Search Results

Search found 1226 results on 50 pages for 'jack flynn'.

Page 26/50 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • Sample twitter application

    - by Jack
    I have installed WAMP and running PHP scripts on localhost. I have enabled cURL. Here is my code. <?php function updateTwitter($status) { // Twitter login information $username = 'xxxxx'; $password = 'xxxxx'; // The url of the update function $url = 'http://twitter.com/statuses/update.xml'; // Arguments we are posting to Twitter $postargs = 'status='.urlencode($status); // Will store the response we get from Twitter $responseInfo=array(); // Initialize CURL $ch = curl_init($url); // Tell CURL we are doing a POST curl_setopt($ch, CURLOPT_PROXY,"localhost:80"); curl_setopt ($ch, CURLOPT_POST, true); // Give CURL the arguments in the POST curl_setopt ($ch, CURLOPT_POSTFIELDS, $postargs); // Set the username and password in the CURL call curl_setopt($ch, CURLOPT_USERPWD, $username.':'.$password); // Set some cur flags (not too important) curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_NOBODY, 0); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // execute the CURL call $response = curl_exec($ch); if($response === false) { echo 'Curl error: ' . curl_error($ch); } else { echo 'Operation completed without any errors<br/>'; } // Get information about the response $responseInfo=curl_getinfo($ch); // Close the CURL connection curl_close($ch); // Make sure we received a response from Twitter if(intval($responseInfo['http_code'])==200){ // Display the response from Twitter echo $response; }else{ // Something went wrong echo "Error: " . $responseInfo['http_code']; } curl_close($ch); } updateTwitter("Just finished a sweet tutorial on http://brandontreb.com"); ?> Here's my output Operation completed without any errors Error: 404 Here's what error 404 means 404 Not Found: The URI requested is invalid or the resource requested, such as a user, does not exists. Please help.

    Read the article

  • Adding metadata attributes to MySQL table

    - by Jack
    I would like to add custom attributes to a MySQL table which I can read via php. These attributes are not to interfere with the table itself - they are primarily accessed by php code during code generation time and these attributes HAVE to reside in the DB itself. Something similar in concept to .NET reflection. Does MySQL support anything like this? Thanks.

    Read the article

  • C# XAML get new width and height for Canvas

    - by Jack Navarro
    I have searched through many times but have not seen this before. Probably really simple question but can't wrap my head around it. Wrote a VSTO add-in for Excel that draws a Grid dynamically. Then launches a new window and replaces the contents of the Canvas with the generated Grid. The problem is with printing. When I call the print procedure the canvas.height and canvas.width returned is the old value prior to replacing it with the grid. Sample: string="<Grid Name=\"CanvasGrid\" xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">..Lots of stuff..</Grid>"; // Launch new window and replace the Canvas element WpfUserControl newWindow = new WpfUserControl(); newWindow.Show(); //To test MessageBox.Show(myCanvas.ActualWidth.ToString()); //return 894 Grid testGrid = myCanvas.FindName("CanvasGrid") as Grid; MessageBox.Show("Grid " + testGrid.ActualWidth.ToString()); //return 234 StringReader stringReader = new StringReader(LssAllcChrt); XmlReader xmlReader = XmlReader.Create(stringReader); Canvas myCanvas = newWindow.FindName("GrphCnvs") as Canvas; myCanvas.Children.Clear(); myCanvas.Children.Add((UIElement)XamlReader.Load(xmlReader)); //To test MessageBox.Show(myCanvas.ActualWidth.ToString()); //return 894 but should be much larger the Grid spans all three of my screens Grid testGrid = myCanvas.FindName("CanvasGrid") as Grid; MessageBox.Show("Grid " + testGrid.ActualWidth.ToString()); //return 234 but should be much larger the Grid spans all three of my screens //Run code from WpfUserControl.cs after it loads from button click Grid testGrid = canvas.FindName("CanvasGrid") as Grid; MessageBox.Show("Grid " + testGrid.ActualWidth.ToString()); //return 234 but should be much larger the Grid spans all three of my screens So basically I have no way of telling what my new width and height are Any Ideas

    Read the article

  • Wcf inhereted models

    - by jack london
    [DataContract] Base { [DataMember] public int Id {get;set;} } [DataContract] A : Base { [DataMember] public string Value {get;set;} } [ServiceContract] interface IService { [OperationContract] void SetValue (Base base); } is there a way to use the service like the following style: new Service ().SetValue (new A ());

    Read the article

  • Django's logout function remove locale settings

    - by jack
    When I use Django's logout function to log out an authenticated user, it switched locale to en_US, the default one. from django.contrib.auth import logout def someview(request): logout(request) return HttpResponseRedirect('/') How to keep user's locale after logged out?

    Read the article

  • How to set ReceiveBufferSize for UDPClient? or Does it make sense to set? C#

    - by Jack
    Hello all. I am implementing a UDP data transfer thing. I have several questions about UDP buffer. I am using UDPClient to do the UDP send / receive. and my broadband bandwidth is 150KB/s (bytes/s, not bps). I send out a 500B datagram out to 27 hosts 27 hosts send back 10KB datagram back if they receive. So, I should receive 27 responses, right? however, I only get averagely 8 - 12 instead. I then tried to reduce the size of the response down to 500B, yes, I receive all. A thought of mine is that if all 27 hosts send back 10KB response at almost same time, the incoming traffic will be 270KB/s (likely), that exceeds my incoming bandwidth so loss happens. Am I right? But I think even if the incoming traffic exceeds the bandwidth, is the Windows supposed to put the datagram in the buffer and wait for receive? I then suspect that maybe the ReceiveBufferSize of my UdpClient is too small? by default, it is 8092B?? I don't know whether I am all right at these points. Please give me some help.

    Read the article

  • Setting variables in shell script by running commands

    - by rajya vardhan
    >cat /tmp/list1 john jack >cat /tmp/list2 smith taylor It is guaranteed that list1 and list2 will have equal number of lines. f(){ i=1 while read line do var1 = `sed -n '$ip' /tmp/list1` var2 = `sed -n '$ip' /tmp/list2` echo $i,$var1,$var2 i=`expr $i+1` echo $i,$var1,$var2 done < $INFILE } So output of f() should be: 1,john,smith 2,jack,taylor But getting 1,p,p 1+1,p,p If i replace following: var1 = `sed -n '$ip' /tmp/list1` var2 = `sed -n '$ip' /tmp/list2` with this: var1=`head -$i /tmp/vip_list|tail -1` var2=`head -$i /tmp/lb_list|tail -1` Then output: 1,john,smith 1,john,smith Not an expert of shell, so please excuse if sounds childish :)

    Read the article

  • Optional Argument: compile time constant issue

    - by Jack
    Why is this working: public int DoesEmailAddressExistsExcludingEmailAddressID( string emailAddress, string invitationCode, int emailAddressID = 0, int For = (int) Enums.FOR.AC) whereas this doesn't public int DoesEmailAddressExistsExcludingEmailAddressID( string emailAddress, string invitationCode, int emailAddressID = 0, int For = Enums.FOR.AC.GetHashCode()) where AC is enum. Can enums's hashcode change at runtime?

    Read the article

  • String tokenizer for PHP

    - by Jack
    I have used the String Tokenizer in Java. I wish to know if there is similar functionality for PHP. I have a string and I want to extract individual words from it. eg. If the string is - Summer is doubtful #haiku #poetry #babel I want to know if it contains the hashtag #haiku.

    Read the article

  • Variable width columns in a table

    - by Jack
    I'm using an HTML table for a calendar and I want to fill the cells with various events from my database. Usually they will land on weekends but some will run for long weekend, bank holidays or even the odd week day. How can I get my tables columns to expand and shrink accordingly. I'd like to avoid the use of javascript if possible. If this can't be done I'm going to need a tutorial to help me get my head around how to make div's positioning behave. cheers

    Read the article

  • sharepoint: editing webpart caml

    - by Jack
    I added this code to my sharepoint content query web part, which is looking at an events list from my calender, .webpart file in order to only show recurring events within the next month and regular events within the next month. However, I can't get the web part imported and working. Also is there any way to replace <Month /> with a range like <Today:Today OffsetDays="30"/> except with valid code? Here is the code: <property name="QueryOverride" type="string"> <Where> <Or> <And> <Neq> <FieldRef Name="FRecurrence"/> <Value Type="Recurrance">1</Value> </Neq> <And> <Lt> <FieldRef Name="EventDate" Type="DateTime"/> <Value Type="DateTime"><Today OffsetDays="30"/></Value> </Lt> <Gt> <FieldRef Name="EventDate" Type="DateTime"/> <Value Type="DateTime"><Today /></Value> </Gt> </And> </And> <DataRangesOverlap> <FieldRef Name="EventDate" /> <FieldRef Name="EndDate" /> <FieldRef Name="RecirrenceId" /> <Value Type="DateTime"><Month /></Value> </DataRangesOverlap> </Or> </Where> </property> When I upload this I get "Unable to add selected web part(s). The file format is not valid" and when I add <![CDATA[ and ]]> I can import it but the query doesn't return anything. How can I get this to work?

    Read the article

  • Methods : Make my method with many input variables with out overloading

    - by Jack Jon
    is there Any Way To Make my Method Take many input variable but with out overloading ... could be my question not clear ... I mean Like That : if I Have This Method public void setValues (int val1,int val2 ,String val3){ } what I want is : use this method with many way setValues (val1,val2) OR setValues (val3) why I want to do that with out overloading : Because if i have as example 10 variable i want to add many method with overloading but i don't like that ... is there any way helps me to check variable or skip it in the same method .. Thanks for help .

    Read the article

  • MySQL slow queries

    - by jack
    The MySQL slow query log often shows a bunch of following entries in sequence. SET timestamp=1268999330; commit; # User@Host: username[username] @ localhost [] # Query_time: 4.172700 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0 SET timestamp=1268999330; commit; # User@Host: username[username] @ localhost [] # Query_time: 3.628924 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0 SET timestamp=1268999330; commit; # User@Host: username[username] @ localhost [] # Query_time: 3.116018 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0 ... Usually 6-7 "commit" queries in sequence. Anyone what they are and what's the preceding query of each of them? Thanks in advance.

    Read the article

  • Are programming languages and methods inefficient? (assembler and C knowledge needed)

    - by b-gen-jack-o-neill
    Hi, for a long time, I am thinking and studying output of C language compiler in assembler form, as well as CPU architecture. I know this may be silly to you, but it seems to me that something is very ineffective. Please, don´t be angry if I am wrong, and there is some reason I do not see for all these principles. I will be very glad if you tell me why is it designed this way. I actually truly believe I am wrong, I know the genius minds of people which get PCs together knew a reason to do so. What exactly, do you ask? I´ll tell you right away, I use C as a example: 1: Stack local scope memory allocation: So, typical local memory allocation uses stack. Just copy esp to ebp and than allocate all the memory via ebp. OK, I would understand this if you explicitly need allocate RAM by default stack values, but if I do understand it correctly, modern OS use paging as a translation layer between application and physical RAM, when address you desire is further translated before reaching actual RAM byte. So why don´t just say 0x00000000 is int a,0x00000004 is int b and so? And access them just by mov 0x00000000,#10? Because you wont actually access memory blocks 0x00000000 and 0x00000004 but those your OS set the paging tables to. Actually, since memory allocation by ebp and esp use indirect addressing, "my" way would be even faster. 2: Variable allocation duplicity: When you run application, Loader load its code into RAM. When you create variable, or string, compiler generates code that pushes these values on the top o stack when created in main. So there is actual instruction for do so, and that actual number in memory. So, there are 2 entries of the same value in RAM. One in form of instruction, second in form of actual bytes in the RAM. But why? Why not to just when declaring variable count at which memory block it would be, than when used, just insert this memory location?

    Read the article

  • Matching of tuples

    - by Jack
    From what I understood I can use pattern-matching in a match ... with expression with tuples of values, so something like match b with ("<", val) -> if v < val then true else false | ("<=", val) -> if v <= val then true else false should be correct but it gives me a syntax error as if the parenthesis couldn't be used: File "ocaml.ml", line 41, characters 14-17: Error: Syntax error: ')' expected File "ocaml.ml", line 41, characters 8-9: Error: This '(' might be unmatched referring on first match clause.. Apart from that, can I avoid matching strings and applying comparisons using a sort of eval of the string? Or using directly the comparison operator as the first element of the tuple?

    Read the article

  • Repeatedly querying xml using python

    - by Jack
    I have some xml documents I need to run queries on. I've created some python scripts (using ElementTree) to do this, since I'm vaguely familiar with using it. The way it works is I run the scripts several times with different arguments, depending on what I want to find out. These files can be relatively large (10MB+) and so it takes rather a long time to parse them. On my system, just running: tree = ElementTree.parse(document) takes around 30 seconds, with a subsequent findall query only adding around a second to that. Seeing as the way I'm doing this requires me to repeatedly parse the file, I was wondering if there was some sort of caching mechanism I can use so that the ElementTree.parse computation can be reduced on subsequent queries. I realise the smart thing to do here may be to try and batch as many queries as possible together in the python script, but I was hoping there might be another way. Thanks.

    Read the article

  • Problem with PHP/Java bridge.

    - by Jack
    I am using Tomcat 6. I am running a php script using the JavaBridge. I get the following error when I run my code. Fatal error: Call to undefined function mysqli_connect() in C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\xxxx\xxxxx.php on line 534 Please help.

    Read the article

  • Free or open source dictionaries

    - by jack
    I'm working on a multi-lingual search engine. I need to map keywords in English to corresponding words in following languages: Bulgarian Catalan Chinese Crotian Czech Danish Dutch Finish French German Greek Hungarian Italian Japanese Korean Lithuanian Litvian Norwegian Polish Portuguese Romanian Russian Slovak Slovenian Spanish Swedish Thai Ukrainian Vietnamese I already known eudict and stardict. Could you recommend some other free or open source dictionaries cover one or more above languages?

    Read the article

  • Dynamic select menu Rails, Javascript HABTM

    - by Jack
    Hi, I am following a tutorial in one of Ryan Bates' Railscasts here. Basically I want a form where there are 2 drop down menus, the contents of one are dependent on the other. I have Years and Courses, where Years HABMT Courses and Courses HABTM Years. In the tutorial, the javascript is as follows: var states = new Array(); <% for state in @states -%> states.push(new Array(<%= state.country_id %>, '<%=h state.name %>', <%= state.id %>)); <% end -%> function countrySelected() { country_id = $('person_country_id').getValue(); options = $('person_state_id').options; options.length = 1; states.each(function(state) { if (state[0] == country_id) { options[options.length] = new Option(state[1], state[2]); } }); if (options.length == 1) { $('state_field').hide(); } else { $('state_field').show(); } } document.observe('dom:loaded', function() { countrySelected(); $('person_country_id').observe('change', countrySelected); }); Where I guess country has many states and state belongs to country. I think what I need to do is edit the first for statement to somehow loop through all of the courses for each year_id, but don't know how to do this. Any ideas? Thanks

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >