qid
int64
4
22.2M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
331,641
<p>I am dealing with <a href="http://framework.zend.com/manual/en/zend.form.html" rel="nofollow noreferrer"><code>Zend_Form</code></a> right now and I am having a difficult time figuring out how to:</p> <ol> <li>Use custom images for form buttons and,</li> <li>Insert text and links in specific places (in my case I wan...
[ { "answer_id": 332133, "author": "monzee", "author_id": 31003, "author_profile": "https://Stackoverflow.com/users/31003", "pm_score": 0, "selected": false, "text": "echo $this->form->element" } ]
2008/12/01
[ "https://Stackoverflow.com/questions/331641", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11252/" ]
331,642
<p>In a bash script I execute a command on a remote machine through ssh. If user breaks the script by pressing Ctrl+C it only stops the script - not even ssh client. Moreover even if I kill ssh client the remote command is still running...</p> <p>How can make bash to kill local ssh client and remote command invocation...
[ { "answer_id": 331679, "author": "Johannes Schaub - litb", "author_id": 34509, "author_profile": "https://Stackoverflow.com/users/34509", "pm_score": 1, "selected": false, "text": "trap \"some_command\" SIGINT\n" }, { "answer_id": 337061, "author": "tkokoszka", "author_id...
2008/12/01
[ "https://Stackoverflow.com/questions/331642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42201/" ]
331,663
<p>Is there a difference in behavior between adding a control to the ASPX page directly and loading a control programmatically and adding to a placeholder?</p> <p>The control inherits from <code>System.Web.UI.WebControls.DataBoundControl</code>.</p> <p>The reason I ask is that I have a control that works when I add i...
[ { "answer_id": 331734, "author": "Cristian Libardo", "author_id": 16526, "author_profile": "https://Stackoverflow.com/users/16526", "pm_score": 3, "selected": true, "text": "C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\Temporary ASP.NET Files\n" }, { "answer_id": 331850, ...
2008/12/01
[ "https://Stackoverflow.com/questions/331663", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38522/" ]
331,666
<p>I have the following very simple Javascript-compatible regular expression:</p> <pre><code>&lt;script type="text/javascript" id="(.+)" src="([^"]+)"&gt; </code></pre> <p>I am trying to match on script tags and gather both the ID and src attributes. I'd like to make the order of the attributes irrelevant, so that th...
[ { "answer_id": 331700, "author": "Nick Berardi", "author_id": 17, "author_profile": "https://Stackoverflow.com/users/17", "pm_score": 0, "selected": false, "text": "<script\\s*\\S*\\s*(id=\"([^\"]+)\")?\\s*\\S*\\s*(src=\"([^\"]+)\")\\s*\\S*\\s*(id=\"([^\"]+)\")?[^>]*>\n" }, { "an...
2008/12/01
[ "https://Stackoverflow.com/questions/331666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8215/" ]
331,690
<p>What is the standard encoding of C++ source code? Does the C++ standard even say something about this? Can I write C++ source in Unicode?</p> <p>For example, can I use non-ASCII characters such as Chinese characters in comments? If so, is full Unicode allowed or just a subset of Unicode? (e.g., that 16-bit first pa...
[ { "answer_id": 331724, "author": "Head Geek", "author_id": 12193, "author_profile": "https://Stackoverflow.com/users/12193", "pm_score": 4, "selected": false, "text": "warning C4819: The file contains a character that cannot be represented\nin the current code page (932). Save the file i...
2008/12/01
[ "https://Stackoverflow.com/questions/331690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30187/" ]
331,695
<p>My problem:</p> <p>I'm looking for a way to represent a person's name and address as an encoded id. The id should contain only alpha-numeric characters, be collision-proof, and be represented in a smallest number of characters possible. My first thought was to simply use a cryptographic hash function like MD5 or ...
[ { "answer_id": 331721, "author": "Charles Bretana", "author_id": 32632, "author_profile": "https://Stackoverflow.com/users/32632", "pm_score": -1, "selected": false, "text": "You could use AAAAA01 for first person at first address,\n AAAAA02 for second person at first addre...
2008/12/01
[ "https://Stackoverflow.com/questions/331695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42203/" ]
331,731
<p>Is there a way in .net to refer to a control generically (so that if the control name changes, etc.) you don't have a problem.</p> <p>I.e., the object level version of the "me" keyword.</p> <p>So, I'd like to use something generic instead of RadioButton1 in the example below.</p> <pre><code>Private Sub RadioButto...
[ { "answer_id": 331738, "author": "Patrick Desjardins", "author_id": 13913, "author_profile": "https://Stackoverflow.com/users/13913", "pm_score": 2, "selected": false, "text": "this.checkbox.EventXYZ += new EventXZY(checkedEvent);\n" }, { "answer_id": 331742, "author": "Crist...
2008/12/01
[ "https://Stackoverflow.com/questions/331731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4906/" ]
331,744
<p>Is it possible for a JPA entity class to contain two embedded (<code>@Embedded</code>) fields? An example would be:</p> <pre><code>@Entity public class Person { @Embedded public Address home; @Embedded public Address work; } public class Address { public String street; ... } </code></pre> ...
[ { "answer_id": 9246639, "author": "Philihp Busby", "author_id": 643928, "author_profile": "https://Stackoverflow.com/users/643928", "pm_score": 6, "selected": false, "text": "@Entity \npublic class Person {\n @AttributeOverrides({\n @AttributeOverride(name=\"street\",column=@Column(n...
2008/12/01
[ "https://Stackoverflow.com/questions/331744", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24396/" ]
331,755
<p>How do I setup TeamCity 4.0 so that I can access it over port 443 on the internet? e.g. <a href="https://teamcity.mydomain.com" rel="nofollow noreferrer">https://teamcity.mydomain.com</a></p> <p>I am running IIS 7 on the same server that TeamCity is installed. I see two options:</p> <ol> <li><p>Setup TeamCity to...
[ { "answer_id": 1060810, "author": "dvkwong", "author_id": 67613, "author_profile": "https://Stackoverflow.com/users/67613", "pm_score": 0, "selected": false, "text": "LoadModule proxy_module bin/mod_proxy.so \nLoadModule proxy_http_module bin/mod_proxy_http.so\n\nProxyPass /TeamCity http...
2008/12/01
[ "https://Stackoverflow.com/questions/331755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/571/" ]
331,757
<p>On Mac OS X, I am running Flex Builder (which is basically a customized Eclipse). When I do a Find it beeps if it cannot find the selected text and when it wraps the search to the top.</p> <p>Is it possible to turn off that beep? I've searched the internet and the preferences pane to no avail.</p>
[ { "answer_id": 16117318, "author": "kevinarpe", "author_id": 257299, "author_profile": "https://Stackoverflow.com/users/257299", "pm_score": 2, "selected": false, "text": "xset b off" } ]
2008/12/01
[ "https://Stackoverflow.com/questions/331757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27081/" ]
331,758
<p>Let's say I checked in a changelist (in Perforce) with lots of files and I'd like to revert the entire changelist. Is there an easy way to "revert" the entire changelist in one fell swoop?</p> <p>Currently I do something like this for each file in the changelist:</p> <ul> <li>p4 sync //path/to/file#n (where "n" i...
[ { "answer_id": 22145028, "author": "Arnon Zilca", "author_id": 3374591, "author_profile": "https://Stackoverflow.com/users/3374591", "pm_score": 0, "selected": false, "text": "#!/bin/bash\n\nset -e\n\nif [[ $# -ne 1 ]]; then\necho \"usage: $(basename $0) changelist\"\n exit 1\nfi\n\nC...
2008/12/01
[ "https://Stackoverflow.com/questions/331758", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27020/" ]
331,767
<p>I've created a small python script to toggle between two files I'm using for testing.</p> <p>My question is, what is a good Python format style for the following code:</p> <pre><code>import filecmp import shutil local = "local.txt" remote = "remote.txt" config_file = "C:\some\path\file.txt" shutil.copyfile( remo...
[ { "answer_id": 331775, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 3, "selected": false, "text": "source = remote if filecmp.cmp(local, config_file) else local\n\nshutil.copyfile(source, config_file)\n" }, { ...
2008/12/01
[ "https://Stackoverflow.com/questions/331767", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20654/" ]
331,770
<pre><code>SELECT avg(con_hits) as avg_hits FROM content WHERE con_type = 1 AND con_posttime &lt; $twelve_hrs_ago AND con_refresh = 0 ORDER BY con_posttime DESC LIMIT 100 </code></pre> <p>I would like it to go to the first record that was posted at least 12 hours ago (denoted by the <code>$twelve...
[ { "answer_id": 331783, "author": "troelskn", "author_id": 18180, "author_profile": "https://Stackoverflow.com/users/18180", "pm_score": 5, "selected": true, "text": "LIMIT" }, { "answer_id": 331792, "author": "Rob", "author_id": 34224, "author_profile": "https://Stack...
2008/12/01
[ "https://Stackoverflow.com/questions/331770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
331,777
<p>What are my options for running Java 6 on OS X? </p> <p>I have an MacBook Pro Intel Core Duo running Mac OS X 10.4. Do I have any options for running Java 6 on this hardware and OS?</p> <p>Related questions: Which Macs (either current or forthcoming) support 64-bit computing? Are there any Apple laptops (either cu...
[ { "answer_id": 1379197, "author": "Marcus Adams", "author_id": 168493, "author_profile": "https://Stackoverflow.com/users/168493", "pm_score": 2, "selected": false, "text": "$ export JAVA_HOME=/Users/madams/Desktop/soylatte16-i386-1.0.3\n$ export PATH=/Users/madams/Desktop/soylatte16-i38...
2008/12/01
[ "https://Stackoverflow.com/questions/331777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32174/" ]
331,786
<p>If I understand correctly the .net runtime will always clean up after me. So if I create new objects and I stop referencing them in my code, the runtime will clean up those objects and free the memory they occupied.</p> <p>Since this is the case why then do some objects need to have a destructor or dispose method? ...
[ { "answer_id": 331795, "author": "Yona", "author_id": 40007, "author_profile": "https://Stackoverflow.com/users/40007", "pm_score": 8, "selected": true, "text": "Dispose" } ]
2008/12/01
[ "https://Stackoverflow.com/questions/331786", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42214/" ]
331,794
<p>I added a text file to a testapp's solution and I want to read said file. I don't remember how to do this, I know it has to do with reflections but I need a push in the right direction.</p>
[ { "answer_id": 331819, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 1, "selected": false, "text": "String" } ]
2008/12/01
[ "https://Stackoverflow.com/questions/331794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25515/" ]
331,855
<p>I need to check whether a page is being redirected or not without actually downloading the content. I just need the final URL. What's the best way of doing this is Python? Thanks!</p>
[ { "answer_id": 331871, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 1, "selected": false, "text": "urllib2" }, { "answer_id": 331890, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "h...
2008/12/01
[ "https://Stackoverflow.com/questions/331855", "https://Stackoverflow.com", "https://Stackoverflow.com/users/280/" ]
331,856
<p>I may be barking up the wrong tree... However, what I have is a MySQL server that accepts connections only from a client with a valid SSL cert (see <a href="http://dev.mysql.com/doc/refman/5.0/en/secure-create-certs.html" rel="nofollow noreferrer">this link</a>). This works great for example with Rails. I have my da...
[ { "answer_id": 331895, "author": "Stepan Mazurov", "author_id": 40786, "author_profile": "https://Stackoverflow.com/users/40786", "pm_score": 4, "selected": true, "text": "config.inc.php" }, { "answer_id": 60654570, "author": "Ken Silverman", "author_id": 13051432, "a...
2008/12/01
[ "https://Stackoverflow.com/questions/331856", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39034/" ]
331,862
<p>I'm switching between different Java SDKs (1.4.2, 1.5.0 and 1.6.0) for various projects. I would like to set the JAVA_HOME environment variable on my Windows XP machine without going through the tedious My Computer -> Advanced -> [Select System Variable] -> Edit -> Ok -> Ok</p> <p>Is it possible to do this from th...
[ { "answer_id": 331898, "author": "Patrick Cuff", "author_id": 7903, "author_profile": "https://Stackoverflow.com/users/7903", "pm_score": 1, "selected": false, "text": "set args = WScript.Arguments\nSet objShell = WScript.CreateObject(\"WScript.Shell\")\nSet colSystemEnvVars = objShell.E...
2008/12/01
[ "https://Stackoverflow.com/questions/331862", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7507/" ]
331,889
<p>I have an input file that I want to sort based on timestamp which is a substring of each record. I want to store multiple attributes of the </p> <p>The list is currently about 1000 records. But, I want it to be able to scale up a bit just in case.</p> <p>When I did it with a Linked List by searching the entire l...
[ { "answer_id": 331897, "author": "Paul Nathan", "author_id": 26227, "author_profile": "https://Stackoverflow.com/users/26227", "pm_score": 2, "selected": false, "text": " <algorithm>\n" }, { "answer_id": 331910, "author": "Edouard A.", "author_id": 41363, "author_prof...
2008/12/01
[ "https://Stackoverflow.com/questions/331889", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39360/" ]
331,918
<p>I'm attempting to use Python to convert a multi-page PDF into a series of JPEGs. I can split the PDF up into individual pages easily enough with available tools, but I haven't been able to find anything that can covert PDFs to images.</p> <p>PIL does not work, as it can't read PDFs. The two options I've found are u...
[ { "answer_id": 36113000, "author": "Idan Yacobi", "author_id": 5459259, "author_profile": "https://Stackoverflow.com/users/5459259", "pm_score": 3, "selected": false, "text": "import ghostscript\n\ndef pdf2jpeg(pdf_input_path, jpeg_output_path):\n args = [\"pdf2jpeg\", # actual value ...
2008/12/01
[ "https://Stackoverflow.com/questions/331918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21885/" ]
331,937
<p>I'm building a GUI class for C++ and dealing a lot with pointers. An example call:</p> <pre><code>mainGui.activeWindow-&gt;activeWidget-&gt;init(); </code></pre> <p>My problem here is that I want to cast the <strong>activeWidget</strong> pointer to another type. <strong>activeWidget</strong> is of type GUI_BASE....
[ { "answer_id": 331942, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 2, "selected": false, "text": "((GUI_TEXTBOX*)(mainGui.activeWindow->activeWidget))->function();\n" }, { "answer_id": 331943, "author": "Pau...
2008/12/01
[ "https://Stackoverflow.com/questions/331937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42224/" ]
331,953
<p>I recently came across this in some code - basically someone trying to create a large object, coping when there's not enough heap to create it:</p> <pre><code>try { // try to perform an operation using a huge in-memory array byte[] massiveArray = new byte[BIG_NUMBER]; } catch (OutOfMemoryError oome) { /...
[ { "answer_id": 332022, "author": "jsight", "author_id": 1432, "author_profile": "https://Stackoverflow.com/users/1432", "pm_score": 2, "selected": false, "text": "System.gc()" }, { "answer_id": 332023, "author": "OscarRyz", "author_id": 20654, "author_profile": "https...
2008/12/01
[ "https://Stackoverflow.com/questions/331953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21849/" ]
331,963
<p>I'm trying to "single source" a form page which can be in edit mode or view mode. For various reasons, this isn't using the ASP.Net FormView or DetailsView controls.</p> <p>Since there is no way to disable a textbox without turning its contents gray (well, we could "eat" all of the keystrokes into it, but that isn'...
[ { "answer_id": 331997, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 1, "selected": false, "text": "<input" }, { "answer_id": 332246, "author": "Benry", "author_id": 28408, "author_profile": "https:...
2008/12/01
[ "https://Stackoverflow.com/questions/331963", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14894/" ]
331,972
<p>I'm working on a menu-generating HtmlHelper extension method. This method will need to know which Action is being executed. So if Home/Index is executing, the extension method would show all links to other actions that're "coordinated." In a sense, all I need to know during the execution of the Home controller's Ind...
[ { "answer_id": 331998, "author": "Nick Berardi", "author_id": 17, "author_profile": "https://Stackoverflow.com/users/17", "pm_score": 3, "selected": true, "text": "var action = HtmlHelper.ViewContext.RouteData.Values[\"action\"];\nvar controller = HtmlHelper.ViewContext.RouteData.Values[...
2008/12/01
[ "https://Stackoverflow.com/questions/331972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28686/" ]
331,976
<p>I'm attempting to use the following code to serialize an anonymous type to JSON:</p> <pre><code>var serializer = new DataContractJsonSerializer(thing.GetType()); var ms = new MemoryStream(); serializer.WriteObject(ms, thing); var json = Encoding.Default.GetString(ms.ToArray()); </code></pre> <p>However, I get the...
[ { "answer_id": 331983, "author": "Nick Berardi", "author_id": 17, "author_profile": "https://Stackoverflow.com/users/17", "pm_score": 8, "selected": true, "text": "JavaScriptSerializer serializer = new JavaScriptSerializer();\nvar output = serializer.Serialize(your_anon_object);\n" }, ...
2008/12/01
[ "https://Stackoverflow.com/questions/331976", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4541/" ]
331,992
<p>My list (@degree) is built from a SQL command. The NVL command in the SQL isn't working, neither are tests such as:</p> <pre><code>if (@degree[$i] == "") if (@degree[$i] == " ") if (@degree[$i] == '') if (@degree[$i] == -1) if (@degree[$i] == 0) if (@degree[$i] == ()) if (@degree[$i] == undef) </code></pre> <p>$i ...
[ { "answer_id": 332011, "author": "Paul Tomblin", "author_id": 3333, "author_profile": "https://Stackoverflow.com/users/3333", "pm_score": 4, "selected": true, "text": "if (defined($degree[$i]))" }, { "answer_id": 334663, "author": "derobert", "author_id": 27727, "auth...
2008/12/01
[ "https://Stackoverflow.com/questions/331992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42229/" ]
331,996
<p>I'm having quite a bit of pain inserting and deleting UITableViewCells from the same UITableView!</p> <p>I don't normally post code, but I thought this was the best way of showing where I'm having the problem:</p> <hr> <pre><code>- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 5; } ...
[ { "answer_id": 332097, "author": "e.James", "author_id": 33686, "author_profile": "https://Stackoverflow.com/users/33686", "pm_score": 0, "selected": false, "text": "for (int i=1; i<5; i++)\n{\n // ...\n}" }, { "answer_id": 351133, "author": "codelogic", "author_id": 4...
2008/12/01
[ "https://Stackoverflow.com/questions/331996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1221378/" ]
332,005
<p>When I look at a directory in Windows Explorer, I can see a ProductName and ProductVersion property for the DLL's in that directory.</p> <p>I need to export this DLL list with ProductName and ProductVersion into a text file.</p> <p>If I do <code>c:\&gt;dir *.dll &gt; test.log</code>, the test.log does not have the...
[ { "answer_id": 332015, "author": "Dirk Vollmar", "author_id": 40347, "author_profile": "https://Stackoverflow.com/users/40347", "pm_score": 2, "selected": true, "text": "Set objShell = CreateObject (\"Shell.Application\")\nSet objFolder = objShell.Namespace (\"C:\\Scripts\")\nSet objFSO ...
2008/12/01
[ "https://Stackoverflow.com/questions/332005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32670/" ]
332,030
<p>What are the proper uses of:</p> <ul> <li><a href="https://en.cppreference.com/w/cpp/language/static_cast" rel="noreferrer"><code>static_cast</code></a></li> <li><a href="https://en.cppreference.com/w/cpp/language/dynamic_cast" rel="noreferrer"><code>dynamic_cast</code></a></li> <li><a href="https://en.cppreference....
[ { "answer_id": 332054, "author": "andreas buykx", "author_id": 19863, "author_profile": "https://Stackoverflow.com/users/19863", "pm_score": 4, "selected": false, "text": "reinterpret_cast" }, { "answer_id": 332070, "author": "Fred Larson", "author_id": 10077, "author...
2008/12/01
[ "https://Stackoverflow.com/questions/332030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33686/" ]
332,048
<p>I've been trying to add a swf over a swf on a html page, it's working fine in Firefox, but in IE, the one that's added first is always on top of the other one. I used z-index but it's not working, does anyone know how to solve this? Thanks.</p> <p>I already added wmode:transparent, it is working in firefox but not ...
[ { "answer_id": 332054, "author": "andreas buykx", "author_id": 19863, "author_profile": "https://Stackoverflow.com/users/19863", "pm_score": 4, "selected": false, "text": "reinterpret_cast" }, { "answer_id": 332070, "author": "Fred Larson", "author_id": 10077, "author...
2008/12/01
[ "https://Stackoverflow.com/questions/332048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34797/" ]
332,060
<p>I have been working my way through Scott Guthrie's excellent post on <a href="http://weblogs.asp.net/scottgu/archive/2008/10/16/asp-net-mvc-beta-released.aspx" rel="noreferrer">ASP.NET MVC Beta 1</a>. In it he shows the improvements made to the UpdateModel method and how they improve unit testing. I have recreated...
[ { "answer_id": 332089, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 4, "selected": true, "text": "var routeData = new RouteData();\nvar httpContext = MockRepository.GenerateStub<HttpContextBase>();\nFormCollection form...
2008/12/01
[ "https://Stackoverflow.com/questions/332060", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32588/" ]
332,067
<p>My application's context root is /foobar and I am running an exploded deployment with maven-jetty-plugin.</p> <p>I need to dynamically remap requets for /images/* to /foobar/images/*, and I cannot remap my application's context root to /.</p> <p>For weblogic I have a halfwit solution where I deploy an additional w...
[ { "answer_id": 332089, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 4, "selected": true, "text": "var routeData = new RouteData();\nvar httpContext = MockRepository.GenerateStub<HttpContextBase>();\nFormCollection form...
2008/12/01
[ "https://Stackoverflow.com/questions/332067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23691/" ]
332,079
<p>I'm working with some example java code for making md5 hashes. One part converts the results from bytes to a string of hex digits:</p> <pre><code>byte messageDigest[] = algorithm.digest(); StringBuffer hexString = new StringBuffer(); for (int i=0;i&lt;messageDigest.length;i++) { hexString.append(Integer.to...
[ { "answer_id": 332093, "author": "kgiannakakis", "author_id": 24054, "author_profile": "https://Stackoverflow.com/users/24054", "pm_score": 2, "selected": false, "text": "public static String getMD5(String filename)\n throws NoSuchAlgorithmException, IOException {\n MessageDige...
2008/12/01
[ "https://Stackoverflow.com/questions/332079", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25680/" ]
332,102
<p>In Django 1.0, what is the best way to catch and show an error if user enters only whitespace (" ") in a form field?</p> <pre><code>class Item(models.Model): description = models.CharField(max_length=100) class ItemForm(ModelForm): class Meta: model = Item </code></pre> <p>if user enters only whit...
[ { "answer_id": 332947, "author": "Carl Meyer", "author_id": 3207, "author_profile": "https://Stackoverflow.com/users/3207", "pm_score": 3, "selected": true, "text": "class ItemForm(forms.ModelForm):\n class Meta:\n model = Item\n\n def clean_description(self):\n if no...
2008/12/01
[ "https://Stackoverflow.com/questions/332102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11452/" ]
332,109
<p>I have a website that employs a generic mod_rewrite rule to push all requests to the index.php page, with the exception of certain file extensions:</p> <pre><code>RewriteRule !\.(js|ico|gif|jpg|JPG|png|css|php|phtml|pdf|txt|xml)$ index.php </code></pre> <p>What I need to be able to do is also exclude a certain dir...
[ { "answer_id": 332185, "author": "stesch", "author_id": 41860, "author_profile": "https://Stackoverflow.com/users/41860", "pm_score": 0, "selected": false, "text": "RewriteCond %{REQUEST_FILENAME} !-f" }, { "answer_id": 332587, "author": "jTresidder", "author_id": 36365, ...
2008/12/01
[ "https://Stackoverflow.com/questions/332109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29538/" ]
332,111
<p>I need to store a double as a string. I know I can use <code>printf</code> if I wanted to display it, but I just want to store it in a string variable so that I can store it in a map later (as the <em>value</em>, not the <em>key</em>).</p>
[ { "answer_id": 332113, "author": "Darron", "author_id": 22704, "author_profile": "https://Stackoverflow.com/users/22704", "pm_score": 2, "selected": false, "text": "sprintf()" }, { "answer_id": 332124, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": ...
2008/12/01
[ "https://Stackoverflow.com/questions/332111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1288/" ]
332,117
<p>I need to be able to embed and control the playback of an AVI file in a WinForms app, using C#. The video needs to be embedded in the form, not launched in a separate media player window.</p> <p>What's the best approach to do this? I found the System.Media namespace, which sounded promising, but it appears that i...
[ { "answer_id": 10728660, "author": "Andres A.", "author_id": 170945, "author_profile": "https://Stackoverflow.com/users/170945", "pm_score": 3, "selected": false, "text": "axWindowsMediaPlayer1.URL = \n @\"http://go.microsoft.com/fwlink/?LinkId=95772\";\n" } ]
2008/12/01
[ "https://Stackoverflow.com/questions/332117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1338/" ]
332,120
<p>I'm trying to build a video recorder without jailbreaking my iPhone (i've a Developer license). I began using PhotoLibrary private framework, but i can only reach 2ftp (too slow). Cycoder app have a fps of 15, i think it uses a different approach. I tried to create a bitmap from the previewView of the CameraControll...
[ { "answer_id": 498936, "author": "Marco", "author_id": 42240, "author_profile": "https://Stackoverflow.com/users/42240", "pm_score": 1, "selected": false, "text": "image = [window _createCGImageRefRepresentationInFrame:rectToCapture];\n" }, { "answer_id": 602093, "author": "M...
2008/12/01
[ "https://Stackoverflow.com/questions/332120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42240/" ]
332,122
<p>I'm trying to embed my Subversion revision number in a C++ project and am having problems setting up GNU make to do so. My makefile currently looks something like this:</p> <pre><code>check-svnversion: ../shared/update-svnversion-h.pl ../shared/svnversion.h: check-svnversion shared/svnversion.o: ../shared/svnv...
[ { "answer_id": 332191, "author": "coppro", "author_id": 16855, "author_profile": "https://Stackoverflow.com/users/16855", "pm_score": 1, "selected": false, "text": "svn:keywords" }, { "answer_id": 332756, "author": "CesarB", "author_id": 28258, "author_profile": "http...
2008/12/01
[ "https://Stackoverflow.com/questions/332122", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25507/" ]
332,129
<p>What is the most appropriate media type (formally MIME type) to use when sending data structured with YAML over HTTP and why?</p> <p>There is no registered <a href="http://www.iana.org/assignments/media-types/application/" rel="noreferrer">application type</a> or <a href="http://www.iana.org/assignments/media-types/...
[ { "answer_id": 332159, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 8, "selected": true, "text": "application/x-yaml" }, { "answer_id": 332163, "author": "Greg", "author_id": 24181, "author_profi...
2008/12/01
[ "https://Stackoverflow.com/questions/332129", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5343/" ]
332,161
<p>Someone within my organization has started pushing for us to pilot the CMU SEI's TSP process (see website <a href="http://www.sei.cmu.edu/tsp/" rel="nofollow noreferrer">here</a>). I have an instinctual aversion to any attempts to cure software development illnesses with alphabet soup, but I would like to know if an...
[ { "answer_id": 332159, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 8, "selected": true, "text": "application/x-yaml" }, { "answer_id": 332163, "author": "Greg", "author_id": 24181, "author_profi...
2008/12/01
[ "https://Stackoverflow.com/questions/332161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/327/" ]
332,167
<p>Is it possible to change a sql server instance name? Or is it something that can only be set during installation?</p>
[ { "answer_id": 463464, "author": "Stuart Helwig", "author_id": 5019, "author_profile": "https://Stackoverflow.com/users/5019", "pm_score": 1, "selected": false, "text": "sp_dropserver 'oldname', 'droplogins'\n" } ]
2008/12/01
[ "https://Stackoverflow.com/questions/332167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39677/" ]
332,178
<p>What is the best method of hiding php errors from being displayed on the browser?</p> <p>Would it be to use the following:</p> <pre><code>ini_set("display_errors", 1); </code></pre> <p>Any best practice tips would be appreciated as well!</p> <p>I am logging the errors, I just want to make sure that setting the d...
[ { "answer_id": 332206, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 7, "selected": true, "text": "ini_set(\"display_errors\", 0);\nini_set(\"log_errors\", 1);\n\n//Define where do you want the log to go, syslog or a...
2008/12/01
[ "https://Stackoverflow.com/questions/332178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42135/" ]
332,193
<p>Is there any way to do it? I only have client access and no access to the server. Is there a command I've missed or some software that I can install locally that can connect and find a file by filename?</p>
[ { "answer_id": 332609, "author": "Martin v. Löwis", "author_id": 33006, "author_profile": "https://Stackoverflow.com/users/33006", "pm_score": 0, "selected": false, "text": " cvs rls -Rde <modulename>\n" }, { "answer_id": 333685, "author": "Oliver Giesen", "author_id": 97...
2008/12/01
[ "https://Stackoverflow.com/questions/332193", "https://Stackoverflow.com", "https://Stackoverflow.com/users/543/" ]
332,207
<p>I have an OpenGl program in which I am displaying an image using textures. I want to be able to load a new image to be displayed. </p> <p>In my Init function I call:</p> <pre><code>Gl.glGenTextures(1, mTextures); </code></pre> <p>Since only one image will be displayed at time, I am using the same texture name for...
[ { "answer_id": 333233, "author": "unwind", "author_id": 28169, "author_profile": "https://Stackoverflow.com/users/28169", "pm_score": 0, "selected": false, "text": "glTextImage2D" }, { "answer_id": 1584431, "author": "Bahbar", "author_id": 148383, "author_profile": "h...
2008/12/01
[ "https://Stackoverflow.com/questions/332207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/55638/" ]
332,229
<p>Suppose you have a method that should create and return an array of some sort. What if the array doesn't get populated. Do you return an empty array or null/nothing?</p>
[ { "answer_id": 332247, "author": "Paul Tomblin", "author_id": 3333, "author_profile": "https://Stackoverflow.com/users/3333", "pm_score": 1, "selected": false, "text": "Collection.size() == 0" }, { "answer_id": 332248, "author": "Greg Beech", "author_id": 13552, "auth...
2008/12/01
[ "https://Stackoverflow.com/questions/332229", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28146/" ]
332,230
<p>I am looking for a way to get the essence or the most important aspect of a webpage? If I provide a URL, is there any external service which can accomplish this? I am not looking for snap.com like service as it provides a snapshot.</p> <p>I might be willing to even implement such a system on my own. For beginning I...
[ { "answer_id": 599504, "author": "Ramesh", "author_id": 30594, "author_profile": "https://Stackoverflow.com/users/30594", "pm_score": 1, "selected": false, "text": "select * from contentanalysis.analyze where url='http://www.cnn.com/2011/11/11/world/europe/greece-main/index.html'; \n" ...
2008/12/01
[ "https://Stackoverflow.com/questions/332230", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29653/" ]
332,254
<p>I have a spreadsheet with a dataset of a number of transactions, each of which is composed of substeps, each of which has the time that it occurred. There can be a variable number and order of steps.</p> <p>I'd like to find the duration of each transaction. If I can do this in Excel then great, as it's already in...
[ { "answer_id": 332296, "author": "Kibbee", "author_id": 1862, "author_profile": "https://Stackoverflow.com/users/1862", "pm_score": 1, "selected": false, "text": "SELECT TransID, DateDiff(mi, Min(Time),Max(Time)) AS Duration\nFROM MyTable\nGROUP BY TrandID\n" }, { "answer_id": 33...
2008/12/01
[ "https://Stackoverflow.com/questions/332254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42234/" ]
332,255
<p>I know <code>class foo(object)</code> is an old school way of defining a class. But I would like to understand in more detail the difference between these two.</p>
[ { "answer_id": 332290, "author": "Brian C. Lane", "author_id": 27461, "author_profile": "https://Stackoverflow.com/users/27461", "pm_score": 4, "selected": false, "text": "class foo(object):" }, { "answer_id": 332575, "author": "muhuk", "author_id": 42188, "author_pro...
2008/12/01
[ "https://Stackoverflow.com/questions/332255", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
332,269
<p>Hello I am compiling a program with make but I get the error of No such file or directory but the file is in a directory of the path.</p> <p>I have this #include "genetic.h", that file is in a directory called /home/myuser/toolbox/lib/genalg and in the PATH I have ...:/home/myuser/toolbox/lib/genalg, so I do not wh...
[ { "answer_id": 332290, "author": "Brian C. Lane", "author_id": 27461, "author_profile": "https://Stackoverflow.com/users/27461", "pm_score": 4, "selected": false, "text": "class foo(object):" }, { "answer_id": 332575, "author": "muhuk", "author_id": 42188, "author_pro...
2008/12/01
[ "https://Stackoverflow.com/questions/332269", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39160/" ]
332,273
<p>I'm trying to setup the Entity Framework with SQL Server 2008. I'm using Guids for the keys on my tables. Is there a way to set it up so the keys are automatically generated by the database? I tried setting "RowGuid" to true and also set the column's default value to be "(newid())". Either way the mapped class s...
[ { "answer_id": 332342, "author": "Corbin March", "author_id": 7625, "author_profile": "https://Stackoverflow.com/users/7625", "pm_score": 2, "selected": false, "text": "private Guid _identifier = Guid.NewGuid();\n" }, { "answer_id": 6867868, "author": "Jeff", "author_id":...
2008/12/01
[ "https://Stackoverflow.com/questions/332273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/632/" ]
332,276
<p>I have a ton of repeating code in my class that looks like the following:</p> <pre><code>NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; </code></pre> <p>The problem with asynchronous requests is when you h...
[ { "answer_id": 332483, "author": "Matt Gallagher", "author_id": 36103, "author_profile": "https://Stackoverflow.com/users/36103", "pm_score": 7, "selected": true, "text": "connectionToInfoMapping =\n CFDictionaryCreateMutable(\n kCFAllocatorDefault,\n 0,\n &kCFTyp...
2008/12/01
[ "https://Stackoverflow.com/questions/332276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40882/" ]
332,284
<p>We want to allow "normal" href links to other webpages, but we don't want to allow anyone to sneak in client-side scripting.</p> <p>Is searching for "javascript:" within the HREF and onclick/onmouseover/etc. events good enough? Or are there other things to check?</p>
[ { "answer_id": 332338, "author": "Timothy Khouri", "author_id": 11917, "author_profile": "https://Stackoverflow.com/users/11917", "pm_score": 0, "selected": false, "text": "<img src=\"nosuchimage.blahblah\" onerror=\"alert('Haxored!!!');\" />\n" }, { "answer_id": 332409, "aut...
2008/12/01
[ "https://Stackoverflow.com/questions/332284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/337/" ]
332,289
<p>How do I change the size of figure drawn with Matplotlib?</p>
[ { "answer_id": 332311, "author": "tatwright", "author_id": 40849, "author_profile": "https://Stackoverflow.com/users/40849", "pm_score": 9, "selected": false, "text": "pylab" }, { "answer_id": 334462, "author": "jfs", "author_id": 4279, "author_profile": "https://Stac...
2008/12/01
[ "https://Stackoverflow.com/questions/332289", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40849/" ]
332,291
<p>What is the best way to build a loopback URL for an AJAX call? Say I have a page at</p> <pre><code>http://www.mydomain.com/some/subdir/file.php </code></pre> <p>that I want to load with an AJAX call. In Firefox, using jQuery this works fine:</p> <pre><code>$.post('/some/subdir/file.php', ...); </code></pre> <p>S...
[ { "answer_id": 332311, "author": "tatwright", "author_id": 40849, "author_profile": "https://Stackoverflow.com/users/40849", "pm_score": 9, "selected": false, "text": "pylab" }, { "answer_id": 334462, "author": "jfs", "author_id": 4279, "author_profile": "https://Stac...
2008/12/01
[ "https://Stackoverflow.com/questions/332291", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5291/" ]
332,295
<p>I am working on a simple CAD program which uses OpenGL to handle on-screen rendering. Every shape drawn on the screen is constructed entirely out of simple line segments, so even a simple drawing ends up processing thousands of individual lines.</p> <p>What is the best way to communicate changes in this collection ...
[ { "answer_id": 332439, "author": "Branan", "author_id": 13894, "author_profile": "https://Stackoverflow.com/users/13894", "pm_score": 3, "selected": false, "text": "glBufferSubData()" } ]
2008/12/01
[ "https://Stackoverflow.com/questions/332295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33686/" ]
332,297
<p>I want have to have a single imageList used by multiple forms in a project. That is to say, multiple controls use the same image list.</p> <p><em>Note: Ideally multiple projects in a single solution will use the same image list - but I don't want to ask too much of Microsoft at once.</em></p> <p>Some controls are ...
[ { "answer_id": 3771603, "author": "Ivan Ferrer Villa", "author_id": 382515, "author_profile": "https://Stackoverflow.com/users/382515", "pm_score": 0, "selected": false, "text": " Shared shoImageList As New ImageList\n Public Sub New()\n If shoImageList.Images.Count = 0 Then...
2008/12/01
[ "https://Stackoverflow.com/questions/332297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12597/" ]
332,300
<p>Is there a measurable performance difference between using INT vs. VARCHAR as a primary key in MySQL? I'd like to use VARCHAR as the primary key for reference lists (think US States, Country Codes) and a coworker won't budge on the INT AUTO_INCREMENT as a primary key for all tables. </p> <p>My argument, as detailed...
[ { "answer_id": 332346, "author": "LeppyR64", "author_id": 16592, "author_profile": "https://Stackoverflow.com/users/16592", "pm_score": 3, "selected": false, "text": "ex.\nid value\n1 A\n2 B\n3 C\n\nUpdate 3 to D\nid value\n1 A\n2 B\n3 D\n\nUpdate 2 to C\nid value\n1 A\n2 C\n3 D\n\nUpdat...
2008/12/01
[ "https://Stackoverflow.com/questions/332300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/302/" ]
332,309
<p>I've developed an application at working using MySQL 5, that uses Views to access the major pieces of data. It turns out that our production server uses MySQL 4, which does not have Views included.</p> <p>Does anybody have a quick and dirty way to deal with this that doesn't involve rewriting all my code? </p>
[ { "answer_id": 332366, "author": "derobert", "author_id": 27727, "author_profile": "https://Stackoverflow.com/users/27727", "pm_score": 2, "selected": false, "text": "CREATE VIEW foo AS\n SELECT a, b, c FROM real_table WHERE fooable = 1;\n\nSELECT * FROM foo;\n" } ]
2008/12/01
[ "https://Stackoverflow.com/questions/332309", "https://Stackoverflow.com", "https://Stackoverflow.com/users/655/" ]
332,353
<p>This is making me kind of crazy: I did a mysqldump of a partitioned table on one server, moved the resulting SQL dump to another server, and attempted to run the insert. It fails, but I'm having difficulty figuring out why. Google and the MySQL forums and docs have not been much help.</p> <p>The failing query lo...
[ { "answer_id": 1314642, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "vi /etc/apparmor.d/usr.sbin.mysql\n" } ]
2008/12/01
[ "https://Stackoverflow.com/questions/332353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40093/" ]
332,364
<p>Is it possible to embed the Windows Explorer file/folder browser view in a WPF or a WinForms window?</p> <p>I basically want to host the file/folder browser as part of my app window. I don't want to re-implement what the shell provides, especially the shell extensions such as TortoiseSVN.</p>
[ { "answer_id": 335490, "author": "Enrico Campidoglio", "author_id": 26396, "author_profile": "https://Stackoverflow.com/users/26396", "pm_score": 3, "selected": false, "text": "<Window x:Class=\"Samples.FilesystemBrowser\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/present...
2008/12/01
[ "https://Stackoverflow.com/questions/332364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
332,365
<p>Just looking at:</p> <p><img src="https://i.stack.imgur.com/G0ifh.png" alt="XKCD Strip" title="Her daughter is named Help I&#39;m trapped in a driver&#39;s license factory."> <em>(Source: <a href="https://xkcd.com/327/" rel="noreferrer">https://xkcd.com/327/</a>)</em></p> <p>What does this SQL do:</p> <pre><code>...
[ { "answer_id": 332367, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 11, "selected": true, "text": "q = \"INSERT INTO Students VALUES ('\" + FNMName.Text + \"', '\" + LName.Text + \"')\";\n" }, { "answer_id": 332373, ...
2008/12/01
[ "https://Stackoverflow.com/questions/332365", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39677/" ]
332,370
<p>In C#, the questions of what types to create, what members they should have, and what namespaces should hold them, are questions of OO design. They are not the questions I'm interested in here.</p> <p>Instead, I want to ask how you store these in disk artifacts. Here are some example rules:</p> <ul> <li><p>Put a...
[ { "answer_id": 332372, "author": "Jay Bazuzi", "author_id": 5314, "author_profile": "https://Stackoverflow.com/users/5314", "pm_score": 3, "selected": false, "text": "partial" } ]
2008/12/01
[ "https://Stackoverflow.com/questions/332370", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5314/" ]
332,384
<p>I'm working on a page using jQuery's <a href="http://docs.jquery.com/UI/Accordion" rel="nofollow noreferrer">accordion UI element</a>. I modeled my HTML on that example, except that inside the <code>&lt;li&gt;</code> elements, I have some unordered lists of links. Like this:</p> <pre><code> $(document).ready(functi...
[ { "answer_id": 332502, "author": "Pim Jager", "author_id": 35197, "author_profile": "https://Stackoverflow.com/users/35197", "pm_score": -1, "selected": false, "text": " navigation: true\n" }, { "answer_id": 332533, "author": "Matthew Crumley", "author_id": 2214, "aut...
2008/12/01
[ "https://Stackoverflow.com/questions/332384", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4376/" ]
332,390
<p>I'd like to serialize some LINQ generated objects and store them in a table as a binary field (Never you mind why). I'd like to be able to write some code that looks something like this:</p> <pre><code>SerialTestDataContext db = new SerialTestDataContext(); relation_table row = db.relation_tables.First(); MemoryS...
[ { "answer_id": 332421, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "public partial class User : ISerializable\n{\n // implement GetObjectData here\n}\n" }, { "answer_id": 332471, "a...
2008/12/01
[ "https://Stackoverflow.com/questions/332390", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2191/" ]
332,397
<p>My function is pretty much a standard search function... I've included it below.</p> <p>In the function I have 1 line of code responsible for weeding out Repart NTFS points. </p> <pre><code>if (attributes.ToString().IndexOf("ReparsePoint") == -1) </code></pre> <p>The problem is now I am getting an error <code>Ac...
[ { "answer_id": 332412, "author": "Greg Beech", "author_id": 13552, "author_profile": "https://Stackoverflow.com/users/13552", "pm_score": 4, "selected": false, "text": "if (attributes.ToString().IndexOf(\"ReparsePoint\") == -1)\n" } ]
2008/12/01
[ "https://Stackoverflow.com/questions/332397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41291/" ]
332,422
<p>Is there a <strong>JavaScript</strong> equivalent of <strong>Java</strong>'s <code>class.getName()</code>?</p>
[ { "answer_id": 332429, "author": "Jason Bunting", "author_id": 1790, "author_profile": "https://Stackoverflow.com/users/1790", "pm_score": 12, "selected": true, "text": "class.getName()" }, { "answer_id": 332434, "author": "Greg", "author_id": 24181, "author_profile":...
2008/12/01
[ "https://Stackoverflow.com/questions/332422", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41595/" ]
332,431
<p>Lets say you need to attach some JavaScript functionality to an ASP.NET User Control of which there might be multiple instances on any given page. Because JavaScript has shared global state, what techniques can you use to keep the client state and behavior for each instance of a control separate?</p>
[ { "answer_id": 332517, "author": "John MacIntyre", "author_id": 29043, "author_profile": "https://Stackoverflow.com/users/29043", "pm_score": 0, "selected": false, "text": "function <%=this.ClientID %>_myButton_onclick()\n{\n DoSomething();\n}\n" }, { "answer_id": 9840040, ...
2008/12/01
[ "https://Stackoverflow.com/questions/332431", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4541/" ]
332,441
<p>I was at an interview for a C position in which they presented me with an idiom that I haven't previously encountered. This is a trick that simplifies implementation of various algorithms involving linked lists and I'm wondering if anybody else has encountered this.</p> <p>Say we have a linked list record defined s...
[ { "answer_id": 332470, "author": "paxdiablo", "author_id": 14860, "author_profile": "https://Stackoverflow.com/users/14860", "pm_score": 2, "selected": false, "text": "x -> prev -> next = y\ny -> next = x\ny -> prev = x -> prev\nx -> prev = y\n" }, { "answer_id": 332519, "aut...
2008/12/01
[ "https://Stackoverflow.com/questions/332441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15109/" ]
332,448
<h2>Update</h2> <p>I am making this a community wiki, for three reasons:</p> <ul> <li>I don't feel like I got a definitive answer, but</li> <li>I have long since stopped needing an answer, because I rolled my own accordion function</li> <li>this question gets tons of views, so clearly lots of people are still interes...
[ { "answer_id": 332485, "author": "Pim Jager", "author_id": 35197, "author_profile": "https://Stackoverflow.com/users/35197", "pm_score": 0, "selected": false, "text": " navigation: true\n" }, { "answer_id": 332739, "author": "Darko", "author_id": 32943, "author_profil...
2008/12/01
[ "https://Stackoverflow.com/questions/332448", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4376/" ]
332,454
<p>I want to do this C# code in F#</p> <pre><code> string[] a = new string[5]; string b = string.Empty; a[0] = "Line 1"; a[2] = "Line 2"; foreach (string c in a) { b = c + Environment.NewLine; } </code></pre>
[ { "answer_id": 332527, "author": "Juliet", "author_id": 40516, "author_profile": "https://Stackoverflow.com/users/40516", "pm_score": 5, "selected": true, "text": "open System\nlet a = [| \"Line 1\"; null; \"Line 2\"; null; null;|] \nlet b = String.Join(Environment.NewLine, a)\n" }, ...
2008/12/01
[ "https://Stackoverflow.com/questions/332454", "https://Stackoverflow.com", "https://Stackoverflow.com/users/72123/" ]
332,460
<p>Is their a way to use a non-member non-friend function on an object using the same "dot" notation as member functions?</p> <p>Can I pull a (any) member out of a class, and have users use it in the same way they always have?</p> <p>Longer Explanation:</p> <p><a href="http://www.ddj.com/cpp/184401197" rel="nofollow...
[ { "answer_id": 332524, "author": "paercebal", "author_id": 14089, "author_profile": "https://Stackoverflow.com/users/14089", "pm_score": 2, "selected": false, "text": "void T::doSomething(int value) ; // method\nvoid doSomething(T & t, int value) ; // non-member non-friend function\n...
2008/12/01
[ "https://Stackoverflow.com/questions/332460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29701/" ]
332,473
<p>I've created a DLL project in VS 2005 for native Win32/unmanaged C++, call it myProj.dll. It depends on a 3rd-party commercial DLL that in turn depends on msvcr90.dll (I assume it was built from a VS 2008 project). I'll call it thirdParty.dll.</p> <p>My DLL project builds just fine in VS2005. I've built a test a...
[ { "answer_id": 332545, "author": "jussij", "author_id": 14738, "author_profile": "https://Stackoverflow.com/users/14738", "pm_score": 3, "selected": false, "text": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifes...
2008/12/01
[ "https://Stackoverflow.com/questions/332473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
332,477
<p>I need to revoke an authentication cookie if the user no longer exists (or some other condition), after the forms authentication mechanism already have received the authentication cookie from the browser and have validated it. I.e. here is the use scenario:</p> <ol> <li>The user have been authenticated, and granted...
[ { "answer_id": 332644, "author": "marto", "author_id": 29555, "author_profile": "https://Stackoverflow.com/users/29555", "pm_score": 3, "selected": true, "text": "FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(\n 1, // Ticket version\n name...
2008/12/01
[ "https://Stackoverflow.com/questions/332477", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8220/" ]
332,479
<p>i get this error </p> <pre><code>{"Method 'System.DateTime ConvertTimeFromUtc(System.DateTime, System.TimeZoneInfo)' has no supported translation to SQL."} </code></pre> <p>when i try to execute this linq to sql</p> <pre><code>var query = from p in db.Posts let categories = GetCategoriesByPostId(p.P...
[ { "answer_id": 332490, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 2, "selected": true, "text": "[Function]" } ]
2008/12/01
[ "https://Stackoverflow.com/questions/332479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31296/" ]
332,486
<p>How can I programmatically change my browser's default home page with C#?</p>
[ { "answer_id": 332496, "author": "EBGreen", "author_id": 1358, "author_profile": "https://Stackoverflow.com/users/1358", "pm_score": 4, "selected": true, "text": "HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\Start Page\n" } ]
2008/12/01
[ "https://Stackoverflow.com/questions/332486", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33185/" ]
332,492
<p>I'm seeing conflicting references in <a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#i16209" rel="noreferrer">Oracles documentation</a>. Is there any difference between how decimals are stored in a FLOAT and a NUMBER types in the database?</p> <p>As I recall from C, et al, a flo...
[ { "answer_id": 332520, "author": "Bill Karwin", "author_id": 20860, "author_profile": "https://Stackoverflow.com/users/20860", "pm_score": 6, "selected": true, "text": "BINARY_FLOAT" } ]
2008/12/01
[ "https://Stackoverflow.com/questions/332492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/685/" ]
332,522
<p>I've been trying to run a jar file - let's call it test.jar - that uses the Sybase jconn3.jar on a Unix system.</p> <p>I have created a MANIFEST.MF file that has the following:</p> <pre><code>Class-Path: $SYBASE/jConnect-6_0/classes/jconn3.jar commons-net-1.3.0.jar </code></pre> <p>This gives a ClassNotFoundError...
[ { "answer_id": 332543, "author": "erickson", "author_id": 3474, "author_profile": "https://Stackoverflow.com/users/3474", "pm_score": 5, "selected": true, "text": "file:/opt/sybase13/..." } ]
2008/12/01
[ "https://Stackoverflow.com/questions/332522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
332,528
<p>Let's say that I want to merge from a release branch to the master branch and there are some commits in the release branch that I don't want to include in the master branch. Is there a way to do the merge so that one or more of those commits will not be merged?</p> <p>My strategy so far is to do the following (in ...
[ { "answer_id": 3970442, "author": "fcurella", "author_id": 3914, "author_profile": "https://Stackoverflow.com/users/3914", "pm_score": 7, "selected": false, "text": "config.php" }, { "answer_id": 7203170, "author": "Maze", "author_id": 549635, "author_profile": "https...
2008/12/01
[ "https://Stackoverflow.com/questions/332528", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4883/" ]
332,534
<p>Please advise if you can.</p> <p>I am building an SMS web service API that will allow people to send SMS to their desired cellphone numbers. A request will be sent to the interface, we then process that request based on the account details provided and credits available on their account.</p> <p>We have two propose...
[ { "answer_id": 332548, "author": "dacracot", "author_id": 13930, "author_profile": "https://Stackoverflow.com/users/13930", "pm_score": 2, "selected": false, "text": "<Message version=\"1.0\" clientID=\"11111\" passPhrase=\"shjfkh\">\n <Request Type=\"sms\" Refno=\"10\" ToAddress=\"27...
2008/12/01
[ "https://Stackoverflow.com/questions/332534", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16092/" ]
332,554
<p>I don't understand how GCC works under Linux. In a source file, when I do a:</p> <pre><code>#include &lt;math.h&gt; </code></pre> <p>Does the compiler extract the appropriate binary code and insert it into the compiled executable OR does the compiler insert a reference to an external binary file (a-la Windows DLL...
[ { "answer_id": 332572, "author": "Johannes Schaub - litb", "author_id": 34509, "author_profile": "https://Stackoverflow.com/users/34509", "pm_score": 6, "selected": true, "text": "math.h" }, { "answer_id": 332573, "author": "Konrad Rudolph", "author_id": 1968, "author...
2008/12/01
[ "https://Stackoverflow.com/questions/332554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11760/" ]
332,558
<p>I have a database where I store objects. I have the following (simplified) schema</p> <pre><code>CREATE TABLE MyObjects ( UniqueIdentifier Id; BigInt GenerationId; BigInt Value; Bit DeleteAction; ) </code></pre> <p>Each object has a unique identifier ("Id"), and a (set of) ...
[ { "answer_id": 332584, "author": "Martin v. Löwis", "author_id": 33006, "author_profile": "https://Stackoverflow.com/users/33006", "pm_score": 0, "selected": false, "text": " select GenerationId,Value,DeleteAction from MyObjects \n where Id=1 and GenerationId < 3 \n order by Genera...
2008/12/01
[ "https://Stackoverflow.com/questions/332558", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33272/" ]
332,574
<p>I dictate SQL using speech recognition, and lining things up is a pain. If I could see where the tab stops are it would save me a lot of time.</p>
[ { "answer_id": 332577, "author": "Keith Walton", "author_id": 22448, "author_profile": "https://Stackoverflow.com/users/22448", "pm_score": 4, "selected": true, "text": "Windows Registry Editor Version 5.00\n\n[HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\90\\Tools\\Shel...
2008/12/01
[ "https://Stackoverflow.com/questions/332574", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22448/" ]
332,580
<p>Is there an easy way in either language to generate a large set of random data quickly so far all the functions I've tried haven't worked too well when I need to generate a group of say 500,000 characters :( Any ideas?</p>
[ { "answer_id": 332598, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 2, "selected": false, "text": "System.Random" }, { "answer_id": 333895, "author": "RS Conley", "author_id": 7890, "author_profil...
2008/12/01
[ "https://Stackoverflow.com/questions/332580", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
332,585
<p>It was a long holiday weekend, so I got the coding bug again and started playing around:</p> <p><a href="http://gfilter.net/junk/tileengine.jpg" rel="nofollow noreferrer">Mario http://gfilter.net/junk/tileengine.jpg</a></p> <p>I wrote a basic tile engine, but having never attempted this before, I am really struggl...
[ { "answer_id": 332785, "author": "Hugh Allen", "author_id": 15069, "author_profile": "https://Stackoverflow.com/users/15069", "pm_score": 2, "selected": false, "text": "const gravity = ... ; // pixels per timestep (eg. video frame) squared\n// while in freefall, each timestep:\ny_velocit...
2008/12/01
[ "https://Stackoverflow.com/questions/332585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965/" ]
332,592
<p>I have a set of divs that I want to make <code>collapsible/expandable</code> using jQuery's <code>slideToggle()</code> method. How do I make all of these divs collapsed by default? I'd like to avoid explicitly calling <code>slideToggle()</code> on each element during/after page rendering.</p>
[ { "answer_id": 332596, "author": "Anne Porosoff", "author_id": 28701, "author_profile": "https://Stackoverflow.com/users/28701", "pm_score": 4, "selected": false, "text": "$(document).ready(function(){\n $('div').hide();\n});\n" }, { "answer_id": 332600, "author": "netadicto...
2008/12/01
[ "https://Stackoverflow.com/questions/332592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3488/" ]
332,602
<p>Let's say I have a table that represents a super class, <strong>students</strong>. And then I have N tables that represent subclasses of that object (<strong>athletes</strong>, <strong>musicians</strong>, etc). How can I express a constraint such that a student must be modeled in one (not more, not less) subclass?</...
[ { "answer_id": 332615, "author": "Bill Karwin", "author_id": 20860, "author_profile": "https://Stackoverflow.com/users/20860", "pm_score": 3, "selected": true, "text": "CHECK" }, { "answer_id": 333916, "author": "Dave Markle", "author_id": 24995, "author_profile": "ht...
2008/12/01
[ "https://Stackoverflow.com/questions/332602", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40725/" ]
332,603
<p>When I get AuthenticationStatus.Authenticated (DotNetOpenId library) response from myopenid provider, i'd like to redirect user from login page to another one using MVC Redirect(myurl). But unfortunately, instead of getting to myurl, user is redirected to empty page:</p> <p>myurl?token=AWSe9PSLwx0RnymcW0q.... (+ se...
[ { "answer_id": 550709, "author": "zihotki", "author_id": 66591, "author_profile": "https://Stackoverflow.com/users/66591", "pm_score": 1, "selected": false, "text": "FormsAuth.SetAuthCookie(UserName, RememberMe);\n" }, { "answer_id": 573944, "author": "JarrettV", "author_...
2008/12/01
[ "https://Stackoverflow.com/questions/332603", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
332,623
<p>I would like to implement a search engine which should crawl a set of web sites, extract specific information from the pages and create full-text index of that specific information.</p> <p>It seems to me that Xapian could be a good choice for the search engine library.</p> <p>What are the options for a crawler/par...
[ { "answer_id": 550709, "author": "zihotki", "author_id": 66591, "author_profile": "https://Stackoverflow.com/users/66591", "pm_score": 1, "selected": false, "text": "FormsAuth.SetAuthCookie(UserName, RememberMe);\n" }, { "answer_id": 573944, "author": "JarrettV", "author_...
2008/12/01
[ "https://Stackoverflow.com/questions/332623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19808/" ]
332,629
<p>I've <code>rm</code>'ed a 2.5gb log file - but it doesn't seemed to have freed any space.</p> <p>I did:</p> <pre><code>rm /opt/tomcat/logs/catalina.out </code></pre> <p>then this:</p> <pre><code>df -hT </code></pre> <p>and <code>df</code> reported my <code>/opt</code> mount still at 100% used.</p> <p>Any sugge...
[ { "answer_id": 332657, "author": "Bill Karwin", "author_id": 20860, "author_profile": "https://Stackoverflow.com/users/20860", "pm_score": 3, "selected": false, "text": "catalina.out" }, { "answer_id": 332676, "author": "Johannes Schaub - litb", "author_id": 34509, "a...
2008/12/01
[ "https://Stackoverflow.com/questions/332629", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3966/" ]
332,630
<p>Let's say I have an existing System.Threading.Timer instance and I'd like to call Change on it to push it's firing time back:</p> <pre><code>var timer = new Timer(DelayCallback, null, 10000, Timeout.Infinite); // ... (sometime later but before DelayCallback has executed) timer.Change(20000, Timeout.Infinite); </cod...
[ { "answer_id": 332677, "author": "Timothy Khouri", "author_id": 11917, "author_profile": "https://Stackoverflow.com/users/11917", "pm_score": 0, "selected": false, "text": "while (sleepyTime > 0)\n{\n int temp = sleepyTime;\n sleepyTime = 0;\n Thread.Sleep(temp);\n}\n\n// here's...
2008/12/01
[ "https://Stackoverflow.com/questions/332630", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42286/" ]
332,651
<p>I know how to set up a local webserver using xampp on windows... I enter my alias and target on the hosts file (c:\windows\system32\drivers\etc\hosts) and then add a respective entry on my apache vhosts config file. This way, assuming that my webserver is listening to port 80, I can for example map <code>example.com...
[ { "answer_id": 333552, "author": "Arnout", "author_id": 3496, "author_profile": "https://Stackoverflow.com/users/3496", "pm_score": 3, "selected": true, "text": "example.com:8080 localhost:80 . .\n" } ]
2008/12/02
[ "https://Stackoverflow.com/questions/332651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5005/" ]
332,653
<p>I'm trying to figure out a method of connecting from C# code to a digital scale. The particular scale is an Ohaus SP202 digital scale which comes with a USB connection. I would like to read the weight measured on the scale programmatically. I don't have the scale yet, I'm just doing the research before hand.</p> <...
[ { "answer_id": 66222210, "author": "Christian Findlay", "author_id": 1878141, "author_profile": "https://Stackoverflow.com/users/1878141", "pm_score": 0, "selected": false, "text": "using Device.Net;\nusing Device.Net.Windows;\nusing Microsoft.Extensions.Logging;\nusing Microsoft.Extensi...
2008/12/02
[ "https://Stackoverflow.com/questions/332653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
332,668
<p>How to figure out if a table is in use in SQL (on any type database)? if somebody is already using it, or have it "open" then its in use.</p>
[ { "answer_id": 341881, "author": "igorgue", "author_id": 29253, "author_profile": "https://Stackoverflow.com/users/29253", "pm_score": 1, "selected": true, "text": "select spid\n from master..sysprocesses\n where dbid = db_id('Works') and spid <> @@spid\n" } ]
2008/12/02
[ "https://Stackoverflow.com/questions/332668", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29253/" ]
332,681
<p>Greetings!</p> <p>I'm calling a Web service from Javascript when a user clicks on a link. I need to get the coordinates where the user clicked so that I can display a DIV in an appropriate location. My client-side script looks like the following:</p> <pre><code>var g_event; function DoWork(event, theId) { ...
[ { "answer_id": 332843, "author": "Nathaniel Reinhart", "author_id": 41122, "author_profile": "https://Stackoverflow.com/users/41122", "pm_score": 0, "selected": false, "text": "window.event.cancelBubble = true" }, { "answer_id": 332879, "author": "tvanfosson", "author_id"...
2008/12/02
[ "https://Stackoverflow.com/questions/332681", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27870/" ]
332,697
<p><strong>This problem has been solved thanks to your suggestions.</strong> See the bottom for details. Thanks very much for your help!</p> <p>Our ASP.NET website is accessed from several specific and highly secure international locations. It has been operating fine, but we have added another client location which is...
[ { "answer_id": 334130, "author": "Turnkey", "author_id": 13144, "author_profile": "https://Stackoverflow.com/users/13144", "pm_score": 1, "selected": false, "text": "foreach (string key in Request.Form)\n{\n Response.Write(\"<br>\" + key + \"=\" + Request.Form[key]);\n}\n" } ]
2008/12/02
[ "https://Stackoverflow.com/questions/332697", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20118/" ]
332,700
<p>I've got a whole host of values stored in a .net 2.0 hashtable. What I would really like to find is a way to, essentially, do a SQL select statement on the table.</p> <p>Meaning, I'd like to get a list of keys whose associated values match a very simple text pattern (along the lines of "starts with a number".)</p...
[ { "answer_id": 332706, "author": "Nathan W", "author_id": 6335, "author_profile": "https://Stackoverflow.com/users/6335", "pm_score": 3, "selected": true, "text": " static void Main(string[] args)\n {\n Hashtable myhashtable = new Hashtable();\n myhashtable.Add(\"Test...
2008/12/02
[ "https://Stackoverflow.com/questions/332700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19074/" ]
332,701
<p>I'm dealing with a large group of entities that store locations. They are displayed on a map. I'm trying to come up with an efficient way to group near located entities into one entity when viewed from a higher location. So, for example, if you are very high, when looking down, you will see one entity that represent...
[ { "answer_id": 332706, "author": "Nathan W", "author_id": 6335, "author_profile": "https://Stackoverflow.com/users/6335", "pm_score": 3, "selected": true, "text": " static void Main(string[] args)\n {\n Hashtable myhashtable = new Hashtable();\n myhashtable.Add(\"Test...
2008/12/02
[ "https://Stackoverflow.com/questions/332701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9450/" ]
332,703
<p>I have a 3-leveled hierarchy of entities: Customer-Order-Line, which I would like to retrieve in entirety for a given customer, using ISession.Get(id). I have the following XML fragments:</p> <p>customer.hbm.xml:</p> <pre><code>&lt;bag name="Orders" cascade="all-delete-orphan" inverse="false" fetch="join"&gt; &...
[ { "answer_id": 333382, "author": "Tigraine", "author_id": 21699, "author_profile": "https://Stackoverflow.com/users/21699", "pm_score": 3, "selected": false, "text": "session.CreateCriteria(typeof(Post))\n .SetFetchMode(\"Comments\", FetchMode.Eager)\n .List();\n" }, { "ans...
2008/12/02
[ "https://Stackoverflow.com/questions/332703", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2918/" ]