qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
243,494
<p>I have some legacy code that uses VBA to parse a word document and build some XML output; </p> <p>Needless to say it runs like a dog but I was interested in profiling it to see where it's breaking down and maybe if there are some options to make it faster.</p> <p>I don't want to try anything until I can start meas...
[ { "answer_id": 243545, "author": "Svante Svenson", "author_id": 19707, "author_profile": "https://Stackoverflow.com/users/19707", "pm_score": 0, "selected": false, "text": "Debug.Print \"before/after foo\", Now\n" }, { "answer_id": 244103, "author": "Aardvark", "author_id...
2008/10/28
[ "https://Stackoverflow.com/questions/243494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24525/" ]
243,504
<p>How would one go about capturing users keystrokes in the SMS composer on the Symbian OS, specifically for a Nokia N73 (or any of the symbian supported devices <a href="http://en.wikipedia.org/wiki/Symbian_OS#Devices_that_have_used_the_Symbian_OS" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Symbian_OS#Devi...
[ { "answer_id": 286611, "author": "KevinD", "author_id": 26497, "author_profile": "https://Stackoverflow.com/users/26497", "pm_score": 3, "selected": true, "text": "RWindowGroup::CaptureKey() RWindowGroup::CaptureLongKey() RWsSession::SendEventToWindowGroup() TApaTask::SendKey()" } ]
2008/10/28
[ "https://Stackoverflow.com/questions/243504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/368855/" ]
243,510
<p>Does anyone know what is wrong with this query?</p> <pre><code> SELECT DISTINCT c.CN as ClaimNumber, a.ItemDate as BillReceivedDate, c.DTN as DocTrackNumber FROM ItemData a, ItemDataPage b, KeyGroupData c WHERE a.ItemTypeNum in (112, 113, 116, 172, 189) AND a....
[ { "answer_id": 243520, "author": "Chris Conway", "author_id": 2849, "author_profile": "https://Stackoverflow.com/users/2849", "pm_score": 2, "selected": false, "text": " SELECT DISTINCT c.CN as ClaimNumber, \na.ItemDate as BillReceivedDate, \nc.DTN as DocTrackNumber, \na.Date...
2008/10/28
[ "https://Stackoverflow.com/questions/243510", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2849/" ]
243,528
<p>We're looking at using Oracle Hierarchical queries to model potentially very large tree structures (potentially infinitely wide, and depth of 30+). My understanding is that hierarchal queries provide a method to write recursively joining SQL but they it does not provide any real performance enhancements over if you ...
[ { "answer_id": 245156, "author": "dacracot", "author_id": 13930, "author_profile": "https://Stackoverflow.com/users/13930", "pm_score": 1, "selected": false, "text": "CREATE TABLE\n loopy\n (key NUMBER, key_hier number, info VARCHAR2, part NUMBER)\nPARTITION BY\n RANGE (part)\n ...
2008/10/28
[ "https://Stackoverflow.com/questions/243528", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9155/" ]
243,553
<p>How can I find out which row in a JTable the user just clicked?</p>
[ { "answer_id": 243560, "author": "Paul Tomblin", "author_id": 3333, "author_profile": "https://Stackoverflow.com/users/3333", "pm_score": 6, "selected": true, "text": "aJTable.rowAtPoint(evt.getPoint());" }, { "answer_id": 245005, "author": "oxbow_lakes", "author_id": 168...
2008/10/28
[ "https://Stackoverflow.com/questions/243553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24028/" ]
243,554
<p>I'm currently creating a window system for XNA games from scratch. I'm developing primarily for Windows, but who knows what platforms I might support in the future. Feel free to answer if you know this for native Direct3D, since the performance semantics should be similar. If possible, consider what would change if ...
[ { "answer_id": 1133845, "author": "Jodi", "author_id": 127081, "author_profile": "https://Stackoverflow.com/users/127081", "pm_score": 2, "selected": false, "text": "size (bits) = width x height x color data size (bits)\n 3,515625MB = 29491200 bits = 1280 x 760 x 32 bits\n" } ]
2008/10/28
[ "https://Stackoverflow.com/questions/243554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20363/" ]
243,567
<p>The database type is PostGres 8.3.</p> <p>If I wrote: </p> <pre><code>SELECT field1, field2, field3, count(*) FROM table1 GROUP BY field1, field2, field3 having count(*) &gt; 1; </code></pre> <p>I have some rows that have a count over 1. How can I take out the duplicate (I do still want 1 row for each of them in...
[ { "answer_id": 243627, "author": "Jonathan Leffler", "author_id": 15168, "author_profile": "https://Stackoverflow.com/users/15168", "pm_score": 0, "selected": false, "text": "CREATE <temporary table> (<correct structure for table being cleaned>);\nBEGIN WORK; -- if needed\nINSERT INTO ...
2008/10/28
[ "https://Stackoverflow.com/questions/243567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13913/" ]
243,568
<p>I found in a bug in an old C++ MFC program we have that calculates an offset (in days) for a given date from a fixed base date. We were seeing results that were off by one for some reason, and I tracked it down to where the original programmer had used the CTimeSpan.GetDays() method. According to the <a href="http...
[ { "answer_id": 243841, "author": "Mark Ransom", "author_id": 5987, "author_profile": "https://Stackoverflow.com/users/5987", "pm_score": 3, "selected": true, "text": "CTime startDay(start.GetYear(), start.GetMonth(), start.GetDay(), 0, 0, 0);\nCTime finishDay(finish.GetYear(), finish.Get...
2008/10/28
[ "https://Stackoverflow.com/questions/243568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3043/" ]
243,569
<p>consider this code block</p> <pre><code>public void ManageInstalledComponentsUpdate() { IUpdateView view = new UpdaterForm(); BackgroundWorker worker = new BackgroundWorker(); Update update = new Update(); worker.WorkerReportsProgress = true; worke...
[ { "answer_id": 243600, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 4, "selected": true, "text": "using System;\nusing System.ComponentModel;\nusing System.Threading;\nusing System.Windows.Forms;\nclass Demo : Form\n...
2008/10/28
[ "https://Stackoverflow.com/questions/243569", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30324/" ]
243,572
<p>I am configure log4net to use a composite RollingFileAppender so that the current file is always named <strong>logfile.log</strong> and all subsequent files are named <strong>logfile-YYYY.MM.dd.seq.log</strong> where <strong>seq</strong> is the sequence number if a log exceeds a certain size within a single day. Un...
[ { "answer_id": 243607, "author": "Leandro López", "author_id": 22695, "author_profile": "https://Stackoverflow.com/users/22695", "pm_score": 2, "selected": false, "text": "protected string GetNextOutputFileName(string fileName)\n{\n if (!m_staticLogFileName) \n {\n fileName ...
2008/10/28
[ "https://Stackoverflow.com/questions/243572", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19977/" ]
243,617
<p>I have a Java based web-application and a new requirement to allow Users to place variables into text fields that are replaced when a document or other output is produced. How have others gone about this?</p> <p>I was thinking of having a pre-defined set of variables such as :<br> <code>@BOOKING_NUMBER@</code><br> ...
[ { "answer_id": 243781, "author": "belugabob", "author_id": 13397, "author_profile": "https://Stackoverflow.com/users/13397", "pm_score": 2, "selected": false, "text": "MessageFormat.format(\"This is some text for booking {0} that is needed by me, for use with invoice {1}\", bookingNumber...
2008/10/28
[ "https://Stackoverflow.com/questions/243617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2955/" ]
243,644
<p>I have currently more than 100 connections in Sleep state.</p> <p>Some connection must stay in Sleep state (and don't close) because it's permanent connection but some others (with a different user name) are from some php script and I want them to timeout very fast.</p> <p>Is it possible to setup a wait_timeout pe...
[ { "answer_id": 244291, "author": "Gary Richardson", "author_id": 2506, "author_profile": "https://Stackoverflow.com/users/2506", "pm_score": 0, "selected": false, "text": "mysql.user +-----------------------+-----------------------------------+------+-----+---------+-------+\n| Field ...
2008/10/28
[ "https://Stackoverflow.com/questions/243644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6605/" ]
243,646
<p>I've got an <code>RSA</code> private key in <code>PEM</code> format, is there a straight forward way to read that from .NET and instantiate an <code>RSACryptoServiceProvider</code> to decrypt data encrypted with the corresponding public key?</p>
[ { "answer_id": 243685, "author": "wprl", "author_id": 17847, "author_profile": "https://Stackoverflow.com/users/17847", "pm_score": 5, "selected": false, "text": "//------- Parses binary ans.1 RSA private key; returns RSACryptoServiceProvider ---\npublic static RSACryptoServiceProvider ...
2008/10/28
[ "https://Stackoverflow.com/questions/243646", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32093/" ]
243,683
<p>How do I extract the value of a property in a PropertyCollection?</p> <p>If I drill down on the 'Properties' in the line below is visual studion I can see the value but how do I read it?</p> <pre><code>foreach (string propertyName in result.Properties.PropertyNames) { MessageBox.Show(ProperyNames[0].Value.ToStri...
[ { "answer_id": 243703, "author": "steve", "author_id": 32103, "author_profile": "https://Stackoverflow.com/users/32103", "pm_score": -1, "selected": false, "text": "foreach (string propertyName in result.Properties.PropertyNames)\n{ MessageBox.Show(properyName.ToString()); <--Wrong!\n}\...
2008/10/28
[ "https://Stackoverflow.com/questions/243683", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
243,691
<p>[Error] WARNING. Duplicate resource(s): [Error] Type 2 (BITMAP), ID TWWDBRICHEDITMSWORD: [Error] File C:\Borland\Delphi7\ip4000vcl7\LIB\wwrichsp.RES resource kept; file C:\Borland\Delphi7\ip4000vcl7\LIB\wwrichsp.RES resource discarded. I have searched the code for same named objects, like objects. Can a...
[ { "answer_id": 243890, "author": "Lars Truijens", "author_id": 1242, "author_profile": "https://Stackoverflow.com/users/1242", "pm_score": 2, "selected": false, "text": "{$R wwrichsp.RES}\n" } ]
2008/10/28
[ "https://Stackoverflow.com/questions/243691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
243,696
<p>MathWorks currently doesn't allow you to use <code>cout</code> from a mex file when the MATLAB desktop is open because they have redirected stdout. Their current workaround is providing a function, <a href="http://www.mathworks.com/support/tech-notes/1600/1605.html" rel="nofollow noreferrer">mexPrintf, that they re...
[ { "answer_id": 244286, "author": "Max Lybbert", "author_id": 10593, "author_profile": "https://Stackoverflow.com/users/10593", "pm_score": 0, "selected": false, "text": "cout cout fstream ofstream cout rdbuf" }, { "answer_id": 244584, "author": "Shane Powell", "author_id"...
2008/10/28
[ "https://Stackoverflow.com/questions/243696", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27315/" ]
243,701
<p>I'd like to check a few queries generated by ActiveRecord, but I don't need to actually run them. Is there a way to get at the query before it returns its result?</p>
[ { "answer_id": 243934, "author": "Gene T", "author_id": 413049, "author_profile": "https://Stackoverflow.com/users/413049", "pm_score": 2, "selected": false, "text": "construct_finder_sql,\n" }, { "answer_id": 1634280, "author": "gtd", "author_id": 8376, "author_profi...
2008/10/28
[ "https://Stackoverflow.com/questions/243701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1190/" ]
243,712
<p>Hey! I was looking at this code at <a href="http://www.gnu.org/software/m68hc11/examples/primes_8c-source.html" rel="noreferrer">http://www.gnu.org/software/m68hc11/examples/primes_8c-source.html</a></p> <p>I noticed that in some situations they used hex numbers, like in line 134:</p> <pre><code>for (j = 1; val &a...
[ { "answer_id": 243727, "author": "James Curran", "author_id": 12725, "author_profile": "https://Stackoverflow.com/users/12725", "pm_score": 8, "selected": true, "text": "j 0000:0001 0000:0010 0000:0100 0000:1000 0001:0000 0010:0000 0100:0000 1000:0000 0x01 0x02 0x04 0x08 0x10 0x20 0x40 0...
2008/10/28
[ "https://Stackoverflow.com/questions/243712", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8715/" ]
243,728
<p>I got dtd in file and I cant remove it. When i try to parse it in Java I get "Caused by: java.net.SocketException: Network is unreachable: connect", because its remote dtd. can I disable somehow dtd checking?</p>
[ { "answer_id": 243747, "author": "toolkit", "author_id": 3295, "author_profile": "https://Stackoverflow.com/users/3295", "pm_score": 5, "selected": true, "text": "<?xml version=\"1.0\"?>\n<!DOCTYPE foo PUBLIC \"//FOO//\" \"foo.dtd\">\n<foo>\n <bar>Value</bar>\n</foo>\n import java.io....
2008/10/28
[ "https://Stackoverflow.com/questions/243728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30453/" ]
243,734
<p>I am trying to compile a labview CIN using visual studio 2003.</p> <p>I have followed the tutorial located <a href="http://zone.ni.com/devzone/cda/tut/p/id/3172" rel="nofollow noreferrer">here</a> to the letter, but am getting the following error:</p> <blockquote> <p>Project : error PRJ0019: A tool returned an e...
[ { "answer_id": 243762, "author": "Tim", "author_id": 10755, "author_profile": "https://Stackoverflow.com/users/10755", "pm_score": 0, "selected": false, "text": "\"$(CINTOOLS_DIR)\\lvsbutil\" \"$(TargetName)\" -d \"$(ProjectDir)$(OutDir)\"\n $(OutDir)$(TargetName).lsb" } ]
2008/10/28
[ "https://Stackoverflow.com/questions/243734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1555/" ]
243,750
<p>I've searched around a bit for similar questions, but other than running one command or perhaps a few command with items such as:</p> <pre><code>ssh user@host -t sudo su - </code></pre> <p>However, what if I essentially need to run a script on (let's say) 15 servers at once. Is this doable in bash? In a perfect wo...
[ { "answer_id": 243803, "author": "antik", "author_id": 1625, "author_profile": "https://Stackoverflow.com/users/1625", "pm_score": 3, "selected": false, "text": "man expect" }, { "answer_id": 243818, "author": "Yang Zhao", "author_id": 31095, "author_profile": "https:...
2008/10/28
[ "https://Stackoverflow.com/questions/243750", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14838/" ]
243,752
<p>Is there a way to do this without iterating through the List and adding the items to the ObservableCollection?</p>
[ { "answer_id": 243766, "author": "Nescio", "author_id": 14484, "author_profile": "https://Stackoverflow.com/users/14484", "pm_score": 6, "selected": true, "text": "Dim list as new List(of string)\n...some stuff to fill the list...\nDim observable as new ObservableCollection(of string)(li...
2008/10/28
[ "https://Stackoverflow.com/questions/243752", "https://Stackoverflow.com", "https://Stackoverflow.com/users/132931/" ]
243,777
<p>do you know any not strict xpath for java? (I want it to not check dtd and schema) and it would be cool if it dont care about correct xml.</p>
[ { "answer_id": 243866, "author": "David M. Karr", "author_id": 10508, "author_profile": "https://Stackoverflow.com/users/10508", "pm_score": 0, "selected": false, "text": "/*[local-name()='foo']/*[local-name()='bar']\n" } ]
2008/10/28
[ "https://Stackoverflow.com/questions/243777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30453/" ]
243,782
<p>I'm trying to select a column from a single table (no joins) and I need the count of the number of rows, ideally before I begin retrieving the rows. I have come to two approaches that provide the information I need.</p> <p><strong>Approach 1:</strong></p> <pre><code>SELECT COUNT( my_table.my_col ) AS row_count ...
[ { "answer_id": 243963, "author": "JosephStyons", "author_id": 672, "author_profile": "https://Stackoverflow.com/users/672", "pm_score": 2, "selected": false, "text": "SELECT \n mt.my_row,\n (SELECT COUNT(mt2.my_row) FROM my_table mt2 WHERE mt2.foo = mt.foo) as cnt\nFROM my_table mt\nWHE...
2008/10/28
[ "https://Stackoverflow.com/questions/243782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1625/" ]
243,790
<p>I have this table in an Oracle DB which has a primary key defined on 3 of the data columns. I want to drop the primary key constraint to allow rows with duplicate data for those columns, and create a new column, 'id', to contain an auto-incrementing integer ID for these rows. I know how to create a sequence and trig...
[ { "answer_id": 243838, "author": "Steve", "author_id": 15470, "author_profile": "https://Stackoverflow.com/users/15470", "pm_score": 2, "selected": false, "text": "update\ntable\nset id = rownum\n" }, { "answer_id": 244080, "author": "Tony Andrews", "author_id": 18747, ...
2008/10/28
[ "https://Stackoverflow.com/questions/243790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3101/" ]
243,794
<p>I'm using the latest version of the <a href="https://jqueryui.com/tabs/" rel="nofollow noreferrer">jQuery UI tabs</a>. I have tabs positioned toward the bottom of the page. </p> <p>Every time I click a tab, the screen jumps toward the top.</p> <p>How can I prevent this from happening?</p> <p>Please see this examp...
[ { "answer_id": 243832, "author": "changelog", "author_id": 5646, "author_profile": "https://Stackoverflow.com/users/5646", "pm_score": 4, "selected": false, "text": "<a href=\"#\" onclick=\"activateTab('tab1');\">Tab 1</a> return false; <a href=\"#\" onclick=\"activateTab('tab1'); return...
2008/10/28
[ "https://Stackoverflow.com/questions/243794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31869/" ]
243,800
<p><strong>The Situation</strong></p> <p>I have an area of the screen that can be shown and hidden via JavaScript (something like "show/hide advanced search options"). Inside this area there are form elements (select, checkbox, etc). For users using assistive technology like a screen-reader (in this case JAWS), we nee...
[ { "answer_id": 29660365, "author": "Noah Herron", "author_id": 2612003, "author_profile": "https://Stackoverflow.com/users/2612003", "pm_score": 0, "selected": false, "text": "<div id=\"placeholder\" style=\"display:none;\">\n <select title=\"Month\" style=\"speak:none;\">\n <option>...
2008/10/28
[ "https://Stackoverflow.com/questions/243800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9960/" ]
243,811
<p>Looking through some code I came across the following code</p> <pre><code>trTuDocPackTypdBd.update(TrTuDocPackTypeDto.class.cast(packDto)); </code></pre> <p>and I'd like to know if casting this way has any advantages over </p> <pre><code>trTuDocPackTypdBd.update((TrTuDocPackTypeDto)packDto); </code></pre> <p>I'v...
[ { "answer_id": 243835, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 2, "selected": false, "text": "T Class<? extends T> T" }, { "answer_id": 243862, "author": "erickson", "author_id": 3474, "author_p...
2008/10/28
[ "https://Stackoverflow.com/questions/243811", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4389/" ]
243,814
<p>I am attempting to deploy .NET 2.0 web services on IIS that has both 1.0 and 2.0 installed. This web server primarily serves a large .NET 1.0 application. </p> <p>I have copied by .NET 2.0 web service project to the server and have created a virtual directory to point to the necessary folder. </p> <p>When I set th...
[ { "answer_id": 243835, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 2, "selected": false, "text": "T Class<? extends T> T" }, { "answer_id": 243862, "author": "erickson", "author_id": 3474, "author_p...
2008/10/28
[ "https://Stackoverflow.com/questions/243814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1638/" ]
243,816
<p>How to validate iscontrolkeys in textbox keydown event in .net?</p>
[ { "answer_id": 243879, "author": "Russ Cam", "author_id": 1831, "author_profile": "https://Stackoverflow.com/users/1831", "pm_score": 0, "selected": false, "text": " private void textBox1_KeyDown(object sender, KeyEventArgs e)\n {\n if (e.KeyCode == Keys.ControlKey)\n ...
2008/10/28
[ "https://Stackoverflow.com/questions/243816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
243,831
<p>Is there a way to get the Unicode Block of a character in python? The <a href="http://www.python.org/doc/2.5.2/lib/module-unicodedata.html" rel="noreferrer">unicodedata</a> module doesn't seem to have what I need, and I couldn't find an external library for it.</p> <p>Basically, I need the same functionality as <a ...
[ { "answer_id": 245072, "author": "zaphod", "author_id": 13871, "author_profile": "https://Stackoverflow.com/users/13871", "pm_score": 5, "selected": true, "text": "unicodedata bisect struct def block(ch):\n '''\n Return the Unicode block name for ch, or None if ch has no block.\n\n >>...
2008/10/28
[ "https://Stackoverflow.com/questions/243831", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7581/" ]
243,836
<p>Is there a library method to copy all the properties between two (already present) instances of the same class, in Python?</p> <p>I mean, something like Apache Commons' <code>PropertyUtilsBean.copyProperties()</code></p>
[ { "answer_id": 244116, "author": "Peter Hoffmann", "author_id": 720, "author_profile": "https://Stackoverflow.com/users/720", "pm_score": 7, "selected": true, "text": "__getitem__ __setitem__ __dict__ nobj.__dict__ = oobj.__dict__.copy() # just a shallow copy\n inspect.getmembers()" ...
2008/10/28
[ "https://Stackoverflow.com/questions/243836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3497/" ]
243,851
<p>I'm trying to unit test a piece of code that needs a currently logged in user in the test. Using the .Net 2.0 Membership Provider, how can I programmatically log in as a user for this test?</p>
[ { "answer_id": 250787, "author": "user31934", "author_id": 31934, "author_profile": "https://Stackoverflow.com/users/31934", "pm_score": 2, "selected": false, "text": " public class TemporaryPrincipal : IDisposable {\n private readonly IPrincipal _cache;\n\n public Tempo...
2008/10/28
[ "https://Stackoverflow.com/questions/243851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16027/" ]
243,852
<p>I am attempting to deploy an ASP.NET 2.0 Web service application on an IIS server that currently serves a large .NET 1.0 web application. </p> <p>I have set up an appropriate virtual directory and have set the ASP.NET version for the virtual directory to 2.0, when I attempt to browse the site in a web-browser, I am...
[ { "answer_id": 566516, "author": "Tom Anderson", "author_id": 13502, "author_profile": "https://Stackoverflow.com/users/13502", "pm_score": 0, "selected": false, "text": "c:\\windows\\microsoft.net\\framework\\v2.0.50727\\aspnet_regiis.exe -i\n C:\\windows\\microsoft.net\\framework\\v2.0...
2008/10/28
[ "https://Stackoverflow.com/questions/243852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1638/" ]
243,864
<p>I want to create a list of integers from 1 to <code>n</code>. I can do this in Python using <code>range(1, n+1)</code>, and in Haskell using: <code>take n (iterate (1+) 1)</code>.</p> <p>What is the right OCaml idiom for this?</p>
[ { "answer_id": 244078, "author": "Thedric Walker", "author_id": 26166, "author_profile": "https://Stackoverflow.com/users/26166", "pm_score": 4, "selected": false, "text": "let rec range i j = \n if i > j then [] \n else i :: range (i+1) j\n" }, { "answer_id": 244104, "auth...
2008/10/28
[ "https://Stackoverflow.com/questions/243864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1386292/" ]
243,865
<p>I have two iterators, a <code>list</code> and an <code>itertools.count</code> object (i.e. an infinite value generator). I would like to merge these two into a resulting iterator that will alternate yield values between the two:</p> <pre><code>&gt;&gt;&gt; import itertools &gt;&gt;&gt; c = itertools.count(1) &gt;&g...
[ { "answer_id": 243892, "author": "Claudiu", "author_id": 15055, "author_profile": "https://Stackoverflow.com/users/15055", "pm_score": 4, "selected": false, "text": "a b def imerge(a, b):\n i1 = iter(a)\n i2 = iter(b)\n while True:\n try:\n yield i1.next()\n ...
2008/10/28
[ "https://Stackoverflow.com/questions/243865", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18950/" ]
243,894
<p>Does the placement of a function have an effect on the performance of closures within scope? If so, where is the optimal place to put these functions? If not, is the implied association by closure enough reason to place a function in another place logically?</p> <p>For instance, if <strong>foo</strong> does not r...
[ { "answer_id": 243949, "author": "Claudiu", "author_id": 15055, "author_profile": "https://Stackoverflow.com/users/15055", "pm_score": 3, "selected": false, "text": "localState foo foo foo foo foo" }, { "answer_id": 246945, "author": "WPWoodJr", "author_id": 32122, "a...
2008/10/28
[ "https://Stackoverflow.com/questions/243894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/208/" ]
243,897
<p>I have a variable that is built in loop. Something like:</p> <pre><code>$str = ""; for($i = 0; $i &lt; 10; $i++) $str .= "something"; </code></pre> <p>If $str = "" is ommitted, I get undefined variable notice, but I thought php auto-declare a variable the first time it sees undeclared one?</p> <p>How do I do this...
[ { "answer_id": 243913, "author": "vIceBerg", "author_id": 17766, "author_profile": "https://Stackoverflow.com/users/17766", "pm_score": 5, "selected": true, "text": "$str = $str . \"something\"; $str = [undefined value] . \"something\"; [undefined value] \"something\" \"\"" }, { ...
2008/10/28
[ "https://Stackoverflow.com/questions/243897", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15345/" ]
243,900
<p>I've seen some code where a <em>Class</em> is imported, instead of a namespace, making all the static members/methods of that class available. Is this a feature of VB? Or do other languages do this as well?</p> <p>TestClass.vb</p> <pre><code>public class TestClass public shared function Somefunc() as Boolean...
[ { "answer_id": 246615, "author": "RS Conley", "author_id": 7890, "author_profile": "https://Stackoverflow.com/users/7890", "pm_score": 3, "selected": true, "text": "GlobalMultiUse GlobalMultiUse Instancing" }, { "answer_id": 5697882, "author": "gumuruh", "author_id": 6870...
2008/10/28
[ "https://Stackoverflow.com/questions/243900", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40/" ]
243,929
<p>I have several arrays of arrays or arrays of dicts that I would like to store in my iPhone app. This lists are static and won't be modified by the app or users. Occasionally they may be displayed but more likely they'll be iterated over and compared to some input value. Would the best way to store these arrays be...
[ { "answer_id": 244978, "author": "Colin Barrett", "author_id": 23106, "author_profile": "https://Stackoverflow.com/users/23106", "pm_score": 3, "selected": true, "text": "@implementation DataSource\n+ (NSArray *)someData\n{\n static NSArray *data = nil;\n if (!data) {\n data = [[NSA...
2008/10/28
[ "https://Stackoverflow.com/questions/243929", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29263/" ]
243,945
<p>From wikipedia: </p> <blockquote> <p>the cross product is a binary operation on two vectors in a <strong>three-dimensional</strong> Euclidean space that results in another vector which is perpendicular to the plane containing the two input vectors.</p> </blockquote> <p>Given that the definition is only defined i...
[ { "answer_id": 244046, "author": "Alnitak", "author_id": 6782, "author_profile": "https://Stackoverflow.com/users/6782", "pm_score": 4, "selected": false, "text": "a b" }, { "answer_id": 29060469, "author": "Bill Burdick", "author_id": 1026782, "author_profile": "http...
2008/10/28
[ "https://Stackoverflow.com/questions/243945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18265/" ]
243,956
<p>I currently have a silverlight application which rotates through several graphs of live data. Each page has two user controls though: one for an info box at the top and another for the graph to display. I have tried to add a background image to the master page that they are displayed on so that the image is behind e...
[ { "answer_id": 245384, "author": "Bryant", "author_id": 10893, "author_profile": "https://Stackoverflow.com/users/10893", "pm_score": 2, "selected": false, "text": "<object data=\"data:application/x-silverlight-2,\" type=\"application/x-silverlight-2\" width=\"100%\" height=\"100%\">\n ...
2008/10/28
[ "https://Stackoverflow.com/questions/243956", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
243,962
<p>Which Eclipse package should I choose for Python development with <a href="http://www.pydev.org/" rel="nofollow noreferrer">PyDev</a>?</p> <p>Nothing on the Eclipse homepage tells me what to choose, and the PyDev documentation assumes I already have Eclipse installed. Does it matter which Eclipse package I choose?<...
[ { "answer_id": 1215589, "author": "J. Peterson", "author_id": 105767, "author_profile": "https://Stackoverflow.com/users/105767", "pm_score": 2, "selected": false, "text": "Help > Software Updates >" } ]
2008/10/28
[ "https://Stackoverflow.com/questions/243962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23423/" ]
243,966
<p>I need to send an email to someone and want them to be able to simply reply to the email without having to specify the email address.</p> <p>Using sp_send_dbmail sets the reply-to address as the name of the profile that it was sent from.</p> <p>Can this be changed to specify the reply-to so it looks like it came f...
[ { "answer_id": 26142821, "author": "Doug_Ivison", "author_id": 1259871, "author_profile": "https://Stackoverflow.com/users/1259871", "pm_score": 2, "selected": false, "text": "sp_send_dbmail sp_send_dbmail" } ]
2008/10/28
[ "https://Stackoverflow.com/questions/243966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11989/" ]
243,967
<p>Sometimes you need to skip execution of part of a method under certain non-critical error conditions. You can use <em>exceptions</em> for that, but exceptions generally are not recommended in normal application logic, only for abnormal situations.</p> <p>So I do a trick like this:</p> <pre><code>do { bool isGoo...
[ { "answer_id": 243978, "author": "Paul Tomblin", "author_id": 3333, "author_profile": "https://Stackoverflow.com/users/3333", "pm_score": 5, "selected": false, "text": "bool isGood = true;\n\n .... some code\n\n if(isGood)\n {\n .... some more code\n }\n\n if(isGood)\n {\n ...
2008/10/28
[ "https://Stackoverflow.com/questions/243967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20390/" ]
243,971
<p>What do you think of using a metric of function point to lines of code as a metric?</p> <p>It makes me think of the old game show "Name That Tune". "I can name that tune in three notes!" I can write that functionality in 0.1 klocs! Is this useful?</p> <p>It would certainly seem to promote library usage, but is ...
[ { "answer_id": 244298, "author": "T.E.D.", "author_id": 29639, "author_profile": "https://Stackoverflow.com/users/29639", "pm_score": 0, "selected": false, "text": "grep -c \";\" *.h *.cpp | awk -F: '/:/ {x += $2} END {print x}'\n" } ]
2008/10/28
[ "https://Stackoverflow.com/questions/243971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13930/" ]
243,992
<p>When I create a zip Archive via <code>java.util.zip.*</code>, is there a way to split the resulting archive in multiple volumes? </p> <p>Let's say my overall archive has a <code>filesize</code> of <code>24 MB</code> and I want to split it into 3 files on a limit of 10 MB per file.<br> Is there a zip API which has ...
[ { "answer_id": 244025, "author": "sakana", "author_id": 28921, "author_profile": "https://Stackoverflow.com/users/28921", "pm_score": 4, "selected": true, "text": "import java.io.File;\nimport java.io.FileNotFoundException;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\n...
2008/10/28
[ "https://Stackoverflow.com/questions/243992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9688/" ]
243,995
<p>I am trying to set the permissions of a folder and all of it's children on a vista computer. The code I have so far is this.</p> <pre><code> public static void SetPermissions(string dir) { DirectoryInfo info = new DirectoryInfo(dir); DirectorySecurity ds = info.GetAccessControl(); ...
[ { "answer_id": 244798, "author": "Erin", "author_id": 22835, "author_profile": "https://Stackoverflow.com/users/22835", "pm_score": 4, "selected": true, "text": "public static void SetPermissions(string dir)\n {\n DirectoryInfo info = new DirectoryInfo(dir);\n ...
2008/10/28
[ "https://Stackoverflow.com/questions/243995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22835/" ]
244,001
<p>I know that cursors are frowned upon and I try to avoid their use as much as possible, but there may be some legitimate reasons to use them. I have one and I am trying to use a pair of cursors: one for the primary table and one for the secondary table. The primary table cursor iterates through the primary table in a...
[ { "answer_id": 244024, "author": "Eduardo Campañó", "author_id": 12091, "author_profile": "https://Stackoverflow.com/users/12091", "pm_score": 0, "selected": false, "text": "DECLARE curScores CURSOR\nFOR \n SELECT FName,Score \n FROM @Scores \n WHERE Fname = @Fname \n" }, { ...
2008/10/28
[ "https://Stackoverflow.com/questions/244001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/262613/" ]
244,009
<p>In my Rails controller, I'm creating multiple instances of the same model class. I want to add some RSpec expectations so I can test that it is creating the correct number with the correct parameters. So, here's what I have in my spec:</p> <pre> Bandmate.should_receive(:create).with(:band_id => @band.id, :user_id...
[ { "answer_id": 248742, "author": "James Baker", "author_id": 9365, "author_profile": "https://Stackoverflow.com/users/9365", "pm_score": 6, "selected": true, "text": ".ordered" } ]
2008/10/28
[ "https://Stackoverflow.com/questions/244009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19964/" ]
244,018
<p>I'm using Flex 3 in the UI of a Windows app (Flash player as an embedded ActiveX control), and passing data between them with ExternalInterface (primarily into the Flex app, as opposed to out). I'm finding, though, that the performance is pretty awful, particularly with larger (i.e., custom) objects; the more EI cal...
[ { "answer_id": 248742, "author": "James Baker", "author_id": 9365, "author_profile": "https://Stackoverflow.com/users/9365", "pm_score": 6, "selected": true, "text": ".ordered" } ]
2008/10/28
[ "https://Stackoverflow.com/questions/244018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32129/" ]
244,019
<p>I've used HttpWebRequests to post data to HTTPS websites before, and I've never had todo anything different than a regular HTTP Post.</p> <p>Does anyone know if there are any tricks involved that I missed to ensure that this is done properly?</p>
[ { "answer_id": 244089, "author": "FlySwat", "author_id": 1965, "author_profile": "https://Stackoverflow.com/users/1965", "pm_score": 2, "selected": false, "text": "System.Net.ServicePointManager.ServerCertificateValidationCallback +=\n delegate(object sender, System.Security.Cryptogra...
2008/10/28
[ "https://Stackoverflow.com/questions/244019", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965/" ]
244,029
<p>I am trying to insert a time only value, but get the following error</p> <blockquote> <ul> <li>ex {"SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM."} System.Exception</li> </ul> </blockquote> <p>From the front end, the time is selected using the "TimeEdit" control, wi...
[ { "answer_id": 244041, "author": "StingyJack", "author_id": 16391, "author_profile": "https://Stackoverflow.com/users/16391", "pm_score": -1, "selected": false, "text": "SELECT (GETDATE() - (CAST(FLOOR(CAST(GETDATE() as FLOAT)) AS DateTime)))\n" } ]
2008/10/28
[ "https://Stackoverflow.com/questions/244029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23667/" ]
244,034
<p>Wanna write a RegEx to validate a driving license. </p> <p>if it doesn't start with (US, CA, CN) then it has to be followed with XX and after that with any number of Alpha numeric letters. </p> <p>So for example if the driving license starts with GB then it has to be followed with XX GBXX12345363 However if it sta...
[ { "answer_id": 244045, "author": "Tanktalus", "author_id": 23512, "author_profile": "https://Stackoverflow.com/users/23512", "pm_score": 0, "selected": false, "text": "/^(?:(?:US|CA|CN)\\w+|[[:alpha:]]{2}XX\\w+)$/\n" }, { "answer_id": 244094, "author": "eyelidlessness", "...
2008/10/28
[ "https://Stackoverflow.com/questions/244034", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
244,063
<p>I have a <code>&lt;button&gt;</code> with an accesskey assgined to it. The accesskey works fine as long as the button is visible, but when I set <code>display: none</code> or <code>visibility: hidden</code>, the accesskey no longer works.</p> <p>Also tried without success:</p> <ul> <li>Use a different element type...
[ { "answer_id": 244176, "author": "Sal", "author_id": 32144, "author_profile": "https://Stackoverflow.com/users/32144", "pm_score": 2, "selected": false, "text": "display:none visibility:hidden" }, { "answer_id": 245831, "author": "Community", "author_id": -1, "author_...
2008/10/28
[ "https://Stackoverflow.com/questions/244063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14749/" ]
244,085
<p>Delphi 2009 complains with an E2283 error: [DCC Error] outputcode.pas(466): E2283 Too many local constants. Use shorter procedures</p> <p>Delphi 2007 compiles just fine. I can't find an abundance of local constants, it's a short (500 line) unit. Do you see any abundance of constants or literals I can address?</p> ...
[ { "answer_id": 244488, "author": "Jeremy Mullin", "author_id": 7893, "author_profile": "https://Stackoverflow.com/users/7893", "pm_score": 0, "selected": false, "text": "procedure TOutputCodeForm.FormCreate(Sender: TObject);\nbegin\n\n if ( IsWindowsVista() ) then\n begin\n Set...
2008/10/28
[ "https://Stackoverflow.com/questions/244085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7893/" ]
244,087
<p>What are some things I can do to improve query performance of an oracle query without creating indexes?</p> <p>Here is the query I'm trying to run faster:</p> <pre><code>SELECT c.ClaimNumber, a.ItemDate, c.DTN, b.FilePath FROM items a, itempages b, keygroupdata c WHERE a.ItemType IN (112,115,189,241) AND a.ItemNum...
[ { "answer_id": 244131, "author": "Rob Booth", "author_id": 16445, "author_profile": "https://Stackoverflow.com/users/16445", "pm_score": 4, "selected": true, "text": "SELECT c.ClaimNumber, a.ItemDate, c.DTN, b.FilePath\nFROM items a\nINNER JOIN itempages b ON b.ItemNum = a.ItemNum\nINNER...
2008/10/28
[ "https://Stackoverflow.com/questions/244087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2849/" ]
244,110
<p>Here's the code. Not much to it.</p> <pre><code>&lt;?php include(&quot;Spreadsheet/Excel/Writer.php&quot;); $xls = new Spreadsheet_Excel_Writer(); $sheet = $xls-&gt;addWorksheet('At a Glance'); $colNames = array('Foo', 'Bar'); $sheet-&gt;writeRow(0, 0, $colNames, $colHeadingFormat); for($i=1; $i&lt;=10; $i++) ...
[ { "answer_id": 244404, "author": "Mark Biek", "author_id": 305, "author_profile": "https://Stackoverflow.com/users/305", "pm_score": 4, "selected": true, "text": "$sheet->writeRow(0, 0, $colNames, $colHeadingFormat);\n for($i=1; $i<=10; $i++)\n{\n $row = array( \"foo $i\", \"bar $i\")...
2008/10/28
[ "https://Stackoverflow.com/questions/244110", "https://Stackoverflow.com", "https://Stackoverflow.com/users/305/" ]
244,113
<p>I'm working on a stored procedure in SQL Server 2000 with a temp table defined like this:</p> <pre>CREATE TABLE #MapTable (Category varchar(40), Code char(5))</pre> <p>After creating the table I want to insert some standard records (which will then be supplemented dynamically in the procedure). Each category (abo...
[ { "answer_id": 244158, "author": "DJ.", "author_id": 10492, "author_profile": "https://Stackoverflow.com/users/10492", "pm_score": 0, "selected": false, "text": "CREATE TABLE #MapTable (Category varchar(40), Code char(5))\n\nINSERT INTO #MapTable \nSELECT X.Category, X.Code FROM\n(SELECT...
2008/10/28
[ "https://Stackoverflow.com/questions/244113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3043/" ]
244,114
<p>I'm developing a poker game in C#. At the moment I'm trying to get the players hand score using <code>RegEx</code>. I search the string (composed of the cards suit and number) and look for suits or numbers to match the <code>RegEx</code>. If i get 2 matches then the player has a pair, 3 matches he has 3 of a kind. <...
[ { "answer_id": 4459394, "author": "Dalou", "author_id": 538032, "author_profile": "https://Stackoverflow.com/users/538032", "pm_score": 2, "selected": false, "text": "// D H S C \ncolors = [7,5,3,2]\n\n// A Q K J T 9 8 7 6 5 4 3 2 \nranks = [...
2008/10/28
[ "https://Stackoverflow.com/questions/244114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23146/" ]
244,115
<p>Just for my own purposes, I'm trying to build a tokenizer in Java where I can define a regular grammar and have it tokenize input based on that. The StringTokenizer class is deprecated, and I've found a couple functions in Scanner that hint towards what I want to do, but no luck yet. Anyone know a good way of going ...
[ { "answer_id": 244236, "author": "Balint Pato", "author_id": 19621, "author_profile": "https://Stackoverflow.com/users/19621", "pm_score": 2, "selected": false, "text": " import java.util.Scanner;\n\n\n public class Main { \n\n public static void main(String[] args) {\n\n S...
2008/10/28
[ "https://Stackoverflow.com/questions/244115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1370/" ]
244,119
<p>Can anoyne recommend a good library that will let me easily read/write private member fields of a class? I was looking through apache commons, but couldnt see it. I must be getting blind ?</p> <p>Edit: Asking questions on the border of legalities always give these questions of "why"? I am writing several javarebel ...
[ { "answer_id": 244146, "author": "Ken Gentle", "author_id": 8709, "author_profile": "https://Stackoverflow.com/users/8709", "pm_score": 1, "selected": false, "text": "java.lang.reflect" }, { "answer_id": 244156, "author": "sakana", "author_id": 28921, "author_profile"...
2008/10/28
[ "https://Stackoverflow.com/questions/244119", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23691/" ]
244,152
<p>I have a site that requires Windows Authentication the application obtains the credential from the Security.Prinicipal once the user is autenticated the problem is that my credentials on my local environment are different that the ones stored in the DB and the user preferences cannot be obtain. i am doing the follow...
[ { "answer_id": 244874, "author": "Robert Paulson", "author_id": 14033, "author_profile": "https://Stackoverflow.com/users/14033", "pm_score": 3, "selected": true, "text": "UPDATE Users \nSET \n UserName = REPLACE(UserName, '\\\\ProductionDomain\\', '\\\\DevDomain\\')\n" } ]
2008/10/28
[ "https://Stackoverflow.com/questions/244152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14440/" ]
244,157
<p>I am trying to read an XML-file from another server. However the the company that's hosting me seems to have turned of the file_get_contents function from retrieving files for files from other servers (and their support is not very bright and it takes forever for them to answer). So I need a work around in some way....
[ { "answer_id": 244163, "author": "Ross", "author_id": 2025, "author_profile": "https://Stackoverflow.com/users/2025", "pm_score": 0, "selected": false, "text": "allow_url_fopen var_dump(ini_get('allow_url_fopen'));\n copy" }, { "answer_id": 244166, "author": "Greg", "auth...
2008/10/28
[ "https://Stackoverflow.com/questions/244157", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27943/" ]
244,164
<p>I need to resize PNG, JPEG and GIF files. How can I do this using Java?</p>
[ { "answer_id": 244177, "author": "Burkhard", "author_id": 12860, "author_profile": "https://Stackoverflow.com/users/12860", "pm_score": 8, "selected": true, "text": "BufferedImage createResizedCopy(Image originalImage, \n int scaledWidth, int scaledHeight, \n boolea...
2008/10/28
[ "https://Stackoverflow.com/questions/244164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2011/" ]
244,183
<p>I'm working on a site which contains a whole bunch of mp3s and images, and I'd like to display a loading gif while all the content loads. </p> <p>I have no idea how to achieve this, but I do have the animated gif I want to use. </p> <p>Any suggestions?</p>
[ { "answer_id": 244190, "author": "mmattax", "author_id": 1638, "author_profile": "https://Stackoverflow.com/users/1638", "pm_score": 6, "selected": true, "text": "readystatechanged function load(url) {\n // display loading image here...\n document.getElementById('loadingImg').visib...
2008/10/28
[ "https://Stackoverflow.com/questions/244183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27171/" ]
244,184
<p>We have are relatively simple Reporting Services report that our users commonly export to Excel. I've noticed that the files produced by the Excel export seem unusually large. If I open one of these files and just click save, without making any changes, the file size reduces to about half of it's previous size. Has ...
[ { "answer_id": 923724, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": -1, "selected": false, "text": "DataElementOutput Data tab convert text to column use the delimiter" } ]
2008/10/28
[ "https://Stackoverflow.com/questions/244184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/162/" ]
244,191
<p>For example:</p> <pre><code>public void doSomething() { final double MIN_INTEREST = 0.0; // ... } </code></pre> <p>Personally, I would rather see these substitution constants declared statically at the class level. I suppose I'm looking for an "industry viewpoint" on the matter.</p>
[ { "answer_id": 244215, "author": "sakana", "author_id": 28921, "author_profile": "https://Stackoverflow.com/users/28921", "pm_score": -1, "selected": false, "text": "public class Test {\n\n final double MIN_INTEREST = 0.0;\n\n /**\n * @param args\n */\n public static voi...
2008/10/28
[ "https://Stackoverflow.com/questions/244191", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32142/" ]
244,192
<p>I have a pattern to match with the string: string pattern = @"asc" I am checking the SQL SELECT query for right syntax, semantics, ... I need to say that in the end of the query string I can have "asc" or "desc". How can it be written in C#?</p>
[ { "answer_id": 244201, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 1, "selected": false, "text": "asc|desc\n" }, { "answer_id": 244203, "author": "bdukes", "author_id": 2688, "author_profile": "http...
2008/10/28
[ "https://Stackoverflow.com/questions/244192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28298/" ]
244,208
<p>I'm using MySQL 5.0.45 on CentOS 5.1.</p> <p><code>SELECT DISTINCT(email) FROM newsletter</code></p> <p>Returns 217259 rows</p> <p><code>SELECT COUNT(DISTINCT(email)) FROM newsletter</code></p> <p>Returns 180698 for the count.</p> <p><code>SELECT COUNT(*) FROM (SELECT DISTINCT(email) FROM newsletter) AS foo</co...
[ { "answer_id": 244262, "author": "Paul Tomblin", "author_id": 3333, "author_profile": "https://Stackoverflow.com/users/3333", "pm_score": 0, "selected": false, "text": "select distinct(email) from newsletter order by email;" }, { "answer_id": 244435, "author": "Maglob", "...
2008/10/28
[ "https://Stackoverflow.com/questions/244208", "https://Stackoverflow.com", "https://Stackoverflow.com/users/796/" ]
244,219
<p>In c# (3.0 or 3.5, so we can use lambdas), is there an elegant way of sorting a list of dates in descending order? I know I can do a straight sort and then reverse the whole thing, </p> <pre><code>docs.Sort((x, y) =&gt; x.StoredDate.CompareTo(y.StoredDate)); docs.Reverse(); </code></pre> <p>but is there a lambda e...
[ { "answer_id": 244221, "author": "jonnii", "author_id": 4590, "author_profile": "https://Stackoverflow.com/users/4590", "pm_score": 4, "selected": false, "text": "docs.Sort((x, y) => y.StoredDate.CompareTo(x.StoredDate));\n" }, { "answer_id": 244227, "author": "Tamas Czinege"...
2008/10/28
[ "https://Stackoverflow.com/questions/244219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2849/" ]
244,222
<p>I have compression enabled within IIS7 and it works as expected on all responses except for those constructed by ASP.NET AJAX. I have a web service that provides data to the client. When the web service is called directly, it is properly compressed. However, when it is called via ASP.NET AJAX, the JSON response i...
[ { "answer_id": 266753, "author": "stevemegson", "author_id": 25028, "author_profile": "https://Stackoverflow.com/users/25028", "pm_score": 3, "selected": false, "text": "<dynamicTypes>\n <add mimeType=\"text/*\" enabled=\"true\" />\n <add mimeType=\"message/*\" enabled=\"true\" /...
2008/10/28
[ "https://Stackoverflow.com/questions/244222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
244,243
<p>I ran into the problem that my primary key sequence is not in sync with my table rows. </p> <p>That is, when I insert a new row I get a duplicate key error because the sequence implied in the serial datatype returns a number that already exists.</p> <p>It seems to be caused by import/restores not maintaining the s...
[ { "answer_id": 244265, "author": "meleyal", "author_id": 4196, "author_profile": "https://Stackoverflow.com/users/4196", "pm_score": 11, "selected": true, "text": "-- Login to psql and run the following\n\n-- What is the result?\nSELECT MAX(id) FROM your_table;\n\n-- Then run...\n-- This...
2008/10/28
[ "https://Stackoverflow.com/questions/244243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4196/" ]
244,246
<p>I want to create an alias for a class name. The following syntax would be perfect:</p> <pre><code>public class LongClassNameOrOneThatContainsVersionsOrDomainSpecificName { ... } public class MyName = LongClassNameOrOneThatContainsVersionOrDomainSpecificName; </code></pre> <p>but it won't compile.</p> <hr /> <h2>...
[ { "answer_id": 244255, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 7, "selected": false, "text": "using typedef using ColorScheme = The.Fully.Qualified.Namespace.Outlook2007ColorScheme;\n" }, { "answer_id": ...
2008/10/28
[ "https://Stackoverflow.com/questions/244246", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12597/" ]
244,252
<p>I've been looking (without great luck) for the perfect reference card with all the basic sorting algos in C (or maybe in pseudo code). Wikipedia is a terrific source of info but this time I'm looking for something definitely more portable (pocket size if possible) and of course printable. Any suggestion would be muc...
[ { "answer_id": 244294, "author": "Jonathan Leffler", "author_id": 15168, "author_profile": "https://Stackoverflow.com/users/15168", "pm_score": 2, "selected": false, "text": "qsort() qsort() bsearch() qsort()" }, { "answer_id": 244632, "author": "ephemient", "author_id": ...
2008/10/28
[ "https://Stackoverflow.com/questions/244252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6992/" ]
244,264
<p>I am currently trying to learn all new features of C#3.0. I have found a very nice collection of <a href="http://msdn.microsoft.com/en-us/vcsharp/aa336746.aspx" rel="nofollow noreferrer">sample to practice LINQ</a> but I can't find something similar for Lambda.</p> <p>Do you have a place that I could practice Lambda...
[ { "answer_id": 244427, "author": "cfeduke", "author_id": 5645, "author_profile": "https://Stackoverflow.com/users/5645", "pm_score": 2, "selected": false, "text": "System.Action<...> System.Func<...> System.Predicate<...> public static void Main()\n{\n // ToString is shown below for c...
2008/10/28
[ "https://Stackoverflow.com/questions/244264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13913/" ]
244,276
<p>A website I'm working on (using AS2 because it's oldschool) has a larger index .swf file that loads sub-swfs using <code>loadMovie("foo1.swf", placeToShowSwf)</code>. There's <code>foo1.swf</code> through 4, which is silly because the only thing that's different between them is a single number in the address of an x...
[ { "answer_id": 244414, "author": "Claudio", "author_id": 30122, "author_profile": "https://Stackoverflow.com/users/30122", "pm_score": 0, "selected": false, "text": "function setFooNum(i:Number) {\n fooNum = i;\n my_xml.load(\"foo\"+fooNum+\".xml\");\n};\n" }, { "answer_id"...
2008/10/28
[ "https://Stackoverflow.com/questions/244276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32139/" ]
244,280
<p>I'm trying to implement a unit test for a function in a project that doesn't have unit tests and this function requires a System.Web.Caching.Cache object as a parameter. I've been trying to create this object by using code such as...</p> <pre><code>System.Web.Caching.Cache cache = new System.Web.Caching.Cache(); ca...
[ { "answer_id": 244331, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 4, "selected": true, "text": "public interface ICacheWrapper\n{\n ...methods to support\n}\n\npublic class CacheWrapper : ICacheWrapper\n{\n priv...
2008/10/28
[ "https://Stackoverflow.com/questions/244280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1463/" ]
244,285
<p>I've got to get a quick and dirty configuration editor up and running. The flow goes something like this:</p> <p>configuration (POCOs on server) are serialized to XML.<br> The XML is well formed at this point. The configuration is sent to the web server in XElements.<br> On the web server, the XML (Yes, ALL OF IT)...
[ { "answer_id": 244299, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 4, "selected": true, "text": "<foo mean-attribute=\"&lt;\">\n &lt;foo mean-attribute=\"&amp;&lt;\"&gt;\n" }, { "answer_id": 244330, "aut...
2008/10/28
[ "https://Stackoverflow.com/questions/244285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
244,295
<p>s it possible to do the following in subsonic.</p> <p>SELECT * FROM TABLE1</p> <p>WHERE Column1 > Column2 or Column1 &lt; Colum3</p> <p>All examples that I've seen assume you now a value to pass to the where clause. I'm trying to do this without creating a view.</p> <p>Thanks</p>
[ { "answer_id": 716887, "author": "Rick Rat", "author_id": 43754, "author_profile": "https://Stackoverflow.com/users/43754", "pm_score": -1, "selected": false, "text": "Dim TableList As Generic.List(Of Database.Table1) = _\n New SubSonic.Select().From(\"Table1\"). _\n Where(\"Col1\").IsGr...
2008/10/28
[ "https://Stackoverflow.com/questions/244295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2526/" ]
244,316
<p>I'm looking for a good reader/writer lock in C++. We have a use case of a single infrequent writer and many frequent readers and would like to optimize for this. Preferable I would like a cross-platform solution, however a Windows only one would be acceptable. </p>
[ { "answer_id": 244344, "author": "Greg Rogers", "author_id": 5963, "author_profile": "https://Stackoverflow.com/users/5963", "pm_score": 6, "selected": true, "text": "shared_lock unique_lock upgrade_lock shared_mutex" }, { "answer_id": 244376, "author": "ephemient", "auth...
2008/10/28
[ "https://Stackoverflow.com/questions/244316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/852/" ]
244,329
<p>Something happened that I'm not sure should be possible. Obviously it is, because I've seen it, but I need to find the root cause &amp; I was hoping you all could help.</p> <p>We have a system that looks up latitude &amp; longitude for a zipcode. Rather than access it every time, we cache the results in a cheap i...
[ { "answer_id": 244819, "author": "Vladimir Dyuzhev", "author_id": 1163802, "author_profile": "https://Stackoverflow.com/users/1163802", "pm_score": 3, "selected": false, "text": "LatLongPair llp = InMemoryGeocodingCache.getInstance().get(ZIP1);\nllp.lat = x;\nllp.lon = y;\n" }, { ...
2008/10/28
[ "https://Stackoverflow.com/questions/244329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7773/" ]
244,340
<p>I am getting a DC for a window handle of an object in another program using win32gui.GetDC which returns an int/long. I need to blit this DC into a memory DC in python. The only thing I can't figure out how to do is get a wxDC derived object from the int/long that win32gui returns. None of the wxDC objects allow ...
[ { "answer_id": 1821168, "author": "FogleBird", "author_id": 90308, "author_profile": "https://Stackoverflow.com/users/90308", "pm_score": 2, "selected": true, "text": "window = wx.Frame(None, -1, '')\nwindow.AssociateHandle(hwnd)\ndc = wx.WindowDC(window)\n" } ]
2008/10/28
[ "https://Stackoverflow.com/questions/244340", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13036/" ]
244,345
<p>I was watching Rob Connerys webcasts on the MVCStoreFront App, and I noticed he was unit testing even the most mundane things, things like:</p> <pre><code>public Decimal DiscountPrice { get { return this.Price - this.Discount; } } </code></pre> <p>Would have a test like:</p> <pre><code>[TestMethod...
[ { "answer_id": 249579, "author": "philant", "author_id": 18804, "author_profile": "https://Stackoverflow.com/users/18804", "pm_score": 3, "selected": false, "text": "Assert.IsEqual(p.DiscountPrice,90);\n" } ]
2008/10/28
[ "https://Stackoverflow.com/questions/244345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965/" ]
244,385
<p>I'm trying to run a shell command using the backtick operators, but the fact that the child process inherits php's open file descriptors is problematic. Is there a way to keep this from happening?</p> <p>I'm running PHP 5.1.2</p>
[ { "answer_id": 32634046, "author": "Greg", "author_id": 329062, "author_profile": "https://Stackoverflow.com/users/329062", "pm_score": 0, "selected": false, "text": "$cmd_to_run = escapeshellarg('/path/to/file --args');\n`echo $cmd_to_run | /bin/at now`;\n" } ]
2008/10/28
[ "https://Stackoverflow.com/questions/244385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4883/" ]
244,390
<p>Right now, I have </p> <pre><code>SELECT gp_id FROM gp.keywords WHERE keyword_id = 15 AND (SELECT practice_link FROM gp.practices WHERE practice_link IS NOT NULL AND id = gp_id) </code></pre> <p>This does not provide a syntax error, however for values where it should return row(s), it just returns 0 ...
[ { "answer_id": 244405, "author": "SquareCog", "author_id": 15962, "author_profile": "https://Stackoverflow.com/users/15962", "pm_score": 1, "selected": false, "text": "\nselect k.gp_id \nfrom gp.keywords as k,\n gp.practices as p\nwhere\nkeyword_id=15\nand practice_link is not null\n...
2008/10/28
[ "https://Stackoverflow.com/questions/244390", "https://Stackoverflow.com", "https://Stackoverflow.com/users/572/" ]
244,392
<p>Here's the quick and skinny of my issue:</p> <pre>$("a").toggle(function() { /*function A*/ }, function() { /*function B*/ });</pre> <p>Inside <code>function A</code> a form is displayed. If the user successfully completes the form, the form is hidden again (returning to it's original state).</p> <p>Inside <code...
[ { "answer_id": 244468, "author": "foxy", "author_id": 30119, "author_profile": "https://Stackoverflow.com/users/30119", "pm_score": 5, "selected": true, "text": ".toggle() .toggle() .toggle(even, odd) $(\"a\").click(function() {\n $(\"#theForm\").toggle();\n});\n" }, { "answer...
2008/10/28
[ "https://Stackoverflow.com/questions/244392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32154/" ]
244,408
<p>I've got two collections (generic Lists), let's call them ListA and ListB.</p> <p>In ListA I've got a few items of type A. In ListB I've got some items of type B that have the SAME ID (but not same type) as the items in ListA, plus many more. I want to remove all the items from ListB that have the same ID as the on...
[ { "answer_id": 244426, "author": "Elie", "author_id": 23249, "author_profile": "https://Stackoverflow.com/users/23249", "pm_score": 0, "selected": false, "text": "for (item i: LISTA) {\n removeItem(i, LISTB);\n}\n\n\nmethod removeItem(Item, List) {\n for (Item i: List) {\n i...
2008/10/28
[ "https://Stackoverflow.com/questions/244408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3397/" ]
244,431
<p>I have two assemblies with the same name in the Global Assembly cache, but with different version numbers. How do I tell my program which version to reference?</p> <p>For the record, this is a VB.Net page in an ASP.Net web site.</p>
[ { "answer_id": 244469, "author": "Ady", "author_id": 31395, "author_profile": "https://Stackoverflow.com/users/31395", "pm_score": 2, "selected": false, "text": "<add assembly=\"Foo.Bar, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A\"/>\n <add assembly=\"Foo.Bar, Vers...
2008/10/28
[ "https://Stackoverflow.com/questions/244431", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19074/" ]
244,438
<p>Imagine I have these python lists:</p> <pre><code>keys = ['name', 'age'] values = ['Monty', 42, 'Matt', 28, 'Frank', 33] </code></pre> <p>Is there a direct or at least a simple way to produce the following list of dictionaries ?</p> <pre><code>[ {'name': 'Monty', 'age': 42}, {'name': 'Matt', 'age': 28}, ...
[ { "answer_id": 244455, "author": "Cheery", "author_id": 21711, "author_profile": "https://Stackoverflow.com/users/21711", "pm_score": 2, "selected": false, "text": "def fields_from_list(keys, values):\n iterator = iter(values)\n while True:\n yield dict((key, iterator.next()...
2008/10/28
[ "https://Stackoverflow.com/questions/244438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12388/" ]
244,445
<p>If, like me, you shiver at the site of a While (True) loop, then you too must have thought long and hard about the best way to refactor it away. I've seen several different implementations, none really better than any other, such as the timer &amp; delegate combination.</p> <p>So what's the best way you've come up...
[ { "answer_id": 244459, "author": "Jon B", "author_id": 27414, "author_profile": "https://Stackoverflow.com/users/27414", "pm_score": 4, "selected": false, "text": "volatile bool m_shutdown = false;\nvoid Run()\n{\n while (!m_shutdown)\n { ... }\n}\n" }, { "answer_id": 24448...
2008/10/28
[ "https://Stackoverflow.com/questions/244445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27498/" ]
244,452
<h1>My situation</h1> <ul> <li>Input: a set of rectangles </li> <li>each rect is comprised of 4 doubles like this: (x0,y0,x1,y1)</li> <li>they are not "rotated" at any angle, all they are "normal" rectangles that go "up/down" and "left/right" with respect to the screen</li> <li>they are randomly placed - they may be t...
[ { "answer_id": 244458, "author": "Toon Krijthe", "author_id": 18061, "author_profile": "https://Stackoverflow.com/users/18061", "pm_score": 0, "selected": false, "text": "int LineOverlap(int line1a, line1b, line2a, line2b) \n{\n // assume line1a <= line1b and line2a <= line2b\n if (lin...
2008/10/28
[ "https://Stackoverflow.com/questions/244452", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13477/" ]
244,482
<p>Developing a heavily XML-based Java-application, I recently encountered an interesting problem on Ubuntu Linux.</p> <p>My application, using the <a href="http://jpf.sourceforge.net/" rel="noreferrer">Java Plugin Framework</a>, appears unable to convert a <a href="http://www.dom4j.org/" rel="noreferrer">dom4j</a>-cr...
[ { "answer_id": 244707, "author": "matt b", "author_id": 4249, "author_profile": "https://Stackoverflow.com/users/4249", "pm_score": 5, "selected": false, "text": "parent-first" }, { "answer_id": 244727, "author": "Adam Crume", "author_id": 25498, "author_profile": "ht...
2008/10/28
[ "https://Stackoverflow.com/questions/244482", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25141/" ]
244,489
<p>I have a managed dll that calls into a native library. This native library generally returns IntPtrs. These can be passed in to other methods in the native library to do things, or to tell the library to free the instance associated with the IntPtr. But only some of the instances need to freed in this way, others...
[ { "answer_id": 244707, "author": "matt b", "author_id": 4249, "author_profile": "https://Stackoverflow.com/users/4249", "pm_score": 5, "selected": false, "text": "parent-first" }, { "answer_id": 244727, "author": "Adam Crume", "author_id": 25498, "author_profile": "ht...
2008/10/28
[ "https://Stackoverflow.com/questions/244489", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
244,492
<p>Is there something like a panel that I can use in a MFC application. This is to overlay the default window in MFC (a dialog application). Then to paint the panel black and paint some random stuff on top of it. Something like a view port.</p> <p>is there a better option than this to achieve the same effect ?</p>
[ { "answer_id": 37513811, "author": "Devolus", "author_id": 2282011, "author_profile": "https://Stackoverflow.com/users/2282011", "pm_score": 0, "selected": false, "text": "CDialog Create() Show()" } ]
2008/10/28
[ "https://Stackoverflow.com/questions/244492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1781/" ]
244,493
<p>I have a certain POJO which needs to be persisted on a database, current design specifies its field as a single string column, and adding additional fields to the table is not an option.</p> <p>Meaning, the objects need to be serialized in some way. So just for the basic implementation I went and designed my own se...
[ { "answer_id": 244511, "author": "Jason Cohen", "author_id": 4926, "author_profile": "https://Stackoverflow.com/users/4926", "pm_score": 2, "selected": false, "text": "Properties load()/store() public String getFieldsAsString() {\n Properties data = new Properties();\n data.setProperty...
2008/10/28
[ "https://Stackoverflow.com/questions/244493", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24545/" ]
244,506
<p>Given a list of urls, I would like to check that each url:</p> <ul> <li>Returns a 200 OK status code</li> <li>Returns a response within X amount of time</li> </ul> <p>The end goal is a system that is capable of flagging urls as potentially broken so that an administrator can review them.</p> <p>The script will be...
[ { "answer_id": 244669, "author": "Henning", "author_id": 29549, "author_profile": "https://Stackoverflow.com/users/29549", "pm_score": 5, "selected": true, "text": "function is_available($url, $timeout = 30) {\n $ch = curl_init(); // get cURL handle\n\n // set cURL options\n $op...
2008/10/28
[ "https://Stackoverflow.com/questions/244506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3238/" ]
244,509
<p>I'm planning to make a very simple program using php and mySQL. The main page will take information and make a new row in the database with that information. However, I need a number to put in for the primary key. Unfortunately, I have no idea about the normal way to determine what umber to use. Preferably, if I del...
[ { "answer_id": 244516, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 5, "selected": true, "text": "CREATE TABLE animals (\n id MEDIUMINT NOT NULL AUTO_INCREMENT,\n name CHAR(30) NOT NULL,\n PRIMARY KEY (i...
2008/10/28
[ "https://Stackoverflow.com/questions/244509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25680/" ]
244,517
<p>Where is a reliable registry key to find install location of Excel 2007?</p>
[ { "answer_id": 244580, "author": "Fionnuala", "author_id": 2548, "author_profile": "https://Stackoverflow.com/users/2548", "pm_score": 4, "selected": true, "text": "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Office\\X.0\\Common\\InstallRoot]\n" }, { "answer_id": 244734, "autho...
2008/10/28
[ "https://Stackoverflow.com/questions/244517", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16794/" ]
244,522
<p>I am writing a web application that will run in kiosk mode on a touch screen. I am currently only targeting it for running on Firefox 3. A few of the use cases I have need to visit external sites. I wish to do so with an embedded browser, which I'm tackling with the help of an <code>&lt;iframe&gt;</code>. I need bac...
[ { "answer_id": 245084, "author": "Borgar", "author_id": 27388, "author_profile": "https://Stackoverflow.com/users/27388", "pm_score": 3, "selected": true, "text": "window.history.current window.history.previous window.history.current <iframe src=\"somepage.html\" name=\"myframe\"></ifram...
2008/10/28
[ "https://Stackoverflow.com/questions/244522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27349/" ]