qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
215,742
<p><em>By Logic Programming I mean the a sub-paradigm of declarative programming languages. Don't confuse this question with "What problems can you solve with if-then-else?"</em></p> <p>A language like Prolog is very fascinating, and it's worth learning for the sake of learning, but I have to wonder what class of rea...
[ { "answer_id": 216302, "author": "Aleksandar Dimitrov", "author_id": 11797, "author_profile": "https://Stackoverflow.com/users/11797", "pm_score": 6, "selected": true, "text": "make/0 edit(1) foobar/2 ?- edit(foobar).\n" } ]
2008/10/18
[ "https://Stackoverflow.com/questions/215742", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18446/" ]
215,745
<p>Are there any other ways to avoid LazyInitializationExceptions in a Hibernate web application besides using the OpenSessionInView pattern? Are there any downsides to using OpenSessionInView?</p>
[ { "answer_id": 215806, "author": "abahgat", "author_id": 27565, "author_profile": "https://Stackoverflow.com/users/27565", "pm_score": 4, "selected": true, "text": "FetchMode.JOIN Hibernate.initialize(property)" } ]
2008/10/18
[ "https://Stackoverflow.com/questions/215745", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18995/" ]
215,748
<p>I'm currently working on project with Haskell, and have found myself some trouble. I'm supposed to read and insert into a list each line in a "dictionary.txt" file, but I can't seem to do so. I've got this code:</p> <pre><code>main = do let list = [] loadNums "dictionary.txt" list loadNums location list = ...
[ { "answer_id": 215796, "author": "CesarB", "author_id": 28258, "author_profile": "https://Stackoverflow.com/users/28258", "pm_score": 5, "selected": true, "text": "let list' = inpStr:list\n" }, { "answer_id": 215812, "author": "ephemient", "author_id": 20713, "author_...
2008/10/18
[ "https://Stackoverflow.com/questions/215748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9506/" ]
215,752
<p>While working on a C++ project, I was looking for a third party library for something that is not my core business. I found a really good library, doing exactly what's needed, but it is written in Python. I decided to experiment with embedding Python code in C++, using the Boost.Python library.</p> <p>The C++ code ...
[ { "answer_id": 215843, "author": "tzot", "author_id": 6899, "author_profile": "https://Stackoverflow.com/users/6899", "pm_score": 1, "selected": false, "text": "PyObject_CallObject(<py function>, <args>) PyRun_String(<expression>, Py_eval_input, <globals>, <locals>)" }, { "answer...
2008/10/18
[ "https://Stackoverflow.com/questions/215752", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25287/" ]
215,753
<p>I was watching a tutorial on Rails and was very impressed that you could so easily create an editing system for a class just by defining it.</p> <p>Can this be done in ASP.NET?</p> <p>I know there are ORMs out there, but do they come with an editing system?</p> <p>To explain what I mean by an editing system, cons...
[ { "answer_id": 215843, "author": "tzot", "author_id": 6899, "author_profile": "https://Stackoverflow.com/users/6899", "pm_score": 1, "selected": false, "text": "PyObject_CallObject(<py function>, <args>) PyRun_String(<expression>, Py_eval_input, <globals>, <locals>)" }, { "answer...
2008/10/19
[ "https://Stackoverflow.com/questions/215753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24696/" ]
215,767
<p>If you have something like:</p> <pre><code>val myStuff = Array(Person("joe",40), Person("mary", 35)) </code></pre> <p>How do you create an XML value with that data as nodes? I know how to use { braces } in an XML expression to put a value, but this is a collection of values. Do I need to iterate explicitly or is t...
[ { "answer_id": 215860, "author": "Aaron Maenpaa", "author_id": 2603, "author_profile": "https://Stackoverflow.com/users/2603", "pm_score": 5, "selected": true, "text": "class Person(name : String, age : Int){\n def toXml() = <person><name>{ name }</name><age>{ age }</age></person>\n}\...
2008/10/19
[ "https://Stackoverflow.com/questions/215767", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17138/" ]
215,770
<p>I'm a very novice OCaml programmer so please forgive me if this is a stupid/obvious question. There's <em>a lot</em> to absorb and I may have missed this in the documentation.</p> <p>I have a base of code that's starting to look like this:</p> <pre><code>let update_x p x = add_delta p; p.x &lt;- x; refresh ...
[ { "answer_id": 215884, "author": "Chris Conway", "author_id": 1412, "author_profile": "https://Stackoverflow.com/users/1412", "pm_score": 2, "selected": true, "text": "UPDATE_FIELD x f y\n x.f <- y\n" }, { "answer_id": 264390, "author": "zrr", "author_id": 34515, "aut...
2008/10/19
[ "https://Stackoverflow.com/questions/215770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18446/" ]
215,799
<p>I'm looking it over and it seems to be that it is fundamentally broken.</p> <ul> <li>Only 5 instance methods aren't marked obsolete. </li> <li>There doesn't appear to be any built-in way to parse query-string variables.</li> <li>There are no methods to mutate the Uri, for example appending a new query variable.</li...
[ { "answer_id": 215864, "author": "Jason Whitehorn", "author_id": 27860, "author_profile": "https://Stackoverflow.com/users/27860", "pm_score": 3, "selected": false, "text": "Uri link = new Uri(new Uri(webSiteAddress), linkPulledFromSite);\nstring absoluteUrl = link.AbsoluteUri;\n" } ]
2008/10/19
[ "https://Stackoverflow.com/questions/215799", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5274/" ]
215,810
<p>I've got an unmanaged Linux VPS running ubuntu that I'm using for the web server for a personal website. I'd like to get a barebones email server up and running. All the installation guides I've found so far are for a full-fledged email server with a webmail interface and everything. That's a lot more than I need...
[ { "answer_id": 215858, "author": "Terry G Lorber", "author_id": 809, "author_profile": "https://Stackoverflow.com/users/809", "pm_score": 0, "selected": false, "text": "sudo apt-get install postfix\n" } ]
2008/10/19
[ "https://Stackoverflow.com/questions/215810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29262/" ]
215,820
<p>Years ago when I was working with C# I could easily create a temporary file and get its name with this function:</p> <pre><code>Path.GetTempFileName(); </code></pre> <p>This function would create a file with a unique name in the temporary directory and return the full path to that file. </p> <p>In the Cocoa API's...
[ { "answer_id": 215927, "author": "Ben Gottlieb", "author_id": 6694, "author_profile": "https://Stackoverflow.com/users/6694", "pm_score": 4, "selected": false, "text": "unistd.h [NSTemporaryDirectory() stringByAppendingPathComponent: [NSString stringWithFormat: @\"%.0f.%@\", [NSDate time...
2008/10/19
[ "https://Stackoverflow.com/questions/215820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28106/" ]
215,854
<p>When using XmlDocument.Load , I am finding that if the document refers to a DTD, a connection is made to the provided URI. Is there any way to prevent this from happening?</p>
[ { "answer_id": 215892, "author": "muratgu", "author_id": 26224, "author_profile": "https://Stackoverflow.com/users/26224", "pm_score": 1, "selected": false, "text": "XMLReader ValidationType None" }, { "answer_id": 216207, "author": "Richard Nienaber", "author_id": 9539, ...
2008/10/19
[ "https://Stackoverflow.com/questions/215854", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14357/" ]
215,883
<p>I have an s-expression bound to a variable in Common Lisp:</p> <pre><code>(defvar x '(+ a 2)) </code></pre> <p>Now I want to create a function that when called, evaluates the expression in the scope in which it was defined. I've tried this:</p> <pre><code>(let ((a 4)) (lambda () (eval x))) </code></pre> <p>an...
[ { "answer_id": 215922, "author": "sanxiyn", "author_id": 18382, "author_profile": "https://Stackoverflow.com/users/18382", "pm_score": 2, "selected": false, "text": "(ext:eval-env x (ext:the-environment))\n" }, { "answer_id": 218755, "author": "dsm", "author_id": 7780, ...
2008/10/19
[ "https://Stackoverflow.com/questions/215883", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7492/" ]
215,885
<p>If I add an after_save callback to an ActiveRecord model, and on that callback I use update_attribute to change the object, the callback is called again, and so a 'stack overflow' occurs (hehe, couldn't resist).</p> <p>Is it possible to avoid this behavior, maybe disabling the callback during it's execution? Or is ...
[ { "answer_id": 215888, "author": "Terry G Lorber", "author_id": 809, "author_profile": "https://Stackoverflow.com/users/809", "pm_score": 3, "selected": false, "text": "send(name.to_s + '=', value)\n" }, { "answer_id": 216762, "author": "Patrick McKenzie", "author_id": 15...
2008/10/19
[ "https://Stackoverflow.com/questions/215885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16957/" ]
215,891
<p>For performance reasons, I draw the strings for my UITableViewCell in a custom view that overrides its drawRect method to draw strings directly in the view rectangle using NSString:drawInRect. This is similar to Apple's TableViewSuite Example 5-CustomTableViewCell.</p> <p>However, when I invoke setEditing on the ce...
[ { "answer_id": 216382, "author": "rustyshelf", "author_id": 6044, "author_profile": "https://Stackoverflow.com/users/6044", "pm_score": 2, "selected": false, "text": "-(void)_refreshTableAndCells{\n //refresh the table\n [myCustomTableView reloadData];\n //refresh all the visibl...
2008/10/19
[ "https://Stackoverflow.com/questions/215891", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1967/" ]
215,896
<p>I'm writing a PHP script and the script outputs a simple text file log of the operations it performs. How would I use PHP to delete the first several lines from this file when it reaches a certain file size?</p> <p>Ideally, I would like it to keep the first two lines (date/time created and blank) and start deletin...
[ { "answer_id": 215898, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 0, "selected": false, "text": "open original file IN for reading\ncreate new output file OUT\nread the first two lines from IN\nwrite these lines to OUT...
2008/10/19
[ "https://Stackoverflow.com/questions/215896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27025/" ]
215,908
<h3>Note</h3> <p>This is not a REBOL-specific question. You can answer it in any language.</p> <h3>Background</h3> <p>The <a href="http://www.rebol.com" rel="nofollow noreferrer">REBOL</a> language supports the creation of domain-specific languages known as "dialects" in REBOL <em>parlance</em>. I've created such a ...
[ { "answer_id": 215952, "author": "Robert Gamble", "author_id": 25222, "author_profile": "https://Stackoverflow.com/users/25222", "pm_score": 4, "selected": true, "text": "#!/usr/bin/perl\n\nuse strict;\nuse warnings;\n\nmy @list1 = qw(1 2);\nmy @list2 = qw(3 4);\nmy @list3 = qw(5 6);\n\n...
2008/10/19
[ "https://Stackoverflow.com/questions/215908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27779/" ]
215,913
<p>I have ran into an odd problem with the ActionLink method in ASP.NET MVC Beta. When using the Lambda overload from the MVC futures I cannot seem to specify a parameter pulled from ViewData.</p> <p>When I try this:</p> <pre><code>&lt;%= Html.ActionLink&lt;PhotoController&gt;(p =&gt; p.Upload(((string)ViewData["grou...
[ { "answer_id": 216398, "author": "Schotime", "author_id": 29376, "author_profile": "https://Stackoverflow.com/users/29376", "pm_score": 2, "selected": false, "text": "<%= Html.ActionLink<HomeController>(x=>x.Search((string)ViewData[\"search\"]), \"search?\") %>\n" }, { "answer_id...
2008/10/19
[ "https://Stackoverflow.com/questions/215913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27860/" ]
215,954
<p>Does anyone know of any notepad++ plugin that saves a version of whatever I'm working on periodically? Ideally, it would save many versions with the automatic version number and the date in the title, and perhaps store them in a zipped archive to save space.</p> <p>Does something like this exist already, or shold I...
[ { "answer_id": 216024, "author": "Blorgbeard", "author_id": 369, "author_profile": "https://Stackoverflow.com/users/369", "pm_score": 3, "selected": false, "text": "hg commit" } ]
2008/10/19
[ "https://Stackoverflow.com/questions/215954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21475/" ]
215,959
<p>What's the best way to get a nice clean URL structure like stack overflow has? </p> <p>Do I need to use IIS for this? Or is there a way I can do it with some sort of mapping file in asp .net?</p> <p>The site I want this for has hundreds of pages, and is already deployed.<br> I would like a method that requires the...
[ { "answer_id": 216334, "author": "Cristian Libardo", "author_id": 16526, "author_profile": "https://Stackoverflow.com/users/16526", "pm_score": 3, "selected": true, "text": "<system.web>\n <urlMappings enabled=\"true\">\n <add url=\"~/test/\" mappedUrl=\"~/test.aspx\"/>\n </urlMappi...
2008/10/19
[ "https://Stackoverflow.com/questions/215959", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3153/" ]
215,961
<p>I am implementing a BFS, and what it is going to do is go through an ordered tree to find the shortest solution to a puzzle.</p> <p>What i will be doing is creating a Snapshot object that holds the current position of each piece in a puzzle. I will add this Snapshot object into the queue and check if it is the solu...
[ { "answer_id": 215995, "author": "Tomek", "author_id": 29326, "author_profile": "https://Stackoverflow.com/users/29326", "pm_score": 0, "selected": false, "text": "for (int i-0; i < constraint; i++)\nPiece \"Piece\"+i = new Piece();\n" }, { "answer_id": 216813, "author": "gbj...
2008/10/19
[ "https://Stackoverflow.com/questions/215961", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29326/" ]
215,963
<p>I've read the documentation on <a href="http://msdn.microsoft.com/en-us/library/ms776420(VS.85).aspx" rel="noreferrer">WideCharToMultiByte</a>, but I'm stuck on this parameter:</p> <pre><code>lpMultiByteStr [out] Pointer to a buffer that receives the converted string. </code></pre> <p>I'm not quite sure how to pro...
[ { "answer_id": 215973, "author": "Brian R. Bondy", "author_id": 3153, "author_profile": "https://Stackoverflow.com/users/3153", "pm_score": 4, "selected": false, "text": "#include <string>\n\nstd::string wstrtostr(const std::wstring &wstr)\n{\n // Convert a Unicode string to an ASCII ...
2008/10/19
[ "https://Stackoverflow.com/questions/215963", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23120/" ]
215,971
<p>It seems <a href="http://openlaszlo.org/" rel="nofollow noreferrer">OpenLaszlo</a> can <a href="http://www.antunkarlovac.com/blog/2008/02/19/writing-an-openlaszlo-air-application/" rel="nofollow noreferrer">run on AIR</a>. What's less obvious is whether OpenLaszlo apps can use the AIR-specific APIs, like file system...
[ { "answer_id": 3404703, "author": "raju-bitter", "author_id": 410652, "author_profile": "https://Stackoverflow.com/users/410652", "pm_score": 1, "selected": false, "text": "<canvas bgcolor=\"#ffffff\" debug=\"false\" height=\"100%\" width=\"100%\">\n\n <passthrough when=\"$as3\">\n ...
2008/10/19
[ "https://Stackoverflow.com/questions/215971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13041/" ]
215,988
<p>What is the Win32 API call to determine the system-wide font (in particular the color) for say Menus.</p> <p>This would be equivalent to going into Appearance Settings - Advanced - and then choosing Menu as the item to look at.</p> <p>I can use GetSysColor to find the colors of various system-wide window elements,...
[ { "answer_id": 35338788, "author": "CodesInChaos", "author_id": 445517, "author_profile": "https://Stackoverflow.com/users/445517", "pm_score": 3, "selected": false, "text": "SystemParametersInfo SystemParametersInfo(SPI_GETNONCLIENTMETRICS, ...) NONCLIENTMETRICS LOGFONT lfCaptionFont lf...
2008/10/19
[ "https://Stackoverflow.com/questions/215988", "https://Stackoverflow.com", "https://Stackoverflow.com/users/410357/" ]
216,000
<p>I was trying to compile a program using an external compiled object coreset.o. I wrote the public01.c test file and my functions are in computation.c, both of which compiles. However its failing on linking it together. What might be the problem?</p> <pre><code>gcc -o public01.x public01.o computation.o coreset.o...
[ { "answer_id": 8795449, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "sudo apt-get install ia32-libs \n" } ]
2008/10/19
[ "https://Stackoverflow.com/questions/216000", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9628/" ]
216,007
<p>My PHP/MS Sql Server 2005/win 2003 Application occasionally becomes very unresponsive, the memory/cpu usage does not spike. If i try to open any new connection from sql management studio, then the it just hangs at the open connection dialog box. how to deterime the total number of active connections ms sql server ...
[ { "answer_id": 216020, "author": "Mitch Wheat", "author_id": 16076, "author_profile": "https://Stackoverflow.com/users/16076", "pm_score": 9, "selected": true, "text": "SELECT \n DB_NAME(dbid) as DBName, \n COUNT(dbid) as NumberOfConnections,\n loginame as LoginName\nFROM\n s...
2008/10/19
[ "https://Stackoverflow.com/questions/216007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
216,008
<p>It just happens to me about one code design question. Say, I have one "template" method that invokes some functions that may "alter". A intuitive design is to follow "Template Design Pattern". Define the altering functions to be "virtual" functions to be overridden in subclasses. Or, I can just use delegate function...
[ { "answer_id": 216053, "author": "Michael Burr", "author_id": 12711, "author_profile": "https://Stackoverflow.com/users/12711", "pm_score": 1, "selected": false, "text": "this this" } ]
2008/10/19
[ "https://Stackoverflow.com/questions/216008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26349/" ]
216,019
<p>I have a .ini file with sensitive information in my php wab app. I denied access to it using a .htaccess file:</p> <pre><code>&lt;files my.ini&gt; order deny,allow deny from all &lt;/files&gt; </code></pre> <p>I don't have access to folders outside of htdocs, so I can't move the .ini file out of browsable terr...
[ { "answer_id": 20445807, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 3, "selected": false, "text": "my.ini -> changes to my.ini.php\n ;<?php\n;die(); // For further security\n;/*\n [category]\n name=\"value\"\n\n;*/\n ...
2008/10/19
[ "https://Stackoverflow.com/questions/216019", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3740/" ]
216,030
<p>Is there a better way to do the following:</p> <pre><code>$array = array('test1', 'test2', 'test3', 'test4', 'test5'); // do a bunch of other stuff, probably a loop $array[] = 'test6'; end($array); echo key($array); // gives me 6 </code></pre> <p>This will give the key of the most recently add array element.</p> ...
[ { "answer_id": 216039, "author": "Paolo Bergantino", "author_id": 16417, "author_profile": "https://Stackoverflow.com/users/16417", "pm_score": 4, "selected": true, "text": "$end = end(array_keys($array));\n function array_last_key($array) {\n end($array);\n return key($array);\n}\...
2008/10/19
[ "https://Stackoverflow.com/questions/216030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5441/" ]
216,037
<p>I've been thinking a lot lately about how to go about doing functional programming in C (<em>not</em> C++). Obviously, C is a procedural language and doesn't really support functional programming natively.</p> <p>Are there any compiler/language extensions that add some functional programming constructs to the lang...
[ { "answer_id": 216782, "author": "ephemient", "author_id": 20713, "author_profile": "https://Stackoverflow.com/users/20713", "pm_score": 6, "selected": true, "text": "callback = alloc_callback(&function, data) callback(arg1, ...) function(data, arg1, ...)" }, { "answer_id": 33785...
2008/10/19
[ "https://Stackoverflow.com/questions/216037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9530/" ]
216,049
<p>Sometimes you're developing and you decide to commit, forgetting you created a few files on your project. Then a few days down the line your buddy gets your build out of Subversion and complains that some files appear to be missing. You realize, ah crap, I forgot to add those files!</p> <p>How can I get a list of t...
[ { "answer_id": 216052, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 8, "selected": true, "text": "svn status svn status | grep ^?\n svn:ignore svn status" }, { "answer_id": 1082146, "author": "Damian Powell",...
2008/10/19
[ "https://Stackoverflow.com/questions/216049", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8123/" ]
216,068
<p>I am parsing an input text file. If I grab the input one line at a time using getline(), is there a way that I can search through the string to get an integer? I was thinking something similar to getNextInt() in Java. </p> <p>I know there has to be 2 numbers in that input line; however, these values will be separ...
[ { "answer_id": 216072, "author": "Eclipse", "author_id": 8701, "author_profile": "https://Stackoverflow.com/users/8701", "pm_score": 3, "selected": true, "text": "int i1, i2;\nstringstream ss(lineFromGetLine);\nss >> i1 >> i2;\n int i1, i2;\ntheFileStream >> i1 >> i2;\n" }, { "an...
2008/10/19
[ "https://Stackoverflow.com/questions/216068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29326/" ]
216,070
<p>I'm trying to create a POST request, unfortunately the body of the POST never seems to be sent.</p> <p>Below is the code that I'm using. The code is invoked when a user clicks on a link, not a form "submit" button. It runs without error, invokes the servlet that is being called but, as I mentioned earlier, the bo...
[ { "answer_id": 216074, "author": "Paolo Bergantino", "author_id": 16417, "author_profile": "https://Stackoverflow.com/users/16417", "pm_score": 4, "selected": true, "text": "parameters requestBody new Ajax.Request(sURL,\n{\n method: 'POST',\n parameters: 'hello=world&test=yes',\n ...
2008/10/19
[ "https://Stackoverflow.com/questions/216070", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4962/" ]
216,076
<p>Is it possible to scale a UIView down to 0 (width and height is 0) using CGAffineTransformMakeScale?</p> <p>view.transform = CGAffineTransformMakeScale(0.0f, 0.0f);</p> <p>Why would this throw an error of &quot;<code>&lt;Error&gt;: CGAffineTransformInvert: singular matrix.</code>&quot; ?</p> <br /> <br /> <p><em>Upd...
[ { "answer_id": 216322, "author": "Ben Gottlieb", "author_id": 6694, "author_profile": "https://Stackoverflow.com/users/6694", "pm_score": 3, "selected": false, "text": " 0 0 0\n 0 0 0\n 0 0 1\n" }, { "answer_id": 7869373, "author": "Mike Smith", "author_id": ...
2008/10/19
[ "https://Stackoverflow.com/questions/216076", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1987/" ]
216,083
<p>Looking for code samples to access a memory map file in C#</p>
[ { "answer_id": 4818216, "author": "Mubashar", "author_id": 806076, "author_profile": "https://Stackoverflow.com/users/806076", "pm_score": 1, "selected": false, "text": "CSFileMappingClient\nCSFileMappingServer\n" } ]
2008/10/19
[ "https://Stackoverflow.com/questions/216083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4653/" ]
216,093
<p>I am working on a desktop application in PyGTK and seem to be bumping up against some limitations of my file organization. Thus far I've structured my project this way:</p> <ul> <li>application.py - holds the primary application class (most functional routines)</li> <li>gui.py - holds a loosely coupled GTK gui imp...
[ { "answer_id": 216113, "author": "gimel", "author_id": 6491, "author_profile": "https://Stackoverflow.com/users/6491", "pm_score": 0, "selected": false, "text": "myapp/\n application/\n gui/\n command/\n state/\n __init__.py" }, { "answer_id": 216145, "author": "Jaime Sor...
2008/10/19
[ "https://Stackoverflow.com/questions/216093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24608/" ]
216,094
<p>I'm trying to get my head around SPL iterators and I've come up with 2 ways to handle it. I see the first version to be less complicated but the second version has composition feel to it (I think).</p> <p>What am I not seeing is which one is preferable over the other? Or am I just over complicating this?</p> <p>He...
[ { "answer_id": 217090, "author": "Michał Niedźwiedzki", "author_id": 2169, "author_profile": "https://Stackoverflow.com/users/2169", "pm_score": 2, "selected": false, "text": "IteratorAggregate IteratorAggregate getIterator() Iterator getChocolated() IteratorAggregate foreach class BoxOf...
2008/10/19
[ "https://Stackoverflow.com/questions/216094", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29230/" ]
216,102
<p>I do the following in command line:</p> <p>1) wget <a href="ftp://mirrors.kernel.org/gnu/gcc/gcc-3.4.6/gcc-3.4.6.tar.bz2" rel="nofollow noreferrer">ftp://mirrors.kernel.org/gnu/gcc/gcc-3.4.6/gcc-3.4.6.tar.bz2</a></p> <p>2) tar -jxf gcc-3.4.6.tar.bz2</p> <p>3) cd gcc-3.4.6</p> <p>4) cd libstdc++-v3</p> <p>5) ./c...
[ { "answer_id": 2345565, "author": "Eric", "author_id": 165082, "author_profile": "https://Stackoverflow.com/users/165082", "pm_score": 1, "selected": false, "text": "config/autorun.sh\n./configure <options>\nmake\nmake install\n" } ]
2008/10/19
[ "https://Stackoverflow.com/questions/216102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25700/" ]
216,119
<p>I want to have a function that will return the reverse of a list that it is given -- using recursion. How can I do that?</p>
[ { "answer_id": 216136, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 5, "selected": true, "text": "mylist = [1, 2, 3, 4, 5]\nbackwards = lambda l: (backwards (l[1:]) + l[:1] if l else []) \nprint backwards (mylist)\n" ...
2008/10/19
[ "https://Stackoverflow.com/questions/216119", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11324/" ]
216,124
<p>Say I have a struct "s" with an int pointer member variable "i". I allocate memory on the heap for i in the default constructor of s. Later in some other part of the code I pass an instance of s by value to some function. Am I doing a shallow copy here? Assume I didn't implement any copy constructors or assignme...
[ { "answer_id": 216152, "author": "Claudiu", "author_id": 15055, "author_profile": "https://Stackoverflow.com/users/15055", "pm_score": 2, "selected": false, "text": "s i i" }, { "answer_id": 216154, "author": "1800 INFORMATION", "author_id": 3146, "author_profile": "h...
2008/10/19
[ "https://Stackoverflow.com/questions/216124", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22471/" ]
216,138
<p>Are any of you aware of a library that helps you build/manipulate SQL queries, that supports JOIN's?</p> <p>It would give a lot of flexibility i'd think if you have something where you could return an object, that has some query set, and still be able to apply JOIN's to it, subqueries and such.</p> <p>I've search ...
[ { "answer_id": 216149, "author": "Christian C. Salvadó", "author_id": 5445, "author_profile": "https://Stackoverflow.com/users/5445", "pm_score": 3, "selected": false, "text": "$q = Doctrine_Query::create();\n$q->from('User u')\n->leftJoin('u.Group g')\n->innerJoin('u.Phonenumber p WITH ...
2008/10/19
[ "https://Stackoverflow.com/questions/216138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20538/" ]
216,141
<p>The point of this question is to create the shortest <b>not abusively slow</b> Sudoku solver. This is defined as: <b>don't recurse when there are spots on the board which can only possibly be one digit</b>.</p> <p>Here is the shortest I have so far in python:</p> <pre><code>r=range(81) s=range(1,10) def R(A): ...
[ { "answer_id": 216603, "author": "Claudiu", "author_id": 15055, "author_profile": "https://Stackoverflow.com/users/15055", "pm_score": 2, "selected": false, "text": "r=range(81);s=range(1,10)\ndef R(A):\n z={}\n for i in r:\n if A[i]!=0:continue\n h={}\n for j ...
2008/10/19
[ "https://Stackoverflow.com/questions/216141", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15055/" ]
216,155
<p>I want to allow users to paste <code>&lt;embed&gt;</code> and <code>&lt;object&gt;</code> HTML fragments (video players) via an HTML form. The server-side code is PHP. How can I protect against malicious pasted code, JavaScript, etc? I could parse the pasted code, but I'm not sure I could account for all variations....
[ { "answer_id": 216157, "author": "Paolo Bergantino", "author_id": 16417, "author_profile": "https://Stackoverflow.com/users/16417", "pm_score": 3, "selected": true, "text": "EMBED OBJECT [embed url=\"http://www.whatever.com/myvideo.whatever\" ...] <EMBED> $youtube = '<object width=\"425\...
2008/10/19
[ "https://Stackoverflow.com/questions/216155", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17307/" ]
216,173
<p>Is there anything in the header of an HTTP request that would allow me to differentiate between an AJAX call and a direct browser request from a given client? Are the user agent strings usually the same regardless?</p>
[ { "answer_id": 216183, "author": "Paul Dixon", "author_id": 6521, "author_profile": "https://Stackoverflow.com/users/6521", "pm_score": 6, "selected": true, "text": "xmlHttpRequest.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n" } ]
2008/10/19
[ "https://Stackoverflow.com/questions/216173", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5291/" ]
216,182
<p>When should I continue to make derived classes, and when should I just add conditionals to my code? eg for a missile</p> <pre><code>class Object; class Projectile : public Object; class Missile : public Projectile; class MissileGuided : public Missile; </code></pre> <p>Or should I implement that last one in the m...
[ { "answer_id": 216194, "author": "Vlad Gudim", "author_id": 22088, "author_profile": "https://Stackoverflow.com/users/22088", "pm_score": 4, "selected": true, "text": "interface INavigable {\n Course calcCourse (Position current, Destination dest);\n}\n\n\nClass GeoStationaryRocketCPU i...
2008/10/19
[ "https://Stackoverflow.com/questions/216182", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6266/" ]
216,185
<p>Suppose to have a code like this:</p> <pre><code>&lt;div class="notSelected"&gt; &lt;label&gt;Name &lt;input type="text" name="name" id="name" /&gt; &lt;/label&gt; &lt;div class="description"&gt; Tell us what's your name to make us able to fake to be your friend whe...
[ { "answer_id": 216214, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 4, "selected": true, "text": "<div class=\"selectable\"> (=off) vs. <div class=\"selectable selected\"> (=on)\n $(document).ready(function(){\n\n // ha...
2008/10/19
[ "https://Stackoverflow.com/questions/216185", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21384/" ]
216,197
<p>I was using mysql++ library and compiling with GCC 3.3.4.<br> That GCC version had some bugs so I upgraded to GCC 3.4.6.<br> After upgrading GCC I rebuilt mysql++ and recompiled my program. But now I get a segmentation fault error.</p> <p>I get the following message:</p> <blockquote> <p>./mysqlTest: Symbol `_ZTV...
[ { "answer_id": 216213, "author": "Mihai Limbășan", "author_id": 14444, "author_profile": "https://Stackoverflow.com/users/14444", "pm_score": 3, "selected": true, "text": "ldd ldd" } ]
2008/10/19
[ "https://Stackoverflow.com/questions/216197", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25700/" ]
216,202
<p>I have a command that runs fine if I ssh to a machine and run it, but fails when I try to run it using a remote ssh command like : </p> <pre><code>ssh user@IP &lt;command&gt; </code></pre> <p>Comparing the output of "env" using both methods resutls in different environments. When I manually login to the machine an...
[ { "answer_id": 1472444, "author": "Ian Vaughan", "author_id": 119790, "author_profile": "https://Stackoverflow.com/users/119790", "pm_score": 7, "selected": false, "text": "ssh user@host \"source /etc/profile; /path/script.sh\" ~/.bash_profile ~/.bashrc" }, { "answer_id": 4173699...
2008/10/19
[ "https://Stackoverflow.com/questions/216202", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13523/" ]
216,203
<p>I have a 'framework' in Flex which loads and destroys child 'sections', which are instances of module classes. These have a lot of webservice and animation in them and are part of a public facing site.</p> <p>Before I remove a section from the screen I call a 'hideSection()' interface method on the instance. In thi...
[ { "answer_id": 216477, "author": "moritzstefaner", "author_id": 23069, "author_profile": "https://Stackoverflow.com/users/23069", "pm_score": 0, "selected": false, "text": "removeEventListener(this, listenerFunction, eventType);\n" } ]
2008/10/19
[ "https://Stackoverflow.com/questions/216203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24727/" ]
216,206
<p>Does anybody know any resources on this subject?</p> <p>I'm developing an embedded application for 2x16 LCD display. Ideally I would like to have a general (display independent) framework, that could be used virtually on any display - one or more segment(s) LED, 1x16, 2x16 LCD, etc. Also would like to learn about g...
[ { "answer_id": 216215, "author": "Steve Moyer", "author_id": 17008, "author_profile": "https://Stackoverflow.com/users/17008", "pm_score": 2, "selected": false, "text": "<command>[<address>][<data>] a\n ---\nf| g |b\n ---\ne| |c\n ---\n d\n" } ]
2008/10/19
[ "https://Stackoverflow.com/questions/216206", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1692070/" ]
216,209
<p>I'm looking for the best way to tell if an <code>&lt;mx:Image&gt;</code> has already fired the 'Event.COMPLETE' event. I want to do something if it has shown, or attach an event handler if it hasnt yet.</p> <p>something like :</p> <pre><code>if (newBackground.percentLoaded &lt; 100) </code></pre> <p>or</p> <pre...
[ { "answer_id": 216264, "author": "hasseg", "author_id": 4111, "author_profile": "https://Stackoverflow.com/users/4111", "pm_score": 2, "selected": true, "text": "Event.COMPLETE mx.controls.Image \"loadingCompleted\" \"complete\" false true Event.COMPLETE" }, { "answer_id": 216696...
2008/10/19
[ "https://Stackoverflow.com/questions/216209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24727/" ]
216,212
<p>What are the best practices and rules-of-thumb to follow while maintaining code? Is it good practice to have only the production ready code in the development branch, or should untested latest code be available in the development branch?</p> <p>How do you guys maintain your development code and production code?</p...
[ { "answer_id": 216228, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 8, "selected": true, "text": "master master dev next maintenance hot-fix dev master dev master dev master rocketraman/gitworkflow" } ]
2008/10/19
[ "https://Stackoverflow.com/questions/216212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2220518/" ]
216,233
<p>I wrote a program which includes writing and reading from database. When I run the app and try to perform writing I call the following method:</p> <pre><code>public static void AddMessage(string callID, string content) { string select = "INSERT INTO Sporocilo (oznaka_klica, smer, vsebina, pr...
[ { "answer_id": 216262, "author": "Russ Cam", "author_id": 1831, "author_profile": "https://Stackoverflow.com/users/1831", "pm_score": 0, "selected": false, "text": "public static int AddMessage(string callID, string content)\n {\n Int32 newProdID = 0\n string select =\n ...
2008/10/19
[ "https://Stackoverflow.com/questions/216233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22996/" ]
216,255
<p>I am writing a small program. The interface I am writing to control each repository that is made defines a method of Save(IPublicObject). I am using LINQ for the SQL Version of the repository CRUD. My question is this. I would like to have only the one method which accepts the interface type. I want to think ho...
[ { "answer_id": 216388, "author": "Aleris", "author_id": 20417, "author_profile": "https://Stackoverflow.com/users/20417", "pm_score": 0, "selected": false, "text": "Repository.Save(publicObject)\n public class Repository {\n public void Save(IPublicObject publicObject) {\n publ...
2008/10/19
[ "https://Stackoverflow.com/questions/216255", "https://Stackoverflow.com", "https://Stackoverflow.com/users/67959/" ]
216,259
<p>Is there a max length for an array in C++?</p> <p>Is it a C++ limit or does it depend on my machine? Is it tweakable? Does it depend on the type the array is made of?</p> <p>Can I break that limit somehow or do I have to search for a better way of storing information? And what should be the simplest way?</p> <p>W...
[ { "answer_id": 216266, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 8, "selected": true, "text": "std::size_t vector<int> vector<char> int char vector<char> vector<int> int[] char[] allocator vector allocator" }, ...
2008/10/19
[ "https://Stackoverflow.com/questions/216259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22963/" ]
216,278
<p>Out style:</p> <pre><code>bool result; if(something.TryParse(val, out result)) { DoSomething(result); } </code></pre> <p>Nullable style:</p> <pre><code>bool? result = something.TryParse2(val); if(result.HasValue) { DoSomething(result.Value); } </code></pre>
[ { "answer_id": 216656, "author": "JaredPar", "author_id": 23283, "author_profile": "https://Stackoverflow.com/users/23283", "pm_score": 0, "selected": false, "text": "\nvar result = Int32.TryParse(\"123\");\n" }, { "answer_id": 216892, "author": "Robert Rossney", "author_...
2008/10/19
[ "https://Stackoverflow.com/questions/216278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16526/" ]
216,294
<p>I've been playing with some algorithms on the internet for a while and I can't seem to get them to work, so I'm tossing the question out here;</p> <p>I am attempting to render a velocity vector line from a point. Drawing the line isn't difficult: just insert a line with length <code>velocity.length</code> into the ...
[ { "answer_id": 216319, "author": "House MD", "author_id": 29163, "author_profile": "https://Stackoverflow.com/users/29163", "pm_score": 1, "selected": true, "text": "z_vec" } ]
2008/10/19
[ "https://Stackoverflow.com/questions/216294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23845/" ]
216,315
<p>As it was made clear in my <a href="https://stackoverflow.com/questions/212009/do-i-have-to-explicitly-call-systemexit-in-a-webstart-application">recent question</a>, Swing applications need to explicitly call System.exit() when they are ran using the Sun Webstart launcher (at least as of Java SE 6).</p> <p>I want ...
[ { "answer_id": 216412, "author": "Oleg Barshay", "author_id": 2043539, "author_profile": "https://Stackoverflow.com/users/2043539", "pm_score": 2, "selected": false, "text": "private boolean isRunningJavaWebStart() {\n return System.getProperty(\"javawebstart.version\", null) != null;...
2008/10/19
[ "https://Stackoverflow.com/questions/216315", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18187/" ]
216,333
<p>When i use any of the other strongly typed HTML helpers after typing for example </p> <pre><code>Html.Actionlink&lt;HomeController&gt;(x=&gt;x. </code></pre> <p>This pops up intellisense on the methods that the HomeController class has. However for the example above, this does not happen. Only after inserting the ...
[ { "answer_id": 216618, "author": "Paco", "author_id": 13376, "author_profile": "https://Stackoverflow.com/users/13376", "pm_score": 1, "selected": false, "text": "Html.Actionlink<YourControllerType>(x=>x.\n" } ]
2008/10/19
[ "https://Stackoverflow.com/questions/216333", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29376/" ]
216,341
<p>I want to apply a function to all columns in a matrix with MATLAB. For example, I'd like to be able to call smooth on every column of a matrix, instead of having smooth treat the matrix as a vector (which is the default behaviour if you call <code>smooth(matrix)</code>).</p> <p>I'm sure there must be a more idiomat...
[ { "answer_id": 216468, "author": "bastibe", "author_id": 1034, "author_profile": "https://Stackoverflow.com/users/1034", "pm_score": 0, "selected": false, "text": "m(:,:) = m(:)" }, { "answer_id": 216504, "author": "Hallgrim", "author_id": 15454, "author_profile": "ht...
2008/10/19
[ "https://Stackoverflow.com/questions/216341", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3829/" ]
216,360
<p>What I'd like to accomplish is to present charts on webpages. For example aspx pages gridviews that present a two column table are able to be copied &amp; placed into Excel then a chart created. The pages I currently use most are ASP.NET 3.0 or SharePoint team sites with stored procedures. People are very interested...
[ { "answer_id": 216379, "author": "Tim C", "author_id": 7585, "author_profile": "https://Stackoverflow.com/users/7585", "pm_score": 1, "selected": false, "text": "<v:shape\n fillcolor=\"green\"\n style=\"position:relative;top:1;left:1;width:200;height:200\"\n path = \"m 1,1 l 1,2...
2008/10/19
[ "https://Stackoverflow.com/questions/216360", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17877/" ]
216,391
<p>I was just wondering, if by moving complex if else statements and the resulting html markup to the code behind violates some 'MVC' law?</p> <p>It seems like a great option when faced with inline if else statements that can become extremely unreadable.</p>
[ { "answer_id": 216866, "author": "Panos", "author_id": 8049, "author_profile": "https://Stackoverflow.com/users/8049", "pm_score": 2, "selected": true, "text": "HtmlHelper Html.MoneyTextBox() Html.OptionGroup() Html.Pager<T> public class CustomerInfo\n{\n public Customer Customer { get;...
2008/10/19
[ "https://Stackoverflow.com/questions/216391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29376/" ]
216,401
<p>Is there a way to set a different value for service startup timeout per service? I can change it using the ServicesPipeTimeout registry key, but it's per machine (<a href="http://support.microsoft.com/kb/824344" rel="noreferrer">http://support.microsoft.com/kb/824344</a>).</p> <p>At the moment the only thing I thou...
[ { "answer_id": 909588, "author": "Hinek", "author_id": 20580, "author_profile": "https://Stackoverflow.com/users/20580", "pm_score": 6, "selected": false, "text": "protected override void OnStart()\n{\n this.RequestAdditionalTime(10000);\n // do your stuff\n}\n" }, { "answe...
2008/10/19
[ "https://Stackoverflow.com/questions/216401", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19956/" ]
216,409
<p>I have a very strange problem, when I try to <code>var_dump</code> (or <code>print_r</code>) a Doctrine Object, my Apache responses with an empty blank page (200 OK header). I can <code>var_dump</code> a normal php var like:</p> <pre><code>$dummy = array("a" =&gt; 1, "b" =&gt;2); </code></pre> <p>And it works fine...
[ { "answer_id": 216427, "author": "Greg", "author_id": 24181, "author_profile": "https://Stackoverflow.com/users/24181", "pm_score": 2, "selected": true, "text": "print_r() ini_set('memory_limit', '256M'); var_dump print_r var_dump" }, { "answer_id": 3799164, "author": "Julien...
2008/10/19
[ "https://Stackoverflow.com/questions/216409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
216,426
<p>As I understand it, when asked to reserve a larger block of memory, the realloc() function will do one of three different things:</p> <p><code><pre> if free contiguous block exists grow current block else if sufficient memory allocate new memory copy old memory to new free old memory else return...
[ { "answer_id": 216462, "author": "Rômulo Ceccon", "author_id": 23193, "author_profile": "https://Stackoverflow.com/users/23193", "pm_score": 4, "selected": true, "text": "realloc() malloc()" }, { "answer_id": 216492, "author": "Jonathan Leffler", "author_id": 15168, "...
2008/10/19
[ "https://Stackoverflow.com/questions/216426", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2289/" ]
216,428
<p>Highly embedded (limited code and ram size) projects pose unique challenges for code organization.</p> <p>I have seen quite a few projects with no organization at all. (Mostly by hardware engineers who, in my experience are not typically concerned with non-functional aspects of code.)</p> <p>However, I have been t...
[ { "answer_id": 216532, "author": "Jason Cohen", "author_id": 4926, "author_profile": "https://Stackoverflow.com/users/4926", "pm_score": 2, "selected": false, "text": "#include" } ]
2008/10/19
[ "https://Stackoverflow.com/questions/216428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/445087/" ]
216,430
<p>We have several websites on different domains and I'd like to be able to track users' movements on these sites.</p> <ul> <li>Obviously cookies are not feasable, because they don't cross domain borders. </li> <li>I could look at a combination of IP address and User Agent, but there are some cases where that does not...
[ { "answer_id": 29267318, "author": "Neil McGuigan", "author_id": 223478, "author_profile": "https://Stackoverflow.com/users/223478", "pm_score": 3, "selected": false, "text": "If getCookie(\"c\") == null then setCookie(\"c\", \"anyValue\") uaid GET http://child.com/any-page getCookie(\"c...
2008/10/19
[ "https://Stackoverflow.com/questions/216430", "https://Stackoverflow.com", "https://Stackoverflow.com/users/999/" ]
216,450
<p>I have a C++ library and a C++ application trying to use functions and classes exported from the library. The library builds fine and the application compiles but fails to link. The errors I get follow this form:</p> <blockquote> <p>app-source-file.cpp:(.text+0x2fdb): undefined reference to `lib-namespace::GetSta...
[ { "answer_id": 216488, "author": "Christian.K", "author_id": 21567, "author_profile": "https://Stackoverflow.com/users/21567", "pm_score": 2, "selected": false, "text": "g++ -fPIC -Wall -O3 -L~/project/lib/release -lfoobar\n g++ -fPIC -Wall -O3 ~/project/lib/release/libfoobar.so\n" }...
2008/10/19
[ "https://Stackoverflow.com/questions/216450", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16429/" ]
216,463
<p>I would like to use a TypeCoverter to regionalise output for enums in an assembly that is a PIA loaded into Excel.</p> <p>I can run this and it works on an assembly in a test project I created with an explicitly referenceed assembly, however when running a project that has been built as an Excel PIA. If I try: _ ...
[ { "answer_id": 216488, "author": "Christian.K", "author_id": 21567, "author_profile": "https://Stackoverflow.com/users/21567", "pm_score": 2, "selected": false, "text": "g++ -fPIC -Wall -O3 -L~/project/lib/release -lfoobar\n g++ -fPIC -Wall -O3 ~/project/lib/release/libfoobar.so\n" }...
2008/10/19
[ "https://Stackoverflow.com/questions/216463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6684/" ]
216,470
<ul> <li>Is there a key shortcut for this in XCode?</li> <li>Can I implement an Applescript for this and run it within XCode?</li> </ul>
[ { "answer_id": 2879198, "author": "rsfinn", "author_id": 34498, "author_profile": "https://Stackoverflow.com/users/34498", "pm_score": 1, "selected": false, "text": "[Foo alloc]<cursor>\n [Foo alloc] init<cursor>\n [[Foo alloc] init]<cursor>\n" } ]
2008/10/19
[ "https://Stackoverflow.com/questions/216470", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
216,478
<p>We're getting ready to translate our PHP website into various languages, and the gettext support in PHP looks like the way to go.</p> <p>All the tutorials I see recommend using the english text as the message ID, i.e.</p> <p>gettext("Hi there!")</p> <p>But is that really a good idea? Let's say someone in marketi...
[ { "answer_id": 216807, "author": "chroder", "author_id": 18802, "author_profile": "https://Stackoverflow.com/users/18802", "pm_score": 5, "selected": true, "text": "welcome_back_1 welcome back, %1" }, { "answer_id": 35101069, "author": "Timo Huovinen", "author_id": 175071...
2008/10/19
[ "https://Stackoverflow.com/questions/216478", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29394/" ]
216,480
<p>Somewhat-simplified example situation: I have entities A and B which are incredibly "heavy" domain objects. Loading one from the database is a pretty big deal. Then I have an entity C, which is a very simple object that has a label string, one A, and one B -- both lazy.</p> <p>I'm doing some low-level querying to c...
[ { "answer_id": 216807, "author": "chroder", "author_id": 18802, "author_profile": "https://Stackoverflow.com/users/18802", "pm_score": 5, "selected": true, "text": "welcome_back_1 welcome back, %1" }, { "answer_id": 35101069, "author": "Timo Huovinen", "author_id": 175071...
2008/10/19
[ "https://Stackoverflow.com/questions/216480", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27614/" ]
216,484
<p>I have a groovy script with an unknown number of variables in context at runtime, how do I find them all and print the name and value of each?</p>
[ { "answer_id": 216507, "author": "Ted Naleid", "author_id": 8912, "author_profile": "https://Stackoverflow.com/users/8912", "pm_score": 6, "selected": true, "text": "foo = \"abc\"\nbar = \"def\"\n\nif (true) {\n baz = \"ghi\"\n this.binding.variables.each {k,v -> println \"$k = $v\...
2008/10/19
[ "https://Stackoverflow.com/questions/216484", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2031/" ]
216,510
<p>I understand that <code>inline</code> by itself is a suggestion to the compiler, and at its discretion it may or may not inline the function, and it will also produce linkable object code.</p> <p>I think that <code>static inline</code> does the same (may or may not inline) but will not produce linkable object code ...
[ { "answer_id": 216546, "author": "puetzk", "author_id": 14312, "author_profile": "https://Stackoverflow.com/users/14312", "pm_score": 7, "selected": false, "text": "inline static inline extern inline inline extern inline static inline inline extern inline static inline static inline exte...
2008/10/19
[ "https://Stackoverflow.com/questions/216510", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
216,513
<p>Just getting started with Linq to SQL so forgive the newbie question. I'm trying to reproduce the following (working) query in Linq to SQL (VB.NET):</p> <pre><code>Select f.Title, TotalArea = Sum(c.Area) From Firms f Left Join Concessions c on c.FirmID = f.FirmID Group By f.Title Order by Sum(c.Area) DESC <...
[ { "answer_id": 216573, "author": "Herb Caudill", "author_id": 239663, "author_profile": "https://Stackoverflow.com/users/239663", "pm_score": 6, "selected": true, "text": "From c In Concessions _\nJoin f In Firms on f.FirmID equals c.FirmID _\nGroup by f.Title _\nInto TotalArea = sum(c.O...
2008/10/19
[ "https://Stackoverflow.com/questions/216513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/239663/" ]
216,523
<p>I want to ask a question about how you would approach a simple object-oriented design problem. I have a few ideas of my own about what the best way of tackling this scenario, but I would be interested in hearing some opinions from the Stack Overflow community. Links to relevant online articles are also appreciated. ...
[ { "answer_id": 216765, "author": "Federico A. Ramponi", "author_id": 18770, "author_profile": "https://Stackoverflow.com/users/18770", "pm_score": 3, "selected": false, "text": "# --------- PERSON ----------------\n\nclass Person:\n def __init__(self, personId, name, dateOfBirth, addr...
2008/10/19
[ "https://Stackoverflow.com/questions/216523", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7532/" ]
216,536
<p>I'm relatively new to web application programming so I hope this question isn't too basic for everyone. </p> <p>I created a HTML page with a FORM containing a dojox datagrid (v1.2) filled with rows of descriptions for different grocery items. After the user selects the item he's interested in, he will click on th...
[ { "answer_id": 216785, "author": "extraneon", "author_id": 24582, "author_profile": "https://Stackoverflow.com/users/24582", "pm_score": 3, "selected": true, "text": "<html>\n <head>\n </head>\n <body>\n <script type=\"text/javascript\">\n function updateSelectedItemId() {\n ...
2008/10/19
[ "https://Stackoverflow.com/questions/216536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27163/" ]
216,538
<p>What is the best way to format a decimal if I only want decimal displayed if it is not an integer.</p> <p>Eg:</p> <pre><code>decimal amount = 1000M decimal vat = 12.50M </code></pre> <p>When formatted I want:</p> <pre><code>Amount: 1000 (not 1000.0000) Vat: 12.5 (not 12.50) </code></pre>
[ { "answer_id": 216550, "author": "Richard Nienaber", "author_id": 9539, "author_profile": "https://Stackoverflow.com/users/9539", "pm_score": 6, "selected": true, "text": " decimal one = 1000M;\n decimal two = 12.5M;\n\n Console.WriteLine(one.ToString(\"0.##\"));\n Console.Wr...
2008/10/19
[ "https://Stackoverflow.com/questions/216538", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8547/" ]
216,542
<p>I need to figure out a way uniquely identify each computer which visits the web site I am creating. Does anybody have any advice on how to achieve this?</p> <p>Because i want the solution to work on all machines and all browsers (within reason) I am trying to create a solution using javascript.</p> <p>Cookies will n...
[ { "answer_id": 12162449, "author": "Steve Wortham", "author_id": 102896, "author_profile": "https://Stackoverflow.com/users/102896", "pm_score": 3, "selected": false, "text": "__utma getUniqueId()" }, { "answer_id": 16376795, "author": "Mr Programmer", "author_id": 530410...
2008/10/19
[ "https://Stackoverflow.com/questions/216542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3746/" ]
216,588
<p>I am displaying a scrolled data table in a web page. This table has several thousands of dynamic rows, so it is loaded from the server (via AJAX).</p> <p>The user can scroll up and down, so what I need is to <strong>detect when the user reaches the end of the scrollbar</strong> (that is, the last row at the bottom...
[ { "answer_id": 216607, "author": "Yuval Adam", "author_id": 24545, "author_profile": "https://Stackoverflow.com/users/24545", "pm_score": 2, "selected": false, "text": "$wnd.onscroll = function() {\n if (($wnd.height - $wnd.scrollTop) < SOME_MARGIN) then doSomething();\n};\n" }, {...
2008/10/19
[ "https://Stackoverflow.com/questions/216588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12388/" ]
216,600
<p>How would I go about adding <code>enctype="multipart/form-data"</code> to a form that is generated by using <code>&lt;% Html.BeginForm(); %&gt;</code>?</p>
[ { "answer_id": 216604, "author": "liggett78", "author_id": 19762, "author_profile": "https://Stackoverflow.com/users/19762", "pm_score": 9, "selected": true, "text": "Html.BeginForm(\n action, controller, FormMethod.Post, new { enctype=\"multipart/form-data\"})\n null Html.BeginForm(\...
2008/10/19
[ "https://Stackoverflow.com/questions/216600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1469/" ]
216,612
<p>Does anyone know of a good dictionary API or ruby library to lookup the definitions of words?</p> <p>I'm thinking it should work something like:</p> <ol> <li>I call get_definition(word)</li> <li>It returns the definition for that word (ideally in some way to easily format the definition for display.</li> </ol> <p...
[ { "answer_id": 216630, "author": "Ross", "author_id": 2025, "author_profile": "https://Stackoverflow.com/users/2025", "pm_score": 4, "selected": false, "text": "http://dictionary.cambridge.org/learnenglish/results.asp?searchword=SEARCH_PHRASE&dict=L\n /* BC double-click pop-up dictionary...
2008/10/19
[ "https://Stackoverflow.com/questions/216612", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16876/" ]
216,616
<p>How can I construct the following string in an Excel formula:</p> <blockquote> <p>Maurice &quot;The Rocket&quot; Richard</p> </blockquote> <p>If I'm using single quotes, it's trivial: <code>=&quot;Maurice 'The Rocket' Richard&quot;</code> but what about double quotes?</p>
[ { "answer_id": 216623, "author": "YonahW", "author_id": 3821, "author_profile": "https://Stackoverflow.com/users/3821", "pm_score": 10, "selected": true, "text": "= \"Maurice \"\"The Rocket\"\" Richard\"\n" }, { "answer_id": 218474, "author": "Dave DuPlantis", "author_id"...
2008/10/19
[ "https://Stackoverflow.com/questions/216616", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2443/" ]
216,657
<p>I have a table called logs which has a datetime field. I want to select the date and count of rows based on a particular date format. </p> <p>How do I do this using SQLAlchemy?</p>
[ { "answer_id": 216730, "author": "Jonathan Leffler", "author_id": 15168, "author_profile": "https://Stackoverflow.com/users/15168", "pm_score": 0, "selected": false, "text": "SELECT date_formatter(datetime_field, \"format-specification\") AS dt_field, COUNT(*)\n FROM logs\n GROUP B...
2008/10/19
[ "https://Stackoverflow.com/questions/216657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1448/" ]
216,673
<p>When I worked on the <a href="http://framework.zend.com/manual/en/zend.db.html" rel="noreferrer">Zend Framework's database component</a>, we tried to abstract the functionality of the <code>LIMIT</code> clause supported by MySQL, PostgreSQL, and SQLite. That is, creating a query could be done this way:</p> <pre><c...
[ { "answer_id": 720280, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 3, "selected": false, "text": "SELECT TOP n *\nFROM tablename\nWHERE key NOT IN (\n SELECT TOP x key\n FROM tablename\n ORDER BY key\n DESC\n);\n...
2008/10/19
[ "https://Stackoverflow.com/questions/216673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20860/" ]
216,674
<p>What is the best way to manage the JavaScript files and the functions/objects context in an ASP.NET MVC app?</p>
[ { "answer_id": 216729, "author": "Moran Helman", "author_id": 1409636, "author_profile": "https://Stackoverflow.com/users/1409636", "pm_score": 0, "selected": false, "text": "mainApp = function(){\n\n return {\n\n init: function(){\n\n },\n\n function1: function(){\n\...
2008/10/19
[ "https://Stackoverflow.com/questions/216674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1409636/" ]
216,710
<p>When I run the following, PowerShell hangs waiting for the dialog to close, even though the dialog is never displayed:</p> <pre><code>[void] [Reflection.Assembly]::LoadWithPartialName( 'System.Windows.Forms' ) $d = New-Object Windows.Forms.OpenFileDialog $d.ShowDialog( ) </code></pre> <p>Calling <code>ShowDialog</...
[ { "answer_id": 216738, "author": "Steven Murawski", "author_id": 1233, "author_profile": "https://Stackoverflow.com/users/1233", "pm_score": 5, "selected": true, "text": "[void] [Reflection.Assembly]::LoadWithPartialName( 'System.Windows.Forms' )\n$d = New-Object Windows.Forms.OpenFileDi...
2008/10/19
[ "https://Stackoverflow.com/questions/216710", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2495/" ]
216,716
<p>In a <a href="https://stackoverflow.com/questions/215933/gcc-compiler-error-on-windows-xp">recent issue</a>, I've found that DJGPP can only accept the DOS command line character limit. To work around this limitation, I've decided to try to write a makefile to allow me to <a href="http://www.delorie.com/djgpp/v2faq/...
[ { "answer_id": 216767, "author": "Jonathan Leffler", "author_id": 15168, "author_profile": "https://Stackoverflow.com/users/15168", "pm_score": 2, "selected": false, "text": ".s .asm %.o : %.asm" } ]
2008/10/19
[ "https://Stackoverflow.com/questions/216716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1256/" ]
216,748
<p>What are the pros and cons of using nested public C++ classes and enumerations? For example, suppose you have a class called <code>printer</code>, and this class also stores information on output trays, you could have:</p> <pre><code>class printer { public: std::string name_; enum TYPE { TYPE_...
[ { "answer_id": 216760, "author": "paercebal", "author_id": 14089, "author_profile": "https://Stackoverflow.com/users/14089", "pm_score": 7, "selected": true, "text": "class A\n{\n public :\n class B { /* etc. */ } ;\n\n // etc.\n} ;\n class A\n{\n public :\n class B ;\n\n...
2008/10/19
[ "https://Stackoverflow.com/questions/216748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9236/" ]
216,749
<p>I have a WPF project defined like this:</p> <pre> MyApp.sln MyAppWPF MyApp.Domain </pre> <p>In one of my xaml files in the MyAppWPF project I'm trying to reference a class defined in MyApp.Domain project. I have a <strong>project reference</strong> in MyAppWPF to MyApp.Domain. I am trying to create the refer...
[ { "answer_id": 28754607, "author": "Kaitlin Hipkin", "author_id": 4548035, "author_profile": "https://Stackoverflow.com/users/4548035", "pm_score": 1, "selected": false, "text": "assembly=MyApp.Domain xmlns:local=\"clr-namespace:MyApp.Domain\"" }, { "answer_id": 31970937, "au...
2008/10/19
[ "https://Stackoverflow.com/questions/216749", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16501/" ]
216,766
<p>File formats I would like to play include .wav, .mp3, .midi.</p> <p>I have tried using the Wireless Toolkit classes with no success. I have also tried using the AudioClip class that is part of the Samsung SDK; again with</p>
[ { "answer_id": 223691, "author": "Irfan Mulic", "author_id": 27016, "author_profile": "https://Stackoverflow.com/users/27016", "pm_score": 3, "selected": true, "text": "// Code starts here put this into midlet run() method\n\npublic void run()\n{\n try\n {\n InputStream is = getClas...
2008/10/19
[ "https://Stackoverflow.com/questions/216766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9771/" ]
216,771
<p>I know that this is a simple question for PHP guys but I don't know the language and just need to do a simple "get" from another web page when my page is hit. i.e. signal the other page that this page has been hit.</p> <p>EDIT: curl is not available to me.</p>
[ { "answer_id": 216774, "author": "troelskn", "author_id": 18180, "author_profile": "https://Stackoverflow.com/users/18180", "pm_score": 4, "selected": true, "text": "file_get_contents('http://www.example.org');\n" }, { "answer_id": 216776, "author": "Greg", "author_id": 2...
2008/10/19
[ "https://Stackoverflow.com/questions/216771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1463/" ]
216,781
<p>I have a java webapp that has to be deployed on either Win or Linux machines. I now want to add log4j for logging and I'd like to use a relative path for the log file as I don't want to change the file path on every deployment. The container will most likely be Tomcat but not necessarily.</p> <p>What's the best way...
[ { "answer_id": 216805, "author": "Steve K", "author_id": 739, "author_profile": "https://Stackoverflow.com/users/739", "pm_score": 7, "selected": false, "text": "log4j.rootCategory=DEBUG,errorfile\n\nlog4j.appender.errorfile.File=${catalina.home}/logs/LogFilename.log\n ${catalina.home} $...
2008/10/19
[ "https://Stackoverflow.com/questions/216781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2697/" ]
216,790
<p>What's the best way to get the last inserted id using sqlite from Java? Google is giving me different answers--some say select the last-insert-rowid; others say call statement.getGeneratedKeys(). What's the best route to take? (I just want to return the id, not use it for other inserts or anything.)</p>
[ { "answer_id": 217391, "author": "Brian", "author_id": 700, "author_profile": "https://Stackoverflow.com/users/700", "pm_score": 5, "selected": true, "text": "getGeneratedKeys() getGeneratedKeys()" }, { "answer_id": 621896, "author": "David Citron", "author_id": 5309, ...
2008/10/19
[ "https://Stackoverflow.com/questions/216790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29173/" ]
216,796
<p>For homework, I was given the following 8 code fragments to analyze and give a Big-Oh notation for the running time. Can anybody please tell me if I'm on the right track? </p> <pre><code>//Fragment 1 for(int i = 0; i &lt; n; i++) sum++; </code></pre> <p>I'm thinking O(N) for fragment 1</p> <pre><code>//Frag...
[ { "answer_id": 8121746, "author": "Arnab Datta", "author_id": 528617, "author_profile": "https://Stackoverflow.com/users/528617", "pm_score": 0, "selected": false, "text": "for(i = 0; i < n; i++) {\n for(j = 0; j < 100; j++){....}\n}\n ..." } ]
2008/10/19
[ "https://Stackoverflow.com/questions/216796", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14013/" ]
216,817
<p>Similar to <a href="https://stackoverflow.com/questions/216710/call-openfiledialog-from-powershell">this question</a>, after running the following code the browser dialog does appear with all the correct buttons, but the selection area that usally displays available folders is missing:</p> <pre><code>[void] [Reflec...
[ { "answer_id": 217527, "author": "Gordon Bell", "author_id": 16473, "author_profile": "https://Stackoverflow.com/users/16473", "pm_score": 5, "selected": true, "text": "$app = new-object -com Shell.Application\n$folder = $app.BrowseForFolder(0, \"Select Folder\", 0, \"C:\\\")\nif ($folde...
2008/10/19
[ "https://Stackoverflow.com/questions/216817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2495/" ]
216,818
<p>I have a button that adds an already defined usercontrol programtically. I am rebuilding each control on Postback and they show up fine. If I put text in the textbox it shows up fine, however my images are losing their url. Any idea why or how I can fix this?</p> <p>I tried adding AJAX updatepanel to see if that ...
[ { "answer_id": 216872, "author": "Jason Stevenson", "author_id": 13368, "author_profile": "https://Stackoverflow.com/users/13368", "pm_score": 1, "selected": false, "text": "<img> <asp:Image>" } ]
2008/10/19
[ "https://Stackoverflow.com/questions/216818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26685/" ]
216,819
<p>I keep wondering how does a debugger work? Particulary the one that can be 'attached' to already running executable. I understand that compiler translates code to machine language, but then how does debugger 'know' what it is being attached to?</p>
[ { "answer_id": 216954, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": 5, "selected": false, "text": "ptrace" }, { "answer_id": 21746853, "author": "Jonathon Reinhart", "author_id": 119527, "author_...
2008/10/19
[ "https://Stackoverflow.com/questions/216819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29430/" ]
216,822
<p>There are some cool and exciting features in .NET 3.5/C# 3.0, and with those features comes some darn interesting ways to write the exact same line of code.</p> <p>Using the above stated tool set (and by extension .NET 2.0 stuff), what are the different ways the below code snippet could reasonably be rewritten? </p...
[ { "answer_id": 216828, "author": "Mark Brackett", "author_id": 2199, "author_profile": "https://Stackoverflow.com/users/2199", "pm_score": 4, "selected": true, "text": "if (Directory.Exists(uploadDirectory)) \n Directory.GetFiles(uploadDirectory)\n .Where(f => File.GetLastWriteTime(f...
2008/10/19
[ "https://Stackoverflow.com/questions/216822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27860/" ]
216,823
<p>I'm currently using the following code to right-trim all the <code>std::strings</code> in my programs:</p> <pre><code>std::string s; s.erase(s.find_last_not_of(" \n\r\t")+1); </code></pre> <p>It works fine, but I wonder if there are some end-cases where it might fail?</p> <p>Of course, answers with elegant altern...
[ { "answer_id": 216829, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 4, "selected": false, "text": "string::npos string::npos string::size_type" }, { "answer_id": 216883, "author": "Leon Timmermans", "auth...
2008/10/19
[ "https://Stackoverflow.com/questions/216823", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14690/" ]
216,833
<p>I have a ASP.NET <code>GridView</code> with a column mapped to a boolean. I want do display "Yes"/"No" instead of "True"/"False". Well actually I want "Ja"/"Nej" (in Danish).</p> <p>Is this possible? </p> <pre><code>&lt;asp:gridview id="GridView1" runat="server" autogeneratecolumns="false"&gt; &lt;columns&gt; ...
[ { "answer_id": 216851, "author": "Mark Brackett", "author_id": 2199, "author_profile": "https://Stackoverflow.com/users/2199", "pm_score": 3, "selected": false, "text": "<script runat=\"server\">\n TResult Eval<T, TResult>(string field, Func<T, TResult> converter) {\n object o = Dat...
2008/10/19
[ "https://Stackoverflow.com/questions/216833", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8547/" ]