qid
int64
4
22.2M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
121,025
<p>How do I get the modified date/time of a file in Python?</p>
[ { "answer_id": 121030, "author": "Thomas Wouters", "author_id": 17624, "author_profile": "https://Stackoverflow.com/users/17624", "pm_score": 6, "selected": true, "text": "os.path.getmtime(filepath)\n" }, { "answer_id": 6110132, "author": "Dingo", "author_id": 291667, ...
2008/09/23
[ "https://Stackoverflow.com/questions/121025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17693/" ]
121,051
<p>How do I go about making an image or section of the page full screen on the iPhone?</p> <p>I have an image that is 480 x 320 and I want to pull that up full screen on the iPhone but it has to be within a webpage so that I can make the image a link back to the previous page.</p> <p>Currently if I drop the image on a blank page and I open it up on the iPhone it just shows up in the top left corner.</p>
[ { "answer_id": 121097, "author": "Hans Sjunnesson", "author_id": 8683, "author_profile": "https://Stackoverflow.com/users/8683", "pm_score": 4, "selected": false, "text": "<head>\n <meta name=\"viewport\" content=\"width=device-width,user-scalable=no\" />\n</head>\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/121051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8897/" ]
121,059
<p>What is the best way to divide a 32 bit integer into four (unsigned) chars in C#.</p>
[ { "answer_id": 121089, "author": "Jason Cohen", "author_id": 4926, "author_profile": "https://Stackoverflow.com/users/4926", "pm_score": 2, "selected": false, "text": "int x = yourNumber();\nchar a = (char)(x & 0xff);\nchar b = (char)((x >> 8) & 0xff);\nchar c = (char)((x >> 16) & 0xff);...
2008/09/23
[ "https://Stackoverflow.com/questions/121059", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14759/" ]
121,063
<p>I've recently acquired a second monitor and now run VS2008 SP1 maximized on my secondary (and bigger) monitor. This theoretically has the benefit of opening the application under development on the primary monitor, where -- as it seems to me -- all newly started applications go. So far, so good. The problem though is now, that the exception helper popup is <strong>not</strong> opened on the secondary monitor. Even worse, it is <strong>only</strong> shown when the Studio window is far enough on the primary monitor! If I drag the studio with an opened exception helper from the primary to the secondary monitor, the helper is dragged with the window until it hits the border between the two monitors, where it suddenly <strong>disappears</strong>.</p> <p>Has somebody experienced this too? Is there any workaround? Anything else I should try?</p>
[ { "answer_id": 121089, "author": "Jason Cohen", "author_id": 4926, "author_profile": "https://Stackoverflow.com/users/4926", "pm_score": 2, "selected": false, "text": "int x = yourNumber();\nchar a = (char)(x & 0xff);\nchar b = (char)((x >> 8) & 0xff);\nchar c = (char)((x >> 16) & 0xff);...
2008/09/23
[ "https://Stackoverflow.com/questions/121063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4918/" ]
121,066
<p>I want to attach a click event to a button element and then later remove it, but I can't get <code>unclick()</code> or <code>unbind()</code> event(s) to work as expected. In the code below, the button is <code>tan</code> colour and the click event works.</p> <pre><code>window.onload = init; function init() { $("#startButton").css('background-color', 'beige').click(process_click); $("#startButton").css('background-color', 'tan').unclick(); } </code></pre> <p>How can I remove events from my elements?</p>
[ { "answer_id": 121084, "author": "redsquare", "author_id": 6440, "author_profile": "https://Stackoverflow.com/users/6440", "pm_score": 2, "selected": false, "text": "$(\"#startButton\").unbind('click')\n" }, { "answer_id": 121142, "author": "Jim", "author_id": 8427, "...
2008/09/23
[ "https://Stackoverflow.com/questions/121066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4639/" ]
121,111
<p>I'm running VS2008 and have used <a href="http://msdn2.microsoft.com/en-us/library/ms724947.aspx" rel="noreferrer">SystemParametersInfo</a> to activate "Focus Follows Mouse" and "Do not Raise On Focus." Sadly though, VS2008 (with and without SP1) doesn't honour the "Do not Raise" part and eagerly pushes into the foreground every time the pointer touches its window.</p> <p>A while ago I complained about that on my <a href="http://dasz.at/index.php/2008/01/focus-follow-mouse-or-not/" rel="noreferrer">blog and posted an example app</a> to set the parameters. Two others also reported having that problem, but they too didn't know how to proceed.</p> <p>How could I fix/workaround this problem? Anything else I should try?</p>
[ { "answer_id": 64425715, "author": "Yorimyorimyorim", "author_id": 14477636, "author_profile": "https://Stackoverflow.com/users/14477636", "pm_score": 2, "selected": false, "text": "Options -> Environment -> Tabs and Windows -> uncheck both entries under 'Floating Windows'." } ]
2008/09/23
[ "https://Stackoverflow.com/questions/121111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4918/" ]
121,112
<p>I have a legacy application that is written in C# and it displays a very complex treeview with 10 to 20 thousand elements.</p> <p>In the past I encountered a similar problem (but in C++) that i solved with the OWNERDATA capability offered by the Win32 API.</p> <p>Is there a similar mechanism in C#?</p> <p>EDIT: The plan is to optimize the creation time as well as browsing time. The method available through Win32 API is excellent in both of these cases as it reduce initialization time to nothing and the number of requests for elements are limited to only the ones visible at any one time. Joshl: We are actually doing exactly what you suggest already, but we still need more efficiency.</p>
[ { "answer_id": 121270, "author": "Seb Nilsson", "author_id": 2429, "author_profile": "https://Stackoverflow.com/users/2429", "pm_score": 3, "selected": false, "text": "TreeView tree = new TreeView();\nTreeNode root = new TreeNode(\"Root\");\nPopulateRootNode(root); // Get all your data\n...
2008/09/23
[ "https://Stackoverflow.com/questions/121112", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19912/" ]
121,116
<p>I have a managed DLL (written in C++/CLI) that contains a class used by a C# executable. In the constructor of the class, I need to get access to the full path of the executable referencing the DLL. In the actual app I know I can use the Application object to do this, but how can I do it from a managed DLL?</p>
[ { "answer_id": 121137, "author": "leppie", "author_id": 15541, "author_profile": "https://Stackoverflow.com/users/15541", "pm_score": 5, "selected": true, "text": "Assembly.GetCallingAssembly()\n" }, { "answer_id": 121725, "author": "Brian Stewart", "author_id": 3114, ...
2008/09/23
[ "https://Stackoverflow.com/questions/121116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3114/" ]
121,117
<p>Are there any good webservices out there that provide good lookup information for Countries and States/Provinces?</p> <p>If so what ones do you use?</p>
[ { "answer_id": 121160, "author": "Owen", "author_id": 2109, "author_profile": "https://Stackoverflow.com/users/2109", "pm_score": 4, "selected": true, "text": "http://SERVERNAME/ShippingAPITest.dll?API=Verify&XML=<AddressValidateRequest%20USERID=\"xxxxxxx\"><Address ID=\"0\"><Address1></...
2008/09/23
[ "https://Stackoverflow.com/questions/121117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8897/" ]
121,147
<p>I'd like to be able to determine if a directory such as a '.app' is considered to be a package or bundle from Finder's point of view on the command line. I don't think this would be difficult to do with a small shell program, but I'd rather not re-invent the wheel if I don't have to.</p>
[ { "answer_id": 121703, "author": "Hagelin", "author_id": 5156, "author_profile": "https://Stackoverflow.com/users/5156", "pm_score": 2, "selected": false, "text": "getFileInfo -aB directory_name\n" }, { "answer_id": 122426, "author": "Mecki", "author_id": 15809, "auth...
2008/09/23
[ "https://Stackoverflow.com/questions/121147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4468/" ]
121,162
<p>What does the <code>explicit</code> keyword mean in C++?</p>
[ { "answer_id": 121163, "author": "Skizz", "author_id": 1898, "author_profile": "https://Stackoverflow.com/users/1898", "pm_score": 13, "selected": true, "text": "class Foo\n{\nprivate:\n int m_foo;\n\npublic:\n // single parameter constructor, can be used as an implicit conversion\n F...
2008/09/23
[ "https://Stackoverflow.com/questions/121162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1898/" ]
121,167
<p>What are some of the lesser-known but useful features and techniques that people are using in their Greasemonkey scripts?</p> <p>(Please, just one feature per answer.)</p> <p>Similar threads:</p> <ul> <li><a href="https://stackoverflow.com/questions/61088/hidden-features-of-javascript">Hidden Features of JavaScript</a></li> <li><a href="https://stackoverflow.com/questions/15496/hidden-features-of-java">Hidden Features of Java</a></li> <li><a href="https://stackoverflow.com/questions/75538/hidden-features-of-c">Hidden Features of C++</a></li> <li><a href="https://stackoverflow.com/questions/9033/hidden-features-of-c">Hidden Features of C#</a></li> </ul>
[ { "answer_id": 121197, "author": "Chris Noe", "author_id": 14749, "author_profile": "https://Stackoverflow.com/users/14749", "pm_score": 3, "selected": false, "text": "GM_setValue(keyname, value)" }, { "answer_id": 121327, "author": "Chris Noe", "author_id": 14749, "a...
2008/09/23
[ "https://Stackoverflow.com/questions/121167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14749/" ]
121,199
<p>How is it possible in Eclipse JDT to convert a multiline selection to String. Like the following</p> <p>From:</p> <pre><code>xxxx yyyy zzz </code></pre> <p>To:</p> <pre><code>"xxxx " + "yyyy " + "zzz" </code></pre> <p>I tried the following template </p> <pre><code>"${line_selection}${cursor}"+ </code></pre> <p>but that way I only get the whole block surrounded not each line separately. How can I achieve a multiline processing like commenting the selected block?</p>
[ { "answer_id": 121420, "author": "Diomidis Spinellis", "author_id": 20520, "author_profile": "https://Stackoverflow.com/users/20520", "pm_score": 2, "selected": false, "text": "sed 's/^/\"/;s/$/\"+/'\n" }, { "answer_id": 121428, "author": "Rafał Dowgird", "author_id": 121...
2008/09/23
[ "https://Stackoverflow.com/questions/121199", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
121,202
<p>I work with quite a bit of multi-platform C/C++ code, separated by common #defines (#if WIN, #if UNIX, etc). It would be nice if I could have vim automatically fold the sections I'm currently not interested in when I open a file. I've searched through the vim script archives, but I haven't found anything useful. Any suggestions? Places to start?</p>
[ { "answer_id": 121278, "author": "hometoast", "author_id": 2009, "author_profile": "https://Stackoverflow.com/users/2009", "pm_score": 3, "selected": false, "text": ":syn region myFold start=\"\\#IF\" end=\"\\#ENDIF\" transparent fold\n:syn sync fromstart\n:set foldmethod=syntax\n" }, ...
2008/09/23
[ "https://Stackoverflow.com/questions/121202", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21138/" ]
121,203
<p>There was a post this morning asking about how many people disable JavaScript. Then I began to wonder what techniques might be used to determine if the user has it disabled. </p> <p>Does anyone know of some short/simple ways to detect if JavaScript is disabled? My intention is to give a warning that the site is not able to function properly without the browser having JS enabled. </p> <p>Eventually I would want to redirect them to content that is able to work in the absence of JS, but I need this detection as a placeholder to start.</p>
[ { "answer_id": 121211, "author": "ConroyP", "author_id": 2287, "author_profile": "https://Stackoverflow.com/users/2287", "pm_score": 8, "selected": false, "text": "noscript" }, { "answer_id": 121220, "author": "Hank Gay", "author_id": 4203, "author_profile": "https://...
2008/09/23
[ "https://Stackoverflow.com/questions/121203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10676/" ]
121,218
<p>Is it possible to detect the HTTP request method (e.g. GET or POST) of a page from JavaScript? If so, how?</p>
[ { "answer_id": 121290, "author": "Jim", "author_id": 8427, "author_profile": "https://Stackoverflow.com/users/8427", "pm_score": 4, "selected": false, "text": "<meta>" }, { "answer_id": 6760459, "author": "Andy", "author_id": 608042, "author_profile": "https://Stackov...
2008/09/23
[ "https://Stackoverflow.com/questions/121218", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3420/" ]
121,237
<p>I would like to convert a string into a node. I have a method that is defined to take a node, but the value I have is a string (it is hard coded). How do I turn that string into a node?</p> <p>So, given an XQuery method:</p> <pre><code>define function foo($bar as node()*) as node() { (: unimportant details :) } </code></pre> <p>I have a string that I want to pass to the foo method. How do I convert the string to a node so that the method will accept the string.</p>
[ { "answer_id": 121249, "author": "Sixty4Bit", "author_id": 1681, "author_profile": "https://Stackoverflow.com/users/1681", "pm_score": 5, "selected": true, "text": "xdmp:unquote($string).\n" }, { "answer_id": 121467, "author": "Jim Burger", "author_id": 20164, "author...
2008/09/23
[ "https://Stackoverflow.com/questions/121237", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1681/" ]
121,240
<p>What is the best (cleanest, most efficient) way to write saturating addition in C?</p> <p>The function or macro should add two unsigned inputs (need both 16- and 32-bit versions) and return all-bits-one (0xFFFF or 0xFFFFFFFF) if the sum overflows.</p> <p>Target is x86 and ARM using gcc (4.1.2) and Visual Studio (for simulation only, so a fallback implementation is OK there).</p>
[ { "answer_id": 121263, "author": "DGentry", "author_id": 4761, "author_profile": "https://Stackoverflow.com/users/4761", "pm_score": 3, "selected": false, "text": "uint32_t saturate_add32(uint32_t a, uint32_t b)\n{\n uint32_t sum = a + b;\n if ((sum < a) || (sum < b))\n retu...
2008/09/23
[ "https://Stackoverflow.com/questions/121240", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8964/" ]
121,243
<p>What are some hidden features of <a href="http://en.wikipedia.org/wiki/Microsoft_SQL_Server" rel="nofollow noreferrer">SQL Server</a>?</p> <p>For example, undocumented system stored procedures, tricks to do things which are very useful but not documented enough?</p> <hr> <h2>Answers</h2> <p><em>Thanks to everybody for all the great answers!</em></p> <p><strong>Stored Procedures</strong></p> <ul> <li><strong>sp_msforeachtable:</strong> Runs a command with '?' replaced with each table name (v6.5 and up)</li> <li><strong>sp_msforeachdb:</strong> Runs a command with '?' replaced with each database name (v7 and up)</li> <li><strong>sp_who2:</strong> just like sp_who, but with a lot more info for troubleshooting blocks (v7 and up)</li> <li><strong>sp_helptext:</strong> If you want the code of a stored procedure, view &amp; UDF</li> <li><strong>sp_tables:</strong> return a list of all tables and views of database in scope.</li> <li><strong>sp_stored_procedures:</strong> return a list of all stored procedures</li> <li><strong>xp_sscanf:</strong> Reads data from the string into the argument locations specified by each format argument.</li> <li><strong>xp_fixeddrives:</strong>: Find the fixed drive with largest free space</li> <li><strong>sp_help:</strong> If you want to know the table structure, indexes and constraints of a table. Also views and UDFs. Shortcut is Alt+F1</li> </ul> <p><strong>Snippets</strong></p> <ul> <li>Returning rows in random order</li> <li>All database User Objects by Last Modified Date</li> <li>Return Date Only</li> <li>Find records which date falls somewhere inside the current week.</li> <li>Find records which date occurred last week.</li> <li>Returns the date for the beginning of the current week.</li> <li>Returns the date for the beginning of last week.</li> <li>See the text of a procedure that has been deployed to a server</li> <li>Drop all connections to the database</li> <li>Table Checksum</li> <li>Row Checksum</li> <li>Drop all the procedures in a database</li> <li>Re-map the login Ids correctly after restore</li> <li>Call Stored Procedures from an INSERT statement</li> <li>Find Procedures By Keyword</li> <li>Drop all the procedures in a database</li> <li>Query the transaction log for a database programmatically.</li> </ul> <p><strong>Functions</strong></p> <ul> <li>HashBytes()</li> <li>EncryptByKey</li> <li>PIVOT command</li> </ul> <p><strong>Misc</strong></p> <ul> <li>Connection String extras</li> <li>TableDiff.exe</li> <li>Triggers for Logon Events (New in Service Pack 2)</li> <li>Boosting performance with persisted-computed-columns (pcc).</li> <li>DEFAULT_SCHEMA setting in sys.database_principles</li> <li>Forced Parameterization</li> <li>Vardecimal Storage Format</li> <li>Figuring out the most popular queries in seconds</li> <li>Scalable Shared Databases</li> <li>Table/Stored Procedure Filter feature in SQL Management Studio</li> <li>Trace flags</li> <li>Number after a <code>GO</code> repeats the batch</li> <li>Security using schemas</li> <li>Encryption using built in encryption functions, views and base tables with triggers</li> </ul>
[ { "answer_id": 121275, "author": "Sklivvz", "author_id": 7028, "author_profile": "https://Stackoverflow.com/users/7028", "pm_score": 3, "selected": false, "text": "sp_tables\n" }, { "answer_id": 121496, "author": "Sklivvz", "author_id": 7028, "author_profile": "https:...
2008/09/23
[ "https://Stackoverflow.com/questions/121243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7028/" ]
121,253
<p>I'm having a strange problem in Visual Studio 2008 where my "Pending Checkins" window never updates. I open it up, and it says "Updating..." like usual, but I never see the "X remaining" message, and nothing happens. It just sits there doing nothing.</p> <p>Checked-out stuff still shows as checked out in Solution Explorer. SourceSafe 2005 still works like normal.</p> <p>Any ideas?</p>
[ { "answer_id": 192168, "author": "Ryan Lundy", "author_id": 5486, "author_profile": "https://Stackoverflow.com/users/5486", "pm_score": 4, "selected": true, "text": "GlobalSection(SourceCodeControl) = preSolution\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/121253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5486/" ]
121,266
<p>I'm currently looking for ways to create automated tests for a <a href="https://jsr311.dev.java.net/" rel="noreferrer">JAX-RS</a> (Java API for RESTful Web Services) based web service. </p> <p>I basically need a way to send it certain inputs and verify that I get the expected responses. I'd prefer to do this via JUnit, but I'm not sure how that can be achieved.</p> <p>What approach do you use to test your web-services?</p> <p><strong>Update:</strong> As entzik pointed out, decoupling the web service from the business logic allows me to unit test the business logic. However, I also want to test for the correct HTTP status codes etc.</p>
[ { "answer_id": 28726499, "author": "Fırat Küçük", "author_id": 159837, "author_profile": "https://Stackoverflow.com/users/159837", "pm_score": 4, "selected": false, "text": "mvn test" }, { "answer_id": 31744302, "author": "Alexandr", "author_id": 511804, "author_profi...
2008/09/23
[ "https://Stackoverflow.com/questions/121266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2964/" ]
121,274
<p>How would I go about binding the following object, Car, to a gridview?</p> <pre> public class Car { long Id {get; set;} Manufacturer Maker {get; set;} } public class Manufacturer { long Id {get; set;} String Name {get; set;} } </pre> <p>The primitive types get bound easy but I have found no way of displaying anything for Maker. I would like for it to display the Manufacturer.Name. Is it even possible? </p> <p>What would be a way to do it? Would I have to store ManufacturerId in Car as well and then setup an lookupEditRepository with list of Manufacturers?</p>
[ { "answer_id": 121328, "author": "hollystyles", "author_id": 2083160, "author_profile": "https://Stackoverflow.com/users/2083160", "pm_score": 3, "selected": false, "text": " public class Manufacturer\n {\n long Id {get; set;}\n String Name {get; set;}\n\n public ...
2008/09/23
[ "https://Stackoverflow.com/questions/121274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15771/" ]
121,280
<p>How do I detect what browser (IE, Firefox, Opera) the user is accessing my site with? Examples in Javascript, PHP, ASP, Python, JSP, and any others you can think of would be helpful. Is there a language agnostic way to get this information?</p>
[ { "answer_id": 121319, "author": "Midhat", "author_id": 9425, "author_profile": "https://Stackoverflow.com/users/9425", "pm_score": 2, "selected": false, "text": "private String getBrowserName(HttpServletRequest request) {\n // get the user Agent from request header\n String userAg...
2008/09/23
[ "https://Stackoverflow.com/questions/121280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1288/" ]
121,282
<p>If I do something like:</p> <pre><code>$ cat /bin/ls </code></pre> <p>into my terminal, I understand why I see a bunch of binary data, representing the ls executable. But afterwards, when I get my prompt back, my own keystrokes look crazy. I type "a" and I get a weird diagonal line. I type "b" and I get a degree symbol.</p> <p>Why does this happen?</p>
[ { "answer_id": 121299, "author": "Nick Johnson", "author_id": 12030, "author_profile": "https://Stackoverflow.com/users/12030", "pm_score": 5, "selected": false, "text": "reset\n" }, { "answer_id": 121374, "author": "Dan", "author_id": 17121, "author_profile": "https:...
2008/09/23
[ "https://Stackoverflow.com/questions/121282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7598/" ]
121,283
<p>I have a web application that is becoming rather large. I want to separate it into smaller more logical projects, but the smaller projects are still going to need to access some of the classes in the app_code of the main project. What are some good methods to accomplish this?</p>
[ { "answer_id": 121296, "author": "Paul van Brenk", "author_id": 1837197, "author_profile": "https://Stackoverflow.com/users/1837197", "pm_score": 3, "selected": false, "text": "/webapp1\n /default.aspx\n /....\n/webapp2\n /default.aspx\n /....\n/lib\n /Utils.cs\n" }, { ...
2008/09/23
[ "https://Stackoverflow.com/questions/121283", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16820/" ]
121,309
<p>In an ASP.NET 2.0 website, I have a string representing some well-formed XML. I am currently creating an XmlDocument object with it and running an XSL transformation for display in a Web form. Everything was operating fine until the XML input started to contain namespaces.</p> <p>How can I read in this string and allow namespaces?</p> <p>I've included the current code below. The string source comes from an HTML encoded node in a WordPress RSS feed.</p> <pre><code>XPathNavigator myNav= myPost.CreateNavigator(); XmlNamespaceManager myManager = new XmlNamespaceManager(myNav.NameTable); myManager.AddNamespace("content", "http://purl.org/rss/1.0/modules/content/"); string myPost = HttpUtility.HtmlDecode("&lt;post&gt;" + myNav.SelectSingleNode("//item[1]/content:encoded", myManager).InnerXml + "&lt;/post&gt;"); XmlDocument myDocument = new XmlDocument(); myDocument.LoadXml(myPost.ToString()); </code></pre> <p>The error is on the last line:</p> <p>"System.Xml.XmlException: 'w' is an undeclared namespace. Line 12, position 201. at System.Xml.XmlTextReaderImpl.Throw(Exception e) ..."</p>
[ { "answer_id": 121407, "author": "ckarras", "author_id": 5688, "author_profile": "https://Stackoverflow.com/users/5688", "pm_score": 1, "selected": false, "text": "<test xmlns:w=\"http://...\">\n <w:elementInWNamespace />\n</test>\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/121309", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19626/" ]
121,318
<p>I need to have a script read the files coming in and check information for verification.</p> <p>On the first line of the files to be read is a date but in numeric form. eg: 20080923 But before the date is other information, I need to read it from position 27. Meaning line 1 position 27, I need to get that number and see if it’s greater then another number.</p> <p>I use the grep command to check other information but I use special characters to search, in this case the information before the date is always different, so I can’t use a character to search on. It has to be done by line 1 position 27.</p>
[ { "answer_id": 121336, "author": "Jonathan Leffler", "author_id": 15168, "author_profile": "https://Stackoverflow.com/users/15168", "pm_score": 4, "selected": true, "text": "sed 1q $file | cut -c27-34\n" }, { "answer_id": 121344, "author": "DGentry", "author_id": 4761, ...
2008/09/23
[ "https://Stackoverflow.com/questions/121318", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21151/" ]
121,324
<p>I'm looking for a framework to generate Java source files.</p> <p>Something like the following API:</p> <pre><code>X clazz = Something.createClass("package name", "class name"); clazz.addSuperInterface("interface name"); clazz.addMethod("method name", returnType, argumentTypes, ...); File targetDir = ...; clazz.generate(targetDir); </code></pre> <p>Then, a java source file should be found in a sub-directory of the target directory.</p> <p>Does anyone know such a framework?</p> <hr> <p><strong>EDIT</strong>:</p> <ol> <li>I really need the source files.</li> <li>I also would like to fill out the code of the methods.</li> <li>I'm looking for a high-level abstraction, not direct bytecode manipulation/generation.</li> <li>I also need the "structure of the class" in a tree of objects.</li> <li>The problem domain is general: to generate a large amount of very different classes, without a "common structure".</li> </ol> <hr> <p><strong>SOLUTIONS</strong><br> I have posted 2 answers based in your answers... <a href="https://stackoverflow.com/questions/121324/a-java-api-to-generate-java-source-files#136010">with CodeModel</a> and <a href="https://stackoverflow.com/questions/121324/a-java-api-to-generate-java-source-files#136016">with Eclipse JDT</a>.</p> <p>I have used <a href="http://codemodel.java.net/" rel="noreferrer">CodeModel</a> in my solution, :-)</p>
[ { "answer_id": 136010, "author": "Daniel Fanjul", "author_id": 16135, "author_profile": "https://Stackoverflow.com/users/16135", "pm_score": 6, "selected": false, "text": "JCodeModel cm = new JCodeModel();\nJDefinedClass dc = cm._class(\"foo.Bar\");\nJMethod m = dc.method(0, int.class, \...
2008/09/23
[ "https://Stackoverflow.com/questions/121324", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16135/" ]
121,326
<p>What does it mean when it gives a backtrace with the following output?</p> <pre><code>#0 0x00000008009c991c in pthread_testcancel () from /lib/libpthread.so.2 #1 0x00000008009b8120 in sigaction () from /lib/libpthread.so.2 #2 0x00000008009c211a in pthread_mutexattr_init () from /lib/libpthread.so.2 #3 0x0000000000000000 in ?? () </code></pre> <p>The program has crashed with a standard signal 11, segmentation fault. My application is a multi-threaded FastCGI C++ program running on FreeBSD 6.3, using pthread as the threading library.</p> <p>It has been compiled with -g and all the symbol tables for my source are loaded, according to info sources.</p> <p>As is clear, none of my actual code appears in the trace but instead the error seems to originate from standard pthread libraries. In particular, what is ?? () ????</p> <p><b>EDIT</b>: eventually tracked the crash down to a standard invalid memory access in my main code. Doesn't explain why the stack trace was corrupted, but that's a question for another day :)</p>
[ { "answer_id": 327884, "author": "D.Shawley", "author_id": 41747, "author_profile": "https://Stackoverflow.com/users/41747", "pm_score": 2, "selected": false, "text": "NULL" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/121326", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10264/" ]
121,350
<p>I have a large ADO.Net dataset and two database schemas (Oracle) with different constraints. The dataset will work with either schema, but I want to be able to tell the dataset which schema to use (via connection string) at runtime.</p> <p>Is that even possible?</p>
[ { "answer_id": 121500, "author": "David Basarab", "author_id": 2469, "author_profile": "https://Stackoverflow.com/users/2469", "pm_score": 1, "selected": false, "text": " DataSet ds = new DataSet();\n\n // Do some updateing here\n\n // Put your connection...
2008/09/23
[ "https://Stackoverflow.com/questions/121350", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4219/" ]
121,373
<p>I am working on a WinForms application programmed in C# .NET 2.0 and VS2008. I am just about to start translating the app into several languages. Before I start, is it a good idea to use the VS2008 itself for all the localization? Or is it better to use some external tool right away? This is my first .NET app, so I rather ask before I start. What are others using?</p> <p>All strings used in my app are in resources, so I think the app is ready to be translated.</p> <p>Thank you, Petr</p>
[ { "answer_id": 670713, "author": "Germstorm", "author_id": 18631, "author_profile": "https://Stackoverflow.com/users/18631", "pm_score": 0, "selected": false, "text": "Default value | DE | ES\n-------------------------------\napple |apple | apple\n...\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/121373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20353/" ]
121,382
<p>Is there a way to comment out markup in an <code>.ASPX</code> page so that it isn't delivered to the client? I have tried the standard comments <code>&lt;!-- --&gt;</code> but this just gets delivered as a comment and doesn't prevent the control from rendering. </p>
[ { "answer_id": 121397, "author": "BigJump", "author_id": 8542, "author_profile": "https://Stackoverflow.com/users/8542", "pm_score": 3, "selected": false, "text": "<asp:panel runat=\"server\" visible=\"false\">\n html here\n</asp:panel>\n" }, { "answer_id": 121400, "author...
2008/09/23
[ "https://Stackoverflow.com/questions/121382", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10676/" ]
121,385
<p>What makes a language strongly typed? I'm looking for the most important aspects of a strongly typed language.</p> <p>Yesterday I asked if PowerShell was strongly typed, but no one could agree on the definition of "strongly-typed", so I'm looking to clarify the definition.</p> <p>Feel free to link to wikipedia or other sources, but don't just cut and paste for your answer.</p>
[ { "answer_id": 121412, "author": "Hans Sjunnesson", "author_id": 8683, "author_profile": "https://Stackoverflow.com/users/8683", "pm_score": 1, "selected": false, "text": "int i = 4;\nchar s = i; // Type mismatch: cannot convert from int to char\n" }, { "answer_id": 121482, "...
2008/09/23
[ "https://Stackoverflow.com/questions/121385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3289/" ]
121,387
<p>Table: </p> <pre><code>UserId, Value, Date. </code></pre> <p>I want to get the UserId, Value for the max(Date) for each UserId. That is, the Value for each UserId that has the latest date. Is there a way to do this simply in SQL? (Preferably Oracle)</p> <p><strong>Update:</strong> Apologies for any ambiguity: I need to get ALL the UserIds. But for each UserId, only that row where that user has the latest date.</p>
[ { "answer_id": 121416, "author": "jdmichal", "author_id": 12275, "author_profile": "https://Stackoverflow.com/users/12275", "pm_score": 2, "selected": false, "text": "SELECT UserId, Value\nFROM Users AS user\nWHERE Date = (\n SELECT MAX(Date)\n FROM Users AS maxtest\n WHERE maxt...
2008/09/23
[ "https://Stackoverflow.com/questions/121387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21154/" ]
121,392
<p>I have a bunch (hundreds) of files that are supposed to have Unix line endings. I strongly suspect that some of them have Windows line endings, and I want to programmatically figure out which ones do.</p> <p>I know I can just run <pre>flip -u</pre> or something similar in a script to convert everything, but I want to be able to identify those files that need changing first.</p>
[ { "answer_id": 121447, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": 6, "selected": false, "text": "file" }, { "answer_id": 121464, "author": "stimms", "author_id": 361, "author_profile": "https:/...
2008/09/23
[ "https://Stackoverflow.com/questions/121392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18177/" ]
121,396
<p>When you call the <code>object.__repr__()</code> method in Python you get something like this back: </p> <blockquote> <pre><code>&lt;__main__.Test object at 0x2aba1c0cf890&gt; </code></pre> </blockquote> <p>Is there any way to get a hold of the memory address if you overload <code>__repr__()</code>, other then calling <code>super(Class, obj).__repr__()</code> and regexing it out? </p>
[ { "answer_id": 121422, "author": "Ben Hoffstein", "author_id": 4482, "author_profile": "https://Stackoverflow.com/users/4482", "pm_score": 6, "selected": false, "text": "id(object)\n" }, { "answer_id": 121426, "author": "Thomas Wouters", "author_id": 17624, "author_pr...
2008/09/23
[ "https://Stackoverflow.com/questions/121396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/452521/" ]
121,408
<p>I need to store items with a calendar date (just the day, no time) in a sqlite database. What's the best way to represent the date in the column? Julian days and unix seconds come to mind as reasonable alternatives. If I go with a unit other than days at what clock time should it be?</p> <p>Update: I am aware of ISO8601 and actually used it to store the date as a string in YYYY-MM-DD format for the prototype. But for various arithmetic I have to convert it to some number internally, so I'd prefer to store a number and just convert to string for display. What units should this number be in, with what origin, and if the units is more precise than days what time of day should be used?</p>
[ { "answer_id": 124508, "author": "benzado", "author_id": 10947, "author_profile": "https://Stackoverflow.com/users/10947", "pm_score": 0, "selected": false, "text": "Date = (Month << 5) | Day\nMonth = Date >> 5\nDay = 0x1F & Date\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/121408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20626/" ]
121,439
<p>I'm running <code>Django 1.0</code> and I'm close to deploying my app. As such, I'll be changing the DEBUG setting to False.</p> <p>With that being said, I'd still like to include the stacktrace on my 500.html page when errors occur. By doing so, users can copy-and-paste the errors and easily email them to the developers.</p> <p>Any thoughts on how best to approach this issue?</p>
[ { "answer_id": 121474, "author": "Aaron Maenpaa", "author_id": 2603, "author_profile": "https://Stackoverflow.com/users/2603", "pm_score": 5, "selected": true, "text": "import traceback\nimport sys\n\ntry:\n raise Exception(\"Message\")\nexcept:\n type, value, tb = sys.exc_info()\n...
2008/09/23
[ "https://Stackoverflow.com/questions/121439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10040/" ]
121,453
<p>There is a way to know the flash player version installed on the computer that runs our SWF file with Action Script 3.0?</p>
[ { "answer_id": 149292, "author": "Martin", "author_id": 15840, "author_profile": "https://Stackoverflow.com/users/15840", "pm_score": 2, "selected": false, "text": "import flash.system.Capabilities;\n\n\nvar versionNumber:String = Capabilities.version;\ntrace(\"versionNumber: \"+versionN...
2008/09/23
[ "https://Stackoverflow.com/questions/121453", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20601/" ]
121,476
<p>What is the best way to access a running mono application via the command line (Linux/Unix)? </p> <p>Example: a mono server application is running and I want to send commands to it using the command line in the lightest/fastest way possible, causing the server to send back a response (e.g. to stdout).</p>
[ { "answer_id": 4331077, "author": "Gabriel Burt", "author_id": 223615, "author_profile": "https://Stackoverflow.com/users/223615", "pm_score": 1, "selected": false, "text": "gsharp" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/121476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17378/" ]
121,493
<p>I'm no crypto expert, but as I understand it, 3DES is a symmetric encryption algorithm, which means it doesnt use public/private keys.</p> <p>Nevertheless, I have been tasked with encrypting data using a public key, (specifically, a .CER file). If you ignore the whole symmetric/asymmetric thang, I should just be able to use the key data from the public key as the TripleDES key. However, I'm having difficulty extracting the key bytes from the .CER file. This is the code as it stands..</p> <pre><code>TripleDESCryptoServiceProvider cryptoProvider = new TripleDESCryptoServiceProvider(); X509Certificate2 cert = new X509Certificate2(@"c:\temp\whatever.cer"); cryptoProvider.Key = cert.PublicKey.Key. </code></pre> <p>The simplest method I can find to extract the raw key bytes from the certificate is ToXmlString(bool), and then doing some hacky substringing upon the returned string. However, this seems so hackish I feel I must be missing a simpler, more obvious way to do it.</p> <p>Am I missing a simpler way to use a .cer file to provide the key data to the C# 3DES crypto class, or is hacking it out of the certificate xml string really the best way to go about this?</p>
[ { "answer_id": 121527, "author": "Seb Nilsson", "author_id": 2429, "author_profile": "https://Stackoverflow.com/users/2429", "pm_score": 0, "selected": false, "text": "byte[] keyBytes = Convert.FromBase64String(sourceString);\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/121493", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21002/" ]
121,499
<p>Suppose I attach an <code>blur</code> function to an HTML input box like this:</p> <pre><code>&lt;input id="myInput" onblur="function() { ... }"&gt;&lt;/input&gt; </code></pre> <p>Is there a way to get the ID of the element which caused the <code>blur</code> event to fire (the element which was clicked) inside the function? How?</p> <p>For example, suppose I have a span like this:</p> <pre><code>&lt;span id="mySpan"&gt;Hello World&lt;/span&gt; </code></pre> <p>If I click the span right after the input element has focus, the input element will lose its focus. How does the function know that it was <code>mySpan</code> that was clicked?</p> <p>PS: If the onclick event of the span would occur before the onblur event of the input element my problem would be solved, because I could set some status value indicating a specific element had been clicked.</p> <p>PPS: The background of this problem is that I want to trigger an AJAX autocompleter control externally (from a clickable element) to show its suggestions, without the suggestions disappearing immediately because of the <code>blur</code> event on the input element. So I want to check in the <code>blur</code> function if one specific element has been clicked, and if so, ignore the blur event. </p>
[ { "answer_id": 121517, "author": "brock.holum", "author_id": 15860, "author_profile": "https://Stackoverflow.com/users/15860", "pm_score": 0, "selected": false, "text": "<script type=\"text/javascript\">\n var lastFocusedElement;\n</script>\n<input id=\"myInput\" onFocus=\"lastFocusedE...
2008/09/23
[ "https://Stackoverflow.com/questions/121499", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6264/" ]
121,511
<p>I have inherited a poorly written web application that seems to have errors when it tries to read in an xml document stored in the database that has an "&amp;" in it. For example there will be a tag with the contents: "Prepaid &amp; Charge". Is there some secret simple thing to do to have it not get an error parsing that character, or am I missing something obvious? </p> <p>EDIT: Are there any other characters that will cause this same type of parser error for not being well formed?</p>
[ { "answer_id": 121529, "author": "Steve g", "author_id": 12092, "author_profile": "https://Stackoverflow.com/users/12092", "pm_score": 2, "selected": false, "text": "&amp;" }, { "answer_id": 121537, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "http...
2008/09/23
[ "https://Stackoverflow.com/questions/121511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13593/" ]
121,521
<p>I use the on-demand (hosted) version of FogBugz. I would like to start using Mercurial for source control. I would like to integrate FogBugz and a BitBucket repository. I gave it a bit of a try but things weren't going very well. </p> <p>FogBugz requires that you hook up your Mercurial client to a fogbugz.py python script. TortoiseHg doesn't seem to have the hgext directory that they refer to in instructions.</p> <p>So has anyone successfully done something similar?</p>
[ { "answer_id": 123314, "author": "Stefan Rusek", "author_id": 19704, "author_profile": "https://Stackoverflow.com/users/19704", "pm_score": 4, "selected": true, "text": "[fogbugz]\npath=C:\\Program Files\\TortoiseHg\\scripts\\fogbugz.py\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/121521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20498/" ]
121,579
<p>I don't know if anyone has seen this issue before but I'm just stumped. Here's the unhandled exception message that my error page is capturing. </p> <blockquote> <p>Error Message: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.</p> <p>Stack Trace: at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) at System.Web.UI.HiddenFieldPageStatePersister.Load() at System.Web.UI.Page.LoadPageStateFromPersistenceMedium() at System.Web.UI.Page.LoadAllState() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.generic_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously)</p> <p>Source: System.Web</p> </blockquote> <p>Anybody have any ideas on how I could resolve this? Thanks.</p>
[ { "answer_id": 121583, "author": "Chris Driver", "author_id": 5217, "author_profile": "https://Stackoverflow.com/users/5217", "pm_score": 5, "selected": true, "text": "<input type=\"hidden\" name=\"__EVENTVALIDATION\" id=\"__EVENTVALIDATION\" value=\"AEBnx7v.........tS\" />\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/121579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21165/" ]
121,581
<p>In SQL Server what is the simplest/cleanest way to make a datetime representing the first of the month based on another datetime? eg I have a variable or column with 3-Mar-2005 14:23 and I want to get 1-Mar-2005 00:00 (as a datetime, not as varchar)</p>
[ { "answer_id": 121596, "author": "Ben Hoffstein", "author_id": 4482, "author_profile": "https://Stackoverflow.com/users/4482", "pm_score": 3, "selected": false, "text": "SELECT DATEADD(mm, DATEDIFF(mm, 0, @date), 0)\n" }, { "answer_id": 121602, "author": "George Mastros", ...
2008/09/23
[ "https://Stackoverflow.com/questions/121581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8479/" ]
121,585
<p>I'm specifically interested in Windows 2000/XP, but Vista/7 would be interesting too (if different).</p> <p>I was thinking along the lines of task scheduling a batch file or equivalent on a daily basis.</p> <p>EDIT: Sorry, I should have provided more info. The question pertains to 10 machines which I manually apply updates. I don't want to install the updates programatically, but just find out if there are updates ready to download/install (i.e. the update shield icon in the system tray is indicating this) using a batch or script. Thanks.</p>
[ { "answer_id": 857737, "author": "Alex", "author_id": 26564, "author_profile": "https://Stackoverflow.com/users/26564", "pm_score": 2, "selected": false, "text": "WUApiLib" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/121585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13967/" ]
121,599
<p>We're looking at CouchdDB for a CMS-ish application. What are some common patterns, best practices and workflow advice surrounding backing up our production database?</p> <p>I'm particularly interested in the process of cloning the database for use in development and testing.</p> <p>Is it sufficient to just copy the files on disk out from under a live running instance? Can you clone database data between two live running instances?</p> <p>Advice and description of the techniques you use will be greatly appreciated.</p>
[ { "answer_id": 126556, "author": "Jan Lehnardt", "author_id": 21269, "author_profile": "https://Stackoverflow.com/users/21269", "pm_score": 3, "selected": false, "text": "cp" }, { "answer_id": 28734252, "author": "coffeequant", "author_id": 2841309, "author_profile": ...
2008/09/23
[ "https://Stackoverflow.com/questions/121599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19784/" ]
121,605
<p>What is the best way to reduce the size of the viewstate hidden field in JSF? I have noticed that my view state is approximately 40k this goes down to the client and back to the server on every request and response espically coming to the server this is a significant slowdown for the user. </p> <p>My Environment JSF 1.2, MyFaces, Tomcat, Tomahawk, RichFaces</p>
[ { "answer_id": 121624, "author": "David Waters", "author_id": 12148, "author_profile": "https://Stackoverflow.com/users/12148", "pm_score": 4, "selected": false, "text": "<context-param>\n <param-name>org.apache.myfaces.COMPRESS_STATE_IN_CLIENT</param-name>\n <param-value>true</par...
2008/09/23
[ "https://Stackoverflow.com/questions/121605", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12148/" ]
121,606
<p>If I want to bind a collection to a some form of listing control in Silverlight. Is the only way to do it so make the underlying objects in the collection implement INotifyPropertyChanged and for the collection to be an Observablecollection?</p> <p>If I was using some sort of third party object, for example that returned by a web service, I would have to wrap it or map it to something that implements INotifyPropertyChanged ?</p>
[ { "answer_id": 598191, "author": "caryden", "author_id": 313, "author_profile": "https://Stackoverflow.com/users/313", "pm_score": 0, "selected": false, "text": "<UserControl>\n <UserControl.Resources>\n <local:FooToBindableFooConverter x:Key=\"BindableFooConverter\"/>\n </U...
2008/09/23
[ "https://Stackoverflow.com/questions/121606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/230/" ]
121,615
<p>I'm in the process of adding custom buttons to my iPhone UI and want to make them have the glassy look from Apple's apps. I have a good default glass image, but I'd hate to have to have a separate image for each tint I want (red, green, blue, etc.). </p> <p>Is there a way to load a grayscale PNG and adjust it to the color I want? Better yet, is there a way to get Apple's glassy look without having to load custom images at all?</p>
[ { "answer_id": 4971371, "author": "Cyrille", "author_id": 526547, "author_profile": "https://Stackoverflow.com/users/526547", "pm_score": 3, "selected": false, "text": "UISegmentedControl" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/121615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1967/" ]
121,631
<p>Is there a difference in performance (in oracle) between</p> <pre><code>Select * from Table1 T1 Inner Join Table2 T2 On T1.ID = T2.ID </code></pre> <p>And</p> <pre><code>Select * from Table1 T1, Table2 T2 Where T1.ID = T2.ID </code></pre> <p>?</p>
[ { "answer_id": 122403, "author": "user21241", "author_id": 21241, "author_profile": "https://Stackoverflow.com/users/21241", "pm_score": 5, "selected": false, "text": "JOIN" }, { "answer_id": 354834, "author": "kiewic", "author_id": 27211, "author_profile": "https://S...
2008/09/23
[ "https://Stackoverflow.com/questions/121631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1782/" ]
121,638
<p>This may seem like a daft question, but i was wondering about how to use MVC frameworks on hosted servers.</p> <p>I am playing about (albeit slowly) at home with the RoR on Ubuntu and understand that if i want to do a live site then i need hosting with Rails and Ruby.</p> <p>However, what happens about the PHP frameworks. For example i have seen in the past all about the CakePHP but lately i have just come across the <a href="http://www.symfony-project.org/tutorial/1_1/my-first-project" rel="nofollow noreferrer">Symfony project</a> and was thinking that if i had a server stack set up i could develop at home, how would i go about deploying anything live. </p> <p>How do i use php command line on live servers, and how would i go about installing the framework on another server.</p> <p>This is all hyperthetical at the moment as i am just thinking about it, but it is a question that i have thought of in the past.</p> <p>Regards</p>
[ { "answer_id": 121681, "author": "dirtside", "author_id": 20903, "author_profile": "https://Stackoverflow.com/users/20903", "pm_score": 2, "selected": false, "text": "<?php\nrequire_once(\"/home/username/frameworks/Kohana_2.2/system/core/Bootstrap.php\");\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/121638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17415/" ]
121,656
<p>I have the following string and I would like to remove <code>&lt;bpt *&gt;*&lt;/bpt&gt;</code> and <code>&lt;ept *&gt;*&lt;/ept&gt;</code> (notice the additional tag content inside them that also needs to be removed) without using a XML parser (overhead too large for tiny strings).</p> <pre><code>The big &lt;bpt i="1" x="1" type="bold"&gt;&lt;b&gt;&lt;/bpt&gt;black&lt;ept i="1"&gt;&lt;/b&gt;&lt;/ept&gt; &lt;bpt i="2" x="2" type="ulined"&gt;&lt;u&gt;&lt;/bpt&gt;cat&lt;ept i="2"&gt;&lt;/u&gt;&lt;/ept&gt; sleeps. </code></pre> <p>Any regex in VB.NET or C# will do.</p>
[ { "answer_id": 121727, "author": "davenpcj", "author_id": 4777, "author_profile": "https://Stackoverflow.com/users/4777", "pm_score": 1, "selected": false, "text": "(<bpt .*?>.*?</bpt>)|(<ept .*?>.*?</ept>)\n" }, { "answer_id": 121833, "author": "Torsten Marek", "author_i...
2008/09/23
[ "https://Stackoverflow.com/questions/121656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1508/" ]
121,662
<p>Ok, so we have clients and those clients get to customize their web facing page. One option we are giving them is to be able to change the color of a graphic (it's like a framish-looking bar) using one of those hex wheels or whatever. </p> <p>So, I've thought about it, and I don't know where to start. I am sending comps out this week to my xhtml guy and I want to have the implementation done at least in my mind before I send things out. </p> <p>Something about System.Drawing sounds about right, but I've never worked with that before and it sounds hella complicated. Does anyone have an idea? </p> <p><strong>UPDATE:</strong> The color of an image will be changing. So if I want image 1 to be green, and image 2 to be blue, I go into my admin screen and enter those hex values (probably will give them an interface for it) and then when someone else looks at their page they will see the changes they made. Kind of like customizing a facebook or myspace page (OMFGz soooo Werb 2.0)</p>
[ { "answer_id": 122354, "author": "clweeks", "author_id": 13748, "author_profile": "https://Stackoverflow.com/users/13748", "pm_score": 2, "selected": true, "text": "Imports System.Drawing\n\nPrivate Function createImage(ByVal srcPath As String, ByVal fg As Color, ByVal bg As Color) As Bi...
2008/09/23
[ "https://Stackoverflow.com/questions/121662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4140/" ]
121,665
<p>How does one invoke a groovy method that prints to stdout, appending the output to a string?</p>
[ { "answer_id": 121776, "author": "Joe Skora", "author_id": 14057, "author_profile": "https://Stackoverflow.com/users/14057", "pm_score": 5, "selected": true, "text": "void doSomething() {\n println \"i did something\"\n}\n\nprintln \"normal call\\n---------------\"\ndoSomething()\nprint...
2008/09/23
[ "https://Stackoverflow.com/questions/121665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
121,674
<p>The CPU architecture landscape has changed, multiple cores is a trend that will change how we have to develop software. I've done multi-threaded development in C, C++ and Java, I've done multi-process development using various IPC mechanisms. Traditional approaches of using threads doesn't seem to make it easy, for the developer, to utilize hardware that supports a high degree of concurrency.</p> <p>What languages, libraries and development techniques are you aware of that help alleviate the traditional challenges of creating concurrent applications? I'm obviously thinking of issues like deadlocks and race conditions. Design techniques, libraries, tools, etc. are also interesting that help actually take advantage of and ensure that the available resources are being utilized - just writing a safe, robust threaded application doesn't ensure that it's using all the available cores.</p> <p>What I've seen so far is:</p> <ul> <li><a href="http://www.erlang.org/" rel="nofollow noreferrer">Erlang</a>: process based, message passing IPC, the 'actor's model of concurrency</li> <li><a href="https://github.com/dramatis/dramatis" rel="nofollow noreferrer">Dramatis</a>: actors model library for Ruby and Python</li> <li><a href="http://www.scala-lang.org/" rel="nofollow noreferrer">Scala</a>: functional programming language for the JVM with some added concurrency support</li> <li><a href="http://clojure.org/" rel="nofollow noreferrer">Clojure</a>: functional programming language for the JVM with an actors library</li> <li><a href="http://code.google.com/p/termite/" rel="nofollow noreferrer">Termite</a>: a port of Erlang's process approach and message passing to Scheme</li> </ul> <p>What else do you know about, what has worked for you and what do you think is interesting to watch?</p>
[ { "answer_id": 121764, "author": "Torsten Marek", "author_id": 9567, "author_profile": "https://Stackoverflow.com/users/9567", "pm_score": 3, "selected": false, "text": "map/imap" }, { "answer_id": 219043, "author": "gbjbaanb", "author_id": 13744, "author_profile": "h...
2008/09/23
[ "https://Stackoverflow.com/questions/121674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19784/" ]
121,676
<p>Inside a .NET 3.5 web app running impersonation I am trying to execute a process via:</p> <pre><code>var process = new Process { StartInfo = { CreateNoWindow = true, FileName = "someFileName", Domain = "someDomain", Username = "someUserName", Password = securePassword, UseShellExecute = false } }; process.Start(); </code></pre> <p>-Changing the trust mode to full in web.config did not fix.</p> <p>-Note the var securePassword is a secureString set up earlier in the code.</p> <p>This throws an exception with 'Access is Denied' as its message. If I remove the username and password information, the exception goes away, but the process starts as aspnet_wp instead of the user I need it to.</p> <p>I've seen this issue in multiple forums and never seen a solution provided. Any ideas?</p>
[ { "answer_id": 121763, "author": "Mike L", "author_id": 12085, "author_profile": "https://Stackoverflow.com/users/12085", "pm_score": 2, "selected": false, "text": "Dim startInfo As New ProcessStartInfo(programName)\n With startInfo\n .Domain = \"test.local\"\n ...
2008/09/23
[ "https://Stackoverflow.com/questions/121676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
121,680
<p>I am 90% sure I saw this answer on stackoverflow before, in fact I had never seen the "int?" syntax before seeing it here, but no matter how I search I can't find the previous post, and it's driving me crazy.</p> <p>It's possible that I've been eating the funny mushrooms by accident, but if I'm not, can someone please point out the previous post if they can find it or re-explain it? My stackoverflow search-fu is apparently too low....</p>
[ { "answer_id": 121686, "author": "Forgotten Semicolon", "author_id": 1960, "author_profile": "https://Stackoverflow.com/users/1960", "pm_score": 8, "selected": true, "text": "Nullable<int>" }, { "answer_id": 54249164, "author": "Taher Assad", "author_id": 7510214, "au...
2008/09/23
[ "https://Stackoverflow.com/questions/121680", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8151/" ]
121,700
<p>In an attempt to add some parameter validation and correct usage semantics to our application, we are trying to add correct exception handling to our .NET applications.</p> <p>My question is this: When throwing exceptions in ADO.NET if a particular query returns no data or the data could not be found, what type of exception should I use?</p> <p>Psuedocode: (read, don't scrutinize the semantics of the code, I know it won't compile)</p> <pre><code>public DataSet GetData(int identifier) { dataAdapter.Command.Text = "Select * from table1 Where ident = " + identifier.toString(); DataSet ds = dataAdapter.Fill(ds); if (ds.table1.Rows.Count == 0) throw new Exception("Data not found"); return ds; } </code></pre>
[ { "answer_id": 121746, "author": "Richard Yorkshire", "author_id": 21001, "author_profile": "https://Stackoverflow.com/users/21001", "pm_score": 2, "selected": false, "text": "public class myException : Exception\n{\n public myException(string s) : base() \n {\n this.MyReasonMes...
2008/09/23
[ "https://Stackoverflow.com/questions/121700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15766/" ]
121,707
<p>I don't currently use ajax.net though I would be open to it if it is the only solution. I have a auto-complete control on screen that I am using to populate a asp.net dropdownlist with values through javascript (jQuery). I have had to use EnableEventValidation="false" to allow this. After I add my options to the select and the form is posted back I would like to be able to get all the values for the option elements I have added to the asp.net dropdownlist through javascript.. Is there a good way to accomplish this?</p>
[ { "answer_id": 192082, "author": "Jason", "author_id": 26860, "author_profile": "https://Stackoverflow.com/users/26860", "pm_score": 1, "selected": false, "text": "string fooBar = Request.Form[SomeDropDown.UniqueID];\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/121707", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18926/" ]
121,713
<p>My boss asked me to setup a <a href="http://en.wikipedia.org/wiki/Apache_Subversion" rel="nofollow noreferrer">Subversion</a> server for him to use so that he can share all his documents across different machines in sync and still be able to access them when there is no Internet connection.</p> <p>I have this up for him, but now he's requesting that the 'create date' file attribute be preserved. I explained that since he downloaded all the files that is their create date, but he insists I find a manner to preserve this as it is affecting the desktop search agent he uses. Is there any way to set this attribute to be preserved via Subversion, or do I have to write a script to get the date of each file and have him run 'touch' after each intial check out?</p> <p>Note that the set of documents that were added to the SVN repository span back several years, and he wants these dates preserved across all checkouts. So the date of the last change that Subversion has could potentially be off by years from what he wants.</p>
[ { "answer_id": 7366083, "author": "Bryce", "author_id": 311364, "author_profile": "https://Stackoverflow.com/users/311364", "pm_score": 2, "selected": false, "text": "svn propset svn:date --revprop -r HEAD \"2007-04-22\"\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/121713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9940/" ]
121,722
<pre><code>string percentage = e.Row.Cells[7].Text; </code></pre> <p>I am trying to do some dynamic stuff with my GridView, so I have wired up some code to the RowDataBound event. I am trying to get the value from a particular cell, which is a TemplateField. But the code above always seems to be returning an empty string. </p> <p>Any ideas?</p> <p>To clarify, here is a bit the offending cell:</p> <pre><code>&lt;asp:TemplateField HeaderText="# Percentage click throughs"&gt; &lt;ItemTemplate&gt; &lt;%# AddPercentClickThroughs((int)Eval("EmailSummary.pLinksClicked"), (int)Eval("NumberOfSends")) %&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; </code></pre> <p>On a related note, does anyone know if there is a better way of selecting the cell in the row. It sucks putting in <code>cell[1]</code>. Couldn't I do <code>cell["mycellname"]</code>, so if I decide to change the order of my cells, bugs wont appear?</p>
[ { "answer_id": 121740, "author": "Orion Adrian", "author_id": 7756, "author_profile": "https://Stackoverflow.com/users/7756", "pm_score": 5, "selected": true, "text": "Label" }, { "answer_id": 121751, "author": "Stephen Wrighton", "author_id": 7516, "author_profile": ...
2008/09/23
[ "https://Stackoverflow.com/questions/121722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3193/" ]
121,743
<p>Server virtualization is a big thing these days, so I'm tasked at work to install some of our software on a virtualized server and see what happens. Long story short: a <code>rsync</code> transfer promptly brings the virtualized server to its knees. The virtualization host is a beefy machine with no other load; I don't think this should be happening. <code>Top</code> shows high load averages, and cpu iowait near 100%. There's a huge bottleneck somewhere.</p> <p>I'm more a programmer than a sysadmin, I lack the knowledge on how to go about fixing this outside of random Googling. I suspect I'm not alone in this. </p> <p>What I'd like to see here is general advice on virtualization, and pointers to good articles and other resources, which I and others could use to educate ourselves. </p> <ul> <li>What tools (even standard unix tools) can be used to pinpoint bottlenecks?</li> <li>What metrics should be followed to ensure things run smoothly?</li> <li>What kind of things can be efficiently virtualized? </li> <li>What kind of setups are doomed to fail?</li> </ul> <p>I apologize the broadness of the question. I just don't have the knowledge to ask useful specific questions about this.</p> <p>Edit: More on my specific problem:</p> <ul> <li>XAN paravirtualization, 3 x guest CentOS</li> <li>All guests on local SCSI disks, there is a fully hardware raid controller</li> <li>rsyncd running on 1 guest os, transfer initiated from a remote non virtualized server through 100mbps LAN</li> </ul> <p>Like I said before, I really can't provide a ton of useful data. I'm not really expecting to get a direct solution to this problem, I'd be happy with pointers on where to start building the skillset required to better understand these kinds of problems.</p>
[ { "answer_id": 121790, "author": "mlambie", "author_id": 17453, "author_profile": "https://Stackoverflow.com/users/17453", "pm_score": 2, "selected": false, "text": "iostat" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/121743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18037/" ]
121,757
<p>I doubt it can be done portably, but are there any solutions out there? I think it could be done by creating an alternate stack and reseting SP,BP, and IP on function entry, and having yield save IP and restore SP+BP. Destructors and exception safety seem tricky but solvable.</p> <p>Has it been done? Is it impossible?</p>
[ { "answer_id": 121773, "author": "Steve g", "author_id": 12092, "author_profile": "https://Stackoverflow.com/users/12092", "pm_score": 3, "selected": false, "text": "next()" }, { "answer_id": 10776153, "author": "jhasse", "author_id": 647898, "author_profile": "https:...
2008/09/23
[ "https://Stackoverflow.com/questions/121757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19193/" ]
121,762
<p>I have two threads in an Android application, one is the view thread, and the other is the worker thread. What I want to do is, sleep the worker thread until the view thread terminates the handling of the onDraw method.</p> <p>How i can do this? is there any wait for the signal or something?</p>
[ { "answer_id": 121853, "author": "Paul Brinkley", "author_id": 18160, "author_profile": "https://Stackoverflow.com/users/18160", "pm_score": 6, "selected": true, "text": "stick.wait();\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/121762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7363/" ]
121,795
<p>My question is, which version-naming scheme should be used for what type of project.</p> <p>Very common is major.minor.fix, but even this can lead to 4 number (i.e. Firefox 2.0.0.16). Some have a model that odd numbers indicate developer-versions and even numbers stable releases. And all sorts of additions can enter the mix, like -dev3, -rc1, SP2 etc.</p> <p>Exists reasons to prefer one scheme over another and should different type of projects (i.e. Open Source vs. Closed Source) have different version naming schemes?</p>
[ { "answer_id": 121819, "author": "Armin Ronacher", "author_id": 19990, "author_profile": "https://Stackoverflow.com/users/19990", "pm_score": 3, "selected": false, "text": "dev" }, { "answer_id": 305321, "author": "Ramesh Soni", "author_id": 191, "author_profile": "ht...
2008/09/23
[ "https://Stackoverflow.com/questions/121795", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21005/" ]
121,808
<p>I can use properties of an Excel Worksheet to tell if the worksheet is protected (Worksheet.Protection, Worksheet.ProtectContents etc).</p> <p>How can I tell using VBA if the entire workbook has been protected?</p>
[ { "answer_id": 121840, "author": "Guy Starbuck", "author_id": 2194, "author_profile": "https://Stackoverflow.com/users/2194", "pm_score": 2, "selected": false, "text": "Public Function wbAllSheetsProtected(wbTarget As Workbook) As Boolean \n\nDim ws As Worksheet \n\nwbAllSheetsProtected ...
2008/09/23
[ "https://Stackoverflow.com/questions/121808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13087/" ]
121,810
<p><strong>Is there any way that I can remove the Print item from the context menu when you right-click on an email with VBA?</strong></p> <p>I am forever right-clicking to reply to an email, only to accidentally click <code>Print</code> and have Outlook send it directly to the printer quicker than I can stop it.</p> <p><img src="https://farm4.static.flickr.com/3221/2882658372_496d6e7a11_o.jpg" alt="alt text"></p> <p><strong>NB:</strong> I am using Outlook 2007.</p>
[ { "answer_id": 582063, "author": "Will Rickards", "author_id": 290835, "author_profile": "https://Stackoverflow.com/users/290835", "pm_score": 4, "selected": true, "text": "Private Sub Application_ItemContextMenuDisplay(ByVal CommandBar As Office.CommandBar, ByVal Selection As Selection)...
2008/09/23
[ "https://Stackoverflow.com/questions/121810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/383/" ]
121,813
<p>We have redesigned the structure to a website which has several business units. Now I want to redirect (301) to the new page.</p> <p>IE: <br /> was www.example.com/abc <br /> now www.example.com/default.aspx?article=abc <br /></p> <p>I have tried to use Global.asax to do this, and it works properly when I debug through it.</p> <pre><code> if (Request.RawUrl.Contains("abc")) { Response.RedirectLocation = "/default.aspx?article=abc"; Response.StatusCode = 301; Response.StatusDescription = "Moved"; Response.End(); } </code></pre> <p>So <a href="http://localhost:1234/example/abc" rel="nofollow noreferrer">http://localhost:1234/example/abc</a> redirects properly, but (where 1234 is the port for the debugging server)<br/> <a href="http://localhost/example/abc" rel="nofollow noreferrer">http://localhost/example/abc</a> does not redirect, it gives me a 404.</p> <p>Any ideas?</p> <hr> <p>Additional info: If I go to <a href="http://localhost/example/abc/default.aspx" rel="nofollow noreferrer">http://localhost/example/abc/default.aspx</a> then it redirects properly.</p>
[ { "answer_id": 121893, "author": "Dave Anderson", "author_id": 371, "author_profile": "https://Stackoverflow.com/users/371", "pm_score": 2, "selected": false, "text": " *; www.example.com/*; www.example.com/default.aspx?article=$0\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/121813", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18821/" ]
121,817
<p>I need to set the text within a DIV element dynamically. What is the best, browser safe approach? I have prototypejs and scriptaculous available.</p> <pre><code>&lt;div id="panel"&gt; &lt;div id="field_name"&gt;TEXT GOES HERE&lt;/div&gt; &lt;/div&gt; </code></pre> <p>Here's what the function will look like:</p> <pre><code>function showPanel(fieldName) { var fieldNameElement = document.getElementById('field_name'); //Make replacement here } </code></pre>
[ { "answer_id": 121822, "author": "ceejayoz", "author_id": 1902010, "author_profile": "https://Stackoverflow.com/users/1902010", "pm_score": 4, "selected": false, "text": "$('field_name').innerHTML = 'Your text.';\n" }, { "answer_id": 121824, "author": "17 of 26", "author_...
2008/09/23
[ "https://Stackoverflow.com/questions/121817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4893/" ]
121,821
<p>I am creating an SQL view for a file that strips out the spaces in a particular field. My question is if there is a why to set a key on that new view so a person can still CHAIN the file. We are on V5R3.</p>
[ { "answer_id": 149414, "author": "Chris Smith", "author_id": 9073, "author_profile": "https://Stackoverflow.com/users/9073", "pm_score": 0, "selected": false, "text": "OPNQRYF" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/121821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2535/" ]
121,827
<p>I'm looking to implement an ESB and wanted to get thoughts related to "how" my web services might change (WCF) or -- how my client apps that consume these services might "need to be revised" (-- other than a new service ref to the ESB path --)</p> <p>The device I'm working with specifically is the "WebSphere DataPower XML Security Gateway XS40"</p>
[ { "answer_id": 149414, "author": "Chris Smith", "author_id": 9073, "author_profile": "https://Stackoverflow.com/users/9073", "pm_score": 0, "selected": false, "text": "OPNQRYF" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/121827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2701/" ]
121,828
<p>I'm stuck with the following problem. I'm trying to implement a basic GridView paged result set, which connects to an Oracle database. By itself, the GridView, and the paged results, work fine. The problem comes when I try to put it in page layout class that we have at work.</p> <p>We have ClassA, which inherits from Page, and is a corporate standard. Then I have ClassB, which inherits from ClassA and which includes application-specific code. The page that the GridView is on inherits from ClassB. This all seems to work fine in other pages, and I don't think it's the source of the problem, but I thought I'd mention it.</p> <p>What happens is that the first time the page with the GridView loads, everything looks normal. The query runs and the first 10 records are displayed, with the numbers for paging below. When I click on "2" or any of the other pages, I get the "yellow screen of death" with the following message: "Object reference not set to an instance of an object". The object being referred to in that error line is "Me", the Page object (ASP.pagename_aspx in the debugger). I don't believe that the exact line it fails on is that important, because I've switched the order of a few statements around and it just fails on the earliest one. </p> <p>I've traced through with the debugger and it looks normal, only that on Page 1 it works fine, and Page 2 it fails. </p> <p>I have implemented the PageIndexChanging event (again, it works by itself if I remove inheritance from ClassB. Also, if I try inheriting directly from ClassA (bypassing ClassB entirely), I still get the problem.</p> <p>Any ideas? Thanks.</p>
[ { "answer_id": 196035, "author": "Toran Billups", "author_id": 2701, "author_profile": "https://Stackoverflow.com/users/2701", "pm_score": 1, "selected": false, "text": "<asp:GridView ID=\"gridSuppliers\" EnableViewState=\"false\" runat=\"server\" OnPageIndexChanging=\"gridSuppliers_Page...
2008/09/23
[ "https://Stackoverflow.com/questions/121828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
121,847
<p>I hear logarithms mentioned quite a lot in the programming context. They seem to be the solution to many problems and yet I can't seem to find a real-world way of making use of them. I've read the <a href="http://en.wikipedia.org/wiki/Logarithms" rel="noreferrer">Wikipedia entry</a> and that, quite frankly, leaves me none the wiser.</p> <p><strong>So, where can I learn about the real-world programming problems that logarithms solve?</strong> Has anyone got any examples of problems they faced that were solved by implementing a logarithm?</p>
[ { "answer_id": 125030, "author": "joel.neely", "author_id": 3525, "author_profile": "https://Stackoverflow.com/users/3525", "pm_score": 1, "selected": false, "text": "a = b + c\n" }, { "answer_id": 492040, "author": "Community", "author_id": -1, "author_profile": "htt...
2008/09/23
[ "https://Stackoverflow.com/questions/121847", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1944/" ]
121,849
<p>I'm not sure how I should express this, but I'll give it a try. <br /> I recently started coding my portfolio in object-oriented PHP and I'm wondering if it's according to best practices to use a single page where the content changes depending on SQL data and the $_GET variable?</p> <p>If so/not, why?</p> <p>Edit: Take a look at my next post, more in-depth details.</p>
[ { "answer_id": 121943, "author": "Fire Lancer", "author_id": 6266, "author_profile": "https://Stackoverflow.com/users/6266", "pm_score": 2, "selected": false, "text": "<?php\nrequire ('config.php')\nrequire ('start.php')\nrequire ('header.php')\n//custom page stuff\nrequire ('footer.php'...
2008/09/23
[ "https://Stackoverflow.com/questions/121849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/348430/" ]
121,864
<p>As compared to say:</p> <pre><code>REPLICATE(@padchar, @len - LEN(@str)) + @str </code></pre>
[ { "answer_id": 121890, "author": "AlexCuse", "author_id": 794, "author_profile": "https://Stackoverflow.com/users/794", "pm_score": 9, "selected": true, "text": "right('XXXXXXXXXXXX'+ rtrim(@str), @n)\n" }, { "answer_id": 121896, "author": "Tom H", "author_id": 5696608, ...
2008/09/23
[ "https://Stackoverflow.com/questions/121864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18255/" ]
121,866
<p>I'm preparing to deploy my Django app and I noticed that when I change the "DEBUG" setting to False, all references to static files (i.e., JavaScript, CSS, etc..) result in <code>HTTP 500</code> errors.</p> <p>Any idea what's causing that issue (and how to fix it)?</p>
[ { "answer_id": 122052, "author": "Peter Shinners", "author_id": 17209, "author_profile": "https://Stackoverflow.com/users/17209", "pm_score": 5, "selected": true, "text": "urls.py" }, { "answer_id": 38675118, "author": "wcyn", "author_id": 2878244, "author_profile": "...
2008/09/23
[ "https://Stackoverflow.com/questions/121866", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10040/" ]
121,922
<p>I am currently suffering a brain fart. I've done this before but I can't remember the exact syntax and I can't look at the code I wrote because I was working at another company at the time. I have this arrangement:</p> <pre><code>class P { // stuff }; class PW : public P { // more stuff }; class PR : public P { // more stuff }; class C { public: P GetP() const { return p; } private: P p; }; // ... P p = c.GetP( ); // valid PW p = c.GetP( ); // invalid PR p = c.GetP( ); // invalid // ... </code></pre> <p>Now I would like to make P interchangeable with PW and PR (and thus PW and PR can be interchanged). I could probably get away with casts but this code change has occurred quite a few times in this module alone. I am pretty sure it is a operator but for the life of me I can't remember what.</p> <p><strong>How do I make P interchangeable with PW and PR with minimal amount of code?</strong></p> <p><strong>Update:</strong> To give a bit more clarification. P stands for Project and the R and W stands for Reader and Writer respectively. All the Reader has is the code for loading - no variables, and the writer has code for simply Writing. It needs to be separate because the Reading and Writing sections has various manager classes and dialogs which is none of Projects real concern which is the manipulation of project files.</p> <p><strong>Update:</strong> I also need to be able to call the methods of P and PW. So if P has a method a() and PW as a method call b() then I could :</p> <pre><code>PW p = c.GetP(); p.a(); p.b(); </code></pre> <p>It's basically to make the conversion transparent.</p>
[ { "answer_id": 121944, "author": "Carl Seleborg", "author_id": 2095, "author_profile": "https://Stackoverflow.com/users/2095", "pm_score": 2, "selected": false, "text": "PW p = c.GetP()" }, { "answer_id": 121964, "author": "coppro", "author_id": 16855, "author_profile...
2008/09/23
[ "https://Stackoverflow.com/questions/121922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/342/" ]
121,946
<p>Ok, so I just ran into the following problem that raised an eyebrow.</p> <p>For various reasons I have a testing setup where Testing classes in a TestingAssembly.dll depend on the TestingBase class in a BaseTestingAssembly.dll. One of the things the TestBase does in the meantime is look for a certain embedded resource in its own and the calling assembly</p> <p>So my BaseTestingAssembly contained the following lines...</p> <pre><code>public class TestBase { private static Assembly _assembly; private static Assembly _calling_assembly; static TestBase() { _assembly = Assembly.GetExecutingAssembly(); _calling_assembly = Assembly.GetCallingAssembly(); } } </code></pre> <p>Static since I figured, these assemblies would be the same over the application's lifetime so why bother recalculating them on every single test.</p> <p>When running this however I noticed that both _assembly and _calling_assembly were being set to BaseTestingAssembly rather than BaseTestingAssembly and TestingAssembly respectively.</p> <p>Setting the variables to non-static and having them initialized in a regular constructor fixed this but I am confused why this happened to begin this. I thought static constructors run the first time a static member gets referenced. This could only have been from my TestingAssembly which should then have been the caller. Does anyone know what might have happened?</p>
[ { "answer_id": 122060, "author": "Curt Hagenlocher", "author_id": 533, "author_profile": "https://Stackoverflow.com/users/533", "pm_score": 4, "selected": true, "text": "private static Assembly _assembly;\nprivate static Assembly Assembly {\n get {\n if (_assembly == null) _assembly ...
2008/09/23
[ "https://Stackoverflow.com/questions/121946", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5056/" ]
121,962
<p>How can I consistently get the absolute, fully-qualified root or base url of the site regardless of whether the site is in a virtual directory and regardless of where my code is in the directory structure? I've tried every variable and function I can think of and haven't found a good way.</p> <p>I want to be able to get the url of the current site, i.e. <a href="http://www.example.com" rel="nofollow noreferrer">http://www.example.com</a> or if it's a virtual directory, <a href="http://www.example.com/DNN/" rel="nofollow noreferrer">http://www.example.com/DNN/</a></p> <hr> <p>Here's some of the things I've tried and the result. The only one that includes the whole piece that I want (<a href="http://localhost:4471/DNN441" rel="nofollow noreferrer">http://localhost:4471/DNN441</a>) is Request.URI.AbsoluteURI:</p> <ul> <li>Request.PhysicalPath: C:\WebSites\DNN441\Default.aspx</li> <li>Request.ApplicationPath: /DNN441</li> <li>Request.PhysicalApplicationPath: C:\WebSites\DNN441\</li> <li>MapPath: C:\WebSites\DNN441\DesktopModules\Articles\Templates\Default.aspx</li> <li>RawURL: /DNN441/ModuleTesting/Articles/tabid/56/ctl/Details/mid/374/ItemID/1/Default.aspx</li> <li>Request.Url.AbsoluteUri: <a href="http://localhost:4471/DNN441/Default.aspx" rel="nofollow noreferrer">http://localhost:4471/DNN441/Default.aspx</a></li> <li>Request.Url.AbsolutePath: /DNN441/Default.aspx</li> <li>Request.Url.LocalPath: /DNN441/Default.aspx Request.Url.Host: localhost</li> <li>Request.Url.PathAndQuery: /DNN441/Default.aspx?TabId=56&amp;ctl=Details&amp;mid=374&amp;ItemID=1</li> </ul>
[ { "answer_id": 121997, "author": "Stephen Wrighton", "author_id": 7516, "author_profile": "https://Stackoverflow.com/users/7516", "pm_score": 0, "selected": false, "text": "<a href='/'>goes to root</a>" }, { "answer_id": 231475, "author": "EfficionDave", "author_id": 4318...
2008/09/23
[ "https://Stackoverflow.com/questions/121962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4318/" ]
121,979
<p>I want to detect users' screen size and pass this into a charting application (Chart Director by <a href="http://www.advsofteng.com" rel="nofollow noreferrer">http://www.advsofteng.com</a>) to control how big an image to display.</p> <p>I have to use ASP, but I can only think to use JavaScript to detect screen-size and then pass this into the server-side script. Is there an easier way?</p> <p>Thanks</p>
[ { "answer_id": 122135, "author": "Jim", "author_id": 8427, "author_profile": "https://Stackoverflow.com/users/8427", "pm_score": 0, "selected": false, "text": "src" }, { "answer_id": 32599305, "author": "pavurya", "author_id": 3975278, "author_profile": "https://Stack...
2008/09/23
[ "https://Stackoverflow.com/questions/121979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21203/" ]
122,033
<p>Yesterday, I asked <a href="https://stackoverflow.com/questions/119107/how-do-i-generate-a-list-of-n-unique-random-numbers-in-ruby">this</a> question and never really got an answer I was really happy with. I really would like to know how to generate a list of N unique random numbers using a functional language such as Ruby without having to be extremely imperative in style.</p> <p>Since I didn't see anything I really liked, I've written the solution I was looking for in LINQ:</p> <pre><code> static void Main(string[] args) { var temp = from q in GetRandomNumbers(100).Distinct().Take(5) select q; } private static IEnumerable GetRandomNumbers(int max) { Random r = new Random(); while (true) { yield return r.Next(max); } } </code></pre> <p>Can you translate my LINQ to Ruby? Python? Any other functional programming language?</p> <p><strong>Note:</strong> Please try not to use too many loops and conditionals - otherwise the solution is trivial. Also, I'd rather see a solution where you don't have to generate an array much bigger than N so you can then just remove the duplicates and trim it down to N.</p> <p>I know I'm being picky, but I'd really like to see some elegant solutions to this problem. Thanks!</p> <p><strong>Edit:</strong><br /> Why all the downvotes?</p> <p>Originally my code sample had the Distinct() after the Take() which, as many pointed out, could leave me with an empty list. I've changed the order in which those methods are called to reflect what I meant in the first place.</p> <p><strong>Apology:</strong><br /> I've been told this post came across as rather snobbish. I wasn't trying to imply that LINQ is better than Ruby/Python; or that my solution is much better than everyone else's. My intent is just to learn how to do this (with certain constraints) in Ruby. I'm sorry if I came across as a jerk.</p>
[ { "answer_id": 122047, "author": "Dan Lenski", "author_id": 20789, "author_profile": "https://Stackoverflow.com/users/20789", "pm_score": 0, "selected": false, "text": "from numpy import *\na = random.random_integers(0, 100, 5)\nb = unique(a)\n" }, { "answer_id": 122062, "aut...
2008/09/23
[ "https://Stackoverflow.com/questions/122033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/781/" ]
122,057
<p>At present it seems that VS2008 still isn't supported either in the 5.1.5 release or in the STLPort CVS repository. If someone has already done this work then it would be useful to share, if possible :)</p> <p>Likewise it would be useful to know about the changes required for a VS2005 or 2008 x64 build.</p>
[ { "answer_id": 156902, "author": "Len Holgate", "author_id": 7925, "author_profile": "https://Stackoverflow.com/users/7925", "pm_score": 2, "selected": false, "text": "\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\bin\\amd64\\vcvarsamd64.bat" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/122057", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7925/" ]
122,067
<p>I have a site using a custom favicon.ico. The favicon displays as expected in all browsers except IE. When trying to display the favicon in IE, I get the big red x; when displaying the favicon in another browser, it displays just fine. The page source includes and it does work in other browsers. Thanks for your thoughts.</p> <p><strong>EDIT: SOLVED: The source of the issue was the file was a jpg renamed to ico. I created the file as an ico and it is working as expected. Thanks for your input.</strong></p>
[ { "answer_id": 122111, "author": "Oli", "author_id": 12870, "author_profile": "https://Stackoverflow.com/users/12870", "pm_score": 7, "selected": true, "text": "<link rel=\"icon\" href=\"http://www.example.com/favicon.ico\" type=\"image/x-icon\" />\n<link rel=\"shortcut icon\" href=\"htt...
2008/09/23
[ "https://Stackoverflow.com/questions/122067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13465/" ]
122,088
<p>I have a table in a MSSQL database that looks like this:</p> <pre><code>Timestamp (datetime) Message (varchar(20)) </code></pre> <p>Once a day, a particular process inserts the current time and the message 'Started' when it starts. When it is finished it inserts the current time and the message 'Finished'.</p> <p>What is a good query or set of statements that, given a particular date, returns:</p> <ul> <li>0 if the process never started</li> <li>1 if the process started but did not finish</li> <li>2 if the process started and finished</li> </ul> <p>There are other messages in the table, but 'Started' and 'Finished' are unique to this one process.</p> <p>EDIT: For bonus karma, raise an error if the data is invalid, for example there are two 'Started' messages, or there is a 'Finished' without a 'Started'.</p>
[ { "answer_id": 122129, "author": "George Mastros", "author_id": 1408129, "author_profile": "https://Stackoverflow.com/users/1408129", "pm_score": 3, "selected": true, "text": "Select Count(Message) As Status\nFrom Process_monitor\nWhere TimeStamp >= '20080923'\n And TimeStamp < ...
2008/09/23
[ "https://Stackoverflow.com/questions/122088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16881/" ]
122,089
<p>A brief search shows that all available (uUnix command line) tools that convert from xsd (XML Schema) to rng (RelaxNG) or rnc (compact RelaxNG) have problems of some sort.</p> <p>First, if I use rngconv:</p> <pre><code>$ wget https://msv.dev.java.net/files/documents/61/31333/rngconv.20060319.zip $ unzip rngconv.20060319.zip $ cd rngconv-20060319/ $ java -jar rngconv.jar my.xsd &gt; my.rng </code></pre> <p>It does not have a way to de-normalize elements so all end up being alternative start elements (it also seems to be a bit buggy).</p> <p>Trang is an alternative, but it doesn't support xsd files on the input only on the output (why?). It supports DTD, however. Converting to DTD first comes to mind, but a solid xsd2dtd is hard to find as well. The one below:</p> <pre><code> $ xsltproc http://crism.maden.org/consulting/pub/xsl/xsd2dtd.xsl in.xsd &gt; out.dtd </code></pre> <p>Seems to be buggy.</p> <p>All this is very surprising. For all these years of XML (ab)use, there no decent command line tools for these trivial basic tasks? Are people using only editors? Do those work? I much prefer command line, especially because I'd like to automate these tasks.</p> <p>Any enlightening comments on this?</p>
[ { "answer_id": 1095094, "author": "neozen", "author_id": 59412, "author_profile": "https://Stackoverflow.com/users/59412", "pm_score": 2, "selected": false, "text": "1.xml 2.xml 3.xml 4.xml 5.xml" }, { "answer_id": 2302117, "author": "antonj", "author_id": 183994, "au...
2008/09/23
[ "https://Stackoverflow.com/questions/122089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21205/" ]
122,097
<p>I am wondering what primers/guides/tutorials/etc. are out there for learning to rewrite URLs using Apache/.htaccess? Where is a good place to start?</p> <p>My primary interest is learning how to point certain directories to others, and how to use portions of a URL as parameters to a script (i.e. "/some/subdirs/like/this" => "script.php?a=some&amp;b=subdirs&amp;c=like&amp;d=this").</p>
[ { "answer_id": 122164, "author": "Kyle Burton", "author_id": 19784, "author_profile": "https://Stackoverflow.com/users/19784", "pm_score": 2, "selected": false, "text": "RewriteRule ^/games.* /usr/local/games/web\nRewriteRule ^/product/(.*)/view$ /var/web/productdb/$1\n" } ]
2008/09/23
[ "https://Stackoverflow.com/questions/122097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5291/" ]
122,098
<p>I have a Google Web Toolkit (GWT) application and when I link to it, I want to pass some arguments/parameters that it can use to dynamically retrieve data. E.g. if it were a stock chart application, I would want my link to contain the symbol and then have the GWT app read that and make a request to some stock service. E.g. <a href="http://myapp/gwt/StockChart?symbol=GOOG" rel="noreferrer">http://myapp/gwt/StockChart?symbol=GOOG</a> would be the link to my StockChart GWT app and it would make a request to my stock info web service for the GOOG stock. </p> <p>So far, I've been using the server-side code to add Javascript variables to the page and then I've read those variables using JSNI (JavaScript Native Interface). </p> <p>For example:</p> <p>In the host HTML:</p> <pre><code>&lt;script type="text/javascript"&gt; var stockSymbol = '&lt;%= request.getParameter("symbol") %&gt;'; &lt;/script&gt; </code></pre> <p>In the GWT code:</p> <pre><code>public static native String getSymbol() /*-{ return $wnd.stockSymbol; }-*/; </code></pre> <p>(Although this code is based on real code that works, I've modified it for this question so I might have goofed somewhere)</p> <p>However, this doesn't always work well in hosted mode (especially with arrays) and since JSNI wasn't around in version 1.4 and previous, I'm guessing there's another/better way. </p>
[ { "answer_id": 122833, "author": "Drejc", "author_id": 6482, "author_profile": "https://Stackoverflow.com/users/6482", "pm_score": 4, "selected": true, "text": "// returns whole query string \npublic static String getQueryString() \n{\n return Window.Location.getQueryString();\n}\n\n/...
2008/09/23
[ "https://Stackoverflow.com/questions/122098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9910/" ]
122,102
<p>What is the most efficient way to clone a JavaScript object? I've seen <code>obj = eval(uneval(o));</code> being used, but <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/uneval" rel="noreferrer">that's non-standard and only supported by Firefox</a>.<br/><br/> I've done things like <code>obj = JSON.parse(JSON.stringify(o));</code> but question the efficiency. <br/><br/> I've also seen recursive copying functions with various flaws. <br /> I'm surprised no canonical solution exists.</p>
[ { "answer_id": 122190, "author": "ConroyP", "author_id": 2287, "author_profile": "https://Stackoverflow.com/users/2287", "pm_score": 9, "selected": false, "text": "function clone(obj) {\n if (obj === null || typeof (obj) !== 'object' || 'isActiveClone' in obj)\n return obj;\n\n...
2008/09/23
[ "https://Stackoverflow.com/questions/122102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12694/" ]
122,104
<p>Say I have a page that display search results. I search for stackoverflow and it returns 5000 results, 10 per page. Now I find myself doing this when building links on that page:</p> <pre><code>&lt;%=Html.ActionLink("Page 1", "Search", new { query=ViewData["query"], page etc..%&gt; &lt;%=Html.ActionLink("Page 2", "Search", new { query=ViewData["query"], page etc..%&gt; &lt;%=Html.ActionLink("Page 3", "Search", new { query=ViewData["query"], page etc..%&gt; &lt;%=Html.ActionLink("Next", "Search", new { query=ViewData["query"], page etc..%&gt; </code></pre> <p>I dont like this, I have to build my links with careful consideration to what was posted previously etc.. </p> <p>What I'd like to do is</p> <pre><code>&lt;%=Html.BuildActionLinkUsingCurrentActionPostData ("Next", "Search", new { Page = 1}); </code></pre> <p>where the anonymous dictionary overrides anything currently set by previous action. </p> <p>Essentially I care about what the previous action parameters were, because I want to reuse, it sounds simple, but start adding sort and loads of advance search options and it starts getting messy.</p> <p>Im probably missing something obvious</p>
[ { "answer_id": 123454, "author": "Switters", "author_id": 1860358, "author_profile": "https://Stackoverflow.com/users/1860358", "pm_score": 1, "selected": false, "text": "<div id=\"product_list\">\n <% foreach (TestMVC.Product product in ViewData.Model)\n { %>\n ...
2008/09/23
[ "https://Stackoverflow.com/questions/122104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
122,105
<p>I want to filter a <code>java.util.Collection</code> based on a predicate.</p>
[ { "answer_id": 122204, "author": "jon", "author_id": 12215, "author_profile": "https://Stackoverflow.com/users/12215", "pm_score": 3, "selected": false, "text": "public interface Predicate<T> {\n public boolean filter(T t);\n}\n\nvoid filterCollection(Collection<T> col, Predicate<T> pre...
2008/09/23
[ "https://Stackoverflow.com/questions/122105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4792/" ]
122,107
<p><strong>"It is not possible to check out a single file. The finest level of checkouts you can do is at the directory level."</strong></p> <p>How do I get around this issue when using Subversion?</p> <p>We have this folder in Subversion where we keep all our images. I just want to check out one file (image) from that. This folder is really big and has ton of other stuff which I don't need now.</p>
[ { "answer_id": 122126, "author": "Milan Babuškov", "author_id": 14690, "author_profile": "https://Stackoverflow.com/users/14690", "pm_score": 6, "selected": false, "text": "svn cat" }, { "answer_id": 122134, "author": "Mnementh", "author_id": 21005, "author_profile": ...
2008/09/23
[ "https://Stackoverflow.com/questions/122107", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1175964/" ]
122,108
<p>I have implemented the WMD control that Stack Overflow uses into a project of mine, it <strong>almost</strong> works like a charm, but when I save the changes to the database it is saving the HTML version and not the Markdown version.</p> <p>So where I have this in my text box:</p> <pre><code>**boldtext** </code></pre> <p>It is really saving this:</p> <pre><code>&lt;b&gt;boldtext&lt;/b&gt; </code></pre> <p>How do I make it save the Markdown version?</p>
[ { "answer_id": 122572, "author": "Clinton Dreisbach", "author_id": 6262, "author_profile": "https://Stackoverflow.com/users/6262", "pm_score": 4, "selected": true, "text": "wmd.js" }, { "answer_id": 5369774, "author": "Ryan Yonzon", "author_id": 668358, "author_profil...
2008/09/23
[ "https://Stackoverflow.com/questions/122108", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1768/" ]
122,110
<p>I'm a big fan of the Jadclipse plugin and I'd really like to upgrade to Eclipse 3.4 but the plugin currently does not work. Are there any other programs out there that let you use jad to view source of code you navigate to from Eclipse? (Very useful when delving into ambiguous code in stack traces).</p>
[ { "answer_id": 442887, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "java.lang.IncompatibleClassChangeError\n at net.sf.jadclipse.JadclipseClassFileEditor.doOpenBuffer(JadclipseClassFileEd...
2008/09/23
[ "https://Stackoverflow.com/questions/122110", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5885/" ]
122,115
<p>Ruby's standard popen3 module does not work on Windows. Is there a maintained replacement that allows for separating stdin, stdout, and stderr?</p>
[ { "answer_id": 122222, "author": "Max Caceres", "author_id": 4842, "author_profile": "https://Stackoverflow.com/users/4842", "pm_score": 4, "selected": true, "text": "require 'rubygems'\nrequire 'popen4'\n\nstatus =\n POpen4::popen4(\"cmd\") do |stdout, stderr, stdin, pid|\n stdin.pu...
2008/09/23
[ "https://Stackoverflow.com/questions/122115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4842/" ]
122,127
<p>In order to create the proper queries I need to be able to run a query against the same datasource that the report is using. How do I get that information <strong>programatically</strong>? Preferably the connection string or pieces of data used to build the connection string.</p>
[ { "answer_id": 122423, "author": "Orion Adrian", "author_id": 7756, "author_profile": "https://Stackoverflow.com/users/7756", "pm_score": 2, "selected": true, "text": "DataSourceDefinition dataSourceDefinition \n = reportingService.GetDataSourceContents(\"DataSourceName\");\n\nstring ...
2008/09/23
[ "https://Stackoverflow.com/questions/122127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7756/" ]
122,144
<p>Im calling a locally hosted wcf service from silverlight and I get the exception below.</p> <p>Iv created a clientaccesspolicy.xml, which is situated in the route of my host.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;access-policy&gt; &lt;cross-domain-access&gt; &lt;policy&gt; &lt;allow-from http-request-headers="*"&gt; &lt;domain uri="*"/&gt; &lt;/allow-from&gt; &lt;grant-to&gt; &lt;resource path="/" include-subpaths="true"/&gt; &lt;/grant-to&gt; &lt;/policy&gt; &lt;/cross-domain-access&gt; &lt;/access-policy&gt; </code></pre> <blockquote> <p>An error occurred while trying to make a request to URI '<a href="http://localhost:8005/Service1.svc" rel="nofollow noreferrer">http://localhost:8005/Service1.svc</a>'. This could be due to a cross domain configuration error. Please see the inner exception for more details. ---></p> <p>{System.Security.SecurityException ---> System.Security.SecurityException: Security error. at MS.Internal.InternalWebRequest.Send() at System.Net.BrowserHttpWebRequest.BeginGetResponseImplementation() at System.Net.BrowserHttpWebRequest.InternalBeginGetResponse(AsyncCallback callback, Object state) at System.Net.AsyncHelper.&lt;>c__DisplayClass4.b__3(Object sendState) --- End of inner exception stack trace --- at System.Net.AsyncHelper.BeginOnUI(BeginMethod beginMethod, AsyncCallback callback, Object state) at System.Net.BrowserHttpWebRequest.BeginGetResponse(AsyncCallback callback, Object state) at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteSend(IAsyncResult result) at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.OnSend(IAsyncResult result)}</p> </blockquote> <p>Any ideas on how to progress?</p>
[ { "answer_id": 123432, "author": "Dan", "author_id": 230, "author_profile": "https://Stackoverflow.com/users/230", "pm_score": 2, "selected": false, "text": "<!DOCTYPE cross-domain-policy SYSTEM \"http://www.adobe.com/xml/dtds/cross-domain-policy.dtd\">\n<cross-domain-policy>\n <allow-h...
2008/09/23
[ "https://Stackoverflow.com/questions/122144", "https://Stackoverflow.com", "https://Stackoverflow.com/users/230/" ]
122,154
<p>I'm using Team Foundation Build but we aren't yet using TFS for problem tracking, so I would like to disable the work item creation on a failed build. Is there any way to do this? I tried commenting out the work item info in the TFSBuild.proj file for the build type but that didn't do the trick.</p>
[ { "answer_id": 122660, "author": "Tim Booker", "author_id": 10046, "author_profile": "https://Stackoverflow.com/users/10046", "pm_score": 6, "selected": true, "text": "<SkipWorkItemCreation>true</SkipWorkItemCreation>\n" }, { "answer_id": 51420939, "author": "Beingnin", "...
2008/09/23
[ "https://Stackoverflow.com/questions/122154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/327/" ]
122,160
<p>I'm a big fan of the way Visual Studio will give you the comment documentation / parameter names when completing code that you have written and ALSO code that you are referencing (various libraries/assemblies).</p> <p>Is there an easy way to get inline javadoc/parameter names in Eclipse when doing code complete or hovering over methods? Via plugin? Via some setting? It's extremely annoying to use a lot of libraries (as happens often in Java) and then have to go to the website or local javadoc location to lookup information when you have it in the source jars right there!</p>
[ { "answer_id": 122182, "author": "Henry B", "author_id": 6414, "author_profile": "https://Stackoverflow.com/users/6414", "pm_score": 7, "selected": false, "text": "Source Attachment: (none)\nJavadoc location: (none)\nNative library location: (none)\nAccess rules: (No restrictions)\n" }...
2008/09/23
[ "https://Stackoverflow.com/questions/122160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5885/" ]