qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
266,803
<p>I have several static factory patterns in my PHP library. However, memory footprint is getting out of hand and we want to reduce the number of files required during execution time. Here is an example of where we are today:</p> <pre><code>require_once('Car.php'); require_once('Truck.php'); abstract class Auto { ...
[ { "answer_id": 266820, "author": "Kent Fredric", "author_id": 15614, "author_profile": "https://Stackoverflow.com/users/15614", "pm_score": 4, "selected": true, "text": "require(\"autoloader.php\"); \n$x = new Car(); \n$x = new Bike(); \n" }, { "answer_id": 266828, "author":...
2008/11/05
[ "https://Stackoverflow.com/questions/266803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20176/" ]
266,805
<p>I'm trying to get rid of some spurious warnings in my SSIS Progress log. I'm getting a bunch of warnings about unused columns in tasks that use raw SQL to do their work. I have a Data Flow responsible for archiving data in a staging table prior to loading new data. The Data Flow looks like this:</p> <pre><code>+---...
[ { "answer_id": 306393, "author": "AdamH", "author_id": 21081, "author_profile": "https://Stackoverflow.com/users/21081", "pm_score": 0, "selected": false, "text": "DataFlow Task Execute SQL Task DataFlow Task OLE DB Destination" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/266805", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34861/" ]
266,809
<p>I would like to make my Java/Swing application compatible with the Services-menu available on Mac OS X. For example, so that the user could select some text in JTextArea and have it converted into speech by <strong>Services -> Speech -> Start Speaking Text</strong>. Is there a simple way to achieve that? (The applic...
[ { "answer_id": 11675159, "author": "Dave", "author_id": 347237, "author_profile": "https://Stackoverflow.com/users/347237", "pm_score": 0, "selected": false, "text": "String stuffYouWantToSay = \"StackOverflow Rocks!\";\nProcess p = null;\ntry {\n ProcessBuilder pb = new ProcessBuilde...
2008/11/05
[ "https://Stackoverflow.com/questions/266809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12547/" ]
266,818
<p>I need to see if a string value matches with an object value, but why won't this work?</p> <pre><code>public int countPacks(String flavour) { int counter = 0; for(int index = 0; index &lt; packets.size(); index++) { if (packets.equals(flavour)) { counter ++; } ...
[ { "answer_id": 266827, "author": "micro", "author_id": 23275, "author_profile": "https://Stackoverflow.com/users/23275", "pm_score": 2, "selected": false, "text": "if (packets.get(index).equals(flavour)) {\n ...\n" }, { "answer_id": 266831, "author": "Jon Skeet", "autho...
2008/11/05
[ "https://Stackoverflow.com/questions/266818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
266,819
<p>Where is the best place to add a method to the integer class in Rails? I'd like to add a <code>to_meters</code> and <code>to_miles</code> methods.</p>
[ { "answer_id": 266840, "author": "Zak", "author_id": 2112692, "author_profile": "https://Stackoverflow.com/users/2112692", "pm_score": 2, "selected": false, "text": "Float feetToMiles(integer I) miles = Feet.feetToMiles(5280); miles = 1.0" }, { "answer_id": 266845, "author": ...
2008/11/05
[ "https://Stackoverflow.com/questions/266819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6705/" ]
266,825
<p>I'd like to format a duration in seconds using a pattern like H:MM:SS. The current utilities in java are designed to format a time but not a duration.</p>
[ { "answer_id": 266846, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 8, "selected": true, "text": "PeriodFormatter Duration toPeriod PeriodType Period java.time.Duration getSeconds() public static String formatDuration(D...
2008/11/05
[ "https://Stackoverflow.com/questions/266825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
266,849
<p>I'm conducting experiments regarding e-mail spam. One of these experiments require sending mail thru Tor. Since I'm using Python and smtplib for my experiments, I'm looking for a way to use the Tor proxy (or other method) to perform that mail sending. Ideas how this can be done?</p>
[ { "answer_id": 266846, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 8, "selected": true, "text": "PeriodFormatter Duration toPeriod PeriodType Period java.time.Duration getSeconds() public static String formatDuration(D...
2008/11/05
[ "https://Stackoverflow.com/questions/266849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9941/" ]
266,854
<p>I frequently run into large, non-template classes in C++ where simple methods are defined directly in the class body in the header file instead of separately in the implementation file. For example:</p> <pre><code>class Foo { int getBar() const { return bar; } ... }; </code></pre> <p>Why do this? It seems like...
[ { "answer_id": 266868, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": 5, "selected": true, "text": "inline" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/266854", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1891/" ]
266,857
<p>I'm writing a Rails plugin that includes some partials. I'd like to test the partials, but I'm having a hard time setting up a test that will render them. There's no associated controller, so I'm just faking one:</p> <pre><code>require 'action_controller' require 'active_support' require 'action_pack' require 'ac...
[ { "answer_id": 267055, "author": "James A. Rosen", "author_id": 1190, "author_profile": "https://Stackoverflow.com/users/1190", "pm_score": 0, "selected": false, "text": "require 'action_controller'\nrequire 'active_support'\nrequire 'action_pack'\nrequire 'action_view'\nrequire 'action_...
2008/11/05
[ "https://Stackoverflow.com/questions/266857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1190/" ]
266,870
<p>I'm reading <em>The C++ Programming Language.</em> In it Stroustrup states that <code>sizeof(char) == 1</code> and <code>1 &lt;= sizeof(bool)</code>. The specifics depend on the implementation. Why would such a simple value as a boolean take the same space as a char?</p>
[ { "answer_id": 268329, "author": "sep", "author_id": 30333, "author_profile": "https://Stackoverflow.com/users/30333", "pm_score": 2, "selected": false, "text": " bool b[9];\n bool *pb0 = &b[0];\n bool *pb1 = &b[1];\n\n for (int counter=0; counter<9; ++counter)\n {\n ...
2008/11/05
[ "https://Stackoverflow.com/questions/266870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32944/" ]
266,874
<p>I'm setting the below variables in my vimrc to control how windows get split when I bring up the file explorer plugin for vim. But it appears these variables are not being read because they have no effect on how the file explorer window is displayed. I'm new to vim. I know the vimrc file is being read because I can ...
[ { "answer_id": 269952, "author": "Zathrus", "author_id": 16220, "author_profile": "https://Stackoverflow.com/users/16220", "pm_score": 2, "selected": true, "text": "let g:netrw_winsize=10\nlet g:netrw_alto=1\n" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/266874", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16973/" ]
266,877
<p>I have a very specific html table construct that seems to reveal a Gecko bug.</p> <p>Here's a distilled version of the problem. Observe the following table in a gecko-based browser (FF, for example): (you'll have to copy and paste this into a new file)</p> <pre><code>&lt;style&gt; table.example{ border-colla...
[ { "answer_id": 266906, "author": "Greg", "author_id": 24181, "author_profile": "https://Stackoverflow.com/users/24181", "pm_score": 4, "selected": true, "text": "style=\"border-color: ...;\" <td rowspan=\"3\">" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/266877", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34832/" ]
266,888
<p>I have a situation where I want to copy the output assembly from one project into the output directory of my target application using MSBuild, without hard-coding paths in my MSBuild Copy task. Here's the scenario:</p> <ul> <li>Project A - Web Application Project</li> <li>Project B - Dal Interface Project</li> <li>...
[ { "answer_id": 266956, "author": "Andrew Van Slaars", "author_id": 8087, "author_profile": "https://Stackoverflow.com/users/8087", "pm_score": 4, "selected": true, "text": "<Target Name=\"AfterBuild\">\n<Copy SourceFiles=\"$(SolutionDir)MyProject.Dal.Linq\\bin\\$(Configuration)\\MyProjec...
2008/11/05
[ "https://Stackoverflow.com/questions/266888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8087/" ]
266,901
<p>Just wondering if there is any way to do the following:</p> <pre><code>public Interface IDataField { object GetValue(); } public Interface IComplexDataField : IDataField { object GetDefaultValue(); } public class MyBase { private IDataField _DataField; public MyBase() { this._DataFie...
[ { "answer_id": 266911, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 2, "selected": false, "text": "MyBase public class MyBase<T> where T : IDataField\n{\n public virtual T CreateDataField()\n {\n ... etc .....
2008/11/05
[ "https://Stackoverflow.com/questions/266901", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30572/" ]
266,903
<p>How can I create an instance of the following annotation (with all fields set to their default value).</p> <pre><code> @Retention( RetentionPolicy.RUNTIME ) public @interface Settings { String a() default "AAA"; String b() default "BBB"; String c() default "CCC"; } </c...
[ { "answer_id": 266945, "author": "Florin", "author_id": 34565, "author_profile": "https://Stackoverflow.com/users/34565", "pm_score": 1, "selected": false, "text": "@Settings\npublic void myMethod() {\n}\n" }, { "answer_id": 613469, "author": "akuhn", "author_id": 24468, ...
2008/11/05
[ "https://Stackoverflow.com/questions/266903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24468/" ]
266,913
<p>I'm looking to stream lots of data (up to ~1 Gbit) from Java to a C++ application (both on the same machine). I'm currently using a FIFO on Linux but need a Windows solution too.</p> <p>The most cross-platform method seems to be a local socket, but: a) won't I get huge overhead from TCP checksumming and copying to ...
[ { "answer_id": 3557247, "author": "Vincent", "author_id": 137511, "author_profile": "https://Stackoverflow.com/users/137511", "pm_score": 1, "selected": false, "text": "const char[] rawData = {0,1,2,3,4,5,6,7,8,9}; //Or get some raw data from somewhere\nint dataSize = sizeof(rawData);\np...
2008/11/05
[ "https://Stackoverflow.com/questions/266913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
266,923
<p>In C# which is more memory efficient: Option #1 or Option #2?</p> <pre><code>public void TestStringBuilder() { //potentially a collection with several hundred items: string[] outputStrings = new string[] { "test1", "test2", "test3" }; //Option #1 StringBuilder formattedOutput = new StringBuilder();...
[ { "answer_id": 266936, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 3, "selected": false, "text": "Remove" }, { "answer_id": 266991, "author": "cfeduke", "author_id": 5645, "author_profile": "https:/...
2008/11/05
[ "https://Stackoverflow.com/questions/266923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9711/" ]
266,924
<p>I am trying to convert a date with individual parts such as 12, 1, 2007 into a datetime in SQL Server 2005. I have tried the following:</p> <pre><code>CAST(DATEPART(year, DATE)+'-'+ DATEPART(month, DATE) +'-'+ DATEPART(day, DATE) AS DATETIME) </code></pre> <p>but this results in the wrong date. What is the correct...
[ { "answer_id": 266940, "author": "Cade Roux", "author_id": 18255, "author_profile": "https://Stackoverflow.com/users/18255", "pm_score": 8, "selected": true, "text": "y, m, d int CAST(CAST(y AS varchar) + '-' + CAST(m AS varchar) + '-' + CAST(d AS varchar) AS DATETIME)\n" }, { "a...
2008/11/05
[ "https://Stackoverflow.com/questions/266924", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23133/" ]
266,927
<p>I receive an error message when exposing an ADO.NET Data Service using an Entity Framework data model that contains an entity (called "Case") with an internal setter on a property. If I modify the setter to be public (using the entity designer), the data services works fine.</p> <p>I don’t need the entity "Case" ex...
[ { "answer_id": 421500, "author": "ggponti", "author_id": 6840, "author_profile": "https://Stackoverflow.com/users/6840", "pm_score": 0, "selected": false, "text": "public class WebDataService : DataService< DataModel.DataEntities >\n" }, { "answer_id": 3090364, "author": "Jak...
2008/11/05
[ "https://Stackoverflow.com/questions/266927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33496/" ]
266,931
<p>It seems that nginx is used with php, ruby and python. </p> <p>Anyone has an example of how to setup nginx to work with jetty/tomcat in backend? </p> <p>Thanks.</p>
[ { "answer_id": 267072, "author": "Javier", "author_id": 11649, "author_profile": "https://Stackoverflow.com/users/11649", "pm_score": 4, "selected": true, "text": "server {\n location /anything {\n proxy_pass http://localhost:8080/whatever;\n }\n}\n" }, { "answer_id"...
2008/11/05
[ "https://Stackoverflow.com/questions/266931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34565/" ]
266,988
<p>I'm working on a Facebook FBML controls library and would like to create my FBML controls somewhat patterned like the ASP.NET WebControls library. I have a base class that handles rendering by default; here's my render method:</p> <pre><code> protected override void Render(HtmlTextWriter writer) { ...
[ { "answer_id": 270417, "author": "Jason Hernandez", "author_id": 34863, "author_profile": "https://Stackoverflow.com/users/34863", "pm_score": 4, "selected": true, "text": "<fb:name uid=\"00101010101\"/> public class FbName:System.Web.UI.WebControls.WebControl\n{\n\n protected overri...
2008/11/05
[ "https://Stackoverflow.com/questions/266988", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34224/" ]
266,989
<p>Subject says it all but he background:</p> <p>I want to trigger some TortoiseSVN action from a batch file? I suspect that I can do this by calling the right exe with the right args but I'd rather find a way to solve the more general problem of doing an arbitrary action.</p> <p><strong>Edit:</strong> The reason tha...
[ { "answer_id": 267019, "author": "Niniki", "author_id": 4155, "author_profile": "https://Stackoverflow.com/users/4155", "pm_score": 1, "selected": false, "text": "svn update\n svn help\n svn help <command>\n" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/266989", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1343/" ]
266,997
<p>I'm trying to extract all matches from a EBML definition, which is something like this:</p> <pre><code>| + A track | + Track number: 3 | + Track UID: 724222477 | + Track type: subtitles ... | + Language: eng ... | + A track | + Track number: 4 | + Track UID: 745646561 | + Track type: subtitles ... | + Langu...
[ { "answer_id": 267007, "author": "Markus Jarderot", "author_id": 22364, "author_profile": "https://Stackoverflow.com/users/22364", "pm_score": 2, "selected": false, "text": ".* /Track type: subtitles.*?Language: (\\w\\w\\w)/m\n Language: ??? Track type: subtitles: subtitles Language /^\\...
2008/11/05
[ "https://Stackoverflow.com/questions/266997", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16957/" ]
267,001
<p>I'm trying to save the output of an vector image drawin in Java2D to an SWF file. There are great libraries for saving java2D output as things like SVG (BATIK) and PDF(itext) but I can't find one for SWF. Any ideas?</p>
[ { "answer_id": 267023, "author": "rmeador", "author_id": 10861, "author_profile": "https://Stackoverflow.com/users/10861", "pm_score": 1, "selected": false, "text": "<mx:Script><![CDATA[\n\n[Embed(source=\"../images/down.svg\")]\n[Bindable]\nprotected var drillDownImage:Class;\n\n]]></mx...
2008/11/05
[ "https://Stackoverflow.com/questions/267001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34888/" ]
267,006
<p>My new ASP.NET MVC Web Application works on my development workstation, but does not run on my web server...</p> <hr> <h1>Server Error in '/' Application.</h1> <hr> <h2>Configuration Error</h2> <p><strong>Description:</strong> An error occurred during the processing of a configuration file required to service t...
[ { "answer_id": 267021, "author": "Haacked", "author_id": 598, "author_profile": "https://Stackoverflow.com/users/598", "pm_score": 9, "selected": true, "text": "* Microsoft.Web.Infrastructure\n* System.Web.Razor\n* System.Web.WebPages.Deployment\n* System.Web.WebPages.Razor\n" }, { ...
2008/11/05
[ "https://Stackoverflow.com/questions/267006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83/" ]
267,011
<p>I'm trying to understand what this method means as I'm reading <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.getpostbackeventreference.aspx" rel="noreferrer">this</a> and have wondered what uses this may have. I don't quite understand the example given.</p> <p>Can anyone give an...
[ { "answer_id": 267246, "author": "stevemegson", "author_id": 25028, "author_profile": "https://Stackoverflow.com/users/25028", "pm_score": 4, "selected": true, "text": "href=\"javascript:__doPostBack('ctl00$LinkButton1','')\"\n" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/267011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5853/" ]
267,025
<p>I need to read an Excel 2007 XLSX file in a Java application. Does anyone know of a good API to accomplish this task?</p>
[ { "answer_id": 14396304, "author": "Koss", "author_id": 1691125, "author_profile": "https://Stackoverflow.com/users/1691125", "pm_score": 3, "selected": false, "text": " public Workbook getTemplateData(String xlsxFile) {\n Workbook workbook = new Workbook();\n parseSharedStrings...
2008/11/05
[ "https://Stackoverflow.com/questions/267025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32435/" ]
267,026
<p>This very simple code gives me tons of errors:</p> <pre><code>#include &lt;iostream&gt; #include &lt;string&gt; int main() { std::string test = " "; std::cout &lt;&lt; test; } </code></pre> <p>I tried to compile it on linux by typing <strong>gcc -o simpletest simpletest.cpp</strong> on the console. I can'...
[ { "answer_id": 267031, "author": "rmeador", "author_id": 10861, "author_profile": "https://Stackoverflow.com/users/10861", "pm_score": 0, "selected": false, "text": "main() int return 0;" }, { "answer_id": 267034, "author": "Robert Gamble", "author_id": 25222, "author...
2008/11/05
[ "https://Stackoverflow.com/questions/267026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27090/" ]
267,030
<p>I'm needing to script my build. I'm using MSBUILD because of it's integration with VS.net. I am trying to copy some files from the build environment to the deployment folder. I'm using the copy task of MSBuild. But instead of copying the directory tree as I would expect. it copies all the contents into a single fol...
[ { "answer_id": 267088, "author": "minty", "author_id": 4491, "author_profile": "https://Stackoverflow.com/users/4491", "pm_score": 2, "selected": false, "text": "<Target Name=\"migrate\" DependsOnTargets=\"Clean\">\n <Copy DestinationFiles=\"@(SourceDir->'$(DeployPath)\\%(RecursiveDir...
2008/11/05
[ "https://Stackoverflow.com/questions/267030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4491/" ]
267,033
<p>Say I have a list of all <code>Projects</code>, and that I group them by <code>Category</code> like this:</p> <pre><code>var projectsByCat = from p in Projects group p by p.Category into g orderby g.Count() descending select new { Category = g.Key, Projects...
[ { "answer_id": 267053, "author": "Mark Cidade", "author_id": 1659, "author_profile": "https://Stackoverflow.com/users/1659", "pm_score": 7, "selected": true, "text": "var oddCategories = projectsByCat.ToList().Where((c,i) => i % 2 != 0);\nvar evenCategories = projectsByCat.ToList().Wher...
2008/11/05
[ "https://Stackoverflow.com/questions/267033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2122/" ]
267,045
<p>I started out with a generic interface called ILogin. The interfaces requires that you implement two properties: UserID and Password. I have many login-type classes that implement this interface. As my project grew and grew, I found that many classes repeated the UserID and Password code. Now I decide that I nee...
[ { "answer_id": 267118, "author": "coobird", "author_id": 17172, "author_profile": "https://Stackoverflow.com/users/17172", "pm_score": 5, "selected": true, "text": "Animal Cat Dog Mosquito Eagle Eat() Breathe() Sleep() Animal Fly() Mosquito Eagle IFly IFly Fly() Mosquito Eagle Animal IFl...
2008/11/05
[ "https://Stackoverflow.com/questions/267045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/132931/" ]
267,057
<p>I hope someone can help me with this, I'm mostly a C# developer so my C and C++ skills are bad. I have a native C dll that is a plugin of a larger application. I cross compile this dll for windows on linux using gcc.</p> <p>In the native dll when I create a D3DSurface I want to call a function in a Mixed Mode C++...
[ { "answer_id": 268822, "author": "Sunlight", "author_id": 33650, "author_profile": "https://Stackoverflow.com/users/33650", "pm_score": 0, "selected": false, "text": "void * IDirect3DSurface void * IntPtr" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/267057", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
267,064
<p>Why is the dropdown not showing my blank item first? Here is what I have</p> <pre><code>drpList.Items.Add(New ListItem("", "")) With drpList .DataSource = myController.GetList(userid) .DataTextField = "Name" .DataValueField = "ID" .DataBind() End With </code></pre> <p>Edit ~ I am binding to a Gene...
[ { "answer_id": 267080, "author": "Dillie-O", "author_id": 71, "author_profile": "https://Stackoverflow.com/users/71", "pm_score": 3, "selected": false, "text": "Dim liFirst As New ListItem(\"\", \"\")\ndrpList.Items.Insert(0, liFirst)\n" }, { "answer_id": 267082, "author": "J...
2008/11/05
[ "https://Stackoverflow.com/questions/267064", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23667/" ]
267,071
<p>I'm using the JSP <a href="http://displaytag.sourceforge.net/11/" rel="nofollow noreferrer">displaytag</a> tag lib to create HTML tables. I'd like the user to able to click on a column header in order to sort the data. My JSP code is shown below:</p> <pre><code>&lt;display:table name="tableData" id="stat" sort="pag...
[ { "answer_id": 267365, "author": "MetroidFan2002", "author_id": 8026, "author_profile": "https://Stackoverflow.com/users/8026", "pm_score": 3, "selected": false, "text": "<display:table requestURI=\"yourUrlMappedController.yourExtension\" ...>\n" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/267071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2648/" ]
267,076
<p>Could someone please tell me which objects types can be tested using Regular Expressions in C#?</p>
[ { "answer_id": 267084, "author": "Manu", "author_id": 2133, "author_profile": "https://Stackoverflow.com/users/2133", "pm_score": 4, "selected": true, "text": "if(obj is string){...}\n" }, { "answer_id": 267105, "author": "ripper234", "author_id": 11236, "author_profi...
2008/11/05
[ "https://Stackoverflow.com/questions/267076", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26327/" ]
267,085
<p>I'm trying to convert the below SQL query to HQL and am having a few issues. A straight line by line conversion doesn't work, I am wondering if I should be using an Inner Join in the HQL?</p> <pre><code> SELECT (UNIX_TIMESTAMP(cosc1.change_date) - UNIX_TIMESTAMP(cosc2.change_date)) FROM customer_ord...
[ { "answer_id": 267166, "author": "Nick", "author_id": 34558, "author_profile": "https://Stackoverflow.com/users/34558", "pm_score": 4, "selected": true, "text": "from Foo f inner join f.bar as b session.createSQLQuery(...)" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/267085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18340/" ]
267,091
<p>At the risk of being downmodded, I want to ask what the best mechanism (best is obviously subjective for the practice violation inherent here) for viewing data from a table, using C#, with a <em>lot</em> of columns. By a lot, I mean something like 1000.</p> <p>Now before you get all click happy, or throw out respo...
[ { "answer_id": 267107, "author": "Steven A. Lowe", "author_id": 9345, "author_profile": "https://Stackoverflow.com/users/9345", "pm_score": 2, "selected": false, "text": "td { font-size: 0.2em; text-align: right; }\n" }, { "answer_id": 267112, "author": "Whisk", "author_i...
2008/11/05
[ "https://Stackoverflow.com/questions/267091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13154/" ]
267,101
<p>once you have a commit that contains a submodule object, you pretty much cannot get git-svn to commit past it.</p> <p>Any ideas, workarounds, anything that is not "don't use submodules with git-svn"?</p> <p>So far the answer seems to be a big NO.</p> <p>Is there any way to at least allow existing git commits cont...
[ { "answer_id": 286185, "author": "Aupajo", "author_id": 10407, "author_profile": "https://Stackoverflow.com/users/10407", "pm_score": 1, "selected": false, "text": "svn:externals svn propset svn:externals [...]\n" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/267101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13989/" ]
267,113
<p>I’m trying to implement a dictionary for use with WCF. My requirements are:</p> <ul> <li>actual (private variable or base class) type equivalent to Dictionary </li> <li>Comparer = <code>System.StringComparer.InvariantCultureIgnoreCase</code></li> <li>Custom (override/new) Add(key, value) method (to include valida...
[ { "answer_id": 267691, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 1, "selected": false, "text": "Add Add object [DataContract] [DataMember] DataContractSerializer DataContractSerializer Add 1\nMyDictionary\nabc=123...
2008/11/05
[ "https://Stackoverflow.com/questions/267113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28736/" ]
267,114
<p>I always try to avoid to return string literals, because I fear they aren't defined outside of the function. But I'm not sure if this is the case. Let's take, for example, this function:</p> <pre><code> const char * return_a_string(void) { return "blah"; } </code></pre> <p>Is this correct code? It does work fo...
[ { "answer_id": 267134, "author": "Brian R. Bondy", "author_id": 3153, "author_profile": "https://Stackoverflow.com/users/3153", "pm_score": 7, "selected": true, "text": "char * sz = \"this is a test\";\nsz[0] = 'T'; //<--- undefined results\n" }, { "answer_id": 267136, "autho...
2008/11/05
[ "https://Stackoverflow.com/questions/267114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18687/" ]
267,124
<p>I'm working on an ASP.Net application and working to add some Ajax to it to speed up certain areas. The first area that I am concentrating is the attendance area for the teachers to report attendance (and some other data) about the kids. This needs to be fast.</p> <p>I've created a dual-control set up where the use...
[ { "answer_id": 267181, "author": "Jared", "author_id": 3442, "author_profile": "https://Stackoverflow.com/users/3442", "pm_score": 0, "selected": false, "text": "<script type=\"text/javascript\" src=\"<%=Response.ApplyAppPathModifier(\"~/js/jquery-1.2.6.js\") %>\"></script>\n<script type...
2008/11/05
[ "https://Stackoverflow.com/questions/267124", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3442/" ]
267,138
<p>I have a site where I use CustomErrors in the web.config to specify a custom error page, and that's working just fine. The custom 404 page is also specified in the IIS configuration (because if it's not, I don't get my custom 404 page).</p> <p>But I have some logic that kicks in if a user gets a 404 that looks at ...
[ { "answer_id": 267183, "author": "stevemegson", "author_id": 25028, "author_profile": "https://Stackoverflow.com/users/25028", "pm_score": 4, "selected": false, "text": "http://example.com/FileNotFound.aspx?404;http://example.com/badpage.aspx" }, { "answer_id": 267252, "autho...
2008/11/05
[ "https://Stackoverflow.com/questions/267138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/856/" ]
267,151
<p>I have seen 3d surface plots of data before but i do not know what software i could use to make it.</p> <p>I have 3 series of data (X, Y, Z) basically i want each of the rows on the table to be a point in 3d space, all joined as a mesh. The data is currently csv, but i can change the format, as it is data i genera...
[ { "answer_id": 267175, "author": "nlucaroni", "author_id": 157, "author_profile": "https://Stackoverflow.com/users/157", "pm_score": 0, "selected": false, "text": "function plot_from_file(datafile)\n//\n// Make a simple x-y-z plot based on values read from a datafile.\n// We assume that ...
2008/11/05
[ "https://Stackoverflow.com/questions/267151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29924/" ]
267,160
<p>I recently added JQuery's date-picker control to a project. In Internet Exploder, I get the following error message:</p> <blockquote> <p>Internet Explorer cannot open the Internet site</p> <p><a href="http://localhost/" rel="nofollow noreferrer">http://localhost/</a></p> <p>Operation aborted</p> </blo...
[ { "answer_id": 267331, "author": "Andrew Hedges", "author_id": 11577, "author_profile": "https://Stackoverflow.com/users/11577", "pm_score": 0, "selected": false, "text": "defer" }, { "answer_id": 865331, "author": "Travis", "author_id": 307338, "author_profile": "htt...
2008/11/05
[ "https://Stackoverflow.com/questions/267160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10420/" ]
267,163
<p>I've had significant success with NSURL, NSURL[Mutable]Request, NSURLConnection with my iPhone applications. When trying to compile a stand alone Cocoa application, 10 line program to make a simple HTTP request, there are zero compiler errors or warnings. The program compiles fine, yet the HTTP Request is never made...
[ { "answer_id": 267265, "author": "Mike Abdullah", "author_id": 28768, "author_profile": "https://Stackoverflow.com/users/28768", "pm_score": 2, "selected": false, "text": "NSURLConnection NSRunLoop NSURLConnection [NSURLConnection sendSynchronousRequest:returningResponse:error:]" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/267163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
267,168
<p>In Visual Studio, I can select the "Treat warnings as errors" option to prevent my code from compiling if there are any warnings. Our team uses this option, but there are two warnings we would like to keep as warnings. </p> <p>There is an option to suppress warnings, but we DO want them to show up as warnings, so t...
[ { "answer_id": 468166, "author": "SvenL", "author_id": 57790, "author_profile": "https://Stackoverflow.com/users/57790", "pm_score": 7, "selected": false, "text": "WarningsNotAsErrors <PropertyGroup>\n ...\n ...\n <WarningsNotAsErrors>618,1030,1701,1702</WarningsNotAsErrors>\n</...
2008/11/05
[ "https://Stackoverflow.com/questions/267168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24315/" ]
267,179
<p>I'm trying to create a template class to insulate the users from a data type. I would have preferred to use an adapter class, but the function signatures needed to change requiring a template.</p> <p>In the code sample below(not the actual project just a simplified version to illustrate the problem), while in the ...
[ { "answer_id": 267254, "author": "Greg Rogers", "author_id": 5963, "author_profile": "https://Stackoverflow.com/users/5963", "pm_score": 0, "selected": false, "text": "StructWrapper StructWrapper" }, { "answer_id": 269258, "author": "Sunlight", "author_id": 33650, "au...
2008/11/05
[ "https://Stackoverflow.com/questions/267179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
267,186
<p>In C++ when can a virtual function use static binding? If it is being accessed through a pointer, accessed directly, or never?</p>
[ { "answer_id": 267238, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": 3, "selected": false, "text": "class Base\n{\npublic:\n virtual ~Base() {}\n virtual void DoIt() { printf(\"In Base::DoIt()\\n\"); }\n};\n\nclass...
2008/11/05
[ "https://Stackoverflow.com/questions/267186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
267,191
<p>Bascially I want to know the best way to hide/show an ASP.NET control from a Javascript function. I figured I would just access the control in Javascript using:</p> <pre><code>var theControl = document.getElementById("txtEditBox"); </code></pre> <p>Then just set the control's Visible property to true/false. It d...
[ { "answer_id": 267197, "author": "Jason Bunting", "author_id": 1790, "author_profile": "https://Stackoverflow.com/users/1790", "pm_score": 6, "selected": true, "text": "var theControl = document.getElementById(\"txtEditBox\");\ntheControl.style.display = \"none\";\n\n// to show it again:...
2008/11/05
[ "https://Stackoverflow.com/questions/267191", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12172/" ]
267,193
<p>I have a computer at home which I can't access from work. I'd like to be able to view results from work that my home computer produces. The best idea I've come up with is an automated script running on my home computer that emails myself the results (from a text file or stderr/out) when complete. </p> <p>I'm dec...
[ { "answer_id": 267289, "author": "paavo256", "author_id": 34911, "author_profile": "https://Stackoverflow.com/users/34911", "pm_score": 2, "selected": false, "text": "mail -s \"My subject here\" recipient@wherever.com <message_body.txt\n" }, { "answer_id": 267301, "author": "...
2008/11/05
[ "https://Stackoverflow.com/questions/267193", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
267,198
<p>We need to handle this event in the base form, regardless of which controls currently have focus. We have a couple of global key commands that need to work regardless of control focus.</p> <p>This works by handling the PreviewKeyDown event in the form normally. When we add a user control to the form, the event no ...
[ { "answer_id": 267385, "author": "BFree", "author_id": 15861, "author_profile": "https://Stackoverflow.com/users/15861", "pm_score": 1, "selected": false, "text": " foreach (Control control in this.Controls)\n {\n control.PreviewKeyDown += new Preview...
2008/11/05
[ "https://Stackoverflow.com/questions/267198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1811110/" ]
267,200
<p>I have a Visual Studio Solution. Currently, it is an empty solution (=no projects) and I have added a few solution folders.</p> <p>Solution Folders only seem to be "virtual folders", because they are not really created in the Filesystem and files inside solution folders are just sitting in the same folder as the .s...
[ { "answer_id": 55675993, "author": "rsenna", "author_id": 158074, "author_profile": "https://Stackoverflow.com/users/158074", "pm_score": 4, "selected": false, "text": "MSBUILD <None Include=\"**/*\" /> <?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- DockerDev/DockerDev.shproj -->\n<Pro...
2008/11/05
[ "https://Stackoverflow.com/questions/267200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/91/" ]
267,219
<p>I want to display the current host and database names in a view.</p> <p>Where can I get these names?</p> <p>Are there some predefined environment or global variables? </p>
[ { "answer_id": 267251, "author": "Robert Gamble", "author_id": 25222, "author_profile": "https://Stackoverflow.com/users/25222", "pm_score": 5, "selected": true, "text": "config = Rails::Configuration.new\nhost = config.database_configuration[RAILS_ENV][\"host\"]\ndatabase = config...
2008/11/06
[ "https://Stackoverflow.com/questions/267219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14755/" ]
267,221
<p>I've got a Perforce server set up, and installed the P4V client. I've created a new depot and a new workspace. Per the documentation, I've mapped the workspace to the depot. So far so good.</p> <p>I now have a .SQL script that was created by an external application that I wish to check in for the first time. I ...
[ { "answer_id": 268163, "author": "Toby Allen", "author_id": 6244, "author_profile": "https://Stackoverflow.com/users/6244", "pm_score": 1, "selected": false, "text": "Workspace root: C:\\Documents and Settings\\wtansill\\Perforce\\wtansill_localhost_1666\n\nFile dir under root: C:\\Docum...
2008/11/06
[ "https://Stackoverflow.com/questions/267221", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34903/" ]
267,222
<p>I would like to write an application that will copy MP3 files to a SanDisk Sansa M240. The SanDisk doesn't have a drive letter and uses MTP for file transfer. I stumbled through the sample of connecting to the device at : <a href="http://blogs.msdn.com/dimeby8/archive/2006/09/27/774259.aspx" rel="nofollow noreferr...
[ { "answer_id": 39818354, "author": "Xavier Peña", "author_id": 831138, "author_profile": "https://Stackoverflow.com/users/831138", "pm_score": 2, "selected": false, "text": "obj\\Debug bin\\Debug FriendlyName private IDictionary<string, string> GetDeviceIds()\n {\n var devi...
2008/11/06
[ "https://Stackoverflow.com/questions/267222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12747/" ]
267,236
<p>It seems if I do something like</p> <pre><code>$file = fopen($filepath, "w"); $CR = curl_init(); curl_setopt($CR, CURLOPT_URL, $source_path); curl_setopt($CR, CURLOPT_POST, 1); curl_setopt($CR, CURLOPT_FAILONERROR, true); curl_setopt($CR, CURLOPT_RETURNTRANSFER, 1); curl_setopt($CR, CURLOPT_SSL_VERIFYPEER, 0); curl...
[ { "answer_id": 279844, "author": "too much php", "author_id": 28835, "author_profile": "https://Stackoverflow.com/users/28835", "pm_score": 3, "selected": true, "text": "$file = '/tmp/test12345';\nfile_put_contents($file, 'hello');\necho filesize($file), \"\\n\";\nfile_put_contents($file...
2008/11/06
[ "https://Stackoverflow.com/questions/267236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10393/" ]
267,237
<p>What's the best way to unit test protected and private methods in Ruby, using the standard Ruby <code>Test::Unit</code> framework?</p> <p>I'm sure somebody will pipe up and dogmatically assert that "you should only unit test public methods; if it needs unit testing, it shouldn't be a protected or private method", b...
[ { "answer_id": 267401, "author": "James Baker", "author_id": 9365, "author_profile": "https://Stackoverflow.com/users/9365", "pm_score": 7, "selected": false, "text": "myobject.send(:method_name, args)\n send send! send!" }, { "answer_id": 267408, "author": "rampion", "au...
2008/11/06
[ "https://Stackoverflow.com/questions/267237", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13157/" ]
267,239
<p>In C# how do you make the columns in a DataGrid AutoFit Column Width like you can in Excel? Currently my five columns are fixed width but the column headers can change so I would like the columns to autofit to the width of the column.</p> <p>Thanks</p>
[ { "answer_id": 19436840, "author": "JVD2C", "author_id": 1678769, "author_profile": "https://Stackoverflow.com/users/1678769", "pm_score": 1, "selected": false, "text": " public static DataGrid AddDataGrid(DataGrid DG, object Me, System.Data.DataTable DS)\n {\n\n\n try {\n ...
2008/11/06
[ "https://Stackoverflow.com/questions/267239", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
267,248
<p>I have some code that looks like:</p> <pre><code>template&lt;unsigned int A, unsigned int B&gt; int foo() { int v = 1; const int x = A - B; if (x &gt; 0) { v = v &lt;&lt; x; } bar(v); } </code></pre> <p>gcc will complain about x being negative for certain instantiations of A, B; however, I do perfor...
[ { "answer_id": 267255, "author": "Claudiu", "author_id": 15055, "author_profile": "https://Stackoverflow.com/users/15055", "pm_score": 0, "selected": false, "text": "const short unsigned int x = A - B;\n" }, { "answer_id": 267257, "author": "Evan Teran", "author_id": 1343...
2008/11/06
[ "https://Stackoverflow.com/questions/267248", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
267,250
<p>I am using <code>getch()</code> and my app crashes instantly. Including when doing:</p> <pre><code>int main() { getch(); } </code></pre> <p>I can't find the link but supposedly the problem is that it needs to turn off buffering or something strange along those lines, and I still want <code>cout</code> to work ...
[ { "answer_id": 267281, "author": "dmckee --- ex-moderator kitten", "author_id": 2509, "author_profile": "https://Stackoverflow.com/users/2509", "pm_score": 2, "selected": false, "text": "#include <stdio.h>\n #include <curses.h>\n getch()" }, { "answer_id": 267371, "author": "...
2008/11/06
[ "https://Stackoverflow.com/questions/267250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
267,256
<p>After considering the answers to my previous question (<a href="https://stackoverflow.com/questions/252459/one-svn-repository-or-many">One SVN Repository or many?</a>), I've decided to take the 4 or so repositories I have and consolidate them into one. This of course leads to the question, <strong>what's the best wa...
[ { "answer_id": 267307, "author": "Ken Gentle", "author_id": 8709, "author_profile": "https://Stackoverflow.com/users/8709", "pm_score": 7, "selected": true, "text": "svnadmin dump > project<n>.dmp\n svn mkdir \"<repo url>/project<n>\"\nsvnadmin load --parent-dir \"project<n>\" <filesyste...
2008/11/06
[ "https://Stackoverflow.com/questions/267256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9021/" ]
267,259
<p>So, I've been doing Java for a number of years now, but now I'm starting a C++ project. I'm trying to determine best practices for setting up said project.</p> <p>Within the project, how do you generally structure their code? Do you do it Java style with namespace folders and break up your source that way? Do you k...
[ { "answer_id": 267307, "author": "Ken Gentle", "author_id": 8709, "author_profile": "https://Stackoverflow.com/users/8709", "pm_score": 7, "selected": true, "text": "svnadmin dump > project<n>.dmp\n svn mkdir \"<repo url>/project<n>\"\nsvnadmin load --parent-dir \"project<n>\" <filesyste...
2008/11/06
[ "https://Stackoverflow.com/questions/267259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9450/" ]
267,275
<p>Despite an earlier question (<a href="https://stackoverflow.com/questions/223894/opengl-rotation-using-gldrawpixels">asked here</a>), our project is constrained to using glDrawPixels, so we have to do some hackery.</p> <p>One of the feature requirements is to be able to have a magnified view show up on a clicked re...
[ { "answer_id": 273878, "author": "thing2k", "author_id": 3180, "author_profile": "https://Stackoverflow.com/users/3180", "pm_score": 0, "selected": false, "text": "// main.cpp\n// glut Text\n\n#ifdef __WIN32__\n #define WIN32_LEAN_AND_MEAN\n #include <windows.h>\n#endif\n#include <...
2008/11/06
[ "https://Stackoverflow.com/questions/267275", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21981/" ]
267,287
<p>Attempting to print out a list of values from 2 different variables that are aligned correctly.</p> <pre><code>foreach finalList ($correctList $wrongList) printf "%20s%s\n" $finalList end </code></pre> <p>This prints them out an they are aligned, but it's one after another. How would I have it go through each ite...
[ { "answer_id": 267340, "author": "Robert Gamble", "author_id": 25222, "author_profile": "https://Stackoverflow.com/users/25222", "pm_score": 4, "selected": true, "text": "# Get the max index of the smallest list\nset maxIndex = $#correctList\nif ( $#wrongList < $#correctList ) then\n se...
2008/11/06
[ "https://Stackoverflow.com/questions/267287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28392/" ]
267,303
<p>I'm am building my asp.net web application using MVC (Preview 5), and am also using the Master pages concept. </p> <p>My PageA and PageB are both content pages. I'm doing a form submit in a method via JavaScript from PageA to PageB. PageB has its PreviousPageType attribute set to PageA, but when I access the Pre...
[ { "answer_id": 267340, "author": "Robert Gamble", "author_id": 25222, "author_profile": "https://Stackoverflow.com/users/25222", "pm_score": 4, "selected": true, "text": "# Get the max index of the smallest list\nset maxIndex = $#correctList\nif ( $#wrongList < $#correctList ) then\n se...
2008/11/06
[ "https://Stackoverflow.com/questions/267303", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31622/" ]
267,312
<p>What is the difference between a Hash Map and dictionary ADT. And when to prefer one over another. For my programming assignment my instructor has asked to use one of them but I don't see any difference in between both. The program is supposed to work with a huge no. of strings. Any suggestions?</p>
[ { "answer_id": 297123, "author": "Phil", "author_id": 38343, "author_profile": "https://Stackoverflow.com/users/38343", "pm_score": 7, "selected": true, "text": "HashMap Dictionary Dictionary Dictionary" } ]
2008/11/06
[ "https://Stackoverflow.com/questions/267312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33203/" ]
267,351
<p>The Dragon Book includes an exercise on converting integers to roman numerals using a syntax-directed translation scheme.</p> <p>How can this be completed?</p>
[ { "answer_id": 267587, "author": "Oddthinking", "author_id": 8014, "author_profile": "https://Stackoverflow.com/users/8014", "pm_score": 3, "selected": true, "text": "0 -> ''\n1 -> 'I'\n2 -> 'II'\n3 -> 'III'\n4 -> 'IV'\n...\n9 -> 'IX'\n 0 -> ''\n1 -> 'X'\n2 -> 'XX'\n...\n9 -> 'XC'\n" }...
2008/11/06
[ "https://Stackoverflow.com/questions/267351", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3314/" ]
267,367
<p>For example:</p> <p>Base class header file has:</p> <pre><code>enum FOO { FOO_A, FOO_B, FOO_C, FOO_USERSTART }; </code></pre> <p>Then the derived class has:</p> <pre><code>enum FOO { FOO_USERA=FOO_USERSTART FOO_USERB, FOO_USERC }; </code></pre> <p>Just to be clear on my usage it is for having an event handler w...
[ { "answer_id": 268262, "author": "MSalters", "author_id": 15416, "author_profile": "https://Stackoverflow.com/users/15416", "pm_score": 3, "selected": true, "text": "enum Foo {\n A,\n B,\n MAX = 1<<15\n};\n" }, { "answer_id": 269967, "author": "Marcin", "author_id": 22...
2008/11/06
[ "https://Stackoverflow.com/questions/267367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13676/" ]
267,369
<p>When beginning a new web project, i'm always a bit worried about removing pieces of the web.config. It seems there are more entries than ever with Net 3.5 SP1.</p> <p>Which bits of the .config do you delete for the following scenarios:</p> <ul> <li>WCF Web Service, no Javascript support</li> <li>Simple MVC Websit...
[ { "answer_id": 506074, "author": "Andrew Harry", "author_id": 30576, "author_profile": "https://Stackoverflow.com/users/30576", "pm_score": 1, "selected": true, "text": "<?xml version=\"1.0\"?>\n<configuration>\n <system.web>\n <compilation debug=\"true\">\n <assemblie...
2008/11/06
[ "https://Stackoverflow.com/questions/267369", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30576/" ]
267,374
<p>People in java/.net world has framework which provides methods for sorting a list.</p> <p>In CS, we all might have gone through Bubble/Insertion/Merge/Shell sorting algorithms. Do you write any of it these days?</p> <p>With frameworks in place, do you write code for sorting?<br></p> <p>Do you think it makes sense...
[ { "answer_id": 267406, "author": "JaredPar", "author_id": 23283, "author_profile": "https://Stackoverflow.com/users/23283", "pm_score": 3, "selected": false, "text": "list.Sort();\nenumerable.OrderBy(x => x); // Occasionally a different lambda is used\n" } ]
2008/11/06
[ "https://Stackoverflow.com/questions/267374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23574/" ]
267,399
<p>Thinking about <a href="https://stackoverflow.com/questions/267351/how-can-i-convert-from-integers-to-roman-numerals-using-a-syntax-directed-trans">my other problem</a>, i decided I can't even create a regular expression that will match roman numerals (let alone a context-free grammar that will generate them)</p> <...
[ { "answer_id": 267405, "author": "paxdiablo", "author_id": 14860, "author_profile": "https://Stackoverflow.com/users/14860", "pm_score": 10, "selected": true, "text": "^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$\n M{0,4} 0 4000 0: <empty> matched by M{0}\n1000: M ...
2008/11/06
[ "https://Stackoverflow.com/questions/267399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3314/" ]
267,410
<p>I have a datasource that I want to bind to a listview that has multiple columns. How do I bind my datasource to that listview</p> <p>Here is some pseudo code that doesn't work to help illustrate what I am trying to do:</p> <pre><code>MyDataTable dt = GetDataSource(); ListView1.DataBindings.Add("Column1.Text", dt, ...
[ { "answer_id": 267720, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 0, "selected": false, "text": "ListView DataBindings.Add DataGridView" } ]
2008/11/06
[ "https://Stackoverflow.com/questions/267410", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1632/" ]
267,418
<p>Is there an elegant way to specialize a template based on one of its template parameters?</p> <p>Ie.</p> <pre><code>template&lt;int N&gt; struct Junk { static int foo() { // stuff return Junk&lt;N - 1&gt;::foo(); } }; // compile error: template argument '(size * 5)' involves template param...
[ { "answer_id": 267514, "author": "jwfearn", "author_id": 10559, "author_profile": "https://Stackoverflow.com/users/10559", "pm_score": 5, "selected": true, "text": "#include <iostream>\nusing namespace std;\n\ntemplate < typename T, T N, T D >\nstruct fraction {\n typedef T value_type...
2008/11/06
[ "https://Stackoverflow.com/questions/267418", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5963/" ]
267,427
<p>I have a file with data listed as follows:</p> <pre><code>0, 2, 10 10, 8, 10 10, 10, 10 10, 16, 10 15, 10, 16 17, 10, 16 </code></pre> <p>I want to be able to input the file and split it into three arrays, in the process trimming all excess spaces and converting ea...
[ { "answer_id": 267449, "author": "Matthew Smith", "author_id": 20889, "author_profile": "https://Stackoverflow.com/users/20889", "pm_score": 2, "selected": false, "text": "vector<int> inint;\nvector<int> inbase;\nvector<int> outbase;\nwhile (fgets(buf, fh)) {\n char *tok = strtok(buf, ...
2008/11/06
[ "https://Stackoverflow.com/questions/267427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/338360/" ]
267,436
<p>For example, if I have a <em>unicode</em> string, I can encode it as an <em>ASCII</em> string like so:</p> <pre><code>&gt;&gt;&gt; u'\u003cfoo/\u003e'.encode('ascii') '&lt;foo/&gt;' </code></pre> <p>However, I have e.g. this <em>ASCII</em> string:</p> <pre><code>'\u003foo\u003e' </code></pre> <p>... that I want ...
[ { "answer_id": 267444, "author": "Ned Batchelder", "author_id": 14343, "author_profile": "https://Stackoverflow.com/users/14343", "pm_score": 0, "selected": false, "text": ">>> s = '\\u003cfoo\\u003e'\n>>> eval('u\"'+s.replace('\"', r'\\\"')+'\"').encode('ascii')\n'<foo>'\n" }, { ...
2008/11/06
[ "https://Stackoverflow.com/questions/267436", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2168/" ]
267,439
<p>Much related to <a href="https://stackoverflow.com/questions/245687/managing-reference-paths-between-x86-and-x64-workstations-in-a-team">this question</a>, we have a scenario on my team where we need to copy the contents of a folder for a suite of libraries and configuration files for said libraries to our folder wh...
[ { "answer_id": 267444, "author": "Ned Batchelder", "author_id": 14343, "author_profile": "https://Stackoverflow.com/users/14343", "pm_score": 0, "selected": false, "text": ">>> s = '\\u003cfoo\\u003e'\n>>> eval('u\"'+s.replace('\"', r'\\\"')+'\"').encode('ascii')\n'<foo>'\n" }, { ...
2008/11/06
[ "https://Stackoverflow.com/questions/267439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14409/" ]
267,451
<p>I would like to read/write encrypted XML files using LINQ to XML. Does anyone know how to use encryption algorithms built into the .NET Framework to encrypt the Stream used by the XDocument object?</p> <p>I did try it, but you can't set the CryptoStream to Read/Write access. It only support Read or Write, which cau...
[ { "answer_id": 267713, "author": "Corbin March", "author_id": 7625, "author_profile": "https://Stackoverflow.com/users/7625", "pm_score": 4, "selected": true, "text": "XDocument writeContacts = new XDocument(\n new XElement(\"contacts\",\n new XElement(\"contact\",\n new X...
2008/11/06
[ "https://Stackoverflow.com/questions/267451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7831/" ]
267,465
<p>On IBM DB2 v.9 windows, when someone connect to database by Server\Administrator user DB2 database will automatically accept and grant all the permissions to this user? But, in some case environment Administrator of server does not need to see every data in the database. So how to prevent Administrator use connect t...
[ { "answer_id": 274355, "author": "Kevin Beck", "author_id": 24734, "author_profile": "https://Stackoverflow.com/users/24734", "pm_score": 0, "selected": false, "text": "CONNECT GRANT CONNECT ON DATABASE TO <user1>, <user2>, ...\n REVOKE CONNECT ON DATABASE FROM PUBLIC\n" }, { "an...
2008/11/06
[ "https://Stackoverflow.com/questions/267465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24550/" ]
267,473
<p>The exception mentions</p> <pre><code>FILE* __cdecl _getstream </code></pre> <p>I'm calling <code>fopen</code> and it keeps crashing. </p> <pre><code>AfxMessageBox("getting here 1"); FILE* filePtr = fopen(fileName, "rb"); AfxMessageBox("getting here 2"); </code></pre> <p>For some reason, I never get to the secon...
[ { "answer_id": 24874294, "author": "ArtHare", "author_id": 1158478, "author_profile": "https://Stackoverflow.com/users/1158478", "pm_score": 0, "selected": false, "text": "HANDLE hMyFile = CreateFile(...);\nFILE* pFile = _fdopen( _open_osfhandle((long)hMyFile, <flags>), \"rb\" );\nCloseH...
2008/11/06
[ "https://Stackoverflow.com/questions/267473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31325/" ]
267,477
<p>I know that you can use a dummy "int" parameter on <code>operator++</code> and <code>operator--</code> to override the postfix versions of those operators, but I vaguely recall something about a dummy parameter that you could declare on a destructor. Does anyone know anything about that, and if so, what that dummy p...
[ { "answer_id": 267505, "author": "Thomas L Holaday", "author_id": 29403, "author_profile": "https://Stackoverflow.com/users/29403", "pm_score": 2, "selected": false, "text": "class MyClass { /* ... */ };\n\nchar * raw_mem = new char [sizeof (MyClass)];\npMyClass = new (raw_mem) MyClass;\...
2008/11/06
[ "https://Stackoverflow.com/questions/267477", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12193/" ]
267,487
<p>I want to do something like this:</p> <pre><code>SQL.Text := Format('select foo from bar where baz like ''%s%''',[SearchTerm]); </code></pre> <p>But Format doesn't like that last '%', of course. So how can I escape it? <code>\%</code>? <code>%%</code>? </p> <p>Or do I have to do this:</p> <pre><code>SQL.Text := ...
[ { "answer_id": 267506, "author": "Robert Gamble", "author_id": 25222, "author_profile": "https://Stackoverflow.com/users/25222", "pm_score": 6, "selected": true, "text": "SQL.Text := Format('select foo from bar where baz like ''%s%%''',[SearchTerm]);\n" }, { "answer_id": 18956816...
2008/11/06
[ "https://Stackoverflow.com/questions/267487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369/" ]
267,488
<p>I'm having some trouble figuring out how to use more than one left outer join using LINQ to SQL. I understand how to use one left outer join. I'm using VB.NET. Below is my SQL syntax.</p> <p><strong>T-SQL</strong></p> <pre><code>SELECT o.OrderNumber, v.VendorName, s.StatusName FROM Orders o LEFT...
[ { "answer_id": 267542, "author": "Jon Norton", "author_id": 4797, "author_profile": "https://Stackoverflow.com/users/4797", "pm_score": 2, "selected": false, "text": "DataContext.ExecuteCommand(...)" }, { "answer_id": 267632, "author": "tvanfosson", "author_id": 12950, ...
2008/11/06
[ "https://Stackoverflow.com/questions/267488", "https://Stackoverflow.com", "https://Stackoverflow.com/users/299/" ]
267,530
<p>I have two tables that I would like to join but I am getting an error from MySQL</p> <pre><code>Table: books bookTagNum ShelfTagNum book1 1 book2 2 book3 2 Table: shelf shelfNum shelfTagNum 1 shelf1 2 shelf2 </code></pre> <p>I want my results to be:</p> <pre><code>bookTagNum Sh...
[ { "answer_id": 267531, "author": "Blair Conrad", "author_id": 1199, "author_profile": "https://Stackoverflow.com/users/1199", "pm_score": 3, "selected": false, "text": "where `books`.`shelfTagNum`=`shelf`.`shelfNum`\n books shelf where books shelfNum shelfNum JOIN" }, { "answer_i...
2008/11/06
[ "https://Stackoverflow.com/questions/267530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28462/" ]
267,534
<p>I asked this question before, <a href="https://stackoverflow.com/questions/264441/does-a-native-php-5-function-exist-that-does-the-following-in-1-line">Here</a> however I think I presented the problem poorly, and got quite a few replies that may have been useful to someone but did not address the actual question and...
[ { "answer_id": 267545, "author": "Matthew Scharley", "author_id": 15537, "author_profile": "https://Stackoverflow.com/users/15537", "pm_score": 0, "selected": false, "text": "$pos = 0;\n$num = 0;\nwhile(($pos = strpos($places, ',', $pos+1)) !== false) {$num++;}\n$which = rand(0, $num);\n...
2008/11/06
[ "https://Stackoverflow.com/questions/267534", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34561/" ]
267,538
<p>I would like to implement a telnet server in C. How would I proceed with this? Which RFCs should I look at? This is important to me, and I would appreciate any help.</p>
[ { "answer_id": 271416, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": -1, "selected": false, "text": "#include <glib.h>\n#include <gnet.h>\n\nvoid client_connect(GServer G_GNUC_UNUSED *server, GConn *conn, gpointer G_GNUC_UNUSE...
2008/11/06
[ "https://Stackoverflow.com/questions/267538", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
267,540
<p>I've met a really strange problem.</p> <p>The code is as follow:</p> <pre><code>::boost::shared_ptr&lt;CQImageFileInfo&gt; pInfo=CQUserViewDataManager::GetInstance()-&gt;GetImageFileInfo(nIndex); Image* pImage=pInfo-&gt;m_pThumbnail; if(pImage==NULL) pImage=m_pStretchedDefaultThumbImage; else { // int...
[ { "answer_id": 267559, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 0, "selected": false, "text": "pImage == NULL rcShowImage" }, { "answer_id": 267564, "author": "Martin Cote", "author_id": 9936, "au...
2008/11/06
[ "https://Stackoverflow.com/questions/267540", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25749/" ]
267,578
<p>I use ASP.Net and I have a custom 404 page. When user pastes url that is not found it will redirected to the custom 404 page. However google indexes my custom 404 page. Search 404(page not found).</p> <p>Anyone have solution?</p>
[ { "answer_id": 267708, "author": "Sean Reilly", "author_id": 8313, "author_profile": "https://Stackoverflow.com/users/8313", "pm_score": 1, "selected": false, "text": "<META NAME=\"ROBOTS\" CONTENT=\"NOINDEX\">\n" } ]
2008/11/06
[ "https://Stackoverflow.com/questions/267578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
267,607
<p>I have been given two different Microsoft Word document that my virus scanner has warned me contains macros. These should be simple text files, and the person who sent them doesn't even know what a macro is; they may be a mistake on his part, but they might be signs of a malicious infection. My installation of OpenO...
[ { "answer_id": 23863755, "author": "Martin Kealey", "author_id": 5781773, "author_profile": "https://Stackoverflow.com/users/5781773", "pm_score": 1, "selected": false, "text": "Tools Macros Organize Macros OpenOffice.org Basic OpenOffice.org Basic Macros Edit" }, { "answer_id": ...
2008/11/06
[ "https://Stackoverflow.com/questions/267607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16398/" ]
267,609
<p>I'd like to know what are the most useful JQuery plugins. I'm particularly interested in those which are likely to be useful in general UI development, such as <a href="http://tablesorter.com" rel="noreferrer">Tablesorter</a>, rather than those which serve uncommon needs.</p> <p>If you could provide a very brief d...
[ { "answer_id": 267626, "author": "hugoware", "author_id": 17091, "author_profile": "https://Stackoverflow.com/users/17091", "pm_score": 4, "selected": false, "text": "var results = $.from(data)\n .ignoreCase()\n .startsWith(\"firstName\",\"m\")\n .or(\"n\")\n .isNot(\"adminis...
2008/11/06
[ "https://Stackoverflow.com/questions/267609", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2648/" ]
267,613
<p>Im trying to get into some basic JavaFX game development and I'm getting confused with some circle maths.</p> <p>I have a circle at (x:250, y:250) with a radius of 50.</p> <p>My objective is to make a smaller circle to be placed on the circumference of the above circle based on the position of the mouse.</p> <p>W...
[ { "answer_id": 267622, "author": "Markus Jarderot", "author_id": 22364, "author_profile": "https://Stackoverflow.com/users/22364", "pm_score": 3, "selected": true, "text": "atan(height/length) atan2 y x" } ]
2008/11/06
[ "https://Stackoverflow.com/questions/267613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26310/" ]
267,615
<p>Using jquery how do I focus the first element (edit field, text area, dropdown field, etc) in the form when the page load?</p> <p>Something like:</p> <pre><code>document.forms[0].elements[0].focus(); </code></pre> <p>but using jquery.</p> <p>Another requirement, don't focus the first element when the form has cl...
[ { "answer_id": 267645, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": 6, "selected": false, "text": "$('form:not(.filter) :input:visible:enabled:first').focus()\n <input /> <select> <textarea> filter" }, { "answer_id": ...
2008/11/06
[ "https://Stackoverflow.com/questions/267615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3370/" ]
267,628
<p>I have both Fruityloops and Propellerheads Reason software synths on my Windows PC.</p> <p>Any way I can get at and script these from either Visual Basic or Python? Or at least send Midi messages to the synths from code?</p> <p>Update : attempts to use something like a "midi-mapper" (thanks for link MusiGenesis) d...
[ { "answer_id": 2840001, "author": "Wouter van Nifterick", "author_id": 38813, "author_profile": "https://Stackoverflow.com/users/38813", "pm_score": 2, "selected": false, "text": "Your Application Virtual MIDI Port FruityLoops" }, { "answer_id": 4439944, "author": "zslevi", ...
2008/11/06
[ "https://Stackoverflow.com/questions/267628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8482/" ]
267,629
<p>What's your experience with <a href="http://www.doctrine-project.org/" rel="noreferrer">doctrine</a>? I've never been much of an ORM kind of guy, I mostlymanaged with just some basic db abstraction layer like adodb. </p> <p>But I understood all the concepts and benifits of it. So when a project came along that need...
[ { "answer_id": 32977773, "author": "Dennis", "author_id": 2883328, "author_profile": "https://Stackoverflow.com/users/2883328", "pm_score": 3, "selected": false, "text": "doctrine orm:validate-schema" }, { "answer_id": 37661758, "author": "Dennis", "author_id": 2883328, ...
2008/11/06
[ "https://Stackoverflow.com/questions/267629", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2976/" ]
267,643
<p>Does anyone know how to generate SQL scripts from a query?</p> <p>For example, </p> <ol> <li>Script some tables.</li> <li>Do custom action 1.</li> <li>Script the views. </li> <li>Do custom action 2.</li> <li>Etc.</li> </ol>
[ { "answer_id": 267831, "author": "Alexander Prokofyev", "author_id": 11256, "author_profile": "https://Stackoverflow.com/users/11256", "pm_score": 0, "selected": false, "text": "select 'UPDATE '+table_name+ ' SET description=''(new!) ''+description WHERE description_date>''2008-11-01''' ...
2008/11/06
[ "https://Stackoverflow.com/questions/267643", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
267,658
<p>I have the following table schema;</p> <pre><code>CREATE TABLE `db1`.`sms_queue` ( `Id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, `Message` VARCHAR(160) NOT NULL DEFAULT 'Unknown Message Error', `CurrentState` VARCHAR(10) NOT NULL DEFAULT 'None', `Phone` VARCHAR(14) DEFAULT NULL, `Created` TIMESTAMP NOT N...
[ { "answer_id": 807613, "author": "Bogdan Gusiev", "author_id": 91610, "author_profile": "https://Stackoverflow.com/users/91610", "pm_score": 7, "selected": false, "text": "create table test_table( \n id integer not null auto_increment primary key, \n stamp_created timestamp default '00...
2008/11/06
[ "https://Stackoverflow.com/questions/267658", "https://Stackoverflow.com", "https://Stackoverflow.com/users/264/" ]
267,672
<p>I am trying to use native windows API with Qt using mingw toolset. There are link problems with some functions. What happens? Is this a bug with mingw name mangling?</p> <pre><code>#ifdef Q_WS_WIN HWND hwnd = QWidget::winId(); HDC hdcEMF = CreateEnhMetaFile(NULL, NULL, NULL, NULL ) ; Rectangle(hdcEMF,1...
[ { "answer_id": 267678, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": 3, "selected": true, "text": "CreateEnhMetaFileW() CloseEnhMetaFile() -lgdi32 -L/path/to/folder/containing/the/library -lgdi32" }, { "answe...
2008/11/06
[ "https://Stackoverflow.com/questions/267672", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19884/" ]
267,674
<p>Is it possible to inspect the return value of a function in gdb assuming the return value is <strong>not</strong> assigned to a variable?</p>
[ { "answer_id": 267682, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": 6, "selected": false, "text": "EAX print $eax long long double structs classes" }, { "answer_id": 267687, "author": "hark", "author...
2008/11/06
[ "https://Stackoverflow.com/questions/267674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11688/" ]
267,685
<p>This question is regarding the performance issue in Mac OS X</p> <p>Canvas3D object is embedded in a JPanel; then the panel is integrated with the rest of the Swing-built application. Within that Canvas I am rendering a simple cube by applying certain transformations. At the initial launch It works fine. But when ...
[ { "answer_id": 267682, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": 6, "selected": false, "text": "EAX print $eax long long double structs classes" }, { "answer_id": 267687, "author": "hark", "author...
2008/11/06
[ "https://Stackoverflow.com/questions/267685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
267,693
<p>I have a .NET assembly that (for reasons outside my control) <em>must</em> be in the GAC. However, the same assembly is used by another program, which has a its own copy of an older version of the same assembly. It must use its own copy and not whatever is in the GAC. Proper versioning is probably more hassle than i...
[ { "answer_id": 267729, "author": "Corbin March", "author_id": 7625, "author_profile": "https://Stackoverflow.com/users/7625", "pm_score": 6, "selected": false, "text": "<runtime>\n <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n <dependentAssembly>\n <...
2008/11/06
[ "https://Stackoverflow.com/questions/267693", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20336/" ]
267,704
<p>Is there an easy way to modify this code so that the target URL opens in the SAME window?</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;a href="javascript:q=(do...
[ { "answer_id": 267705, "author": "Stephen Walcher", "author_id": 25375, "author_profile": "https://Stackoverflow.com/users/25375", "pm_score": 3, "selected": false, "text": "<a href=\"javascript:;\" onclick=\"window.location = 'http://example.com/submit.php?url=' + escape(document.locati...
2008/11/06
[ "https://Stackoverflow.com/questions/267704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34964/" ]