qid
int64
4
22.2M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
106,472
<p>What are good methodologies for creating sprocs that reduce the pain of debugging? And what tools are out there for debugging stored procedures?</p> <p>Perhaps most importantly, what are indications to look out for that errors are happening in a sproc and not in the code? I hope I'm not all over the board too terribly bad here. Votes for answers to any of the above. Thanks.</p> <p>For what it's worth, I work in a .NET environment, SQL servers.</p>
[ { "answer_id": 106648, "author": "Seibar", "author_id": 357, "author_profile": "https://Stackoverflow.com/users/357", "pm_score": 1, "selected": false, "text": "LEFT JOIN\n" }, { "answer_id": 106698, "author": "Ron Savage", "author_id": 12476, "author_profile": "https...
2008/09/19
[ "https://Stackoverflow.com/questions/106472", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13578/" ]
106,473
<p>We make heavy use of Velocity in our web application. While it is easy to debug the Java side of things and ensure the Velocity Context is populated correctly, it would be extremely valuable to be able to step through the parsing of the VTL on the merge step, set breakpoints, etc. Are there any tools or IDEs/IDE plugins that would make this kind of thing possible with VTL (Velocity Template Language)?</p>
[ { "answer_id": 7972815, "author": "DJ.", "author_id": 10638, "author_profile": "https://Stackoverflow.com/users/10638", "pm_score": 3, "selected": false, "text": "#if($logger.log($data)) #end" } ]
2008/09/19
[ "https://Stackoverflow.com/questions/106473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17123/" ]
106,476
<p>I have a setup executable that I need to install. When I run it, it launches a msi to do the actual install and then dies immediately. The side effect of this is it will return control back to any console you call it from before the install finishes. Depending on what machine I run it on, it can take from three to ten minutes so having the calling script sleep is undesirable. I would launch the msi directly but it complains about missing components. </p> <p>I have a WSH script that uses WMI to start a process and then watch until it's pid is no longer running. Is there some way to determine the pid of the MSI the initial executable is executing, and then watch for that pid to end using WMI? Is the launching process information even associated with a process?</p>
[ { "answer_id": 106601, "author": "Jim Olsen", "author_id": 15603, "author_profile": "https://Stackoverflow.com/users/15603", "pm_score": 2, "selected": true, "text": "c:\\>wmic PROCESS WHERE ParentProcessId=4000 GET CommandLine, ProcessId \nCommandLine ...
2008/09/19
[ "https://Stackoverflow.com/questions/106476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
106,481
<p>I have this line in a javascript block in a page:</p> <pre><code>res = foo('&lt;%= @ruby_var %&gt;'); </code></pre> <p>What is the best way to handle the case where <code>@ruby_var</code> has a single-quote in it? Else it will break the JavaScript code.</p>
[ { "answer_id": 106518, "author": "Max Cantor", "author_id": 16034, "author_profile": "https://Stackoverflow.com/users/16034", "pm_score": 2, "selected": false, "text": "@ruby_var.gsub(/[']/, '\\\\\\\\\\'')\n" }, { "answer_id": 106557, "author": "TFKyle", "author_id": 1920...
2008/09/20
[ "https://Stackoverflow.com/questions/106481", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19409/" ]
106,508
<p>What is a smart pointer and when should I use one?</p>
[ { "answer_id": 106523, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 4, "selected": false, "text": "std::tr1::shared_ptr" }, { "answer_id": 106568, "author": "sergtk", "author_id": 13441, "author_profile"...
2008/09/20
[ "https://Stackoverflow.com/questions/106508", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19410/" ]
106,509
<p>I have a button that I would like to disable when the form submits to prevent the user submitting multiple times.</p> <p>I have tried naively disabling the button with javascript onclick but then if a client side validation that fails the button remains disabled.</p> <p>How do I disable the button when the form successfully submits not just when the user clicks?</p> <p>This is an ASP.NET form so I would like to hook in nicely with the asp.net ajax page lifecycle if possible.</p>
[ { "answer_id": 106840, "author": "Turnkey", "author_id": 13144, "author_profile": "https://Stackoverflow.com/users/13144", "pm_score": 3, "selected": false, "text": "<input type=\"hidden\" name=\"form_submitted\" value=\"0\">\n\nfunction check_submit (){\n if (document.Form1.f...
2008/09/20
[ "https://Stackoverflow.com/questions/106509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6600/" ]
106,534
<p>The default rails XML builder escapes all HTML, so something like:</p> <pre class="lang-ruby prettyprint-override"><code>atom_feed do |feed| @stories.each do |story| feed.entry story do |entry| entry.title story.title entry.content "&lt;b&gt;foo&lt;/b&gt;" end end end </code></pre> <p>will produce the text:</p> <pre class="lang-html prettyprint-override"><code>&lt;b&gt;foo&lt;/b&gt; </code></pre> <p>instead of: <strong>foo</strong></p> <p>Is there any way to instruct the XML builder to not escape the XML?</p>
[ { "answer_id": 106616, "author": "Shalmanese", "author_id": 14559, "author_profile": "https://Stackoverflow.com/users/14559", "pm_score": 4, "selected": true, "text": "entry.content \"<b>foo</b>\", :type => \"html\"\n" }, { "answer_id": 5706949, "author": "Rodrigo", "auth...
2008/09/20
[ "https://Stackoverflow.com/questions/106534", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14559/" ]
106,544
<p>I get the following error when trying to run the latest Cygwin version of rsync in Windows XP SP2. The error occurs for attempts at both local syncs (that is: source and destination on the local harddisk only) and remote syncs (using "-e ssh" from the openssh package). Any advice on how to fix/workaround it?</p> <pre> bash-3.2$ rsync -a dir1 dir2 rsync: Failed to dup/close: Socket operation on non-socket (108) rsync error: error in IPC code (code 14) at /home/lapo/packaging/tmp/rsync-2.6.9/pipe.c(143) [receiver=2.6.9] rsync: read error: Connection reset by peer (104) rsync error: error in IPC code (code 14) at /home/lapo/packaging/tmp/rsync-2.6.9/io.c(604) [sender=2.6.9] </pre>
[ { "answer_id": 2507539, "author": "DH4", "author_id": 267429, "author_profile": "https://Stackoverflow.com/users/267429", "pm_score": 2, "selected": false, "text": "$ gdb --args /usr/bin/rsync -a somedir/ anotherdir\nGNU gdb 6.8.0.20080328-cvs (cygwin-special)\n.....\n(no debugging symbo...
2008/09/20
[ "https://Stackoverflow.com/questions/106544", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19417/" ]
106,554
<p>I use this code in my Windows Service to be notified of USB disk drives being inserted and removed:</p> <pre><code>WqlEventQuery query = new WqlEventQuery("__InstanceOperationEvent", "TargetInstance ISA 'Win32_LogicalDisk' AND TargetInstance.DriveType=2"); query.WithinInterval = TimeSpan.FromSeconds(1); _deviceWatcher = new ManagementEventWatcher(query); _deviceWatcher.EventArrived += new EventArrivedEventHandler(OnDeviceEventArrived); _deviceWatcher.Start(); </code></pre> <p>It works on XP and Vista, but on XP I can hear the very noticeable sound of the hard drive being accessed every second. Is there another WMI query that will give me the events without the sound effect?</p>
[ { "answer_id": 52615754, "author": "Mujtaba", "author_id": 6880486, "author_profile": "https://Stackoverflow.com/users/6880486", "pm_score": 1, "selected": false, "text": "using System;\nusing System.Management;\n\nnamespace MonitorDrives\n{\nclass Program\n{\n public enum EventType\n...
2008/09/20
[ "https://Stackoverflow.com/questions/106554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14842/" ]
106,555
<p>I have a Perl script where I maintain a very simple cache using a hash table. I would like to clear the hash once it occupies more than n bytes, to avoid Perl (32-bit) running out of memory and crashing. </p> <p>I can do a check on the number of keys-value pairs:</p> <pre><code>if (scalar keys %cache &gt; $maxSize) { %cache = (); } </code></pre> <p>But is it possible to check the actual memory occupied by the hash?</p>
[ { "answer_id": 106565, "author": "mbac32768", "author_id": 18446, "author_profile": "https://Stackoverflow.com/users/18446", "pm_score": 4, "selected": false, "text": "use Devel::Size qw(size total_size);\n\nmy $size = size(\"A string\");\nmy @foo = (1, 2, 3, 4, 5);\nmy $other_size = siz...
2008/09/20
[ "https://Stackoverflow.com/questions/106555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5734/" ]
106,563
<p>I'd like to log the output of a command to <code>stdout</code> as well as to a log file. I've got Cygwin installed and I'm trying to use the <code>tee</code> command to accomplish this.</p> <pre><code>devenv mysolution.sln /build myproject "Release|Win32" | tee build.log </code></pre> <p>Trouble is that <code>tee</code> seems to insist on waiting for the end of file before outputting anything to either <code>stdout</code> or the log file. This takes away the point of it all, which is to have a log file for future reference, but also some <code>stdout</code> logging so I can easily see the build progress.</p> <p><code>tee</code>'s options appear to be limited to <code>--append</code>, <code>--ignore-interrupts</code>, <code>--help</code>, and <code>--version</code>. So is there another method to get to what I'm trying to do?</p>
[ { "answer_id": 106579, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 2, "selected": false, "text": "$|" }, { "answer_id": 108370, "author": "jon", "author_id": 12215, "author_profile": "https://Stackoverf...
2008/09/20
[ "https://Stackoverflow.com/questions/106563", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4790/" ]
106,586
<p><strong>There is a lot of relativity involved in working with exceptions.</strong> Beyond low level APIs where exceptions cover errors raised from hardware and the OS there is a shady area where the programmer decides what constitutes an exception and what is a normal condition.</p> <p>How do you decide when to use exceptions? <strong>Do you have a consistent policy regarding exceptions?</strong></p>
[ { "answer_id": 107098, "author": "Harold Ekstrom", "author_id": 8429, "author_profile": "https://Stackoverflow.com/users/8429", "pm_score": 0, "selected": false, "text": "HRESULT Foo()\n{\n HRESULT hr = S_OK;\n try {\n // Avoid a whole lot of nested ifs and return code\n ...
2008/09/20
[ "https://Stackoverflow.com/questions/106586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13615/" ]
106,591
<p>At work today, I came across the <code>volatile</code> keyword in Java. Not being very familiar with it, I found <a href="http://web.archive.org/web/20210221170926/https://www.ibm.com/developerworks/java/library/j-jtp06197/" rel="noreferrer">this explanation</a>.</p> <p>Given the detail in which that article explains the keyword in question, do you ever use it or could you ever see a case in which you could use this keyword in the correct manner?</p>
[ { "answer_id": 106641, "author": "Ande Turner", "author_id": 4857, "author_profile": "https://Stackoverflow.com/users/4857", "pm_score": 8, "selected": false, "text": "volatile" }, { "answer_id": 106787, "author": "Greg Mattes", "author_id": 13940, "author_profile": "...
2008/09/20
[ "https://Stackoverflow.com/questions/106591", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16759/" ]
106,599
<p>I would like to serialize and deserialize objects without having to worry about the entire class graph.</p> <p>Flexibility is key. I would like to be able to serialize any object passed to me without complete attributes needed throughout the entire object graph.</p> <blockquote> <p>That means that Binary Serialization is not an option as it only works with the other .NET Platforms. I would also like something readable by a person, and thus decipherable by a management program and other interpreters.</p> </blockquote> <p>I've found problems using the DataContract, JSON, and XML Serializers.</p> <ul> <li>Most of these errors seem to center around Serialization of Lists/Dictionaries (i.e. <a href="http://weblogs.asp.net/pwelter34/archive/2006/05/03/444961.aspx" rel="noreferrer">XML Serializable Generic Dictionary</a>).</li> <li>"Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer."</li> </ul> <p>Please base your answers on actual experiences and not theory or reading of an article.</p>
[ { "answer_id": 106697, "author": "Ian Suttle", "author_id": 19421, "author_profile": "https://Stackoverflow.com/users/19421", "pm_score": 2, "selected": false, "text": "[XmlArray(\"Foo\")]\n[XmlArrayItem(\"Bar\")]\npublic List<BarClass> FooBars\n{ get; set; }\n" }, { "answer_id":...
2008/09/20
[ "https://Stackoverflow.com/questions/106599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2744/" ]
106,623
<p>I have a Java program that loads thirdparty class files (classes I did not write) and executes them. These classes often use <code>java.util.Random</code>, which by default generates random starting seed values every time it gets instantiated. For reasons of reproducability, I want to give these classes the same starting seed every time, changing it only at my discretion.</p> <p>Here are some of the obvious solutions, and why they don't work:</p> <ol> <li><p>Use a different Random class in the thirdparty classfiles. The problem here is I only load the class files, and cannot modify the source.</p></li> <li><p>Use a custom classloader to load our own Random class instead of the JVM's version. This approach will not work because Java does not allow classloaders to override classes in the <code>java</code> package.</p></li> <li><p>Swap out the rt.jar's <code>java.util.Random</code> implementation for our own, or putting files into trusted locations for the JVM. These approaches require the user of the application messing with the JVM install on their machine, and are no good.</p></li> <li><p>Adding a custom <code>java.util.Random</code> class to the bootclasspath. While this would technically work, for this particular application, it is impractical because this application is intended for end users to run from an IDE. I want to make running the app convenient for users, which means forcing them to set their bootclasspath is a pain. I can't hide this in a script, because it's intended to be run from an IDE like Eclipse (for easy debugging.)</p></li> </ol> <p>So how can I do this?</p>
[ { "answer_id": 106693, "author": "OscarRyz", "author_id": 20654, "author_profile": "https://Stackoverflow.com/users/20654", "pm_score": 2, "selected": false, "text": "java -X\n" }, { "answer_id": 2972293, "author": "mahaveer", "author_id": 358208, "author_profile": "h...
2008/09/20
[ "https://Stackoverflow.com/questions/106623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9871/" ]
106,627
<blockquote> <p><strong>Possible Duplicates:</strong><br> <a href="https://stackoverflow.com/questions/370427/learn-obj-c-memory-management">Learn Obj-C Memory Management</a><br> <a href="https://stackoverflow.com/questions/710288/where-are-the-best-explanations-of-memory-management-for-iphone">Where are the best explanations of memory management for iPhone?</a> </p> </blockquote> <p>I come from a C/C++ background and the dynamic nature of Objective-C is somewhat foreign to me, is there a good resource anyone can point me to for some basic memory management techniques in Objective-C? ex. retaining, releasing, autoreleasing</p> <p>For instance, is it completely illegal to use a pointer to an Objective-C object and treat it as an array? Are you forced to use NSArray and NSMutableArray for data structures?</p> <p>I know these are pretty newbie questions, thanks for any help you can offer me.</p>
[ { "answer_id": 126149, "author": "benzado", "author_id": 10947, "author_profile": "https://Stackoverflow.com/users/10947", "pm_score": 2, "selected": false, "text": "alloc" }, { "answer_id": 146720, "author": "mmalc", "author_id": 23233, "author_profile": "https://Sta...
2008/09/20
[ "https://Stackoverflow.com/questions/106627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
106,630
<p>I start by creating a string variable with some <strong>non-ascii</strong> <em>utf-8</em> encoded data on it:</p> <pre><code>&gt;&gt;&gt; text = 'á' &gt;&gt;&gt; text '\xc3\xa1' &gt;&gt;&gt; text.decode('utf-8') u'\xe1' </code></pre> <p>Using <code>unicode()</code> on it raises errors...</p> <pre><code>&gt;&gt;&gt; unicode(text) Traceback (most recent call last): File "&lt;stdin&gt;", line 1, in &lt;module&gt; UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128) </code></pre> <p>...but if I know the encoding I can use it as second parameter:</p> <pre><code>&gt;&gt;&gt; unicode(text, 'utf-8') u'\xe1' &gt;&gt;&gt; unicode(text, 'utf-8') == text.decode('utf-8') True </code></pre> <p>Now if I have a class that returns this text in the <code>__str__()</code> method:</p> <pre><code>&gt;&gt;&gt; class ReturnsEncoded(object): ... def __str__(self): ... return text ... &gt;&gt;&gt; r = ReturnsEncoded() &gt;&gt;&gt; str(r) '\xc3\xa1' </code></pre> <p><code>unicode(r)</code> seems to use <code>str()</code> on it, since it raises the same error as <code>unicode(text)</code> above:</p> <pre><code>&gt;&gt;&gt; unicode(r) Traceback (most recent call last): File "&lt;stdin&gt;", line 1, in &lt;module&gt; UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128) </code></pre> <p>Until now everything is as planned!</p> <p><strong>But as no one would ever expect, <code>unicode(r, 'utf-8')</code> won't even try:</strong></p> <pre><code>&gt;&gt;&gt; unicode(r, 'utf-8') Traceback (most recent call last): File "&lt;stdin&gt;", line 1, in &lt;module&gt; TypeError: coercing to Unicode: need string or buffer, ReturnsEncoded found </code></pre> <p>Why? Why this inconsistent behavior? Is it a bug? is it intended? Very awkward.</p>
[ { "answer_id": 106640, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 3, "selected": false, "text": "unicode" }, { "answer_id": 106709, "author": "Blair Conrad", "author_id": 1199, "author_profile": ...
2008/09/20
[ "https://Stackoverflow.com/questions/106630", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17160/" ]
106,632
<p>Strange question, but: Sharepoint 2007 greets you with the Administrator Tasks on the Central Administration after installation.</p> <p>I just wonder if this list is "safe" to be used for my own Administration Tasks? The reason why i'm asking is because I found that Sharepoint uses a lot of "black magic" and unlogical behaviour and breaks rather easily, so I do not want risk breaking anything if i'm entering my own tasks into the task list.</p>
[ { "answer_id": 106640, "author": "John Millikin", "author_id": 3560, "author_profile": "https://Stackoverflow.com/users/3560", "pm_score": 3, "selected": false, "text": "unicode" }, { "answer_id": 106709, "author": "Blair Conrad", "author_id": 1199, "author_profile": ...
2008/09/20
[ "https://Stackoverflow.com/questions/106632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/91/" ]
106,668
<p>I've used poderosa(a .NET terminal app) to monitor logs on multiple linux/solaris servers. This application is NOT getting currently maintained and I've had several problems with it.</p> <p>I'm wondering what other users do to simultaneously monitor several logs in real-time(as in tail -f logfile). I would like to be able to tab/cascade several ssh tails.</p>
[ { "answer_id": 106690, "author": "zigdon", "author_id": 4913, "author_profile": "https://Stackoverflow.com/users/4913", "pm_score": 1, "selected": false, "text": "ssh serverX tail -f /path/to/log/file\n" }, { "answer_id": 126083, "author": "dsm", "author_id": 7780, "a...
2008/09/20
[ "https://Stackoverflow.com/questions/106668", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11142/" ]
106,684
<p>What I'm trying to do with MRS is to teach myself some basic AI; what I want to do is to make a rocket entity, with things such as vectored exhaust, and staging. Anyone have an idea on how to make an entity that can fly? Or do I just need to constantly apply a force upwards?</p>
[ { "answer_id": 514016, "author": "AShelly", "author_id": 10396, "author_profile": "https://Stackoverflow.com/users/10396", "pm_score": 2, "selected": false, "text": "Simulation.Physics.PhysicsEntity.ApplyForce()" } ]
2008/09/20
[ "https://Stackoverflow.com/questions/106684", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18658/" ]
106,685
<p>I use <code>PHPMyAdmi</code>n for convenience in updating a remote database.</p> <p>But it doesn't show warnings, by default, which recently got me into some embarrassing trouble where I was updating a SET field with string not on its list and not noticing the problem. </p> <p>I'm using <code>2.11.9.1 (Dreamhost's default install)</code>.</p> <p>On the <code>PHPMyAdmin</code> wiki it lists "Display warnings" as a feature of <a href="http://wiki.cihar.com/pma/phpMyAdmin_2.9.0-rc1" rel="nofollow noreferrer">version 2.9.0</a> and even "Display all warnings" as a feature of 2.10.2 -- but how do I actually turn this on? The documentation isn't great.</p>
[ { "answer_id": 9611839, "author": "Simon East", "author_id": 195835, "author_profile": "https://Stackoverflow.com/users/195835", "pm_score": 1, "selected": false, "text": "INSERTs" } ]
2008/09/20
[ "https://Stackoverflow.com/questions/106685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/242241/" ]
106,711
<p>Here's a simplified version of what I'm trying to do :</p> <ol> <li>Before any other actions are performed, present the user with a form to retrieve a string.</li> <li>Input the string, and then redirect to the default controller action (e.g. index). The string only needs to exist, no other validations are necessary.</li> <li>The string must be available (as an instance variable?) to all the actions in this controller.</li> </ol> <p>I'm very new with Rails, but this doesn't seem like it ought to be exceedingly hard, so I'm feeling kind of dumb.</p> <p>What I've tried : I have a <code>before_filter</code> redirecting to a private method that looks like</p> <pre><code>def check_string if @string return true else get_string end end </code></pre> <p>the <code>get_string</code> method looks like </p> <pre><code>def get_string if params[:string] respond_to do |format| format.html {redirect_to(accounts_url)} # authenticate.html.erb end end respond_to do |format| format.html {render :action =&gt;"get_string"} # get_string.html.erb end end </code></pre> <p>This fails because i have two render or redirect calls in the same action. I can take out that first <code>respond_to</code>, of course, but what happens is that the controller gets trapped in the <code>get_string</code> method. I can more or less see why that's happening, but I don't know how to fix it and break out. I need to be able to show one form (View), get and then do something with the input string, and then proceed as normal.</p> <p>The <code>get_string.html.erb</code> file looks like </p> <pre><code>&lt;h1&gt;Enter a string&lt;/h1&gt; &lt;% form_tag('/accounts/get_string') do %&gt; &lt;%= password_field_tag(:string, params[:string])%&gt; &lt;%= submit_tag('Ok')%&gt; &lt;% end %&gt; </code></pre> <p>I'll be thankful for any help!</p> <h2>EDIT</h2> <p>Thanks for the replies...<br> @Laurie Young : You are right, I was misunderstanding. For some reason I had it in my head that the instance of any given controller invoked by a user would persist throughout their session, and that some of the Rails magic was in tracking objects associated with each user session. I can see why that doesn't make a whole lot of sense in retrospect, and why my attempt to use an instance variable (which I'd thought would persist) won't work. Thanks to you as well :)</p>
[ { "answer_id": 106757, "author": "Toby Hede", "author_id": 14971, "author_profile": "https://Stackoverflow.com/users/14971", "pm_score": 3, "selected": true, "text": "def get_string\n @string = params[:string] || session[:string] \n respond_to do |format|\n if @string \n forma...
2008/09/20
[ "https://Stackoverflow.com/questions/106711", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17046/" ]
106,712
<p>I have a VB.NET Windows Forms project that at one point paints text directly to onto the form at runtime. Before I paint with the font though, I want to make sure that the font and font-size exists on the user's machine. If they don't, I'll try a few other similar fonts, eventually defaulting with Arial or something.</p> <p>What's the best way to test and validate a font on a user's computer?</p>
[ { "answer_id": 106724, "author": "Charlie", "author_id": 18529, "author_profile": "https://Stackoverflow.com/users/18529", "pm_score": 4, "selected": true, "text": "\n\nInstalledFontCollection installedFontCollection = new InstalledFontCollection();\n\n// Get the array of FontFamily obje...
2008/09/20
[ "https://Stackoverflow.com/questions/106712", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5473/" ]
106,766
<p>A common task in programs I've been working on lately is modifying a text file in some way. (Hey, I'm on Linux. Everything's a file. And I do large-scale system admin.)</p> <p>But the file the code modifies may not exist on my desktop box. And I probably don't want to modify it if it IS on my desktop.</p> <p>I've read about unit testing in Dive Into Python, and it's pretty clear what I want to do when testing an app that converts decimal to Roman Numerals (the example in DintoP). The testing is nicely self-contained. You don't need to verify that the program PRINTS the right thing, you just need to verify that the functions are returning the right output to a given input.</p> <p>In my case, however, we need to test that the program is modifying its environment correctly. Here's what I've come up with:</p> <p>1) Create the "original" file in a standard location, perhaps /tmp.</p> <p>2) Run the function that modifies the file, passing it the path to the file in /tmp.</p> <p>3) Verify that the file in /tmp was changed correctly; pass/fail unit test accordingly.</p> <p>This seems kludgy to me. (Gets even kludgier if you want to verify that backup copies of the file are created properly, etc.) Has anyone come up with a better way?</p>
[ { "answer_id": 106780, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 3, "selected": false, "text": "PYTHONPATH" }, { "answer_id": 111199, "author": "Glyph", "author_id": 13564, "author_profile": "https:/...
2008/09/20
[ "https://Stackoverflow.com/questions/106766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19207/" ]
106,770
<p>It has always bothered me that the only way to copy a file in Java involves opening streams, declaring a buffer, reading in one file, looping through it, and writing it out to the other steam. The web is littered with similar, yet still slightly different implementations of this type of solution.</p> <p>Is there a better way that stays within the bounds of the Java language (meaning does not involve exec-ing OS specific commands)? Perhaps in some reliable open source utility package, that would at least obscure this underlying implementation and provide a one line solution?</p>
[ { "answer_id": 115086, "author": "Josh", "author_id": 2204759, "author_profile": "https://Stackoverflow.com/users/2204759", "pm_score": 8, "selected": false, "text": "public static void copyFile(File sourceFile, File destFile) throws IOException {\n if(!destFile.exists()) {\n d...
2008/09/20
[ "https://Stackoverflow.com/questions/106770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17123/" ]
106,800
<p>Does anyone know of where to find unit testing guidelines and recommendations? I'd like to have something which addresses the following types of topics (for example):</p> <ul> <li>Should tests be in the same project as application logic?</li> <li>Should I have test classes to mirror my logic classes or should I have only as many test classes as I feel I need to have?</li> <li>How should I name my test classes, methods, and projects (if they go in different projects)</li> <li>Should private, protected, and internal methods be tested, or just those that are publicly accessible?</li> <li>Should unit and integration tests be separated?</li> <li>Is there a <strong>good</strong> reason not to have 100% test coverage?</li> </ul> <p>What am I not asking about that I should be?</p> <p>An online resource would be best.</p>
[ { "answer_id": 106813, "author": "Josh", "author_id": 11702, "author_profile": "https://Stackoverflow.com/users/11702", "pm_score": 5, "selected": true, "text": "public class UserBehavior\n" } ]
2008/09/20
[ "https://Stackoverflow.com/questions/106800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19421/" ]
106,820
<p>I realize that literally it translates to Java Enterprise Edition. But what I'm asking is what does this really mean? When a company requires Java EE experience, what are they really asking for? Experience with EJBs? Experience with Java web apps? </p> <p>I suspect that this means something different to different people and the definition is subjective.</p>
[ { "answer_id": 231843, "author": "oxbow_lakes", "author_id": 16853, "author_profile": "https://Stackoverflow.com/users/16853", "pm_score": 5, "selected": false, "text": "API" } ]
2008/09/20
[ "https://Stackoverflow.com/questions/106820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/292/" ]
106,828
<p>I need to display a bunch of images on a web page using AJAX. All of them have different dimensions, so I want to adjust their size before displaying them. Is there any way to do this in JavaScript?</p> <p>Using PHP's <code>getimagesize()</code> for each image causes an unnecessary performance hit since there will be many images.</p>
[ { "answer_id": 106843, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "<img>" }, { "answer_id": 106844, "author": "Stephen Wrighton", "author_id": 7516, "author_profile": "https...
2008/09/20
[ "https://Stackoverflow.com/questions/106828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
106,854
<p>Whats a good value for an identity increment for an 'Orders' table? (orders as in shopping cart orders)</p> <p>I want the order numbers to appear so that we have more orders than we really do, plus make it harder for users to guess order numbers of other users in cases where that might be a problem.</p> <p>I dont want too big a value such that I might run out of values, and i also don't want a noticable sequence to be apparent.</p> <p>I've settled on 42 for now</p>
[ { "answer_id": 106875, "author": "David Basarab", "author_id": 2469, "author_profile": "https://Stackoverflow.com/users/2469", "pm_score": 0, "selected": false, "text": "[ID] [int] IDENTITY(5497,73) NOT NULL,\n" }, { "answer_id": 9463851, "author": "soniiic", "author_id":...
2008/09/20
[ "https://Stackoverflow.com/questions/106854", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16940/" ]
106,880
<p>I am trying to use the <code>InternalsVisibleTo</code> assembly attribute to make my internal classes in a .NET class library visible to my unit test project. For some reason, I keep getting an error message that says:</p> <blockquote> <p>'MyClassName' is inaccessible due to its protection level</p> </blockquote> <p>Both assemblies are signed and I have the correct key listed in the attribute declaration. Any ideas?</p>
[ { "answer_id": 107958, "author": "Joe", "author_id": 13087, "author_profile": "https://Stackoverflow.com/users/13087", "pm_score": 8, "selected": true, "text": "[assembly: InternalsVisibleTo(\"MyFriendAssembly,\nPublicKey=0024000004800000940000000602000000240000525341310004000001000100F7...
2008/09/20
[ "https://Stackoverflow.com/questions/106880", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14101/" ]
106,886
<p>I have a table that is dynamically created using DIVs. Each row of the table has two images. I want to set the height for the div (that represents a particular row) to the height of image that is greater of the two images being displayed in that particular row. The images to displayed will always change, and they are from an external server.</p> <p>How do I set the height for my div so that I can fit images?</p>
[ { "answer_id": 106915, "author": "MetaGuru", "author_id": 18309, "author_profile": "https://Stackoverflow.com/users/18309", "pm_score": 0, "selected": false, "text": "function getSize(imgSrc){\n\n var aImg = new Image();\n\n aImg.src = imgSrc;\n\n aHeight = newImg.height;\n a...
2008/09/20
[ "https://Stackoverflow.com/questions/106886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
106,896
<p>I'm used to the Java model where you can have one public class per file. Python doesn't have this restriction, and I'm wondering what's the best practice for organizing classes.</p>
[ { "answer_id": 107836, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 9, "selected": true, "text": "from ssReader import Reader\nfrom theCalcs import ACalc, AnotherCalc\nfrom theDB import Loader\n\ndef main( sourceFileName )...
2008/09/20
[ "https://Stackoverflow.com/questions/106896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14139/" ]
106,907
<p>We put all of our unit tests in their own projects. We find that we have to make certain classes public instead of internal just for the unit tests. Is there anyway to avoid having to do this. What are the memory implication by making classes public instead of sealed?</p>
[ { "answer_id": 106948, "author": "Ash", "author_id": 5023, "author_profile": "https://Stackoverflow.com/users/5023", "pm_score": 9, "selected": true, "text": "[assembly: InternalsVisibleTo(\"NameAssemblyYouWantToPermitAccess\")]\nnamespace NameOfYourNameSpace\n{\n" }, { "answer_i...
2008/09/20
[ "https://Stackoverflow.com/questions/106907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4653/" ]
106,912
<p>How do you draw a custom button next to the minimize, maximize and close buttons within the Titlebar of the Form?</p> <p>I know you need to use Win32 API calls and override the WndProc procedure, but I haven't been able to figure out a solution that works right.</p> <p>Does anyone know how to do this? More specifically, does anyone know a way to do this that works in Vista?</p>
[ { "answer_id": 107437, "author": "Matthew Scharley", "author_id": 15537, "author_profile": "https://Stackoverflow.com/users/15537", "pm_score": 4, "selected": true, "text": "// The state of our little button\nButtonState _buttState = ButtonState.Normal;\nRectangle _buttPosition = new Rec...
2008/09/20
[ "https://Stackoverflow.com/questions/106912", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7831/" ]
106,941
<p>I'm a pretty new C# and .NET developer. I recently created an MMC snapin using C# and was gratified by how easy it was to do, especially after hearing a lot of horror stories by some other developers in my organisation about how hard it is to do in C++.</p> <p>I pretty much went through the whole project at some point and made every instance of the &quot;public&quot; keyword to &quot;internal&quot;, except as required by the runtime in order to run the snapin. What is your feeling on this, should you generally make classes and methods public or internal?</p>
[ { "answer_id": 106962, "author": "Ryan Farley", "author_id": 1627, "author_profile": "https://Stackoverflow.com/users/1627", "pm_score": -1, "selected": false, "text": "class Class1\n{\n}\n" }, { "answer_id": 106971, "author": "Jay Bazuzi", "author_id": 5314, "author_...
2008/09/20
[ "https://Stackoverflow.com/questions/106941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3146/" ]
106,963
<p>I'm building the world's simplest library application. All I want to be able to do is scan in a book's UPC (barcode) using a typical scanner (which just types the numbers of the barcode into a field) and then use it to look up data about the book... at a minimum, title, author, year published, and either the Dewey Decimal or Library of Congress catalog number.</p> <p>The goal is to print out a tiny sticker ("spine label") with the card catalog number that I can stick on the spine of the book, and then I can sort the books by card catalog number on the shelves in our company library. That way books on similar subjects will tend to be near each other, for example, if you know you're looking for a book about accounting, all you have to do is find SOME book about accounting and you'll see the other half dozen that we have right next to it which makes it convenient to browse the library.</p> <p>There seem to be lots of web APIs to do this, including Amazon and the Library of Congress. But those are all extremely confusing to me. What I really just want is a single higher level function that takes a UPC barcode number and returns some basic data about the book.</p>
[ { "answer_id": 106987, "author": "Philip Rieck", "author_id": 12643, "author_profile": "https://Stackoverflow.com/users/12643", "pm_score": 3, "selected": false, "text": "if (indexisbn.indexOf(\"978\") == 0) {\n isbn = isbn.substr(3,9);\n var xsum = 0;\n var add = 0;\n var i = 0;...
2008/09/20
[ "https://Stackoverflow.com/questions/106963", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4/" ]
106,965
<p>Is there a way to read a locked file across a network given that you are the machine admin on the remote machine? I haven't been able to read the locked file locally, and attempting it over the network adds another layer of difficulty.</p>
[ { "answer_id": 106987, "author": "Philip Rieck", "author_id": 12643, "author_profile": "https://Stackoverflow.com/users/12643", "pm_score": 3, "selected": false, "text": "if (indexisbn.indexOf(\"978\") == 0) {\n isbn = isbn.substr(3,9);\n var xsum = 0;\n var add = 0;\n var i = 0;...
2008/09/20
[ "https://Stackoverflow.com/questions/106965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2712/" ]
106,979
<p>I have two threads, one needs to poll a bunch of separate static resources looking for updates. The other one needs to get the data and store it in the database. How can thread 1 tell thread 2 that there is something to process?</p>
[ { "answer_id": 106994, "author": "1800 INFORMATION", "author_id": 3146, "author_profile": "https://Stackoverflow.com/users/3146", "pm_score": 4, "selected": true, "text": "QueueUserWorkItem" } ]
2008/09/20
[ "https://Stackoverflow.com/questions/106979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14101/" ]
107,005
<p>I'm trying to find if there is a reliable way (using <a href="http://en.wikipedia.org/wiki/SQLite" rel="noreferrer">SQLite</a>) to find the ID of the next row to be inserted, <em>before it gets inserted</em>. I need to use the id for another insert statement, but don't have the option of instantly inserting and getting the next row.</p> <p>Is predicting the next id as simple as getting the last id and adding one? Is that a guarantee?</p> <p>Edit: A little more reasoning... I can't insert immediately because the insert may end up being canceled by the user. User will make some changes, SQL statements will be stored, and from there the user can either save (inserting all the rows at once), or cancel (not changing anything). In the case of a program crash, the desired functionality is that nothing gets changed.</p>
[ { "answer_id": 107115, "author": "Eevee", "author_id": 17875, "author_profile": "https://Stackoverflow.com/users/17875", "pm_score": 5, "selected": true, "text": "BEGIN;" }, { "answer_id": 409834, "author": "Einstein", "author_id": 41898, "author_profile": "https://St...
2008/09/20
[ "https://Stackoverflow.com/questions/107005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14278/" ]
107,054
<p>I'm trying to implement an outdent of the first letter of the first paragraph of the body text. Where I'm stuck is in getting consistent spacing between the first letter and the rest of the paragraph. </p> <p>For example, there is a huge difference in spacing between a "W" and an "I"</p> <p><img src="https://i.stack.imgur.com/2TsvYm.png" alt="&#39;I&#39; Outdent"><br> <img src="https://i.stack.imgur.com/DnZVSm.png" alt="&#39;W&#39; Outdent"></p> <p>Anyone have any ideas about how to mitigate the differences? I'd prefer a pure CSS solution, but will resort to JavaScript if need be.</p> <p><strong>PS</strong>: I don't necessarily need compatibility in IE or Opera</p>
[ { "answer_id": 107111, "author": "Matthew Rapati", "author_id": 15000, "author_profile": "https://Stackoverflow.com/users/15000", "pm_score": 0, "selected": false, "text": "p.outdent:first-letter {\n font-family: ms mincho;\n font-size: 8em;\n line-height: 1;\n font-weight: n...
2008/09/20
[ "https://Stackoverflow.com/questions/107054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11577/" ]
107,073
<p>I am designing a game to be played in the browser.</p> <p>Game is a space theme and I need to generate a map of the "Galaxy".</p> <p>The basic idea of the map is here:</p> <p><a href="http://www.oglehq.com/map.png" rel="nofollow noreferrer">game map http://www.oglehq.com/map.png</a></p> <p>The map is a grid, with each grid sector can contain a planet/system and each of these has links to a number of adjacent grids.</p> <p>To generate the maps I figured that I would have a collection of images representing the grid elements. So in the case of the sample above, each of the squares is a separate graphic. </p> <p>To create a new map I would "weave" the images together. The map element images would have the planets and their links already on them, and I, therefore, need to stitch the map together in such a way that each image is positioned with its appropriate counterparts => so the image in the bottom corner must have images to the left and diagonal left that link up with it correctly. </p> <p>How would you go about creating the code to know where to place the images? Is there a better way than using images?</p> <p>At the moment performance and/or load should not be a consideration (if I need to generate maps to have preconfigured rather than do it in real-time, I don't mind).</p> <p>If it makes a difference I will be using HTML, CSS, and JavaScript and backed by a Ruby on Rails app. </p>
[ { "answer_id": 107161, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": -1, "selected": false, "text": "Bit 0 : Has planet\nBit 1 : Has line from planet going north\nBit 2 : Has line from planet going northwest\n...\nBit 8 : Has ...
2008/09/20
[ "https://Stackoverflow.com/questions/107073", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14971/" ]
107,079
<p>I know WCF supports many WS-* protocols but WS-Eventing does seem to be listed.</p> <p>I do know that WCF has a pub/sub model, but is it WS-Eventing compliant?</p>
[ { "answer_id": 4185246, "author": "till", "author_id": 148337, "author_profile": "https://Stackoverflow.com/users/148337", "pm_score": 1, "selected": false, "text": " Subscribe s = new Subscribe();\n (s.Delivery = new DeliveryType()).Mode...
2008/09/20
[ "https://Stackoverflow.com/questions/107079", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2744/" ]
107,117
<p>I noticed that you can call Queue.Synchronize to get a thread-safe queue object, but the same method isn't available on Queue&lt;T&gt;. Does anyone know why? Seems kind of weird.</p>
[ { "answer_id": 107182, "author": "Domenic", "author_id": 3191, "author_profile": "https://Stackoverflow.com/users/3191", "pm_score": 3, "selected": false, "text": "Queue<T>" }, { "answer_id": 107789, "author": "Matt Ryan", "author_id": 19548, "author_profile": "https:...
2008/09/20
[ "https://Stackoverflow.com/questions/107117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14101/" ]
107,132
<p>As a follow up to "<a href="https://stackoverflow.com/questions/105400/what-are-indexes-and-how-can-i-use-them-to-optimize-queries-in-my-database">What are indexes and how can I use them to optimise queries in my database?</a>" where I am attempting to learn about indexes, what columns are good index candidates? Specifically for an MS SQL database?</p> <p>After some googling, everything I have read suggests that columns that are generally increasing and unique make a good index (things like MySQL's auto_increment), I understand this, but I am using MS SQL and I am using GUIDs for primary keys, so it seems that indexes would not benefit GUID columns...</p>
[ { "answer_id": 107166, "author": "Eevee", "author_id": 17875, "author_profile": "https://Stackoverflow.com/users/17875", "pm_score": 2, "selected": false, "text": "SELECT" }, { "answer_id": 107172, "author": "pappes", "author_id": 19494, "author_profile": "https://Sta...
2008/09/20
[ "https://Stackoverflow.com/questions/107132", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1638/" ]
107,150
<p>How do I capture the event of the clicking the Selected Node of a TreeView? It doesn't fire the <strong>SelectedNodeChanged</strong> since the selection has obviously not changed but then what event can I catch so I know that the Selected Node was clicked?</p> <p><strong>UPDATE</strong>: When I have some time, I'm going to have to dive into the bowels of the TreeView control and dig out what and where it handles the click events and subclass the TreeView to expose a new event OnSelectedNodeClicked.</p> <p>I'll probably do this over the Christmas holidays and I'll report back with the results.</p> <p><strong>UPDATE</strong>: I have come up with a solution below that sub-classes the TreeView control.</p>
[ { "answer_id": 107298, "author": "Wayne", "author_id": 8236, "author_profile": "https://Stackoverflow.com/users/8236", "pm_score": 3, "selected": false, "text": "protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e){\n // Do whatever you're doing\n TreeView1.Selected...
2008/09/20
[ "https://Stackoverflow.com/questions/107150", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19377/" ]
107,154
<p>I've just read up on <code>Thread.IsBackground</code> and if I understand it correctly, when it's set to <code>false</code> the Thread is a foreground thread which means it should stay alive until it has finished working even though the app have been exited out. Now I tested this with a winform app and it works as expected but when used with a console app the process doesn't stay alive but exits right away. Does the <code>Thread.IsBackground</code> behave differently from a console app than a winform app?</p>
[ { "answer_id": 107306, "author": "Adrian Clark", "author_id": 148, "author_profile": "https://Stackoverflow.com/users/148", "pm_score": 3, "selected": true, "text": "Thread.IsBackground" } ]
2008/09/20
[ "https://Stackoverflow.com/questions/107154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19490/" ]
107,160
<p>I recently started work on a personal coding project using C++ and KDevelop. Although I started out by just hacking around, I figure it'll be better in the long run if I set up a proper unit test suite before going too much further. I've created a seperate test-runner executable as a sub project, and the tests I've added to it appear to function properly. So far, success.</p> <p>However, I'd really like to get my unit tests running every time I build, not only when I explicitly run them. This will be especially true as I split up the mess I've made into convenience libraries, each of which will probably have its own test executable. Rather than run them all by hand, I'd like to get them to run as the final step in my build process. I've looked all through the options in the project menu and the automake manager, but I can't figure out how to set this up.</p> <p>I imagine this could probably be done by editing the makefile by hand. Unfortunately, my makefile-fu is a bit weak, and I'm also afraid that KDevelop might overwrite any changes I make by hand the next time I change something through the IDE. Therefore, if there's an option on how to do this through KDevelop itself, I'd much prefer to go that way.</p> <p>Does anybody know how I could get KDevelop to run my test executables as part of the build process? Thank you!</p> <p>(I'm not 100% tied to KDevelop. If KDevelop can't do this, or else if there's an IDE that makes this much easier, I could be convinced to switch.)</p>
[ { "answer_id": 8608452, "author": "Caruccio", "author_id": 561948, "author_profile": "https://Stackoverflow.com/users/561948", "pm_score": 0, "selected": false, "text": "$ cat src/base64.c\n//code to be tested\nint encode64(...) { ... }\n\n#ifdef UNITTEST\n#include <assert.h>\nint main(i...
2008/09/20
[ "https://Stackoverflow.com/questions/107160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19491/" ]
107,165
<p>I'm asking more about what this means to my code. I understand the concepts mathematically, I just have a hard time wrapping my head around what they mean conceptually. For example, if one were to perform an O(1) operation on a data structure, I understand that the number of operations it has to perform won't grow because there are more items. And an O(n) operation would mean that you would perform a set of operations on each element. Could somebody fill in the blanks here?</p> <ul> <li>Like what exactly would an O(n^2) operation do?</li> <li>And what the heck does it mean if an operation is O(n log(n))?</li> <li>And does somebody have to smoke crack to write an O(x!)?</li> </ul>
[ { "answer_id": 3461832, "author": "Albin Sunnanbo", "author_id": 401728, "author_profile": "https://Stackoverflow.com/users/401728", "pm_score": 5, "selected": false, "text": "C#" }, { "answer_id": 30371967, "author": "Khaled.K", "author_id": 2128327, "author_profile"...
2008/09/20
[ "https://Stackoverflow.com/questions/107165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2147/" ]
107,196
<p>When I do a clean build my C# project, the produced dll is different then the previously built one (which I saved separately). No code changes were made, just clean and rebuild. </p> <p>Diff shows some bytes in the DLL have changes -- few near the beginning and few near the end, but I can't figure out what these represent. Does anybody have insights on why this is happening and how to prevent it? </p> <p>This is using Visual Studio 2005 / WinForms.</p> <p><strong>Update:</strong> Not using automatic version incrementing, or signing the assembly. If it's a timestamp of some sort, how to I prevent VS from writing it? </p> <p><strong>Update:</strong> After looking in Ildasm/diff, it seems like the following items are different:</p> <ul> <li>Two bytes in PE header at the start of the file.</li> <li>&lt;PrivateImplementationDetails&gt;{<em>guid</em>} section </li> <li>Cryptic part of the string table near the end (wonder why, I did not change the strings)</li> <li>Parts of assembly info at the end of file.</li> </ul> <p>No idea how to eliminate any of these, if at all possible...</p>
[ { "answer_id": 107448, "author": "Alex Lyman", "author_id": 5897, "author_profile": "https://Stackoverflow.com/users/5897", "pm_score": 5, "selected": true, "text": "View > MetaInfo > Raw:Header,Schema,Rows // important, otherwise you get very basic info from the next step\n\nView > Meta...
2008/09/20
[ "https://Stackoverflow.com/questions/107196", "https://Stackoverflow.com", "https://Stackoverflow.com/users/838/" ]
107,243
<p>I was reading Andrew Kennedy's blog post series on <a href="http://blogs.msdn.com/andrewkennedy/archive/2008/08/29/units-of-measure-in-f-part-one-introducing-units.aspx" rel="noreferrer">units of measurement in F#</a> and it makes a lot of sense in a lot of cases. Are there any other languages that have such a system?</p> <p>Edit: To be more clear, I mean the flexible units of measurement system where you can define your own arbitrarily.</p>
[ { "answer_id": 107250, "author": "Alex M", "author_id": 9652, "author_profile": "https://Stackoverflow.com/users/9652", "pm_score": 2, "selected": false, "text": "RPL" }, { "answer_id": 107287, "author": "Eevee", "author_id": 17875, "author_profile": "https://Stackove...
2008/09/20
[ "https://Stackoverflow.com/questions/107243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4977/" ]
107,292
<p>We are starting a new SOA project with a lot of shared .net assemblies. The code for these assemblies will be stored in SVN.</p> <p>In development phase, we would like to be able to code these assemblies as an entire solution with as little SVN 'friction' as possible. </p> <p>When the project enters more of a maintenance mode, the assemblies will be maintained on an individual level.</p> <p>Without making Branching, Tagging, and Automated Builds a maintenance nightmare, what's the best way to organize these libraries in SVN that also works well with the VS 2008 IDE?</p> <p>Do you setup Trunk/Branches/Tags at each library level and try to spaghetti it all together somehow at compile time, or is it better to keep it all as one big project with code replicated here and there for simplicity? Is there a solution using externs?</p>
[ { "answer_id": 107525, "author": "Craig Trader", "author_id": 12895, "author_profile": "https://Stackoverflow.com/users/12895", "pm_score": 4, "selected": true, "text": "/svn/tools/\n vendor1/\n too11/\n 1.0/\n 1.1/\n latest = a copy of vendor1/tool1/1.1\n too...
2008/09/20
[ "https://Stackoverflow.com/questions/107292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6354/" ]
107,294
<p>I understand the overall meaning of pointers and references(or at least I think i do), I also understand that when I use <b>new</b> I am dynamically allocating memory.</p> <p>My question is the following:</p> <p>If i were to use <code>cout &lt;&lt; &amp;p</code>, it would display the "virtual memory location" of <code>p</code>. Is there a way in which I could manipulate this "virtual memory location?"</p> <p>For example, the following code shows an array of <code>int</code>s.</p> <p>If I wanted to show the value of <code>p[1]</code> and I knew the "virtual memory location" of <code>p</code>, could I somehow do "<code>&amp;p + 1</code>" and obtain the value of <code>p[1]</code> with <code>cout &lt;&lt; *p</code>, which will now point to the second element in the array?</p> <pre><code>int *p; p = new int[3]; p[0] = 13; p[1] = 54; p[2] = 42; </code></pre>
[ { "answer_id": 107301, "author": "KTC", "author_id": 12868, "author_profile": "https://Stackoverflow.com/users/12868", "pm_score": 4, "selected": true, "text": "int *p = new int[3];\np[0] = 13;\np[1] = 54;\np[2] = 42;\n\ncout << *p << ' ' << *(p+1) << ' ' << *(p+2);\n" }, { "answ...
2008/09/20
[ "https://Stackoverflow.com/questions/107294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17162/" ]
107,314
<p>We've been using selenium with great success to handle high-level website testing (in addition to extensive python doctests at a module level). However now we're using extjs for a lot of pages and its proving difficult to incorporate Selenium tests for the complex components like grids. </p> <p>Has anyone had success writing automated tests for extjs-based web pages? Lots of googling finds people with similar problems, but few answers. Thanks!</p>
[ { "answer_id": 185372, "author": "Marko Dumic", "author_id": 5817, "author_profile": "https://Stackoverflow.com/users/5817", "pm_score": 2, "selected": false, "text": "/**\n * Javascript needed to execute in order to select row in the grid\n * \n * @param gridId Grid id\n * @param rowInd...
2008/09/20
[ "https://Stackoverflow.com/questions/107314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19506/" ]
107,390
<p>They both seem to be sending data to the server inside the body, so what makes them different?</p>
[ { "answer_id": 107415, "author": "Jonathan Arkell", "author_id": 11052, "author_profile": "https://Stackoverflow.com/users/11052", "pm_score": 8, "selected": false, "text": "PUT" }, { "answer_id": 107450, "author": "Brian R. Bondy", "author_id": 3153, "author_profile"...
2008/09/20
[ "https://Stackoverflow.com/questions/107390", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10708/" ]
107,404
<p>What are the down sides of using a composite/compound primary key?</p>
[ { "answer_id": 877556, "author": "onedaywhen", "author_id": 15354, "author_profile": "https://Stackoverflow.com/users/15354", "pm_score": 1, "selected": false, "text": "PRIMARY KEY" } ]
2008/09/20
[ "https://Stackoverflow.com/questions/107404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6354/" ]
107,405
<p>What I'm trying to do here is get the headers of a given URL so I can determine the MIME type. I want to be able to see if <code>http://somedomain/foo/</code> will return an HTML document or a JPEG image for example. Thus, I need to figure out how to send a HEAD request so that I can read the MIME type without having to download the content. Does anyone know of an easy way of doing this?</p>
[ { "answer_id": 107427, "author": "Eevee", "author_id": 17875, "author_profile": "https://Stackoverflow.com/users/17875", "pm_score": 8, "selected": true, "text": ">>> import httplib\n>>> conn = httplib.HTTPConnection(\"www.google.com\")\n>>> conn.request(\"HEAD\", \"/index.html\")\n>>> r...
2008/09/20
[ "https://Stackoverflow.com/questions/107405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10708/" ]
107,413
<p>I have a 3d object that I wish to be able to rotate around in 3d. The easiest way is to directly translate X and Y mouse motion to rotation about the Y and X axes, but if there is some rotation along both axes, the way the model rotates becomes highly counterintuitive (i.e. if you flip the object 180 degrees about one axis, your motion along the other axis is reversed).</p> <p>I could simply do the above method, but instead of storing the amount to rotate about the two axes, I could store the full rotation matrix and just further rotate it along the same axes for each mouse drag, but I'm concerned that that would quickly have precision issues.</p>
[ { "answer_id": 107510, "author": "Lloyd", "author_id": 9952, "author_profile": "https://Stackoverflow.com/users/9952", "pm_score": 3, "selected": false, "text": "q.x = sin(0.5*angle) * axis.x;\nq.y = sin(0.5*angle) * axis.y;\nq.z = sin(0.5*angle) * axis.z;\nq.w = cos(0.5*angle);\n" } ]
2008/09/20
[ "https://Stackoverflow.com/questions/107413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
107,414
<p>As a base SAS programmer, you know the drill:</p> <p>You submit your SAS code, which contains an unbalanced quote, so now you've got not only and unclosed quote, but also unclosed comments, macro function definitions, and a missing run; or quit; statement.</p> <p>What's your best trick for not having those unbalanced quotes bother you?</p>
[ { "answer_id": 107443, "author": "Martin Bøgelund", "author_id": 18968, "author_profile": "https://Stackoverflow.com/users/18968", "pm_score": 3, "selected": false, "text": "*); */; /*’*/ /*”*/; %mend;\n" }, { "answer_id": 536803, "author": "AFHood", "author_id": 65050, ...
2008/09/20
[ "https://Stackoverflow.com/questions/107414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18968/" ]
107,456
<p>So I'm looking at writing an iPhone application that shows things on a map. What frameworks/methodologies are out there for doing this?</p> <p>Searching around on Google, I could only find this one: <a href="http://code.google.com/p/iphone-google-maps-component/" rel="nofollow noreferrer">http://code.google.com/p/iphone-google-maps-component/</a></p> <p>Which according to the issues list is slow, and stops working after a while. Does anyone know of something better, or have any experience with the library above?</p>
[ { "answer_id": 3759873, "author": "sanjay", "author_id": 451368, "author_profile": "https://Stackoverflow.com/users/451368", "pm_score": 0, "selected": false, "text": "[[uiapplication sharedapplication]openurl:@\"www.maps.google.com];" } ]
2008/09/20
[ "https://Stackoverflow.com/questions/107456", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6044/" ]
107,464
<p>There have been some questions about whether or not JavaScript is an object-oriented language. Even a statement, "just because a language has objects doesn't make it OO."</p> <p>Is JavaScript an object-oriented language?</p>
[ { "answer_id": 108773, "author": "AnthonyWJones", "author_id": 17516, "author_profile": "https://Stackoverflow.com/users/17516", "pm_score": 7, "selected": true, "text": "function MyClass() {\n var _value = 1;\n this.getValue = function() { return _value; }\n}\n" } ]
2008/09/20
[ "https://Stackoverflow.com/questions/107464", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1538/" ]
107,531
<p>I would like to create an XML-based website. I want to use XML files as datasources since it is a kind of online directory site. Can someone please give me a starting point? Are there any good online resources that I can refer to? I am pretty comfortable with ASP and JavaScript.</p>
[ { "answer_id": 108920, "author": "Svante Svenson", "author_id": 19707, "author_profile": "https://Stackoverflow.com/users/19707", "pm_score": 0, "selected": false, "text": "<data>\n <item visible=\"no\">\n <title>Invisible item 1</title>\n </item>\n <item visible=\"yes\">\n <tit...
2008/09/20
[ "https://Stackoverflow.com/questions/107531", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19536/" ]
107,546
<p>I need to implement auto-capitalization inside of a Telerik RadEditor control on an ASPX page as a user types.</p> <p>This can be an IE specific solution (IE6+).</p> <p>I currently capture every keystroke (down/up) as the user types to support a separate feature called "macros" that are essentially short keywords that expand into formatted text. i.e. the macro "so" could auto expand upon hitting spacebar to "stackoverflow".</p> <p>That said, I have access to the keyCode information, as well I am using the TextRange methods to select a word ("so") and expanding it to "stackoverflow". Thus, I have some semblence of context.</p> <p>However, I need to check this context to know whether I should auto-capitalize. This also needs to work regardless of whether a macro is involved.</p> <p>Since I'm monitoring keystrokes for the macros, should I just monitor for punctuation (it's more than just periods that signal a capital letter) and auto-cap the next letter typed, or should I use TextRange and analyze context?</p>
[ { "answer_id": 107662, "author": "Andrew Hedges", "author_id": 11577, "author_profile": "https://Stackoverflow.com/users/11577", "pm_score": 3, "selected": true, "text": "function toTitleCase(str) {\n return str.replace(/([\\w&`'‘’\"“.@:\\/\\{\\(\\[<>_]+-? *)/g, function(match, ...
2008/09/20
[ "https://Stackoverflow.com/questions/107546", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2742/" ]
107,549
<p>When we compile a dll using __stdcall inside visual studio 2008 the compiled function names inside the dll are.</p> <p>FunctionName</p> <p>Though when we compile the same dll using GCC using wx-dev-cpp GCC appends the number of paramers the function has, so the name of the function using Dependency walker looks like.</p> <p>FunctionName@numberOfParameters or == FunctionName@8</p> <p>How do you tell GCC compiler to remove @nn from exported symbols in the dll?</p>
[ { "answer_id": 107564, "author": "Roger Lipscombe", "author_id": 8446, "author_profile": "https://Stackoverflow.com/users/8446", "pm_score": 4, "selected": true, "text": "void __stdcall Foo(int a, int b);\n" }, { "answer_id": 254789, "author": "CesarB", "author_id": 28258...
2008/09/20
[ "https://Stackoverflow.com/questions/107549", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17382/" ]
107,562
<p>I'm trying to install faac and am running into errors. Here are the errors I get when trying to build it:</p> <hr> <pre><code>[root@test faac]# ./bootstrap configure.in:11: warning: underquoted definition of MY_DEFINE run info '(automake)Extending aclocal' or see http://sources.redhat.com/automake/automake.html#Extending-aclocal aclocal:configure.in:17: warning: macro `AM_PROG_LIBTOOL' not found in library common/mp4v2/Makefile.am:5: Libtool library used but `LIBTOOL' is undefined common/mp4v2/Makefile.am:5: common/mp4v2/Makefile.am:5: The usual way to define `LIBTOOL' is to add `AC_PROG_LIBTOOL' common/mp4v2/Makefile.am:5: to `configure.in' and run `aclocal' and `autoconf' again. libfaac/Makefile.am:1: Libtool library used but `LIBTOOL' is undefined libfaac/Makefile.am:1: libfaac/Makefile.am:1: The usual way to define `LIBTOOL' is to add `AC_PROG_LIBTOOL' libfaac/Makefile.am:1: to `configure.in' and run `aclocal' and `autoconf' again. configure.in:17: error: possibly undefined macro: AM_PROG_LIBTOOL If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. </code></pre> <hr> <p>Does anyone know what this means? I was unable to find anything about this so I figured I'd ask you guys. Thank you for your help.</p> <p>EDIT: Here's my versions of linux, libtool, automake and autoconf:</p> <pre><code>[root@test faac]# libtool --version ltmain.sh (GNU libtool) 2.2 Written by Gordon Matzigkeit &lt;gord@gnu.ai.mit.edu&gt;, 1996 Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [root@test faac]# autoconf --version autoconf (GNU Autoconf) 2.59 Written by David J. MacKenzie and Akim Demaille. Copyright (C) 2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [root@test faac]# automake --version automake (GNU automake) 1.9.2 Written by Tom Tromey &lt;tromey@redhat.com&gt;. Copyright 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [root@test faac]# cat /etc/redhat-release Red Hat Enterprise Linux WS release 4 (Nahant) </code></pre>
[ { "answer_id": 107592, "author": "Douglas Leeder", "author_id": 3978, "author_profile": "https://Stackoverflow.com/users/3978", "pm_score": 2, "selected": false, "text": "$ ./bootstrap \nconfigure.in:11: warning: underquoted definition of MY_DEFINE\nconfigure.in:11: run info '(automake...
2008/09/20
[ "https://Stackoverflow.com/questions/107562", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
107,566
<p>My last couple of projects have involved websites that sell a product/service and require a 'checkout' process in which users put in their credit card information and such. Obviously we got SSL certificates for the security of it plus giving peace of mind to the customers. I am, however, a little clueless as to the subtleties of it, and most importantly as to which parts of the website should 'use' the certificate.</p> <p>For example, I've been to websites where the moment you hit the homepage you are put in https - mostly banking sites - and then there are websites where you are only put in https when you are finally checking out. Is it overkill to make the entire website run through https if it doesn't deal with something on the level of banking? Should I only make the checkout page https? What is the performance hit on going all out?</p>
[ { "answer_id": 7468106, "author": "Blans", "author_id": 952203, "author_profile": "https://Stackoverflow.com/users/952203", "pm_score": 0, "selected": false, "text": "https" } ]
2008/09/20
[ "https://Stackoverflow.com/questions/107566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16417/" ]
107,598
<p>Given an arbitrary sequence of points in space, how would you produce a smooth continuous interpolation between them?</p> <p>2D and 3D solutions are welcome. Solutions that produce a list of points at arbitrary granularity and solutions that produce control points for bezier curves are also appreciated.</p> <p>Also, it would be cool to see an iterative solution that could approximate early sections of the curve as it received the points, so you could draw with it.</p>
[ { "answer_id": 107664, "author": "freespace", "author_id": 8297, "author_profile": "https://Stackoverflow.com/users/8297", "pm_score": 2, "selected": false, "text": "p(x)" } ]
2008/09/20
[ "https://Stackoverflow.com/questions/107598", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2653/" ]
107,603
<p>I am constantly learning new tools, even old fashioned ones, because I like to use the right solution for the problem.</p> <p>Nevertheless, I wonder if there is still any reason to learn some of them. <code>awk</code> for example is interesting to me, but for simple text processing, I can use <code>grep</code>, <code>cut</code>, <code>sed</code>, etc. while for complex ones, I'll go for Python.</p> <p>Now I don't mean that's it's not a powerful and handy tool. But since it takes time and energy to learn a new tool, <strong>is it worth it</strong> ?</p>
[ { "answer_id": 107618, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 5, "selected": false, "text": "awk" }, { "answer_id": 107619, "author": "Matthias Kestenholz", "author_id": 317346, "author_profile"...
2008/09/20
[ "https://Stackoverflow.com/questions/107603", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9951/" ]
107,611
<p>I need to load some fonts temporarily in my program. Preferably from a dll resource file.</p>
[ { "answer_id": 107702, "author": "Brian Matthews", "author_id": 1969, "author_profile": "https://Stackoverflow.com/users/1969", "pm_score": 2, "selected": false, "text": "\n34 FONT \"myfont.ttf\"\n" }, { "answer_id": 110705, "author": "Francesca", "author_id": 9842, "...
2008/09/20
[ "https://Stackoverflow.com/questions/107611", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13219/" ]
107,660
<p>What is the best (regarding performance) way to compute the critical path of a directional acyclic graph when the nodes of the graph have weight?</p> <p>For example, if I have the following structure:</p> <pre><code> Node A (weight 3) / \ Node B (weight 4) Node D (weight 7) / \ Node E (weight 2) Node F (weight 3) </code></pre> <p>The critical path should be A->B->F (total weight: 10)</p>
[ { "answer_id": 37254469, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "a > b" } ]
2008/09/20
[ "https://Stackoverflow.com/questions/107660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19331/" ]
107,668
<p>If you have a situation where a TCP connection is potentially too slow and a UDP 'connection' is potentially too unreliable what do you use? There are various standard reliable UDP protocols out there, what experiences do you have with them?</p> <p>Please discuss one protocol per reply and if someone else has already mentioned the one you use then consider voting them up and using a comment to elaborate if required.</p> <p><strong>I'm interested in the various options here, of which TCP is at one end of the scale and UDP is at the other. Various reliable UDP options are available and each brings some elements of TCP to UDP.</strong></p> <p>I know that often TCP is the correct choice but having a list of the alternatives is often useful in helping one come to that conclusion. Things like Enet, RUDP, etc that are built on UDP have various pros and cons, have you used them, what are your experiences?</p> <p>For the avoidance of doubt there is no more information, this is a hypothetical question and one that I hoped would elicit a list of responses that detailed the various options and alternatives available to someone who needs to make a decision.</p>
[ { "answer_id": 108451, "author": "smo", "author_id": 16080, "author_profile": "https://Stackoverflow.com/users/16080", "pm_score": 3, "selected": false, "text": "int opt = -1;\nif (setsockopt(sock_fd, IPPROTO_TCP, TCP_NODELAY, (char *)&opt, sizeof(opt)))\n printf(\"Error disabling Nagle...
2008/09/20
[ "https://Stackoverflow.com/questions/107668", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7925/" ]
107,674
<p>I'd like to build a real quick and dirty administrative backend for a Ruby on Rails application I have been attached to at the last minute. I've looked at activescaffold and streamlined and think they are both very attractive and they should be simple to get running, but I don't quite understand how to set up either one as a backend administration page. They seem designed to work like standard Ruby on Rails generators/scaffolds for creating visible front ends with model-view-controller-table name correspondence.</p> <p>How do you create a admin_players interface when players is already in use and you want to avoid, as much as possible, affecting any of its related files?</p> <p>The show, edit and index of the original resource are not usuable for the administrator.</p>
[ { "answer_id": 107715, "author": "Toby Hede", "author_id": 14971, "author_profile": "https://Stackoverflow.com/users/14971", "pm_score": 3, "selected": false, "text": "class CustomersController < ApplicationController\n layout 'streamlined'\n acts_as_streamlined \n\n Streamlined...
2008/09/20
[ "https://Stackoverflow.com/questions/107674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6805/" ]
107,675
<p>I'd like to unit test responses from the Google App Engine webapp.WSGIApplication, for example request the url '/' and test that the responses status code is 200, using <a href="http://code.google.com/p/gaeunit" rel="noreferrer">GAEUnit</a>. How can I do this? </p> <p>I'd like to use the webapp framework and GAEUnit, which runs within the App Engine sandbox (unfortunately <a href="http://pythonpaste.org/webtest/" rel="noreferrer">WebTest</a> does not work within the sandbox).</p>
[ { "answer_id": 107753, "author": "David Coffin", "author_id": 13049, "author_profile": "https://Stackoverflow.com/users/13049", "pm_score": 2, "selected": false, "text": "import webbrowser\n" }, { "answer_id": 114449, "author": "Steve", "author_id": 7424, "author_prof...
2008/09/20
[ "https://Stackoverflow.com/questions/107675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13049/" ]
107,683
<p>Question in the title.</p> <p>And what happens when all 3 of <code>$_GET[foo]</code>, <code>$_POST[foo]</code> and <code>$_COOKIE[foo] exist?</code> Which one of them gets included to <code>$_REQUEST?</code></p>
[ { "answer_id": 107727, "author": "e-satis", "author_id": 9951, "author_profile": "https://Stackoverflow.com/users/9951", "pm_score": 3, "selected": false, "text": "$_REQUEST" } ]
2008/09/20
[ "https://Stackoverflow.com/questions/107683", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1897/" ]
107,693
<p>I'm having trouble with global variables in php. I have a <code>$screen</code> var set in one file, which requires another file that calls an <code>initSession()</code> defined in yet another file. The <code>initSession()</code> declares <code>global $screen</code> and then processes $screen further down using the value set in the very first script.</p> <p>How is this possible?</p> <p>To make things more confusing, if you try to set $screen again then call the <code>initSession()</code>, it uses the value first used once again. The following code will describe the process. Could someone have a go at explaining this?</p> <pre><code>$screen = "list1.inc"; // From model.php require "controller.php"; // From model.php initSession(); // From controller.php global $screen; // From Include.Session.inc echo $screen; // prints "list1.inc" // From anywhere $screen = "delete1.inc"; // From model2.php require "controller2.php" initSession(); global $screen; echo $screen; // prints "list1.inc" </code></pre> <p>Update:<br> If I declare <code>$screen</code> global again just before requiring the second model, $screen is updated properly for the <code>initSession()</code> method. Strange.</p>
[ { "answer_id": 107759, "author": "e-satis", "author_id": 9951, "author_profile": "https://Stackoverflow.com/users/9951", "pm_score": 7, "selected": true, "text": "Global" }, { "answer_id": 107760, "author": "Athena", "author_id": 17846, "author_profile": "https://Stac...
2008/09/20
[ "https://Stackoverflow.com/questions/107693", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10583/" ]
107,701
<p>How can I remove those annoying Mac OS X <code>.DS_Store</code> files from a Git repository?</p>
[ { "answer_id": 107703, "author": "John Topley", "author_id": 1450, "author_profile": "https://Stackoverflow.com/users/1450", "pm_score": 3, "selected": false, "text": "find . -name \"*.DS_Store\" -type f -exec git-rm {} \\;\n" }, { "answer_id": 107711, "author": "Nathan", ...
2008/09/20
[ "https://Stackoverflow.com/questions/107701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1450/" ]
107,705
<p>Is output buffering enabled by default in Python's interpreter for <code>sys.stdout</code>?</p> <p>If the answer is positive, what are all the ways to disable it?</p> <p>Suggestions so far:</p> <ol> <li>Use the <code>-u</code> command line switch</li> <li>Wrap <code>sys.stdout</code> in an object that flushes after every write</li> <li>Set <code>PYTHONUNBUFFERED</code> env var</li> <li><code>sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)</code></li> </ol> <p>Is there any other way to set some global flag in <code>sys</code>/<code>sys.stdout</code> programmatically during execution?</p>
[ { "answer_id": 107717, "author": "Seb", "author_id": 189, "author_profile": "https://Stackoverflow.com/users/189", "pm_score": 10, "selected": true, "text": "python -u" }, { "answer_id": 107746, "author": "stderr", "author_id": 19556, "author_profile": "https://Stacko...
2008/09/20
[ "https://Stackoverflow.com/questions/107705", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206/" ]
107,735
<p>After hitting a few StackOverflowExceptions in .NET I noticed they completely bypass the unhandled exception handlers that .NET offers (Application.ThreadException / AppDomain.UnhandledException). This is very disturbing since we have critical cleanup code in those exception handlers.</p> <p>Is there any way to overcome this?</p>
[ { "answer_id": 2952513, "author": "NBB", "author_id": 355782, "author_profile": "https://Stackoverflow.com/users/355782", "pm_score": 0, "selected": false, "text": "private Thing _myThing = null;\n\nPublic Thing MyThing\n{\n get{\n return this.MyThing;}\n set{\n this.My...
2008/09/20
[ "https://Stackoverflow.com/questions/107735", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18910/" ]
107,755
<p><strong>What libraries are there to write C# internationalized applications?</strong></p> <p>Typical functionalities that should be contained in the library:</p> <ul> <li>Validation of country specific data (e.g. VAT numbers, phone numbers, addresses,...)</li> <li>Validation of bank and financial coordinates (e.g. Credit Card numbers, IBAN,...)</li> <li>Language-specific functionalities (e.g. numbers to words to numbers, summarize,...)</li> <li>Language specific content filtering (e.g. swearword filtering...)</li> </ul> <p>An example of such libraries in Perl would be the <a href="http://search.cpan.org/modlist/Internationalization_Locale" rel="noreferrer">Internationalization/Locale section</a> of CPAN.</p> <p>What C# solutions are available?</p> <hr> <p>Note: I am not looking for an introduction to the System.Globalization namespace :)</p> <hr> <p>Note 2: Should I desume that there are no options available? Is someone interested in joining forces and create one?</p> <hr> <p>Note 3: Edit to make the question appear on front page in hope of more answers. This isn't such a hard question, how is it possible that Stackers don't ever do i18n?</p>
[ { "answer_id": 145744, "author": "Carra", "author_id": 21679, "author_profile": "https://Stackoverflow.com/users/21679", "pm_score": 1, "selected": false, "text": " culture = new CultureInfo(locale);\n int number = Convert.ToInt32(myString, culture.NumberFormat);\n string str= Conv...
2008/09/20
[ "https://Stackoverflow.com/questions/107755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7028/" ]
107,772
<p>From my understanding the XMPP protocol is based on an always-on connection where you have no, immediate, indication of when an XML message ends.</p> <p>This means you have to evaluate the stream as it comes. This also means that, probably, you have to deal with asynchronous connections since the socket can block in the middle of an XML message, either due to message length or a connection being slow.</p> <p>I would appreciate one source per answer so we can mod them up and see what's the favourite.</p>
[ { "answer_id": 110215, "author": "Joe Hildebrand", "author_id": 8388, "author_profile": "https://Stackoverflow.com/users/8388", "pm_score": 2, "selected": true, "text": "stanza = null\nwhile parser has more:\n switch on token type:\n START_TAG:\n elem = create element from pa...
2008/09/20
[ "https://Stackoverflow.com/questions/107772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8167/" ]
107,794
<p>Are there any import and export tools that would let us move projects into and out of team system <strong>with full history and log</strong>? Our current SCM is SVN.</p> <p>PS - Sorry, I know it's a repost, but I didn't get an answer before... :)</p>
[ { "answer_id": 608896, "author": "Matthew Savage", "author_id": 18434, "author_profile": "https://Stackoverflow.com/users/18434", "pm_score": 3, "selected": false, "text": "svn co <url> Proj_SVN" } ]
2008/09/20
[ "https://Stackoverflow.com/questions/107794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7028/" ]
107,823
<p>(Jeopardy-style question, I wish the answer had been online when I had this issue)</p> <p>Using Java 1.4, I have a method that I want to run as a thread some of the time, but not at others. So I declared it as a subclass of Thread, then either called start() or run() depending on what I needed.</p> <p>But I found that my program would leak memory over time. What am I doing wrong?</p>
[ { "answer_id": 107832, "author": "slim", "author_id": 7512, "author_profile": "https://Stackoverflow.com/users/7512", "pm_score": 7, "selected": true, "text": "Thread" }, { "answer_id": 107937, "author": "Alexander", "author_id": 16724, "author_profile": "https://Stac...
2008/09/20
[ "https://Stackoverflow.com/questions/107823", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7512/" ]
107,828
<p>I don't want <code>PHP</code> errors to display /html, but I want them to display in <code>/html/beta/usercomponent</code>. Everything is set up so that errors do not display at all. How can I get errors to just show up in that one folder (and its subfolders)?</p>
[ { "answer_id": 107843, "author": "Kent Fredric", "author_id": 15614, "author_profile": "https://Stackoverflow.com/users/15614", "pm_score": 6, "selected": true, "text": ".htaccess" }, { "answer_id": 107849, "author": "Twan", "author_id": 6702, "author_profile": "https...
2008/09/20
[ "https://Stackoverflow.com/questions/107828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
107,840
<p>I'm wondering how do you deal with displaying release revision number when pushing live new versions of your app?</p> <p>You can use <code>$Rev$</code> in a file to get latest revision, but only after you update the file.</p> <p>What if I want to update a string in one file every time I change any file in the repository/directory?</p> <p>Is there a way?</p>
[ { "answer_id": 107853, "author": "Eevee", "author_id": 17875, "author_profile": "https://Stackoverflow.com/users/17875", "pm_score": 1, "selected": false, "text": "svnversion" }, { "answer_id": 107869, "author": "benzado", "author_id": 10947, "author_profile": "https:...
2008/09/20
[ "https://Stackoverflow.com/questions/107840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19217/" ]
107,846
<p>I've encrypted the connectionstring in my web.config file using the steps in the link below: <a href="http://www.codeproject.com/KB/database/WebFarmConnStringsNet20.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/database/WebFarmConnStringsNet20.aspx</a></p> <p>However, whenever I call my application, it will give the following error: </p> <blockquote> <p>Failed to decrypt using provider 'CustomProvider'. Error message from the provider: The RSA key container could not be opened.</p> </blockquote> <p>The server where I perform the encryption is a 64-bit Windows Server 2003 R2 SP2. Because of that I assign the ACL to <code>NT Authority\Network Service</code>. Yet it still doesn't work. </p> <p>Hope someone has some ideas what else do I need to check to get this working.</p> <p>PS. If I used the default rsa key <code>NetFrameworkConfigurationKey</code> for encryption, then the connection string will not have an access problem. </p>
[ { "answer_id": 107889, "author": "Per Hornshøj-Schierbeck", "author_id": 11619, "author_profile": "https://Stackoverflow.com/users/11619", "pm_score": 0, "selected": false, "text": "<configProtectedData>\n" } ]
2008/09/20
[ "https://Stackoverflow.com/questions/107846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19582/" ]
107,872
<p>I have <a href="http://laconi.ca/trac/" rel="nofollow noreferrer">Laconica</a> (self hosted <a href="http://twitter.com/home" rel="nofollow noreferrer">twitter</a>) configured on my local intranet and would like to integrate the public stream into SharePoint site with a web part. How can I do this?</p>
[ { "answer_id": 107874, "author": "Eric Schoonover", "author_id": 3957, "author_profile": "https://Stackoverflow.com/users/3957", "pm_score": 4, "selected": true, "text": "<xsl:stylesheet xmlns:x=\"http://www.w3.org/2001/XMLSchema\" version=\"1.0\" exclude-result-prefixes=\"xsl ddwrt msxs...
2008/09/20
[ "https://Stackoverflow.com/questions/107872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3957/" ]
107,884
<p>I'm trying to identify differences between a base case and supplied case. Looking for a library to tell me similarity in percentage or something like that.</p> <p>For Example:</p> <p>I've 10 different HTML pages. * All of them are 404 responses with only one 2 lines of random code (such as time or quote of the day).</p> <p>Now when I supply a new 404 page I want a result back such as "%80" similar,however if I supply another page totally different or same website but quite different content I should get something lile "%20 similar".</p> <p>Basically what I want to do is, when I've got a new response I want to identify if the new response is similar to these 10 pages which I supplied before.</p> <p>I'm trying to solve this in .NET, A library or an algorithm recommendation would be great.</p>
[ { "answer_id": 17126186, "author": "Matt Mullens", "author_id": 2000867, "author_profile": "https://Stackoverflow.com/users/2000867", "pm_score": 0, "selected": false, "text": "// This could probably be optimized significantly, but is a real-world\n// example of how to use tree edit dist...
2008/09/20
[ "https://Stackoverflow.com/questions/107884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
107,888
<p>On Linux/GCC I can use the -rpath flag to change an executables search path for shared libraries without tempering with environment variables.</p> <p>Can this also be accomplished on Windows? As far as I know, dlls are always searched in the executable's directory and in PATH. </p> <p>My scenario: I would like to put shared libraries into locations according to their properties (32/64bit/Debug/Release) without taking care of unique names. On Linux, this is easily be done via rpath, but I haven't found any way doing this on Windows yet.</p> <p>Thanks for any hints!</p>
[ { "answer_id": 107899, "author": "ChrisN", "author_id": 3853, "author_profile": "https://Stackoverflow.com/users/3853", "pm_score": 3, "selected": false, "text": "LoadLibrary" } ]
2008/09/20
[ "https://Stackoverflow.com/questions/107888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
107,903
<p>On Mac OS X, you can create a zip archive from the Finder by selecting some files and selecting "Compress" from the contextual menu or the File menu. Unfortunately, the resulting file is not identical to the archive created by the <code>zip</code> command (with the default options).</p> <p>This distinction matters to at least one service operated by Apple, which fails to accept archives created with the <code>zip</code> command. Having to create archives manually is preventing me from fully automating my release build process.</p> <p>How can I create a zip archive in the correct format within a shell script?</p> <p>EDIT: Since writing this question long ago, I've figured out that the key difference between <code>ditto</code> and <code>zip</code> is how they handle symbolic links: because the code signature inside an app bundle contains a symlink, it needs to be preserved as a link and not stored as a regular file. <code>ditto</code> does this by default, but <code>zip</code> does not (option <code>-y</code> is required).</p>
[ { "answer_id": 107938, "author": "millenomi", "author_id": 6061, "author_profile": "https://Stackoverflow.com/users/6061", "pm_score": 5, "selected": true, "text": "ditto -ck --rsrc --sequesterRsrc folder file.zip\n" }, { "answer_id": 2473201, "author": "Jared Egan", "aut...
2008/09/20
[ "https://Stackoverflow.com/questions/107903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10947/" ]
107,936
<p>Is there a way to add some custom font on a website without using images, <a href="http://en.wikipedia.org/wiki/Adobe_Flash" rel="noreferrer">Flash</a> or some other graphics?</p> <p>For example, I was working on a wedding website, and I found a lot of nice fonts for that subject. But I can't find the right way to add that font on the server. And how do I include that font with CSS into the HTML? Is this possible to do without graphics?</p>
[ { "answer_id": 107951, "author": "hangy", "author_id": 11963, "author_profile": "https://Stackoverflow.com/users/11963", "pm_score": 10, "selected": true, "text": "<style type=\"text/css\">\n@font-face {\n font-family: \"My Custom Font\";\n src: url(http://www.example.org/mycustomf...
2008/09/20
[ "https://Stackoverflow.com/questions/107936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16039/" ]
107,964
<p>I am using YUI reset/base, after the reset it sets the <code>ul</code> and <code>li</code> tags to list-style: disc outside;</p> <p>My markup looks like this:</p> <pre><code>&lt;div id="nav"&gt; &lt;ul class="links"&gt; &lt;li&gt;&lt;a href=""&gt;Testing&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>My CSS is:</p> <pre><code>#nav {} #nav ul li { list-style: none; } </code></pre> <p>Now that makes the small disc beside each li disappear.</p> <p>Why doesn't this work though?</p> <pre><code> #nav {} #nav ul.links { list-style: none; } </code></pre> <p>It works if I remove the link to the base.css file, why?.</p> <p>Updated: <code>sidenav</code> -> <code>nav</code></p>
[ { "answer_id": 107965, "author": "Matt", "author_id": 17759, "author_profile": "https://Stackoverflow.com/users/17759", "pm_score": 1, "selected": false, "text": "#nav ul.links\n" }, { "answer_id": 107983, "author": "Josti", "author_id": 11231, "author_profile": "http...
2008/09/20
[ "https://Stackoverflow.com/questions/107964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1368/" ]
107,971
<p>I'm using the following JavaScript code:</p> <pre><code>&lt;script language="JavaScript1.2" type="text/javascript"&gt; function CreateBookmarkLink(title, url) { if (window.sidebar) { window.sidebar.addPanel(title, url,""); } else if( window.external ) { window.external.AddFavorite( url, title); } else if(window.opera &amp;&amp; window.print) { return true; } } &lt;/script&gt; </code></pre> <p>This will create a bookmark for Firefox and IE. But the link for Firefox will show up in the sidepanel of the browser, instead of being displayed in the main screen. I personally find this very annoying and am looking for a better solution. It is of course possible to edit the bookmark manually to have it <em>not</em> show up in the side panel, but that requires extra steps. I just want to be able to have people bookmark a page (that has a lot of GET information in the URL which is used to build a certain scheme) the easy way.</p> <p>I'm afraid that it might not be possible to have Firefox present the page in the main screen at all (as Googling this subject resulted in practically nothing worth using), but I might have missed something. If anyone has an idea if this is possible, or if there's a workaround, I'd love to hear about it.</p>
[ { "answer_id": 107985, "author": "Per Hornshøj-Schierbeck", "author_id": 11619, "author_profile": "https://Stackoverflow.com/users/11619", "pm_score": 0, "selected": false, "text": "if (window.sidebar) \n" }, { "answer_id": 107993, "author": "iBobo", "author_id": 10567, ...
2008/09/20
[ "https://Stackoverflow.com/questions/107971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18922/" ]
107,972
<p>Is it possible under any set of circumstances to be able to accomplish this?</p> <p>My current circumstances are this:</p> <pre><code>public class CustomForm : Form { public class CustomGUIElement { ... public event MouseEventHandler Click; // etc, and so forth. ... } private List&lt;CustomGUIElement&gt; _elements; ... public void CustomForm_Click(object sender, MouseEventArgs e) { // we might want to call one of the _elements[n].Click in here // but we can't because we aren't in the same class. } } </code></pre> <p>My first thought was to have a function similar to:</p> <pre><code>internal enum GUIElementHandlers { Click, ... } internal void CustomGUIElement::CallHandler(GUIElementHandler h, object[] args) { switch (h) { case Click: this.Click(this, (EventArgs)args[0]); break; ... // etc and so forth } } </code></pre> <p>It's a horribly ugly kludge, but it should work... There must be a more elegant solution though? The .NET library does this all the time with message handlers and calling events in Control's. Does anyone else have any other/better ideas?</p>
[ { "answer_id": 107979, "author": "Phil Wright", "author_id": 6276, "author_profile": "https://Stackoverflow.com/users/6276", "pm_score": 6, "selected": true, "text": "public class CustomGUIElement \n{\n public void PerformClick()\n {\n OnClick(EventArgs.Empty);\n }\n\n...
2008/09/20
[ "https://Stackoverflow.com/questions/107972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15537/" ]
107,984
<p>In toad, I can see unicode characters that are coming from oracle db. But when I click one of the fields in the data grid into the edit mode, the unicode characters are converted to meaningless symbols, but this is not the big issue.</p> <p>While editing this field, the unicode characters are displayed correctly as I type. But as soon as I press enter and exit edit mode, they are converted to the nearest (most similar) non-unicode character. So I cannot type unicode characters on data grids. Copy &amp; pasting one of the unicode characters also does not work.</p> <p>How can I solve this?</p> <p>Edit: I am using toad 9.0.0.160.</p>
[ { "answer_id": 107979, "author": "Phil Wright", "author_id": 6276, "author_profile": "https://Stackoverflow.com/users/6276", "pm_score": 6, "selected": true, "text": "public class CustomGUIElement \n{\n public void PerformClick()\n {\n OnClick(EventArgs.Empty);\n }\n\n...
2008/09/20
[ "https://Stackoverflow.com/questions/107984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31505/" ]
107,995
<p>The <code>unzip</code> command doesn't have an option for recursively unzipping archives.</p> <p>If I have the following directory structure and archives:</p> <pre> /Mother/Loving.zip /Scurvy/Sea Dogs.zip /Scurvy/Cures/Limes.zip </pre> <p>And I want to unzip all of the archives into directories with the same name as each archive:</p> <pre> /Mother/Loving/1.txt /Mother/Loving.zip /Scurvy/Sea Dogs/2.txt /Scurvy/Sea Dogs.zip /Scurvy/Cures/Limes/3.txt /Scurvy/Cures/Limes.zip </pre> <p>What command or commands would I issue?</p> <p>It's important that this doesn't choke on filenames that have spaces in them.</p>
[ { "answer_id": 107999, "author": "chuckrector", "author_id": 10645, "author_profile": "https://Stackoverflow.com/users/10645", "pm_score": 5, "selected": false, "text": "find . -name \"*.zip\" | while read filename; do unzip -o -d \"`basename -s .zip \"$filename\"`\" \"$filename\"; done;...
2008/09/20
[ "https://Stackoverflow.com/questions/107995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10645/" ]
108,005
<p>first question here. I'm developing a program in C# (.NET 3.5) that displays files in a listview. I'd like to have the "large icon" view display the icon that Windows Explorer uses for that filetype, otherwise I'll have to use some existing code like this:</p> <pre><code> private int getFileTypeIconIndex(string fileName) { string fileLocation = Application.StartupPath + "\\Quarantine\\" + fileName; FileInfo fi = new FileInfo(fileLocation); switch (fi.Extension) { case ".pdf": return 1; case ".doc": case ".docx": case ".docm": case ".dotx":case ".dotm": case ".dot":case ".wpd": case ".wps": return 2; default: return 0; } } </code></pre> <p>The above code returns an integer that is used to select an icon from an imagelist that I populated with some common icons. It works fine but I'd need to add every extension under the sun! Is there a better way? Thanks!</p>
[ { "answer_id": 108056, "author": "eric", "author_id": 5798, "author_profile": "https://Stackoverflow.com/users/5798", "pm_score": 3, "selected": false, "text": "private System.Windows.Forms.ListView FileView;\n\nprivate ImageList _SmallImageList = new ImageList();\nprivate ImageList _Lar...
2008/09/20
[ "https://Stackoverflow.com/questions/108005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14333/" ]
108,009
<p>I'm writing a C parser using PLY, and recently ran into a problem. This code:</p> <pre><code>typedef int my_type; my_type x; </code></pre> <p>Is correct C code, because my_type is defined as a type previously to being used as such. I handle it by filling a type symbol table in the parser that gets used by the lexer to differentiate between types and simple identifiers.</p> <p>However, while the type declaration rule ends with SEMI (the ';' token), PLY shifts the token <code>my_type</code> from the second line before deciding it's done with the first one. Because of this, I have no chance to pass the update in the type symbol table to the lexer and it sees my_type as an identifier and not a type.</p> <p>Any ideas for a fix ?</p> <p>The full code is at: <a href="http://code.google.com/p/pycparser/source/browse/trunk/src/c_parser.py" rel="nofollow noreferrer">http://code.google.com/p/pycparser/source/browse/trunk/src/c_parser.py</a> Not sure how I can create a smaller example out of this. </p> <p><strong>Edit:</strong></p> <p>Problem solved. See my solution below.</p>
[ { "answer_id": 108482, "author": "Eli Bendersky", "author_id": 8206, "author_profile": "https://Stackoverflow.com/users/8206", "pm_score": 3, "selected": true, "text": "declaration" } ]
2008/09/20
[ "https://Stackoverflow.com/questions/108009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8206/" ]
108,010
<p>Greetings.</p> <p>I'm looking for a way to parse a number of XML files in a particular directory with ASP.NET (C#). I'd like to be able to return content from particular elements, but before that, need to find those that have a certain value between an element.</p> <p>Example XML file 1:</p> <pre><code>&lt;file&gt; &lt;title&gt;Title 1&lt;/title&gt; &lt;someContent&gt;Content&lt;/someContent&gt; &lt;filter&gt;filter&lt;/filter&gt; &lt;/file&gt; </code></pre> <p>Example XML file 2:</p> <pre><code>&lt;file&gt; &lt;title&gt;Title 2&lt;/title&gt; &lt;someContent&gt;Content&lt;/someContent&gt; &lt;filter&gt;filter, different filter&lt;/filter&gt; &lt;/file&gt; </code></pre> <p>Example case 1:</p> <p>Give me all XML that has a filter of 'filter'.</p> <p>Example case 2:</p> <p>Give me all XML that has a title of 'Title 1'.</p> <p>Looking, it seems this should be possible with LINQ, but I've only seen examples on how to do this when there is one XML file, not when there are multiples, such as in this case.</p> <p>I would prefer that this be done on the server-side, so that I can cache on that end.</p> <p>Functionality from any version of the .NET Framework can be used.</p> <p>Thanks!</p> <p>~James</p>
[ { "answer_id": 108044, "author": "chakrit", "author_id": 3055, "author_profile": "https://Stackoverflow.com/users/3055", "pm_score": 2, "selected": false, "text": "var xc = new XMLContentEnumerator(@\"C:\\dir\");\n\nvar filesWithHello = xc.Where(x => x.title.Contains(\"hello\"));\n" },...
2008/09/20
[ "https://Stackoverflow.com/questions/108010", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11912/" ]
108,043
<p>When I create a socket using accept() and make a FILE out of it using fdopen(), what do I have to do to clean everything up? Do I need to do fclose() on the FILE, shutdown() and close() on the socket, or only the shutdown() and or close() or fclose()? If I don't do fclose(), do I have to free() the FILE pointer manually?</p>
[ { "answer_id": 108049, "author": "freespace", "author_id": 8297, "author_profile": "https://Stackoverflow.com/users/8297", "pm_score": -1, "selected": false, "text": "FILE" } ]
2008/09/20
[ "https://Stackoverflow.com/questions/108043", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12523/" ]
108,081
<p>Are there any good, cross platform (SBCL and CLISP at the very least) easy to install GUI libraries?</p>
[ { "answer_id": 108142, "author": "Matthias Benkard", "author_id": 15517, "author_profile": "https://Stackoverflow.com/users/15517", "pm_score": 6, "selected": true, "text": "(require :asdf-install)\n(asdf-install:install :ltk)\n" } ]
2008/09/20
[ "https://Stackoverflow.com/questions/108081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7780/" ]
108,094
<p>Is there anyway to disable the rather annoying feature that Visual Studio (2008 in my case) has of copying the line (with text on it) the cursor is on when <kbd>CTRL</kbd>-<kbd>C</kbd> is pressed and no selection is made?</p> <p>I know of the option to disable copying blank lines. But this is driving me crazy as well.</p> <p>ETA: I'm not looking to customize the keyboard shortcut.</p> <p>ETA-II: I am NOT looking for "Tools->Options->Text Editor->All Languages->Apply cut or copy to blank lines...".</p>
[ { "answer_id": 2509622, "author": "David Walthall", "author_id": 301019, "author_profile": "https://Stackoverflow.com/users/301019", "pm_score": 5, "selected": true, "text": "Sub CopyOnlyIfSelection()\n Dim s As String = DTE.ActiveDocument.Selection.Text\n Dim n As Integer = Len(s)...
2008/09/20
[ "https://Stackoverflow.com/questions/108094", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4192/" ]