qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
87,304
<p>What's a good algorithm for calculating frames per second in a game? I want to show it as a number in the corner of the screen. If I just look at how long it took to render the last frame the number changes too fast.</p> <p>Bonus points if your answer updates each frame and doesn't converge differently when the frame rate is increasing vs decreasing.</p>
[ { "answer_id": 87333, "author": "Martin Beckett", "author_id": 10897, "author_profile": "https://Stackoverflow.com/users/10897", "pm_score": 7, "selected": false, "text": "// eg.\nfloat smoothing = 0.9; // larger=more smoothing\nmeasurement = (measurement * smoothing) + (current * (1.0-s...
2008/09/17
[ "https://Stackoverflow.com/questions/87304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16679/" ]
87,317
<p>I need to get a list of attribute values from child elements in Python.</p> <p>It's easiest to explain with an example.</p> <p>Given some XML like this:</p> <pre><code>&lt;elements&gt; &lt;parent name="CategoryA"&gt; &lt;child value="a1"/&gt; &lt;child value="a2"/&gt; &lt;child value="a3"/&gt; &lt;/parent&gt; &lt;parent name="CategoryB"&gt; &lt;child value="b1"/&gt; &lt;child value="b2"/&gt; &lt;child value="b3"/&gt; &lt;/parent&gt; &lt;/elements&gt; </code></pre> <p>I want to be able to do something like:</p> <pre class="lang-python prettyprint-override"><code>&gt;&gt;&gt; getValues("CategoryA") ['a1', 'a2', 'a3'] &gt;&gt;&gt; getValues("CategoryB") ['b1', 'b2', 'b3'] </code></pre> <p>It looks like a job for XPath but I'm open to all recommendations. I'd also like to hear about your favourite Python XML libraries.</p>
[ { "answer_id": 87503, "author": "pjz", "author_id": 8002, "author_profile": "https://Stackoverflow.com/users/8002", "pm_score": 2, "selected": false, "text": " import xmltramp\n\n values = xmltramp.parse('''...''')\n\n def getValues( values, category ):\n cat = [ parent for parent ...
2008/09/17
[ "https://Stackoverflow.com/questions/87317", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3464/" ]
87,330
<p>Is there a canonical ordering of submatch expressions in a regular expression? </p> <p>For example: What is the order of the submatches in<br> "(([0-9]{3}).([0-9]{3}).([0-9]{3}).([0-9]{3}))\s+([A-Z]+)" ?</p> <pre><code>a. (([0-9]{3})\.([0-9]{3})\.([0-9]{3})\.([0-9]{3}))\s+([A-Z]+) (([0-9]{3})\.([0-9]{3})\.([0-9]{3})\.([0-9]{3})) ([A-Z]+) ([0-9]{3}) ([0-9]{3}) ([0-9]{3}) ([0-9]{3}) b. (([0-9]{3})\.([0-9]{3})\.([0-9]{3})\.([0-9]{3}))\s+([A-Z]+) (([0-9]{3})\.([0-9]{3})\.([0-9]{3})\.([0-9]{3})) ([0-9]{3}) ([0-9]{3}) ([0-9]{3}) ([0-9]{3}) ([A-Z]+) </code></pre> <p>or</p> <pre><code>c. somthin' else. </code></pre>
[ { "answer_id": 87417, "author": "Asgeir S. Nilsen", "author_id": 16023, "author_profile": "https://Stackoverflow.com/users/16023", "pm_score": 0, "selected": false, "text": "(([0-9]{3}).([0-9]{3}).([0-9]{3}).([0-9]{3}))\n([0-9]{3})\n([0-9]{3})\n([0-9]{3})\n([0-9]{3})\n([A-Z]+)\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/87330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16753/" ]
87,350
<p>Any recommendations on <a href="http://en.wikipedia.org/wiki/Grep" rel="noreferrer">grep</a> tools for Windows? Ideally ones that could leverage 64-bit OS.</p> <p>I'm aware of <a href="http://www.cygwin.com/" rel="noreferrer">Cygwin</a>, of course, and have also found <a href="http://www.powergrep.com/" rel="noreferrer">PowerGREP</a>, but I'm wondering if there are any hidden gems out there?</p>
[ { "answer_id": 87378, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 6, "selected": false, "text": "grep --include \"*.xxx\" -nRHI \"my Text to grep\" *\n" }, { "answer_id": 87394, "author": "Ray Hayes", "author_...
2008/09/17
[ "https://Stackoverflow.com/questions/87350", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1690/" ]
87,359
<p>I have a page which spawns a popup browser window. I have a JavaScript variable in the parent browser window and I would like to pass it to the popped-up browser window.</p> <p>Is there a way to do this? I know this can be done across frames in the same browser window but I'm not sure if it can be done across browser windows.</p>
[ { "answer_id": 87649, "author": "Milan Babuškov", "author_id": 14690, "author_profile": "https://Stackoverflow.com/users/14690", "pm_score": 0, "selected": false, "text": "var x = 10;\nwindow.open('mypage.php?x='+x);\n" }, { "answer_id": 87659, "author": "Grant Wagner", "...
2008/09/17
[ "https://Stackoverflow.com/questions/87359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2577/" ]
87,365
<p>If the owner of a web site wants to track who their users are as much as possible, what things can they capture (and how). You might want to know about this in order to capture information on a site you create or, as a user, to <em>prevent</em> a site from capturing data on you.</p> <p>Here is a starting list, but I'm sure I have missed some important ones:</p> <ol> <li>Referrer (what web page had the link you followed to get here). This is a HTTP header.</li> <li>IP Address of the machine you are browsing from. This is available with the HTTP headers.</li> <li>User Agent (what browser you are using). This is a HTTP header.</li> <li>Cookie placed on a previous visit. This is a header, available only if a cookie was placed earlier and was not deleted by the user.</li> <li>Flash Cookie placed on a previous visit. Some users turn off cookies, but <em>very</em> few know how to turn off Flash cookies. Works like a normal cookie although it depends on Flash.</li> <li>Web Bugs. Place something small (like a transparent single-pixel GIF) on the page that's served up from a 3rd party. Some third parties (such as DoubleClick) will have their own cookies and can correlate with other visits the user makes (for a fee!).</li> </ol> <p>Those are the common ones I think of, but there have to be LOTS of unusual ones. For instance, this:</p> <ol> <li>Time on the user's clock. <a href="https://stackoverflow.com/questions/13/determining-web-users-time-zone">Use JavaScript</a> to transmit it.</li> </ol> <p>... which I had never heard of before reading it here.</p> <hr> <p>ADDED LATER (after reading <a href="http://www.joelonsoftware.com/items/2008/09/15.html" rel="nofollow noreferrer">this</a>):</p> <p><strong>Please try to put just ONE item per answer, then we can use voting up to sort out the better/more-interesting ones.</strong> The list below is probably less effective.</p> <p>Ah well... NEXT time I ask a question like this I'll set it up better.</p> <hr> <p>And here are some of the best answers I got:</p> <ol> <li><a href="https://stackoverflow.com/questions/87365/what-identifying-information-can-a-website-capture#87413">James</a> points out that IE transmits the .NET framework version.</li> <li><a href="https://stackoverflow.com/questions/87365/what-identifying-information-can-a-website-capture#87454">AviewAnew</a> points out that one can <a href="http://ha.ckers.org/weird/CSS-history-hack.html" rel="nofollow noreferrer">find what sites you have visited</a>.</li> <li><a href="https://stackoverflow.com/questions/87365/what-identifying-information-can-a-website-capture#87529">Mecki</a> points out that Screen Resolution can be determined.</li> <li><a href="https://stackoverflow.com/questions/87365/what-identifying-information-can-a-website-capture#87529">Mecki</a> <em>also</em> points out that any auto-fill information your browser has cached can be determined, by creating a hidden field, then reading it with JavaScript.</li> <li><a href="https://stackoverflow.com/questions/87365/what-identifying-information-can-a-website-capture#87463">jjrv</a> points out that Flash can list the fonts on the user's machine.</li> <li><a href="https://stackoverflow.com/questions/87365/what-identifying-information-can-a-website-capture#87473">Kent</a> points out that you can find out <a href="http://weblogs.asp.net/jezell/archive/2006/08/25/Stealing-History.aspx" rel="nofollow noreferrer">what websites a person has visited</a>.</li> <li><a href="https://stackoverflow.com/questions/87365/what-identifying-information-can-a-website-capture#87493">Silver Dragon</a> points out you can determine the location of the mouse within the browsing window using Flash and AJAX.</li> <li><a href="https://stackoverflow.com/questions/87365/what-identifying-information-can-a-website-capture#87494">Jim</a> points out that you can tell what language the user has configured in their browser from a HTTP header.</li> <li><a href="https://stackoverflow.com/questions/87365/what-identifying-information-can-a-website-capture#87494">Jim</a> also mentions that you can detect whether people are using Greasemonkey or something similar to modify the page.</li> </ol>
[ { "answer_id": 87494, "author": "Jim", "author_id": 8427, "author_profile": "https://Stackoverflow.com/users/8427", "pm_score": 0, "selected": false, "text": "Accept-Language Accept User-Agent" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/87365", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14570/" ]
87,372
<p>I'm asking for a template trick to detect if a class has a specific member function of a given signature.</p> <p>The problem is similar to the one cited here <a href="http://www.gotw.ca/gotw/071.htm" rel="noreferrer">http://www.gotw.ca/gotw/071.htm</a> but not the same: in the item of Sutter's book he answered to the question that a class C MUST PROVIDE a member function with a particular signature, else the program won't compile. In my problem I need to do something if a class has that function, else do "something else". </p> <p>A similar problem was faced by boost::serialization but I don't like the solution they adopted: a template function that invokes by default a free function (that you have to define) with a particular signature unless you define a particular member function (in their case "serialize" that takes 2 parameters of a given type) with a particular signature, else a compile error will happens. That is to implement both intrusive and non-intrusive serialization. </p> <p>I don't like that solution for two reasons:</p> <ol> <li>To be non intrusive you must override the global "serialize" function that is in boost::serialization namespace, so you have IN YOUR CLIENT CODE to open namespace boost and namespace serialization!</li> <li>The stack to resolve that mess was 10 to 12 function invocations.</li> </ol> <p>I need to define a custom behavior for classes that has not that member function, and my entities are inside different namespaces (and I don't want to override a global function defined in one namespace while I'm in another one)</p> <p>Can you give me a hint to solve this puzzle?</p>
[ { "answer_id": 87474, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 2, "selected": false, "text": "serialize std swap" }, { "answer_id": 87846, "author": "yrp", "author_id": 7228, "author_profile": "https...
2008/09/17
[ "https://Stackoverflow.com/questions/87372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10120/" ]
87,380
<p>I need to write a function that receives a string and a regex. I need to check if there is a match and return the start and end location of a match. (The regex was already compiled by <code>qr//</code>.)</p> <p>The function might also receive a "global" flag and then I need to return the (start,end) pairs of all the matches.</p> <p>I cannot change the regex, not even add <code>()</code> around it as the user might use <code>()</code> and <code>\1</code>. Maybe I can use <code>(?:)</code>.</p> <p>Example: given "ababab" and the regex <code>qr/ab/</code>, in the global case I need to get back 3 pairs of (start, end).</p>
[ { "answer_id": 87410, "author": "Leon Timmermans", "author_id": 4727, "author_profile": "https://Stackoverflow.com/users/4727", "pm_score": 3, "selected": false, "text": "length $1 sub match_positions {\n my ($regex, $string) = @_;\n return if not $string =~ /($regex)/;\n return...
2008/09/17
[ "https://Stackoverflow.com/questions/87380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11827/" ]
87,381
<p>With ViEmu you really need to unbind a lot of resharpers keybindings to make it work well.</p> <p>Does anyone have what they think is a good set of keybindings that work well for resharper when using ViEmu?</p> <p>What I'm doing at the moment using the Visual Studio bindings from Resharper. Toasting all the conflicting ones with ViEmu, and then just driving the rest through the menu modifiers ( Alt-R keyboard shortcut for the menu item ). I also do the same with Visual Assist shortcuts ( for C++ )</p> <p>if anyones got any tips and tricks for ViEmu / Resharper or Visual Assist working together well I'd most apprciate it!</p>
[ { "answer_id": 994587, "author": "Jay", "author_id": 114994, "author_profile": "https://Stackoverflow.com/users/114994", "pm_score": 5, "selected": true, "text": "map <C-S-c> gS:vsc Edit.CommentSelection<CR>\nmap <C-A-c> gS:vsc Edit.UncommentSelection<CR>\n map <C-S-A-f> gS:vsc ReSharper...
2008/09/17
[ "https://Stackoverflow.com/questions/87381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10431/" ]
87,408
<p>a lot of websites like twitter, facebook and others let the users enter their email id and pwd and 'extract' the contacts based on that. </p> <p>Anyone know how this is done? </p>
[ { "answer_id": 87624, "author": "Dónal", "author_id": 2648, "author_profile": "https://Stackoverflow.com/users/2648", "pm_score": 2, "selected": false, "text": "List<Contact> contacts = SimpleAddressBookImporter.fetchContacts(emailAddress, password)\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/87408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
87,422
<p>I am writing an application that if the user hits back, it may resend the same information and mess up the flow and integrity of data. How do I disable it for users who are with and without javascript on?</p>
[ { "answer_id": 87632, "author": "Claus Thomsen", "author_id": 15555, "author_profile": "https://Stackoverflow.com/users/15555", "pm_score": 3, "selected": false, "text": " Response.Cache.SetCacheability(HttpCacheability.NoCache);\n Response.Cache.SetExpires(Now.AddSeconds(-1));\n Resp...
2008/09/17
[ "https://Stackoverflow.com/questions/87422", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10088/" ]
87,425
<p>Do you generally assume that toString() on any given object has a low cost (i.e. for logging)? I do. Is that assumption valid? If it has a high cost should that normally be changed? What are valid reasons to make a toString() method with a high cost? The only time that I get concerned about toString costs is when I know that it is on some sort of collection with many members. From: <a href="http://jamesjava.blogspot.com/2007/08/tostring-cost.html" rel="noreferrer">http://jamesjava.blogspot.com/2007/08/tostring-cost.html</a></p> <p>Update: Another way to put it is: Do you usually look into the cost of calling toString on any given class before calling it?</p>
[ { "answer_id": 87519, "author": "Eli Courtwright", "author_id": 1694, "author_profile": "https://Stackoverflow.com/users/1694", "pm_score": 5, "selected": true, "text": "Arrays.toString Collections.toString java.util java.net.URL" }, { "answer_id": 94872, "author": "Mr. Shiny...
2008/09/17
[ "https://Stackoverflow.com/questions/87425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6770/" ]
87,442
<p>I know that you can make a virtual network interface in Windows (see <a href="http://support.microsoft.com/kb/236869" rel="nofollow noreferrer">here</a>), and in Linux it is also pretty easy with ip-aliases, but does something similar exist for <strong>Mac OS X</strong>? I've been looking for loopback adapters, virtual interfaces and couldn't find a good solution.</p> <p>You can create a new interface in the networking panel, based on an existing interface, but it will not act as a real fully functional interface (if the original interface is inactive, then the derived one is also inactive).</p> <p>This scenario is needed when working in a completely disconnected situation. Even then, it makes sense to have networking capabilities when running servers in a VMWare installation. Those virtual machines can be reached by their IP address, but not by their DNS name, even if I run a DNS server in one of those virtual machines. By configuring an interface to use the virtual DNS server, I thought I could test some DNS scenario's. Unfortunately, no interface is resolving DNS names if none of them are inactive...</p>
[ { "answer_id": 6375307, "author": "bmasterswizzle", "author_id": 801917, "author_profile": "https://Stackoverflow.com/users/801917", "pm_score": 5, "selected": false, "text": "/Library/Preferences/SystemConfiguration/preferences.plist preferences.plist preferences.plist preferences.plist...
2008/09/17
[ "https://Stackoverflow.com/questions/87442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9504/" ]
87,458
<p>I want to do this so that I can say something like, <code>svn mv *.php php-folder/</code>, but it does not seem to be working. Is it even possible? No mention of it is made on the relevant page in the <a href="http://svnbook.red-bean.com/en/1.0/re18.html" rel="noreferrer">svn book</a>.</p> <p>Example output of <code>svn mv *.php php-folder/</code> :<br> <code>svn: Client error in parsing arguments</code></p> <p>Being able to move a whole file system would be a plus, so if any answers given could try to include that ability, that'd be cool.</p> <p>Thanks in advance!</p>
[ { "answer_id": 87516, "author": "sirprize", "author_id": 12902, "author_profile": "https://Stackoverflow.com/users/12902", "pm_score": 4, "selected": true, "text": "for file in *.php; do svn mv $file php-folder/; done\n" }, { "answer_id": 87524, "author": "cjm", "author_i...
2008/09/17
[ "https://Stackoverflow.com/questions/87458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16562/" ]
87,459
<p>I have a class with a string property that's actually several strings joined with a separator.</p> <p>I'm wondering if it is good form to have a proxy property like this:</p> <pre><code>public string ActualProperty { get { return actualProperty; } set { actualProperty = value; } } public string[] IndividualStrings { get { return ActualProperty.Split(.....); } set { // join strings from array in propval .... ; ActualProperty = propval; } } </code></pre> <p>Is there any risks I have overlooked?</p>
[ { "answer_id": 87498, "author": "Shog9", "author_id": 811, "author_profile": "https://Stackoverflow.com/users/811", "pm_score": 1, "selected": false, "text": "Split() IndividualStrings ActualProperty actualProperty" }, { "answer_id": 88196, "author": "Steve Cooper", "auth...
2008/09/17
[ "https://Stackoverflow.com/questions/87459", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4192/" ]
87,468
<p>Essentially I have a PHP page that calls out some other HTML to be rendered through an object's method. It looks like this:</p> <p>MY PHP PAGE:</p> <pre><code>// some content... &lt;?php $GLOBALS["topOfThePage"] = true; $this-&gt;renderSomeHTML(); ?&gt; // some content... &lt;?php $GLOBALS["topOfThePage"] = false; $this-&gt;renderSomeHTML(); ?&gt; </code></pre> <p>The first method call is cached, but I need renderSomeHTML() to display slightly different based upon its location in the page. I tried passing through to $GLOBALS, but the value doesn't change, so I'm assuming it is getting cached.</p> <p>Is this not possible without passing an argument through the method or by not caching it? Any help is appreciated. This is not my application -- it is Magento.</p> <p><strong>Edit:</strong></p> <p>This is Magento, and it looks to be using memcached. I tried to pass an argument through renderSomeHTML(), but when I use func_get_args() on the PHP include to be rendered, what comes out is not what I put into it.</p> <p><strong>Edit:</strong></p> <p>Further down the line I was able to "invalidate" the cache by calling a different method that pulled the same content and passing in an argument that turned off caching. Thanks everyone for your help.</p>
[ { "answer_id": 87507, "author": "DGM", "author_id": 14253, "author_profile": "https://Stackoverflow.com/users/14253", "pm_score": 1, "selected": false, "text": "$GLOBALS. $this->renderSomeHTML(true);\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/87468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
87,542
<p>I have a set of WCF web services connected to dynamically by a desktop application.</p> <p>My problem is the really detailed config settings that WCF requires to work. Getting SSL to work involves custom settings. Getting MTOM or anything else to work requires more. You want compression? Here we go again...</p> <p>WCF is really powerful - you can use a host of different ways to connect, but all seem to involve lots of detailed config. If host and client don't match perfectly you get hard to decipher errors.</p> <p>I want to make the desktop app far easier to configure - ideally some kind of auto-discovery. The users of the desktop app should just be able to enter the URL and it do the rest.</p> <p>Does anyone know a good way to do this?</p> <p>I know Visual Studio can set the config up for you, but I want the desktop app to be able to do it based on a wide variety of different server set-ups.</p> <p>I know that VS's tools can be used externally, but I'm looking for users of the desktop apps to not have to be WCF experts. I know MS made this intentionally over complicated.</p> <p>Is there any way, mechanism, 3rd party library or anything to make auto-discovery of WCF settings possible?</p>
[ { "answer_id": 101186, "author": "Keith", "author_id": 905, "author_profile": "https://Stackoverflow.com/users/905", "pm_score": 1, "selected": false, "text": "/// <summary>If the url doesn't end with a WSDL query string append it</summary>\nstatic string AddWsdlQueryStringIfMissing( str...
2008/09/17
[ "https://Stackoverflow.com/questions/87542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/905/" ]
87,557
<p>I have a class with many embedded assets. </p> <p>Within the class, I would like to get the class definition of an asset by name. I have tried using getDefinitionByName(), and also ApplicationDomain.currentDomain.getDefinition() but neither work.</p> <p>Example:</p> <pre><code>public class MyClass { [Embed(source="images/image1.png")] private static var Image1Class:Class; [Embed(source="images/image2.png")] private static var Image2Class:Class; [Embed(source="images/image3.png")] private static var Image3Class:Class; private var _image:Bitmap; public function MyClass(name:String) { var ClassDef:Class = getDefinitionByName(name) as Class; //&lt;&lt;-- Fails _image = new ClassDef() as Bitmap; } } var cls:MyClass = new MyClass("Image1Class"); </code></pre>
[ { "answer_id": 87596, "author": "Marc Hughes", "author_id": 6791, "author_profile": "https://Stackoverflow.com/users/6791", "pm_score": 4, "selected": true, "text": "public class MyClass\n{\n [Embed(source=\"images/image1.png\")] private static var Image1Class:Class;\n [Embed(source=\"...
2008/09/17
[ "https://Stackoverflow.com/questions/87557", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8399/" ]
87,561
<p>I'd like to add some pie, bar and scatter charts to my Ruby on Rails web application. I want want them to be atractive, easy to add and not introduce much overhead. </p> <p>What charting solution would you recommend?<br> What are its drawbacks (requires Javascript, Flash, expensive, etc)?</p>
[ { "answer_id": 87646, "author": "Clinton Dreisbach", "author_id": 6262, "author_profile": "https://Stackoverflow.com/users/6262", "pm_score": 7, "selected": true, "text": "GoogleChart::PieChart.new('320x200', \"Things I Like To Eat\", false) do |pc| \n pc.data \"Broccoli\", 30\n pc.dat...
2008/09/17
[ "https://Stackoverflow.com/questions/87561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16779/" ]
87,587
<p>Continuing my problem from yesterday, the Silverlight datagrid I have from this <a href="https://stackoverflow.com/questions/74461/silverlight-datagrid-control-selection-changed-event-interfering-with-sorting">issue</a> is now causing Stack Overflow errors when sorting a column with a large amount of data (Like the text column that contains a where clause for a SQL statment). When you sort, it'll fire the SelectedIndexChanged event for the datagrid and then still try to stort. If you click the header again the stack overflow occours. </p> <p>Does anyone have an idea on how to stop the sorting on this control for a column? All the other columns sort fine (but still fire that darn SelectedIndexChanged event), but if I could shut off the column for whereClause it'd be perfect.</p> <p>Does anyone have a better idea at how to get this to work?</p>
[ { "answer_id": 88253, "author": "BKimmel", "author_id": 13776, "author_profile": "https://Stackoverflow.com/users/13776", "pm_score": 0, "selected": false, "text": "dataGridView1.Columns[*Numberofthecolumnyoudontwantsorted*].SortMode\n= DataGridViewColumnSortMode.NotSortable;\n" }, {...
2008/09/17
[ "https://Stackoverflow.com/questions/87587", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12413/" ]
87,612
<p>I want to fire up a flash presentation inside Powerpoint 2007. I am calling the Win32 ShellExecute() routine. When I run this from a location whose path is a UNC path (\myserver\myfolder\sample.ppt) it does not work.</p> <p>The ShellExecute routine expects 6 arguments, one of which is the path to run it from. I've tried to set this parameter to C:\ as well as using ActivePresentation.Path (which is a UNC path). Neither works.</p>
[ { "answer_id": 91379, "author": "Robert Mearns", "author_id": 5050, "author_profile": "https://Stackoverflow.com/users/5050", "pm_score": 2, "selected": false, "text": "* Autoload = True\n* EmbedMovie = True\n* Enabled = True\n* Loop = True\n* Playing = True\n* Visible = True\n* Movie = ...
2008/09/17
[ "https://Stackoverflow.com/questions/87612", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13800/" ]
87,621
<p>I have an XML that I want to load to objects, manipulate those objects (set values, read values) and then save those XMLs back. It is important for me to have the XML in the structure (xsd) that I created.</p> <p>One way to do that is to write my own serializer, but is there a built in support for it or open source in C# that I can use? </p>
[ { "answer_id": 87641, "author": "ckarras", "author_id": 5688, "author_profile": "https://Stackoverflow.com/users/5688", "pm_score": 6, "selected": true, "text": "xsd.exe dependency1.xsd dependency2.xsd schema.xsd /out:outputDir\n" }, { "answer_id": 88003, "author": "Community...
2008/09/17
[ "https://Stackoverflow.com/questions/87621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9855/" ]
87,647
<p>I have a DTS package with a data transformation task (data pump). I’d like to source the data with the results of a stored procedure that takes parameters, but DTS won’t preview the result set and can’t define the columns in the data transformation task.</p> <p>Has anyone gotten this to work?</p> <p>Caveat: The stored procedure uses two temp tables (and cleans them up, of course)</p>
[ { "answer_id": 88006, "author": "Cervo", "author_id": 16219, "author_profile": "https://Stackoverflow.com/users/16219", "pm_score": 2, "selected": false, "text": "DECLARE @param1 DataType1 \nDECLARE @param2 DataType2\nSET @param1 = global variable \nSET @param2 = global variable (I for...
2008/09/17
[ "https://Stackoverflow.com/questions/87647", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16813/" ]
87,676
<p>Every time I need to work with date and/or timstamps in Java I always feel like I'm doing something wrong and spend endless hours trying to find a better way of working with the APIs without having to code my own Date and Time utility classes. Here's a couple of annoying things I just ran into:</p> <ul> <li><p>0-based months. I realize that best practice is to use Calendar.SEPTEMBER instead of 8, but it's annoying that 8 represents September and not August.</p></li> <li><p>Getting a date without a timestamp. I always need the utility that Zeros out the timestamp portion of the date.</p></li> <li><p>I know there's other issues I've had in the past, but can't recall. Feel free to add more in your responses.</p></li> </ul> <p>So, my question is ... What third party APIs do you use to simplify Java's usage of Date and Time manipulation, if any? Any thoughts on using <a href="http://www.joda.org/joda-time/" rel="noreferrer">Joda</a>? Anyone looked closer at JSR-310 Date and Time API? </p>
[ { "answer_id": 88135, "author": "Michael", "author_id": 13379, "author_profile": "https://Stackoverflow.com/users/13379", "pm_score": 2, "selected": false, "text": "DateUtils DateUtils.truncate() Date Calendar" }, { "answer_id": 88974, "author": "Patrick Wilkes", "author_...
2008/09/17
[ "https://Stackoverflow.com/questions/87676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5917/" ]
87,689
<p>I have several applications that are part of a suite of tools that various developers at our studio use. these applications are mainly command line apps that open a DOS cmd shell. These apps in turn start up a GUI application that tracks output and status (via sockets) of these command line apps.</p> <p>The command line apps can be started with the user is logged in, when their workstation is locked (they fire off a batch file and then immediately lock their workstaion), and when they are logged out (via a scheduled task). The problems that I have are with the last two cases.</p> <p>If any of these apps fire off when the user is locked or logged out, these command will spawn the GUI windows which tracks the output/status. That's fine, but say the user has their workstation locked -- when they unlock their workstation, the GUI isn't visible. It's running the task list, but it's not visible. The next time these users run some of our command line apps, the GUI doesn't get launched (because it's already running), but because it's not visible on the desktop, users don't see any output.</p> <p>What I'm looking for is a way to tell from my command line apps if they are running behind a locked workstation or when a user is logged out (via scheduled task) -- basically are they running without a user's desktop visible. If I can tell that, then I can simply not start up our GUI and can prevent a lot of problem.</p> <p>These apps that I need to test are C/C++ Windows applications.</p> <p>I hope that this make sense.</p>
[ { "answer_id": 92462, "author": "Mark", "author_id": 4405, "author_profile": "https://Stackoverflow.com/users/4405", "pm_score": 3, "selected": true, "text": "HWINSTA dHandle = GetProcessWindowStation();\nif ( GetUserObjectInformation(dHandle, UOI_NAME, nameBuffer, bufferLen, &lenNeeded)...
2008/09/17
[ "https://Stackoverflow.com/questions/87689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4405/" ]
87,692
<p>How can I, as the wiki admin, enter scripting (Javascript) into a Sharepoint wiki page?<br><br> I would like to enter a title and, when clicking on that, having displayed under it a small explanation. I usually have done that with javascript, any other idea?</p>
[ { "answer_id": 87739, "author": "RobbieGee", "author_id": 6752, "author_profile": "https://Stackoverflow.com/users/6752", "pm_score": 0, "selected": false, "text": "title=\"text here\" alt=\"text here\" <h2 title=\"some explanation here\">headline</h2>" }, { "answer_id": 87744, ...
2008/09/17
[ "https://Stackoverflow.com/questions/87692", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15346/" ]
87,734
<p>If the major axis of the ellipse is vertical or horizontal, it's easy to calculate the bounding box, but what about when the ellipse is rotated?</p> <p>The only way I can think of so far is to calculate all the points around the perimeter and find the max/min x and y values. It seems like there should be a simpler way.</p> <p>If there's a function (in the mathematical sense) that describes an ellipse at an arbitrary angle, then I could use its derivative to find points where the slope is zero or undefined, but I can't seem to find one.</p> <p><strong>Edit: to clarify, I need the axis-aligned bounding box, i.e. it should not be rotated with the ellipse, but stay aligned with the x axis so transforming the bounding box won't work.</strong></p>
[ { "answer_id": 88020, "author": "Mike Tunnicliffe", "author_id": 13956, "author_profile": "https://Stackoverflow.com/users/13956", "pm_score": 6, "selected": true, "text": "x = h + a*cos(t)*cos(phi) - b*sin(t)*sin(phi) [1]\ny = k + b*sin(t)*cos(phi) + a*cos(t)*sin(phi) [2]\n 0 = dx/dt ...
2008/09/17
[ "https://Stackoverflow.com/questions/87734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2214/" ]
87,735
<p>I have a simple SQL 'Select' query, and I'd like to dump the results into an Excel file. I'm only able to save as .csv and converting to .xls creates some super ugly output. In any case, as far as I can tell (using Google) this doesn't seem to be so straight forward. Any help would be greatly appreciated.</p>
[ { "answer_id": 6704819, "author": "Prathap", "author_id": 565302, "author_profile": "https://Stackoverflow.com/users/565302", "pm_score": 2, "selected": false, "text": "insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0', \n'Excel 8.0;Database=D:\\testing.xls;', \n'SELECT * FROM [SheetName$...
2008/09/17
[ "https://Stackoverflow.com/questions/87735", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16830/" ]
87,747
<p>I want to create a list of columns in SQL Server 2005 that have identity columns and their corresponding table in T-SQL.</p> <p>Results would be something like:</p> <p>TableName, ColumnName</p>
[ { "answer_id": 87773, "author": "Kevin Crumley", "author_id": 1818, "author_profile": "https://Stackoverflow.com/users/1818", "pm_score": 6, "selected": false, "text": "select o.name, c.name\nfrom sys.objects o inner join sys.columns c on o.object_id = c.object_id\nwhere c.is_identity = ...
2008/09/17
[ "https://Stackoverflow.com/questions/87747", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
87,753
<p>How can I resize an image, with the image quality unaffected?</p>
[ { "answer_id": 87786, "author": "Kris Erickson", "author_id": 3798, "author_profile": "https://Stackoverflow.com/users/3798", "pm_score": 8, "selected": false, "text": "Bitmap newImage = new Bitmap(newWidth, newHeight);\nusing (Graphics gr = Graphics.FromImage(newImage))\n{\n gr.Smoot...
2008/09/17
[ "https://Stackoverflow.com/questions/87753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1368/" ]
87,758
<p>I have several old 3.5in floppy disks that I would like to backup. My attempts to create an image of the disks have failed. I tried using the UNIX utility dd_rescue, but when the kernel tries to open (<code>/dev/fd0</code>) I get a kernel error,</p> <pre><code>floppy0: probe failed... </code></pre> <p>I would like an image because some of the floppies are using the LIF file system format. Does anyone have any ideas as to what I should do?</p> <p>HP now Agilent made some tools that could read and write to files on LIF formatted disk. I could use these tools to copy and convert the files to the local disk but not without possibly losing some data in the process. In other words, converting from LIF to some other format back to LIF will lose some information.</p> <p>I just want to backup the raw bytes on the disk and not be concerned with the type of file system.</p>
[ { "answer_id": 89689, "author": "Ana Betts", "author_id": 5728, "author_profile": "https://Stackoverflow.com/users/5728", "pm_score": 0, "selected": false, "text": "dd if=/dev/floppy0 of=animage.bin conv=noerror\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/87758", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4778/" ]
87,760
<p>Ive been smashing my head with this for a while. I have 2 completely identical .wmv files encoded with wmv3 codec. I put them both through ffmpeg with the following command:</p> <pre><code>/usr/bin/ffmpeg -i file.wmv -ar 44100 -ab 64k -qscale 9 -s 512x384 -f flv file.flv </code></pre> <p>One file converts just fine, and gives me the following output:</p> <pre><code> FFmpeg version SVN-r11070, Copyright (c) 2000-2007 Fabrice Bellard, et al. configuration: --prefix=/usr --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --extra-cflags=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic --enable-liba52 --enable-libfaac --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libxvid --enable-libx264 --enable-pp --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-optimizations --disable-strip libavutil version: 49.5.0 libavcodec version: 51.48.0 libavformat version: 51.19.0 built on Jun 25 2008 09:17:38, gcc: 4.1.2 20070925 (Red Hat 4.1.2-33) Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -&gt; 29.97 (30000/1001) Input #0, asf, from 'ok.wmv': Duration: 00:14:22.3, start: 3.000000, bitrate: 467 kb/s Stream #0.0: Audio: wmav2, 44100 Hz, stereo, 64 kb/s Stream #0.1: Video: wmv3, yuv420p, 320x240 [PAR 0:1 DAR 0:1], 400 kb/s, 29.97 tb(r) Output #0, flv, to 'ok.flv': Stream #0.0: Video: flv, yuv420p, 512x384 [PAR 0:1 DAR 0:1], q=2-31, 200 kb/s, 29.97 tb(c) Stream #0.1: Audio: libmp3lame, 44100 Hz, stereo, 64 kb/s Stream mapping: Stream #0.1 -&gt; #0.0 Stream #0.0 -&gt; #0.1 Press [q] to stop encoding frame=25846 fps=132 q=9.0 Lsize= 88486kB time=862.4 bitrate= 840.5kbits/s video:80827kB audio:6738kB global headers:0kB muxing overhead 1.050642% </code></pre> <p>While another file, fails:</p> <pre><code>FFmpeg version SVN-r11070, Copyright (c) 2000-2007 Fabrice Bellard, et al. configuration: --prefix=/usr --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --extra-cflags=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic --enable-liba52 --enable-libfaac --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libxvid --enable-libx264 --enable-pp --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-optimizations --disable-strip libavutil version: 49.5.0 libavcodec version: 51.48.0 libavformat version: 51.19.0 built on Jun 25 2008 09:17:38, gcc: 4.1.2 20070925 (Red Hat 4.1.2-33) [wmv3 @ 0x3700940d20]Extra data: 8 bits left, value: 0 Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -&gt; 25.00 (25/1) Input #0, asf, from 'bad3.wmv': Duration: 00:06:34.9, start: 4.000000, bitrate: 1666 kb/s Stream #0.0: Audio: 0x0162, 48000 Hz, stereo, 256 kb/s Stream #0.1: Video: wmv3, yuv420p, 512x384 [PAR 0:1 DAR 0:1], 1395 kb/s, 25.00 tb(r) File 'ok.flv' already exists. Overwrite ? [y/N] y Output #0, flv, to 'ok.flv': Stream #0.0: Video: flv, yuv420p, 512x384 [PAR 0:1 DAR 0:1], q=2-31, 200 kb/s, 25.00 tb(c) Stream #0.1: Audio: libmp3lame, 48000 Hz, stereo, 64 kb/s Stream mapping: Stream #0.1 -&gt; #0.0 Stream #0.0 -&gt; #0.1 Unsupported codec (id=0) for input stream #0.0 </code></pre> <p>The only difference I see is with the Input audio codec</p> <p>Working:</p> <pre><code>Stream #0.0: Audio: wmav2, 44100 Hz, stereo, 64 kb/s </code></pre> <p>Not working:</p> <pre><code> Stream #0.0: Audio: 0x0162, 48000 Hz, stereo, 64 kb/s </code></pre> <p>Any ideas?</p>
[ { "answer_id": 239656, "author": "razong", "author_id": 29885, "author_profile": "https://Stackoverflow.com/users/29885", "pm_score": 4, "selected": true, "text": "ffmpeg audio 0x0162" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/87760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
87,769
<p>How do you connect to Oracle using PHP on MAC OS X?</p>
[ { "answer_id": 87860, "author": "Guy", "author_id": 993, "author_profile": "https://Stackoverflow.com/users/993", "pm_score": 0, "selected": false, "text": "c:> SQLPLUS\n\nCONNECT scott/tiger@mydatabase\n" }, { "answer_id": 5263006, "author": "nick fox", "author_id": 2232...
2008/09/17
[ "https://Stackoverflow.com/questions/87769", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
87,771
<p>How would I go about...</p> <ul> <li><p>multiplying two 64-bit numbers </p></li> <li><p>multiplying two 16-digit hexadecimal numbers </p></li> </ul> <p>...using Assembly Language. </p> <p>I'm only allowed to use registers %eax, %ebx, %ecx, %edx, and the stack.</p> <p>EDIT: Oh, I'm using ATT Syntax on the x86<br> EDIT2: Not allowed to decompile into assembly...</p>
[ { "answer_id": 87884, "author": "BCS", "author_id": 1343, "author_profile": "https://Stackoverflow.com/users/1343", "pm_score": 0, "selected": false, "text": "a:b * c:d = e:f\n// goes to\ne:f = b*d;\nx:y = a*d; e += x;\nx:y = b*c; e += x;\n" }, { "answer_id": 15542823, "aut...
2008/09/17
[ "https://Stackoverflow.com/questions/87771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13597/" ]
87,795
<p>All I want is to update an ListViewItem's text whithout seeing any flickering.</p> <p>This is my code for updating (called several times):</p> <pre><code>listView.BeginUpdate(); listViewItem.SubItems[0].Text = state.ToString(); // update the state listViewItem.SubItems[1].Text = progress.ToString(); // update the progress listView.EndUpdate(); </code></pre> <p>I've seen some solutions that involve overriding the component's <code>WndProc():</code></p> <pre><code>protected override void WndProc(ref Message m) { if (m.Msg == (int)WM.WM_ERASEBKGND) { m.Msg = (int)IntPtr.Zero; } base.WndProc(ref m); } </code></pre> <p><strong>They say it solves the problem, but in my case It didn't</strong>. I believe this is because I'm using icons on every item.</p>
[ { "answer_id": 87848, "author": "Ed S.", "author_id": 1053, "author_profile": "https://Stackoverflow.com/users/1053", "pm_score": 0, "selected": false, "text": "SetStyle(\n ControlStyles.AllPaintingInWmPaint |\n ControlStyles.UserPaint |\n ControlStyles.DoubleBuffer, true)\n" }, {...
2008/09/17
[ "https://Stackoverflow.com/questions/87795", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10833/" ]
87,812
<p>Say I have the following class</p> <pre><code>MyComponent : IMyComponent { public MyComponent(int start_at) {...} } </code></pre> <p>I can register an instance of it with castle windsor via xml as follows</p> <pre><code>&lt;component id="sample" service="NS.IMyComponent, WindsorSample" type="NS.MyComponent, WindsorSample"&gt; &lt;parameters&gt; &lt;start_at&gt;1&lt;/start_at &gt; &lt;/parameters&gt; &lt;/component&gt; </code></pre> <p>How would I go about doing the exact same thing but in code? (Notice, the constructor parameter)</p>
[ { "answer_id": 87893, "author": "Gareth", "author_id": 1313, "author_profile": "https://Stackoverflow.com/users/1313", "pm_score": 0, "selected": false, "text": "T Resolve<T>(IDictionary arguments)\n object Resolve(Type service, IDictionary arguments)\n IDictionary<string, object> values...
2008/09/17
[ "https://Stackoverflow.com/questions/87812", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5056/" ]
87,818
<p>Hi I am trying to find a way to read the cookie that i generated in .net web application to read that on the php page because i want the users to login once but they should be able to view .net and php pages ,until the cookie expires user should not need to login in again , but both .net and php web applications are on different servers , help me with this issue please , thanks</p>
[ { "answer_id": 87851, "author": "blowdart", "author_id": 2525, "author_profile": "https://Stackoverflow.com/users/2525", "pm_score": 1, "selected": false, "text": "Response.Cookies[\"domain\"].Domain = \"contoso.com\";\n" }, { "answer_id": 88174, "author": "Mike King", "a...
2008/09/17
[ "https://Stackoverflow.com/questions/87818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
87,821
<p>Is it possible to use an <strong>IF</strong> clause within a <strong>WHERE</strong> clause in MS SQL?</p> <p>Example:</p> <pre><code>WHERE IF IsNumeric(@OrderNumber) = 1 OrderNumber = @OrderNumber ELSE OrderNumber LIKE '%' + @OrderNumber + '%' </code></pre>
[ { "answer_id": 87839, "author": "bdukes", "author_id": 2688, "author_profile": "https://Stackoverflow.com/users/2688", "pm_score": 9, "selected": true, "text": "WHERE OrderNumber LIKE\n CASE WHEN IsNumeric(@OrderNumber) = 1 THEN \n @OrderNumber \n ELSE\n '%' + @OrderNumber\n END...
2008/09/17
[ "https://Stackoverflow.com/questions/87821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/299/" ]
87,831
<p>Nant seems very compiler-centric - which is guess is because it's considered a .NET development system. But I know it can be done! I've seen it. The platform we're building on has its own compiler and doesn't use 'cl.exe' for c++. We're building a C++ app on a different platform and would like to override with our own compiler. Can anyone point me at a way to do that or at least how to set up a target of my own that will use our target platform's compiler?</p>
[ { "answer_id": 87878, "author": "Romain Verdier", "author_id": 4687, "author_profile": "https://Stackoverflow.com/users/4687", "pm_score": 0, "selected": false, "text": "<exec>" }, { "answer_id": 87948, "author": "Jeff Cuscutis", "author_id": 2277, "author_profile": "...
2008/09/17
[ "https://Stackoverflow.com/questions/87831", "https://Stackoverflow.com", "https://Stackoverflow.com/users/424554/" ]
87,849
<p>I am about to move to SVN as my RCS of choice (after many years using CVS) and have a basic question...</p> <p>I have a number of shared projects - code that I want to use with lots of different projects. Is it possible to 'link' these shared folders to the projects that need them, so checking out a project will also checkout the shared code?</p> <p>For example, suppose my repository looks like this:</p> <p>root<br> --project1<br> --project2<br> --shared<br> --smtp </p> <p>When I checkout project1, I also want to checkout shared and smtp.</p> <p>Back in my CVS days I would of used a Unix symbolic link in one of the project folders, but as my new SVN repository won't necessarily be hosted on a Unix box, I can't do the same.</p>
[ { "answer_id": 87899, "author": "jamuraa", "author_id": 9805, "author_profile": "https://Stackoverflow.com/users/9805", "pm_score": 2, "selected": false, "text": "$ svn propget svn:externals calc\nthird-party/sounds http://svn.example.com/repos/sounds\nthird-party/skins -r148...
2008/09/17
[ "https://Stackoverflow.com/questions/87849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9236/" ]
87,871
<p>How best to make the selected date of an ASP.NET Calendar control available to JavaScript?</p> <p>Most controls are pretty simple, but the calendar requires more than just a simple <em>document.getElementById().value</em>.</p>
[ { "answer_id": 88199, "author": "Christian C. Salvadó", "author_id": 5445, "author_profile": "https://Stackoverflow.com/users/5445", "pm_score": 0, "selected": false, "text": "document.getElementById('<%= DateTextBox.ClientID%>').value;" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/87871", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3043/" ]
87,877
<p>I am trying to build a dependency graph of tables based on the foreign keys between them. This graph needs to start with an arbitrary table name as its root. I could, given a table name look up the tables that reference it using the all_constraints view, then look up the tables that reference them, and so on, but this would be horrible inefficient. I wrote a recursive query that does this for all tables, but when I add:</p> <pre><code>START WITH Table_Name=:tablename </code></pre> <p>It doesn't return the entire tree.</p>
[ { "answer_id": 88217, "author": "Milan Babuškov", "author_id": 14690, "author_profile": "https://Stackoverflow.com/users/14690", "pm_score": 2, "selected": false, "text": "while (rows left in that table)\n list = rows where table name exists in child but not in parent\n print list\n r...
2008/09/17
[ "https://Stackoverflow.com/questions/87877", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9940/" ]
87,885
<p>anyone have any experience using this? if so, is it worth while?</p>
[ { "answer_id": 9679469, "author": "Evans Y.", "author_id": 1118703, "author_profile": "https://Stackoverflow.com/users/1118703", "pm_score": 3, "selected": false, "text": "java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=<port> <class>\n jdb -attach <port>\n jdb -sourcepath \...
2008/09/17
[ "https://Stackoverflow.com/questions/87885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13143/" ]
87,902
<p>I am trying to validate user id's matching the example:</p> <pre><code>smith.jack or smith.jack.s </code></pre> <p>In other words, any number of non-whitespace characters (except dot), followed by exactly one dot, followed by any number of non-whitespace characters (except dot), optionally followed by exactly one dot followed by any number of non-whitespace characters (except dot). I have come up with several variations that work fine except for allowing consecutive dots! For example, the following Regex</p> <pre><code>^([\S][^.]*[.]{1}[\S][^.]*|[\S][^.]*[.]{1}[\S][^.]*[.]{1}[\S][^.]*)$ </code></pre> <p>matches "smith.jack" and "smith.jack.s" but also matches "smith..jack" "smith..jack.s" ! My gosh, it even likes a dot as a first character. It seems like it would be so simple to code, but it isn't. I am using .NET, btw.</p> <p>Frustrating.</p>
[ { "answer_id": 87919, "author": "BCS", "author_id": 1343, "author_profile": "https://Stackoverflow.com/users/1343", "pm_score": 1, "selected": false, "text": "[^\\s.]+\\.[^\\s.]+(\\.[^\\s.]+)?\n" }, { "answer_id": 87923, "author": "kch", "author_id": 13989, "author_pr...
2008/09/17
[ "https://Stackoverflow.com/questions/87902", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
87,909
<p>Is it possible to set the title of a page when it's simply a loaded SWF?</p>
[ { "answer_id": 88131, "author": "64BitBob", "author_id": 16339, "author_profile": "https://Stackoverflow.com/users/16339", "pm_score": 2, "selected": false, "text": "getURL('javascript:var x = (document.getElementsByTagName(\"head\")[0].getElementsByTagName(\"title\")[0].firstChild.nodeV...
2008/09/17
[ "https://Stackoverflow.com/questions/87909", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69665/" ]
87,932
<p>Most mature C++ projects seem to have an own <strong>reflection and attribute system</strong>, i.e for defining attributes which can be accessed by string and are automatically serializable. At least many C++ projects I participated in seemed to <strong>reinvent the wheel</strong>.</p> <p>Do you know any <strong>good open source libraries</strong> for C++ which support reflection and attribute containers, specifically:</p> <ul> <li>Defining RTTI and attributes via macros</li> <li>Accessing RTTI and attributes via code</li> <li>Automatic serialisation of attributes</li> <li>Listening to attribute modifications (e.g. OnValueChanged)</li> </ul>
[ { "answer_id": 2486020, "author": "Matthew Herrmann", "author_id": 232066, "author_profile": "https://Stackoverflow.com/users/232066", "pm_score": 2, "selected": false, "text": "struct point\n{\n int x;\n int y;\n\n // add this to your classes\n template <typename Visitor...
2008/09/17
[ "https://Stackoverflow.com/questions/87932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15288/" ]
87,934
<p>In Notepad++, I was writing a JavaScript file and something didn't work: an alert had to be shown when a button was clicked, but it wasn't working.</p> <p>I has used the auto-complete plugin provided with Notepad++, which presented me with <code>onClick</code>.</p> <p>When I changed the capital <code>C</code> to a small <code>c</code>, it did work.</p> <p>So first of all, when looking at the functions in the auto-completion, I noticed a lot of functions using capitals.</p> <p>But when you change <code>getElementById</code> to <code>getelementbyid</code>, you also get an error, and to make matters worse, my handbook from school writes all the stuff with capital letters but the solutions are all done in small letters.</p> <p>So what is it with JavaScript and its selective nature towards which functions can have capital letters in them and which can't?</p>
[ { "answer_id": 87958, "author": "Prestaul", "author_id": 5628, "author_profile": "https://Stackoverflow.com/users/5628", "pm_score": 6, "selected": true, "text": "<div id='divYo' onClick=\"alert('yo!');\">Say Yo</div> // Upper-case 'C'\n <div id='divYo' onclick=\"alert('yo!');\">Say Yo</...
2008/09/17
[ "https://Stackoverflow.com/questions/87934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11795/" ]
87,950
<p>I've been attempting move a directory structure from one location to another in Subversion, but I get an <code>Item '*' is out of date</code> commit error. </p> <p>I have the latest version checked out (so far as I can tell). <code>svn st -u</code> turns up no differences other than the mv commands.</p>
[ { "answer_id": 88079, "author": "Michael", "author_id": 9316, "author_profile": "https://Stackoverflow.com/users/9316", "pm_score": 10, "selected": true, "text": "svn update" }, { "answer_id": 89496, "author": "Aeon", "author_id": 13289, "author_profile": "https://Sta...
2008/09/17
[ "https://Stackoverflow.com/questions/87950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16562/" ]
87,970
<p>I'd like to populate an arraylist by specifying a list of values just like I would an integer array, but am unsure of how to do so without repeated calls to the "add" method.</p> <p>For example, I want to assign { 1, 2, 3, "string1", "string2" } to an arraylist. I know for other arrays you can make the assignment like:</p> <pre><code>int[] IntArray = {1,2,3}; </code></pre> <p>Is there a similar way to do this for an arraylist? I tried the addrange method but the curly brace method doesn't implement the ICollection interface.</p>
[ { "answer_id": 88017, "author": "Sunny Milenov", "author_id": 8220, "author_profile": "https://Stackoverflow.com/users/8220", "pm_score": 4, "selected": true, "text": "object[] myArray = new object[] {1,2,3,\"string1\",\"string2\"};\nArrayList myArrayList = new ArrayList(myArray);\n" }...
2008/09/17
[ "https://Stackoverflow.com/questions/87970", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16866/" ]
87,986
<p>In C# you can get the original error and trace the execution path (stack trace) using the inner exception that is passed up. I would like to know how this can be achieved using the error handling try/catch in sql server 2005 when an error occurs in a stored procedure nested 2 or 3 levels deep. </p> <p>I am hoping that functions like ERROR_MESSAGE(), ERROR_LINE(), ERROR_PROCEDURE(), ERROR_SEVERITY() can be easily passed up the line so that the top level stored proc can access them.</p>
[ { "answer_id": 166372, "author": "Josef", "author_id": 5581, "author_profile": "https://Stackoverflow.com/users/5581", "pm_score": 2, "selected": false, "text": "USE tempdb\ngo\nCREATE PROCEDURE SubProcedure @RandomNumber int, @XMLErrors XML OUTPUT\nAS\nBEGIN\nBEGIN TRY\n IF @RandomNu...
2008/09/17
[ "https://Stackoverflow.com/questions/87986", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11989/" ]
87,999
<p>Well the docs finally said it, I need to take it easy on my wrist for a few months. Being that I'm a .NET Developer this could end my livelihood for a little while, something I'm not anxious to do. That said, are there any good handsfree options for developers? Anyone had success using any of the speech recognition software out there?</p> <p>POSTSCRIPT: I've recovered my arm again to the point where two-handed programming isn't a problem. Dragon Naturally speaking worked well enough, but was slower, not like the keyboard where I was programming faster than I thought.</p>
[ { "answer_id": 350542, "author": "onnodb", "author_id": 1037, "author_profile": "https://Stackoverflow.com/users/1037", "pm_score": 6, "selected": true, "text": "if (somevar == 'a')\n{\n print('You pressed a!');\n}\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/87999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16868/" ]
88,011
<p>For various reasons, such as cookies, SEO, and to keep things simple, I would like to make apache automatically redirect any requests for <a href="http://www.foobar.com/anything" rel="nofollow noreferrer">http://www.foobar.com/anything</a> to <a href="http://foobar.com/anything" rel="nofollow noreferrer">http://foobar.com/anything</a>. The best I could come up with is a mod_rewrite-based monstrosity, is there some easy simple way to tell it "Redirect all requests for domain ABC to XYZ"? </p> <p>PS: I found <a href="https://stackoverflow.com/questions/50931/redirecting-non-www-url-to-www">this somewhat related question</a>, but it's for IIS and does the opposite of what I want. Also it's still complex.</p>
[ { "answer_id": 88034, "author": "UnkwnTech", "author_id": 115, "author_profile": "https://Stackoverflow.com/users/115", "pm_score": -1, "selected": false, "text": "RewriteEngine On\nRewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]\nRewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]\n" }, ...
2008/09/17
[ "https://Stackoverflow.com/questions/88011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14569/" ]
88,030
<p>What's the best way to import/export app internal settings into a file from within an app?</p> <p>I have the Settings.settings file, winform UI tied to the settings file, and I want to import/export settings, similar to Visual Studio Import/Export Settings feature. </p>
[ { "answer_id": 88226, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "public static string SerializeToXMLString(object ObjectToSerialize)\nMemoryStream mem = new MemoryStream(); \nSystem.X...
2008/09/17
[ "https://Stackoverflow.com/questions/88030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
88,036
<p>I need to make an ArrayList of ArrayLists thread safe. I also cannot have the client making changes to the collection. Will the unmodifiable wrapper make it thread safe or do I need two wrappers on the collection?</p>
[ { "answer_id": 88090, "author": "John Gardner", "author_id": 13687, "author_profile": "https://Stackoverflow.com/users/13687", "pm_score": 1, "selected": false, "text": "static class UnmodifiableSet<E> extends UnmodifiableCollection<E>\n implements Set<E>, Serializable;\n...
2008/09/17
[ "https://Stackoverflow.com/questions/88036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13491/" ]
88,078
<p>I wand to construct an MSI which, in its installation process, will deploy itself along with its contained Files/Components, to the TargetDir.</p> <p>So MyApp.msi contains MyApp.exe and MyAppBootstrapperEmpty.exe (with no resources) in its File Table.</p> <p>The user launches a MyAppBootstrapperPackaged.exe (containing MyApp.msi as a resource, obtained from the internet somewhere, or email or otherwise). MyAppBootStrapperPackaged.exe extracts MyApp.msi to a temp folder and executes it via msiexec.exe.</p> <p>After the msiexec.exe process completes, I want MyApp.msi, MyBootstrapperEmpty.exe (AND MyApp.exe in %ProgramFiles%\MyApp folder so MyApp.exe can be assured access to MyApp.msi when it runs (for creating the below-mentioned packaged content).</p> <p>MyAppBootstrapper*.exe could try and copy MyApp.msi to %ProgramFiles%\MyApp folder, but would need elevation to do so, and would not allow for its removal via Windows Installer uninstall process (from Add/Remove Programs or otherwise), which should be preserved.</p> <p>Obviously (I think it's obvious - am I wrong?) I can't include the MSI as a file in my Media/CAB (chicken and egg scenario), so I believe it would have to be done via a Custom Action before the install process, adding the original MSI to the MSI DB's Media/CAB and the appropriate entry in the File table on the fly. Can this be done and if so how?</p> <p>Think of a content distribution model where content files are only ever to be distributed together with the App. Content is produced by the end user via the App at run time, and packaged into a distributable EXE which includes both the App and the content.</p> <p>MyApp's installer must remain an MSI, but may be executed by a Bootstrapper EXE. The installed MyApp.exe must have access to both MyApp.msi and EXE is to be "assembled" at runtime by the App from a base (empty) MyAppBootstrapper.exe, which is also installed by the MSI, and the content created by the end-user. The EXE's resource MSI must be the same as that used to install the App which is doing the runtime packaging.</p> <p>WIX is not to be installed with MyApp.</p> <p>There can be no network dependencies at run-/packaging- time (i.e. can't do the packaging via a Webservice - must be done locally).</p> <p>I am familiar with (and using) Custom Actions (managed and unmanaged, via DTF and otherwise).</p>
[ { "answer_id": 90094, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "%TEMP%" }, { "answer_id": 559407, "author": "Wim Coenen", "author_id": 52626, "author_profile": "https://St...
2008/09/17
[ "https://Stackoverflow.com/questions/88078", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8787/" ]
88,082
<p>It can be either at compile time or at run-time using a config file. Is there a more elegant way than simple (and many) if statements?</p> <p>I am targeting especially sets of UI controls that comes for a particular feature.</p>
[ { "answer_id": 88101, "author": "Doug Moore", "author_id": 13179, "author_profile": "https://Stackoverflow.com/users/13179", "pm_score": 0, "selected": false, "text": "switch (setting) {\n case \"development\": \n dostuff;\n break\n case \"production\":\n dootherstuff;\n ...
2008/09/17
[ "https://Stackoverflow.com/questions/88082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9411/" ]
88,087
<p>We’re getting the following error message when we click on “Search Settings” for a Shared Services Provider: “Authentication failed because the remote party has closed the transport stream.”</p> <p>This is a new server environment with two web front ends, one database server, and one index server, all running Windows 2003 x64.</p> <p>Does anyone have any thoughts related to if this could be related to 64-bit, or what could be causing the error.</p> <p>Here are the full details from ULS:</p> <blockquote> <p>09/17/2008 16:30:34.13 w3wp.exe (0x0E84) 0x030C Search Server Common MS Search Administration 86x4 High Configuring the Search Application web service Url to '<a href="https://mushni-sptwb04q:56738/Shared%20Services%20Portal/Search/SearchAdmin.asmx" rel="nofollow noreferrer">https://mushni-sptwb04q:56738/Shared%20Services%20Portal/Search/SearchAdmin.asmx</a>'. </p> <p>09/17/2008 16:30:34.14 w3wp.exe (0x0E84) 0x030C Search Server Common MS Search Administration 86ze High Exception caught in Search Admin web-service proxy (client). System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Authentication failed because the remote party has closed the transport stream. at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.Co... </p> <p>09/17/2008 16:30:34.14* w3wp.exe (0x0E84) 0x030C Search Server Common MS Search Administration 86ze High ...mpilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result) at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size) at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size) at System.Net.ConnectStream.WriteHeaders(Boolean async) --- End of inner exception stack trace --- at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request) at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request) at System.Web.Services.Protocols.SoapHt... </p> <p>09/17/2008 16:30:34.14* w3wp.exe (0x0E84) 0x030C Search Server Common MS Search Administration 86ze High ...tpClientProtocol.Invoke(String methodName, Object[] parameters) at Microsoft.Office.Server.Search.Administration.SearchWebServiceProxy.RunWithSoapExceptionHandling[T](String methodName, Object[] parameters) </p> </blockquote>
[ { "answer_id": 248377, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "#WARNING: AcquireCredentialsHandle failed with error -2146893043(0x8009030d)\n CN={hostname},L=951338967,OU=SharePoint,O=Micro...
2008/09/17
[ "https://Stackoverflow.com/questions/88087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13368/" ]
88,093
<p>What update rate should I run my fixed-rate game logic at?</p> <p>I've used 60 updates per second in the past, but that's hard because it's not an even number of updates per second (16.666666). My current games uses 100, but that seems like overkill for most things.</p>
[ { "answer_id": 88210, "author": "Jeff", "author_id": 16639, "author_profile": "https://Stackoverflow.com/users/16639", "pm_score": 3, "selected": false, "text": "while(1) \n{ \n while(CurrentTime() < lastUpdate + TICK_LENGTH) \n { \n UpdateGame(); \n lastUpdate += TICK_LENGTH;\...
2008/09/17
[ "https://Stackoverflow.com/questions/88093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16679/" ]
88,094
<p>I seem to make this mistake every time I set up a new development box. Is there a way to make sure you don't have to manually assign rights for the ASPNET user? I usually install .Net then IIS, then Visual Studio but it seems I still have to manually assign rights to the ASPNET user to get everything running correctly. Is my install order wrong?</p>
[ { "answer_id": 88124, "author": "Jonathan Rupp", "author_id": 12502, "author_profile": "https://Stackoverflow.com/users/12502", "pm_score": 3, "selected": true, "text": "%windir%\\Microsoft.NET\\Framework\\v2.0.50727\\aspnet_regiis.exe -i\n %windir%\\Microsoft.NET\\Framework\\v2.0.50727\...
2008/09/17
[ "https://Stackoverflow.com/questions/88094", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16636/" ]
88,096
<p>I am working on a project with peek performance requirements, so we need to bulk (batch?) several operations (for example persisting the data to a database) for efficiency.</p> <p>However, I want our code to maintain an easy to understand flow, like:</p> <pre><code>input = Read(); parsed = Parse(input); if (parsed.Count &gt; 10) { status = Persist(parsed); ReportSuccess(status); return; } ReportFailure(); </code></pre> <p>The feature I'm looking for here is automatically have Persist() happen in bulks (and ergo asynchronously), but behave to its user as if it's synchronous (user should block until the bulk action completes). I want the implementor to be able to implement Persist(ICollection).</p> <p>I looked into flow-based programming, with which I am not highly familiar. I saw one library for fbp in C# <a href="http://www.jpaulmorrison.com/fbp/" rel="nofollow noreferrer">here</a>, and played a bit with Microsoft's Workflow Foundation, but my impression is that both are overkill for what I need. What would you use to implement a bulked flow behavior?</p> <p>Note that I would like to get code that is exactly like what I wrote (simple to understand &amp; debug), so solutions that involve yield or configuration in order to connect flows to one another are inadequate for my purpose. Also, <a href="http://en.wikipedia.org/wiki/Chain-of-responsibility_pattern" rel="nofollow noreferrer">chaining</a> is not what I'm looking for - I don't want to first build a chain and then run it, I want code that looks as if it is a simple flow ("Do A, Do B, if C then do D").</p>
[ { "answer_id": 873821, "author": "Robin", "author_id": 108040, "author_profile": "https://Stackoverflow.com/users/108040", "pm_score": 0, "selected": false, "text": "BackgroundWorker using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.ComponentModel;...
2008/09/17
[ "https://Stackoverflow.com/questions/88096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11236/" ]
88,211
<p>The title should say it all, then I can solidify 2 more ticks on the Joel test. </p> <p>I've implemented build automation using a makefile and a python script already and I understand the basics and the options. </p> <p>But how can I, the new guy who reads the blogs, convince my cohort of its inherent efficacy?</p>
[ { "answer_id": 105576, "author": "Vladimir", "author_id": 9641, "author_profile": "https://Stackoverflow.com/users/9641", "pm_score": 1, "selected": false, "text": "to: all developers\n\nGuys,\n\nI've just noticed that I can build our software using the \nlatest version because of the fo...
2008/09/17
[ "https://Stackoverflow.com/questions/88211", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1765/" ]
88,222
<p>I'd like know what people think about using RAISERROR in stored procedures to pass back user messages (i.e. business related messages, not error messages) to the application. </p> <p>Some of the senior developers in my firm have been using this method and catching the SqlException in our C# code to pick up the messages and display them to the user. I am not happy with this method and would like to know how other people deal with these types of user messages from stored procs.</p>
[ { "answer_id": 91207, "author": "Jonas Lincoln", "author_id": 17436, "author_profile": "https://Stackoverflow.com/users/17436", "pm_score": 0, "selected": false, "text": "CREATE PROCEDURE checkReturnValue\nAS\nBEGIN\n DECLARE @err AS INT\n SET @err = 0\n\n IF (rand() < 0.5)\n ...
2008/09/17
[ "https://Stackoverflow.com/questions/88222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11989/" ]
88,235
<p>Recently I ran into this error in my web application:</p> <blockquote> <p>java.lang.OutOfMemoryError: PermGen space</p> </blockquote> <p>It's a typical Hibernate/JPA + IceFaces/JSF application running on Tomcat 6 and JDK 1.6. Apparently this can occur after redeploying an application a few times.</p> <p>What causes it and what can be done to avoid it? How do I fix the problem?</p>
[ { "answer_id": 88262, "author": "Chris", "author_id": 16907, "author_profile": "https://Stackoverflow.com/users/16907", "pm_score": 10, "selected": true, "text": "-XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled\n tomcat6w //ES//servicename\n" }, { "answer_id": 89748,...
2008/09/17
[ "https://Stackoverflow.com/questions/88235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16907/" ]
88,259
<p>I tend to use <a href="http://en.wikipedia.org/wiki/SQLite" rel="noreferrer">SQLite</a> when doing <a href="http://en.wikipedia.org/wiki/Django_(web_framework)" rel="noreferrer">Django</a> development, but on a live server something more robust is often needed (<a href="http://en.wikipedia.org/wiki/MySQL" rel="noreferrer">MySQL</a>/<a href="http://en.wikipedia.org/wiki/PostgreSQL" rel="noreferrer">PostgreSQL</a>, for example). Invariably, there are other changes to make to the Django settings as well: different logging locations / intensities, media paths, etc.</p> <p>How do you manage all these changes to make deployment a simple, automated process?</p>
[ { "answer_id": 88331, "author": "Jim", "author_id": 8427, "author_profile": "https://Stackoverflow.com/users/8427", "pm_score": 6, "selected": false, "text": "settings_local.py settings_development.py DEBUG = True settings_production.py SERVER_EMAIL settings.py settings_local.py settings...
2008/09/17
[ "https://Stackoverflow.com/questions/88259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
88,269
<p>In certain unknown situations selenium does not detect that a page has loaded when using the open method. I am using the Java API. For example (This code will not produce this error. I don't know of an externally visible page that will.):</p> <pre><code>Selenium browser = new DefaultSelenium("localhost", 4444, "*firefox", "http://www.google.com"); browser.start(); browser.open("http://www.google.com/webhp?hl=en"); browser.type("q", "hello world"); </code></pre> <p>When the error occurs, the call to 'open' times out, even though you can clearly see that the page has loaded successfully before the timeout occurs. Increasing the timeout does not help. The call to 'type' never occurs, no progress is made.</p> <p>How do you get selenium to recognize that the page has loaded when this error occurs?</p>
[ { "answer_id": 88320, "author": "Matthew Jaskula", "author_id": 4356, "author_profile": "https://Stackoverflow.com/users/4356", "pm_score": 0, "selected": false, "text": "SeleniumServer server = new SeleniumServer(4444, false, true);\n" }, { "answer_id": 8079103, "author": "T...
2008/09/17
[ "https://Stackoverflow.com/questions/88269", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4356/" ]
88,276
<p>I've been trying to figure this out for about two weeks. I'm able to create email items in people's folders, read the folders, all that stuff but for the life of me I can not get anything to work with the calendars.</p> <p>I can provide examples of the XML I'm sending to WebDav but hoping someone out there has done this and has an example?</p>
[ { "answer_id": 92523, "author": "Robert Sanders", "author_id": 16952, "author_profile": "https://Stackoverflow.com/users/16952", "pm_score": 2, "selected": false, "text": "T 10.0.1.95:59741 -> 66.211.136.9:80 [AP]\nPUT /exchange/yourname.domainname.com/Cal2/CC1.1163646061548.0.eml HTTP/1...
2008/09/17
[ "https://Stackoverflow.com/questions/88276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
88,306
<p>I'm making a small web application in Seaside. I have a login component, and after the user logs in I want to send along a cookie when the next component renders itself. Is there a way to get at the object handling the response so I can add something to the headers it will output?</p> <p>I'm trying to avoid using WASession>>redirectWithCookies since it seems pretty kludgey to redirect only because I want to set a cookie.</p> <p>Is there another way that already exist to add a cookie that will go out on the next response?</p>
[ { "answer_id": 90695, "author": "Julian", "author_id": 11526, "author_profile": "https://Stackoverflow.com/users/11526", "pm_score": 4, "selected": true, "text": "self requestContext response addCookie: aCookie\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/88306", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2766176/" ]
88,311
<p>I'm currently generating an 8-character pseudo-random uppercase string for "A" .. "Z":</p> <pre><code>value = ""; 8.times{value &lt;&lt; (65 + rand(25)).chr} </code></pre> <p>but it doesn't look clean, and it can't be passed as an argument since it isn't a single statement. To get a mixed-case string "a" .. "z" plus "A" .. "Z", I changed it to:</p> <pre><code>value = ""; 8.times{value &lt;&lt; ((rand(2)==1?65:97) + rand(25)).chr} </code></pre> <p>but it looks like trash.</p> <p>Does anyone have a better method?</p>
[ { "answer_id": 88338, "author": "easeout", "author_id": 10906, "author_profile": "https://Stackoverflow.com/users/10906", "pm_score": 0, "selected": false, "text": "(0...8).collect { |n| value << (65 + rand(25)).chr }.join()\n" }, { "answer_id": 88341, "author": "Kent Fredri...
2008/09/17
[ "https://Stackoverflow.com/questions/88311", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10157/" ]
88,325
<p>I have a class:</p> <pre><code>class MyClass: def __init__(self, foo): if foo != 1: raise Error("foo is not equal to 1!") </code></pre> <p>and a unit test that is supposed to make sure the incorrect arg passed to the constructor properly raises an error:</p> <pre><code>def testInsufficientArgs(self): foo = 0 self.assertRaises((Error), myClass = MyClass(Error, foo)) </code></pre> <p>But I get...</p> <pre><code>NameError: global name 'Error' is not defined </code></pre> <p>Why? Where should I be defining this Error object? I thought it was built-in as a default exception type, no?</p>
[ { "answer_id": 88346, "author": "Jerub", "author_id": 14648, "author_profile": "https://Stackoverflow.com/users/14648", "pm_score": 6, "selected": true, "text": "class MyClass:\n def __init__(self, foo):\n if foo != 1:\n raise ValueError(\"foo is not equal to 1!\")\n...
2008/09/17
[ "https://Stackoverflow.com/questions/88325", "https://Stackoverflow.com", "https://Stackoverflow.com/users/577/" ]
88,326
<p>Does <a href="http://elmah.github.io/" rel="nofollow noreferrer">ELMAH</a> logged exceptions even when they do not bubble up to the application? I'd like to pop up a message when an exception occurs and still log the exception. Currently I've been putting everything in try catch blocks and spitting out messages, but this gets tedious.</p>
[ { "answer_id": 841426, "author": "Michael La Voie", "author_id": 65843, "author_profile": "https://Stackoverflow.com/users/65843", "pm_score": 7, "selected": false, "text": "try\n{\n int i = 5;\n int j = 0;\n i = i / j; //Throws exception\n}\ncatch (Exception ex)\n{\n MyPerso...
2008/09/17
[ "https://Stackoverflow.com/questions/88326", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16891/" ]
88,343
<p>When I try to compile code on VS 2005 and it fails, the line which causes the error gets underlined blue, and mouse-hovering over it displays the error message. Fine, but you can't see object types or whatever, because Intellisense will show the error message, and not object info.</p> <p>In this image, I wanted to see what type <code>DateTime.Subtract()</code> returns, but VS insists on showing the error message:</p> <p><a href="http://img502.imageshack.us/img502/6962/vs2005errordl7.png" rel="nofollow noreferrer">alt text http://img502.imageshack.us/img502/6962/vs2005errordl7.png</a></p> <p>Does anyone know how to get the error message out of the way, <strong>once you've got enough of it</strong>?</p>
[ { "answer_id": 88459, "author": "André Chalella", "author_id": 4850, "author_profile": "https://Stackoverflow.com/users/4850", "pm_score": 0, "selected": false, "text": "View -> IntelliSense -> Quick Info Ctrl+K, Ctrl+I" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/88343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4850/" ]
88,359
<p>While searching the interweb for a solution for my VB.net problems I often find helpful articles on a specific topic, but the code is C#. That is no big problem but it cost some time to convert it to VB manually. There are some sites that offer code converters from C# to VB and vice versa, but to fix all the flaws after the code-conversion is nearly as time-consuming as doing it by myself in the first place.</p> <p>Till now I am using <a href="http://labs.developerfusion.co.uk/convert/csharp-to-vb.aspx" rel="noreferrer">http://labs.developerfusion.co.uk/convert/csharp-to-vb.aspx</a></p> <p>Do you know something better?</p>
[ { "answer_id": 114152, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": false, "text": "public class FileSystemEventSubscription : EventSubscription\n{\n private FileSystemWatcher fileSystemWatcher;\n\n publi...
2008/09/17
[ "https://Stackoverflow.com/questions/88359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12336/" ]
88,361
<p>I have an Asp.Net repeater, which contains a textbox and a checkbox. I need to add client-side validation that verifies that when the checkbox is checked, the textbox can only accept a value of zero or blank.</p> <p>I would like to use one or more of Asp.Net's validator controls to accomplish this, to provide a consistent display for client side errors (server-side errors are handled by another subsystem).</p> <p>The Asp:CompareValidator doesn't seem to be flexible enough to perform this kind of complex comparison, so I'm left looking at the Asp:CustomValidator.</p> <p>The problem I'm running into is that there doesn't seem to be any way to pass custom information into the validation function. This is an issue because the ClientIds of the checkbox and the textbox are unknown to me at runtime (as they're part of a Repeater).</p> <p>So... My options seem to be:</p> <ol> <li>Pass the textbox and checkbox to the CustomValidator somehow (doesn't seem to be possible).</li> <li>Find the TextBox through JavaScript based on the arguments passed in by the CustomValidator. Is this even possible, what with the ClientId being ambiguous?</li> <li>Forget validation entirely, and emit custom JavaScript (allowing me to pass both ClientIds to a custom function).</li> </ol> <p>Any ideas on what might be a better way of implementing this?</p>
[ { "answer_id": 88386, "author": "Doug Moore", "author_id": 13179, "author_profile": "https://Stackoverflow.com/users/13179", "pm_score": 0, "selected": false, "text": "protected MyDataBound(object sender, RepeaterItemEventArgs e) {\n (CheckBox)cb = (CheckBox)e.Item.FindControl(\"myCheck...
2008/09/17
[ "https://Stackoverflow.com/questions/88361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16911/" ]
88,381
<p>we have several <em>"production environments"</em> (three servers each, with the same version of our system. Each one has a SQL Server Database as production database). </p> <p>In one of this environment the <em>tempdb</em> transaction log starts to grow fast and infinitely, we can´t find why. Same version of SO, SQL Server, application. No changes in the environment.</p> <p>Someone know how to figure what´s happening ou how to fix this?</p>
[ { "answer_id": 88446, "author": "Nick Craver", "author_id": 13249, "author_profile": "https://Stackoverflow.com/users/13249", "pm_score": 0, "selected": false, "text": "DBCC OPENTRAN\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/88381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
88,399
<p>I saw <a href="https://stackoverflow.com/questions/73319/duplicate-a-whole-line-in-vim#73357">this same question for VIM</a> and it has been something that I myself wanted to know how to do for Emacs. In ReSharper I use CTRL-D for this action. What is the least number of commands to perform this in Emacs?</p>
[ { "answer_id": 88468, "author": "Allen", "author_id": 6043, "author_profile": "https://Stackoverflow.com/users/6043", "pm_score": 2, "selected": false, "text": "kill-whole-line" }, { "answer_id": 88588, "author": "sverrejoh", "author_id": 473, "author_profile": "https...
2008/09/17
[ "https://Stackoverflow.com/questions/88399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4872/" ]
88,434
<p>I'm trying to build a better username/password field for my workplace and would like to be able to complain when they have their caps lock on.</p> <p>Is this possible? And if so I'd like to have it detected before the client types their first letter.</p> <p>Is there a non-platform specific way to do this?</p>
[ { "answer_id": 88456, "author": "Nick Craver", "author_id": 13249, "author_profile": "https://Stackoverflow.com/users/13249", "pm_score": 6, "selected": true, "text": "Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK)\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/88434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2443/" ]
88,448
<p>I have a public facing application deployed with Flex. I want to switch to using the cached framework (.swz) but need to know if for my user base this is an effective solution or not (most users will only visit the site once and its just not worth it).</p> <p>What I want to do is track whether or not a user has loaded the .swz/.swf file during that session - or if they are using a cached version they had previously downloaded from me or another site. If say 80% of users are downloading the framework .swz then i may as well embed the cutdown framework. But if 60% of users already have the framework I'd rather allow that cached version to be used.</p> <p>The best solution I have now is to look at the web server log and count the .swz file downloads vs. the number of times my main application .swf file is loaded. This is clumsy and a pain and I havent even been able to go to the effort of doing it yet.</p> <p>I cannot seem to find anything indicating what .swz or .swf files are loaded. I'd like to track against the current user session if i can determine this.</p>
[ { "answer_id": 90767, "author": "Seldaek", "author_id": 6512, "author_profile": "https://Stackoverflow.com/users/6512", "pm_score": 0, "selected": false, "text": "grep -c \\.swz web_log_dir/* \ngrep -c \\.swf web_log_dir/*\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/88448", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16940/" ]
88,454
<p>Most of the MVC samples I have seen pass an instance of the view to the controller like this</p> <pre><code>public class View { Controller controller = new Controller(this); } </code></pre> <p>Is there any advantage to passing a class which provides access to just the the properties and events the controller is interested in, like this:</p> <pre><code>public class UIWrapper { private TextBox textBox; public TextBox TextBox { get {return textBox;} } public UIWrapper(ref TextBox textBox) { this.textBox = textBox; } public class View { UIWrapper wrapper = new UIWrapper(this); Controller controller = new Controller(wrapper) } </code></pre>
[ { "answer_id": 90767, "author": "Seldaek", "author_id": 6512, "author_profile": "https://Stackoverflow.com/users/6512", "pm_score": 0, "selected": false, "text": "grep -c \\.swz web_log_dir/* \ngrep -c \\.swf web_log_dir/*\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/88454", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35031/" ]
88,460
<p>I'm trying to use libvirt with virsh to manage my kvm/qemu vms. The problem I have is with getting it to work with public IPs. The server is running ubuntu 8.04.</p> <p>libvirt keeps trying to run it as:</p> <pre><code>/usr/bin/kvm -M pc -m 256 -smp 3 -monitor pty -no-acpi \ -drive file=/opt/virtual-machines/calculon/root.qcow2,if=ide,boot=on \ -net nic,vlan=0,model=virtio -net tap,fd=10,vlan=0 -usb -vnc 127.0.0.1:0 </code></pre> <p>Which boots, but does not have any network access (pings go nowhere). Running it without fd=10 makes it work right, with kvm creating the necessary TAP device for me and networking functioning inside the host. All the setup guides I've seen focus on setting up masquerading, while I just want a simple bridge and unfiltered access to the net (both the guests and host must use public IPs). </p> <p>Running ifconfig on the host gives this, the bridge is manually setup in my /etc/network/interfaces file. :</p> <pre><code>br0 Link encap:Ethernet HWaddr 00:1e:c9:3c:59:b8 inet addr:12.34.56.78 Bcast:12.34.56.79 Mask:255.255.255.240 inet6 addr: fe80::21e:c9ff:fe3c:59b8/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:3359 errors:0 dropped:0 overruns:0 frame:0 TX packets:3025 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:180646 (176.4 KB) TX bytes:230908 (225.4 KB) eth0 Link encap:Ethernet HWaddr 00:1e:c9:3c:59:b8 inet6 addr: fe80::21e:c9ff:fe3c:59b8/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:6088386 errors:0 dropped:0 overruns:0 frame:0 TX packets:3058 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:680236624 (648.7 MB) TX bytes:261696 (255.5 KB) Interrupt:33 </code></pre> <p>Any help would be greatly appreciated.</p>
[ { "answer_id": 90689, "author": "AgentK", "author_id": 14868, "author_profile": "https://Stackoverflow.com/users/14868", "pm_score": 4, "selected": true, "text": "auto eth0\niface eth0 inet manual\n\nauto br0\niface br0 inet static\n address 192.168.0.10\n network 192.168.0...
2008/09/17
[ "https://Stackoverflow.com/questions/88460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11105/" ]
88,471
<p>I have searched for such a plugin but haven't found any. I need a facility to "tag" my java files. Similar to tagging on stackoverflow.</p> <p>I want to be able to group my files based on projects/tasks I wam working on. Mylyn helps a little but it dynamically changes the context (list of resources associated with a task) based on various factors. </p> <p>I just want a basic tagging facility for all the files in my workspace.</p>
[ { "answer_id": 97820, "author": "Scott Stanchfield", "author_id": 12541, "author_profile": "https://Stackoverflow.com/users/12541", "pm_score": 0, "selected": false, "text": "public interface Observer {} // no required methods\n public class SomeClass implements Observer {...}\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/88471", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
88,473
<p>Does anybody know how to apply a "where in values" type condition using LINQ-to-Entities? I've tried the following but it doesn't work:</p> <pre><code>var values = new[] { "String1", "String2" }; // some string values var foo = model.entitySet.Where(e =&gt; values.Contains(e.Name)); </code></pre> <p>I believe this works in LINQ-to-SQL though? Any thoughts?</p>
[ { "answer_id": 88486, "author": "Aaron Powell", "author_id": 11388, "author_profile": "https://Stackoverflow.com/users/11388", "pm_score": 0, "selected": false, "text": "SELECT [t0].[col1]\nFROM [table] [t0]\nWHERE [col1] IN ( 'Value 1', 'Value 2')\n" }, { "answer_id": 88495, ...
2008/09/17
[ "https://Stackoverflow.com/questions/88473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16948/" ]
88,476
<p>I'm a little hesitant to post this, as I'm not completely sure what I'm doing. Any help would be wonderful.</p> <p>I'm on a computer with a firewall/filter on it. I can download files without any difficulty. When I try to clone files from Github, though, the computer just hangs. Nothing happens. It creates a git file in the folder, but the key files don't get loaded in. For context, I'm working on a Rails app, trying to load in Restful Authentication.</p> <p>Have any of you dealt with this? Any suggestions for getting the clone to work? Disabling the firewall might be an option, but if I can do something without going through that process, I'd appreciate it.</p>
[ { "answer_id": 88492, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 2, "selected": false, "text": "git://" }, { "answer_id": 2382585, "author": "rogerdpack", "author_id": 32453, "author_profile": "http...
2008/09/17
[ "https://Stackoverflow.com/questions/88476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69299/" ]
88,481
<p>I see that Adobe AIR uses WebKit as its render and I see that WebKit (at least the most current build) has some SVG support. Does this mean (and has anyone specifically tried) that an Adobe AIR application could render SVG on an HTML page?</p>
[ { "answer_id": 227999, "author": "aaaidan", "author_id": 26331, "author_profile": "https://Stackoverflow.com/users/26331", "pm_score": 2, "selected": false, "text": "[Embed(source=\"assets/frog.svg\")]\n[Bindable]\npublic var SvgAsset:Class;\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/88481", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8256/" ]
88,485
<p>This is a follow up question to <a href="https://stackoverflow.com/questions/85815/how-to-tell-if-a-javascript-function-is-defined">This Question</a>. </p> <p>I like (and understand) the solution there. However, in the code I am working in, another way to solve the same problem is used:</p> <pre><code>function exist(sFN) { if(self[sFN]) return true; return false; } </code></pre> <p>It seems to work fine, although I don't understand how. Does it work? How? What are minuses of this approach? Should I switch to solution from the other question?</p>
[ { "answer_id": 88498, "author": "kch", "author_id": 13989, "author_profile": "https://Stackoverflow.com/users/13989", "pm_score": 2, "selected": false, "text": "typeof typeof(foobar) // -> undefined\ntypeof(alert) // -> function\n function isfun(sym) { return typeof(sym) } isfun(inexi...
2008/09/17
[ "https://Stackoverflow.com/questions/88485", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2515/" ]
88,488
<p>Is there a way to get a <code>DrawingContext</code> (or something similar) for a <code>WriteableBitmap</code>? I.e. something to allow you to call simple <code>DrawLine</code>/<code>DrawRectangle</code>/etc kinds of methods, rather than manipulate the raw pixels directly.</p>
[ { "answer_id": 88531, "author": "user7116", "author_id": 7116, "author_profile": "https://Stackoverflow.com/users/7116", "pm_score": 3, "selected": false, "text": "DrawingVisual drawingVisual = new DrawingVisual();\nusing (DrawingContext drawingContext = drawingVisual.RenderOpen())\n{\n ...
2008/09/17
[ "https://Stackoverflow.com/questions/88488", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2495/" ]
88,489
<p><strong>Keep in mind that I'm not looking for a list of current browsers to support, I'm looking for logical ways to make that list, backed by some kind of hard statistics.</strong> </p> <p>Since it's been a while since my last web job, I decided to do this latest site up from scratch. Now I have to decide <em>again</em> what to support in terms of browsers. Certainly I have a list of what I'd like to support, but the decisions that went into that list seem to be a little arbitrary to me. Where can I go to get a reliable picture of browser usage and what seems to be a good point at which to cut off an old version of a browser from support?</p>
[ { "answer_id": 88538, "author": "Jim", "author_id": 8427, "author_profile": "https://Stackoverflow.com/users/8427", "pm_score": 6, "selected": true, "text": "alt" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/88489", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16398/" ]
88,490
<p>Is there a difference between just saying <code>throw;</code> and <code>throw ex;</code> assuming <code>ex</code> is the exception you're catching?</p>
[ { "answer_id": 88502, "author": "GEOCHET", "author_id": 5640, "author_profile": "https://Stackoverflow.com/users/5640", "pm_score": 6, "selected": true, "text": "throw ex; throw;" }, { "answer_id": 88577, "author": "Eric Schoonover", "author_id": 3957, "author_profile...
2008/09/17
[ "https://Stackoverflow.com/questions/88490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16891/" ]
88,518
<p>I'm a complete perl novice, am running a perl script using perl 5.10 and getting this warning: </p> <pre><code>$* is no longer supported at migrate.pl line 380. </code></pre> <p>Can anyone describe what $* did and what the recommended replacement of it is now? Alternatively if you could point me to documentation that describes this that would be great.</p> <p>The script I'm running is to migrate a source code database from vss to svn and can be found here: <a href="http://www.x2systems.com/files/migrate.pl.txt" rel="noreferrer">http://www.x2systems.com/files/migrate.pl.txt</a></p> <p>The two snippets of code that use it are: </p> <pre><code> $* = 1; $/ = ':'; $cmd = $SSCMD . " Dir -I- \"$proj\""; $_ = `$cmd`; # what this next expression does is to merge wrapped lines like: # $/DeviceAuthority/src/com/eclyptic/networkdevicedomain/deviceinterrogator/excep # tion: # into: # $/DeviceAuthority/src/com/eclyptic/networkdevicedomain/deviceinterrogator/exception: s/\n((\w*\-*\.*\w*\/*)+\:)/$1/g; $* = 0; </code></pre> <p>and then some ways later on: </p> <pre><code> $cmd = $SSCMD . " get -GTM -W -I-Y -GL\"$localdir\" -V$version \"$file\" 2&gt;&amp;1"; $out = `$cmd`; # get rid of stupid VSS warning messages $* = 1; $out =~ s/\n?Project.*rebuilt\.//g; $out =~ s/\n?File.*rebuilt\.//g; $out =~ s/\n.*was moved out of this project.*rebuilt\.//g; $out =~ s/\nContinue anyway.*Y//g; $* = 0; </code></pre> <p>many thanks, </p> <ul> <li>Rory</li> </ul>
[ { "answer_id": 88528, "author": "Leon Timmermans", "author_id": 4727, "author_profile": "https://Stackoverflow.com/users/4727", "pm_score": 1, "selected": false, "text": "m s s/\\n?Project.*rebuilt\\.//msg\n" }, { "answer_id": 88540, "author": "Michael Carman", "author_i...
2008/09/17
[ "https://Stackoverflow.com/questions/88518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8479/" ]
88,522
<p>I wanting to show prices for my products in my online store. I'm currently doing:</p> <pre><code>&lt;span class="ourprice"&gt; &lt;%=GetPrice().ToString("C")%&gt; &lt;/span&gt; </code></pre> <p>Where GetPrice() returns a decimal. So this currently returns a value e.g. "£12.00"</p> <p>I think the correct HTML for an output of "£12.00" is "<code>&amp;pound;12.00</code>", so although this is rendering fine in most browsers, some browsers (Mozilla) show this as $12.00. </p> <p>(The server is in the UK, with localisation is set appropriately in web.config).</p> <p>Is the below an improvement, or is there a better way?</p> <pre><code>&lt;span class="ourprice"&gt; &lt;%=GetPrice().ToString("C").Replace("£","&amp;pound;")%&gt; &lt;/span&gt; </code></pre>
[ { "answer_id": 88535, "author": "Nick Craver", "author_id": 13249, "author_profile": "https://Stackoverflow.com/users/13249", "pm_score": 2, "selected": false, "text": "<%=String.Format(\"{0:C}\",GetPrice())%>\n" }, { "answer_id": 88555, "author": "Claus Thomsen", "author...
2008/09/17
[ "https://Stackoverflow.com/questions/88522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11538/" ]
88,541
<p>I’ve been reading a few questions and answers regarding exceptions and their use. Seems to be a strong opinion that exceptions should be raised only for exception, unhandled cases. So that lead me to wondering how validation works with business objects.</p> <p>Lets say I have a business object with getters/setters for the properties on the object. Let’s say I need to validate that the value is between 10 and 20. This is a business rule so it belongs in my business object. So that seems to imply to me that the validation code goes in my setter. Now I have my UI databound to the properties of the data object. The user enters 5, so the rule needs to fail and the user is not allowed to move out of the textbox. . The UI is databound to the property so the setter is going to be called, rule checked and failed. If I raised an exception from my business object to say the rule failed, the UI would pick that up. But that seems to go against the preferred usage for exceptions. Given that it’s a setter, you aren’t really going to have a ‘result’ for the setter. If I set another flag on the object then that would imply the UI has to check that flag after each UI interaction.</p> <p>So how should the validation work?</p> <p>Edit: I've probably used an over-simplified example here. Something like the range check above could be handled easily by the UI but what if the valdation was more complicated, e.g. the business object calculates a number based on the input and if that calculated number is out of range it should be recjected. This is more complicated logic that should not be in th UI. </p> <p>There is also the consideration of further data entered based on a field already entered. e.g.I have to enter an item on the order to get certain informaion like stock on hand, current cost, etc. The user may require this information to make decisions on further entry (liek how many units to order) or it may be required in order for further validation to be done. Should a user be able to enter other fields if the item isn't valid? What would be the point?</p>
[ { "answer_id": 88733, "author": "Matt Howells", "author_id": 16881, "author_profile": "https://Stackoverflow.com/users/16881", "pm_score": 2, "selected": false, "text": "[MinValue(10), MaxValue(20)]\npublic int Value { get; set; }\n" }, { "answer_id": 88770, "author": "Rob Gr...
2008/09/17
[ "https://Stackoverflow.com/questions/88541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11355/" ]
88,546
<p>In Perl, a conditional can be expressed either as</p> <pre><code>if (condition) { do something } </code></pre> <p>or as</p> <pre><code>(condition) and do { do something } </code></pre> <p>Interestingly, the second way seems to be about 10% faster. Does anyone know why?</p>
[ { "answer_id": 88611, "author": "Leon Timmermans", "author_id": 4727, "author_profile": "https://Stackoverflow.com/users/4727", "pm_score": 4, "selected": false, "text": "LISTOP (0x8177a18) leave [1] \n OP (0x8176590) enter \n COP (0x8177a40) nextstate \n LISTOP (0x8177b20) scop...
2008/09/17
[ "https://Stackoverflow.com/questions/88546", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
88,554
<p>In <em>C++</em>, I can have take input like this: </p> <pre><code>cin &gt;&gt; a &gt;&gt; b &gt;&gt; c; </code></pre> <p>And <code>a</code> can be <code>int</code>, <code>b</code> can be <code>float</code>, and <code>c</code> can be whatever... How do I do the same in <em>python</em>?</p> <p><code>input()</code> and <code>raw_input()</code>, the way I'm using them, don't seem to be giving me the desired results.</p>
[ { "answer_id": 88587, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "input() int float >>> line = raw_input().split()\n>>> a = int(line[0])\n>>> b = float(line[1])\n>>> c = \" \".join(line[2:])\n ...
2008/09/17
[ "https://Stackoverflow.com/questions/88554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10096/" ]
88,558
<p>I am making a game in C++ and am having problems with my derived class. I have a base class called GameScreen which has a vitrual void draw() function with no statements. I also have a derived class called MenuScreen which also has a virtual void draw() function and a derived class from MenuScreen called TestMenu which also has a void draw() function. In my program I have a list of GameScreens that I have a GameScreen iterator pass through calling each GameScreens draw() function.</p> <p>The issue is that I have placed a TestMenu object on the GameScreen list. Instead of the iterator calling the draw() function of TestMenu it is calling the draw() function of the GameScreen class. Does anyone know how I could call the draw() function of TestMenu instead of the one in GameScreen.</p> <p>Here is the function:</p> <pre><code>// Tell each screen to draw itself. //gsElement is a GameScreen iterator //gsScreens is a list of type GameScreen void Draw() { for (gsElement = gsScreens.begin(); gsElement != gsScreens.end(); gsElement++) { /*if (gsElement-&gt;ssState == Hidden) continue;*/ gsElement-&gt;Draw(); } } </code></pre> <p>Here are a copy of my classes:</p> <pre><code>class GameScreen { public: string strName; bool bIsPopup; bool bOtherScreenHasFocus; ScreenState ssState; //ScreenManager smScreenManager; GameScreen(string strName){ this-&gt;strName = strName; } //Determine if the screen should be drawn or not bool IsActive(){ return !bOtherScreenHasFocus &amp;&amp; (ssState == Active); } //------------------------------------ //Load graphics content for the screen //------------------------------------ virtual void LoadContent(){ } //------------------------------------ //Unload content for the screen //------------------------------------ virtual void UnloadContent(){ } //------------------------------------------------------------------------- //Update changes whether the screen should be updated or not and sets //whether the screen should be drawn or not. // //Input: // bOtherScreenHasFocus - is used set whether the screen should update // bCoveredByOtherScreen - is used to set whether the screen is drawn or not //------------------------------------------------------------------------- virtual void Update(bool bOtherScreenHasFocus, bool bCoveredByOtherScreen){ this-&gt;bOtherScreenHasFocus = bOtherScreenHasFocus; //if the screen is covered by another than change the screen state to hidden //else set the screen state to active if(bCoveredByOtherScreen){ ssState = Hidden; } else{ ssState = Active; } } //----------------------------------------------------------- //Takes input from the mouse and calls appropriate actions //----------------------------------------------------------- virtual void HandleInput(){ } //---------------------- //Draw content on screen //---------------------- virtual void Draw(){ } //-------------------------------------- //Deletes screen from the screen manager //-------------------------------------- void ExitScreen(){ //smScreenManager.RemoveScreen(*this); } }; class MenuScreen: public GameScreen{ public: vector &lt;BUTTON&gt; vbtnMenuEntries; MenuScreen(string strName):GameScreen(strName){ } virtual void Update(bool bOtherScreenHasFocus, bool bCoveredByOtherScreen){ GameScreen::Update(bOtherScreenHasFocus, bCoveredByOtherScreen); for(unsigned int i = 0; i &lt; vbtnMenuEntries.size(); i++){ vbtnMenuEntries[i].IsPressed(); } } virtual void Draw(){ GameScreen::Draw(); for(unsigned int i = 0; i &lt; vbtnMenuEntries.size(); i++) vbtnMenuEntries[i].Draw(); } }; class testMenu : public MenuScreen{ public: vector&lt;OBJECT&gt; test; //OBJECT background3(); // OBJECT testPic(512, 384, buttonHover.png, 100, 40, 100, 40); // BUTTON x(256, 384, buttonNormal.png, buttonHover.png, buttonPressed.png, 100, 40, test()); bool draw; testMenu():MenuScreen("testMenu"){ OBJECT background3(1, 1, 0, TEXT("background.png"), 1, 1, 1024, 768); OBJECT testPic(512, 384,0, TEXT("buttonHover.png"), 1, 1, 100, 40); test.push_back(background3); test.push_back(testPic); //background3.Init(int xLoc, int yLoc, int zLoc, LPCTSTR filePath, int Rows, int Cols, int Width, int Height) //test.push_back(background3); // vbtnMenuEntries.push_back(x); draw = false; } void Update(bool bOtherScreenHasFocus, bool bCoveredByOtherScreen){ MenuScreen::Update(bOtherScreenHasFocus, bCoveredByOtherScreen); //cout &lt;&lt; "X" &lt;&lt; endl; /*if(MouseLButton == true){ testMenu2 t; smManager.AddScreen(t); }*/ } void Draw(){ //background3.Draw(); test[0].Draw(); test[1].Draw(); MenuScreen::Draw(); ///*if(draw){*/ // testPic.Draw(); //} } /*void test(){ draw = true; }*/ }; </code></pre>
[ { "answer_id": 90612, "author": "Johann Gerell", "author_id": 6345, "author_profile": "https://Stackoverflow.com/users/6345", "pm_score": 1, "selected": false, "text": "std::vector<> #include <vector>\n#include <algorithm>\n\nstruct Base\n{\n virtual void Foo() = 0;\n virtual ~Base...
2008/09/17
[ "https://Stackoverflow.com/questions/88558", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
88,566
<p>In a custom module for drupal 4.7 I hacked together a node object and passed it to node_save($node) to create nodes. This hack appears to no longer work in drupal 6. While I'm sure this hack could be fixed I'm curious if there is a standard solution to create nodes without a form. In this case the data is pulled in from a custom feed on another website.</p>
[ { "answer_id": 88876, "author": "calebbrown", "author_id": 7007, "author_profile": "https://Stackoverflow.com/users/7007", "pm_score": 4, "selected": true, "text": "node_add() node_form() node_object_prepare()" }, { "answer_id": 90437, "author": "William OConnor - csevb10", ...
2008/09/17
[ "https://Stackoverflow.com/questions/88566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10393/" ]
88,570
<p>Does anyone know if it's possible to use regex capture within Apache's DirectoryMatch directive? I'd like to do something like the following:</p> <pre><code>&lt;DirectoryMatch ^/home/www/(.*)&gt; AuthType Basic AuthName $1 AuthUserFile /etc/apache2/svn.passwd Require group $1 admin &lt;/DirectoryMatch&gt; </code></pre> <p>but so far I've had no success.</p> <p>Specifically, I'm trying to create a group-based HTTP Auth for individual directories/vhosts on a server in Apache 2.0. </p> <p>For example, Site A, pointing to /home/www/a will be available to all users in group admin and group a, site b at /home/www/b will be available to all users in group admin and group b, etc. I'd like to keep everything based on the directory name so I can easily script adding htpasswd users to the correct groups and automate this as much as possible, but other suggestions for solving the problem are certainly welcome.</p>
[ { "answer_id": 91535, "author": "innaM", "author_id": 7498, "author_profile": "https://Stackoverflow.com/users/7498", "pm_score": 3, "selected": true, "text": "<Perl>\nmy @groups = qw/ foo bar baz /;\nforeach ( @groups ) {\n push @PerlConfig, qq| <Directory /home/www/$_> blah </Direct...
2008/09/17
[ "https://Stackoverflow.com/questions/88570", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16960/" ]
88,573
<p>In C++, you can specify that a function may or may not throw an exception by using an exception specifier. For example:</p> <pre><code>void foo() throw(); // guaranteed not to throw an exception void bar() throw(int); // may throw an exception of type int void baz() throw(...); // may throw an exception of some unspecified type </code></pre> <p>I'm doubtful about actually using them because of the following:</p> <ol> <li>The compiler doesn't really enforce exception specifiers in any rigorous way, so the benefits are not great. Ideally, you would like to get a compile error.</li> <li>If a function violates an exception specifier, I think the standard behaviour is to terminate the program.</li> <li>In VS.Net, it treats throw(X) as throw(...), so adherence to the standard is not strong.</li> </ol> <p>Do you think exception specifiers should be used?<br> Please answer with "yes" or "no" and provide some reasons to justify your answer.</p>
[ { "answer_id": 88599, "author": "Branan", "author_id": 13894, "author_profile": "https://Stackoverflow.com/users/13894", "pm_score": 2, "selected": false, "text": "throw()" }, { "answer_id": 88905, "author": "Christopher", "author_id": 3186, "author_profile": "https:/...
2008/09/17
[ "https://Stackoverflow.com/questions/88573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3146/" ]
88,582
<p>For a small project I have to parse pdf files and take a specific part of them (a simple chain of characters). I'd like to use python to do this and I've found several libraries that are capable of doing what I want in some ways.</p> <p>But now after a few researches, I'm wondering what is the real structure of a pdf file, does anyone know if there is a spec or some explanations anywhere online? I've found a link on adobe but it seems that it's a dead link :(</p>
[ { "answer_id": 57220079, "author": "keithchristian", "author_id": 7396580, "author_profile": "https://Stackoverflow.com/users/7396580", "pm_score": 0, "selected": false, "text": "pdfinfo -layout some_pdf_file.pdf\n some_pdf_file.txt grep -a --color=always \"\\\\\\\\[0-9][0-9][0-9]\" some...
2008/09/17
[ "https://Stackoverflow.com/questions/88582", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11544/" ]
88,613
<p>How do I tokenize the string:</p> <pre><code>&quot;2+24*48/32&quot; </code></pre> <p>Into a list:</p> <pre><code>['2', '+', '24', '*', '48', '/', '32'] </code></pre>
[ { "answer_id": 88639, "author": "Cristian", "author_id": 680, "author_profile": "https://Stackoverflow.com/users/680", "pm_score": 2, "selected": false, "text": ">>> import re\n>>> splitter = re.compile(r'([+*/])')\n>>> splitter.split(\"2+24*48/32\")\n" }, { "answer_id": 88663, ...
2008/09/17
[ "https://Stackoverflow.com/questions/88613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
88,615
<p>Given an arbitrary string, what is an efficient method of finding duplicate phrases? We can say that phrases must be longer than a certain length to be included.</p> <p>Ideally, you would end up with the number of occurrences for each phrase.</p>
[ { "answer_id": 88765, "author": "Sridhar Iyer", "author_id": 13820, "author_profile": "https://Stackoverflow.com/users/13820", "pm_score": 3, "selected": true, "text": "js" }, { "answer_id": 580135, "author": "Community", "author_id": -1, "author_profile": "https://St...
2008/09/17
[ "https://Stackoverflow.com/questions/88615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/337/" ]
88,618
<p>We have a medium sized .js file that we include in our web framework that I am porting over to SharePoint. However, I'm not sure how to go about this or what the best practice is. This is for a framework solution that will be used by other client projects, so it's best for it to be self contained and deploy-able, rather than requiring manually deploying files to the webserver.</p> <p>My current thinking to put the JavaScript into an embedded resource and then use the script manager to write out the file. Does this seem reasonable? Or does anyone have any other recommendations?</p>
[ { "answer_id": 93475, "author": "andrew", "author_id": 17767, "author_profile": "https://Stackoverflow.com/users/17767", "pm_score": 0, "selected": false, "text": "<TemplateFiles>\n <TemplateFile Location=\"LAYOUTS\\somescript.js\" />\n</TemplateFiles>\n" } ]
2008/09/17
[ "https://Stackoverflow.com/questions/88618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1685/" ]