qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
303,371
<p>I've used boost serialization but this doesn't appear to allow me to generate xml that conforms to a particular schema -- it seems it's purpose was to just to persist a class's state.</p> <p>Platform: linux</p> <p>What do you guys use to generate NOT parse xml?</p> <p>So far I'm going down Foredecker's route of j...
[ { "answer_id": 303724, "author": "MattyT", "author_id": 7405, "author_profile": "https://Stackoverflow.com/users/7405", "pm_score": 6, "selected": false, "text": "Document doc;\nNode* root(doc.InsertEndChild(Element(\"RootNode\")));\nElement measurements(\"measurements\");\nElement tbr(\...
2008/11/19
[ "https://Stackoverflow.com/questions/303371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39110/" ]
303,397
<p>I have designed a xml schema to parse an incoming xml document. The receive location gets xml documents from 2 feeds, one of them has misspelled a node in the document, "Roookie" instead of "Rookie", Is there a way to have my existing xsd parse this document?</p>
[ { "answer_id": 303438, "author": "phihag", "author_id": 35070, "author_profile": "https://Stackoverflow.com/users/35070", "pm_score": 2, "selected": false, "text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<xsl:stylesheet version=\"2.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transfor...
2008/11/19
[ "https://Stackoverflow.com/questions/303397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1443363/" ]
303,404
<p>If I have records:</p> <pre> Row Date, LocationID, Account 1 Jan 1, 2008 1 1000 2 Jan 2, 2008 1 1000 3 Jan 3, 2008 2 1001 4 Jan 3, 2008 1 1001 5 Jan 3, 2008 3 1001 6 Jan 4, 2008 3 1002 </pre> <p>I need to get the row (<code...
[ { "answer_id": 303421, "author": "Tony Andrews", "author_id": 18747, "author_profile": "https://Stackoverflow.com/users/18747", "pm_score": 0, "selected": false, "text": "select *\nfrom mytable t1\nwhere date = (select max(date) from mytable t2\n where t2.location = t1.locat...
2008/11/19
[ "https://Stackoverflow.com/questions/303404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9266/" ]
303,405
<p>I have an API call in my application where I am checking the time taken for a single call. I have put this in a FOR loop and using 10000 calls to get the average times of all calls. Now the issue which came up was that the actual application using the API, is multi-threaded. If I wish to make my application also do ...
[ { "answer_id": 10769819, "author": "betabandido", "author_id": 1135819, "author_profile": "https://Stackoverflow.com/users/1135819", "pm_score": 0, "selected": false, "text": "std::thread" } ]
2008/11/19
[ "https://Stackoverflow.com/questions/303405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35416/" ]
303,417
<p>I found that SQL stored procedures are very interesting and useful. I have written stored procedures but i want to write well crafted, good performance tuned and concise SPs for any sort of requirement and also would love to learn about any tricks or good practices for stored procedures. How do i move from the begin...
[ { "answer_id": 303462, "author": "Cade Roux", "author_id": 18255, "author_profile": "https://Stackoverflow.com/users/18255", "pm_score": 4, "selected": false, "text": "/*\n Usage:\n EXEC usp_ThisProc @Param1 = 1, @Param2 = 2\n*/\n" }, { "answer_id": 303819, "author": "H...
2008/11/19
[ "https://Stackoverflow.com/questions/303417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3113/" ]
303,440
<p>I'm working on a idea where my a:link have one state (blue, no underline etc) with a a:hover being white. I want my <strong>visited links to have the same state</strong> as <code>a:link</code> and <code>a:hover</code>. Is this possible? supported in most common browsers?</p>
[ { "answer_id": 303447, "author": "Marc Charbonneau", "author_id": 35136, "author_profile": "https://Stackoverflow.com/users/35136", "pm_score": 1, "selected": false, "text": "a\n{\n color:#6c7492;\n font-weight:bold;\n text-decoration:none;\n}\na:hover\n{\n border-bottom:1px ...
2008/11/19
[ "https://Stackoverflow.com/questions/303440", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
303,460
<p>Greetings!</p> <p>I'm creating a User Control that will display data in a GridView control. We are using n-tier architecture and the data in question is retrieved from our database and returned to us as a ReadOnlyCollection. OurNewObject is a class containing several properties and an empty constructor that takes...
[ { "answer_id": 303506, "author": "Mitchel Sellers", "author_id": 13279, "author_profile": "https://Stackoverflow.com/users/13279", "pm_score": 1, "selected": true, "text": "[System.ComponentModel.DataObjectMethodAttribute\n (System.ComponentModel.DataObjectMethodType.Select, true)]\n ...
2008/11/19
[ "https://Stackoverflow.com/questions/303460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27870/" ]
303,488
<p>In through <code>php_info()</code> where the WSDL cache is held (<code>/tmp</code>), but I don't necessarily know if it is safe to delete all files starting with WSDL. </p> <p>Yes, I <em>should</em> be able to just delete everything from <code>/tmp</code>, but I don't know what else this could effect if I delete an...
[ { "answer_id": 303514, "author": "Owen", "author_id": 4853, "author_profile": "https://Stackoverflow.com/users/4853", "pm_score": 9, "selected": true, "text": "ini_set(\"soap.wsdl_cache_enabled\", 0);\n $client = new SoapClient('http://somewhere.com/?wsdl', array('cache_wsdl' => WSDL_CAC...
2008/11/19
[ "https://Stackoverflow.com/questions/303488", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8880/" ]
303,502
<p>I ran across this and was wondering if someone could explain why this works in VB.NET when I would expect it should fail, just like it does in C#</p> <pre><code>//The C# Version struct Person { public string name; } ... Person someone = null; //Nope! Can't do that!! Person? someoneElse = null; //No problem, ju...
[ { "answer_id": 303525, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 4, "selected": false, "text": "Nothing default(T) Nothing" }, { "answer_id": 17376576, "author": "piBoss", "author_id": 826297, "au...
2008/11/19
[ "https://Stackoverflow.com/questions/303502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17091/" ]
303,510
<p>My XML (<strong>a.xhtml</strong>) starts like this</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; ... </code></pre> <p>My code starts like this</p> <pre><code>use XML::XPath; use XML::XPath::XMLParser; my $xp = XML...
[ { "answer_id": 304842, "author": "mirod", "author_id": 11095, "author_profile": "https://Stackoverflow.com/users/11095", "pm_score": 5, "selected": true, "text": "my $p = XML::Parser->new( NoLWP => 1);\nmy $xp= XML::XPath->new( parser => $p, filename => \"a.xhtml\");\n" }, { "ans...
2008/11/19
[ "https://Stackoverflow.com/questions/303510", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24349/" ]
303,511
<p>I'm setting up CruiseControl.NET and during the build I want to modify my version.txt file and have it checked in. When I do this, CruiseControl.NET doesn't know this checkin was done by the build and so the next time it checks sources, it sees there were modifications and rebuilds again (I have IfModificationExist...
[ { "answer_id": 303665, "author": "g .", "author_id": 6944, "author_profile": "https://Stackoverflow.com/users/6944", "pm_score": 4, "selected": true, "text": "<sourcecontrol type=\"filtered\">\n <sourceControlProvider type=\"svn\">\n ... \n </sourceControlProvider>\n ...
2008/11/19
[ "https://Stackoverflow.com/questions/303511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
303,512
<p>It seems like Groovy was forgotten in this thread so I'll just ask the same question for Groovy.</p> <ul> <li>Try to limit answers to Groovy core</li> <li>One feature per answer</li> <li>Give an example and short description of the feature, not just a link to documentation</li> <li>Label the feature using bold titl...
[ { "answer_id": 303561, "author": "Robert Fischer", "author_id": 27561, "author_profile": "https://Stackoverflow.com/users/27561", "pm_score": 5, "selected": false, "text": "def x = [foo:1, bar:{-> println \"Hello, world!\"}]\nx.foo\nx.bar()\n" }, { "answer_id": 303641, "autho...
2008/11/19
[ "https://Stackoverflow.com/questions/303512", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
303,519
<p>someone has an idea how can I do that ?</p> <p>thanks</p>
[ { "answer_id": 303551, "author": "Robert Gamble", "author_id": 25222, "author_profile": "https://Stackoverflow.com/users/25222", "pm_score": 3, "selected": false, "text": "n n" }, { "answer_id": 303610, "author": "Pyrolistical", "author_id": 21838, "author_profile": "...
2008/11/19
[ "https://Stackoverflow.com/questions/303519", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
303,548
<p>I have the following xml that's sent to me from a web service. I'm using .NET to deserialize it, but I'm getting an exception saying that its formatted wrong. <code>There is an error in XML document (2, 2)</code> Now, if I understand that correctly, it's not liking that it's finding the first <code>&lt;error&gt;</...
[ { "answer_id": 303633, "author": "Panos", "author_id": 8049, "author_profile": "https://Stackoverflow.com/users/8049", "pm_score": 2, "selected": true, "text": "<XmlRoot(Namespace:=\"http://www.w3.org/1999/xml\", ElementName:=\"messages\")> _\nPublic Class cResponseMessage\n\n <XmlEle...
2008/11/19
[ "https://Stackoverflow.com/questions/303548", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13611/" ]
303,554
<p>I have a hidden field that i want to bind to either a function on the page's code behind. I don't quite recall the exact syntax and i can't find the answer via Google. Is the code below correct? Thank.</p> <pre><code>print("&lt;asp:HiddenField ID="dummy" Value='&lt;%#Getdummy() %&gt;' runat="server" /&gt;"); </code...
[ { "answer_id": 303663, "author": "WestDiscGolf", "author_id": 33116, "author_profile": "https://Stackoverflow.com/users/33116", "pm_score": 2, "selected": false, "text": "<asp:HiddenField ID=\"hdnId\" runat=\"server\" Value='<%# GetValue() %>'/>\n protected string GetValue()\n{\n retur...
2008/11/19
[ "https://Stackoverflow.com/questions/303554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28647/" ]
303,555
<p>Suppose I have two classes with the same interface:</p> <pre><code>interface ISomeInterface { int foo{get; set;} int bar{get; set;} } class SomeClass : ISomeInterface {} class SomeOtherClass : ISomeInterface {} </code></pre> <p>Suppose I have an instance of ISomeInterface that represents a SomeClass. I...
[ { "answer_id": 303570, "author": "mendicant", "author_id": 1800, "author_profile": "https://Stackoverflow.com/users/1800", "pm_score": 3, "selected": false, "text": " public ISomeInterface CopyValues(ISomeInterface fromSomeClass, ISomeInterface toSomeOtherClass)\n {\n //copy prope...
2008/11/19
[ "https://Stackoverflow.com/questions/303555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2147/" ]
303,562
<p>I'm trying to write a macro that would allow me to do something like: <code>FORMAT(a &lt;&lt; "b" &lt;&lt; c &lt;&lt; d)</code>, and the result would be a string -- the same as creating an ostringstream, inserting <code>a...d</code>, and returning <code>.str()</code>. Something like:</p> <pre><code>string f(){ o...
[ { "answer_id": 303620, "author": "coppro", "author_id": 16855, "author_profile": "https://Stackoverflow.com/users/16855", "pm_score": 2, "selected": false, "text": "operator << (ostream&, char*) const void* using namespace std; #define MAKE_OUTPUT(z, n, data) \\\n BOOST_PP_TUPLE_ELEM(...
2008/11/19
[ "https://Stackoverflow.com/questions/303562", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39132/" ]
303,591
<p>Range intersection is a simple, but non-trivial problem.</p> <p>Its has been answered twice already:</p> <ul> <li><a href="https://stackoverflow.com/questions/224878/find-number-range-intersection">Find number range intersection</a></li> <li><a href="https://stackoverflow.com/questions/143552/comparing-date-ranges...
[ { "answer_id": 303644, "author": "Paul Tomblin", "author_id": 3333, "author_profile": "https://Stackoverflow.com/users/3333", "pm_score": 0, "selected": false, "text": " - if the node range intersects the input range:\n - if it's a leaf node, then add the range to your result list\n...
2008/11/19
[ "https://Stackoverflow.com/questions/303591", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21838/" ]
303,608
<p>I noticed that doxygen uses the graphviz library for creating diagrams. Have you ever used graphviz for generating documentation? Is it worth learning the graphviz for documentation purposes outside the scope of doxygen? Or am I better off to sticking with a standard data modeling package like Visio?</p> <p>I under...
[ { "answer_id": 976801, "author": "Quinn Taylor", "author_id": 120292, "author_profile": "https://Stackoverflow.com/users/120292", "pm_score": 4, "selected": false, "text": "-(NSString*)dotGraphString -(NSString*)dotGraphStringForNode: CHAbstractBinarySearchTree.m dotGraphString" } ]
2008/11/19
[ "https://Stackoverflow.com/questions/303608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22724/" ]
303,611
<p>I originally used WebRequest and WebResponse to sent Http Post Messages. Always I got a response of "OK". The message I post is an XML signed with a certificate in the xml.</p> <p>The composition is this: C# service that is sending to a https website. HTTPS Website on another place that I cant say. HTTPS Local Web...
[ { "answer_id": 15832221, "author": "gradosevic", "author_id": 915320, "author_profile": "https://Stackoverflow.com/users/915320", "pm_score": 1, "selected": false, "text": "request.Proxy = null; request.Credentials = System.Net.CredentialCache.DefaultCredentials;" } ]
2008/11/19
[ "https://Stackoverflow.com/questions/303611", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12924/" ]
303,613
<p>Here are the specs that I'm trying to implement in a nutshell:</p> <p>1) Some Alerts have to be sent on certain events in the application.</p> <p>2) These Alerts have Users subscribe to them.</p> <p>3) And the Users have set their own Notification preferences (e.g. Email and/or SMS).</p> <p>I have not been able ...
[ { "answer_id": 3682691, "author": "simbo1905", "author_id": 329496, "author_profile": "https://Stackoverflow.com/users/329496", "pm_score": 1, "selected": false, "text": "-Dcom.sun.management.jmxremote.port=9999 \n-Dcom.sun.management.jmxremote.authenticate=false \n-Dcom.sun.management.j...
2008/11/19
[ "https://Stackoverflow.com/questions/303613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/325613/" ]
303,625
<p>I've followed the ADAM Step by Step Guide from Microsoft and setup an ADAM instance on my local machine. I'm attempting to authenticate using the "Mary Baker" account, but every time I get a COM exception on the <code>if (entry.Guid != null)</code> line below. The exception states that there's an unknown user name...
[ { "answer_id": 6287693, "author": "Ryan Sweet", "author_id": 79736, "author_profile": "https://Stackoverflow.com/users/79736", "pm_score": 2, "selected": false, "text": "displayName user displayName displayName" }, { "answer_id": 16465582, "author": "Kwex", "author_id": 7...
2008/11/19
[ "https://Stackoverflow.com/questions/303625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26218/" ]
303,639
<p>I'm terrible with regex, but I've had a try and a Google (and even looked in reddit's source) and I'm still stuck so here goes:</p> <p>My aim is to match the following 'codes' and replace them with the HTML tags. It's just the regex I'm stuck with.</p> <pre><code>**bold text** _italic text_ ~hyperlink~ </code></pr...
[ { "answer_id": 303647, "author": "Owen", "author_id": 4853, "author_profile": "https://Stackoverflow.com/users/4853", "pm_score": 3, "selected": true, "text": "\\*\\*(.[^*]*)\\*\\*\n \\*\\* // match two *'s\n(. // match any character\n[^*] // that is not a *\n*) /...
2008/11/19
[ "https://Stackoverflow.com/questions/303639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2025/" ]
303,642
<p>I have written a new custom component derived from TLabel. The component adds some custom drawing to component, but nothing else. When component is painted, everything works fine. But when the redraw is needed (like dragging another window over the component), "label part" works fine but my custom drawing is not pro...
[ { "answer_id": 303899, "author": "Jim McKeeth", "author_id": 255, "author_profile": "https://Stackoverflow.com/users/255", "pm_score": 1, "selected": false, "text": "procedure TMyComponent.MyCustomPaint;\nvar\n rect: TRect;\nbegin\n rect := self.BoundsRect;\n rect.TopLeft := ParentToC...
2008/11/19
[ "https://Stackoverflow.com/questions/303642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7735/" ]
303,656
<p>Our application is an Xbap running in full trust. I have a function similar to this:</p> <pre><code>private void ShowPage(Page page) { NavigationWindow mainWindow = Application.Current.MainWindow as NavigationWindow; mainWindow.Navigate(page); } </code></pre> <p>This works great for browsing inside an ex...
[ { "answer_id": 310022, "author": "Shaun Bowe", "author_id": 1514, "author_profile": "https://Stackoverflow.com/users/1514", "pm_score": 3, "selected": true, "text": "private void ShowPage(Page page)\n{\n NavigationWindow popup = new NavigationWindow(); \n popup.Height = 400;\n ...
2008/11/19
[ "https://Stackoverflow.com/questions/303656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1514/" ]
303,664
<p>I am new to Python, and I'm working on writing some database code using the <code>cx_Oracle</code> module. In the <a href="http://cx-oracle.sourceforge.net/html/module.html" rel="nofollow noreferrer">cx_Oracle documentation</a> they have a code example like this:</p> <pre><code>import sys import cx_Oracle connect...
[ { "answer_id": 303693, "author": "Andrew Beyer", "author_id": 38691, "author_profile": "https://Stackoverflow.com/users/38691", "pm_score": 2, "selected": false, "text": "error" }, { "answer_id": 303697, "author": "ddaa", "author_id": 11549, "author_profile": "https:/...
2008/11/19
[ "https://Stackoverflow.com/questions/303664", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31319/" ]
303,668
<p>Hey I usually run into a situation where I will create a class that should only be instantiated by one or a few classes. In this case I would make its constructor private and make it a friend class to the objects that should be able to instantiate it. For example (in C++):</p> <pre><code>class CFoo { friend cla...
[ { "answer_id": 303680, "author": "g .", "author_id": 6944, "author_profile": "https://Stackoverflow.com/users/6944", "pm_score": 1, "selected": false, "text": "public class CBar\n{\n CBar()\n {\n m_pFoo = new CFoo();\n }\n\n CFoo m_pFoo;\n\n private class CFoo\n ...
2008/11/19
[ "https://Stackoverflow.com/questions/303668", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13115/" ]
303,679
<p>I would like to search my table having a column of first names and a column of last names. I currently accept a search term from a field and compare it against both columns, one at a time with </p> <pre><code> select * from table where first_name like '%$search_term%' or last_name like '%$search_term%'; </...
[ { "answer_id": 303730, "author": "Jack", "author_id": 24998, "author_profile": "https://Stackoverflow.com/users/24998", "pm_score": 3, "selected": false, "text": "SELECT *,concat_ws(' ',first_name,last_name) AS whole_name FROM users HAVING whole_name LIKE '%$search_term%'\n" }, { ...
2008/11/19
[ "https://Stackoverflow.com/questions/303679", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1149/" ]
303,699
<p>I have a text area and a function to do syntax highlighting on it. Right now it reads the entire RichTextBox. How would I get a string variable containing the current line? Below is the code i currently have.</p> <pre><code>Private Sub HighLight() Dim rm As System.Text.RegularExpressions.MatchCollection Dim...
[ { "answer_id": 303729, "author": "JamesSugrue", "author_id": 1075, "author_profile": "https://Stackoverflow.com/users/1075", "pm_score": 3, "selected": true, "text": "rtbMain.Lines(lineNumber)\n" }, { "answer_id": 303733, "author": "P Daddy", "author_id": 36388, "auth...
2008/11/19
[ "https://Stackoverflow.com/questions/303699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39143/" ]
303,712
<p>In a Java application (JRE 1.5.0_12) on Windows XP, I call a native method:</p> <pre><code>public native int attachImage( ... ); </code></pre> <p>... which lives in a Visual C++ 6.0 .dll. It displays an application-modal window. Problem is, the application's tray icon doesn't respond to mouseclicks while this wind...
[ { "answer_id": 303753, "author": "James Van Huis", "author_id": 31828, "author_profile": "https://Stackoverflow.com/users/31828", "pm_score": 2, "selected": true, "text": "Shell shell = new Shell(display,SWT.APPLICATION_MODAL);\n dialog.setModalityType(Dialog.ModalityType.APPLICATION_MOD...
2008/11/19
[ "https://Stackoverflow.com/questions/303712", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35142/" ]
303,718
<p>My Firefox 3.0.4 does not display non-existing images at all, or it displays the image alt as plain text (if available).<br/> This way I would have no idea that there is supposed to be an image there.</p> <p>Does anyone know if there is a way to make it work like IE/Opera? (ie. display a box even if the image file ...
[ { "answer_id": 303772, "author": "Pim Jager", "author_id": 35197, "author_profile": "https://Stackoverflow.com/users/35197", "pm_score": -1, "selected": false, "text": "<img src='...' width='100' height='100' alt='...'></img>\nor\n<img src='...' alt='...' style='width:100px; height:100px...
2008/11/19
[ "https://Stackoverflow.com/questions/303718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36036/" ]
303,720
<p>I'm looking for something like <code>alert()</code>, but that doesn't "pause" the script.</p> <p>I want to display an alert and allow the next command, a form <code>submit()</code>, to continue. So the page will be changing after the alert is displayed, but it won't wait till the user has clicked OK.</p> <p>Is the...
[ { "answer_id": 303735, "author": "Aaron Powell", "author_id": 11388, "author_profile": "https://Stackoverflow.com/users/11388", "pm_score": 7, "selected": true, "text": "setTimeout(\"alert('hello world');\", 1);\n setTimeout(function() { alert('hello world'); }, 1);\n eval" }, { ...
2008/11/19
[ "https://Stackoverflow.com/questions/303720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5441/" ]
303,726
<p>I'm just playing around and I'm trying to grab information from websites. Unfortunately, with the following code:</p> <pre><code>import sys import socket import re from urlparse import urlsplit url = urlsplit(sys.argv[1]) sock = socket.socket() sock.connect((url[0] + '://' + url[1],80)) path = url[2] if not path...
[ { "answer_id": 303747, "author": "Piotr Lesnicki", "author_id": 38796, "author_profile": "https://Stackoverflow.com/users/38796", "pm_score": 1, "selected": false, "text": "addr = socket.gethostbyname(url[1])\n...\nsock.connect((addr,80))\n" }, { "answer_id": 303749, "author"...
2008/11/19
[ "https://Stackoverflow.com/questions/303726", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2128/" ]
303,745
<p>This is probably a beginner question, but how do you set a recordset to a string variable? </p> <p>Here is my code: </p> <pre><code>Function getOffice (strname, uname) strEmail = uname WScript.Echo "email: " &amp; strEmail Dim objRoot : Set objRoot = GetObject("LDAP://RootDSE") Dim objDomain : Set objDomain = G...
[ { "answer_id": 303754, "author": "BQ.", "author_id": 4632, "author_profile": "https://Stackoverflow.com/users/4632", "pm_score": 0, "selected": false, "text": "Cstr(objRS.Fields(0))\n" }, { "answer_id": 312645, "author": "AnonJr", "author_id": 25163, "author_profile":...
2008/11/19
[ "https://Stackoverflow.com/questions/303745", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18853/" ]
303,759
<p>I'm using VS 2008 to create a C++ DLL (not managed) project and I need convert a char* to a long long type. Is there an easy way to do it?</p> <p>Thanks in advance :)</p>
[ { "answer_id": 303796, "author": "altruic", "author_id": 38620, "author_profile": "https://Stackoverflow.com/users/38620", "pm_score": 4, "selected": true, "text": "_atoi64. char* __int64" }, { "answer_id": 303800, "author": "Alan", "author_id": 37843, "author_profile...
2008/11/19
[ "https://Stackoverflow.com/questions/303759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24927/" ]
303,760
<p>The concept of a <a href="http://en.wikipedia.org/wiki/Coroutine" rel="noreferrer">coroutine</a> sounds very interesting, but I don't know, if it makes sense in a real productive environment? What are use cases for coroutines, where the coroutine implementation is more elegant, simpler or more efficient than other m...
[ { "answer_id": 303789, "author": "Bevan", "author_id": 30280, "author_profile": "https://Stackoverflow.com/users/30280", "pm_score": 5, "selected": true, "text": "yield return yield return" }, { "answer_id": 304234, "author": "Charlie Martin", "author_id": 35092, "aut...
2008/11/19
[ "https://Stackoverflow.com/questions/303760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21005/" ]
303,761
<p>The Drupal API has <a href="http://api.drupal.org/api/function/drupal_get_path/6" rel="noreferrer"><code>drupal_get_path($type, $name)</code></a> which will give the path of any particular theme or module. What if I want the path of the current theme?</p>
[ { "answer_id": 303792, "author": "Owen", "author_id": 4853, "author_profile": "https://Stackoverflow.com/users/4853", "pm_score": 4, "selected": false, "text": "global $theme;\n$path = drupal_get_path('theme', $theme);\n\n// there's also a $theme_path global\n\nglobal $theme_path;\n" }...
2008/11/19
[ "https://Stackoverflow.com/questions/303761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10393/" ]
303,763
<p>I was wondering if anyone knew of a macro or keyboard shortcut or anything really that would automate Attaching to a Process within visual studio?</p>
[ { "answer_id": 303765, "author": "vfilby", "author_id": 24279, "author_profile": "https://Stackoverflow.com/users/24279", "pm_score": 4, "selected": true, "text": "System.Diagnostics.Debugger.Break()" }, { "answer_id": 303774, "author": "Greg Beech", "author_id": 13552, ...
2008/11/19
[ "https://Stackoverflow.com/questions/303763", "https://Stackoverflow.com", "https://Stackoverflow.com/users/493/" ]
303,767
<p>I need to grab the height of the window and the scrolling offset in jQuery, but I haven't had any luck finding this in the jQuery docs or Google.</p> <p>I'm 90% certain there's a way to access height and scrollTop for an element (presumably including the window), but I just can't find the specific reference.</p>
[ { "answer_id": 303778, "author": "Joey V.", "author_id": 34462, "author_profile": "https://Stackoverflow.com/users/34462", "pm_score": 3, "selected": false, "text": "$(window).height()\n\n$(window).width()\n" }, { "answer_id": 303791, "author": "Pim Jager", "author_id": 3...
2008/11/19
[ "https://Stackoverflow.com/questions/303767", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38666/" ]
303,783
<p>I'm building a fairly simple PHP script that will need to send some emails with attachments. I've found these 2 libraries to do this. </p> <p>Does either one have significant advantages over the other? Or should I just pick one at random and be done with it?</p>
[ { "answer_id": 15074414, "author": "Marco Demaio", "author_id": 260080, "author_profile": "https://Stackoverflow.com/users/260080", "pm_score": 3, "selected": false, "text": "SMTPDebug = 2" } ]
2008/11/19
[ "https://Stackoverflow.com/questions/303783", "https://Stackoverflow.com", "https://Stackoverflow.com/users/85/" ]
303,809
<p>I'm working on a simple application to start learning my way around WPF. I created a vector graphic in Microsoft Expression Design at 400px by 400px, mainly because I thought it would be easier to create it on a bigger canvas.</p> <p>I've exported the image to a XAML file as a series of objects within a 400px squar...
[ { "answer_id": 310491, "author": "discorax", "author_id": 30408, "author_profile": "https://Stackoverflow.com/users/30408", "pm_score": 0, "selected": false, "text": " dot = new Image();\n BitmapImage dotSource = new BitmapImage();\n dotSource.BeginInit();\n s...
2008/11/19
[ "https://Stackoverflow.com/questions/303809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/641985/" ]
303,827
<p>How do you access a MySQL relation using RoR?</p>
[ { "answer_id": 304730, "author": "allesklar", "author_id": 19893, "author_profile": "https://Stackoverflow.com/users/19893", "pm_score": 3, "selected": true, "text": "has_many :addresses\n belongs_to :user\n" } ]
2008/11/19
[ "https://Stackoverflow.com/questions/303827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39155/" ]
303,829
<p>In Ruby we have the 'bang' method <code>capitalize!</code> which has the strange behavior of returning a <code>nil</code> if no changes to the string were made.</p> <p>That means I can't chain this commands with other since it effectively destroys the chain if it returns <code>nil</code>.</p> <p>What im trying to ...
[ { "answer_id": 303861, "author": "Robert Gamble", "author_id": 25222, "author_profile": "https://Stackoverflow.com/users/25222", "pm_score": 3, "selected": false, "text": "fname = fullname[0...fullname.index(' ')].capitalize\n" } ]
2008/11/19
[ "https://Stackoverflow.com/questions/303829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14587/" ]
303,830
<p>I have a body of text that I have to scan and each line contains at least 2 and sometimes four parts of information. The problem is that each line can be 1 out of 15-20 different actions.</p> <p>in ruby the current code looks somewhat like this:</p> <pre> text.split("\n").each do |line| #around 20 times.. .........
[ { "answer_id": 304532, "author": "Jan Goyvaerts", "author_id": 33358, "author_profile": "https://Stackoverflow.com/users/33358", "pm_score": 0, "selected": false, "text": "regex1|regex2|regex3|...|regex15\n" }, { "answer_id": 306688, "author": "Brad Gilbert", "author_id":...
2008/11/19
[ "https://Stackoverflow.com/questions/303830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39110/" ]
303,838
<p>I am in the process of setting up CruiseControl.NET. The problem I am having is that I am running CC as a console application and when my build completes successfully and executes (using exec) it launches it within the CruiseControl DOS prompt. I am just using simple batch files to launch my app but having it run wi...
[ { "answer_id": 303844, "author": "e.James", "author_id": 33686, "author_profile": "https://Stackoverflow.com/users/33686", "pm_score": 9, "selected": true, "text": "start cmd.exe\n" }, { "answer_id": 303869, "author": "BlackMael", "author_id": 19377, "author_profile":...
2008/11/19
[ "https://Stackoverflow.com/questions/303838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25946/" ]
303,841
<p>I am getting this warning:</p> <pre><code>Use of uninitialized value in eval \"string\" at myscript.pl line 57. </code></pre> <p>When I run this code:</p> <pre><code>eval; { `$client -f $confFile -i $inputFile -o $outputFile`; }; if( $@ ) { # error handling here ... } </code></pre> <p>What is ca...
[ { "answer_id": 303855, "author": "Svante", "author_id": 31615, "author_profile": "https://Stackoverflow.com/users/31615", "pm_score": 4, "selected": true, "text": "eval" }, { "answer_id": 303990, "author": "Leon Timmermans", "author_id": 4727, "author_profile": "https...
2008/11/19
[ "https://Stackoverflow.com/questions/303841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39153/" ]
303,842
<p>I'm wondering if there is any way to create a User Account on a Windows XP machine that can be done through scripting from an ActiveX control on a webpage. Specifically, I'd like to know if there's any way to deploy an ActiveX control with computers (that I preconfigure and ship) that will allow use of my webpage f...
[ { "answer_id": 303855, "author": "Svante", "author_id": 31615, "author_profile": "https://Stackoverflow.com/users/31615", "pm_score": 4, "selected": true, "text": "eval" }, { "answer_id": 303990, "author": "Leon Timmermans", "author_id": 4727, "author_profile": "https...
2008/11/19
[ "https://Stackoverflow.com/questions/303842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28053/" ]
303,853
<p>I am considering using Maven for a Java open source project I manage.</p> <p>In the past, however, Maven has not always had the best reputation. What are your impressions of Maven, at this time? </p>
[ { "answer_id": 3361860, "author": "Jan", "author_id": 357556, "author_profile": "https://Stackoverflow.com/users/357556", "pm_score": 2, "selected": false, "text": "pom.xml" } ]
2008/11/19
[ "https://Stackoverflow.com/questions/303853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32174/" ]
303,877
<p>TeX/LaTeX is great, I use it in many ways. Some of its advantages are:</p> <ul> <li>it uses text files, this way the input-files can be diffed and many tools exist to work with text</li> <li>it is very flexible</li> <li>it has a stable layout: if I change something at the start of the document, it doesn't affect ot...
[ { "answer_id": 304039, "author": "vfilby", "author_id": 24279, "author_profile": "https://Stackoverflow.com/users/24279", "pm_score": 2, "selected": false, "text": " .pl 10.0i\n .po 0\n .ll 7.2i\n .lt 7.2i\n .nr LL 7.2i\n .nr LT 7.2i\n .ds...
2008/11/19
[ "https://Stackoverflow.com/questions/303877", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21005/" ]
303,911
<p>There is a similar question <a href="https://stackoverflow.com/questions/203495/testing-rest-webservices">here</a> but it only covers some of the issues below.</p> <p>We have a client who requires web services using REST.</p> <p>We have tons of experience using SOAP and over time have gathered together a really go...
[ { "answer_id": 21280384, "author": "Johan", "author_id": 398441, "author_profile": "https://Stackoverflow.com/users/398441", "pm_score": 0, "selected": false, "text": "{ \"greeting\" : { \"firstName\" : <first_name>, \"lastName\" : <last_name> } }\n given().\n param(\"first_name\"...
2008/11/20
[ "https://Stackoverflow.com/questions/303911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9922/" ]
303,913
<pre><code>File fil = new File("Tall.txt"); FileReader inputFil = new FileReader(fil); BufferedReader in = new BufferedReader(inputFil); int [] tall = new int [100]; String s =in.readLine(); while(s!=null) { int i = 0; tall[i] = Integer.parseInt(s); //this is line 19 System.out.println(tall[i]); s = ...
[ { "answer_id": 303921, "author": "erickson", "author_id": 3474, "author_profile": "https://Stackoverflow.com/users/3474", "pm_score": 3, "selected": false, "text": "try {\n tall[i++] = Integer.parseInt(s);\n}\ncatch (NumberFormatException ex) {\n continue;\n}\n if (s.length() == 0) \n ...
2008/11/20
[ "https://Stackoverflow.com/questions/303913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37161/" ]
303,916
<p>I'm trying to wrap my head around the best way to use IoC within my application for dependency injection, however I have a little issue.</p> <p>I am using a loose implementation of the MVP pattern with a WPF app. Essentially, a presenter class is instantiated, and a view and task (e.g. IEmployeeView and IEmployeeTa...
[ { "answer_id": 303921, "author": "erickson", "author_id": 3474, "author_profile": "https://Stackoverflow.com/users/3474", "pm_score": 3, "selected": false, "text": "try {\n tall[i++] = Integer.parseInt(s);\n}\ncatch (NumberFormatException ex) {\n continue;\n}\n if (s.length() == 0) \n ...
2008/11/20
[ "https://Stackoverflow.com/questions/303916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18434/" ]
303,939
<p>I'm wondering why styling an element within a specific class, like this:</p> <pre><code>.reddish H1 { color: red } </code></pre> <p>is shown as an example of correct syntax in the CSS1 specification under Contextual selectors:</p> <p><a href="http://www.w3.org/TR/2008/REC-CSS1-20080411/#class-as-selector" rel="no...
[ { "answer_id": 304122, "author": "philnash", "author_id": 28376, "author_profile": "https://Stackoverflow.com/users/28376", "pm_score": 3, "selected": true, "text": ".reddish h1 h1 .reddish h1 { color: blue; }\n" } ]
2008/11/20
[ "https://Stackoverflow.com/questions/303939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
303,955
<p>I have a generic function which gets a interface as a type, now in one condition I have to create a new class depending on the interface. I have been thinking about it and a way to solve it would be to use an IoC but I was hoping there would be an other way because an IoC seems a bit like an overkill. </p> <p>below...
[ { "answer_id": 304155, "author": "Odd", "author_id": 11908, "author_profile": "https://Stackoverflow.com/users/11908", "pm_score": 0, "selected": false, "text": "public void Method<T>()\n{\n Type type = typeof(T);\n\n T newObject = (T)type.GetConstructor(new System.Type[] { }).Invoke(n...
2008/11/20
[ "https://Stackoverflow.com/questions/303955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/305008/" ]
303,956
<p>Is it possible using <a href="https://jquery.com/" rel="noreferrer">jQuery</a> to select all <code>&lt;a&gt;</code> links which href ends with "ABC"?</p> <p>For example, if I want to find this link <code>&lt;a href="http://server/page.aspx?id=ABC"&gt;</code></p>
[ { "answer_id": 303961, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 12, "selected": true, "text": " $('a[href$=\"ABC\"]')...\n = is exactly equal\n!= is not equal\n^= is starts with\n$= is ends with\n*= is contains\n...
2008/11/20
[ "https://Stackoverflow.com/questions/303956", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36036/" ]
303,970
<p>I am having trouble constructing a single XPath statement to return two different sets of attributes. </p> <p>For example take the following XML document:</p> <pre><code>&lt;root&gt; &lt;line name="one" alpha="a1" beta="b1"/&gt; &lt;line name="two" alpha="a2" beta="b2"/&gt; &lt;line name="three" alpha="a3" bet...
[ { "answer_id": 303999, "author": "Oppositional", "author_id": 2029, "author_profile": "https://Stackoverflow.com/users/2029", "pm_score": 5, "selected": true, "text": "| //@alpha | //@beta\n" }, { "answer_id": 304003, "author": "Mads Hansen", "author_id": 14419, "auth...
2008/11/20
[ "https://Stackoverflow.com/questions/303970", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3810/" ]
303,987
<p>Is there any way in Linq to check to see if a record of a parent exists in its children? </p> <p>I have a table that has a foreign key relationship with 12 other tables. All I want to do is see if any records in those child tables depend on the parent, so I can delete it without causing errors with FK constraints. ...
[ { "answer_id": 304074, "author": "matt_dev", "author_id": 39086, "author_profile": "https://Stackoverflow.com/users/39086", "pm_score": 0, "selected": false, "text": " ParentChildrenDataContext context = new ParentChildrenDataContext();\n\n var child1Ids = from c in context...
2008/11/20
[ "https://Stackoverflow.com/questions/303987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4144/" ]
303,994
<p>Is it possible for me to turn on audit logging on my mysql database?</p> <p>I basically want to monitor all queries for an hour, and dump the log to a file.</p>
[ { "answer_id": 304008, "author": "Robert Gamble", "author_id": 25222, "author_profile": "https://Stackoverflow.com/users/25222", "pm_score": 8, "selected": true, "text": "mysqld --log=log_file_name\n my.cnf log = log_file_name\n --log-slow-queries --log long_query_time" }, { "ans...
2008/11/20
[ "https://Stackoverflow.com/questions/303994", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1368/" ]
304,010
<p>I have a multi-threaded application that is hanging on a call to _dl_sysinfo_int80(). According to gdb, all threads are stuck in this call.</p> <p>The top of the stack trace looks like:</p> <pre><code>#0 0x002727a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 #1 0x004f23de in __lll_mutex_lock_wait () from /l...
[ { "answer_id": 305277, "author": "CesarB", "author_id": 28258, "author_profile": "https://Stackoverflow.com/users/28258", "pm_score": 0, "selected": false, "text": "_dl_sysinfo_int80 int $0x80 __lll_mutex_lock_wait" } ]
2008/11/20
[ "https://Stackoverflow.com/questions/304010", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1449/" ]
304,011
<p>What's the easiest way to truncate a C++ <code>float</code> variable that has a value of 0.6000002 to a value of 0.6000 and store it back in the variable?</p>
[ { "answer_id": 304013, "author": "Brian R. Bondy", "author_id": 3153, "author_profile": "https://Stackoverflow.com/users/3153", "pm_score": 4, "selected": true, "text": "char sz[64];\ndouble lf = 0.600000002;\nsprintf(sz, \"%.4lf\\n\", lf); //sz contains 0.6000\n\ndouble lf2 = atof(sz);\...
2008/11/20
[ "https://Stackoverflow.com/questions/304011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/191808/" ]
304,041
<p>I've been working with Vector2's and XNA, and I've come to find that calling the Normalize() member function on a Zero Vector normalizes it to a vector of {NaN, NaN}. This is all well and good, but in my case I'd prefer it instead just leave them as Zero Vectors.</p> <p>Adding this code to my project enabled a cut...
[ { "answer_id": 304077, "author": "lomaxx", "author_id": 493, "author_profile": "https://Stackoverflow.com/users/493", "pm_score": 0, "selected": false, "text": "Vector2 v2 = new Vector2()\nv2 = v2.NormalizeOrZero();\n" }, { "answer_id": 304098, "author": "yfeldblum", "aut...
2008/11/20
[ "https://Stackoverflow.com/questions/304041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1388/" ]
304,043
<p>I'm trying to generate pairwise combinations of rows on based on their ids. SQLite version is 3.5.9. The table contents are the following:</p> <pre><code>id|name|val 1|A|20 2|B|21 3|C|22 </code></pre> <p>with table schema being:</p> <pre><code>CREATE TABLE mytable ( id INTEGER NOT NULL, name VARCHAR, ...
[ { "answer_id": 305680, "author": "converter42", "author_id": 28974, "author_profile": "https://Stackoverflow.com/users/28974", "pm_score": 0, "selected": false, "text": "SQLite version 3.6.2\nEnter \".help\" for instructions\nEnter SQL statements terminated with a \";\"\nsqlite> create t...
2008/11/20
[ "https://Stackoverflow.com/questions/304043", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39167/" ]
304,049
<p>Is there anyone out there using iPython with emacs 23? The documents on the emacs wiki are a bit of a muddle and I would be interested in hearing from anyone using emacs for Python development. Do you use the download python-mode and ipython.el? What do you recommend?</p>
[ { "answer_id": 312741, "author": "RichieHH", "author_id": 37370, "author_profile": "https://Stackoverflow.com/users/37370", "pm_score": 4, "selected": true, "text": "(setq load-path\n (append (list nil\n \"~/.emacs.d/python-mode-1.0/\"\n \"~/.emacs.d/py...
2008/11/20
[ "https://Stackoverflow.com/questions/304049", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37370/" ]
304,081
<p>I'm building a winForms app in NET3.5SP1 using VS2008Express. Am trying to deserialize an object using the System.Web.Script.Serialization library.</p> <p>The error is: Type 'jsonWinForm.Category' is not supported for deserialization of an array.</p> <p>Cheers!</p> <pre><code>using System; using System.Collectio...
[ { "answer_id": 304157, "author": "Dave Mateer", "author_id": 26086, "author_profile": "https://Stackoverflow.com/users/26086", "pm_score": 4, "selected": false, "text": "JavaScriptSerializer serializer = new JavaScriptSerializer();\n\n// create a generic list of categories\nList<Category...
2008/11/20
[ "https://Stackoverflow.com/questions/304081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26086/" ]
304,088
<p>The comment to <a href="https://stackoverflow.com/questions/200090/how-do-you-convert-a-c-string-to-an-int#200099">this answer</a> got me wondering. I've always thought that C was a proper subset of C++, that is, any valid C code is valid C++ code by extension. Am I wrong about that? Is it possible to write a val...
[ { "answer_id": 304091, "author": "Brian R. Bondy", "author_id": 3153, "author_profile": "https://Stackoverflow.com/users/3153", "pm_score": 6, "selected": true, "text": "int *new;//<-- new is not a keyword in C\nchar *p = malloc(1024); //void * to char* without cast \n" }, { "ans...
2008/11/20
[ "https://Stackoverflow.com/questions/304088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1288/" ]
304,093
<p>I was wondering why <code>shared_ptr</code> doesn't have an implicit constructor. The fact it doesn't is alluded to here: <a href="https://stackoverflow.com/questions/142391/getting-a-boostsharedptr-for-this">Getting a boost::shared_ptr for this</a></p> <p>(I figured out the reason but thought it would be a fun que...
[ { "answer_id": 304183, "author": "user35978", "author_id": 35978, "author_profile": "https://Stackoverflow.com/users/35978", "pm_score": -1, "selected": false, "text": "int main() {\n\n int foo = 5;\n fun(&foo);\n\n cout << foo << endl; // ops!!\n\n return 0;\n}\n" }, { ...
2008/11/20
[ "https://Stackoverflow.com/questions/304093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3594/" ]
304,109
<p>Having the window handle for an open application, I'm able to use the GetWindowText function to retrieve the text from the title bar of the app. I would like to take this a step farther and retrieve the icon associated with the same app. </p> <p>How might I go about doing this? I looked through what I thought wo...
[ { "answer_id": 304120, "author": "Adam Davis", "author_id": 2915, "author_profile": "https://Stackoverflow.com/users/2915", "pm_score": 5, "selected": true, "text": "Icon ico = Icon.ExtractAssociatedIcon(theProcess.MainModule.FileName);\n" }, { "answer_id": 14053737, "author"...
2008/11/20
[ "https://Stackoverflow.com/questions/304109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39171/" ]
304,117
<p>Am wondering if anyone might provide some conceptual advice on an efficient way to build a data model to accomplish the simple system described below. Am somewhat new to thinking in a non-relational manner and want to try avoiding any obvious pitfalls. It's my understanding that a basic principal is that "storage ...
[ { "answer_id": 307312, "author": "ianb", "author_id": 20218, "author_profile": "https://Stackoverflow.com/users/20218", "pm_score": 1, "selected": false, "text": "Expando setattr(entity, 'tag_'+tag_name, True)\n def get_all_with_tag(model_class, tag):\n return model_class.all().filter...
2008/11/20
[ "https://Stackoverflow.com/questions/304117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26241/" ]
304,129
<p>How do I return a constant from an sql statement? </p> <p>For example how would I change the code below so "my message" would return if my (boolean expression) was true</p> <pre><code>if (my boolean expression) "my message" else select top 1 name from people; </code></pre> <p>I am using ms sql 2000</p>
[ { "answer_id": 304138, "author": "Ned Batchelder", "author_id": 14343, "author_profile": "https://Stackoverflow.com/users/14343", "pm_score": 6, "selected": true, "text": "select 'my message';\n" }, { "answer_id": 304149, "author": "Vinko Vrsalovic", "author_id": 5190, ...
2008/11/20
[ "https://Stackoverflow.com/questions/304129", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1632/" ]
304,130
<p>Based on the advice provided at <a href="http://www.tweakguides.com/VA_4.html" rel="nofollow noreferrer">http://www.tweakguides.com/VA_4.html</a> to prevent Windows Vista from "intelligently" rearranging column formats in Windows Explorer, I have written a script to automate the process a little.</p> <pre><code>Dim...
[ { "answer_id": 9645214, "author": "aelgoa", "author_id": 1260792, "author_profile": "https://Stackoverflow.com/users/1260792", "pm_score": 1, "selected": false, "text": "Const HKCR=&H80000000:Const HKCU=&H80000001:Const HKLM=&H80000002:Const HKU=&H80000003:Const HKCC=&H80000005\n\ndim pc...
2008/11/20
[ "https://Stackoverflow.com/questions/304130", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2663/" ]
304,139
<p>So the chain of events is:</p> <ol> <li>The user submits a form.</li> <li>During the processing of the submission, there is a message generated, such as "Your record was saved."</li> <li>The user is redirected to a new page, say the search results.</li> <li>The new page needs to display the message.</li> </ol> <p>...
[ { "answer_id": 304168, "author": "dylanfm", "author_id": 38795, "author_profile": "https://Stackoverflow.com/users/38795", "pm_score": 0, "selected": false, "text": "<?php class session\n public function __construct()\n{\n session_start();\n}\n\npublic function set($name, $value)\n{\n...
2008/11/20
[ "https://Stackoverflow.com/questions/304139", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5441/" ]
304,152
<p>I am using Python and the <a href="http://twistedmatrix.com/trac/" rel="nofollow noreferrer">Twisted</a> framework to connect to an FTP site to perform various automated tasks. Our FTP server happens to be Pure-FTPd, if that's relevant.</p> <p>When connecting and calling the <strong>list</strong> method on an <str...
[ { "answer_id": 311236, "author": "Martin Carpenter", "author_id": 39443, "author_profile": "https://Stackoverflow.com/users/39443", "pm_score": 3, "selected": true, "text": "NLST LIST LIST LIST MLST MLSD NLST NLST LIST LIST NLST" } ]
2008/11/20
[ "https://Stackoverflow.com/questions/304152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2696/" ]
304,213
<p>I am using the ASP.NET <strong>Client-Side</strong> ajax control toolkit in my asp.net MVC application. I see that there is a .js file named "AjaxControlToolkit.ModalPopup.ModalPopupBehavior.js" in the AjaxControlToolkit folder. However, I cannot find any examples on how to use it.<br /><br /> [Edit] - As mentioned,...
[ { "answer_id": 759377, "author": "Gramic", "author_id": 18788, "author_profile": "https://Stackoverflow.com/users/18788", "pm_score": 3, "selected": true, "text": "<script src=\"javascripts/MicrosoftAjax.js\" type=\"text/javascript\" ></script>\n<script src=\"javascripts/AjaxControlToolk...
2008/11/20
[ "https://Stackoverflow.com/questions/304213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37786/" ]
304,216
<p>Is there a way to find all nodes in a xml tree using cElementTree? The findall method works only for specified tags.</p>
[ { "answer_id": 304220, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 3, "selected": true, "text": "etree.findall('.//*')\n" } ]
2008/11/20
[ "https://Stackoverflow.com/questions/304216", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2220518/" ]
304,226
<p>I have a custom NSTableView subclass which is bound to a data source (an NSArray) which updates asynchronously. When items are added to the array, rows are automatically added to the tableview. Awesome!</p> <p>My question is this: How can I detect that this magic has happened so that I can perform some other tasks ...
[ { "answer_id": 304304, "author": "Marc Charbonneau", "author_id": 35136, "author_profile": "https://Stackoverflow.com/users/35136", "pm_score": 4, "selected": true, "text": "enclosingScrollView rowHeight intercellSpacing" }, { "answer_id": 991114, "author": "Community", "...
2008/11/20
[ "https://Stackoverflow.com/questions/304226", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33686/" ]
304,233
<p>I'm trying to use the ASP.NET MVC Ajax.BeginForm helper but don't want to use the existing content insertion options when the call completes. Instead, I want to use a custom JavaScript function as the callback.</p> <p>This works, but the result I want should be returned as JSON. Unfortunately, the framework just tr...
[ { "answer_id": 304517, "author": "Kobi", "author_id": 39215, "author_profile": "https://Stackoverflow.com/users/39215", "pm_score": 5, "selected": true, "text": "var json_data = content.get_response().get_object();\n json_data[0]" }, { "answer_id": 2107434, "author": "Russel"...
2008/11/20
[ "https://Stackoverflow.com/questions/304233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2656/" ]
304,240
<pre><code>&lt;?php class foo { //this class is always etended, and has some other methods that do utility work //and are never overrided public function init() { //what do to here to call bar-&gt;doSomething or baz-&gt;doSomething //depending on what class is actually instantiated? ...
[ { "answer_id": 304245, "author": "Owen", "author_id": 4853, "author_profile": "https://Stackoverflow.com/users/4853", "pm_score": 1, "selected": false, "text": "public function init() {\n $this->doSomething();\n}\n\n$obj = new bar();\n$obj->doSomething(); // prints \"bar\"\n\n$obj2 = ...
2008/11/20
[ "https://Stackoverflow.com/questions/304240", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39183/" ]
304,249
<p>I assume 100 bytes is too small and can slow down larger file transfers with all of the writes, but something like 1MB seems like it may be too much. Does anyone have any suggestions for an optimal chunk of bytes per write for sending data over a network?</p> <p>To elaborate a bit more, I'm implementing something ...
[ { "answer_id": 304841, "author": "Stefan", "author_id": 19307, "author_profile": "https://Stackoverflow.com/users/19307", "pm_score": 2, "selected": false, "text": "Private PreferredTransferDuration As Integer = 1800 ' milliseconds, the timespan the class will attempt to achieve for each...
2008/11/20
[ "https://Stackoverflow.com/questions/304249", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39185/" ]
304,256
<p>The Python <a href="http://www.python.org/doc/2.5.2/lib/datetime-datetime.html" rel="noreferrer"><code>datetime.isocalendar()</code></a> method returns a tuple <code>(ISO_year, ISO_week_number, ISO_weekday)</code> for the given <code>datetime</code> object. Is there a corresponding inverse function? If not, is the...
[ { "answer_id": 304288, "author": "Tom", "author_id": 3715, "author_profile": "https://Stackoverflow.com/users/3715", "pm_score": -1, "selected": false, "text": "strptime %W %w def fromisocalendar(y,w,d):\n return datetime.strptime( \"%04dW%02d-%d\"%(y,w-1,d), \"%YW%W-%w\")\n 1 %W 0 1 %...
2008/11/20
[ "https://Stackoverflow.com/questions/304256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3715/" ]
304,268
<p>I am looking to use Java to get the MD5 checksum of a file. I was really surprised but I haven't been able to find anything that shows how to get the MD5 checksum of a file.</p> <p>How is it done?</p>
[ { "answer_id": 304275, "author": "Bill the Lizard", "author_id": 1288, "author_profile": "https://Stackoverflow.com/users/1288", "pm_score": 7, "selected": false, "text": "import java.io.*;\nimport java.security.MessageDigest;\n\npublic class MD5Checksum {\n\n public static byte[] crea...
2008/11/20
[ "https://Stackoverflow.com/questions/304268", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24998/" ]
304,270
<p>Ok, I have one JavaScript that creates rows in a table like this:</p> <pre><code> function AddRow(text,rowID) { var tbl = document.getElementById('tblNotePanel'); var row = tbl.insertRow(tbl.rows.length); var cell = row.insertCell(); var textNode = document.createTextNode(text); cell.id = rowID...
[ { "answer_id": 304282, "author": "Eric Schoonover", "author_id": 3957, "author_profile": "https://Stackoverflow.com/users/3957", "pm_score": 2, "selected": false, "text": "this clickTest alert(this.id);\n cell.onclick = function() { alert(this.id); alert(cell.id); };\n cell.id" }, { ...
2008/11/20
[ "https://Stackoverflow.com/questions/304270", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12172/" ]
304,281
<p>I can't figure out how to get the SCOPE_IDENTITY() back to my variables from an SQL2005 Store Procedure.</p> <p>My sSQL String:</p> <pre><code>sSQL = "EXEC [sp_NewClaim] " &amp; Chr(34) &amp; ClaimNumber &amp; Chr(34) &amp; ", " &amp; Request.Cookies("UserID") &amp; ", " &amp; Request.Cookies("MasterID") &amp; ", ...
[ { "answer_id": 304294, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 4, "selected": true, "text": "CREATE PROCEDURE sp_NewClaim\n (\n @ClaimNumber nvarchar(50),\n @blah............\n .................\n)\nAS\n...
2008/11/20
[ "https://Stackoverflow.com/questions/304281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38678/" ]
304,290
<p>Why do I have to specify <code>runat="server"</code> on all my ASP.NET controls when it is a mandatory attribute and <code>server</code> is the only option available in my limited knowledge of ASP.NET, and I get an error if I don't use it?</p> <p>I do understand that I can optionally use it on my HTML tags, and I d...
[ { "answer_id": 304306, "author": "Dave Swersky", "author_id": 34796, "author_profile": "https://Stackoverflow.com/users/34796", "pm_score": 4, "selected": false, "text": "<INPUT type=\"submit\" runat=server /> <asp:Button runat=server /> <asp:XXX />" }, { "answer_id": 304307, ...
2008/11/20
[ "https://Stackoverflow.com/questions/304290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5302/" ]
304,317
<p>Does MySQL index foreign key columns automatically?</p>
[ { "answer_id": 33893061, "author": "Navrattan Yadav", "author_id": 3665000, "author_profile": "https://Stackoverflow.com/users/3665000", "pm_score": 2, "selected": false, "text": "Innodb FOREIGN KEY foreign_key_name CONSTRAINT constraint_name\nFOREIGN KEY foreign_key_name (columns)\nREFE...
2008/11/20
[ "https://Stackoverflow.com/questions/304317", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2648/" ]
304,319
<p>As I sometimes have path problems, where one of my own cmd scripts is hidden (shadowed) by another program (earlier on the path), I would like to be able to find the full path to a program on the Windows command line, given just its name.</p> <p>Is there an equivalent to the UNIX command 'which'?</p> <p>On UNIX, <...
[ { "answer_id": 304392, "author": "RexE", "author_id": 38146, "author_profile": "https://Stackoverflow.com/users/38146", "pm_score": 6, "selected": false, "text": "($Env:Path).Split(\";\") | Get-ChildItem -filter programName*\n" }, { "answer_id": 304441, "author": "paxdiablo",...
2008/11/20
[ "https://Stackoverflow.com/questions/304319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34596/" ]
304,322
<p>Is there a way I can export my Silverlight DataGrid data to excel or csv?</p> <p>I searched the web but can't find any examples!</p> <p>Thanks a lot </p>
[ { "answer_id": 353671, "author": "DaniCE", "author_id": 19046, "author_profile": "https://Stackoverflow.com/users/19046", "pm_score": 2, "selected": false, "text": "public String ExportDataGrid(DataGrid grid)\n{\n string colPath;\n System.Reflection.PropertyInfo propInfo;\n Syst...
2008/11/20
[ "https://Stackoverflow.com/questions/304322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
304,323
<p>What is the best way to integrate an external script into the Zend Framework? Let me explain because I may be asking this the wrong way. I have a script that downloads and parses an XML file. This script, which runs as a daily cron job, needs to dump its data into the database.</p> <p>I am using Zend Framework for ...
[ { "answer_id": 304838, "author": "smack0007", "author_id": 26566, "author_profile": "https://Stackoverflow.com/users/26566", "pm_score": 1, "selected": false, "text": "require_once('Zend/Loader.php');\nZend_Loader::registerAutoload();\n" }, { "answer_id": 305761, "author": "S...
2008/11/20
[ "https://Stackoverflow.com/questions/304323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11252/" ]
304,356
<p>I've written a script which takes the summary of an order and stores in into an XML file, except the problem is that I don't want people to be able to open the XML file in their browser, obviously.</p> <p>I'm hosted on a very dodgy shared server with limited abilities: no SSH, for starters.</p> <p><strong>Is there...
[ { "answer_id": 304380, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": 2, "selected": true, "text": "<Files ~ \"myfile.xml\">\n Order allow,deny\n Deny from all\n</Files>\n" }, { "answer_id": 304439, "author": ...
2008/11/20
[ "https://Stackoverflow.com/questions/304356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9021/" ]
304,371
<p>I'm looking to get some help on using the <a href="http://malsup.com/jquery/cycle/" rel="nofollow noreferrer">cycle</a> library for jQuery. I'm in the <a href="http://malsup.com/jquery/cycle/begin.html" rel="nofollow noreferrer">beginner</a> demos, and I got the absolute first one completed. This is the second one o...
[ { "answer_id": 304475, "author": "seanb", "author_id": 3354, "author_profile": "https://Stackoverflow.com/users/3354", "pm_score": 2, "selected": false, "text": "$(document).ready(function() { \n $('.pics').cycle({ \n fx: 'scrollDown', \n speed: 300, \n t...
2008/11/20
[ "https://Stackoverflow.com/questions/304371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
304,373
<p>I have the following .aspx page, and I want to view it in web browsers such as IE or Google Chrome by opening it directly in those browsers:</p> <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD X...
[ { "answer_id": 304379, "author": "Brettski", "author_id": 5836, "author_profile": "https://Stackoverflow.com/users/5836", "pm_score": 3, "selected": true, "text": "%@ Page Language=\"C#\" AutoEventWireup=\"true\" CodeBehind=\"Default.aspx.cs\" Inherits=\"WebApplication1._Default\" %>" ...
2008/11/20
[ "https://Stackoverflow.com/questions/304373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
304,383
<p>Is there a way to edit the log message of a certain revision in Subversion? I accidentally wrote the wrong filename in my commit message which could be confusing later.</p> <p>I've seen <em><a href="https://stackoverflow.com/questions/179123/how-do-i-edit-an-incorrect-commit-message-in-git">How do I edit an incorre...
[ { "answer_id": 304390, "author": "Kamil Kisiel", "author_id": 15061, "author_profile": "https://Stackoverflow.com/users/15061", "pm_score": 10, "selected": true, "text": "$svn propedit -r N --revprop svn:log URL \n$svn propset -r N --revprop svn:log \"new log message\" URL \n $ svnadmin ...
2008/11/20
[ "https://Stackoverflow.com/questions/304383", "https://Stackoverflow.com", "https://Stackoverflow.com/users/813/" ]
304,384
<p>How do I compare two images &amp; recognize the pattern in an image irrespective of its size and pattern size, and using .Net C#? Also, which algorithms are used for doing so from Image Processing?</p>
[ { "answer_id": 9443757, "author": "Mandah Mr.", "author_id": 1228884, "author_profile": "https://Stackoverflow.com/users/1228884", "pm_score": 1, "selected": false, "text": " ExhaustiveTemplateMatching tm = new ExhaustiveTemplateMatching(0.921f);\n // find all matchings ...
2008/11/20
[ "https://Stackoverflow.com/questions/304384", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
304,386
<p>I am trying to develop a plug-in for <a href="http://trac.webkit.org/wiki/QtWebKit" rel="nofollow noreferrer">QtWebkit</a>. But I am not able to find how to develop a plugin for QtWebKit, hopefully one that can be invoked by JavaScript. Does anyone know of any tutorials or documents that explain how to do this?</p>...
[ { "answer_id": 420163, "author": "Henrik Hartz", "author_id": 50830, "author_profile": "https://Stackoverflow.com/users/50830", "pm_score": 2, "selected": false, "text": "QWebPage webview createPlugin protected:\n QObject* createPlugin(const QString &classid, const QUrl &url, const QSt...
2008/11/20
[ "https://Stackoverflow.com/questions/304386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
304,389
<p>In VB.NET, which is better to use: function overloading or default parameters?</p>
[ { "answer_id": 304484, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 3, "selected": true, "text": "Process ProcessStartInfo Person jon = new Person.Builder { Name=\"Jon\", Age=32,\n Spous...
2008/11/20
[ "https://Stackoverflow.com/questions/304389", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34588/" ]
304,391
<p>Say I have a string of 16 numeric characters (i.e. 0123456789012345) what is the most efficient way to delimit it into sets like : 0123-4567-8901-2345, in PHP?</p> <p>Note: I am rewriting an existing system that is painfully slow.</p>
[ { "answer_id": 304411, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": 4, "selected": true, "text": "$string = '0123456789012345';\n$sets = str_split($string, 4);\nprint_r($sets);\n Array\n(\n [0] => 0123\n [1] => 4567...
2008/11/20
[ "https://Stackoverflow.com/questions/304391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115/" ]
304,393
<p>One of the <a href="http://www.sqlite.org/whentouse.html" rel="noreferrer">appropriate uses</a> for <a href="http://www.sqlite.org" rel="noreferrer">sqlite3</a> is "in-memory databases". This sounds like a really useful tool for my C++ applications. Does anyone have an example of how this is done in C or C++? I'm...
[ { "answer_id": 304402, "author": "Kyle Cronin", "author_id": 658, "author_profile": "https://Stackoverflow.com/users/658", "pm_score": 3, "selected": false, "text": "ATTACH foo.db AS foo\n SELECT * FROM foo.users\n" }, { "answer_id": 333057, "author": "Danielb", "author_i...
2008/11/20
[ "https://Stackoverflow.com/questions/304393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14167/" ]
304,396
<p>I'm looking for some sample code that will sort the list items in an HTML list by alphabetical order. Can anyone help?</p> <p>Here is a sample list for people to work with:</p> <pre><code>&lt;ul class="alphaList"&gt; &lt;li&gt;apples&lt;/li&gt; &lt;li&gt;cats&lt;/li&gt; &lt;li&gt;bears&lt;/li&gt; &lt;...
[ { "answer_id": 304428, "author": "Chatu", "author_id": 39203, "author_profile": "https://Stackoverflow.com/users/39203", "pm_score": 8, "selected": true, "text": "var items = $('.alphaList > li').get();\nitems.sort(function(a,b){\n var keyA = $(a).text();\n var keyB = $(b).text();\n\n ...
2008/11/20
[ "https://Stackoverflow.com/questions/304396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3957/" ]
304,430
<p>When running the following code it leaves out one row. When I do a files.Count it says there are 4 rows but there is no data stored for the 4th row. When I run the stored procedure from within SQL Manager it returns all 4 rows and all the data. Any help?</p> <pre><code> List&lt;File&gt; files = new List&...
[ { "answer_id": 304465, "author": "seanb", "author_id": 3354, "author_profile": "https://Stackoverflow.com/users/3354", "pm_score": 1, "selected": false, "text": "SqlParameter param = new SqlParameter(); \n// set param stuff - here or in ctor \ncmd.Parameters.Add(param); \n" }, { ...
2008/11/20
[ "https://Stackoverflow.com/questions/304430", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36798/" ]
304,451
<p>I'm trying to avoid code like this when reusing the same ViewUserControl in ASP.NET MVC. Any suggestions?</p> <pre><code>&lt;% if (ViewContext.ViewData["editMode"].ToString() == "edit"){ %&gt; &lt;%= Html.SubmitButton("submit", "Update Brand")%&gt;&lt;span class="or"&gt;Or&lt;/span&gt;&lt;a href="#" class="canc...
[ { "answer_id": 401913, "author": "Todd Smith", "author_id": 31624, "author_profile": "https://Stackoverflow.com/users/31624", "pm_score": 2, "selected": false, "text": "<% string submitLabel = (ViewData[\"editMode\"].ToString() == \"edit\") ? \"Update Brand\" : \"Create New Brand\" %>\n<...
2008/11/20
[ "https://Stackoverflow.com/questions/304451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34133/" ]
304,461
<p>I need to do a join with a table/result-set/whatever that has the integers <code>n</code> to <code>m</code> inclusive. Is there a trivial way to get that without just building the table?</p> <p>(BTW what would that type of construct be called, a "<em>Meta query</em>"?)</p> <p><code>m-n</code> is bounded to somethi...
[ { "answer_id": 304644, "author": "Eugene Yokota", "author_id": 3827, "author_profile": "https://Stackoverflow.com/users/3827", "pm_score": 5, "selected": true, "text": "AUTO_INCREMENT" }, { "answer_id": 304711, "author": "ysth", "author_id": 17389, "author_profile": "...
2008/11/20
[ "https://Stackoverflow.com/questions/304461", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1343/" ]