Search Results

Search found 1214 results on 49 pages for 'jack sparrow'.

Page 24/49 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >

  • How to move an element in a sorted list and keep the CouchDb write "atomic"

    - by karlthorwald
    I have elements of a list in couchdb documents. Let's say these are 3 elements in 3 documents: { "id" : "783587346", "type" : "aList", "content" : "joey", "sort" : 100.0 } { "id" : "358734ff6", "type" : "aList", "content" : "jill", "sort" : 110.0 } { "id" : "abf587346", "type" : "aList", "content" : "jack", "sort" : 120.0 } A view retrieves all "aList" documents and displays them sorted by "sort". Now I want to move the elements, when I want to move "jack" to the middle, I could do this atomic in one write and change it's sort key to 105.0. The view now returns the documents in the new sort order. After a lot of sorting I could end up with sort keys like 50.99999 and 50.99998 after some years and in extreme situations run out of digits? What can you recommend, is there a better way to do this? I'd rather keep the elements in seperate documents. Different users might edit different elements in parallel (which also can get tricky). Maybe there is a much better way?

    Read the article

  • iPhone OS syntax highlighting UITextField

    - by Jack
    Hi, I am working on an application and would like to apply some syntax highlighting to some user entered text. I have looked around and some people are suggesting that this can be done in OS 3.2+ but posts seem to be from before the NDA was lifted. Does anyone have any suggestions as to how to go about doing this? I would be interested in releasing the code on github if I could get it implemented well, as I have never done so before. Thanks

    Read the article

  • PHP: Need help with simple XML

    - by Jack
    I am beginner in PHP. I am trying to parse this xml file. <relationship> <target> <following type="boolean">true</following> <followed_by type="boolean">true</followed_by> <screen_name>xxxx</screen_name> <id type="integer">xxxx</id> </target> <source> <notifications_enabled nil="true"/> <following type="boolean">true</following> <blocking nil="true"/> <followed_by type="boolean">true</followed_by> <screen_name>xxxx</screen_name> <id type="integer">xxxxx</id> </source> </relationship> I need to get the value of the field 'following type="boolean" ' for the target and here's my code - $xml = simplexml_load_string($response); foreach($xml->children() as $child) { if ($child->getName() == 'target') { foreach($child->children() as $child_1) if ( $child_1->getName() == 'following') { $is_my_friend = (bool)$child_1; break; } break; } } but I am not getting the correct output. I think the ' type="boolean" ' part of the field is creating problems. Please help.

    Read the article

  • RoR: Replace_html with partial and collection not functioning

    - by Jack
    I am trying to create a tabbed interface using the prototype helper method "replace_html." I have three different partials I am working with. The first one is the 'main tab' and it is loaded automatically like so: <div id = "grid"> <% things_today = things.find_things_today %> <%= render :partial => "/todaything", :collection => things_today, :as =>:thing %> </div> ...which works fine. Similarly, I have a _tomorrowthing partial which would replace the content in the 'grid' div like so: <%things_tomorrow = things.find_things_tomorrow%> <%= link_to_function('Tomorrow',nil, :id=>'tab') do |page| page.replace_html 'grid' , :partial => '/tomorrowthing',:collection => things_tomorrow, :as => :thing end %> If I click on this tab nothing happens at all. Using firebug, the only errors I find are a missing ) after argument list which is contained in the Element.update block where the link_to_function is called. What am I doing wrong?

    Read the article

  • Accessing Linq data in telerik grid ItemCreated method

    - by Jack
    Not sure if the title of this question makes sense, but here's my problem: I have a telerik grid bound to a Linq data object, however, I limit the fields returned: <IQueryable>filter = data.Select(x => new {x.ID, x.Name, x.Age}); I would like to access these fields in the ItemCreated method of the grid: protected void rgPeople_ItemCreated(object sender, GridItemEventArgs e) { Telerik.Web.UI.GridDataItem item = (GridDataItem)e.Item; ?????? Person = (???????)e.Item.DataItem; } What do I declare ?????? as so that I can use: String ID = Person.ID; String Name = Person.Name; etc

    Read the article

  • Navigating the Content Assist List in Eclipse

    - by Jack
    Here are the ways the Eclipse documentation states you can navigate the Content Assist list: You can use the mouse or the keyboard (Up Arrow, Down Arrow, Page Up, Page Down, Home, End, Enter) to navigate and select lines in the list. But all of the options require you to move your hands significantly away from their natural place on the keyboard! Are there any other, quicker ways I can navigate this list? Something like tab, or the j/k from vi?

    Read the article

  • Consolidate the same image used multiple times in a PDF.

    - by Jack
    I am generating PDF documents using DevExpress XtraReports. I am using the same image over and over (in rows of status lights). The PDF generated seems to duplicate the image definition for each image included. I would prefer if it included the image once and referenced it wherever it needed another copy - this would drastically reduce the size of my PDF docs. Is there any way to achieve this using DevExpress or even post processed via a third party application. Any help is appreciated.

    Read the article

  • warning: returning reference to temporary

    - by Jack
    I have a function like this const string &SomeClass::Foo(int Value) { if (Value < 0 or Value > 10) return ""; else return SomeClass::StaticMember[i]; } I get warning: returning reference to temporary. Why is that? I thought the both values the function returns (reference to const char* "" and reference to a static member) cannot be temporary.

    Read the article

  • How to REALLY focus a link using jQuery / javascript

    - by Bobby Jack
    Calling the jQuery focus() method on a link appears to only partially focus the link. Whilst the link has focus to the extent that pressing ENTER follows the link, it doesn't take on the default outline styling (or adopt any styling set via the :focus pseudo-class), nor is the tab-order correctly 'entered'. Any ideas on how to resolve this? (results observed in Firefox 3.6.2)

    Read the article

  • How to retrieve the GUID for Yahoo's Contacts API

    - by Jack Marchetti
    I'm attemping to use the Yahoo Contacts API to add an "invite your friends" feature on a site I'm building. I've found the correct web service to call (http://social.yahooapis.com/v1/user/{guid}/contacts) but it is asking for the user's GUID, not their username/password. I've searched, and am unable to find a "lookup" feature through the Yahoo API which lets me get the user's guid from their username/password. Does anyone have any experience with the Contacts API. I've reaad over the documentation, and looked at YQL as well, but I still haven't found how to get the user's guid. Thanks guys.

    Read the article

  • How to bind an ip address to telnetlib in Python

    - by jack
    The code below binds an ip address to urllib, urllib2, etc. import socket true_socket = socket.socket def bound_socket(*a, **k): sock = true_socket(*a, **k) sock.bind((sourceIP, 0)) return sock socket.socket = bound_socket Is it also able to bind an ip address to telnetlib?

    Read the article

  • Diamond problem in C++

    - by Jack
    I know the diamond problem. I am using gcc compiler. I have some scenarios I need explanation about. 1) class A{ public: virtual void eat(){cout<<"A eat\n";} }; class B:public A{ public: void eat(){ cout<<"B eat\n";}}; class C:public A{ public: void eat(){ cout<<"C eat\n";}}; class D:public B,C{ public: void eat(){ cout<<"D eat\n";}}; int main() { A * a = new D(); a->eat(); getch(); return 0; } Why doesn't this work? 2) class A{ public: void eat(){cout<<"A eat\n";} }; class B:virtual public A{ public: void eat(){ cout<<"B eat\n";}}; class C:virtual public A{ public: void eat(){ cout<<"C eat\n";}}; class D: public B,C{ public: void eat(){ cout<<"D eat\n";}}; int main() { A * a = new D(); a->eat(); getch(); return 0; } When I do this what happens in the background. How does the ambiguity get removed. Is the concept of vtables involved here?

    Read the article

  • .Net Logger (Write your own vs log4net/enterprise logger/nlog etc.)

    - by Jack
    I work for an IT department with about 50+ developers. It used to be about 100+ developers but was cut because of the recession. When our department was bigger there was an ambitious effort made to set up a special architecture group. One thing this group decided to do was create our own internal logger. They thought it was such a simple task that we could spend recources and do it ourselves. Now we are having issues with performance and difficulty viewing the logs generated and some employees are frustrated that we are spending recources on infrastructure stuff like this instead of focusing on serving our business and using stuff that already exists like log4net or Enterprise Logger. Can you assist me in listing up reasons why you should not create your own .net logger. Also reasons for why you should are welcome to get a fair point of view :)

    Read the article

  • Website in right-to-left languages (Arabic, Hebrew)

    - by jack
    I currently developing a multi-language interface for a Django project. But when I started to work on Arabic and Hebrew languages, I noticed all pages messed up after dir="rtl" to html tag (according to instructions on http://www.w3.org/International/tutorials/bidi-xhtml/) Does that mean I need separate stylesheets for right-to-left languages?

    Read the article

  • Tweeple some general questions about twitter

    - by Jack
    1) If I tweet to someone who is not my friend/follower does he receive my tweets? What if I select 'protect my tweets' option in my profile? 2) Can someone who is not my friend/follower send me a tweet? What if I select 'protect my tweets' option in my profile?

    Read the article

  • Resizing image to fit its container

    - by jack moore
    #foo {width: 300px; height: 400px; overflow: hidden;} <div id="foo"></div> this.someimage = randomImageUrl; $("foo").innerHTML = "<img src='"+this.someimage+"' class='fooimage' />"; Now, the picture could be 200x200 or 1100x400 ... it's totally random. I can just stretch it (or reduce its size) by using: .fooimage {width: 300px; height: 400px;} $("foo").innerHTML = "<img src='"+this.someimage+"' class='fooimage' />"; Or I could test its size: imgHeight = newImg.height; imgWidth = newImg.width; ... and maybe something like this: if(imgHeight >400){ $("foo").innerHTML = "<img src='"+this.someimage+"' height='400' />"; } and browsers will do the rest. But there must be something better. Any ideas? Thanks! :)

    Read the article

  • Really frustrated: Help writing a sample twitter app

    - by Jack
    I have installed WAMP. I have enable cURL in php.ini. I want to implement a twitter app that posts a new status message for a user. Here's my code <?php function updateTwitter($status) { $username = 'xxxxxx'; $password = 'xxxx'; $url = 'http://twitter.com/statuses/update.xml'; $postargs = 'status='.urlencode($status); $responseInfo=array(); $ch = curl_init($url); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 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) $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"); ?> I am getting the following output Operation completed without any errors Error: 404 Please help.

    Read the article

  • Iphone & Web App synch

    - by Jack Welsh
    I am trying to build an Iphone App client for our CRM solution so our sales people would be able to access the information available in our CRM through an Iphone App. I am trying to find out what is the recommended approach to architect the application when it comes to the database. I am not sure where should the data reside, should I save a subset of the data on the iPhone, or should I just rely on webservices and pull the information I need from the database whenever I need it. Also, is there any best practices or frameworks to build such applications on the Iphone.

    Read the article

  • C Run-Time library part 2

    - by b-gen-jack-o-neill
    Hi, I was suggested when I have some further questions on my older ones, to create newer Question and reffer to old one. So, this is the original question: What is the C runtime library? OK, from your answers, I now get thet statically linked libraries are Microsoft implementation of C standart functions. Now: If I get it right, the scheme would be as follow: I want to use printf(), so I must include which just tels compiler there us functio printf() with these parameters. Now, when I compile code, becouse printf() is defined in C Standart Library, and becouse Microsoft decided to name it C Run Time library, it gets automatically statically linked from libcmt.lib (if libcmt.lib is set in compiler) at compile time. I ask, becouse on wikipedia, in article about runtime library there is that runtime library is linked in runtime, but .lib files are linked at compile time, am I right? Now, what confuses me. There is .dll version of C standart library. But I thought that to link .dll file, you must actually call winapi program to load that library. So, how can be these functions dynamically linked, if there is no static library to provide code to tell Windows to load desired functions from dll? And really last question on this subject - are C Standart library functions also calls to winapi even they are not .dll files like more advanced WinAPI functions? I mean, in the end to access framebuffer and print something you must tell Windows to do it, since OS cannot let you directly manipulate HW. I think of it like the OS must be written to support all C standart library functions same way across similiar versions, since they are statically linked, and can differently support more complex WinAPI calls becouse new version of OS can have adjustements in the .dll file.

    Read the article

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