qid
int64
4
22.2M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
364,794
<p>My first instinct is to say each key is an object, and has a hash code, which is what is used to determine if a duplicate is being inserted. However, I can't find anything to back that up for sure. Can someone provide a link that says that, or provide the real answer here? Thanks!</p>
[ { "answer_id": 364823, "author": "Dave L.", "author_id": 3093, "author_profile": "https://Stackoverflow.com/users/3093", "pm_score": 5, "selected": true, "text": "Map" }, { "answer_id": 365002, "author": "Apocalisp", "author_id": 3434, "author_profile": "https://Stack...
2008/12/13
[ "https://Stackoverflow.com/questions/364794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
364,802
<p>What does generator comprehension do? How does it work? I couldn't find a tutorial about it.</p>
[ { "answer_id": 364818, "author": "Can Berk Güder", "author_id": 2119, "author_profile": "https://Stackoverflow.com/users/2119", "pm_score": 3, "selected": false, "text": ">>> [x**2 for x in range(1,11)]\n[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]\n" }, { "answer_id": 364824, "aut...
2008/12/13
[ "https://Stackoverflow.com/questions/364802", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44354/" ]
364,809
<p>I want to gather data from different data servers located in Europe and Asia. Rather than running a plain data query task that will clog up the undersea network I am thinking of a couple of machines that will be available for me at the local sites.</p> <p>I am thinking to design the master package so that I can:</p> <ol> <li>run remote setup tasks</li> <li>launch the data collection package locally using psexec dtexec ...</li> <li>get the data locally stored in multiple raw file (1 for each type of data)</li> <li>zipped and pulled back</li> <li>unzipped and bulkuploaded to local server</li> </ol> <p>Data collection is handled through custom script source since the data is available through a weird class library.</p> <p>Tasks can fail unpredictably. If a particular type of data is successfully captured while the others fail for a particular location, I don't want to run it again.</p> <p>How can I simplify this design if possible and make it more robust?</p>
[ { "answer_id": 365149, "author": "ConcernedOfTunbridgeWells", "author_id": 15401, "author_profile": "https://Stackoverflow.com/users/15401", "pm_score": 2, "selected": true, "text": "High+--------------------------+--------------------------+\n | | ...
2008/12/13
[ "https://Stackoverflow.com/questions/364809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30546/" ]
364,825
<p>I have a query to the effect of</p> <pre><code>SELECT t3.id, a,bunch,of,other,stuff FROM t1, t2, t3 WHERE (associate t1,t2, and t3 with each other) GROUP BY t3.id LIMIT 10,20 </code></pre> <p>I want to know to many total rows this query would return without the LIMIT (so I can show pagination information).</p> <p>Normally, I would use this query:</p> <pre><code>SELECT COUNT(t3.id) FROM t1, t2, t3 WHERE (associate t1,t2, and t3 with each other) GROUP BY t3.id </code></pre> <p>However the GROUP BY changes the meaning of the COUNT, and instead I get a set of rows representing the number of unique t3.id values in each group.</p> <p>Is there a way to get a count for the total number of rows when I use a GROUP BY? I'd like to avoid having to execute the entire query and just counting the number of rows, since I only need a subset of the rows because the values are paginated. I'm using MySQL 5, but I think this pretty generic.</p>
[ { "answer_id": 364833, "author": "Bill Karwin", "author_id": 20860, "author_profile": "https://Stackoverflow.com/users/20860", "pm_score": 4, "selected": false, "text": "SELECT SQL_CALC_FOUND_ROWS t3.id, a,bunch,of,other,stuff \nFROM t1, t2, t3 \nWHERE (associate t1,t2, and t3 with each ...
2008/12/13
[ "https://Stackoverflow.com/questions/364825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36384/" ]
364,832
<p>So, I have the following rows in the DB:</p> <p>1 | /users/</p> <p>2 | /users/admin/</p> <p>3 | /users/admin/*</p> <p>4 | /users/admin/mike/</p> <p>5 | /users/admin/steve/docs/</p> <p>The input URL is <strong>/users/admin/steve/</strong>, and the goal is to find the URL match from the DB.</p> <p>I want to return #3 as the correct row, since the wildcard "*" specifies that anything can go in place of the asterisk. What would be the most efficient method for doing this?</p> <p><strong>Here's my initial thoughts, but I'm sure they could be improved upon:</strong></p> <ol> <li>Make a query to see if there's an exact URL match</li> <li>If no matches, then retrieve all rows with "*" as the last character, in reverse order (so the more specific URLs take precedence)</li> <li>For each row, if it (minus the "*") matches the input URL, then return it</li> <li>If nothing is found, then we're SOL</li> </ol>
[ { "answer_id": 364840, "author": "Bill Karwin", "author_id": 20860, "author_profile": "https://Stackoverflow.com/users/20860", "pm_score": 3, "selected": true, "text": "SELECT * FROM mytable AS m\nWHERE <input-url> = m.urlpattern\n OR <input-url> REGEXP REPLACE(m.urlpattern, '*', '.*');\...
2008/12/13
[ "https://Stackoverflow.com/questions/364832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32881/" ]
364,842
<p>I've got a Perl script that needs to execute another Perl script. This second script can be executed directly on the command line, but I need to execute it from within my first program. I'll need to pass it a few parameters that would normally be passed in when it's run standalone (the first script runs periodically, and executes the second script under a certain set of system conditions).</p> <p>Preliminary Google searches suggest using backticks or a system() call. Are there any other ways to run it? (I'm guessing yes, since it's Perl we're talking about :P ) Which method is preferred if I need to capture output from the invoked program (and, if possible, pipe that output as it executes to stdout as though the second program were invoked directly)?</p> <p>(Edit: oh, <strong>now</strong> SO suggests some related questions. <a href="https://stackoverflow.com/questions/109124/run-external-process-from-perl-capture-stderr-stdout-and-the-process-exit-code">This one</a> is close, but not exactly the same as what I'm asking. The second program will likely take an hour or more to run (lots of I/O), so I'm not sure a one-off invocation is the right fit for this.)</p>
[ { "answer_id": 364858, "author": "Jonathan Leffler", "author_id": 15168, "author_profile": "https://Stackoverflow.com/users/15168", "pm_score": 3, "selected": false, "text": "system" }, { "answer_id": 364861, "author": "Robert Gamble", "author_id": 25222, "author_prof...
2008/12/13
[ "https://Stackoverflow.com/questions/364842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/774/" ]
364,847
<p>how to change connection string dynamically in object datasource in asp.net ?</p>
[ { "answer_id": 364850, "author": "Tarik", "author_id": 44852, "author_profile": "https://Stackoverflow.com/users/44852", "pm_score": 2, "selected": false, "text": "protected void ObjectDataSource1_ObjectCreated(object sender, ObjectDataSourceEventArgs e)\n{\n if (e.ObjectInstance != n...
2008/12/13
[ "https://Stackoverflow.com/questions/364847", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18709/" ]
364,895
<p>I know this is possible via a simple registry change to accomplish this as long as IE/firefox is being used. However, I am wondering if there is a reliable way to do so for other browsers,</p> <p>I am specifically looking for a way to do this via an installer, so editing a preference inside a specific browser will not cut it.</p>
[ { "answer_id": 49505885, "author": "ka3yc", "author_id": 3300376, "author_profile": "https://Stackoverflow.com/users/3300376", "pm_score": 2, "selected": false, "text": "<a href='myfile:\\\\mysharedserver\\sharedfolder\\' target='_self'>Shared server</a>\n" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/364895", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1200558/" ]
364,925
<p>Say I have a git repository and I've been working on master, can I retroactively create a branch. For example:</p> <p>A - B - C - A1 - D - A2 - E</p> <p>I want to make it look like this:</p> <pre><code>A - A1 - A2 \ \ B - C - D - E </code></pre> <p>The specific use case is when I've cherry-picked a bunch of commits into an old version branch and it needs to go into multiple older versions and I don't want to repeat the cherry-pick on all those revision.</p> <p>Essentially it's something that would have been good as a feature or topic branch in the first place but wasn't created like that.</p>
[ { "answer_id": 365179, "author": "Bombe", "author_id": 43582, "author_profile": "https://Stackoverflow.com/users/43582", "pm_score": 6, "selected": true, "text": "git checkout -b new-branch hash-of-A\ngit cherry-pick hash-of-A1\ngit cherry-pick hash-of-A2\n" }, { "answer_id": 367...
2008/12/13
[ "https://Stackoverflow.com/questions/364925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9594/" ]
364,936
<p>Does anyone have any good suggestions for creating a Pipe object in Java which <em>is</em> both an InputStream and and OutputStream since Java does not have multiple inheritance and both of the streams are abstract classes instead of interfaces?</p> <p>The underlying need is to have a single object that can be passed to things which need either an InputStream or an OutputStream to pipe output from one thread to input for another.</p>
[ { "answer_id": 365034, "author": "Aaron Digulla", "author_id": 34088, "author_profile": "https://Stackoverflow.com/users/34088", "pm_score": 1, "selected": false, "text": "InputStream" }, { "answer_id": 19465966, "author": "Guido Medina", "author_id": 1666753, "author...
2008/12/13
[ "https://Stackoverflow.com/questions/364936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45931/" ]
364,937
<p>Failed to create component 'User Control 1'. the error message follows:</p> <blockquote> <p>'System.NullReferenceException : Object reference not set to an instance of an object. at System.ComponentModel.ReflectPropertyDescriptor.SetValue(Object Component, Object Value) .............. etc..........</p> </blockquote> <p>What should I do to fix this error?</p>
[ { "answer_id": 371047, "author": "Tom Walker", "author_id": 6951, "author_profile": "https://Stackoverflow.com/users/6951", "pm_score": 2, "selected": false, "text": "Integer" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/364937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
364,941
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/225929/what-is-the-exact-problem-with-multiple-inheritance">What is the exact problem with multiple inheritance?</a> </p> </blockquote> <p>Why is multiple inheritance considered to be <em>evil</em> while implementing multiple interfaces is not? Especially when once considers that interfaces are simply pure abstract classes?</p> <p><strong>(More or less) duplicate of</strong> <a href="https://stackoverflow.com/questions/225929/what-is-the-exact-problem-with-multiple-inheritance" title="What is the exact problem with multiple inheritance?">What is the exact problem with multiple inheritance?</a>, <a href="https://stackoverflow.com/questions/178333/multiple-inheritance-in-c" title="Multiple Inheritance in C#">Multiple Inheritance in C#</a>, and some others...</p>
[ { "answer_id": 364945, "author": "Brad Wilson", "author_id": 1554, "author_profile": "https://Stackoverflow.com/users/1554", "pm_score": 6, "selected": true, "text": " A\n / \\\nB c\n \\ /\n D\n" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/364941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45931/" ]
364,946
<p>I am giving link of a pdf file on my web page for download, like below</p> <pre><code>&lt;a href="myfile.pdf"&gt;Download Brochure&lt;/a&gt; </code></pre> <p>The problem is when user clicks on this link then</p> <ul> <li>If the user have installed Adobe Acrobat, then it opens the file in the same browser window in Adobe Reader.</li> <li>If the Adobe Acrobat is not installed then it pop-up to the user for Downloading the file.</li> </ul> <p>But I want it always pop-up to the user for download, irrespective of "Adobe acrobat" is installed or not.</p> <p>Please tell me how i can do this?</p>
[ { "answer_id": 364950, "author": "TravisO", "author_id": 35116, "author_profile": "https://Stackoverflow.com/users/35116", "pm_score": 8, "selected": true, "text": "<a href=\"pdf_server.php?file=pdffilename\">Download my eBook</a>\n" }, { "answer_id": 364957, "author": "Sudde...
2008/12/13
[ "https://Stackoverflow.com/questions/364946", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45261/" ]
364,952
<p>I would like to manipulate the HTML inside an iframe using jQuery.</p> <p>I thought I'd be able to do this by setting the context of the jQuery function to be the document of the iframe, something like:</p> <pre><code>$(function(){ //document ready $('some selector', frames['nameOfMyIframe'].document).doStuff() }); </code></pre> <p>However this doesn't seem to work. A bit of inspection shows me that the variables in <code>frames['nameOfMyIframe']</code> are <code>undefined</code> unless I wait a while for the iframe to load. However, when the iframe loads the variables are not accessible (I get <code>permission denied</code>-type errors).</p> <p>Does anyone know of a work-around to this?</p>
[ { "answer_id": 364983, "author": "Khb", "author_id": 37817, "author_profile": "https://Stackoverflow.com/users/37817", "pm_score": 2, "selected": false, "text": "$(document).ready(function() {\n $('some selector', frames['nameOfMyIframe'].document).doStuff()\n} );\n" }, { "ans...
2008/12/13
[ "https://Stackoverflow.com/questions/364952", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7407/" ]
364,959
<p>Here I had build a HTML page with an <code>iFrame</code>. I had an id within the <code>iFrame</code> src page. Is it possible to access the id from my current page through JavaScript.</p> <p>Please help me.</p>
[ { "answer_id": 364972, "author": "Biswanath", "author_id": 41968, "author_profile": "https://Stackoverflow.com/users/41968", "pm_score": 0, "selected": false, "text": "<title>Untitled Page</title>\n<script type=\"text/javascript\" >\n function ShowVal() {\n alert(myIframe.docum...
2008/12/13
[ "https://Stackoverflow.com/questions/364959", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38172/" ]
364,962
<p>My application is already developed and now we are going to change the connection string whatever stored in the session object (Bcoz of Distributed Database Management System (DDBMS))</p> <p>Problem is here.....</p> <blockquote> <pre><code>In that application There are so many **ObjectDataSource** which are </code></pre> <p>initialize with the using <strong>.XSD</strong> file. which is related to the <strong>TableAdapter</strong> and in which connection string of <strong>TableAdapter</strong> is assign from the Web.Config File. Now How to change the connection string to whatever stored in session object?</p> </blockquote> <p>Thanks in advance.</p>
[ { "answer_id": 416869, "author": "Bill Martin", "author_id": 46064, "author_profile": "https://Stackoverflow.com/users/46064", "pm_score": 0, "selected": false, "text": "myTableAdapter.Connection.ConnectionString = clsGlobals.gstrConnectionString;\n" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/364962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45934/" ]
364,963
<p>I have an a aspx page, but all content is generated by hands(yes I know that I need to make a handler, I have another question)</p> <p>I want to cache output in client browser. Problem is that it's cached only for one query.</p> <pre><code> public static void ProceedCaching(string etag, string lastModify, string response, HttpResponse Response, HttpRequest Request) { Response.AddHeader("ETag", "\"" + etag + "\""); Response.AddHeader("Last-Modified", lastModify); Response.AppendHeader("Cache-Control", "Public"); Response.AppendHeader("Expires", DateTime.Now.AddMinutes(1).ToUniversalTime().ToString("r",DateTimeFormatInfo.InvariantInfo)); string ifModified = Request.Headers["If-Modified-Since"]; if (!string.IsNullOrEmpty(ifModified)) { if (ifModified.Contains(";")) ifModified = ifModified.Remove(ifModified.IndexOf(';')); } string incomingEtag = Request.Headers["If-None-Match"]; if (String.Compare(incomingEtag, etag) == 0 || string.Compare(ifModified, lastModify) == 0) { Response.StatusCode = 304; Response.End(); } Response.Write(response); Response.End(); } </code></pre> <p>it's become preaty messy. As I said it's cached only once. After recevieng HTTP 304 browser will send clean request without caching information(etag, lastmodified). Have any ideas? </p>
[ { "answer_id": 416869, "author": "Bill Martin", "author_id": 46064, "author_profile": "https://Stackoverflow.com/users/46064", "pm_score": 0, "selected": false, "text": "myTableAdapter.Connection.ConnectionString = clsGlobals.gstrConnectionString;\n" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/364963", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41483/" ]
364,978
<p>i want to check my server connection to know if its available or not to inform the user..</p> <p>so how to send a pkg or msg to the server (it's not SQL server; it's a server contains some serviecs) ...</p> <p>thnx in adcvance ..</p>
[ { "answer_id": 364992, "author": "paxdiablo", "author_id": 14860, "author_profile": "https://Stackoverflow.com/users/14860", "pm_score": 3, "selected": true, "text": "select * from sysibm.sysdummy1" }, { "answer_id": 365139, "author": "UnkwnTech", "author_id": 115, "a...
2008/12/13
[ "https://Stackoverflow.com/questions/364978", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42782/" ]
364,985
<p>I need to find the smallest power of two that's greater or equal to a given value. So far, I have this:</p> <pre><code>int value = 3221; // 3221 is just an example, could be any number int result = 1; while (result &lt; value) result &lt;&lt;= 1; </code></pre> <p>It works fine, but feels kind of naive. Is there a better algorithm for that problem?</p> <p>EDIT. There were some nice Assembler suggestions, so I'm adding those tags to the question.</p>
[ { "answer_id": 364993, "author": "jfs", "author_id": 4279, "author_profile": "https://Stackoverflow.com/users/4279", "pm_score": 4, "selected": false, "text": "ceil(log2(value))\n" }, { "answer_id": 365042, "author": "DocMax", "author_id": 6234, "author_profile": "htt...
2008/12/13
[ "https://Stackoverflow.com/questions/364985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38106/" ]
364,989
<p>I am considering Smarty as my web app templating solution, and I am now concerned with its performance against plain PHP. </p> <p>The Smarty site says it should be the same, however, I was not able to find anyone doing real benchmarking to prove the statement right or wrong.</p> <p>Did anyone do some benchmarking of Smarty vs plain PHP? Or maybe come across some resources on such tests?</p> <p>Thanks</p>
[ { "answer_id": 844692, "author": "Chad Scira", "author_id": 103696, "author_profile": "https://Stackoverflow.com/users/103696", "pm_score": 2, "selected": false, "text": "// with smarty (baseline)\n 0.014 seconds\n\n// with xsl/xslt-clientside\n 0.008 seconds\n 42% decrease in s...
2008/12/13
[ "https://Stackoverflow.com/questions/364989", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19584/" ]
365,001
<p>In the app I am working on, I want to allow the user to upload static HTML pages to replace the default "user profile" MVC View page. Is this possible? That is, the user uploaded html pages will totally run out of MVC, and it can include its own CSS links, etc.</p> <p>Ideas? Suggestions?</p>
[ { "answer_id": 365032, "author": "Ian", "author_id": 4396, "author_profile": "https://Stackoverflow.com/users/4396", "pm_score": 5, "selected": false, "text": "routes.IgnoreRoute(\"UserPages/{*path}\");\n" }, { "answer_id": 365033, "author": "maxnk", "author_id": 45862, ...
2008/12/13
[ "https://Stackoverflow.com/questions/365001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20067/" ]
365,006
<p>I have set up a version control system using <strong>TortoiseSVN</strong> at my home to manage my pet projects, school projects etc...and it works locally.</p> <p>Now I need to be able to access my code repository remotely, like from school, so that I will be able to update the source at school from the repository, and commit it again once I have finished working on it.</p> <p>The question is, <strong>how can I connect to my repository remotely</strong> ? What ports do I need to open on my router for example?</p> <p>Also, I cannot install the Tortoise client at school, so I will need some other <em>portable</em> application that does this task, be it GUI or <a href="http://en.wikipedia.org/wiki/Command-line_interface" rel="nofollow noreferrer">CLI</a>.</p>
[ { "answer_id": 374295, "author": "dbr", "author_id": 745, "author_profile": "https://Stackoverflow.com/users/745", "pm_score": 2, "selected": false, "text": "C++" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44084/" ]
365,012
<p>Extended Backus–Naur Form: <strong>EBNF</strong> </p> <p>I'm very new to parsing concepts. Where can I get sufficiently easy to read and follow material for writing a grammar for the boost::spirit library, which uses a grammar similar to EBNF?</p> <p>Currently I am looking into <a href="http://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form" rel="noreferrer">EBNF</a> from Wikipedia. </p>
[ { "answer_id": 376753, "author": "Norman Ramsey", "author_id": 41661, "author_profile": "https://Stackoverflow.com/users/41661", "pm_score": 4, "selected": true, "text": "while" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22076/" ]
365,015
<p>I'm using Windows XP and I want to know if the local area is available or not?</p> <p>And if I'm using another OS would that affect on my code?</p>
[ { "answer_id": 14810573, "author": "NASSER", "author_id": 354974, "author_profile": "https://Stackoverflow.com/users/354974", "pm_score": 0, "selected": false, "text": "using System.Net.NetworkInformation; //(Add reference of System.Net.dll)\npublic partial class Form1: Form\n{\n publ...
2008/12/13
[ "https://Stackoverflow.com/questions/365015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42782/" ]
365,028
<p>I'm not a JS guy so I'm kinda stumbling around in the dark. Basically, I wanted something that would add a link to a twitter search for @replies to a particular user while on that person's page. </p> <p>Two things I am trying to figure out:</p> <ol> <li>how to extract the user name from the page so that I can construct the right URL. ie. if I am on <a href="http://twitter.com/ev" rel="nofollow noreferrer">http://twitter.com/ev</a> , I should get "ev" back. </li> <li>how to manipulate the DOM to insert things at the right place</li> </ol> <p>Here's the HTML fragment I'm targetting:</p> <pre><code>&lt;ul id="tabMenu"&gt; &lt;li&gt; &lt;a href="/ev" id="updates_tab"&gt;Updates&lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href="/ev/favourites" id="favorites_tab"&gt;Favorites&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p>And here is the script (so far):</p> <pre><code>// ==UserScript== // @name Twitter Replies Search // @namespace http://jauderho.com/ // @description Find all the replies for a particular user // @include http://twitter.com/* // @include https://twitter.com/* // @exclude http://twitter.com/home // @exclude https://twitter.com/home // @author Jauder Ho // ==/UserScript== var menuNode = document.getElementById('tabMenu'); if (typeof(menuNode) != "undefined" &amp;&amp; menuNode != null) { var html = []; html[html.length] = '&lt;li&gt;'; html[html.length] = '&lt;a href="http://search.twitter.com/search?q=to:ev" class="section-links" id="replies_search_tab"&gt;@Replies Search&lt;/a&gt;'; html[html.length] = '&lt;/li&gt;'; // this is obviously wrong var div = document.createElement('div'); div.className = 'section last'; div.innerHTML = html.join(''); followingNode = menuNode.parentNode; followingNode.parentNode.insertBefore(div, followingNode); } </code></pre>
[ { "answer_id": 365044, "author": "PhiLho", "author_id": 15459, "author_profile": "https://Stackoverflow.com/users/15459", "pm_score": 1, "selected": false, "text": "var userName = window.location.href.match(/^http:\\/\\/twitter\\.com\\/(\\w+)/)\nif (userName == null)\n return; // Proble...
2008/12/13
[ "https://Stackoverflow.com/questions/365028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26366/" ]
365,029
<p>I was reading a book on templates and found the following piece of code:</p> <pre><code>template &lt;template &lt;class&gt; class CreationPolicy&gt; class WidgetManager : public CreationPolicy&lt;Widget&gt; { ... void DoSomething() { Gadget* pW = CreationPolicy&lt;Gadget&gt;().Create(); ... } }; </code></pre> <p>I didn't get the nested templates specified for the CreationPolicy (which is again a template). What is the meaning of that weird looking syntax?</p>
[ { "answer_id": 365035, "author": "Daniel Earwicker", "author_id": 27423, "author_profile": "https://Stackoverflow.com/users/27423", "pm_score": 4, "selected": true, "text": "CreationPolicy" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39742/" ]
365,045
<p>I have a database (NexusDB (supposedly SQL-92 compliant)) which contains and Item table, a Category table, and a many-to-many ItemCategory table, which is just a pair of keys. As you might expect, Items are assigned to multiple categories. </p> <p>I am wanting to all the end user to select all items which are </p> <p>ItemID | CategoryID<br> --------------------------------<br> 01 | 01<br> 01 | 02<br> 01 | 12<br></p> <p>02 | 01<br> 02 | 02<br> 02 | 47<br></p> <p>03 | 01<br> 03 | 02<br> 03 | 14<br> etc...<br></p> <p>I want to be able to select all ItemID's that are assigned to Categories X, Y, and Z but NOT assigned to Categories P and Q. </p> <p>For the example data above, for instance, say I'd like to grab all Items assigned to Categories 01 or 02 but NOT 12 (yielding Items 02 and 03). Something along the lines of:</p> <p>SELECT ItemID WHERE (CategoryID IN (01, 02)) </p> <p>...and remove from that set SELECT ItemID WHERE NOT (CategoryID = 12)</p> <p>This is probably a pretty basic SQL question, but it's stumping me at the moment. Any help w/b appreciated.</p>
[ { "answer_id": 365053, "author": "Tom", "author_id": 13219, "author_profile": "https://Stackoverflow.com/users/13219", "pm_score": 3, "selected": true, "text": "SELECT ItemID FROM Table\nEXCEPT\nSELECT ItemID FROM Table\nWHERE\nCategoryID <> 12\n" }, { "answer_id": 365059, "a...
2008/12/13
[ "https://Stackoverflow.com/questions/365045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32303/" ]
365,048
<p>why this is happen ?</p> <p>When u create abstract class in c++ Ex: <strong>Class A</strong> (which has a pure virtual function) after that <strong>class B</strong> is inherited from class <strong>A</strong> </p> <p>And if <strong>class A</strong> has constructor called <strong>A()</strong> suppose i created an <strong>Object</strong> of <strong>class B</strong> then the compiler initializes the base class first i.e.<strong>class A</strong> and then initialize the <strong>class B</strong> Then.......?</p> <p>First thing is we can not access a constructor of any class without an Object then how it is initialize the constructor of abstract class if we can not create an object of abstract class .</p>
[ { "answer_id": 365054, "author": "dalle", "author_id": 19100, "author_profile": "https://Stackoverflow.com/users/19100", "pm_score": 2, "selected": false, "text": "class A" }, { "answer_id": 365073, "author": "Drakosha", "author_id": 19868, "author_profile": "https://...
2008/12/13
[ "https://Stackoverflow.com/questions/365048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45934/" ]
365,058
<p>How can I detect, or be notified, when windows is logging out in python?</p> <p>Edit: Martin v. Löwis' answer is good, and works for a full logout but it does not work for a 'fast user switching' event like pressing win+L which is what I really need it for. <br /><br />Edit: im not using a gui this is running as a service</p>
[ { "answer_id": 365232, "author": "ChrisN", "author_id": 3853, "author_profile": "https://Stackoverflow.com/users/3853", "pm_score": 4, "selected": true, "text": "win32ts" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115/" ]
365,071
<p>I have a form in Axapta/Dynamics Ax (EmplTable) which has two data sources (EmplTable and HRMVirtualNetworkTable) where the second data source (HRMVirtualNetworkTable) is linked to the first on with "Delayed" link type.</p> <p>Is there a way to set an filter on the records, based on the second data source, without having to change the link type to "InnerJoin"?</p>
[ { "answer_id": 1097783, "author": "Jan B. Kjeldsen", "author_id": 4509, "author_profile": "https://Stackoverflow.com/users/4509", "pm_score": 4, "selected": true, "text": "static void updateJoinMode(QueryBuildDataSource qds)\n{\n Counter r;\n if (qds)\n {\n qds.joinMode(J...
2008/12/13
[ "https://Stackoverflow.com/questions/365071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19808/" ]
365,082
<p>As the title suggests. I want to be able to change the label of a single field in the admin application. I'm aware of the Form.field attribute, but how do I get my Model or ModelAdmin to pass along that information?</p>
[ { "answer_id": 14743532, "author": "Seperman", "author_id": 1497443, "author_profile": "https://Stackoverflow.com/users/1497443", "pm_score": 5, "selected": false, "text": "class Person(models.Model):\n ...\n\n def address_report(self, instance):\n ...\n # short_descripti...
2008/12/13
[ "https://Stackoverflow.com/questions/365082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10583/" ]
365,086
<p>How can I project the row number onto the linq query result set.</p> <p>Instead of say:</p> <p>field1, field2, field3</p> <p>field1, field2, field3</p> <p>I would like:</p> <p>1, field1, field2, field3</p> <p>2, field1, field2, field3</p> <p>Here is my attempt at this:</p> <pre><code>public List&lt;ScoreWithRank&gt; GetHighScoresWithRank(string gameId, int count) { Guid guid = new Guid(gameId); using (PPGEntities entities = new PPGEntities()) { int i = 1; var query = from s in entities.Scores where s.Game.Id == guid orderby s.PlayerScore descending select new ScoreWithRank() { Rank=i++, PlayerName = s.PlayerName, PlayerScore = s.PlayerScore }; return query.ToList&lt;ScoreWithRank&gt;(); } } </code></pre> <p>Unfortunately, the "Rank=i++" line throws the following compile-time exception:</p> <p>"An expression tree may not contain an assignment operator"</p>
[ { "answer_id": 365127, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 6, "selected": false, "text": "public List<ScoreWithRank> GetHighScoresWithRank(string gameId, int count)\n{\n Guid guid = new Guid(gameId);\n us...
2008/12/13
[ "https://Stackoverflow.com/questions/365086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42818/" ]
365,087
<p>I m using a dropdown to display "Location" field of a table. I want to set first item of dropdowm as "-Select Location-". I can't set tables first record as "Select" because table is stroed in xml format. And table file is generated dynamicaly. I am currentaly using as</p> <pre><code> ddlLocationName.Dispose(); ddlLocationName.AppendDataBoundItems = true; ddlLocationName.Items.Add("Select Location"); ddlLocationName.DataSource = _section.GetLocations(); ddlLocationName.DataBind(); ddlLocationName.AppendDataBoundItems = false; </code></pre> <p>but data is binded repeatedly. What will be the solution for this problem? Thaks in advance.</p>
[ { "answer_id": 365092, "author": "Samiksha", "author_id": 29515, "author_profile": "https://Stackoverflow.com/users/29515", "pm_score": 0, "selected": false, "text": "ListItem li = new ListItem(\"Select Location\",\"-1\");\nddlLocationName.Items.Add(li);\n" }, { "answer_id": 3650...
2008/12/13
[ "https://Stackoverflow.com/questions/365087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43886/" ]
365,094
<p>I've been using <a href="http://www.rainlendar.net" rel="noreferrer">Rainlendar</a> for some time and I noticed that it has an option to put the window "on desktop". It's like a bottomMost window (as against topmost).</p> <p>How could I do this on a WPF app?</p> <p>Thanks</p>
[ { "answer_id": 365270, "author": "Artur Carvalho", "author_id": 1013, "author_profile": "https://Stackoverflow.com/users/1013", "pm_score": 3, "selected": false, "text": " using System;\n using System.Runtime.InteropServices;\n using System.Windows;\n using System.Windows.Inte...
2008/12/13
[ "https://Stackoverflow.com/questions/365094", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1013/" ]
365,095
<p>How do you make the authentication for a browser-based application dependent on the client machine? Say the admin can login only from <b>this</b> machine.</p> <p>Assumptions: There is complete control over the network and all machines (client and server) involved.</p> <p>I am looking for an apache/linux solution.</p>
[ { "answer_id": 365102, "author": "The Archetypal Paul", "author_id": 21755, "author_profile": "https://Stackoverflow.com/users/21755", "pm_score": 3, "selected": true, "text": " <Directory \"/www/hidden/docs\">\n" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365095", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17404/" ]
365,100
<p>I keep on hearing this words '<strong>callback</strong>' and '<strong>postback</strong>' tossed around.<br> What is the difference between two ? </p> <p>Is postback very specific to the ASP.NET pages ?</p>
[ { "answer_id": 365106, "author": "Andreas Grech", "author_id": 44084, "author_profile": "https://Stackoverflow.com/users/44084", "pm_score": 9, "selected": true, "text": "<form>" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365100", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41968/" ]
365,103
<p>I want to profile (keep an Eye on) all the activities that goes on in a Database which is in PostgreSQL.</p> <p>Is there any such utility which will help me do this?</p>
[ { "answer_id": 365112, "author": "mat", "author_id": 42083, "author_profile": "https://Stackoverflow.com/users/42083", "pm_score": 3, "selected": false, "text": "pg_catalog" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45951/" ]
365,125
<p>As part of a VBA program, I have to set the background colors of certain cells to green, yellow or red, based on their values (basically a health monitor where green is okay, yellow is borderline and red is dangerous).</p> <p>I know how to set the values of those cells, but how do I set the background color.</p>
[ { "answer_id": 365131, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 7, "selected": true, "text": "ActiveCell.Interior.ColorIndex = 28\n" }, { "answer_id": 60529043, "author": "Matt G", "author_id": 8...
2008/12/13
[ "https://Stackoverflow.com/questions/365125", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14860/" ]
365,155
<p>I want a simple tutorial to show me how to load a yaml file and parse the data. Expat style would be great but any solution that actually shows me the data in some form would be useful.</p> <p>So far I ran multiple tests in the <code>yaml-0.1.1</code> source code for C and I either get an error, no output whatsoever, or in the <code>run-emitter.c</code> case. It reads in the yaml file and prints it to <code>STDOUT</code>, it does not produce the text via <code>libyaml</code> functions/structs. In the cases with an error I don't know if it was because the file was bad or my build is incorrect (I didn't modify anything...) The file was copied from yaml.org</p> <p>Can anyone point me to a tutorial? (I googled for at least 30 minutes reading anything that looked relevant) or a name of a lib that has a good tutorial or example. Maybe you can tell me which <code>libyaml</code> test loads in files and does something with it or why I got errors. This document does not explain how to <em>use</em> the file--only how to load it:</p> <p><a href="http://pyyaml.org/wiki/LibYAML#Documentation" rel="nofollow noreferrer">http://pyyaml.org/wiki/LibYAML#Documentation</a></p>
[ { "answer_id": 365230, "author": "jfs", "author_id": 4279, "author_profile": "https://Stackoverflow.com/users/4279", "pm_score": 3, "selected": false, "text": "#include <iyaml++.hh>\n#include <tr1/memory>\n#include <iostream>\n#include <stdexcept>\n\nusing namespace std;\n\n// What shoul...
2008/12/13
[ "https://Stackoverflow.com/questions/365155", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
365,168
<p>Since I kicked off the process of inserting 7M rows from one table into two others, I'm wondering now if there's a faster way to do this. The process is expected to finish in an hour, that's 24h of processing.</p> <p>Here's how it goes:</p> <p>The data from this table</p> <pre><code>RAW (word VARCHAR2(4000), doc VARCHAR2(4000), count NUMBER); </code></pre> <p>should find a new home in two other cluster tables T1 and T2</p> <pre><code>CREATE CLUSTER C1 (word VARCHAR2(4000)) SIZE 200 HASHKEYS 10000000; CREATE CLUSTER C2 (doc VARCHAR2(4000)) SIZE 200 HASHKEYS 10000000; T1 (word VARCHAR2(4000), doc VARCHAR2(4000), count NUMBER) CLUSTER C1(word); T2 (doc VARCHAR2(4000), word VARCHAR2(4000), count NUMBER) CLUSTER C2(doc); </code></pre> <p>through Java inserts with manual commit like this</p> <pre><code>stmtT1 = conn.prepareStatement("insert into T1 values(?,?,?)"); stmtT2 = conn.prepareStatement("insert into T2 values(?,?,?)"); rs = stmt.executeQuery("select word, doc, count from RAW"); conn.setAutoCommit(false); while (rs.next()) { word = rs.getString(1); doc = rs.getString(2); count = rs.getInt(3); if (commitCount++==10000) { conn.commit(); commitCount=0; } stmtT1.setString(1, word); stmtT1.setString(2, doc); stmtT1.setInt(3, count); stmtT2.setString(1, doc); stmtT2.setString(2, word); stmtT2.setInt(3,count); stmtT1.execute(); stmtT2.execute(); } conn.commit(); </code></pre> <p>Any ideas?</p>
[ { "answer_id": 368455, "author": "David Aldridge", "author_id": 6742, "author_profile": "https://Stackoverflow.com/users/6742", "pm_score": 1, "selected": false, "text": "insert all\ninto t1\ninto t2\nselect * from RAW\n/\n" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36942/" ]
365,191
<p>How to calculate minute difference between two date-times in PHP?</p>
[ { "answer_id": 365214, "author": "Oli", "author_id": 12870, "author_profile": "https://Stackoverflow.com/users/12870", "pm_score": 8, "selected": true, "text": "January 1, 1970, 00:00:00 GMT" }, { "answer_id": 365220, "author": "user38526", "author_id": 38526, "author...
2008/12/13
[ "https://Stackoverflow.com/questions/365191", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38940/" ]
365,204
<p>I am new to UserControls, and while developing my own control I found a problem with showing events of my control in the property grid at design time. If I have some events in my control I want to see them in Property grid and if I double-click that I want to have a handler, in the same way Microsoft does for its controls.</p>
[ { "answer_id": 365216, "author": "lc.", "author_id": 44853, "author_profile": "https://Stackoverflow.com/users/44853", "pm_score": 3, "selected": true, "text": "public" }, { "answer_id": 1079021, "author": "Filini", "author_id": 21162, "author_profile": "https://Stack...
2008/12/13
[ "https://Stackoverflow.com/questions/365204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45648/" ]
365,208
<p>Do you have any experience with <a href="http://www.olegsych.com/2007/12/text-template-transformation-toolkit/" rel="nofollow noreferrer">T4</a> and <a href="http://www.t4editor.net/" rel="nofollow noreferrer">T4 Editor</a>? Can you compare it to <a href="http://www.codesmithtools.com/" rel="nofollow noreferrer">CodeSmith</a> or <a href="http://www.mygenerationsoftware.com/" rel="nofollow noreferrer">MyGeneration</a>?</p> <p>What code generators do you use? What do you recommend?</p> <p>I want to use it for generatig of SPs. Is there anything else you find code generation useful?</p>
[ { "answer_id": 365211, "author": "Andreas Grech", "author_id": 44084, "author_profile": "https://Stackoverflow.com/users/44084", "pm_score": 1, "selected": false, "text": "tab tab" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365208", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19712/" ]
365,219
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/12249056/executing-sql-server-agent-job-from-a-stored-procedure-and-returning-job-result">Executing SQL Server Agent Job from a stored procedure and returning job result</a> </p> </blockquote> <p>Is there a way to determine when a sql agent job as finished once it has been started with sp_start_job?</p>
[ { "answer_id": 365250, "author": "gbn", "author_id": 27535, "author_profile": "https://Stackoverflow.com/users/27535", "pm_score": 2, "selected": false, "text": "XP_SQLAGENT_ENUM_JOBS" }, { "answer_id": 3104804, "author": "Maashu", "author_id": 222489, "author_profile...
2008/12/13
[ "https://Stackoverflow.com/questions/365219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1200558/" ]
365,222
<p>I have a base recipe class and I am using a datacontext. I overrode the insert method for the recipe in the datacontext and am trying to insert into its children. Nomatter what I do I cannot get the child to insert.Currently, just the recipe inserts and nothing happens with the child.</p> <pre><code> partial void InsertRecipe(Recipe instance) { // set up the arrays for (int x = 0; x &lt; instance.PlainIngredients.Count; ++x) { instance.TextIngredients.Add(new TextIngredient() { StepNumber = x + 1, Text = instance.PlainIngredients[x] }); } this.ExecuteDynamicInsert(instance); } </code></pre> <p>I have tried everything I can think of. I even instantiated another datacontext in the method and after the instance came back from ExecuteDynamicInsert with the id, tried to add it, and I get timeout errors.</p>
[ { "answer_id": 367299, "author": "Matthew Kruskamp", "author_id": 22521, "author_profile": "https://Stackoverflow.com/users/22521", "pm_score": 3, "selected": true, "text": " public override void SubmitChanges(\n System.Data.Linq.ConflictMode failureMode)\n {\n Change...
2008/12/13
[ "https://Stackoverflow.com/questions/365222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22521/" ]
365,223
<p>Is there a way to programmatically disable usb storage devices from working while still keeping usb ports functional for other types of devices like keyboards and mice?</p>
[ { "answer_id": 365245, "author": "PabloG", "author_id": 394, "author_profile": "https://Stackoverflow.com/users/394", "pm_score": 4, "selected": true, "text": "Directions for Use:\n\n1.) Take the following blue text, copy it, and paste it into a text document. Then, save it as USBSTOR...
2008/12/13
[ "https://Stackoverflow.com/questions/365223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41630/" ]
365,224
<p>Pour in your posts. I'll start with a couple, let us see how much we can collect.</p> <p>To provide inline event handlers like</p> <pre><code>button.Click += (sender,args) =&gt; { }; </code></pre> <p>To find items in a collection</p> <pre><code> var dogs= animals.Where(animal =&gt; animal.Type == "dog"); </code></pre> <p>For iterating a collection, like</p> <pre><code> animals.ForEach(animal=&gt;Console.WriteLine(animal.Name)); </code></pre> <p>Let them come!!</p>
[ { "answer_id": 365228, "author": "Andreas Grech", "author_id": 44084, "author_profile": "https://Stackoverflow.com/users/44084", "pm_score": 3, "selected": true, "text": "var dude = mySource.Select(x => new {Name = x.name, Surname = x.surname});\n" }, { "answer_id": 365256, "...
2008/12/13
[ "https://Stackoverflow.com/questions/365224", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45956/" ]
365,249
<p>when a System.Web.HttpResponse.End() is called a System.Thread.Abort is being fired, which i'm guessing is (or fires) an exception? I've got some logging and this is being listed in the log file...</p> <p>A first chance </p> <pre><code>exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll 12/14/2008 01:09:31:: Error in Path :/authenticate Raw Url :/authenticate Message :Thread was being aborted. Source :mscorlib Stack Trace : at System.Threading.Thread.AbortInternal() at System.Threading.Thread.Abort(Object stateInfo) at System.Web.HttpResponse.End() at DotNetOpenId.Response.Send() at DotNetOpenId.RelyingParty.AuthenticationRequest.RedirectToProvider() at MyProject.Services.Authentication.OpenIdAuthenticationService.GetOpenIdPersonaDetails(Uri serviceUri) in C:\Users\Pure Krome\Documents\Visual Studio 2008\Projects\MyProject\Projects\Services\Authentication\OpenIdAuthenticationService.cs:line 108 at MyProject.Mvc.Controllers.AuthenticationController.Authenticate() in C:\Users\Pure Krome\Documents\Visual Studio 2008\Projects\MyProject\Projects\MVC Application\Controllers\AuthenticationController.cs:line 69 TargetSite :Void AbortInternal() A first chance exception of type 'System.Threading.ThreadAbortException' occurred in Ackbar.Mvc.DLL An exception of type 'System.Threading.ThreadAbortException' occurred in Ackbar.Mvc.DLL but was not handled in user code </code></pre> <p>Is this normal behavior and is it possible to gracefully abort instead of (what looks like) a sudden abrupt abort?</p> <h2>Update</h2> <p>So far it the common census that it's <a href="http://msdn.microsoft.com/en-us/library/system.web.httpresponse.end.aspx" rel="noreferrer">by design</a>. So i'm wondering if it's possible we could take this question and see if we could tweak the code to make it not feel like we're ending the thread <em>prematurely</em> and gracefully exit ... Possible? Code examples?</p>
[ { "answer_id": 365552, "author": "Peter Oehlert", "author_id": 44656, "author_profile": "https://Stackoverflow.com/users/44656", "pm_score": 2, "selected": false, "text": "catch(Exception e) { // log exception and then do not throw again }" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365249", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30674/" ]
365,259
<p>I want to search for a line in a file, using regex, inside a Perl script.</p> <p>Assuming it is in a system with grep installed, is it better to:</p> <ul> <li>call the external <code>grep</code> through an <code>open()</code> command</li> <li><code>open()</code> the file directly and use a <code>while</code> loop and an <code>if ($line =~ m/regex/)</code>?</li> </ul>
[ { "answer_id": 365403, "author": "Adrian Pronk", "author_id": 41861, "author_profile": "https://Stackoverflow.com/users/41861", "pm_score": 3, "selected": false, "text": "LANG= LANGUAGE= /bin/grep\n" }, { "answer_id": 365410, "author": "Dave Sherohman", "author_id": 18914...
2008/12/13
[ "https://Stackoverflow.com/questions/365259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15884/" ]
365,261
<p>For desktop application that is. This is just a general question that maybe only need general answers.</p>
[ { "answer_id": 365613, "author": "Norman Ramsey", "author_id": 41661, "author_profile": "https://Stackoverflow.com/users/41661", "pm_score": 4, "selected": false, "text": "typedef struct Pnmrdr_T *Pnmrdr_T;\n\nstruct Pnmrdr_T *Pnmrdr_new(FILE *);\npixel Pnmrdr_get(Pnmrdr_T);\nvoid Pnmrdr...
2008/12/13
[ "https://Stackoverflow.com/questions/365261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38515/" ]
365,284
<p>When you rotate an image using canvas, it'll get cut off - how do I avoid this? I already made the canvas element bigger then the image, but it's still cutting off the edges.</p> <p>Example:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;test&lt;/title&gt; &lt;script type="text/javascript"&gt; function startup() { var canvas = document.getElementById('canvas'); var ctx = canvas.getContext('2d'); var img = new Image(); img.src = 'player.gif'; img.onload = function() { ctx.rotate(5 * Math.PI / 180); ctx.drawImage(img, 0, 0, 64, 120); } } &lt;/script&gt; &lt;/head&gt; &lt;body onload='startup();'&gt; &lt;canvas id="canvas" style="position: absolute; left: 300px; top: 300px;" width="800" height="800"&gt;&lt;/canvas&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
[ { "answer_id": 365292, "author": "Vincent Ramdhanie", "author_id": 27439, "author_profile": "https://Stackoverflow.com/users/27439", "pm_score": 4, "selected": true, "text": "ctx.translate(85, 85);\nctx.rotate(5 * Math.PI / 180);\n" }, { "answer_id": 1015486, "author": "Commu...
2008/12/13
[ "https://Stackoverflow.com/questions/365284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45974/" ]
365,312
<p>I have the following XML document:</p> <pre><code>&lt;projects&gt; &lt;project&gt; &lt;name&gt;Shockwave&lt;/name&gt; &lt;language&gt;Ruby&lt;/language&gt; &lt;owner&gt;Brian May&lt;/owner&gt; &lt;state&gt;New&lt;/state&gt; &lt;startDate&gt;31/10/2008 0:00:00&lt;/startDate&gt; &lt;/project&gt; &lt;project&gt; &lt;name&gt;Other&lt;/name&gt; &lt;language&gt;Erlang&lt;/language&gt; &lt;owner&gt;Takashi Miike&lt;/owner&gt; &lt;state&gt; Canceled &lt;/state&gt; &lt;startDate&gt;07/11/2008 0:00:00&lt;/startDate&gt; &lt;/project&gt; ... </code></pre> <p>And I'd like to get this from the transformation (XSLT) result:</p> <pre><code>Shockwave,Ruby,Brian May,New,31/10/2008 0:00:00 Other,Erlang,Takashi Miike,Cancelled,07/11/2008 0:00:00 </code></pre> <p>Does anyone know the XSLT to achieve this? I'm using .net in case that matters.</p>
[ { "answer_id": 365338, "author": "schnaader", "author_id": 34065, "author_profile": "https://Stackoverflow.com/users/34065", "pm_score": 7, "selected": true, "text": "<xsl:stylesheet version=\"1.0\"\nxmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n<xsl:output method=\"text\" encodin...
2008/12/13
[ "https://Stackoverflow.com/questions/365312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7595/" ]
365,339
<p>We currently send an email notification in plain text or html format. Our environment is C#/.NET/SQL Server.</p> <p>I'd like to know if anyone recommends a particular solution. I see two ways of doing this:</p> <ul> <li>dynamically convert current email to pdf using a third party library and sending the pdf as an attachment</li> </ul> <p>or </p> <ul> <li>use SSRS to allow users to export pdf report (could eventually have SSRS push reports)</li> </ul> <p>I'm open to third party libraries (especially if they are open source and free). It seems that SSRS is the simplest and easiest way to go. Anyone have any tips?</p>
[ { "answer_id": 365398, "author": "Darin Dimitrov", "author_id": 29407, "author_profile": "https://Stackoverflow.com/users/29407", "pm_score": 3, "selected": true, "text": "class Program\n{\n static void Main(string[] args)\n {\n string html = \n@\"<html>\n<head>\n <meta htt...
2008/12/13
[ "https://Stackoverflow.com/questions/365339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36902/" ]
365,352
<p>It is not uncommon for me (or likely anyone else) to have a list of objects I need to iterate through and then interact with a list of properties. I use a nested loop, like this:</p> <pre><code>IList&lt;T&gt; listOfObjects; IList&lt;TProperty&gt; listOfProperties; foreach (T dataObject in listOfObjects) { foreach (TProperty property in listOfProperties) { //do something clever and extremely useful here } } </code></pre> <p>Is this the time and performance tested pattern for this problem? Or is there something more performant, more elegant, or just plain fun (while still being readable and maintainable of course)?</p> <p>The code above doesn't make me smile. Can someone please help bring some joy to my loop?</p> <p>Thank you!</p> <p>Update: I use the term "nerd" in a most positive sense. As part of the wikipedia definition puts it "that refers to a person who passionately pursues intellectual activities". By "code nerd" I mean someone who is concerned about continually improving oneself as a programmer, finding new, novel, and elegant ways of coding that are fast, maintainable, and beautiful! They rejoice to move out of VB6 and want smart people to critique their code and help them smartify themselves. (Note: they also like to make new words that end in -ify).</p> <p>Final note:</p> <p>Thank you to Dave R, Earwicker, and TheSoftwareJedi for sending me down the Linq path. It is just the sort of happy code I was looking for!</p>
[ { "answer_id": 365360, "author": "Serge Wautier", "author_id": 12379, "author_profile": "https://Stackoverflow.com/users/12379", "pm_score": 0, "selected": false, "text": "foreach (T dataObject in listOfObjects)\n{ \n foreach (TProperty property in listOfProperties) \n {\n if ...
2008/12/13
[ "https://Stackoverflow.com/questions/365352", "https://Stackoverflow.com", "https://Stackoverflow.com/users/620435/" ]
365,353
<ol> <li>In WordPress, how do I hide a Page?</li> <li>How do I then reimplement it as a DIV, let's say, on another Page?</li> </ol> <p><strong>Context</strong></p> <p>I'm trying to get some year-end tax write-offs here for my freelance business, and so I'm donating WordPress sites to churches. Now, unfortunately I'm finding that several pastors don't understand computers that well, and even though WordPress is fairly easy to tech guys like you and me, they get a bit confused. Therefore, I commented out Posts, Comments, Plugins, Widgets, Users, Design, and left nothing but Pages (New, Edit, Delete) and Media Gallery. I then took a theme that showed the Pages as tabs at the top like a normal website.</p> <p>My hope is to call a particular page like Sidebar1 as its title. However, instead of this being displayed as a tab, it will be hidden. Then, it will be reimplemented as a DIV inside the page titled Home. If the pastor accidentally deletes Sidebar1, all he has to do is recreate it again and poof it reappears.</p> <p>This doesn't deal with the Wordpress website, but the Wordpress installation.</p> <p>I've changed the admin -- I just need to change the front-end.</p> <p>I could figure this out on my own, but in the interest of time I wondered if someone had already done this?</p> <p>Your help could help me get this done just in time for Christmas for some area churches here. Thank you.</p>
[ { "answer_id": 366756, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "wp_list_pages('sort_column=menu_order&exclude=3&title_li=');\n" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
365,370
<p>I am currently using TcpListener to address incoming connections, each of which are given a thread for handling the communication and then shutdown that single connection. Code looks as follows:</p> <pre><code>TcpListener listener = new TcpListener(IPAddress.Any, Port); System.Console.WriteLine("Server Initialized, listening for incoming connections"); listener.Start(); while (listen) { // Step 0: Client connection TcpClient client = listener.AcceptTcpClient(); Thread clientThread = new Thread(new ParameterizedThreadStart(HandleConnection)); clientThread.Start(client.GetStream()); client.Close(); } </code></pre> <p>The <code>listen</code> variable is a boolean that is a field on the class. Now, when the program shuts down I want it to stop listening for clients. Setting listen to <code>false</code> will prevent it from taking on more connections, but since <code>AcceptTcpClient</code> is a blocking call, it will at minimum take the next client and THEN exit. Is there any way to force it to simply break out and stop, right then and there? What effect does calling listener.Stop() have while the other blocking call is running?</p>
[ { "answer_id": 365533, "author": "Peter Oehlert", "author_id": 44656, "author_profile": "https://Stackoverflow.com/users/44656", "pm_score": 7, "selected": true, "text": "TcpListener" }, { "answer_id": 365664, "author": "Dzmitry Huba", "author_id": 45943, "author_prof...
2008/12/13
[ "https://Stackoverflow.com/questions/365370", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9479/" ]
365,371
<p>I can't figure out how to achieve the following layout with CSS (probably because I don't actually know CSS).</p> <p>I have a bunch of divs like this:</p> <pre><code>&lt;div class="right"&gt; &lt;p&gt;1&lt;/p&gt; &lt;/div&gt; &lt;div class="left"&gt; &lt;p&gt;2&lt;/p&gt; &lt;/div&gt; &lt;div class="left"&gt; &lt;p&gt;3&lt;/p&gt; &lt;/div&gt; &lt;div class="left"&gt; &lt;p&gt;4&lt;/p&gt; &lt;/div&gt; &lt;div class="right"&gt; &lt;p&gt;5&lt;/p&gt; &lt;/div&gt; &lt;div class="right"&gt; &lt;p&gt;6&lt;/p&gt; &lt;/div&gt; </code></pre> <p>(not the real contents)</p> <p>Now I want the layout to look like two equal columns of divs, with the "right" ones on the right, and the "left" ones on the left, thus:</p> <pre><code>2 1 3 5 4 6 </code></pre> <p>[<strong>Edit: In a previous version of this question I had textareas inside the divs, and the divs all had different names like "one" and "xyz".</strong>] I tried something like</p> <pre><code>div.right { width:50%; float:right; clear:right; } div.left { width:50%; float:left; clear:left;} </code></pre> <p>but it doesn't quite work: It produces something like:</p> <pre><code>2 1 3 4 5 6 </code></pre> <p>(without the "clear"s, it blithely produces </p> <pre><code>2 1 3 4 6 5 </code></pre> <p>which is not what is wanted).</p> <p>It is apparent that it can be made to work if the divs are ordered differently, but I'd like not to do that (because these divs are generated dynamically if the browser has Javascript, and I don't want to change the actual order that is displayed in the absence of Javascript, for semantic reasons). Is it still possible to achieve the layout I want?</p> <p>[For what it's worth, I'm willing to have it not work on IE or older versions of other browsers, so if there is a solution that works only on standards-compliant browsers, that's okay :-)]</p>
[ { "answer_id": 365407, "author": "dave mankoff", "author_id": 10093, "author_profile": "https://Stackoverflow.com/users/10093", "pm_score": 2, "selected": false, "text": "div {\n width: 198px;\n border: 1px solid black;\n}\ndiv.onediv, div.tendiv, div.xyzdiv { float: right; }\ndiv.twod...
2008/12/13
[ "https://Stackoverflow.com/questions/365371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4958/" ]
365,376
<p>I use a basic Post to send data to a Django server.</p> <p>The data consists of a base64 encoded 640*380 PNG image dynamically created by the flex component.</p> <pre><code>&lt;mx:HTTPService id="formSend" showBusyCursor="true" useProxy="false" url="http://127.0.0.1/form/" method="POST" result="formSentConfirmation(event)" fault="formSendingFailed(event)"/&gt; private function sendForm(url:String, message:String, meteo:Number):void { formSend.url = url; var params:Object = { message: message, image_data: getEncodedImage() }; snapButton.label = "sending ..."; formSend.send(params); } </code></pre> <p>On the server side i can see that the data is in the request.POST not in request.FILES. That means the image is not send as a File with multiencode HTTP.</p> <ol> <li><p>Will i get into trouble on a real server ? since the limit is 200k for urlencoded POST var.</p></li> <li><p>How to make HTTPservice send the data as a file?</p></li> <li><p>Any other solutions?</p></li> </ol> <p>Thanks</p>
[ { "answer_id": 1471859, "author": "franckyfranck", "author_id": 177787, "author_profile": "https://Stackoverflow.com/users/177787", "pm_score": 2, "selected": false, "text": "var urlLoader:URLLoader = new URLLoader();\n urlLoader.dataFormat = URLLoaderDataFormat.BINARY;\n urlLoader...
2008/12/13
[ "https://Stackoverflow.com/questions/365376", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32032/" ]
365,380
<p>I was wondering if InnoDB would be the best way to format the table? The table contains one field, primary key, and the table will get 816k rows a day (est.). This will get very large very quick! I'm working on a file storage way (would this be faster)? The table is going to store ID numbers of Twitter Ids that have already been processed?</p> <p>Also, any estimated memory usage on a <code>SELECT min('id')</code> statement? Any other ideas are greatly appreciated!</p>
[ { "answer_id": 365405, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "SELECT min('id')" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45530/" ]
365,382
<p>How do you rotate an image with the canvas html5 element from the bottom center angle?</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;test&lt;/title&gt; &lt;script type="text/javascript"&gt; function startup() { var canvas = document.getElementById('canvas'); var ctx = canvas.getContext('2d'); var img = new Image(); img.src = 'player.gif'; img.onload = function() { ctx.translate(185, 185); ctx.rotate(90 * Math.PI / 180); ctx.drawImage(img, 0, 0, 64, 120); } } &lt;/script&gt; &lt;/head&gt; &lt;body onload='startup();'&gt; &lt;canvas id="canvas" style="position: absolute; left: 300px; top: 300px;" width="800" height="800"&gt;&lt;/canvas&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Unfortunately this seems to rotate it from the top left angle of the image. Any idea?</p> <p>Edit: in the end the object (space ship) has to rotate like a clock pointer, as if it is turning right/left.</p>
[ { "answer_id": 365418, "author": "Vincent Ramdhanie", "author_id": 27439, "author_profile": "https://Stackoverflow.com/users/27439", "pm_score": 6, "selected": true, "text": "ctx.translate(32, 120);\n" }, { "answer_id": 366362, "author": "PhiLho", "author_id": 15459, ...
2008/12/13
[ "https://Stackoverflow.com/questions/365382", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45974/" ]
365,391
<p>I'm trying to use an excel VB macro to download excel files from a membership password-protected site. I am using the "InternetExplorer" object to open a browser window, log-in and browse to the correct page, then scanning for the links I want in the page. Using the Workbooks.Open(URLstring) doesn't work because Excel isn't logged. Instead of the actual file, it opens the html page asking for the log-in.</p> <p>My preference would be to use the VB macro to automate the right-click "save target as" event in internet explorer on the correct link, but I don't know exactly how to do this.</p>
[ { "answer_id": 365644, "author": "Tmdean", "author_id": 45084, "author_profile": "https://Stackoverflow.com/users/45084", "pm_score": 1, "selected": false, "text": "Declare Sub Sleep Lib \"kernel32\" (ByVal dwMilliseconds As Long)\n...\nSub YourMacro()\n ... Navigate IE to the correct...
2008/12/13
[ "https://Stackoverflow.com/questions/365391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
365,395
<p>just a quick question, if I have a matrix has n rows and m columns, how can I cut off the 4 sides of the matrix and return a new matrix? (the new matrix would have n-2 rows m-2 columns).</p> <p>Thanks in advance</p>
[ { "answer_id": 365399, "author": "Mr Fooz", "author_id": 25050, "author_profile": "https://Stackoverflow.com/users/25050", "pm_score": 5, "selected": true, "text": "a[1:-1, 1:-1]\n" }, { "answer_id": 365983, "author": "jfs", "author_id": 4279, "author_profile": "https...
2008/12/13
[ "https://Stackoverflow.com/questions/365395", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44354/" ]
365,424
<p>I've written an Apache module in C. Under certain conditions, I can get it to segfault, but I have no idea as to why. At this point, it could be my code, it could be the way I'm compiling the program, or it could be a bug in the OS library (the segfault happens during a call to dlopen()).</p> <p>I've tried running through GDB and Valgrind with no success. GDB gives me a backtrace into the dlopen() system call that appears meaningless. In Valgrind, the bug actually seems to disappear or at least become non-reproducible. On the other hand, I'm a total novice when it comes to these tools.</p> <p>I'm a little new to production quality C programming (I started on C many years ago, but have never worked professionally with it.) What is the best way for me to go about learning the ropes of debugging programs? What other tools should I be investigating? In summary, how do you figure out how to tackle new bug challenges?</p> <p>EDIT: Just to clarify, I want to thank Sydius's and dmckee's input. I had taken a look at Apache's guide and am fairly familiar with dlopen (and dlsym and dlclose). My module works for the most part (it's at about 3k lines of code and, as long as I don't activate this one section, things seem to work just fine.)</p> <p>I guess this is where my original question comes from - I don't know what to do next. I know I haven't used GDB and Valgrind to their full potential. I know that I may not be compiling with the exact right flags. But I'm having trouble figuring out more. I can find beginner's guides that tell me what I already know, and man pages that tell me more than I need to know but with no guidance.</p>
[ { "answer_id": 365539, "author": "dmckee --- ex-moderator kitten", "author_id": 2509, "author_profile": "https://Stackoverflow.com/users/2509", "pm_score": 2, "selected": false, "text": "dlopen()" }, { "answer_id": 365599, "author": "Norman Ramsey", "author_id": 41661, ...
2008/12/13
[ "https://Stackoverflow.com/questions/365424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10093/" ]
365,427
<p>I have problems with Boost.Spirit parsing a string. </p> <p>The string looks like </p> <pre><code>name1 has this and that.\n name 2 has this and that.\n na me has this and that.\n </code></pre> <p>and I have to extract the names. The text "has this and that" is always the same but the name can consist of spaces therefore I can't use graph_p. </p> <p>1) How do I parse such a string?</p> <p>Since the string has several lines of that format I have to store the names in a vector. </p> <p>I used something like </p> <pre><code>std::string name; rule&lt;&gt; r = *graph_p[append(name)]; </code></pre> <p>for saving one name but </p> <p>2) what's the best way to save several names in a vector?</p> <p>Thanks in advance</p> <p>Konrad</p>
[ { "answer_id": 365742, "author": "Mr.Ree", "author_id": 37946, "author_profile": "https://Stackoverflow.com/users/37946", "pm_score": 0, "selected": false, "text": "string s = \"na me has this and that.\\n\";\nmyVector . push_back( s.substr( 0, s.find( \"has this and that\" ) ) );\n" }...
2008/12/13
[ "https://Stackoverflow.com/questions/365427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
365,453
<p>Greetings!</p> <p>I'd like to investigate Django but I'm running Windows XP. I've installed XMPP and I currently have Python 2.6 installed (is it true that 2.5 is the only version that will work with XMPP?). What else do I need to get up and running? Any tips, recommended IDEs, etc? </p>
[ { "answer_id": 365464, "author": "Sam", "author_id": 428, "author_profile": "https://Stackoverflow.com/users/428", "pm_score": 2, "selected": false, "text": "@echo off\npython manage.py runserver\n" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365453", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27870/" ]
365,458
<p>Is there a way to identify at run-time of an executable is being run from within valgrind? I have a set of C++ unit tests, and one of them expects <code>std::vector::reserve</code> to throw <code>std::bad_alloc</code>. When I run this under valgrind, it bails out completely, preventing me from testing for both memory leaks (using valgrind) and behavior (expecting the exception to be thrown).</p> <p>Here's a minimal example that reproduces it:</p> <pre><code>#include &lt;vector&gt; int main() { size_t uint_max = static_cast&lt;size_t&gt;(-1); std::vector&lt;char&gt; v; v.reserve(uint_max); } </code></pre> <p>Running valgrind, I get this output:</p> <pre><code>Warning: silly arg (-1) to __builtin_new() new/new[] failed and should throw an exception, but Valgrind cannot throw exceptions and so is aborting instead. Sorry. at 0x40192BC: VALGRIND_PRINTF_BACKTRACE (valgrind.h:319) by 0x401C823: operator new(unsigned) (vg_replace_malloc.c:164) by 0x80487BF: std::vector&lt;char, std::allocator&lt;char&gt; &gt;::reserve(unsigned) new_allocator.h:92) by 0x804874D: main (vg.cxx:6) </code></pre> <p>I'd like to modify my unit test to simply skip the offending code when it's being run from within valgrind. Is this possible?</p>
[ { "answer_id": 365624, "author": "Norman Ramsey", "author_id": 41661, "author_profile": "https://Stackoverflow.com/users/41661", "pm_score": 1, "selected": false, "text": "MYAPP_UNIT_TESTS_DISABLED=\"NEW_MINUS_ONE,FLY_TO_MOON,DEREF_NULL\" valgrind myapp\n" }, { "answer_id": 36579...
2008/12/13
[ "https://Stackoverflow.com/questions/365458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40620/" ]
365,460
<p>I want to select an option in select tag through the value. - javascript</p> <pre><code>var selectbox=document.getElementById("Lstrtemplate"); var TemplateName=selectbox.options[selectbox.selectedIndex].text; </code></pre> <p>Now i am having the option text in TemplateName, using this i want to update an another select tag, which is having the same text.. </p> <p>But dont want to use index or id.. </p> <p>Want to achieve only by the value</p> <p>Please help me</p>
[ { "answer_id": 365463, "author": "Andreas Grech", "author_id": 44084, "author_profile": "https://Stackoverflow.com/users/44084", "pm_score": 1, "selected": false, "text": "var TemplateName = selectbox.options[selectbox.selectedIndex].value;\n" }, { "answer_id": 365468, "autho...
2008/12/13
[ "https://Stackoverflow.com/questions/365460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38172/" ]
365,472
<p>I get the above error whenever I try and use ActionLink ? I've only just started playing around with MVC and don't really understand what it's problem is with the code (below):</p> <pre><code>&lt;%= Html.ActionLink("Lists", "Index", "Lists"); %&gt; </code></pre> <p>This just seems to be a parsing issue but it only happens when I run the page. The application builds perfectly fine, so I really don't get it because the error is a compilation error? If I take line 25 out it will happen on the next line instead...</p> <pre><code> Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS1026: ) expected Source Error: Line 23: &lt;/div&gt; Line 24: Line 25: &lt;%= Html.ActionLink("Lists", "Index", "Lists"); %&gt; Line 26: &lt;a href="&lt;%= Url.Action("/", "Lists"); %&gt;"&gt;Click here to view your lists&lt;/a&gt; Line 27: Source File: d:\Coding\Playground\HowDidYouKnowMVCSoln\HowDidYouKnowMVC\Views\Home\Index.aspx Line: 25 </code></pre>
[ { "answer_id": 365478, "author": "maxnk", "author_id": 45862, "author_profile": "https://Stackoverflow.com/users/45862", "pm_score": 3, "selected": false, "text": "<%= Html.ActionLink(\"Lists\", \"Index\", \"Lists\") %>\n" }, { "answer_id": 365480, "author": "Mike Scott", ...
2008/12/13
[ "https://Stackoverflow.com/questions/365472", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26081/" ]
365,482
<p>What is the difference between ArrayList and List in VB.NET</p>
[ { "answer_id": 365494, "author": "arul", "author_id": 15409, "author_profile": "https://Stackoverflow.com/users/15409", "pm_score": 4, "selected": false, "text": "List<string> strList; // can store only strings\nList<int> intList; // can store only ints\nArrayList someList; // can store ...
2008/12/13
[ "https://Stackoverflow.com/questions/365482", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38997/" ]
365,487
<p>Everyday I receive thousands of emails and I want to parse the content/body of these emails to load them into a database.</p> <p>My problem is that nowadays I am parsing the email body manually and I would like to change the logic to a <strong>Regular Expression in C#.</strong></p> <p>Here is the body of the emails:</p> <hr> <p>Gentilissima Agenzia Nexity Residenziale</p> <p>il nostro utente:</p> <p>Sig./Sig.ra :<strong>Pablo Azorin</strong></p> <p>Email: <strong>pabloazorin@gmail.com</strong></p> <p>Tel.: <strong>02322-498900</strong></p> <p>sta cercando un immobile con le seguenti caratteristiche:</p> <p>Categoria: <strong>Residenziale</strong></p> <p>Tipologia: <strong>Villa</strong></p> <p>Tipo di contratto: <strong>Vendita</strong></p> <p>Comune: Assago Prov. <strong>Milano</strong></p> <p>Zona: <strong>non specificata</strong></p> <p>Fascia di prezzo: <strong>non specificata</strong></p> <hr> <p>I need to extract the text in bold and I thought a RegEx is what I need for this...</p> <p>Looking forward to get your suggestion about how to make it works.</p> <p>Thanks!</p> <p><strong>--Pablo</strong></p>
[ { "answer_id": 366545, "author": "Jan Goyvaerts", "author_id": 33358, "author_profile": "https://Stackoverflow.com/users/33358", "pm_score": 2, "selected": false, "text": "Sig\\./Sig\\.ra :(.*)\n\nEmail: (.*)\n\nTel\\.: (.*)\n\nsta cercando un immobile con le seguenti caratteristiche:\n\...
2008/12/13
[ "https://Stackoverflow.com/questions/365487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
365,489
<p>My company is about to hire <strong>.NET developers</strong>. We work on a variety of .NET platforms: ASP.NET, Compact Framework, Windowsforms, Web Services. I'd like to compile a list/catalog of good questions, a kind of minimum standard to see if the applicants are experienced. So, my question is:</p> <p><strong>What questions</strong> do you think should a good <strong>.NET programmer be able to respond</strong>?</p> <p>I'd also see it as a <strong>checklist</strong> for myself, in order to see where my own deficits are <em>(there are many...)</em>.</p> <p><img src="https://i.imgur.com/Xo2yI.png" alt="alt text"></p> <p>*UPDATE: It want to make clear that we're not testing only for .NET knowledge, and that problem solving capabilities and general programming skills are even more important to us. </p>
[ { "answer_id": 366377, "author": "splattne", "author_id": 6461, "author_profile": "https://Stackoverflow.com/users/6461", "pm_score": 7, "selected": false, "text": "a.Equals(b)" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365489", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6461/" ]
365,495
<p>I have been a .net developer for the past three yrs. Just curious to know about the network security field. What kind of work does the developers working in these area do? I really have not much idea about network security but what my understanding is these people are involved in securing network, preventing attacks on network as obvious. Could any one please give me some details about this field and also what does it take to move to this field.</p>
[ { "answer_id": 366377, "author": "splattne", "author_id": 6461, "author_profile": "https://Stackoverflow.com/users/6461", "pm_score": 7, "selected": false, "text": "a.Equals(b)" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365495", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45280/" ]
365,496
<p>I have an update query being run by a cron task that's timing out. The query takes, on average, five minutes to execute when executed in navicat.</p> <p>The code looks roughly like this. It's quite simple:</p> <pre><code>// $db is a mysqli link set_time_limit (0); // should keep the script from timing out $query = "SLOW QUERY"; $result = $db-&gt;query($query); if (!$result) echo "error"; </code></pre> <p>Even though the script shouldn't timeout, the time spent waiting on the sql call still seems to be subject to a timeout.</p> <p>Is there an asynchronous call that can be used? Or adjust the timeout?</p> <p>Is the timeout different because it's being called from the command line rather than through Apache?</p> <p>Thanks</p>
[ { "answer_id": 365549, "author": "Karsten", "author_id": 28144, "author_profile": "https://Stackoverflow.com/users/28144", "pm_score": 6, "selected": true, "text": "set_time_limit(0);\nignore_user_abort(1);\n" }, { "answer_id": 65779637, "author": "Jambu Atchison", "autho...
2008/12/13
[ "https://Stackoverflow.com/questions/365496", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1430/" ]
365,522
<p>A friend and I are going back and forth with brain-teasers and I have no idea how to solve this one. My assumption is that it's possible with some bitwise operators, but not sure.</p>
[ { "answer_id": 365544, "author": "Christian C. Salvadó", "author_id": 5445, "author_profile": "https://Stackoverflow.com/users/5445", "pm_score": 7, "selected": true, "text": "#include<stdio.h>\n\nint add(int x, int y) {\n int a, b;\n do {\n a = x & y;\n b = x ^ y;\n ...
2008/12/13
[ "https://Stackoverflow.com/questions/365522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23126/" ]
365,559
<p>i am trying to produce clouds effect in my flash animation using as3</p> <p>i am able to generate clouds through action script but the real problem is how to make them be generated at one end of the screen and travel diagonally to the other end... </p> <p>any thoughts?</p>
[ { "answer_id": 367080, "author": "grapefrukt", "author_id": 914, "author_profile": "https://Stackoverflow.com/users/914", "pm_score": 2, "selected": false, "text": "package {\n\n import flash.display.Sprite;\n import flash.events.Event;\n\n public class Cloud extends Sprite{\n\n...
2008/12/13
[ "https://Stackoverflow.com/questions/365559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16458/" ]
365,591
<p>I thought 2048 security violation error were mean to happen when trying to access other domains. </p> <p>I got:</p> <p><strong>"Security sandbox violation: <a href="http://127.0.0.1/site_media/main.swf" rel="nofollow noreferrer">http://127.0.0.1/site_media/main.swf</a> cannot load data from 127.0.0.1:80"</strong>, isn it the same domain? what is the solution ?</p> <p>on doing</p> <pre><code>var loader:MultipartLoader = new MultipartLoader("http://127.0.0.1/create/"); </code></pre> <p>Did i miss something ?</p>
[ { "answer_id": 367492, "author": "Moss Collum", "author_id": 13210, "author_profile": "https://Stackoverflow.com/users/13210", "pm_score": 1, "selected": false, "text": "var loader:MultipartLoader = new MultipartLoader(\"/create/\");\n" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365591", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32032/" ]
365,602
<p>If I were looking to create my own language are there any tools that would help me along? I have heard of yacc but I'm wondering how I would implement features that I want in the language.</p>
[ { "answer_id": 365636, "author": "dmckee --- ex-moderator kitten", "author_id": 2509, "author_profile": "https://Stackoverflow.com/users/2509", "pm_score": 4, "selected": false, "text": "[compiler]" }, { "answer_id": 70345715, "author": "Yuchang Ke", "author_id": 6623366,...
2008/12/13
[ "https://Stackoverflow.com/questions/365602", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1265473/" ]
365,603
<p>When viewing a webpage, I would like to copy a selection of text with its html formatting in one piece. Meaning if some text is in bold and blue, I want the tool to create a style or class in the html which makes the text blue. Everything is contained in the produced html.</p> <p>I have downloaded a similar plugin but the classes definitions are still external which means I have to get them separately. A non technical user would be at a loss here. I want the user to be able to copy and paste to a new webpage and that page just just works properly because the html copied contains everything.</p> <p>This doesn't have to be a FF plugin. It could be IE or a Windows app.</p>
[ { "answer_id": 365680, "author": "Christian Lescuyer", "author_id": 341, "author_profile": "https://Stackoverflow.com/users/341", "pm_score": 0, "selected": false, "text": "<h2><a href=\"http://stackoverflow.com/questions/365603/firefox-plugin-to-copy-text-with-its-formatting-intelligent...
2008/12/13
[ "https://Stackoverflow.com/questions/365603", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5232/" ]
365,615
<p>In C#/VB.NET/.NET, which loop runs faster, <code>for</code> or <code>foreach</code>?</p> <p>Ever since I read that a <code>for</code> loop works faster than a <code>foreach</code> loop a <a href="https://learn.microsoft.com/previous-versions/dotnet/articles/ms973839(v=msdn.10)" rel="noreferrer">long time ago</a> I assumed it stood true for all collections, generic collections, all arrays, etc.</p> <p>I scoured Google and found a few articles, but most of them are inconclusive (read comments on the articles) and open ended.</p> <p>What would be ideal is to have each scenario listed and the best solution for the same.</p> <p>For example (just an example of how it should be):</p> <ol> <li>for iterating an array of 1000+ strings - <code>for</code> is better than <code>foreach</code></li> <li>for iterating over <code>IList</code> (non generic) strings - <code>foreach</code> is better than <code>for</code></li> </ol> <p>A few references found on the web for the same: </p> <ol> <li><a href="https://learn.microsoft.com/previous-versions/dotnet/articles/ms973839(v=msdn.10)" rel="noreferrer">Original grand old article by Emmanuel Schanzer</a></li> <li><a href="https://www.codeproject.com/KB/cs/foreach.aspx" rel="noreferrer">CodeProject FOREACH Vs. FOR</a></li> <li><a href="https://learn.microsoft.com/archive/blogs/kevin_ransom/to-foreach-or-not-to-foreach-that-is-the-question" rel="noreferrer">Blog - To <code>foreach</code> or not to <code>foreach</code>, that is the question</a></li> <li><a href="https://web.archive.org/web/20100123104946/http://weblogs.asp.net/mdavey/archive/2004/02/25/79504.aspx" rel="noreferrer">ASP.NET forum - NET 1.1 C# <code>for</code> vs <code>foreach</code></a></li> </ol> <p> </p> <p>[Edit]</p> <p>Apart from the readability aspect of it, I am really interested in facts and figures. There are applications where the last mile of performance optimization squeezed do matter. </p>
[ { "answer_id": 365627, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 6, "selected": false, "text": "for" }, { "answer_id": 365630, "author": "Oliver Friedrich", "author_id": 44532, "author_profile"...
2008/12/13
[ "https://Stackoverflow.com/questions/365615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33015/" ]
365,649
<p>I was looking through Mozilla's <a href="http://mxr.mozilla.org/mozilla/source/js/narcissus/jsexec.js" rel="nofollow noreferrer">JS in JS</a> code and came across the <a href="http://mxr.mozilla.org/mozilla/source/js/narcissus/jsexec.js#137" rel="nofollow noreferrer">snarf function</a>. It's not defined in the javascript, it seems, just in the C version <a href="http://mxr.mozilla.org/mozilla/source/js/src/js.c#3712" rel="nofollow noreferrer">here</a>. It isn't very well-commented, though. I Google searched this to no avail. </p> <p>Is this a standard part of JavaScript? (My guess is no.) Is it some kind of extension? What is it supposed to do? </p>
[ { "answer_id": 365716, "author": "Eugene Lazutkin", "author_id": 26394, "author_profile": "https://Stackoverflow.com/users/26394", "pm_score": 4, "selected": true, "text": "snarf(filename)" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365649", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15055/" ]
365,650
<p>When I try to build my project I get the following message in the build window :</p> <p><strong>========== Build: 0 succeeded or up-to-date, 0 failed, 1 skipped ==========</strong></p> <p>I tried rebuilding , then building again , but it doesn't help . Is there a way to view more detailed messages ? The "skipped" part doesn't give me any info on what's wrong . I am using Visual Studio 2005 Professional Edition .</p>
[ { "answer_id": 12840704, "author": "ulidtko", "author_id": 531179, "author_profile": "https://Stackoverflow.com/users/531179", "pm_score": 2, "selected": false, "text": "appwiz.cpl" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365650", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31610/" ]
365,657
<p>On my main form, there is another (floatable) window. This floatable window works sort of like a popupwindow in that it will close when the user clicks somewhere else outside of this window. This is handled by the Deactivate event. But what I want to do is, if the user clicks on a different control (say a button), I want to both close this float window and then activate that button with just one click. Currently, the user has to click twice (one to deactivate the window and once more to activate the desired button). Is there a way to do this with just one click?</p>
[ { "answer_id": 365691, "author": "Quibblesome", "author_id": 1143, "author_profile": "https://Stackoverflow.com/users/1143", "pm_score": 2, "selected": false, "text": "foreach(Control c in parentForm.Controls)\n{\n c.Click += delegate(object sender, EventArgs e)\n {\n ...
2008/12/13
[ "https://Stackoverflow.com/questions/365657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36258/" ]
365,661
<p>Is it possible for an Subversion client to break a repository in any way? This could be any sort of destructive disruption, but it must be such that it cannot be recovered from without restoring the repository from a backup.</p> <p>Obviously, deleting everything and then checking that it is easy to fix simply with a rollback, so I am looking for something more than that.</p>
[ { "answer_id": 365672, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 4, "selected": true, "text": "file://" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365661", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20770/" ]
365,669
<p>I typically use the .markdown or .md extension for markdown documents. Unfortunately spotlight refuses to index them unless they have the .txt file extension.</p> <p>I've seen a possible solution involving <a href="http://blog.macromates.com/2007/leopard-issues/" rel="noreferrer">editing Info.plist files</a> on the textmate blog. Is there a better way?</p> <p>Update: I just discovered <a href="http://github.com/mdk/qlmarkdown/" rel="noreferrer">QuickLook generator for Markdown files</a> which adds spotlight support and nice HTML quicklook previews. It works a treat!</p>
[ { "answer_id": 365675, "author": "Chris Hanson", "author_id": 714, "author_profile": "https://Stackoverflow.com/users/714", "pm_score": 2, "selected": false, "text": "UTExportedTypeDeclarations" }, { "answer_id": 33404681, "author": "Pwdr", "author_id": 1052107, "auth...
2008/12/13
[ "https://Stackoverflow.com/questions/365669", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18751/" ]
365,699
<p>I find myself doing 2 things quite often in JS, at the moment using jQuery:</p> <p>The first is the populating of an HTML element, which might look like:</p> <pre><code>$.get('http://www.example.com/get_result.php', { id: 1 }, function (data) { $('#elementId').html(data); }); </code></pre> <p>The second is populating a select element with a JSON result, such as:</p> <pre><code>$.getJSON('http://www.example.com/get_result.php', { id: 1 }, function(data) { $.each(data, function(value, name) { $('#selectField').append('&lt;option value="' + value + '"&gt;' + name + '&lt;/option&gt;'); } )}; </code></pre> <p>What I'm looking for is either a better what of doing either of these or an extension (either library or a chunk of code) to jQuery that will do these without having to recreate the code all the time. Or is there already something in jQuery that makes this faster?</p> <p><strong>Edit:</strong> As mentioned by <a href="https://stackoverflow.com/questions/365699/better-way-or-reusable-code-to-populate-an-html-element-or-create-a-select-afte#365790">Kevin Gorski</a>, populating the HTML element could be done as:</p> <pre><code>$('#elementId').load('http://www.example.com/get_result.php', { id: 1 }); </code></pre> <p>This is perfect. Although, if you wanted to do a POST, it wouldn't work. Then doing <a href="https://stackoverflow.com/questions/365699/better-way-or-reusable-code-to-populate-an-html-element-or-create-a-select-afte#365797">Collin Allen's</a> method is better.</p>
[ { "answer_id": 365797, "author": "Collin Allen", "author_id": 41728, "author_profile": "https://Stackoverflow.com/users/41728", "pm_score": 2, "selected": false, "text": "(function ($) {\n $.fn.populateWith = function(sUrl, oData, fCallback) {\n if (!oData) oData = false;\n ...
2008/12/13
[ "https://Stackoverflow.com/questions/365699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5441/" ]
365,719
<p>I got a little stuck and I'm hoping someone can point me in the right direction. I have an NSMutableArray that stores a sequence. I created an enumerator so that a while loop can get the content of the array one by one.</p> <p>Everything works fine however I want the methods to be called with a 10 second gap in between each call. Right now it plays all at once (or in very quick order). What should I look at to create a delay in between method calls?</p> <p>Below is what I got so far. Thanks!</p> <pre><code>NSEnumerator * enumerator = [gameSequenceArray objectEnumerator]; id element; while(element = [enumerator nextObject]) { NSLog(element); int elementInt = [element intValue]; [self.view showButton:elementInt]; } </code></pre>
[ { "answer_id": 365798, "author": "Adam Wright", "author_id": 1200, "author_profile": "https://Stackoverflow.com/users/1200", "pm_score": 3, "selected": true, "text": "[NSObject performSelector:@selector(some:selector:name:) withObject:objInstance afterDelay: 10]\n" }, { "answer_i...
2008/12/13
[ "https://Stackoverflow.com/questions/365719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46022/" ]
365,743
<p>I have a small app that has a Render thread. All this thread does is draw my objects at their current location.</p> <p>I have some code like:</p> <pre><code>public void render() { // ... rendering various objects if (mouseBall != null) mouseBall.draw() } </code></pre> <p>Then I also have some mouse handler that creates and sets mouseBall to a new ball when the user clicks the mouse. The user can then drag the mouse around and the ball will follow where the mouse goes. When the user releases the ball I have another mouse event that sets mouseBall = null. </p> <p>The problem is, my render loop is running fast enough that at random times the conditional (mouseBall != null) will return true, but in that split second after that point the user will let go of the mouse and I'll get a nullpointer exception for attempting .draw() on a null object.</p> <p>What is the solution to a problem like this?</p>
[ { "answer_id": 365748, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 5, "selected": true, "text": "mouseBall" }, { "answer_id": 365762, "author": "Nathaniel Flath", "author_id": 41241, "author_profile"...
2008/12/13
[ "https://Stackoverflow.com/questions/365743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
365,750
<p>I'm using VB.net (2003), and calling the SelectNodes method on an xml document.<br> If I have a document:</p> <pre><code>&lt;InqRs&gt; &lt;DetRs&gt; &lt;RefInfo&gt; &lt;RefType&gt;StopNum&lt;/RefType&gt; &lt;RefId&gt;0&lt;/RefId&gt; &lt;/RefInfo&gt; &lt;RefInfo&gt; &lt;RefType&gt;Id&lt;/RefType&gt; &lt;RefId&gt;0&lt;/RefId&gt; &lt;/RefInfo&gt; &lt;/DetRs&gt; &lt;DetRs&gt; &lt;RefInfo&gt; &lt;RefType&gt;StopNum&lt;/RefType&gt; &lt;RefId&gt;0&lt;/RefId&gt; &lt;/RefInfo&gt; &lt;RefInfo&gt; &lt;RefType&gt;Id&lt;/RefType&gt; &lt;RefId&gt;1&lt;/RefId&gt; &lt;/RefInfo&gt; &lt;/DetRs&gt; &lt;/InqRs&gt; </code></pre> <p>How can I select just for the <code>DetRs</code> that has <code>RefType=Id</code> and <code>RefId=0</code>, ie, the 'first' one above?</p> <p>I've tried several different attempts, among others: </p> <pre><code>InqRs/DetRs[RefInfo/RefType='Id' and RefInfo/RefId='0'] InqRs/DetRs[RefInfo/RefType='Id'][RefInfo/RefId='0'] </code></pre> <p>But these select both of the DetRs sections (because of the StopNum RefId of 0, I presume). </p>
[ { "answer_id": 365957, "author": "Toby White", "author_id": 45891, "author_profile": "https://Stackoverflow.com/users/45891", "pm_score": 1, "selected": false, "text": "DetRs/Refinfo[RefType='Id' and RefId='0']/..\n" }, { "answer_id": 366835, "author": "Dimitre Novatchev", ...
2008/12/13
[ "https://Stackoverflow.com/questions/365750", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
365,768
<p>I have an intel assembly assignment. I need to write a calculator which uses 2 stacks. For example, i have an expression like 23+4/2^4$ .So that $ indicates the end of expression. What I will do is to have two stacks, one for numbers, one for operators and push and pop them according to the operator precedence.</p> <p>What I need is how can I use 2 stacks for two different purpose at the same time. As long as I know esp register indicates the place for variables in the stack to pop the last or to push a new one. But if I only have one esp register, how can I have two stacks?</p> <p>Thanks in advance... </p>
[ { "answer_id": 365883, "author": "israkir", "author_id": 26379, "author_profile": "https://Stackoverflow.com/users/26379", "pm_score": -1, "selected": false, "text": "mov ecx,256\nL1: call ReadInt\n push eax ;push the integer to where esp=1 points\n add esp,ecx ;esp=...
2008/12/13
[ "https://Stackoverflow.com/questions/365768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26379/" ]
365,773
<p>How do I detect when my Compact Framework application is being smart-minimized (smart minimize is what happens when the user clicks the "X" button in the top-right corner on a Pocket PC)?</p> <p>The Deactivate event isn't the right way because it occurs in circumstances other than minimization, such as when a message box or another form is shown on top of the main form. And the form's WindowState doesn't help because there is no "Minimized" WindowState on .NET CF.</p> <p>I heard that by setting MinimizeBox = false, my app will be closed instead of minimized. But I actually don't want my app to close, I just want to know when it has been minimized.</p>
[ { "answer_id": 410216, "author": "Geries Handal", "author_id": 37328, "author_profile": "https://Stackoverflow.com/users/37328", "pm_score": 4, "selected": true, "text": "using System.Runtime.InteropServices;\n" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22820/" ]
365,777
<p><em>Let's say I have download links for files on my site.</em> </p> <p>When clicked these links send an AJAX request to the server which returns the URL with the location of the file. </p> <p>What I want to do is direct the browser to download the file when the response gets back. Is there a portable way to do this?</p>
[ { "answer_id": 365855, "author": "Vilx-", "author_id": 41360, "author_profile": "https://Stackoverflow.com/users/41360", "pm_score": 1, "selected": false, "text": "window.open()" }, { "answer_id": 365910, "author": "fasih.rana", "author_id": 46024, "author_profile": "...
2008/12/13
[ "https://Stackoverflow.com/questions/365777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7883/" ]
365,780
<p>As you can see in the image below I have a tree datamodel consisting of groups that can contain other groups plus an arbitary number of items wich again can hold Parameters. The Parameters itself are defined globally and just reoccur in the items. Only the parameter's actual value may differ from parameter usage to parameter usage in the different items.</p> <p>The image below is an ordinary WPF treeview control with a custom control template and datatemplates for the items.</p> <p>Now my goal is to remove the parameter names above the textboxes and stack them vertically in a separate column at the very left of the treeview and just leave the textboxes there but also stacked vertically so they the correspond with their parameter names in the first column.</p> <p>Is there a way I can solve this with control templates and data templates and databinding to the view model ? (Yes I use MVVM)</p> <p><a href="http://img242.imageshack.us/img242/5377/treebh8.th.png" rel="nofollow noreferrer">treeview image http://img242.imageshack.us/img242/5377/treebh8.th.png</a> <a href="http://img242.imageshack.us/img242/5377/treebh8.png" rel="nofollow noreferrer">image link</a></p> <p>The problem is a general layout problem that must work well with databinding. generally I want to bind the object graph to a view that somewhat looks like this (cutout mockup):</p> <p><a href="http://img75.imageshack.us/img75/5763/treelayoutjh5.jpg" rel="nofollow noreferrer">treelayout http://img75.imageshack.us/img75/5763/treelayoutjh5.jpg</a></p> <p>Note that the ParamX headers are not really part of the treelayout anymore. But the values still are. Now the values must keep a connection (i.e. the are on the same row) with them. Also if none of the items in the tree contain for example Param1 the Param1 header and the corresponding row must completely dissappear.</p>
[ { "answer_id": 366486, "author": "Nir", "author_id": 3509, "author_profile": "https://Stackoverflow.com/users/3509", "pm_score": 1, "selected": false, "text": "using System;\nusing System.Collections.Generic;\n\nnamespace WpfTreeGridWhatever\n{\n public class ItemBase\n {\n }\n ...
2008/12/13
[ "https://Stackoverflow.com/questions/365780", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4227/" ]
365,782
<p>What is the accepted/most commonly used way to manipulate dynamic (with all dimensions not known until runtime) multi-dimensional arrays in C and/or C++.</p> <p>I'm trying to find the cleanest way to accomplish what this Java code does:</p> <pre><code>public static void main(String[] args){ Scanner sc=new Scanner(System.in); int rows=sc.nextInt(); int cols=sc.nextInt(); int[][] data=new int[rows][cols]; manipulate(data); } public static void manipulate(int[][] data){ for(int i=0;i&lt;data.length;i++) for(int j=0;j&lt;data[0].length.j++){ System.out.print(data[i][j]); } } </code></pre> <p>(reads from std_in just to clarify that dimensions aren't known until runtime).</p> <p>Edit:I noticed that this question is pretty popular even though it's pretty old. I don't actually agree with the top voted answer. I think the best choice for C is to use a single-dimensional array as Guge said below "You can alloc rows<em>cols</em>sizeof(int) and access it by table[row*cols+col].".</p> <p>There is a number of choices with C++, if you really like boost or stl then the answers below might be preferable, but the simplest and probably fastest choice is to use a single dimensional array as in C.</p> <p>Another viable choice in C and C++ if you want the [][] syntax is lillq's answer down at the bottom is manually building the array with lots of malloc's.</p>
[ { "answer_id": 365800, "author": "Klaim", "author_id": 2368, "author_profile": "https://Stackoverflow.com/users/2368", "pm_score": 4, "selected": false, "text": "#include \"boost/multi_array.hpp\"\n#include <cassert>\n\nint \nmain () {\n // Create a 3D array that is 3 x 4 x 2\n typedef...
2008/12/13
[ "https://Stackoverflow.com/questions/365782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34957/" ]
365,805
<p>W3c validator didn't ding me on this, but I was curious if anyone else had an opinion on placing html comments outside of the html tags?</p> <pre> ... &lt;/body&gt; &lt;/html&gt; &lt;!-- byee --&gt; </pre> <p>I have an application and am outputting some data and want it to be the absolute last thing that is done, which unfortunately means I've already attached my last &lt;/html&gt;. </p>
[ { "answer_id": 33569915, "author": "BernardF", "author_id": 1517981, "author_profile": "https://Stackoverflow.com/users/1517981", "pm_score": 1, "selected": false, "text": ".directive" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365805", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
365,817
<p>A programmer I know has a website that is fully Standards Compliant. It uses Unicode-encoded fully-validated XHTML 1.1 with CSS. The pages are frames-free, table-free and JavaScript-free.</p> <p>He would like to be directed to a blogging tool that does not demand any particular database system or web server, but does create static pages that comply with the above standards and best practices and is itself a professionally finished native Windows application.</p> <p>...and it should be able to produce an RSS feed as well.</p> <p>Is there anything out there that comes close to this?</p>
[ { "answer_id": 33569915, "author": "BernardF", "author_id": 1517981, "author_profile": "https://Stackoverflow.com/users/1517981", "pm_score": 1, "selected": false, "text": ".directive" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30176/" ]
365,820
<p>How do you rotate an image using <a href="http://code.google.com/p/jquery-rotate/" rel="nofollow noreferrer">jQuery-rotate</a> plugin?</p> <p>I have tried the following and it doesn't seem to work:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=windows-1252"&gt; &lt;title&gt;View Photo&lt;/title&gt; &lt;script type="text/javascript" src="scripts/jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="scripts/jquery.rotate.1-1.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var angle = 0; setInterval ( function (e) { rotate(); }, 100 ); function rotate() { angle = angle + 1; $('#pic').rotate(angle); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;img border="0" src="player.gif" name="pic" id="pic"&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Other methods that are supported by most browsers are wanted too, thanks!</p>
[ { "answer_id": 1710976, "author": "jvan", "author_id": 208144, "author_profile": "https://Stackoverflow.com/users/208144", "pm_score": 3, "selected": false, "text": "<script type=\"text/javascript\">\n//<![CDATA[\n var angle = 1;\n\n $(document).ready(function() {\n setInter...
2008/12/13
[ "https://Stackoverflow.com/questions/365820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45974/" ]
365,823
<p>Curious to get people's thoughts. I conduct frequent interviews, and have had enough in my career to reflect on them, and I've noticed a broad array of questions. I made this c++ specific, but it's worth noting that I have had people ask me algorithmic complexity questions over the phone, and I don't even mean what is the complexity of a hash lookup vs. a binary tree, I mean more like analytical problems, such as "imagine there are 4 bumble bees, each buzzing bla bla bla."</p> <p>Now personally I prefer to keep phone screens a little more concrete, and leave the abstract questions for the white board. So when conducting c++ phone interviews, what kind of topics do you cover, especially for Sr. developers?</p> <p>I know there is another thread similar to this, but frankly it seems to completely have missed the point that this is about phone screens, not interviews that are face to face. Plus this is more c++ specific.</p>
[ { "answer_id": 365862, "author": "jalf", "author_id": 33213, "author_profile": "https://Stackoverflow.com/users/33213", "pm_score": 5, "selected": true, "text": "a = b++ + b++?" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365823", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44996/" ]
365,826
<p>How do I calculate distance between two GPS coordinates (using latitude and longitude)?</p>
[ { "answer_id": 365853, "author": "cletus", "author_id": 18393, "author_profile": "https://Stackoverflow.com/users/18393", "pm_score": 10, "selected": true, "text": "radians = degrees * PI / 180" }, { "answer_id": 365857, "author": "Norman Ramsey", "author_id": 41661, ...
2008/12/13
[ "https://Stackoverflow.com/questions/365826", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14635/" ]
365,841
<p>My Windows application runs under Wine, but the installation is a bit of a headache for laymen, and the wrappers I've seen online (PlayOnLinux, Wine Doors) require even more packages to be installed. Is there a way to make a package that will install Wine if the user needs it to be installed, install the application and shortcuts, all with minimal user hassle?</p>
[ { "answer_id": 365993, "author": "Ana Betts", "author_id": 5728, "author_profile": "https://Stackoverflow.com/users/5728", "pm_score": 3, "selected": false, "text": "msiexec /i /q" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39702/" ]
365,866
<p><b>Background</b><br /> I'm researching the efficiency of messaging within contemporary web applications, examining the use of alternatives to XML. This is a university project whose results will be released publicly - the greater the participation of the community, the greater the value of the results that are given back.</p> <p>I need as many real-life examples of XML in use as possible so as to:</p> <ul> <li>fully understand to what uses XML is put when host A talks to host B<br /> I can certainly imagine how XML should/may be used. The reality may be quite different.<br />&nbsp;</li> <li>perform tests on actual not hypothetical data<br />How XML performs compared to Technology X on sets of <em>real-life</em> data is of equal importance to how XML compares to Technology X on an <em>arbitrary</em> set of data<br />&nbsp;</li> <li>identify and measure any patterns of use of XML<br />&nbsp;e.g. elements-only, elements plus some attributes or minimal elements and heavy attribute usage</li> </ul> <p><b>The Question</b><br /></p> <p><b>How do <em>you</em> use XML within the world of web applications?</b></p> <p>When Host B returns XML-structured data to Host A over HTTP, what comes back? This may be a server returning data in an AJAX environment or one server collating data from one or more other servers.</p> <p>Ideal answers would include:</p> <ul> <li>A real-life example of XML within an HTTP response</li> <li>The URL, where relevant, to request the above</li> <li>An explanation, if needed, of what the data represents</li> <li>An explanation, if not obvious, of why such messages are being exchanged (e.g. to fulfil a user request; host X returning a health status report to host Y)</li> </ul> <p>I'd prefer examples from applications/services that <i>you've</i> made, developed or worked on, although any examples are welcome. Anything from a 5-line XML document to a 10,000 line monster would be great.</p> <p>Your own opinions on the use of XML in your example would also be wonderful (e.g. we implemented XML-structured responses because of Requirement X/Person Y even though I thought JSON would have been better because ...; or, we use XML to do this because [really good reason] and it's just the best choice for the job).</p> <p><strong>Update</strong><br /> I very much appreciate all answers on the topic of XML in general, however what I'm really looking for is <em>real-life examples of HTTP response bodies containing XML</em>.</p> <p>I'm currently fairly aware of the history of XML, of what common alternatives may exist and how they may compare in features and suitability to given scenarios.</p> <p>What would be of greater benefit would be a impression of how XML is currently used in the exchange of data between HTTP hosts regardless of whether any current usage is correct or suitable. Examples of cases where XML is misapplied are just as valuable as cases where XML is correctly-applied.</p>
[ { "answer_id": 365997, "author": "geocar", "author_id": 37507, "author_profile": "https://Stackoverflow.com/users/37507", "pm_score": 0, "selected": false, "text": "~" } ]
2008/12/13
[ "https://Stackoverflow.com/questions/365866", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5343/" ]