qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
20,722
<p>How can I efficiently and effectively detect the version and, for that matter, any available information about the instance of <a href="http://silverlight.net/" rel="nofollow noreferrer">Silverlight</a> currently running on the browser?</p>
[ { "answer_id": 20745, "author": "Bryan Roth", "author_id": 299, "author_profile": "https://Stackoverflow.com/users/299", "pm_score": 2, "selected": false, "text": "Silverlight.isInstalled = function(d)\n{\n var c = false, a = null;\n try\n {\n var b = null;\n if(Si...
2008/08/21
[ "https://Stackoverflow.com/questions/20722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/375/" ]
20,731
<p>I've tried several things already,</p> <pre><code>std::stringstream m; m.empty(); m.clear(); </code></pre> <p>both of which don't work.</p>
[ { "answer_id": 20732, "author": "CodingWithoutComments", "author_id": 25, "author_profile": "https://Stackoverflow.com/users/25", "pm_score": 5, "selected": false, "text": "m.str(\"\");\n" }, { "answer_id": 20792, "author": "Wilka", "author_id": 1367, "author_profile"...
2008/08/21
[ "https://Stackoverflow.com/questions/20731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25/" ]
20,744
<p>Using the viewer control for display of SQL Reporting Services reports on web page (Microsoft.ReportViewer.WebForms), can you move the View Report button? It defaults to the very right side of the report, which means you have to scroll all the way across before the button is visible. Not a problem for reports that f...
[ { "answer_id": 886149, "author": "Liron Yahdav", "author_id": 62, "author_profile": "https://Stackoverflow.com/users/62", "pm_score": 3, "selected": true, "text": "function getRepViewBtn() {\n return document.getElementsByName(\"ReportViewer1$ctl00$ctl00\")[0];\n}\n\nfunction hideViewRe...
2008/08/21
[ "https://Stackoverflow.com/questions/20744", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1215/" ]
20,762
<p>Is there any easy/general way to clean an XML based data source prior to using it in an XmlReader so that I can gracefully consume XML data that is non-conformant to the hexadecimal character restrictions placed on XML?</p> <p>Note: </p> <ul> <li>The solution needs to handle XML data sources that use character enc...
[ { "answer_id": 20777, "author": "Eugene Katz", "author_id": 1533, "author_profile": "https://Stackoverflow.com/users/1533", "pm_score": 7, "selected": true, "text": "/// <summary>\n/// Removes control characters and other non-UTF-8 characters\n/// </summary>\n/// <param name=\"inString\"...
2008/08/21
[ "https://Stackoverflow.com/questions/20762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2029/" ]
20,778
<p>I have binary data in a file that I can read into a byte array and process with no problem. Now I need to send parts of the data over a network connection as elements in an XML document. My problem is that when I convert the data from an array of bytes to a String and back to an array of bytes, the data is getting...
[ { "answer_id": 20860, "author": "McDowell", "author_id": 304, "author_profile": "https://Stackoverflow.com/users/304", "pm_score": 5, "selected": false, "text": "byte[] bytes = loadFile(file); \n//all chars in encoded are guaranteed to be 7-bit ASCII\nbyte[] encoded = Base64.enc...
2008/08/21
[ "https://Stackoverflow.com/questions/20778", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1288/" ]
20,787
<p>In what situation would it be more appropriate for me to use a bitset (STL container) to manage a set of flags rather than having them declared as a number of separate (bool) variables?</p> <p>Will I get a significant performance gain if I used a bitset for 50 flags rather than using 50 separate bool variables?</p>...
[ { "answer_id": 20916, "author": "Herms", "author_id": 1409, "author_profile": "https://Stackoverflow.com/users/1409", "pm_score": 2, "selected": false, "text": "struct MyBitset {\n bool firstOption:1;\n bool secondOption:1;\n bool thirdOption:1;\n int fourBitNumber:4;\n};\n MyBitset ...
2008/08/21
[ "https://Stackoverflow.com/questions/20787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/381/" ]
20,794
<p>If I call <code>os.stat()</code> on a broken <code>symlink</code>, python throws an <code>OSError</code> exception. This makes it useful for finding them. However, there are a few other reasons that <code>os.stat()</code> might throw a similar exception. Is there a more precise way of detecting broken <code>symlinks...
[ { "answer_id": 20843, "author": "dlamblin", "author_id": 459, "author_profile": "https://Stackoverflow.com/users/459", "pm_score": 2, "selected": false, "text": "find . -type f -exec test \\{} -ef /path/to/file \\; -print man test -L -h head -0 FILE1 0 1" }, { "answer_id": 20845,...
2008/08/21
[ "https://Stackoverflow.com/questions/20794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1892/" ]
20,797
<p>I have a byte array in memory, read from a file. I would like to split the byte array at a certain point (index) without having to just create a new byte array and copy each byte at a time, increasing the in memory foot print of the operation. What I would like is something like this:</p> <pre><code>byte[] largeBy...
[ { "answer_id": 20826, "author": "Stu", "author_id": 414, "author_profile": "https://Stackoverflow.com/users/414", "pm_score": 0, "selected": false, "text": "std::vector<int> IEnumerable<>" }, { "answer_id": 20949, "author": "Michał Piaskowski", "author_id": 1534, "aut...
2008/08/21
[ "https://Stackoverflow.com/questions/20797", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1048/" ]
20,840
<p>Why should I or shouldn't I use dirty reads:</p> <pre><code>set transaction isolation level read uncommitted </code></pre> <p>in SQL Server?</p>
[ { "answer_id": 34477845, "author": "K ROHAN", "author_id": 5719882, "author_profile": "https://Stackoverflow.com/users/5719882", "pm_score": -1, "selected": false, "text": "Select * from table_name with(nolock) \n" } ]
2008/08/21
[ "https://Stackoverflow.com/questions/20840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/357/" ]
20,850
<p>I'm a bit newbieish when it comes to the deeper parts of OSX configuration and am having to put up with a fairly irritating niggle which while I can put up with it, I know under Windows I could have sorted in minutes.</p> <p>Basically, I have an external disk with two volumes: </p> <p>One is an HFS+ volume which I...
[ { "answer_id": 36907, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 3, "selected": true, "text": "/etc/fstab LABEL=VolumeName none ntfs noauto\n /etc/fstab.hd diskarbitrationd" } ]
2008/08/21
[ "https://Stackoverflow.com/questions/20850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1120/" ]
20,852
<p>I'd like to be able to track file read/writes of specific program invocations. No information about the actual transactions is required, just the file names involved.</p> <p>Is there a cross platform solution to this? <br /> What are various platform specific methods? <br /> On Linux I know there's strace/ptrace...
[ { "answer_id": 21269, "author": "Mat Noguchi", "author_id": 1799, "author_profile": "https://Stackoverflow.com/users/1799", "pm_score": 1, "selected": false, "text": "ReadDirectoryChangesW" } ]
2008/08/21
[ "https://Stackoverflow.com/questions/20852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1164871/" ]
20,856
<p>I've heard of a few ways to implement tagging; using a mapping table between TagID and ItemID (makes sense to me, but does it scale?), adding a fixed number of possible TagID columns to ItemID (seems like a bad idea), Keeping tags in a text column that's comma separated (sounds crazy but could work). I've even heard...
[ { "answer_id": 20871, "author": "Yaakov Ellis", "author_id": 51, "author_profile": "https://Stackoverflow.com/users/51", "pm_score": 10, "selected": true, "text": "Table: Item\nColumns: ItemID, Title, Content\n\nTable: Tag\nColumns: TagID, Title\n\nTable: ItemTag\nColumns: ItemID, TagID\...
2008/08/21
[ "https://Stackoverflow.com/questions/20856", "https://Stackoverflow.com", "https://Stackoverflow.com/users/459/" ]
20,876
<p>I'm new to SQL Server Reporting Services, and was wondering the best way to do the following:</p> <blockquote> <ul> <li>Query to get a list of popular IDs</li> <li>Subquery on each item to get properties from another table</li> </ul> </blockquote> <p>Ideally, the final report columns would look like this:<...
[ { "answer_id": 20914, "author": "Carlton Jenke", "author_id": 1215, "author_profile": "https://Stackoverflow.com/users/1215", "pm_score": 0, "selected": false, "text": "select *,\n (select count(*) from tbl2 t2 where t2.tbl1ID = t1.tbl1ID) as cnt\nfrom tbl1 t1\n declare @tbl1 table\n(\n ...
2008/08/21
[ "https://Stackoverflow.com/questions/20876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/109/" ]
20,882
<p>Some things look strange to me:</p> <ul> <li>What is the distinction between 0.0.0.0, 127.0.0.1, and [::]?</li> <li>How should each part of the foreign address be read (part1:part2)?</li> <li>What does a state Time_Wait, Close_Wait mean?</li> <li>etc.</li> </ul> <p>Could someone give a quick overview of how to int...
[ { "answer_id": 2247948, "author": "PlanetUnknown", "author_id": 179521, "author_profile": "https://Stackoverflow.com/users/179521", "pm_score": 2, "selected": false, "text": "TCP Connection States SYN_SEND SYN_RECEIVED ESTABLISHED LISTEN TIMED_WAIT CLOSE_WAIT FIN_WAIT_2 LAST_ACK CLOSED" ...
2008/08/21
[ "https://Stackoverflow.com/questions/20882", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1946/" ]
20,910
<p>My company develops several types of applications. A lot of our business comes from doing multimedia-type apps, typically done in Flash. However, now that side of the house is starting to migrate towards doing Flex development.</p> <p>Most of our other development is done using .NET. I'm trying to make a push to...
[ { "answer_id": 1508585, "author": "Akash Kava", "author_id": 85597, "author_profile": "https://Stackoverflow.com/users/85597", "pm_score": 4, "selected": false, "text": "e.g.\n// this is possible in flex..\n// but not in silverlight\n<mx:TextBox id=\"firstName\"/>\n<mx:TextBox id=\"lastN...
2008/08/21
[ "https://Stackoverflow.com/questions/20910", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1226/" ]
20,912
<p>I'm trying to do a file system backup of a RedHat Enterprise Linux v4 server using Symantec Backup Exec 11d (Rev 7170). The backup server is Windows Server 2003.</p> <p>I can browse the target server to create a selection list, and when I do a test run it completes successfully.</p> <p>However, when I run a real ...
[ { "answer_id": 30982, "author": "Tyler Gooch", "author_id": 1372, "author_profile": "https://Stackoverflow.com/users/1372", "pm_score": 0, "selected": false, "text": "[root@MYSERVER ~]# service iptables status \nTable: filter \nChain INPUT (policy ACCEPT) \ntarget prot opt source ...
2008/08/21
[ "https://Stackoverflow.com/questions/20912", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1372/" ]
20,923
<p>I need to script the creation of app pools and websites on IIS 6.0. I have been able to create these using adsutil.vbs and iisweb.vbs, but don't know how to set the version of ASP.NET for the sites I have just created to 2.0.50727.0.</p> <p>Ideally I would like to adsutil.vbs to update the metabase. How do I do thi...
[ { "answer_id": 20953, "author": "Chris Miller", "author_id": 206, "author_profile": "https://Stackoverflow.com/users/206", "pm_score": 2, "selected": false, "text": "'******************************************************************************************\n' Name: SetASPDotNetVersion\n...
2008/08/21
[ "https://Stackoverflow.com/questions/20923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/636/" ]
20,926
<p>Today I was working on a tab navigation for a webpage. I tried the <a href="http://www.alistapart.com/articles/slidingdoors2/" rel="noreferrer">Sliding Doors</a> approach which worked fine. Then I realized that I must include an option to delete a tab (usually a small X in the right corner of each tab). </p> <p>I w...
[ { "answer_id": 20944, "author": "Yaakov Ellis", "author_id": 51, "author_profile": "https://Stackoverflow.com/users/51", "pm_score": 4, "selected": true, "text": "<a class=\"page_tab page_tab\">\n <div class=\"page_title\" title=\"Click to rename this page.\">Click & Type Page Name</div...
2008/08/21
[ "https://Stackoverflow.com/questions/20926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2078/" ]
20,927
<p>I've got two models: Message and Attachment. Each attachment is attached to a specific message, using a ForeignKey on the Attachment model. Both models have an auto_now DateTimeField called updated. I'm trying to make it so that when any attachment is saved, it also sets the updated field on the associated message t...
[ { "answer_id": 72359, "author": "zgoda", "author_id": 12138, "author_profile": "https://Stackoverflow.com/users/12138", "pm_score": 1, "selected": false, "text": "save()" }, { "answer_id": 33449486, "author": "Serjik", "author_id": 546822, "author_profile": "https://S...
2008/08/21
[ "https://Stackoverflow.com/questions/20927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1914/" ]
20,952
<p>I'm trying to unit test a custom ConfigurationSection I've written, and I'd like to load some arbitrary configuration XML into a <a href="http://msdn.microsoft.com/en-us/library/system.configuration.configuration.aspx" rel="noreferrer">System.Configuration.Configuration</a> for each test (rather than put the test co...
[ { "answer_id": 704817, "author": "Oliver Pearmain", "author_id": 334395, "author_profile": "https://Stackoverflow.com/users/334395", "pm_score": 5, "selected": true, "text": "public class MyXmlCustomConfigSection : MyCustomConfigSection\n{\n public MyXmlCustomConfigSection (string con...
2008/08/21
[ "https://Stackoverflow.com/questions/20952", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2338/" ]
20,958
<p>I'm designing a database table and asking myself this question: <em>How long should the firstname field be?</em></p> <p>Does anyone have a list of reasonable lengths for the most common fields, such as first name, last name, and email address?</p>
[ { "answer_id": 10103305, "author": "Micheal Mouner Mikhail Youssif", "author_id": 1119452, "author_profile": "https://Stackoverflow.com/users/1119452", "pm_score": 2, "selected": false, "text": "+------------+---------------+---------------------------------+\n| Field | Length (Char...
2008/08/21
[ "https://Stackoverflow.com/questions/20958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/437/" ]
20,959
<p>How can I determine all of the assemblies that my .NET desktop application has loaded? I'd like to put them in the about box so I can query customers over the phone to determine what version of XYZ they have on their PC.</p> <p>It would be nice to see both managed and unmanaged assemblies. I realize the list will...
[ { "answer_id": 20970, "author": "Nick", "author_id": 1490, "author_profile": "https://Stackoverflow.com/users/1490", "pm_score": 0, "selected": false, "text": "AppDomain.CurrentDomain.GetAssemblies();" }, { "answer_id": 20974, "author": "Greg Hurlman", "author_id": 35, ...
2008/08/21
[ "https://Stackoverflow.com/questions/20959", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1490/" ]
20,993
<p>When creating a web application, and lets say you have a User object denoting a single user, what do you think is the best way to store that the user has logged in?</p> <p>Two ways I've thought about have been:</p> <ul> <li>Stored the user database id in a session variable</li> <li>Stored the entire user object in...
[ { "answer_id": 21344, "author": "tghw", "author_id": 2363, "author_profile": "https://Stackoverflow.com/users/2363", "pm_score": 3, "selected": false, "text": "|Session |UserID | |--------+-------| |a1d4e...+ 12345 | |--------+-------| |c64b2...+ 23456 | |--------+-------|" } ]
2008/08/21
[ "https://Stackoverflow.com/questions/20993", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1610/" ]
20,998
<p>When I try to create a SQL Server Login by saying</p> <pre><code>CREATE LOGIN [ourdomain\SQLAccessGroup] FROM WINDOWS; </code></pre> <p>I get this error</p> <blockquote> <p>The server principal 'ourdomain\SQLAccessGroup' already exists.</p> </blockquote> <p>However, when I try this code</p> <pre><code>DROP LO...
[ { "answer_id": 21074, "author": "Pete", "author_id": 76, "author_profile": "https://Stackoverflow.com/users/76", "pm_score": 4, "selected": true, "text": "The login already has an account under a different user name.\n" }, { "answer_id": 21115, "author": "jonezy", "author...
2008/08/21
[ "https://Stackoverflow.com/questions/20998", "https://Stackoverflow.com", "https://Stackoverflow.com/users/76/" ]
21,027
<p>Is it possible to change how <kbd>Ctrl</kbd> + <kbd>Tab</kbd> and <kbd>Shift</kbd> + <kbd>Ctrl</kbd> + <kbd>Tab</kbd> work in Visual Studio? I have disabled the popup navigator window, because I only want to switch between items in the tab control. My problem is the inconsistency of what switching to the next and pr...
[ { "answer_id": 21092, "author": "PabloG", "author_id": 394, "author_profile": "https://Stackoverflow.com/users/394", "pm_score": -1, "selected": false, "text": "#IfWinActive Microsoft Excel (application specific remapping)\n\n; Printing area in Excel (@ Ctrl+Alt+A)\n^!a::\nSend !ade\nret...
2008/08/21
[ "https://Stackoverflow.com/questions/21027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2277/" ]
21,052
<p>When I'm working with DataBound controls in ASP.NET 2.0 such as a Repeater, I know the fastest way to retrieve a property of a bound object (instead of using Reflection with the Eval() function) is to cast the DataItem object to the type it is and then use that object natively, like the following:</p> <pre><code>&l...
[ { "answer_id": 21056, "author": "Shawn", "author_id": 26, "author_profile": "https://Stackoverflow.com/users/26", "pm_score": 7, "selected": true, "text": "<%@ Import Namespace=\"RootNamespace.SubNamespace1\" %> \n" } ]
2008/08/21
[ "https://Stackoverflow.com/questions/21052", "https://Stackoverflow.com", "https://Stackoverflow.com/users/392/" ]
21,060
<p>I'm tired of being in the middle of typing something, having a pop-up with a question appear, and hitting enter before reading it... (it also happens with some windows that are not pop-ups)</p> <p>Do you know if there's some setting I could touch for this not to happen?</p>
[ { "answer_id": 21056, "author": "Shawn", "author_id": 26, "author_profile": "https://Stackoverflow.com/users/26", "pm_score": 7, "selected": true, "text": "<%@ Import Namespace=\"RootNamespace.SubNamespace1\" %> \n" } ]
2008/08/21
[ "https://Stackoverflow.com/questions/21060", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1782/" ]
21,078
<p>What's the most efficient way to concatenate strings?</p>
[ { "answer_id": 21084, "author": "TheSmurf", "author_id": 1975282, "author_profile": "https://Stackoverflow.com/users/1975282", "pm_score": 2, "selected": false, "text": "StringBuilder sb = new StringBuilder();\nsb.Append(\"string1\");\nsb.Append(\"string2\");\n...etc...\nString strResult...
2008/08/21
[ "https://Stackoverflow.com/questions/21078", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2358/" ]
21,091
<p>Programming languages had several (r)evolutionary steps in their history. Some people argue that model-driven approaches will be The Next Big Thing. There are tools like openArchitectureWare, AndroMDA, Sculptor/Fornax Platform etc. that promise incredible productivity boosts. However, I made the experience that it i...
[ { "answer_id": 320316, "author": "jbandi", "author_id": 32749, "author_profile": "https://Stackoverflow.com/users/32749", "pm_score": 3, "selected": false, "text": "class Firm < ActiveRecord::Base\n has_many :clients\n has_one :account\n belongs_to :conglomorate\nend\n" } ]
2008/08/21
[ "https://Stackoverflow.com/questions/21091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1793/" ]
21,133
<p>What's the easiest way to profile a PHP script?</p> <p>I'd love tacking something on that shows me a dump of all function calls and how long they took but I'm also OK with putting something around specific functions.</p> <p>I tried experimenting with the <a href="http://php.net/microtime" rel="noreferrer">microtim...
[ { "answer_id": 21139, "author": "Eric Lamb", "author_id": 538, "author_profile": "https://Stackoverflow.com/users/538", "pm_score": 3, "selected": false, "text": "microtime() get_memory_usage() get_peak_memory_usage()" }, { "answer_id": 21189, "author": "Vincent", "author...
2008/08/21
[ "https://Stackoverflow.com/questions/21133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/305/" ]
21,184
<p>I've got a System.Generic.Collections.List(Of MyCustomClass) type object.</p> <p>Given integer varaibles pagesize and pagenumber, how can I query only any single page of MyCustomClass objects?</p>
[ { "answer_id": 21389, "author": "Espo", "author_id": 2257, "author_profile": "https://Stackoverflow.com/users/2257", "pm_score": 6, "selected": true, "text": "var pageNum = 3;\nvar pageSize = 20;\nquery = query.Skip((pageNum - 1) * pageSize).Take(pageSize);\n query.Page(2,50)\n" }, {...
2008/08/21
[ "https://Stackoverflow.com/questions/21184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83/" ]
21,207
<p>I'm currently trying out db4o (the java version) and I pretty much like what I see. But I cannot help wondering how it does perform in a real live (web-)environment. Does anyone have any experiences (good or bad) to share about running db4o? </p>
[ { "answer_id": 24499, "author": "Judah Gabriel Himango", "author_id": 536, "author_profile": "https://Stackoverflow.com/users/536", "pm_score": 7, "selected": true, "text": "// C# syntax for \"Find all MyFoos with Bar == 23\".\n// (Note the Java syntax is more verbose using the Predicate...
2008/08/21
[ "https://Stackoverflow.com/questions/21207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1562/" ]
21,232
<p>I've got a System.Generic.Collections.List(Of MyCustomClass) type object.</p> <p>Given integer varaibles pagesize and pagenumber, how can I collect only any single page of <code>MyCustomClass</code> objects?</p> <p>This is what I've got. How can I improve it?</p> <pre><code>'my given collection and paging parame...
[ { "answer_id": 21267, "author": "FlySwat", "author_id": 1965, "author_profile": "https://Stackoverflow.com/users/1965", "pm_score": 1, "selected": false, "text": "List<int> lolInts = new List<int>();\n\nfor (int i = 0; i <= 100; i++)\n{\n lolInts.Add(i);\n}\n\nList<int> page1 = lolInt...
2008/08/21
[ "https://Stackoverflow.com/questions/21232", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83/" ]
21,265
<p>What is the best method for comparing IEEE floats and doubles for equality? I have heard of several methods, but I wanted to see what the community thought.</p>
[ { "answer_id": 21277, "author": "DrPizza", "author_id": 2131, "author_profile": "https://Stackoverflow.com/users/2131", "pm_score": 4, "selected": true, "text": "bool is_nan(float f)\n{\n return (*reinterpret_cast<unsigned __int32*>(&f) & 0x7f800000) == 0x7f800000 && (*reinterpret_cas...
2008/08/21
[ "https://Stackoverflow.com/questions/21265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2328/" ]
21,280
<p>I seem to be missing something about LINQ. To me, it looks like it's taking some of the elements of SQL that I like the least and moving them into the C# language and using them for other things.</p> <p>I mean, I could see the benefit of using SQL-like statements on things other than databases. But if I wanted to...
[ { "answer_id": 21292, "author": "FlySwat", "author_id": 1965, "author_profile": "https://Stackoverflow.com/users/1965", "pm_score": 6, "selected": true, "text": "foreach (int number in list1)\n{\n foreach (int number2 in list2)\n {\n if (number2 == number)\n {\n ...
2008/08/21
[ "https://Stackoverflow.com/questions/21280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2147/" ]
21,288
<p>Which C#/.NET Dependency Injection frameworks are worth looking into? And what can you say about their complexity and speed.</p>
[ { "answer_id": 227012, "author": "Glenn Block", "author_id": 18419, "author_profile": "https://Stackoverflow.com/users/18419", "pm_score": 6, "selected": false, "text": "Spring.NET Castle Windsor Structure Map Autofac Ninject Unity" } ]
2008/08/21
[ "https://Stackoverflow.com/questions/21288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2011/" ]
21,294
<p>How can you reliably and dynamically load a JavaScript file? This will can be used to implement a module or component that when 'initialized' the component will dynamically load all needed JavaScript library scripts on demand.</p> <p>The client that uses the component isn't required to load all the library script ...
[ { "answer_id": 21297, "author": "Adam", "author_id": 1341, "author_profile": "https://Stackoverflow.com/users/1341", "pm_score": 3, "selected": false, "text": " function include(url)\n {\n var s = document.createElement(\"script\");\n s.setAttribute(\"type\", \"text/javascript\")...
2008/08/21
[ "https://Stackoverflow.com/questions/21294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1341/" ]
21,303
<p>VC++ makes functions which are implemented within the class declaration inline functions.</p> <p>If I declare a class <code>Foo</code> as follows, then are the CONSTRUCTOR and DESTRUCTOR inline functions?</p> <pre><code>class Foo { int* p; public: Foo() { p = new char[0x00100000]; } ~Foo() { delete []...
[ { "answer_id": 21326, "author": "Wilka", "author_id": 1367, "author_profile": "https://Stackoverflow.com/users/1367", "pm_score": 5, "selected": false, "text": "class Foo \n{\n int* p;\npublic:\n Foo();\n ~Foo();\n};\n\ninline Foo::Foo() \n{ \n p = new char[0x00100000]; \n}\n...
2008/08/21
[ "https://Stackoverflow.com/questions/21303", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1556/" ]
21,388
<p>I have a collection of objects in a database. Images in a photo gallery, products in a catalog, chapters in a book, etc. Each object is represented as a row. I want to be able to arbitrarily order these images, storing that ordering in the database so when I display the objects, they will be in the right order.</...
[ { "answer_id": 53794303, "author": "Chris Conlan", "author_id": 6073802, "author_profile": "https://Stackoverflow.com/users/6073802", "pm_score": 0, "selected": false, "text": "INSERT INSERT INSERT DELETE DELETE CharField() max_length INSERT JOIN" } ]
2008/08/21
[ "https://Stackoverflow.com/questions/21388", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2363/" ]
21,437
<p>What are some effective strategies for preventing the use of my proprietary images?</p> <p>I'm talking about saving them, direct linking to them etc...</p> <p>Presently I have a watermark on the image, but I'd rather not.</p> <p>.NET platform preferred, but if there's a strategy that's on another platform that in...
[ { "answer_id": 11382754, "author": "mridul4c", "author_id": 1509915, "author_profile": "https://Stackoverflow.com/users/1509915", "pm_score": 0, "selected": false, "text": " <div style=”float: left;”>\n<img src=”your-image.jpg” style=”width: 200px;height: 200px;”/>\n<img src=”the-dumm...
2008/08/21
[ "https://Stackoverflow.com/questions/21437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1975/" ]
21,448
<p>I have an SSIS package that exports data to a couple of Excel files for transfer to a third party. To get this to run as a scheduled job on a 64-bit server I understand that I need to set the step as a CmdExec type and call the 32-bit version of DTExec. But I don't seem to be able to get the command right to pass in...
[ { "answer_id": 22093, "author": "Marek Grzenkowicz", "author_id": 95, "author_profile": "https://Stackoverflow.com/users/95", "pm_score": 2, "selected": false, "text": "\"Data Source=\" + @[User::FilePath] + \";Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=dBASE IV;\"" }, { ...
2008/08/21
[ "https://Stackoverflow.com/questions/21448", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2375/" ]
21,449
<p>What is the difference between the following types of endianness?</p> <ul> <li>byte (8b) invariant big and little endianness</li> <li>half-word (16b) invariant big and little endianness</li> <li>word (32b) invariant big and little endianness</li> <li>double-word (64b) invariant big and little endianness</li> </ul> ...
[ { "answer_id": 21455, "author": "James A. Rosen", "author_id": 1190, "author_profile": "https://Stackoverflow.com/users/1190", "pm_score": -1, "selected": false, "text": "1010 0011\n 0011 1010\n 1100 0101\n" }, { "answer_id": 21531, "author": "dguaraglia", "author_id": 23...
2008/08/21
[ "https://Stackoverflow.com/questions/21449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2045/" ]
21,454
<p>How do I go about specifying and using an ENUM in a Django model?</p>
[ { "answer_id": 21468, "author": "fulmicoton", "author_id": 446497, "author_profile": "https://Stackoverflow.com/users/446497", "pm_score": 7, "selected": false, "text": "MAYBECHOICE = (\n ('y', 'Yes'),\n ('n', 'No'),\n ('u', 'Unknown'),\n)\n married = models.CharField(max_length...
2008/08/21
[ "https://Stackoverflow.com/questions/21454", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2019/" ]
21,461
<pre><code>#if SYMBOL //code #endif </code></pre> <p>what values does C# predefine for use?</p>
[ { "answer_id": 21467, "author": "Nick", "author_id": 1490, "author_profile": "https://Stackoverflow.com/users/1490", "pm_score": 2, "selected": false, "text": "Visual Studio DEBUG" }, { "answer_id": 21479, "author": "Frank Krueger", "author_id": 338, "author_profile":...
2008/08/21
[ "https://Stackoverflow.com/questions/21461", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1343/" ]
21,489
<p>SQL Experts,</p> <p>Is there an efficient way to group runs of data together using SQL?<br> Or is it going to be more efficient to process the data in code. </p> <p>For example if I have the following data:</p> <pre><code>ID|Name 01|Harry Johns 02|Adam Taylor 03|John Smith 04|John Smith 05|Bill Manning 06|John S...
[ { "answer_id": 21492, "author": "Matt Hamilton", "author_id": 615, "author_profile": "https://Stackoverflow.com/users/615", "pm_score": 0, "selected": false, "text": "select Name, count(*)\nfrom MyTable\ngroup by Name\n select Name + ' (' + cast(count(*) as varchar) + ')'\nfrom MyTable\n...
2008/08/22
[ "https://Stackoverflow.com/questions/21489", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2281/" ]
21,514
<p>Within c#, I need to be able to</p> <ul> <li>Connect to a remote system, specifying username/password as appropriate</li> <li>List the members of a localgroup on that system</li> <li>Fetch the results back to the executing computer</li> </ul> <p>So for example I would connect to \SOMESYSTEM with appropriate creds,...
[ { "answer_id": 24075, "author": "quux", "author_id": 2383, "author_profile": "https://Stackoverflow.com/users/2383", "pm_score": 2, "selected": false, "text": "SELECT PartComponent FROM Win32_GroupUser WHERE GroupComponent = \"Win32_Group.Domain='thehostname',Name='thegroupname'\"\n publ...
2008/08/22
[ "https://Stackoverflow.com/questions/21514", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2383/" ]
21,547
<p>I've spent a good amount of time coming up with solution to this problem, so in the spirit of <a href="https://stackoverflow.com/questions/21245/questions-vs-conveying-information">this post</a>, I'm posting it here, since I think it might be useful to others. </p> <p>If anyone has a better script, or anything to a...
[ { "answer_id": 21551, "author": "Blorgbeard", "author_id": 369, "author_profile": "https://Stackoverflow.com/users/369", "pm_score": 5, "selected": false, "text": "declare @schema varchar(100), @table varchar(100)\nset @schema = 'dbo' -- set schema name here\nset @table = 'MyTable' -- se...
2008/08/22
[ "https://Stackoverflow.com/questions/21547", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369/" ]
21,558
<p>I want to know what a "<em>virtual base class</em>" is and what it means.</p> <p>Let me show an example:</p> <pre><code>class Foo { public: void DoSomething() { /* ... */ } }; class Bar : public virtual Foo { public: void DoSpecific() { /* ... */ } }; </code></pre>
[ { "answer_id": 21607, "author": "OJ.", "author_id": 611, "author_profile": "https://Stackoverflow.com/users/611", "pm_score": 10, "selected": true, "text": "class A { public: void Foo() {} };\nclass B : public A {};\nclass C : public A {};\nclass D : public B, public C {};\n A\n / \\\n...
2008/08/22
[ "https://Stackoverflow.com/questions/21558", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1556/" ]
21,564
<p>I ended up writing a quick little script for this in Python, but I was wondering if there was a utility you could feed text into which would prepend each line with some text -- in my specific case, a timestamp. Ideally, the use would be something like:</p> <pre><code>cat somefile.txt | prepend-timestamp </code></p...
[ { "answer_id": 21602, "author": "jj33", "author_id": 430, "author_profile": "https://Stackoverflow.com/users/430", "pm_score": 5, "selected": false, "text": "cat somefile.txt | perl -pne 'print scalar(localtime()), \" \";'\n tail -f /path/to/log | perl -pne 'print scalar(localtime()), \"...
2008/08/22
[ "https://Stackoverflow.com/questions/21564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/156/" ]
21,574
<p>I'm not clear on the differences between the "current" version of Ruby (1.8) and the "new" version (1.9). Is there an "easy" or a "simple" explanation of the differences and why it is so different?</p>
[ { "answer_id": 21621, "author": "Tim Sullivan", "author_id": 722, "author_profile": "https://Stackoverflow.com/users/722", "pm_score": 8, "selected": true, "text": "irb(main):001:0> ?c\n=> \"c\"\n irb(main):001:0> ?c\n=> 99\n irb(main):001:0> \"cat\"[1]\n=> \"a\"\n irb(main):001:0> \"cat...
2008/08/22
[ "https://Stackoverflow.com/questions/21574", "https://Stackoverflow.com", "https://Stackoverflow.com/users/757/" ]
21,583
<p>This past summer I was developing a basic ASP.NET/SQL Server CRUD app, and unit testing was one of the requirements. I ran into some trouble when I tried to test against the database. To my understanding, unit tests should be:</p> <ul> <li>stateless</li> <li>independent from each other</li> <li>repeatable with th...
[ { "answer_id": 23297120, "author": "Mustafa Ekici", "author_id": 687817, "author_profile": "https://Stackoverflow.com/users/687817", "pm_score": 1, "selected": false, "text": " [TestFixture]\n public class TrannsactionScopeTests\n {\n private TransactionScope trans = null...
2008/08/22
[ "https://Stackoverflow.com/questions/21583", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1266/" ]
21,589
<p>I did some tests a while ago and never figured out how to make this work. </p> <p><strong>The ingredients:</strong></p> <ul> <li>COM+ transactional object (developed in VB6) </li> <li>.Net web application (with transaction) in IIS that...<br> makes a call to the COM+ component<br> updates a row in a SQL database...
[ { "answer_id": 66513, "author": "Euro Micelli", "author_id": 2230, "author_profile": "https://Stackoverflow.com/users/2230", "pm_score": 3, "selected": true, "text": "void SomeMethod()\n{\n EnterpriseServicesInteropOption e = EnterpriseServicesInteropOption.Full;\n using (Transacti...
2008/08/22
[ "https://Stackoverflow.com/questions/21589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1328/" ]
21,593
<p>What is the difference between using angle brackets and quotes in an <code>include</code> directive?</p> <ul> <li><code>#include &lt;filename&gt;</code></li> <li><code>#include &quot;filename&quot;</code></li> </ul>
[ { "answer_id": 21594, "author": "quest49", "author_id": 2399, "author_profile": "https://Stackoverflow.com/users/2399", "pm_score": 11, "selected": false, "text": "#include <filename> #include \"filename\"" }, { "answer_id": 41538, "author": "Community", "author_id": -1, ...
2008/08/22
[ "https://Stackoverflow.com/questions/21593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2399/" ]
21,635
<p>I have a product which has been traditionally shipped as an MSI file. It is deployed through some sort of SMS push to thousands of desktops by our various clients. The software we use to create these installers is getting long in the tooth and we are looking to replace it. We have already standardized on InstallA...
[ { "answer_id": 21650, "author": "Chris", "author_id": 2134, "author_profile": "https://Stackoverflow.com/users/2134", "pm_score": 2, "selected": false, "text": "MSI WiX 3.0 Dark" }, { "answer_id": 21726, "author": "saschabeaumont", "author_id": 592, "author_profile": ...
2008/08/22
[ "https://Stackoverflow.com/questions/21635", "https://Stackoverflow.com", "https://Stackoverflow.com/users/361/" ]
21,640
<p>Is there a simple way in .NET to quickly get the current protocol, host, and port? For example, if I'm on the following URL:</p> <p><code>http://www.mywebsite.com:80/pages/page1.aspx</code></p> <p>I need to return:</p> <p><code>http://www.mywebsite.com:80</code></p> <p>I know I can use <code>Request.Url.Absolute...
[ { "answer_id": 21653, "author": "Dale Ragan", "author_id": 1117, "author_profile": "https://Stackoverflow.com/users/1117", "pm_score": 5, "selected": false, "text": "Uri url = Request.Url;\nstring protocol = url.Scheme;\n" }, { "answer_id": 22361, "author": "Rick", "autho...
2008/08/22
[ "https://Stackoverflow.com/questions/21640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2076253/" ]
21,647
<p>The following <strong>C++</strong> code uses a <strong>ifstream</strong> object to read integers from a text file (which has one number per line) until it hits <strong>EOF</strong>. Why does it read the integer on the last line twice? How to fix this?</p> <p><strong>Code:</strong></p> <pre><code>#include &lt;iostr...
[ { "answer_id": 21656, "author": "wilhelmtell", "author_id": 456, "author_profile": "https://Stackoverflow.com/users/456", "pm_score": 8, "selected": true, "text": "while (true) {\n int x;\n iFile >> x;\n if( iFile.eof() ) break;\n cerr << x << endl;\n}\n" }, { "answer...
2008/08/22
[ "https://Stackoverflow.com/questions/21647", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1630/" ]
21,652
<p>I have some code that gives a user id to a utility that then send email to that user.</p> <pre><code>emailUtil.sendEmail(userId, "foo"); public void sendEmail(String userId, String message) throws MailException { /* ... logic that could throw a MailException */ } </code></pre> <p><code>MailException</code> co...
[ { "answer_id": 21858, "author": "niklasfi", "author_id": 2275, "author_profile": "https://Stackoverflow.com/users/2275", "pm_score": -1, "selected": false, "text": "throw new exception(\"WhatCausedIt\")\n" }, { "answer_id": 138532, "author": "Mnementh", "author_id": 21005...
2008/08/22
[ "https://Stackoverflow.com/questions/21652", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1666/" ]
21,669
<p>I didn't get the answer to this anywhere. What is the runtime complexity of a Regex match and substitution?</p> <p>Edit: I work in python. But would like to know in general about most popular languages/tools (java, perl, sed).</p>
[ { "answer_id": 766514, "author": "jpalecek", "author_id": 51831, "author_profile": "https://Stackoverflow.com/users/51831", "pm_score": 3, "selected": false, "text": "O(m*n+m) m n m O(m) O(m^2+n) O(2^m) O(n^2*m) a*a*" }, { "answer_id": 63529950, "author": "Peter Franek", ...
2008/08/22
[ "https://Stackoverflow.com/questions/21669", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1448/" ]
21,697
<p>I'm currently writing an ASP.Net app from the UI down. I'm implementing an MVP architecture because I'm sick of Winforms and wanted something that had a better separation of concerns.</p> <p>So with MVP, the Presenter handles events raised by the View. Here's some code that I have in place to deal with the creation...
[ { "answer_id": 22043, "author": "Cheekysoft", "author_id": 1820, "author_profile": "https://Stackoverflow.com/users/1820", "pm_score": 5, "selected": true, "text": "try {\n // call service etc.\n // handle success to view\n} \ncatch (AccountAlreadyExistsException) {\n // set the messa...
2008/08/22
[ "https://Stackoverflow.com/questions/21697", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1894/" ]
21,698
<p>I'm trying to write a RegEx for a code generator (in C#) to determine a proper class or package name of an AS3 class.</p> <p>I know that class names</p> <ul> <li>must start with a letter (capital or otherwise)</li> <li>any other digit can be alphanumeric</li> <li>cannot have spaces</li> </ul> <p>Is there anything...
[ { "answer_id": 22290, "author": "Matt MacLean", "author_id": 22, "author_profile": "https://Stackoverflow.com/users/22", "pm_score": 1, "selected": false, "text": "public class $Test {}\npublic class _Test {}\npublic class test {}\n" }, { "answer_id": 72319, "author": "Iain",...
2008/08/22
[ "https://Stackoverflow.com/questions/21698", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1306/" ]
21,715
<p>Prior to C# generics, everyone would code collections for their business objects by creating a collection base that implemented IEnumerable</p> <p>IE:</p> <pre><code>public class CollectionBase : IEnumerable </code></pre> <p>and then would derive their Business Object collections from that.</p> <pre><code>public...
[ { "answer_id": 21722, "author": "Scott Muc", "author_id": 1894, "author_profile": "https://Stackoverflow.com/users/1894", "pm_score": 2, "selected": false, "text": "public class BusinessObjectCollection : List<BusinessObject> {}\n public IEnumerable<BusinessObject> GetBusinessObjects();\...
2008/08/22
[ "https://Stackoverflow.com/questions/21715", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965/" ]
21,725
<p>What are your favorite (G)Vim plugins/scripts?</p>
[ { "answer_id": 26092, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 4, "selected": false, "text": "ctags" }, { "answer_id": 58846, "author": "Dominic Dos Santos", "author_id": 5379, "author_profile...
2008/08/22
[ "https://Stackoverflow.com/questions/21725", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2386/" ]
21,749
<p>I have a Delphi 7 application that has two views of a document (e.g. a WYSIWYG HTML edit might have a WYSIWYG view and a source view - not my real application). They can be opened in separate windows, or docked into tabs in the main window.</p> <p>If I open a modal dialog from one of the separate forms, the main fo...
[ { "answer_id": 21978, "author": "Marius", "author_id": 1008, "author_profile": "https://Stackoverflow.com/users/1008", "pm_score": 4, "selected": true, "text": "dialog := TDialogForm.Create( parentForm );\ndialog.PopupParent := parentForm;\ndialog.PopupMode := pmExplicit; \ndialog.Show...
2008/08/22
[ "https://Stackoverflow.com/questions/21749", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2219/" ]
21,817
<p>The topic says the most of it - what is the reason for the fact that static methods can't be declared in an interface?</p> <pre><code>public interface ITest { public static String test(); } </code></pre> <p>The code above gives me the following error (in Eclipse, at least): "Illegal modifier for the interface ...
[ { "answer_id": 21823, "author": "Kyle Cronin", "author_id": 658, "author_profile": "https://Stackoverflow.com/users/658", "pm_score": 4, "selected": false, "text": "Math.add(2, 3);\n" }, { "answer_id": 21845, "author": "FlySwat", "author_id": 1965, "author_profile": "...
2008/08/22
[ "https://Stackoverflow.com/questions/21817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2238/" ]
21,848
<p>There may be more than one way to ask this question, so here's a desciption of the problem. I was working on master and committed some stuff and then decided I wanted to put that work on hold. I backed up a few commits and then branched from before I started my crap work. Practically this works fine, I just now have...
[ { "answer_id": 21897, "author": "olliej", "author_id": 784, "author_profile": "https://Stackoverflow.com/users/784", "pm_score": 3, "selected": false, "text": "git checkout -b fake_master master # fake_master now points to the same commit as master\ngit branch -D master # g...
2008/08/22
[ "https://Stackoverflow.com/questions/21848", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2427/" ]
21,877
<p>What I want to achieve is this. I want to give the user the ability to upload an image file, store the image in BLOB in SQL Server, and then use this image as a logo in other pages of the site. </p> <p>I have done this by using </p> <pre><code> Response.Clear(); Response.ContentType = "image/pjpeg"; Respo...
[ { "answer_id": 21885, "author": "FlySwat", "author_id": 1965, "author_profile": "https://Stackoverflow.com/users/1965", "pm_score": 3, "selected": false, "text": "using System;\nusing System.Web;\n\nnamespace Example\n{ \n public class GetImage : IHttpHandler\n {\n\n public...
2008/08/22
[ "https://Stackoverflow.com/questions/21877", "https://Stackoverflow.com", "https://Stackoverflow.com/users/932/" ]
21,879
<p>I'm trying to reteach myself some long forgotten math skills. This is part of a much larger project to effectively "teach myself software development" from the ground up (the details are <a href="http://www.appscanadian.ca/archives/cs-101-introduction-to-computer-science/" rel="noreferrer">here</a> if you're interes...
[ { "answer_id": 21962, "author": "Mark Harrison", "author_id": 116, "author_profile": "https://Stackoverflow.com/users/116", "pm_score": 4, "selected": true, "text": "base:\n algebra\n trigonometry\n analytic geometry\n\ntrack 1 track 2 track 3...
2008/08/22
[ "https://Stackoverflow.com/questions/21879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1588/" ]
21,908
<p>I'm working on a web application that needs to prints silently -- that is without user involvement. What's the best way to accomplish this? It doesn't like it can be done with strictly with Javascript, nor Flash and/or AIR. The closest I've seen involves a Java applet.</p> <p>I can understand why it would a Bad ...
[ { "answer_id": 21924, "author": "Espo", "author_id": 2257, "author_profile": "https://Stackoverflow.com/users/2257", "pm_score": 3, "selected": false, "text": "<script>\nfunction Print() {\n alert (\"THUD.. another tree bites the dust!\")\n if (document.layers)\n {\n window.print()...
2008/08/22
[ "https://Stackoverflow.com/questions/21908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/181/" ]
21,934
<p>Python uses the reference count method to handle object life time. So an object that has no more use will be immediately destroyed.</p> <p>But, in Java, the GC(garbage collector) destroys objects which are no longer used at a specific time.</p> <p>Why does Java choose this strategy and what is the benefit from thi...
[ { "answer_id": 22219, "author": "Eli Courtwright", "author_id": 1694, "author_profile": "https://Stackoverflow.com/users/1694", "pm_score": 4, "selected": false, "text": "def parse_some_attrs(fname):\n return open(fname).read().split(\"~~~\")[2:4]\n def parse_some_attrs(fname):\n w...
2008/08/22
[ "https://Stackoverflow.com/questions/21934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1556/" ]
21,938
<p>Whilst analysing some legacy code with FXCop, it occurred to me is it really that bad to catch a general exception error within a try block or should you be looking for a specific exception. Thoughts on a postcard please.</p>
[ { "answer_id": 21942, "author": "Philippe", "author_id": 920, "author_profile": "https://Stackoverflow.com/users/920", "pm_score": 3, "selected": false, "text": "IOException NullPointerException Exception" }, { "answer_id": 21950, "author": "John", "author_id": 2168, ...
2008/08/22
[ "https://Stackoverflow.com/questions/21938", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1731/" ]
21,956
<p>I have two arrays of <code>System.Data.DataRow</code> objects which I want to compare. </p> <p>The rows have two columns A and B. Column A is a key and I want to find out which rows have had their B column changed and which rows have been added or deleted. </p> <p><strong>How do I do this in PowerShell?</strong></...
[ { "answer_id": 48471891, "author": "Dongminator", "author_id": 1178960, "author_profile": "https://Stackoverflow.com/users/1178960", "pm_score": 1, "selected": false, "text": "foreach ($property in ($row1 | Get-Member -MemberType Property)) {\n $pName = $property.Name\n\n if ($row1...
2008/08/22
[ "https://Stackoverflow.com/questions/21956", "https://Stackoverflow.com", "https://Stackoverflow.com/users/966/" ]
21,961
<pre><code>&gt;&gt;&gt; import time &gt;&gt;&gt; time.strptime("01-31-2009", "%m-%d-%Y") (2009, 1, 31, 0, 0, 0, 5, 31, -1) &gt;&gt;&gt; time.mktime((2009, 1, 31, 0, 0, 0, 5, 31, -1)) 1233378000.0 &gt;&gt;&gt; 60*60*24 # seconds in a day 86400 &gt;&gt;&gt; 1233378000.0 / 86400 14275.208333333334 </code></pre> <p><code>...
[ { "answer_id": 21973, "author": "Anders Eurenius", "author_id": 1421, "author_profile": "https://Stackoverflow.com/users/1421", "pm_score": 2, "selected": false, "text": "mktime(...)\n mktime(tuple) -> floating point number\n\n Convert a time tuple in local time to seconds since th...
2008/08/22
[ "https://Stackoverflow.com/questions/21961", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2427/" ]
21,987
<p>I am developing an application that controls an Machine.<br/> When I receive an error from the Machine the users should be able to directly notice it, one way that is done is Flashing the tray on the taskbar. When the machine clears the error the tray should stop flashing.</p> <p>There's one little annoyance using t...
[ { "answer_id": 23285, "author": "TheSmurf", "author_id": 1975282, "author_profile": "https://Stackoverflow.com/users/1975282", "pm_score": 4, "selected": true, "text": "FLASHW_STOP" }, { "answer_id": 37615, "author": "Stormenet", "author_id": 2090, "author_profile": "...
2008/08/22
[ "https://Stackoverflow.com/questions/21987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2090/" ]
21,992
<p>I'm looking for (arguably) the correct way to return data from a <code>XmlHttpRequest</code>. Options I see are:</p> <ul> <li><p><strong>Plain HTML</strong>. Let the request format the data and return it in a usable format.<br> <em>Advantage</em>: easy to consume by the calling page.<br><em>Disadvantage</em>: Very...
[ { "answer_id": 22002, "author": "Hrvoje Hudo", "author_id": 1407, "author_profile": "https://Stackoverflow.com/users/1407", "pm_score": 0, "selected": false, "text": "JSON OO js" } ]
2008/08/22
[ "https://Stackoverflow.com/questions/21992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/909/" ]
21,999
<p>Anti aliasing <a href="http://forums.msdn.microsoft.com/en-US/wpf/thread/1ad9a62a-d1a4-4ca2-a950-3b7bf5240de5" rel="noreferrer">cannot be turned off</a> in WPF. But I want to remove the blurred look of WPF fonts when they are small. </p> <p>One possibility would be to use a .net 2.0 component. This looks like it wo...
[ { "answer_id": 6943415, "author": "Wolkenjaeger", "author_id": 408659, "author_profile": "https://Stackoverflow.com/users/408659", "pm_score": 3, "selected": false, "text": "TextOptions.TextFormattingMode=\"Display\"\n" } ]
2008/08/22
[ "https://Stackoverflow.com/questions/21999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1013/" ]
22,000
<p>I've created a map system for a game that runs on the principle of drawing the picture of the map from tiles. There are many reasons for this which I won't go into here but if you really want to know then I'm sure you can find out how to contact me ;)</p> <p>I have <a href="http://woarl.com/board/rob.php?mode=map&a...
[ { "answer_id": 22013, "author": "samjudson", "author_id": 1908, "author_profile": "https://Stackoverflow.com/users/1908", "pm_score": 2, "selected": false, "text": "<img> </td> <td>\n <img src=\"image.jpg\"/>\n</td>\n <td><img src=\"image.jpg\"/></td>\n" }, { "answer_id": 22016, ...
2008/08/22
[ "https://Stackoverflow.com/questions/22000", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1384652/" ]
22,001
<p>I'm learning objective-C and Cocoa. In the Apple tutorial I'm working through there's a side note that says: </p> <blockquote> <p><code>IBOutlet</code> is a null-defined macro, which the C preprocessor removes at compile time.</p> </blockquote> <p>I'm curious - what's a null-defined macro?</p>
[ { "answer_id": 22003, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 3, "selected": false, "text": "#define IBOutlet\n" }, { "answer_id": 22455, "author": "Matt Dillard", "author_id": 863, "author_profi...
2008/08/22
[ "https://Stackoverflow.com/questions/22001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
22,012
<p>My application dynamically loads assemblies at runtime from specific subfolders. These assemblies are compiled with dependencies to other assemblies. The runtime trys to load these from the application directory. But I want to put them into the modules directory.</p> <p>Is there a way to tell the runtime that the d...
[ { "answer_id": 22022, "author": "samjudson", "author_id": 1908, "author_profile": "https://Stackoverflow.com/users/1908", "pm_score": 2, "selected": false, "text": "<probing> <configuration>\n <runtime>\n <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n <probing privat...
2008/08/22
[ "https://Stackoverflow.com/questions/22012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2374/" ]
22,106
<p>In Linux, what is the difference between <code>/dev/ttyS0</code> and <code>/dev/ttys0</code>?</p> <p>I know that the first is a serial port, but what about the second, with the small <code>s</code>?</p>
[ { "answer_id": 22124, "author": "Espo", "author_id": 2257, "author_profile": "https://Stackoverflow.com/users/2257", "pm_score": 0, "selected": false, "text": "3 char Pseudo-TTY slaves\n 0 = /dev/ttyp0 First PTY slave\n 1 = /dev/ttyp1 Second PTY slave\n ...\n ...
2008/08/22
[ "https://Stackoverflow.com/questions/22106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1585/" ]
22,115
<p>I am writing a Java utility that helps me to generate loads of data for performance testing. It would be <em>really</em> cool to be able to specify a regex for Strings so that my generator spits out things that match this.</p> <p>Is something out there already baked that I can use to do this? Or is there a library ...
[ { "answer_id": 22133, "author": "Cheekysoft", "author_id": 1820, "author_profile": "https://Stackoverflow.com/users/1820", "pm_score": 7, "selected": true, "text": "dk.brics.automaton" }, { "answer_id": 245381, "author": "J Wynia", "author_id": 1124, "author_profile":...
2008/08/22
[ "https://Stackoverflow.com/questions/22115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2455/" ]
22,135
<p>I am trying to implement NTLM authentication on one of our internal sites and everything is working. The one piece of the puzzle I do not have is how to take the information from NTLM and authenticate with Active Directory.</p> <p>There is a <a href="http://www.innovation.ch/personal/ronald/ntlm.html" rel="nofollow...
[ { "answer_id": 464096, "author": "user8134", "author_id": 8134, "author_profile": "https://Stackoverflow.com/users/8134", "pm_score": 4, "selected": false, "text": "yum install samba-winbind yum install mod_auth_ntlm_winbind" } ]
2008/08/22
[ "https://Stackoverflow.com/questions/22135", "https://Stackoverflow.com", "https://Stackoverflow.com/users/309844/" ]
22,140
<p>As part of our product release we ship Apache HTTP Server binaries that we have compiled on our (UNIX) development machine.</p> <p>We tell our clients to install the binaries (on their UNIX servers) under the same directory structure that we compiled it under. For some clients this is not appropriate, e.g. where th...
[ { "answer_id": 27644, "author": "wvdschel", "author_id": 2018, "author_profile": "https://Stackoverflow.com/users/2018", "pm_score": 0, "selected": false, "text": "/opt/my_apache2/" }, { "answer_id": 27902, "author": "Hissohathair", "author_id": 2997, "author_profile"...
2008/08/22
[ "https://Stackoverflow.com/questions/22140", "https://Stackoverflow.com", "https://Stackoverflow.com/users/381/" ]
22,156
<p>I've been using user controls extensively but never use a HttpHandler and was wondering if I am doing something suboptimal or wrong</p>
[ { "answer_id": 22171, "author": "Vaibhav", "author_id": 380, "author_profile": "https://Stackoverflow.com/users/380", "pm_score": 0, "selected": false, "text": "Asp.Net HttpHandler public class Page : TemplateControl, IHttpHandler\n" } ]
2008/08/22
[ "https://Stackoverflow.com/questions/22156", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2385/" ]
22,165
<p>I have a need to create a "transactional" process using an external API that does not support COM+ or .NET transactions (Sharepoint to be exact)</p> <p>What I need to do is to be able to perform a number of processes in a sequence, but any failure in that sequence means that I will have to manually undo all of the ...
[ { "answer_id": 22220, "author": "vitule", "author_id": 1287, "author_profile": "https://Stackoverflow.com/users/1287", "pm_score": 3, "selected": true, "text": "Update() SPList.Update() SPWeb.Update()" } ]
2008/08/22
[ "https://Stackoverflow.com/questions/22165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/983/" ]
22,181
<p>I have a very simple mapping function called "BuildEntity" that does the usual boring "left/right" coding required to dump my reader data into my domain object. (shown below) My question is this - If I don't bring back every column in this mapping as is, I get the "System.IndexOutOfRangeException" exception and want...
[ { "answer_id": 22189, "author": "Matt Hamilton", "author_id": 615, "author_profile": "https://Stackoverflow.com/users/615", "pm_score": 0, "selected": false, "text": "reader.GetOrdinal GetOrdinal IndexOutOfRangeException Dictionary<string, int> ContainsKey" }, { "answer_id": 2219...
2008/08/22
[ "https://Stackoverflow.com/questions/22181", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
22,187
<p>What libraries exist for other programming languages to provide an Erlang-style concurrency model (processes, mailboxes, pattern-matching receive, etc.)?</p> <p>Note: I am specifically interested in things that are intended to be similar to Erlang, not just any threading or queueing library.</p>
[ { "answer_id": 22285, "author": "jcsalterego", "author_id": 1416, "author_profile": "https://Stackoverflow.com/users/1416", "pm_score": 4, "selected": true, "text": "#define N 100000\nint main(int argc, char *argv[])\n{\n int i, a[N];\n #pragma omp parallel for\n for (i=0;i<N;i++) \n ...
2008/08/22
[ "https://Stackoverflow.com/questions/22187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1175/" ]
22,239
<p>(I'm using Visual C++ 2008) I've always heard that main() is <em>required</em> to return an integer, but here I didn't put in <code>return 0;</code> and and it compiled with 0 errors and 0 warnings! In the debug window it says the program has exited with code 0. If this function is named anything other than main()...
[ { "answer_id": 22262, "author": "sparkes", "author_id": 269, "author_profile": "https://Stackoverflow.com/users/269", "pm_score": 7, "selected": true, "text": "main int int main() { /* ... */ }\n int main(int argc, char* argv[]) {\n/* ... */\n}\n return main exit main" }, { "answ...
2008/08/22
[ "https://Stackoverflow.com/questions/22239", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2222/" ]
22,245
<p>I have multiple projects in a couple of different workspaces. However, it seems like I can never figure out how to change my current workspace. The result is that files that I have checked out on my machine are shown to be checked out by somebody else and are not accessible.</p>
[ { "answer_id": 58591630, "author": "Vishal Sareen", "author_id": 12285975, "author_profile": "https://Stackoverflow.com/users/12285975", "pm_score": 0, "selected": false, "text": "File -> Source Control -> Advanced -> Workspace" } ]
2008/08/22
[ "https://Stackoverflow.com/questions/22245", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
22,259
<p>I want to allow users to upload avatar-type images in a variety of formats (<strong>GIF, JPEG, and PNG at least</strong>), but to save them all as <strong>PNG database BLOBs</strong>. If the images are oversized, pixelwise, I want to resize them before DB-insertion.</p> <p><strong>What is the best way to use GD to ...
[ { "answer_id": 22333, "author": "Andy", "author_id": 1993, "author_profile": "https://Stackoverflow.com/users/1993", "pm_score": 2, "selected": false, "text": "\n<?php\n //Input file\n $file = \"myImage.png\";\n $img = ImageCreateFromPNG($file);\n\n //Dimensions\n $width = imag...
2008/08/22
[ "https://Stackoverflow.com/questions/22259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1820/" ]
22,269
<p>I'm trying to build a C# console application to automate grabbing certain files from our website, mostly to save myself clicks and - frankly - just to have done it. But I've hit a snag that for which I've been unable to find a working solution.</p> <p>The website I'm trying to which I'm trying to connect uses ASP....
[ { "answer_id": 22333, "author": "Andy", "author_id": 1993, "author_profile": "https://Stackoverflow.com/users/1993", "pm_score": 2, "selected": false, "text": "\n<?php\n //Input file\n $file = \"myImage.png\";\n $img = ImageCreateFromPNG($file);\n\n //Dimensions\n $width = imag...
2008/08/22
[ "https://Stackoverflow.com/questions/22269", "https://Stackoverflow.com", "https://Stackoverflow.com/users/111/" ]
22,322
<p>I've got a problem similar to,but subtly different from, that described <a href="https://stackoverflow.com/questions/22012/loading-assemblies-and-its-dependencies">here</a> (Loading assemblies and their dependencies).</p> <p>I have a C++ DLL for 3D rendering that is what we sell to customers. For .NET users we will...
[ { "answer_id": 479664, "author": "Greg Whitfield", "author_id": 2102, "author_profile": "https://Stackoverflow.com/users/2102", "pm_score": 4, "selected": true, "text": "static void Main(String[] argv)\n {\n // Create a new AppDomain, but with the base directory set to either the 32...
2008/08/22
[ "https://Stackoverflow.com/questions/22322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2102/" ]
22,326
<p>I am trying to <strong>replace the current selection in Word (2003/2007)</strong> by some <strong>RTF string</strong> stored in a variable.</p> <p>Here is the current code:</p> <pre><code>Clipboard.SetText(strRTFString, TextDataFormat.Rtf) oWord.ActiveDocument.ActiveWindow.Selection.PasteAndFormat(0) </code></pre>...
[ { "answer_id": 22335, "author": "samjudson", "author_id": 1908, "author_profile": "https://Stackoverflow.com/users/1908", "pm_score": -1, "selected": false, "text": "RichTextBox r = new RichTextBox();\nr.Rtf = strRTFString;\nConsole.WriteLine(r.Text);\n" }, { "answer_id": 27425, ...
2008/08/22
[ "https://Stackoverflow.com/questions/22326", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1508/" ]
22,354
<p>I am working on a SharePoint application that supports importing multiple documents in a single operation. I also have an ItemAdded event handler that performs some basic maintenance of the item metadata. This event fires for both imported documents and manually created ones. The final piece of the puzzle is a ba...
[ { "answer_id": 22703, "author": "vitule", "author_id": 1287, "author_profile": "https://Stackoverflow.com/users/1287", "pm_score": 1, "selected": false, "text": "ItemAdded ItemUpdated ItemAdded() ItemAdded() private static object myLock = new object();\npublic override void ItemAdded(SPI...
2008/08/22
[ "https://Stackoverflow.com/questions/22354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2470/" ]
22,356
<p>I find that the .NET event model is such that I'll often be raising an event on one thread and listening for it on another thread. I was wondering what the cleanest way to marshal an event from a background thread onto my UI thread is.</p> <p>Based on the community suggestions, I've used this:</p> <pre><code>// e...
[ { "answer_id": 22387, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 4, "selected": false, "text": "private void mCoolObject_CoolEvent(object sender, CoolObjectEventArgs args)\n{\n if (InvokeRequired)\n {\n ...
2008/08/22
[ "https://Stackoverflow.com/questions/22356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1490/" ]
22,358
<p>Is there any way to tinker with the iPhone SDK on a Windows machine? Are there plans for an iPhone SDK version for Windows?</p> <p>The only other way I can think of doing this is to run a Mac VM image on a <strong>VMWare</strong> server running on Windows, although I'm not too sure how legal this is.</p>
[ { "answer_id": 1532802, "author": "Keith Adler", "author_id": 135952, "author_profile": "https://Stackoverflow.com/users/135952", "pm_score": 4, "selected": false, "text": "Adobe Flash CS 5 iPhone Windows" }, { "answer_id": 6022718, "author": "priamos", "author_id": 75629...
2008/08/22
[ "https://Stackoverflow.com/questions/22358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2454/" ]
22,379
<p>I'm wondering how you can implement a program similar to <code>tail -f</code> in C/C++, a program that watches for and processes new lines added to a log file?</p>
[ { "answer_id": 22399, "author": "jj33", "author_id": 430, "author_profile": "https://Stackoverflow.com/users/430", "pm_score": 4, "selected": true, "text": "wembley 0 /home/jj33/swap >#> cat p\nmy $f = shift;\nopen(I, \"<$f\") || die \"Couldn't open $f: $!\\n\";\n\nwhile (1) {\n seek(I,...
2008/08/22
[ "https://Stackoverflow.com/questions/22379", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486/" ]
22,401
<p>I'm looking at the <a href="http://www.php.net/manual/en/" rel="noreferrer">PHP Manual</a>, and I'm not seeing a section on data structures that most languages have, such as lists and sets. Am I just blind or does PHP not have anything like this built in?</p>
[ { "answer_id": 22405, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 3, "selected": false, "text": "$lst = array(1, 2, 3);\n$hsh = array(1 => \"This\", 2 => \"is a\", 3 => \"test\");\n" }, { "answer_id": 22412,...
2008/08/22
[ "https://Stackoverflow.com/questions/22401", "https://Stackoverflow.com", "https://Stackoverflow.com/users/572/" ]
22,409
<p>I have a need to convert images from CMYK to RGB - not necessarily back again, but hey, if it can be done...</p> <p>With the release of ColdFusion 8, we got the <a href="http://cfquickdocs.com/cf8/?getDoc=cfimage" rel="nofollow noreferrer">CFImage</a> tag, but it doesn't support this conversion; and nor does <a hre...
[ { "answer_id": 848533, "author": "Randy Stegbauer", "author_id": 34301, "author_profile": "https://Stackoverflow.com/users/34301", "pm_score": 4, "selected": true, "text": "package cmyk;\n\nimport java.awt.color.ColorSpace;\nimport java.awt.image.BufferedImage;\nimport java.awt.image.Col...
2008/08/22
[ "https://Stackoverflow.com/questions/22409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/751/" ]
22,417
<p>Say I have a Student table, it's got an int ID. I have a fixed set of 10 multiple choice questions with 5 possible answers. I have a normalized answer table that has the question id, the Student.answer (1-5) and the Student.ID</p> <p>I'm trying to write a single query that will return all scores over a certain pe...
[ { "answer_id": 22448, "author": "Dave Ward", "author_id": 60, "author_profile": "https://Stackoverflow.com/users/60", "pm_score": 3, "selected": true, "text": "select student_name, score\nfrom students\n join (select student_answers.student_id, count(*) as score\n from student_an...
2008/08/22
[ "https://Stackoverflow.com/questions/22417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1975/" ]
22,429
<p>Is it possible to embed an inline search box into a web page which provides similar functionality to the <a href="http://www.ie7pro.com/inline-search.html" rel="noreferrer">IE7Pro Inline Search</a> or similar plugins for Firefox/Safari?</p>
[ { "answer_id": 22448, "author": "Dave Ward", "author_id": 60, "author_profile": "https://Stackoverflow.com/users/60", "pm_score": 3, "selected": true, "text": "select student_name, score\nfrom students\n join (select student_answers.student_id, count(*) as score\n from student_an...
2008/08/22
[ "https://Stackoverflow.com/questions/22429", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2418/" ]