qid
int64
4
22.2M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
84,243
<p>I am developing a website that relies much on XML data. The web site has an interface where user can update data. The data provided by user will be updated to the respective XML file. However, the changes is not reflected until after 1 or 2 minutes.</p> <p>Anyone knows how to force the browser to load the latest XML file immediately?</p>
[ { "answer_id": 84351, "author": "Jim", "author_id": 8427, "author_profile": "https://Stackoverflow.com/users/8427", "pm_score": 2, "selected": false, "text": "Cache-Control: no-cache" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/84243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
84,263
<p>I'm designing a web site navigation hierarchy. It's a tree of nodes.</p> <p>Most nodes are pages. Some nodes are links (think shortcuts in Windows).</p> <p>Most pages hold HTML content. Some execute code.</p> <p>I'd like to represent these as this collection of classes and abstract (MustInherit) classes&hellip;</p> <p><img src="https://i.stack.imgur.com/0gNAy.gif" alt="class diagram"></p> <p>This is the database table where I'm going to store all this&hellip;</p> <p><a href="http://img178.imageshack.us/img178/8573/nodetablefm8.gif" rel="nofollow noreferrer">database table http://img178.imageshack.us/img178/8573/nodetablefm8.gif</a></p> <p>Here's where I'm stumped. PageNodes may or may not be roots.</p> <p>How should I handle the root class?</p> <p><img src="https://i.stack.imgur.com/1stKR.gif" alt="class diagram"></p> <p>I don't want to have to have all four of&hellip;</p> <ul> <li>HtmlPageNode</li> <li>CodePageNode</li> <li>Html<strong>Root</strong>PageNode</li> <li>Code<strong>Root</strong>PageNode</li> </ul> <p>I want the HtmlPageNode and CodePageNode classes to inherit <em>either</em> from PageNode or else from RootPageNode. Is that possible?</p> <hr> <p>Clarification: There are multiple root nodes and roots may have parent nodes. Each is the root of only a sub-tree that has distinct styling. Think of different, color-coded departments. (Perhaps root is a poor name choice. Suggestions?)</p> <hr> <p>Update: Regarding the "Root" name...<br> I've asked: <a href="https://stackoverflow.com/questions/86790/is-there-a-specific-name-for-the-node-that-coresponds-to-a-subtree">Is there a specific name for the node that coresponds to a subtree?</a></p>
[ { "answer_id": 84336, "author": "Sunny Milenov", "author_id": 8220, "author_profile": "https://Stackoverflow.com/users/8220", "pm_score": 1, "selected": false, "text": "class Node\n{\n private bool isRootNode;\n public bool IsRootNode;\n\n private StylingData stylingData;\n publi...
2008/09/17
[ "https://Stackoverflow.com/questions/84263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83/" ]
84,278
<p>How do I use <code>RelativeSource</code> with WPF bindings and what are the different use-cases?</p>
[ { "answer_id": 84314, "author": "Bob King", "author_id": 6897, "author_profile": "https://Stackoverflow.com/users/6897", "pm_score": 5, "selected": false, "text": "<Binding RelativeSource=\"{RelativeSource TemplatedParent}\"/>\n" }, { "answer_id": 84317, "author": "Abe Heideb...
2008/09/17
[ "https://Stackoverflow.com/questions/84278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4918/" ]
84,285
<p>is it legal for a thread to call this.start() inside its own constructor? and if so what potential issues can this cause? I understand that the object wont have fully initialized until the constructor has run to completion but aside from this are there any other issues? </p>
[ { "answer_id": 84550, "author": "Eli Courtwright", "author_id": 1694, "author_profile": "https://Stackoverflow.com/users/1694", "pm_score": 2, "selected": false, "text": "Thread t = new CustomThread();\nt.start();\nactiveThreads.add(t);\n" }, { "answer_id": 84611, "author": "...
2008/09/17
[ "https://Stackoverflow.com/questions/84285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
84,290
<p>How do I get a a complete list of all the urls that my rails application could generate? </p> <p>I don't want the routes that I get get form rake routes, instead I want to get the actul URLs corrosponding to all the dynmically generated pages in my application...</p> <p>Is this even possible?</p> <p>(Background: I'm doing this because I want a complete list of URLs for some load testing I want to do, which has to cover the entire breadth of the application)</p>
[ { "answer_id": 84482, "author": "Jeremiah Peschka", "author_id": 11780, "author_profile": "https://Stackoverflow.com/users/11780", "pm_score": 1, "selected": false, "text": "rake routes" }, { "answer_id": 90868, "author": "kch", "author_id": 13989, "author_profile": "...
2008/09/17
[ "https://Stackoverflow.com/questions/84290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7473/" ]
84,310
<p>I'm connecting to an AS/400 stored procedure layer using the IBM iSeries Access for Windows package. This provides a .NET DLL with classes similar to those in the <code>System.Data</code> namespace. As such we use their implementation of the connection class and provide it with a connection string.</p> <p>Does anyone know how I can amend the connection string to indicate the default library it should use?</p>
[ { "answer_id": 84374, "author": "Dillie-O", "author_id": 71, "author_profile": "https://Stackoverflow.com/users/71", "pm_score": 1, "selected": false, "text": "<add name=\"AS400ConnectionString\" connectionString=\"Data Source=DEVL820;Initial Catalog=Q1A_DATABASE_SRVR;Persist Security In...
2008/09/17
[ "https://Stackoverflow.com/questions/84310", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12277/" ]
84,322
<p>It appears that using perldoc perl gives the list of, e.g. perlre, perlvar, etc.</p> <p>Is this the best place to find the list of what's available as an overview or tutorial or reference manual section? Is there another, better list?</p>
[ { "answer_id": 84417, "author": "moritz", "author_id": 14132, "author_profile": "https://Stackoverflow.com/users/14132", "pm_score": 4, "selected": true, "text": "perldoc perltoc\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/84322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8763/" ]
84,330
<p><strong>Here is the updated question:</strong></p> <p>the current query is doing something like:<br></p> <pre><code>$sql1 = "TRUNCATE TABLE fubar"; $sql2 = "CREATE TEMPORARY TABLE IF NOT EXISTS fubar SELECT id, name FROM barfu"; </code></pre> <p>The first time the method containing this is run, it generates an error message on the truncate since the table doesn't exist yet.</p> <p>Is my only option to do the <code>CREATE TABLE</code>, run the <code>TRUNCATE TABLE</code>, and then fill the table? (3 separate queries)</p> <p><strong>original question was:</strong></p> <p> I've been having a hard time trying to figure out if the following is possible in MySql without having to write block sql:</p> <pre><code>CREATE TABLE fubar IF NOT EXISTS ELSE TRUNCATE TABLE fubar </code></pre> <p>If I run truncate separately before the create table, and the table doesn't exist, then I get an error message. I'm trying to eliminate that error message without having to add any more queries.</p> <p>This code will be executed using PHP.</p>
[ { "answer_id": 84396, "author": "Ben", "author_id": 11522, "author_profile": "https://Stackoverflow.com/users/11522", "pm_score": 2, "selected": false, "text": "DROP TABLE IF EXISTS fubar;\nCREATE TABLE fubar;\n" }, { "answer_id": 84405, "author": "Mark Janssen", "author_...
2008/09/17
[ "https://Stackoverflow.com/questions/84330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16186/" ]
84,331
<p>Is there a macro or a way to conditionally copy rows from one worksheet to another in Excel 2003?</p> <p>I'm pulling a list of data from SharePoint via a web query into a blank worksheet in Excel, and then I want to copy the rows for a particular month to a particular worksheet (for example, all July data from a SharePoint worksheet to the Jul worksheet, all June data from a SharePoint worksheet to Jun worksheet, etc.).</p> <p><strong>Sample data</strong></p> <pre><code>Date - Project - ID - Engineer 8/2/08 - XYZ - T0908-5555 - JS 9/4/08 - ABC - T0908-6666 - DF 9/5/08 - ZZZ - T0908-7777 - TS </code></pre> <p>It's not a one-off exercise. I'm trying to put together a dashboard that my boss can pull the latest data from SharePoint and see the monthly results, so it needs to be able to do it all the time and organize it cleanly.</p>
[ { "answer_id": 84526, "author": "BKimmel", "author_id": 13776, "author_profile": "https://Stackoverflow.com/users/13776", "pm_score": 0, "selected": false, "text": "rows = ActiveSheet.UsedRange.Rows\nn = 0\n\nwhile n <= rows\n if ActiveSheet.Rows(n).Cells(DateColumnOrdinal).Value > '8/1...
2008/09/17
[ "https://Stackoverflow.com/questions/84331", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
84,332
<p>My Access 2000 DB causes me problems - sometimes (haven't pinpointed the cause) the "book" form won't close. Clicking its close button does nothing, File -> Close does nothing, even closing Access results in no action. I don't have an OnClose handler for this form. The only workaround I can find involves opening the Vba editor, making a change to the code for that form (even adding a space and then immediately deleting the space), and then going back to close the "book" form, closing it, and saying "no, I don't want to save the changes". Only then will it close. Any help?</p>
[ { "answer_id": 84907, "author": "Chris OC", "author_id": 11041, "author_profile": "https://Stackoverflow.com/users/11041", "pm_score": 0, "selected": false, "text": "If Me.chkbox Then\n" }, { "answer_id": 88914, "author": "David-W-Fenton", "author_id": 9787, "author_p...
2008/09/17
[ "https://Stackoverflow.com/questions/84332", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12874/" ]
84,341
<p>I have a core file generated on a remote system that I don't have direct access to. I also have local copies of the library files from the remote system, and the executable file for the crashing program.</p> <p>I'd like to analyse this core dump in gdb.</p> <p>For example:</p> <pre><code>gdb path/to/executable path/to/corefile </code></pre> <p>My libraries are in the current directory.</p> <p>In the past I've seen debuggers implement this by supplying the option "-p ." or "-p /=."; so my question is:</p> <p>How can I specify that libraries be loaded first from paths relative to my current directory when analysing a corefile in gdb?</p>
[ { "answer_id": 84546, "author": "Drew Frezell", "author_id": 10954, "author_profile": "https://Stackoverflow.com/users/10954", "pm_score": 7, "selected": true, "text": "set solib-absolute-prefix ./usr\nfile path/to/executable\ncore-file path/to/corefile\n" }, { "answer_id": 84722...
2008/09/17
[ "https://Stackoverflow.com/questions/84341", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13956/" ]
84,346
<p>How do I create an index on a column in MySQL v 5.0 (myisam db engine) based upon the length of its value its a TEXT data type up to 7000 characters, do I have to add another column with the length of the first column?</p>
[ { "answer_id": 84500, "author": "Henning", "author_id": 7034, "author_profile": "https://Stackoverflow.com/users/7034", "pm_score": 3, "selected": true, "text": "ADD INDEX myIndex(LENGTH(text)))" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/84346", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16191/" ]
84,378
<p>When using <code>divs</code> when is it best to use a <code>class</code> vs <code>id</code>? </p> <p>Is it best to use <code>class</code>, on say font variant or elements within the html? Then use <code>id</code> for the structure/containers? </p> <p>This is something I've always been a little uncertain on, any help would be great.</p>
[ { "answer_id": 84409, "author": "Oli", "author_id": 12870, "author_profile": "https://Stackoverflow.com/users/12870", "pm_score": 5, "selected": false, "text": "<div id=\"section\" class=\"section\">Text</div>\n" }, { "answer_id": 84412, "author": "Vinko Vrsalovic", "auth...
2008/09/17
[ "https://Stackoverflow.com/questions/84378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16195/" ]
84,404
<p>Visual Studio 2003 and 2005 (and perhaps 2008 for all I know) require the command line user to run in the 'Visual Studio Command Prompt'. When starting this command prompt it sets various environment variables that the C++ compiler, cl, uses when compiling.</p> <p>This is not always desirable. If, for example, I want to run 'cl' from within Ant, I'd like to avoid having to run Ant from within the 'Visual Studio Command Prompt'. Running vcvars32.bat isn't an option as the environment set by vcvars32.bat would be lost by the time cl was run (if running from within Ant).</p> <p>Is there an easy way to run cl without having to run from within the Visual Studio command prompt?</p>
[ { "answer_id": 84431, "author": "ljs", "author_id": 3394, "author_profile": "https://Stackoverflow.com/users/3394", "pm_score": 3, "selected": false, "text": "C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\vcvarsall.bat\n" }, { "answer_id": 87052, "author": "Eclipse", ...
2008/09/17
[ "https://Stackoverflow.com/questions/84404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6839/" ]
84,421
<p>Is there a built in way to convert an integer in Ruby into its hexadecimal equivalent?</p> <p>Something like the opposite of <a href="http://ruby-doc.org/core-2.0.0/String.html#method-i-to_i" rel="noreferrer"><code>String#to_i</code></a>:</p> <pre><code>"0A".to_i(16) #=&gt;10 </code></pre> <p>Like perhaps:</p> <pre><code>"0A".hex #=&gt;10 </code></pre> <p>I know how to roll my own, but it's probably more efficient to use a built in Ruby function.</p>
[ { "answer_id": 84455, "author": "flxkid", "author_id": 13036, "author_profile": "https://Stackoverflow.com/users/13036", "pm_score": 6, "selected": false, "text": "%" }, { "answer_id": 84485, "author": "Jean", "author_id": 7898, "author_profile": "https://Stackoverflo...
2008/09/17
[ "https://Stackoverflow.com/questions/84421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6106/" ]
84,422
<p>in XSLT processing, is there a performance difference between apply-template and call-template? In my stylesheets there are many instances where I can use either, which is the best choice?</p>
[ { "answer_id": 85514, "author": "JeniT", "author_id": 6739, "author_profile": "https://Stackoverflow.com/users/6739", "pm_score": 6, "selected": false, "text": "<xsl:apply-templates>" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/84422", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
84,427
<p>Specifically, is the following legal C++?</p> <pre>class A{}; void foo(A*); void bar(const A&); int main(void) { foo(&A()); // 1 bar(A()); // 2 }</pre> <p>It appears to work correctly, but that doesn't mean it's necessarily legal. Is it?</p> <p><i>Edit - changed <code>A&amp;</code> to <code>const A&amp;</code></i></p>
[ { "answer_id": 84494, "author": "roo", "author_id": 716, "author_profile": "https://Stackoverflow.com/users/716", "pm_score": -1, "selected": false, "text": "int dosomething(error_code& _e = ignore_errorcode()) {\n //do something\n}\n" }, { "answer_id": 84521, "author": "M...
2008/09/17
[ "https://Stackoverflow.com/questions/84427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9530/" ]
84,449
<p>The XML Schema Part 2 specifies that an instance of a datatype that is defined as boolean can have the following legal literals {true, false, 1, 0}. The following XML, for example, when deserialized, sets the boolean property "Emulate" to <code>true</code>.</p> <pre><code>&lt;root&gt; &lt;emulate&gt;1&lt;/emulate&gt; &lt;/root&gt; </code></pre> <p>However, when I serialize the object back to the XML, I get <code>true</code> instead of the numerical value. My question is, is there a way that I can control the boolean representation in the XML?</p>
[ { "answer_id": 85468, "author": "Simon Steele", "author_id": 4591, "author_profile": "https://Stackoverflow.com/users/4591", "pm_score": 6, "selected": false, "text": "[XmlIgnore]\npublic bool MyValue { get; set; }\n\n/// <summary>Get a value purely for serialization purposes</summary>\n...
2008/09/17
[ "https://Stackoverflow.com/questions/84449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8205/" ]
84,460
<p>I've been using Destop.open() to launch a .pdf viewer on Windows machines, both Vista and XP, and most of them work just fine. However, on one XP machine the call does not work, simply returning without throwing any exceptions, and the viewer does not launch. On that machine the file association is properly set up as far as I can tell: double-clicking a .pdf works, as does the "start xxx.pdf" command on the command prompt. I'm thinking it must be a Windows configuration issue, but can't put my finger on it.</p> <p>Has anyone else seen this problem?</p>
[ { "answer_id": 84529, "author": "Martin Spamer", "author_id": 15527, "author_profile": "https://Stackoverflow.com/users/15527", "pm_score": 2, "selected": false, "text": "Control Panel->Java Control Panel->Advanced->Java Console.\n" }, { "answer_id": 9962004, "author": "Lund ...
2008/09/17
[ "https://Stackoverflow.com/questions/84460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16213/" ]
84,463
<p>For example I want to be able to programatically hit a line of code like the following where the function name is dynamically assigned without using Evaluate(). The code below of course doesn't work but represents what I would like to do.</p> <pre><code>application.obj[funcName](argumentCollection=params) </code></pre> <p>The only way I can find to call a function dynamically is by using cfinvoke, but as far as I can tell that instantiates the related cfc/function on the fly and can't use a previously instantiated cfc.</p> <p>Thanks</p>
[ { "answer_id": 84836, "author": "Ben Doom", "author_id": 12267, "author_profile": "https://Stackoverflow.com/users/12267", "pm_score": 4, "selected": true, "text": "<!--- Create the component instance. --->\n<cfobject component=\"tellTime2\" name=\"tellTimeObj\">\n<!--- Invoke the method...
2008/09/17
[ "https://Stackoverflow.com/questions/84463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8345/" ]
84,486
<p>I've spent far too much time trying to figure this out. This should be the simplest thing and everyone who distributes Java applications in jars must have to deal with it.</p> <p>I just want to know the proper way to add versioning to my Java app so that I can access the version information when I'm testing, e.g. debugging in Eclipse <strong>and</strong> running from a jar.</p> <p>Here's what I have in my build.xml:</p> <pre><code>&lt;target name="jar" depends = "compile"&gt; &lt;property name="version.num" value="1.0.0"/&gt; &lt;buildnumber file="build.num"/&gt; &lt;tstamp&gt; &lt;format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss" /&gt; &lt;/tstamp&gt; &lt;manifest file="${build}/META-INF/MANIFEST.MF"&gt; &lt;attribute name="Built-By" value="${user.name}" /&gt; &lt;attribute name="Built-Date" value="${TODAY}" /&gt; &lt;attribute name="Implementation-Title" value="MyApp" /&gt; &lt;attribute name="Implementation-Vendor" value="MyCompany" /&gt; &lt;attribute name="Implementation-Version" value="${version.num}-b${build.number}"/&gt; &lt;/manifest&gt; &lt;jar destfile="${build}/myapp.jar" basedir="${build}" excludes="*.jar" /&gt; &lt;/target&gt; </code></pre> <p>This creates /META-INF/MANIFEST.MF and I can read the values when I'm debugging in Eclipse thusly:</p> <pre><code>public MyClass() { try { InputStream stream = getClass().getResourceAsStream("/META-INF/MANIFEST.MF"); Manifest manifest = new Manifest(stream); Attributes attributes = manifest.getMainAttributes(); String implementationTitle = attributes.getValue("Implementation-Title"); String implementationVersion = attributes.getValue("Implementation-Version"); String builtDate = attributes.getValue("Built-Date"); String builtBy = attributes.getValue("Built-By"); } catch (IOException e) { logger.error("Couldn't read manifest."); } </code></pre> <p>}</p> <p>But, when I create the jar file, it loads the manifest of another jar (presumably the first jar loaded by the application - in my case, activation.jar).</p> <p>Also, the following code doesn't work either although all the proper values are in the manifest file.</p> <pre><code> Package thisPackage = getClass().getPackage(); String implementationVersion = thisPackage.getImplementationVersion(); </code></pre> <p>Any ideas?</p>
[ { "answer_id": 84945, "author": "Martin Spamer", "author_id": 15527, "author_profile": "https://Stackoverflow.com/users/15527", "pm_score": 1, "selected": false, "text": "this.getClass().getClassLoader().getResourceAsStream( ... ) ;\n" }, { "answer_id": 94325, "author": "bass...
2008/09/17
[ "https://Stackoverflow.com/questions/84486", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16216/" ]
84,488
<p>Is there some built-in way to share files between Xen guests? I don't currently need to share the actual images, just some data files.</p>
[ { "answer_id": 35119359, "author": "Vorell", "author_id": 5865147, "author_profile": "https://Stackoverflow.com/users/5865147", "pm_score": 1, "selected": false, "text": "xvda3" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/84488", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9594/" ]
84,506
<p>I find from reading perldoc perlvar, about a thousand lines in is help for %ENV. Is there a way to find that from the command line directly?</p> <p>On my Windows machine, I've tried the following</p> <pre><code>perldoc ENV perldoc %ENV perldoc %%ENV perldoc -r ENV (returns info about Use Env) perldoc -r %ENV perldoc -r %%%ENV perldoc -r %%%%ENV (says No documentation found for "%ENV") </code></pre> <p>None actually return information about the %ENV variable.</p> <p>How do I use perldoc to find out about %ENV, if I don't want to have to eye-grep through thousands of line?</p> <p>I've tried the suggested "perldoc perlvar" and then typing /%ENV, but nothing happens. </p> <pre><code>perl -v: This is perl, v5.8.0 built for MSWin32-x86-multi-thread </code></pre> <p>Though I've asked about %ENV, this also applies to any general term, so knowing that %ENV is in perlvar for this one example won't help me next time when I don't know which section.</p> <p>Is there a way to get perldoc to dump everything (ugh) and I can grep the output?</p>
[ { "answer_id": 84786, "author": "Eli Bendersky", "author_id": 8206, "author_profile": "https://Stackoverflow.com/users/8206", "pm_score": 0, "selected": false, "text": "unixutils" }, { "answer_id": 84791, "author": "Ovid", "author_id": 8003, "author_profile": "https:/...
2008/09/17
[ "https://Stackoverflow.com/questions/84506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8763/" ]
84,556
<p>Personally I like this one:</p> <p><img src="https://i.stack.imgur.com/ZNtvc.jpg" alt=""></p> <p>P.S. Do not hotlink the cartoon without the site's permission please. </p>
[ { "answer_id": 1469915, "author": "fixxxer", "author_id": 170005, "author_profile": "https://Stackoverflow.com/users/170005", "pm_score": 3, "selected": false, "text": "HAI\nCAN HAS STDIO?\nI HAS A VAR\nIM IN YR LOOP\n UP VAR!!1\n VISIBLE VAR\n IZ VAR BIGGER THAN 10? KTHXBYE\nIM...
2008/09/17
[ "https://Stackoverflow.com/questions/84556", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4230/" ]
84,583
<p>The DBAs here maintain all SQL Server and SQL Reporting servers. I have a custom developed SQL Reporting 2005 project in Visual Studio that runs fine on my local SQL Database and Reporting instances. I need to deploy to a production server, so I had a folder created on a SQL Reporting 2005 server with permissions to upload files. Normally, a deploy from within Visual Studio is all that is needed to upload the report files.</p> <p>However, for security purposes, data sources are maintained explicitly by DBAs and stored in a separated locked down common folder on the reporting server. I had them create the data source for me.</p> <p>When I attempt to deploy from VS, it gives me the error </p> <blockquote> <p>The item '/Data Sources' already exists.</p> </blockquote> <p>I get this whether I'm deploying the whole project or just a single report file. I already set <code>OverwriteDataSources=false</code> in the project properties. The TargetServer URL and folder are verified correct.</p> <p>I suppose I could copy the files manually, but I'd like to be able to deploy from within VS. What could I be doing wrong?</p>
[ { "answer_id": 156077, "author": "Peter Wone", "author_id": 1715673, "author_profile": "https://Stackoverflow.com/users/1715673", "pm_score": 2, "selected": false, "text": " <DataSources>\n <DataSource Name=\"preserve the datasource name you've been using\">\n <ConnectionPropert...
2008/09/17
[ "https://Stackoverflow.com/questions/84583", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3347/" ]
84,644
<p>To make it short: hibernate doesn't support projections and query by example? I found this post:</p> <p>The code is this:</p> <pre><code>User usr = new User(); usr.setCity = 'TEST'; getCurrentSession().createCriteria(User.class) .setProjection( Projections.distinct( Projections.projectionList() .add( Projections.property("name"), "name") .add( Projections.property("city"), "city"))) .add( Example.create(usr)) </code></pre> <p>Like the other poster said, The generated sql keeps having a where class refering to just <strong>y0_= ? instead of this_.city</strong>. </p> <p>I already tried several approaches, and searched the issue tracker but found nothing about this.</p> <p>I even tried to use Projection alias and Transformers, but it does not work:</p> <pre><code>User usr = new User(); usr.setCity = 'TEST'; getCurrentSession().createCriteria(User.class) .setProjection( Projections.distinct( Projections.projectionList() .add( Projections.property("name"), "name") .add( Projections.property("city"), "city"))) .add( Example.create(usr)).setResultTransformer(Transformers.aliasToBean(User.class)); </code></pre> <p>Has anyone used projections and query by example ?</p>
[ { "answer_id": 86752, "author": "Arthur Thomas", "author_id": 14009, "author_profile": "https://Stackoverflow.com/users/14009", "pm_score": 5, "selected": true, "text": "getCurrentSession().createCriteria(User.class)\n.setProjection( Projections.distinct( Projections.projectionList()\n.a...
2008/09/17
[ "https://Stackoverflow.com/questions/84644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
84,661
<p>Sometimes, in PL SQL you want to add a parameter to a Package, Function or Procedure in order to prepare future functionality. For example:</p> <pre><code>create or replace function doGetMyAccountMoney( Type_Of_Currency IN char := 'EUR') return number is Result number(12,2); begin Result := 10000; IF char &lt;&gt; 'EUR' THEN -- ERROR NOT IMPLEMENTED YET END IF; return(Result); end doGetMyAccountMoney;also </code></pre> <p>It can lead to lots of warnings like</p> <pre><code>Compilation errors for FUNCTION APPUEMP_PRAC.DOGETMYACCOUNTMONEY Error: Hint: Parameter 'Currency' is declared but never used in 'doGetMyAccountMoney' Line: 1 </code></pre> <p>What would be the best way to avoid those warnings? </p>
[ { "answer_id": 88742, "author": "Sergey Stadnik", "author_id": 10557, "author_profile": "https://Stackoverflow.com/users/10557", "pm_score": 1, "selected": false, "text": "ALTER SESSION SET PLSQL_WARNINGS='ENABLE:SEVERE';\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/84661", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16206/" ]
84,680
<p>I'm writing a Spring web application that requires users to login. My company has an Active Directory server that I'd like to make use of for this purpose. However, I'm having trouble using Spring Security to connect to the server.</p> <p>I'm using Spring 2.5.5 and Spring Security 2.0.3, along with Java 1.6.</p> <p>If I change the LDAP URL to the wrong IP address, it doesn't throw an exception or anything, so I'm wondering if it's even <em>trying</em> to connect to the server to begin with.</p> <p>Although the web application starts up just fine, any information I enter into the login page is rejected. I had previously used an InMemoryDaoImpl, which worked fine, so the rest of my application seems to be configured correctly.</p> <p>Here are my security-related beans:</p> <pre><code> &lt;beans:bean id="ldapAuthProvider" class="org.springframework.security.providers.ldap.LdapAuthenticationProvider"&gt; &lt;beans:constructor-arg&gt; &lt;beans:bean class="org.springframework.security.providers.ldap.authenticator.BindAuthenticator"&gt; &lt;beans:constructor-arg ref="initialDirContextFactory" /&gt; &lt;beans:property name="userDnPatterns"&gt; &lt;beans:list&gt; &lt;beans:value&gt;CN={0},OU=SBSUsers,OU=Users,OU=MyBusiness,DC=Acme,DC=com&lt;/beans:value&gt; &lt;/beans:list&gt; &lt;/beans:property&gt; &lt;/beans:bean&gt; &lt;/beans:constructor-arg&gt; &lt;/beans:bean&gt; &lt;beans:bean id="userDetailsService" class="org.springframework.security.userdetails.ldap.LdapUserDetailsManager"&gt; &lt;beans:constructor-arg ref="initialDirContextFactory" /&gt; &lt;/beans:bean&gt; &lt;beans:bean id="initialDirContextFactory" class="org.springframework.security.ldap.DefaultInitialDirContextFactory"&gt; &lt;beans:constructor-arg value="ldap://192.168.123.456:389/DC=Acme,DC=com" /&gt; &lt;/beans:bean&gt; </code></pre>
[ { "answer_id": 86367, "author": "delfuego", "author_id": 16414, "author_profile": "https://Stackoverflow.com/users/16414", "pm_score": 6, "selected": true, "text": "<beans:bean id=\"contextSource\"\n class=\"org.springframework.security.ldap.DefaultSpringSecurityContextSource\">\n ...
2008/09/17
[ "https://Stackoverflow.com/questions/84680", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13379/" ]
84,716
<p>I use the jQuery <a href="http://docs.jquery.com/Utilities/jQuery.extend" rel="nofollow noreferrer">extend</a> function to extend a class prototype.</p> <p>For example:</p> <pre><code>MyWidget = function(name_var) { this.init(name_var); } $.extend(MyWidget.prototype, { // object variables widget_name: '', init: function(widget_name) { // do initialization here this.widget_name = widget_name; }, doSomething: function() { // an example object method alert('my name is '+this.widget_name); } }); // example of using the class built above var widget1 = new MyWidget('widget one'); widget1.doSomething(); </code></pre> <p>Is there a better way to do this? Is there a cleaner way to create the class above with only one statement instead of two?</p>
[ { "answer_id": 84824, "author": "Jonny Buchanan", "author_id": 6760, "author_profile": "https://Stackoverflow.com/users/6760", "pm_score": 6, "selected": false, "text": "var MyWidget = Class.extend({\n init: function(widget_name){\n this.widget_name = widget_name;\n },\n\n doSometh...
2008/09/17
[ "https://Stackoverflow.com/questions/84716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13850/" ]
84,717
<p>What are the best conventions of naming testing-assemblies in .NET (or any other language or platform)?</p> <p>What I'm mainly split between are these options (please provide others!):</p> <ul> <li><strong>Company.Website</strong> - <em>the project</em></li> <li><strong>Company.Website.Tests</strong></li> </ul> <p><em>or</em></p> <ul> <li><strong>Company.Website</strong></li> <li><strong>Company.WebsiteTests</strong></li> </ul> <p>The problem with the first solution is that it looks like .Tests are a sub-namespace to the site, while they really are more parallel in my mind. What happens when a new sub-namespace comes into play, like <strong>Company.Website.Controls</strong>, where should I put the tests for that namespace, for instance?</p> <p>Maybe it should even be: <strong>Tests.Company.Website</strong> and <strong>Tests.Company.Website.Controls</strong>, and so on.</p>
[ { "answer_id": 84809, "author": "Tom Carr", "author_id": 14954, "author_profile": "https://Stackoverflow.com/users/14954", "pm_score": 1, "selected": false, "text": "Company.Namespace.Test\nCompany.Namespace.Data.Test\n" }, { "answer_id": 84972, "author": "Claus Thomsen", ...
2008/09/17
[ "https://Stackoverflow.com/questions/84717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2429/" ]
84,759
<p>This is an Eclipse question, and you can assume the Java package for all these Eclipse classes is <code>org.eclipse.core.resources</code>. </p> <p>I want to get an <code>IFile</code> corresponding to a location <code>String</code> I have:</p> <pre><code> "platform:/resource/Tracbility_All_Supported_lib/processes/gastuff/globalht/GlobalHTInterface.wsdl" </code></pre> <p>I have the enclosing <code>IWorkspace</code> and <code>IWorkspaceRoot</code>. If I had the <code>IPath</code> corresponding to the location above, I could simply call <code>IWorkspaceRoot.getFileForLocation(IPath)</code>.</p> <p>How do I get the corresponding <code>IPath</code> from the location <code>String</code>? Or is there some other way to get the corresponding <code>IFile</code>?</p>
[ { "answer_id": 85074, "author": "Paul Reiners", "author_id": 7648, "author_profile": "https://Stackoverflow.com/users/7648", "pm_score": 2, "selected": false, "text": "String platformLocationString = portTypeContainer\n .getLocation();\nString locationString = platformLocationStri...
2008/09/17
[ "https://Stackoverflow.com/questions/84759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7648/" ]
84,782
<p>I am writting JAVA programme using JDBC for database conntectivity , I am calling one stored procedure in that which is returning ORACLE REF CURSOR , IS there any way I can handle that without importing ORACLE PACKAGES ?</p>
[ { "answer_id": 85766, "author": "jwiklund", "author_id": 4208, "author_profile": "https://Stackoverflow.com/users/4208", "pm_score": 2, "selected": true, "text": "select * from table( sp_returning( ? ) )\n" }, { "answer_id": 411052, "author": "tuinstoel", "author_id": 439...
2008/09/17
[ "https://Stackoverflow.com/questions/84782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14299/" ]
84,795
<p>How can I optimize the following code, which currently takes over 2 minutes to retrieve and loop through 800+ records from a pool of over 100K records, returning 6 fields per record (adds approximately 20 seconds per additional field):</p> <pre><code>&lt;cfset dllPath="C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.DirectoryServices.dll" /&gt; &lt;cfset LDAPPath="LDAP://" &amp; arguments.searchPath /&gt; &lt;cfset theLookUp=CreateObject(".NET","System.DirectoryServices.DirectoryEntry", dllPath).init(LDAPPath) /&gt; &lt;cfset theSearch=CreateObject(".NET","System.DirectoryServices.DirectorySearcher", dllPath).init(theLookUp) /&gt; &lt;cfset theSearch.Set_Filter(arguments.theFilter) /&gt; &lt;cfset theObject = theSearch.FindAll() /&gt; &lt;cfloop index="row" from="#startRow#" to="#endRow#"&gt; &lt;cfset QueryAddRow(theQuery) /&gt; &lt;cfloop list="#columnList#" index="col"&gt; &lt;cfloop from="0" to="#theObject.Get_Item(row).Get_Properties().Get_Item(col).Get_Count()-1#" index="item"&gt; &lt;cftry&gt; &lt;cfset theQuery[col][theQuery.recordCount]=ListAppend(theQuery[col][theQuery.recordCount],theObject.Get_Item(row).Get_Properties().Get_Item(col).Get_Item(item),"|") /&gt; &lt;cfcatch type="any"&gt; &lt;/cfcatch&gt; &lt;/cftry&gt; &lt;/cfloop&gt; &lt;/cfloop&gt; &lt;/cfloop&gt; </code></pre>
[ { "answer_id": 85913, "author": "Peter Boughton", "author_id": 9360, "author_profile": "https://Stackoverflow.com/users/9360", "pm_score": 3, "selected": true, "text": "<cfset dllPath=\"C:\\WINDOWS\\Microsoft.NET\\Framework\\v1.1.4322\\System.DirectoryServices.dll\" />\n<cfset LDAPPath=\...
2008/09/17
[ "https://Stackoverflow.com/questions/84795", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16289/" ]
84,800
<p>I am looking for an efficient way to pull the data I want out of an array called $submission_info so I can easily auto-fill my form fields. The array size is about 120.</p> <p>I want to find the field name and extract the content. In this case, the field name is <strong>loanOfficer</strong> and the content is <strong>John Doe</strong>.</p> <pre><code>Output of Print_r($submission_info[1]): Array ( [field_id] =&gt; 2399 [form_id] =&gt; 4 [field_name] =&gt; loanOfficer [field_test_value] =&gt; ABCDEFGHIJKLMNOPQRSTUVWXYZ [field_size] =&gt; medium [field_type] =&gt; other [data_type] =&gt; string [field_title] =&gt; LoanOfficer [col_name] =&gt; loanOfficer [list_order] =&gt; 2 [admin_display] =&gt; yes [is_sortable] =&gt; yes [include_on_redirect] =&gt; yes [option_orientation] =&gt; vertical [file_upload_dir] =&gt; [file_upload_url] =&gt; [file_upload_max_size] =&gt; 1000000 [file_upload_types] =&gt; [content] =&gt; John Doe ) </code></pre> <p>I want to find the field name and extract the content. In this case, the field name is <strong>loanOfficer</strong> and the content is <strong>John Doe</strong>.</p>
[ { "answer_id": 85117, "author": "Randy", "author_id": 9361, "author_profile": "https://Stackoverflow.com/users/9361", "pm_score": 3, "selected": true, "text": "foreach($submission_info as $elem) {\n $newarray[$elem[\"field_name\"]] = $elem[\"content\"];\n}\n" }, { "answer_id":...
2008/09/17
[ "https://Stackoverflow.com/questions/84800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16292/" ]
84,803
<p>has anyone else seen this error message. a quick check with google doesn't show me much.</p>
[ { "answer_id": 84900, "author": "jessegavin", "author_id": 5651, "author_profile": "https://Stackoverflow.com/users/5651", "pm_score": 2, "selected": false, "text": "alert($(\"#myElement\").tagName);\n" }, { "answer_id": 5640718, "author": "Abc", "author_id": 369724, ...
2008/09/17
[ "https://Stackoverflow.com/questions/84803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13800/" ]
84,817
<p>We are producing a portable code (win+macOs) and we are looking at how to make the code more rubust as it crashes every so often... (overflows or bad initializations usually) :-(</p> <p>I was reading that Google Chrome uses a process for every tab so if something goes wrong then the program does not crash compleatelly, only that tab. I think that is quite neat, so i might give it a go!</p> <p>So i was wondering if someone has some tips, help, reading list, comment, or something that can help me build more rubust c++ code (portable is always better).</p> <p>In the same topic i was also wondering if there is a portable library for processes (like boost)?</p> <p>Well many Thanks. </p>
[ { "answer_id": 85289, "author": "paercebal", "author_id": 14089, "author_profile": "https://Stackoverflow.com/users/14089", "pm_score": 1, "selected": false, "text": "doSomethingBad(T * t)\n{\n if(t == NULL) return ;\n\n // do the processing.\n}\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/84817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16269/" ]
84,837
<p>I have an ASP.NET 1.1 application, and on my local machine the submit button on my page works fine, but when I deploy it to our development application server, I click on Submit and nothing happens.. I'm assuming that the Page_Validate() function is failing and disabling the POSTBACK, but how do I debug this and determine what is failing? It sounds like some config problem since it works great on my local machine but not on the remote server...</p>
[ { "answer_id": 145061, "author": "Mauricio Scheffer", "author_id": 21239, "author_profile": "https://Stackoverflow.com/users/21239", "pm_score": 0, "selected": false, "text": "aspnet_regiis.exe -c" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/84837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7243/" ]
84,839
<p>I am trying to create an XML file based on data fields from a table, and I want to have the nodes named based on the value in a field from the table. The problem is that sometimes values entered in that column contain spaces and other characters not allowed in Node names.</p> <p>Does anyone have any code that will cleanup a passed in string and repalce invalid characters with replacement text so that it can be reversed on the other end and get the original value back?</p> <p>I am using .net (vb.net but I can read/convert c#)</p>
[ { "answer_id": 145061, "author": "Mauricio Scheffer", "author_id": 21239, "author_profile": "https://Stackoverflow.com/users/21239", "pm_score": 0, "selected": false, "text": "aspnet_regiis.exe -c" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/84839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1889/" ]
84,842
<p>I'm programmatically adding ToolStripButton items to a context menu.</p> <p>That part is easy.</p> <pre><code>this.tsmiDelete.DropDownItems.Add("The text on the item."); </code></pre> <p>However, I also need to wire up the events so that when the user clicks the item something actually happens!</p> <p>How do I do this? The method that handles the click also needs to receive some sort of id or object that relates to the particular ToolStripButton that the user clicked.</p>
[ { "answer_id": 84909, "author": "Andy", "author_id": 3857, "author_profile": "https://Stackoverflow.com/users/3857", "pm_score": 3, "selected": true, "text": "ToolStripButton btn = new ToolStripButton(\"The text on the item.\");\nthis.tsmiDelete.DropDownItems.Add(btn);\nbtn.Click += new ...
2008/09/17
[ "https://Stackoverflow.com/questions/84842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7837/" ]
84,847
<p>How do I create a self-signed certificate for code signing using tools from the Windows SDK?</p>
[ { "answer_id": 201277, "author": "Roger Lipscombe", "author_id": 8446, "author_profile": "https://Stackoverflow.com/users/8446", "pm_score": 10, "selected": true, "text": "makecert -r -pe -n \"CN=My CA\" -ss CA -sr CurrentUser ^\n -a sha256 -cy authority -sky signature -sv MyCA.p...
2008/09/17
[ "https://Stackoverflow.com/questions/84847", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8446/" ]
84,882
<p>This is a pretty simple question, at least it seems like it should be, about sudo permissions in Linux.</p> <p>There are a lot of times when I just want to append something to <code>/etc/hosts</code> or a similar file but end up not being able to because both <code>&gt;</code> and <code>&gt;&gt;</code> are not allowed, even with root.</p> <p>Is there someway to make this work without having to <code>su</code> or <code>sudo su</code> into root?</p>
[ { "answer_id": 84898, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 4, "selected": false, "text": "sudo sh -c \"echo 127.0.0.1 localhost >> /etc/hosts\"\n" }, { "answer_id": 84899, "author": "Matt P", ...
2008/09/17
[ "https://Stackoverflow.com/questions/84882", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9908/" ]
84,885
<p>Wondering if anybody out there has any success in using the JDEdwards XMLInterop functionality. I've been using it for a while (with a simple PInvoke, will post code later). I'm looking to see if there's a better and/or more robust way.</p> <p>Thanks.</p>
[ { "answer_id": 154634, "author": "Jon Dewees", "author_id": 1365, "author_profile": "https://Stackoverflow.com/users/1365", "pm_score": 4, "selected": true, "text": "namespace YourNameSpace\n" }, { "answer_id": 19598192, "author": "nkuebelbeck", "author_id": 411490, "...
2008/09/17
[ "https://Stackoverflow.com/questions/84885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1365/" ]
84,912
<p>Making a web page display correctly im all major browsers today is a very time consuming task.</p> <p>Is there a easy way to make a CSS style that looks identical in every browser? Or at least do you have some tips to make this work easier?</p>
[ { "answer_id": 84975, "author": "Toby Mills", "author_id": 12377, "author_profile": "https://Stackoverflow.com/users/12377", "pm_score": 3, "selected": false, "text": "<!--[if lte IE 6]>\n<link href=\"/css/eqtr_ie6.css\" rel=\"stylesheet\" type=\"text/css\" />\n<![endif]-->\n" }, { ...
2008/09/17
[ "https://Stackoverflow.com/questions/84912", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14635/" ]
84,932
<p>I have Perl script and need to determine the full path and filename of the script during execution. I discovered that depending on how you call the script <code>$0</code> varies and sometimes contains the <code>fullpath+filename</code> and sometimes just <code>filename</code>. Because the working directory can vary as well I can't think of a way to reliably get the <code>fullpath+filename</code> of the script.</p> <p>Anyone got a solution?</p>
[ { "answer_id": 84959, "author": "Ovid", "author_id": 8003, "author_profile": "https://Stackoverflow.com/users/8003", "pm_score": 7, "selected": false, "text": "use Cwd 'abs_path';\nprint abs_path($0);\n" }, { "answer_id": 84973, "author": "Sean", "author_id": 4919, "a...
2008/09/17
[ "https://Stackoverflow.com/questions/84932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16331/" ]
84,968
<p>If I open a file in Design View (web form), I get intellisense for my display code, but not my script code.. If I open with source code editor I, occasionally, get intellisense within the script tags. </p> <p>Anyone know how to get intellisense working all of the time for all of my code? </p> <p>Been living with this one for a long time.</p>
[ { "answer_id": 85583, "author": "devlord", "author_id": 16454, "author_profile": "https://Stackoverflow.com/users/16454", "pm_score": 1, "selected": false, "text": "<script runat=\"server\">" }, { "answer_id": 86256, "author": "madcolor", "author_id": 13954, "author_p...
2008/09/17
[ "https://Stackoverflow.com/questions/84968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13954/" ]
84,992
<p>I'm trying to register an externally hosted SQL 2000 server through Enterprise Manager which isn't on the default port and I can't see anywhere to change it within Enterprise Manager.</p> <p>So, the question is, how do I connect to the database if:</p> <p>I.P. Address is 123.456.789 (example)</p> <p>Port is 1334</p>
[ { "answer_id": 86031, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "\\\\[instance]" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/84992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
84,995
<p>I'm looking for a way to stream a PDF file from my server to the browser using .NET 2.0 (in binary).</p> <p>I'm trying to grab an existing PDF file from a server path and push that up as binary to the browser.</p>
[ { "answer_id": 85002, "author": "Darren Kopp", "author_id": 77, "author_profile": "https://Stackoverflow.com/users/77", "pm_score": 1, "selected": false, "text": "Response.OutputStream" }, { "answer_id": 85053, "author": "foxxtrot", "author_id": 10369, "author_profile...
2008/09/17
[ "https://Stackoverflow.com/questions/84995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2701/" ]
85,006
<p>I have loaded image into a new, initialized Oracle ORDImage object and am processing it by PL/SQL. I can read its properties, but cannot process it with the process() method. </p> <pre><code>vLocalImage ORDImage := ORDImage.init(); ... vLocalImage.source.localdata := PORTAL.wwdoc_admin.get_document_blob_content(pFile); vLocalImage.setProperties(); ... if vLocalImage.width &gt; lMaxWidth then vLocalImage.process('maxScale 534 401'); end if; </code></pre> <p>This should scale the image down, conserving aspect ratio, so that it is no more than 534 px wide and no more than 401 px high. </p> <p>However, I get the following error stack:</p> <pre><code>Internal error: ORA-29400: data cartridge error IMG-00710: unable to write to destination image ORA-01031: insufficient privileges </code></pre> <p>Trying other operations (like 'rotate 90') gives same errors.</p>
[ { "answer_id": 253114, "author": "Sten Vesterli", "author_id": 9363, "author_profile": "https://Stackoverflow.com/users/9363", "pm_score": 3, "selected": true, "text": " vNewImage ORDImage;\n...\n vLocalImage.processCopy('maxScale 534 401', vNewImage);\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/85006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9363/" ]
85,019
<p>Google Maps used to do this bit where when you hit the &quot;Print&quot; link, what would be sent to the printer wasn't exactly what you had on the screen, but rather a differently-formatted version of mostly the same information.</p> <p>It appears that they've largely moved away from this concept (I guess people didn't understand it) and most websites have a &quot;print version&quot; of things like articles and so forth.</p> <p>But if you wanted to make a webpage such that a &quot;printer friendly&quot; version of the page is what gets sent to the printer without having to make a separate page for it, how would you do that?</p>
[ { "answer_id": 85061, "author": "skamradt", "author_id": 9217, "author_profile": "https://Stackoverflow.com/users/9217", "pm_score": 3, "selected": false, "text": "<link rel=\"stylesheet\" type=\"text/css\" href=\"print.css\" media=\"print, handheld\" />\n<link rel=\"stylesheet\" type=\"...
2008/09/17
[ "https://Stackoverflow.com/questions/85019", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2577/" ]
85,033
<p>I am wrapping a native C++ class, which has the following methods:</p> <pre><code>class Native { public: class Local { std::string m_Str; int m_Int; }; typedef std::vector&lt;Local&gt; LocalVec; typedef LocalVec::iterator LocalIter; LocalIter BeginLocals(); LocalIter EndLocals(); private: LocalVec m_Locals; }; </code></pre> <p>1) What is the ".NET way" of representing this same kind of interface? A single method returning an array&lt;>? Does the array&lt;> generic have iterators, so that I could implement BeginLocals() and EndLocals()? </p> <p>2) Should Local be declared as a <strong>value struct</strong> in the .NET wrapper?</p> <p>I'd really like to represent the wrapped class with a .NET flavor, but I'm very new to the managed world - and this type of information is frustrating to google for...</p>
[ { "answer_id": 85402, "author": "Philip Rieck", "author_id": 12643, "author_profile": "https://Stackoverflow.com/users/12643", "pm_score": 4, "selected": true, "text": " vector<int> a_vector;\n vector<int>::iterator a_iterator;\n for(int i= 0; i < 100; i++)\n {\n a_vector.push_bac...
2008/09/17
[ "https://Stackoverflow.com/questions/85033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3114/" ]
85,034
<p>I want to make a table in SqlServer that will add, on insert, a auto incremented primary key. This should be an autoincremented id similar to MySql auto_increment functionality. (Below)</p> <pre><code>create table foo ( user_id int not null auto_increment, name varchar(50) ) </code></pre> <p>Is there a way of doing this with out creating an insert trigger?</p>
[ { "answer_id": 85042, "author": "SQLMenace", "author_id": 740, "author_profile": "https://Stackoverflow.com/users/740", "pm_score": 5, "selected": true, "text": "create table foo \n( \nuser_id int not null identity, \nname varchar(50) \n)\n" }, { "answer_id": 85858, "auth...
2008/09/17
[ "https://Stackoverflow.com/questions/85034", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12942/" ]
85,036
<p>I need to manually migrate modified stored procedures from a DEV SQL Server 2005 database instance to a TEST instance. Except for the changes I'm migrating, the databases have the same schemas. How can I quickly identify which stored procedures have been modified in the DEV database for migration to the TEST instance?</p> <p>I assume I can write a query against some of the system tables to view database objects of type stored procedure, sorting by some sort of last modified or compiled data, but I'm not sure. Maybe there is some sort of free utility someone can point me to.</p>
[ { "answer_id": 85084, "author": "RBS", "author_id": 14299, "author_profile": "https://Stackoverflow.com/users/14299", "pm_score": 0, "selected": false, "text": "SELECT name\n FROM sys.objects\n WHERE type = 'P'\n AND DATEDIFF(D,modify_date, GETDATE()) < 7\n" }, { "an...
2008/09/17
[ "https://Stackoverflow.com/questions/85036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16137/" ]
85,046
<p>Are there any good books or website that go over creating a <code>JTable</code>? I want to make one column editable. I would like to actually put a inherited <code>JCheckBox</code> component (that we created here) into one of the table columns instead of just having the table put <code>JCheckBox</code> in based on it being an editable <code>boolean</code> field.</p> <p>I have the <a href="https://rads.stackoverflow.com/amzn/click/com/0201914670" rel="nofollow noreferrer" rel="nofollow noreferrer">JFC Swing Tutorial Second Edition</a> book but I just would like to know if there are other examples I could look at and learn how to deal with the tables better. The book seems to just take the java 'trail' online and put it in the book.</p> <p>I am re-reading the stuff though, just curious if anyone has found something that might help out more.</p>
[ { "answer_id": 105005, "author": "Richard Walton", "author_id": 15075, "author_profile": "https://Stackoverflow.com/users/15075", "pm_score": 0, "selected": false, "text": "Package javax.swing.table" }, { "answer_id": 105380, "author": "morsch", "author_id": 19256, "a...
2008/09/17
[ "https://Stackoverflow.com/questions/85046", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14009/" ]
85,051
<p>Assuming network access is sporadic with no central server, what would be the best way to use git to keep three or more branches in sync? Is there a way to extract just my deltas, email those, and merge them on the other end?</p>
[ { "answer_id": 85079, "author": "Jim Puls", "author_id": 6010, "author_profile": "https://Stackoverflow.com/users/6010", "pm_score": 3, "selected": false, "text": "git-format-patch" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/85051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16203/" ]
85,058
<p>I see <a href="http://www.is-research.de/info/vmlanguages/index.html" rel="noreferrer">here</a> that there are a load of languages aside from Java that run on the JVM. I'm a bit confused about the whole concept of other languages running in the JVM. So:</p> <p>What is the advantage in having other languages for the JVM?</p> <p>What is required (in high level terms) to write a language/compiler for the JVM? </p> <p>How do you write/compile/run code in a language (other than Java) in the JVM?</p> <hr> <p><strong>EDIT:</strong> There were 3 follow up questions (originally comments) that were answered in the accepted answer. They are reprinted here for legibility:</p> <p>How would an app written in, say, JPython, interact with a Java app? </p> <p>Also, Can that JPython application use any of the JDK functions/objects?? </p> <p>What if it was Jaskell code, would the fact that it is a functional language not make it incompatible with the JDK?</p>
[ { "answer_id": 86201, "author": "toluju", "author_id": 12457, "author_profile": "https://Stackoverflow.com/users/12457", "pm_score": 6, "selected": true, "text": "from java.net import URL\nu = URL('http://jython.org')\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/85058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/142/" ]
85,085
<p>I've got an RMI call defined as:</p> <pre><code>public void remoteGetCustomerNameNumbers(ArrayList&lt;String&gt; customerNumberList, ArrayList&lt;String&gt; customerNameList) throws java.rmi.RemoteException; </code></pre> <p>The function does a database lookup and populates the two ArrayLists. The calling function gets nothing. I believe this works with Vector types.</p> <p>Do I need to use the Vector, or is there a way to get this to work without making two calls. I've got some other ideas that I'd probably use, like returning a key/value pair, but I'd like to know if I can get this to work.</p> <p>Update:<br/> I would accept all of the answers given so far if I could. I hadn't known the network cost, so It makes sense to rework the function to return a LinkedHashMap instead of the two ArrayLists.</p>
[ { "answer_id": 86847, "author": "BCunningham", "author_id": 7689, "author_profile": "https://Stackoverflow.com/users/7689", "pm_score": 1, "selected": false, "text": "public ArrayList<String> getCustomerNames() throws java.rmi.RemoteException;\n\npublic ArrayList<String> getCustomerNumbe...
2008/09/17
[ "https://Stackoverflow.com/questions/85085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16345/" ]
85,091
<p>OK, this begins to drive me crazy. I have an asp.net webapp. Pretty straightforward, most of the code in the .aspx.vb, and a few classes in App_Code.</p> <p>The problem, which has begun to occur only today (even though most of the code was already written), is that once in a while, I have this error message :</p> <blockquote> <p>Error BC30002: Type ‘XXX’ is not defined</p> </blockquote> <p>The error occurs about every time I modify the files in the App_Code folder. EDIT : OK, this happens also if I don't touch anything for a while then refresh the page. I'm still trying to figure out exactly how to trigger this error.</p> <p>I just have to wait a little bit without touching anything, then refresh the page and it works, but it's very annoying.</p> <p>So I searched a little bit, but nothing came up except imports missing. Any idea ?</p>
[ { "answer_id": 156933, "author": "thomasb", "author_id": 6776, "author_profile": "https://Stackoverflow.com/users/6776", "pm_score": 4, "selected": true, "text": "Imports CMS\n\nSub Whatever()\n Dim a as new Arbo.MyObject() ' Arbo is a namespace inside CMS\n Dim b as new Util.MyOth...
2008/09/17
[ "https://Stackoverflow.com/questions/85091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6776/" ]
85,116
<p>I want the server to always serve dates in UTC in the HTML, and have JavaScript on the client site convert it to the user's local timezone.</p> <p>Bonus if I can output in the user's locale date format.</p>
[ { "answer_id": 85161, "author": "japollock", "author_id": 1210318, "author_profile": "https://Stackoverflow.com/users/1210318", "pm_score": -1, "selected": false, "text": "usersLocalTime = new Date();\n" }, { "answer_id": 85213, "author": "dave", "author_id": 14355, "...
2008/09/17
[ "https://Stackoverflow.com/questions/85116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13989/" ]
85,119
<p>I know you can do redirection based on the domain or path to rewrite the URI to point at a site-specific location and I've also seen some brutish <code>if</code> and <code>elif</code> statements for every site as shown in the following code, which I would like to avoid.</p> <pre class="lang-py prettyprint-override"><code>if site == 'site1': ... elif site == 'site2: ... </code></pre> <p>What are some good and clever ways of running multiple sites from a single, common Python web framework (i.e., Pylons, TurboGears, etc)?</p>
[ { "answer_id": 85134, "author": "Jim", "author_id": 8427, "author_profile": "https://Stackoverflow.com/users/8427", "pm_score": 5, "selected": true, "text": "Host" }, { "answer_id": 86705, "author": "Gabriel Ross", "author_id": 10751, "author_profile": "https://Stacko...
2008/09/17
[ "https://Stackoverflow.com/questions/85119", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4919/" ]
85,122
<p>On Windows I have a problem I never encountered on Unix. That is how to get a thread to sleep for less than one millisecond. On Unix you typically have a number of choices (sleep, usleep and nanosleep) to fit your needs. On Windows, however, there is only <em>Sleep</em> with millisecond granularity. </p> <p>On Unix, I can use the use the <code>select</code> system call to create a microsecond sleep which is pretty straightforward:</p> <pre><code>int usleep(long usec) { struct timeval tv; tv.tv_sec = usec/1000000L; tv.tv_usec = usec%1000000L; return select(0, 0, 0, 0, &amp;tv); } </code></pre> <p>How can I achieve the same on Windows?</p>
[ { "answer_id": 85143, "author": "Jorge Ferreira", "author_id": 6508, "author_profile": "https://Stackoverflow.com/users/6508", "pm_score": -1, "selected": true, "text": "select" }, { "answer_id": 1448900, "author": "Hendrik", "author_id": 123411, "author_profile": "ht...
2008/09/17
[ "https://Stackoverflow.com/questions/85122", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6508/" ]
85,137
<p>Say I have a class named Frog, it looks like:</p> <pre><code>public class Frog { public int Location { get; set; } public int JumpCount { get; set; } public void OnJump() { JumpCount++; } } </code></pre> <p>I need help with 2 things:</p> <ol> <li>I want to create an event named Jump in the class definition.</li> <li>I want to create an instance of the Frog class, and then create another method that will be called when the Frog jumps.</li> </ol>
[ { "answer_id": 85188, "author": "Quintin Robinson", "author_id": 12707, "author_profile": "https://Stackoverflow.com/users/12707", "pm_score": 7, "selected": true, "text": "public event EventHandler Jump;\npublic void OnJump()\n{\n EventHandler handler = Jump;\n if (null != handler...
2008/09/17
[ "https://Stackoverflow.com/questions/85137", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1368/" ]
85,147
<p>I've never used any of the .NET generics in my work, but I understand that they are fairly popular. Does anyone have any good links or book suggestions for learning them? As a bonus; I only vaguely understand what .NET generic collections are and what they do...does anyone have any practical examples of how they might be used to greater advantage than the normal collections in .NET?</p>
[ { "answer_id": 85249, "author": "William Yeung", "author_id": 16371, "author_profile": "https://Stackoverflow.com/users/16371", "pm_score": -1, "selected": false, "text": "public T GetValue<T>() {\n return (T) ...;\n}\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/85147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13776/" ]
85,159
<p>Is there any way to parse a string in the format HH:MM into a Date (or other) object using the standard libraries?</p> <p>I know that I can parse something like "9/17/2008 10:30" into a Date object using</p> <pre><code>var date:Date = new Date(Date.parse("9/17/2008 10:30"); </code></pre> <p>But I want to parse just 10:30 by itself. The following code will not work.</p> <pre><code>var date:Date = new Date(Date.parse("10:30"); </code></pre> <p>I know I can use a custom RegEx to do this fairly easily, but it seems like this should be possible using the existing Flex API.</p>
[ { "answer_id": 87125, "author": "mikechambers", "author_id": 10232, "author_profile": "https://Stackoverflow.com/users/10232", "pm_score": 2, "selected": false, "text": "var str:String = \"9/17/2008 10:30\"\n\nvar items:Array = str.split(\" \");\nvar dateElements:Array = items[0].split(\...
2008/09/17
[ "https://Stackoverflow.com/questions/85159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1247/" ]
85,181
<p>This is pretty weird.</p> <p>I have my Profiler open and it obviously shows that a stored procedure is called. I open the database and the SP list, but the SP doesn't exist. However, there's another SP whose name is the same except it has a prefix 'x'</p> <p>Is SQL Server 2005 mapping the SP name to a different one for security purposes?</p> <p>EDIT: I found out it's a Synonym, whatever that is. </p>
[ { "answer_id": 85341, "author": "Kevin Crumley", "author_id": 1818, "author_profile": "https://Stackoverflow.com/users/1818", "pm_score": 4, "selected": true, "text": "select *\nfrom sys.objects\nwhere name = 'THE_NAME_YOU_WANT'\n" }, { "answer_id": 6598930, "author": "Amit S...
2008/09/17
[ "https://Stackoverflow.com/questions/85181", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10088/" ]
85,183
<p>I have an object that implements IDisposable that is registered with the Windsor Container and I would like to dispose of it so it's Dispose method is called and next time Resolve is called it fetches a new instance.</p> <p>Does </p> <pre><code>container.Release(obj); </code></pre> <p>automatically call Dispose() immediately? Or do I need to do</p> <pre><code>obj.Dispose(); container.Release(obj); </code></pre> <p>Couldn't find anything in the documentation on what exactly Release does</p> <p><strong>EDIT:</strong> See my answer below for the results of tests I ran. Now the question becomes, how do I force the container to release an instance of a component with a singleton lifecycle? This only needs to be done in one place and writing a custom lifecycle seems far too heavyweight, is there no built in way of doing it?</p>
[ { "answer_id": 85498, "author": "Philip Rieck", "author_id": 12643, "author_profile": "https://Stackoverflow.com/users/12643", "pm_score": 2, "selected": false, "text": "using(ISomeService service = container.Resolve<ISomeService>())\n{\n // Do stuff here\n // service.Dispose is automati...
2008/09/17
[ "https://Stackoverflow.com/questions/85183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5056/" ]
85,190
<p>Consider:</p> <pre><code>List&lt;String&gt; someList = new ArrayList&lt;String&gt;(); // add "monkey", "donkey", "skeleton key" to someList </code></pre> <pre><code>for (String item : someList) { System.out.println(item); } </code></pre> <p>What would the equivalent <code>for</code> loop look like without using the <em>for each</em> syntax?</p>
[ { "answer_id": 85206, "author": "nsayer", "author_id": 13757, "author_profile": "https://Stackoverflow.com/users/13757", "pm_score": 11, "selected": true, "text": "for (Iterator<String> i = someIterable.iterator(); i.hasNext();) {\n String item = i.next();\n System.out.println(item...
2008/09/17
[ "https://Stackoverflow.com/questions/85190", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5074/" ]
85,223
<p>Of course most languages have library functions for this, but suppose I want to do it myself.</p> <p>Suppose that the float is given like in a C or Java program (except for the 'f' or 'd' suffix), for example "<code>4.2e1</code>", "<code>.42e2</code>" or simply "<code>42</code>". In general, we have the "integer part" before the decimal point, the "fractional part" after the decimal point, and the "exponent". All three are integers.</p> <p><strong>It is easy to find and process the individual digits, but how do you compose them into a value of type <code>float</code> or <code>double</code> without losing precision?</strong></p> <p>I'm thinking of multiplying the integer part with 10^<em>n</em>, where <em>n</em> is the number of digits in the fractional part, and then adding the fractional part to the integer part and subtracting <em>n</em> from the exponent. This effectively turns <code>4.2e1</code> into <code>42e0</code>, for example. Then I could use the <code>pow</code> function to compute 10^<em>exponent</em> and multiply the result with the new integer part. The question is, does this method guarantee maximum precision throughout?</p> <p>Any thoughts on this?</p>
[ { "answer_id": 85526, "author": "user7116", "author_id": 7116, "author_profile": "https://Stackoverflow.com/users/7116", "pm_score": 5, "selected": false, "text": "/* use this to start your atof implementation */\n\n/* atoi - christopher.watford@gmail.com */\n/* PUBLIC DOMAIN */\nlong at...
2008/09/17
[ "https://Stackoverflow.com/questions/85223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14637/" ]
85,272
<p>Anyone can read the GoF book to learn what design patterns are and how to use them, but what is the process for figuring out when a design pattern solves a problem? Does the knowledge of the pattern drive the design, or is there a way to figure out how a pattern can be used to change a design?</p> <p>In other words, are there patterns for Patterns?</p>
[ { "answer_id": 279828, "author": "Charlie Martin", "author_id": 35092, "author_profile": "https://Stackoverflow.com/users/35092", "pm_score": 4, "selected": false, "text": "TYPE_t ary[SIZE] = // ... gets initialized somehow\nsize_t ix ; // Your index variable\n\nfor(ix=0; ix < SIZ...
2008/09/17
[ "https://Stackoverflow.com/questions/85272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7565/" ]
85,275
<p>I'm working on a game where I create a random map of provinces (a la Risk or Diplomacy). To create that map, I'm first generating a series of semi-random points, then figuring the Delaunay triangulations of those points. </p> <p>With that done, I am now looking to create a Voronoi diagram of the points to serve as a starting point for the province borders. My data at this point (no pun intended) consists of the original series of points and a collection of the Delaunay triangles.</p> <p>I've seen a number of ways to do this on the web, but most of them are tied up with how the Delaunay was derived. I'd love to find something that doesn't need to be integrated to the Delaunay, but can work based off the data alone. Failing that, I'm looking for something comprehensible to a relative geometry newbie, as opposed to optimal speed. Thanks!</p>
[ { "answer_id": 85484, "author": "Alexandra Franks", "author_id": 16203, "author_profile": "https://Stackoverflow.com/users/16203", "pm_score": 3, "selected": false, "text": "for yloop = 0 to height-1\n for xloop = 0 to width-1\n\n // Generate maximal value\n closest_distance = wid...
2008/09/17
[ "https://Stackoverflow.com/questions/85275", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8365/" ]
85,282
<p>In C# you can make a block inside of a method that is not attached to any other statement.</p> <pre><code> public void TestMethod() { { string x = "test"; string y = x; { int z = 42; int zz = z; } } } </code></pre> <p>This code compiles and runs just as if the braces inside the main method weren't there. Also notice the block inside of a block.</p> <p>Is there a scenario where this would be valuable? I haven't found any yet, but am curious to hear of other people's findings.</p>
[ { "answer_id": 85323, "author": "Anthony", "author_id": 5599, "author_profile": "https://Stackoverflow.com/users/5599", "pm_score": 2, "selected": false, "text": "if (someCondition)\n SimpleStatement();\n\nif (SomeCondition)\n{\n BlockOfStatements();\n}\n" }, { "answer_id": 854...
2008/09/17
[ "https://Stackoverflow.com/questions/85282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3289/" ]
85,283
<p>I'm writting a financial C# application which receive messages from the network, translate them into different object according to the message type and finaly apply the application business logic on them.</p> <p>The point is that after the business logic is applied, I'm very sure I will never need this instance again. Rather than to wait for the garbage collector to free them, I'd like to explicitly "delete" them.</p> <p>Is there a better way to do so in C#, should I use a pool of object to reuse always the same set of instance or is there a better strategy.</p> <p>The goal being to avoid the garbage collection to use any CPU during a time critical process.</p>
[ { "answer_id": 87982, "author": "Eddie Velasquez", "author_id": 12851, "author_profile": "https://Stackoverflow.com/users/12851", "pm_score": 2, "selected": false, "text": "public class MyClass: IDisposable\n{\n private bool _disposed;\n\n public void Dispose()\n {\n Disp...
2008/09/17
[ "https://Stackoverflow.com/questions/85283", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8315/" ]
85,353
<p>What is the best (or as good as possible) general SVN ignore pattern to use? </p> <p>There are a number of different IDE, editor, compiler, plug-in, platform, etc. specific files and some file types that "overlap" (i.e. desirable for some types projects and not for others). </p> <p><strong>There are however, a large number of file types that you just never want included in source control automatically regardless the specifics of your development environment.</strong></p> <p>The answer to this question would serve as a good starting point for any project - only requiring them to add the few environment specific items they need. It could be adapted for other Version Control Systems (VCS) as well.</p>
[ { "answer_id": 85371, "author": "icelava", "author_id": 2663, "author_profile": "https://Stackoverflow.com/users/2663", "pm_score": 3, "selected": false, "text": "*/bin */obj *.user *.suo\n" }, { "answer_id": 85440, "author": "noah", "author_id": 12034, "author_profil...
2008/09/17
[ "https://Stackoverflow.com/questions/85353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2233/" ]
85,370
<p>My strongest lead is that the code who deals with the incoming XMLs is actually receiving an invalid/incomplete file hence failing the DOM parsing. Any suggestions?</p>
[ { "answer_id": 85448, "author": "Hank", "author_id": 7610, "author_profile": "https://Stackoverflow.com/users/7610", "pm_score": 2, "selected": false, "text": "doc.selectSingleNode(\"//some/element/in/a/structure\");\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/85370", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6992/" ]
85,373
<p>In SQL Server, how do I "floor" a DATETIME to the second/minute/hour/day/year?</p> <p>Let's say that I have a date of <strong>2008-09-17 12:56:53.430</strong>, then the output of flooring should be:</p> <ul> <li>Year: 2008-01-01 00:00:00.000</li> <li>Month: 2008-09-01 00:00:00.000</li> <li>Day: 2008-09-17 00:00:00.000</li> <li>Hour: 2008-09-17 12:00:00.000</li> <li>Minute: 2008-09-17 12:56:00.000</li> <li>Second: 2008-09-17 12:56:53.000</li> </ul>
[ { "answer_id": 85379, "author": "Portman", "author_id": 1690, "author_profile": "https://Stackoverflow.com/users/1690", "pm_score": 8, "selected": true, "text": "declare @datetime datetime;\nset @datetime = getdate();\nselect @datetime;\nselect dateadd(year,datediff(year,0,@datetime),0);...
2008/09/17
[ "https://Stackoverflow.com/questions/85373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1690/" ]
85,451
<p>Which is better to use for timing in Python? time.clock() or time.time()? Which one provides more accuracy?</p> <p>for example:</p> <pre><code>start = time.clock() ... do something elapsed = (time.clock() - start) </code></pre> <p>vs.</p> <pre><code>start = time.time() ... do something elapsed = (time.time() - start) </code></pre>
[ { "answer_id": 85489, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 4, "selected": false, "text": "clock()" }, { "answer_id": 85511, "author": "PierreBdR", "author_id": 7136, "author_profile": "ht...
2008/09/17
[ "https://Stackoverflow.com/questions/85451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16148/" ]
85,457
<p>I am trying to inherit from my generated datacontext in LinqToSQL - something like this </p> <pre><code>public class myContext : dbDataContext { public System.Data.Linq.Table&lt;User&gt;() Users { return (from x in base.Users() where x.DeletedOn.HasValue == false select x); } } </code></pre> <p>But my Linq statement returns IQueryable which cannot cast to Table - does anyone know a way to limit the contents of a Linq.Table - I am trying to be certain that anywhere my Users table is accessed, it doesn't return those marked deleted. Perhaps I am going about this all wrong - any suggestions would be greatly appreciated.</p> <p>Hal</p>
[ { "answer_id": 85507, "author": "Scott Nichols", "author_id": 4299, "author_profile": "https://Stackoverflow.com/users/4299", "pm_score": 1, "selected": false, "text": "Users.OfType<ActiveUsers>\n" }, { "answer_id": 85989, "author": "Scott Nichols", "author_id": 4299, ...
2008/09/17
[ "https://Stackoverflow.com/questions/85457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16416/" ]
85,459
<p>I have a series of PDFs named sequentially like so:</p> <ul> <li>01_foo.pdf</li> <li>02_bar.pdf</li> <li>03_baz.pdf</li> <li>etc.</li> </ul> <p>Using Ruby, is it possible to combine these into one big PDF while keeping them in sequence? I don't mind installing any necessary gems to do the job.</p> <p>If this isn't possible in Ruby, how about another language? No commercial components, if possible.</p> <hr> <p><strong>Update:</strong> <a href="https://stackoverflow.com/questions/85459/is-it-possible-to-combine-a-series-of-pdfs-into-one-using-ruby#85618">Jason Navarrete's suggestion</a> lead to the perfect solution:</p> <p>Place the PDF files needing to be combined in a directory along with <a href="http://www.accesspdf.com/pdftk/" rel="nofollow noreferrer">pdftk</a> (or make sure pdftk is in your PATH), then run the following script:</p> <pre><code>pdfs = Dir["[0-9][0-9]_*"].sort.join(" ") `pdftk #{pdfs} output combined.pdf` </code></pre> <p>Or I could even do it as a one-liner from the command-line:</p> <pre><code>ruby -e '`pdftk #{Dir["[0-9][0-9]_*"].sort.join(" ")} output combined.pdf`' </code></pre> <p>Great suggestion Jason, perfect solution, thanks. <strong>Give him an up-vote people</strong>.</p>
[ { "answer_id": 85576, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": 2, "selected": false, "text": "system()" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/85459", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1944/" ]
85,479
<p>Can someone give an example of a good time to actually use "unsafe" and "fixed" in C# code? I've played with it before, but never actually found a good use for it. </p> <p>Consider this code...</p> <pre><code>fixed (byte* pSrc = src, pDst = dst) { //Code that copies the bytes in a loop } </code></pre> <p>compared to simply using...</p> <pre><code>Array.Copy(source, target, source.Length); </code></pre> <p>The second is the code found in the .NET Framework, the first a part of the code copied from the Microsoft website, <a href="http://msdn.microsoft.com/en-us/library/28k1s2k6(VS.80).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/28k1s2k6(VS.80).aspx</a>.</p> <p>The built in Array.Copy() is dramatically faster than using Unsafe code. This might just because the second is just better written and the first is just an example, but what kinds of situations would you really even need to use Unsafe/Fixed code for anything? Or is this poor web developer messing with something above his head?</p>
[ { "answer_id": 85774, "author": "Rune", "author_id": 7948, "author_profile": "https://Stackoverflow.com/users/7948", "pm_score": 5, "selected": false, "text": "unsafe\n{\n BitmapData bmData = bm.LockBits(...)\n byte *bits = (byte*)pixels.ToPointer();\n // Do stuff with bits\n}\n...
2008/09/17
[ "https://Stackoverflow.com/questions/85479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
85,481
<p>Say I've got this table (SQL Server 2005):</p> <pre><code>Id =&gt; integer MyField =&gt; XML </code></pre> <p><b>Id MyField</b> </p> <pre><code>1 &lt; Object&gt;&lt; Type&gt;AAA&lt; /Type&gt;&lt; Value&gt;10&lt; /Value&gt;&lt; /Object&gt;&lt; Object&gt;&lt; Type&gt;BBB&lt; /Type&gt;&lt;Value&gt;20&lt; /Value&gt;&lt; /Object&gt; 2 &lt; Object&gt;&lt; Type&gt;AAA&lt; /Type&gt;&lt; Value&gt;15&lt; /Value&gt;&lt; /Object&gt; 3 &lt; Object&gt;&lt; Type&gt;AAA&lt; /Type&gt;&lt; Value&gt;20&lt; /Value&gt;&lt; /Object&gt;&lt; Object&gt;&lt; Type&gt;BBB&lt; /Type&gt;&lt; Value&gt;30&lt; /Value&gt;&lt; /Object&gt; </code></pre> <p>I need a TSQL query which would return something like this:</p> <pre><code>Id AAA BBB 1 10 20 2 15 NULL 3 20 30 </code></pre> <p>Note that I won't know if advance how many <code>'Type'</code> (eg AAA, BBB, CCC,DDD, etc.) there will be in the xml string.</p>
[ { "answer_id": 85535, "author": "Darren Kopp", "author_id": 77, "author_profile": "https://Stackoverflow.com/users/77", "pm_score": 1, "selected": false, "text": "select id, MyField.query('/Object/Type[.=\"AAA\"]/Value') as AAA, MyField.query('/Object/Type[.=\"BBB\"]/Value) AS BBB\n" }...
2008/09/17
[ "https://Stackoverflow.com/questions/85481", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15928/" ]
85,486
<p>I'm trying to add an SVN repository to Eclipse. </p> <p>I've installed <a href="http://subclipse.tigris.org/" rel="noreferrer">Subclipse</a>, and it seems to be working fine. But, when I try to "add a new SVN repository", I input this, for example:</p> <p><em><a href="http://svn.python.org/projects/peps/trunk" rel="noreferrer">http://svn.python.org/projects/peps/trunk</a></em></p> <p>I get this:</p> <blockquote> <p>Error validating location: "org.tigris.subversion.javahl.ClientException: RA layer request failed svn: OPTIONS of '<a href="http://svn.python.org/projects/peps/trunk" rel="noreferrer">http://svn.python.org/projects/peps/trunk</a>': could not connect to server (<a href="http://svn.python.org" rel="noreferrer">http://svn.python.org</a>) " Keep location anyway?</p> </blockquote> <p>I know that my Eclipse can connect to the Internet, because I downloaded Subclipse earlier (I had to change my proxy settings). </p> <p>I get a similar message for other SVN locations I've tried to add. </p> <p>What is the solution?</p>
[ { "answer_id": 85619, "author": "bengineerd", "author_id": 10428, "author_profile": "https://Stackoverflow.com/users/10428", "pm_score": 2, "selected": false, "text": "$ svn checkout http://svn.python.org/projects/peps/trunk\n" }, { "answer_id": 85852, "author": "Mike Tunnicl...
2008/09/17
[ "https://Stackoverflow.com/questions/85486", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1179/" ]
85,487
<p>How do I perform a reverse DNS lookup, that is how do I resolve an IP address to its DNS hostname in Perl?</p>
[ { "answer_id": 85573, "author": "Joakim", "author_id": 16432, "author_profile": "https://Stackoverflow.com/users/16432", "pm_score": 4, "selected": false, "text": "use Socket;\n$iaddr = inet_aton(\"127.0.0.1\"); # or whatever address\n$name = gethostbyaddr($iaddr, AF_INET);\n" }, { ...
2008/09/17
[ "https://Stackoverflow.com/questions/85487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16432/" ]
85,500
<p>First time working with UpdatePanels in .NET. </p> <p>I have an updatepanel with a trigger pointed to an event on a FormView control. The UpdatePanel holds a ListView with related data from a separate database.</p> <p>When the UpdatePanel refreshes, it needs values from the FormView control so that on the server it can use them to query the database.</p> <p>For the life if me, I can't figure out how to get those values. The event I'm triggering from has them, but I want the updatepanel to refresh asynchronously. How do I pass values to the load event on the panel?</p> <p>Googled this ad nauseum and can't seem to get to an answer here. A link or an explanation would be immensely helpful..</p> <p>Jeff</p>
[ { "answer_id": 86520, "author": "StingyJack", "author_id": 16391, "author_profile": "https://Stackoverflow.com/users/16391", "pm_score": 3, "selected": true, "text": "<html xmlns=\"http://www.w3.org/1999/xhtml\" >\n<head runat=\"server\">\n <title>Untitled Page</title>\n <script ty...
2008/09/17
[ "https://Stackoverflow.com/questions/85500", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16426/" ]
85,553
<p>MSDN says that you should use structs when you need lightweight objects. Are there any other scenarios when a struct is preferable over a class?</p> <p>Some people might have forgotten that:</p> <ol> <li><em>structs</em> can have methods.</li> <li><em>structs</em> cannot be inherited.</li> </ol> <p>I understand the technical differences between structs and classes, I just don't have a good feel for <strong>when</strong> to use a struct.</p>
[ { "answer_id": 470416, "author": "Andrei Rînea", "author_id": 1796, "author_profile": "https://Stackoverflow.com/users/1796", "pm_score": 6, "selected": false, "text": "public struct ThreeDimensionalPoint\n{\n public readonly int X, Y, Z;\n public ThreeDimensionalPoint(int x, int y...
2008/09/17
[ "https://Stackoverflow.com/questions/85553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/781/" ]
85,559
<p>I have a problem in my project with the .designer which as everyone know is autogenerated and I ahvent changed at all. One day I was working fine, I did a back up and next day boom! the project suddenly stops working and sends a message that the designer cant procees a code line... and due to this I get more errores (2 in my case), I even had a back up from the day it was working and is useless too, I get the same error, I tryed in my laptop and the same problem comes. How can I delete the &quot;FitTrack&quot;? The incredible part is that while I was trying on the laptop the errors on the desktop were gone in front of my eyes, one and one second later the other one (but still have the warning from the designer and cant see the form), I closed and open it again and again I have the errors...</p> <p>The error is:</p> <pre><code>Warning 1 The designer cannot process the code at line 27: Me.CrystalReportViewer1.ReportSource = Me.CrystalReport11 The code within the method 'InitializeComponent' is generated by the designer and should not be manually modified. Please remove any changes and try opening the designer again. C:\Documents and Settings\Alan Cardero\Desktop\Reportes Liquidacion\Reportes Liquidacion\Reportes Liquidacion\Form1.Designer.vb 28 0 </code></pre>
[ { "answer_id": 85602, "author": "Quintin Robinson", "author_id": 12707, "author_profile": "https://Stackoverflow.com/users/12707", "pm_score": 1, "selected": false, "text": "If(Not DesignMode) Then Me.CrystalReportViewer1.ReportSource = Me.CrystalReport11\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/85559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
85,577
<p>I'd like to search for a given MAC address on my network, all from within a Python script. I already have a map of all the active IP addresses in the network but I cannot figure out how to glean the MAC address. Any ideas?</p>
[ { "answer_id": 85632, "author": "Sylvain Defresne", "author_id": 5353, "author_profile": "https://Stackoverflow.com/users/5353", "pm_score": 1, "selected": false, "text": "arping" }, { "answer_id": 86541, "author": "akiva", "author_id": 65724, "author_profile": "https...
2008/09/17
[ "https://Stackoverflow.com/questions/85577", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11760/" ]
85,622
<p>Most precompiled Windows binaries are made with the MSYS+gcc toolchain. It uses MSVCRT runtime, which is incompatible with Visual C++ 2005/2008.</p> <p>So, how to go about and compile Cairo 1.6.4 (or later) for Visual C++ only. Including dependencies (png,zlib,pixman).</p>
[ { "answer_id": 96168, "author": "jfs", "author_id": 6223, "author_profile": "https://Stackoverflow.com/users/6223", "pm_score": 0, "selected": false, "text": "config.h" }, { "answer_id": 6704146, "author": "Sergeq", "author_id": 846031, "author_profile": "https://Stac...
2008/09/17
[ "https://Stackoverflow.com/questions/85622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14455/" ]
85,649
<p>How do I remove a USB drive using the Win32 API? I do a lot of work on embedded systems and on one of these I have to copy my programs on a USB stick and insert it into the target hardware.</p> <p>Since I mostly work on the console I don't like to use the mouse and click on the small task-bar icon hundred times a day. </p> <p>I'd love to write a little program to do exactly that so I can put it into my makefiles, but I haven't found any API call that does the same thing.</p> <p>Any ideas?</p>
[ { "answer_id": 85678, "author": "Grant Wagner", "author_id": 9254, "author_profile": "https://Stackoverflow.com/users/9254", "pm_score": 3, "selected": false, "text": "sync -e [drive_letter]" }, { "answer_id": 85694, "author": "Kris Kumler", "author_id": 4281, "author...
2008/09/17
[ "https://Stackoverflow.com/questions/85649", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15955/" ]
85,675
<p>I have two tables I would like to complare. One of the columns is type CLOB. I would like to do something like this:</p> <pre><code>select key, clob_value source_table minus select key, clob_value target_table </code></pre> <p>Unfortunately, Oracle can't perform minus operations on clobs. How can I do this?</p>
[ { "answer_id": 85716, "author": "hamishmcn", "author_id": 3590, "author_profile": "https://Stackoverflow.com/users/3590", "pm_score": 2, "selected": false, "text": "select key, to_hash_str_val(glob_value) from source_table\nminus\nselect key, to_hash_str_val(glob_value) from target_table...
2008/09/17
[ "https://Stackoverflow.com/questions/85675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16484/" ]
85,699
<p>I'm building a group calendar application that needs to support recurring events, but all the solutions I've come up with to handle these events seem like a hack. I can limit how far ahead one can look, and then generate all the events at once. Or I can store the events as repeating and dynamically display them when one looks ahead on the calendar, but I'll have to convert them to a normal event if someone wants to change the details on a particular instance of the event.</p> <p>I'm sure there's a better way to do this, but I haven't found it yet. What's the best way to model recurring events, where you can change details of or delete particular event instances?</p> <p>(I'm using Ruby, but please don't let that constrain your answer. If there's a Ruby-specific library or something, though, that's good to know.)</p>
[ { "answer_id": 85909, "author": "Purfideas", "author_id": 4615, "author_profile": "https://Stackoverflow.com/users/4615", "pm_score": 2, "selected": false, "text": "#!/usr/bin/ruby\nrequire 'date'\n\nstart_date = Date.parse('2008-01-01')\nend_date = Date.parse('2008-04-01')\nwday = 5 #...
2008/09/17
[ "https://Stackoverflow.com/questions/85699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6262/" ]
85,701
<p>I have a database field that contains a raw date field (stored as character data), such as </p> <blockquote> <p>Friday, September 26, 2008 8:30 PM Eastern Daylight Time</p> </blockquote> <p>I can parse this as a Date easily, with SimpleDateFormat</p> <pre><code>DateFormat dbFormatter = new SimpleDateFormat("EEEE, MMMM dd, yyyy hh:mm aa zzzz"); Date scheduledDate = dbFormatter.parse(rawDate); </code></pre> <p>What I'd like to do is extract a TimeZone object from this string. The default TimeZone in the JVM that this application runs in is GMT, so I can't use <code>.getTimezoneOffset()</code> from the <code>Date</code> parsed above (because it will return the default TimeZone).</p> <p>Besides tokenizing the raw string and finding the start position of the Timezone string (since I know the format will always be <code>EEEE, MMMM dd, yyyy hh:mm aa zzzz</code>) is there a way using the DateFormat/SimpleDateFormat/Date/Calendar API to extract a TimeZone object - which will have the same TimeZone as the String I've parsed apart with <code>DateFormat.parse()</code>?</p> <p>One thing that bugs me about <code>Date</code> vs <code>Calendar</code> in the Java API is that <code>Calendar</code> is supposed to replace <code>Date</code> in all places... but then they decided, oh hey let's still use <code>Date</code>'s in the <code>DateFormat</code> classes.</p>
[ { "answer_id": 86183, "author": "Ed Thomas", "author_id": 8256, "author_profile": "https://Stackoverflow.com/users/8256", "pm_score": 2, "selected": false, "text": " DateFormat dbFormatter = new SimpleDateFormat(\"EEEE, MMMM dd, yyyy hh:mm aa zzzz\");\n dbFormatter.setTimeZ...
2008/09/17
[ "https://Stackoverflow.com/questions/85701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4249/" ]
85,702
<p>I want to have a "select-only" <code>ComboBox</code> that provides a list of items for the user to select from. Typing should be disabled in the text portion of the <code>ComboBox</code> control.</p> <p>My initial googling of this turned up an overly complex, misguided suggestion to capture the <code>KeyPress</code> event.</p>
[ { "answer_id": 85706, "author": "Cory Engebretson", "author_id": 3406, "author_profile": "https://Stackoverflow.com/users/3406", "pm_score": 10, "selected": true, "text": "stateComboBox.DropDownStyle = ComboBoxStyle.DropDownList;\n" }, { "answer_id": 26005210, "author": "inve...
2008/09/17
[ "https://Stackoverflow.com/questions/85702", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3406/" ]
85,724
<p>I've got an Active Directory synchronization tool (.NET 2.0 / C#) written as a Windows Service that I've been working on for a while and have recently been tasked with adding the ability to drive events based on changes in group membership. The basic scenario is that users are synchronized with a security database and, when group membership changes, the users need to have their access rights changed (ie. if I am now a member of "IT Staff" then I should automatically receive access to the server room, if I am removed from that group then I should automatically lose access to the server room).</p> <p>The problem is that when doing a DirectorySynchronization against groups you receive back the group that has had a member added/removed, and from there when you grab the members list you get back the list of all members in that group currently not just the members that have been added or removed. This leads me to quite an efficiency problem - that being that in order to know if a user has been added or removed I will have to keep locally a list of each group and all members and compare that against the current list to see who has been added (not in local list), and who has been deleted (in local list, not in current members list). </p> <p>I'm debating just storing the group membership details in a DataSet in memory and writing to disk each time I've processed new membership changes. That way if the service stops/crashes or the machine is rebooted I can still get to the current state of the Active Directory within the security database by comparing the last information on disk to that from the current group membership list. However, this seems terrible inefficient - running through every member in the group to compare against what is in the dataset and then writing out changes to disk each time there are changes to the list.</p> <p>Has anyone dealt with this scenario before? Is there some way that I haven't found to retrieve only a delta of group members? What would you do in this situation to ensure that you never miss any changes while taking the smallest performance hit possible?</p> <p><strong>Edit:</strong> The AD might contain 500 users, it might contain 200,000 users - it depends on the customer, and on top of that how many groups the average user is a member of</p>
[ { "answer_id": 86141, "author": "Claus Thomsen", "author_id": 15555, "author_profile": "https://Stackoverflow.com/users/15555", "pm_score": 2, "selected": false, "text": " EventLog myLog = new EventLog(\"Security\");\n\n // set event handler\n myLog.EntryWritten += n...
2008/09/17
[ "https://Stackoverflow.com/questions/85724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12063/" ]
85,726
<p>Is it possible to convert floating point exceptions (signals) into C++ exceptions on x86 Linux?</p> <p>This is for debugging purposes, so nonportability and imperfection is okay (e.g., if it isn't 100% guaranteed that all destructors are called).</p>
[ { "answer_id": 88829, "author": "jwfearn", "author_id": 10559, "author_profile": "https://Stackoverflow.com/users/10559", "pm_score": 3, "selected": false, "text": "fetestexcept" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/85726", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16480/" ]
85,761
<p>I have an external variable coming in as a string and I would like to do a switch/case on it. How do I do that in xquery?</p>
[ { "answer_id": 85780, "author": "Sixty4Bit", "author_id": 1681, "author_profile": "https://Stackoverflow.com/users/1681", "pm_score": 2, "selected": false, "text": "let $str := \"kitchen\"\nlet $room := element {$str} {}\n" }, { "answer_id": 171837, "author": "Oliver Hallam",...
2008/09/17
[ "https://Stackoverflow.com/questions/85761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1681/" ]
85,770
<p>here is the input i am getting from my flash file </p> <p>process.php?Q2=898&amp;Aa=Grade1&amp;Tim=0%3A0%3A12&amp;Q1=908&amp;Bb=lkj&amp;Q4=jhj&amp;Q3=08&amp;Cc=North%20America&amp;Q0=1</p> <p>and in php i use this code foreach ($_GET as $field => $label) { $datarray[]=$_GET[$field];</p> <pre><code>echo "$field :"; echo $_GET[$field];; echo "&lt;br&gt;"; </code></pre> <p>i get this out put</p> <p>Q2 :898 Aa :Grade1 Tim :0:0:12 Q1 :908 Bb :lkj Q4 :jhj Q3 :08 Cc :North America Q0 :1</p> <p>now my question is how do i sort it alphabaticaly so it should look like this Aa :Grade1 Bb :lkj Cc :North America Q0 :1 Q1 :908</p> <p>and so on....before i can insert it into the DB</p>
[ { "answer_id": 85792, "author": "terminus", "author_id": 9232, "author_profile": "https://Stackoverflow.com/users/9232", "pm_score": 4, "selected": true, "text": "ksort($_GET);\n" }, { "answer_id": 85841, "author": "micahwittman", "author_id": 11181, "author_profile":...
2008/09/17
[ "https://Stackoverflow.com/questions/85770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16458/" ]
85,773
<p>My source code needs to support both .NET version 1.1 and 2.0 ... how do I test for the different versions &amp; what is the best way to deal with this situation.</p> <p>I'm wondering if I should have the two sections of code inline, in separate classes, methods etc. What do you think?</p>
[ { "answer_id": 85902, "author": "Scott Dorman", "author_id": 1559, "author_profile": "https://Stackoverflow.com/users/1559", "pm_score": 2, "selected": true, "text": "#if NET11\n// .NET 1.1 code\n#elif NET20\n// .NET 2.0 code\n#endif\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/85773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4491/" ]
85,804
<p>Is there a better way to forcefully disconnect all users from an Oracle 10g database schema than restarting the Oracle database services?</p> <p>We have several developers using SQL Developer connecting to the same schema on a single Oracle 10g server. The problem is that when we want to drop the schema to rebuild it, inevitably someone is still connected and we cannot drop the database schema or the user while someone is still connected.</p> <p>By the same token, we do not want to drop all connections to other schemas because other people may still be connected and testing with those schemas.</p> <p>Anyone know of a quick way to resolve this?</p>
[ { "answer_id": 86739, "author": "Sten Vesterli", "author_id": 9363, "author_profile": "https://Stackoverflow.com/users/9363", "pm_score": 8, "selected": true, "text": "select sid,serial# from v$session where username = '<your_schema>'" }, { "answer_id": 9417191, "author": "Li...
2008/09/17
[ "https://Stackoverflow.com/questions/85804", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15766/" ]
85,815
<p>How do you tell if a function in JavaScript is defined?</p> <p>I want to do something like this</p> <pre><code>function something_cool(text, callback) { alert(text); if( callback != null ) callback(); } </code></pre> <p>But it gets me a</p> <blockquote> <p>callback is not a function</p> </blockquote> <p>error when callback is not defined.</p>
[ { "answer_id": 85822, "author": "Tom Ritter", "author_id": 8435, "author_profile": "https://Stackoverflow.com/users/8435", "pm_score": 10, "selected": true, "text": "typeof callback === \"function\"\n" }, { "answer_id": 85825, "author": "bdukes", "author_id": 2688, "a...
2008/09/17
[ "https://Stackoverflow.com/questions/85815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8351/" ]
85,816
<p>I've got just one page that I want to force to be accessed as an HTTPS page (PHP on Apache). How do I do this without making the whole directory require HTTPS? Or, if you submit a form to an HTTPS page from an HTTP page, does it send it by HTTPS instead of HTTP?</p> <p>Here is my example:</p> <pre><code>http://www.example.com/some-page.php </code></pre> <p>I want it to only be accessed through:</p> <pre><code>https://www.example.com/some-page.php </code></pre> <p>Sure, I can put all of the links to this page pointed at the HTTPS version, but that doesn't stop some fool from accessing it through HTTP on purpose...</p> <p>One thing I thought was putting a redirect in the header of the PHP file to check to be sure that they are accessing the HTTPS version:</p> <pre><code>if($_SERVER[&quot;SCRIPT_URI&quot;] == &quot;http://www.example.com/some-page.php&quot;){ header('Location: https://www.example.com/some-page.php'); } </code></pre> <p>But that can't be the right way, can it?</p>
[ { "answer_id": 85835, "author": "thebigjc", "author_id": 16507, "author_profile": "https://Stackoverflow.com/users/16507", "pm_score": 6, "selected": false, "text": "<Location /buyCrap.php>\nRewriteEngine On\nRewriteCond %{HTTPS} off\nRewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}\n...
2008/09/17
[ "https://Stackoverflow.com/questions/85816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
85,880
<p>Currently I'm doing some unit tests which are executed from bash. Unit tests are initialized, executed and cleaned up in a bash script. This script usualy contains an init(), execute() and cleanup() functions. But they are not mandatory. I'd like to test if they are or are not defined.</p> <p>I did this previously by greping and seding the source, but it seemed wrong. Is there a more elegant way to do this?</p> <p>Edit: The following sniplet works like a charm:</p> <pre><code>fn_exists() { LC_ALL=C type $1 | grep -q 'shell function' } </code></pre>
[ { "answer_id": 85903, "author": "JBB", "author_id": 12332, "author_profile": "https://Stackoverflow.com/users/12332", "pm_score": 9, "selected": true, "text": "[[ $(type -t foo) == function ]] && echo \"Foo exists\"" }, { "answer_id": 85932, "author": "Allan Wind", "autho...
2008/09/17
[ "https://Stackoverflow.com/questions/85880", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9232/" ]