qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
306,602
<p>I am porting an existing application to C# and want to improve performance wherever possible. Many existing loop counters and array references are defined as System.UInt32, instead of the Int32 I would have used.</p> <p>Is there any significant performance difference for using UInt32 vs Int32?</p>
[ { "answer_id": 306670, "author": "Rohan West", "author_id": 38686, "author_profile": "https://Stackoverflow.com/users/38686", "pm_score": 0, "selected": false, "text": " Console.WriteLine(Int32.MaxValue); // Max interation 2147483647\n Console.WriteLine(UInt32.MaxValue...
2008/11/20
[ "https://Stackoverflow.com/questions/306602", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12113/" ]
306,626
<p>I'm completely stumped on this one. I have three different lists that need to be displayed on the screen. It's completely possible that the lists will extend past the bottom edge of the screen, so I would need scrolling.</p> <p>I've tried using a <code>ScrollView</code> with a <code>LinearLayout</code> child, and ...
[ { "answer_id": 5127111, "author": "hgllnt", "author_id": 593529, "author_profile": "https://Stackoverflow.com/users/593529", "pm_score": 3, "selected": false, "text": "ListAdapter listAdapter = listView.getAdapter();\n \nint rows = listAdapter.getCount() / columns;\nint height = 60 * ...
2008/11/20
[ "https://Stackoverflow.com/questions/306626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12096/" ]
306,641
<p>I am implementing a validation class in classic ASP. How should the validation class interface with my other classes? </p> <p>My current setup: The User class's set methods call the appropriate validation method in the validation class. Any errors that occur are stored in User.mError. For example, here's my set met...
[ { "answer_id": 306823, "author": "shahkalpesh", "author_id": 23574, "author_profile": "https://Stackoverflow.com/users/23574", "pm_score": 0, "selected": false, "text": "\nPsuedo Code.\n\nclass EmailValidator\n...\nfunction Validate(byval EmailAddress as string, optional byval Result as ...
2008/11/20
[ "https://Stackoverflow.com/questions/306641", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26180/" ]
306,642
<p>How can I retrieve raw time-series data from a Proficy Historian/iHistorian?</p> <p>Ideally, I would ask for data for a particular tag between two dates.</p>
[ { "answer_id": 306646, "author": "Michael Haren", "author_id": 29, "author_profile": "https://Stackoverflow.com/users/29", "pm_score": 2, "selected": false, "text": "<add name=\"HistorianConnectionString\" \n providerName=\"ihOLEDB.iHistorian.1\" \n connectionString=\"\n Pr...
2008/11/20
[ "https://Stackoverflow.com/questions/306642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29/" ]
306,668
<p>I've been preaching both to my colleagues and here on SO about the goodness of using parameters in SQL queries, especially in .NET applications. I've even gone so far as to promise them as giving immunity against SQL injection attacks.</p> <p>But I'm starting to wonder if this really is true. Are there any known SQ...
[ { "answer_id": 306675, "author": "Adam Bellaire", "author_id": 21632, "author_profile": "https://Stackoverflow.com/users/21632", "pm_score": 7, "selected": true, "text": "security_level" }, { "answer_id": 306676, "author": "Steven A. Lowe", "author_id": 9345, "author_...
2008/11/20
[ "https://Stackoverflow.com/questions/306668", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30366/" ]
306,679
<p>If a line of text is wrapped to an additional line, how do I determine programmatically the point in the string where it was broken.</p> <p>Example: Input string = "This is a test of a wrapped line of text".</p> <pre><code> Based on the width of the richTextBox it could display: This is a test o...
[ { "answer_id": 313168, "author": "Mike Two", "author_id": 23659, "author_profile": "https://Stackoverflow.com/users/23659", "pm_score": 2, "selected": false, "text": "public partial class Window1 : Window\n{\n public Window1()\n {\n InitializeComponent();\n }\n\n priva...
2008/11/20
[ "https://Stackoverflow.com/questions/306679", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37918/" ]
306,684
<p>I've encountered a weird situation:</p> <p>Messages are sent from ServerA to ServerB. It goes into ServerA outgoing queue and then sent to ServerB's queue.</p> <p>ServerB crashed. We had to reformat. When we brought it up, we forgot to install the MSMQ Service.</p> <p>Messages begin pilling up in ServerA's outgoi...
[ { "answer_id": 546587, "author": "Carlos A. Ibarra", "author_id": 37835, "author_profile": "https://Stackoverflow.com/users/37835", "pm_score": 3, "selected": true, "text": "MQ_SEND_ACCESS" }, { "answer_id": 18854569, "author": "barrypicker", "author_id": 415559, "aut...
2008/11/20
[ "https://Stackoverflow.com/questions/306684", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13484/" ]
306,709
<p>I've been using SVN a lot as a single user on a single computer</p> <p>Now I'd like to share my stuff across multiple computers</p> <p>So far I've been checking out from <code>file://c:/myproject</code></p> <p>I'd like to checkout from <code>svn://mycomputer/myproject</code></p> <p>How can I map the first into t...
[ { "answer_id": 306834, "author": "localshred", "author_id": 29690, "author_profile": "https://Stackoverflow.com/users/29690", "pm_score": 2, "selected": false, "text": "svnserve -d -r /path/to/repos/\n /path/to/repos/myproject svn co svn://your.ip.addr/myproject ./myproject_checkout\n sv...
2008/11/20
[ "https://Stackoverflow.com/questions/306709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6367/" ]
306,713
<p>I'm having some trouble navigating Java's rule for inferring generic type parameters. Consider the following class, which has an optional list parameter:</p> <pre><code>import java.util.Collections; import java.util.List; public class Person { private String name; private List&lt;String&gt; nicknames; publ...
[ { "answer_id": 306748, "author": "carson", "author_id": 25343, "author_profile": "https://Stackoverflow.com/users/25343", "pm_score": 7, "selected": false, "text": "Collections.<String>emptyList();\n return (List<T>)EMPTY_LIST;\n" }, { "answer_id": 306750, "author": "Dan Vint...
2008/11/20
[ "https://Stackoverflow.com/questions/306713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1412/" ]
306,722
<p>I have a table in my MYSQL database which does not have a primary key, but has a unique key on two columns. When using MyEclipse's Hibernate reverse engineer tool to create a mapping for that table, it generates two classes, one for named after the table itself, and one with an "Id" suffix. It seems most of the us...
[ { "answer_id": 306748, "author": "carson", "author_id": 25343, "author_profile": "https://Stackoverflow.com/users/25343", "pm_score": 7, "selected": false, "text": "Collections.<String>emptyList();\n return (List<T>)EMPTY_LIST;\n" }, { "answer_id": 306750, "author": "Dan Vint...
2008/11/20
[ "https://Stackoverflow.com/questions/306722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
306,732
<p>I have a Freemarker template which contains a bunch of placeholders for which values are supplied when the template is processed. I want to conditionally include part of the template if the userName variable is supplied, something like:</p> <pre><code>[#if_exists userName] Hi ${userName}, How are you? [/#if_exist...
[ { "answer_id": 306749, "author": "Ulf Lindback", "author_id": 30354, "author_profile": "https://Stackoverflow.com/users/30354", "pm_score": 9, "selected": true, "text": "[#if userName??]\n Hi ${userName}, How are you?\n[/#if]\n <#if userName??>\n Hi ${userName}, How are you?\n</#if>\...
2008/11/20
[ "https://Stackoverflow.com/questions/306732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2648/" ]
306,743
<p>What is the most efficient way to detect duplicates in a 10 column / 50K row table? I'm using MSSQL 8.0</p>
[ { "answer_id": 306756, "author": "Guge", "author_id": 37771, "author_profile": "https://Stackoverflow.com/users/37771", "pm_score": 4, "selected": false, "text": "group by count(*)>1" }, { "answer_id": 306789, "author": "Aaron Palmer", "author_id": 24908, "author_prof...
2008/11/20
[ "https://Stackoverflow.com/questions/306743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39426/" ]
306,757
<p><strong>Given:</strong> Constructing an ADO Connection object from one thread and giving it to another thread is <strong><em>forbidden</em></strong>. The two threads are different apartments, and even though the first thread will <strong>never</strong> touch it again (not even maintain a reference to it!), it doesn...
[ { "answer_id": 483780, "author": "Lasse V. Karlsen", "author_id": 267, "author_profile": "https://Stackoverflow.com/users/267", "pm_score": 1, "selected": false, "text": "public class MyClass\n{\n int _number;\n\n public int Number { get { return _number; } set { _number = value; }...
2008/11/20
[ "https://Stackoverflow.com/questions/306757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12597/" ]
306,779
<p>I have a PPPOE connection on a computer. That computer has two LAN cards and I activated ICS on it. The problem is, the connection kinda degrades over time (don't know why), and a redial would be nice, hourly maybe. I was thinking of writing an AutoIT script that would do this, if, for example I'm sending some data ...
[ { "answer_id": 484495, "author": "sven", "author_id": 46, "author_profile": "https://Stackoverflow.com/users/46", "pm_score": 3, "selected": true, "text": "rasdial connectionname\n public static int OpenConnection(string connectionName, int Timeout) {\n int ExitCode;\n ProcessStartIn...
2008/11/20
[ "https://Stackoverflow.com/questions/306779", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31610/" ]
306,788
<p>How do I check if the timestamp date of a record is before midnight today?</p> <p>datediff is driving me nuts...</p>
[ { "answer_id": 306794, "author": "Cade Roux", "author_id": 18255, "author_profile": "https://Stackoverflow.com/users/18255", "pm_score": 3, "selected": false, "text": "WHERE dtColumn < DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE()))\n" }, { "answer_id": 306802, "author": "StingyJa...
2008/11/20
[ "https://Stackoverflow.com/questions/306788", "https://Stackoverflow.com", "https://Stackoverflow.com/users/750/" ]
306,806
<p>I have the following entity class (in Groovy):</p> <pre><code>import javax.persistence.Entity import javax.persistence.Id import javax.persistence.GeneratedValue import javax.persistence.GenerationType @Entity public class ServerNode { @Id @GeneratedValue(strategy = GenerationType.AUTO) Long id String fi...
[ { "answer_id": 306825, "author": "billjamesdev", "author_id": 13824, "author_profile": "https://Stackoverflow.com/users/13824", "pm_score": 6, "selected": false, "text": "<property name=\"hbm2ddl.auto\" value=\"create\"/>\n <property name=\"hibernate.hbm2ddl.auto\" value=\"update\"/>\n" ...
2008/11/20
[ "https://Stackoverflow.com/questions/306806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18811/" ]
306,839
<p>Is there a way to reuse a 3rd party control reference?</p> <p>For example, I have this referenced in my App.xaml</p> <pre><code>xmlns:cust="clr-namespace:ThirdParty.Controls;assembly=ThirdParty.Controls" </code></pre> <p>I don't want to repeat this 3rd party control xml namespace on each page/control that needs a...
[ { "answer_id": 306990, "author": "Jobi Joy", "author_id": 8091, "author_profile": "https://Stackoverflow.com/users/8091", "pm_score": 3, "selected": true, "text": "<ContentControl Template=\"{DynamicResource thirdPartyControlTemplate}\" />\n xmlns:thridParty=\"clr-namespace:WpfCustomCo...
2008/11/20
[ "https://Stackoverflow.com/questions/306839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29676/" ]
306,840
<p>I have a working makefile that builds with mingw32. Now i renamed that makefile to Makefile.w32 (source -> <a href="http://pastie.org/319964" rel="nofollow noreferrer">http://pastie.org/319964</a>)</p> <p>Now i have a Makefile with the following. The problem is, it does not build my source</p> <pre><code>all: ...
[ { "answer_id": 306854, "author": "Sherm Pendley", "author_id": 27631, "author_profile": "https://Stackoverflow.com/users/27631", "pm_score": 3, "selected": true, "text": "make -f Makefile.w32\n all: mingw32\n clean: mingw32-clean\n" } ]
2008/11/20
[ "https://Stackoverflow.com/questions/306840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
306,852
<p>I have a C# application that is a client to a web service. One of my requirements is to allow capturing the SOAP that I send, so that if there is a problem, I can either fix the bug, or demonstrate that the problem is in the service I am calling.</p> <p>My WebReference proxy service class derives from <code>System...
[ { "answer_id": 21592590, "author": "bnieland", "author_id": 279393, "author_profile": "https://Stackoverflow.com/users/279393", "pm_score": 2, "selected": false, "text": "mySoapHttpClientProtocol.Url = mySoapHttpClientProtocol.Url.Replace(\"localhost\", \"localhost.fiddler\");\n" }, ...
2008/11/20
[ "https://Stackoverflow.com/questions/306852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7475/" ]
306,859
<p>I have a ContextMenuStrip that contains a submenu of dynamically generated ToolStripMenuItems. There are up to 80 sub menu items. Pressing the first letter of a desired menu item selects it correctly, but if the item happens to be out of the visible range (in a range handled by the scroll arrows), it isn't display...
[ { "answer_id": 21592590, "author": "bnieland", "author_id": 279393, "author_profile": "https://Stackoverflow.com/users/279393", "pm_score": 2, "selected": false, "text": "mySoapHttpClientProtocol.Url = mySoapHttpClientProtocol.Url.Replace(\"localhost\", \"localhost.fiddler\");\n" }, ...
2008/11/20
[ "https://Stackoverflow.com/questions/306859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1484/" ]
306,862
<p>Today my colleagues and me have a discussion about the usage of the <code>final</code> keyword in Java to improve the garbage collection.</p> <p>For example, if you write a method like:</p> <pre><code>public Double doCalc(final Double value) { final Double maxWeight = 1000.0; final Double totalWeight = maxWe...
[ { "answer_id": 306893, "author": "SCdF", "author_id": 1666, "author_profile": "https://Stackoverflow.com/users/1666", "pm_score": 5, "selected": false, "text": "final final MyObject o = new MyObject();\no.setValue(\"foo\"); // Works just fine\no = new MyObject(); // Doesn't work.\n Final...
2008/11/20
[ "https://Stackoverflow.com/questions/306862", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34856/" ]
306,863
<p>I know this isn't really what XPath is for but if I have a HashMap of XPath expressions to values how would I go about building an XML document. I've found dom-4j's DocumentHelper.makeElement(branch, xpath) except it is incapable of creating attributes or indexing. Surely a library exists that can do this?</p> <pr...
[ { "answer_id": 306893, "author": "SCdF", "author_id": 1666, "author_profile": "https://Stackoverflow.com/users/1666", "pm_score": 5, "selected": false, "text": "final final MyObject o = new MyObject();\no.setValue(\"foo\"); // Works just fine\no = new MyObject(); // Doesn't work.\n Final...
2008/11/20
[ "https://Stackoverflow.com/questions/306863", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
306,867
<p>I have a problem where I cannot identify visitors to my intranet page because their browser is configured to use a proxy, even for the local intranet. I always see the proxy IP and no other details about the client. The SOE that my company uses has the proxy set up already for Firefox and Internet Explorer, and I ca...
[ { "answer_id": 306882, "author": "Sijin", "author_id": 8884, "author_profile": "https://Stackoverflow.com/users/8884", "pm_score": 1, "selected": false, "text": "HTTP-X-FORWARD-FOR REMOTE-ADDR" } ]
2008/11/20
[ "https://Stackoverflow.com/questions/306867", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10320/" ]
306,871
<p>A table exists that someone else loaded. I need to query against the table, but the lack of indexes makes the query plan abysmal. What I would like to do is detect if there is an index for a particular column, so that I can created it if it does not exist, and not create it if it is already there.</p> <p>Thanks.<...
[ { "answer_id": 306881, "author": "BQ.", "author_id": 4632, "author_profile": "https://Stackoverflow.com/users/4632", "pm_score": 2, "selected": false, "text": "Select * from sys.all_ind_columns where table_name=:TabName and table_owner=:TabOwner;\n" }, { "answer_id": 306895, ...
2008/11/20
[ "https://Stackoverflow.com/questions/306871", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7734/" ]
306,877
<p>I wanted to deserialize an XML message containing an element that can be marked <code>nil="true"</code> into a class with a property of type <code>int?</code>. The only way I could get it to work was to write my own <code>NullableInt</code> type which implements <code>IXmlSerializable</code>. Is there a better way t...
[ { "answer_id": 306980, "author": "Phil Jenkins", "author_id": 35496, "author_profile": "https://Stackoverflow.com/users/35496", "pm_score": 4, "selected": true, "text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<entities xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type...
2008/11/20
[ "https://Stackoverflow.com/questions/306877", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12006/" ]
306,880
<pre><code>ArrayList &lt;String&gt; list = new ArrayList(); list.add("behold"); list.add("bend"); list.add("bet"); list.add("bear"); list.add("beat"); list.add("become"); list.add("begin"); </code></pre> <p>There is a way to search for the regexp bea.* and get the indexes like in ArrayList.indexOf ?</p> <p>EDIT: re...
[ { "answer_id": 306954, "author": "Herms", "author_id": 1409, "author_profile": "https://Stackoverflow.com/users/1409", "pm_score": 3, "selected": false, "text": "import java.util.regex.Pattern;\nimport java.util.ListIterator;\nimport java.util.ArrayList;\n\n/**\n * Finds the index of all...
2008/11/20
[ "https://Stackoverflow.com/questions/306880", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14015/" ]
306,894
<p>As a beginning programmer, I'm trying to settle on a standard naming convention for myself. I realize that it's personal preference, but I was trying to get some ideas from some of you (well a LOT of you) who are much smarter than myself.</p> <p>I'm not talking about camel notation but rather how do you name your ...
[ { "answer_id": 306923, "author": "Greg Beech", "author_id": 13552, "author_profile": "https://Stackoverflow.com/users/13552", "pm_score": 5, "selected": true, "text": "quantity" }, { "answer_id": 307003, "author": "Ryan Lundy", "author_id": 5486, "author_profile": "ht...
2008/11/20
[ "https://Stackoverflow.com/questions/306894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38317/" ]
306,896
<p>Is it possible to use EventListener to Listen to a variable and detect when the value of that variable changes? Thanks.</p>
[ { "answer_id": 318639, "author": "Brian Hodge", "author_id": 20628, "author_profile": "https://Stackoverflow.com/users/20628", "pm_score": 5, "selected": true, "text": "someVar = 5 someVar(5); //The document class\npackage\n{\n import flash.display.Sprite;\n import flash.events.Event;\...
2008/11/20
[ "https://Stackoverflow.com/questions/306896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34797/" ]
306,901
<p>When I run a wxPython application, it prints the string &ldquo;Redirecting output to win32trace remote collector&rdquo;and I must open PythonWin's trace collector tool to view that trace output.</p> <p>Since I'm not interested in collecting this output, how should I disable this feature?</p>
[ { "answer_id": 306925, "author": "joeforker", "author_id": 36330, "author_profile": "https://Stackoverflow.com/users/36330", "pm_score": 1, "selected": false, "text": "class MyApp(wx.App):\n def __init__(self):\n # Prevent wxPython from redirecting stdout/stderr:\n super...
2008/11/20
[ "https://Stackoverflow.com/questions/306901", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36330/" ]
306,906
<p>I would like to find all the rows in a table and match on an exact case sensitive string. Unfortunately, my table has the case insensitive collation. </p> <p>What is the most efficient way to perform this.</p> <p>Eg.</p> <p>I would like the following to return no rows:</p> <pre><code>select * from sysobject wher...
[ { "answer_id": 306918, "author": "Sam Saffron", "author_id": 17174, "author_profile": "https://Stackoverflow.com/users/17174", "pm_score": 4, "selected": true, "text": "declare @match nvarchar(4000) \nset @match = 'sysbinobjs'\n\n\nselect * from sysobjects\nwhere name = @match and\ncast(...
2008/11/20
[ "https://Stackoverflow.com/questions/306906", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17174/" ]
306,924
<p>Is it possible to set the size of a checkbox using CSS or HTML across browsers? </p> <p><code>width</code> and <code>size</code> work in IE6+, but not with Firefox, where the checkbox stays 16x16 even if I set a smaller size.</p>
[ { "answer_id": 3132509, "author": "Avi Flax", "author_id": 7012, "author_profile": "https://Stackoverflow.com/users/7012", "pm_score": 3, "selected": false, "text": "-webkit-transform: scale(1.3, 1.3);" }, { "answer_id": 10415275, "author": "jdw", "author_id": 1370191, ...
2008/11/20
[ "https://Stackoverflow.com/questions/306924", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39474/" ]
306,937
<p>What is the cast expression equivalent of VB.NET's CType in Visual Basic 6?</p>
[ { "answer_id": 306944, "author": "JohnFx", "author_id": 30018, "author_profile": "https://Stackoverflow.com/users/30018", "pm_score": 5, "selected": true, "text": "cint() Cast to integer\ncstr() cast to string\nclng() cast to long\ncdbl() cast to double\ncdate() cast to date\n" }, { ...
2008/11/20
[ "https://Stackoverflow.com/questions/306937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35286/" ]
306,938
<p>We currently have an appserver setup where EVERYTHING is off of one big context root, and we copy class files and restart app servers to deploy. Not ideal. I'm trying to set up an ant script to do the build and deploy using wdeploy, and everything works, except I need my servlet to forward to jsps outside of the con...
[ { "answer_id": 306944, "author": "JohnFx", "author_id": 30018, "author_profile": "https://Stackoverflow.com/users/30018", "pm_score": 5, "selected": true, "text": "cint() Cast to integer\ncstr() cast to string\nclng() cast to long\ncdbl() cast to double\ncdate() cast to date\n" }, { ...
2008/11/20
[ "https://Stackoverflow.com/questions/306938", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12386/" ]
306,945
<p>I have a very long-running stored procedure in SQL Server 2005 that I'm trying to debug, and I'm using the 'print' command to do it. The problem is, I'm only getting the messages back from SQL Server at the very end of my sproc - I'd like to be able to flush the message buffer and see these messages immediately duri...
[ { "answer_id": 307005, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 9, "selected": true, "text": "RAISERROR RAISERROR( 'This message will show up right away...',0,1) WITH NOWAIT\n" }, { "answer_id": 4068129, ...
2008/11/20
[ "https://Stackoverflow.com/questions/306945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16942/" ]
306,946
<p>need ask you about some help.</p> <p>I have web app running in Net 2.0.<br> I wanna ask what storage (cache, session, file) I should use for my objects as they have different scope of using. Can be divide into several groups:<br> 1) objects related directly to visitor (e.g. details about visitor that are received a...
[ { "answer_id": 306978, "author": "cfeduke", "author_id": 5645, "author_profile": "https://Stackoverflow.com/users/5645", "pm_score": 3, "selected": true, "text": "Session Session Cache Application" } ]
2008/11/20
[ "https://Stackoverflow.com/questions/306946", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24507/" ]
306,968
<p>I have a linux box with a bank of modems and need to create demand-dial (outbound) PPP connections to a very large set of remote machines. Since I have far more remotes than local modems, I'd like to launch one or more instances of <code>pppd</code> in <code>demand</code> mode, but not allocate a particular modem u...
[ { "answer_id": 361114, "author": "Adam Liss", "author_id": 29157, "author_profile": "https://Stackoverflow.com/users/29157", "pm_score": 2, "selected": true, "text": "/dev/modem0 /dev/modem1 pppd /dev/modem. /dev/modem. /dev/null" } ]
2008/11/20
[ "https://Stackoverflow.com/questions/306968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29157/" ]
306,992
<p>I have found an example for encrypting a web.config during installation <a href="http://madtechnology.wordpress.com/2007/05/04/using-wix-to-secure-a-connection-string/" rel="nofollow noreferrer">here</a>, but my app is a windows service. The <code>aspnetreg_iis</code> method works only for web.config files.</p> <p...
[ { "answer_id": 307080, "author": "AJ.", "author_id": 27457, "author_profile": "https://Stackoverflow.com/users/27457", "pm_score": 2, "selected": false, "text": "//class global\nstatic System.Reflection.Assembly DefiningAssembly;\n\nAppDomain currentDomain = AppDomain.CurrentDomain;\ncur...
2008/11/20
[ "https://Stackoverflow.com/questions/306992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1865/" ]
307,004
<p>On several of my usercontrols, I change the cursor by using</p> <pre><code>this.Cursor = Cursors.Wait; </code></pre> <p>when I click on something.</p> <p>Now I want to do the same thing on a WPF page on a button click. When I hover over my button, the cursor changes to a hand, but when I click it, it doesn't cha...
[ { "answer_id": 307020, "author": "Matt Hamilton", "author_id": 615, "author_profile": "https://Stackoverflow.com/users/615", "pm_score": 9, "selected": true, "text": "Mouse.OverrideCursor = Cursors.Wait;\ntry\n{\n // do stuff\n}\nfinally\n{\n Mouse.OverrideCursor = null;\n}\n" },...
2008/11/20
[ "https://Stackoverflow.com/questions/307004", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3047/" ]
307,006
<p>I'm working on an application controller for a program that is spitting text directly to /dev/tty.</p> <p>This is a production application controller that must be able to catch all text going to the terminal. Generally, this isn't a problem. We simply redirect stdout and stderr. This particular application is makin...
[ { "answer_id": 307328, "author": "flolo", "author_id": 36472, "author_profile": "https://Stackoverflow.com/users/36472", "pm_score": 2, "selected": false, "text": " screen -D -m yourEvilProgram\n" }, { "answer_id": 307505, "author": "Jonathan Leffler", "author_id": 15168,...
2008/11/20
[ "https://Stackoverflow.com/questions/307006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19741/" ]
307,013
<p>This is for .NET. IgnoreCase is set and MultiLine is NOT set.</p> <p>Usually I'm decent at regex, maybe I'm running low on caffeine...</p> <p>Users are allowed to enter HTML-encoded entities (&lt;lt;, &lt;amp;, etc.), and to use the following HTML tags:</p> <pre><code>u, i, b, h3, h4, br, a, img </code></pre> <p...
[ { "answer_id": 308367, "author": "Jan Goyvaerts", "author_id": 33358, "author_profile": "https://Stackoverflow.com/users/33358", "pm_score": 1, "selected": false, "text": "<(?!/?(i|b|h3|h4|a|img)\\b)[^>]+>\n" }, { "answer_id": 315823, "author": "Jason Kelley", "author_id"...
2008/11/20
[ "https://Stackoverflow.com/questions/307013", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16306/" ]
307,014
<p>A client of mine has told me the program I made for them won't connect to a SQL server named instance, I have a standard SQL server with no named instance so I'm wondering how I can test this. A named instance connection string look like the one below, could the backslash be were my code fails?</p> <p>Driver={SQL N...
[ { "answer_id": 309877, "author": "D'Arcy Rittich", "author_id": 39430, "author_profile": "https://Stackoverflow.com/users/39430", "pm_score": 2, "selected": false, "text": "string server = \"myServer\\\\myInstance\";\n string server = @\"myServer\\myInstance\";\n" } ]
2008/11/20
[ "https://Stackoverflow.com/questions/307014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
307,015
<p>This isn't working. Can this be done in find? Or do I need to xargs?</p> <pre><code>find -name 'file_*' -follow -type f -exec zcat {} \| agrep -dEOE 'grep' \; </code></pre>
[ { "answer_id": 307023, "author": "Paul Tomblin", "author_id": 3333, "author_profile": "https://Stackoverflow.com/users/3333", "pm_score": 4, "selected": false, "text": "find . -name \"file_*\" -follow -type f -print0 | xargs -0 zcat | agrep -dEOE 'grep'\n" }, { "answer_id": 30715...
2008/11/20
[ "https://Stackoverflow.com/questions/307015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34594/" ]
307,019
<p>The following query returns strange results for me:</p> <pre><code>SELECT `Statistics`.`StatisticID`, COUNT(`Votes`.`StatisticID`) AS `Score`, COUNT(`Views`.`StatisticID`) AS `Views`, COUNT(`Comments`.`StatisticID`) AS `Comments` FROM `Statistics` LEFT JOIN `Votes` ON `Votes`.`StatisticID` = `Statis...
[ { "answer_id": 307303, "author": "benlumley", "author_id": 39161, "author_profile": "https://Stackoverflow.com/users/39161", "pm_score": 3, "selected": true, "text": "SELECT\n `Statistics`.`StatisticID`,\n COUNT(DISTINCT `Votes`.`VoteID`) AS `Score`,\n COUNT(DISTINCT `Views`.`Vi...
2008/11/20
[ "https://Stackoverflow.com/questions/307019", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2025/" ]
307,024
<p>A link that stands out is <a href="http://www.devdaily.com/blog/post/jfc-swing/handling-main-mac-menu-in-swing-application/" rel="noreferrer">http://www.devdaily.com/blog/post/jfc-swing/handling-main-mac-menu-in-swing-application/</a> however the menu bar under Mac OS X displays as the package name as opposed to the...
[ { "answer_id": 307996, "author": "Daniel Hiller", "author_id": 16193, "author_profile": "https://Stackoverflow.com/users/16193", "pm_score": 2, "selected": false, "text": "-Xdock:name=\"YourNameHere\"\n" }, { "answer_id": 310575, "author": "Matt Solnit", "author_id": 6198...
2008/11/20
[ "https://Stackoverflow.com/questions/307024", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39693/" ]
307,027
<p>I'm wondering if this is a good design. I have a number of tables that require address information (e.g. street, post code/zip, country, fax, email). Sometimes the same address will be repeated multiple times. For example, an address may be stored against a supplier, and then on each purchase order sent to them. ...
[ { "answer_id": 307111, "author": "Eric Z Beard", "author_id": 1219, "author_profile": "https://Stackoverflow.com/users/1219", "pm_score": 6, "selected": true, "text": "Addresses\n---------\nAddressId (PK)\nStreet1\n... (etc)\n AddressTypes\n------------\nAddressTypeId\nAddressTypeName\n ...
2008/11/20
[ "https://Stackoverflow.com/questions/307027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14663/" ]
307,030
<p>I have a working make, I have platform code and like several makes for each os in the folder. Right now I have one makefile which works. I renamed it to Makefile.ws and wrote this in Makefile</p> <pre><code>all: make -f Makefile.w32 clean: make -f Makefile.w32 clean </code></pre> <p>I ran it and got this ...
[ { "answer_id": 307062, "author": "e.James", "author_id": 33686, "author_profile": "https://Stackoverflow.com/users/33686", "pm_score": 0, "selected": false, "text": "$(MAKE) -f ... make -f ..." }, { "answer_id": 307067, "author": "JesperE", "author_id": 13051, "author...
2008/11/20
[ "https://Stackoverflow.com/questions/307030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
307,041
<p>The rails books and web pages I've been following have all stuck to very simple projects for the sake of providing complete examples. I'm moving away from the small project app and into a realm of non-browser clients and need to decide where to put code that is shared by all involved parties.</p> <p>The non-browse...
[ { "answer_id": 307061, "author": "John Topley", "author_id": 1450, "author_profile": "https://Stackoverflow.com/users/1450", "pm_score": 4, "selected": true, "text": "/lib" } ]
2008/11/20
[ "https://Stackoverflow.com/questions/307041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30997/" ]
307,048
<p>Suddenly my Flex Apps can no longer connect to salesforce.com via its API, I am getting a security sandbox violation. Login credentials are correct, I have tried them via a different means, and I have obfuscated them below.</p> <p>This was working fine earlier today and I have not been coding since then.</p> <p>A...
[ { "answer_id": 339479, "author": "Simon", "author_id": 24039, "author_profile": "https://Stackoverflow.com/users/24039", "pm_score": 1, "selected": false, "text": "apex = new Connection(); \napex.serverUrl = \"https://na3.salesforce.com/services/Soap/u/14.0\";\napex.protocol = \"https...
2008/11/20
[ "https://Stackoverflow.com/questions/307048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24039/" ]
307,056
<p>What rules apply to the name that ends up in the exports section of an PE (Portable Executable)? Roughly, I see names starting with an '_' underscore, a '?' question mark or an '@' at-sign. What do those mean, and what about the rest of the name?</p> <p>Also - How can I reverse the naming convention into something ...
[ { "answer_id": 307076, "author": "Eric", "author_id": 6367, "author_profile": "https://Stackoverflow.com/users/6367", "pm_score": 3, "selected": true, "text": "LIBRARY \"MyDll\"\n\nEXPORTS\n exportFunction1\n" } ]
2008/11/20
[ "https://Stackoverflow.com/questions/307056", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12170/" ]
307,060
<p>The function <a href="http://msdn.microsoft.com/en-us/library/aa366537(VS.85).aspx" rel="noreferrer">CreateFileMapping</a> can be used to allocate space in the pagefile (if the first argument is <code>INVALID_HANDLE_VALUE</code>). The allocated space can later be memory mapped into the process virtual address space...
[ { "answer_id": 307106, "author": "Kieveli", "author_id": 15852, "author_profile": "https://Stackoverflow.com/users/15852", "pm_score": 3, "selected": true, "text": "A single file mapping object can be shared by multiple processes.\n" } ]
2008/11/20
[ "https://Stackoverflow.com/questions/307060", "https://Stackoverflow.com", "https://Stackoverflow.com/users/755/" ]
307,070
<p>I want to offload a block of code in my main process to child process to make it run concurrently. I also want to have the PID of the spawned child process so I can monitor and kill it if necessary.</p>
[ { "answer_id": 307088, "author": "Chris Lloyd", "author_id": 42413, "author_profile": "https://Stackoverflow.com/users/42413", "pm_score": 6, "selected": true, "text": "fork #!/usr/bin/env ruby\nputs \"This is the master process.\"\n\nchild_pid = fork do\n puts \"This is the child proce...
2008/11/20
[ "https://Stackoverflow.com/questions/307070", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42413/" ]
307,073
<p>Consider the "double-check idiom for lazy initialization of instance fields":</p> <blockquote><pre>// Item 71 in Effective Java copied from <a href="http://java.sun.com/developer/technicalArticles/Interviews/bloch_effective_08_qa.html" rel="nofollow noreferrer">this interview with Bloch</a>. private volatile FieldT...
[ { "answer_id": 307206, "author": "jacobko", "author_id": 1318, "author_profile": "https://Stackoverflow.com/users/1318", "pm_score": 0, "selected": false, "text": "reset() reset() void reset() {\n field = new FieldType();\n}\n" }, { "answer_id": 307225, "author": "erickson...
2008/11/20
[ "https://Stackoverflow.com/questions/307073", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39489/" ]
307,082
<p>What is the shortest chunk of C++ you can come up with to safely clean up a <code>std::vector</code> or <code>std::list</code> of pointers? (assuming you have to call delete on the pointers?)</p> <pre><code>list&lt;Foo*&gt; foo_list; </code></pre> <p>I'd rather not use Boost or wrap my pointers with smart pointers....
[ { "answer_id": 307090, "author": "John Dibling", "author_id": 241536, "author_profile": "https://Stackoverflow.com/users/241536", "pm_score": 3, "selected": false, "text": "template< typename T >\nstruct delete_ptr : public std::unary_function<T,bool>\n{\n bool operator()(T*pT) const {...
2008/11/20
[ "https://Stackoverflow.com/questions/307082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23524/" ]
307,084
<p>The .net framework 3.5 (or vista) provides me with an English voice (David I think) to use with the Speech.Synthesis api. I need a french voice to use with a french dictation practice app I am building for my kids to use to improve their french spelling. The api allows me to change culture when creating a voice, but...
[ { "answer_id": 307090, "author": "John Dibling", "author_id": 241536, "author_profile": "https://Stackoverflow.com/users/241536", "pm_score": 3, "selected": false, "text": "template< typename T >\nstruct delete_ptr : public std::unary_function<T,bool>\n{\n bool operator()(T*pT) const {...
2008/11/20
[ "https://Stackoverflow.com/questions/307084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1400/" ]
307,089
<p>I've been looking for some guidelines on how to layout PHP code. I've found some good references, such as the following:</p> <p><a href="http://www.dagbladet.no/development/phpcodingstandard/" rel="nofollow noreferrer">http://www.dagbladet.no/development/phpcodingstandard/</a></p> <p>and <a href="https://stackover...
[ { "answer_id": 307164, "author": "Nick Van Brunt", "author_id": 30470, "author_profile": "https://Stackoverflow.com/users/30470", "pm_score": 2, "selected": false, "text": "index.php" } ]
2008/11/20
[ "https://Stackoverflow.com/questions/307089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11522/" ]
307,094
<p>I have a couple of tables that I want to map to classes. The tables look like this:</p> <pre><code>Asset --------- AssetId AssetName Product --------- ProductId ProductName AssetId Disposal --------- DisposalId AssetId DisposalDate </code></pre> <p>Basically what I want to do is join the Product Table to the Dis...
[ { "answer_id": 750741, "author": "Stefan Steinegger", "author_id": 2658202, "author_profile": "https://Stackoverflow.com/users/2658202", "pm_score": 1, "selected": true, "text": " <class name=\"Product\" table=\"Product\" lazy=\"false\">\n <id name=\"ProductId\" column=\"ProductId\" ...
2008/11/20
[ "https://Stackoverflow.com/questions/307094", "https://Stackoverflow.com", "https://Stackoverflow.com/users/493/" ]
307,096
<p>When using tables in a CSS-based layout, I've noticed if I have a table with 4 columns (2 on the side are small for spacing, 2 in the middle are for content), when I type content in one of the two middle columns, it will stay at the top, which is perfect.</p> <p>However, if I type content in the other middle column...
[ { "answer_id": 307186, "author": "Zack The Human", "author_id": 18265, "author_profile": "https://Stackoverflow.com/users/18265", "pm_score": 1, "selected": false, "text": "td {\n vertical-align:top;\n}\n <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.o...
2008/11/20
[ "https://Stackoverflow.com/questions/307096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32484/" ]
307,098
<p>i get a Keyword not supported: '192.168.1.1;initial catalog'. error when trying to do this </p> <p><code>Dim cn As New SqlConnection(str)</code> </p> <p>where str is the connection string starts with '192.168.1.1;initial catalog' ... I have not specified the provider in the connection string</p>
[ { "answer_id": 307114, "author": "lomaxx", "author_id": 493, "author_profile": "https://Stackoverflow.com/users/493", "pm_score": 5, "selected": true, "text": "Dim str As String\nstr = \"Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;\"\n\nD...
2008/11/20
[ "https://Stackoverflow.com/questions/307098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
307,120
<p>I need to set a system environment variable from a Bash script that would be available outside of the current scope. So you would normally export environment variables like this:</p> <pre><code>export MY_VAR=/opt/my_var </code></pre> <p>But I need the environment variable to be available at a system level though. ...
[ { "answer_id": 307145, "author": "Douglas Leeder", "author_id": 3978, "author_profile": "https://Stackoverflow.com/users/3978", "pm_score": 4, "selected": false, "text": "source {script}\n eval `bash {script}`\n eval \"$(bash script.sh)\"\n" }, { "answer_id": 307204, "author"...
2008/11/20
[ "https://Stackoverflow.com/questions/307120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18228/" ]
307,128
<p>I'm having trouble with this code:</p> <pre><code>NSRect itemFrame; id item; // code to assign item goes here. itemFrame.origin.y -= [item respondsToSelector:@selector(selectedHeight)] ? [item selectedHeight] : [self defaultSelectedHeight]; </code></pre> <p>This is the problematic bit:</p> <pre><code>[item sele...
[ { "answer_id": 307146, "author": "Marc Charbonneau", "author_id": 35136, "author_profile": "https://Stackoverflow.com/users/35136", "pm_score": 1, "selected": false, "text": "selectedHeight item" }, { "answer_id": 307147, "author": "e.James", "author_id": 33686, "auth...
2008/11/20
[ "https://Stackoverflow.com/questions/307128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
307,141
<p>I need to test for general URLs using any protocol (http, https, shttp, ftp, svn, mysql and things I don't know about).</p> <p>My first pass is this:</p> <pre><code>\w+://(\w+\.)+[\w+](/[\w]+)(\?[-A-Z0-9+&amp;@#/%=~_|!:,.;]*)? </code></pre> <p>(<a href="http://perldoc.perl.org/perlre.html" rel="nofollow noreferre...
[ { "answer_id": 307142, "author": "BCS", "author_id": 1343, "author_profile": "https://Stackoverflow.com/users/1343", "pm_score": 2, "selected": false, "text": "[\\w+-]+://([a-zA-Z0-9]+\\.)+[[a-zA-Z0-9]+](/[%\\w]+)(\\?[-A-Z0-9+&@#/%=~_|!:,.;]*)?\n ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?...
2008/11/20
[ "https://Stackoverflow.com/questions/307141", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1343/" ]
307,148
<p>Vim is acting slow when I scroll. The cursor skips some lines when I'm pressing j/k continually.</p> <p>I'm using xterm and urxvt. In both vim acts like this.</p> <p>This happens locally, with small or big files. I do use Control + F/B they work just fine.</p> <p>EDIT: ttyfast in small files did the trick but in ...
[ { "answer_id": 307175, "author": "Jeremy Cantrell", "author_id": 18866, "author_profile": "https://Stackoverflow.com/users/18866", "pm_score": 7, "selected": true, "text": ":help 'ttyfast'\n :set ttyfast\n vim -u NONE\n" }, { "answer_id": 378967, "author": "Cyber Oliveira", ...
2008/11/20
[ "https://Stackoverflow.com/questions/307148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36532/" ]
307,152
<p>What do I gain by adding a timestamp column called recordversion to a table in ms-sql?</p>
[ { "answer_id": 307261, "author": "TravisO", "author_id": 35116, "author_profile": "https://Stackoverflow.com/users/35116", "pm_score": 1, "selected": false, "text": "CreatedBy(varchar) | CreatedOn(date) | ModifiedBy(varchar) | ModifiedOn(date)\n" } ]
2008/11/20
[ "https://Stackoverflow.com/questions/307152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1632/" ]
307,179
<p>Is this defined by the language? Is there a defined maximum? Is it different in different browsers?</p>
[ { "answer_id": 307194, "author": "Peter Bailey", "author_id": 8815, "author_profile": "https://Stackoverflow.com/users/8815", "pm_score": 9, "selected": false, "text": "Number.MIN_SAFE_INTEGER;\nNumber.MAX_SAFE_INTEGER;\n Number.MAX_VALUE;\nNumber.MIN_VALUE;\n console.log('MIN_VALUE', Nu...
2008/11/20
[ "https://Stackoverflow.com/questions/307179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5657/" ]
307,183
<p>In .NET is there a function that tests if a string is syntactically a correct path? I specifically don't want it to test if the path actually exists.</p> <p>my current take on this is a regex:</p> <pre><code>([a-zA-Z]:|\\)?\\?([^/\\:*?"&lt;&gt;|]+[/\\])*[^/\\:*?"&lt;&gt;|]* </code></pre> <p>matches:</p> <pre><co...
[ { "answer_id": 307196, "author": "Aaron Palmer", "author_id": 24908, "author_profile": "https://Stackoverflow.com/users/24908", "pm_score": 2, "selected": true, "text": "RegEx=\"^([a-zA-Z]\\:|\\\\\\\\[^\\/\\\\:*?\"<>|]+\\\\[^\\/\\\\:*?\"<>|]+)(\\\\[^\\/\\\\:*?\"<>|]+)+(\\.[^\\/\\\\:*?\"<...
2008/11/20
[ "https://Stackoverflow.com/questions/307183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1343/" ]
307,198
<p>I want to store a URL prefix in an Windows environment variable. The ampersands in the query string makes this troublesome though.</p> <p>For example: I have a URL prefix of <code>http://example.com?foo=1&amp;bar=</code> and want to create a full URL by providing a value for the <code>bar</code> parameter. I then w...
[ { "answer_id": 307218, "author": "wimh", "author_id": 33499, "author_profile": "https://Stackoverflow.com/users/33499", "pm_score": -1, "selected": false, "text": "for /f \"tokens=*\" %i in (%myvar%) do set %myvar%=%~i\n set myvar=\"http://example.com?foo=1&bar=\"\nstart \"\" %myvar%\n" ...
2008/11/20
[ "https://Stackoverflow.com/questions/307198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3488/" ]
307,210
<p>I'm doing a PHP site which displays code examples in various languages (C#, PHP, Perl, Ruby, etc.). Are there any PHP functions which add syntax coloring for these and other languages? </p> <p>If not, I would at least like to find that one built-in PHP function which does syntax coloring for PHP code, can't find it...
[ { "answer_id": 307228, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": 1, "selected": false, "text": "\"<?php\\n$code\\n?>\" <?php ?>" } ]
2008/11/20
[ "https://Stackoverflow.com/questions/307210", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4639/" ]
307,232
<p>I am very curious about the possibility of providing immutability for java beans (by beans here I mean classes with an empty constructor providing getters and setters for members). Clearly these classes are not immutable and where they are used to transport values from the data layer this seems like a real proble...
[ { "answer_id": 307283, "author": "Michael Rutherfurd", "author_id": 33889, "author_profile": "https://Stackoverflow.com/users/33889", "pm_score": 2, "selected": false, "text": "public interface DateBean {\n public Date getDate();\n}\n\npublic class ImmutableDate implements DateBean {\...
2008/11/20
[ "https://Stackoverflow.com/questions/307232", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39476/" ]
307,236
<p>Can any one give me a scripts (HTML/CSS/Javascript) that can reproduce this error on <code>IE 7.0</code>? I am trying to fix this bug in my page where I get this warning but could not exactly found the problem. Line number does not match with the source either. </p> <p>I thought the better approach would be to crea...
[ { "answer_id": 307385, "author": "Shog9", "author_id": 811, "author_profile": "https://Stackoverflow.com/users/811", "pm_score": 1, "selected": false, "text": "var blah = {};\nblah.methodWhichDoesntExist(); // <-- error\n" }, { "answer_id": 307431, "author": "nickf", "aut...
2008/11/20
[ "https://Stackoverflow.com/questions/307236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3627/" ]
307,250
<p>I have a field in my form labeled "Name" that will contain both the First &amp; Last name.</p> <p>Our existing dynamic server (to which the form is being POSTed to), expects two separate fields (first name, last name). </p> <p>Can I use Javascript to split the user input into two separate variables before the form...
[ { "answer_id": 307266, "author": "FlySwat", "author_id": 1965, "author_profile": "https://Stackoverflow.com/users/1965", "pm_score": 0, "selected": false, "text": "var yourForm = document.getElementById('yourFormId');\nyourform.onsubmit = new function()\n{\n var nameBox = document.get...
2008/11/20
[ "https://Stackoverflow.com/questions/307250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32154/" ]
307,273
<p>I have the whole MVC-Model set up and use HTML views as templates. But I have german strings in there that I would like to translate to other languages at some point.</p> <p>What is the best way to do this? I know I have to use Zend_Translate, but do I have to implement a single call to a translate function for eve...
[ { "answer_id": 308170, "author": "Stefan Gehrig", "author_id": 11354, "author_profile": "https://Stackoverflow.com/users/11354", "pm_score": 5, "selected": true, "text": "// setup your translation\n$translate = new Zend_Translate('csv', '/my/path/source-de.csv', 'de');\n$translate->addTr...
2008/11/20
[ "https://Stackoverflow.com/questions/307273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9535/" ]
307,287
<p>I have a question about implementing caching (memoization) using arrays in Haskell. The following pattern works:</p> <pre><code>f = (fA !) where fA = listArray... </code></pre> <p>But this does not (the speed of the program suggests that the array is getting recreated each call or something):</p> <pre><code>f ...
[ { "answer_id": 307399, "author": "CesarB", "author_id": 28258, "author_profile": "https://Stackoverflow.com/users/28258", "pm_score": 3, "selected": false, "text": "-v4 fA n n fA fA fA !! f 10000 f 2 f 3 f 12 fA f fA f -v4" }, { "answer_id": 308567, "author": "luqui", "au...
2008/11/20
[ "https://Stackoverflow.com/questions/307287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
307,292
<p>I have been bitten by a poorly architected solution. It is not thread safe! </p> <p>I have several shared classes and members in the solution, and during development all was cool...<br> BizTalk has sunk my battle ship. </p> <p>We are using a custom BizTalk Adapter to call my assemblies. The Adapter is calling ...
[ { "answer_id": 307310, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 0, "selected": false, "text": "public class Loader\n{\n private static object SyncRoot = new object();\n private string connectionString;\n p...
2008/11/20
[ "https://Stackoverflow.com/questions/307292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1048/" ]
307,294
<p>SOLVED: Nevermind, the links were visited, and the border definition was missing for visited links (as someone pointed out, thanks). As for the color being first place in the border definition, the snippet comes from the IE Developper Toolbar, this is not directly my code. Anyway, thank you guys !</p> <p>Why does t...
[ { "answer_id": 307297, "author": "Patrick Desjardins", "author_id": 13913, "author_profile": "https://Stackoverflow.com/users/13913", "pm_score": 3, "selected": true, "text": "*{...} #main A:link, A:Visited {\n\nCOLOR: #437fda;\n\nBORDER-BOTTOM: #437fda 1px dashed;\n\nTEXT-DECORATION: no...
2008/11/20
[ "https://Stackoverflow.com/questions/307294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39474/" ]
307,304
<p>How do I convert an SQL Server SMALLDATETIME to Unix Timestamp? </p> <p>date was stored as CAST(0x96040474 AS SmallDateTime) in MS Access DB. Data was dumped to SQL and I'm looking to convert those times to Unix Timestamps for MySQL.</p> <p>Thanks AO</p>
[ { "answer_id": 307625, "author": "Ken Gentle", "author_id": 8709, "author_profile": "https://Stackoverflow.com/users/8709", "pm_score": 0, "selected": false, "text": "smalldatetime" } ]
2008/11/20
[ "https://Stackoverflow.com/questions/307304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
307,305
<p>What's the easiest way to play a sound file (.wav) in Python? By easiest I mean both most platform independent and requiring the least dependencies. pygame is certainly an option, but it seems overkill for just sound.</p>
[ { "answer_id": 307316, "author": "Rizwan Kassim", "author_id": 35335, "author_profile": "https://Stackoverflow.com/users/35335", "pm_score": 3, "selected": false, "text": "import time, wave, pymedia.audio.sound as sound\nf= wave.open( 'YOUR FILE NAME', 'rb' )\nsampleRate= f.getframerate(...
2008/11/20
[ "https://Stackoverflow.com/questions/307305", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15055/" ]
307,313
<p>I am writing an iPhone application, and need to save the state of my application (5K or so).</p> <p>My main worry is data persisting across upgrades. Some of the applications I use clearly got this wrong, and I would prefer not to!</p>
[ { "answer_id": 9675747, "author": "Allison", "author_id": 1166266, "author_profile": "https://Stackoverflow.com/users/1166266", "pm_score": 4, "selected": false, "text": "NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];\n[prefs setObject:@\"TextToSave\" forKey:@\"keyToFindT...
2008/11/20
[ "https://Stackoverflow.com/questions/307313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27074/" ]
307,322
<p>Let's say I have some code like this:<br /></p> <pre><code>&lt;html&gt; &lt;head&gt;&lt;title&gt;Title&lt;/title&gt;&lt;/head&gt; &lt;body&gt; &lt;?php if (!$someCondition){ die(); } else{ #Do something } ?&gt; &lt;/body&gt; &lt;html&gt; </code></pre> <p>I hope the purpose of this code is straightforward. If...
[ { "answer_id": 307325, "author": "stalepretzel", "author_id": 1615, "author_profile": "https://Stackoverflow.com/users/1615", "pm_score": 0, "selected": false, "text": "die() die(\"</body></html>\")" }, { "answer_id": 307336, "author": "J Cooper", "author_id": 38803, ...
2008/11/20
[ "https://Stackoverflow.com/questions/307322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1615/" ]
307,338
<p>how to create a good plugin engine for standalone executables created with pyInstaller, py2exe or similar tools? </p> <p>I do not have experience with py2exe, but pyInstaller uses an import hook to import packages from it's compressed repository. Of course I am able to import dynamically another compressed reposito...
[ { "answer_id": 307517, "author": "monkut", "author_id": 24718, "author_profile": "https://Stackoverflow.com/users/24718", "pm_score": 3, "selected": true, "text": "from distutils.core import setup\nimport py2exe\n\nsetup (name = \"script2compile\",\n console=['script2compile.pyw'],...
2008/11/20
[ "https://Stackoverflow.com/questions/307338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1369629/" ]
307,343
<p>Is it possible to forward declare an standard container in a header file? For example, take the following code:</p> <pre><code>#include &lt;vector&gt; class Foo { private: std::vector&lt;int&gt; container_; ... }; </code></pre> <p>I want to be able to do something like this:</p> <pre><code>namespace std...
[ { "answer_id": 307349, "author": "Evan Teran", "author_id": 13430, "author_profile": "https://Stackoverflow.com/users/13430", "pm_score": 4, "selected": false, "text": "container_ std::vector<int> *container_;\n" }, { "answer_id": 307408, "author": "Rob Kennedy", "author_...
2008/11/20
[ "https://Stackoverflow.com/questions/307343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9236/" ]
307,348
<p>I need to create a custom control to display bmp images with alpha channel. The background can be painted in different colors and the images have shadows so I need to truly "paint" the alpha channel.</p> <p>Does anybody know how to do it?</p> <p>I also want if possible to create a mask using the alpha channel info...
[ { "answer_id": 333542, "author": "mackenir", "author_id": 25457, "author_profile": "https://Stackoverflow.com/users/25457", "pm_score": 1, "selected": false, "text": "R = multiplicationLookup[alpha][R];\nG = multiplicationLookup[alpha][G];\nB = multiplicationLookup[alpha][B];\n" }, {...
2008/11/20
[ "https://Stackoverflow.com/questions/307348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14053/" ]
307,352
<p>I just ran across the following error (and found the solution online, but it's not present in Stack Overflow):</p> <blockquote> <p>(.gnu.linkonce.[stuff]): undefined reference to [method] [object file]:(.gnu.linkonce.[stuff]): undefined reference to `typeinfo for [classname]'</p> </blockquote> <p>Why mig...
[ { "answer_id": 307381, "author": "cdleary", "author_id": 3594, "author_profile": "https://Stackoverflow.com/users/3594", "pm_score": 6, "selected": false, "text": "virtual void foo();\n virtual void foo() {}\n virtual void foo() = 0;\n" }, { "answer_id": 307427, "author": "pa...
2008/11/21
[ "https://Stackoverflow.com/questions/307352", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3594/" ]
307,362
<p>I'm trying to get this:</p> <pre><code>//C.h #ifndef C_H #define C_H #include "c.h" class C { public: C(); int function(int, int); }; #endif </code></pre> <p>which is defined in this:</p> <pre><code>//c.cpp #include "c.h" C::C() { } int C::function(int a, int b) { return a * b; } </code><...
[ { "answer_id": 307378, "author": "paxdiablo", "author_id": 14860, "author_profile": "https://Stackoverflow.com/users/14860", "pm_score": 2, "selected": false, "text": "bcc32 -ecrp.exe crp.cpp c.cpp\n" }, { "answer_id": 307383, "author": "Community", "author_id": -1, "...
2008/11/21
[ "https://Stackoverflow.com/questions/307362", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
307,364
<p>I have a gallery I quickly coded up for a small site, and under Firefox 3 and Safari 3 works fine. But when I test on my old best friend IE7, it seems to not fire the imageVar.onload = function() { // code here }.. which I want to use to stop the load effect and load the image. </p> <p>Please bear in mind...</p> ...
[ { "answer_id": 307392, "author": "Eran Galperin", "author_id": 10585, "author_profile": "https://Stackoverflow.com/users/10585", "pm_score": 2, "selected": false, "text": " window.load = function(){ \n //actions to be performed on window load\n }\n\n imageViewer.image.onload = funct...
2008/11/21
[ "https://Stackoverflow.com/questions/307364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31671/" ]
307,365
<p>I'm trying to attach a PDF attachment to an email being sent with System.Net.Mail. The attachment-adding part looks like this:</p> <pre><code>using (MemoryStream pdfStream = new MemoryStream()) { pdfStream.Write(pdfData, 0, pdfData.Length); Attachment a = new Attachment(pdfStream, string.Format("...
[ { "answer_id": 307401, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 5, "selected": true, "text": "pdfStream.Seek(0,SeekOrigin.Begin)" }, { "answer_id": 74226856, "author": "Jacob C.", "author_id": 14210...
2008/11/21
[ "https://Stackoverflow.com/questions/307365", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24952/" ]
307,367
<p>I have a C project that is built using a makefile, Eclipse constantly warns about "Invalid project path: Duplicate path entries", but I cannot figure out what the hell it wants me to do. I would like to disable this warning and continue with my life.</p> <p>My application compiles and runs fine, with not a single ...
[ { "answer_id": 12089022, "author": "bouum", "author_id": 1619349, "author_profile": "https://Stackoverflow.com/users/1619349", "pm_score": 0, "selected": false, "text": ".metadata" }, { "answer_id": 27936817, "author": "jww", "author_id": 608639, "author_profile": "ht...
2008/11/21
[ "https://Stackoverflow.com/questions/307367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34879/" ]
307,370
<p>I'm have a ADO DataSet that I'm loading from its XML file via ReadXml. The data and the schema are in separate files.</p> <p>Right now, it takes close to 13 seconds to load this DataSet. I can cut this to 700 milliseconds if I don't read the DataSet's schema and just let ReadXml infer the schema, but then the res...
[ { "answer_id": 10856773, "author": "Jon", "author_id": 1431550, "author_profile": "https://Stackoverflow.com/users/1431550", "pm_score": 1, "selected": false, "text": "void create_files()\n {\n //create text file with data\n StreamWriter sr = new StreamWriter(\"plain_tex...
2008/11/21
[ "https://Stackoverflow.com/questions/307370", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19403/" ]
307,389
<p>Is there a firefox plugin or something similar I can use to validate that my html output has properly closed tags?</p>
[ { "answer_id": 307412, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": 1, "selected": false, "text": "alt" }, { "answer_id": 307461, "author": "Community", "author_id": -1, "author_profile": "https://Stackove...
2008/11/21
[ "https://Stackoverflow.com/questions/307389", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7883/" ]
307,391
<p>I am using an ASP.NET <code>ModalPopupExtender</code> on a page and would like to prevent the dialog from hiding when the user presses the ok button in certain conditions. But I can't seem to find a way.</p> <p>What I am looking for is something like this</p> <pre><code>ajax:ModalPopupExtender ... OnOkScript=&quot;...
[ { "answer_id": 307412, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": 1, "selected": false, "text": "alt" }, { "answer_id": 307461, "author": "Community", "author_id": -1, "author_profile": "https://Stackove...
2008/11/21
[ "https://Stackoverflow.com/questions/307391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/698/" ]
307,411
<p>I'm new to jQuery, and I'm totally struggling with using jQuery UI's <code>sortable</code>.</p> <p>I'm trying to put together a page to facilitate grouping and ordering of items.</p> <p>My page has a list of groups, and each group contains a list of items. I want to allow users to be able to do the following: </p...
[ { "answer_id": 310508, "author": "Adam Bellaire", "author_id": 21632, "author_profile": "https://Stackoverflow.com/users/21632", "pm_score": 6, "selected": true, "text": "connectWith ...sortable({connectWith:['.group'], ... }\n" }, { "answer_id": 311159, "author": "James", ...
2008/11/21
[ "https://Stackoverflow.com/questions/307411", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1245/" ]
307,423
<p>I have the following two files and would like the second to extend the first:</p> <ol> <li>wwwroot\site\application.cfc</li> <li>wwwroot\site\dir\application.cfc</li> </ol> <p>However, when I go to declare the component for the second file, I'm not sure what to put in the extends attribute. <strong>My problem is ...
[ { "answer_id": 307441, "author": "Peter Boughton", "author_id": 9360, "author_profile": "https://Stackoverflow.com/users/9360", "pm_score": 4, "selected": false, "text": "<cfcomponent>\n\n <cfset this.name = \"cf7app\" />\n <cfset this.sessionmanagement = true />\n\n</cfcomponent>\...
2008/11/21
[ "https://Stackoverflow.com/questions/307423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3420/" ]
307,433
<p>Working to get DateTimes for any time zone. I'm using DateTimeOffset, and a string, and an XmlElement attribute. When I do, I get the following error:</p> <blockquote> <p>[InvalidOperationException: 'dateTime' is an invalid value for the XmlElementAttribute.DataType property. dateTime cannot be converted t...
[ { "answer_id": 307453, "author": "user35559", "author_id": 35559, "author_profile": "https://Stackoverflow.com/users/35559", "pm_score": 0, "selected": false, "text": "creationTimeX DateTime DateTime DateTime.Now.ToUniveralTime()" }, { "answer_id": 310162, "author": "Asher", ...
2008/11/21
[ "https://Stackoverflow.com/questions/307433", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36627/" ]
307,437
<p>I have two directories in the same parent directory. Call the parent directory <strong>base</strong> and the children directories <strong>alpha</strong> and <strong>bravo</strong>. I want to replace <strong>alpha</strong> with <strong>bravo</strong>. The simplest method is:</p> <pre><code>rm -rf alpha mv bravo a...
[ { "answer_id": 307447, "author": "Chris Charabaruk", "author_id": 5697, "author_profile": "https://Stackoverflow.com/users/5697", "pm_score": 0, "selected": false, "text": "mv alpha delme\nmv bravo alpha\nrm -rf delme\n" }, { "answer_id": 307450, "author": "paxdiablo", "a...
2008/11/21
[ "https://Stackoverflow.com/questions/307437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20903/" ]
307,438
<p>In the footer of my page, I would like to add something like "last updated the xx/xx/200x" with this date being the last time a certain mySQL table has been updated.</p> <p>What is the best way to do that? Is there a function to retrieve the last updated date? Should I access to the database every time I need this...
[ { "answer_id": 307488, "author": "Alnitak", "author_id": 6782, "author_profile": "https://Stackoverflow.com/users/6782", "pm_score": 9, "selected": true, "text": "information_schema SELECT UPDATE_TIME\nFROM information_schema.tables\nWHERE TABLE_SCHEMA = 'dbname'\n AND TABLE_NAME = ...
2008/11/21
[ "https://Stackoverflow.com/questions/307438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39474/" ]
307,445
<p>I have a 2D image randomly and sparsely scattered with pixels.<br> given a point on the image, I need to find the distance to the closest pixel that is not in the background color (black).<br> What is the fastest way to do this? </p> <p>The only method I could come up with is building a kd-tree for the pixels. but...
[ { "answer_id": 320735, "author": "Alnitak", "author_id": 6782, "author_profile": "https://Stackoverflow.com/users/6782", "pm_score": 3, "selected": false, "text": "r^2 = dx^2 + dy^2\n (n + 1)^2 = n^2 + 2n + 1\n nx^2 = ox^2 + 2ox + 1\n = ox^2 + 2(nx - 1) + 1\n = ox^...
2008/11/21
[ "https://Stackoverflow.com/questions/307445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9611/" ]
307,463
<p>What's the general consensus?</p> <p>If you need to change the database after a given action, do you use an observer pattern and let the framework / application handle the update for you? Or do you bypass the application and delegate the update to a database trigger?</p> <p>Obviously the trigger is faster, but is...
[ { "answer_id": 307487, "author": "Andre Gallo", "author_id": 14401, "author_profile": "https://Stackoverflow.com/users/14401", "pm_score": 2, "selected": false, "text": " /// <summary>\n /// Sends changes that were made to retrieved objects to the underlying database, \n /// and...
2008/11/21
[ "https://Stackoverflow.com/questions/307463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38354/" ]
307,486
<p>I want to create a unique id but <code>uniqid()</code> is giving something like <code>'492607b0ee414'</code>. What i would like is something similar to what tinyurl gives: <code>'64k8ra'</code>. The shorter, the better. The only requirements are that it should not have an obvious order and that it should look pretti...
[ { "answer_id": 307617, "author": "RJHunter", "author_id": 39223, "author_profile": "https://Stackoverflow.com/users/39223", "pm_score": 2, "selected": false, "text": "uniqid() function strip_digits_from_string($string) {\n return preg_replace('/[0-9]/', '', $string);\n}\n function rep...
2008/11/21
[ "https://Stackoverflow.com/questions/307486", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6037/" ]
307,494
<p>I would like to do something like the following:</p> <pre><code>def add(a, b): #some code def subtract(a, b): #some code operations = [add, subtract] operations[0]( 5,3) operations[1](5,3) </code></pre> <p>In python, is it possible to assign something like a function pointer?</p>
[ { "answer_id": 307622, "author": "Ned Batchelder", "author_id": 14343, "author_profile": "https://Stackoverflow.com/users/14343", "pm_score": 3, "selected": false, "text": "def the_simple_way(a, b):\n # blah blah\n\ndef the_complicated_way(a, b):\n # blah blah\n\ndef foo(way):\n ...
2008/11/21
[ "https://Stackoverflow.com/questions/307494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/64/" ]
307,495
<p>in Web 2.0 applications many users usually want to stay logged in ('remember me' flag) and on the other hand their cookie can give access to very private data. Is there a way to prevent that somebody who steals the cookie - directly from the computer or via sniffing - can use the cookie to get access to the user's d...
[ { "answer_id": 309276, "author": "mjmcinto", "author_id": 28660, "author_profile": "https://Stackoverflow.com/users/28660", "pm_score": 0, "selected": false, "text": "Page.Request.UserHostName\n" } ]
2008/11/21
[ "https://Stackoverflow.com/questions/307495", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
307,500
<p>I have a table structure that looks like:</p> <pre><code>&lt;table&gt; &lt;tr id="row1"&gt; &lt;td&gt; &lt;div&gt;row 1 content1&lt;/div&gt; &lt;/td&gt; &lt;td&gt; &lt;div&gt;row 1 content2&lt;/div&gt; &lt;/td&gt; &lt;td&gt; &lt;div&gt;row 1 content3&lt;/div&gt; &lt;/td&gt; &lt;/t...
[ { "answer_id": 307509, "author": "Shog9", "author_id": 811, "author_profile": "https://Stackoverflow.com/users/811", "pm_score": 6, "selected": true, "text": "$(\"selector\").each(function()\n{\n this.style.backgroundColor = \"red\";\n});\n" }, { "answer_id": 6269297, "auth...
2008/11/21
[ "https://Stackoverflow.com/questions/307500", "https://Stackoverflow.com", "https://Stackoverflow.com/users/419/" ]