qid
int64
4
22.2M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
340,943
<p>How would I go about dynamically allocating a multi-dimensional array?</p>
[ { "answer_id": 340970, "author": "eplawless", "author_id": 1370, "author_profile": "https://Stackoverflow.com/users/1370", "pm_score": 2, "selected": false, "text": "int" }, { "answer_id": 340990, "author": "Johannes Schaub - litb", "author_id": 34509, "author_profile...
2008/12/04
[ "https://Stackoverflow.com/questions/340943", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1370/" ]
340,959
<p>I am using ubuntu 8.04 and windows xp. I mount the fat32 disk which contains eclipse workspace to ubuntu. but I find I could not use the workspace, maybe I have no right to use it.</p> <p>the fat32 disk I mounted has the 755 right,I try to use chmod to change it to 777 but failed. I try to mount it to 777 mode, but I find there is nothing about mode in vfat option.</p> <p>How should I do next ? how could I share the workspace? Help me. thanks. </p>
[ { "answer_id": 341763, "author": "jamesh", "author_id": 4737, "author_profile": "https://Stackoverflow.com/users/4737", "pm_score": 1, "selected": false, "text": "rw" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/340959", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41940/" ]
340,972
<p>Py3k <a href="http://mail.python.org/pipermail/python-list/2008-December/518408.html" rel="nofollow noreferrer">just came out</a> and has gobs of <a href="http://docs.python.org/3.0/whatsnew/3.0.html" rel="nofollow noreferrer">neat new stuff</a>! I'm curious, what are SO pythonistas most excited about? What features are going to affect the way you write code on a daily basis, or have you been looking forward to?</p>
[ { "answer_id": 342448, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 2, "selected": false, "text": "<sniff>" }, { "answer_id": 348832, "author": "shsmurfy", "author_id": 2188962, "author_profile": "https...
2008/12/04
[ "https://Stackoverflow.com/questions/340972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41457/" ]
340,981
<p>Is it possible to just send a JPanel or any other component to the printer? Or do I have to implement all the drawing to the graphics object by hand?</p> <p>I have tried to use the Print* functions of the JPanel to print to the graphics object but the page that gets printed is blank.</p>
[ { "answer_id": 341070, "author": "Michael Myers", "author_id": 13531, "author_profile": "https://Stackoverflow.com/users/13531", "pm_score": 1, "selected": false, "text": "Graphics" }, { "answer_id": 342821, "author": "Lawrence Dol", "author_id": 8946, "author_profile...
2008/12/04
[ "https://Stackoverflow.com/questions/340981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34145/" ]
340,983
<p>Is there a better, more jQuery-ish way of handling this image substitution?</p> <pre><code>var image = $(obj).children("img"); if ($(image).attr("src") == "Images/TreeCollapse.gif") $(image).attr("src", "Images/TreeExpand.gif"); else $(image).attr("src", "Images/TreeCollapse.gif"); </code></pre>
[ { "answer_id": 341052, "author": "BigJump", "author_id": 8542, "author_profile": "https://Stackoverflow.com/users/8542", "pm_score": 2, "selected": false, "text": "var image = $(obj).children(\"img\");\n$(image).toggle(\n function () { $(image).attr(\"src\", \"Images/TreeExpand.gif\");}...
2008/12/04
[ "https://Stackoverflow.com/questions/340983", "https://Stackoverflow.com", "https://Stackoverflow.com/users/343/" ]
340,984
<p>Here is a simple overview of my directory layout for my views:</p> <p>Project</p> <ul> <li>Page 1</li> <li>Page 2</li> <li>RSS</li> </ul> <p>Issues</p> <ul> <li>Page 1</li> <li>Page 2</li> <li>RSS</li> </ul> <p>I am using forms authentication to deny access to all unauthenticated users, that works fine. However, I want to be able to grant access to the RSS views to everyone (so they can subscribe via google reader and stuff)</p> <p>I understand that you can grant access to pages by adding the following page to your web.config</p> <pre><code> &lt;location path="TOURPAGE.aspx"&gt; &lt;system.web&gt; &lt;authorization&gt; &lt;allow users="*" /&gt; &lt;allow users="?" /&gt; &lt;/authorization&gt; &lt;/system.web&gt; </code></pre> <p></p> <p>However, how would I do this with my dynamically made URL's, such as:</p> <pre><code>Issues/RSS/chrisj </code></pre> <ul> <li>That path maps to a controller in issues called RSS, which takes a username and spits out an RSS of thier issues...</li> </ul> <p><strong>EDIT</strong></p> <p>Some answers I thought had fixed it, but:</p> <p>It seems that, in my case at least, you still need the authentication cookie in order to see the page. You can be logged out and view it, so long as you have the cookie.</p> <p>That is no good to me, I need the page to be completely public, as it is an RSS feed.</p>
[ { "answer_id": 341023, "author": "Chris James", "author_id": 3193, "author_profile": "https://Stackoverflow.com/users/3193", "pm_score": 2, "selected": false, "text": " <location path=\"Issues/RSS\">\n<system.web>\n <authorization>\n <allow users=\"*\" />\n <allow users=\"?\" />\...
2008/12/04
[ "https://Stackoverflow.com/questions/340984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3193/" ]
340,998
<p>I need to update a group of cells by inserting the same two characters into all of them, but I'm just drawing a blank on how to do this. Could someone point me in the right direction?</p> <p><b>Old Cells</b><br> HI.1 <br> HI.2<br> HII.1</p> <p><b>New Cells</b><br> H08I.1<br> H08I.2<br> H08II.1</p>
[ { "answer_id": 341013, "author": "Tony Andrews", "author_id": 18747, "author_profile": "https://Stackoverflow.com/users/18747", "pm_score": 2, "selected": false, "text": "update cells\nset cell = Replace(cell,'H','H08');\n" }, { "answer_id": 341016, "author": "Michael Haren",...
2008/12/04
[ "https://Stackoverflow.com/questions/340998", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21717/" ]
341,005
<p>Suppose you're maintaining an API that was originally released years ago (before java gained <code>enum</code> support) and it defines a class with enumeration values as ints:</p> <pre><code>public class VitaminType { public static final int RETINOL = 0; public static final int THIAMIN = 1; public static final int RIBOFLAVIN = 2; } </code></pre> <p>Over the years the API has evolved and gained Java 5-specific features (generified interfaces, etc). Now you're about to add a new enumeration:</p> <pre><code>public enum NutrientType { AMINO_ACID, SATURATED_FAT, UNSATURATED_FAT, CARBOHYDRATE; } </code></pre> <p>The 'old style' int-enum pattern has no type safety, no possibility of adding behaviour or data, etc, <em>but it's published and in use</em>. I'm concerned that mixing two styles of enumeration is inconsistent for users of the API.</p> <p>I see three possible approaches:</p> <ul> <li><p>Give up and define the new enum (<code>NutrientType</code> in my fictitious example) as a series of ints like the <code>VitaminType</code> class. You get consistency but you're not taking advantage of type safety and other modern features.</p></li> <li><p>Decide to live with an inconsistency in a published API: keep <code>VitaminType</code> around as is, and add <code>NutrientType</code> as an <code>enum</code>. Methods that take a <code>VitaminType</code> are still declared as taking an int, methods that take a <code>NutrientType</code> are declared as taking such.</p></li> <li><p>Deprecate the <code>VitaminType</code> class and introduce a new <code>VitaminType2</code> enum. Define the new <code>NutrientType</code> as an enum. <br/> Congratulations, for the next 2-3 years until you can kill the deprecated type, you're going to deal with deprecated versions of every single method that took a <code>VitaminType</code> as an int and adding a new <code>foo(VitaminType2 v)</code> version of each. You also need to write tests for each deprecated <code>foo(int v)</code> method as well as its corresponding <code>foo(VitaminType2 v)</code> method, so you just multiplied your QA effort.</p></li> </ul> <p>What is the best approach?</p>
[ { "answer_id": 341066, "author": "Steve B.", "author_id": 19479, "author_profile": "https://Stackoverflow.com/users/19479", "pm_score": 3, "selected": true, "text": "class A\n {\n public static final int MY_CONSTANT=1\n }\n\n class B\n {\n ....\n i+=A.MY...
2008/12/04
[ "https://Stackoverflow.com/questions/341005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24173/" ]
341,018
<p>Is there a way to make a DataGridView have no cell selected? I notice even when it loses focus() it has a at least one active cell. Is there another mode that allows this? or some other trick? </p>
[ { "answer_id": 380161, "author": "David Hall", "author_id": 2660, "author_profile": "https://Stackoverflow.com/users/2660", "pm_score": 3, "selected": false, "text": "DataGridView.CurrentCell = null" }, { "answer_id": 431529, "author": "Community", "author_id": -1, "a...
2008/12/04
[ "https://Stackoverflow.com/questions/341018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36590/" ]
341,039
<p>In <a href="http://msdn.microsoft.com/en-us/library/ms462365.aspx" rel="nofollow noreferrer">CAML</a> I can query SharePoint Listitems using the "Contains"-element, but there is no "does not contain"-element I could use.</p> <p>So what is the best way to get the items that do not contain a string? Is there a better way than to loop through each and every item?</p>
[ { "answer_id": 2382575, "author": "Alex Nolasco", "author_id": 65694, "author_profile": "https://Stackoverflow.com/users/65694", "pm_score": 2, "selected": false, "text": "=ISNUMBER(FIND(\"Critical\"), [Title])\n" }, { "answer_id": 32076800, "author": "Daniel", "author_id...
2008/12/04
[ "https://Stackoverflow.com/questions/341039", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4531/" ]
341,059
<p>We have a process that needs to run every two hours. It's a process that needs to run on it's own thread so as to not interrupt normal processing.</p> <p>When it runs, it will download 100k records and verify them against a database. The framework to run this has a lot of objects managing this process. These objects only need to be around when the process is running.</p> <p>What's a better standard?</p> <ol> <li><p>Keep the thread in wait mode by letting it sleep until I need it again. Or,</p></li> <li><p>Delete it when it is done and create it the next time I need it? (System Timer Events.)</p></li> </ol>
[ { "answer_id": 341135, "author": "Pierre", "author_id": 24449, "author_profile": "https://Stackoverflow.com/users/24449", "pm_score": 4, "selected": true, "text": "thread_join" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/341059", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34183/" ]
341,067
<p>I have an existing database that has some testing data into and I'm interested in turning it into a set of DDL, DML, and DCL files so that I could run it against other database systems and create the same schema and such. The database is MS Access 2003.</p> <p>Thoughts?</p>
[ { "answer_id": 12285392, "author": "Eric G", "author_id": 268977, "author_profile": "https://Stackoverflow.com/users/268977", "pm_score": 2, "selected": false, "text": "```cscript\n\n' ddl.vbs\n' Usage:\n' CScript //Nologo ddl.vbs <input mdb file> > <output>\n'\n' Outputs DDL statements...
2008/12/04
[ "https://Stackoverflow.com/questions/341067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16562/" ]
341,074
<p>Without using plpgsql, I'm trying to urlencode a given text within a pgsql SELECT statement.</p> <p>The problem with this approach:</p> <pre><code>select regexp_replace('héllo there','([^A-Za-z0-9])','%' || encode(E'\\1','hex'),'g') </code></pre> <p>...is that the encode function is not passed the regexp parameter, unless there's another way to call functions from within the replacement expression that actually works. So I'm wondering if there's a replacement expression that, by itself, can encode matches into hex values.</p> <p>There may be other combinations of functions. I thought there would be a clever regex (and that may still be the answer) out there, but I'm having trouble finding it.</p>
[ { "answer_id": 341240, "author": "Kev", "author_id": 16777, "author_profile": "https://Stackoverflow.com/users/16777", "pm_score": 4, "selected": true, "text": "select regexp_replace(encode('héllo there','hex'),'(..)',E'%\\\\1','g');\n" }, { "answer_id": 33616365, "author": "...
2008/12/04
[ "https://Stackoverflow.com/questions/341074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16777/" ]
341,080
<p>I am attempting to get a DropDownList to AutoPostBack via an UpdatePanel when the selected item is changed. I'm going a little stir-crazy as to why this isn't working.</p> <p>Does anyone have any quick ideas?</p> <p>ASPX page:</p> <pre><code>&lt;asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always" ChildrenAsTriggers="true" &gt; &lt;ContentTemplate&gt; &lt;asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" onselectedindexchanged="DropDownList1_SelectedIndexChanged"&gt; &lt;asp:ListItem&gt;item 1&lt;/asp:ListItem&gt; &lt;asp:ListItem&gt;item 2&lt;/asp:ListItem&gt; &lt;/asp:DropDownList&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; </code></pre> <p>Code-behind (I put a breakpoint on the string assignment to capture the postback):</p> <pre><code>protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { string s = ""; } </code></pre> <p><strong>Edit:</strong></p> <p><strong>OK, I have it working now. Very weird. All it took was a restart of Visual Studio. This is the kind of thing that frightens me as a developer ;) I think I've seen similar before, where VS gets "out of sync" wrt the assembly it's running.</strong></p> <p><strong>FYI I am running VS 2008 Web Developer Express.</strong></p> <p><strong>Thanks to those that answered.</strong></p>
[ { "answer_id": 341147, "author": "Programmin Tool", "author_id": 21691, "author_profile": "https://Stackoverflow.com/users/21691", "pm_score": 4, "selected": true, "text": " <asp:ScriptManager ID=\"smMain\" runat=\"server\" />\n\n <asp:UpdatePanel ID=\"UpdatePanel1\" runat=\"server\...
2008/12/04
[ "https://Stackoverflow.com/questions/341080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38522/" ]
341,086
<p>I need advice regarding subselect performance in MySQL. For a reason that I can't change, I am not able to use JOIN to create quesry filter, I can only add another AND clause in WHERE.</p> <p>What is the peformance of:</p> <pre><code>select tasks.* from tasks where some criteria and task.project_id not in (select id from project where project.is_template = 1); </code></pre> <p>compared to:</p> <pre><code>select tasks.* from tasks, project where some criteria and task.project_id = project.id and project.is_template &lt;&gt; 1; </code></pre> <p>Note that there is relatively small number of projects whete is_template = 1, and there could be large number of projects where is_template &lt;> 1.</p> <p>Is there other way to achieve the same result without subselects if I can't change anything but and filter?</p>
[ { "answer_id": 341124, "author": "Rob Prouse", "author_id": 30827, "author_profile": "https://Stackoverflow.com/users/30827", "pm_score": 4, "selected": true, "text": "EXPLAIN select tasks.*\nfrom tasks\nwhere \n some criteria\n and task.project_id not in (select id from project where ...
2008/12/04
[ "https://Stackoverflow.com/questions/341086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31141/" ]
341,103
<p>I have this C# extension method that will extend any dictionary where the <em>Value</em> type is an <em>IList</em>. When I write the equivalent code in VB.Net I get the following compile error:</p> <blockquote> <p><em>"Extension method 'Add' has some type constraints that can never be satisfied".</em></p> </blockquote> <p>I find this really puzzling as the <strong>same</strong> type constraints <strong>can</strong> be satisfied in C#.</p> <p>So my question is this: Why does this not work in VB? Is there a way to make these same type constraints work in VB? Have I made a mistake converting the code? I hope somebody can shed some light on this as I have been scratching my head on this one for a while. :)</p> <p><em>(Incase you are curious the extension method is intended to make it simple to add multiple values into a dictionary under a <strong>single</strong> key (such as multiple orders under one customer). But this is unimportant, I am solely concerned about the puzzling behaviour I am observing in VB).</em></p> <p><strong>Here is the C# Version that works:</strong></p> <pre><code>/// &lt;summary&gt; /// Adds the specified value to the multi value dictionary. /// &lt;/summary&gt; /// &lt;param name="key"&gt;The key of the element to add.&lt;/param&gt; /// &lt;param name="value"&gt;The value of the element to add. The value can be null for reference types.&lt;/param&gt; public static void Add&lt;KeyType, ListType, ValueType&gt;(this Dictionary&lt;KeyType, ListType&gt; thisDictionary, KeyType key, ValueType value) where ListType : IList&lt;ValueType&gt;, new() { //if the dictionary doesn't contain the key, make a new list under the key if (!thisDictionary.ContainsKey(key)) { thisDictionary.Add(key, new ListType()); } //add the value to the list at the key index thisDictionary[key].Add(value); } </code></pre> <p><strong>Here is the VB version that doesn't compile:</strong></p> <pre class="lang-vb prettyprint-override"><code>''' &lt;summary&gt; ''' Adds the specified value to the multi value dictionary. ''' &lt;/summary&gt; ''' &lt;param name="key"&gt;The key of the element to add.&lt;/param&gt; ''' &lt;param name="value"&gt;The value of the element to add. The value can be null for reference types.&lt;/param&gt; &lt;System.Runtime.CompilerServices.Extension()&gt; _ Public Sub Add(Of KeyType, ListType As {IList(Of ValueType), New}, ValueType) _ (ByVal thisDictionary As Dictionary(Of KeyType, ListType), ByVal key As KeyType, ByVal value As ValueType) 'if the dictionary doesn't contain the key, make a new list under the key If Not thisDictionary.ContainsKey(key) Then thisDictionary.Add(key, New ListType()) End If 'add the value to the list at the key index thisDictionary(key).Add(value) End Sub </code></pre>
[ { "answer_id": 341565, "author": "configurator", "author_id": 9536, "author_profile": "https://Stackoverflow.com/users/9536", "pm_score": 4, "selected": true, "text": "<System.Runtime.CompilerServices.Extension()>" }, { "answer_id": 5090485, "author": "Mark Hurd", "author...
2008/12/04
[ "https://Stackoverflow.com/questions/341103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39277/" ]
341,109
<p>I'm using reflection to get the Authorize Attributes from controllers and methods.</p> <p>Since I will need to get this information over and over I'm wondering if it is faster to cache it or to simply continue to use reflection to get it.</p> <p>Any thoughts?</p>
[ { "answer_id": 341565, "author": "configurator", "author_id": 9536, "author_profile": "https://Stackoverflow.com/users/9536", "pm_score": 4, "selected": true, "text": "<System.Runtime.CompilerServices.Extension()>" }, { "answer_id": 5090485, "author": "Mark Hurd", "author...
2008/12/04
[ "https://Stackoverflow.com/questions/341109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3396/" ]
341,112
<p>How to call a javascript file (.js) via Excel VBA?</p> <hr> <p>So as i am opposed to the same kind of problem i'll try to submit you guys my case.</p> <p>I am trying to automate datas extraction from valeo's catalogue using excel vba macro.</p> <p>I have a list of références attached to valeo's automotive products (huge list, as more than 3000 thousands items). And i would like to import directly informations from the catalogue wich seems to run under javascript.</p> <p>The datas i need is the list of every vehicules attached to a reference.</p> <p>Here is the url: <a href="http://outcat-cs.tecdoc.net/ows/en/7FA2A0C501BC34CA4BECB04095663CF1.ows_cs2.srv?view=VIndexFramesetJsp" rel="nofollow noreferrer">http://outcat-cs.tecdoc.net/ows/en/7FA2A0C501BC34CA4BECB04095663CF1.ows_cs2.srv?view=VIndexFramesetJsp</a></p> <p>I'd like to access to the "Direct Article Search" tab, in order to copy a reference directly from an excel tab's cell and then simulate a clic on the reference in order to display the "linked vehicules section" and then to copy them in a new excel sheet.</p> <p>I already succeede in doing this with html pure programmed webpage (oscaro.com) using the following code :</p> <pre><code>Set maPageHtml = IE.document Set Helem = maPageHtml.getElementsByTagName("input") For i = 0 To Helem.Length - 1 If Helem(i).getAttribute("name") = "toFind" Then Helem(i).Value = "819971" '819971 is the valeo reference searched If Helem(i).getAttribute("name") = "submit" Then Set Monbouton = Helem(i) Next Monbouton.Click 'this does the click on my button Monbouton </code></pre> <p>But this technique can't be used with valeo website since I am not able (or at least I don't know yet how to do it) to select/click a button when the page is made on javascript, since it doesn't have a name, value or id for the button.</p> <p>Also it seems that the url in the address field is the same before clicking on the "Direct Article Search" button and after having clicked....</p> <p>Hope i am clear enought in spite of my english...</p> <p>Greetings</p>
[ { "answer_id": 341160, "author": "Dirk Vollmar", "author_id": 40347, "author_profile": "https://Stackoverflow.com/users/40347", "pm_score": 0, "selected": false, "text": "oIE.Document.frmMain.param1.Value = 5\noIE.Document.frmMain.param2.Value = \"6\"\noIE.Document.frmMain.submit.click '...
2008/12/04
[ "https://Stackoverflow.com/questions/341112", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
341,118
<p>In order to reference a member of a class in XML comments/documentation, you have to use the following tag:</p> <pre><code>&lt;see cref="member"/&gt; </code></pre> <p>It is better explained <a href="http://msdn.microsoft.com/en-us/library/acd0tfbe.aspx" rel="noreferrer">here</a>.</p> <p><strong>How do you reference an <em>indexer</em>?</strong></p> <p>I mean, a member like this one:</p> <pre><code>internal object this[ int index ] { ... } </code></pre> <p>Thanks in advance.</p>
[ { "answer_id": 341149, "author": "leppie", "author_id": 15541, "author_profile": "https://Stackoverflow.com/users/15541", "pm_score": 5, "selected": true, "text": "<see cref=\"P:System.Collections.ArrayList.Item(System.Int32)\" />\n" }, { "answer_id": 341242, "author": "jyoun...
2008/12/04
[ "https://Stackoverflow.com/questions/341118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1679/" ]
341,143
<p>Say I have a Rails Model called Thing. Thing has a url attribute that can <strong>optionally</strong> be set to a URL somewhere on the Internet. In view code, I need logic that does the following:</p> <pre><code>&lt;% if thing.url.blank? %&gt; &lt;%= link_to('Text', thing_path(thing)) %&gt; &lt;% else %&gt; &lt;%= link_to('Text', thing.url) %&gt; &lt;% end %&gt; </code></pre> <p>This conditional logic in the view is ugly. Of course, I could build a helper function, which would change the view to this:</p> <pre><code>&lt;%= thing_link('Text', thing) %&gt; </code></pre> <p>That solves the verbosity problem, but I would really prefer having the functionality in the model itself. In which case, the view code would be:</p> <pre><code>&lt;%= link_to('Text', thing.link) %&gt; </code></pre> <p>This, obviously, would require a link method on the model. Here's what it would need to contain:</p> <pre><code>def link (self.url.blank?) ? thing_path(self) : self.url end </code></pre> <p>To the point of the question, thing_path() is an undefined method inside Model code. I'm assuming it's possible to "pull in" some helper methods into the model, but how? And is there a real reason that routing only operates at the controller and view layers of the app? I can think of lots of cases where model code may need to deal with URLs (integrating with external systems, etc).</p>
[ { "answer_id": 341166, "author": "Josh Delsman", "author_id": 40644, "author_profile": "https://Stackoverflow.com/users/40644", "pm_score": 4, "selected": false, "text": "# In the helper...\n\ndef link_to_thing(text, thing)\n (thing.url?) ? link_to(text, thing_path(thing)) : link_to(tex...
2008/12/04
[ "https://Stackoverflow.com/questions/341143", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32137/" ]
341,156
<p>Is there an EF equivalent to LINQ to SQL's OnCreated partial? </p> <p>Several of my objects have XML fields that I would like to parse whenever the object is loaded from the db - I'd like to put the XML data into more friendly strongly-typed collections. I've already marked the XML field as private and hooked the SavingChanges event to re-build the XML before the item is committed back to the db, but I can't figure out how to populate the collections whenever the object is loaded.</p> <p>I've thought of using the OnFieldChanged partial for my XML field, but that would run again whenever the XML field is re-built during SavingChanges, so it seems like there should be a better way.</p>
[ { "answer_id": 341301, "author": "David Schmitt", "author_id": 4918, "author_profile": "https://Stackoverflow.com/users/4918", "pm_score": 3, "selected": true, "text": "OnLoaded" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/341156", "https://Stackoverflow.com", "https://Stackoverflow.com/users/521/" ]
341,168
<p>My installer build "signs" a DLL using a Code Signing certificate during the build process. </p> <p>I've noticed that if I try to build twice in succession, the second build fails because the DLL is already signed so signcode chokes. Obviously I can fix this by signing a copy of the DLL in the build, but the problem intrigued me: </p> <p>Is it possible to "unsign" a DLL, and if not, why not...?</p>
[ { "answer_id": 40173109, "author": "vine'th", "author_id": 478028, "author_profile": "https://Stackoverflow.com/users/478028", "pm_score": 6, "selected": true, "text": "signtool remove /s C:\\path\\to.exe.or.dll\n" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/341168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1737/" ]
341,175
<p>I have a datetime coming back from an XML file in the format:</p> <blockquote> <p>20080916 11:02</p> </blockquote> <p>as in </p> <blockquote> <p>yyyymm hh:ss</p> </blockquote> <p>How can i get the datetime.parse function to pick up on this? Ie parse it without erroring? Cheers</p>
[ { "answer_id": 341200, "author": "Blair Conrad", "author_id": 1199, "author_profile": "https://Stackoverflow.com/users/1199", "pm_score": 9, "selected": true, "text": "DateTime.ParseExact(input,\"yyyyMMdd HH:mm\",null);\n" }, { "answer_id": 23805955, "author": "bert", "au...
2008/12/04
[ "https://Stackoverflow.com/questions/341175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35441/" ]
341,184
<p>I'm running Windows and the shell/OS automatically runs Python based on the registry settings when you run a program on the command line. Will this break if I install a 2.x and 3.x version of Python on the same machine?</p> <p>I want to play with Python 3 while still being able to run 2.x scripts on the same machine.</p>
[ { "answer_id": 341218, "author": "Patrick Desjardins", "author_id": 13913, "author_profile": "https://Stackoverflow.com/users/13913", "pm_score": 5, "selected": false, "text": "#!/bin/env python2.7\n" }, { "answer_id": 436455, "author": "Community", "author_id": -1, "...
2008/12/04
[ "https://Stackoverflow.com/questions/341184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4491/" ]
341,192
<p>OK - I have an interesting one here. I'm working on a tetris clone (basically to "level-up" my skills). I was trying to refactor my code to get it abstracted the way I wanted it. While it was working just fine before, now I get a segmentation fault before any images can be blitted. I've tried debugging it to no avail.</p> <p>I have posted my SVN working copy of the project <a href="http://www.andrews.edu/~sajo/downloads/Tetris-clone.tar.gz" rel="nofollow noreferrer">here</a>.</p> <p>It's just a small project and someone with more knowledge than me and a good debugger will probably figure it out in a snap. The only dependency is <a href="http://www.libsdl.org" rel="nofollow noreferrer">SDL</a>. Kudos to the person that can tell me what I'm doing wrong.</p> <p>Edit: As far as I can tell, what I have now and what I had before are logically the same, so I wouldn't think that what I have now would cause a segmentation fault. Just run an svn revert on the working copy, recompile and you can see that it was working...</p>
[ { "answer_id": 341302, "author": "UberJumper", "author_id": 34395, "author_profile": "https://Stackoverflow.com/users/34395", "pm_score": 0, "selected": false, "text": "display = new Surface();\n" }, { "answer_id": 341833, "author": "Community", "author_id": -1, "auth...
2008/12/04
[ "https://Stackoverflow.com/questions/341192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3831/" ]
341,208
<p>The catch is this is a .NET 1.0 project and there is no hidden field control...</p> <p>So this is out of the question:</p> <pre> <code> &lt;asp HiddenField Runat="server" ID="hdn" /> </code> </pre> <p>I vaguely remember some type of HtmlHiddenInput class that allowed similar functionality...does anybody know how to do this?</p> <p>Thanks.</p>
[ { "answer_id": 341222, "author": "Cristian Libardo", "author_id": 16526, "author_profile": "https://Stackoverflow.com/users/16526", "pm_score": 3, "selected": false, "text": "<input type=\"hidden\" runat=\"server\" />\n" }, { "answer_id": 15241207, "author": "Nitin Khachane",...
2008/12/04
[ "https://Stackoverflow.com/questions/341208", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1638/" ]
341,221
<p>Here is some sample VBA code:</p> <pre><code>Sub Macro1() Dim pt As PivotTable Set pt = ActiveSheet.PivotTables("SomePivotTable") 'Set colOfFields = pt.PivotFields End Sub </code></pre> <p>The third line is incomplete/broken. What is the correct way to get access to collection of all the fields in a PivotTable? I need to be able to loop over them. Actual coding is being done in C# VSTO Project.</p>
[ { "answer_id": 341495, "author": "Patrick Cuff", "author_id": 7903, "author_profile": "https://Stackoverflow.com/users/7903", "pm_score": 3, "selected": true, "text": "Sub Macro1()\n Dim pt As PivotTable\n Dim col As PivotFields\n Dim c As PivotField\n\n ' Name of the pivot t...
2008/12/04
[ "https://Stackoverflow.com/questions/341221", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36590/" ]
341,232
<p>In postgres you can do a comparison against multiple items like so:</p> <pre><code> SELECT 'test' IN ('not','in','here'); </code></pre> <p>Which is the same as doing:</p> <pre><code> SELECT ('test' = 'not' OR 'test' = 'in' OR 'test' = 'here'); </code></pre> <p>Is there a functional equivalent for SQL Server ?</p>
[ { "answer_id": 341278, "author": "Scott Ivey", "author_id": 36297, "author_profile": "https://Stackoverflow.com/users/36297", "pm_score": 0, "selected": false, "text": "select case \n when 'test' IN ('not', 'in', 'here') then 1\n else 0\n end;\n" }, { ...
2008/12/04
[ "https://Stackoverflow.com/questions/341232", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43278/" ]
341,233
<p>I am trying to implement Autocomplete in a text area (similar to <a href="http://www.pengoworks.com/workshop/jquery/autocomplete.htm" rel="nofollow noreferrer">http://www.pengoworks.com/workshop/jquery/autocomplete.htm</a>).</p> <p>What I am trying to do is when a user enters a specific set of characters (say insert:) they will get an AJAX filled div with possible selectable matches.</p> <p>In a regular text box, this is of course simple, but in a text area I need to be able to popup the div in the correct location on the screen based on the cursor.</p> <p>Can anyone provide any direction?</p> <p>Thanks, -M</p>
[ { "answer_id": 1028003, "author": "Popara", "author_id": 83910, "author_profile": "https://Stackoverflow.com/users/83910", "pm_score": 1, "selected": false, "text": " function getCursor(nBox){\n var cursorPos = 0;\n if (document.selection){ \n nBox.focus();\n var t...
2008/12/04
[ "https://Stackoverflow.com/questions/341233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
341,237
<p>There's a lot of great information on MSDN dealing with creating Visual Studio templates. I've been specifically working through a Multi-Project Solution (<a href="http://msdn.microsoft.com/en-us/library/ms185308(VS.80,printer).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/ms185308(VS.80,printer).aspx</a>) </p> <p>I have everything working in my template (4 projects + 2 Solution Folders - 1 for Tests, and 1 for Libraries that I'm referencing). I have no problem adding projects, or solution folders through the template, but I've hit a wall trying to add dll's and other resources that are not in a specific project, they are just solution level items.</p> <p>Has anyone dealt with this before? Thanks,</p>
[ { "answer_id": 44795874, "author": "ajawad987", "author_id": 106397, "author_profile": "https://Stackoverflow.com/users/106397", "pm_score": 0, "selected": false, "text": "<Link Include=\"..\\_SharedFiles\\GlobalAssemblyInfo.cs\" />\n" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/341237", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13199/" ]
341,239
<p>I'm a newbie in the great world of NHibernate. I'm using version 2.0.1.GA. Here's my question. I have a table <code>Cars</code> with column <code>Manufacturer(nvarchar(50))</code> and a primary key <code>ID(int)</code>. My .NET class is:</p> <pre><code>public class Car { public virtual int ID { get; set; } public virtual string Manufacturer { get; set; } } </code></pre> <p>Now if I want to retrieve all cars made by Mercedes I have to type this:</p> <pre><code>using (var session = OpenSession()) { var cars = session .CreateCriteria(typeof(Car)) .Add(Restrictions.Like("Manufacturer", "Mercedes")) .List(); // ... } </code></pre> <p>I don't like the fact that I need to specify the property name as a string :( Is it possible to have something more refactor friendly probably (it's only a suggestion)?</p> <pre><code>var ms = session .CreateCriteria&lt;Car&gt;() .Add(c =&gt; c.Manufacturer, Restrictions.Like("Mercedes") .List(); </code></pre> <p>Anything like thins in the current version (2.0.1.GA) or in a future version?</p>
[ { "answer_id": 341771, "author": "Bruno Lopes", "author_id": 42926, "author_profile": "https://Stackoverflow.com/users/42926", "pm_score": 4, "selected": true, "text": "session.Linq<Car>.Where(c => c.Manufacturer == \"Mercedes\").ToList()" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/341239", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42377/" ]
341,243
<p>Does anyone know how to get the Video Ram of a PC from a WMI call?</p> <p>I've seen calls to the Win32_VideoController management object's AdapterRAM property, but that only gives the system memory, and is not representative of the video RAM at all.</p>
[ { "answer_id": 341270, "author": "Dan Esparza", "author_id": 19020, "author_profile": "https://Stackoverflow.com/users/19020", "pm_score": 2, "selected": false, "text": "On Error Resume Next\n\nstrComputer = \".\"\nSet objWMIService = GetObject(\"winmgmts:\\\\\" & strComputer & \"\\root\...
2008/12/04
[ "https://Stackoverflow.com/questions/341243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12497/" ]
341,256
<p>I'm having trouble resizing a tableHeaderView. It simple doesn't work.</p> <p>1) Create a UITableView and UIView (100 x 320 px);</p> <p>2) Set the UIView as tableHeaderView of the UITableView;</p> <p>3) Build and Go. Everything is ok.</p> <p>Now, I want to resizing the tableHeaderView, so I add this code in viewDidLoad:</p> <pre><code>self.tableView.autoresizesSubviews = YES; self.tableView.tableHeaderView = myHeaderView; self.tableView.tableFooterView = myFooterView; CGRect newFrame = self.tableView.tableHeaderView.frame; newFrame.size.height = newFrame.size.height + 100; self.tableView.tableHeaderView.frame = newFrame; </code></pre> <p>The height of the tableHeaderView should appear with 200, but appears with 100.</p> <p>If I write:</p> <pre><code>self.tableView.autoresizesSubviews = YES; CGRect newFrame = myHeaderView.frame; newFrame.size.height = newFrame.size.height + 100; myHeaderView.frame = newFrame; self.tableView.tableHeaderView = myHeaderView; self.tableView.tableFooterView = myFooterView; </code></pre> <p>Then it starts with 200 of height, as I want. But I want to be able to modify it in runtime.</p> <p>I've also tried this, without success:</p> <pre><code>self.tableView.autoresizesSubviews = YES; self.tableView.tableHeaderView = myHeaderView; self.tableView.tableFooterView = myFooterView; CGRect newFrame = self.tableView.tableHeaderView.frame; newFrame.size.height = newFrame.size.height + 100; self.tableView.tableHeaderView.frame = newFrame; [self.tableView.tableHeaderView setNeedsLayout]; [self.tableView.tableHeaderView setNeedsDisplay]; [self.tableView setNeedsLayout]; [self.tableView setNeedsDisplay]; </code></pre> <p>The point here is: <strong>How do we resize a tableHeaderView in runtime ???</strong></p> <p>Have anyone able to do this?</p> <p>Thanks</p> <p>iMe</p>
[ { "answer_id": 342605, "author": "codelogic", "author_id": 43427, "author_profile": "https://Stackoverflow.com/users/43427", "pm_score": -1, "selected": false, "text": "[self.tableView reloadData]" }, { "answer_id": 419115, "author": "Greg Martin", "author_id": 50808, ...
2008/12/04
[ "https://Stackoverflow.com/questions/341256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43282/" ]
341,258
<p>I'm trying to use VBA to write a formula into a cell in Excel. My problem is that when I use a semicolon (<code>;</code>) in my formula, I get an error:</p> <blockquote> <p><strong><code>Run-time error 1004</code></strong></p> </blockquote> <p>My macro is the following : </p> <pre><code>Sub Jours_ouvres() Dim Feuille_Document As String Feuille_Document = "DOCUMENT" Application.Worksheets(Feuille_Document).Range("F2").Formula = "=SUM(D2;E2)" End Sub </code></pre>
[ { "answer_id": 341276, "author": "e.James", "author_id": 33686, "author_profile": "https://Stackoverflow.com/users/33686", "pm_score": 3, "selected": false, "text": ":" }, { "answer_id": 341286, "author": "Treb", "author_id": 22114, "author_profile": "https://Stackove...
2008/12/04
[ "https://Stackoverflow.com/questions/341258", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43277/" ]
341,264
<p>What is the best way to get the Max value from a LINQ query that may return no rows? If I just do</p> <pre><code>Dim x = (From y In context.MyTable _ Where y.MyField = value _ Select y.MyCounter).Max </code></pre> <p>I get an error when the query returns no rows. I could do</p> <pre><code>Dim x = (From y In context.MyTable _ Where y.MyField = value _ Select y.MyCounter _ Order By MyCounter Descending).FirstOrDefault </code></pre> <p>but that feels a little obtuse for such a simple request. Am I missing a better way to do it?</p> <p>UPDATE: Here's the back story: I'm trying to retrieve the next eligibility counter from a child table (legacy system, don't get me started...). The first eligibility row for each patient is always 1, the second is 2, etc. (obviously this is not the primary key of the child table). So, I'm selecting the max existing counter value for a patient, and then adding 1 to it to create a new row. When there are no existing child values, I need the query to return 0 (so adding 1 will give me a counter value of 1). Note that I don't want to rely on the raw count of child rows, in case the legacy app introduces gaps in the counter values (possible). My bad for trying to make the question too generic.</p>
[ { "answer_id": 341313, "author": "David Schmitt", "author_id": 4918, "author_profile": "https://Stackoverflow.com/users/4918", "pm_score": 5, "selected": false, "text": "Double.MinValue" }, { "answer_id": 341560, "author": "Jacob Proffitt", "author_id": 1336, "author_...
2008/12/04
[ "https://Stackoverflow.com/questions/341264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23935/" ]
341,271
<p>My previous job involved maintenance and programming for a very large database with massive amounts of data. Users viewed this data primarily through an intranet web interface. Instead of having a table of user accounts, each user account was a real first-class account in the RDBMS, which permitted them to connect with their own query tools, etc., as well as permitting us to control access through the RDBMS itself instead of using our own application logic.</p> <p>Is this a good setup, assuming you're not on the public intranet and dealing with potentially millions of (potentially malicious) users or something? Or is it always better to define your own means of handling user accounts, your own permissions, your own application security logic, and only hand out RDBMS accounts to power users with special needs?</p>
[ { "answer_id": 33647108, "author": "H S Raju", "author_id": 2963452, "author_profile": "https://Stackoverflow.com/users/2963452", "pm_score": 1, "selected": false, "text": "Manager_Role_Account" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/341271", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18103/" ]
341,273
<p>I can read the <em>MySQL</em> documentation and it's pretty clear. But, how does one decide which character set to use? On what data does collation have an effect?</p> <p>I'm asking for an explanation of the two and how to choose them.</p>
[ { "answer_id": 341352, "author": "mat", "author_id": 42083, "author_profile": "https://Stackoverflow.com/users/42083", "pm_score": 8, "selected": false, "text": "e é è ê f" }, { "answer_id": 42625088, "author": "simhumileco", "author_id": 4217744, "author_profile": "h...
2008/12/04
[ "https://Stackoverflow.com/questions/341273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2172/" ]
341,274
<p>We are upgrading our servers to SQL Server 2005 from SQL Server 2000. We currently use the jtds drivers.</p> <p>I'm interested to know what peoples opinions are of the different jdbc drivers available (in particular the latest Microsoft driver), how they perform with SQL Server 2005 and any other lessons from your collective experience.</p>
[ { "answer_id": 927623, "author": "Rohit Agarwal", "author_id": 108955, "author_profile": "https://Stackoverflow.com/users/108955", "pm_score": 0, "selected": false, "text": "declare @P1 int\nset @P1=1\nexec sp_prepexec @P1 output, N'@P0 int', N'EXEC getEmployeeManagers @P0', 50\nselect @...
2008/12/04
[ "https://Stackoverflow.com/questions/341274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42491/" ]
341,282
<p>I'm trying to create a function which takes an array as an argument, adds values to it (increasing its size if necessary) and returns the count of items. So far I have:</p> <pre><code>int main(int argc, char** argv) { int mSize = 10; ent a[mSize]; int n; n = addValues(a,mSize); for(i=0;i&lt;n;i++) { //Print values from a } } int addValues(ent *a, int mSize) { int size = mSize; i = 0; while(....) { //Loop to add items to array if(i&gt;=size-1) { size = size*2; a = realloc(a, (size)*sizeof(ent)); } //Add to array i++; } return i; } </code></pre> <p>This works if mSize is large enough to hold all the potential elements of the array, but if it needs resizing, I get a Segmentation Fault.</p> <p>I have also tried:</p> <pre><code>int main(int argc, char** argv) { ... ent *a; ... } int addValues(ent *a, int mSize) { ... a = calloc(1, sizeof(ent); //usual loop ... } </code></pre> <p>To no avail.</p> <p>I assume this is because when I call realloc, the copy of 'a' is pointed elsewhere - how is it possible to modify this so that 'a' always points to the same location?</p> <p>Am I going about this correctly? Are there better ways to deal with dynamic structures in C? Should I be implementing a linked list to deal with these?</p>
[ { "answer_id": 341293, "author": "xahtep", "author_id": 42184, "author_profile": "https://Stackoverflow.com/users/42184", "pm_score": 3, "selected": false, "text": "ent **a" }, { "answer_id": 341294, "author": "Todd Gamblin", "author_id": 9122, "author_profile": "http...
2008/12/04
[ "https://Stackoverflow.com/questions/341282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23746/" ]
341,303
<p>All this originated from me poking at a compiler warning message (C4267) when attempting the following line:</p> <pre><code>const unsigned int nSize = m_vecSomeVec.size(); </code></pre> <p><code>size()</code> returns a size_t which although typedef'd to unsigned int, is not actually a unsigned int. This I believe have to do with 64 bit portability issues, however can someone explain it a bit better for me? ( I don't just want to disable 64bit warnings.)</p>
[ { "answer_id": 341341, "author": "unwind", "author_id": 28169, "author_profile": "https://Stackoverflow.com/users/28169", "pm_score": 2, "selected": false, "text": "size_t" }, { "answer_id": 341344, "author": "James Hopkin", "author_id": 11828, "author_profile": "http...
2008/12/04
[ "https://Stackoverflow.com/questions/341303", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18664/" ]
341,310
<p>Is it possible to get a list of all files modified/added/deleted by a particular user?</p> <p>The goal is to get an idea of what a user did for the day (or date range).</p>
[ { "answer_id": 341457, "author": "shek", "author_id": 40618, "author_profile": "https://Stackoverflow.com/users/40618", "pm_score": 7, "selected": true, "text": "svn log | sed -n '/blankman/,/-----$/ p'\n" }, { "answer_id": 4439780, "author": "l0b0", "author_id": 96588, ...
2008/12/04
[ "https://Stackoverflow.com/questions/341310", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39677/" ]
341,315
<p>I tried to make the title as clear as possible... here is my scenario:</p> <p>I have 2 tables (let's call them table A and table B) that have a similar schema. I would like write a stored procedure that would select specific columns of data out of table A, and insert this data as a new record in table B.</p> <p>Can someone point me in the write direction to make such a query? I am unsure how to "Hold" the values from the first query, so that I may then perform the insert.</p> <p>I am trying to avoid making a query, processing it with C# and then making another query...</p> <p>Thanks.</p>
[ { "answer_id": 341323, "author": "John Stauffer", "author_id": 5874, "author_profile": "https://Stackoverflow.com/users/5874", "pm_score": 2, "selected": false, "text": "Insert into tableB (col1, col2, col3) select col1, col2, col3 from tableA where ...\n" }, { "answer_id": 34132...
2008/12/04
[ "https://Stackoverflow.com/questions/341315", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1638/" ]
341,338
<p>How do you make a field in a sql select statement all upper or lower case?</p> <p>Example:</p> <p>select firstname from Person</p> <p>How do I make firstname always return upper case and likewise always return lower case?</p>
[ { "answer_id": 341342, "author": "Stephen Wrighton", "author_id": 7516, "author_profile": "https://Stackoverflow.com/users/7516", "pm_score": 4, "selected": false, "text": "SELECT UCASE(MyColumn) AS Upper, LCASE(MyColumn) AS Lower\nFROM MyTable\n" }, { "answer_id": 341346, "a...
2008/12/04
[ "https://Stackoverflow.com/questions/341338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6232/" ]
341,347
<p>How do I grab the controls inside of a UserControl tag?</p> <p>So if this is on a Page:</p> <pre><code>&lt;ME:NewControl ID="tblCustomList" runat="server"&gt; // ... these controls will be used in my UserControl.aspx &lt;/ME:NewControl&gt; </code></pre> <p>How do I access those controls in my UserControl?</p> <p>For instance, the Table class does this:</p> <pre><code>&lt;asp:Table ID="tblNormal" runat="server"&gt; &lt;asp:TableRow&gt; &lt;asp:TableCell&gt;Thing 1&lt;/asp:TableCell&gt; &lt;asp:TableCell&gt;Thing 2&lt;/asp:TableCell&gt; &lt;/asp:TableRow&gt; &lt;/asp:Table&gt; </code></pre> <p>I get an error saying my UserControl "does not have a public property named 'TableRow', when I do this:</p> <pre><code>&lt;ME:NewControl ID="tblCustomList" runat="server"&gt; &lt;asp:TableRow&gt; &lt;asp:TableCell&gt;Thing 1&lt;/asp:TableCell&gt; &lt;asp:TableCell&gt;Thing 2&lt;/asp:TableCell&gt; &lt;/asp:TableRow&gt; &lt;/ME:NewControl&gt; </code></pre> <p>I found <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.table.createcontrolcollection.aspx" rel="nofollow noreferrer">this sample</a> to help extend the Table class, but it's not <em>exactly</em> what I want to do.</p> <p>I also found <a href="http://msdn.microsoft.com/en-us/library/36574bf6.aspx" rel="nofollow noreferrer">this description</a> of how to use Templated Controls, which I'm not sure if I can use.</p>
[ { "answer_id": 344815, "author": "Gavin Miller", "author_id": 33226, "author_profile": "https://Stackoverflow.com/users/33226", "pm_score": 0, "selected": false, "text": "using System.Web;\nusing System.Web.UI;\nusing System.Web.UI.WebControls;\nusing System.Security.Permissions;\n\nname...
2008/12/04
[ "https://Stackoverflow.com/questions/341347", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25538/" ]
341,348
<p>I have a DSL Tools solution.</p> <p>I need to add a weak-named reference to this project. Because the DSL Tools project DLL is strong-named i cannot used the weak-named DLL.</p> <p>I cannot make the DLL strong-named because i cannot recompile it.</p> <p>I tried to make my DSL Tools project DLL weak-named by going to the Dsl and DslPackage project properties and unchecked the option "Sign the assembly" in the Sigining tab.</p> <p>Then i compile it. The error list gives the following error</p> <pre><code>"gacutil.exe" exited with code 1 </code></pre> <p>Looking at the VS2005 output window i see gacutil is being called </p> <pre><code>C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin\gacutil.exe -nologo -i "C:\Academy\ResearchAndDevelopment\FrontendGenerator\DslPackage\bin\Debug\vantyx.FEGenerator.DslPackage.dll" </code></pre> <p>After that i used the command prompt and the gacutil.exe error displays as this:</p> <pre><code>Z:\&gt;"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin\gacutil.exe" -nologo -i "C:\Academy\ResearchAndDevelopment\FrontendGenerator\DslPackage\bin\Debug\vantyx.FEGenerator.DslPackage.dll" Failure adding assembly to the cache: Attempt to install an assembly without a strong name </code></pre> <p>I don't know why and how gacutil.exe is being called. I looked at the project and solution properties and there is no option configured to call gacutil.exe. I even looked inside every file for "gacutil.exe" but i found nothing.</p> <p>What i really want is to be able to use the weak-named DLL that i cannot make strong-named. As a result of this, i've been trying to make my DSL Tools DLL weak-named but i can't.</p> <p>Any help on how i can workaround this?</p> <p>Many thanks in advance, Luís Filipe </p>
[ { "answer_id": 344815, "author": "Gavin Miller", "author_id": 33226, "author_profile": "https://Stackoverflow.com/users/33226", "pm_score": 0, "selected": false, "text": "using System.Web;\nusing System.Web.UI;\nusing System.Web.UI.WebControls;\nusing System.Security.Permissions;\n\nname...
2008/12/04
[ "https://Stackoverflow.com/questions/341348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20335/" ]
341,370
<p>It seems it is general accepted that exception specifications are not helping as much as one thinks. But I wonder if a specification which only uses std::exception might be a good compromise:</p> <pre><code>void someFunction() throw ( std::exception ); </code></pre> <ul> <li><p>It documents the fact that this method/function might throw an exception.</p></li> <li><p>It would make sure that only exceptions derived from std::exception are thrown and not some exotic classes like std::string or int.</p></li> </ul> <p>So, would this be better then not having any specification at all?</p> <p><strong>Update:</strong></p> <p>Regarding the Runtime-Overhead: Think of it like the usage of asserts. You are using asserts regardless of the runtime-overhead, right? I know you usually can disable them for a release-build, so maybe a better approach would be to wrap the exception specification in a macro so you can disable it for a release build. Something like:</p> <pre><code>#ifdef DEBUG #define THROW( exception ) throw ( exception ) #else #define THROW( exception ) #endif void someFunction() THROW( std::exception ); </code></pre>
[ { "answer_id": 341388, "author": "James Hopkin", "author_id": 11828, "author_profile": "https://Stackoverflow.com/users/11828", "pm_score": 2, "selected": false, "text": "someFunction" }, { "answer_id": 343223, "author": "Paolo Tedesco", "author_id": 15622, "author_pr...
2008/12/04
[ "https://Stackoverflow.com/questions/341370", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
341,372
<p>I've heard powershell 2.0 CTP has modules, but I can't find much example code or instructions. I've read what little help there seems to be online...</p> <p>But I just keep getting "The term 'Add-Module' is not recognized as a cmdlet..." when I try and load a module.</p> <p>Any help would be gratefully received!</p> <p><strong><em>Edit</em></strong> (July 2010) Please note this question is based on powershell 2.0 CTP and is therefore a year and half out of date! Please see Samuel Jack's answer for help with the powershell 2.0 RTM.</p>
[ { "answer_id": 3264564, "author": "Samuel Jack", "author_id": 1727, "author_profile": "https://Stackoverflow.com/users/1727", "pm_score": 2, "selected": false, "text": "Export-ModuleMember -Function * -Alias *" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/341372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32055/" ]
341,373
<p>I need to prompt an alert message when a user selects a particular option in a select menu. Is there a way to do this using jQuery?</p>
[ { "answer_id": 341398, "author": "Neil Aitken", "author_id": 13803, "author_profile": "https://Stackoverflow.com/users/13803", "pm_score": 3, "selected": true, "text": "$(\"#myselect\").change(function() {\n if($(this).val() == \"myval\")\n {\n alert('message');\n }\n});\n"...
2008/12/04
[ "https://Stackoverflow.com/questions/341373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6050/" ]
341,377
<p>Did you know that :</p> <pre><code>Map&lt;Object,Object&gt; m1 = new HashMap&lt;Object, Object&gt;(); Map&lt;Object,Object&gt; m2 = new HashMap&lt;Object, Object&gt;(); System.out.println("m1.equals(m2) = "+m1.equals(m2)); System.out.println("m1.keySet().equals(m2.keySet()) = " +m1.keySet().equals(m2.keySet())); System.out.println("m1.entrySet().equals(m2.entrySet()) = " +m1.entrySet().equals(m2.entrySet())); System.out.println("m1.values().equals(m2.values()) = " +m1.values().equals(m2.values())); </code></pre> <p>would output :</p> <pre><code>m1.equals(m2) = true m1.keySet().equals(m2.keySet()) = true m1.entrySet().equals(m2.entrySet()) = true m1.values().equals(m2.values()) = false </code></pre> <p>This is caused by the fact that <code>AbstractCollection</code> (which <code>HashMap$Values</code> inherits from) does not overrides <code>#equals()</code>.</p> <p>Do you have an idea why this is so ?</p>
[ { "answer_id": 341436, "author": "Greg Case", "author_id": 462, "author_profile": "https://Stackoverflow.com/users/462", "pm_score": 4, "selected": true, "text": "Collection#equals()" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/341377", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7198/" ]
341,379
<p>As an example:</p> <pre><code>def get_booking(f=None): print &quot;Calling get_booking Decorator&quot; def wrapper(request, **kwargs): booking = _get_booking_from_session(request) if booking == None: # we don't have a booking in our session. return HttpRedirect('/') else: return f(request=request, booking=booking, **kwargs) return wrapper @get_booking def do_stuff(request, booking): # do stuff here </code></pre> <p>The problem I am having is, the <code>@get_booking decorator</code> is being called even before I called the function that I am decorating.</p> <p>Output on start:</p> <pre class="lang-none prettyprint-override"><code>Calling get_booking Decorator Calling get_booking Decorator Calling get_booking Decorator Calling get_booking Decorator Calling get_booking Decorator Calling get_booking Decorator Calling get_booking Decorator Calling get_booking Decorator Calling get_booking Decorator Calling get_booking Decorator [26/Oct/2008 19:54:04] &quot;GET /onlinebooking/?id=1,2 HTTP/1.1&quot; 302 0 [26/Oct/2008 19:54:05] &quot;GET /onlinebooking/ HTTP/1.1&quot; 200 2300 [26/Oct/2008 19:54:05] &quot;GET /site-media/css/style.css HTTP/1.1&quot; 200 800 [26/Oct/2008 19:54:05] &quot;GET /site-media/css/jquery-ui-themeroller.css HTTP/1.1&quot; 200 25492 </code></pre> <p>I haven't even made a call to a function that is decorated at this point.</p> <p>I am just getting started with decorators, so maybe I am missing something.</p>
[ { "answer_id": 341389, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 6, "selected": true, "text": "@foo\ndef bar ():\n pass\n" }, { "answer_id": 341391, "author": "David Schmitt", "author_id": 4918, "aut...
2008/12/04
[ "https://Stackoverflow.com/questions/341379", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22306/" ]
341,384
<p>I need to add some intervals and use the result in Excel. </p> <p>Since </p> <pre><code>sum(time.endtime-time.starttime) </code></pre> <p>returns the interval as "1 day 01:30:00" and this format breaks my Excel sheet, I thought it'd be nice to have the output like "25:30:00" but found no way to do it in the PostgreSQL documentation. </p> <p>Can anyone here help me out?</p>
[ { "answer_id": 341439, "author": "mat", "author_id": 42083, "author_profile": "https://Stackoverflow.com/users/42083", "pm_score": 4, "selected": false, "text": "mat=> select date_part('epoch', '01 day 1:30:00'::interval);\n date_part \n-----------\n 91800\n(1 row)\n" }, { "a...
2008/12/04
[ "https://Stackoverflow.com/questions/341384", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43289/" ]
341,387
<p>Hello I would like to ask you, If someone knows how can I add a directory for the header files in the Makefile to avoid the error *.h not found, I have tried this option but does not work:</p> <pre><code>INC_PATH := -I /directory/to/add </code></pre>
[ { "answer_id": 341396, "author": "unwind", "author_id": 28169, "author_profile": "https://Stackoverflow.com/users/28169", "pm_score": 5, "selected": false, "text": "CFLAGS" }, { "answer_id": 341486, "author": "Jonathan Leffler", "author_id": 15168, "author_profile": "...
2008/12/04
[ "https://Stackoverflow.com/questions/341387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39160/" ]
341,393
<p>This is an extension of a question I had yesterday.</p> <p>I am trying to make a little php calculator that will show how much people can save on their phone bills if they switch to VoIP, and how much they can save with each service.</p> <p>I have a form that will spit out the right amount for a monthly bill here:</p> <p><a href="http://www.nextadvisor.com/voip_services/voip_calculator.php?monthlybill=50&amp;Submit=Submit" rel="nofollow noreferrer">http://www.nextadvisor.com/voip_services/voip_calculator.php?monthlybill=50&amp;Submit=Submit</a></p> <p>But now I need to integrate that with some other data and put in a table. The prices for each of the different services are in another file called "values.php". The values are:</p> <pre><code> $offer1calcsavings="24.99"; $offer2calcsavings="20.00"; $offer3calcsavings="21.95"; $offer4calcsavings="23.95"; $offer5calcsavings="19.95"; $offer6calcsavings="23.97"; $offer7calcsavings="24.99"; </code></pre> <p>I want each of the seven rows of the table to have one of the offercalcsavings values subtracted from the monthlybill value. </p> <p>The php code currently looks like this:</p> <pre><code> &lt;?php $monthlybill = $_GET['monthlybill']; ?&gt; Your monthly bill was &lt;?php echo "$monthlybill"; ?&gt; &lt;?php $monthybill="monthlybill"; $re=1; $offer ='offer'.$re.'name'; $offername= ${$offer}; while($offername!=""){ $offerlo ='offer'.$re.'logo'; $offerlogo=${$offerlo}; $offerli ='offer'.$re.'link'; $offerlink=${$offerli}; $offeran ='offer'.$re.'anchor'; $offeranchor=${$offeran}; $offerst ='offer'.$re.'star1'; $offerstar=${$offerst}; $offerbot='offer'.$re.'bottomline'; $offerbottomline=${$offerbot}; $offerca ='offer'.$re.'calcsavings'; $offercalcsavings=${$offerca}; echo '&lt;tr &gt; &lt;td &gt; &lt;a href="'.$offerlink.'" target="blank"&gt; &lt;img src="http://www.nextadvisor.com'.$offerlogo.'" alt="'.$offername.'" /&gt; &lt;/a&gt; &lt;/td&gt; &lt;td &gt;&lt;span class="rating_text"&gt;Rating:&lt;/span&gt; &lt;span class="star_rating1"&gt; &lt;img src="http://www.nextadvisor.com'.$offerstar.'" alt="" /&gt; &lt;/span&gt;&lt;br /&gt; &lt;div style="margin-top:5px; color:#0000FF;"&gt; &lt;a href="'.$offerlink.'" target="blank"&gt;Go to Site&lt;/a&gt; &lt;span style="margin:0px 7px 0px 7px;"&gt;|&lt;/span&gt; &lt;a href="'.$offeranchor.'"&gt;Review&lt;/a&gt; &lt;/div&gt; &lt;/td&gt; &lt;td &gt;'.$offercalcsavings.'&lt;/td&gt; &lt;/tr&gt;'; $re=$re+1; $offer ='offer'.$re.'name'; $offername= ${$offer}; } ?&gt; </code></pre>
[ { "answer_id": 341396, "author": "unwind", "author_id": 28169, "author_profile": "https://Stackoverflow.com/users/28169", "pm_score": 5, "selected": false, "text": "CFLAGS" }, { "answer_id": 341486, "author": "Jonathan Leffler", "author_id": 15168, "author_profile": "...
2008/12/04
[ "https://Stackoverflow.com/questions/341393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43035/" ]
341,397
<p>My computer often produces a "ding" sound, and I can't associate it with anything. Is it possible to programmatically determine the source of the beeps? For example can I hook the sound driver? If so, can you point out some examples or references?</p>
[ { "answer_id": 375218, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": 0, "selected": false, "text": "lsof(8)" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/341397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
341,417
<p>How do you handle the Web User Control event? I notice my custom web user control have a event call OnError but it never fire when i tweak the control to fail. The control is basically a custom gridview control. I search for web user control event handling over the net but i haven't find a article that address what i looking for. Can someone do a quick explanation or point me to the right direction?</p> <p>thank</p>
[ { "answer_id": 342921, "author": "BenAlabaster", "author_id": 40650, "author_profile": "https://Stackoverflow.com/users/40650", "pm_score": 1, "selected": false, "text": "Public Event MyEvent(ByVal Sender As Object, ByVal e As EventArgs)\n\nPrivate Sub SomeMethodThatRaisesMyEvent()\n Ra...
2008/12/04
[ "https://Stackoverflow.com/questions/341417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28647/" ]
341,422
<p>I'm writing a Linux module and getting:</p> <pre><code>Unable to handle kernel NULL pointer dereference </code></pre> <p>What does it mean?</p>
[ { "answer_id": 341432, "author": "Nathan", "author_id": 41158, "author_profile": "https://Stackoverflow.com/users/41158", "pm_score": 4, "selected": true, "text": "int x = 5;\nint * x_ptr = NULL;\n\nx_ptr = &x; // this line may be missing in your code\n\n*x_ptr += 5; //can't dereference ...
2008/12/04
[ "https://Stackoverflow.com/questions/341422", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1100/" ]
341,423
<p>The setTimeout function always seems to give me trouble. Right now I have a function that is recursive (calls itself through setTimeout) and changes the elements height.</p> <p>The function is sent two arguments: the element to be altered and that elements maximum height. The purpose of the function is to unfold the element, or "slide down" at a constant pace. I'm aware I could probably solve this problem with jQuery, but I'm trying my own function.</p> <pre><code>function slide_down(element, max_height) { if(element.clientHeight &lt; max_height) { var factor = 10; var new_height = (element.clientHeight + factor &gt;= max_height) ? max_height : (element.clientHeight + factor); element.style.height = new_height + 'px'; var func_call = 'slide_down(' + element + ', ' + max_height + ');'; window.setTimeout(func_call, 10); } } </code></pre> <p>I have tested the arguments when the function is initially called. max_height is set to 20 because it is the elements desired height (I got this value from .scrollHeight).</p> <p>When the function is done, I want to have it call itself until max_height is the element's height. I do that with this setTimeout call:</p> <pre><code>var func_call = 'slide_down(' + element + ', ' + max_height + ');'; window.setTimeout(func_call, 10); </code></pre> <p>And it is not working. THIS does work:</p> <pre><code>var func_call = 'alert(1);'; window.setTimeout(func_call, 10); </code></pre> <p>I have also tried putting the function call directly into the setTimeout statement, still does not work.</p> <p>Note that the element's height DOES change the first iteration, the function just never calls itself. So the element variable is set correctly, and I used alert() to display the max_height which is also correct.</p> <pre><code>alert(func_call); </code></pre> <p>Alerts this:</p> <pre><code>slide_down([object HTMLParagraphElement], 20); </code></pre>
[ { "answer_id": 341452, "author": "matt b", "author_id": 4249, "author_profile": "https://Stackoverflow.com/users/4249", "pm_score": 0, "selected": false, "text": "setTimeout()" }, { "answer_id": 341460, "author": "Greg", "author_id": 24181, "author_profile": "https://...
2008/12/04
[ "https://Stackoverflow.com/questions/341423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29595/" ]
341,429
<p>I am trying to use the SGI STL implementation I have downloaded from their site. I want to use a hashmap, because I have to store around 5.000.000 records, but it should be good: I need to be able to access it very quickly. I've tried <code>stedext::hash_map</code>, but it was very slow because I couldn't set the initial size. By the way, is it possible to do that? If I add the additional path to my MS Visual Studio, I can't even compile the example from the SGI site. I get an error message: </p> <pre><code>error C2061: syntax error : identifier 'T'. </code></pre> <p>Has anyone else faced such problems?</p>
[ { "answer_id": 341459, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "void resize(size_type n)\n" }, { "answer_id": 341984, "author": "Community", "author_id": -1, "author_prof...
2008/12/04
[ "https://Stackoverflow.com/questions/341429", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
341,438
<p>I have built a simple WCF Service and deployed it to IIS6, and I'm noticing that it works in my Dev and Staging environments, but not Production. Every time I try to hit the service metadata link, I get a 404 page.</p> <p>I've checked IIS config everywhere I can think of and they're identical, so the only difference I can think of is that the Production environment is load balanced.</p> <p>Does anyone know of any issues with running a WCF service behind a load balancer, and how can I get around that? Am I on the wrong track, is there another common problem I should look into? </p>
[ { "answer_id": 31576142, "author": "Jeremy Thompson", "author_id": 495455, "author_profile": "https://Stackoverflow.com/users/495455", "pm_score": 0, "selected": false, "text": "aspnet_regiis -i -enable" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/341438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43250/" ]
341,462
<p>Can anyone explain the difference between the types mentioned above and some sample usage to clearly explain the difference between the two?</p> <p>Any help would be highly appreciated! Note: this question is a spin-off from <a href="https://stackoverflow.com/questions/324168/msxml2ixmldomdocument2ptr-getxml-messing-up-my-string">this other question</a></p>
[ { "answer_id": 341545, "author": "efotinis", "author_id": 12320, "author_profile": "https://Stackoverflow.com/users/12320", "pm_score": 4, "selected": false, "text": "_bstr_t" }, { "answer_id": 343590, "author": "Khalid Salomão", "author_id": 40248, "author_profile": ...
2008/12/04
[ "https://Stackoverflow.com/questions/341462", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1311500/" ]
341,470
<p>I'm using Office Automation in .NET. It is leaving behind the excel.exe program. I know the fix - it is all about explicitely defining the variables. Once defined, I can properly de-allocate the ram and the GC will clean them up.</p> <p>The problem is, I have literally thousands of lines of code to go through. So I'm wondering: Is there some sort of a utility in .net (or 3rd party) that is capable of showing me a list of variables for which I have ram allocated still? If so, I would be able to target those items and specificially de-allocate them.</p> <p>Thanks</p> <p>Ryan</p>
[ { "answer_id": 341765, "author": "Jason Jackson", "author_id": 13103, "author_profile": "https://Stackoverflow.com/users/13103", "pm_score": 0, "selected": false, "text": "Excel.ApplicationClass excel = new Excel.ApplicationClass();\n//do some work with Excel\nexcel.Quit();\n" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/341470", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36620/" ]
341,471
<p>I'm attempting to eliminate leading any leading zeroes in my date when I run the get-date cmdlet by trying: </p> <pre><code>$filedate = get-date -uformat "%m-%d-%Y" $filedate = $filedate.ToString().Replace("0", "") </code></pre> <p>this returns "01-04-2008"</p> <p>I want to the output to be "1-4-2008"</p> <p>any ideas on another way of doing this?</p> <p>thanks in advance</p>
[ { "answer_id": 341524, "author": "Gordon Bell", "author_id": 16473, "author_profile": "https://Stackoverflow.com/users/16473", "pm_score": 5, "selected": true, "text": "$filedate = get-date -format \"M-d-yyyy\"\n" }, { "answer_id": 40612221, "author": "Community", "author...
2008/12/04
[ "https://Stackoverflow.com/questions/341471", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18853/" ]
341,474
<p>Although I know how to build a DOM the long, arduous way using the DOM API, I'd like to do something a bit better than that. Is there a nice, tidy way to build hierarchical documents with, say, an API that works something like Hibernate's Criteria API? So that I can chain calls together like this, for example:</p> <pre><code>Document doc = createDocumentSomehow (); doc.createElement ("root").createElements ( doc.newElement ("subnode") .createElement ("sub-subnode") .setText("some element text") .addAttribute ("attr-name","attr-value"), doc.newElement ("other_subnode")); </code></pre> <p>Ideally, this would result in XML like this:</p> <pre><code>&lt;root&gt; &lt;subnode&gt; &lt;sub-subnode attr-name = "attr-value"&gt;some element text&lt;/sub-subnode&gt; &lt;other_subnode /&gt; &lt;/root&gt; </code></pre> <p>Basically, I'd like something where the Java itself isn't nearly four times longer than the document I'm generating. Does it exist?</p>
[ { "answer_id": 341509, "author": "Johannes Schaub - litb", "author_id": 34509, "author_profile": "https://Stackoverflow.com/users/34509", "pm_score": 3, "selected": true, "text": "JDom" }, { "answer_id": 341573, "author": "Joe Liversedge", "author_id": 4552, "author_p...
2008/12/04
[ "https://Stackoverflow.com/questions/341474", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23309/" ]
341,477
<p>I want to create a <strong>List</strong> of <strong>KeyValuePair</strong>s in a managed C++ project. Here is the syntax I'm using</p> <pre><code>List&lt;KeyValuePair&lt;String^, String^&gt;^&gt;^ thing; </code></pre> <p>but I'm getting the following error:</p> <blockquote> <p>error C3225: generic type argument for 'T' cannot be 'System::Collections::Generic::KeyValuePair ^', it must be a value type or a handle to a reference type</p> </blockquote> <p>I basically want to do this (C#)</p> <pre><code>List&lt;KeyValuePair&lt;string, string&gt;&gt; thing; </code></pre> <p>but in managed C++. Oh and in .Net 2.0. Any takers?</p>
[ { "answer_id": 341679, "author": "Brian", "author_id": 2831, "author_profile": "https://Stackoverflow.com/users/2831", "pm_score": 2, "selected": false, "text": "List<KeyValuePair<String^, String^>>^ thing;\n" }, { "answer_id": 341694, "author": "Konrad Rudolph", "author_...
2008/12/04
[ "https://Stackoverflow.com/questions/341477", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2831/" ]
341,484
<p>in Perl, when I do <code>use &lt;module name&gt; &lt;ver&gt;;</code>, the system finds the <code>.pm</code> file for the library somewhere in the <code>@INC</code> path.</p> <p>Is there a reliable way to which file was actually loaded?</p>
[ { "answer_id": 341529, "author": "John", "author_id": 13895, "author_profile": "https://Stackoverflow.com/users/13895", "pm_score": 2, "selected": false, "text": "perl -le 'print foreach @INC'\n" }, { "answer_id": 341572, "author": "mikegrb", "author_id": 13462, "auth...
2008/12/04
[ "https://Stackoverflow.com/questions/341484", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23630/" ]
341,512
<p>I have the following code in WCF service to throw a custom fault based on certain situations. I am getting a "The creator of this fault did not specify a Reason" exception. What am I doing wrong?</p> <pre><code>//source code if(!DidItPass) { InvalidRoutingCodeFault fault = new InvalidRoutingCodeFault("Invalid Routing Code - No Approval Started"); throw new FaultException&lt;InvalidRoutingCodeFault&gt;(fault); } //operation contract [OperationContract] [FaultContract(typeof(InvalidRoutingCodeFault))] bool MyMethod(); //data contract [DataContract(Namespace="http://myuri.org/Simple")] public class InvalidRoutingCodeFault { private string m_ErrorMessage = string.Empty; public InvalidRoutingCodeFault(string message) { this.m_ErrorMessage = message; } [DataMember] public string ErrorMessage { get { return this.m_ErrorMessage; } set { this.m_ErrorMessage = value; } } } </code></pre>
[ { "answer_id": 341580, "author": "Chris Porter", "author_id": 13495, "author_profile": "https://Stackoverflow.com/users/13495", "pm_score": 0, "selected": false, "text": "<serviceDebug includeExceptionDetailInFaults=\"true\" />\n" }, { "answer_id": 341702, "author": "Michael ...
2008/12/04
[ "https://Stackoverflow.com/questions/341512", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26327/" ]
341,516
<p>I've always wondered about when and where is the best time to cache a property value... Some of them seem pretty simple, like the one below...</p> <pre><code>public DateTime FirstRequest { get { if (this.m_FirstRequest == null) { this.m_FirstRequest = DateTime.Now; } return (DateTime)this.m_FirstRequest; } } private DateTime? m_FirstRequest; </code></pre> <p><strong>But what about some more complicated situations?</strong></p> <ol> <li>A value that comes from a database, but remains true after it's been selected.</li> <li>A value that is stored in a built-in cache and might expire from time to time.</li> <li>A value that has to be calculated first? </li> <li>A value that requires some time to initialize. 0.001s, 0.1s, 1s, <strong>5s</strong>???</li> <li>A value that is set, but something else may come and set it to null to flag that it should be repopulated.</li> <li><strong>???</strong> There seems to be limitless situations.</li> </ol> <p><strong>What do you think is the point that a property can no longer take care of itself and instead require something to populate its value?</strong></p> <hr> <p><strong>[EDIT]</strong></p> <p>I see suggestions that I'm optimizing too early, etc. But my question is for when it is time to optimize. Caching everything isn't what I'm asking, but when it is time to cache, whose responsibility should it be?</p>
[ { "answer_id": 341640, "author": "Jeff Yates", "author_id": 23234, "author_profile": "https://Stackoverflow.com/users/23234", "pm_score": 1, "selected": false, "text": "ISupportInitialize" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/341516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17091/" ]
341,520
<p>Somebody used libapt or libept to list packages and get informations about package in a debian-like system?</p> <p>Libapt is not well-documented at all, and i've found few examples and tutorials about libept. Can someone explain me best methods to</p> <ol> <li>get a list of every packages in the apt-system</li> <li>get informations about single packages (like name, version, dependences, description, etc.</li> <li>get list of files installed by a single package</li> </ol> <p>Work directly with apt internal files is quite simple, but i want to use a library to respect apt specifications.</p>
[ { "answer_id": 341588, "author": "joveha", "author_id": 40668, "author_profile": "https://Stackoverflow.com/users/40668", "pm_score": 3, "selected": false, "text": "# apt-get source apt\n" }, { "answer_id": 23970130, "author": "eyelash", "author_id": 799849, "author_p...
2008/12/04
[ "https://Stackoverflow.com/questions/341520", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39796/" ]
341,531
<p>I have the following snippet where I would like to extract code between the <code>{foreach}</code> and <code>{/foreach}</code> using a regular expression:</p> <pre><code>{foreach (...)} Some random HTML content &lt;div class=""&gt;aklakdls&lt;/div&gt; and some {$/r/template} markup inside. {/foreach} </code></pre> <p>I already have:</p> <pre><code>{foreach [^}]*} </code></pre> <p>but I am unable to match anything after that. Is there any way to match anything BUT {/foreach} as a whole token? Please note that the content between {foreach}{/foreach} can also contain "{$" tokens.</p> <p><strong>Edit</strong>: BaileyP's &amp; Tomalak's answers are correct, but I have chosen BaileyP's answer for simplicity sake.</p>
[ { "answer_id": 341582, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 2, "selected": false, "text": "\\{foreach [^}]*\\}((?:.(?!\\{/foreach\\}))*[^{]?)\n" }, { "answer_id": 341603, "author": "Peter Bailey", ...
2008/12/04
[ "https://Stackoverflow.com/questions/341531", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1508/" ]
341,550
<p>I came across a c library for opening files given a Unicode filename. Before opening the file, it first converts the filename to a path by prepending "\\?\". Is there any reason to do this other than to increase the maximum number of characters allowed in the path, per <a href="http://msdn.microsoft.com/en-us/library/aa365247.aspx" rel="noreferrer">this msdn article</a>? </p> <p>It looks like these "\\?\" paths require the Unicode versions of the Windows API and standard library.</p>
[ { "answer_id": 341575, "author": "Head Geek", "author_id": 12193, "author_profile": "https://Stackoverflow.com/users/12193", "pm_score": 1, "selected": false, "text": "MAX_PATH" }, { "answer_id": 352205, "author": "itsadok", "author_id": 7581, "author_profile": "https...
2008/12/04
[ "https://Stackoverflow.com/questions/341550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21784/" ]
341,571
<p>How can I render after executing an action in a restful controller instead of redirecting.</p> <p>I have a controller with standard actions, and I added a special action that adds data to the resource in question, via a form on the #show page (Think comments on a post). I am validating the input from the form and want to re-render the show action on error and redirect to the show action on success.</p> <p>I want to render to save the user from inputting their info twice, but when I try to render the show action with an error in the flash[:notice] I get an error saying that I am not specifying an ID. When I do specify an ID, it tries to render a new template that doesn't exist yet.</p> <p>I am thinking that it should be a as simple as:</p> <pre><code>def add_comment if my_validation? save the object redirect_to :action =&gt; "show", :id =&gt; params[:id] else render :action =&gt; "show", :id =&gt; params[:id] end end </code></pre> <p>This is not my actual code, just something I put together just now as an example.</p>
[ { "answer_id": 341631, "author": "dsimard", "author_id": 42866, "author_profile": "https://Stackoverflow.com/users/42866", "pm_score": 3, "selected": true, "text": "def create\n @obj = TheObject.new(params[:object])\n render :action => :new unless @obj.save\nend\n" }, { "answer...
2008/12/04
[ "https://Stackoverflow.com/questions/341571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24559/" ]
341,578
<p>Our solution has a lot of todo comments, but unfortunately it seems the only way to sort them is by file. Sorting by project would give me a much better overview of what I'm actually responsible for. Just wondering if there's any way to do this or any add-ins that provide better functionality.</p>
[ { "answer_id": 421344, "author": "Luke", "author_id": 327, "author_profile": "https://Stackoverflow.com/users/327", "pm_score": 1, "selected": false, "text": "todo:" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/341578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/327/" ]
341,594
<p>I'm trying to get information like OS version, hard disk space, disk space available, and installed RAM on a Linux system in C++. I know I can use <code>system()</code> to run different Linux commands and capture their output (which is what I'm currently doing) but I was wondering if there's a better way? Is there something in the C++ standard library that I can use to get information from the operating system?</p>
[ { "answer_id": 341610, "author": "Johannes Schaub - litb", "author_id": 34509, "author_profile": "https://Stackoverflow.com/users/34509", "pm_score": 3, "selected": false, "text": "libhal" }, { "answer_id": 341613, "author": "Martin York", "author_id": 14065, "author_...
2008/12/04
[ "https://Stackoverflow.com/questions/341594", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1288/" ]
341,602
<p>How do you implement a last-modified column in SQL?</p> <p>I know for a date-created column you can just set the default value to <code>getdate()</code>. For last-modified I have always used triggers, but it seems like there must be a better way.</p> <p>Thanks.</p>
[ { "answer_id": 341657, "author": "gbn", "author_id": 27535, "author_profile": "https://Stackoverflow.com/users/27535", "pm_score": 2, "selected": false, "text": "UPDATE\n table\nSET\n blah,\n LastUpdatedDateTime = DEFAULT\nWHERE\n foo = bar\n" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/341602", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26/" ]
341,608
<p>What is the default location for the MySQL configuration file on a redhat linux box?</p>
[ { "answer_id": 8635575, "author": "Nugatu", "author_id": 1116282, "author_profile": "https://Stackoverflow.com/users/1116282", "pm_score": 4, "selected": false, "text": "/etc/mysql/my.cnf" }, { "answer_id": 10001648, "author": "ThinkingMonkey", "author_id": 858515, "a...
2008/12/04
[ "https://Stackoverflow.com/questions/341608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42931/" ]
341,619
<p>I'm using MS Sql 2005.</p> <p>Why does this give me the correct results (returns 169 rows)...</p> <pre><code>select * from [import_Data] where [import_Data].name not in ( select [import_Data].name from [import_Data] inner join [resource] on [import_Data].name = [resource].name where [import_Data].ProviderTypeID = 4 and [resource].IsDeleted = 0 ) and [import_Data].ProviderTypeID = 4 </code></pre> <p>But this doesn't (returns 0 rows)...</p> <pre><code>select * from [import_Data] where [import_Data].name not in ( select [resource].name from [resource] where IsDeleted = 0 ) and [import_Data].ProviderTypeID = 4 </code></pre> <p>The only difference between the <code>name</code> columns is that <code>[resource].name</code> is <code>varchar(500)</code> and <code>[import_Data].name</code> is <code>varchar(300)</code>. </p>
[ { "answer_id": 341659, "author": "xahtep", "author_id": 42184, "author_profile": "https://Stackoverflow.com/users/42184", "pm_score": 2, "selected": false, "text": "null" }, { "answer_id": 341667, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Sta...
2008/12/04
[ "https://Stackoverflow.com/questions/341619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24908/" ]
341,624
<p>I have a Spring web application which is configured to use JDK proxying for AOP. The AOP annotations (such as @Transactional) are declared on the interfaces, rather than the implementation classes.</p> <p>The application itself works fine, but when I run the unit tests, it seems to be attempting to use CGLIB for the AOP functionality (instead of JDK proxying). This causes the tests to fail - I've appended the stack trace below.</p> <p>I don't understand why CGLIB is being used when I run the tests, because the Spring configuration is largely the same as when the application is running. One possibly significant difference is that the test configuration uses a <a href="http://static.springframework.org/spring/docs/2.5.0/api/org/springframework/jdbc/datasource/DataSourceTransactionManager.html" rel="noreferrer">DataSourceTransactionManager</a> instead of a JTA transaction manager. The test classes themselves all extend <a href="http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/test/context/junit4/AbstractJUnit4SpringContextTests.html" rel="noreferrer">AbstractJUnit4SpringContextTests</a>, could it be that this class is somehow hard-wired to use CGLIB?</p> <pre><code>Caused by: org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class $Proxy25]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: Cannot subclass final class class $Proxy25 at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:213) at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:110) at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.createProxy(AbstractAutoProxyCreator.java:488) at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:363) at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:324) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:361) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1343) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473) ... 79 more Caused by: java.lang.IllegalArgumentException: Cannot subclass final class class $Proxy25 at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:446) at net.sf.cglib.transform.TransformingClassGenerator.generateClass(TransformingClassGenerator.java:33) at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216) at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:285) at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:201) ... 86 more </code></pre> <p><strong>EDIT: One of the commentators requested that I post the Spring configuration</strong>. I've included it below in abbreviated form (i.e. irrelevant beans and XML namespaces omitted).</p> <p><strong>spring-servlet.xml</strong></p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;beans&gt; &lt;!-- ANNOTATION SUPPORT --&gt; &lt;!-- Include basic annotation support --&gt; &lt;context:annotation-config/&gt; &lt;!-- CONTROLLERS --&gt; &lt;!-- Controllers, force scanning --&gt; &lt;context:component-scan base-package="com.onebigplanet.web.controller,com.onebigplanet.web.ws.*"/&gt; &lt;!-- Post-processor for @Aspect annotated beans, which converts them into AOP advice --&gt; &lt;bean class="org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator"&gt; &lt;property name="proxyTargetClass" value="true"/&gt; &lt;/bean&gt; &lt;!-- An @Aspect bean that converts exceptions thrown in POJO service implementation classes to runtime exceptions --&gt; &lt;bean id="permissionAdvisor" class="com.onebigplanet.web.advisor.PermissionAdvisor"/&gt; &lt;bean id="businessIntelligenceAdvisor" class="com.onebigplanet.web.advisor.bi.BusinessIntelligenceAdvisor"/&gt; &lt;!-- Finds the controllers and sets an interceptor on each one --&gt; &lt;bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"&gt; &lt;property name="interceptors"&gt; &lt;list&gt; &lt;bean class="com.onebigplanet.web.interceptor.PortalInterceptor"/&gt; &lt;/list&gt; &lt;/property&gt; &lt;/bean&gt; &lt;!-- METHOD HANDLER ADAPTER --&gt; &lt;!-- Finds mapping of url through annotation on methods of Controller --&gt; &lt;bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"&gt; &lt;property name="cacheSeconds" value="0"/&gt; &lt;property name="webBindingInitializer"&gt; &lt;bean class="com.onebigplanet.web.binder.WebBindingInitializer"/&gt; &lt;/property&gt; &lt;/bean&gt; &lt;/beans&gt; </code></pre> <p><strong>applicationContext-service.xml</strong></p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;beans&gt; &lt;!-- Declares a bunch of bean post-processors --&gt; &lt;context:annotation-config/&gt; &lt;context:component-scan base-package="com.onebigplanet.service.impl,com.onebigplanet.dao.impl.mysql" annotation-config="false"/&gt; &lt;!-- Property configurer --&gt; &lt;bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt; &lt;property name="location" value="/WEB-INF/obp-service.properties" /&gt; &lt;/bean&gt; &lt;!-- Post-processor for @Aspect annotated beans, which converts them into AOP advice --&gt; &lt;bean class="org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator"/&gt; &lt;!-- An @Aspect bean that converts exceptions thrown in service implementation classes to runtime exceptions --&gt; &lt;bean id="exceptionAdvisor" class="com.onebigplanet.service.advisor.ExceptionAdvisor"/&gt; &lt;bean id="cachingAdvisor" class="com.onebigplanet.service.advisor.CacheAdvisor"/&gt; &lt;bean id="businessIntelligenceAffiliateAdvisor" class="com.onebigplanet.service.advisor.BusinessIntelligenceAffiliateAdvisor"/&gt; &lt;!-- Writable datasource --&gt; &lt;jee:jndi-lookup id="dataSource" jndi-name="java:/ObpDS"/&gt; &lt;!-- ReadOnly datasource --&gt; &lt;jee:jndi-lookup id="readOnlyDataSource" jndi-name="java:/ObpReadOnlyDS"/&gt; &lt;!-- Map the transaction manager to allow easy lookup of a UserTransaction --&gt; &lt;bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"/&gt; &lt;!-- Annotation driven transaction management --&gt; &lt;tx:annotation-driven transaction-manager="transactionManager"/&gt; &lt;/beans&gt; </code></pre> <p><strong>applicationContext-test.xml</strong> This is only included when running the unit tests. It's purpose is to overwrite some of the beans declared in the other config files.</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;beans&gt; &lt;!-- Overwrite the property configurer bean such that it reads the test properties file instead --&gt; &lt;bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt; &lt;property name="location" value="/obp-test.properties"/&gt; &lt;/bean&gt; &lt;!-- All DAOs should use the test datasource --&gt; &lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"&gt; &lt;property name="driverClassName" value="${testDataSource.driverClassName}"/&gt; &lt;property name="url" value="${testDataSource.url}"/&gt; &lt;property name="username" value="${testDataSource.username}"/&gt; &lt;property name="password" value="${testDataSource.password}"/&gt; &lt;/bean&gt; &lt;bean id="readOnlyDataSource" class="org.apache.commons.dbcp.BasicDataSource"&gt; &lt;property name="driverClassName" value="${testDataSource.driverClassName}"/&gt; &lt;property name="url" value="${testDataSource.url}"/&gt; &lt;property name="username" value="${testDataSource.username}"/&gt; &lt;property name="password" value="${testDataSource.password}"/&gt; &lt;/bean&gt; &lt;!-- Overwrite the JTA transaction manager bean defined in applicationContent-service.xml with this one because the implementation of the former is provided by JBoss --&gt; &lt;bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"&gt; &lt;property name="dataSource" ref="dataSource" /&gt; &lt;/bean&gt; &lt;beans&gt; </code></pre>
[ { "answer_id": 345984, "author": "jonathan.cone", "author_id": 42344, "author_profile": "https://Stackoverflow.com/users/42344", "pm_score": 2, "selected": false, "text": "Caused by: java.lang.IllegalArgumentException: Cannot subclass final class class $Proxy25" }, { "answer_id":...
2008/12/04
[ "https://Stackoverflow.com/questions/341624", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
341,649
<p>is there anyway to have an image act as an ajax actionlink? I can only get it to work using text. Thanks for your help!</p>
[ { "answer_id": 451091, "author": "frantisek", "author_id": 53332, "author_profile": "https://Stackoverflow.com/users/53332", "pm_score": 0, "selected": false, "text": "DecodeLinkContent(Html.ActionLink<Home>(c => c.Delete(item.ID), \"<span class=\\\"redC\\\">X</span>\",new { Class = \"no...
2008/12/04
[ "https://Stackoverflow.com/questions/341649", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
341,668
<p>All objects in my program inherit from a Container class. The Container class has a <code>virtual BaseNode* getParent() const;</code> method and a <code>virtual void setParent(BaseNode *p);</code> method. </p> <p>I have a <code>Set</code> class (Set in a tennis match, not a data structure) which has the <code>Match</code> class as it's parent (via <code>setParent()</code>) but since <code>Set</code> inherits from <code>Container</code>, The program creates a tree structure from the top down and the <code>Set</code> class is a child, it doesn't need to have methods to track and maintain information about it's parent beyond what <code>Container</code> provides. </p> <p>The error <code>C++: invalid conversion from ‘BaseNode*’ to ‘Match*’</code> shows up in the method below when I try to compile my program. (<code>Player* getPlayer1() const;</code> only exists in the <code>Match</code> class)</p> <pre><code>Player* Set::getPlayer1() const{ return getParent()-&gt;getPlayer1(); } </code></pre> <p>This is my inheritance structure for Match. (Note that <code>TreeNode</code> is a template)</p> <pre><code>Match -&gt; TreeNode&lt;Set&gt; -&gt; BaseNode -&gt; Container </code></pre> <p>I don't understand why I'm getting a conversation error. I have tried reading my textbook but it's a rather poor reference. Google just provided too much irrelevant information.</p> <p><strong>Edit</strong></p> <pre><code>Player* Set::getPlayer1() const{ return dynamic_cast&lt;Match&gt;(getParent())-&gt;getPlayer1(); } </code></pre> <p>causes</p> <pre><code>error: cannot dynamic_cast ‘#‘obj_type_ref’ not supported by dump_expr#&lt;expression error&gt;((&amp;((const Set*)this)-&gt;Set::&lt;anonymous&gt;))’ (of type ‘class BaseNode*’) to type ‘class Match’ (target is not pointer or reference) </code></pre> <p><strong>Edit 2</strong></p> <p>I just realized I need <code>dynamic_cast&lt;Match*&gt;</code> which works.</p>
[ { "answer_id": 341686, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": 3, "selected": true, "text": "getParent()" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/341668", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16204/" ]
341,682
<p>My hosting provider (pairNetworks) has certain rules for scripts run on the server. I'm trying to compress a file for backup purposes, and would ideally like to use bzip2 to take advantage of its AWESOME compression rate. However, when trying to compress this 90 MB file, the process sometimes runs upwards of 1.5 minutes. One of the resource rules is that a script may only execute for 30 CPU seconds.</p> <p>If I use the nice command to 'nicefy' the process, does that break up the amount of total CPU processing time? Is there a different command I could use in place of nice? Or will I have to use a different compression utility that doesn't take as long?</p> <p>Thanks!</p> <hr> <p><em>EDIT: This is what their support page says:</em></p> <ul> <li>Run any process that requires more than 16MB of memory space. </li> <li>Run any program that requires more than 30 CPU seconds to complete.</li> </ul> <p><em>EDIT: I run this in a bash script from the command line</em></p>
[ { "answer_id": 341688, "author": "bzlm", "author_id": 7724, "author_profile": "https://Stackoverflow.com/users/7724", "pm_score": 3, "selected": false, "text": "nice" }, { "answer_id": 341690, "author": "Rich", "author_id": 42897, "author_profile": "https://Stackoverf...
2008/12/04
[ "https://Stackoverflow.com/questions/341682", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42135/" ]
341,691
<p>I'm trying to pick a perforamnce analyzer to use. I'm a beginner developer and not sure what to look for in a performance analyzer. What are the most important features?</p>
[ { "answer_id": 341768, "author": "Konrad Rudolph", "author_id": 1968, "author_profile": "https://Stackoverflow.com/users/1968", "pm_score": 2, "selected": false, "text": "valgrind" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/341691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
341,695
<p>I need to write some code to analyze whether or not a given user on our site is a bot. If it's a bot, we'll take some specific action. Looking at the User Agent is not something that is successful for anything but friendly bots, as you can specify any user agent you want in a bot. I'm after behaviors of unfriendly bots. Various ideas I've had so far are:</p> <ul> <li>If you don't have a browser ID</li> <li>If you don't have a session ID</li> <li>Unable to write a cookie</li> </ul> <p>Obviously, there are some cases where a legitimate user will look like a bot, but that's ok. Are there other programmatic ways to detect a bot, or either detect something that looks like a bot? </p>
[ { "answer_id": 341710, "author": "Greg", "author_id": 24181, "author_profile": "https://Stackoverflow.com/users/24181", "pm_score": 2, "selected": false, "text": "<script type=\"text/javascript\">\ndocument.write('<img src=\"/not-a-bot.' + 'php\" style=\"display: none;\">');\n</script>\n...
2008/12/04
[ "https://Stackoverflow.com/questions/341695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
341,696
<p>I work with a number of new tech support folks. Sometimes, they like to fix small issues which may not be a high priority for our developers. This requires teaching SVN basics to non-programmers, which I've found can get a little tricky.</p> <p>What resources have you found useful? Are there diagrams you typically utilize to teach SVN?</p>
[ { "answer_id": 341772, "author": "Piotr Lesnicki", "author_id": 38796, "author_profile": "https://Stackoverflow.com/users/38796", "pm_score": 1, "selected": false, "text": ".bak" }, { "answer_id": 342113, "author": "NewCom", "author_id": 33154, "author_profile": "http...
2008/12/04
[ "https://Stackoverflow.com/questions/341696", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13348/" ]
341,708
<p>I'm an email n00b but I am working on an application that sends HTML email with Unicode characters (as my friend noted "enjoy encoding hell").</p> <p>The <code>Subject:</code> header comes from user input and therefore may contain Unicode characters. Some mail clients (like GMail and Outlook 2007) are OK with this, but from my reading it seems the right way to do this is to use <a href="http://en.wikipedia.org/wiki/MIME#Encoded-Word" rel="noreferrer">MIME Encoded-Word encoding</a> for the headers.</p> <p>I cannot find a Ruby library to do this. Is there one?</p> <p>Also, is there a header to add that will tell mail clients to use UTF-8 when displaying the message? We are sending multipart email so our <code>Content-Type</code> is <code>multipart/mixed</code>. Apple Mail.app in particular is not using the right encoding, even though it's specified in the individual parts as being UTF-8.</p>
[ { "answer_id": 341849, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 3, "selected": false, "text": "require \"base64\"\n\nvalue = Base64.encode64(\"Your UTF-8 string\")\nheader = \"=?UTF-8?B?\" + value + \"?=\"\n" }, ...
2008/12/04
[ "https://Stackoverflow.com/questions/341708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17965/" ]
341,723
<p>I'm working with a bit of html and Javascript code that I've taken over from someone else. The page reloads a table of data (via an asynchronous request) every ten seconds, and then re-builds the table using some DOM code. The code in question looks something like this:</p> <pre><code>var blah = xmlres.getElementsByTagName('blah'); for(var i = 0; i &lt; blah.length; i++) { var td = document.createElement('td'); var select = document.createElement('select'); select.setAttribute("...", "..."); select.onchange = function() { onStatusChanged(select, callid, anotherid); }; td.appendChild(select); } </code></pre> <p>When the <code>onchange</code> event is fired for a <code>&lt;select&gt;</code> element however, it seems like the same values are being passed to the <code>onStatusChanged()</code> method for every <code>&lt;select&gt;</code> in the table (I've verified that in each iteration of the loop, <code>callid</code> and <code>anotherid</code> are being given new, distinct values). </p> <p>I suspect this is occuring because of the nature of how I am setting the event handler, with the <code>select.onchange = function()</code> syntax. If I understand how this is working correctly, this syntax sets a closure for the onchange event to be a function which refers to these two references, which end up having a final value of whatever they are set to on the last iteration of the loop. When the event fires, the value referenced by <code>callid</code> and <code>anotherid</code> is the value set in the last iteration, not the value set at the individual iteration.</p> <p>Is there a way that I can copy the value of the parameters I am passing to <code>onStatusChanged()</code>?</p> <p><em>I've changed the title to better reflect the question and the accepted answer.</em></p>
[ { "answer_id": 341759, "author": "Peter Bailey", "author_id": 8815, "author_profile": "https://Stackoverflow.com/users/8815", "pm_score": 7, "selected": true, "text": "var blah = xmlres.getElementsByTagName('blah');\nfor(var i = 0; i < blah.length; i++) {\n var td = document.createEle...
2008/12/04
[ "https://Stackoverflow.com/questions/341723", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4249/" ]
341,734
<p>I've got no experience with this, so i suspect my logic is overly complicated, or perhaps not complete enough to do what I want. </p> <p>I have a basic tile based system, but want to move units over the terrain in a coninuous fashion. Right now they are "teleporting" from one tile to another.</p> <p>I already have a lot of the game logic set up on the tile system,for things like path-finding, cover, terrain type, etc.</p> <p>My first guess it to have a floating point x/y offset from the center of the unit and the center of a tile, having 0.0 being in the center, and 1.0 being on an edge. This would be for each tile a unit overlaps. Then i can do math to figure out which tile the unit is "most" on, and use that tile for the path-finding logic. </p> <p>To make it nice, as the unit moves I'd have it adjust the ofset so that he gradually will position himself with the tile line, and not make a bunch of 90* turns to hit the path'd tiles. I could then do some fancy stuff to make him curve gracefully around corners.</p> <p>For things like wepon distances, i could use the x/y tile distance, then subract out the x/y offsets to get a simple pathagorean distance.</p> <p>What would be a sucessful way to decouple the movement from the tile, and still be able to "link" the unit to the tile? </p>
[ { "answer_id": 341803, "author": "Markus Jarderot", "author_id": 22364, "author_profile": "https://Stackoverflow.com/users/22364", "pm_score": 1, "selected": false, "text": "(3.141592, 2.718282) -> (3, 3)\n" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/341734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42082/" ]
341,737
<p>I have the following query which works except that I would like it to behave differently. Now it looks for all the duplicate rows on <code>url</code> and returns it in the order of number of duplicate urls. I use GROUP_ CONCAT to seperate all the different screen_name's. </p> <p>However there can be multiple rows with the same url and same screen_name. How do I make it so that it only retreives the rows where screen_name is distinct.</p> <pre><code>SELECT url, title, GROUP_CONCAT( screen_name ) , COUNT( t_uid ) FROM `twl_links` WHERE twl_uid =3 AND timestamp &gt;= NOW( ) - INTERVAL 24 HOUR GROUP BY ( url ) ORDER BY COUNT( t_uid ) DESC </code></pre>
[ { "answer_id": 341793, "author": "derobert", "author_id": 27727, "author_profile": "https://Stackoverflow.com/users/27727", "pm_score": 2, "selected": false, "text": "t_uid url title screen_name\n1 http://google.com/ Google bob\n2 ...
2008/12/04
[ "https://Stackoverflow.com/questions/341737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
341,743
<p>I'm used to passing around string like this in my C++ applications:</p> <pre><code>void foo(const std::string&amp; input) { std::cout &lt;&lt; input.size() &lt;&lt; std::endl; } void bar() { foo("stackoverflow"); } </code></pre> <p>Now I have a case where I want the string to be NULL:</p> <pre><code>void baz() { foo("stackoverflow"); foo(NULL); // very bad with foo implementation above } </code></pre> <p>I could change <code>foo</code> to:</p> <pre><code>void foo(const std::string* input) { // TODO: support NULL input std::cout &lt;&lt; input-&gt;size() &lt;&lt; std::endl; } </code></pre> <p>But to pass a string literal or copy a <code>char*</code> to that implementation of <code>foo</code> I need to write something like this:</p> <pre><code>void bar() { string input("hi"); // annoying temporary foo(&amp;input); foo(NULL); // will work as long as foo handles NULL properly } </code></pre> <p>I started thinking about inheriting from <code>std::string</code> and adding a <code>null</code> property, but I'm not so sure it's a good idea. Maybe it is better to simply use a <code>const char*</code> string for parameters that can be NULL, but what if I want to save a copy of the string (or NULL) without having to manage its memory myself? (See <a href="https://stackoverflow.com/questions/312570/what-are-some-of-the-drawbacks-to-using-c-style-strings">What are some of the drawbacks to using C-style strings?</a> etc.)</p> <p>Any clever solution around?</p>
[ { "answer_id": 341751, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 1, "selected": false, "text": "void foo(const char *xinput)\n{\n if (xinput == NULL) {\n // do something exceptional with this\n return...
2008/12/04
[ "https://Stackoverflow.com/questions/341743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20444/" ]
341,781
<p>Does anybody know how I can close all modal dialogs created by Dojo ? Apparently there used to be a dojo.popup.closeAll function, but this is no longer available in the latest version of the Dojo API that comes with Spring JS.</p>
[ { "answer_id": 394987, "author": "user49360", "author_id": 49360, "author_profile": "https://Stackoverflow.com/users/49360", "pm_score": 2, "selected": false, "text": "dijit.registry.filter(function(w){ \n return w && w.declaredClass == \"dijit.Dialog\" \n}).forEach(function(w){ \n ...
2008/12/04
[ "https://Stackoverflow.com/questions/341781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32232/" ]
341,792
<p>If my domain objects implement IDataErrorInfo, and I am using M-V-VM, how do I propagate errors through the ViewModel into the View? If i was binding directly to the model, I would set the "ValidateOnExceptons" and "ValidateOnErrors" properties to true on my binding. But my ViewModel doesn't implement IDataErrorInfo. Only my model. What do I do?</p> <p><strong>Clarification</strong> I am dealing with an existing codebase that implements IDataErrorInfo in the domain objects. I can't just implement IDataErrorInfo in the my view model.</p>
[ { "answer_id": 1591410, "author": "artur02", "author_id": 13937, "author_profile": "https://Stackoverflow.com/users/13937", "pm_score": 2, "selected": false, "text": "<TextBox x:Name=\"title\" VerticalAlignment=\"Top\" TextWrapping=\"Wrap\" Grid.Column=\"1\" MinWidth=\"20\">\n <TextBox....
2008/12/04
[ "https://Stackoverflow.com/questions/341792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17744/" ]
341,807
<p>How do I bind a CheckBoxField in my GridView to an underlying db field that is a string. The string is either "1" or "0" but all the same the GridView won't willingly bind to it. What do I do. What is the best way to have a checkbox in the GridView and have it get and set the string in the database (or the underlying datasource).</p>
[ { "answer_id": 341819, "author": "BenAlabaster", "author_id": 40650, "author_profile": "https://Stackoverflow.com/users/40650", "pm_score": 3, "selected": false, "text": "Checked='<%# DataBinder.Eval(Container.DataItem, \"MyStringField\") = \"1\" %>'\n" }, { "answer_id": 7343120,...
2008/12/04
[ "https://Stackoverflow.com/questions/341807", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4491/" ]
341,810
<p>Suppose you have output like this:</p> <pre><code>Word1 Word2 Word3 Word4 </code></pre> <p>Where the number of spaces between words is arbitrary. I want to break it into an array of words.</p> <p>I used the following code:</p> <pre><code>string[] tokens = new List&lt;String&gt;(input.Split(' ')) .FindAll ( delegate(string token) { return token != String.Empty; } ).ToArray(); </code></pre> <p>Not exactly efficient, but does the job nicely.</p> <p>How would you do it?</p>
[ { "answer_id": 341828, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 5, "selected": true, "text": "string[] tokens = input.Split(new char[] { ' ' },\n StringSplitOptions.RemoveEmptyEntries); \n" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/341810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965/" ]
341,817
<p>I'm porting a relatively simple console program written for Unix to the Windows platform (<a href="http://en.wikipedia.org/wiki/Visual_C++#32-bit_versions" rel="noreferrer">Visual C++ 8.0</a>). All the source files include "unistd.h", which doesn't exist. Removing it, I get complaints about misssing prototypes for 'srandom', 'random', and 'getopt'. I know I can replace the random functions, and I'm pretty sure I can find/hack-up a getopt implementation. </p> <p>But I'm sure others have run into the same challenge. My question is: is there a port of "unistd.h" to Windows? At least one containg those functions which do have a native Windows implementation - I don't need pipes or forking.</p> <p><strong>EDIT</strong>:</p> <p>I know I can create my very own "unistd.h" which contains replacements for the things I need - especially in this case, since it is a limited set. But since it seems like a common problem, I was wondering if someone had done the work already for a bigger subset of the functionality.</p> <p>Switching to a different compiler or environment isn't possible at work - I'm stuck with Visual Studio.</p>
[ { "answer_id": 341941, "author": "e.James", "author_id": 33686, "author_profile": "https://Stackoverflow.com/users/33686", "pm_score": 5, "selected": false, "text": "unistd.h" }, { "answer_id": 826027, "author": "AShelly", "author_id": 10396, "author_profile": "https:...
2008/12/04
[ "https://Stackoverflow.com/questions/341817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10396/" ]
341,831
<p>I need a tool to automatically convert simple HTML into an image. I will be controlling the HTML input which will consist of simple text formatting tags and possibly image links--I don't need to be able to render arbitrary HTML. Is there a simple way to do this? </p> <p>I've looked at the HTML layout engines like Gecko and Webkit, but frankly I'm overwhelmed by the number of options they have--I don't need a complete web browser! Is it possible to use these engines in this way? Can someone steer me in the right direction?</p> <p>Other possibilities like browsershots, rely on screenshots of real browsers, but I'm going to be running this application on a web server with potentially many users so performance is important and I'm afraid this kind of solution won't scale.</p> <p>Ideas?</p> <p>EDIT: Sorry forget to mention that my server is running Linux, so Windows solutions won't help. :)</p>
[ { "answer_id": 29313585, "author": "Brandon Rhodes", "author_id": 85360, "author_profile": "https://Stackoverflow.com/users/85360", "pm_score": 1, "selected": false, "text": "wkhtmltoimage" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/341831", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27478/" ]
341,844
<p>Our company has for many years had multiple domain names to protect our product name. When our webiste was first set up we had all these domain names resolving to on IP address which worked fine until now. We rewrote the site with ASP.NET MVC and now use Recaptcha. The Recaptcha keys are registered to "www.example.com" which is our main domain. We have other domains like "www.examples.com" and "www.ex-ample.com" that points to the same IP address. when someone comes to our site from the alternate domains, Recaptcha doesn't work because the keys aren't registered for that alternate domain. We would like to redirect eveything that comes in from "www.examples.com" to "www.example.com".</p> <p>I have read that you can set up the sites in IIS and use a permanent redirect, but will this work if the domains all point to the same IP address?</p> <p>We also have installed the Rewrite Module for IIS 7 because a lot of our pages moved when we switched to MVC. Is it possible to write a rule and if so how?</p> <p>Is there a better alternative we should be using?</p> <p>Any help to shine some light on this is greatly appreciated.</p> <hr> <p>I have no problem setting up the domains in IIS, will this work if the domains all point to the same IP address? If I go to www.example.com (192.168.1.1) will it ever end up at www.examples.com (192.168.1.1) which redirects to www.example.com and cause an infinate loop because they are on the same IP address?</p> <hr> <p>How would CNAME be done in a Windows 2003 DNS Server?</p>
[ { "answer_id": 341901, "author": "Adam", "author_id": 13320, "author_profile": "https://Stackoverflow.com/users/13320", "pm_score": 1, "selected": true, "text": "127.0.0.1 A example.com\nwww.exmaple.com CNAME example.com\nexamples.com CNAME example.com\nwww.examples...
2008/12/04
[ "https://Stackoverflow.com/questions/341844", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36383/" ]
341,847
<p>I am working on a course leaflet system for the college I work at, leaflets are stored in a database with primary key course_code. I would like the leaflets ideally to get indexed by google how would I achieve this assuming i develop the system in asp.net 2.0. </p> <p>I understand part of getting it indexed is to pass the variables around in the link in my case the course_code, this obviously also allows bookmarking of course leaflets which is nice. What are the specifics of getting the googlebot to trawl the system best.</p>
[ { "answer_id": 343348, "author": "Liam", "author_id": 18333, "author_profile": "https://Stackoverflow.com/users/18333", "pm_score": 0, "selected": false, "text": "wget -r www.example.com\n" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/341847", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16989/" ]
341,848
<p>Given that Decimal.MaxValue = 79228162514264337593543950335m</p> <p>Why does the next line give me 7922816251426433759354395034M in the Local window instead of 7922816251426433759354395033.5m as expected?</p> <p>Decimal target = Decimal.MaxValue / 10m;</p>
[ { "answer_id": 341865, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 4, "selected": true, "text": "using System;\n\nclass Test\n{\n static void Main()\n {\n decimal constant = decimal.MaxValue / 10m;\n ...
2008/12/04
[ "https://Stackoverflow.com/questions/341848", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13266/" ]
341,852
<p>By default when viewing an account in edit mode you have access to Opportunities, Invoices, and Quotes which contain the products being shopped by the account and/or the sales department.</p> <p>I'm trying to determine where to store, display, and use the products that an account has a subscription too. </p> <p>I may not understand the implementation but it seems that there should be "Products" option directly off the root Account management window that will show the user all the products the account has purchased.</p> <p>We are trying to integrate this with our production tracking system where product sales can originate from other channels that will not flow through CRM first. This product subscription does not fit into the Opportunity, Quote, or Invoice model because they are confirmed recurring sales that were automatically purchased via tools like a Public Website, Portal, etc. </p> <p>By enabling this tracking in CRM we can use the advanced find feature to facilitate follow up sales and marketing efforts.</p> <p>Example: Find everyone who is subscribed to model A, so we can notify them of a new holiday campaign where they can get 10% off on all add-ons.</p> <p>It's my assumption that this is a common scenario, however I'd like to better understand how to approach this within the world of Microsoft CRM.</p> <p>Thank you in advance.</p>
[ { "answer_id": 341865, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 4, "selected": true, "text": "using System;\n\nclass Test\n{\n static void Main()\n {\n decimal constant = decimal.MaxValue / 10m;\n ...
2008/12/04
[ "https://Stackoverflow.com/questions/341852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
341,872
<p>I'm starting a project that will be public facing using asp.net mvc. I know there are about a billion php, python, and ruby html sanitizers out there, but does anyone have some pointers to anything good in .net? What are your experiences with what is out there? I know stackoverflow is a site done in asp.net that allows freeform HTML, what does it use?</p>
[ { "answer_id": 8470031, "author": "Brandon Joyce", "author_id": 54050, "author_profile": "https://Stackoverflow.com/users/54050", "pm_score": 2, "selected": false, "text": "var cleanHtml = Sanitizer.GetSafeHtml(unsafeHtml);\n" }, { "answer_id": 50871492, "author": "Sheo Dayal...
2008/12/04
[ "https://Stackoverflow.com/questions/341872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10771/" ]
341,891
<p>I am designing a system which will at some point require to send email notifications. So I am looking for a simple way to do this. Some background: the system will be running on Linux platform, there will be a working SMTP server somewhere on the network, the operator will configure its address, server credentials if required and a list of target email addresses (no, I am NOT working on a mass email system ;-). The process which will need to send the emails will be probably written in C, but super performance is not really a requirement, there won't be a lot of mails to send, so invoking some command-line tool is an acceptable option. Basically, what I tried in the past for similar tasks:</p> <ul> <li>Invoking local sendmail in command-line mode. This is a nightmare, because of the necessity to support the cryptic sendmail config. This is what I would really like to avoid.</li> <li>Talking to SMTP server port directly (EHLO, etc). This IS an option, but a bit too low-level for year 2008 ;-).</li> <li>Using some MUA which talks to local sendmail daemon acting as a mail relay. This is not nice exactly because it requires having local sendmail up and configured. </li> </ul> <p>So what I need is basically some library for C language or a simple command-line MUA which should be able to talk to remote sendmail (i.e. to talk to SMTP server that I tell it to), <b>but not requiring a local mail relay</b>. </p> <p>Any ideas are welcome!</p>
[ { "answer_id": 342081, "author": "Hudson", "author_id": 14105, "author_profile": "https://Stackoverflow.com/users/14105", "pm_score": 0, "selected": false, "text": "use Mail::Mailer;\n\nmy $mailer = Mail::Mailer->new();\n$mailer->open({\n From => $from_address,\n To => $to_...
2008/12/04
[ "https://Stackoverflow.com/questions/341891", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40548/" ]