qid
int64
4
22.2M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
82,550
<p>I have a template class that I serialize (call it C), for which I want to specify a version for boost serialization. As BOOST_CLASS_VERSION does not work for template classes. I tried this:</p> <pre><code>namespace boost { namespace serialization { template&lt; typename T, typename U &gt; struct version&lt; C&lt;T,U&gt; &gt; { typedef mpl::int_&lt;1&gt; type; typedef mpl::integral_c_tag tag; BOOST_STATIC_CONSTANT(unsigned int, value = version::type::value); }; } } </code></pre> <p>but it does not compile. Under VC8, a subsequent call to BOOST_CLASS_VERSION gives this error:</p> <p><code>error C2913: explicit specialization; 'boost::serialization::version' is not a specialization of a class template</code></p> <p>What is the correct way to do it?</p>
[ { "answer_id": 83616, "author": "James Hopkin", "author_id": 11828, "author_profile": "https://Stackoverflow.com/users/11828", "pm_score": 5, "selected": true, "text": "#include <boost/serialization/version.hpp>\n" }, { "answer_id": 37660167, "author": "dlabs", "author_id...
2008/09/17
[ "https://Stackoverflow.com/questions/82550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14443/" ]
82,607
<p>I get DNS records from a Python program, using <a href="http://www.dnspython.org/" rel="nofollow noreferrer">DNS Python</a></p> <p>I can get various DNSSEC-related records:</p> <pre><code>&gt;&gt;&gt; import dns.resolver &gt;&gt;&gt; myresolver = dns.resolver.Resolver() &gt;&gt;&gt; myresolver.use_edns(1, 0, 1400) &gt;&gt;&gt; print myresolver.query('sources.org', 'DNSKEY') &lt;dns.resolver.Answer object at 0xb78ed78c&gt; &gt;&gt;&gt; print myresolver.query('ripe.net', 'NSEC') &lt;dns.resolver.Answer object at 0x8271c0c&gt; </code></pre> <p>But no RRSIG records:</p> <pre><code>&gt;&gt;&gt; print myresolver.query('sources.org', 'RRSIG') Traceback (most recent call last): File "&lt;stdin&gt;", line 1, in &lt;module&gt; File "/usr/lib/python2.5/site-packages/dns/resolver.py", line 664, in query answer = Answer(qname, rdtype, rdclass, response) File "/usr/lib/python2.5/site-packages/dns/resolver.py", line 121, in __init__ raise NoAnswer </code></pre> <p>I tried several signed domains like absolight.fr or ripe.net.</p> <p>Trying with dig, I see that there are indeed RRSIG records.</p> <p>Checking with tcpdump, I can see that DNS Python sends the correct query and receives correct replies (here, eight records):</p> <pre><code>16:09:39.342532 IP 192.134.4.69.53381 &gt; 192.134.4.162.53: 22330+ [1au] RRSIG? sources.org. (40) 16:09:39.343229 IP 192.134.4.162.53 &gt; 192.134.4.69.53381: 22330 8/5/6 RRSIG[|domain] </code></pre> <p>DNS Python 1.6.0 - Python 2.5.2 (r252:60911, Aug 8 2008, 09:22:44) [GCC 4.3.1] on linux2</p>
[ { "answer_id": 82868, "author": "Cetra", "author_id": 15087, "author_profile": "https://Stackoverflow.com/users/15087", "pm_score": 0, "selected": false, "text": "print myresolver.query('sources.org', 'ANY', 'RRSIG')\n" }, { "answer_id": 84448, "author": "bortzmeyer", "au...
2008/09/17
[ "https://Stackoverflow.com/questions/82607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15625/" ]
82,612
<p>How can I figure out, how many files needs to be recompiled <em>before</em> I start the build process.</p> <p>Sometimes I don't remember how many basic header files I changed so a Rebuild All would be better than a simple build. There seams to be no option for this, but IMHO it must be possible (f.e. XCode give me this information).</p> <p><strong>Update:</strong></p> <p>My problem is not, that Visual Studio doesn't know what to compile. I need to know how much it <em>will</em> compile so that I can decide if I can make a quick test with my new code or if I should write more code till I start the "expensive" build process. Or if my boss ask "When can I have the new build?" the best answer is not "It is done when it is done!".</p> <p>It's really helpful when the IDE can say <em>"compile 200 of 589 files"</em> instead of <em>"compile x,y, ..."</em></p>
[ { "answer_id": 82868, "author": "Cetra", "author_id": 15087, "author_profile": "https://Stackoverflow.com/users/15087", "pm_score": 0, "selected": false, "text": "print myresolver.query('sources.org', 'ANY', 'RRSIG')\n" }, { "answer_id": 84448, "author": "bortzmeyer", "au...
2008/09/17
[ "https://Stackoverflow.com/questions/82612", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15757/" ]
82,645
<p>By default tomcat will create a session cookie for the current domain.</p> <p>If you are on www.example.com, your cookie will be created for www.example.com (will only work on www.example.com). Whereas for example.com it will be created for .example.com (desired behaviour, will work on any subdomain of example.com as well as example.com itself).</p> <p>I've seen a few Tomcat valves which seem to intercept the creation of session cookies and create a replacement cookie with the correct .example.com domain, however none of them seem to work flawlessly and they all appear to leave the existing cookie and just create a new one. This means that two JSESSIONID cookies are being sent with each request.</p> <p>I was wondering if anybody has a definitive solution to this problem.</p>
[ { "answer_id": 633468, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "configureSessionCookie(Cookie cookie)\n" }, { "answer_id": 2902605, "author": "Jason Butler", "author_id": 349...
2008/09/17
[ "https://Stackoverflow.com/questions/82645", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15687/" ]
82,653
<p>Is there any list of blog engines, written in Django?</p>
[ { "answer_id": 21028758, "author": "Akshar Raaj", "author_id": 839549, "author_profile": "https://Stackoverflow.com/users/839549", "pm_score": 1, "selected": false, "text": "django-blogango" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/82653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/70293/" ]
82,654
<p>I have seen examples of printing from a windows application but I have not been able to find a good example of any way of doing this. </p>
[ { "answer_id": 82741, "author": "Ilya Kochetov", "author_id": 15329, "author_profile": "https://Stackoverflow.com/users/15329", "pm_score": 0, "selected": false, "text": "window.print()" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/82654", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12255/" ]
82,661
<p>I want to clear the list of projects on the start page...how do I do this? I know I can track it down in the registry, but is there an approved route to go?</p>
[ { "answer_id": 84797, "author": "Dusty Campbell", "author_id": 2174, "author_profile": "https://Stackoverflow.com/users/2174", "pm_score": 7, "selected": true, "text": "HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\<version>\\ProjectMRUList\n" }, { "answer_id": 31514199, ...
2008/09/17
[ "https://Stackoverflow.com/questions/82661", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15778/" ]
82,721
<p>In a SQL server database, I have a table which contains a TEXT field which is set to allow NULLs. I need to change this to not allow NULLs. I can do this no problem via Enterprise Manager, but when I try to run the following script, <strong>alter table dbo.[EventLog] Alter column [Message] text Not null</strong>, I get an error:</p> <p><em>Cannot alter column 'ErrorMessage' because it is 'text'.</em></p> <p>Reading SQL Books Online does indeed reveal you are not allow to do an ALTER COLUMN on TEXT fields. I really need to be able to do this via a script though, and not manually in Enterprise Manager. What are the options for doing this in script then?</p>
[ { "answer_id": 82862, "author": "Sixto Saez", "author_id": 9711, "author_profile": "https://Stackoverflow.com/users/9711", "pm_score": 3, "selected": true, "text": " /* To prevent any potential data loss issues, you should review this script in detail before running it outside the con...
2008/09/17
[ "https://Stackoverflow.com/questions/82721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7585/" ]
82,726
<p>If I open files I created in Windows, the lines all end with <code>^M</code>.<br /> How do I delete these characters all at once?</p>
[ { "answer_id": 82740, "author": "mercutio", "author_id": 1951, "author_profile": "https://Stackoverflow.com/users/1951", "pm_score": 4, "selected": false, "text": ":%s/\\r\\+//g\n" }, { "answer_id": 82742, "author": "Rob Wells", "author_id": 2974, "author_profile": "h...
2008/09/17
[ "https://Stackoverflow.com/questions/82726", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15482/" ]
82,814
<p>The following code is causing an intermittent crash on a Vista machine.</p> <pre><code>using (SoundPlayer myPlayer = new SoundPlayer(Properties.Resources.BEEPPURE)) myPlayer.Play(); </code></pre> <p>I highly suspect it is this code because the program crashes mid-beep or just before the beep is played every time. I have top-level traps for all <code>ThreadExceptions</code>, <code>UnhandledExceptions</code> in my app domain, and a <code>try-catch</code> around <code>Application.Run</code>, none of which trap this crash.</p> <p>Any ideas?</p> <hr> <p>EDIT:</p> <p>The Event Viewer has the following information:</p> <blockquote> <p>Faulting application [xyz].exe, version 4.0.0.0, time stamp 0x48ce5a74, faulting module msvcrt.dll, version 7.0.6001.18000, time stamp 0x4791a727, exception code 0xc0000005, fault offset 0x00009b30, process id 0x%9, application start time 0x%10.</p> </blockquote> <p>Interestingly, the <code>HRESULT 0xc0000005</code> has the message: </p> <blockquote> <p>"Reading or writing to an inaccessible memory location." (STATUS_ACCESS_VIOLATION)</p> </blockquote>
[ { "answer_id": 163516, "author": "MusiGenesis", "author_id": 14606, "author_profile": "https://Stackoverflow.com/users/14606", "pm_score": 0, "selected": false, "text": "using (SoundPlayer myPlayer = new SoundPlayer(BEEPPURE))\n{ \n myPlayer.Play();\n}\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/82814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1490/" ]
82,831
<p>How do I check whether a file exists or not, without using the <a href="https://docs.python.org/3.6/reference/compound_stmts.html#try" rel="noreferrer"><code>try</code></a> statement?</p>
[ { "answer_id": 82836, "author": "Paul", "author_id": 215086, "author_profile": "https://Stackoverflow.com/users/215086", "pm_score": 10, "selected": false, "text": "import os\n\nif os.path.isfile(filepath):\n print(\"File exists\")\n" }, { "answer_id": 82841, "author": "ben...
2008/09/17
[ "https://Stackoverflow.com/questions/82831", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15616/" ]
82,847
<p>If I am in a function in the code behind, and I want to implement displaying a "Loading..." in the status bar the following makes sense, but as we know from WinForms is a NoNo:</p> <pre><code>StatusBarMessageText.Text = "Loading Configuration Settings..."; LoadSettingsGridData(); StatusBarMessageText.Text = "Done"; </code></pre> <p>What we all now from WinForms Chapter 1 class 101, is the form won't display changes to the user until after the Entire Function completes... meaning the "Loading" message will never be displayed to the user. The following code is needed.</p> <pre><code>Form1.SuspendLayout(); StatusBarMessageText.Text = "Loading Configuration Settings..."; Form1.ResumeLayout(); LoadSettingsGridData(); Form1.SuspendLayout(); StatusBarMessageText.Text = "Done"; Form1.ResumeLayout(); </code></pre> <p>What is the best practice for dealing with this fundamental issue in WPF?</p>
[ { "answer_id": 83216, "author": "Abe Heidebrecht", "author_id": 9268, "author_profile": "https://Stackoverflow.com/users/9268", "pm_score": -1, "selected": false, "text": "StatusBarMessageText.Text = \"Loading Configuration Settings...\";\nthis.Dispatcher.BeginInvoke(new Action(LoadSetti...
2008/09/17
[ "https://Stackoverflow.com/questions/82847", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2744/" ]
82,872
<p>I have a old website that generate its own RSS everytime a new post is created. Everything worked when I was on a server with PHP 4 but now that the host change to PHP 5, I always have a "bad formed XML". I was using xml_parser_create() and xml_parse(...) and fwrite(..) to save everything.</p> <p>Here is the example when saving (I read before save to append old RSS line of course).</p> <pre><code>function SaveXml() { if (!is_file($this-&gt;getFileName())) { //Création du fichier $file_handler = fopen($this-&gt;getFileName(),"w"); fwrite($file_handler,""); fclose($file_handler); }//Fin du if //Header xml version="1.0" encoding="utf-8" $strFileData = '&lt;?xml version="1.0" encoding="iso-8859-1" ?&gt;&lt;rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"&gt;&lt;channel&gt;&lt;title&gt;'.$this-&gt;getProjectName().'&lt;/title&gt;&lt;link&gt;http://www.mywebsite.com&lt;/link&gt;&lt;description&gt;My description&lt;/description&gt;&lt;lastBuildDate&gt;' . date("r"). '&lt;/lastBuildDate&gt;'; //Data reset($this-&gt;arrData); foreach($this-&gt;arrData as $i =&gt; $value) { $strFileData .= '&lt;item&gt;'; $strFileData .= '&lt;title&gt;'. $this-&gt;GetNews($i,0) . '&lt;/title&gt;'; $strFileData .= '&lt;pubDate&gt;'. $this-&gt;GetNews($i,1) . '&lt;/pubDate&gt;'; $strFileData .= '&lt;dc:creator&gt;'. $this-&gt;GetNews($i,2) . '&lt;/dc:creator&gt;'; $strFileData .= '&lt;description&gt;&lt;![CDATA['. $this-&gt;GetNews($i,3) . ']]&gt; &lt;/description&gt;'; $strFileData .= '&lt;link&gt;&lt;![CDATA['. $this-&gt;GetNews($i,4) . ']]&gt;&lt;/link&gt;'; $strFileData .= '&lt;guid&gt;'. $this-&gt;GetNews($i,4) . '&lt;/guid&gt;'; //$strFileData .= '&lt;category&gt;'. $this-&gt;GetNews($i,5) . '&lt;/category&gt;'; $strFileData .= '&lt;category&gt;Mycategory&lt;/category&gt;'; $strFileData .= '&lt;/item&gt;'; }//Fin du for i $strFileData .= '&lt;/channel&gt;&lt;/rss&gt;'; if (file_exists($this-&gt;getFileName()))//Détruit le fichier unlink($this-&gt;getFileName()); $file_handler = fopen($this-&gt;getFileName(),"w"); fwrite($file_handler,$strFileData); fclose($file_handler); }//Fin de SaveXml </code></pre> <p>My question is : how do you create and fill up your RSS in PHP?</p>
[ { "answer_id": 82904, "author": "Andrew Taylor", "author_id": 1776, "author_profile": "https://Stackoverflow.com/users/1776", "pm_score": 0, "selected": false, "text": "SimpleXML" }, { "answer_id": 84601, "author": "Veynom", "author_id": 11670, "author_profile": "http...
2008/09/17
[ "https://Stackoverflow.com/questions/82872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13913/" ]
82,875
<p>What SQL can be used to list the tables, and the rows within those tables in an SQLite database file - once I have attached it with the <code>ATTACH</code> command on the SQLite 3 command line tool?</p>
[ { "answer_id": 82889, "author": "Lasse V. Karlsen", "author_id": 267, "author_profile": "https://Stackoverflow.com/users/267", "pm_score": 9, "selected": false, "text": "SELECT * FROM dbname.sqlite_master WHERE type='table';\n" }, { "answer_id": 82899, "author": "Mark Janssen...
2008/09/17
[ "https://Stackoverflow.com/questions/82875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/974/" ]
82,881
<p>Lets say I have a Dictionary object:</p> <pre><code>Dictionary myDictionary&lt;int, SomeObject&gt; = new Dictionary&lt;string, SomeObject&gt;(); </code></pre> <p>Now I want to iterate through the dictionary in reverse order. I can't use a simple for loop because I don't know the keys of the dictionary. A <em>foreach</em> is easy:</p> <pre><code>foreach (SomeObject object in myDictionary.Values) { // Do stuff to object } </code></pre> <p>But how can I perform this in reverse?</p>
[ { "answer_id": 82925, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "Dictionary<int, SomeObject> myDictionary" }, { "answer_id": 82927, "author": "Chris Wenham", "author_id": 5548,...
2008/09/17
[ "https://Stackoverflow.com/questions/82881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2273/" ]
82,914
<p>I don't think this is possible just using the color setting in SpriteBatch, so I'm trying to work out a simple shader that would take every pixel and make it white, while respecting the alpha value of the pixel.</p> <p>The answer Joel Martinez gave looks right, but how do I incorporate that when I draw the sprite with SpriteBatch?</p>
[ { "answer_id": 83306, "author": "Joel Martinez", "author_id": 5416, "author_profile": "https://Stackoverflow.com/users/5416", "pm_score": 2, "selected": false, "text": "sampler2D baseMap;\n\nstruct PS_INPUT \n{\n float2 Texcoord : TEXCOORD0;\n\n};\n\nfloat4 ps_main( PS_INPUT Input ) : ...
2008/09/17
[ "https://Stackoverflow.com/questions/82914", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11911/" ]
82,929
<p>I have a PHP application that displays a list of options to a user. The list is generated from a simple query against SQL 2000. What I would like to do is have a specific option at the top of the list, and then have the remaining options sorted alphabetically.</p> <p>For example, here's the options if sorted alphabetically: </p> <pre><code>Calgary Edmonton Halifax Montreal Toronto </code></pre> <p>What I would like the list to be is more like this: </p> <pre><code>**Montreal** Calgary Edmonton Halifax Toronto </code></pre> <p>Is there a way that I can do this using a single query? Or am I stuck running the query twice and appending the results?</p>
[ { "answer_id": 82944, "author": "mercutio", "author_id": 1951, "author_profile": "https://Stackoverflow.com/users/1951", "pm_score": 2, "selected": false, "text": "SELECT name FROM options ORDER BY name = \"Montreal\", name;\n" }, { "answer_id": 82955, "author": "Garry Shutle...
2008/09/17
[ "https://Stackoverflow.com/questions/82929", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37/" ]
82,943
<p>Is it possible in c# to initialize an array in, for example, subindex 1?</p> <p>I'm working with Office interop, and every property is an object array that starts in 1 (I assume it was originally programed in VB.NET), and you cannot modify it, you have to set the entire array for it to accept the changes.</p> <p>As a workaround I am cloning the original array, modifying that one, and setting it as a whole when I'm done.</p> <p>But, I was wondering if it was possible to create a new non-zero based array</p>
[ { "answer_id": 82987, "author": "expedient", "author_id": 4248, "author_profile": "https://Stackoverflow.com/users/4248", "pm_score": 4, "selected": true, "text": "Array.CreateInstance" }, { "answer_id": 83022, "author": "xan", "author_id": 15667, "author_profile": "h...
2008/09/17
[ "https://Stackoverflow.com/questions/82943", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1782/" ]
82,949
<p>I'm trying to preform setup and teardown for a set of integration tests, using jUnit 4.4 to execute the tests. The teardown needs to be run reliably. I'm having other problems with TestNG, so I'm looking to port back to jUnit. What hooks are available for execution before any tests are run and after all tests have completed?</p> <p>Note: we're using maven 2 for our build. I've tried using maven's <code>pre-</code> &amp; <code>post-integration-test</code> phases, but, if a test fails, maven stops and doesn't run <code>post-integration-test</code>, which is no help.</p>
[ { "answer_id": 83223, "author": "Jroc", "author_id": 12200, "author_profile": "https://Stackoverflow.com/users/12200", "pm_score": 3, "selected": false, "text": "import org.junit.*;\nimport static org.junit.Assert.*;\nimport java.util.*;\n\nclass SomethingUnitTest {\n @BeforeClass\n ...
2008/09/17
[ "https://Stackoverflow.com/questions/82949", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4893/" ]
82,971
<p>Is it possible to configure Visual Studio 2008 to automatically remove whitespace characters at the end of each line when saving a file? There doesn't seem to be a built-in option, so are there any extensions available to do this?</p>
[ { "answer_id": 83043, "author": "oglester", "author_id": 2017, "author_profile": "https://Stackoverflow.com/users/2017", "pm_score": 6, "selected": false, "text": ":Zs#$" }, { "answer_id": 698243, "author": "Community", "author_id": -1, "author_profile": "https://Stac...
2008/09/17
[ "https://Stackoverflow.com/questions/82971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3853/" ]
82,981
<p>The problem is that I have several "h2" tags that have a <code>display:inline</code> attribute, and on Microsoft's wonderful browsers the space between them doesn't appear. Is there a workaround?</p> <p>I know there is a "non-breaking space" <code>&amp;nbsp;</code> in HTML but I was wondering if one can make a space that may be a "breaking space".</p> <p>--- edit ---</p> <p>The website is <a href="http://newstoday.ro" rel="nofollow noreferrer">http://newstoday.ro</a> and the behaviour is in the footer. If the site is opened in IE the list is continuous, even though there is a space between the words. Please don't comment the rest of the code as I am just the plumber in this situation. Also there is a must for the headings as the client thinks it is better for SEO.</p>
[ { "answer_id": 83032, "author": "Chris Marasti-Georg", "author_id": 96, "author_profile": "https://Stackoverflow.com/users/96", "pm_score": 0, "selected": false, "text": "<html>\n <head><title>Blah</title></head>\n <body>\n <h2 style=\"display:inline;\">Something</h2>\n ...
2008/09/17
[ "https://Stackoverflow.com/questions/82981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3718/" ]
82,993
<p>We need to programatically burn files to CD in a C\C++ Windows XP/Vista application we are developing using Borlands Turbo C++.</p> <p>What is the simplest and best way to do this? We would prefer a native windows API (that doesnt rely on MFC) so as not to rely on any third party software/drivers if one is available.</p>
[ { "answer_id": 85166, "author": "selwyn", "author_id": 16314, "author_profile": "https://Stackoverflow.com/users/16314", "pm_score": 5, "selected": true, "text": "#include <stdio.h>\n#include <imapi.h>\n#include <windows.h>\n\nstruct MEDIAINFO {\n BYTE nSessions;\n BYTE nLastTrack;...
2008/09/17
[ "https://Stackoverflow.com/questions/82993", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14260/" ]
83,009
<p>I'm currently using <a href="http://www.usysware.com/dpack/" rel="noreferrer">DPack</a> as this adds a "Collapse All Projects" option to the Solution node in Solution Explorer. It works pretty well but can take a while to execute and doesn't always collapse everything fully.</p> <p>Are there any better alternatives? Preferably free and easy to install/setup. There are lots out there but which work best and don't have any bugs or performance issues.</p>
[ { "answer_id": 267394, "author": "Mario", "author_id": 472, "author_profile": "https://Stackoverflow.com/users/472", "pm_score": 2, "selected": false, "text": "regpkg CoolCommands.dll /codebase\n" }, { "answer_id": 2340496, "author": "Tom Robinson", "author_id": 12124, ...
2008/09/17
[ "https://Stackoverflow.com/questions/83009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12124/" ]
83,038
<p>When supplying dates to a stored procedure via a parameter I'm a little confused over which format to use for the dates. My original VBA syntax used the ADO Connection object to execute the stored procedure:</p> <pre><code>Set SentDetailRS = Me.ADOConnectionToIntegrity.Execute("dbo.s_SelectAggregatedSentDetailList '" &amp; fCSQLDate(EffectiveDate) &amp; "'", , adCmdText) </code></pre> <p>This works fine for me using the date syntax <code>yyyy-mm-dd</code> but when another user executes the code they recieve the error: 13 'Type Mismatch'. </p> <p>After some experimentation I found that supplying the date in the format <code>dd/mm/yyyy</code> fixes this error for the user but now gives me the error! </p> <p>Executing the stored procedure using a command object with parameters works regardless of the format of the date (I assume ADO is taking care of the formatting behind the scenes). I thought that using the format <code>yyyy-mm-dd</code> would work universally with SQL Server? </p> <p>I'm also perplexed as to why this problem appears to be user specific? I noticed that my default language on SQL Server is 'English' whereas the other user's default language is 'British English', could that cause the problem? </p> <p>I'm using ADO 2.8 with Access 2003 and SQL Server 2000, SQL Server login is via Windows integrated security.</p>
[ { "answer_id": 83489, "author": "Philippe Grondier", "author_id": 11436, "author_profile": "https://Stackoverflow.com/users/11436", "pm_score": 2, "selected": true, "text": "Public function SQLdateFormat(x_date) as string\n\nSQLDateFormat = _\n trim(str(datePart(\"yyyy\",x_date))) & _\...
2008/09/17
[ "https://Stackoverflow.com/questions/83038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
83,040
<p>How do I connect to a remote Oracle database instance from PHP?</p> <p>I need to query (read only) the remote Oracle database for some information; do I need to have an Oracle Instant Client installed?</p> <p>Is the OCI extension for PHP enough?</p>
[ { "answer_id": 83115, "author": "Jroc", "author_id": 12200, "author_profile": "https://Stackoverflow.com/users/12200", "pm_score": 2, "selected": false, "text": "\n odbc_connect($dsn,$user,$pass);\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/83040", "https://Stackoverflow.com", "https://Stackoverflow.com/users/67775/" ]
83,045
<p>I have a costumer showing Notepad with a large set of data that looks totally misaligned if word wrap is on and I want to force it off. Is there a command switch to do this?</p>
[ { "answer_id": 83127, "author": "Cetra", "author_id": 15087, "author_profile": "https://Stackoverflow.com/users/15087", "pm_score": 3, "selected": true, "text": "Hive: HKEY_CURRENT_USER\nKey: SOFTWARE\\Microsoft\\Notepad\nName: fWrap\nType: REG_DWORD\nValue: 0\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/83045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9077/" ]
83,050
<p>I had this question in mind and since I just discovered this site I decided to post it here.</p> <p>Let's say I have a table with a timestamp and a state for a given "object" (generic meaning, not OOP object); is there an optimal way to calculate the time between a state and the next occurrence of another (or same) state (what I call a "trip") with a single SQL statement (inner SELECTs and UNIONs aren't counted)?</p> <p>Ex: For the following, the trip time between Initial and Done would be 6 days, but between Initial and Review it would be 2 days. </p> <blockquote> <p>2008-08-01 13:30:00 - Initial<br> 2008-08-02 13:30:00 - Work<br> 2008-08-03 13:30:00 - Review<br> 2008-08-04 13:30:00 - Work<br> 2008-08-05 13:30:00 - Review<br> 2008-08-06 13:30:00 - Accepted<br> 2008-08-07 13:30:00 - Done</p> </blockquote> <p>No need to be generic, just say what <a href="https://stackoverflow.com/questions/980813/what-is-sgbd">SGBD</a> your solution is specific to if not generic.</p>
[ { "answer_id": 83234, "author": "Andy Irving", "author_id": 8553, "author_profile": "https://Stackoverflow.com/users/8553", "pm_score": 0, "selected": false, "text": "CREATE TABLE #testing\n(\n eventdatetime datetime NOT NULL,\n state varchar(10) NOT NULL\n)\n\nINSERT INTO #testing...
2008/09/17
[ "https://Stackoverflow.com/questions/83050", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15805/" ]
83,058
<p>I have a <code>rails</code> application which is still showing the cachebusting numeric string at the end of the URL for static mode, even though I have put it into the production environment. Can someone tell me what config option I need to set to prevent this behaviour...</p>
[ { "answer_id": 83363, "author": "Dave Cheney", "author_id": 6449, "author_profile": "https://Stackoverflow.com/users/6449", "pm_score": 2, "selected": false, "text": "ENV['RAILS_ASSET_ID'] = ''\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/83058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7473/" ]
83,068
<p>I've got a load-balanced (not using Session state) ASP.Net 2.0 app on IIS5 running back to a single Oracle 10g server, using version 10.1.0.301 of the ODAC/ODP.Net drivers. After a long period of inactivity (a few hours), the application, seemingly randomly, will throw an Oracle exception:</p> <blockquote> <p>Exception: ORA-03113: end-of-file on communication channel at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure) at Oracle.DataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior) at Oracle.DataAccess.Client.OracleCommand.System.Data.IDbCommand.ExecuteReader()</p> <p>...Oracle portion of the stack ends here...</p> </blockquote> <p>We are creating new connections on every request, have the open &amp; close wrapped in a try/catch/finally to ensure proper connection closure, and the whole thing is wrapped in a using (OracleConnection yadayada) {...} block. This problem does not appear linked to the restart of the ASP.Net application after being spun down for inactivity.</p> <p>We have yet to reproduce the problem ourselves. Thoughts, prayers, help?</p> <hr /> <p><strong>More:</strong> Checked with IT, the firewall isn't set to kill connections between those servers.</p>
[ { "answer_id": 91869, "author": "mathewbutler", "author_id": 2288, "author_profile": "https://Stackoverflow.com/users/2288", "pm_score": 5, "selected": true, "text": "SQLNET.EXPIRE_TIME" }, { "answer_id": 93802, "author": "Ken Wren", "author_id": 3430, "author_profile...
2008/09/17
[ "https://Stackoverflow.com/questions/83068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35/" ]
83,073
<p>It seems to be the <a href="https://stackoverflow.com/questions/82391/should-tables-be-avoided-in-html-at-any-cost#82402">general opinion</a> that tables should not be used for layout in HTML. </p> <p>Why?</p> <p>I have never (or rarely to be honest) seen good arguments for this. The usual answers are:</p> <ul> <li><p>It's good to <a href="https://stackoverflow.com/questions/82391/should-tables-be-avoided-in-html-at-any-cost#82422">separate content from layout</a><br>But this is a fallacious argument; <a href="http://www.don-lindsay-archive.org/skeptic/arguments.html#cliche" rel="nofollow noreferrer">Cliche Thinking</a>. I guess it's true that using the table element for layout has little to do with tabular data. So what? Does my boss care? Do my users care?<br><br>Perhaps me or my fellow developers who have to maintain a web page care... Is a table less maintainable? I think using a table is <a href="https://stackoverflow.com/questions/82391/should-tables-be-avoided-in-html-at-any-cost#82571">easier</a> than using divs and CSS.<br><br>By the way... why is using a div or a span good separation of content from layout and a table not? Getting a good layout with only divs often requires a lot of nested divs.</p></li> <li><p>Readability of the code<br>I think it's the other way around. Most people understand HTML, few understand CSS.</p></li> <li><p>It's better for SEO not to use tables<br>Why? Can anybody show some evidence that it is? Or a statement from Google that tables are discouraged from an SEO perspective?</p></li> <li><p>Tables are slower.<br>An extra tbody element has to be inserted. This is peanuts for modern web browsers. Show me some benchmarks where the use of a table significantly slows down a page.</p></li> <li><p>A layout overhaul is easier without tables, see <a href="http://csszengarden.com/" rel="nofollow noreferrer">css Zen Garden</a>.<br>Most web sites that need an upgrade need new content (HTML) as well. Scenarios where a new version of a web site only needs a new CSS file are not very likely. Zen Garden is a nice web site, but a bit theoretical. Not to mention its <a href="https://stackoverflow.com/questions/83073/div-vs-table#83639">misuse</a> of CSS.</p></li> </ul> <p>I am really interested in good arguments to use divs + CSS instead of tables.</p>
[ { "answer_id": 83184, "author": "Grad van Horck", "author_id": 12569, "author_profile": "https://Stackoverflow.com/users/12569", "pm_score": 2, "selected": false, "text": "<div id=\"sidebar\">" }, { "answer_id": 83201, "author": "Swati", "author_id": 12682, "author_pr...
2008/09/17
[ "https://Stackoverflow.com/questions/83073", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3565/" ]
83,093
<p>is there a solution for batch insert via hibernate in partitioned postgresql table? currently i'm getting an error like this...</p> <pre><code>ERROR org.hibernate.jdbc.AbstractBatcher - Exception executing batch: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1 at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:61) at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:46) at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:68).... </code></pre> <p>i have found this link <a href="http://lists.jboss.org/pipermail/hibernate-dev/2007-October/002771.html" rel="nofollow noreferrer">http://lists.jboss.org/pipermail/hibernate-dev/2007-October/002771.html</a> but i can't find anywhere on the web is this problem solved or how it can be get around</p>
[ { "answer_id": 90031, "author": "alexguev", "author_id": 436199, "author_profile": "https://Stackoverflow.com/users/436199", "pm_score": 3, "selected": true, "text": " @Override\n protected void doExecuteBatch(PreparedStatement ps) throws SQLException, HibernateException {\n ...
2008/09/17
[ "https://Stackoverflow.com/questions/83093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15878/" ]
83,106
<p>How should widgets in GWT inform other widgets to refresh themselfs or perform some other action. </p> <p>Should I use sinkEvent / onBrowserEvent? And if so is there a way to create custom Events?</p>
[ { "answer_id": 86962, "author": "Alexandra Franks", "author_id": 16203, "author_profile": "https://Stackoverflow.com/users/16203", "pm_score": 2, "selected": false, "text": "Class newMessageHandler {\n void update(Widget caller, Widget subscriber) {\n ...\n }\n}\n\ncustomEve...
2008/09/17
[ "https://Stackoverflow.com/questions/83106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6482/" ]
83,117
<p>I have a layered application in Java which has a multi thread data access layer which is invoked from different points. A single call to this layer is likely to spawn several threads to parallelize requests to the DB. </p> <p>What I'm looking for is a logging tool that would allow me to define "activities" that are composed by various threads. Therefore, the same method in the data access layer should log different outputs depending on its caller. The ability to group different outputs to summarize the total cost of an operation is also important.</p> <p>Although the application is in Java, language is not a restriction; what I need are the design guidelines so to eventually implement it. We are currently using log4j, but can't get this behaviour from it.</p>
[ { "answer_id": 83245, "author": "Chris Mazzola", "author_id": 15816, "author_profile": "https://Stackoverflow.com/users/15816", "pm_score": 0, "selected": false, "text": "StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();\n" }, { "answer_id": 83513, "aut...
2008/09/17
[ "https://Stackoverflow.com/questions/83117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12791/" ]
83,132
<p>I thought I'd found the solution a while ago (see my <a href="https://tjrobinson.net/programming/technology/2006/09/03/cant-execute-code-from-a-freed-script.html" rel="noreferrer">blog</a>):</p> <blockquote> <p>If you ever get the JavaScript (or should that be JScript) error "Can't execute code from a freed script" - try moving any meta tags in the head so that they're before your script tags. </p> </blockquote> <p>...but based on one of the most recent blog comments, the fix I suggested may not work for everyone. I thought this would be a good one to open up to the StackOverflow community....</p> <p>What causes the error "Can't execute code from a freed script" and what are the solutions/workarounds?</p>
[ { "answer_id": 84300, "author": "Sjoerd Visscher", "author_id": 5852, "author_profile": "https://Stackoverflow.com/users/5852", "pm_score": 5, "selected": false, "text": "try\n{\n f();\n}\ncatch(e)\n{\n if (e.number == -2146823277)\n // f is no longer available\n ...\n}\n" }, ...
2008/09/17
[ "https://Stackoverflow.com/questions/83132", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12124/" ]
83,147
<p>I remember hearing <a href="http://en.wikipedia.org/wiki/Joel_Spolsky" rel="noreferrer">Joel Spolsky</a> mention in <a href="https://stackoverflow.fogbugz.com/default.asp?W4" rel="noreferrer">podcast 014</a> that he'd barely ever used a foreign key (if I remember correctly). However, to me they seem pretty vital to avoid duplication and subsequent data integrity problems throughout your database.</p> <p>Do people have some solid reasons as to why (to avoid a discussion in lines with Stack Overflow principles)?</p> <p><strong>Edit:</strong> <a href="https://stackoverflow.fogbugz.com/default.asp?W13086" rel="noreferrer"><em>"I've yet to have a reason to create a foreign key, so this might be my first reason to actually set up one."</em></a></p>
[ { "answer_id": 83470, "author": "hamishmcn", "author_id": 3590, "author_profile": "https://Stackoverflow.com/users/3590", "pm_score": 0, "selected": false, "text": "customer_type" }, { "answer_id": 83527, "author": "Powerlord", "author_id": 15880, "author_profile": "h...
2008/09/17
[ "https://Stackoverflow.com/questions/83147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3394/" ]
83,152
<p>Is there an open source library that will help me with reading/parsing PDF documents in .NET/C#?</p>
[ { "answer_id": 84410, "author": "ceetheman", "author_id": 16154, "author_profile": "https://Stackoverflow.com/users/16154", "pm_score": 6, "selected": false, "text": "using System;\nusing System.IO;\nusing iTextSharp.text.pdf;\nusing System.Text.RegularExpressions;\n\nnamespace Spider.Ut...
2008/09/17
[ "https://Stackoverflow.com/questions/83152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6777/" ]
83,156
<p>Ok, I have been working with Solaris for a 10+ years, and have never seen this...</p> <p>I have a directory listing which includes both a file and subdirectory with the same name:</p> <pre><code>-rw-r--r-- 1 root other 15922214 Nov 29 2006 msheehan drwxrwxrwx 12 msheehan sysadmin 2048 Mar 25 15:39 msheehan </code></pre> <p>I use file to discover contents of the file, and I get:</p> <pre><code>bash-2.03# file msheehan msheehan: directory bash-2.03# file msh* msheehan: ascii text msheehan: directory </code></pre> <p>I am not worried about the file, but I want to keep the directory, so I try rm:</p> <pre><code>bash-2.03# rm msheehan rm: msheehan is a directory </code></pre> <p>So here is my two part question:</p> <ol> <li>What's up with this?</li> <li>How do I carefully delete the file?</li> </ol> <p>Jonathan</p> <p>Edit: Thanks for the answers guys, both (so far) were helpful, but piping the listing to an editor did the trick, ala:</p> <pre><code>bash-2.03# ls -l &gt; jb.txt bash-2.03# vi jb.txt </code></pre> <p>Which contained:</p> <pre><code>-rw-r--r-- 1 root other 15922214 Nov 29 2006 msheehab^?n drwxrwxrwx 12 msheehan sysadmin 2048 Mar 25 15:39 msheehan </code></pre> <p>Always be careful with the backspace key!</p>
[ { "answer_id": 83224, "author": "Anthony Williams", "author_id": 5597, "author_profile": "https://Stackoverflow.com/users/5597", "pm_score": 0, "selected": false, "text": "cat msh*\n" }, { "answer_id": 83644, "author": "bltxd", "author_id": 11892, "author_profile": "h...
2008/09/17
[ "https://Stackoverflow.com/questions/83156", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8361/" ]
83,157
<p>I know there is no "right" heap size, but which heap size do you use in your applications (application type, jdk, os)?</p> <p>The JVM Options <code>-Xms</code> (initial/minimum) and <code>-Xmx</code> (maximum) allow for controlling the heap size. What settings make sense under which circumstances? When are the defaults appropriate?</p>
[ { "answer_id": 1508750, "author": "dogbane", "author_id": 7412, "author_profile": "https://Stackoverflow.com/users/7412", "pm_score": 1, "selected": false, "text": "-Xms250M -Xmx1500M -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC \n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/83157", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1961117/" ]
83,159
<p>Some API returns me XmlCursor pointing on root of XML Document. I need to insert all of this into another org.w3c.DOM represented document.</p> <p>At start: XmlCursor poiting on <code></p> <p>&lt;a&gt; &lt;b&gt; some text &lt;/b&gt; &lt;/a&gt; </code></p> <p>DOM Document: <code></p> <p>&lt;foo&gt;</p> <p>&lt;/foo&gt; </code></p> <p>At the end I want to have original DOM document changed like this: <code></p> <p>&lt;foo&gt;</p> <p>&nbsp;&nbsp;&lt;someOtherInsertedElement&gt;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;a&gt; &lt;b&gt; some text &lt;/b&gt; &lt;/a&gt;</p> <p>&nbsp;&nbsp;&lt;/someOtherInsertedElement&gt;</p> <p>&lt;/foo&gt; </code></p> <p>NOTE: <code>document.importNode(cursor.getDomNode())</code> doesn't work - Exception is thrown: <em>NOT_SUPPORTED_ERR: The implementation does not support the requested type of object or operation.</em></p>
[ { "answer_id": 83256, "author": "Sietse", "author_id": 6400, "author_profile": "https://Stackoverflow.com/users/6400", "pm_score": 4, "selected": true, "text": "Node originalNode = cursor.getDomNode();\nNode importNode = document.importNode(originalNode.getFirstChild());\nNode otherNode ...
2008/09/17
[ "https://Stackoverflow.com/questions/83159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1128722/" ]
83,172
<p>We are using a Sony SNC-RZ30N IP-based webcam to monitor osprey nests and would like to stream the video feed via our own webserver.</p> <p>Rather than use the built-in webserver of the camera (which requires either ActiveX or Java on the client side) to display the live feed, I would like to weed out just the live feed and display it on our campus webserver (Win2k8/IIS7). Perhaps in an iFrame or the like. </p> <p>Unfortunately, documentation for anything other than FTP'ing a static image snapshot from this camera seems to be pretty much non-existent.</p> <p>There are other "video surveillance" packages (ie: ProSight SMB) that will feed up a web page with the live feed on their own built-in webservers (along with controls to position the camera, which we don't want displayed) - but that is undesireable. </p> <p>I simply want to capture the live stream from the camera and embed it a page on our website so that we can control how the page looks as well as other relevant hyperlinks.</p> <p>Thx.</p>
[ { "answer_id": 83207, "author": "Grad van Horck", "author_id": 12569, "author_profile": "https://Stackoverflow.com/users/12569", "pm_score": 0, "selected": false, "text": "http://<ip>/img/static.jpg" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/83172", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2312/" ]
83,225
<p>I've seen this done in a few sites, an example is <a href="http://www.artofadambetts.com/weblog/?p=169" rel="noreferrer">artofadambetts.com</a>. The scroll bar on the page scrolls only an element of the page, not the entire page. I looked at the source and havent't been able to figure it out yet. How is this done?</p>
[ { "answer_id": 83258, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": -1, "selected": false, "text": "<div style=\"overflow-x: auto; overflow-y: auto;>the content</div>" }, { "answer_id": 83264, "author": "...
2008/09/17
[ "https://Stackoverflow.com/questions/83225", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5304/" ]
83,232
<p>I'm looking for a key/value pair object that I can include in a web service.</p> <p>I tried using .NET's <a href="http://msdn.microsoft.com/en-us/library/5tbh8a42.aspx" rel="noreferrer"><code>System.Collections.Generic.KeyValuePair&lt;&gt;</code></a> class, but it does not properly serialize in a web service. In a web service, the Key and Value properties are not serialized, making this class useless, unless someone knows a way to fix this.</p> <p>Is there any other generic class that can be used for this situation?</p> <p>I'd use .NET's <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.pair.aspx" rel="noreferrer"><code>System.Web.UI.Pair</code></a> class, but it uses Object for its types. It would be nice to use a Generic class, if only for type safety.</p>
[ { "answer_id": 83265, "author": "leppie", "author_id": 15541, "author_profile": "https://Stackoverflow.com/users/15541", "pm_score": 8, "selected": true, "text": "[Serializable]\npublic struct KeyValuePair<K,V>\n{\n public K Key {get;set;}\n public V Value {get;set;}\n}\n" }, { ...
2008/09/17
[ "https://Stackoverflow.com/questions/83232", "https://Stackoverflow.com", "https://Stackoverflow.com/users/392/" ]
83,242
<p>I have a RHEL 5 system with a fresh new hard drive I just dedicated to the MySQL server. To get things started, I used "mysqldump --host otherhost -A | mysql", even though I noticed the manpage never explicitly recommends trying this (mysqldump into a file is a no-go. We're talking 500G of database). </p> <p>This process fails at random intervals, complaining that too many files are open (at which point mysqld gets the relevant signal, and dies and respawns). </p> <p>I tried upping it at sysctl and ulimit, but the problem persists. What do I do about it? </p>
[ { "answer_id": 57127322, "author": "Mohd Abdul Mujib", "author_id": 807104, "author_profile": "https://Stackoverflow.com/users/807104", "pm_score": 0, "selected": false, "text": "mysqldump" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/83242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15910/" ]
83,260
<p>Say I've got this array: MyArray(0)="aaa" MyArray(1)="bbb" MyArray(2)="aaa"</p> <p>Is there a .net function which can give me the unique values? I would like something like this as an output of the function: OutputArray(0)="aaa" OutputArray(1)="bbb"</p>
[ { "answer_id": 83280, "author": "Stormenet", "author_id": 2090, "author_profile": "https://Stackoverflow.com/users/2090", "pm_score": 2, "selected": false, "text": "string[] myarray = new string[] { \"aaa\", \"bbb\", \"aaa\" };\n Dictionary mydict = new Dictionary();\n ...
2008/09/17
[ "https://Stackoverflow.com/questions/83260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15928/" ]
83,279
<p>I'm developing a 3-column website using a layout like this:</p> <pre><code> &lt;div id='left' style='left: 0; width: 150px; '&gt; ... &lt;/div&gt; &lt;div id='middle' style='left: 150px; right: 200px' &gt; ... &lt;/div&gt; &lt;div id='right' style='right: 0; width: 200px; '&gt; ... &lt;/div&gt; </code></pre> <p>But, considering the default CSS 'position' property of <code>&lt;DIV&gt;'s</code> is 'static', my <code>&lt;DIV&gt;'s</code> were shown one below the other, as expected.</p> <p>So I set the CSS property 'position' to 'relative', and changed the 'top' property of the 'middle' and 'right' <code>&lt;DIV&gt;'s</code> to -(minus) the height of the preceding <code>&lt;DIV&gt;</code>. It worked fine, but this approach brought me two problems:</p> <p>1) Even though Internet Explorer 7 shows three columns properly, it still keeps the vertical scrollbar as if the <code>&lt;DIV&gt;'s</code> were positioned one below the other, and there is a lot of white space after the content is over. I would'n like to have that.</p> <p>2) The height of these elements is variable, so I don't really know which value to set for each <code>&lt;DIV&gt;</code>'s 'top' property; and I wouldn't like to hardcode it.</p> <p>So my question is, what would be the best (simple + elegant) way to implement this layout? I would like to avoid absolute positioning , and I also to keep my design tableless.</p>
[ { "answer_id": 90790, "author": "Peter Kelley", "author_id": 14893, "author_profile": "https://Stackoverflow.com/users/14893", "pm_score": 1, "selected": false, "text": "1 <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \n2 \"http://www.w3.org/TR/html4/strict.dtd\"> \n3 <html...
2008/09/17
[ "https://Stackoverflow.com/questions/83279", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15931/" ]
83,299
<p>I found this open-source library that I want to use in my Java application. The library is written in C and was developed under Unix/Linux, and my application will run on Windows. It's a library of mostly mathematical functions, so as far as I can tell it doesn't use anything that's platform-dependent, it's just very basic C code. Also, it's not that big, less than 5,000 lines.</p> <p>What's the easiest way to use the library in my application? I know there's JNI, but that involves finding a compiler to compile the library under Windows, getting up-to-date with the JNI framework, writing the code, etc. Doable, but not that easy. Is there an easier way? Considering the small size of the library, I'm tempted to just translate it to Java. Are there any tools that can help with that?</p> <p><BR> <strong>EDIT</strong></p> <p>I ended up translating the part of the library that I needed to Java. It's about 10% of the library so far, though it'll probably increase with time. C and Java are pretty similar, so it only took a few hours. The main difficulty is fixing the bugs that get introduced by mistakes in the translation.</p> <p>Thank you everyone for your help. The proposed solutions all seemed interesting and I'll look into them when I need to link to larger libraries. For a small piece of C code, manual translation was the simplest solution.</p>
[ { "answer_id": 83394, "author": "Tuxmentat", "author_id": 15963, "author_profile": "https://Stackoverflow.com/users/15963", "pm_score": -1, "selected": false, "text": "System.loadLibrary(\"mylibrary.dll\");\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/83299", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8330/" ]
83,319
<p>I'm trying to figure out why the control does not honor ZIndex.</p> <p>Example 1 - which works fine</p> <pre><code> &lt;Canvas&gt; &lt;Rectangle Canvas.ZIndex="1" Height="400" Width="600" Fill="Yellow"/&gt; &lt;Rectangle Canvas.ZIndex="2" Height="100" Width="100" Fill="Red"/&gt; &lt;/Canvas&gt; </code></pre> <p>Example 2 - which does not work</p> <pre><code> &lt;Canvas&gt; &lt;WebBrowser Canvas.ZIndex="1" Height="400" Width="600" Source="http://www.stackoverflow.com"/&gt; &lt;Rectangle Canvas.ZIndex="2" Height="100" Width="100" Fill="Red"/&gt; &lt;/Canvas&gt; </code></pre> <p>Thanks, -- Ed</p>
[ { "answer_id": 19936409, "author": "Hannish", "author_id": 1514608, "author_profile": "https://Stackoverflow.com/users/1514608", "pm_score": 1, "selected": false, "text": "<Canvas ClipToBounds=\"False\">\n <Popup AllowsTransparency=\"True\" ClipToBounds=\"False\" IsOpen=\"True\">\n ...
2008/09/17
[ "https://Stackoverflow.com/questions/83319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15921/" ]
83,329
<p>I have a ~23000 line SQL dump containing several databases worth of data. I need to extract a certain section of this file (i.e. the data for a single database) and place it in a new file. I know both the start and end line numbers of the data that I want.</p> <p>Does anyone know a Unix command (or series of commands) to extract all lines from a file between say line 16224 and 16482 and then redirect them into a new file?</p>
[ { "answer_id": 83344, "author": "Mark Janssen", "author_id": 15828, "author_profile": "https://Stackoverflow.com/users/15828", "pm_score": 5, "selected": false, "text": ":16224,16482w!/tmp/some-file\n" }, { "answer_id": 83347, "author": "boxxar", "author_id": 15732, "...
2008/09/17
[ "https://Stackoverflow.com/questions/83329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15676/" ]
83,397
<p>In php I have open a .php file and want to evaluate certain lines. Specifically when the $table_id and $line variables are assigned a value.</p> <p>Within the text file I have:</p> <pre><code>... $table_id = 'crs_class'; // table name $screen = 'crs_class.detail.screen.inc'; // file identifying screen structure ... </code></pre> <p>amongst other lines. The if statement below never detects the occurance of <code>$table_id</code> or <code>$screen</code> (even without the $ prepended). I can't understand why it won't work as the strpos statement below looking for 'require' works fine.</p> <p>So, why isn't this if statement getting a hit?</p> <pre><code>while ($line=fgets($fh)) { //echo "Evaluating... $line &lt;br&gt;"; **if ((($pos = stripos($line, '$table_id')) === true) || (($pos = stripos($line, '$screen'))===true))** { // TODO: Not evaluating tableid and screen lines correctly fix. // Set $table_id and $screen variables from task scripts eval($line); } if (($pos=stripos($line, 'require')) === true) { $controller = $line; } } </code></pre>
[ { "answer_id": 83435, "author": "Adam Wright", "author_id": 1200, "author_profile": "https://Stackoverflow.com/users/1200", "pm_score": 2, "selected": false, "text": "<?php\n $foo = \"bar\";\n\n print '$foo';\n print \"$foo\";\n?>\n" }, { "answer_id": 83648, "author": "scu...
2008/09/17
[ "https://Stackoverflow.com/questions/83397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10583/" ]
83,405
<p>I am looking for a good JavaScript library for parsing XML data. It should be much easier to use than the built-in <a href="http://www.w3schools.com/Xml/xml_parser.asp" rel="nofollow noreferrer">XML DOM parsers</a> bundled with the browsers.</p> <p>I got spoiled a bit working with JSON and am looking forward to something on similar lines for XML.</p>
[ { "answer_id": 26957382, "author": "lexicore", "author_id": 303810, "author_profile": "https://Stackoverflow.com/users/303810", "pm_score": 6, "selected": false, "text": "QName" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/83405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4337/" ]
83,410
<p>I have a large CSV file and I want to execute a stored procedure for each line.</p> <p>What is the best way to execute a stored procedure from PowerShell?</p>
[ { "answer_id": 83791, "author": "Mark Schill", "author_id": 9482, "author_profile": "https://Stackoverflow.com/users/9482", "pm_score": 7, "selected": true, "text": "$SqlConnection = New-Object System.Data.SqlClient.SqlConnection\n$SqlConnection.ConnectionString = \"Server=HOME\\SQLEXPRE...
2008/09/17
[ "https://Stackoverflow.com/questions/83410", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12767/" ]
83,439
<p>What is the preferred way to remove spaces from a string in C++? I could loop through all the characters and build a new string, but is there a better way?</p>
[ { "answer_id": 83468, "author": "rupello", "author_id": 635, "author_profile": "https://Stackoverflow.com/users/635", "pm_score": 5, "selected": false, "text": "string.erase(std::remove_if(string.begin(), string.end(), std::isspace), string.end());\n" }, { "answer_id": 83481, ...
2008/09/17
[ "https://Stackoverflow.com/questions/83439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15947/" ]
83,471
<p>Working with a SqlCommand in C# I've created a query that contains a IN (list...) part in the where clause. Instead of looping through my string list generating the list I need for the query (dangerous if you think in sqlInjection). I thought that I could create a parameter like:</p> <pre><code>SELECT blahblahblah WHERE blahblahblah IN @LISTOFWORDS </code></pre> <p>Then in the code I try to add a parameter like this: </p> <pre><code>DataTable dt = new DataTable(); dt.Columns.Add("word", typeof(string)); foreach (String word in listOfWords) { dt.Rows.Add(word); } comm.Parameters.Add("LISTOFWORDS", System.Data.SqlDbType.Structured).Value = dt; </code></pre> <p>But this doesn't work. </p> <p>Questions:</p> <ul> <li>Am I trying something impossible?</li> <li>Did I took the wrong approach?</li> <li>Do I have mistakes in this approach?</li> </ul> <p>Thanks for your time :)</p>
[ { "answer_id": 83525, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 2, "selected": false, "text": "SELECT * FROM [Table] WHERE ID IN (1,2,3)\n" }, { "answer_id": 92069, "author": "Dani", "author_id": 17...
2008/09/17
[ "https://Stackoverflow.com/questions/83471", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15987/" ]
83,476
<p>I've been studying the Google authentication API (AuthSub)... My question is, how do I get the user's account information (at least their Gmail address) after the authentication has passed? </p> <p>Because currently, all I get back from the authentication process is a token granting me access to which ever Google service I have specified in the scope, but there's no easy way to even get the user's login id (Gmail address) as far as I can tell...</p> <hr> <p>If so, what Google service allows me to access the user's information?</p>
[ { "answer_id": 7115414, "author": "StasM", "author_id": 214196, "author_profile": "https://Stackoverflow.com/users/214196", "pm_score": 2, "selected": false, "text": "https://www-opensocial.googleusercontent.com/api/people/@me/@self" }, { "answer_id": 14819324, "author": "use...
2008/09/17
[ "https://Stackoverflow.com/questions/83476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15974/" ]
83,512
<p>I am writing a perl script to parse a mysql database schema and create C++ classes when necessary. My question is a pretty easy one, but us something I haven't really done before and don't know common practice. Any object of any of classes created will need to have "get" methods to populate this information. So my questions are twofold:</p> <ol> <li>Does it make sense to call all of the get methods in the constructor so that the object has data right away? Some classes will have a lot of them, so as needed might make sense too. I have two constrcutors now. One that populates the data and one that does not.</li> <li>Should I also have a another "get" method that retrieves the object's copy of the data rather that the db copy.</li> </ol> <p>I could go both ways on #1 and am leaning towards yes on #2. Any advice, pointers would be much appreciated. </p>
[ { "answer_id": 83702, "author": "bmdhacks", "author_id": 14032, "author_profile": "https://Stackoverflow.com/users/14032", "pm_score": 1, "selected": false, "text": "Artist MJ = Artist::Find(\"Michael Jackson\");\nMJ->set(\"relevant\", \"no\");\nMJ->save();\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/83512", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
83,531
<p>I'm trying to write a stored procedure to select employees who have birthdays that are upcoming. </p> <p><code>SELECT * FROM Employees WHERE Birthday &gt; @Today AND Birthday &lt; @Today + @NumDays</code></p> <p>This will not work because the birth year is part of Birthday, so if my birthday was '09-18-1983' that will not fall between '09-18-2008' and '09-25-2008'. </p> <p>Is there a way to ignore the year portion of date fields and just compare month/days? </p> <p>This will be run every monday morning to alert managers of birthdays upcoming, so it possibly will span new years. </p> <p>Here is the working solution that I ended up creating, thanks Kogus. </p> <pre><code>SELECT * FROM Employees WHERE Cast(DATEDIFF(dd, birthdt, getDate()) / 365.25 as int) - Cast(DATEDIFF(dd, birthdt, futureDate) / 365.25 as int) &lt;&gt; 0 </code></pre>
[ { "answer_id": 83571, "author": "Stephen Wrighton", "author_id": 7516, "author_profile": "https://Stackoverflow.com/users/7516", "pm_score": -1, "selected": false, "text": "SELECT * FROM Employees WHERE\n DATEADD ( year, YEAR(@Today) - YEAR(@Birthday), birthday) BETWEEN @Today AND @EndD...
2008/09/17
[ "https://Stackoverflow.com/questions/83531", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2460/" ]
83,547
<p>I have a decimal number (let's call it <strong>goal</strong>) and an array of other decimal numbers (let's call the array <strong>elements</strong>) and I need to find all the combinations of numbers from <strong>elements</strong> which sum to goal.</p> <p>I have a preference for a solution in C# (.Net 2.0) but may the best algorithm win irrespective.</p> <p>Your method signature might look something like:</p> <pre><code>public decimal[][] Solve(decimal goal, decimal[] elements) </code></pre>
[ { "answer_id": 84168, "author": "Sam Meldrum", "author_id": 16005, "author_profile": "https://Stackoverflow.com/users/16005", "pm_score": 5, "selected": true, "text": "public class Solver {\n\n private List<List<decimal>> mResults;\n\n public List<List<decimal>> Solve(decimal goal,...
2008/09/17
[ "https://Stackoverflow.com/questions/83547", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16005/" ]
83,553
<p>I need to write a program used internally where different users will have different abilities within the program.</p> <p>Rather than making users have a new username and password, how do I tie into an existing domain server's login system?</p> <p>Assume .NET (C#, VB, ASP, etc)</p> <p>-Adam</p>
[ { "answer_id": 83587, "author": "Matt Everson", "author_id": 7300, "author_profile": "https://Stackoverflow.com/users/7300", "pm_score": 3, "selected": true, "text": "private string getWindowsUsername()\n{\n AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);...
2008/09/17
[ "https://Stackoverflow.com/questions/83553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2915/" ]
83,593
<p>Having a set of (2D) points from a GIS file (a city map), I need to generate the polygon that defines the 'contour' for that map (its boundary). Its input parameters would be the points set and a 'maximum edge length'. It would then output the corresponding (probably non-convex) polygon.</p> <p>The best solution I found so far was to generate the Delaunay triangles and then remove the external edges that are longer than the maximum edge length. After all the external edges are shorter than that, I simply remove the internal edges and get the polygon I want. The problem is, this is very time-consuming and I'm wondering if there's a better way.</p>
[ { "answer_id": 83975, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "H01 = bearing from P0 to P1\nH12 = bearing from P1 to P2\nA = fmod( H12-H01+360, 360 )\n|P2-P1| <= MaxEdgeLength\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/83593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8999/" ]
83,604
<p>I am wondering what makes sense in relation to what objects to expose through a WCF service - should I add WCF Serialization specifications to my business entities or should I implement a converter that maps my business entities to the DataContracts that I want to expose through my WCF service?</p> <p>Right now I have entities on different levels: DataAccess, Business and Contract. I have converters in place that can map entities from DataAccess to Business and from Business to Contract and vice versa. Implementing and Maintaining those is time consuming and pretty tedious. What are best practices in relation to this? </p> <p>If I were using an OR/M such as NHibernate or Entity Framework should I be exposing the entities from the ORM directly or should I abstract them the same way I am doing now?</p>
[ { "answer_id": 2402961, "author": "Raj Rao", "author_id": 44815, "author_profile": "https://Stackoverflow.com/users/44815", "pm_score": 1, "selected": false, "text": "//Business Entity\nclass Person\n{\n public string Name{ get; set; }\n public int Age{ get; set; }\n}\n\n\n//Data tra...
2008/09/17
[ "https://Stackoverflow.com/questions/83604", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15771/" ]
83,640
<p>For data types such as std::set and std::map where lookup occurs in logarithmic time, is the implementation required to maintain the begin and end iterators? Does accessing begin and end imply a lookup that could occur in logarithmic time?</p> <p>I have always assumed that begin and end always occur in constant time, however I can't find any confirmation of this in Josuttis. Now that I'm working on something where I need to be anal about performance, I want to make sure to cover my bases.</p> <p>Thanks</p>
[ { "answer_id": 83682, "author": "amo-ej1", "author_id": 15791, "author_profile": "https://Stackoverflow.com/users/15791", "pm_score": 2, "selected": false, "text": "std::map" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/83640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8123/" ]
83,653
<p>The following returns </p> <blockquote> <p>Type of conditional expression cannot be determined because there is no implicit conversion between 'double' and '&lt;null&gt;'</p> </blockquote> <pre><code>aNullableDouble = (double.TryParse(aString, out aDouble) ? aDouble : null) </code></pre> <hr> <p>The reason why I can't just use aNullableBool instead of the roundtrip with aDouble is because aNullableDouble is a property of a generated EntityFramework class which cannot be used as an out par.</p>
[ { "answer_id": 83664, "author": "James Curran", "author_id": 12725, "author_profile": "https://Stackoverflow.com/users/12725", "pm_score": 1, "selected": false, "text": "aNullableDouble = (double.TryParse(aString, out aDouble)?new Nullable<double>(aDouble):null)\n" }, { "answer_i...
2008/09/17
[ "https://Stackoverflow.com/questions/83653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11333/" ]
83,674
<p>I want to find records on a combination of created_on >= some date AND name IN some list of names.</p> <p>For ">=" I'd have to use sql condition. For "IN" I'd have to use a hash of conditions where the key is :name and the value is the array of names.</p> <p>Is there a way to combine the two?</p>
[ { "answer_id": 83736, "author": "Laurie Young", "author_id": 7473, "author_profile": "https://Stackoverflow.com/users/7473", "pm_score": 6, "selected": true, "text": "Class Test < ActiveRecord::Base\n named_scope :created_after_2005, :conditions => \"created_on > 2005-01-01\"\n named_s...
2008/09/17
[ "https://Stackoverflow.com/questions/83674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1167846/" ]
83,687
<p>I have a need to display a <code>UITableView</code> containing a user's account credentials. For this, I'm using <code>UILabels</code> in <code>UITableViewCell</code>. When I display their password, I'd obviously like to just display a placeholder password character instead of their actual password, similar to a <code>UITextField</code> when it's set to secure text entry mode. In fact, I'd like to use the same character as <code>UITextField</code> uses, instead of '*'. </p> <p>My question is, what is the character code for the password character the <code>UITextField</code> when it's in secure mode?</p>
[ { "answer_id": 9304081, "author": "Scott Gardner", "author_id": 616764, "author_profile": "https://Stackoverflow.com/users/616764", "pm_score": 4, "selected": false, "text": "// self.password is your password string\nNSMutableString *dottedPassword = [NSMutableString new];\n\nfor (int i ...
2008/09/17
[ "https://Stackoverflow.com/questions/83687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1967/" ]
83,696
<p>Generally, what's the best way to tackle a layout bug in IE6? What are the most common bugs or problems that one should look for when trying to figure out why your page suddenly looks like a monkey coded it?</p>
[ { "answer_id": 83733, "author": "Alex King", "author_id": 15813, "author_profile": "https://Stackoverflow.com/users/15813", "pm_score": 2, "selected": false, "text": "border: 1px solid red;" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/83696", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11078/" ]
83,723
<p>I'm working on an email validation check and we need to decided whether to allow user@localhost and user@example (notice no .anything) to be validated as a valid email address. This is for an open source project that has a number of use cases on both the web at large and intranets.</p> <p><a href="http://www.ietf.org/rfc/rfc2822.txt" rel="nofollow noreferrer">RFC 2822</a> (Internet Message Format Standard) allows it but <a href="http://www.ietf.org/rfc/rfc2821.txt" rel="nofollow noreferrer">RFC 2821</a> (SMTP Standard) says it should fail.</p> <p>Thoughts?</p>
[ { "answer_id": 85324, "author": "Devin Reams", "author_id": 16248, "author_profile": "https://Stackoverflow.com/users/16248", "pm_score": 0, "selected": false, "text": "<?php \nfunction valid_email($email) { \n // First, we check that there's one @ symbol, and that the lengths are rig...
2008/09/17
[ "https://Stackoverflow.com/questions/83723", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11910/" ]
83,741
<p>I need a simple way to monitor multiple text log files distributed over a number of HP-UX servers. They are a mix of text and XML log files from several distributed legacy systems. Currently we just ssh to the servers and use <em>tail -f</em> and <em>grep</em>, but that doesn't scale when you have many logs to keep track of.</p> <p>Since the logs are in different formats and just files in folders (automatically rotated when they reach a certain size) I need to both collect them remotely and parse each one differently.</p> <p>My initial thought was to make a simple daemon process that I can run on each server using a custom file reader for each file type to parse it into a common format that can be exported over the network via a socket. Another viewer program running locally will connect to these sockets and show the parsed logs in some simple tabbed GUI or aggregated to a console.</p> <p>What log format should I try to convert to if I am to implement it this way?</p> <p>Is there some other easier way? Should I attempt to translate the log files to the log4j format to use with <a href="http://logging.apache.org/chainsaw/" rel="noreferrer">Chainsaw</a> or are there better log viewers that can connect to remote sockets? Could I use <a href="http://www.baremetalsoft.com/baretail/" rel="noreferrer">BareTail</a> as suggested in <a href="https://stackoverflow.com/questions/18632/how-to-monitor-a-text-file-in-realtime#18690">another log question</a>? This is not a <a href="https://stackoverflow.com/questions/35292/log-files-in-massively-distributed-systems">massivly distributed system</a> and changing the current logging implementations for all applications to use UDP broadcast or put messages on a JMS queue is not an option.</p>
[ { "answer_id": 164003, "author": "masukomi", "author_id": 13973, "author_profile": "https://Stackoverflow.com/users/13973", "pm_score": 4, "selected": false, "text": "#!/bin/bash\nFILE=$1\nfor box in box1.foo.com box2.foo.com box3.foo.com box4.foo.com; do\n ssh $box tail -f $FILE &\n...
2008/09/17
[ "https://Stackoverflow.com/questions/83741", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4992/" ]
83,756
<p>I need to enable/disable completely network interfaces from a script in Windows XP. I'm looking for a python solution, but any general way (eg WMI, some command-line à la netsh, some windows call) is welcome and will be adjusted. Thanks.</p>
[ { "answer_id": 83800, "author": "Matt Everson", "author_id": 7300, "author_profile": "https://Stackoverflow.com/users/7300", "pm_score": 0, "selected": false, "text": "devcon disable (id or portion of name)\ndevcon enable (id or portion of name)\n" }, { "answer_id": 83890, "a...
2008/09/17
[ "https://Stackoverflow.com/questions/83756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6899/" ]
83,770
<p>I'm trying to create a server control, which inherits from TextBox, that will automatically have a <a href="http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Calendar/Calendar.aspx" rel="nofollow noreferrer">CalendarExtender</a> attached to it. Is it possible to do this, or does my new control need to inherit from CompositeControl instead? I've tried the former, but I'm not clear during which part of the control lifecycle I should create the new instance of the CalendarExtender, and what controls collection I should add it to. I don't seem to be able to add it to the Page or Form's controls collection, and if I add it to the (TextBox) control's collection, I get none of the pop-up calendar functionality.</p>
[ { "answer_id": 83951, "author": "Joseph Daigle", "author_id": 507, "author_profile": "https://Stackoverflow.com/users/507", "pm_score": 3, "selected": true, "text": "CreateChildControls" }, { "answer_id": 2254764, "author": "spot", "author_id": 145103, "author_profile...
2008/09/17
[ "https://Stackoverflow.com/questions/83770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13583/" ]
83,779
<p>I've used Excel PivotTable to analyze data from my database because it allows me to "slice and dice" very quickly. As we know what is in our database tables, we all can write SQL queries that do what PivotTable does. </p> <p>But I am wondering why PivotTable can construct the queries so fast while it knows <em>nothing</em> about the data and the meanings/relationship between the data fields we give it? </p> <p>Put the question in another way, how can we build <em>ad-hoc</em> SQL queries in such a fast and efficient way? ("Use PivotTable, of course!", yep, but what I want is a programmatic way).</p>
[ { "answer_id": 84120, "author": "Martin08", "author_id": 8203, "author_profile": "https://Stackoverflow.com/users/8203", "pm_score": 0, "selected": false, "text": "- the Page Fields zone \n- the Column Fields zone \n- the Row Fields zone and\n- the Data zone\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/83779", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8203/" ]
83,787
<p>I would like to extract the date a jpg file was created. Java has the lastModified method for the File object, but appears to provide no support for extracting the created date from the file. I believe the information is stored within the file as the date I see when I hover the mouse pointer over the file in Win XP is different than what I can get by using JNI with "dir /TC" on the file in DOS.</p>
[ { "answer_id": 83922, "author": "Jorge Ferreira", "author_id": 6508, "author_profile": "https://Stackoverflow.com/users/6508", "pm_score": 0, "selected": false, "text": "import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\...
2008/09/17
[ "https://Stackoverflow.com/questions/83787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16029/" ]
83,807
<p>All I know about the constraint is it's name (<code>SYS_C003415</code>), but I want to see it's definition.</p>
[ { "answer_id": 83811, "author": "Hank Gay", "author_id": 4203, "author_profile": "https://Stackoverflow.com/users/4203", "pm_score": 5, "selected": false, "text": "ALL_CONSTRAINTS" }, { "answer_id": 108376, "author": "cagcowboy", "author_id": 19629, "author_profile": ...
2008/09/17
[ "https://Stackoverflow.com/questions/83807", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4203/" ]
83,856
<p>I have a string coming from a table like "can no pay{1},as your payment{2}due on {3}". I want to replace {1} with some value , {2} with some value and {3} with some value .</p> <p>Is it Possible to replace all 3 in one replace function ? or is there any way I can directly write query and get replaced value ? I want to replace these strings in Oracle stored procedure the original string is coming from one of my table I am just doing select on that table </p> <p>and then I want to replace {1},{2},{3} values from that string to the other value that I have from another table </p>
[ { "answer_id": 83910, "author": "hamishmcn", "author_id": 3590, "author_profile": "https://Stackoverflow.com/users/3590", "pm_score": 5, "selected": true, "text": "replace()" }, { "answer_id": 28584627, "author": "Florin Ghita", "author_id": 319875, "author_profile": ...
2008/09/17
[ "https://Stackoverflow.com/questions/83856", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14299/" ]
83,863
<p>I want to find a way to develop database projects quickly in Visual Studio. Any ideas?</p>
[ { "answer_id": 83888, "author": "Chris Woodruff", "author_id": 7001, "author_profile": "https://Stackoverflow.com/users/7001", "pm_score": 3, "selected": true, "text": "/****** Object: StoredProcedure [dbo].[CustOrdersOrders] Script Date: 08/25/2007 15:22:59 ******/\nIF EXISTS (SELE...
2008/09/17
[ "https://Stackoverflow.com/questions/83863", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7001/" ]
83,887
<p>Below is an example class hierarchy and code. What I'm looking for is a way to determine if 'ChildClass1' or 'ChildClass2' had the static method whoAmI() called on it without re-implementing it in each child class.</p> <pre><code>&lt;?php abstract class ParentClass { public static function whoAmI () { // NOT correct, always gives 'ParentClass' $class = __CLASS__; // NOT correct, always gives 'ParentClass'. // Also very round-about and likely slow. $trace = debug_backtrace(); $class = $trace[0]['class']; return $class; } } class ChildClass1 extends ParentClass { } class ChildClass2 extends ParentClass { } // Shows 'ParentClass' // Want to show 'ChildClass1' print ChildClass1::whoAmI(); print "\n"; // Shows 'ParentClass' // Want to show 'ChildClass2' print ChildClass2::whoAmI(); print "\n"; </code></pre>
[ { "answer_id": 109888, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 2, "selected": false, "text": "someObject.whoAmI()" }, { "answer_id": 1384848, "author": "Adam Franco", "author_id": 15872, "author_pr...
2008/09/17
[ "https://Stackoverflow.com/questions/83887", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15872/" ]
83,899
<p>We need to capture live video and display <em>easily</em> on Linux. We need a cheap card or USB device with a simple API. Anyone want to share some experience? </p>
[ { "answer_id": 109408, "author": "Shannon Nelson", "author_id": 14450, "author_profile": "https://Stackoverflow.com/users/14450", "pm_score": 2, "selected": false, "text": "dvgrab --size 500 --autosplit <filename>\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/83899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/842/" ]
83,914
<p>I've got a new varchar(10) field in a database with 1000+ records. I'd like to update the table so I can have random data in the field. I'm looking for a SQL solution.</p> <p>I know I can use a cursor, but that seems inelegant.</p> <p>MS-SQL 2000,BTW</p>
[ { "answer_id": 83963, "author": "James Curran", "author_id": 12725, "author_profile": "https://Stackoverflow.com/users/12725", "pm_score": 4, "selected": true, "text": "update MyTable Set RandomFld = CONVERT(varchar(10), NEWID())\n" }, { "answer_id": 83965, "author": "Stephe...
2008/09/17
[ "https://Stackoverflow.com/questions/83914", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4230/" ]
83,918
<p>We have several jobs that run concurrently that have to use the same config info for log4j. They are all dumping the logs into one file using the same appender. Is there a way to have each job dynamically name its log file so they stay seperate?</p> <p>Thanks<BR> Tom</p>
[ { "answer_id": 84021, "author": "Alexandre Victoor", "author_id": 11897, "author_profile": "https://Stackoverflow.com/users/11897", "pm_score": 0, "selected": false, "text": " <category name=\"com.tom.firstbatch\">\n <appender-ref ref=\"FIRST_APPENDER\"/>\n </category>\n <cate...
2008/09/17
[ "https://Stackoverflow.com/questions/83918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5659/" ]
83,945
<p>Is there any way to force a listview control to treat all clicks as though they were done through the Control key?</p> <p>I need to replicate the functionality of using the control key (selecting an item sets and unsets its selection status) in order to allow the user to easily select multiple items at the same time.</p> <p>Thank you in advance.</p>
[ { "answer_id": 2678156, "author": "Matthew M.", "author_id": 27472, "author_profile": "https://Stackoverflow.com/users/27472", "pm_score": 2, "selected": false, "text": "public class MultiSelectNoCTRLKeyListView : ListView {\n public MultiSelectNoCTRLKeyListView() {\n\n }\n\n public c...
2008/09/17
[ "https://Stackoverflow.com/questions/83945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16091/" ]
83,953
<pre><code>foreach ($_GET as $field =&gt; $label) { $datarray[]=$_GET[$field]; echo "$_GET[$field]"; echo "&lt;br&gt;"; } print_r($datarray); </code></pre> <hr> <p>This is the output I am getting. I see the data is there in datarray but when I <code>echo $_GET[$field]</code> </p> <p>I only get "Array"</p> <p>But <code>print_r($datarray)</code> prints all the data. Any idea how I pull those values?</p> <h2>OUTPUT</h2> <pre><code>Array ( [0] =&gt; Array ( [0] =&gt; Grade1 [1] =&gt; ln [2] =&gt; North America [3] =&gt; yuiyyu [4] =&gt; iuy [5] =&gt; uiyui [6] =&gt; yui [7] =&gt; uiy [8] =&gt; 0:0:5 ) ) </code></pre>
[ { "answer_id": 84040, "author": "Fernando Barrocal", "author_id": 2274, "author_profile": "https://Stackoverflow.com/users/2274", "pm_score": 0, "selected": false, "text": "<pre>" }, { "answer_id": 84208, "author": "jackbravo", "author_id": 9055, "author_profile": "ht...
2008/09/17
[ "https://Stackoverflow.com/questions/83953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
83,962
<p>Test the following code:</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; main() { const char *yytext="0"; const float f=(float)atof(yytext); size_t t = *((size_t*)&amp;f); printf("t should be 0 but is %d\n", t); } </code></pre> <p>Compile it with:</p> <pre><code>gcc -O3 test.c </code></pre> <p>The GOOD output should be:</p> <pre><code>"t should be 0 but is 0" </code></pre> <p>But with my gcc 4.1.3, I have:</p> <pre><code>"t should be 0 but is -1209357172" </code></pre>
[ { "answer_id": 83997, "author": "Tobi", "author_id": 5422, "author_profile": "https://Stackoverflow.com/users/5422", "pm_score": 5, "selected": true, "text": "size_t t = *((size_t*)&f);\n" }, { "answer_id": 84020, "author": "Kent Fredric", "author_id": 15614, "author_...
2008/09/17
[ "https://Stackoverflow.com/questions/83962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6605/" ]
83,967
<p>Sometimes my Oracle database on Windows gets hosed. How do I do a manual uninstall of Oracle?</p>
[ { "answer_id": 86536, "author": "Sten Vesterli", "author_id": 9363, "author_profile": "https://Stackoverflow.com/users/9363", "pm_score": 7, "selected": true, "text": "\\HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services" }, { "answer_id": 60243364, "author": "anyGeneric...
2008/09/17
[ "https://Stackoverflow.com/questions/83967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6013/" ]
83,983
<p>example:</p> <pre><code>a_list = [1, 2, 3] a_list.len() # doesn't work len(a_list) # works </code></pre> <p>Python being (very) object oriented, I don't understand why the 'len' function isn't inherited by the object. Plus I keep trying the wrong solution since it appears as the logical one to me</p>
[ { "answer_id": 84016, "author": "Bill Barksdale", "author_id": 16113, "author_profile": "https://Stackoverflow.com/users/16113", "pm_score": 2, "selected": false, "text": "__len__" }, { "answer_id": 84019, "author": "Nate", "author_id": 12779, "author_profile": "https...
2008/09/17
[ "https://Stackoverflow.com/questions/83983", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16070/" ]
83,990
<p>It's common to want browsers to cache resources - JavaScript, CSS, images, etc. until there is a new version available, and then ensure that the browser fetches and caches the new version instead.</p> <p>One solution is to embed a version number in the resource's filename, but will placing the resources to be managed in this way in a directory with a revision number in it do the same thing? Is the whole URL to the file used as a key in the browser's cache, or is it just the filename itself and some meta-data?</p> <p>If my code changes from fetching <code>/r20/example.js</code> to <code>/r21/example.js</code>, can I be sure that revision 20 of <code>example.js</code> was cached, but now revision 21 has been fetched instead and it is now cached?</p>
[ { "answer_id": 41716206, "author": "Leonid Vasilev", "author_id": 2594597, "author_profile": "https://Stackoverflow.com/users/2594597", "pm_score": 3, "selected": false, "text": "URI = scheme \":\" hier-part [ \"?\" query ] [ \"#\" fragment ]\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/83990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12559/" ]
84,007
<p>Do you guys know how I can use the Curl command line to POST SOAP to test a web service?</p> <p>I have a file (soap.xml) which has all the soap message attached to it I just don't seem to be able to properly post it.</p> <p>Thanks!</p>
[ { "answer_id": 84046, "author": "lbz", "author_id": 11530, "author_profile": "https://Stackoverflow.com/users/11530", "pm_score": 6, "selected": true, "text": "curl -d \"String to post\" \"http://www.example.com/target\"\n" }, { "answer_id": 4574519, "author": "Kris C", "...
2008/09/17
[ "https://Stackoverflow.com/questions/84007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13469/" ]
84,034
<p>I have <strong>1 red polygon</strong> say and <strong>50 randomly placed blue polygons</strong> - they are situated in geographical <strong>2D space</strong>. What is the quickest/speediest algorithim to find the the shortest distance between a red polygon and its nearest blue polygon?</p> <p>Bear in mind that it is not a simple case of taking the points that make up the vertices of the polygon as values to test for distance as they may not necessarily be the closest points.</p> <p>So in the end - the answer should give back the closest blue polygon to the singular red one.</p> <p>This is harder than it sounds!</p>
[ { "answer_id": 1120049, "author": "mpen", "author_id": 65387, "author_profile": "https://Stackoverflow.com/users/65387", "pm_score": 2, "selected": false, "text": "log(log m * n)" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/84034", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5175/" ]
84,064
<p>I'm trying to use <code>SQLBindParameter</code> to prepare my driver for input via <code>SQLPutData</code>. The field in the database is a <code>TEXT</code> field. My function is crafted based on MS's example here: <a href="http://msdn.microsoft.com/en-us/library/ms713824(VS.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms713824(VS.85).aspx</a>.</p> <p>I've setup the environment, made the connection, and prepared my statement successfully but when I call <code>SQLBindParam</code> (using code below) it consistently fails reporting: <code>[Microsoft][SQL Native Client]Invalid precision value</code></p> <pre><code>int col_num = 1; SQLINTEGER length = very_long_string.length( ); retcode = SQLBindParameter( StatementHandle, col_num, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_LONGVARBINARY, NULL, NULL, (SQLPOINTER) col_num, NULL, &amp;length ); </code></pre> <p>The above relies on the driver in use returning "N" for the <code>SQL_NEED_LONG_DATA_LEN</code> information type in <code>SQLGetInfo</code>. My driver returns "Y". How do I bind so that I can use <code>SQLPutData</code>?</p>
[ { "answer_id": 89423, "author": "antik", "author_id": 1625, "author_profile": "https://Stackoverflow.com/users/1625", "pm_score": 2, "selected": false, "text": " SQLINTEGER length;\n RETCODE retcode = SQLBindParameter( StatementHandle,\n col_num, // position of the para...
2008/09/17
[ "https://Stackoverflow.com/questions/84064", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1625/" ]
84,096
<p>ssh will look for its keys by default in the ~/.ssh folder. I want to force it to always look in another location.</p> <p>The workaround I'm using is to add the keys from the non-standard location to the agent:</p> <pre><code>ssh-agent ssh-add /path/to/where/keys/really/are/id_rsa </code></pre> <p>(on Linux and MingW32 shell on Windows)</p>
[ { "answer_id": 84212, "author": "roo", "author_id": 716, "author_profile": "https://Stackoverflow.com/users/716", "pm_score": 5, "selected": false, "text": "man ssh" }, { "answer_id": 84419, "author": "Drew Frezell", "author_id": 10954, "author_profile": "https://Stac...
2008/09/17
[ "https://Stackoverflow.com/questions/84096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6329/" ]
84,102
<p>I'd be interested in some before-and-after c# examples, some non-idiomatic vs idiomatic examples. Non-c# examples would be fine as well if they get the idea across. Thanks.</p>
[ { "answer_id": 84270, "author": "Corey Goldberg", "author_id": 16148, "author_profile": "https://Stackoverflow.com/users/16148", "pm_score": 8, "selected": true, "text": "mylist = [1, 2, 3, 4]\nnewlist = []\nfor i in mylist:\n newlist.append(i * 2)\n" }, { "answer_id": 84406, ...
2008/09/17
[ "https://Stackoverflow.com/questions/84102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13578/" ]
84,125
<p>I've been writing PHP for about six years now and have got to a point where I feel I should be doing more to write better code. I know that Object Oriented code is the way to go but I can't get my head around the concept.</p> <p>Can anyone explain in terms that any idiot can understand, OO and how it works in PHP or point me to an idiots guide tutorial?</p>
[ { "answer_id": 84356, "author": "Aquarion", "author_id": 12696, "author_profile": "https://Stackoverflow.com/users/12696", "pm_score": 5, "selected": false, "text": "class Breakfast {\n\n}\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/84125", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6916/" ]
84,147
<p>Does somebody know how to recover a never-starting eclipse when the error "org.eclipse.swt.SWTError: Item not added" is raising againg and again?</p> <p>I'm using WebSphere Studio Site Developer (Windows) 5.1.0</p> <p>The only stack trace in the .metadata/log file is:</p> <p><code>SESSION ----------------------------------------------------------------------<br> !ENTRY org.eclipse.core.launcher 4 0 sep 17, 2008 16:39:00.564<br> !MESSAGE Exception launching the Eclipse Platform:<br> !STACK<br> java.lang.reflect.InvocationTargetException: java.lang.reflect.InvocationTargetException: org.eclipse.swt.SWTError: Item not added<br> at java.lang.Throwable.&lt;init&gt;(Throwable.java)<br> at java.lang.Throwable.&lt;init&gt;(Throwable.java)<br> at org.eclipse.swt.SWTError.&lt;init&gt;(SWTError.java:82)<br> at org.eclipse.swt.SWTError.&lt;init&gt;(SWTError.java:71)<br> at org.eclipse.swt.SWT.error(SWT.java:2358)<br> at org.eclipse.swt.SWT.error(SWT.java:2262)<br> at org.eclipse.swt.widgets.Widget.error(Widget.java:385)<br> at org.eclipse.swt.widgets.Menu.createItem(Menu.java:464)<br> at org.eclipse.swt.widgets.MenuItem.&lt;init&gt;(MenuItem.java:77)<br> at org.eclipse.ui.internal.AcceleratorMenu.setAccelerators(AcceleratorMenu.java:177)<br> at org.eclipse.ui.internal.WWinKeyBindingService.updateAccelerators(WWinKeyBindingService.java:316)<br> at org.eclipse.ui.internal.WWinKeyBindingService.clear(WWinKeyBindingService.java:175)<br> at org.eclipse.ui.internal.WWinKeyBindingService.update(WWinKeyBindingService.java:267)<br> at org.eclipse.ui.internal.WWinKeyBindingService$1.partActivated(WWinKeyBindingService.java:107)<br> at org.eclipse.ui.internal.PartListenerList$1.run(PartListenerList.java:49)<br> at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1006)<br> at org.eclipse.core.runtime.Platform.run(Platform.java:413)<br> at org.eclipse.ui.internal.PartListenerList.firePartActivated(PartListenerList.java:47)<br> at org.eclipse.ui.internal.WorkbenchPage.firePartActivated(WorkbenchPage.java:1180)<br> at org.eclipse.ui.internal.WorkbenchPage.onActivate(WorkbenchPage.java:1833)<br> at org.eclipse.ui.internal.WorkbenchWindow$7.run(WorkbenchWindow.java:1496)<br> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)<br> at org.eclipse.ui.internal.WorkbenchWindow.setActivePage(WorkbenchWindow.java:1483)<br> at org.eclipse.ui.internal.WorkbenchWindow.restoreState(WorkbenchWindow.java:1363)<br> at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1263)<br> at org.eclipse.ui.internal.Workbench.access$10(Workbench.java:1223)<br> at org.eclipse.ui.internal.Workbench$12.run(Workbench.java:1141)<br> at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1006)<br> at org.eclipse.core.runtime.Platform.run(Platform.java:413)<br> at org.eclipse.ui.internal.Workbench.openPreviousWorkbenchState(Workbench.java:1093)<br> at org.eclipse.ui.internal.Workbench.init(Workbench.java:870)<br> at org.eclipse.ui.internal.Workbench.run(Workbench.java:1373)<br> at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:858)<br> at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)<br> at java.lang.reflect.AccessibleObject.invokeL(AccessibleObject.java:207)<br> at java.lang.reflect.Method.invoke(Method.java:271)<br> at org.eclipse.core.launcher.Main.basicRun(Main.java:291)<br> at org.eclipse.core.launcher.Main.run(Main.java:747)<br> at org.eclipse.core.launcher.Main.main(Main.java:583)</code> </p>
[ { "answer_id": 4454563, "author": "Mohammed Ali", "author_id": 543879, "author_profile": "https://Stackoverflow.com/users/543879", "pm_score": 0, "selected": false, "text": "eclipse.ini" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/84147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16135/" ]
84,149
<p>What is a good way to render data produced by a Java process in the browser? </p> <p>I've made extensive use of JSP and the various associated frameworks (<a href="http://java.sun.com/products/jsp/jstl/" rel="nofollow noreferrer">JSTL</a>, <a href="http://struts.apache.org/" rel="nofollow noreferrer">Struts</a>, <a href="http://tapestry.apache.org/" rel="nofollow noreferrer">Tapestry</a>, etc), as well as more comprehensive frameworks not related to JSP (<a href="http://code.google.com/webtoolkit/" rel="nofollow noreferrer">GWT</a>, <a href="http://www.openlaszlo.org/" rel="nofollow noreferrer">OpenLaszlo</a>). None of the solutions have ever been entirely satisfactory - in most cases the framework is too constrained or too complex for my needs, while others would require extensive refactoring of existing code. Additionally, most frameworks seem to have performance problems.</p> <p>Currently I'm leaning towards the solution of exposing my java data via a simple servlet that returns JSON, and then rendering the data using PHP or Ruby. This has the added benefit of instantly exposing my service as a web service as well, but I'm wondering if I'm reinventing the wheel here.</p>
[ { "answer_id": 87111, "author": "Andreas Holstenson", "author_id": 16351, "author_profile": "https://Stackoverflow.com/users/16351", "pm_score": 3, "selected": true, "text": "@Path(\"/\")\nclass TestClass {\n @GET\n @Path(\"text\")\n @Produces(\"text/plain\")\n String getText...
2008/09/17
[ "https://Stackoverflow.com/questions/84149", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12457/" ]
84,163
<p>Here's a challenge that I was tasked with recently. I still haven't figured out the best way to do it, maybe someone else has an idea. </p> <p>Using PHP and/or HTML, create a page that cycles through any number of other pages at a given interval.</p> <p>For instance, we would load this page and it would take us to google for 20 seconds, then on to yahoo for 10 seconds, then on to stackoverflow for 180 seconds and so on an so forth. </p>
[ { "answer_id": 84190, "author": "Jason Cohen", "author_id": 4926, "author_profile": "https://Stackoverflow.com/users/4926", "pm_score": 1, "selected": false, "text": "delay()" }, { "answer_id": 84226, "author": "hasseg", "author_id": 4111, "author_profile": "https://S...
2008/09/17
[ "https://Stackoverflow.com/questions/84163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13399/" ]
84,164
<p>I'm working on a game (C#) that uses a <a href="http://robocode.sourceforge.net/" rel="nofollow noreferrer">Robocode-like</a> programming model: participants inherit a base Class and add strategic behaviors. The game then loads instances of participants' Classes and the competition begins. Unfortunately, participants can "cheat" by sharing static variables between instances of their competitor Class.</p> <p>How do I prevent static variable sharing between Class instances in a .NET language? I know this is accomplished in Java by using a separate ClassLoader per instance. What's the .NET equivalent? </p> <p>Further, my testing shows that separate AppDomains only work when loading a Class that extends MarshalByRefObject. I guess this makes sense - if you simply load a Serializable Class, the Class is copied into the current AppDomain so a second object from a different AppDomain will share its static vars. MarshalByRefObject guarantees that only a proxy is loaded into the current AppDomain and the statics stay behind in the loading AppDomain. See also: <a href="http://blogs.msdn.com/ericlippert/archive/2004/05/27/143203.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/ericlippert/archive/2004/05/27/143203.aspx</a></p>
[ { "answer_id": 85148, "author": "ddc0660", "author_id": 16027, "author_profile": "https://Stackoverflow.com/users/16027", "pm_score": 2, "selected": false, "text": "if(typeof(CompetitorClass).GetFields(BindingFlags.Static))\n{\n // take necessary steps against cheater!\n}\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/84164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7625/" ]
84,165
<p>I am attempting to provide a general solution for the migration of data from one schema version to another. A problem arises when the column data type from the source schema does not match that of the destination. I would like to create a query that will perform a preliminary compare on the columns data types to return which columns need to be fixed before migration is possible.</p> <p>My current approach is to return the table and column names from <code>information_schema.columns</code> where <code>DATA_TYPE</code>'s between catalogs do not match. However, querying <code>information_schema</code> directly will only return results from the catalog of the connection.</p> <p>Has anyone written a query like this?</p>
[ { "answer_id": 84469, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "syscolumns" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/84165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7287/" ]
84,174
<p>I have been trying out <a href="http://www.codeplex.com/servicefactory" rel="nofollow noreferrer">Service Factory</a> and have run into some problems in regards to long filenames - surpassing the limit in Vista/XP. The problem is that when generating code from the models service factory prefixes everything with the namespace specified. Making the folder structure huge. For example starting in</p> <p>c:\work\sftest\MyWebService</p> <p>I create each of the models with moderate length of names in data contracts and service interface. I set the namespace to be MyCompany.SFTest.MyWebservice</p> <p>After generating code I end up with </p> <pre> c:\work\sftest\MyWebService\MyCompany.SFTest.MyWebService c:\work\sftest\MyWebService\MyCompany.SFTest.MyWebService c:\work\sftest\MyWebService\MyCompany.SFTest.MyWebService\Source c:\work\sftest\MyWebService\MyCompany.SFTest.MyWebService\Source\Business Logic c:\work\sftest\MyWebService\MyCompany.SFTest.MyWebService\Source\Resource Access c:\work\sftest\MyWebService\MyCompany.SFTest.MyWebService\Source\Service Interface c:\work\sftest\MyWebService\MyCompany.SFTest.MyWebService\Source\Service Interface\MyCompany.SFTest.MyWebService.DataContracts c:\work\sftest\MyWebService\MyCompany.SFTest.MyWebService\Source\Service Interface\MyCompany.SFTest.MyWebService.FaultContracts c:\work\sftest\MyWebService\MyCompany.SFTest.MyWebService\Source\Service Interface\MyCompany.SFTest.MyWebService.MessageContracts c:\work\sftest\MyWebService\MyCompany.SFTest.MyWebService\Source\Service Interface\MyCompany.SFTest.MyWebService.ServiceContracts c:\work\sftest\MyWebService\MyCompany.SFTest.MyWebService\Source\Service Interface\MyCompany.SFTest.MyWebService.ServiceImplementation c:\work\sftest\MyWebService\MyCompany.SFTest.MyWebService\Source\Tests </pre> <p>Under each of the folders is a project file with the same prefix </p> <pre> c:\work\sftest\MyWebService\MyCompany.SFTest.MyWebService\Source\Service Interface\MyCompany.SFTest.MyWebService.ServiceImplementation\MyCompany.SFTest.MyWebService.ServiceImplementation.proj </pre> <p>This blows up the recipe as windows can't accept filenames exceeding a specific length.</p> <p>Is it necessary to explicitly include the namespace in each of the foldernames? Obviously at some point I might want to branch a service to another location but for the same reason as above might be unable to. Is there a workaround for this?</p>
[ { "answer_id": 84469, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "syscolumns" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/84174", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15771/" ]
84,178
<p>I'm running in a windows environment with Trac / SVN and I want commits to the repository to integrate to Trac and close the bugs that were noted in the SVN Comment.</p> <p>I know there's some post commit hooks to do that, but there's not much information about how to do it on windows.</p> <p>Anyone done it successfully? And what were the steps you followed to achive it?</p> <p>Here's the hook I need to put in place in SVN, but I'm not exactly sure how to do this in the Windows environment.</p> <p><a href="http://trac.edgewall.org/browser/trunk/contrib/trac-post-commit-hook?rev=920" rel="nofollow noreferrer">Trac Post Commit Hook</a></p>
[ { "answer_id": 84301, "author": "Benjamin W. Smith", "author_id": 1068060, "author_profile": "https://Stackoverflow.com/users/1068060", "pm_score": 0, "selected": false, "text": "C:\\Subversion\\repositories\\repo1\\hooks\\post-commit\n" }, { "answer_id": 85089, "author": "Cr...
2008/09/17
[ "https://Stackoverflow.com/questions/84178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5462/" ]
84,180
<p>Conducting a user account cleanup accross Solaris and Redhat linux systems, many of which have a number of Samba shares. </p> <p>What preference do people have for creating the local unix accounts for non interactive Samba users? In particular, the shell entry:</p> <ol> <li>noshell</li> <li>nologin</li> <li>blank</li> </ol> <p>And why?</p> <p>JB</p>
[ { "answer_id": 84344, "author": "Alex B", "author_id": 6180, "author_profile": "https://Stackoverflow.com/users/6180", "pm_score": 2, "selected": false, "text": "passwd" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/84180", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8361/" ]
84,209
<p><strong>Introduction</strong></p> <p>I've always been searching for a way to make Visual Studio draw a line after a certain amount of characters.</p> <p>Below is a guide to enable these so called <em>guidelines</em> for various versions of Visual Studio.</p> <p><strong>Visual Studio 2013 or later</strong></p> <p>Install Paul Harrington's <a href="http://visualstudiogallery.msdn.microsoft.com/da227a0b-0e31-4a11-8f6b-3a149cf2e459/view/Reviews" rel="noreferrer">Editor Guidelines extension</a>.</p> <p><strong>Visual Studio 2010 and 2012</strong></p> <ol> <li>Install Paul Harrington's Editor Guidelines extension for <a href="http://visualstudiogallery.msdn.microsoft.com/0fbf2878-e678-4577-9fdb-9030389b338c" rel="noreferrer">VS 2010</a> or <a href="http://visualstudiogallery.msdn.microsoft.com/da227a0b-0e31-4a11-8f6b-3a149cf2e459?SRC=Home" rel="noreferrer">VS 2012</a>.</li> <li>Open the registry at: <br />VS 2010: <code>HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Text Editor</code> <br />VS 2012: <code>HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\Text Editor</code> <br />and add a new string called <code>Guides</code> with the value <code>RGB(100,100,100), 80</code>. The first part specifies the color, while the other one (<code>80</code>) is the column the line will be displayed.</li> <li>Or install the <a href="http://visualstudiogallery.msdn.microsoft.com/en-us/7f2a6727-2993-4c1d-8f58-ae24df14ea91" rel="noreferrer">Guidelines UI</a> extension (which is also a part of the <a href="http://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef/" rel="noreferrer">Productivity Power Tools</a>), which will add entries to the editor's context menu for adding/removing the entries without needing to edit the registry directly. The current disadvantage of this method is that you can't specify the column directly.</li> </ol> <p><strong>Visual Studio 2008 and Other Versions</strong></p> <p>If you are using Visual Studio 2008 open the registry at <code>HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Text Editor</code> and add a new string called <code>Guides</code> with the value <code>RGB(100,100,100), 80</code>. The first part specifies the color, while the other one (<code>80</code>) is the column the line will be displayed. The vertical line will appear, when you restart Visual Studio.</p> <p>This trick also works for various other version of Visual Studio, as long as you use the correct path:</p> <pre><code>2003: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\7.1\Text Editor 2005: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\Text Editor 2008: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Text Editor 2008 Express: HKEY_CURRENT_USER\Software\Microsoft\VCExpress\9.0\Text Editor </code></pre> <p><a href="https://stackoverflow.com/a/332577/11387">This also works in SQL Server 2005 and probably other versions.</a></p>
[ { "answer_id": 84325, "author": "Rory MacLeod", "author_id": 1016, "author_profile": "https://Stackoverflow.com/users/1016", "pm_score": 2, "selected": false, "text": "HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\9.0\\Text Editor\n" }, { "answer_id": 84467, "author":...
2008/09/17
[ "https://Stackoverflow.com/questions/84209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11387/" ]
84,211
<p>In a C# windows forms application. I have a splash screen with some multi-threaded processes happening in the background. What I would like to do is when I display the splash screen initially, I would like to have it appear to "fade in". And then, once all the processes finish, I would like it to appear as though the splash screen is "fading out". I'm using C# and .NET 2.0. Thanks.</p>
[ { "answer_id": 84251, "author": "Patrick Desjardins", "author_id": 13913, "author_profile": "https://Stackoverflow.com/users/13913", "pm_score": 2, "selected": false, "text": "While(this.Opacity !=0)\n{\n this.Opacity -= 0.05;\n Thread.Sleep(50);//This is for the speed of the opaci...
2008/09/17
[ "https://Stackoverflow.com/questions/84211", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4660/" ]