Search Results

Search found 4 results on 1 pages for 'lazyweb'.

Page 1/1 | 1 

  • "Microsoft DNS Client" vs. getaddrinfo?

    - by Josh K
    Right now, my application is using the c-ares asynchronous DNS resolver library on Windows below cURL, and I have users complaining that it behaves differently from other windows apps. One particular user said that "other applications are using the Microsoft DNS client" and experiences no problems. cURL itself has an asynchronous DNS implementation that uses getaddrinfo() in a thread. My guess is that would be equivalent behavior to using the "DNS Client" and its host of functions (e.g. DnsQuery?) So, dear Lazyweb, I ask if there is a tangible difference between the behavior of getaddrinfo() vs. using the actual Dns* APIs from the Win32 API.

    Read the article

  • Python Twitter library: which one?

    - by Parand
    I realize this is a bit of a lazyweb question, but I wanted to see which python library for Twitter people have had good experiences with. I've used Python Twitter Tools and like its brevity and beauty of interface, but it doesn't seem to be one of the popular ones - it's not even listed on the Twitter Libraries page. There are, however, plenty of others listed: oauth-python-twitter2 by Konpaku Kogasa. Combines python-twitter and oauth-python-twitter to create an evolved OAuth Pokemon. python-twitter by DeWitt Clinton. This library provides a pure Python interface for the Twitter API. python-twyt by Andrew Price. BSD licensed Twitter API interface library and command line client. twitty-twister by Dustin Sallings. A Twisted interface to Twitter. twython by Ryan McGrath. REST and Search library inspired by python-twitter. Tweepy by Josh Roesslein. Supports OAuth, Search API, Streaming API. My requirements are fairly simple: Be able to use OAuth Be able to follow a user Be able to send a direct message Be able to post Streaming API would be nice Twisted one aside (I'm not using twisted in this case), have you used any of the others, and if so, do you recommend them? [Update] FWIW, I ended up going with Python Twitter Tools again. The new version supported OAuth nicely, and it's a very clever API, so I stuck to it.

    Read the article

  • Weird XPath behavior in libxml2

    - by Josh K
    I have this XML tree that looks like this (I've changed the tag names but if you're really clever you may figure out what I'm actually doing.) <ListOfThings> <Thing foo:action="add"> <Bar>doStuff --slowly</Bar> <Index>1</Index> </Thing> <Thing foo:action="add"> <Bar>ping yourMother.net</Bar> <Index>2</Index> </Thing> </ListOfThings> With libxml2, I want to programmatically insert a new Thing tag into the ListOfThings with the Index being the highest current index, plus one. I do it like this (sanity checking removed for brevity): xpath = "//urn:myformat[@foo='bar']/" "urn:mysection[@name='baz']/" "urn:ListOfThings/urn:Thing/urn:Index"; xpathObj = xmlXPathEvalExpression(xpath, xpathCtx); nodes = xpathObj->nodesetval; /* Find last value and snarf the value of the tag */ highest = atoi(nodes->nodeTab[nodes->nodeNr - 1]->children->content); snprintf(order, sizeof(order), "%d", highest + 1); /* highest index plus one */ /* now move up two levels.. */ cmdRoot = nodes->nodeTab[nodes->nodeNr - 1]; ASSERT(cmdRoot->parent && cmdRoot->parent->parent); cmdRoot = cmdRoot->parent->parent; /* build the child tag */ newTag = xmlNewNode(NULL, "Thing"); xmlSetProp(newTag, "foo:action", "add"); /* set new node values */ xmlNewTextChild(newTag, NULL, "Bar", command); xmlNewChild(newTag, NULL, "Index", order); /* append this to cmdRoot */ xmlAddChild(cmdRoot, newTag); But if I call this function twice (to add two Things), the XPath expression doesn't catch the new entry I made. Is there a function I need to call to kick XPath in the shins and get it to make sure it really looks over the whole xmlDocPtr again? It clearly does get added to the document, because when I save it, I get the new tags I added. To be clear, the output looks like this: <ListOfThings> <Thing foo:action="add"> <Bar>doStuff --slowly</Bar> <Index>1</Index> </Thing> <Thing foo:action="add"> <Bar>ping yourMother.net</Bar> <Index>2</Index> </Thing> <Thing foo:action="add"> <Bar>newCommand1</Bar> <Index>3</Index> </Thing> <Thing foo:action="add"> <Bar>newCommand2</Bar> <Index>3</Index> <!-- this is WRONG! --> </Thing> </ListOfThings> I used a debugger to check what happened after xmlXPathEvalExpression got called and I saw that nodes->nodeNr was the same each time. Help me, lazyweb, you're my only hope!

    Read the article

1