qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
378,415
<p>I have a string <code>User name (sales)</code> and I want to extract the text between the brackets, how would I do this? </p> <p>I suspect sub-string but I can't work out how to read until the closing bracket, the length of text will vary.</p>
[ { "answer_id": 378433, "author": "chills42", "author_id": 23855, "author_profile": "https://Stackoverflow.com/users/23855", "pm_score": 4, "selected": false, "text": "\\(([a-z]+?)\\)\n" }, { "answer_id": 378446, "author": "Jennifer", "author_id": 22360, "author_profil...
2008/12/18
[ "https://Stackoverflow.com/questions/378415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
378,422
<p>Apparently I can't move files on different volumes using Directory.Move.</p> <p>I have read that I have to copy each file individually to the destination, then delete the source directory.</p> <p>Do I have any other option?</p>
[ { "answer_id": 378487, "author": "Martijn Laarman", "author_id": 47020, "author_profile": "https://Stackoverflow.com/users/47020", "pm_score": 2, "selected": false, "text": "UnauthorizedAccessException Directory.Delete public void removeReadOnlyDeep(string directory)\n{\n string[] fil...
2008/12/18
[ "https://Stackoverflow.com/questions/378422", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39677/" ]
378,428
<pre><code>$c = $record['corrects']; $i = $record['incorrects']; if($c == 0 &amp;&amp; $i == 0) { $image = imagecreatetruecolor(200,80); $white = imagecolorallocate($image,255,255,255); $red = imagecolorallocate($image,255,0,0); imagefilledrectangle($image,0,0,199,79,$white); $text = 'Quiz cancelled!'; $box = imageftbbox(10,0,'verdana.ttf',$text); $x = imagesx($image)/2 - abs($box[2] - $box[0])/2 - 5; $y = imagesy($image)/2 - abs($box[5] - $box[3])/2 - 5; imagefttext($image,10,0,$x,$y,$red,'verdana.ttf',$text); header('Content-type: image/png'); imagepng($image); imagedestroy($image); exit(); } </code></pre>
[ { "answer_id": 378459, "author": "David Heggie", "author_id": 4309, "author_profile": "https://Stackoverflow.com/users/4309", "pm_score": 1, "selected": false, "text": "<?php\n// Set the enviroment variable for GD\nputenv('GDFONTPATH=' . realpath('.'));\n" } ]
2008/12/18
[ "https://Stackoverflow.com/questions/378428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47468/" ]
378,441
<p>I've an MFC application that currently uses CAtlHttpClient to query a web server for some information.</p> <p>I'd like to change this so that the query goes over securely, with server authentication, using SSL.</p> <p>Googling reveals that Microsoft has changed the way they support this several times, e.g., WinInet, WinHTTP, but for the life of me I can't figure out how to do the above using MFC under MSVS 2005.</p> <p>The application is in C++, and if at all possible, I'd like to avoid dragging .Net into the picture.</p> <p>Any help, hints, suggestions or pointers gratefully appreciated!</p> <p>Thanks,</p> <p>ony</p>
[ { "answer_id": 31977621, "author": "Richard Chambers", "author_id": 1466970, "author_profile": "https://Stackoverflow.com/users/1466970", "pm_score": 0, "selected": false, "text": "WinINet libcurl int GetFile (HINTERNET hOpen, TCHAR * szURL, BYTE szTemp[4096]) \n{\n DWORD dwSize;\n...
2008/12/18
[ "https://Stackoverflow.com/questions/378441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47466/" ]
378,449
<p>I want to use RSpec mocks to provide canned input to a block.</p> <p>Ruby:</p> <pre><code>class Parser attr_accessor :extracted def parse(fname) File.open(fname).each do |line| extracted = line if line =~ /^RCS file: (.*),v$/ end end end </code></pre> <p>RSpec:</p> <pre><code>describe Parser before do @parser = Parser.new @lines = mock("lines") @lines.stub!(:each) File.stub!(:open).and_return(@lines) end it "should extract a filename into extracted" do linetext = [ "RCS file: hello,v\n", "bla bla bla\n" ] # HELP ME HERE ... # the :each should be fed with 'linetext' @lines.should_receive(:each) @parser.should_receive('extracted=') @parser.parse("somefile.txt") end end </code></pre> <p>It's a way to test that the internals of the block work correctly by passing fixtured data into it. But I can't figure out how to do the actual feeding with RSpec mocking mechanism.</p> <p><strong>update:</strong> looks like the problem was not with the linetext, but with the:</p> <pre><code>@parser.should_receive('extracted=') </code></pre> <p>it's not the way it's called, replacing it in the ruby code with self.extracted= helps a bit, but feels wrong somehow.</p>
[ { "answer_id": 378605, "author": "James Mead", "author_id": 2025138, "author_profile": "https://Stackoverflow.com/users/2025138", "pm_score": 3, "selected": true, "text": "and_yields should_receive(:each) StringIO linetext File.open" }, { "answer_id": 379572, "author": "Jeff ...
2008/12/18
[ "https://Stackoverflow.com/questions/378449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11414/" ]
378,456
<p>Is there a javascript function to swap a still image(jpg) to a movie(swf)? If there is is there a disjointed swap image path?</p>
[ { "answer_id": 378521, "author": "Jack", "author_id": 24998, "author_profile": "https://Stackoverflow.com/users/24998", "pm_score": 2, "selected": false, "text": "<div id=\"still_image\" style=\"display:block\">\n <!-- img code here -->\n</div>\n\n\n<div id=\"ani_swf\" style=\"display...
2008/12/18
[ "https://Stackoverflow.com/questions/378456", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
378,465
<p>I just recently noticed <code>Dictionary.TryGetValue(TKey key, out TValue value)</code> and was curious as to which is the better approach to retrieving a value from the Dictionary.</p> <p>I've traditionally done:</p> <pre><code>if (myDict.Contains(someKey)) someVal = myDict[someKey]; ... </code></pre> <p>unless I know it <em>has</em> to be in there.</p> <p>Is it better to just do:</p> <pre><code>if (myDict.TryGetValue(somekey, out someVal) ... </code></pre> <p>Which is the better practice? Is one faster than the other? I would imagine that the Try version would be slower as its 'swallowing' a try/catch inside itself and using that as logic, no?</p>
[ { "answer_id": 378477, "author": "Micah", "author_id": 17744, "author_profile": "https://Stackoverflow.com/users/17744", "pm_score": 7, "selected": true, "text": "public bool TryGetValue(TKey key, out TValue value)\n{\n int index = this.FindEntry(key);\n if (index >= 0)\n {\n ...
2008/12/18
[ "https://Stackoverflow.com/questions/378465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8945/" ]
378,485
<p>I have the follow Linq query ... which executes correctly:</p> <pre><code>from t in Tasks where LookupTaskStarted(t.TaskId) == true select new { t.TaskId, t.Number, Started = LookupTaskStarted(t.TaskId) } </code></pre> <p>Is there anyway to create this as a property on the Linq-To-Sql class? Or do I always have to reference it like this?</p>
[ { "answer_id": 378618, "author": "Bryan Watts", "author_id": 37815, "author_profile": "https://Stackoverflow.com/users/37815", "pm_score": 2, "selected": true, "text": "let from t in Tasks\nlet started = LookupTaskStarted(t.TaskId)\nwhere started\nselect new\n{\n T.TaskId,\n t.Numb...
2008/12/18
[ "https://Stackoverflow.com/questions/378485", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1768/" ]
378,490
<p>I'm running on win2003 server, PHP 526, via the cmd-line.</p> <p>I have a cmdline string:</p> <pre><code>$cmd = ' "d:\Prog Files\foo.exe" -p "d:\data path\datadir" '; </code></pre> <p>Trying to do this in php code</p> <pre><code>$out = `$cmd`; # note use of backticks AKA shell_exec </code></pre> <p>results in a failure by foo.exe as it interprets the -p arg as "d:\data".</p> <p>However, the same <code>$cdm</code> string copied to the windows shell cmdline executes successfully.</p> <p>How do I properly handle spaces in PHP <code>shell_exec</code>?</p>
[ { "answer_id": 1545523, "author": "user187383", "author_id": 187383, "author_profile": "https://Stackoverflow.com/users/187383", "pm_score": 0, "selected": false, "text": "exec('cmd /c \" '.$path.' \"';\n $path = '\"C:\\Program Files\\ToDoList Simple\\ToDoList.exe\" \"C:\\SomePath\\todo....
2008/12/18
[ "https://Stackoverflow.com/questions/378490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23598/" ]
378,492
<p>I have 2 components for example (editor.mxml using mx:windows), when I click an edit button, I want to get the current value from the other component's datafield? (datagrid.mxml using mx:window)</p> <p>I do know how to access the main MXML's datagrid by parentDocument or Application.application method, but stumped block if I want to access other way as mentioned above. Keep the code as simple as possible.</p>
[ { "answer_id": 380269, "author": "hasseg", "author_id": 4111, "author_profile": "https://Stackoverflow.com/users/4111", "pm_score": 1, "selected": false, "text": "A B A B" }, { "answer_id": 4160164, "author": "czerasz", "author_id": 325852, "author_profile": "https://...
2008/12/18
[ "https://Stackoverflow.com/questions/378492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
378,493
<p>I wanted to create my own Python exception class, like this:</p> <pre><code>class MyException(BaseException): def __init__(self, errno, address): if errno == 10048: mess = str(address) + ' is already in use' else: mess = 'Unable to open ' + str(address) BaseException.__init__(mess) </code></pre> <p>but when the program got to the call to <code>BaseException.__init__()</code>, I got this traceback:</p> <pre><code>BaseException.__init__(mess) TypeError: descriptor '__init__' requires a 'exceptions.BaseException' object but received a 'str' </code></pre> <p>I thought that BaseException would take any set of arguments. Also, how I am supposed to pass an 'exceptions.BaseException' object into exceptions.BaseException's constructor?</p>
[ { "answer_id": 378514, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": true, "text": "BaseException.__init__(self, mess)\n BaseClassName.methodname(self, arguments) Exception BaseException" } ]
2008/12/18
[ "https://Stackoverflow.com/questions/378493", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11677/" ]
378,498
<p><a href="http://msdn.microsoft.com/en-us/netframework/aa569603.aspx" rel="nofollow noreferrer">BCL</a></p> <p>Specifically, am I breaking the EULA by doing this? </p>
[ { "answer_id": 378509, "author": "Greg Beech", "author_id": 13552, "author_profile": "https://Stackoverflow.com/users/13552", "pm_score": 5, "selected": true, "text": "where /R \"%WINDIR%\\Microsoft.NET\" eula*.*\n" } ]
2008/12/18
[ "https://Stackoverflow.com/questions/378498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4435/" ]
378,515
<p>I've noticed that boost.asio has a lot of examples involving sockets, serial ports, and all sorts of non-file examples. Google hasn't really turned up a lot for me that mentions if asio is a good or valid approach for doing asynchronous file i/o.</p> <p>I've got gobs of data i'd like to write to disk asynchronously. This can be done with native overlapped io in Windows (my platform), but I'd prefer to have a platform independent solution.</p> <p>I'm curious if</p> <ol> <li>boost.asio has any kind of file support</li> <li>boost.asio file support is mature enough for everyday file i/o</li> <li>Will file support ever be added? Whats the outlook for this?</li> </ol>
[ { "answer_id": 35297114, "author": "moof2k", "author_id": 4343378, "author_profile": "https://Stackoverflow.com/users/4343378", "pm_score": 3, "selected": false, "text": "epoll select BOOST_ASIO_DISABLE_EPOLL open() boost::asio::posix::stream_descriptor boost::asio::windows::object_handl...
2008/12/18
[ "https://Stackoverflow.com/questions/378515", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8123/" ]
378,524
<p>I'm trying to create a Regex usuable in C# that will allow me to take a list of single letters and/or letter groups and ensure that a word is only comprised of items from that list. For instance:</p> <ul> <li>'a' would match 'a', 'aa', 'aaa', but not 'ab'</li> <li>'a b' would match 'a', 'ab', 'abba', 'b', but not 'abc'</li> <li>'a b abc' would match 'a', 'ab', 'abc', 'aabc', 'baabc', but not 'ababac'</li> </ul> <p>I thought something of the form</p> <pre><code>(a|b|abc)* </code></pre> <p>would work, but it incorrectly matches the last term. Here's the code I'm testing with:</p> <pre><code>[Fact] public void TestRegex() { Regex regex = new Regex("(a|b|abc)*"); regex.IsMatch("a").ShouldBeTrue(); regex.IsMatch("b").ShouldBeTrue(); regex.IsMatch("abc").ShouldBeTrue(); regex.IsMatch("aabc").ShouldBeTrue(); regex.IsMatch("baabc").ShouldBeTrue(); // This should not match ... I don't think anyway regex.IsMatch("ababac").ShouldBeFalse(); } </code></pre> <p>I have a pretty basic understanding of regex, so apologies if I'm missing something obvious here :)</p> <p><strong>Update</strong> <em>I don't understand why your counter-example is a counter-example : ababac = a b a bac. cCould you clarify ?</em></p> <p>I only want to use 'a', 'b', and 'abc' - 'bac' would be a completely different term.</p> <p>Let me give another example: Using 'ba' and 't', I could match the word 'bat', but not 'tab'. The order of the letters inside the letter groups is important.</p> <p>(Tests with Diadistis' solution)</p> <pre><code> [Fact] public void TestRegex() { Regex regex = new Regex(@"\A(?:(e|l|ho)*)\Z"); regex.IsMatch("e").ShouldBeTrue(); regex.IsMatch("l").ShouldBeTrue(); regex.IsMatch("ho").ShouldBeTrue(); regex.IsMatch("elho").ShouldBeTrue(); regex.IsMatch("hole").ShouldBeTrue(); regex.IsMatch("holle").ShouldBeTrue(); regex.IsMatch("hello").ShouldBeFalse(); regex.IsMatch("hotel").ShouldBeFalse(); } </code></pre>
[ { "answer_id": 378582, "author": "Diadistis", "author_id": 47401, "author_profile": "https://Stackoverflow.com/users/47401", "pm_score": 3, "selected": true, "text": "Regex regex = new Regex(@\"\\A(?:(a|b|abc)*)\\Z\");\n" }, { "answer_id": 378661, "author": "Michael Burr", ...
2008/12/18
[ "https://Stackoverflow.com/questions/378524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9913/" ]
378,534
<p>How can I make a Property "ReadOnly" outside the Assembly (DLL) for people using the DLL but still be able to populate that property from within the assembly for them to read?</p> <p>For example, if I have a <strong>Transaction</strong> object that needs to populate a property in a <strong>Document</strong> object (which is a child class of the <strong>Transaction</strong> class) when something happens in the <strong>Transaction</strong> object, but I just want to developer using my DLL to only be able to read that property and not change it (it should only be changed from within the DLL itself).</p>
[ { "answer_id": 378543, "author": "Greg Beech", "author_id": 13552, "author_profile": "https://Stackoverflow.com/users/13552", "pm_score": 3, "selected": false, "text": "get set public int MyProp { get; internal set; }\n" }, { "answer_id": 378546, "author": "mmx", "author_...
2008/12/18
[ "https://Stackoverflow.com/questions/378534", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47167/" ]
378,548
<p>How can you join between a table with a sparse number of dates and another table with an exhaustive number of dates such that the gaps between the sparse dates take the values of the previous sparse date?</p> <p>Illustrative example:</p> <pre><code>PRICE table (sparse dates): date itemid price 2008-12-04 1 $1 2008-12-11 1 $3 2008-12-15 1 $7 VOLUME table (exhaustive dates): date itemid volume_amt 2008-12-04 1 12345 2008-12-05 1 23456 2008-12-08 1 34567 2008-12-09 1 ... 2008-12-10 1 2008-12-11 1 2008-12-12 1 2008-12-15 1 2008-12-16 1 2008-12-17 1 2008-12-18 1 </code></pre> <p>Desired result:</p> <pre><code>date price volume_amt 2008-12-04 $1 12345 2008-12-05 $1 23456 2008-12-08 $1 34567 2008-12-09 $1 ... 2008-12-10 $1 2008-12-11 $3 2008-12-12 $3 2008-12-15 $7 2008-12-16 $7 2008-12-17 $7 2008-12-18 $7 </code></pre> <p>Update:</p> <p>A couple people have suggested a correlated subquery that accomplishes the desired result. (Correlated subquery = a subquery that contains a reference to the outer query.)</p> <p>This will work; however, I should have noted that the platform I'm using is MySQL, for which correlated subqueries are poorly optimized. Any way to do it without using a correlated subquery?</p>
[ { "answer_id": 378572, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 2, "selected": false, "text": "SELECT v.date, p.price, v.volume\nFROM volume v\nLEFT JOIN Price p ON p.itemID=v.itemID\n AND p.[date] = (\n ...
2008/12/18
[ "https://Stackoverflow.com/questions/378548", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41613/" ]
378,555
<p>when I press the Maximize button on my WPF app, all the controls therein expand perfectly horizontally, but they do not expand to fill the window vertically. I figure it Maximize handles it horizontally, it should handle it vertically as well. Should I be setting a property somewhere on each control? I can catch the Resize event, but it seems like a lot of work to go through all the controls and resize them vertically only. </p> <p>Thank you for your help.</p>
[ { "answer_id": 378677, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "<Window x:Class=\"MainScreen.Window1\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n xmlns:x=\...
2008/12/18
[ "https://Stackoverflow.com/questions/378555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
378,556
<p>I'm having trouble getting this code to show up correctly in WebKit browsers(chrome/safari). It looks fine in IE6, IE7, and FireFox. </p> <pre><code>&lt;table width="100%"&gt; &lt;tr&gt; &lt;td rowspan="2" style="vertical-align:middle;"&gt; &lt;a href="http://http://{$smarty.const.DOMAIN}/company/a_cherry_on_top/line/gift_cards/?v=s2"&gt;&lt;img src="/i/thumbnails/acotgc25sm.gif" alt="Gift Certificate"/&gt;&lt;/a&gt; &lt;/td&gt; &lt;td style="vertical-align:middle;"&gt; &lt;a href="http://{$smarty.const.DOMAIN}/article?a=2044" target="_top"&gt;Wishlist&lt;/a&gt; &lt;/td&gt; &lt;td style="vertical-align:middle;"&gt; &lt;a href="http://{$smarty.const.DOMAIN}/article?a=2125" target="_top"&gt;Link to Us&lt;/a&gt; &lt;/td&gt; &lt;td style="vertical-align:middle;"&gt; &lt;a href="http://www.shareasale.com/shareasale.cfm?merchantID=8362" target="_blank"&gt;Affiliate Program&lt;/a&gt; &lt;/td&gt; &lt;td style="vertical-align:middle;"&gt; &lt;a href="http://{$smarty.const.DOMAIN}/article?a=1521" target="_top"&gt;Privacy&lt;/a&gt; &lt;/td&gt; &lt;td style="vertical-align:middle;"&gt; &lt;a href="http://{$smarty.const.DOMAIN}/article?a=1395" target="_top"&gt;Guarantee&lt;/a&gt; &lt;/td&gt; &lt;td rowspan="2" style="width:160px;"&gt; &lt;script src="http://www.gmodules.com/ig/ifr?url=http://www.google.com/ig/modules/translatemypage.xml&amp;up_source_language=en&amp;w=160&amp;h=60&amp;title=&amp;border=&amp;output=js"&gt;&lt;/script&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style="vertical-align:middle;"&gt; &lt;a href="http://{$smarty.const.DOMAIN}/article?a=3069" target="_top"&gt;About Us&lt;/a&gt; &lt;/td&gt; &lt;td style="vertical-align:middle;"&gt; &lt;a href="http://{$smarty.const.DOMAIN}/article?a=1467" target="_top"&gt;Shipping&lt;/a&gt; &lt;/td&gt; &lt;td style="vertical-align:middle;"&gt; &lt;a href="http://{$smarty.const.DOMAIN}/article?a=12342383" target="_top"&gt;Why Buy From Us&lt;/a&gt; &lt;/td&gt; &lt;td style="vertical-align:middle;"&gt; &lt;a href="http://{$smarty.const.DOMAIN}/article?a=1397" target="_top"&gt;Contact Us&lt;/a&gt; &lt;/td&gt; &lt;td style="vertical-align:middle;"&gt; &lt;a href="http://{$smarty.const.DOMAIN}/help" target="_top"&gt;Help&lt;/a&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>The problem is that WebKit makes the top row very small and the bottom row fill in the rest of the space instead of each row having an equal height.</p> <p>Anyone have any ideas of how to make it show up how I want it to in WebKit based browsers?</p>
[ { "answer_id": 413408, "author": "Ross", "author_id": 2025, "author_profile": "https://Stackoverflow.com/users/2025", "pm_score": 0, "selected": false, "text": "tr <tr style=\"height: 50%;\">\n" }, { "answer_id": 1020958, "author": "Travis", "author_id": 307338, "auth...
2008/12/18
[ "https://Stackoverflow.com/questions/378556", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13778/" ]
378,559
<p>I restored my development database from production, and the stored procedures I need in my development environment doesn't exist in my production database. Is there a command Ii can use to import the developmetn stored procedures back into SQL Server. There are about 88 files, as each procedure is in a different text file.</p> <p>TIA! Chris</p>
[ { "answer_id": 378570, "author": "mmx", "author_id": 33708, "author_profile": "https://Stackoverflow.com/users/33708", "pm_score": 5, "selected": true, "text": "for %f in (*.sql) do sqlcmd -i %f\n sqlcmd -h" }, { "answer_id": 6538207, "author": "David Q Hogan", "author_id...
2008/12/18
[ "https://Stackoverflow.com/questions/378559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36269/" ]
378,564
<p>Are there any sorts of useful idioms I can make use of when writing an API that is asynchronous? I would like to standardize on something as I seem to be using a few different styles throughout. It seems hard to make asynchronous code simple; I suppose this is because asynchronous operations are anything but.</p> <p>At the most basic level, the user of the API must be able to:</p> <ol> <li>Have data pushed to them as it becomes available <li>Check the status of the asynchronous operation <li>Be notified of errors that occur <li>Wait for completion (converting the asynchronous operation to a synchronous one) </ol> <p>My classes support several asynchronous operations. I have been putting some of the status/error callbacks in the class around it, but the class is becoming gunked up with a lot of incidental fields, as well as getting too large. I am curious if anyone has used an asynchronous API they found to be well-organized. I have looked at .NET's Begin/EndAsyncOperation + AsyncResult design, as well as some classes in Java (e.g. Future).</p> <p>This is being written in Python, so it remains very flexible. There is a caveat: some of these asynchronous operations are being marshaled to a remote machine and executed over there. Thus, not every operation necessarily executes in a separate thread.</p>
[ { "answer_id": 379525, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 2, "selected": false, "text": "class SomeClientInterface( object ):\n def update( self, source, data ):\n # handle data being pushed from Observ...
2008/12/18
[ "https://Stackoverflow.com/questions/378564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29825/" ]
378,574
<p>I'm using this to check for the availability of a URL:</p> <pre><code>$fp = fsockopen($url, 443, $errno, $errstr); </code></pre> <p>and I get this error back...</p> <p><strong>Warning: fsockopen() [function.fsockopen]: unable to connect to <a href="https://example.com/soapserver.php:443" rel="noreferrer">https://example.com/soapserver.php:443</a> (Unable to find the socket transport "https" - did you forget to enable it when you configured PHP?) in C:\Home etc etc....</strong></p> <p>I'm using an IIS server btw,( no its not my doing! ) so I think its something to do with not having open-ssl, but I'm not sure. Can anyone help please? </p> <p>I did a phpinfo() and I do have ssl, but on IMAP and cURL, thats all.</p> <p>Any ideas?</p>
[ { "answer_id": 4844906, "author": "Sérgio", "author_id": 532544, "author_profile": "https://Stackoverflow.com/users/532544", "pm_score": 6, "selected": false, "text": "extension=php_openssl.dll php.ini" }, { "answer_id": 42327389, "author": "The Onin", "author_id": 132557...
2008/12/18
[ "https://Stackoverflow.com/questions/378574", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26107/" ]
378,583
<p>I have a simple function that I want to call in the code behind file name Move and I was trying to see how this can be done and Im not using asp image button because not trying to use asp server side controls since they tend not to work well with ASP.net MVC..the way it is set up now it will look for a javascript function named Move but I want it to call a function named move in code behind of the same view</p> <pre><code> &lt;img alt='move' id="Move" src="/Content/img/hPrevious.png" onclick="Move()"/&gt; protected void Move(){ } </code></pre> <p>//based on Search criteria update a new table</p> <pre><code> protected void Search(object sender EventArgs e) { for (int i = 0; i &lt; data.Count; i++){ HtmlTableRow row = new HtmlTableRow(); HtmlTableCell CheckCell = new HtmlTableCell(); HtmlTableCell firstCell = new HtmlTableCell(); HtmlTableCell SecondCell = new HtmlTableCell(); CheckBox Check = new CheckBox(); Check.ID = data[i].ID; CheckCell.Controls.Add(Check); lbl1.Text = data[i].Date; lbl2.Text = data[i].Name; row.Cells.Add(CheckCell); row.Cells.Add(firstCell); row.Cells.Add(SecondCell); Table.Rows.Add(row); } </code></pre> <p>}</p>
[ { "answer_id": 379017, "author": "Craig Stuntz", "author_id": 7714, "author_profile": "https://Stackoverflow.com/users/7714", "pm_score": 0, "selected": false, "text": "public ActionResult ShowMyPage();\n{\n return View();\n}\n public ActionResult ShowMyPage(string searchQuery);\n{\n ...
2008/12/18
[ "https://Stackoverflow.com/questions/378583", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39809/" ]
378,596
<p>I wrote a google map lookup page. Everthing worked fine until I referenced the page to use a master page. I removed the form tag from the master page as the search button on the map page is a submit button. Everything else on my page appears but the google map div appears with map navigation controls and logo but no map visuals appear.</p> <p>I retested with the previous, non master page version and the map appears correctly. Any thoughts on what I'm missing?</p>
[ { "answer_id": 378667, "author": "Chris Brandsma", "author_id": 9443, "author_profile": "https://Stackoverflow.com/users/9443", "pm_score": 0, "selected": false, "text": "runat=\"server\" <div id=\"gmap\" runat=\"server\"></div>\n var mapDiv = '<%= gmap.ClientID %>';\nvar map = new GMap2...
2008/12/18
[ "https://Stackoverflow.com/questions/378596", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46064/" ]
378,608
<p>I have a set of data that models a hierarchy of categories. A root category contains a set of top-level categories. Each top-level category contains a set of sub-categories.</p> <p>Each sub category has a set of organizations. A given organization can appear in multiple sub categories. </p> <p>The leaf nodes of this hierarchy are organizations. An organization can potentially appear in multiple sub-categories.</p> <p>The data is stored in three SQL tables:</p> <pre><code>organizations organization_id organization_name 1 Org A 2 Org B 3 Org C 4 Org D 5 Org E 6 Org F categories category_id parent_id category_name 0 NULL Top Level Category 1 0 First Category 2 0 Second Category 3 1 Sub Category A 4 1 Sub Category B 5 1 Sub Category C 6 2 Sub Category D organizations_categories -- Maps organizations to sub_categories organization_id category_id 1 3 2 3 2 6 3 4 4 4 5 4 6 5 6 4 7 6 8 6 </code></pre> <p>I would like to be able to select a list of all unique organizations under a given category or sub-category. </p> <p>The way I'm doing it right now involves first figuring out which sub categories have been requested and then looping through each sub_category in code and performing a select to get all organizations mapped to that category. The results of each select are appended to an array. This array contains duplicates whenever an organization appears in multiple sub categories.</p> <p>I would love to replace this kludge with a query that can efficiently select a list of distinct organizations given an id of one of the categories in the hierarchy.</p> <p>I am devloping this solution using PHP and MySQL.</p> <p>Thanks for your time and suggestions.</p>
[ { "answer_id": 378646, "author": "Tom H", "author_id": 5696608, "author_profile": "https://Stackoverflow.com/users/5696608", "pm_score": 3, "selected": true, "text": "SELECT DISTINCT\n O.organization_id,\n O.organization_name\nFROM\n Categories CAT\nINNER JOIN Categories SUB ...
2008/12/18
[ "https://Stackoverflow.com/questions/378608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3238/" ]
378,620
<p>I have a RadioButtonList on my page that is populated via Data Binding</p> <pre><code>&lt;asp:RadioButtonList ID="rb" runat="server"&gt; &lt;/asp:RadioButtonList&gt; &lt;asp:Button Text="Submit" OnClick="submit" runat="server" /&gt; </code></pre> <p>How do I get the value of the radio button that the user selected in my "submit" method?</p>
[ { "answer_id": 378639, "author": "terjetyl", "author_id": 29519, "author_profile": "https://Stackoverflow.com/users/29519", "pm_score": 4, "selected": false, "text": "rb.SelectedValue" }, { "answer_id": 379229, "author": "azamsharp", "author_id": 3797, "author_profile...
2008/12/18
[ "https://Stackoverflow.com/questions/378620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
378,622
<p>Can someone tell me how can I extract a public keu in .pem format from a .cer file ? I'm trying to configure webservice over https with nusoap.</p> <p>Tks, ED</p>
[ { "answer_id": 378690, "author": "Douglas Leeder", "author_id": 3978, "author_profile": "https://Stackoverflow.com/users/3978", "pm_score": 2, "selected": false, "text": "openssl x509 -inform der -in <certificate> -noout -pubkey\n" } ]
2008/12/18
[ "https://Stackoverflow.com/questions/378622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
378,630
<p>I am writing a DLL with mixed C/C++ code. I want to specify the ordinals of the functions I'm exporting. So I created a .DEF file that looks like this</p> <pre><code>LIBRARY LEONMATH EXPORTS sca_alloc @1 vec_alloc @2 mat_alloc @3 sca_free @4 vec_free @5 mat_free @6 ... </code></pre> <p>I would like to specify the ordinals of my C++ functions and class methods too. I have tried using the Dependency Walker to add the mangled names of my functions to the .DEF file:</p> <pre><code> ??0CScalar@@QAE@XZ @25 ??0CScalar@@QAE@O@Z @26 ??0CScalar@@QAE@ABV0@@Z @27 ??1CScalar@@QAE@XZ @28 </code></pre> <p>But this has failed. Any ideas why this could be happening?</p> <hr> <p><b>EDIT:</b> kauppi made a good observation, so I'm adding more information to the question.</p> <ul> <li><b>Platform:</b> Windows (and I'm not interested in portability)</li> <li><b>Compiler:</b> Microsoft's C++ compiler (I'm using VS2005)</li> <li><b>Why I want to do this?:</b> Using the ordinals has the advantage of letting me call exported C++ functions from C code.</li> </ul>
[ { "answer_id": 378751, "author": "coppro", "author_id": 16855, "author_profile": "https://Stackoverflow.com/users/16855", "pm_score": 3, "selected": true, "text": "class MyClass\n{\n void foo(int);\n int bar(int);\n double bar(double);\n void baz(MyClass);\n};\n #ifdef __cplu...
2008/12/18
[ "https://Stackoverflow.com/questions/378630", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46571/" ]
378,632
<p>I have the following html in my webpage (simplified).</p> <pre><code>&lt;button type="submit" name="action" value="ButtonA"&gt;Click Here&lt;/button&gt; </code></pre> <p>In Firefox, it submits "ButtonA" as the value for the "action" form value. However, in IE7, it submits "Click Here". Is there any way to resolve this? I don't want to use input tags, because I need to be able to customize the text without affecting the values sent back to the form (localization). Basically, I want to be able to have multiple buttons with the same name, and depending on their value, do a different action when submitted. Is there any easy with to get IE to act correctly in this case?</p> <p>[MORE]</p> <p>Maybe I should be more clear, but I can't use</p> <pre><code>&lt;input type="submit" name="Action" value="ButtonA"&gt; </code></pre> <p>because I need to be able to change the text displayed for localization rules, without affecting the actual value of the button that's submitted with the form.</p> <p>[MORE]</p> <p>To elaborate even more, Basically, I want the button to be able to say "Save" or "Sauver" depending on the language, but not have the value submitted to the server change. I also want to have multiple buttons with the same name, and depending on the value, do something, rather than depending on the button name, and testing if there is a value for that button. The code is already written from that perspective, and I just want to be able to change the displayed text in the values, without existing server side processing code.</p> <p>Here is a link with a very good <a href="http://allinthehead.com/retro/330/coping-with-internet-explorers-mishandling-of-buttons" rel="noreferrer">explanation of the problem</a>, with some possible work arounds.</p>
[ { "answer_id": 378642, "author": "Abram Simon", "author_id": 46204, "author_profile": "https://Stackoverflow.com/users/46204", "pm_score": 0, "selected": false, "text": "<input type=\"submit\" /> <button>" }, { "answer_id": 378649, "author": "Bullines", "author_id": 27870...
2008/12/18
[ "https://Stackoverflow.com/questions/378632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1862/" ]
378,638
<p>If I have a <code>DropDownList</code> control that makes up part of a CompositeControl how can I expose the <code>SelectedIndexChanged</code> event to the consuming aspx page?</p> <p>Thanks</p>
[ { "answer_id": 378843, "author": "BFree", "author_id": 15861, "author_profile": "https://Stackoverflow.com/users/15861", "pm_score": 2, "selected": false, "text": "public event EventHandler SelectedIndexChanged;\n protected void DropDownList1_SelectedIndexChanged(object sender, E...
2008/12/18
[ "https://Stackoverflow.com/questions/378638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39643/" ]
378,643
<p>The following event can possibly get called hundreds of times a frame.</p> <pre><code>public bool OnCollision(Body body1, Body body2) { if(body2.Tag is Dog) ((Dog)body2.Tag).Bark(); } </code></pre> <p>I understand that using "is" causes a cast to be made and then when i want to do something with it, cast it a second time. Is there a more efficient way to check the type? I made a console app trying "if(body2.Tag.GetType() == typeOf(Dog))" but it appears to be even slower than using "is".</p> <p>Thanks.</p>
[ { "answer_id": 378657, "author": "James Curran", "author_id": 12725, "author_profile": "https://Stackoverflow.com/users/12725", "pm_score": 5, "selected": true, "text": " if(body2.Tag is Dog)\n Dog Temp = body2.Tag as Dog;\nif (temp != null)\n Dog dog = body2.Tag as Dog;\nif (dog != null...
2008/12/18
[ "https://Stackoverflow.com/questions/378643", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47489/" ]
378,655
<p>I want to exclude a subdirectories by pattern in subversion because the development tool we are using is generating them. Getting the tool to generate the directories elsewhere is not an option. We don't want to edit the global-ignore property in ~/.subversion/config as it is difficult to maintain consistency with this. The directories we are trying to exclude look like this:</p> <pre><code>rootdir |-&gt; dir1 |-&gt; dirToExclude |-&gt; dir2 |-&gt; dirToExclude </code></pre> <p>I want to exclude dirToExclude in both dir1 and dir2. Can be done using an svn:ignore on rootdir instead of having to add the svn:ignore to both dir1 and dir2?</p>
[ { "answer_id": 378695, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 3, "selected": true, "text": "svn:ignore .htaccess" } ]
2008/12/18
[ "https://Stackoverflow.com/questions/378655", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40800/" ]
378,669
<p>I am looking for best practice in building multiple visual basic projects(all dll's).We have multiple projects, and our final deliverable will be a dll.Now, one project uses 2 other projects, and another refers to another project.Should projects reference the vbp files, or the dll? If they reference vbp files, how to build all the projects? </p>
[ { "answer_id": 397624, "author": "Kb.", "author_id": 49544, "author_profile": "https://Stackoverflow.com/users/49544", "pm_score": 2, "selected": false, "text": "\\project\\source\n\\project\\source\\project1\\\n\\project\\source\\project2\\\n...\n \\project\\bin\\\n \"c:\\Program Files\...
2008/12/18
[ "https://Stackoverflow.com/questions/378669", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9087/" ]
378,678
<p>Throughout the history of software development, it sometimes happens that some person (usually unknown, probably unwittingly) made what, at the time, seemed a trivial, short-term decision that changed the world of programming. What events of this nature come to mind, and what have been our industry's response to mitigate the pain?</p> <p>Illustration (the biggest one I can think of): When IBM designed the original PC, and decided to save a couple dollars in manufacturing costs by choosing the half-brain-dead 8088 with 8-bit-addressable memory, instead of one of the 16-bit options (8086, 680n, etc.), dooming us to 20 years of address offset calculations.</p> <p>(In response, a lot of careers in unix platform development were begun.)</p> <p>Somewhere toward the other end of the scale lies the decision someone made to have a monster Shift Lock key at the left end of the keyboard, instead of a Ctrl key.</p>
[ { "answer_id": 474121, "author": "Kluge", "author_id": 8752, "author_profile": "https://Stackoverflow.com/users/8752", "pm_score": 3, "selected": false, "text": "cd \\program files\\MyCompany\\MyProgram\n cd \"\\program files\\MyCompany\\MyProgram\"\n" } ]
2008/12/18
[ "https://Stackoverflow.com/questions/378678", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31641/" ]
378,700
<p>Is it possible to add a "metadata"-like description or comments to a table in Microsoft SQL 2000 and above? </p> <p>How would you do this through the CREATE TABLE statement?</p> <p>Is it possible to add a description or comment to fields?</p> <p>How do you query this info back in MSSQL 2000? 2005?</p>
[ { "answer_id": 378729, "author": "JoshBerke", "author_id": 26160, "author_profile": "https://Stackoverflow.com/users/26160", "pm_score": 6, "selected": true, "text": "EXEC sys.sp_addextendedproperty @name=N'<NameOfProp>', \n@value=N'<Value>' , @level0type=N'SCHEMA',@level0name=N'dbo', \n...
2008/12/18
[ "https://Stackoverflow.com/questions/378700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36590/" ]
378,704
<p>It sounds wonky, but this is what I'm trying to do with javascript (this is all triggered by an event handler):</p> <ol> <li>Save the contents of a page (preferably the whole document or at least documentElement object) into a variable.</li> <li>Create an iframe and insert it into the body.</li> <li>Replace the document of the iframe with the saved document (so that the iframe now has the same content as the outer page).</li> <li>Change the outer page.</li> </ol> <p>Everything is dandy except the part about replacing the iframe's document. I've tried a bunch of different things, but all have problems (they are outlined below). I need event handlers, styles, links, etc to all work correctly when the page is in the iframe.</p> <p>And yes, I realize that I could just set the src of the iframe to the url of the current page, but I'd rather the page not have to load. If I can't come up with a solution, this is what I'll do.</p> <hr> <h3>Things that I've already tried:</h3> <pre><code>var html = iframe.contentWindow.document.importNode(document.documentElement, true); iframe.contentWindow.documentElement = html; </code></pre> <p>I get an error message ("setting a property that only has a getter").</p> <pre><code>var html = iframe.contentWindow.document.importNode(document.documentElement, true); var idoc = iframe.contentWindow.document; while(idoc.firstChild) idoc.removeChild(idoc.firstChild); // remove all children (firefox automatically creates an html element for iframes with no src) idoc.appendChild(html); // insert a new documentElement </code></pre> <p>This seems to work, but doesn't re-render the styles, and event handlers don't work. Interestingly, links don't work either, and they aren't even styled with the browser's default styles. Maybe this is because the DOCTYPE isn't copied to the iframe?</p> <pre><code>iframe.contentWindow.document.documentElement.innerHTML = document.documentElement.innerHTML; </code></pre> <p>This has the same behavior as the removeChild/appendChild method.</p> <hr> <p>It seems like if I could just get the browser to re-render the styles and re-register the event handlers then I'd be golden, but I'm not sure if this is even possible.</p>
[ { "answer_id": 49194933, "author": "user3363398", "author_id": 3363398, "author_profile": "https://Stackoverflow.com/users/3363398", "pm_score": 0, "selected": false, "text": "var myIframe = document.createElement(\"iframe\");\nmyIframe.style.display = \"none\";\ndocument.body.appendChil...
2008/12/18
[ "https://Stackoverflow.com/questions/378704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3625/" ]
378,716
<p>I've been building a database input form. There are three fields for notes. They were all build at the same time. They have the same logic &amp; class system - but one of them is returning with escape marks when I update the record, e.g. I enter</p> <pre><code>1 2 3 </code></pre> <p>and the updated record returns </p> <pre><code>1\r\n2\r\n3 </code></pre> <p>I'm confused as the other return the text as formatted. Can you sugggest why this is happening?</p>
[ { "answer_id": 378728, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 0, "selected": false, "text": "'\\' 'n' echo var_dump" }, { "answer_id": 380858, "author": "Jay", "author_id": 41690, "author_pr...
2008/12/18
[ "https://Stackoverflow.com/questions/378716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
378,737
<p>I'm cloning a TClientDataSet and I want to copy all the fields to the clone (which is a new DataSet), I know I can loop through the Fields and copy the info, or make 2 instances of my class and just clone the cursor, but is there some better way? Something like create a new DataSet and assign the fields info?</p> <p><strong>EDIT:</strong></p> <p>The following class helper method works for me:</p> <pre><code>procedure TDataSetHelper.CopyFieldDefs(Source: TDataSet); var Field, NewField: TField; FieldDef: TFieldDef; begin for Field in Source.Fields do begin FieldDef := FieldDefs.AddFieldDef; FieldDef.DataType := Field.DataType; FieldDef.Size := Field.Size; FieldDef.Name := Field.FieldName; NewField := FieldDef.CreateField(Self); NewField.Visible := Field.Visible; NewField.DisplayLabel := Field.DisplayLabel; NewField.DisplayWidth := Field.DisplayWidth; NewField.EditMask := Field.EditMask; if IsPublishedProp(Field, 'currency') then SetPropValue(NewField, 'currency', GetPropValue(Field, 'currency')); end; end; </code></pre> <p>Anyone has a better way for doing this?</p>
[ { "answer_id": 379047, "author": "Jim McKeeth", "author_id": 255, "author_profile": "https://Stackoverflow.com/users/255", "pm_score": 3, "selected": false, "text": "ds2.FieldDefs.Assign(ds1.FieldDefs);\nds2.CreateDataSet;\nds2.Open;\n" } ]
2008/12/18
[ "https://Stackoverflow.com/questions/378737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/727/" ]
378,752
<p>Is there any way to map to a network drive by using a stored procedure? I have tried: </p> <pre><code>xp_cmdshell 'net use Q: [shared_network_drive] [pwd] /user:[username]' </code></pre> <p>but I got an error saying something like </p> <pre><code>'System error 1312 has occurred.' 'A specified logon session does not exist. It may already have been terminated.' </code></pre> <p>However, when I run the same command in a cmd console in the same box as the SQL server machine, there is no problem at all. It looks like that SQL process does pass correct logon credential information. Any way to do it by SQL SP?</p>
[ { "answer_id": 378908, "author": "Tom H", "author_id": 5696608, "author_profile": "https://Stackoverflow.com/users/5696608", "pm_score": 1, "selected": false, "text": "EXEC sp_xp_cmdshell_proxy_account 'DOMAIN\\Username', 'password'\n" }, { "answer_id": 12455430, "author": "M...
2008/12/18
[ "https://Stackoverflow.com/questions/378752", "https://Stackoverflow.com", "https://Stackoverflow.com/users/62776/" ]
378,754
<p>I am trying to debug a problem where a user clicks on the button and the UI just dies. I know, good luck. </p> <p>The logs just end after the user clicks the button so i'm thinking there may be some exception/error that we are not logging. Maybe an OutOfMemoryError.</p> <p>Any suggestions on how to proceed? to get more information. Java command setting etc.</p> <p>Thanks for any help</p> <ul> <li>rich </li> </ul>
[ { "answer_id": 378796, "author": "Charlie Martin", "author_id": 35092, "author_profile": "https://Stackoverflow.com/users/35092", "pm_score": 3, "selected": true, "text": "Thread.setDefaultUncaughtExceptionHandler() Throwables System.exit() normalExit Throwable" }, { "answer_id":...
2008/12/18
[ "https://Stackoverflow.com/questions/378754", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47508/" ]
378,768
<p>This morning, I tried to commit a revision to Subversion and found that all of a sudden I did not have permission to do so.</p> <pre>Can't move '/svn/db/txn-protorevs/21000-ga9.rev' to '/svn/db/revs/21/21001': Permission Denied</pre> <p>Looking at the revs directory, I noticed that somebody had committed the 21000th revision, and the group write permission for the new directory is missing for some reason.</p> <pre> drwxrwsr-x 2 svn svn 24K 2008-10-27 10:04 19 drwxrwsr-x 2 svn svn 24K 2008-12-18 07:13 20 drwxr-sr-x 2 jeff svn 4.0K 2008-12-18 11:18 21 </pre> <p>Setting the group write permission on that directory allows me to commit, so I'm good for another 1000 revisions. But why does this happen, and what can I change to make sure it doesn't happen again?</p>
[ { "answer_id": 378776, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 4, "selected": true, "text": "file:// svnserve file:// svn+ssh:// file://" }, { "answer_id": 378886, "author": "orip", "author_id": 3702...
2008/12/18
[ "https://Stackoverflow.com/questions/378768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3434/" ]
378,786
<p>When writing an abstract class, or a class that doesn't get instantiated directly... do you tend to write a dealloc method in the abstract class and release where appropriate, and then allow for children to call [super dealloc] and then worry about only instance variables they add which aren't part of the super class?</p> <p>How do you folks manage memory with abstract classes?</p> <p>I'm thinking something along the lines of:</p> <pre><code>@interface ClassA : NSObject { NSArray *foo; } @end @implementation ClassA - (void) dealloc { [foo release]; [super dealloc]; } @end @interface ClassB : ClassA { NSArray *bar; } @end @implementation ClassB - (void) dealloc { [bar release]; [super dealloc]; } @end </code></pre> <p>Please pardon any syntactical errors, I just wrote this up on the fly. Does the above make sense or should memory be managed differently? GC isn't an option as I'm doing this on the iPhone.</p>
[ { "answer_id": 379014, "author": "Peter Hosey", "author_id": 30461, "author_profile": "https://Stackoverflow.com/users/30461", "pm_score": 2, "selected": false, "text": "alloc release init dealloc" } ]
2008/12/18
[ "https://Stackoverflow.com/questions/378786", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40882/" ]
378,801
<p>Here is the basic situation.</p> <pre><code>Public Class MyEnumClass(of T) Public MyValue as T End Class </code></pre> <p>This is vast oversimplification of the actual class, but basically I know that T is an enumeration (if it is not then there will be many other problems, and is a logical error made by the programmer)</p> <p>Basically I want to get the underlying integer value of MyValue.</p> <p>Using Cint or Ctype, does not work.</p>
[ { "answer_id": 378824, "author": "Ross Goddard", "author_id": 4779, "author_profile": "https://Stackoverflow.com/users/4779", "pm_score": 3, "selected": false, "text": "String.Format(\"{0:d}\", MyValue)\n" }, { "answer_id": 378828, "author": "Jason Down", "author_id": 973...
2008/12/18
[ "https://Stackoverflow.com/questions/378801", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4779/" ]
378,811
<p>I'm trying to get Python scripts, called from a web browser, to work. I keep getting the error: </p> <pre><code>500 Internal Server Error </code></pre> <p>When I check my error logs I see the message </p> <pre><code>Premature end of script headers </code></pre> <p>The only documentation of this error online says that it can be the result of having improper line return characters in your script, but I wrote my test script right from the shell with pico. Also, when I run the file from the command line it executes just fine. " So far the only change I have made to apache is to add the .py to the "AddHandler cgi-script" line.</p> <p>Thanks!</p> <hr> <p>Thanks for the quick responses. Here is the latest version of the test code. I added a couple new lines before the output as suggested but still get the same error:</p> <pre><code>#!/usr/local/bin/python print "Content-type: text/html\n" print "\n\n" print "&lt;HTML&gt;" print "&lt;HEAD&gt;" print "&lt;TITLE&gt;Test&lt;/TITLE&gt;" print "&lt;/HEAD&gt;" print "&lt;BODY&gt;" print "&lt;H2&gt;Hi there.&lt;/h2&gt;" print "&lt;/BODY&gt;" print "&lt;/HTML&gt;" </code></pre> <p>Some other details: I am running Apache 1.3 and don't have mod_python. I set apache to recognize .py as mentioned above. I am running the script from the main public_html folder. </p> <hr> <p>An update. It doesn't seem to matter what I put in the shebang line. I tried all of the suggestions and even if I leave it blank the same error is showing up in the errors log and I'm getting a 500 error. </p> <p>I'm running Apache/1.3.41 on linux (red hat 3.4) with WHM/Cpanel installed. </p>
[ { "answer_id": 378822, "author": "Kenan Banks", "author_id": 43089, "author_profile": "https://Stackoverflow.com/users/43089", "pm_score": 3, "selected": false, "text": "Content-Type: text/html" }, { "answer_id": 378826, "author": "Jack", "author_id": 24998, "author_p...
2008/12/18
[ "https://Stackoverflow.com/questions/378811", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47514/" ]
378,829
<p>In a UNIX shell script, what can I use to convert decimal numbers into hexadecimal? I thought od would do the trick, but it's not realizing I'm feeding it ASCII representations of numbers.</p> <p>printf? Gross! Using it for now, but what else is available?</p>
[ { "answer_id": 378839, "author": "Keltia", "author_id": 16143, "author_profile": "https://Stackoverflow.com/users/16143", "pm_score": 8, "selected": false, "text": "printf(1) printf \"%x\\n\" 34\n22\n" }, { "answer_id": 378844, "author": "Rob Wells", "author_id": 2974, ...
2008/12/18
[ "https://Stackoverflow.com/questions/378829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18103/" ]
378,832
<p>i have sql statement like this </p> <pre><code>SELECT DISTINCT results_sp_08.material_number FROM results_sp_08 INNER JOIN courses ON results_sp_08.material_number = courses.material_number INNER JOIN users ON results_sp_08.id = users.id AND results_sp_08.doctor = 'xx260' </code></pre> <p>i need alternative way to DISTINCT in to use it in MySQL version: 4.1.22 ? </p> <p>is there another way or trick?</p>
[ { "answer_id": 378838, "author": "dkretz", "author_id": 31641, "author_profile": "https://Stackoverflow.com/users/31641", "pm_score": 0, "selected": false, "text": "JOIN tablex AS x1 ON whatever \nLEFT JOIN tablex AS x2 ON whatever \n AND x2.pkid < x1.pkid AND x2.somefield IS NULL\n...
2008/12/18
[ "https://Stackoverflow.com/questions/378832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47507/" ]
378,847
<p><code>CGI.escapeHTML</code> is pretty bad, but <code>CGI.unescapeHTML</code> is completely borked. For example:</p> <pre><code>require 'cgi' CGI.unescapeHTML('&amp;#8230;') # =&gt; "…" # correct - an ellipsis CGI.unescapeHTML('&amp;hellip;') # =&gt; "&amp;hellip;" # should be "…" CGI.unescapeHTML('&amp;#162;') # =&gt; "\242" # correct - a cent CGI.unescapeHTML('&amp;cent;') # =&gt; "&amp;cent;" # should be "\242" CGI.escapeHTML("…") # =&gt; "…" # should be "&amp;#8230;" </code></pre> <p>It appears that <code>unescapeHTML</code> knows about all of the numeric codes plus <code>&amp;amp;</code>, <code>&amp;lt;</code>, <code>&amp;gt;</code>, and <code>&amp;quot;</code>. And <code>escapeHTML</code> only knows about those last four -- it doesn't do any of the numeric codes. I understand that escaping doesn't generally need to be as robust since HTML will allow the literal versions of most characters except the four that <code>CGI.escapeHTML</code> knows about. But unescaping should really be better.</p> <p>Is there a better tool out there, at least for unescaping?</p>
[ { "answer_id": 379680, "author": "Chris Lloyd", "author_id": 42413, "author_profile": "https://Stackoverflow.com/users/42413", "pm_score": 2, "selected": false, "text": "require 'rubygems'\nrequire 'hpricot'\n\nHpricot('&#8230;', :xhtml_strict => true).to_plain_text\n" }, { "answ...
2008/12/18
[ "https://Stackoverflow.com/questions/378847", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1190/" ]
378,848
<p>I'm wanting to capture my search terms and pass them to a JavaScript variable, but I don't know how to handle quotes that might come through.</p> <p>Here's what I have currently:</p> <pre><code>var searchTerms = "&lt;!--#echo var="terms"--&gt;"; var pattern = / /g; newSearchTerms = searchTerms.replace(/[^a-zA-Z 0-9]+/g,''); var searchStr=newSearchTerms.replace(pattern,"_"); </code></pre> <p>I'm concerned that should "terms" contain double quotes (or an apostrophy if I use single quotes in the JS) then my function will fail.</p> <p>How do I escape the string before it gets into script?</p> <p>Thanks,<br /> Steve</p> <hr> <p>Edit/answer: I ended up doing this by moving this to an external script that captured and parsed the querystring rather than echoing it in the HTML.</p>
[ { "answer_id": 378874, "author": "Grant Wagner", "author_id": 9254, "author_profile": "https://Stackoverflow.com/users/9254", "pm_score": 2, "selected": false, "text": "terms var searchTerms = \"<!--#echo var=\"terms\"-->\"; terms var searchTerms = \"These are the \"terms\"\";\n terms va...
2008/12/18
[ "https://Stackoverflow.com/questions/378848", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16124/" ]
378,862
<p>I need to update a field (which is currently empty) based on a match with another table. This should be simple, but my syntax is wrong.</p> <p>In SQLServer 2005, the syntax would be </p> <pre><code>UPDATE Facilities-NOID SET Facilities-NOID.ID = Facilities-ID.ID FROM Facilities-NOID, Facilities-ID WHERE [Facilities-ID].[Structure ID] = [Facilities-NOID].[Structure ID]; </code></pre> <p>Access doesn't like that FROM line, but if I leave it out, it wants each ID. This should be simple, but I'm not seeing it in the MS help on the Update syntax.</p>
[ { "answer_id": 378986, "author": "BIBD", "author_id": 685, "author_profile": "https://Stackoverflow.com/users/685", "pm_score": 0, "selected": false, "text": "UPDATE Facilities-NOID\nSET Facilities-NOID.ID = Facilities-ID.ID\nWHERE [Facilities-ID].[Structure ID] = [Facilities-NOID].[Stru...
2008/12/18
[ "https://Stackoverflow.com/questions/378862", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22523/" ]
378,864
<p>I need to convert a name in the format Parisi, Kenneth into the format kparisi.</p> <p>Does anyone know how to do this in Perl?<br></p> <p>Here is some sample data that is abnormal:</p> <p>Zelleb, Charles F.,,IV<br> Eilt, John,, IV<br> Wods, Charles R.,,III<br> Welkt, Craig P.,,Jr.<br></p> <p>These specific names should end up as czelleb, jeilt, cwoods, cwelkt, etc.</p> <hr> <p>I have one more condition that is ruining my name builder<br><br> O'Neil, Paul<br><br>so far, Vinko Vrsalovic's answer is working the best when weird/corrupt names are in the mix, but this example above would come out as "pneil"... id be damned below judas if i cant get that o between the p and the n</p>
[ { "answer_id": 378878, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 2, "selected": false, "text": "$name =~ s/(\\w+),\\s(\\w)/$2$1/;\n$name = lc $name;\n \\w [a-z] i $name =~ s/([a-z]+)\\s([a-z])/$2$1/i;\n" }, { ...
2008/12/18
[ "https://Stackoverflow.com/questions/378864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42229/" ]
378,876
<p>Consider the following example. It consists of two header files, declaring two different namespaces:</p> <pre><code>// a1.h #pragma once #include "a2.h" namespace a1 { const int x = 10; typedef a2::C B; } </code></pre> <p>and the second one is</p> <pre><code>// a2.h #pragma once #include "a1.h" namespace a2 { class C { public: int say() { return a1::x; } }; } </code></pre> <p>And a single source file, <code>main.cpp</code>:</p> <pre><code>#include &lt;iostream&gt; #include "a1.h" #include "a2.h" int main() { a2::C c; std::cout &lt;&lt; c.say() &lt;&lt; std::endl; } </code></pre> <p>This way it doesn't compile (tried GCC and MSVC). The error is that <code>a1</code> namespaces is not declared (C2653 on Windows). If you change include order in <code>main.cpp</code> this way:</p> <pre><code>#include "a2.h" #include "a1.h" </code></pre> <p>you get a symmetric error message, i.e. <code>a2</code> namespace is not declared.</p> <p>What's the problem?</p>
[ { "answer_id": 378913, "author": "Greg Rogers", "author_id": 5963, "author_profile": "https://Stackoverflow.com/users/5963", "pm_score": 5, "selected": true, "text": "// a1.h\n#pragma once\n\nnamespace a2 {\n class C;\n}\n\nnamespace a1 \n{\n const int x = 10;\n typedef a2::C B;...
2008/12/18
[ "https://Stackoverflow.com/questions/378876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13543/" ]
378,880
<p>I hope this isn't a waste of time, however I have really been trying to figure this on out. Is it my syntax. I simply want to remove the parent div ".number-row" once the link with a class of ".remove-link" is clicked.</p> <p>Thanks in advance</p> <pre><code>&lt;script&gt; $(document).ready(function(){ $(".remove-link").click(function() { $(this).parent(".number-row").hide(); }) }) &lt;/script&gt; </code></pre> <hr> <pre><code>&lt;div class="number-row" &gt; &lt;div class="number-column"&gt; &lt;div class="label-row"&gt; Select Country: &lt;/div&gt; &lt;div class="input-row"&gt; &lt;select&gt; &lt;option&gt;1&lt;/option&gt; &lt;option&gt;2&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;div class="label-row"&gt; Select Toll Free or City: &lt;/div&gt; &lt;div class="input-row"&gt; &lt;select&gt; &lt;option&gt;1&lt;/option&gt; &lt;option&gt;2&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;div class="label-row"&gt; Select Your Number: &lt;/div&gt; &lt;div class="input-row"&gt; &lt;select&gt; &lt;option&gt;1&lt;/option&gt; &lt;option&gt;2&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="number-column"&gt; &lt;div class="label-row"&gt; Select Country: &lt;/div&gt; &lt;div class="input-row"&gt; &lt;select&gt; &lt;option&gt;1&lt;/option&gt; &lt;option&gt;2&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;div class="label-row"&gt; Enter Number to Forward to: &lt;/div&gt; &lt;div class="input-row"&gt; &lt;input type="text" name="forward_number" id="forward_number" /&gt; &lt;/div&gt; &lt;div class="number-row-options"&gt; &lt;a class="save-link" href="#"&gt;Save&lt;/a&gt; &lt;a class="remove-link" href="#"&gt;Remove&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre>
[ { "answer_id": 378898, "author": "cLFlaVA", "author_id": 45109, "author_profile": "https://Stackoverflow.com/users/45109", "pm_score": 2, "selected": false, "text": "$(document).ready(function(){ \n $(\".remove-link\").click(function() { \n $(this).parent().parent().parent().hi...
2008/12/18
[ "https://Stackoverflow.com/questions/378880", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
378,883
<p>I want my web application users to download some data as an Excel file. </p> <p>I have the next function to send an Input Stream in the response object. </p> <pre><code>public static void sendFile(InputStream is, HttpServletResponse response) throws IOException { BufferedInputStream in = null; try { int count; byte[] buffer = new byte[BUFFER_SIZE]; in = new BufferedInputStream(is); ServletOutputStream out = response.getOutputStream(); while(-1 != (count = in.read(buffer))) out.write(buffer, 0, count); out.flush(); } catch (IOException ioe) { System.err.println("IOException in Download::sendFile"); ioe.printStackTrace(); } finally { if (in != null) { try { in.close(); } catch (IOException ioe) { ioe.printStackTrace(); } } } } </code></pre> <p>I would like to transform my HSSFWorkbook Object to an input stream and pass it to the previous method. </p> <pre><code>public InputStream generateApplicationsExcel() { HSSFWorkbook wb = new HSSFWorkbook(); // Populate the excel object return null; // TODO. return the wb as InputStream } </code></pre> <p><a href="http://poi.apache.org/apidocs/org/apache/poi/hssf/usermodel/HSSFWorkbook.html" rel="noreferrer">http://poi.apache.org/apidocs/org/apache/poi/hssf/usermodel/HSSFWorkbook.html</a></p>
[ { "answer_id": 379148, "author": "lucas", "author_id": 31172, "author_profile": "https://Stackoverflow.com/users/31172", "pm_score": 0, "selected": false, "text": "HSSFWorkbook wb = new HSSFWorkBook();\n//populate\n\nServletOutputStream out = response.getOutputStream();\ntry {\n wb.wri...
2008/12/18
[ "https://Stackoverflow.com/questions/378883", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2138/" ]
378,887
<p><code>String.length</code> will only tell me how many characters are in the String. (In fact, before Ruby 1.9, it will only tell me how many bytes, which is even less useful.)</p> <p>I'd really like to be able to find out how many 'en' wide a String is. For example:</p> <pre><code>'foo'.width # =&gt; 3 'moo'.width # =&gt; 3.5 # m's, w's, etc. are wide 'foi'.width # =&gt; 2.5 # i's, j's, etc. are narrow 'foo bar'.width # =&gt; 6.25 # spaces are very narrow </code></pre> <p>Even better would be if I could get the first <code>n</code> en of a String:</p> <pre><code>'foo'[0, 2.en] # =&gt; "fo" 'filial'[0, 3.en] # =&gt; "fili" 'foo bar baz'[0, 4.5en] # =&gt; "foo b" </code></pre> <p>And better still would be if I could strategize the whole thing. Some people think a space should be 0.25en, some think it should be 0.33, etc.</p>
[ { "answer_id": 379597, "author": "krusty.ar", "author_id": 43981, "author_profile": "https://Stackoverflow.com/users/43981", "pm_score": 2, "selected": false, "text": "Left, Width, Advance values for ArialBD16 'c' through 'm'\nLetter Left Width Advance\nc 1 7 9\n...
2008/12/18
[ "https://Stackoverflow.com/questions/378887", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1190/" ]
378,895
<p>I'm having a little bit of trouble understanding what the problem is here. I have a bit of code that pulls records from a database using LINQ and puts them into an object which is cast into an interface. It looks a bit like this:</p> <pre><code>public IEnumerable&lt;ISomeObject&gt; query() { return from a in dc.SomeTable select new SomeObject { //Assign various members here } as ISomeObject; } </code></pre> <p>When I test this, I put the returned IEnumerable into a variable called results and run this line:</p> <pre><code>Assert.AreEqual(EXPECTED_COUNT, results.Count()); </code></pre> <p>When this is run, I get a System.Security.VerificationException: "Operation could destabilize the runtime."</p> <p>I found the solution <a href="http://devlicio.us/blogs/derik_whittaker/archive/2008/11/29/quot-operation-could-destabilize-the-runtime-quot-from-casting-from-concrete-to-interfaces-with-linq.aspx" rel="noreferrer">here</a>, which is this:</p> <pre><code>var results = from a in dc.SomeTable select new SomeObject { //Assign various members here } as ISomeTable; return results.OfType&lt;ISomeObject&gt;(); </code></pre> <p>This works, but I'm having trouble understanding what's happening here. Why did I get the exception in the first place and how did the lines of code above fix it? The MSDN documentation seems to suggest that this is an issue of type safety, but I'm not seeing where the previous code was type-unsafe.</p> <p><strong>UPDATE</strong> A little bit more information I found out. The first example works if I make the return type IQueryable. This sheds a little bit more light on <em>what</em> was going wrong, but I'm still confused about the <em>why</em>. Why didn't the compiler force me to cast the IEnumerable into an IQueryable?</p>
[ { "answer_id": 378931, "author": "Zachary Yates", "author_id": 8360, "author_profile": "https://Stackoverflow.com/users/8360", "pm_score": 3, "selected": false, "text": "new SomeObject { ... } return results.OfType<ISomeTable>();" }, { "answer_id": 378948, "author": "Av Pinzu...
2008/12/18
[ "https://Stackoverflow.com/questions/378895", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2147/" ]
378,905
<p>I have to ship some groovy code to some users that have only java installed (no grooy, no $groovy_home, etc). I'm trying to invoke groovy from the commandline but I'm having no luck. Here's my bat file:</p> <pre><code>java -classpath .;lib;bin;bin-groovy introspector.AclCollector </code></pre> <p>And here's my exception:</p> <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: groovy/lang/GroovyObject at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$000(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) Caused by: java.lang.ClassNotFoundException: groovy.lang.GroovyObject at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 12 more Could not find the main class: introspector.AclCollector. Program will exit. </code></pre> <p>Does anyone have a clue? I have 'groovy-all-1.6-beta-1.jar' in \lib dir.</p>
[ { "answer_id": 379045, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 4, "selected": false, "text": "java -cp [...];%GROOVY_HOME%/embeddable/groovy-all-1.5.4.jar;[..]\n %GROOVY_HOME%/..." }, { "answer_id": 6914824, "...
2008/12/18
[ "https://Stackoverflow.com/questions/378905", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22992/" ]
378,909
<p>I created a NamedTemporaryFile, added some content in it and now I want to save it into a model FileField. </p> <p>The problem is that I get a SuspiciousOperation because the tmp directory is not within the FileSystemStorage directory.</p> <p>What's the proper way to do this?</p>
[ { "answer_id": 380810, "author": "rombarcz", "author_id": 47267, "author_profile": "https://Stackoverflow.com/users/47267", "pm_score": 2, "selected": false, "text": "from django.core.files.storage import FileSystemStorage\nfs = FileSystemStorage(location='/tmp')\n\nclass YourModel(model...
2008/12/18
[ "https://Stackoverflow.com/questions/378909", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1044/" ]
378,927
<p>I need to know if a variable in Python is a string or a dict. Is there anything wrong with the following code?</p> <pre><code>if type(x) == type(str()): do_something_with_a_string(x) elif type(x) == type(dict()): do_somethting_with_a_dict(x) else: raise ValueError </code></pre> <p><strong>Update</strong>: I accepted avisser's answer (though I will change my mind if someone explains why <code>isinstance</code> is preferred over <code>type(x) is</code>).</p> <p>But thanks to nakedfanatic for reminding me that it's often cleaner to use a dict (as a case statement) than an if/elif/else series.</p> <p>Let me elaborate on my use case. If a variable is a string, I need to put it in a list. If it's a dict, I need a list of the unique values. Here's what I came up with:</p> <pre><code>def value_list(x): cases = {str: lambda t: [t], dict: lambda t: list(set(t.values()))} try: return cases[type(x)](x) except KeyError: return None </code></pre> <p>If <code>isinstance</code> is preferred, how would you write this <code>value_list()</code> function?</p>
[ { "answer_id": 378957, "author": "nakedfanatic", "author_id": 44817, "author_profile": "https://Stackoverflow.com/users/44817", "pm_score": 2, "selected": false, "text": "{type(str()): do_something_with_a_string,\n type(dict()): do_something_with_a_dict}.get(type(x), errorhandler)()\n {s...
2008/12/18
[ "https://Stackoverflow.com/questions/378927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4766/" ]
378,935
<p>What does it mean by logical grouping of modules in assembly? Can anyone please explain how .NET's CLR works with assembly ?</p>
[ { "answer_id": 379829, "author": "Dylan Beattie", "author_id": 5017, "author_profile": "https://Stackoverflow.com/users/5017", "pm_score": 0, "selected": false, "text": "System.Data.SqlClient System.Data.OledbClient System.Web" } ]
2008/12/18
[ "https://Stackoverflow.com/questions/378935", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45648/" ]
378,940
<p>If you have two applications residing on the same server, can you use Server.Transfer to load a page in a different AppDomain/Application?</p> <p>My guess is no, because Server.Transfer() copies HttpContext.Items, among other things. To copy this data between AppDomains, would cause threading and memory sharing concerns a in a world were thread isolation is strictly enforced. </p> <p>Thoughts?</p>
[ { "answer_id": 378956, "author": "mmx", "author_id": 33708, "author_profile": "https://Stackoverflow.com/users/33708", "pm_score": 3, "selected": true, "text": "Server.Transfer Server.Execute HttpContext.Items HttpContext" } ]
2008/12/18
[ "https://Stackoverflow.com/questions/378940", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17360/" ]
378,942
<p>Emacs Lisp function often start like this:</p> <pre><code>(lambda () (interactive) ... </code></pre> <p>What does "(interactive)" do?</p>
[ { "answer_id": 378960, "author": "Charlie Martin", "author_id": 35092, "author_profile": "https://Stackoverflow.com/users/35092", "pm_score": 4, "selected": false, "text": "CTRL-h f interactive" }, { "answer_id": 379171, "author": "Michael Paulukonis", "author_id": 41153,...
2008/12/18
[ "https://Stackoverflow.com/questions/378942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/91385/" ]
378,958
<p>There is someone in my team that swears by using some kind of GVim feature to do manually code folding.</p> <p>As I'm using another editor and do not really need the folding feature, I think it only pollutes the source code with tags like:</p> <pre><code>/* {{{1 */ </code></pre> <p>Convincing the person not to use this folding is not an option (got into some heated discussions before).</p> <p>I'm not really a GVim guy, I'm wondering if there are not any other ways to do the folding without changing the team's code? </p> <ul> <li>Maybe putting the folding directions in a separate file, or </li> <li>Doing some kind of smart folding that takes the syntax of the programming language into account without changing the source code?</li> </ul>
[ { "answer_id": 379001, "author": "grieve", "author_id": 34329, "author_profile": "https://Stackoverflow.com/users/34329", "pm_score": 3, "selected": false, "text": "set foldmethod=syntax\n" }, { "answer_id": 379100, "author": "slim", "author_id": 7512, "author_profile...
2008/12/18
[ "https://Stackoverflow.com/questions/378958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26387/" ]
378,959
<p>Is there a static analysis tool for PHP source files?</p> <p>The binary itself can check for syntax errors, but I'm looking for something that does more, like:</p> <ul> <li>unused variable assignments</li> <li>arrays that are assigned into without being initialized first</li> <li>and possibly code style warnings</li> <li>...</li> </ul>
[ { "answer_id": 379471, "author": "troelskn", "author_id": 18180, "author_profile": "https://Stackoverflow.com/users/18180", "pm_score": 10, "selected": true, "text": "php php -l FILENAME" }, { "answer_id": 10770319, "author": "rjha94", "author_id": 262376, "author_pro...
2008/12/18
[ "https://Stackoverflow.com/questions/378959", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21229/" ]
378,969
<p>I have the following Int lists:</p> <pre><code>t1 = [1000, 1001, 1002, 1003, 1004] t2 = [2000, 2001, 2002] t3 = [3000, 3001, 3002, 3003] </code></pre> <p>The lists size are variable, they are not just 3 like in this example. They can have 1 element or many more. Then I have this:</p> <pre><code>tAll = [t1, t2, t3] </code></pre> <p>I need a function that "turns" <strong>tAll</strong> into something like this:</p> <pre><code>[[1, 1000, 2000, 3000], [2, 1001, 2001, 3001], [3, 1002, 2002, 3002], [4, 1003, 0, 3003], [5, 1004, 0, 0]] </code></pre> <p>Is there an easy way to do this?</p> <p><strong>EDIT:</strong> I'm sorry, I posted this in a hurry and it was not exactly what I wanted. I updated the code above...</p>
[ { "answer_id": 379037, "author": "comingstorm", "author_id": 210211, "author_profile": "https://Stackoverflow.com/users/210211", "pm_score": 1, "selected": false, "text": "zip3 zipWith3 (\\a b c -> [a,b,c]) \nfix _ [] [] [] = []\nfix i as bs cs = [i, hoz as, hoz bs, hoz cs]:fix (i+1) (to...
2008/12/18
[ "https://Stackoverflow.com/questions/378969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40480/" ]
378,972
<p>I've got a variable in Emacs called my-var that I'd like to set whenever I press C-v. How do I do that? I tried this:</p> <pre><code>(defun set-my-var (value) "set my var" (interactive) (defvar my-var value "a variable of mine") ) (global-set-key "\C-v" 'set-my-var) </code></pre> <p>But that fails:</p> <pre><code>call-interactively: Wrong number of arguments: (lambda (value) "set my var" (interactive) (defvar my-var value "a variable of mine")), 0 </code></pre>
[ { "answer_id": 379004, "author": "Charlie Martin", "author_id": 35092, "author_profile": "https://Stackoverflow.com/users/35092", "pm_score": 2, "selected": false, "text": "(interactive) set-my-var (interactive) (interactive \"p\") CTRL-u (interactive \"M\")" }, { "answer_id": 37...
2008/12/18
[ "https://Stackoverflow.com/questions/378972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/91385/" ]
378,979
<p>Is it possible to use a converter within a style? For instance I am trying to create a styled <code>TextBlock</code> whose text resizes based on the <code>ActualHeight</code> property of the <code>TextBlock</code>. The resizing would be done via a converter.</p>
[ { "answer_id": 379032, "author": "Kent Boogaart", "author_id": 5380, "author_profile": "https://Stackoverflow.com/users/5380", "pm_score": 6, "selected": true, "text": "<Style TargetType=\"TextBlock\">\n <Setter Property=\"FontSize\">\n <Setter.Value>\n <Binding Path...
2008/12/18
[ "https://Stackoverflow.com/questions/378979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
378,982
<p>Can I do something like this in the markup of an asp.net page, based off the "Define DEBUG constant" setting?</p> <pre><code>#IF (DEBUG) THEN &lt;asp:TextBox ID="TextBox1" runat="server"&gt;You're in debug mode&lt;/asp:TextBox&gt; #END IF </code></pre>
[ { "answer_id": 379157, "author": "jrcs3", "author_id": 3819, "author_profile": "https://Stackoverflow.com/users/3819", "pm_score": 4, "selected": true, "text": "<asp:Literal id=\"isDebug\" runat=\"server\" />\n<script runat=\"server\">\n void Page_Load()\n {\n#if DEBUG\n isD...
2008/12/18
[ "https://Stackoverflow.com/questions/378982", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44394/" ]
378,983
<p>I'm using IPAddress.TryParse() to parse IP addresses. However, it's a little too permissive (parsing "1" returns 0.0.0.1). I'd like to limit the input to dotted octet notation. What's the best way to do this?</p> <p>(Note: I'm using .NET 2.0)</p> <hr> <p><strong>Edit</strong></p> <p>Let me clarify:</p> <p>I'm writing an app that will scan a range of IPs looking for certain devices (basically a port scanner). When the user enters "192.168.0.1" for the starting address, I want to automatically fill in "192.168.0.255" as the ending address. The problem is that when they type "1", it parses as "0.0.0.1" and the ending address fills in as "0.0.0.255" - which looks goofy.</p>
[ { "answer_id": 379008, "author": "Michael Haren", "author_id": 29, "author_profile": "https://Stackoverflow.com/users/29", "pm_score": 4, "selected": true, "text": "bool IsDottedDecimalIP(string possibleIP)\n{\n Regex R = New Regex(@\"\\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b\");\n return R...
2008/12/18
[ "https://Stackoverflow.com/questions/378983", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27414/" ]
378,985
<p>I am having trouble with visible attribute of an ASP.NET <code>Panel</code> control. I have a page that calls a database table and returns the results in a datagrid.</p> <h3>Requirements</h3> <p>If some of the returned values are <code>null</code> I need to hide the image that's next to it.</p> <p>I am using a <code>Panel</code> to determine whether to hide or show the image but am having trouble with the statement:</p> <pre><code>visible='&lt;%# Eval(&quot;addr1&quot;) &lt;&gt; DBNull.Value %&gt;' </code></pre> <p>I have tried these as well:</p> <pre><code>visible='&lt;%# Eval(&quot;addr1&quot;) &lt;&gt; DBNull.Value %&gt;' visible='&lt;%# IIf(Eval(&quot;addr1&quot;) Is DbNull.Value, &quot;False&quot;,&quot;True&quot;) %&gt;' </code></pre> <p>Code is below:</p> <pre><code>&lt;asp:TemplateField &gt; &lt;ItemTemplate&gt; &lt;%# Eval(&quot;Name&quot;)%&gt; &lt;p&gt; &lt;asp:Panel runat=&quot;server&quot; ID=&quot;Panel1&quot; visible='&lt;%# Eval(&quot;addr1&quot;) &lt;&gt; DBNull.Value %&gt;'&gt; &lt;asp:Image Id=&quot;imgHouse&quot; runat=&quot;server&quot; AlternateText=&quot;Address&quot; SkinId=&quot;imgHouse&quot;/&gt; &lt;/asp:Panel&gt; &lt;%# Eval(&quot;addr1&quot;) %&gt;&lt;p&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; </code></pre> <p>What am I doing wrong?</p> <p><strong>Edit</strong></p> <p>If I use <code>visible='&lt;%# IIf(Eval(&quot;addr1&quot;) Is DbNull.Value, &quot;False&quot;,&quot;True&quot;) %&gt;'</code></p> <p>I get the following error:</p> <pre><code>Compiler Error Message: CS1026: ) expected </code></pre>
[ { "answer_id": 379028, "author": "Ben Scheirman", "author_id": 3381, "author_profile": "https://Stackoverflow.com/users/3381", "pm_score": 0, "selected": false, "text": "public void grid1_RowDataBound(object sender, GridViewRowDataBoundEventArgs e)\n{\n if(e.Row.RowType == RowType.Data...
2008/12/18
[ "https://Stackoverflow.com/questions/378985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
379,007
<p>Your basic SP with a default parameter:</p> <pre><code>ALTER PROCEDURE [usp_debug_fails] @DATA_DT_ID AS int = 20081130 WITH RECOMPILE AS BEGIN /* Usage: EXEC [usp_debug_fails] WITH RECOMPILE */ -- Stuff here that depends on DATA_DT_ID END </code></pre> <p>The same SP with a local that is hardcoded.</p> <pre><code>ALTER PROCEDURE usp_debug_works] WITH RECOMPILE AS BEGIN /* Usage: EXEC [usp_debug_works] WITH RECOMPILE */ DECLARE @DATA_DT_ID AS int SET @DATA_DT_ID = 20081130 -- Stuff here that depends on DATA_DT_ID END </code></pre> <p>You can see where I put in the (redundant, even) <code>WITH RECOMPILE</code> options in order to avoid parameter sniffing (this was never necessary in development where this thing worked fine)</p> <p>The one that works completes fine in a minute or two, the other never completes - just sits there for hours.</p> <p>This problem never happened on the development server (build 9.00.3282.00), the production server is build 9.00.3068.00</p> <p>I've removed all kinds of code from the procs to try to get down to the minimal version which still exhibits the problem, and have been very careful to keep both versions of the SP the same except for that one parameter.</p> <p>I have plenty of other SPs which take parameters and they do run fine. I've also <code>DROP</code>ped and re<code>CREATE</code>ed the SPs.</p> <p>Any ideas?</p> <p>And yes, I have a DBA looking at it and I do not have SHOWPLAN or any useful rights on production to see if there is blocking (in case one's plan results in a lock escalation I guess - again, the only difference is the parameter)</p> <p>I've reviewed all the SQL Server build information and don't see a known issue about this, so until I figure it out or the DBA figures it out, I'm kind of stuck.</p> <p><strong>UPDATE</strong></p> <p>This also fails to complete (this is actually the normal form for these SPs - I just put a default in to make it easier to switch back and forth during testing)</p> <pre><code>ALTER PROCEDURE [usp_debug_fails] @DATA_DT_ID AS int WITH RECOMPILE AS BEGIN /* Usage: EXEC [usp_debug_fails] 20081130 WITH RECOMPILE */ -- Stuff here that depends on DATA_DT_ID END </code></pre> <p>however this one completes (which may work as a workaround, although I have about 25 of these SPs to modify which all have the same form):</p> <pre><code>ALTER PROCEDURE [usp_debug_fails] @DATA_DT_ID_in AS int WITH RECOMPILE AS BEGIN /* Usage: EXEC [usp_debug_fails] 20081130 WITH RECOMPILE */ DECLARE @DATA_DT_ID AS int SET @DATA_DT_ID = @DATA_DT_ID_in -- Stuff here that depends on DATA_DT_ID END </code></pre>
[ { "answer_id": 379067, "author": "gbn", "author_id": 27535, "author_profile": "https://Stackoverflow.com/users/27535", "pm_score": 3, "selected": true, "text": "ALTER PROCEDURE [usp_debug_mightwork]\n @DATA_DT_ID AS int = 20081130\nAS\nBEGIN\n DECLARE @IDATA_DT_ID AS int\n SET @...
2008/12/18
[ "https://Stackoverflow.com/questions/379007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18255/" ]
379,015
<p>Is it possible to send a UDP broadcast packet to a different subnet through a router? I'm writing an app to discover certain devices on the network, and the PC might be on a different subnet than the devices it's looking for.</p>
[ { "answer_id": 379043, "author": "Alnitak", "author_id": 6782, "author_profile": "https://Stackoverflow.com/users/6782", "pm_score": 5, "selected": true, "text": "no ip directed-broadcasts" } ]
2008/12/18
[ "https://Stackoverflow.com/questions/379015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27414/" ]
379,041
<p>When I write a class I always expose private fields through a public property like this:</p> <pre><code>private int _MyField; public int MyField { get{return _MyField; } </code></pre> <p>When is it ok to just expose a public field like this:</p> <pre><code>public int MyField; </code></pre> <p>I am creating a structure called Result and my intention is do this:</p> <pre><code>public Result(bool result, string message) { Result = result; Message = message; } public readonly int Result; public readonly int Message; </code></pre> <p>What is the best practice? Is it ever ok to do this?</p>
[ { "answer_id": 379611, "author": "jpsimard-nyx", "author_id": 47109, "author_profile": "https://Stackoverflow.com/users/47109", "pm_score": 1, "selected": false, "text": "private readonly int result;\nprivate readonly int message;\n\npublic Result(bool result, string message)\n{\n this...
2008/12/18
[ "https://Stackoverflow.com/questions/379041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17744/" ]
379,053
<p>I know that having diamond inheritance is considered bad practice. However, I have 2 cases in which I feel that diamond inheritance could fit very nicely. I want to ask, would you recommend me to use diamond inheritance in these cases, or is there another design that could be better.</p> <p><strong>Case 1:</strong> I want to create classes that represent different kinds of "Actions" in my system. The actions are classified by several parameters: </p> <ul> <li>The action can be "Read" or "Write".</li> <li>The action can be with delay or without delay (It is not just 1 parameter. It changes the behavior significantly).</li> <li>The action's "flow type" can be FlowA or FlowB.</li> </ul> <p>I intend to have the following design:</p> <pre><code>// abstract classes class Action { // methods relevant for all actions }; class ActionRead : public virtual Action { // methods related to reading }; class ActionWrite : public virtual Action { // methods related to writing }; class ActionWithDelay : public virtual Action { // methods related to delay definition and handling }; class ActionNoDelay : public virtual Action {/*...*/}; class ActionFlowA : public virtual Action {/*...*/}; class ActionFlowB : public virtual Action {/*...*/}; // concrete classes class ActionFlowAReadWithDelay : public ActionFlowA, public ActionRead, public ActionWithDelay { // implementation of the full flow of a read command with delay that does Flow A. }; class ActionFlowBReadWithDelay : public ActionFlowB, public ActionRead, public ActionWithDelay {/*...*/}; //... </code></pre> <p>Of course, I will obey that no 2 actions (inheriting from Action class) will implement the same method.</p> <p><strong>Case 2:</strong> I implement the composite design pattern for a "Command" in my system. A command can be read, written, deleted, etc. I also want to have a sequence of commands, which can also be read, written, deleted, etc. A sequence of commands can contain other sequences of commands. </p> <p>So I have the following design:</p> <pre><code>class CommandAbstraction { CommandAbstraction(){}; ~CommandAbstraction()=0; void Read()=0; void Write()=0; void Restore()=0; bool IsWritten() {/*implemented*/}; // and other implemented functions }; class OneCommand : public virtual CommandAbstraction { // implement Read, Write, Restore }; class CompositeCommand : public virtual CommandAbstraction { // implement Read, Write, Restore }; </code></pre> <p>In addition, I have a special kind of commands, "Modern" commands. Both one command and composite command can be modern. Being "Modern" adds a certain list of properties to one command and composite command (mostly same properties for both of them). I want to be able to hold a pointer to CommandAbstraction, and initialize it (via new) according to the needed type of command. So I want to do the following design (in addition to the above) :</p> <pre><code>class ModernCommand : public virtual CommandAbstraction { ~ModernCommand()=0; void SetModernPropertyA(){/*...*/} void ExecModernSomething(){/*...*/} void ModernSomethingElse()=0; }; class OneModernCommand : public OneCommand, public ModernCommand { void ModernSomethingElse() {/*...*/}; // ... few methods specific for OneModernCommand }; class CompositeModernCommand : public CompositeCommand, public ModernCommand { void ModernSomethingElse() {/*...*/}; // ... few methods specific for CompositeModernCommand }; </code></pre> <p>Again, I will make sure that no 2 classes inheriting from CommandAbstraction class will implement the same method.</p> <p>Thank you.</p>
[ { "answer_id": 379217, "author": "Michael Kristofik", "author_id": 46821, "author_profile": "https://Stackoverflow.com/users/46821", "pm_score": -1, "selected": false, "text": "OneCommand CompositeCommand OneCommand CompositeCommand CommandAbstraction\n / ...
2008/12/18
[ "https://Stackoverflow.com/questions/379053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44673/" ]
379,062
<p>Does anyone have a method to understand complex SQL statements? When reading structural / OO code there are usually layers of abstraction that help you break it down into manageable chunks. Often in SQL, though, it seems that you have to keep track of what's going on in multiple parts of a query all at the same time.</p> <p>The impetus for this question is the SQL query discussed in <a href="https://stackoverflow.com/questions/378548/need-help-with-a-complex-join-statement-in-sql">this question about a complex join</a>. After staring at the answer queries for a number of minutes I finally decided to step through the query using particular records to see what was going on. That was the only way I could think of to understand the query piece by piece.</p> <p>Is there a better way to break a SQL query down into manageable pieces?</p>
[ { "answer_id": 379111, "author": "Kon", "author_id": 22303, "author_profile": "https://Stackoverflow.com/users/22303", "pm_score": 4, "selected": false, "text": "select ID, Description, Status from ABC where Status = 1 OR Status = 3\n select \n ID,\n Description,\n Status\nfrom ABC\nw...
2008/12/18
[ "https://Stackoverflow.com/questions/379062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18891/" ]
379,068
<p>I've got a working SOAP::Lite client. It works against an established server, but so far my development server is sending back nothing except a 404. (Which is odd, because I'm not even seeing a connection on the server end.)</p> <p>The closest parallel that I'm used to is <code>Net::FTP</code>. </p> <pre><code>my $ftp = Net::FTP-&gt;new( "some.host.name", Debug =&gt; 1 ); </code></pre>
[ { "answer_id": 379111, "author": "Kon", "author_id": 22303, "author_profile": "https://Stackoverflow.com/users/22303", "pm_score": 4, "selected": false, "text": "select ID, Description, Status from ABC where Status = 1 OR Status = 3\n select \n ID,\n Description,\n Status\nfrom ABC\nw...
2008/12/18
[ "https://Stackoverflow.com/questions/379068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11289/" ]
379,081
<p>Tracking a single remote branch as a local branch is straightforward enough. </p> <pre><code>$ git checkout --track -b ${branch_name} origin/${branch_name} </code></pre> <p>Pushing all local branches up to the remote, creating new remote branches as needed is also easy.</p> <pre><code>$ git push --all origin </code></pre> <p>I want to do the reverse. If I have X number of remote branches at a single source: </p> <pre><code>$ git branch -r branch1 branch2 branch3 . . . </code></pre> <p>Can I create local tracking branches for all those remote branches without needed to manually create each one? Say something like:</p> <pre><code>$ git checkout --track -b --all origin </code></pre> <p>I've googled and RTMs, but have come up bunk thus far. </p>
[ { "answer_id": 379842, "author": "Otto", "author_id": 9594, "author_profile": "https://Stackoverflow.com/users/9594", "pm_score": 8, "selected": true, "text": "for i in `git branch -a | grep remote | grep -v HEAD | grep -v master`; do git branch --track ${i#remotes/origin/} $i; done\n or...
2008/12/18
[ "https://Stackoverflow.com/questions/379081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47532/" ]
379,105
<p>Is it possible to specify my own default object instead of it being null? I would like to define my own default properties on certain objects.</p> <p>For example, if I have an object foo with properties bar and baz, instead of default returing null, I'd like it to be an instance of foo with bar set to "abc" and baz set to "def" -- is this possible?</p>
[ { "answer_id": 379129, "author": "recursive", "author_id": 44743, "author_profile": "https://Stackoverflow.com/users/44743", "pm_score": 3, "selected": true, "text": "public class GenericClass<T> where T : new() {\n //class definition\n\n private void SomeMethod() {\n T myT ...
2008/12/18
[ "https://Stackoverflow.com/questions/379105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4068/" ]
379,115
<p>I've got a grid (dojox.grid v1.2) that I don't want to be sortable. How can I disable that?</p>
[ { "answer_id": 379220, "author": "sprugman", "author_id": 24197, "author_profile": "https://Stackoverflow.com/users/24197", "pm_score": 3, "selected": true, "text": "\ndojo.byId('myGridId').canSort = function(col){\n if(Math.abs(col) == 3) {\n return false;\n } else {\n ...
2008/12/18
[ "https://Stackoverflow.com/questions/379115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24197/" ]
379,128
<p>How would someone who really knows how to take advantage of dynamic programming languages approach programming differently than someone working in a static language? </p> <p>I'm familiar with the whole debate over static versus dynamic typing, but that's not what I'm getting at. I'd like to discuss problem solving techniques that are practical in dynamic languages but not in static languages. </p> <p>Most of the code I've seen written in dynamic programming languages isn't very different than code written in static programming languages. As the saying goes, you can write FORTRAN in any language, and many people do. But some people use dynamic programming languages to solve problems in a way that wouldn't easily translate into, for example, C++. What are some of their techniques?</p> <p>What are some good resources that discuss how to use dynamic programming languages? Not books on language syntax or API reference, but resources on problem solving approaches that take advantage of dynamic language capabilities.</p> <p>EDIT (1/5/2009): I appreciate the answers below, but they don't seem to account for the huge increases in productivity that dynamic language advocates say they experience. </p>
[ { "answer_id": 379169, "author": "chaos", "author_id": 47529, "author_profile": "https://Stackoverflow.com/users/47529", "pm_score": 2, "selected": false, "text": "$row = $db->getTable('user')->getRow(27);\n$row->setValue('name', 'Bob');\n $row = $db->user->getRow(27);\n$row->name = 'Bob...
2008/12/18
[ "https://Stackoverflow.com/questions/379128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25188/" ]
379,131
<p><strong>Area :</strong> Textbox in Silverlight</p> <p><strong>Question:</strong> I need to know what "line number" that is currently edited.</p> <p><strong>I've tried:</strong> As a workaround I've tried splitting with textBox.Split("\r") and counting matches on Regex with similar performance. Performance during the first 2000 lines are acceptable but then it gets to slow.</p> <p><strong>Why:</strong> I have a Textbox and a Listbox side-by-side. The item index in the listbox corresponds to line number in the textbox and the content (of the ListboxItem) is a "processed" version of the corresponding line in textbox.</p> <p><strong>Alternative:</strong> A more performance friendly strategy than my hacks. </p>
[ { "answer_id": 383916, "author": "Christoffer Lette", "author_id": 11808, "author_profile": "https://Stackoverflow.com/users/11808", "pm_score": 2, "selected": false, "text": "string.Split Regex '\\r' var s = ...the string...\nvar r = 0;\nvar c = ...caret position...\n\nfor (var i = 0; i...
2008/12/18
[ "https://Stackoverflow.com/questions/379131", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
379,133
<p>I had a straight forward approach of turning Key/Value pairs of an XML excerpt into an NSDictionary when I started a simple iPhone application. The problem is, I need to turn those NSDictionary's instances that once populated my UITableView's into custom classes because they require behavior and additional complexity. The problem here is that now in order for me to instantiate an object and fill its instance variables with key/value pairs from a web service becomes that much more difficult. I can no longer throw it into a method that iterates through the XML and uses KVC to set its instance variables. </p> <p>What kind of other solution is out there?</p>
[ { "answer_id": 379203, "author": "Marc Charbonneau", "author_id": 35136, "author_profile": "https://Stackoverflow.com/users/35136", "pm_score": 4, "selected": true, "text": "setValue:forKey:" } ]
2008/12/18
[ "https://Stackoverflow.com/questions/379133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40882/" ]
379,136
<p>Can I call a function from lisp from a library written in c or c++? How can I extend lisp? This is useful when you want to do some system calls or stuff like that.</p>
[ { "answer_id": 379970, "author": "geocar", "author_id": 37507, "author_profile": "https://Stackoverflow.com/users/37507", "pm_score": 4, "selected": true, "text": "cl_eval() (with-cstrs ((x \"Hello World\"))\n (#_puts x))\n" } ]
2008/12/18
[ "https://Stackoverflow.com/questions/379136", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47537/" ]
379,138
<p>Why is that Web Service files (.asmx) have their code-behind placed in app_code folder by default unlike the regular .aspx files?</p>
[ { "answer_id": 379970, "author": "geocar", "author_id": 37507, "author_profile": "https://Stackoverflow.com/users/37507", "pm_score": 4, "selected": true, "text": "cl_eval() (with-cstrs ((x \"Hello World\"))\n (#_puts x))\n" } ]
2008/12/18
[ "https://Stackoverflow.com/questions/379138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3096/" ]
379,141
<p>I have two versions of rails (2.1.0 and 2.2.2) installed in my computer.</p> <p>When I create a new application, is it possible to specify that I want to use the older (2.1.0) version?</p>
[ { "answer_id": 379190, "author": "Keltia", "author_id": 16143, "author_profile": "https://Stackoverflow.com/users/16143", "pm_score": 2, "selected": false, "text": "config/environment.rb # Specifies gem version of Rails to use when vendor/rails is not present\nRAILS_GEM_VERSION = '2.1.2'...
2008/12/18
[ "https://Stackoverflow.com/questions/379141", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14755/" ]
379,164
<p>I have a legacy VB6 application which I've inherited. The issue I'm facing is that I'm getting the infamous</p> <pre><code>ORA-12638: Credential retrieval failed </code></pre> <p>error message whenever it tries to connect to one of our Oracle databases. I can connect fine from SQLPlus and Toad, however. I've Googled around and everyone seems to say that modifying their sqlnet.ora file to</p> <pre><code>SQLNET.AUTHENTICATION_SERVICES=(NONE) </code></pre> <p>did the trick. I have yet to find anyone with an alternative fix. Here is what my connection string looks like:</p> <pre><code>"PROVIDER=OraOLEDB.Oracle;DATA SOURCE=(DESCRIPTION = " &amp; _ "(ADDRESS = (PROTOCOL = TCP)(HOST = server1) (PORT = 1521))" &amp; _ "(ADDRESS = (PROTOCOL = TCP)(HOST = server2) (PORT = 1521))" &amp; _ "(LOAD_BALANCE = yes) " &amp; _ "(CONNECT_DATA = " &amp; _ "(SERVER = DEDICATED) " &amp; _ "(SERVICE_NAME = database_name_here) " &amp; _ ") " &amp; _ "); " &amp; _ "User Id=username_here;Password=password_here;" </code></pre> <p>As for my VB code, it's quite simple.</p> <pre><code>Private oracleDatabaseConnection As ADODB.Connection Set oracleDatabaseConnection = New ADODB.Connection oracleDatabaseConnection.Open oracleConnectionString </code></pre> <p>Anyone have any ideas?</p> <p>Thank you. :)</p>
[ { "answer_id": 11019158, "author": "Mark Kram", "author_id": 100283, "author_profile": "https://Stackoverflow.com/users/100283", "pm_score": 6, "selected": false, "text": "Original Entry - SQLNET.AUTHENTICATION_SERVICES= (NTS)\n\nModified Entry - SQLNET.AUTHENTICATION_SERVICES= (NONE)\n"...
2008/12/18
[ "https://Stackoverflow.com/questions/379164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25371/" ]
379,172
<p>Currently I am working on a project where goto statements are heavely used. The main purpose of goto statements is to have one cleanup section in a routine rather than multiple return statements. Like below:</p> <pre><code>BOOL foo() { BOOL bRetVal = FALSE; int *p = NULL; p = new int; if (p == NULL) { cout&lt;&lt;" OOM \n"; goto Exit; } // Lot of code... Exit: if(p) { delete p; p = NULL; } return bRetVal; } </code></pre> <p>This makes it much easier as we can track our clean up code at one section in code, that is, after the Exit label.</p> <p>However, I have read many places it's bad practice to have goto statements.</p> <p>Currently I am reading the <em><a href="https://en.wikipedia.org/wiki/Code_Complete" rel="noreferrer">Code Complete</a></em> book, and it says that we need to use variables close to their declarations. If we use goto then we need to declare/initialize all variables before first use of goto otherwise the compiler will give errors that initialization of xx variable is skipped by the goto statement.</p> <p>Which way is right?</p> <hr> <p>From Scott's comment:</p> <p>It looks like using goto to jump from one section to another is bad as it makes the code hard to read and understand.</p> <p>But if we use goto just to go forward and to one label then it should be fine(?).</p>
[ { "answer_id": 379189, "author": "Tamas Czinege", "author_id": 8954, "author_profile": "https://Stackoverflow.com/users/8954", "pm_score": 7, "selected": true, "text": "void MyMethod()\n{\n MyClass *myInstance = new MyClass(\"myParameter\");\n /* Your code here */\n delete myIns...
2008/12/18
[ "https://Stackoverflow.com/questions/379172", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33411/" ]
379,175
<p>I have a <code>Dictionary&lt;string,int&gt;</code> that has the potential to contain upwards of 10+ million unique keys. I am trying to reduce the amount of memory that this takes, while still maintaining the functionality of the dictionary.</p> <p>I had the idea of storing a hash of the string as a long instead, this decreases the apps memory usage to an acceptable amount (~1.5 gig to ~.5 gig), but I don't feel very good about my method for doing this. </p> <pre><code>long longKey= BitConverter.ToInt64(cryptoTransformSHA1.ComputeHash(enc.GetBytes(strKey)), 0); </code></pre> <p>Basically this chops off the end of a SHA1 hash, and puts the first chunk of it into a long, which I then use as a key. While this works, at least for the data I'm testing with, I don't feel like this is a very reliable solution due to the increased possibility for key collisions. </p> <p>Are there any other ways of reducing the Dictionary's memory footprint, or is the method I have above not as horrible as I think it is?</p> <p>[edit] To clarify, I need to maintain the ability to lookup a value contained in the Dictionary using a string. Storing the actual string in the dictionary takes way to much memory. What I would like to do instead is to use a <code>Dictionary&lt;long,int&gt;</code> where the long is the result of a hashing function on the string.</p>
[ { "answer_id": 379182, "author": "Andrew Hare", "author_id": 34211, "author_profile": "https://Stackoverflow.com/users/34211", "pm_score": 2, "selected": false, "text": "GetHashCode()" }, { "answer_id": 379196, "author": "Konrad Rudolph", "author_id": 1968, "author_pr...
2008/12/18
[ "https://Stackoverflow.com/questions/379175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47540/" ]
379,176
<p>Is there a library that will convert a Double to a String with the whole number, followed by a fraction?</p> <p>For example</p> <pre><code>1.125 = 1 1/8 </code></pre> <p>I am only looking for fractions to a 64th of an inch. </p>
[ { "answer_id": 379250, "author": "chaos", "author_id": 47529, "author_profile": "https://Stackoverflow.com/users/47529", "pm_score": 2, "selected": false, "text": "string strfrac(float frac) {\n int main = to_int(frac + frac / 1000000.0);\n string out = to_string(main);\n float ...
2008/12/18
[ "https://Stackoverflow.com/questions/379176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17712/" ]
379,191
<p>I have a text file that contains localized language strings that is currently encoded in GB2312 (simplified Chinese), but all of my other language files are in UTF-8. I am finding it very difficult to work with this file, as none of my text editors will work properly with it and keep corrupting it. Are there any tools to convert this to UTF-8, and are there any downsides to doing this? Would it be better to just keep it as GB2312 and use a different editor (if so, can you recommend one)?</p> <p><strong>Update:</strong> I'm using Windows XP (English install).</p> <p><strong>Update #2:</strong> I've tried using Notepad++ and Notepad2 to edit the GB2312 files, but both are unable to read the files and corrupt them.</p>
[ { "answer_id": 379864, "author": "mercator", "author_id": 23263, "author_profile": "https://Stackoverflow.com/users/23263", "pm_score": 3, "selected": false, "text": "& &amp; < &lt; > &gt; <html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\" /></head><body>...
2008/12/18
[ "https://Stackoverflow.com/questions/379191", "https://Stackoverflow.com", "https://Stackoverflow.com/users/343/" ]
379,231
<p>I've been developing Web applications for a while now and have dipped my toe into GUI and Game application development.</p> <p>In the web application (php for me), a request is made to the file, that file includes all the necessary files to process the info into memory, then the flow is from Top to Bottom for each request. (mainly)</p> <p>I know that for Games the action happens within the Game Loop, but how are all the different elements of a game layered into that single loop (menu system, gui, loading of assets and the 3d world) with the constant loading and unloading of certain things.</p> <p>Same for GUI programs, i believe there's an "application loop" of some sorts.</p> <p>Are most of the items called into memory and then accessed, are the items linked in and loaded into memory when needed?</p> <p>What helped me develop web applications faster is when i understood the flow of the program, it doesn't have to be detailed, just the general idea or pseudo code.</p>
[ { "answer_id": 379270, "author": "slim", "author_id": 7512, "author_profile": "https://Stackoverflow.com/users/7512", "pm_score": 5, "selected": true, "text": "accept() while(listening) {\n get a socket connection;\n handle it;\n}\n while(running) {\n get mouse/keyboard/whatev...
2008/12/18
[ "https://Stackoverflow.com/questions/379231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22459/" ]
379,234
<p>I'm trying to come up with a clean way of sorting a set of strings based on a "sorting template". I apologize if my wording is confusing, but I can't think of a better way to describe it (maybe someone can come up with a better way to describe it after reading what I'm trying to do?).</p> <p>Consider the following list of strings (my "sort template", each item in the list a "command"):</p> <ul> <li>[FA, TY, AK, PO, PR, ZZ, QW, BC]</li> </ul> <p>I'd like to use the order of the strings within that list to sort a list of those commands. For example, I'd like the following list:</p> <ul> <li>[TY, PR, PR, ZZ, BC, AK]</li> </ul> <p>to be sorted into the following list based on the "sorting template":</p> <ul> <li>[TY, AK, PR, PR, ZZ, BC]</li> </ul> <p>What would be a good way to acomplish this? The best idea I have yet is to use an enumeration...</p> <pre><code>enum Command { FA, TY, AK, PO, PR, ZZ, QW, BC }; </code></pre> <p>...and do an Enum.Parse() on each command in my list I want sorted, converting that list from a list of strings into a list of Commands, which would then be sorted based on the order of the enumeration.</p> <p>I don't know. The enumeration seems like it would work, but is there a better way I could go about this?</p>
[ { "answer_id": 379255, "author": "Ian G", "author_id": 31765, "author_profile": "https://Stackoverflow.com/users/31765", "pm_score": 1, "selected": false, "text": "[1FA, 2TY, 3AK, 4PO, 5PR, 6ZZ, 7QW, 8BC]\n SortedList enum SortedList Commands = new SortedList();\nCommands.Add(1,FA);\nCom...
2008/12/18
[ "https://Stackoverflow.com/questions/379234", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18505/" ]
379,236
<p>I'm trying to design a data model that denotes one user being the friend of another user. This is what i've come up with so far, but it seems clunky, is there a better solution?</p> <pre><code>User ===== Id Name etc... UserFriend =========== UserId FriendId IsMutual IsBlocked </code></pre>
[ { "answer_id": 379262, "author": "chaos", "author_id": 47529, "author_profile": "https://Stackoverflow.com/users/47529", "pm_score": 7, "selected": true, "text": "UserRelationship\n====\nRelatingUserID\nRelatedUserID\nType[friend, block, etc]\n" }, { "answer_id": 379329, "aut...
2008/12/18
[ "https://Stackoverflow.com/questions/379236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8360/" ]
379,238
<p>My project is about to introduce SOAP. It's going to be used for C++ &lt;-> Java and C++ &lt;-> Flex communication. I'm responsible for refactoring our apps to take advantage of Java business rules engine and new Flex gui.</p> <p>What resources are must read for C++ SOAP? I've read W3 materials. We're probably be using gSOAP on Solaris boxes.</p>
[ { "answer_id": 379262, "author": "chaos", "author_id": 47529, "author_profile": "https://Stackoverflow.com/users/47529", "pm_score": 7, "selected": true, "text": "UserRelationship\n====\nRelatingUserID\nRelatedUserID\nType[friend, block, etc]\n" }, { "answer_id": 379329, "aut...
2008/12/18
[ "https://Stackoverflow.com/questions/379238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3579/" ]
379,239
<p>in asp.net 2.0 (not mvc), the form's action is to itself. how can I use the forms plugin to send information to server? I need to send data from the form (let's say name, email, comment) and to display the result on the client side. Any ideas?</p> <p>Thanks, Dave</p>
[ { "answer_id": 382300, "author": "Corey Downie", "author_id": 44861, "author_profile": "https://Stackoverflow.com/users/44861", "pm_score": 2, "selected": false, "text": "$(form).ajaxSubmit(function(){\n success:function(ret){\n $.ajax({\n type: \"POST\",\n contentType:...
2008/12/18
[ "https://Stackoverflow.com/questions/379239", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
379,240
<p>Assuming I have fonts installed which have the appropriate glyphs in them, is there a command shell for Windows XP that will display Unicode characters? At a minimum, two things that should display Unicode correctly:</p> <ul> <li>Directory listings. I don't care what I have to type (dir, ls, get-childitem, etc.), so long as files with Unicode characters in their names appear with the right glyphs, not the unprintable character box.</li> <li>Text file content listings. Again, doesn't matter to me if it's 'less', 'more', 'cat', 'dog', etc., so long as the characters are printed. I recognize that this is more complicated because of character encoding of the file, so if I have to specify that on the command line that's fine with me.</li> </ul> <p>Here's what I've tried so far:</p> <ul> <li>cmd.exe</li> <li>Windows PowerShell; including the multilingual version.</li> <li>Cygwin bash</li> </ul> <p>No luck. I even tried installing <a href="http://blogs.msdn.com/powershell/archive/2006/10/16/Windows-PowerShell-Font-Customization.aspx" rel="noreferrer">custom fonts for cmd/PowerShell</a>. PowerShell and cmd.exe seem to be Unicode-aware in the sense that I can copy/paste the non-printable box out of there and it will paste into other apps with the correct characters. Cygwin (?) seems to convert to the ? character and that comes through in the copy/paste.</p> <p>Any ideas?</p>
[ { "answer_id": 737677, "author": "McDowell", "author_id": 304, "author_profile": "https://Stackoverflow.com/users/304", "pm_score": 5, "selected": false, "text": " CHCP 65001\n DIR > UTF8.TXT\n TYPE UTF8.TXT\n" }, { "answer_id": 10359541, "author": "crusherjoe", "author_i...
2008/12/18
[ "https://Stackoverflow.com/questions/379240", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17834/" ]
379,276
<p>I want to store the username/password information of my windows service 'logon as' user in the app.config.</p> <p>So in my Installer, I am trying to grab the username/password from app.config and set the property but I am getting an error when trying to install the service.</p> <p>It works fine if I hard code the username/password, and fails when I try and access the app.config</p> <pre><code>public class Blah : Installer { public Blah() { ServiceProcessInstaller oServiceProcessInstaller = new ServiceProcessInstaller(); ServiceInstaller oServiceInstaller = new ServiceInstaller(); oServiceProcessInstaller.Account = ServiceAccount.User; oServiceProcessInstaller.Username = ConfigurationManager.AppSettings["ServiceProcessUsername"].ToString(); } } </code></pre>
[ { "answer_id": 462719, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 4, "selected": false, "text": "Configuration config = ConfigurationManager.OpenExeConfiguration(assemblyPath);\nConnectionStringsSection csSection = config.C...
2008/12/18
[ "https://Stackoverflow.com/questions/379276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39677/" ]
379,282
<p>In the C# example of polymorphism, there is a Cat class which inherits a class called AnimalBase and an interface called IAnimal.</p> <p>The link in question is: <a href="http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming</a></p> <p>My question is, why is both a base class and an interface used? Why not one or the other? I was of the school of thought that only an abstract class would be required for implementing polymorphism.</p> <p>Thanks</p>
[ { "answer_id": 379491, "author": "Jared", "author_id": 44757, "author_profile": "https://Stackoverflow.com/users/44757", "pm_score": 4, "selected": true, "text": "|anAnimal| \nanAnimal := Pig new.\nanAnimal makeNoise.\n\nanAnimal := Cow new.\nanAnimal makeNoise.\n makeNoise Animal anA...
2008/12/18
[ "https://Stackoverflow.com/questions/379282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32484/" ]
379,328
<p>I want in a good performance way (I hope) replace a named parameter in my string to a named parameter from code, example, my string:</p> <pre><code>"Hi {name}, do you like milk?" </code></pre> <p>How could I replace the {name} by code, Regular expressions? To expensive? Which way do you recommend?</p> <p>How do they in example NHibernates HQL to replace :my_param to the user defined value? Or in ASP.NET (MVC) Routing that I like better, "{controller}/{action}", new { controller = "Hello", ... }?</p>
[ { "answer_id": 379341, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 5, "selected": true, "text": "Compiled Replace string varname = \"name\";\nstring pattern = \"{\" + varname + \"}\";\nConsole.WriteLine(\"Hi {name}\...
2008/12/18
[ "https://Stackoverflow.com/questions/379328", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
379,339
<p>I am using <a href="http://htmlpurifier.org" rel="nofollow noreferrer">HTML Purifier</a> in my PHP project and am having trouble getting it to work properly with user input.</p> <p>I am having users enter in HTML using a WYSIWYG editor (<a href="http://tinymce.moxiecode.com/" rel="nofollow noreferrer">TinyMCE</a>), but whenever a user enters in the HTML entity <code>&amp;nbsp;</code> (non-breaking space) it gets saved into the database as this weird foreign character (<code>Â</code>).</p> <p>However, the thing is, when I edit the saved entry using the WYSIWYG editor it gets displayed properly as <code>&amp;nbsp;</code>. It also functions properly when displayed, only that in the source code it appears as a real space, but not the non-breaking space character.</p> <p>Also, in the MySQL database it displays as the weird foreign character.</p> <p>I read the doc about <a href="http://htmlpurifier.org/docs/enduser-utf8.html" rel="nofollow noreferrer">Unicode and HTML Purifier</a> and changed my database and web page encoding to be UTF-8, but I am still having problems with the non-breaking space character not being mangled. The other HTML entities, such as <code>&amp;lt;</code> and <code>&amp;gt;</code>, get saved as <code>&lt;</code> and <code>&gt;</code>, but why not <code>&amp;nbsp;</code>?</p>
[ { "answer_id": 379504, "author": "mercator", "author_id": 23263, "author_profile": "https://Stackoverflow.com/users/23263", "pm_score": 3, "selected": true, "text": "0xC2 0xA0 SET NAMES 'utf8'" }, { "answer_id": 380869, "author": "Jay", "author_id": 41690, "author_pro...
2008/12/18
[ "https://Stackoverflow.com/questions/379339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6001/" ]
379,342
<p>I have a site where users can post stuff (as in forums, comments, etc) using a customised implementation of TinyMCE. A lot of them like to copy &amp; paste from Word, which means their input often comes with a plethora of associated MS inline formatting.</p> <p>I can't just get rid of <code>&lt;span whatever&gt;</code> as TinyMCE relies on the span tag for some of it's formatting, and I can't (and don't want to) force said users to use TinyMCE's "Paste From Word" feature (which doesn't seem to work that well anyway).</p> <p>Anyone know of a library/class/function that would take care of this for me? It must be a common problem, though I can't find anything definitive. I've been thinking recently that a series of brute-force regexes looking for MS-specific patterns might do the trick, but I don't want to re-write something that may already be available unless I must.</p> <p>Also, fixing of curly quotes, em-dashes, etc would be good. I have my own stuff to do this now, but I'd really just like to find one MS-conversion filter to rule them all.</p>
[ { "answer_id": 28474984, "author": "Isra", "author_id": 1426639, "author_profile": "https://Stackoverflow.com/users/1426639", "pm_score": 0, "selected": false, "text": "<p>, <b>" }, { "answer_id": 37284498, "author": "Szél Lajos", "author_id": 4570923, "author_profile...
2008/12/18
[ "https://Stackoverflow.com/questions/379342", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14979/" ]
379,343
<p>It seems to me its very easy to implement an implicit operator versus a TypeConverter, so I'm assuming they aren't equivalent because of the prevalence of TypeConverters in the framework (see anything that extends FrameworkElement).</p> <p>But why? Wouldn't it have been much easier to create string->object and object->string implicit operators and take advantage of those in serialization (both XML and XAML)?</p> <p>Is it YAGNI? Single responsibility? Because you can't specify operator overloads in interfaces?</p>
[ { "answer_id": 379563, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 4, "selected": true, "text": "TypeConverter PropertyGrid PropertyGrid PropertyGrid" } ]
2008/12/18
[ "https://Stackoverflow.com/questions/379343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]