qid
int64
4
22.2M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
252,156
<p>In Sql Server 2005 what data type should be used to store passwords <a href="http://msdn.microsoft.com/en-us/library/system.security.cryptography.sha256managed(VS.71).aspx" rel="noreferrer">hashed by SHA-256 algorithm</a>? </p> <p>The data is <a href="http://msdn.microsoft.com/en-us/library/system.security.cryptography.sha256managed(VS.71).aspx" rel="noreferrer">hashed by the application</a> and passed to the database</p>
[ { "answer_id": 252175, "author": "Peter Parker", "author_id": 23264, "author_profile": "https://Stackoverflow.com/users/23264", "pm_score": 4, "selected": false, "text": "0x" } ]
2008/10/30
[ "https://Stackoverflow.com/questions/252156", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3241/" ]
252,179
<p>What is the best way to check if a given url points to a valid file (i.e. not return a 404/301/etc.)? I've got a script that will load certain .js files on a page, but I need a way to verify each URL it receives points to a valid file.</p> <p>I'm still poking around the PHP manual to see which file functions (if any) will actually work with remote URLs. I'll edit my post as I find more details, but if anyone has already been down this path feel free to chime in.</p>
[ { "answer_id": 252418, "author": "Czimi", "author_id": 3906, "author_profile": "https://Stackoverflow.com/users/3906", "pm_score": 4, "selected": true, "text": "<?php\n// create a new cURL resource\n$ch = curl_init();\n\n// set URL and other appropriate options\ncurl_setopt($ch, CURLOPT_...
2008/10/30
[ "https://Stackoverflow.com/questions/252179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5291/" ]
252,202
<p>In my database I have tables that define types for example</p> <p>Table: Publication Types</p> <pre> ID | Type ---------- 1 | Article 2 | Abstract 3 | Book .... </pre> <p>Which is related through the ID key to a publication tables which has the field <em>TypeID</em>.</p> <p>I then create a PublicationTable data table my .NET application which I want to filter based on the publication type. For example the following function gives me the number of publications for a specific author and publication type.</p> <pre> Public Function countPublications(ByVal authorID As Integer, _ ByVal publicationType As Integer) As Integer Dim authPubs As New PublicationsDataSet.tblPublicationsDataTable authPubs = Me.getAuthorsPublications(authorID) Dim dv As New DataView(authPubs) dv.RowFilter = "status='published' AND type='" + _ publicationType.ToString + "'" Return dv.Count End Function </pre> <p>To call this function to get a count of articles by an author of a specific type, I could</p> <ol> <li><p>call the function with two integers</p> <p>countPublications(authorID, 1)</p></li> <li><p>setup an enum so that I can write</p> <p>countPublications(authorID, pubType.Article)</p> <p>or </p></li> <li><p>somehow use the publication type table to filter the publication data set but I haven't got my head around how to do this.</p></li> </ol> <p>What other approaches should I consider.</p> <p>Thanks</p>
[ { "answer_id": 252212, "author": "Steven A. Lowe", "author_id": 9345, "author_profile": "https://Stackoverflow.com/users/9345", "pm_score": 4, "selected": true, "text": "inner join lookuptable lt on lt.id = (int)myenum.sometype \n" }, { "answer_id": 252278, "author": "Adam Li...
2008/10/31
[ "https://Stackoverflow.com/questions/252202", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4612/" ]
252,203
<p>I am using the following code to check if a variable is not nil and not zero</p> <pre><code>if(discount != nil &amp;&amp; discount != 0) ... end </code></pre> <p>Is there a better way to do this?</p>
[ { "answer_id": 252220, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": 5, "selected": false, "text": "if (!discount.nil? && !discount.zero?)\n" }, { "answer_id": 252330, "author": "madlep", "author_id": 14160...
2008/10/31
[ "https://Stackoverflow.com/questions/252203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14755/" ]
252,222
<p>What is the best way to access an ASP.NET HiddenField control that is embedded in an ASP.NET PlaceHolder control through JavaScript? The Visible attribute is set to false in the initial page load and can changed via an AJAX callback.</p> <p>Here is my current source code:</p> <pre><code>&lt;script language="javascript" type="text/javascript"&gt; function AccessMyHiddenField() { var HiddenValue = document.getElementById("&lt;%= MyHiddenField.ClientID %&gt;").value; //do my thing thing..... } &lt;/script&gt; &lt;asp:PlaceHolder ID="MyPlaceHolder" runat="server" Visible="false"&gt; &lt;asp:HiddenField ID="MyHiddenField" runat="server" /&gt; &lt;/asp:PlaceHolder&gt; </code></pre> <p><b>EDIT:</b> How do I set the style for a div tag in the ascx code behind in C#? This is the description from the code behind: CssStyleCollection HtmlControl.Style</p> <p><b>UPDATE:</b> I replaced the asp:hiddenfield with an asp:label and I am getting an "undefined" when I display the HiddenValue variable in a alert box. How would I resolve this.</p> <p><b>UPDATE 2:</b> I went ahead and refactored the code, I replaced the hidden field control with a text box control and set the style to "display: none;". I also removed the JavaScript function (it was used by a CustomValidator control) and replaced it with a RequiredFieldValidator control. </p>
[ { "answer_id": 11045023, "author": "BinuAmitSanish", "author_id": 1457853, "author_profile": "https://Stackoverflow.com/users/1457853", "pm_score": 2, "selected": false, "text": "function popup(lid)\n{\n var linkid=lid.id.toString(); \n var lengthid=linkid.length-25; \n va...
2008/10/31
[ "https://Stackoverflow.com/questions/252222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26327/" ]
252,226
<p>I have an <a href="http://en.wikipedia.org/wiki/EXE" rel="noreferrer">EXE</a> file that I should like to sign so that Windows will not warn the end user about an application from an "unknown publisher". I am not a Windows developer. The application in question is a screensaver generated from an application that generates screensaver applications. As such I have no influence on how the file is generated.</p> <p>I've already found out that I will need a <a href="https://en.wikipedia.org/wiki/Code_signing#Trusted-Library_Attribute" rel="noreferrer">code signing</a> certificate from a <a href="https://en.wikipedia.org/wiki/Certificate_authority" rel="noreferrer">CA</a> like <a href="https://en.wikipedia.org/wiki/Verisign" rel="noreferrer">Verisign</a> or instantssl.com. What I don't understand is what I need to do (if at all possible) to sign my EXE file. What is a simple explanation?</p> <p>Mel Green's answer took me further, but signtool wants me to specify what certificate to use in any case. Can I get a free code signing certificate somehow to test if this will work for me at all?</p> <p>Also please specify which certificate kind is the correct one. Most sites only mention "code signing" and talk about signing applications that are actually compiled by the user. This is not the case for me.</p>
[ { "answer_id": 25922635, "author": "Lee Richardson", "author_id": 40783, "author_profile": "https://Stackoverflow.com/users/40783", "pm_score": 5, "selected": false, "text": "signtool.exe sign /t http://timestamp.verisign.com/scripts/timstamp.dll /f \"MyCert.pfx\" /p MyPassword /d Signed...
2008/10/31
[ "https://Stackoverflow.com/questions/252226", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9438/" ]
252,229
<p>What's the best way to unify several overlapping id systems into a unified one while maintaining the old id system.</p> <p>I have several different ids on my website... (E.g /publisher/1234 and /designer/1234) I would like to unify the ids into a new system, but want to preserve the functionality of the older system.</p>
[ { "answer_id": 25922635, "author": "Lee Richardson", "author_id": 40783, "author_profile": "https://Stackoverflow.com/users/40783", "pm_score": 5, "selected": false, "text": "signtool.exe sign /t http://timestamp.verisign.com/scripts/timstamp.dll /f \"MyCert.pfx\" /p MyPassword /d Signed...
2008/10/31
[ "https://Stackoverflow.com/questions/252229", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4133/" ]
252,242
<p>Specifically, I have a model that has a field like this</p> <pre><code>pub_date = models.DateField("date published") </code></pre> <p>I want to be able to easily grab the object with the most recent <code>pub_date</code>. What is the easiest/best way to do this?</p> <p>Would something like the following do what I want?</p> <pre><code>Edition.objects.order_by('pub_date')[:-1] </code></pre>
[ { "answer_id": 252248, "author": "Harley Holcombe", "author_id": 1057, "author_profile": "https://Stackoverflow.com/users/1057", "pm_score": 6, "selected": true, "text": "obj = Edition.objects.latest('pub_date')\n" }, { "answer_id": 252414, "author": "Jonny Buchanan", "au...
2008/10/31
[ "https://Stackoverflow.com/questions/252242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/85/" ]
252,249
<p>Lucene is an excellent search engine, but the .NET version is behind the official Java release (latest stable .NET release is 2.0, but the latest Java Lucene version is 2.4, which has more features).</p> <p>How do you get around this?</p>
[ { "answer_id": 252254, "author": "Kalid", "author_id": 109, "author_profile": "https://Stackoverflow.com/users/109", "pm_score": 5, "selected": true, "text": "ikvmc -target:library <path-to-lucene.jar>\n" } ]
2008/10/31
[ "https://Stackoverflow.com/questions/252249", "https://Stackoverflow.com", "https://Stackoverflow.com/users/109/" ]
252,252
<p>Given the following markup:</p> <pre><code>&lt;ul&gt; &lt;li&gt;apple&lt;/li&gt; &lt;li class="highlight"&gt;orange&lt;/li&gt; &lt;li&gt;pear&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>Both the <code>ul</code>s and the <code>li</code>s widths appear to be 100%. If I apply a <code>background-color</code> to the list item, the highlight stretches the full width of the page.</p> <p>I only want the background highlight to stretch as wide as the widest item (with maybe some padding). How do I constrain the <code>li</code>s (or perhaps the <code>ul</code>s) width to the width of the widest item?</p>
[ { "answer_id": 252259, "author": "BoltBait", "author_id": 20848, "author_profile": "https://Stackoverflow.com/users/20848", "pm_score": 2, "selected": false, "text": "<ul>\n <li>apple</li>\n <li><span class=\"highlight\">orange</span></li>\n <li>pear</li>\n</ul>\n" }, { "an...
2008/10/31
[ "https://Stackoverflow.com/questions/252252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26627/" ]
252,257
<p>I was just wondering, since the <strong>sealed</strong> keyword's existence indicates that it's the class author's decision as to whether other classes are allowed to inherit from it, why aren't classes sealed by default, with some keyword to mark them explicitly as extensible?</p> <p>I know it's somewhat different, but access modifiers work this way. With the default being restrictive and fuller access only being granted with the insertion of a keyword.</p> <p>There's a large chance that I haven't thought this through properly, though, so please be humane!</p>
[ { "answer_id": 252745, "author": "Pablo Retyk", "author_id": 30729, "author_profile": "https://Stackoverflow.com/users/30729", "pm_score": 6, "selected": true, "text": "public extensible class MyClass\n" } ]
2008/10/31
[ "https://Stackoverflow.com/questions/252257", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82/" ]
252,260
<p>I am trying to use reflector.InvokeMethod to invoke a function with an optional parameter. The function looks like this: </p> <pre><code>Private Function DoSomeStuff(ByVal blah1 as string, ByVal blah2 as string, Optional ByVal blah3 as string = "45") as boolean 'stuff end function </code></pre> <p>and I'm Invoking it like this:</p> <pre><code>Dim result As Boolean = Reflector.InvokeMethod(AccessModifier.private,obj_of_Class, "DoSomeStuff", Param1, Param2, Param3) </code></pre> <p>This works fine, other than when I don't pass the third (optional) parameter, it dosn't hit the function.</p> <pre><code>Dim result As Boolean = Reflector.InvokeMethod(AccessModifier.private,obj_of_Class, "DoSomeStuff", Param1, Param2) </code></pre> <p>Is there a way I can use Reflector.invokeMethod to call this function without passing the optional parameter? or another way to achieve this?</p>
[ { "answer_id": 319190, "author": "codeConcussion", "author_id": 1321, "author_profile": "https://Stackoverflow.com/users/1321", "pm_score": 0, "selected": false, "text": "Private Overloads Function DoSomeStuff(ByVal blah1 As String, ByVal blah2 As String) As Boolean\n Return DoSomeStu...
2008/10/31
[ "https://Stackoverflow.com/questions/252260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
252,267
<p>The code at the end produces a compile error:</p> <pre><code>NotApplicable.java:7: run() in cannot be applied to (int) run(42); ^ 1 error </code></pre> <p>The question is why? Why does javac think I am calling run(), and does not find run(int bar)? It correctly called foo(int bar). Why do I have to use NotApplicable.this.run(42);? Is it a bug?</p> <pre><code>public class NotApplicable { public NotApplicable() { new Runnable() { public void run() { foo(42); run(42); // uncomment below to fix //NotApplicable.this.run(42); } }; } private void run(int bar) { } public void foo(int bar) { } } </code></pre>
[ { "answer_id": 252276, "author": "Claudiu", "author_id": 15055, "author_profile": "https://Stackoverflow.com/users/15055", "pm_score": 0, "selected": false, "text": "run" }, { "answer_id": 252401, "author": "Alex B", "author_id": 6180, "author_profile": "https://Stack...
2008/10/31
[ "https://Stackoverflow.com/questions/252267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21838/" ]
252,268
<p>I develop and maintain small intranet web apps(JSP and Resin).</p> <p>Some users takes so much time to complete the forms that, when they submit, they lose all their input data because of session timeout.</p> <p>Currently I prolonged session timeout to 30 minutes and display count-down clock till session timeout on top of the page, but, I think their must be better ways to protect user inputs.</p> <p>What is the best practices?</p> <hr> <p><strong>Addendum</strong> Our users make several kind of reports with the web-app, and the whole contents of each report are stored in a JavaBean stored in the session.</p> <p>As suggested by some, Ajax or iframe should do the quick fix.</p> <p>I now know that it is better not to abuse session with heavy objects, but I'm not sure how best to refactor current mess. Some people suggested to make the web-app <em>stateless</em>. Any suggestion for refactoring is welcome.</p>
[ { "answer_id": 252349, "author": "Jere.Jones", "author_id": 19476, "author_profile": "https://Stackoverflow.com/users/19476", "pm_score": 2, "selected": false, "text": "<input type=\"hidden\" name=\"user\" value=\"bob\" />\n<input type=\"hidden\" name=\"currentRecordId\" value=\"2345\" /...
2008/10/31
[ "https://Stackoverflow.com/questions/252268", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29197/" ]
252,274
<p>I open gmail, click on an inbox item, and look at source of the page. It doesn't look like there isn't any proper html to relate to what is shown on the actual page.</p> <p>How is the source getting processed into the actual page? Is there some javascript processing this information?</p>
[ { "answer_id": 252307, "author": "Richard A", "author_id": 24355, "author_profile": "https://Stackoverflow.com/users/24355", "pm_score": 2, "selected": false, "text": "try{function aa(a,b){return a.appendChild=b}function ba(a,b){return a.textContent=b}function da(a,b){return a.stop=b}fun...
2008/10/31
[ "https://Stackoverflow.com/questions/252274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
252,282
<p>I'm working on an import (from Excel) dialog to select ranges of cells.</p> <p>When the range is selected, I use the event sink to catch the event and highlight the first row and first column.</p> <p>I need to unhighlight the previous selection's first row and column. I don't think it's safe to just get the selected range at the time the selection changes and remember it, such as (pseudocode for brevity and clarity):</p> <pre><code>OnSelectionChange() { if (m_PrevSelection) UnHilite(m_PrevSelection); HiliteCurrentSelection(); GetSelectedRange(m_PrevSelection); } </code></pre> <p>I'm guessing that just holding onto that range (obtained from _Application::Selection) without releasing it is going to cause all sorts of problems. I haven't found a way to copy the range (IRange Copy just copies cell contents from one range to another).</p> <p>I guess I could take the range's cell addresses and store those, then recreate a range from them when I need to do the unhighlighting. This would seem to me to come up often. Is there a more elegant solution?</p>
[ { "answer_id": 252439, "author": "dbb", "author_id": 25675, "author_profile": "https://Stackoverflow.com/users/25675", "pm_score": 3, "selected": true, "text": "Set Rng = Application.Selection\n" } ]
2008/10/31
[ "https://Stackoverflow.com/questions/252282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965047/" ]
252,286
<p>This sounds dumb, but I can't get it to work. I think i just dont' understand the difference between <code>%%v, %v% and %v</code></p> <p>Here's what I'm trying to do:</p> <pre><code>for %%v in (*.flv) do ffmpeg.exe -i "%%v" -y -f mjpeg -ss 0.001 -vframes 1 -an "%%v.jpg" </code></pre> <p>This successfully generates a thumbnail for each of the movies, but the problem is:</p> <pre><code>movie.flv -&gt; movie.flv.jpg </code></pre> <p>So what I would like to do is pull the last 4 characters off <code>%%v</code> and use that for the second variable.</p> <p>I've been trying things like this:</p> <pre><code>%%v:~0,-3% </code></pre> <p>But it's not working, nor are any of the iterations of that that I could think of.</p> <p>Any ideas?</p>
[ { "answer_id": 252316, "author": "Jeff Hillman", "author_id": 3950, "author_profile": "https://Stackoverflow.com/users/3950", "pm_score": 3, "selected": false, "text": "for %%v in (*.flv) do ffmpeg.exe -i \"%%v\" -y -f mjpeg -ss 0.001 -vframes 1 -an \"%%~nv.jpg\"\n" }, { "answer_...
2008/10/31
[ "https://Stackoverflow.com/questions/252286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10680/" ]
252,287
<p>Here's my setup: a Mac, running OS X Tiger. Windows XP running in a virtual machine (Parallels). Windows XP has my Mac home directory mapped as a network drive.</p> <p>I have two files in a directory of my Mac home directory:</p> <h3>foo.py</h3> <pre><code>pass </code></pre> <h3>test.py</h3> <pre><code>import foo </code></pre> <p>If I run test.py from within my virtual machine by typing 'python test.py', I get this:</p> <pre><code>Traceback (most recent call last): File "test.py", line 1, in &lt;module&gt; import foo ImportError: No module named foo </code></pre> <p>If I try to import foo from the console (running python under Windows from the same directory), all is well:</p> <pre><code>Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. &gt;&gt;&gt; import foo &gt;&gt;&gt; </code></pre> <p>If I run test.py with Mac python, all is well.</p> <p>If I copy test.py and foo.py to a different directory, I can run test.py under Windows without problems.</p> <p>There is an <strong>init</strong>.py in the original directory, but it is empty. Furthermore, copying it with the other files doesn't break anything in the previous paragraph.</p> <p>There are no python-related environment variables set.</p> <p>Any ideas?</p>
[ { "answer_id": 254355, "author": "Brian", "author_id": 9493, "author_profile": "https://Stackoverflow.com/users/9493", "pm_score": 1, "selected": false, "text": "python -v -v test.py\n" } ]
2008/10/31
[ "https://Stackoverflow.com/questions/252287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15154/" ]
252,297
<p>I was making the following call:</p> <pre><code>result = RegOpenKeyEx(key, s, 0, KEY_READ, &amp;key); </code></pre> <p>(C++, Visual Studio 5, Vista 64bit).</p> <p>It is failing with error code 2 ("File not found") even though "<code>regedit</code>" shows that the key exists. This code has always worked on 32bit XP. Why is it "file not found" when it clearly is there?</p>
[ { "answer_id": 252302, "author": "Tim Cooper", "author_id": 10592, "author_profile": "https://Stackoverflow.com/users/10592", "pm_score": 7, "selected": true, "text": "KEY_WOW64_64KEY" }, { "answer_id": 3104602, "author": "Alex", "author_id": 371598, "author_profile":...
2008/10/31
[ "https://Stackoverflow.com/questions/252297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10592/" ]
252,304
<p>In our data access layer at work we have this standard implementation where the class is accessed through a singleton public property which looks something like this:</p> <pre><code>public static CustomerController Instance { get { lock(singletonLock) { if( _instance == null ) { _instance = new CustomerController(); } return _instance; } } } </code></pre> <p>now, I get what the code is doing, but I was wondering why you would do this over just creating an instance of the class each time it is used?</p>
[ { "answer_id": 252363, "author": "Keith Nicholas", "author_id": 10431, "author_profile": "https://Stackoverflow.com/users/10431", "pm_score": 1, "selected": false, "text": " public static CustomerController Instance\n {\n get \n {\n ...
2008/10/31
[ "https://Stackoverflow.com/questions/252304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/493/" ]
252,323
<p>I have a program that monitors debug messages and I have tried using a TextBox and appended the messages to it but it doesn't scale very well and slows way down when the number of messages gets large. I then tried a ListBox but the scrolling was snapping to the top when appending new messages. It also doesn't allow for cut and paste like the text box does.</p> <p>What is a better way to implement a console like element embedded in a winforms window.</p> <p>Edit: I would still like to be able to embed a output window like visual studio but since I can't figure out an easy way here are the two solutions I use. In addition to using the RichTextBox which works but you have to clear it every now and then. I use a console that I pinvoke. Here is a little wrapper class that I wrote to handle this. </p> <pre><code> using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; namespace Con { class Ext_Console { static bool console_on = false; public static void Show(bool on,string title) { console_on = on; if (console_on) { AllocConsole(); Console.Title = title; // use to change color Console.BackgroundColor = System.ConsoleColor.White; Console.ForegroundColor = System.ConsoleColor.Black; } else { FreeConsole(); } } public static void Write(string output) { if (console_on) { Console.Write(output); } } public static void WriteLine(string output) { if (console_on) { Console.WriteLine(output); } } [DllImport("kernel32.dll")] public static extern Boolean AllocConsole(); [DllImport("kernel32.dll")] public static extern Boolean FreeConsole(); } } // example calls Ext_Console.Write("console output "); Ext_Console.WriteLine("console output"); Ext_Console.Show(true,"Title of console"); </code></pre>
[ { "answer_id": 252347, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": " private void AddConsoleComment(string comment)\n {\n textBoxConsole.Text += comment + System.Environment.NewLine...
2008/10/31
[ "https://Stackoverflow.com/questions/252323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32958/" ]
252,352
<p>Is it possible to change the <code>RowCount</code> of a <code>DataGrid</code> in flash after it has been created on the stage?</p> <p>I am loading an XML file externally that contains the number of rows the <code>DataGrid</code> should have, but the problem is that because this file is not loaded at runtime, it just picks the default 3 items. Maybe I have to reload the <code>DataGrid</code> on the stage, or loop until it is defined.</p> <p>Does anyone have experience with this?</p>
[ { "answer_id": 252347, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": " private void AddConsoleComment(string comment)\n {\n textBoxConsole.Text += comment + System.Environment.NewLine...
2008/10/31
[ "https://Stackoverflow.com/questions/252352", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6822/" ]
252,355
<p>After I read a bunch of LINQ related stuff, I suddenly realized that no articles introduce how to write asynchronous LINQ query. </p> <p>Suppose we use LINQ to SQL, below statement is clear. However, if the SQL database responds slowly, then the thread using this block of code would be hindered.</p> <pre><code>var result = from item in Products where item.Price &gt; 3 select item.Name; foreach (var name in result) { Console.WriteLine(name); } </code></pre> <p>Seems that current LINQ query spec doesn't provide support to this.</p> <p>Is there any way to do asynchronous programming LINQ? It works like there is a callback notification when results are ready to use without any blocking delay on I/O.</p>
[ { "answer_id": 252426, "author": "TheSoftwareJedi", "author_id": 18941, "author_profile": "https://Stackoverflow.com/users/18941", "pm_score": 6, "selected": true, "text": "public static class AsynchronousQueryExecutor\n{\n public static void Call<T>(IEnumerable<T> query, Action<IEnum...
2008/10/31
[ "https://Stackoverflow.com/questions/252355", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26349/" ]
252,365
<p>I'm trying to create a TCP connection and send/read data that uses SSL, but I haven't been able to successfully accomplish this.</p> <p>What I'd like to do is something like this:</p> <pre><code> TcpClient _tcpClient = new TcpClient("host", 110); BinaryReader reader = new BinaryReader(new System.Net.Security.SslStream(_tcpClient.GetStream(), true)); Console.WriteLine(reader.ReadString()); </code></pre> <p>I haven't had any luck with it though. An exception is thrown when creating the BinaryReader.</p> <p>Does anyone know of a simple example that does this? I'm not interested in writing the server side of this, just the client.</p>
[ { "answer_id": 252389, "author": "Ovidiu Pacurar", "author_id": 28419, "author_profile": "https://Stackoverflow.com/users/28419", "pm_score": 5, "selected": true, "text": "TcpClient _tcpClient = new TcpClient(\"host\", 110);\n\nStreamReader reader = \n new StreamReader(new System.Net.S...
2008/10/31
[ "https://Stackoverflow.com/questions/252365", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32226/" ]
252,371
<p>What's the easiest way to increase or decrease indentation for a large block of code in vi?</p>
[ { "answer_id": 252380, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 2, "selected": false, "text": ">%" }, { "answer_id": 252385, "author": "Harley Holcombe", "author_id": 1057, "author_profile": "http...
2008/10/31
[ "https://Stackoverflow.com/questions/252371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1693/" ]
252,391
<p>Currently I have:</p> <pre><code>&lt;system.net&gt; &lt;mailSettings&gt; &lt;smtp from="me@mydomain.com"&gt; &lt;network host="localhost" port="25" /&gt; &lt;/smtp&gt; &lt;/mailSettings&gt; &lt;/system.net&gt; </code></pre> <p>How can I change it so the email is sent with a name and not the email address only? </p>
[ { "answer_id": 252415, "author": "Ty.", "author_id": 16948, "author_profile": "https://Stackoverflow.com/users/16948", "pm_score": 7, "selected": true, "text": "new SmtpClient(...).Send(\"\\\"John Smith\\\" jsmith@somewhere.com\", ...);\n" }, { "answer_id": 28046831, "author"...
2008/10/31
[ "https://Stackoverflow.com/questions/252391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2385/" ]
252,411
<p>At the moment I have a console application. I would like to be able to exit the application, update through svn, recompile and then relaunch. This is running under a Linux environment. At the moment I'm not sure how I would be able to relaunch the application. Is there a way to do this?</p>
[ { "answer_id": 252415, "author": "Ty.", "author_id": 16948, "author_profile": "https://Stackoverflow.com/users/16948", "pm_score": 7, "selected": true, "text": "new SmtpClient(...).Send(\"\\\"John Smith\\\" jsmith@somewhere.com\", ...);\n" }, { "answer_id": 28046831, "author"...
2008/10/31
[ "https://Stackoverflow.com/questions/252411", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23120/" ]
252,417
<p>What is the easiest way to use a <code>DLL</code> file from within <code>Python</code>?</p> <p>Specifically, how can this be done <em>without</em> writing any additional wrapper <code>C++</code> code to expose the functionality to <code>Python</code>?</p> <p>Native <code>Python</code> functionality is strongly preferred over using a third-party library.</p>
[ { "answer_id": 252473, "author": "paxdiablo", "author_id": 14860, "author_profile": "https://Stackoverflow.com/users/14860", "pm_score": 8, "selected": true, "text": "import ctypes\n\n# Load DLL into memory.\n\nhllDll = ctypes.WinDLL (\"c:\\\\PComm\\\\ehlapi32.dll\")\n\n# Set up prototyp...
2008/10/31
[ "https://Stackoverflow.com/questions/252417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6839/" ]
252,451
<p>I have a dynamic Facelets page that needs to show information from database when the page loads. At this point in the flow, there have not been any form submissions. Every JSF example I can find only shows a form submission with dynamic results on the next page.</p> <p>Every call I make to our database is currently takes place after an action has been triggered by a form submission. Where should this code go if there hasn't been a form submission, and how do I trigger it? A code snippet would really help me out!</p>
[ { "answer_id": 252943, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "public class BackingBean implements InitializingBean\n{\n public void afterPropertiesSet()\n {\n loadInitialData(...
2008/10/31
[ "https://Stackoverflow.com/questions/252451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
252,459
<p>If you have multiple, unrelated projects, is it a good idea to put them in the same repository?</p> <pre><code>myRepo/projectA/trunk myRepo/projectA/tags myRepo/projectA/branches myRepo/projectB/trunk myRepo/projectB/tags myRepo/projectB/branches </code></pre> <p>or would you create new repositories for each?</p> <pre><code>myRepoA/trunk myRepoA/tags myRepoA/branches myRepoB/trunk myRepoB/tags myRepoB/branches </code></pre> <p>What are the pros and cons of each? All that I can currently think of is that you get mixed revision numbers (so what?), and that you can't use <code>svn:externals</code> unless the repository is actually external. (i think?)</p> <p>The reason I ask is because I'm considering consolidating my multiple repos into one, since my SVN host has started charging per repo.</p>
[ { "answer_id": 252659, "author": "mlambie", "author_id": 17453, "author_profile": "https://Stackoverflow.com/users/17453", "pm_score": 3, "selected": false, "text": "/client/<clientname>/<project>/<trunk, branches, tags>\n" }, { "answer_id": 252717, "author": "Frederic Morin"...
2008/10/31
[ "https://Stackoverflow.com/questions/252459", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9021/" ]
252,464
<p>I'm trying to send the output to the console (or colouredconsole) ... which I'm hoping would (also?) go to the Visual Studio's <code>Output</code> window for any ASP.NET web site/app/mvc app.</p> <p>It doesn't by default, but if I change the target to 'file' then it works for sure.</p> <p>Can NLog output to the <code>Output</code> window for web apps?</p>
[ { "answer_id": 260576, "author": "Scott P", "author_id": 33848, "author_profile": "https://Stackoverflow.com/users/33848", "pm_score": 8, "selected": true, "text": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<nlog xmlns=\"http://www.nlog-project.org/schemas/NLog.xsd\"\n xmlns:xsi=...
2008/10/31
[ "https://Stackoverflow.com/questions/252464", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30674/" ]
252,489
<p>Given a simple switch statement</p> <pre><code>switch (int) { case 1 : { printf("1\n"); break; } case 2 : { printf("2\n"); } case 3 : { printf("3\n"); } } </code></pre> <p>The absence of a break statement in case 2, implies that execution will continue inside the code for case 3. This is not an accident; it was designed that way. Why was this decisions made? What benefit does this provide vs. having an automatic break semantic for the blocks? What was the rationale?</p>
[ { "answer_id": 252497, "author": "Bill the Lizard", "author_id": 1288, "author_profile": "https://Stackoverflow.com/users/1288", "pm_score": 4, "selected": false, "text": "case 0:\ncase 1:\ncase 2:\n // all do the same thing.\n break;\ncase 3:\ncase 4:\n // do something differen...
2008/10/31
[ "https://Stackoverflow.com/questions/252489", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7734/" ]
252,493
<p>Besides the DateTime ctor (new DateTime(year, month, day)) , is there any other way to truncate a date?</p>
[ { "answer_id": 252495, "author": "FlySwat", "author_id": 1965, "author_profile": "https://Stackoverflow.com/users/1965", "pm_score": 2, "selected": false, "text": "DateTime.Now.ToShortDateString();\n" } ]
2008/10/31
[ "https://Stackoverflow.com/questions/252493", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1130097/" ]
252,515
<p>This is a question that's been nagging me for some time. I always thought that C++ should have been designed so that the <code>delete</code> operator (without brackets) works even with the <code>new[]</code> operator.</p> <p>In my opinion, writing this:</p> <pre><code>int* p = new int; </code></pre> <p>should be equivalent to allocating an array of 1 element:</p> <pre><code>int* p = new int[1]; </code></pre> <p>If this was true, the <code>delete</code> operator could always be deleting arrays, and we wouldn't need the <code>delete[]</code> operator.</p> <p>Is there any reason why the <code>delete[]</code> operator was introduced in C++? The only reason I can think of is that allocating arrays has a small memory footprint (you have to store the array size somewhere), so that distinguishing <code>delete</code> vs <code>delete[]</code> was a small memory optimization.</p>
[ { "answer_id": 252518, "author": "David Nehme", "author_id": 14167, "author_profile": "https://Stackoverflow.com/users/14167", "pm_score": 6, "selected": true, "text": "new" }, { "answer_id": 252521, "author": "Ates Goral", "author_id": 23501, "author_profile": "https...
2008/10/31
[ "https://Stackoverflow.com/questions/252515", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9936/" ]
252,517
<p>I'm using c#, and have an open tcpip connection receiving data. Is it possible to save the stream to an ms sql server database as I'm receiving it, instead of receiving all the data then saving it all? If the stream could be sent to the database as it's being received, you wouldn't have to keep the entire chunk of data in memory. Is this at all possible?</p>
[ { "answer_id": 252526, "author": "TheSoftwareJedi", "author_id": 18941, "author_profile": "https://Stackoverflow.com/users/18941", "pm_score": 3, "selected": true, "text": "update myTable set myColumn.Write(@data, @offset, @length) where someid = @someId\n" } ]
2008/10/31
[ "https://Stackoverflow.com/questions/252517", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9266/" ]
252,519
<p>How can I calculate the number of work days between two dates in SQL Server? </p> <p>Monday to Friday and it must be T-SQL.</p>
[ { "answer_id": 252532, "author": "Bogdan Maxim", "author_id": 23795, "author_profile": "https://Stackoverflow.com/users/23795", "pm_score": 5, "selected": false, "text": "--Changing current database to the Master database allows function to be shared by everyone.\nUSE MASTER\nGO\n--If th...
2008/10/31
[ "https://Stackoverflow.com/questions/252519", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28419/" ]
252,539
<p>I have an app where I create many uiviews and add them to the self.view of the UIViewController. My app is running really slowly. I am releasing all of my objects and have no memory leaks (I ran the performance tool). Can anyone tell me what could be making my app so slow? (code is below)</p> <p>[EDIT] The array has around 30 items. [/EndEdit]</p> <p>Thanks so much!</p> <p>Here is the code for the loadView method of my UIViewController:</p> <pre><code>- (void)loadView { UIView *contentView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; contentView.backgroundColor = [UIColor whiteColor]; self.view = contentView; [contentView release]; int length = 0; for(NSString *item in arrayTips) { length++; [item release]; } int index = 0; for(NSString *item in arrayTitles) { SingleFlipView *backView = [[SingleFlipView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; backView.userInteractionEnabled = YES; backView.backgroundColor = [UIColor whiteColor]; [backView setViewIndex:index]; [backView setLastViewIndex:length]; CGRect labelFrame = CGRectMake(10.0f, 0.0f, 300.0f, 30.0f); UILabel *backLabel = [[UILabel alloc] initWithFrame:labelFrame]; backLabel.textAlignment = UITextAlignmentCenter; backLabel.userInteractionEnabled = YES; backLabel.text = item; backLabel.font = [UIFont fontWithName:@"Georgia" size:24.0f]; backLabel.textColor = [UIColor blackColor]; backLabel.backgroundColor = [UIColor whiteColor]; CGRect textFrame = CGRectMake(10.0f, 30.0f, 300.0f, 110.0f); UITextView *tbxView = [[UITextView alloc] initWithFrame:textFrame]; tbxView.textAlignment = UITextAlignmentCenter; tbxView.userInteractionEnabled = YES; tbxView.editable = FALSE; tbxView.text = [arrayTips objectAtIndex:index]; tbxView.font = [UIFont fontWithName:@"Arial" size:14.0f]; tbxView.textColor = [UIColor blackColor]; tbxView.backgroundColor = [UIColor whiteColor]; //CGRect labelFrame = CGRectMake(10.0f, 0.0f, 84.0f, 30.0f); UIImage *nextTip = [[UIImage imageNamed:@"NextTip.png"] retain]; UIImageView *nextTipView = [ [ UIImageView alloc ] initWithImage:nextTip]; nextTipView.frame = CGRectMake(230.0f, -10.0f, 84.0f, 30.0f); nextTipView.userInteractionEnabled = YES; UIImageView *view = [[ UIImageView alloc ] init]; view.userInteractionEnabled = YES; if(self.sexString == @"Men") { UIImage *imgTip = [[UIImage imageNamed:@"feet_small.jpg"] retain]; view.image = imgTip; view.frame = CGRectMake(0.0f, 110.0f, 416.0f, 228.0f); //59*161 [imgTip release]; } [backView addSubview:view]; [backView addSubview:tbxView]; [backView addSubview:backLabel]; //[backView addSubview:nextTipView]; [self.view addSubview:backView]; [backView release]; [backLabel release]; [nextTip release]; [nextTipView release]; [tbxView release]; [view release]; index++; [item release]; } } </code></pre>
[ { "answer_id": 252566, "author": "Ben Gottlieb", "author_id": 6694, "author_profile": "https://Stackoverflow.com/users/6694", "pm_score": 2, "selected": false, "text": "[item release]" } ]
2008/10/31
[ "https://Stackoverflow.com/questions/252539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23695/" ]
252,548
<p>When upgrading MySQL, I first create a backup of the database. Then I will uninstall the current version installed, and delete all the files that were left by the installer. Then I install the latest GA version, and restore the created back-up, using the MySQL Administrator.</p> <p>Is there a better way of doing an upgrade of the MySQL. Because I have to create again all the users that are allowed to connect to the database.</p> <p>The installation of the MySQL is used in a college enrollment system, a client server system I have developed using VB.Net and MySQL. I can only do the update at night because i know no one is connected to the database.</p>
[ { "answer_id": 252587, "author": "Owen", "author_id": 4853, "author_profile": "https://Stackoverflow.com/users/4853", "pm_score": 3, "selected": true, "text": "mysql.user" } ]
2008/10/31
[ "https://Stackoverflow.com/questions/252548", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26087/" ]
252,552
<p>When should unions be used? Why do we need them?</p>
[ { "answer_id": 252561, "author": "LeopardSkinPillBoxHat", "author_id": 22489, "author_profile": "https://Stackoverflow.com/users/22489", "pm_score": 5, "selected": false, "text": "union {\n int a;\n int b;\n int c;\n} myUnion;\n" }, { "answer_id": 252568, "author": "Ada...
2008/10/31
[ "https://Stackoverflow.com/questions/252552", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
252,559
<p>What is meant by redundant function? What is the difference between a redundant function &amp; an inline function? </p>
[ { "answer_id": 252736, "author": "PhiLho", "author_id": 15459, "author_profile": "https://Stackoverflow.com/users/15459", "pm_score": 1, "selected": false, "text": "function Foo(x) { return x * x / 2; }\nfunction Bar(x) { return Math.sqr(x) * 0.5; }\n" } ]
2008/10/31
[ "https://Stackoverflow.com/questions/252559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
252,575
<p>Can we call functions using function pointer? if yes how?</p>
[ { "answer_id": 252581, "author": "Adam Liss", "author_id": 29157, "author_profile": "https://Stackoverflow.com/users/29157", "pm_score": 4, "selected": false, "text": "\n// Functions that will be executed via pointer.\nint add(int i, int j) { return i+j; }\nint subtract(int i, int j) {re...
2008/10/31
[ "https://Stackoverflow.com/questions/252575", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
252,588
<p>On large files (~200+ MB), I get the 503 error when I read the stream.</p> <pre><code>ftp = (FtpWebRequest)WebRequest.Create(new Uri(address.AbsoluteUri + @"/" + file.Name)); ftp.Credentials = new NetworkCredential(username, password); ftp.Method = WebRequestMethods.Ftp.DownloadFile; response = (FtpWebResponse)ftp.GetResponse(); </code></pre> <p>Any clues on what I'm doing wrong or a better practice for larger files?</p>
[ { "answer_id": 264122, "author": "John Lemp", "author_id": 12915, "author_profile": "https://Stackoverflow.com/users/12915", "pm_score": 3, "selected": true, "text": "ftp.KeepAlive = false;\n" }, { "answer_id": 39368278, "author": "mrrrk", "author_id": 155791, "author...
2008/10/31
[ "https://Stackoverflow.com/questions/252588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4068/" ]
252,599
<p>We are developing a desktop application(visual basic 6.0).We have our own logging framework. What are good practices? When we have a web application, then we can control the level of logging. How to go about in a desktop app?</p>
[ { "answer_id": 252614, "author": "Adam Liss", "author_id": 29157, "author_profile": "https://Stackoverflow.com/users/29157", "pm_score": 3, "selected": false, "text": "syslog" } ]
2008/10/31
[ "https://Stackoverflow.com/questions/252599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
252,611
<p>I need to be able to lock down the valid characters in a textbox, I presently have a regex which I can check each character against such as </p> <blockquote> <p>[A-Za-z]</p> </blockquote> <p>would lock down to just Alpha characters. </p> <pre><code>protected override void OnKeyPress(KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Back) { base.OnKeyPress(e); return; } if (String.IsNullOrEmpty(this._ValidCharExpression)) { base.OnKeyPress(e); } else { bool isValidChar = Regex.Match(e.KeyChar.ToString(),this._ValidCharExpression).Success; if (isValidChar) { base.OnKeyPress(e); } else { e.Handled = true; } } } </code></pre> <p>I had placed the regex code in the OnKeyPress code, but I wat to allow all special keys, such as Ctrl-V, Ctrl-C and Backspace to be allowed.</p> <p>As you can see I have the backspace key being handled. However, Ctrl-V, for example cannot see the V key because it runs once for the ctrl key but does not see any modifiers keys.</p> <p>What is the best way to handle this situation?</p>
[ { "answer_id": 304014, "author": "benPearce", "author_id": 4490, "author_profile": "https://Stackoverflow.com/users/4490", "pm_score": 0, "selected": false, "text": "protected override void OnKeyDown(KeyEventArgs e)\n {\n Keys keyCode = (Keys)e.KeyValue;\n base.OnKeyDown(e);\n i...
2008/10/31
[ "https://Stackoverflow.com/questions/252611", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4490/" ]
252,615
<p>I have got the following problem since the server has safe mode turned on, and directories are being created under different users:</p> <ol> <li>I upload my script to the server, it shows as belonging to 'user1'. All it is doing is making a new directory when a new user is created so it can store files in it.</li> <li>New directory is created, but it belongs to 'apache' user.</li> <li>'user1' and 'apache' are different users; and safe mode is turned on. So the php script cannot write to that newly created directory.</li> <li>Now I have a problem!</li> </ol> <p>One solution is to turn off safe mode. Also, a coworker suggested that there are settings that can be changed to ensure the directories are under the same user as the script. So I am looking to see if latter can be done.</p> <p>But I have to ask. Is there a programatical solution for my problem?</p> <p>I am leaning to a 'no', as safe mode was implemented to solve it at the php level. Also the actual problem may seem like the directory being created under a different user, so a programatic fix might just be a band-aid fix.</p>
[ { "answer_id": 252645, "author": "mlambie", "author_id": 17453, "author_profile": "https://Stackoverflow.com/users/17453", "pm_score": 0, "selected": false, "text": "php_value safe_mode = Off\n" }, { "answer_id": 252646, "author": "Luis Melgratti", "author_id": 17032, ...
2008/10/31
[ "https://Stackoverflow.com/questions/252615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/131/" ]
252,624
<p>My users want data from my application in Excel. The data resides in a SQL Server database but I don't want the users to have direct access to the database, I would rather provide them a web service to get the data. What is the best way to move data from SQL Server to Excel via a web service?</p>
[ { "answer_id": 252648, "author": "Dested", "author_id": 11137, "author_profile": "https://Stackoverflow.com/users/11137", "pm_score": 2, "selected": false, "text": " public static void CreateExcelFromDataTable(string filename, DataTable dt) {\n\n DataGrid grid = new DataGrid();...
2008/10/31
[ "https://Stackoverflow.com/questions/252624", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
252,626
<p>I've got the following url route and i'm wanting to make sure that a segment of the route will only accept numbers. as such, i can provide some regex which checks the word.</p> <p>/page/{currentPage}</p> <p>so.. can someone give me a regex which matches when the word is a number (any int) greater than 0 (ie. 1 &lt;-> int.max).</p>
[ { "answer_id": 252634, "author": "Paige Ruten", "author_id": 813, "author_profile": "https://Stackoverflow.com/users/813", "pm_score": 3, "selected": false, "text": "/([1-9][0-9]*)/\n" }, { "answer_id": 252641, "author": "Christian C. Salvadó", "author_id": 5445, "aut...
2008/10/31
[ "https://Stackoverflow.com/questions/252626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30674/" ]
252,644
<p>Here is one of my header file which consists of a union template with 4 different structures.</p> <pre><code>#define MAX 3 union family { struct name /*for taking the name and gender of original member*/ { unsigned char *namess; unsigned int gender; union family *ptr_ancestor; /*this is a pointer to his ancestors details*/ }names; struct male /*for taking the above person's 3 male ancestors details if he is male*/ { unsigned char husb_names[3][20]; unsigned char wife_names[3][20]; unsigned int wife_status[3]; }male_ancestor; struct unmarry /*for taking the above person's 3 female parental ancestors if she is female and unmarried*/ { unsigned int mar; unsigned char parental_fem[3][20]; unsigned int marit_status[3]; }fem_un; struct marry /*for taking 3 parental-in-laws details if she is female and married*/ { unsigned int mar; unsigned char in_law_fem[3][20]; unsigned int in_marit_status[3]; }fem_marr; }; extern union family original[MAX]; /*for original person*/ extern union family ancestor_male[MAX]; /*used if he is male for storing his male ancestor details*/ extern union family ancestor_female[MAX]; /*used if she is female*/ extern int x; </code></pre> <p>My aim is to get a person name and gender and store the person's any 3 male/female ancestors according to the person's gender and marital status as follows..</p> <p>I mean that <code>MAX</code> will have 3 members and each will be having 3 ancestors. These ancestors will be determined by the gender the corresponding member like the following conditions:</p> <ul> <li>if male then use <code>struct male</code></li> <li>if female unmarried use <code>struct unmarry</code></li> <li>if female married use <code>struct marry</code></li> </ul> <p><code>struct name</code> is for the member name and gender for whom we have to take ancestors and point the <code>*ptr_ancestor</code> to that corresponding ancestor array (ancestormale or ancestorfemale).</p> <p>The object in memory is a union. Ok. My program will have an array of unions, in fact. Each element of the array may be using a different structure in the union. Here we should be careful in assigning the pointer or else we may loose our older person records at run time.</p> <p>If possible please tell me how to get the details of 1st element ie. <code>original[0]</code> even after taking the <code>original[1]</code>. Here I am just getting the last element of the array, and all previous records are gone at run time. I am not using any other data structures or files.</p> <p>My environment is Turbo C on Windows.</p>
[ { "answer_id": 252667, "author": "Adam Liss", "author_id": 29157, "author_profile": "https://Stackoverflow.com/users/29157", "pm_score": 2, "selected": false, "text": "// Define an array of 20 employees, each identified either by name or ID.\nunion ID {\n char name[10]; // ID may be...
2008/10/31
[ "https://Stackoverflow.com/questions/252644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31116/" ]
252,660
<p>How can I delete the session information from my browser by using javascript? Is it possible to do?</p>
[ { "answer_id": 252675, "author": "Ady", "author_id": 31395, "author_profile": "https://Stackoverflow.com/users/31395", "pm_score": 1, "selected": false, "text": "var d = new Date();\ndocument.cookie = \"cookiename=1;expires=\" + d.toGMTString() + \";\" + \";\";\n" }, { "answer_id...
2008/10/31
[ "https://Stackoverflow.com/questions/252660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
252,662
<p>I need some information about localization. I am using .net 2.0 with C# 2.0 which takes care of most of the localization related issues. However, I need to manually draw the alphabets corresponding to the current culture on the screen in one particular screen.</p> <p>This would be similar to the Contacts screen in Microsoft Outlook (Address Cards view or Detailed Address Cards View under Contacts), and so it needs a the column of buttons at the right end, one for each alphabet. </p> <p>I am trying to emulate that, but I don't want to ask the user to choose the script. If the current culture is say, Chinese, I want to draw Chinese alphabets. When the user changes the culture info to English (and when he restarts the application) I want to draw English alphabets instead. Hope you understand where I am going with this query. </p> <p>I can determine the culture of the current user (Application.CurrentCulture or System.Globalization.CultureInfo.CurrentCulture will give the culture related information). I also have all the scripts to render the alphabets. However, the problem is that I don't know how to map the culture info to the name of a script. </p> <p>In other words, is there a way to determine the script name corresponding to a culture? Or is it possible to determine the range of Unicode character values corresponding to a culture? Either of them would allow me to render the alphabets on the button properly.</p> <p>Any suggestions or guidance regarding this is truly appreciated. If there is something fundamentally wrong with my approach (or with what I am trying to achieve), please point out that as well. Thanks for your time. </p> <p>PS: I know the easiest solution is to either configure the script name as part of user preferences or display a list of languages for the user to choose from (a la Contact in Outlook 2007). But I am just trying to see whether I can render the alphabets corresponding to the culture without the user having to do anything.</p>
[ { "answer_id": 265586, "author": "Serge Wautier", "author_id": 12379, "author_profile": "https://Stackoverflow.com/users/12379", "pm_score": 0, "selected": false, "text": "GetLocaleInfoW(MAKELCID(wLangId, SORT_DEFAULT), LOCALE_FONTSIGNATURE, wcBuf, MAXWCBUF);\n" } ]
2008/10/31
[ "https://Stackoverflow.com/questions/252662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32990/" ]
252,665
<p>I need to get all the <em>cookies</em> stored in my browser using JavaScript. How can it be done? </p>
[ { "answer_id": 252684, "author": "Codeslayer", "author_id": 4021, "author_profile": "https://Stackoverflow.com/users/4021", "pm_score": 4, "selected": false, "text": "document.cookie" }, { "answer_id": 252727, "author": "Franci Penov", "author_id": 17028, "author_prof...
2008/10/31
[ "https://Stackoverflow.com/questions/252665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
252,671
<p>Has anyone ever seen the storage class <code>auto</code> explicitly used in C/C++? If so, in what situation?</p>
[ { "answer_id": 252686, "author": "Robert Gamble", "author_id": 25222, "author_profile": "https://Stackoverflow.com/users/25222", "pm_score": 2, "selected": false, "text": "auto" }, { "answer_id": 12573433, "author": "Jive Dadson", "author_id": 445296, "author_profile"...
2008/10/31
[ "https://Stackoverflow.com/questions/252671", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2079/" ]
252,689
<p>We had a performance issue with DataGridViews where the redraw was horridly slow and found the solution <a href="https://stackoverflow.com/questions/118528/horrible-redraw-performance-of-the-datagridview-on-one-of-my-two-screens">Here</a> to create a derived type and enable double buffering on the control. (Derived type is necessary since the DoubleBuffered property is protected)</p> <p>It doesn't seem like there's any drawback to having the DoubleBuffered property set to true.</p>
[ { "answer_id": 10277205, "author": "Dawid Moś", "author_id": 665695, "author_profile": "https://Stackoverflow.com/users/665695", "pm_score": 5, "selected": false, "text": "typeof(DataGridView).InvokeMember(\n \"DoubleBuffered\", \n BindingFlags.NonPublic | BindingFlags.Instance | Bin...
2008/10/31
[ "https://Stackoverflow.com/questions/252689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12685/" ]
252,691
<p>I am hacking up a tagging application for emacs. I have got a tag cloud/weighted list successfully displaying on a buffer, but i am running into a snag. I need to be able to properly word-wrap the buffer, but I haven't a clue where to start.</p> <p>The font I am using is a variable width font. On top of that, each tag is going to be in a different size, depending on how many times it shows up on the buffer. Finally, the window that displays the tagcloud could be in a window that is 200 pixels wide, or the full screen width.</p> <p>I really have no idea where to start. I tried longlines mode on the tagcloud buffer, but that didn't work.</p> <p>Source code is at: <a href="http://emacswiki.org/cgi-bin/emacs/free-tagging.el" rel="nofollow noreferrer">http://emacswiki.org/cgi-bin/emacs/free-tagging.el</a></p>
[ { "answer_id": 255361, "author": "Alex Coventry", "author_id": 1941213, "author_profile": "https://Stackoverflow.com/users/1941213", "pm_score": 3, "selected": true, "text": "posn-at-point" }, { "answer_id": 256015, "author": "Matt Curtis", "author_id": 17221, "author...
2008/10/31
[ "https://Stackoverflow.com/questions/252691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11052/" ]
252,703
<p>What's the difference between the list methods <code>append()</code> and <code>extend()</code>?</p>
[ { "answer_id": 252704, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 7, "selected": false, "text": "append" }, { "answer_id": 252705, "author": "Harley Holcombe", "author_id": 1057, "author_profile": "...
2008/10/31
[ "https://Stackoverflow.com/questions/252703", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15055/" ]
252,729
<p>i'm trying to make the following routes .. and currently i'm going about this in a <em>really</em> long way.. ie. one route instance for EACH route.</p> <p>this is what i'm after... (assuming i'm doing a 'stackoverflow website')</p> <pre><code>/ &lt;-- root site /page/{page} &lt;-- root site, but to the page of questions. /tag/{tag}/page/{page} &lt;-- as above, but the questions are filtered by tag /question/ask &lt;-- this page :P /question/{subject} &lt;-- reading about a question </code></pre> <p>(and no.. i'm most definitely not doing a stackoverflow website :) )</p> <p>cheers!</p> <p>(gawd i find dis all so confusing at times).</p>
[ { "answer_id": 260131, "author": "Haacked", "author_id": 598, "author_profile": "https://Stackoverflow.com/users/598", "pm_score": 3, "selected": true, "text": "routes.MapRoute(\"page-tag\", \"tag/{tag}/page/{page}\", new {controller=\"question\", action=\"FilterByTag\"});\n" } ]
2008/10/31
[ "https://Stackoverflow.com/questions/252729", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30674/" ]
252,735
<p>I have made a bunch of changes to a number of files in a project. Every commit (usually at the file level) was accompanied by a comment of what was changed. </p> <p>Is there a way to get a list from CVS of these comments on changes since the last tagged version?</p> <p>Bonus if I can do this via the eclipse CVS plugin.</p> <p><strong>UPDATE</strong>: I'd love to accept an answer here, but unfortunately none of the answers are what I am looking for. Frankly I don' think it is actually possible, which is a pity really as this could be a great way to create a change list between versions (Assuming all commits are made at a sensible granularity and contain meaningful comments).</p>
[ { "answer_id": 252801, "author": "Louis Gerbarg", "author_id": 30506, "author_profile": "https://Stackoverflow.com/users/30506", "pm_score": 3, "selected": false, "text": "cvs log -rVERSION_1_0:\n" }, { "answer_id": 254100, "author": "Alex B", "author_id": 6180, "auth...
2008/10/31
[ "https://Stackoverflow.com/questions/252735", "https://Stackoverflow.com", "https://Stackoverflow.com/users/939/" ]
252,748
<p>How should I use array of function pointers in C?</p> <p>How can I initialize them?</p>
[ { "answer_id": 252750, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 8, "selected": false, "text": "int sum(int a, int b);\nint subtract(int a, int b);\nint mul(int a, int b);\nint div(int a, int b);\n\nint (*p[4]) (int x, int ...
2008/10/31
[ "https://Stackoverflow.com/questions/252748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
252,766
<p>How can I add line numbers to a range of lines in a file opened in Vim? Not as in <code>:set nu</code>—this just <em>displays</em> line numbers—but actually have them be prepended to each line in the file?</p>
[ { "answer_id": 252770, "author": "Jerub", "author_id": 14648, "author_profile": "https://Stackoverflow.com/users/14648", "pm_score": 5, "selected": false, "text": "cat -n" }, { "answer_id": 252774, "author": "VonC", "author_id": 6309, "author_profile": "https://Stacko...
2008/10/31
[ "https://Stackoverflow.com/questions/252766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31641/" ]
252,780
<p>I have seen many programs consisting of structures like the one below</p> <pre><code>typedef struct { int i; char k; } elem; elem user; </code></pre> <p>Why is it needed so often? Any specific reason or applicable area?</p>
[ { "answer_id": 252783, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 6, "selected": false, "text": "typedef" }, { "answer_id": 252810, "author": "unwind", "author_id": 28169, "author_profile": "https:/...
2008/10/31
[ "https://Stackoverflow.com/questions/252780", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31116/" ]
252,782
<p>What is the purpose of the <code>strdup()</code> function in C?</p>
[ { "answer_id": 252786, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 4, "selected": false, "text": "strdup()" }, { "answer_id": 252802, "author": "paxdiablo", "author_id": 14860, "author_profile": "https://S...
2008/10/31
[ "https://Stackoverflow.com/questions/252782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31116/" ]
252,785
<p>What is the difference between <code>IQueryable&lt;T&gt;</code> and <code>IEnumerable&lt;T&gt;</code>?</p> <hr> <p>See also <a href="https://stackoverflow.com/questions/2433306/whats-the-difference-between-iqueryable-and-ienumerable?rq=1">What's the difference between IQueryable and IEnumerable</a> that overlaps with this question.</p>
[ { "answer_id": 252789, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 8, "selected": false, "text": "IQueryable<T>" }, { "answer_id": 252857, "author": "Mark Cidade", "author_id": 1659, "author_profile": "htt...
2008/10/31
[ "https://Stackoverflow.com/questions/252785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
252,800
<p>I have the need to display a nested set structure in HTML. I am doing it with the following partial:</p> <pre><code>&lt;ul&lt;%= ' id="tree"' if depth == 0 %&gt;&gt; &lt;% items.each do |item| %&gt; &lt;li id="node_&lt;%= item.id %&gt;"&gt;&lt;a&gt;&lt;%= item.name %&gt;&lt;/a&gt; &lt;% if item.has_children? %&gt; &lt;%= render :partial =&gt; 'tree_level', :locals =&gt; {:items =&gt; item.children, :depth =&gt; depth + 1} %&gt; &lt;% end %&gt; &lt;/li&gt; &lt;% end %&gt; &lt;/ul&gt; </code></pre> <p>Is this the best place to have the code? I "feel" like there should be a <code>to_html</code> method on the object which dumps the entire tree structure for me, though this works.</p>
[ { "answer_id": 252829, "author": "Jarek", "author_id": 33013, "author_profile": "https://Stackoverflow.com/users/33013", "pm_score": 2, "selected": false, "text": "def render_node(node)\n res = \"<ul>\"\n ...\n node.items.each {|n| res << render_node(n)}\n ...\n res << \"</ul>\"\n ...
2008/10/31
[ "https://Stackoverflow.com/questions/252800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17453/" ]
252,811
<p>Does anyone know of a simple method for solving this?</p> <p>I have a table which consists of start times for events and the associated durations. I need to be able to split the event durations into thirty minute intervals. So for example if an event starts at 10:45:00 and the duration is 00:17:00 then the returned set should allocate 15 minutes to the 10:30:00 interval and 00:02:00 minutes to the 11:00:00 interval.</p> <p>I'm sure I can figure out a clumsy approach but would like something a little simpler. This must come up quite often I'd imagine but Google is being unhelpful today.</p> <p>Thanks,</p> <p>Steve</p>
[ { "answer_id": 252854, "author": "Ady", "author_id": 31395, "author_profile": "https://Stackoverflow.com/users/31395", "pm_score": 2, "selected": false, "text": "create table #interval_lookup (\n from_date datetime,\n to_date datetime\n)\n\ndeclare @time datetime\nset @time = '00:00:00...
2008/10/31
[ "https://Stackoverflow.com/questions/252811", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
252,817
<p>Just out of curiosity:</p> <p>I know I can tell the compiler if I want a value to be interpreted as a certain numeric type, e.g. as Integer (32 bit signed), this way appending an "I" (type character) to the constant value:</p> <pre><code>Private Function GetTheAnswerAsInteger() As Integer Return 42I End Function </code></pre> <p>There's also "S" for Short, "D" for Decimal, etc.</p> <p>But what is the <strong>suffix for Byte</strong>? Hint: it's not the obvious one "B"...</p>
[ { "answer_id": 20710408, "author": "Yuriy Galanter", "author_id": 961695, "author_profile": "https://Stackoverflow.com/users/961695", "pm_score": 3, "selected": false, "text": "Imports System.Runtime.CompilerServices\n\nModule IntegerExtensions\n\n <Extension()> _\n Public Function...
2008/10/31
[ "https://Stackoverflow.com/questions/252817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6461/" ]
252,820
<p>Is it possible to have something like a <code>JTextArea</code> which will color some keywords based on some mappings I have ?</p>
[ { "answer_id": 252833, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 3, "selected": true, "text": "JTextArea" } ]
2008/10/31
[ "https://Stackoverflow.com/questions/252820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31610/" ]
252,848
<p>I tried this step:</p> <p>Select the menu options "Project > New Build Phase > New Run Script Build Phase", and enter the following script (don't forget to replace /Users/youruser/bin by the correct path to gen_entitlements.py) :</p> <pre><code>export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate if [ "${PLATFORM_NAME}" == "iphoneos" ]; then /Users/youruser/bin/gen_entitlements.py "my.company.${PROJECT_NAME}" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent"; codesign -f -s "iPhone developer" --resource-rules "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/ResourceRules.plist" \ --entitlements "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/" fi </code></pre> <p>(from <a href="http://www.246tnt.com/iPhone/#xcode" rel="noreferrer">link</a>)</p> <p>Now I want to remove this script from my project. How do I remove the "Run Script Build Phase" build phase from Xcode?</p>
[ { "answer_id": 48738485, "author": "Lance Samaria", "author_id": 4833705, "author_profile": "https://Stackoverflow.com/users/4833705", "pm_score": 1, "selected": false, "text": "Build Phases" } ]
2008/10/31
[ "https://Stackoverflow.com/questions/252848", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16066/" ]
252,856
<pre><code>div#thing { position: absolute; top: 0px; z-index: 2; margin: 0 auto; } &lt;div id="thing"&gt; &lt;p&gt;text text text with no fixed size, variable font&lt;/p&gt; &lt;/div&gt; </code></pre> <p>The div is at the top, but I can't center it with <code>&lt;center&gt;</code> or <code>margin: 0 auto</code>;</p>
[ { "answer_id": 252872, "author": "JacobE", "author_id": 30056, "author_profile": "https://Stackoverflow.com/users/30056", "pm_score": 8, "selected": true, "text": "div" }, { "answer_id": 447113, "author": "Community", "author_id": -1, "author_profile": "https://Stacko...
2008/10/31
[ "https://Stackoverflow.com/questions/252856", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21559/" ]
252,865
<p>"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." (Donald Knuth). My SQL tables are unlikely to contain more than a few thousand rows each (and those are the big ones!). SQL Server Database Engine Tuning Advisor dismisses the amount of data as irrelevant. So I shouldn't even think about putting explicit indexes on these tables. Correct?</p>
[ { "answer_id": 252952, "author": "Timothy Khouri", "author_id": 11917, "author_profile": "https://Stackoverflow.com/users/11917", "pm_score": 3, "selected": false, "text": "SELECT * FROM MySmallTable <-- No worries... Index won't help\n\nSELECT\n *\nFROM\n MyBigTable INNER JOIN MyS...
2008/10/31
[ "https://Stackoverflow.com/questions/252865", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15354/" ]
252,882
<p>There are a couple of questions similar to this on stack overflow but not quite the same.</p> <p>I want to open, or create, a local group on a win xp computer and add members to it, domain, local and well known accounts. I also want to check whether a user is already a member so that I don't add the same account twice, and presumably get an exception.</p> <p>So far I started using the DirectoryEntry object with the <code>WinNT://</code> provider. This is going ok but I'm stuck on how to get a list of members of a group?</p> <p>Anyone know how to do this? Or provide a better solution than using DirectoryEntry?</p>
[ { "answer_id": 252890, "author": "Tim Robinson", "author_id": 32133, "author_profile": "https://Stackoverflow.com/users/32133", "pm_score": 1, "selected": false, "text": "\"member\"" }, { "answer_id": 252892, "author": "splattne", "author_id": 6461, "author_profile": ...
2008/10/31
[ "https://Stackoverflow.com/questions/252882", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21429/" ]
252,891
<p>Am I allowed to place <code>&lt;noscript&gt;</code> in the <code>&lt;head&gt;</code>?</p>
[ { "answer_id": 8595670, "author": "Kevin C.", "author_id": 193494, "author_profile": "https://Stackoverflow.com/users/193494", "pm_score": 4, "selected": false, "text": "<head>" }, { "answer_id": 58421249, "author": "Luke", "author_id": 1716905, "author_profile": "htt...
2008/10/31
[ "https://Stackoverflow.com/questions/252891", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21559/" ]
252,893
<p>How do you change the CLASSPATH of a Java process from within the Java process?</p> <hr> <p>Before you ask me "Why would you want to do that?" I'll explain it shortly. </p> <blockquote> <p>When you have a Clojure REPL running it is common to need more jars in your CLASSPATH to load a <a href="http://clojure.org" rel="noreferrer">Clojure</a> source file, and I'd like to do it without having to restart Clojure itself (which is not really an option when using it on Slime on Emacs).</p> </blockquote> <p>That's the reason but I don't want this question tagged as some-weird-language some-weird-editor and be disregarded by the majority of Java developers that may have the answer.</p>
[ { "answer_id": 252967, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 7, "selected": true, "text": "java.lang.ClassLoader" }, { "answer_id": 19293096, "author": "Akhi Youngisthan", "author_id": 2834852, "auth...
2008/10/31
[ "https://Stackoverflow.com/questions/252893", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6068/" ]
252,897
<p>I am developing an application that needs to use regini (because of legacy reasons) to insert something into the registry. I have been trying to do this in such a way the the user of the application is not aware of this. I have written the following code:</p> <pre><code>System.Diagnostics.ProcessStartInfo pi = new ProcessStartInfo(); pi.FileName = @"c:\windows\system32\regini.exe"; pi.Arguments = name; pi.WorkingDirectory = Utils.AppSettings.WorkingDirectory.ToString(); pi.WindowStyle = ProcessWindowStyle.Hidden; pi.RedirectStandardError = true; pi.RedirectStandardOutput = true; pi.UseShellExecute = false; Process p = new Process(); p.StartInfo = pi; p.EnableRaisingEvents = true; p.Start(); </code></pre> <p>Unfortunately, I still see the 'command' window pop-up every time this code is executed. I was under the impression that </p> <pre><code>pi.WindowStyle = ProcessWindowStyle.Hidden; </code></pre> <p>would prevent that. How can I prevent regini from opening its own command window? </p>
[ { "answer_id": 253098, "author": "splattne", "author_id": 6461, "author_profile": "https://Stackoverflow.com/users/6461", "pm_score": 3, "selected": true, "text": "pi.CreateNoWindow = true;\n" } ]
2008/10/31
[ "https://Stackoverflow.com/questions/252897", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32522/" ]
252,906
<p>Anyone got an idea how to get from an Xserver the list of all open windows?</p>
[ { "answer_id": 252911, "author": "Alnitak", "author_id": 6782, "author_profile": "https://Stackoverflow.com/users/6782", "pm_score": 8, "selected": true, "text": "xwininfo -tree -root\n" }, { "answer_id": 1017932, "author": "Marten", "author_id": 125739, "author_profi...
2008/10/31
[ "https://Stackoverflow.com/questions/252906", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4172/" ]
252,907
<p>I have two PHP scripts, both using the same session by calling <code>session_name('MySessID')</code>.</p> <p>When the first script calls the second script using curl, the second script hangs when <code>session_start()</code> is called.</p> <p>Why would this happend?</p>
[ { "answer_id": 252958, "author": "Jrgns", "author_id": 6681, "author_profile": "https://Stackoverflow.com/users/6681", "pm_score": 4, "selected": true, "text": "session_commit" }, { "answer_id": 470333, "author": "Tom", "author_id": 42754, "author_profile": "https://S...
2008/10/31
[ "https://Stackoverflow.com/questions/252907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6681/" ]
252,915
<p>How to send array in Httpservice in Adobe Flex3</p>
[ { "answer_id": 435524, "author": "bartv", "author_id": 51371, "author_profile": "https://Stackoverflow.com/users/51371", "pm_score": 3, "selected": false, "text": "var service:HTTPService = new HTTPService();\nservice.useProxy = true;\nservice.destination = \"myservicet\";\nservice.resul...
2008/10/31
[ "https://Stackoverflow.com/questions/252915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33016/" ]
252,917
<p>I feel that using GetEnumerator() and casting IEnumerator.Current is expensive. Any better suggestions?<br/><br/> I'm open to using a different data structure if it offers similiar capabilities with better performance.</p> <p><strong>After thought:</strong><br/> Would a generic stack be a better idea so that the cast isn't necessary?</p>
[ { "answer_id": 252944, "author": "Timothy Khouri", "author_id": 11917, "author_profile": "https://Stackoverflow.com/users/11917", "pm_score": 3, "selected": false, "text": "Stack<MyClass> stacky = new Stack<MyClass>();\n\nforeach (MyClass item in stacky)\n{\n // this is as fast as you...
2008/10/31
[ "https://Stackoverflow.com/questions/252917", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17540/" ]
252,921
<p>Magento shopping cart is built on the Zend Framework in PHP. This is the first time I've dealt with the Zend framework and I'm having the following difficulty...</p> <p>I'm creating a custom module that will allow users to upload images whenever they purchase products. </p> <p>I can overload the addAction() method whenever a user attempts to add a product to their cart. I can also create a custom module which presents the form to the user and accepts the file(s). However I'm not sure how to insert the code to run my module into my overloaded method:</p> <pre><code>&lt;?php require_once 'Mage/Checkout/controllers/CartController.php'; class Company_SpecialCheckout_Checkout_CartController extends Mage_Checkout_CartController { # Overloaded addAction public function addAction() { # when user tries to add to cart, request images from them # ********* # *** what do i do in here to display a custom block ???? ### # *** and allow addAction to continue only if successfully validated form input ### # ********* parent::addAction(); } } </code></pre> <p>I suspect my difficulties come from my lack of knowledge of the Zend MVC way of doing things. I've studied all the Magento documentation/wikis/forum threads from top to bottom.</p>
[ { "answer_id": 258573, "author": "Simon", "author_id": 33036, "author_profile": "https://Stackoverflow.com/users/33036", "pm_score": 2, "selected": false, "text": " <?PHP\nrequire_once 'Mage/Checkout/controllers/CartController.php';\nclass Company_SpecialCheckout_Checkout_CartControll...
2008/10/31
[ "https://Stackoverflow.com/questions/252921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17492/" ]
252,924
<p>This is a simple one. I want to replace a sub-string with another sub-string on client-side using Javascript.</p> <p>Original string is <code>'original READ ONLY'</code></p> <p>I want to replace the <code>'READ ONLY'</code> with <code>'READ WRITE'</code></p> <p>Any quick answer please? Possibly with a javascript code snippet...</p>
[ { "answer_id": 252928, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 4, "selected": false, "text": "<script type=\"text/javascript\">\n\nvar str1=\"Visit Microsoft!\";\nvar str2 = str1.replace(/microsoft/i, \"W3Schoo...
2008/10/31
[ "https://Stackoverflow.com/questions/252924", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13370/" ]
252,945
<p>I am creating a plugin for Eclipse 3.4. I created a plug-in development project using the application with a view. Now I am trying to create a <code>TextViewer</code> the documentation says that it is located in <code>org.eclipse.jface.text.TextViewer</code>. But, this whole package is missing and eclipse cannot locate <code>TextViewer</code> class to import. I want to know why is this package/class missing? Also if it is really gone what took <code>TextViewer</code>'s place?</p>
[ { "answer_id": 253132, "author": "McDowell", "author_id": 304, "author_profile": "https://Stackoverflow.com/users/304", "pm_score": 3, "selected": false, "text": "Require-Bundle: org.eclipse.ui,\n org.eclipse.core.runtime,\n org.eclipse.jface.text\n" } ]
2008/10/31
[ "https://Stackoverflow.com/questions/252945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5004/" ]
252,955
<p>Is there a way to "stream" a set of results (eg. a DataTable) from a BackgroundWorker to a DataGridView. What I want to do is to query data, and fill the results in a DataGridView <strong>as they come</strong> (like query grid results in SQL Server Management Studio). My first thought was to use a BackgroundWorker (to avoid the UI freeze effect), but there would still be a perceivable "lag" as the BackgroundWorker is loading the results.</p> <p>What would be the best way to go about this?</p>
[ { "answer_id": 257554, "author": "Timothy Khouri", "author_id": 11917, "author_profile": "https://Stackoverflow.com/users/11917", "pm_score": 1, "selected": false, "text": "myDataGridView.Rows[rowNumber].SetValues(valuesFromNewPage);\n" }, { "answer_id": 426226, "author": "Co...
2008/10/31
[ "https://Stackoverflow.com/questions/252955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18731/" ]
252,957
<p>I know we can do like mget *.xml which will download all xml files. But how is it possible that we using mget with certain file name patterns. can we do something like *SS.xml which mean it will download all files ending with SS.xml?</p>
[ { "answer_id": 252960, "author": "Alnitak", "author_id": 6782, "author_profile": "https://Stackoverflow.com/users/6782", "pm_score": 1, "selected": false, "text": "mget" } ]
2008/10/31
[ "https://Stackoverflow.com/questions/252957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
252,962
<p>We have a file that has a 64 bit integer as a string in it. How do we scanf() or otherwise parse this numeric string into an unsigned 64 bit integer type in C++ ? </p> <p>We are aware of things like %lld etc., but a lot of ways to do this parse seem to break compiles under different compilers and stdlibs. The code should compile under gcc and the Microsoft C++ compiler (of course full compliance with standards would be a plus)</p>
[ { "answer_id": 252965, "author": "Alnitak", "author_id": 6782, "author_profile": "https://Stackoverflow.com/users/6782", "pm_score": 1, "selected": false, "text": "scanf()" }, { "answer_id": 252979, "author": "unwind", "author_id": 28169, "author_profile": "https://St...
2008/10/31
[ "https://Stackoverflow.com/questions/252962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19734/" ]
252,963
<p>How can I use Hyperlink button in gridview. I mean when I run my program,all data is displayed in gridview,but I want hyperlink in gridview, so that when I will click in hyperlink it will show the select path which is in gridview : if there is pdf file path and I just click on this hyper link then I can see the pdf file.</p> <p>Can you tell me how can I do this? </p>
[ { "answer_id": 252984, "author": "Eoin Campbell", "author_id": 30155, "author_profile": "https://Stackoverflow.com/users/30155", "pm_score": 1, "selected": false, "text": "<asp:TemplateField HeaderText=\"Link\" SortExpression=\"PdfUrl\">\n <itemtemplate>\n <asp:HyperLink runat=...
2008/10/31
[ "https://Stackoverflow.com/questions/252963", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
252,972
<p>Please forgive my long question. I have an idea for a design that I could use some comments on. Is it a good idea to do this? And what are the pit falls I should be aware of? Are there other similar implementations that are better?</p> <p><strong>My situation is as follows:</strong><br> I am working on a rewrite of a windows forms application that connects to a SQL 2008 (earlier it was SQL 2005) server. The application is an "expert-system" for an engineering company where we store structured data about constructions. We have control of all installations of the client software, we have no external customers or users, they are all internal to the company, and they are all be trusted not to do anything malicious to the software or database.</p> <p>The current design doesn't have too many tables (about 10 - 20) but some of them have millions of records that belong to several hundred constructions. The systems performance has been ok so far, but it is starting to degrade as we are pushing the limits of the design. </p> <p>As part of the rewrite I am considering splitting the database into one master database and several "child" databases where each describes one construction. Each child database should be of identical design. This should eliminate the performance problems we are seeing today since the data stored in each database would be less than one percent of the total data amount. </p> <p>My concern is that instead of maintaining one database we will now get hundreds of databases that must be kept up to date. The system is constantly evolving as the companys requirements change (you know how it is), and while we try to look forward to reduce the number of changes the changes will come. So we will need a system where we keep track of all database changes done to the system so they can be applied to the child databases. Updating the client application won't be a problem, we have good control of that aspect.</p> <p>I am thinking of a change tracing system where we store database scripts for all changes in a table in the master database. We can then give each change a version number and we can store a current version number in each child database. When the client program connects to a child database we can then check the version number of the database against the current version number of the master database and if there are patches with version numbers greater than the version number of the child database we run these and update the child database to the latest version. </p> <p>As I see it this should work well. Any changes to the system will first be tested and validated before committed as a new version of the database. The change will then be applied to the database the first time a user opens it. I suppose we would open the database in exclusive mode while applying the changes, but as long as the changes aren't too frequent this should not be a problem.</p> <p>So what do you think? Will this work? Have any of you done something similar? Should we scrap the solution and go for the monolithic system instead?</p>
[ { "answer_id": 253024, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": true, "text": "def change103(...):\n \"Create new table.\"\ndef change104(...):\n \"\"\"Transfer data from old table to new table and ma...
2008/10/31
[ "https://Stackoverflow.com/questions/252972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30366/" ]
252,974
<p>I would like to hear some opinions about using the isolated storage in Silverlight for storing sensitive data. For example, is it OK to store an authentication token (some GUID that identifies a server-side session) in this storage, or is it better to use cookies?</p> <p>The isolated storage gives an advantage over cookies in that it is shared across browsers, but it might be more difficult to handle expiry, and there might be some other issues (security?) that I am not aware of.</p> <p>So... what are your opinions? Or do you know any great articles about the topic?</p> <p>Thanks, Jacob</p>
[ { "answer_id": 253024, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": true, "text": "def change103(...):\n \"Create new table.\"\ndef change104(...):\n \"\"\"Transfer data from old table to new table and ma...
2008/10/31
[ "https://Stackoverflow.com/questions/252974", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30056/" ]
252,976
<p>How can I create a query for a full outer join across a M2M relationchip using the django QuerySet API?</p> <p>It that is not supported, some hint about creating my own manager to do this would be welcome.</p> <p><strong>Edited to add:</strong> @S.Lott: Thanks for the enlightenment. The need for the OUTER JOIN comes from the application. It has to generate a report showing the data entered, even if it still incomplete. I was not aware of the fact that the result would be a new class/model. Your hints will help me quite a bit.</p>
[ { "answer_id": 253057, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 5, "selected": true, "text": "for obj in Model1.objects.all():\n if obj.model2_set().count() == 0:\n # process (obj, None) -- no Model2 associat...
2008/10/31
[ "https://Stackoverflow.com/questions/252976", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11527/" ]
252,988
<p>How to get all the database names and corresponding table names together ?</p>
[ { "answer_id": 253003, "author": "Hapkido", "author_id": 27646, "author_profile": "https://Stackoverflow.com/users/27646", "pm_score": 0, "selected": false, "text": "SELECT Name FROM master.sys.databases\n" }, { "answer_id": 253042, "author": "Timothy Khouri", "author_id"...
2008/10/31
[ "https://Stackoverflow.com/questions/252988", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
253,013
<p>We use a simple object model for our low level networking code at work where struct pointers are passed around to functions which are pretending to be methods. I've inherited most of this code which was written by consultants with passable C/C++ experience at best and I've spent many late nights trying to refactor code into something that would resemble a reasonable structure.</p> <p>Now I would like to bring the code under unit testing but considering the object model we have chosen I have no idea how to mock objects. See the example below:</p> <p>Sample header (foo.h):</p> <pre><code>#ifndef FOO_H_ #define FOO_H_ typedef struct Foo_s* Foo; Foo foo_create(TcpSocket tcp_socket); void foo_destroy(Foo foo); int foo_transmit_command(Foo foo, enum Command command); #endif /* FOO_H_ */ </code></pre> <p>Sample source (foo.c):</p> <pre><code>struct Foo_s { TcpSocket tcp_socket; }; Foo foo_create(TcpSocket tcp_socket) { Foo foo = NULL; assert(tcp_socket != NULL); foo = malloc(sizeof(struct Foo_s)); if (foo == NULL) { goto fail; } memset(foo, 0UL, sizeof(struct Foo_s)); foo-&gt;tcp_socket = tcp_socket; return foo; fail: foo_destroy(foo); return NULL; } void foo_destroy(Foo foo) { if (foo != NULL) { tcp_socket_destroy(foo-&gt;tcp_socket); memset(foo, 0UL, sizeof(struct Foo_s)); free(foo); } } int foo_transmit_command(Foo foo, enum Command command) { size_t len = 0; struct FooCommandPacket foo_command_packet = {0}; assert(foo != NULL); assert((Command_MIN &lt;= command) &amp;&amp; (command &lt;= Command_MAX)); /* Serialize command into foo_command_packet struct */ ... len = tcp_socket_send(foo-&gt;tcp_socket, &amp;foo_command_packet, sizeof(foo_command_packet)); if (len &lt; sizeof(foo_command_packet)) { return -1; } return 0; } </code></pre> <p>In the example above I would like to mock the <em>TcpSocket</em> object so that I can bring <em>"foo_transmit_command"</em> under unit testing but I'm not sure how to go about this without inheritance. I don't really want to redesign the code to use vtables unless I really have to. Maybe there is a better approach to this than mocking?</p> <p>My testing experience comes mainly from C++ and I'm a bit afraid that I might have painted myself into a corner here. I would highly appreciate any recommendations from more experienced testers.</p> <p>Edit:<br> Like Richard Quirk pointed out it is really the call to <em>"tcp_socket_send"</em> that I want to override and I would prefer to do it without removing the real tcp_socket_send symbol from the library when linking the test since it is called by other tests in the same binary.</p> <p>I'm starting to think that there is no obvious solution to this problem..</p>
[ { "answer_id": 253119, "author": "qrdl", "author_id": 28494, "author_profile": "https://Stackoverflow.com/users/28494", "pm_score": 0, "selected": false, "text": "struct Foo_s" }, { "answer_id": 253265, "author": "Ilya", "author_id": 6807, "author_profile": "https://S...
2008/10/31
[ "https://Stackoverflow.com/questions/253013", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22247/" ]
253,026
<p>I used a class which derives from <code>CListBox</code>, and create it with following:</p> <pre><code>style:WS_CHILD|WS_VISIBLE |LBS_OWNERDRAWFIXED | WS_VSCROLL | WS_HSCROLL </code></pre> <p>I expect the ListBox's item to be have a fixed size, not affected by the size of the list box. So I override the MeasureItem() method, in which I specify the item's size like below:</p> <pre><code>void CMyListBox::MeasureItem(LPMEASUREITEMSTRUCT lpMIS) { lpMIS-&gt;itemHeight = ALBUM_ITEM_HEIGHT; lpMIS-&gt;itemWidth = ALBUM_ITEM_WIDTH; } </code></pre> <p>But the item's size changes according to the List box's size changing. is there anything wrong with my approach?</p>
[ { "answer_id": 253201, "author": "Stu Mackellar", "author_id": 28591, "author_profile": "https://Stackoverflow.com/users/28591", "pm_score": 0, "selected": false, "text": "MSDN" }, { "answer_id": 1125905, "author": "macbirdie", "author_id": 5049, "author_profile": "ht...
2008/10/31
[ "https://Stackoverflow.com/questions/253026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26404/" ]
253,030
<p>If you want to some code to execute based on two or more conditions which is the best way to format that if statement ?</p> <p>first example:-</p> <pre><code>if(ConditionOne &amp;&amp; ConditionTwo &amp;&amp; ConditionThree) { Code to execute } </code></pre> <p>Second example:-</p> <pre><code>if(ConditionOne) { if(ConditionTwo ) { if(ConditionThree) { Code to execute } } } </code></pre> <p>which is easiest to understand and read bearing in mind that each condition may be a long function name or something.</p>
[ { "answer_id": 253047, "author": "Torbjørn", "author_id": 22621, "author_profile": "https://Stackoverflow.com/users/22621", "pm_score": 5, "selected": false, "text": "if(MyChecksAreOk()) { Code to execute }\n\n...\n\nprivate bool MyChecksAreOk()\n{ \n return ConditionOne && ConditionT...
2008/10/31
[ "https://Stackoverflow.com/questions/253030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
253,036
<p>I have WPF ListBox which is bound to a ObservableCollection, when the collection changes, all items update their position.</p> <p>The new position is stored in the collection but the UI does not update. So I added the following:</p> <pre><code> void scenarioItems_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { ToolboxListItem.UpdatePositions(); lstScenario.ItemsSource = null; lstScenario.ItemsSource = ToolboxListItem.ScenarioItems; this.lstScenario.SelectedIndex = e.NewStartingIndex; } </code></pre> <p>By setting the ItemsSource to null and then binding it again, the UI is updated,</p> <p>but this is probably very bad coding :p</p> <p>Suggestions?</p>
[ { "answer_id": 253298, "author": "Gishu", "author_id": 1695, "author_profile": "https://Stackoverflow.com/users/1695", "pm_score": 7, "selected": true, "text": "List<MyCustomType>()" }, { "answer_id": 1851824, "author": "rolling", "author_id": 225348, "author_profile"...
2008/10/31
[ "https://Stackoverflow.com/questions/253036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28149/" ]
253,038
<p>I'm having a bit of a problem. I have a datatable in the parent form. I open a dialogbox form that gets the datatable property and creates a checkboxlist. This will be used to export those columns. But when I run the application the parentform property is null. I've tried setting it in the parent and dialogbox form (I assumed this would have been done automagically if ShowDialog() was called).</p> <p>Can someone take a look and see where I'm going wrong? From the dialogbox:</p> <pre><code>frmParent MyParentForm = (frmParent)this.ParentForm; for (int i=0; i&lt;MyParentForm.DataGridTable.Count; i++) { chkListExportItems.Add(MyParentForm.DataGrid.Columns[i].Name,true); } </code></pre> <p>From the parent form:</p> <pre><code>frmExports MyForm = new frmExports(); MyForm.MdiParent = this; if (MyForm.ShowDialog == DialogResult.OK) { MyForm.SelectedItems // Do something } </code></pre>
[ { "answer_id": 253298, "author": "Gishu", "author_id": 1695, "author_profile": "https://Stackoverflow.com/users/1695", "pm_score": 7, "selected": true, "text": "List<MyCustomType>()" }, { "answer_id": 1851824, "author": "rolling", "author_id": 225348, "author_profile"...
2008/10/31
[ "https://Stackoverflow.com/questions/253038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5906/" ]
253,051
<p>I've been teaching myself Objective-C over the past month or so (I'm a Java head) and I've got my brain wrapped around most of it now. One thing that's confusing me at the moment: What's the difference between importing a class via @class vs doing a #import? </p> <p>Is one better than another one, or do I need to use one instead of the other in certain cases? I've been using just #import so far.</p>
[ { "answer_id": 253154, "author": "Ben Gottlieb", "author_id": 6694, "author_profile": "https://Stackoverflow.com/users/6694", "pm_score": 7, "selected": true, "text": "#import" }, { "answer_id": 253550, "author": "Dave Dribin", "author_id": 26825, "author_profile": "h...
2008/10/31
[ "https://Stackoverflow.com/questions/253051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6044/" ]
253,055
<p>When I've worked a bit with my source code, I did my usual thing commit and then I pushed to a remote repository. But then I noticed I forgot to organize my imports in the source code. So I do the amend command to replace the previous commit:</p> <pre><code>&gt; git commit --amend </code></pre> <p>Unfortunately the commit can't be pushed back to the repository. It is rejected like this:</p> <pre><code>&gt; git push origin To //my.remote.repo.com/stuff.git/ ! [rejected] master -&gt; master (non-fast forward) error: failed to push some refs to '//my.remote.repo.com/stuff.git/' </code></pre> <p>What should I do? (I can access the remote repository.)</p>
[ { "answer_id": 253726, "author": "mipadi", "author_id": 28804, "author_profile": "https://Stackoverflow.com/users/28804", "pm_score": 7, "selected": false, "text": "git commit --amend" }, { "answer_id": 255080, "author": "CB Bailey", "author_id": 19563, "author_profil...
2008/10/31
[ "https://Stackoverflow.com/questions/253055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3713/" ]
253,058
<p>Today I happens to find that one C# class can inherit one interface both in implicit and explicit way. This surprises me. If C# works in this way, then one instance can behave differently when referenced in different way.</p> <pre><code>interface IFoo { void DoSomething(); } class Foo : IFoo { #region IFoo Members public void DoSomething() { Console.WriteLine("do something implicitly"); } #endregion #region IFoo Members void IFoo.DoSomething() { Console.WriteLine("do something explicitly"); } #endregion } Foo f = new Foo(); f.DoSomething(); ((IFoo)f).DoSomething(); </code></pre> <p>Above code runs and output</p> <pre><code>do something implicitly do something explicitly </code></pre> <p>I believe that this design of C# make inconsistency of behavior. Perhaps it is mandatory that one C# class can inherit from one interface in implicit or expliict way, but not both. </p> <p>Is there any reason that why C# is designed in such a way?</p>
[ { "answer_id": 253079, "author": "François", "author_id": 32379, "author_profile": "https://Stackoverflow.com/users/32379", "pm_score": 2, "selected": false, "text": " interface IMoveable\n {\n public void Act();\n }\n\n interface IRollable\n {\n public void Act();\n }\n\n c...
2008/10/31
[ "https://Stackoverflow.com/questions/253058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26349/" ]
253,063
<p>Any ideas on how to disable, but not uninstall Resharper 4.x or above?</p>
[ { "answer_id": 344447, "author": "mackenir", "author_id": 25457, "author_profile": "https://Stackoverflow.com/users/25457", "pm_score": 3, "selected": false, "text": "C:\\Program\n Files\\JetBrains\\ReSharper\\v4.0\\Bin\\Product.VisualStudio.80.AddIn" }, { "answer_id": 5200569, ...
2008/10/31
[ "https://Stackoverflow.com/questions/253063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
253,064
<p>Are there any libraries out there (preferably a self contained Text Edit Control) for .NET that have Spell Check capabilities. I would like to add the typical red underline to miss-spelled words in the edit area of my application.</p> <p>Edit: To clarify, this is for WinForms</p>
[ { "answer_id": 26321325, "author": "Steve", "author_id": 3396597, "author_profile": "https://Stackoverflow.com/users/3396597", "pm_score": 2, "selected": false, "text": "using System;\nusing System.ComponentModel;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windo...
2008/10/31
[ "https://Stackoverflow.com/questions/253064", "https://Stackoverflow.com", "https://Stackoverflow.com/users/194/" ]
253,066
<p>How do you debug <a href="http://java.sun.com/javase/6/docs/api/java/lang/ClassLoader.html#getResource(java.lang.String)" rel="noreferrer">getResource</a>-style methods that are failing, returning null?</p> <p>I am sure the file it's looking for is there, but it's returning NULL. How do I know what it is looking for to try to spot any mismatch?</p>
[ { "answer_id": 253448, "author": "matt b", "author_id": 4249, "author_profile": "https://Stackoverflow.com/users/4249", "pm_score": 4, "selected": false, "text": "getResource()" } ]
2008/10/31
[ "https://Stackoverflow.com/questions/253066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6068/" ]
253,075
<p>Is there a csh script/command to list all the files in source source tree which have line endings that show up as "^M" in emacs (under linux).</p> <p>Thanks!</p>
[ { "answer_id": 253084, "author": "C. K. Young", "author_id": 13, "author_profile": "https://Stackoverflow.com/users/13", "pm_score": 0, "selected": false, "text": "find . -type f -exec grep $'\\r' {} +\n" }, { "answer_id": 253111, "author": "Rob Wells", "author_id": 2974,...
2008/10/31
[ "https://Stackoverflow.com/questions/253075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5775/" ]