qid int64 4 22.2M | question stringlengths 18 48.3k | answers list | date stringlengths 10 10 | metadata list |
|---|---|---|---|---|
63,206 | <p>If Java application requires certain JRE version then how can I check its availability on Mac OS X during installation?</p>
| [
{
"answer_id": 63227,
"author": "Stu Thompson",
"author_id": 2961,
"author_profile": "https://Stackoverflow.com/users/2961",
"pm_score": 2,
"selected": true,
"text": "manoa:~ stu$ ll /System/Library/Frameworks/JavaVM.framework/Versions/\ntotal 56\n774077 lrwxr-xr-x 1 root wheel 5 Ju... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7292/"
] |
63,232 | <p>How would you make the contents of Flex RIA applications accessible to Google, so that Google can index the content and shows links to the right items in your Flex RIA. Consider a online shop, created in Flex, where the offered items shall be indexed by Google. Then a link on Google should open the corresponding product in the RIA.</p>
| [
{
"answer_id": 64077,
"author": "Theo",
"author_id": 1109,
"author_profile": "https://Stackoverflow.com/users/1109",
"pm_score": 4,
"selected": true,
"text": "/items/345"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/63232",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7524/"
] |
63,291 | <p>How do I select all the columns in a table that only contain NULL values for all the rows? I'm using <strong>MS SQL Server 2005</strong>. I'm trying to find out which columns are not used in the table so I can delete them.</p>
| [
{
"answer_id": 63312,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 4,
"selected": false,
"text": "SELECT cols\nFROM table\nWHERE cols IS NULL\n"
},
{
"answer_id": 63374,
"author": "Charles Graham",
"author_id"... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/299/"
] |
63,295 | <p>I have Sun webserver iws6 (iplanet 6) proxying my bea cluster.
My cluster is under /portal/yadda.
I want anyone who goes to </p>
<pre><code>http://the.domain.com/
</code></pre>
<p>to be quickly redirected to </p>
<pre><code>http://the.domain.com/portal/
</code></pre>
<p>I have and index.html that does a post and redirect, but the user sometimes sees it.
Does anyone have a better way?</p>
<p>Aaron</p>
<p>I have tried the 3 replies below. None of them worked for me. Back to the drawing board.
A</p>
| [
{
"answer_id": 63398,
"author": "Adam Davis",
"author_id": 2915,
"author_profile": "https://Stackoverflow.com/users/2915",
"pm_score": -1,
"selected": false,
"text": "<?php\nheader(\"Location: http://www.example.com/\"); /* Redirect browser */\n\n/* Make sure that code below does not get... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63295",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7659/"
] |
63,303 | <p>I have a System.Diagnostics.Process object in a program targeted at the .Net framework 3.5</p>
<p>I have redirected both <code>StandardOutput</code> and <code>StandardError</code> pipes and I'm receiving data from them asynchronously. I've also set an event handler for the Exited event.</p>
<p>Once I call <code>Process.Start()</code> I want to go off and do other work whilst I wait for events to be raised.</p>
<p>Unfortunately it appears that, for a process which returns a large amount of information, the Exited event is fired before the last <code>OutputDataReceived</code> event.</p>
<p>How do I know when the last <code>OutputDataReceived</code> has been received? Ideally I would like the <code>Exited</code> event to be the last event I receive.</p>
<p>Here is an example program:</p>
<pre><code>using System;
using System.Diagnostics;
using System.Threading;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string command = "output.exe";
string arguments = " whatever";
ProcessStartInfo info = new ProcessStartInfo(command, arguments);
// Redirect the standard output of the process.
info.RedirectStandardOutput = true;
info.RedirectStandardError = true;
// Set UseShellExecute to false for redirection
info.UseShellExecute = false;
Process proc = new Process();
proc.StartInfo = info;
proc.EnableRaisingEvents = true;
// Set our event handler to asynchronously read the sort output.
proc.OutputDataReceived += new DataReceivedEventHandler(proc_OutputDataReceived);
proc.ErrorDataReceived += new DataReceivedEventHandler(proc_ErrorDataReceived);
proc.Exited += new EventHandler(proc_Exited);
proc.Start();
// Start the asynchronous read of the sort output stream. Note this line!
proc.BeginOutputReadLine();
proc.BeginErrorReadLine();
proc.WaitForExit();
Console.WriteLine("Exited (Main)");
}
static void proc_Exited(object sender, EventArgs e)
{
Console.WriteLine("Exited (Event)");
}
static void proc_ErrorDataReceived(object sender, DataReceivedEventArgs e)
{
Console.WriteLine("Error: {0}", e.Data);
}
static void proc_OutputDataReceived(object sender, DataReceivedEventArgs e)
{
Console.WriteLine("Output data: {0}", e.Data);
}
}
}
</code></pre>
<p>When running this program you will notice that "Exited (Event)" appears in a completely variable location within the output. You may need to run it a few times and, obviously, you will need to replace "output.exe" with a program of your choice that produces a suitably large amount of output.</p>
<p>So, the question again: How do I know when the last <code>OutputDataReceived</code> has been received? Ideally I would like the <code>Exited</code> event to be the last event I receive.</p>
| [
{
"answer_id": 1423665,
"author": "csharptest.net",
"author_id": 164392,
"author_profile": "https://Stackoverflow.com/users/164392",
"pm_score": 5,
"selected": false,
"text": "e.Data"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/63303",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
63,343 | <p>Here's an interesting problem. On a recently installed Server 2008 64bit I opened IE and through the Tools -> Options I changed the homepage to iGoogle.com. Clicked okay and then clicked the homepage button. IE crashes.</p>
<p>Now you'd think that I could just remove iGoogle as the homepage but when I open IE it immediately goes to that page and crashes on open.</p>
<p>Obviously I'd prefer to find a solution to why IE is crashing on the iGoogle page but just to get IE running again I need to remove iGoogle as the homepage. Is there anyway to do this without opening IE?</p>
| [
{
"answer_id": 63367,
"author": "Sietse",
"author_id": 6400,
"author_profile": "https://Stackoverflow.com/users/6400",
"pm_score": 2,
"selected": false,
"text": "start » run » iexplore about:blank\n"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/63343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1463/"
] |
63,379 | <p>I have a case where a VB.Net winforms app needs to play WMV files from across the network. The user running the app cannot be given direct access to the network share. Through impersonation, I can see that the files exist (without impersonation, File.Exists returns false for the files on the network share). When I then try to load the file into a Windows Media Player control, the control just remains black. I have deduced that when the Windows Media Player control is loaded into memory, it is running on a separate unmanaged thread than the .Net managed thread. Is there any way to pass that security token from the managed thread to the unmanaged thread? Am I missing something completely?</p>
| [
{
"answer_id": 64630,
"author": "Alvaro Rodriguez",
"author_id": 1550,
"author_profile": "https://Stackoverflow.com/users/1550",
"pm_score": 0,
"selected": false,
"text": "[DllImport(\"advapi32.dll\", SetLastError=true)]\npublic static extern int LogonUser(string pszUsername, string pszD... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63379",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
63,399 | <p>I need to do a dump of a table on a remote server, but I can't access the server directly. The only access I have is through PHP scripts.</p>
<p>Is there some way in which MySQL will return an </p>
<pre><code>INSERT INTO `table_name` (`field1`, `field2`) VALUES ('a', 'b'), ('c', 'd')
</code></pre>
<p>statement, like what <code>mysqldump</code> will return?</p>
<p>I don't have access to phpMyAdmin, and I preferably don't want to use <code>exec</code>, <code>system</code> or <code>passthru</code>.</p>
<p>See <a href="https://stackoverflow.com/questions/81934/easy-way-to-export-a-sql-table-without-access-to-the-server-or-phpmyadmin">this question</a> for another export method</p>
| [
{
"answer_id": 63431,
"author": "agnul",
"author_id": 6069,
"author_profile": "https://Stackoverflow.com/users/6069",
"pm_score": 0,
"selected": false,
"text": "select 'insert into table table_name (field1, field2) values'\n || table_name.field1 || ', ' || table_field2 || ');'\nfro... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6681/"
] |
63,421 | <p>Currently my workflow with Emacs when I am coding in C or C++ involves three windows. The largest on the right contains the file I am working with. The left is split into two, the bottom being a shell which I use to type in compile or make commands, and the top is often some sort of documentation or README file that I want to consult while I am working. Now I know there are some pretty expert Emacs users out there, and I am curious what other Emacs functionally is useful if the intention is to use it as a complete IDE. Specifically, most IDEs usually fulfill these functions is some form or another:</p>
<ul>
<li>Source code editor</li>
<li>Compiler</li>
<li>Debugging</li>
<li>Documentation Lookup</li>
<li>Version Control</li>
<li>OO features like class lookup and object inspector </li>
</ul>
<p>For a few of these, it's pretty obvious how Emacs can fit these functions, but what about the rest? Also, if a specific language must be focused on, I'd say it should be C++. </p>
<p><strong>Edit:</strong> One user pointed out that I should have been more specific when I said 'what about the rest'. Mostly I was curious about efficient version control, as well as documentation lookup. For example, in SLIME it is fairly easy to do a quick hyperspec lookup on a Lisp function. Is there a quick way to look up something in C++ STL documentation (if I forgot the exact syntax of <a href="http://www.sgi.com/tech/stl/hash_map.html" rel="noreferrer">hash_map</a>, for example)?</p>
| [
{
"answer_id": 63511,
"author": "Ben Collins",
"author_id": 3279,
"author_profile": "https://Stackoverflow.com/users/3279",
"pm_score": 7,
"selected": true,
"text": "M-x compile"
},
{
"answer_id": 594533,
"author": "Jonas Kölker",
"author_id": 58668,
"author_profile":... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63421",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7545/"
] |
63,439 | <p>How can I programatically cause a control's tooltip to show in a Winforms app without needing the mouse to hover over the control? (P/Invoke is ok if necessary). </p>
| [
{
"answer_id": 63471,
"author": "Mark D",
"author_id": 7452,
"author_profile": "https://Stackoverflow.com/users/7452",
"pm_score": 0,
"selected": false,
"text": "static HWND hwndToolTip = NULL;\n\nvoid CreateToolTip( HWND hWndControl, TCHAR *tipText )\n{ \n BOOL success;\n\n if( hwn... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63439",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2187/"
] |
63,447 | <p>How do I perform an <code>IF...THEN</code> in an <code>SQL SELECT</code> statement?</p>
<p>For example:</p>
<pre><code>SELECT IF(Obsolete = 'N' OR InStock = 'Y' ? 1 : 0) AS Saleable, * FROM Product
</code></pre>
| [
{
"answer_id": 63474,
"author": "John Sheehan",
"author_id": 1786,
"author_profile": "https://Stackoverflow.com/users/1786",
"pm_score": 6,
"selected": false,
"text": "SELECT \n(CASE \n WHEN (Obsolete = 'N' OR InStock = 'Y') THEN 'YES'\n EL... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63447",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6522/"
] |
63,463 | <p>Let's say I have a web page that currently accepts a single ID value via a url parameter:<br>
<a href="http://example.com/mypage.aspx?ID=1234" rel="nofollow noreferrer">http://example.com/mypage.aspx?ID=1234</a></p>
<p>I want to change it to accept a <em>list</em> of ids, like this:<br>
<a href="http://example.com/mypage.aspx?IDs=1234,4321,6789" rel="nofollow noreferrer">http://example.com/mypage.aspx?IDs=1234,4321,6789</a></p>
<p>So it's available to my code as a string via <em>context.Request.QueryString["IDs"].</em> What's the best way to turn that string value into a List<int>?</p>
<p><strong>Edit:</strong> I know how to do .split() on a comma to get a list of strings, but I ask because I don't know how to easily convert that string list to an int list. This is still in .Net 2.0, so no lambdas.</p>
| [
{
"answer_id": 63472,
"author": "Grokys",
"author_id": 6448,
"author_profile": "https://Stackoverflow.com/users/6448",
"pm_score": 0,
"selected": false,
"text": "string[] splitIds = ids.split(',');\n"
},
{
"answer_id": 63508,
"author": "Mark Embling",
"author_id": 6844,
... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3043/"
] |
63,494 | <p>I discovered <a href="http://en.wikipedia.org/wiki/Template_metaprogramming" rel="noreferrer">template metaprogramming</a> more than 5 years ago and got a huge kick out of reading <a href="https://rads.stackoverflow.com/amzn/click/com/0201704315" rel="noreferrer" rel="nofollow noreferrer">Modern C++ Design</a> but I never found an opertunity to use it in real life.</p>
<p>Have <em>you</em> ever used this technique in real code?</p>
<blockquote>
<p>Contributors to <a href="http://www.boost.org/" rel="noreferrer">Boost</a> need not apply ;o)</p>
</blockquote>
| [
{
"answer_id": 3586490,
"author": "deft_code",
"author_id": 28817,
"author_profile": "https://Stackoverflow.com/users/28817",
"pm_score": 3,
"selected": false,
"text": "template< typename T >\nT& singleton();\n\ntemplate< typename T >\nT& zombie_singleton();\n\ntemplate< typename T >\nT&... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63494",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3848/"
] |
63,517 | <p>I'm absolutely stunned by the fact that MS just couldn't get it right to navigate to the definition of a method, when you're combining C# and VB projects in one solution. If you're trying to navigate from VB to C#, it brings up the "Object Explorer", and if from C# to VB, it generates a metadata file.</p>
<p>Honestly, what is so complicated about jumping between different languages, especially if they're supposedly using the same CLR?</p>
<p>Does anyone know why this is, or if there's any workaround?
Did they get it right in VS 2008?</p>
<hr>
<p>@Keith, I am afraid you may be right about your answer. I am truly stunned that Microsoft screwed this up so badly. Does anyone have any ideas for a workaround?</p>
<hr>
<p>@Mladen Mihajlovic - that's exactly the situation I'm describing. Try it out yourself; project references don't make a shred of difference.</p>
| [
{
"answer_id": 21877038,
"author": "Giulio Caccin",
"author_id": 1636173,
"author_profile": "https://Stackoverflow.com/users/1636173",
"pm_score": 0,
"selected": false,
"text": "ctrl+,"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/63517",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7850/"
] |
63,546 | <p>Would like to programmically change the connecton string for a database which utilizes the membership provider of asp.net within a windows application. The system.configuration namespace allows changes to the user settings, however, we would like to adjust a application setting? Does one need to write a class with utilizes XML to modify the class? Does one need to delete the current connections (can one select a connection to clear) and add a new one? Can one adjust the existing connection string?</p>
| [
{
"answer_id": 63579,
"author": "Joseph Daigle",
"author_id": 507,
"author_profile": "https://Stackoverflow.com/users/507",
"pm_score": 3,
"selected": false,
"text": "Configuration myConfig = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);"
},
{
"answer_id... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63546",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7950/"
] |
63,556 | <p>I have a class with a bunch of properties that look like this:</p>
<pre><code>public string Name
{
get { return _name; }
set { IsDirty = true; _name = value; }
}
</code></pre>
<p>It would be a lot easier if I could rely on C# 3.0 to generate the backing store for these, but is there any way to factor out the IsDirty=true; so that I can write my properties something like this and still get the same behaviour:</p>
<pre><code>[MakesDirty]
public string Name { get; set; }
</code></pre>
| [
{
"answer_id": 63623,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 0,
"selected": false,
"text": "class A\n{\n [Foo]\n public int Property1{get; set;}\n public int Property2{get {return variable;} set{ Property1 = va... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63556",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1404/"
] |
63,581 | <p>I'm using <a href="http://www.c6software.com/Products/PopBox/" rel="nofollow noreferrer">PopBox</a> for magnifying thumbnails on my page.
But I want my website to work even for users which turned javascript off.</p>
<p>I tried to use the following HTML code:</p>
<pre><code><a href="image.jpg">
<img src="thumbnail.jpg" pbsrc="image.jpg" onclick="Pop(...);"/>
</a>
</code></pre>
<p>Now i need to disable the a-Tag using javascript, otherwise my PopBox won't work.</p>
<p>How do I do that?</p>
| [
{
"answer_id": 63626,
"author": "Chris Shaffer",
"author_id": 6744,
"author_profile": "https://Stackoverflow.com/users/6744",
"pm_score": 3,
"selected": true,
"text": "<a href=\"image.jpg onclick=\"Pop()\"; return false;\"><img ...></a>\n"
},
{
"answer_id": 63638,
"author": "... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63581",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4186/"
] |
63,599 | <p>We have an issue using the <code>PEAR</code> libraries on <code>Windows</code> from <code>PHP</code>.</p>
<p>Pear contains many classes, we are making use of a fair few, one of which is the Mail class found in <code>Mail.php</code>. We use PEAR on the path, rather than providing the full explicit path to individual PEAR files:</p>
<pre><code>require_once('Mail.php');
</code></pre>
<p>Rather than:</p>
<pre><code>require_once('/path/to/pear/Mail.php');
</code></pre>
<p>This causes issues in the administration module of the site, where there is a <code>mail.php</code> file (used to send mails to users). If we are in an administrative screen that sends an email (such as the user administration screen that can generate and email new random passwords to users when they are approved from the moderation queue) and we attempt to include <code>Mail.php</code> we "accidentally" include mail.php.</p>
<p>Without changing to prepend the full path to the PEAR install explicitly requiring the PEAR modules (non-standard, typically you install PEAR to your path...) is there a way to enforce PHP on Windows to require files case-sensitively?</p>
<p>We are adding the PEAR path to the include path ourselves, so have control over the path order. We also recognize that we should avoid using filenames that clash with PEAR names regardless of case, and in the future will do so. This page however (which is not an include file, but a controller), has been in the repository for some years, and plugins specifically generate URLS to provide links/redirects to this page in their processing.</p>
<blockquote>
<p>(We support Apache, Microsoft IIS, LightHTTPD and Zeus, using PHP 4.3 or later (including PHP5))</p>
</blockquote>
| [
{
"answer_id": 63627,
"author": "ceejayoz",
"author_id": 1902010,
"author_profile": "https://Stackoverflow.com/users/1902010",
"pm_score": 2,
"selected": false,
"text": "include('Mail.php');"
},
{
"answer_id": 65937,
"author": "farzad",
"author_id": 9394,
"author_prof... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7106/"
] |
63,618 | <p>Shoes has some built in dump commands (Shoes.debug), but are there other tools that can debug the code without injecting debug messages throughout? Something like gdb would be great.</p>
| [
{
"answer_id": 63923,
"author": "Brian Phillips",
"author_id": 7230,
"author_profile": "https://Stackoverflow.com/users/7230",
"pm_score": 1,
"selected": false,
"text": "\n% sudo gem install ruby-debug\n"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/63618",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7936/"
] |
63,671 | <p>I seem to remember reading something about how it is bad for structs to implement interfaces in CLR via C#, but I can't seem to find anything about it. Is it bad? Are there unintended consequences of doing so?</p>
<pre><code>public interface Foo { Bar GetBar(); }
public struct Fubar : Foo { public Bar GetBar() { return new Bar(); } }
</code></pre>
| [
{
"answer_id": 63711,
"author": "Joseph Daigle",
"author_id": 507,
"author_profile": "https://Stackoverflow.com/users/507",
"pm_score": 0,
"selected": false,
"text": "IComparable"
},
{
"answer_id": 1289537,
"author": "ShuggyCoUk",
"author_id": 12748,
"author_profile":... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63671",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
63,687 | <p>I would like to save the programs settings every time the user exits the program. So I need a way to call a function when the user quits the program. How do I do that?</p>
<p>I am using Java 1.5.</p>
| [
{
"answer_id": 63701,
"author": "Mat Mannion",
"author_id": 6282,
"author_profile": "https://Stackoverflow.com/users/6282",
"pm_score": 6,
"selected": true,
"text": "Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {\n public void run() {\n // what you want to do\... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63687",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
63,690 | <p>I work with embedded Linux systems that sometimes want to get their IP address from a DHCP server. The DHCP Client client we use (<a href="http://www.phystech.com/download/dhcpcd.html" rel="nofollow noreferrer" title="DHCPCD">dhcpcd</a>) has limited retry logic. If our device starts up without any DHCP server available and times out, dhcpcd will exit and the device will never get an IP address until it's rebooted with a DHCP server visible/connected. I can't be the only one that has this problem. The problem doesn't even seem to be specific to embedded systems (though it's worse there). How do you handle this? Is there a more robust client available? </p>
| [
{
"answer_id": 64746,
"author": "jpbarto",
"author_id": 8511,
"author_profile": "https://Stackoverflow.com/users/8511",
"pm_score": 1,
"selected": false,
"text": "rc.local"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/63690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7685/"
] |
63,694 | <p>Is there any feasible way of using generics to create a Math library that does not depend on the base type chosen to store data?</p>
<p>In other words, let's assume I want to write a Fraction class. The fraction can be represented by two ints or two doubles or whatnot. The important thing is that the basic four arithmetic operations are well defined. So, I would like to be able to write <code>Fraction<int> frac = new Fraction<int>(1,2)</code> and/or <code>Fraction<double> frac = new Fraction<double>(0.1, 1.0)</code>.</p>
<p>Unfortunately there is no interface representing the four basic operations (+,-,*,/). Has anybody found a workable, feasible way of implementing this?</p>
| [
{
"answer_id": 64142,
"author": "fryguybob",
"author_id": 4592,
"author_profile": "https://Stackoverflow.com/users/4592",
"pm_score": 6,
"selected": true,
"text": " abstract class MathProvider<T>\n {\n public abstract T Divide(T a, T b);\n public abstract T Multiply(T... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63694",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7028/"
] |
63,723 | <p>Is there a way I can configure the MidPointRounding enumeration default setting in a config file (I.e. web.config or app.config) I have a considerable source code base, and I need to configure at the application scope how rounding will occur, whether used in Math.Round or decimal type rounding... I would like to do this in order to get consistent rounding results throughout the application without changing every line that works with a decimal type or uses Math.Round....</p>
| [
{
"answer_id": 64271,
"author": "rohancragg",
"author_id": 5351,
"author_profile": "https://Stackoverflow.com/users/5351",
"pm_score": 0,
"selected": false,
"text": "MyEnum GetEnumValue(string enumString) {\n return (MyEnum)Enum.Parse(typeof(MyEnum),enumString);\n}\n"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/63723",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
63,741 | <p>Why does the default IntelliJ default class javadoc comment use non-standard syntax? Instead of creating a line with "User: jstauffer" it could create a line with "@author jstauffer". The other lines that it creates (Date and Time) probably don't have javadoc syntax to use but why not use the javadoc syntax when available?</p>
<p>For reference here is an example:</p>
<pre>/**
* Created by IntelliJ IDEA.
* User: jstauffer
* Date: Nov 13, 2007
* Time: 11:15:10 AM
* To change this template use File | Settings | File Templates.
*/</pre>
| [
{
"answer_id": 63922,
"author": "Rob Dickerson",
"author_id": 7530,
"author_profile": "https://Stackoverflow.com/users/7530",
"pm_score": 6,
"selected": false,
"text": "@author"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/63741",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6770/"
] |
63,743 | <p>I am developing a web page code, which fetches dynamically the content from the server and then places this content to container nodes using something like</p>
<pre><code>container.innerHTML = content;
</code></pre>
<p>Sometimes I have to overwrite some previous content in this node. This works fine, until it happens that previous content occupied more vertical space then a new one would occupy AND a user scrolled the page down -- scrolled more than new content would allow, provided its height.</p>
<p>In this case the page redraws incorrectly -- some artifacts of the old content remain. It works fine, and it is even possible to get rid of artifacts, by minimizing and restoring the browser (or force the window to be redrawn in an other way), however this does not seem very convenient.</p>
<p>I am testing this only under Safari (this is a iPhone-optimized website).</p>
<p>Does anybody have the idea how to deal with this?</p>
| [
{
"answer_id": 63811,
"author": "palehorse",
"author_id": 312,
"author_profile": "https://Stackoverflow.com/users/312",
"pm_score": 0,
"selected": false,
"text": "$('#container').html( content );\n"
},
{
"answer_id": 65912,
"author": "Scott Swezey",
"author_id": 9439,
... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63743",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3894/"
] |
63,748 | <p>I want to implement in Java a class for handling graph data structures. I have a Node class and an Edge class. The Graph class maintains two list: a list of nodes and a list of edges. Each node must have an unique name. How do I guard against a situation like this:
</p>
<pre><code>Graph g = new Graph();
Node n1 = new Node("#1");
Node n2 = new Node("#2");
Edge e1 = new Edge("e#1", "#1", "#2");
// Each node is added like a reference
g.addNode(n1);
g.addNode(n2);
g.addEdge(e1);
// This will break the internal integrity of the graph
n1.setName("#3");
g.getNode("#2").setName("#4");
</code></pre>
<p></p>
<p>I believe I should clone the nodes and the edges when adding them to the graph and return a NodeEnvelope class that will maintain the graph structural integrity. Is this the right way of doing this or the design is broken from the beginning ?</p>
| [
{
"answer_id": 63795,
"author": "jjnguy",
"author_id": 2598,
"author_profile": "https://Stackoverflow.com/users/2598",
"pm_score": 1,
"selected": false,
"text": "Node"
},
{
"answer_id": 63846,
"author": "Jim Kiley",
"author_id": 7178,
"author_profile": "https://Stacko... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3885/"
] |
63,752 | <p>Semantically speaking, is there an appropriate place in today's websites (late 2008+) where using the bold <code><b></code> and italic <code><i></code> tags are more useful than the more widely used <code><strong></code> and <code><em></code> tags?</p>
| [
{
"answer_id": 63761,
"author": "ceejayoz",
"author_id": 1902010,
"author_profile": "https://Stackoverflow.com/users/1902010",
"pm_score": 3,
"selected": false,
"text": "SPAN"
},
{
"answer_id": 63821,
"author": "Chris Broadfoot",
"author_id": 3947,
"author_profile": "... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63752",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8086/"
] |
63,755 | <p>Does anyone know a good way to do this? I need to have simple forms that submit to email without writing a lot of code. These forms will be hosted in content-viewer web parts or similar in MOSS 2007. I'd like to avoid using InfoPath.</p>
| [
{
"answer_id": 17395874,
"author": "Ricksy",
"author_id": 2537442,
"author_profile": "https://Stackoverflow.com/users/2537442",
"pm_score": 0,
"selected": false,
"text": "text boxes"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/63755",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8033/"
] |
63,758 | <p>I have a Java application that launches another java application. The launcher has a watchdog timer and receives periodic notifications from the second VM. However, if no notifications are received then the second virtual machine should be killed and the launcher will perform some additional clean-up activities.</p>
<p>The question is, is there any way to do this using only java? so far I have to use some native methods to perform this operation and it is somehow ugly.</p>
<p>Thanks!</p>
| [
{
"answer_id": 63807,
"author": "James A. N. Stauffer",
"author_id": 6770,
"author_profile": "https://Stackoverflow.com/users/6770",
"pm_score": 0,
"selected": false,
"text": "java.lang.Runtime.exec"
},
{
"answer_id": 63909,
"author": "David Webb",
"author_id": 3171,
... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2309/"
] |
63,764 | <p>How can I find what databases I have a minimum of read access to in either basic SQL, MySQL specific or in PHP?</p>
| [
{
"answer_id": 63869,
"author": "Jay Shepherd",
"author_id": 7511,
"author_profile": "https://Stackoverflow.com/users/7511",
"pm_score": 1,
"selected": false,
"text": "SHOW DATABASES;"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/63764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/115/"
] |
63,771 | <p>As I build *nix piped commands I find that I want to see the output of one stage to verify correctness before building the next stage but I don't want to re-run each stage. Does anyone know of a program that will help with that? It would keep the output of the last stage automatically to use for any new stages. I usually do this by sending the result of each command to a temporary file (i.e. tee or run each command one at a time) but it would be nice for a program to handle this.</p>
<p>I envision something like a tabbed interface where each tab is labeled with each pipe command and selecting a tab shows the output (at least a hundred lines) of applying that command to to the previous result.</p>
| [
{
"answer_id": 63783,
"author": "pjz",
"author_id": 8002,
"author_profile": "https://Stackoverflow.com/users/8002",
"pm_score": 3,
"selected": false,
"text": "cat /var/log/syslog | tee /tmp/syslog.out | grep something | tee /tmp/grep.out | sed 's/foo/bar/g' | tee /tmp/sed.out | cat >>/va... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6770/"
] |
63,776 | <p>Given an integer typedef:</p>
<pre><code>typedef unsigned int TYPE;
</code></pre>
<p>or</p>
<pre><code>typedef unsigned long TYPE;
</code></pre>
<p>I have the following code to reverse the bits of an integer:</p>
<pre><code>TYPE max_bit= (TYPE)-1;
void reverse_int_setup()
{
TYPE bits= (TYPE)max_bit;
while (bits <<= 1)
max_bit= bits;
}
TYPE reverse_int(TYPE arg)
{
TYPE bit_setter= 1, bit_tester= max_bit, result= 0;
for (result= 0; bit_tester; bit_tester>>= 1, bit_setter<<= 1)
if (arg & bit_tester)
result|= bit_setter;
return result;
}
</code></pre>
<p>One just needs first to run reverse_int_setup(), which stores an integer with the highest bit turned on, then any call to reverse_int(<em>arg</em>) returns <em>arg</em> with its bits reversed (to be used as a key to a binary tree, taken from an increasing counter, but that's more or less irrelevant).</p>
<p>Is there a platform-agnostic way to have in compile-time the correct value for max_int after the call to reverse_int_setup(); Otherwise, is there an algorithm you consider <em>better/leaner</em> than the one I have for reverse_int()?</p>
<p>Thanks.</p>
| [
{
"answer_id": 63854,
"author": "TK.",
"author_id": 1816,
"author_profile": "https://Stackoverflow.com/users/1816",
"pm_score": 0,
"selected": false,
"text": "long temp = 0;\nint counter = 0;\nint number_of_bits = sizeof(value) * 8; // get the number of bits that represent value (assumin... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63776",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6899/"
] |
63,800 | <p>Does Java impose any extra restrictions of its own. Windows (upto Vista) does not allow names to include</p>
<pre><code>\ / < > ? * :
</code></pre>
<p>I know HOW to validate names (a regular expression).</p>
<p>I need to validate filenames entered by users. </p>
<p>My application does not need to run on any other platform, though, of course, I would prefer to be platform independent!</p>
| [
{
"answer_id": 63861,
"author": "jjnguy",
"author_id": 2598,
"author_profile": "https://Stackoverflow.com/users/2598",
"pm_score": 2,
"selected": false,
"text": "File.separator\n"
},
{
"answer_id": 63963,
"author": "Andrew",
"author_id": 7613,
"author_profile": "https... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63800",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8118/"
] |
63,805 | <p>How do I ask PowerShell where something is? </p>
<p>For instance, "which notepad" and it returns the directory where the notepad.exe is run from according to the current paths.</p>
| [
{
"answer_id": 63831,
"author": "Nicholas",
"author_id": 8054,
"author_profile": "https://Stackoverflow.com/users/8054",
"pm_score": 2,
"selected": false,
"text": "Function Find-Path($Path, [switch]$All = $false, [Microsoft.PowerShell.Commands.TestPathType]$type = \"Any\")\n## You could ... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63805",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1220/"
] |
63,870 | <p>I have a rather large file (150 million lines of 10 chars). I need to split it in 150 files of 2 million lines, with each output line being alternatively the first 5 characters or the last 5 characters of the source line.
I could do this in Perl rather quickly, but I was wondering if there was an easy solution using bash.
Any ideas?</p>
| [
{
"answer_id": 63941,
"author": "HD.",
"author_id": 6525,
"author_profile": "https://Stackoverflow.com/users/6525",
"pm_score": 3,
"selected": true,
"text": "sed 's/\\(.....\\)\\(.....\\)/\\1\\n\\2/' input_file | split -l 2000000 - out-prefix-\n"
},
{
"answer_id": 63973,
"aut... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63870",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7028/"
] |
63,881 | <p>I have a strange problem with my cake (cake_1.2.0.7296-rc2).
My start()-action runs twice, under certain circumstances, even though only one request is made.</p>
<p>The triggers seem to be :
- loading an object like: <code>$this->Questionnaire->read(null, $questionnaire_id);</code>
- accessing $this-data </p>
<p>If I disable the call to <code>loadAvertisement()</code> from the <code>start()</code>-action, this does not happen.
If I disable the two calls inside <code>loadAdvertisement():</code></p>
<pre><code>$questionnaire = $this->Questionnaire->read(null, $questionnaire_id);
$question = $this->Questionnaire->Question->read(null, $question_id);
</code></pre>
<p>... then it doesn't happen either.</p>
<p>Why?</p>
<p>See my code below, the Controller is "questionnaires_controller".</p>
<pre><code>function checkValidQuestionnaire($id)
{
$this->layout = 'questionnaire_frontend_layout';
if (!$id)
{
$id = $this->Session->read('Questionnaire.id');
}
if ($id)
{
$this->data = $this->Questionnaire->read(null, $id);
//echo "from ".$questionnaire['Questionnaire']['validFrom']." ".date("y.m.d");
//echo " - to ".$questionnaire['Questionnaire']['validTo']." ".date("y.m.d");
if ($this->data['Questionnaire']['isPublished'] != 1
//|| $this->data['Questionnaire']['validTo'] < date("y.m.d")
//|| $this->data['Questionnaire']['validTo'] < date("y.m.d")
)
{
$id = 0;
$this->flash(__('Ungültiges Quiz. Weiter zum Archiv...', true), array('action'=>'archive'));
}
}
else
{
$this->flash(__('Invalid Questionnaire', true), array('action'=>'intro'));
}
return $id;
}
function start($id = null) {
$this->log("start");
$id = $this->checkValidQuestionnaire($id);
//$questionnaire = $this->Questionnaire->read(null, $id);
$this->set('questionnaire', $this->data);
// reset flow-controlling session vars
$this->Session->write('Questionnaire',array('id' => $id));
$this->Session->write('Questionnaire'.$id.'currQuestion', null);
$this->Session->write('Questionnaire'.$id.'lastAnsweredQuestion', null);
$this->Session->write('Questionnaire'.$id.'correctAnswersNum', null);
$this->loadAdvertisement($id, 0);
$this->Session->write('Questionnaire'.$id.'previewMode', $this->params['named']['preview_mode']);
if (!$this->Session->read('Questionnaire'.$id.'previewMode'))
{
$questionnaire['Questionnaire']['participiantStartCount']++;
$this->Questionnaire->save($questionnaire);
}
}
function loadAdvertisement($questionnaire_id, $question_id)
{
//$questionnaire = array();
$questionnaire = $this->Questionnaire->read(null, $questionnaire_id);
//$question = array();
$question = $this->Questionnaire->Question->read(null, $question_id);
if (isset($question['Question']['advertisement_id']) && $question['Question']['advertisement_id'] > 0)
{
$this->set('advertisement', $this->Questionnaire->Question->Advertisement->read(null, $question['Question']['advertisement_id']));
}
else if (isset($questionnaire['Questionnaire']['advertisement_id']) && $questionnaire['Questionnaire']['advertisement_id'] > 0)
{
$this->set('advertisement', $this->Questionnaire->Question->Advertisement->read(null, $questionnaire['Questionnaire']['advertisement_id']));
}
}
</code></pre>
<p>I really don't understand this... it don't think it's meant to be this way.
Any help would be greatly appreciated! :)</p>
<p>Regards,
Stu</p>
| [
{
"answer_id": 12165162,
"author": "Aloe",
"author_id": 1631160,
"author_profile": "https://Stackoverflow.com/users/1631160",
"pm_score": 1,
"selected": false,
"text": "www"
},
{
"answer_id": 28416302,
"author": "jtrumbull",
"author_id": 3112730,
"author_profile": "ht... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
63,885 | <p>I am trying to create a rather simple effect on a set of images. When an image doesn't have the mouse over it, I'd like it to have a simple, gray border. When it does have an image over it, I'd like it to have a different, "selected", border.</p>
<p>The following CSS works great in Firefox:</p>
<pre class="lang-css prettyprint-override"><code>.myImage a img
{
border: 1px solid grey;
padding: 3px;
}
.myImage a:hover img
{
border: 3px solid blue;
padding: 1px;
}
</code></pre>
<p>However, in IE, borders do not appear when the mouse isn't hovered over the image. My Google-fu tells me there is a bug in IE that is causing this problem. Unfortunately, I can't seem to locate a way to fix that bug.</p>
| [
{
"answer_id": 64098,
"author": "Eric DeLabar",
"author_id": 7556,
"author_profile": "https://Stackoverflow.com/users/7556",
"pm_score": 0,
"selected": false,
"text": "<div class=\"myImage\"><a href=\"...\" class=\"image\"><img .../></a></div>\n"
},
{
"answer_id": 64134,
"au... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63885",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7357/"
] |
63,897 | <p>I'm testing the VB function below that I got from a Google search. I plan to use it to generate hash codes for quick string comparison. However, there are occasions in which two different strings have the same hash code. For example, these strings</p>
<p>"122Gen 1 heap size (.NET CLR Memory w3wp):mccsmtpteweb025.20833333333333E-02"</p>
<p>"122Gen 2 heap size (.NET CLR Memory w3wp):mccsmtpteweb015.20833333333333E-02"</p>
<p>have the same hash code of 237117279.</p>
<p>Please tell me:
- What is wrong with the function?
- How can I fix it?</p>
<p>Thank you</p>
<p>martin</p>
<hr>
<pre><code>Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As Any, src As Any, ByVal bytes As Long)
Private Function HashCode(Key As String) As Long
On Error GoTo ErrorGoTo
Dim lastEl As Long, i As Long
' copy ansi codes into an array of long'
lastEl = (Len(Key) - 1) \ 4
ReDim codes(lastEl) As Long
' this also converts from Unicode to ANSI'
CopyMemory codes(0), ByVal Key, Len(Key)
' XOR the ANSI codes of all characters'
For i = 0 To lastEl - 1
HashCode = HashCode Xor codes(i) 'Xor'
Next
ErrorGoTo:
Exit Function
End Function
</code></pre>
| [
{
"answer_id": 63964,
"author": "Clinton Pierce",
"author_id": 8173,
"author_profile": "https://Stackoverflow.com/users/8173",
"pm_score": 4,
"selected": true,
"text": "System.Security.Cryptography"
},
{
"answer_id": 64055,
"author": "user7936",
"author_id": 7936,
"au... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63897",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8203/"
] |
63,930 | <p>Struts 1.3 application. Main website is NOT served by struts/Java. I need to forward the result of a struts action to a page in the website, that is outside of the struts context. Currently, I forward to a JSP in context and use a meta-refresh to forward to the real location. That seems kinda sucky. Is there a better way?</p>
| [
{
"answer_id": 64049,
"author": "shrisha",
"author_id": 6466,
"author_profile": "https://Stackoverflow.com/users/6466",
"pm_score": 4,
"selected": true,
"text": "sendRedirect()"
},
{
"answer_id": 1006703,
"author": "Kevin Hakanson",
"author_id": 22514,
"author_profile... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3029/"
] |
63,950 | <p>I program with Emacs on Ubuntu (Hardy Heron at the moment), and I like the default text coloration in the Emacs GUI. However, the default text coloration when Emacs is run in the terminal is different and garish.</p>
<p>How do I make the colors in the terminal match the colors in the GUI?</p>
| [
{
"answer_id": 64585,
"author": "insipid",
"author_id": 8649,
"author_profile": "https://Stackoverflow.com/users/8649",
"pm_score": 7,
"selected": false,
"text": "env TERM=xterm-256color emacs -nw\n"
},
{
"answer_id": 60620286,
"author": "Arseniy Alekseyev",
"author_id": ... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63950",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
63,960 | <p>I haven't programmed games for about 10 years (My last experience was DJGPP + Allegro), but I thought I'd check out XNA over the weekend to see how it was shaping up.</p>
<p>I am fairly impressed, however as I continue to piece together a game engine, I have a (probably) basic question.</p>
<p>How much should you rely on C#'s Delegates and Events to drive the game? As an application programmer, I use delegates and events heavily, but I don't know if there is a significant overhead to doing so.</p>
<p>In my game engine, I have designed a "chase cam" of sorts, that can be attached to an object and then recalculates its position relative to the object. When the object moves, there are two ways to update the chase cam.</p>
<ul>
<li>Have an "UpdateCameras()" method in the main game loop.</li>
<li>Use an event handler, and have the chase cam subscribe to object.OnMoved.</li>
</ul>
<p>I'm using the latter, because it allows me to chain events together and nicely automate large parts of the engine. Suddenly, what would be huge and complex get dropped down to a handful of 3-5 line event handlers...Its a beauty.</p>
<p>However, if event handlers firing every nanosecond turn out to be a major slowdown, I'll remove it and go with the loop approach.</p>
<p>Ideas?</p>
| [
{
"answer_id": 79886,
"author": "Empyrean",
"author_id": 14830,
"author_profile": "https://Stackoverflow.com/users/14830",
"pm_score": 2,
"selected": false,
"text": " private delegate void SpacialItemVisitor(ISpacialItem item);\n\n protected override void Update(GameTime gameTime)\... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63960",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1965/"
] |
63,974 | <p>In my application I have a DataGridView control that displays data for the selected object. When I select a different object (in a combobox above), I need to update the grid. Unfortunately different objects have completely different data, even different columns, so I need to clear all the existing data and columns, create new columns and add all the rows. When this is done, the whole control flickers horribly and it takes ages. Is there a generic way to get the control in an update state so it doesn't repaint itself, and then repaint it after I finish all the updates? </p>
<p>It is certainly possible with TreeViews:</p>
<pre><code>myTreeView.BeginUpdate();
try
{
//do the updates
}
finally
{
myTreeView.EndUpdate();
}
</code></pre>
<p>Is there a generic way to do this with other controls, DataGridView in particular?</p>
<p>UPDATE: Sorry, I am not sure I was clear enough. I see the "flickering", because after single edit the control gets repainted on the screen, so you can see the scroll bar shrinking, etc.</p>
| [
{
"answer_id": 65578,
"author": "Ken Wootton",
"author_id": 7357,
"author_profile": "https://Stackoverflow.com/users/7357",
"pm_score": 3,
"selected": false,
"text": "this.SuspendLayout();\n\n// Do something interesting.\n\nthis.ResumeLayout();\n"
},
{
"answer_id": 70281,
"au... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5363/"
] |
63,995 | <p>I would like to give a class a unique ID every time a new one is instantiated. For example with a class named Foo i would like to be able to do the following</p>
<pre><code>dim a as New Foo()
dim b as New Foo()
</code></pre>
<p>and a would get a unique id and b would get a unique ID. The ids only have to be unique over run time so i would just like to use an integer. I have found a way to do this BUT (and heres the caveat) I do NOT want to be able to change the ID from anywhere. My current idea for a way to implement this is the following:</p>
<pre><code>Public Class test
Private Shared ReadOnly _nextId As Integer
Private ReadOnly _id As Integer
Public Sub New()
_nextId = _nextId + 1
_id = _nextId
End Sub
End Class
</code></pre>
<p>However this will not compile because it throws an error on
_nextId = _nextId + 1
I don't see why this would be an error (because _Id is also readonly you're supposed to be able to change a read only variable in the constructor.) I think this has something to do with it being shared also. Any solution (hopefully not kludgy hehe) or an explanation of why this won't work will be accepted. The important part is i want both of the variables (or if there is a way to only have one that would even be better but i don't think that is possible) to be immutable after the object is initialized. Thanks!</p>
| [
{
"answer_id": 64033,
"author": "Magnus Akselvoll",
"author_id": 4683,
"author_profile": "https://Stackoverflow.com/users/4683",
"pm_score": 0,
"selected": false,
"text": "Shared Sub New()\n _nextId = 0\nEnd Sub\n"
},
{
"answer_id": 64108,
"author": "Joel Coehoorn",
"au... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63995",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8054/"
] |
63,998 | <p>Continuing the "Hidden features of ..." meme, let's share the lesser-known but useful features of Ruby programming language.</p>
<p>Try to limit this discussion with core Ruby, without any Ruby on Rails stuff.</p>
<p>See also:</p>
<ul>
<li><a href="https://stackoverflow.com/questions/9033/hidden-features-of-c">Hidden features of C#</a></li>
<li><a href="https://stackoverflow.com/questions/15496/hidden-features-of-java">Hidden features of Java</a></li>
<li><a href="https://stackoverflow.com/questions/61088/hidden-features-of-javascript">Hidden features of JavaScript</a></li>
<li><a href="https://stackoverflow.com/questions/709679/hidden-features-of-ruby-on-rails">Hidden features of Ruby on Rails</a></li>
<li><a href="https://stackoverflow.com/questions/101268/hidden-features-of-python">Hidden features of Python</a></li>
</ul>
<p>(Please, just <em>one</em> hidden feature per answer.)</p>
<p>Thank you</p>
| [
{
"answer_id": 64080,
"author": "CodingWithoutComments",
"author_id": 25,
"author_profile": "https://Stackoverflow.com/users/25",
"pm_score": 5,
"selected": false,
"text": "((0..9).each do |n|\n define_method \"press_#{n}\" do\n @number = @number.to_i * 10 + n\n end\n end\n"
... | 2008/09/15 | [
"https://Stackoverflow.com/questions/63998",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7754/"
] |
64,000 | <p>When launching a process from Java, both stderr and stdout can block on output if I don't read from the pipes. Currently I have a thread that pro-actively reads from one and the main thread blocks on the other.</p>
<p>Is there an easy way to join the two streams or otherwise cause the subprocess to continue while not losing the data in stderr? </p>
| [
{
"answer_id": 64183,
"author": "Mat Mannion",
"author_id": 6282,
"author_profile": "https://Stackoverflow.com/users/6282",
"pm_score": 3,
"selected": true,
"text": "ProcessBuilder builder = new ProcessBuilder(command);\nbuilder.redirectErrorStream(true);\n"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/64000",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4926/"
] |
64,003 | <p>I want to put a copyright notice in the footer of a web site, but I think it's incredibly tacky for the year to be outdated.</p>
<p>How would I make the year update automatically with <a href="http://en.wikipedia.org/wiki/PHP#History" rel="noreferrer">PHP 4</a> or <a href="http://en.wikipedia.org/wiki/PHP#History" rel="noreferrer">PHP 5</a>?</p>
| [
{
"answer_id": 64009,
"author": "Daniel Papasian",
"author_id": 7548,
"author_profile": "https://Stackoverflow.com/users/7548",
"pm_score": 9,
"selected": false,
"text": "<?php echo date(\"Y\"); ?>\n"
},
{
"answer_id": 64011,
"author": "Mark Biek",
"author_id": 305,
"... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1661459/"
] |
64,029 | <p>I have a very specific problem using C# and a Windows MDI Form application. I want to display two (or more) images to the user, a 'left' and a 'right' image. The names of the images are concealed from the user, and then the user selects which image they prefer (this is part of a study involving medical image quality, so the user has to be blinded from possibly relevant capture parameters which might be revealed in the image name). Instead of showing the actual names, substitute names like 'image 0' and 'image 1' (etc) are shown to the user.</p>
<p>Whenever I use the standard <code>MDILayout.TileVertical</code> or <code>TileHorizontal</code>, the images are loaded in reverse order. For example, if I have image 0 and image 1, they are displayed </p>
<p>Image 1 Image 0</p>
<p>Three or more images would be something like</p>
<p>2 1 0</p>
<p>or</p>
<p>3 2</p>
<p>1 0</p>
<p>And so forth. The problem is, my users are confused by this right to leftness, and if I have another dialog box that asks them which image is better (or to rate the displayed images), they always confuse the order of images on the screen with the order of images in the dialog box. That is, if I just order the images 0 1 2 3 etc in a ratings dialog, they assume that image 3 as it's displayed is image 0 in the MDI parent window, image 2 is image 1, etc-- they read left to right, and the images are being displayed right to left. If I reorder the tabs in the ratings dialog box to reflect the order on the screen, that just confuses them further ("Why is image 3 before image 2?") and the results come out in the wrong order, and are generally unusable.</p>
<p>So, how do I force the ordering of displayed windows using <code>MDILayout</code> in <code>C#</code>? Do I have to do it by hand, or is there some switch I can send to the layout manager?</p>
<p>Thanks!</p>
| [
{
"answer_id": 64330,
"author": "OwenP",
"author_id": 2547,
"author_profile": "https://Stackoverflow.com/users/2547",
"pm_score": 0,
"selected": false,
"text": "ActivateMdiChild"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/64029",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
64,036 | <p>It's a bit difficult to implement a deep object copy function. What steps you take to ensure the original object and the cloned one share no reference? </p>
| [
{
"answer_id": 64611,
"author": "user8690",
"author_id": 8690,
"author_profile": "https://Stackoverflow.com/users/8690",
"pm_score": 6,
"selected": false,
"text": "org.apache.commons.lang3.SerializationUtils.clone(T)"
},
{
"answer_id": 228900,
"author": "sankara",
"author... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64036",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3885/"
] |
64,038 | <p>When I use the default java locale on my linux machine it comes out with the US locale settings, where do I change this so that it comes out with the correct locale?</p>
| [
{
"answer_id": 64096,
"author": "Chris Broadfoot",
"author_id": 3947,
"author_profile": "https://Stackoverflow.com/users/3947",
"pm_score": 6,
"selected": false,
"text": "user.language"
},
{
"answer_id": 9894836,
"author": "cayhorstmann",
"author_id": 375317,
"author_... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64038",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
64,041 | <p>How do I change font size on the DataGridView?</p>
| [
{
"answer_id": 64167,
"author": "psamwel",
"author_id": 3089,
"author_profile": "https://Stackoverflow.com/users/3089",
"pm_score": 7,
"selected": true,
"text": " private void UpdateFont()\n {\n //Change cell font\n foreach(DataGridViewColumn c in dgAssets.Columns)\n ... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64041",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4653/"
] |
64,046 | <p>I have a strange problem when I publish my website. I inherited this project and the problem started before I arrived so I don't know what conditions lead to the creation of the problem.</p>
<p>Basically, 3 folders below the website project fail to publish properly. When the PrecompiledWeb is transferred to the host these three folders have to be manually copied from the Visual Studio project (i.e. they are no longer the published versions) to the host for it to work.</p>
<p>If the results of the publish operation are left, any page in the folder results in the following error:</p>
<blockquote>
<p>Server Error in '/' Application.
Unable to cast object of type
'System.Web.Compilation.BuildResultNoCompilePage'
to type
'System.Web.Compilation.BuildResultCompiledType'.
Description: An unhandled exception
occurred during the execution of the
current web request. Please review the
stack trace for more information about
the error and where it originated in
the code.</p>
<p>Exception Details:
System.InvalidCastException: Unable to
cast object of type
'System.Web.Compilation.BuildResultNoCompilePage'
to type
'System.Web.Compilation.BuildResultCompiledType'.</p>
<p>Source Error:</p>
<p>An unhandled exception was generated
during the execution of the current
web request. Information regarding the
origin and location of the exception
can be identified using the exception
stack trace below.</p>
<p>Stack Trace:</p>
<p>[InvalidCastException: Unable to cast
object of type
'System.Web.Compilation.BuildResultNoCompilePage'
to type
'System.Web.Compilation.BuildResultCompiledType'.]
System.Web.UI.PageParser.GetCompiledPageInstance(VirtualPath
virtualPath, String inputFile,
HttpContext context) +254<br>
System.Web.UI.PageParser.GetCompiledPageInstance(String
virtualPath, String inputFile,
HttpContext context) +171<br>
URLRewrite.URLRewriter.ProcessRequest(HttpContext
context) +2183<br>
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+405 System.Web.HttpApplication.ExecuteStep(IExecutionStep
step, Boolean& completedSynchronously)
+65</p>
<p>Version Information: Microsoft .NET
Framework Version:2.0.50727.832;
ASP.NET Version:2.0.50727.832</p>
</blockquote>
<p>Does anyone have any idea what the possible causes of these pages not publishing correctly could be? Anything I can look at that may indicate the root of the problem?</p>
<p><strong>Addition:</strong>
It is a completely clean build each time, so there shouldn't be a problem with old bin files lying around. I've also checked the datestamp on the items in the bin folder and they are up-to-date.</p>
<p><strong>Second Addition:</strong>
The project was originally created as a <em>Web Site</em>, not a Web Application. Sorry for the ambiguity.</p>
| [
{
"answer_id": 1123019,
"author": "Mircea Grelus",
"author_id": 119138,
"author_profile": "https://Stackoverflow.com/users/119138",
"pm_score": 0,
"selected": false,
"text": "aspnet_compiler"
},
{
"answer_id": 32035009,
"author": "Abhilash Thomas",
"author_id": 1716548,
... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64046",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8152/"
] |
64,059 | <p>I have some website which requires a logon and shows sensitive information.</p>
<p>The person goes to the page, is prompted to log in, then gets to see the information.</p>
<p>The person logs out of the site, and is redirected back to the login page.</p>
<p>The person then can hit "back" and go right back to the page where the sensitive information is contained. Since the browser just thinks of it as rendered HTML, it shows it to them no problem.</p>
<p>Is there a way to prevent that information from being displayed when the person hits the "back" button from the logged out screen? I'm not trying to disable the back button itself, I'm just trying to keep the sensitive information from being displayed again because the person is not logged into the site anymore.</p>
<p>For the sake of argument, the above site/scenario is in ASP.NET with Forms Authentication (so when the user goes to the first page, which is the page they want, they're redirected to the logon page - in case that makes a difference).</p>
| [
{
"answer_id": 64079,
"author": "Espo",
"author_id": 2257,
"author_profile": "https://Stackoverflow.com/users/2257",
"pm_score": 2,
"selected": false,
"text": "Response.Cache.SetCacheability(HttpCacheability.NoCache)\n"
},
{
"answer_id": 64081,
"author": "TheSmurf",
"auth... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2577/"
] |
64,061 | <p>What Java library would you say is the best for consuming and parsing feeds? Requirements:</p>
<ul>
<li>Embeddable</li>
<li>Supports Atom & RSS</li>
<li>Has caching architecture</li>
<li>Should be able to deal with any feed format the same way</li>
</ul>
<p>(Please: <em>one</em> suggestion per answer.)</p>
| [
{
"answer_id": 4357661,
"author": "so_mv",
"author_id": 186858,
"author_profile": "https://Stackoverflow.com/users/186858",
"pm_score": 0,
"selected": false,
"text": "dormant"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/64061",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2041950/"
] |
64,117 | <p>I had to delete all the rows from a log table that contained about 5 million rows. My initial try was to issue the following command in query analyzer:</p>
<p>delete from client_log</p>
<p>which took a very long time.</p>
| [
{
"answer_id": 64133,
"author": "Martynnw",
"author_id": 5466,
"author_profile": "https://Stackoverflow.com/users/5466",
"pm_score": 1,
"selected": false,
"text": "Truncate Table"
},
{
"answer_id": 64156,
"author": "James A. Rosen",
"author_id": 1190,
"author_profile"... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4096/"
] |
64,139 | <p>I have a usercontrol that has several public properties. These properties automatically show up in the properties window of the VS2005 designer under the "Misc" category. Except two of the properties which are enumerations don't show up correctly.</p>
<p>The first on uses the following enum:</p>
<pre><code>public enum VerticalControlAlign
{
Center,
Top,
Bottom
}
</code></pre>
<p>This does not show up in the designer <em>at all.</em></p>
<p>The second uses this enum:</p>
<pre><code>public enum AutoSizeMode
{
None,
KeepInControl
}
</code></pre>
<p>This one shows up, but the designer seems to think it's a bool and only shows True and False. And when you build a project using the controls it will say that it can't convert type bool to AutoSizeMode.</p>
<p>Also, these enums are declared globably to the Namespace, so they are accessible everywhere.</p>
<p>Any ideas?</p>
| [
{
"answer_id": 64188,
"author": "Thunder3",
"author_id": 2832,
"author_profile": "https://Stackoverflow.com/users/2832",
"pm_score": 0,
"selected": false,
"text": "batch=\"false\""
},
{
"answer_id": 64326,
"author": "Statement",
"author_id": 2166173,
"author_profile":... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64139",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/194/"
] |
64,141 | <p>In Python is there any way to make a class, then make a second version of that class with identical dat,a but which can be changed, then reverted to be the same as the data in the original class? </p>
<p>So I would make a class with the numbers 1 to 5 as the data in it, then make a second class with the same names for sections (or very similar). Mess around with the numbers in the second class then with one function then reset them to be the same as in the first class. </p>
<p>The only alternative I've found is to make one aggravatingly long class with too many separate pieces of data in it to be readily usable.</p>
| [
{
"answer_id": 64163,
"author": "Teifion",
"author_id": 1384652,
"author_profile": "https://Stackoverflow.com/users/1384652",
"pm_score": 4,
"selected": true,
"text": "class dog(object):\n def __init__(self, height, width, lenght):\n self.height = height\n self.width = w... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64141",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8324/"
] |
64,146 | <p>When a script is saved as a bundle, it can use the <code>localized string</code> command to find the appropriate string, e.g. in <code>Contents/Resources/English.lproj/Localizable.strings</code>. If this is a format string, what is the best way to fill in the placeholders? In other words, what is the AppleScript equivalent of <code>+[NSString stringWithFormat:]</code>?</p>
<p>One idea I had was to use <code>do shell script</code> with <code>printf(1)</code>. Is there a better way?</p>
| [
{
"answer_id": 66899,
"author": "nlanza",
"author_id": 9373,
"author_profile": "https://Stackoverflow.com/users/9373",
"pm_score": 0,
"selected": false,
"text": "printf(1)"
},
{
"answer_id": 41405599,
"author": "Minh Nguyễn",
"author_id": 4585461,
"author_profile": "h... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64146",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6311/"
] |
64,174 | <p>Is there any way to change Firefox system icon (the one on the left top of the window)? </p>
<p>Precision : I want to change the icon of a bundled version of Firefox with apache/php and my application. So manual operation on each computer is not a solution.
I try Resource Hacker and it's the good solution. The add ons one is good too.</p>
| [
{
"answer_id": 9433191,
"author": "studgeek",
"author_id": 255961,
"author_profile": "https://Stackoverflow.com/users/255961",
"pm_score": 2,
"selected": false,
"text": "omni.ja"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/64174",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8404/"
] |
64,193 | <p>I am using the AJAX Control Toolkit Popup Calendar Control in a datagrid. When it is in the footer it looks fine. When it is in the edit side of the datagrid it is inheriting the style from the datagrid and looks completely different (i.e. too big). </p>
<p>Is there a way to alter the CSS so that it does not inherit the style from the datagrid?</p>
| [
{
"answer_id": 64317,
"author": "user8456",
"author_id": 8456,
"author_profile": "https://Stackoverflow.com/users/8456",
"pm_score": 2,
"selected": true,
"text": "body table tr td table tr {\n /*css goes here */\n\n}\n"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/64193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7316/"
] |
64,200 | <p>How do I call MySQL stored procedures from Perl? Stored procedure functionality is fairly new to MySQL and the MySQL modules for Perl don't seem to have caught up yet.</p>
| [
{
"answer_id": 64283,
"author": "aggergren",
"author_id": 7742,
"author_profile": "https://Stackoverflow.com/users/7742",
"pm_score": 2,
"selected": false,
"text": "#!/usr/bin/perl\n#\nuse strict;\nuse DBI qw(:sql_types);\n\nmy $dbh = DBI->connect(\n $ConnStr,\n $Us... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64200",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
64,202 | <p>I am using SQL Server 2000 and I have two databases that both replicate (transactional push subscription) to a single database. I need to know which database the records came from.</p>
<p>So I want to add a fixed column specified in the publication to my table so I can tell which database the row originated from.</p>
<p>How do I go about doing this?</p>
<p>I would like to avoid altering the main databases mostly due to the fact there are many tables I would need to do this to. I was hoping for some built in feature of replication that would do this for me some where. Other than that I would go with the view idea.</p>
| [
{
"answer_id": 65508,
"author": "Chris Shaffer",
"author_id": 6744,
"author_profile": "https://Stackoverflow.com/users/6744",
"pm_score": 1,
"selected": false,
"text": "\nALTER TABLE TableName ADD\n MyColumn AS 'Server1'\n"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/64202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2253/"
] |
64,204 | <p>I am creating a Windows Service in C# that processes messages from a queue. I want to give ops the flexibility of partitioning the service in production according to properties of the message. For example, they should be able to say that one instance processes web orders from Customer A, another batch orders from Customer A, a third web or batch orders from Customer B, and so on.</p>
<p>My current solution is to assign separate queues to each customer\source combination. The process that puts orders into the queues has to make the right decision. My Windows Service can be configured to pull messages from one or more queues. It's messy, but it works.</p>
| [
{
"answer_id": 2133312,
"author": "Árpád Varga",
"author_id": 258533,
"author_profile": "https://Stackoverflow.com/users/258533",
"pm_score": 2,
"selected": false,
"text": "MessageEnumerator en = q.GetMessageEnumerator2();\n\nwhile (en.MoveNext())\n{\n if (en.Current.Label == label)\n... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64204",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7668/"
] |
64,209 | <p>I'm reading lines of text that can come in any order. The problem is that the output can actually be indentical to the previous output. How can I detect this, without sorting the output first?</p>
<p>Is there some kind of hash function that can take identical input, but in any order, and still produce the same result?</p>
| [
{
"answer_id": 64236,
"author": "Nicholas",
"author_id": 8054,
"author_profile": "https://Stackoverflow.com/users/8054",
"pm_score": 0,
"selected": false,
"text": "A B C D\nD E F G\nC B A D\n"
},
{
"answer_id": 67573,
"author": "Community",
"author_id": -1,
"author_pr... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8406/"
] |
64,214 | <p>I read everywhere that business logic belongs in the models and not in controller but where is the limit?
I am toying with a personnal accounting application. </p>
<pre><code>Account
Entry
Operation
</code></pre>
<p>When creating an operation it is only valid if the corresponding entries are created and linked to accounts so that the operation is balanced for exemple buy a 6-pack :</p>
<pre><code>o=Operation.new({:description=>"b33r", :user=>current_user, :date=>"2008/09/15"})
o.entries.build({:account_id=>1, :amount=>15})
o.valid? #=>false
o.entries.build({:account_id=>2, :amount=>-15})
o.valid? #=>true
</code></pre>
<p>Now the form shown to the user in the case of <em>basic operations</em> is simplified to hide away the entries details, the accounts are selected among 5 default by the kind of operation requested by the user (intialise account -> equity to accout, spend assets->expenses, earn revenues->assets, borrow liabilities->assets, pay debt assets->liabilities ...) I want the entries created from default values.</p>
<p>I also want to be able to create more complex operations (more than 2 entries). For this second use case I will have a different form where the additional complexity is exposed.This second use case prevents me from including a debit and credit field on the Operation and getting rid of the Entry link. </p>
<p>Which is the best form ? Using the above code in a SimpleOperationController as I do for the moment, or defining a new method on the Operation class so I can call Operation.new_simple_operation(params[:operation])</p>
<p>Isn't it breaking the separation of concerns to actually create and manipulate Entry objects from the Operation class ?</p>
<p>I am not looking for advice on my twisted accounting principles :)</p>
<p>edit -- It seems I didn't express myself too clearly.
I am not so concerned about the validation. I am more concerned about where the creation logic code should go : </p>
<p>assuming the operation on the controller is called spend, when using spend, the params hash would contain : amount, date, description. Debit and credit accounts would be derived from the action which is called, but then I have to create all the objects. Would it be better to have </p>
<pre><code>#error and transaction handling is left out for the sake of clarity
def spend
amount=params[:operation].delete(:amount)#remove non existent Operation attribute
op=Operation.new(params[:operation])
#select accounts in some way
...
#build entries
op.entries.build(...)
op.entries.build(...)
op.save
end
</code></pre>
<p>or to create a method on Operation that would make the above look like </p>
<pre><code>def spend
op=Operation.new_simple_operation(params)
op.save
end
</code></pre>
<p>this definitely give a much thinner controller and a fatter model, but then the model will create and store instances of other models which is where my problem is.</p>
| [
{
"answer_id": 64389,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 0,
"selected": false,
"text": "class Operation < ActiveRecord::Base\n has_many :entries\n validates_associated :entries\nend\n"
},
{
"answer_id": 66... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7898/"
] |
64,272 | <p>I want to create a custom control in C#. But every time I have to fully redraw my control, it flickers, even if I use double buffering (drawing to an Image first, and blitting that).</p>
<p>How do I eliminate flicker when I have to fully redraw?</p>
| [
{
"answer_id": 64507,
"author": "Shaun Austin",
"author_id": 1120,
"author_profile": "https://Stackoverflow.com/users/1120",
"pm_score": 5,
"selected": true,
"text": "SetStyle(ControlStyles.OptimizedDoubleBuffer | \n ControlStyles.UserPaint |\n ControlStyles.AllPaintingIn... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7305/"
] |
64,279 | <p>We create new sites in IIS 6 (Windows Server 2003) using IIS Manager. When these sites are created in IIS 6, the ASP.NET version defaults to ASP.NET 1.1. We would like it to default to ASP.NET 2.0. The reason this is a problem for us is that when you take any site on the server and switch the ASP.NET version from ASP.NET 1.1 to ASP.NET 2.0, all web sites recycle.</p>
<p>Is there a setting in the IIS metabase that controls this or a way to create a site via script that sets the ASP.Net version correctly so that we can avoid the IIS reset when setting up each site?</p>
| [
{
"answer_id": 68043,
"author": "Tim",
"author_id": 10363,
"author_profile": "https://Stackoverflow.com/users/10363",
"pm_score": 4,
"selected": false,
"text": "aspnet_regiis -lk"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/64279",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
64,284 | <p>Let's say I have a list of categories for navigation on a web app. Rather than selecting from the database for every user, should I add a function call in the application_onStart of the global.asax to fetch that data into an array or collection that is re-used over and over. If my data does not change at all - (Edit - very often), would this be the best way?</p>
| [
{
"answer_id": 64361,
"author": "Al.",
"author_id": 7921,
"author_profile": "https://Stackoverflow.com/users/7921",
"pm_score": 1,
"selected": false,
"text": "// Create and load the profile object\nx_siteprofile thisprofile = new x_siteprofile(Server.MapPath(String.Concat(config.Path, \"... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64284",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1115144/"
] |
64,291 | <p>I'm working on an application that needs to quickly render simple 3D scenes on the server, and then return them as a JPEG via HTTP. Basically, I want to be able to simply include a dynamic 3D scene in an HTML page, by doing something like:</p>
<pre><code><img src="http://www.myserver.com/renderimage?scene=1&x=123&y=123&z=123">
</code></pre>
<p>My question is about what technologies to use to do the rendering. In a desktop application I would quite naturally use DirectX, but I'm afraid it might not be ideal for a server-side application that would be creating images for dozens or even hundreds of users in tandem. Does anyone have any experience with this? Is there a 3D API (preferably freely available) that would be ideal for this application? Is it better to write a software renderer from scratch?</p>
<p>My main concerns about using DirectX or OpenGL, is whether it will function well in a virtualized server environment, and whether it makes sense with typical server hardware (over which I have little control). </p>
| [
{
"answer_id": 12820722,
"author": "Janus Troelsen",
"author_id": 309483,
"author_profile": "https://Stackoverflow.com/users/309483",
"pm_score": 2,
"selected": false,
"text": "<?php\nchdir(\"/tmp\");\n@unlink(\"demo.png\");\nsystem(\"~janus/.wine/drive_c/POV-Ray-v3.7-RC6/bin/pvengine-ss... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8409/"
] |
64,311 | <p>The design for the website I am working on calls for a custom image on lists instead of a bullet. Using the image is fine, but I have been having difficulties ensuring that it is centered against the text of the list item across all browsers. Does anyone know of a standard solution for this?</p>
| [
{
"answer_id": 64340,
"author": "Dillie-O",
"author_id": 71,
"author_profile": "https://Stackoverflow.com/users/71",
"pm_score": 0,
"selected": false,
"text": "li\n{\n background-image: URL('custom.png');\n background-repeat: no-repeat;\n background-position: center;\n}\n"
},
{... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64311",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4284/"
] |
64,321 | <p>You write a function and, looking at the resulting assembly, you see it can be improved.</p>
<p>You would like to keep the function you wrote, for readability, but you would like to substitute your own assembly for the compiler's. Is there any way to establish a relationship between your high-livel language function and the new assembly?</p>
| [
{
"answer_id": 64460,
"author": "spoulson",
"author_id": 3347,
"author_profile": "https://Stackoverflow.com/users/3347",
"pm_score": 1,
"selected": false,
"text": "__asm { }"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/64321",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8522/"
] |
64,333 | <p>What do I lose by adopting test driven design?</p>
<p>List only negatives; do not list benefits written in a negative form.</p>
| [
{
"answer_id": 64358,
"author": "Jason Cohen",
"author_id": 4926,
"author_profile": "https://Stackoverflow.com/users/4926",
"pm_score": -1,
"selected": false,
"text": "private"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/64333",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8509/"
] |
64,351 | <p>I'm trying to load a page that is basically an edit form inside a
dialog (ui.dialog). I can load this page fine from an external (I'm
using asp.net) page.</p>
<p>The problem is that inside of my "popup" form, I need to <code>$(function()
{my function here});</code> syntax to do some stuff when the page loads,
along with registering some <code>.fn</code> extensions for some dynamic dropdowns
using ajax calls.</p>
<p>I have created my <code><script type="text/javascript" src="jquery.js"></code> but
I don't think these are being included, and also my <code>$(function)</code> is not
being called.</p>
<p>Is this possible to do or do I need to find another way of
accomplishing what I need to do? </p>
| [
{
"answer_id": 64515,
"author": "Alexey Lebedev",
"author_id": 8338,
"author_profile": "https://Stackoverflow.com/users/8338",
"pm_score": 3,
"selected": true,
"text": "$.ajax({\n //...\n success: function(text) {\n // insert text into container\n // the code from $(funct... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8534/"
] |
64,360 | <p>When I cut (kill) text in Emacs 22.1.1 (in its own window on X, in KDE, on Kubuntu), I can't paste (yank) it in any other application.</p>
| [
{
"answer_id": 64558,
"author": "memius",
"author_id": 8522,
"author_profile": "https://Stackoverflow.com/users/8522",
"pm_score": 8,
"selected": true,
"text": ".emacs"
},
{
"answer_id": 65473,
"author": "Chris Conway",
"author_id": 1412,
"author_profile": "https://St... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64360",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8522/"
] |
64,387 | <p><strong>Emacs</strong>: <code>C-U (79) #</code> » a pretty 79 character length divider</p>
<p><strong>VIM</strong>: <code>79-i-#</code> » see above</p>
<p><strong><a href="http://macromates.com/" rel="nofollow noreferrer">Textmate</a></strong>: ????</p>
<p>Or is it just assumed that we'll make a Ruby call or have a snippet somewhere?</p>
| [
{
"answer_id": 64975,
"author": "pjbeardsley",
"author_id": 6812,
"author_profile": "https://Stackoverflow.com/users/6812",
"pm_score": 2,
"selected": false,
"text": "python -c \"print '#' * $TM_SELECTED_TEXT\"\n"
},
{
"answer_id": 91221,
"author": "Matt",
"author_id": 15... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64387",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
64,388 | <p>I'm trying to use Visual Studio 2008's extensibility to write an addin that will create a project folder with various messages in it after parsing an interface. I'm having trouble at the step of creating/adding the folder, however. I've tried using </p>
<pre><code>ProjectItem folder =
item.ProjectItem.Collection.AddFolder(newDirectoryName, string.Empty);
</code></pre>
<p>(item is my target file next to which I'm creating a folder with the same name but "Messages" appended to it) but it chokes when a folder already exists (no big surprise).</p>
<p>I tried deleting it if it already exists, such as: </p>
<pre><code>DirectoryInfo dirInfo = new DirectoryInfo(newDirectoryParent +
newDirectoryName);
if (dirInfo.Exists)
{
dirInfo.Delete(true);
}
ProjectItem folder =
item.ProjectItem.Collection.AddFolder(newDirectoryName, string.Empty);
</code></pre>
<p>I can SEE that the folder gets deleted when in debug, but it still
seems to think the folder is still there and dies on a folder already
exists exception. </p>
<p>Any ideas??? </p>
<p>Thanks. </p>
<p>AK </p>
<p>.... Perhaps the answer would lie in programmatically refreshing the project after the delete? How might this be done?</p>
| [
{
"answer_id": 64901,
"author": "Andrew",
"author_id": 8586,
"author_profile": "https://Stackoverflow.com/users/8586",
"pm_score": 2,
"selected": false,
"text": "DirectoryInfo dirInfo = new DirectoryInfo(newDirectoryParent + newDirectoryName);\n\nif (dirInfo.Exists)\n{\n dirInfo.Delet... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64388",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8586/"
] |
64,426 | <p>I'm looking for a good server/client protocol supported in Python for making data requests/file transfers between one server and many clients. Security is also an issue - so secure login would be a plus. I've been looking into XML-RPC, but it looks to be a pretty old (and possibly unused these days?) protocol.</p>
| [
{
"answer_id": 64489,
"author": "Will Harris",
"author_id": 4702,
"author_profile": "https://Stackoverflow.com/users/4702",
"pm_score": 2,
"selected": false,
"text": "urllib"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/64426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8585/"
] |
64,432 | <p>I have inherited a large legacy ColdFusion app. There are hundreds of <cfquery>some sql here #variable#</cfquery> statements that need to be parameterized along the lines of: <cfquery> some sql here <cfqueryparam value="#variable#"/> </cfquery></p>
<p>How can I go about adding parameterization programmatically?</p>
<p>I have thought about writing some regular expression or sed/awk'y sort of solution, but it seems like somebody somewhere has tackled such a problem. Bonus points awarded for inferring the sql type automatically.</p>
| [
{
"answer_id": 72772,
"author": "betelgeuce",
"author_id": 366182,
"author_profile": "https://Stackoverflow.com/users/366182",
"pm_score": 1,
"selected": false,
"text": "<cf_inputFilter\n scopes = \"FORM,COOKIE,URL\"\n chars = \"<,>,!,&,|,%,=,(,),',{,}\"\n ... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64432",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8563/"
] |
64,436 | <p>I'm using Excel VBA to a write a UDF. I would like to overload my own UDF with a couple of different versions so that different arguments will call different functions. </p>
<p>As VBA doesn't seem to support this, could anyone suggest a good, non-messy way of achieving the same goal? Should I be using Optional arguments or is there a better way?</p>
| [
{
"answer_id": 64494,
"author": "theo",
"author_id": 7870,
"author_profile": "https://Stackoverflow.com/users/7870",
"pm_score": 0,
"selected": false,
"text": "Foo_DescriptiveName1()\n\nFoo_DescriptiveName2()\n"
},
{
"answer_id": 70526,
"author": "Joel Spolsky",
"author_i... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64436",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/69157/"
] |
64,469 | <p>I have a VB6 program that someone recently helped me convert to VB.NET</p>
<p>In the program, when saving files, I stamp them with the date which I was getting by calling the Today() function. </p>
<p>When I try to run the new VB.NET code in Vista it throws a permission exception for the Today() . If I run Visual Studio Express (this is the 2008 Express version) in Admin mode, then the problem doesn't occur, but clearly I want to end up with a stand-alone program which runs for all users without fancy permissions.</p>
<p>So how can a normal VB.NET program in Vista get today's date?</p>
| [
{
"answer_id": 64521,
"author": "David J. Sokol",
"author_id": 1390,
"author_profile": "https://Stackoverflow.com/users/1390",
"pm_score": 4,
"selected": true,
"text": "DateTime.Now"
},
{
"answer_id": 64526,
"author": "SqlRyan",
"author_id": 8114,
"author_profile": "h... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64469",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8482/"
] |
64,498 | <p>Can you specialize a template method within a template class without specializing the class template parameter?</p>
<p>Please note that the specialization is on the <em>value</em> of the template parameter, not its type.</p>
<p>This seems to compile under Visual Studio 2008 SP1 complier, but not GCC 4.2.4.</p>
<pre><code>#include <iostream>
using namespace std;
template <typename T>
class A
{
private:
template <bool b>
void testme();
template <>
void testme<true>() { cout << "true" << endl; };
template <>
void testme<false>() { cout << "false" << endl; };
public:
void test();
};
template<typename T> struct select {};
template<> struct select<int> { static const bool value = true; };
template<> struct select<double> { static const bool value = false; };
template <class T>
void A<T>::test() { testme<select<T>::value>(); }
int main(int argc, const char* argv[])
{
A<int> aInt;
A<double> aDouble;
aInt.test();
aDouble.test();
return 0;
}
</code></pre>
<p>GCC tells me:"error: explicit specialization in non-namespace scope ‘class A’"</p>
<p>If it is not supported in the standard, can anyone tell me why?</p>
| [
{
"answer_id": 64824,
"author": "moswald",
"author_id": 8368,
"author_profile": "https://Stackoverflow.com/users/8368",
"pm_score": 2,
"selected": false,
"text": "template<typename ty>\nclass A\n{\npublic:\n void foo(bool b);\n void foo(int i);\n};\n"
},
{
"answer_id": ... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64498",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8524/"
] |
64,505 | <p>I'm using the following method to send mail from Python using SMTP. Is it the right method to use or are there gotchas I'm missing ?</p>
<pre><code>from smtplib import SMTP
import datetime
debuglevel = 0
smtp = SMTP()
smtp.set_debuglevel(debuglevel)
smtp.connect('YOUR.MAIL.SERVER', 26)
smtp.login('USERNAME@DOMAIN', 'PASSWORD')
from_addr = "John Doe <john@doe.net>"
to_addr = "foo@bar.com"
subj = "hello"
date = datetime.datetime.now().strftime( "%d/%m/%Y %H:%M" )
message_text = "Hello\nThis is a mail from your server\n\nBye\n"
msg = "From: %s\nTo: %s\nSubject: %s\nDate: %s\n\n%s"
% ( from_addr, to_addr, subj, date, message_text )
smtp.sendmail(from_addr, to_addr, msg)
smtp.quit()
</code></pre>
| [
{
"answer_id": 64554,
"author": "pjz",
"author_id": 8002,
"author_profile": "https://Stackoverflow.com/users/8002",
"pm_score": 3,
"selected": false,
"text": ".login()"
},
{
"answer_id": 64890,
"author": "Vincent Marchetti",
"author_id": 8935,
"author_profile": "https... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64505",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8206/"
] |
64,508 | <p>What does the following Guile scheme code do?</p>
<pre><code>(eq? y '.)
(cons x '.)
</code></pre>
<p>The code is not valid in MzScheme, is there a portable equivalent across scheme implementations?</p>
<p>I am trying to port this code written by someone else. Guile seems to respond to '. with #{.}#, but I'm not sure what it means or how to do this in another scheme.</p>
| [
{
"answer_id": 15561595,
"author": "NalaGinrut",
"author_id": 259033,
"author_profile": "https://Stackoverflow.com/users/259033",
"pm_score": 1,
"selected": false,
"text": "#{.}#"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/64508",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8689/"
] |
64,518 | <p>I have a Glade GUI description file with a <code>GtkTreeView</code> in a <code>GtkHBox</code> in a window; and there's a handler for the <code>row_activated</code> signal. Now, Glade has automatically set the "events" property (inherited from <code>GtkWidget</code>) of that treeview to some value (<code>GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</code>). And there are two strange things with this:</p>
<ul>
<li>removing the pre-set value (so that the property is empty) doesn't seem to break the application (at least not with the old GTK 2.10 I have atm).</li>
<li>in fact, an annoying bug I has seen before (where the treeview items would not correctly react to expand or collapse clicks) is now gone!</li>
</ul>
<p>I have yet to test this with a newer GTK version, but the question is already there: exactly what is the purpose for this <code>events</code> property? And why does Glade automatically and unnecessarily set it to some value? Does this have some side effects I'm not aware of?</p>
| [
{
"answer_id": 65017,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 0,
"selected": false,
"text": "row_activated"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/64518",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
64,537 | <p>How do I use Perl to create graphs?</p>
<p>I'm running scheduled job that creates text reports. I'd like to move this to the next step (for the management) and also create some graphs that go along with this. Is this possible / feasible? It'd be great if I could do this using Office some how.</p>
<h2>update: solutions i'm going to investigate in this order</h2>
<ul>
<li>Spreadsheet::WriteExcel (this seems to now have changed from the last time i investigated this .... wait, this was suggested by the author of the module. cool.)</li>
<li>GD Graph - this is now available for ActivePerl(wasn't last time i looked)</li>
<li>SVG</li>
<li>Open Charts look interesting.</li>
<li>Chartdirector</li>
</ul>
| [
{
"answer_id": 64556,
"author": "user8456",
"author_id": 8456,
"author_profile": "https://Stackoverflow.com/users/8456",
"pm_score": 2,
"selected": false,
"text": "Spreadsheet::WriteExcel::Chart\n"
},
{
"answer_id": 66276,
"author": "Pat",
"author_id": 238,
"author_pr... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64537",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8676/"
] |
64,559 | <p>I've started to work a bit with master pages for an ASP.net mvc site and I've come across a question. When I link in a stylesheet on the master page it seems to update the path to the sheet correctly. That is in the code I have</p>
<pre><code><link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
</code></pre>
<p>but looking at the source once the page is fed to a browser I get</p>
<pre><code><link href="Content/Site.css" rel="stylesheet" type="text/css" />
</code></pre>
<p>which is perfect. However the same path translation doesn't seem to work for script files. </p>
<pre><code><script src="../../Content/menu.js" type="text/javascript"></script>
</code></pre>
<p>just comes out as the same thing. It still seems to work on a top level page but I suspect that is just the browser/web server correcting my error. Is there a way to get the src path to be globbed too? </p>
| [
{
"answer_id": 64586,
"author": "Iain Holder",
"author_id": 1122,
"author_profile": "https://Stackoverflow.com/users/1122",
"pm_score": 0,
"selected": false,
"text": "<link href=\"~/Content/Site.css\" rel=\"stylesheet\" type=\"text/css\" />\n"
},
{
"answer_id": 66376,
"author... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64559",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/361/"
] |
64,570 | <p>PHP's explode function returns an array of strings split on some provided substring. It will return empty strings when there are leading, trailing, or consecutive delimiters, like this:</p>
<pre><code>var_dump(explode('/', '1/2//3/'));
array(5) {
[0]=>
string(1) "1"
[1]=>
string(1) "2"
[2]=>
string(0) ""
[3]=>
string(1) "3"
[4]=>
string(0) ""
}
</code></pre>
<p>Is there some different function or option or anything that would return everything <em>except</em> the empty strings?</p>
<pre><code>var_dump(different_explode('/', '1/2//3/'));
array(3) {
[0]=>
string(1) "1"
[1]=>
string(1) "2"
[2]=>
string(1) "3"
}
</code></pre>
| [
{
"answer_id": 64606,
"author": "James Aylett",
"author_id": 6302,
"author_profile": "https://Stackoverflow.com/users/6302",
"pm_score": 2,
"selected": false,
"text": "function not_empty_string($s) {\n return $s !== \"\";\n}\n\narray_filter(explode('/', '1/2//3/'), 'not_empty_string');\... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5726/"
] |
64,581 | <p>Any information on how to display the ODBC connections dialog and get the chosen ODBC back?</p>
| [
{
"answer_id": 65161,
"author": "RyanBrady",
"author_id": 2555,
"author_profile": "https://Stackoverflow.com/users/2555",
"pm_score": 2,
"selected": false,
"text": "// a_RootKey is Microsoft.Win32.RegistryKey \n// DSN is a class not provided in this code sample - you can see what propert... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64581",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
64,602 | <p>There are three assembly version attributes. What are differences? Is it ok if I use <code>AssemblyVersion</code> and ignore the rest?</p>
<hr>
<p>MSDN says:</p>
<ul>
<li><p><a href="https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assemblyversionattribute" rel="noreferrer">AssemblyVersion</a>:</p>
<blockquote>
<p>Specifies the version of the assembly being attributed. </p>
</blockquote></li>
<li><p><a href="https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assemblyfileversionattribute" rel="noreferrer">AssemblyFileVersion</a>:</p>
<blockquote>
<p>Instructs a compiler to use a specific version number for the Win32 file version resource. The Win32 file version is not required to be the same as the assembly's version number. </p>
</blockquote></li>
<li><p><a href="https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assemblyinformationalversionattribute" rel="noreferrer">AssemblyInformationalVersion</a>:</p>
<blockquote>
<p>Defines additional version information for an assembly manifest. </p>
</blockquote></li>
</ul>
<hr>
<p><em>This is a follow-up to <a href="https://stackoverflow.com/questions/62353/what-are-the-best-practices-for-using-assembly-attributes">What are the best practices for using Assembly Attributes?</a></em></p>
| [
{
"answer_id": 64634,
"author": "Bob King",
"author_id": 6897,
"author_profile": "https://Stackoverflow.com/users/6897",
"pm_score": 5,
"selected": false,
"text": "AssemblyVersion"
},
{
"answer_id": 64642,
"author": "Scott Dorman",
"author_id": 1559,
"author_profile":... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64602",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2361/"
] |
64,605 | <p>Is it possible to use both JScript and VBScript in the same HTA? Can I call VBScript functions from JScript and vice-versa? Are there any "gotchas," like the JScript running first and the VBScript running second (classic ASP pages have this issue).</p>
| [
{
"answer_id": 64638,
"author": "Mark Brackett",
"author_id": 2199,
"author_profile": "https://Stackoverflow.com/users/2199",
"pm_score": 5,
"selected": true,
"text": "<script language=\"javascript\">\n // javascript code\n</script>\n\n<script language=\"vbscript\">\n ' vbscript code... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64605",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5616/"
] |
64,631 | <p>I know next to nothing when it comes to the how and why of https connections. Obviously, when I'm transmitting secure data like passwords or especially credit card information, https is a critical tool. What do I need to know about it, though? What are the most common mistakes you see developers making when they implement it in their projects? Are there times when https is just a bad idea? Thanks!</p>
| [
{
"answer_id": 210279,
"author": "JSchaefer",
"author_id": 3676,
"author_profile": "https://Stackoverflow.com/users/3676",
"pm_score": 0,
"selected": false,
"text": "<link>"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/64631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
64,639 | <p>What's the proper way to convert from a scientific notation string such as "1.234567E-06" to a floating point variable using C#?</p>
| [
{
"answer_id": 64662,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 7,
"selected": true,
"text": "Double.Parse(\"1.234567E-06\", System.Globalization.NumberStyles.Float);\n"
},
{
"answer_id": 221197,
"author": "Jay... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64639",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2488/"
] |
64,640 | <p>Someone please correct me if I'm wrong, but parsing a yyyy/MM/dd (or other specific formats) dates in C# <strong>should</strong> be as easy as </p>
<pre><code>DateTime.ParseExact(theDate, "yyyy/MM/dd");
</code></pre>
<p>but no, C# forces you to create an IFormatProvider.</p>
<p>Is there an app.config friendly way of setting this so I don't need to do this each time?</p>
<pre><code>DateTime.ParseExact(theDate, "yyyy/MM/dd", new CultureInfo("en-CA", true));
</code></pre>
| [
{
"answer_id": 64675,
"author": "John Sheehan",
"author_id": 1786,
"author_profile": "https://Stackoverflow.com/users/1786",
"pm_score": 2,
"selected": false,
"text": "public static DateTime ParseExactDateTime(this string dateString, string formatString) {\n return DateTime.ParseExact... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64640",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7311/"
] |
64,645 | <p>I have an interface that I have defined in C++ which now needs to be implemented in C#. What is the best way to go about this? I don't want to use COM at all in my interface definition. The way I have solved this right now is to to have two interface definitions, one in C++ and one in C#. I then expose the C# interfaces as a COM server. This was my application which is written in C++ can call into C#. Is there anyway I can avoid having to define my implementation in C++ as well as C#?</p>
| [
{
"answer_id": 66930,
"author": "mlbrock",
"author_id": 9966,
"author_profile": "https://Stackoverflow.com/users/9966",
"pm_score": 0,
"selected": false,
"text": "public __gc class MyClass_Net {\npublic:\n MyClass_Net()\n :native_ptr_(new MyClass())\n {\n }\n ~MyClass_Net()\... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64645",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8661/"
] |
64,649 | <p>If I issue the <a href="https://en.wikipedia.org/wiki/Find_(Unix)" rel="noreferrer">find</a> command as follows:</p>
<pre><code>find . -name *.ear
</code></pre>
<p>It prints out:</p>
<pre><code>./dir1/dir2/earFile1.ear
./dir1/dir2/earFile2.ear
./dir1/dir3/earFile1.ear
</code></pre>
<p>I want to 'print' the name and the size to the command line:</p>
<pre><code>./dir1/dir2/earFile1.ear 5000 KB
./dir1/dir2/earFile2.ear 5400 KB
./dir1/dir3/earFile1.ear 5400 KB
</code></pre>
| [
{
"answer_id": 64666,
"author": "Jeremy Weathers",
"author_id": 8794,
"author_profile": "https://Stackoverflow.com/users/8794",
"pm_score": 0,
"selected": false,
"text": "find . -name \"*.ear\" -exec ls -l {} \\;\n"
},
{
"answer_id": 64678,
"author": "Yaba",
"author_id": ... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/700/"
] |
64,653 | <p>I am trying to delete several rows from a MySQL 5.0.45 database:</p>
<pre><code>delete from bundle_inclusions;
</code></pre>
<p>The client works for a while and then returns the error:</p>
<pre><code>Lock wait timeout exceeded; try restarting transaction
</code></pre>
<p>It's possible there is some uncommitted transaction out there that has a lock on this table, but I need this process to trump any such locks. How do I break the lock in MySQL?</p>
| [
{
"answer_id": 10704454,
"author": "Lars Bohl",
"author_id": 438960,
"author_profile": "https://Stackoverflow.com/users/438960",
"pm_score": 3,
"selected": false,
"text": "innodb_lock_wait_timeout = 50\n"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/64653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8344/"
] |
64,689 | <p>Is this function declaration in C#:</p>
<pre><code>void foo(string mystring)
</code></pre>
<p>the same as this one in C:</p>
<pre><code>void foo(char *)
</code></pre>
<p>i.e. In C#, does the called function receive a pointer behind the scenes?</p>
| [
{
"answer_id": 64713,
"author": "user7116",
"author_id": 7116,
"author_profile": "https://Stackoverflow.com/users/7116",
"pm_score": 5,
"selected": true,
"text": "void foo(const char *);\n"
},
{
"answer_id": 64727,
"author": "David Thibault",
"author_id": 5903,
"autho... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1463/"
] |
64,693 | <p>Theres is a little problem I want to solve with Haskell:
let substitute a function that change all of the wildcards in a string for one concrete parameter. The function has de signature of:</p>
<pre><code>subs :: String -> String -> String -> String
-- example:
-- subs 'x' "x^3 + x + sin(x)" "6.2" will generate
-- "6.2^3 + 6.2 + sin(6.2)"
</code></pre>
| [
{
"answer_id": 65479,
"author": "Dan Dyer",
"author_id": 5171,
"author_profile": "https://Stackoverflow.com/users/5171",
"pm_score": 4,
"selected": true,
"text": "import Text.Regex(mkRegex, subRegex)\n\nsubs :: String -> String -> String -> String\nsubs wildcard input value = subRegex (m... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64693",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6766/"
] |
64,723 | <p>What is a <strong>non recursive</strong> algorithm for deciding whether a passed in amount can be built additively from a set of numbers.<br>
In my case I'm determining whether a certain currency amount (such as $40) can be met by adding up some combination of a set of bills (such as $5, $10 and $20 bills). That is a simple example, but the algorithm needs to work for any currency set (some currencies use funky bill amounts and some bills may not be available at a given time).<br>
So $50 can be met with a set of ($20 and $30), but cannot be met with a set of ($20 and $40). The non-recursive requirement is due to the target code base being for <code>SQL Server 2000</code> where the support of recursion is limited.<br>
In addition this is for supporting a multi currency environment where the set of bills available may change (think a foreign currency exchange teller for example).</p>
| [
{
"answer_id": 64864,
"author": "seanyboy",
"author_id": 1726,
"author_profile": "https://Stackoverflow.com/users/1726",
"pm_score": 2,
"selected": false,
"text": "Denominations = [10,20,50,100]\nRequired = 570\n\nDenominations = sort(Denominations)\niBase = integer (Required / Denominat... | 2008/09/15 | [
"https://Stackoverflow.com/questions/64723",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8852/"
] |
64,745 | <p>Coming from <code>J2ME</code> programming are there any similarities that would make it easy to adapt to <code>Android API</code>. Or is <code>Android API</code> completely different from the <code>J2ME</code> way of programming mobile apps. </p>
| [
{
"answer_id": 539260,
"author": "haseman",
"author_id": 62516,
"author_profile": "https://Stackoverflow.com/users/62516",
"pm_score": 4,
"selected": false,
"text": "postInvalidate"
}
] | 2008/09/15 | [
"https://Stackoverflow.com/questions/64745",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.