qid
int64
4
22.2M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
341,900
<p>I'm matching ASP.Net generated elements by ID name, but I have some elements which may render as text boxes or labels depending on the page context. I need to figure out whether the match is to a textbox or label in order to know whether to get the contents by val() or by html().</p> <pre><code>$("[id$=" + endOfIdToMatch + "]").each(function () { //determine whether $(this) is a textbox or label //do stuff }); </code></pre> <p>I found a solution that doesn't work, it just returns "undefined":</p> <pre><code>$("[id$=" + endOfIdToMatch + "]").each(function () { alert($(this).tagName); }); </code></pre> <p>What am I missing?</p>
[ { "answer_id": 341919, "author": "CMPalmer", "author_id": 14894, "author_profile": "https://Stackoverflow.com/users/14894", "pm_score": 3, "selected": false, "text": "$(\"[id$=\" + endOfIdToMatch + \"]\").each(function () {\n alert($(this).attr(tagName));\n});\n" }, { "answer_i...
2008/12/04
[ "https://Stackoverflow.com/questions/341900", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14894/" ]
341,911
<p>I'm trying to run the Camel Example "camel-example-spring-jms" (also at <a href="http://activemq.apache.org/camel/tutorial-jmsremoting.html" rel="nofollow noreferrer">http://activemq.apache.org/camel/tutorial-jmsremoting.html</a>). However, when I try to start Camel using "org.apache.camel.spring.Main" class, I get the error saying</p> <p><strong>"Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [<a href="http://activemq.apache.org/schema/core]" rel="nofollow noreferrer">http://activemq.apache.org/schema/core]</a>"</strong></p> <p>[Note: I'm able to run the example just fine when I use Maven command "mvn exec:java -PCamelServer" ]</p> <p>Can someone please help me understand what might be causing this. A potential resolution hint will not hurt either :)</p> <p>++++++ Error Stack +++++</p> <pre><code>Dec 4, 2008 12:45:01 PM org.apache.camel.util.MainSupport doStart INFO: Apache Camel 1.5.0 starting Dec 4, 2008 12:45:01 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1ac3c08: display name [org.springframework.context.support.ClassPathXmlApplicationContext@1ac3c08]; startup date [Thu Dec 04 12:45:01 EST 2008]; root of context hierarchy Dec 4, 2008 12:45:01 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from file [C:\dev\camel-example-spring-jms\bin\META-INF\spring\camel-server-aop.xml] Dec 4, 2008 12:45:02 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from file [C:\dev\camel-example-spring-jms\bin\META-INF\spring\camel-server.xml] Dec 4, 2008 12:45:03 PM org.apache.camel.util.MainSupport run SEVERE: Failed: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [camel-server.xml] Offending resource: file [C:\dev\camel-example-spring-jms\bin\META-INF\spring\camel-server-aop.xml]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://activemq.apache.org/schema/core] Offending resource: file [C:\dev\camel-example-spring-jms\bin\META-INF\spring\camel-server.xml] org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [camel-server.xml] Offending resource: file [C:\dev\camel-example-spring-jms\bin\META-INF\spring\camel-server-aop.xml]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://activemq.apache.org/schema/core] Offending resource: file [C:\dev\camel-example-spring-jms\bin\META-INF\spring\camel-server.xml] at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:201) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:147) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:132) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:80) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353) at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:93) at org.apache.camel.spring.Main.createDefaultApplicationContext(Main.java:189) at org.apache.camel.spring.Main.doStart(Main.java:152) at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:47) at org.apache.camel.util.MainSupport.run(MainSupport.java:121) at org.apache.camel.util.MainSupport.run(MainSupport.java:310) at org.apache.camel.spring.Main.main(Main.java:72) </code></pre> <p>++++++</p>
[ { "answer_id": 343237, "author": "James Strachan", "author_id": 2068211, "author_profile": "https://Stackoverflow.com/users/2068211", "pm_score": 2, "selected": true, "text": "mvn eclipse:eclipse\n" }, { "answer_id": 404084, "author": "Community", "author_id": -1, "au...
2008/12/04
[ "https://Stackoverflow.com/questions/341911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/325613/" ]
341,933
<p>If I am inserting elements into a wrap panel and there is still space in the panel before it overflows on the next line, can I specifically make it wrap over so that the subsequent elements are on the next line?</p> <p>I am looking for something like this:</p> <pre><code>&lt;WrapPanel&gt; &lt;Element/&gt; &lt;Element/&gt; &lt;NewLine???/&gt; &lt;Element/&gt; &lt;Element/&gt; &lt;Element/&gt; &lt;/WrapPanel&gt; </code></pre>
[ { "answer_id": 341994, "author": "Timothy Khouri", "author_id": 11917, "author_profile": "https://Stackoverflow.com/users/11917", "pm_score": 6, "selected": true, "text": "<WrapPanel>\n <TextBlock>1</TextBlock>\n <TextBlock>2</TextBlock>\n <TextBlock>3</TextBlock>\n <TextBloc...
2008/12/04
[ "https://Stackoverflow.com/questions/341933", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24177/" ]
341,942
<p>This should be easy, but I'm not sure how to best go about it. I have a WinForms app that lets the user type in long descriptions. Occaisionally, they would type in URLs, and the RichTextBox would recognize them and make them clickable when displayed.</p> <p>I'm moving the app to the web, and I'm not sure how to make those same URLs clickable. Is there some semi-automatic way to convert "<a href="http://www.google.com" rel="nofollow noreferrer">http://www.google.com</a>" or "www.google.com" to clickable links? Do I have to resort to RegEx matching?</p>
[ { "answer_id": 341960, "author": "MrKurt", "author_id": 35296, "author_profile": "https://Stackoverflow.com/users/35296", "pm_score": 5, "selected": true, "text": "\\b(?:(?:https?|ftp|file)://|www\\.|ftp\\.)\n (?:\\([-A-Z0-9+&@#/%=~_|$?!:,.]*\\)|[-A-Z0-9+&@#/%=~_|$?!:,.])*\n (?:\\([-A-...
2008/12/04
[ "https://Stackoverflow.com/questions/341942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23935/" ]
341,952
<p>I've got two Django projects on the same server. The first launched several months ago, and has since collected hundreds of user accounts. The second project is launching in a few days, and we'd like the second project to allow users of the first app to authenticate using the same credentials.</p> <p>At first, I was going to simply dump the user table from the first project into the second project, but this would not allow for a synchronous solution (user creates account on project B, does not then have access to project A).</p> <p>Does Django have some way of natively switching database names (since they're on the same server) for user authentication, and then back to the original database when finished with authentication?</p> <p>If not, what do you think would be the best solution for my problem? Also - we're using MySQL.</p>
[ { "answer_id": 342161, "author": "eliego", "author_id": 39092, "author_profile": "https://Stackoverflow.com/users/39092", "pm_score": 2, "selected": false, "text": "DROP TABLE proj2.users;\nCREATE VIEW proj2.users AS SELECT * FROM proj1.users;\n" }, { "answer_id": 342303, "au...
2008/12/04
[ "https://Stackoverflow.com/questions/341952", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22468/" ]
341,953
<p>I am a bit rusty on my Haskell and am looking to ramp back up. One thing I enjoy from F# is the F# Interactive shell integrated with Visual Studio: I can evaluate virtually anything (including function and class definitions) and use F# as a shell. Is there an equivalent in Haskell? When I use <code>ghci</code>, I cannot evaluate function definitions. How do you work around that?</p> <p>My current preferred setting is using Emacs with haskell-mode and opening an interactive ghi interpreter. However, is there a way to evaluate just region of a file?</p>
[ { "answer_id": 342010, "author": "Darius Bacon", "author_id": 27024, "author_profile": "https://Stackoverflow.com/users/27024", "pm_score": 4, "selected": true, "text": "$ ghci\nPrelude> let double n = n + n\nPrelude> double 42\n84\n" }, { "answer_id": 342014, "author": "J Co...
2008/12/04
[ "https://Stackoverflow.com/questions/341953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34596/" ]
341,957
<p>I have a c# struct where I need to forbid calling the no args constructor on it.</p> <pre><code>MyStruct a; /// init a by members // OK MyStruct b = MyStruct.Fact(args); // OK, inits by memebers MyStruct s = new MyStruct(); // can't have that </code></pre> <p>I'm doing this mostly to force explicet values for all members as there are no valid default values and all members must have valid values.</p> <p>In C++ this would be easy, add a private constructor but c# doesn't allow that.</p> <p>Is there a way to prevent the above? </p> <p>I really need to enforce using a factory so preventing all public constructor calls would work just as well.</p> <hr> <p>Full discloser: to avoid a mono dependency, the c# app is being automatically translated to D where <code>new Struct()</code> results in a pointer and this is mucking things up for me. However this question is relevant despite that so just ignore it.</p>
[ { "answer_id": 341977, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 5, "selected": true, "text": "MyStruct ms = new MyStruct();" }, { "answer_id": 35088203, "author": "Eljay", "author_id": 4641116, "...
2008/12/04
[ "https://Stackoverflow.com/questions/341957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1343/" ]
341,966
<p>How is it that tools like this one can make an ajax style call back to a central site? basically they give you a " tag to put on your site where ever it is. So in this widget you have the ability to ask for an email to be sent to you for the page you're currently on. I assume this makes an ajax style call back to share this who sends out the email. But how can they do this with out a proxy on your server and without the browser blocking it as an XSS exploit?</p> <p>Any answers on this would be greatly appreciated thank you for your help. I assume working with the Flickr API would present the same challenges?</p> <p>Link from the title : <a href="http://sharethis.com/" rel="nofollow noreferrer">http://sharethis.com/</a></p>
[ { "answer_id": 342150, "author": "FlySwat", "author_id": 1965, "author_profile": "https://Stackoverflow.com/users/1965", "pm_score": 1, "selected": false, "text": "someFunction(\"Callback Data\");\n" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/341966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42987/" ]
341,971
<p>What is this "Execute Around" idiom (or similar) I've been hearing about? Why might I use it, and why might I not want to use it?</p>
[ { "answer_id": 342016, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 8, "selected": true, "text": "public interface InputStreamAction\n{\n void useStream(InputStream stream) throws IOException;\n}\n\n// Somewhere else...
2008/12/04
[ "https://Stackoverflow.com/questions/341971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4725/" ]
342,031
<p>Does anyone know of a way to monitor table record changes in a SQL Server (2005 or 2008) database from a .Net application? It needs to be able to support multiple clients at a time. Each client will "subscribe" when it starts, and "unsubscribe" when it exits. Multiple users could be accessing the system at once and I want to reflect their changes on the other users client. Then when the client handles the change event, it could update it's local object representing that record. Kind of similar to how Access updates records that are modified are reflected in each form referencing it.</p> <p>I know microsoft has their Microsoft.SqlServer libraries for interacting with a SQL Server. But I'm not sure which concept applies to what I want to do (or what could be bent to apply to what I want to do). The ones that sound like they might be useful are the Management ones or the Replication one.</p> <p>In anticipation of someone asking, "why don't you just requery the table occasionally to look for new information?" I have a large number of tables that I want to monitor and that would be a pain in the butt. Plus if I'm looking for something a bit more elegant.</p> <p>I'm open to suggestions...</p>
[ { "answer_id": 895300, "author": "Aaron", "author_id": 2742, "author_profile": "https://Stackoverflow.com/users/2742", "pm_score": 3, "selected": false, "text": "void Initialization()\n{\n // Create a dependency connection.\n SqlDependency.Start(connectionString, queueName);\n}\n\n...
2008/12/04
[ "https://Stackoverflow.com/questions/342031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34440/" ]
342,032
<p>I was trying to raise a post back event by div tag. I don't know how to do that. AL I could think of is javascript, but that is not what I want. I need to call function of a class inside a event handler. </p>
[ { "answer_id": 342253, "author": "FlySwat", "author_id": 1965, "author_profile": "https://Stackoverflow.com/users/1965", "pm_score": 2, "selected": false, "text": "<div id=\"foo\" onclick=\"__doPostBack('foo','')\">\nClicky!\n</div>\n" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/342032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21918/" ]
342,037
<p>I put together a class yesterday to do some useful task. I started alpha testing, and at some point realized I was adding alpha test related methods to the class itself. It hit me that they don't belong there. After a bit of head scratching I derived a test class from the base class that has access to the protected members as well. I put all of the testing related methods, and set up and tear down in the test class, and left the base class lean and mean as the old saying goes.</p> <p>After browsing around here awhile I found one comment that suggested using this sort of technique by making the testing class a friend of the real class.</p> <p>In retrospect both of those techniques should have been obvious to me.</p> <p><strong>What I am looking for, are techniques for specifically alpha testing/unit testing classes, without adding to the weight of the class being tested.</strong></p> <p><strong>What techniques have you personally used, and recommend?</strong></p>
[ { "answer_id": 342066, "author": "Jeff B", "author_id": 25879, "author_profile": "https://Stackoverflow.com/users/25879", "pm_score": 0, "selected": false, "text": "class myClass\n{\nprivate:\n int foo;\npublic:\n myClass() { foo = 0; }\n}\n" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/342037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7734/" ]
342,044
<p>I'm selecting 1 field from 1 table and storing it into a temp table.</p> <p>Sometimes that table ends up with 0 rows.</p> <p>I want to add that field onto another table that has 20+ fields</p> <p>Regular union won't work for me because of the field # mismatch. Outer wont work for me because there is nothing to compare. NVL doesn't work on the first temp table.</p> <p>Anyone know how to do it?</p> <p><strong>UPDATED:</strong></p> <p>I failed to mention.... When the table that retrieves 1 field finds a match in other cases, this code that I'm using now works....</p> <pre><code>SELECT DISTINCT reqhead_rec.resp_name&lt;br&gt; FROM reqhead_rec, biglist&lt;br&gt; WHERE reqhead_rec.req_no = biglist.req_no AND reqhead_rec.frm = biglist.req_frm&lt;br&gt; INTO TEMP grabname with no log; SELECT biglist.*, grabname.resp_name&lt;br&gt; FROM biglist, grabname&lt;br&gt; ORDER BY prnt_item, account_amt&lt;br&gt; INTO TEMP xxx with no log; </code></pre>
[ { "answer_id": 342068, "author": "Bill Karwin", "author_id": 20860, "author_profile": "https://Stackoverflow.com/users/20860", "pm_score": 2, "selected": false, "text": "SELECT t20.*, t1.*\nFROM table_with_20_columns AS t20\n LEFT OUTER JOIN temp_table_with_1_column AS t1 ON (1=1);\n" ...
2008/12/04
[ "https://Stackoverflow.com/questions/342044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42229/" ]
342,052
<p>I need to increment a String in java from "aaaaaaaa" to "aaaaaab" to "aaaaaac" up through the alphabet, then eventually to "aaaaaaba" to "aaaaaabb" etc. etc.</p> <p>Is there a trick for this?</p>
[ { "answer_id": 342090, "author": "Pyrolistical", "author_id": 21838, "author_profile": "https://Stackoverflow.com/users/21838", "pm_score": 0, "selected": false, "text": "public String(byte[] bytes, String charsetName)\n" }, { "answer_id": 342104, "author": "Joachim Sauer", ...
2008/12/04
[ "https://Stackoverflow.com/questions/342052", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13930/" ]
342,057
<p>This is a continuation of my question about <a href="https://stackoverflow.com/questions/339795/reading-the-superblock">reading the superblock</a>.</p> <p>Let's say I want to target the HFS+ file system in Mac OS X. How could I read sector 2 of the boot disk? As far as I know Unix only provides system calls to read from files, which are never stored at that location.</p> <p>Does this require either 1) the program to run kernel mode, or 2) the program to be written in Assembly? I would prefer to avoid either of these restrictions, particularly the latter.</p>
[ { "answer_id": 342077, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": 4, "selected": true, "text": "/dev/sda" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/342057", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18091/" ]
342,080
<p>I have a little utility that does a search of a number of files. I had to create it because both Google &amp; Windows desktop searches were not finding the appropriate lines in files. The searching works fine (I am willing to improve on it) but one of the things I would like to add to my util is a batch find/replace.</p> <p>So how would be the best way to read a line from a file, compare it to a search term and if it passes, then update the line, and continue through the rest of the file?</p>
[ { "answer_id": 347668, "author": "Emperor XLII", "author_id": 2495, "author_profile": "https://Stackoverflow.com/users/2495", "pm_score": 0, "selected": false, "text": "'a string'" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/342080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18821/" ]
342,088
<p>I have a web app on our intranet (VS 2005). There are a couple pages that don't require the user to be logged into the app (feedback and the default page). I am trying to get the domain and username to display and/or send with the feedback. Is there a way to do this without requiring the user to log in? I've tried <code>this.Request.ServerVariables["LOGON_USER"]</code> and <code>this.User.Identity.Name</code>, but neither of them worked.</p> <p>Edit:<br> I should have mentioned most of the users have Windows 2000 on their machines. It works on my development machine (XP), but not on the production network (where I have 2000).</p>
[ { "answer_id": 342123, "author": "matt_dev", "author_id": 39086, "author_profile": "https://Stackoverflow.com/users/39086", "pm_score": 2, "selected": false, "text": "AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);\n\nWindowsPrincipal principal = (WindowsPri...
2008/12/04
[ "https://Stackoverflow.com/questions/342088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39355/" ]
342,093
<p>Here's my PS1 variable:</p> <pre><code>PS1='\u:\W$(__git_ps1 "\e[32m\][%s]\e[0m\]")$ ' </code></pre> <p>Works great for picking up my Git branch, but it has the unfortunate side-effect of wrapping the lines when the colours are active, so that they overlap when you use long commands.</p> <p>Can anyone with magic PS1 skills help me out to fix this?</p>
[ { "answer_id": 342135, "author": "Aupajo", "author_id": 10407, "author_profile": "https://Stackoverflow.com/users/10407", "pm_score": 7, "selected": true, "text": "PS1='\\u:\\W$(__git_ps1 \"\\[\\e[32m\\][%s]\\[\\e[0m\\]\")$ '\n" }, { "answer_id": 1703567, "author": "SiegeX", ...
2008/12/04
[ "https://Stackoverflow.com/questions/342093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10407/" ]
342,100
<p>I have a Guid.NewGuid() call that is creating an Empty Guid. </p> <p>What would cause such a problem and how can I fix it?</p> <p><b>Edit:</b> The code:<br /></p> <pre><code>&lt;WebMethod()&gt; _ Public Function CreateRow(rowValue As String) as String Dim rowPointer As Guid = System.Guid.NewGuid() Dim rowPointerValue As String = rowPointer.ToString() Try Dim result as Integer = SqlHelper.ExecuteNonQuery(ConnectionString, "Sproc_Name", rowValue, rowPointer) Return result Catch ex as Exception Throw ex End Try End Function </code></pre> <p><strong>Edit:</strong> Turns out that rowPointer was originally being passed to the SqlHelper and not rowPointerValue - This of course is passed as empty, as pointed out in the answers. Changing it to rowPointerValue/rowPointer.ToString() fixed the problem.</p>
[ { "answer_id": 993192, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "Dim g As New Guid();\n\nDim whereDoYouWantToSeeIt As String = g.ToString();\n" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/342100", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33226/" ]
342,101
<p>ok, ive a class and i pass an object as property.</p> <p>the object that i pass is a <code>List&lt;X&gt;</code></p> <p>in my class im trying to access the Object index by reflection BUT I CAN'T!!! </p> <p>Example:</p> <p>this class works i just wrote down the part i want to show you and i need help.</p> <pre><code>class MyClass { private object _recordSet; public object RecordSet { get { return _recordSet; } set { _recordSet = value; } } public string Draw() { system.reflection.Assembly asem = system.reflection.Assembly.getAssembly(_dataSource.GetType()); object instance; instance = asem.CreateInstance(_dataSource.GetType().UnderlyingSystemType.FullName); //to access de Count of my List int recordcount = int.Parse(_dataSource.GetType().GetProperty("Count").GetValue(_dataSource,null)); //i need to do a for(int cont = 0; cont &lt; recordCount; cont++) { _dataSource[cont].Name; // &lt;-- THIS PART IS NOT WORKING!!! because i cant access the Index Directly.... WHAT TO DO!! ??? } } } </code></pre>
[ { "answer_id": 342114, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 4, "selected": true, "text": "object" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/342101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
342,103
<p>I have an SSRS report where the date should be grouped by project category the project code in the category is repeating in side the group how do I suppress the value</p> <p>Please help me to get an idea.</p> <p>Thanks,brijit</p>
[ { "answer_id": 10850941, "author": "H B", "author_id": 521443, "author_profile": "https://Stackoverflow.com/users/521443", "pm_score": 3, "selected": false, "text": "=Fields!ProductCode.Value = Previous(Fields!ProductCode.Value)\n" }, { "answer_id": 28763270, "author": "Nicky...
2008/12/04
[ "https://Stackoverflow.com/questions/342103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
342,116
<p>I have a Viewbox with <code>Stretch=Uniform</code> in order to not distort the content. However, when the frame window is wider or taller than the content, the Viewbox content is always centered.</p> <p>I cannot seem to find any content alignment options on the Viewbox. Is there a way to do this?</p>
[ { "answer_id": 342548, "author": "John Z", "author_id": 43430, "author_profile": "https://Stackoverflow.com/users/43430", "pm_score": 5, "selected": true, "text": "VerticalAlignment=\"Top\"" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/342116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25879/" ]
342,119
<p>I'm trying to use a generic list as a property of the users profile. I'll admit this is probably just making my life harder than it needs to be but I don't want to change the programming model just because the data store struggles.</p> <p>I have this in my web.config</p> <p> </p> <pre><code> &lt;/providers&gt; &lt;properties&gt; ..... &lt;add name="AListProperty" type="System.Collections.Generic.List`1[[System.Int32]]"/&gt; &lt;add name="AnotherListProperty" type="System.Collections.Generic.List`1[[MyNamespace.Web.UI.MyReallySimpleClass]]"&gt; &lt;/properties&gt; &lt;/profile&gt; </code></pre> <p>The first property, "AListProperty" works fine. The second one throws a variety of exceptions depending on how I delcare it in the web.config. MyReallySimpleClass is public, serializable and consists of 2 public fields (at present)</p> <p>So, my questions are 1. Does anyone know where the format for declaring these types in the web.config is documented. 2. What I'm doing wrong? It looks fine, I can't see any semantic difference between the two declarations.</p> <p>Thanks</p>
[ { "answer_id": 342548, "author": "John Z", "author_id": 43430, "author_profile": "https://Stackoverflow.com/users/43430", "pm_score": 5, "selected": true, "text": "VerticalAlignment=\"Top\"" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/342119", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42975/" ]
342,122
<p>What are the best practices for naming ant targets? </p> <p>For example, what would you expect the target "test" to run? All unit tests? All functional tests? Both?</p> <p>What are the standard names used for running different types of tests (unit/functional/all)? Are there standards for target names to deploy software in J2SE? in J2EE?</p> <p>My project uses ant for a java project with junit, Swing applications, and J2EE applications.</p>
[ { "answer_id": 342155, "author": "matt b", "author_id": 4249, "author_profile": "https://Stackoverflow.com/users/4249", "pm_score": 1, "selected": false, "text": "test" }, { "answer_id": 342255, "author": "Rob Hruska", "author_id": 29995, "author_profile": "https://St...
2008/12/04
[ "https://Stackoverflow.com/questions/342122", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6180/" ]
342,131
<p>Is there a way to get Visual Studio to display strings as verbatim strings (prefixed with '@')? I'd like to easily cut strings containing file paths from Visual Studio into Explorer or other apps.</p> <p>Clarification: when VS displays a string in the auto, watch, immediate, etc. window, I'd like it to be formatted as as verbatim string so that I can simple copy it for use elsewhere.</p>
[ { "answer_id": 342165, "author": "a_hardin", "author_id": 1497, "author_profile": "https://Stackoverflow.com/users/1497", "pm_score": 0, "selected": false, "text": "string s = @\"c:\\my folder\\\";\n" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/342131", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43370/" ]
342,140
<p>I would like to keep a static counter in a garbage collected class and increment it using Interlocked::Increment. What's the C++/CLI syntax to do this?</p> <p>I've been trying variations on the following, but no luck so far:</p> <pre><code>ref class Foo { static __int64 _counter; __int64 Next() { return System::Threading::Interlocked::Increment( &amp;_counter ); } }; </code></pre>
[ { "answer_id": 342283, "author": "McKenzieG1", "author_id": 3776, "author_profile": "https://Stackoverflow.com/users/3776", "pm_score": 4, "selected": true, "text": "_int64" }, { "answer_id": 6738677, "author": "Ben Voigt", "author_id": 103167, "author_profile": "http...
2008/12/04
[ "https://Stackoverflow.com/questions/342140", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4540/" ]
342,151
<p>I'm trying to perform a once-through read of a large file (~4GB) using Java 5.0 x64 (on Windows XP).</p> <p>Initially the file read rate is very fast, but gradually the throughput slows down substantially, and my machine seems very unresponsive as time goes on.</p> <p>I've used ProcessExplorer to monitor the File I/O statistics, and it looks like the process initially reads 500MB/sec, but this rate gradually drops to around 20MB/sec.</p> <p>Any ideas on the the best way to maintain File I/O rates, especially with reading large files using Java?</p> <p>Here's some test code that shows the "interval time" continuing to increase. Just pass Main a file that's at least 500MB.</p> <pre><code>import java.io.File; import java.io.RandomAccessFile; public class MultiFileReader { public static void main(String[] args) throws Exception { MultiFileReader mfr = new MultiFileReader(); mfr.go(new File(args[0])); } public void go(final File file) throws Exception { RandomAccessFile raf = new RandomAccessFile(file, "r"); long fileLength = raf.length(); System.out.println("fileLen: " + fileLength); raf.close(); long startTime = System.currentTimeMillis(); doChunk(0, file, 0, fileLength); System.out.println((System.currentTimeMillis() - startTime) + " ms"); } public void doChunk(int threadNum, File file, long start, long end) throws Exception { System.out.println("Starting partition " + start + " to " + end); RandomAccessFile raf = new RandomAccessFile(file, "r"); raf.seek(start); long cur = start; byte buf[] = new byte[1000]; int lastPercentPrinted = 0; long intervalStartTime = System.currentTimeMillis(); while (true) { int numRead = raf.read(buf); if (numRead == -1) { break; } cur += numRead; if (cur &gt;= end) { break; } int percentDone = (int)(100.0 * (cur - start) / (end - start)); if (percentDone % 5 == 0) { if (lastPercentPrinted != percentDone) { lastPercentPrinted = percentDone; System.out.println("Thread" + threadNum + " Percent done: " + percentDone + " Interval time: " + (System.currentTimeMillis() - intervalStartTime)); intervalStartTime = System.currentTimeMillis(); } } } raf.close(); } } </code></pre> <p>Thanks!</p>
[ { "answer_id": 344054, "author": "kohlerm", "author_id": 26056, "author_profile": "https://Stackoverflow.com/users/26056", "pm_score": 0, "selected": false, "text": " // read from the file with buffering\n // and with direct access to the buffer\n\n MyTimer mt = new ...
2008/12/04
[ "https://Stackoverflow.com/questions/342151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
342,152
<p>I was working with a new C++ developer a while back when he asked the question: "Why can't variable names start with numbers?"</p> <p>I couldn't come up with an answer except that some numbers can have text in them (123456L, 123456U) and that wouldn't be possible if the compilers were thinking everything with some amount of alpha characters was a variable name.</p> <p>Was that the right answer? Are there any more reasons?</p> <pre><code>string 2BeOrNot2Be = "that is the question"; // Why won't this compile? </code></pre>
[ { "answer_id": 342176, "author": "Pyrolistical", "author_id": 21838, "author_profile": "https://Stackoverflow.com/users/21838", "pm_score": 7, "selected": false, "text": "int 2d = 42;\ndouble a = 2d;\n" }, { "answer_id": 342192, "author": "skiphoppy", "author_id": 18103, ...
2008/12/04
[ "https://Stackoverflow.com/questions/342152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34183/" ]
342,167
<p>The function below is logging the "0", "z" and the "1" ok... but its not capturing the "Z" (shift-z)... any help would be appreciated...</p> <pre><code>__declspec(dllexport) LRESULT CALLBACK HookProc (UINT nCode, WPARAM wParam, LPARAM lParam) { if ((nCode == HC_ACTION) &amp;&amp; (wParam == WM_KEYUP)) { // This Struct gets infos on typed key KBDLLHOOKSTRUCT hookstruct = *((KBDLLHOOKSTRUCT*)lParam); // Bytes written counter for WriteFile() DWORD Counter; wchar_t Logger[1]; switch (hookstruct.vkCode) { case 060: Logger[0] = L'0'; break; case 061: Logger[0] = L'1'; break; case 90: Logger[0] = L'z'; break; case 116: Logger[0] = L'Z'; break; } // Opening of a logfile. Creating it if it does not exists HANDLE hFile = CreateFile(L"C:\\logfile.txt", GENERIC_WRITE, FILE_SHARE_READ, NULL,OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); // put the file pointer to the end SetFilePointer(hFile,NULL,NULL,FILE_END); // Write the hFile typed in logfile WriteFile(hFile,&amp;Logger,sizeof(Logger),&amp;Counter,NULL); //WriteFile(hFile,&amp;hookstruct.vkCode,sizeof(hookstruct.vkCode),&amp;Counter,NULL); // Close the file CloseHandle(hFile); } } </code></pre>
[ { "answer_id": 342213, "author": "arul", "author_id": 15409, "author_profile": "https://Stackoverflow.com/users/15409", "pm_score": 3, "selected": false, "text": " case 90:\n if(GetKeyState(VK_LSHIFT|VK_RSHIFT)\n Logger[0] = L'Z'; break;\n ...
2008/12/04
[ "https://Stackoverflow.com/questions/342167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37109/" ]
342,171
<p>I have a MFC dialog with 32 CComboBoxes on it that all have the same data in the listbox. Its taking a while to come up, and it looks like part of the delay is the time I need to spend using InsertString() to add all the data to the 32 controls. How can I subclass CComboBox so that the 32 instances share the same data?</p>
[ { "answer_id": 342372, "author": "Rob", "author_id": 9236, "author_profile": "https://Stackoverflow.com/users/9236", "pm_score": 2, "selected": true, "text": "m_wndCombo.SetRedraw(FALSE);\n// Fill combo here\n...\nm_wndCombo.SetRedraw(TRUE);\nm_wndCombo.Invalidate();\n" }, { "ans...
2008/12/04
[ "https://Stackoverflow.com/questions/342171", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6701/" ]
342,181
<p>My application allows the user to enter a numeric value (currency) in a <code>UITextField</code> control, but the keyboard layout that I wish was available is unfortunately not one of the built-in options, so I had to choose the "Numbers &amp; Punctuation" option in Interface Builder. Here's the corresponding dialog window in IB:</p> <p><a href="https://i.stack.imgur.com/FbnvH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FbnvH.png" alt="enter image description here"></a></p> <p>So when my application asks the user for the input, it is displaying the following:</p> <p><a href="https://i.stack.imgur.com/u9tbB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/u9tbB.png" alt="enter image description here"></a></p> <p>Which is perfectly fine, but look at all of the extra keys available to the user! One could easily enter "12;56!" in the text field, and I assume I have to validate that somehow.</p> <p>So my question is: how do I validate currency values entered into a <code>UITextField</code>?</p>
[ { "answer_id": 342231, "author": "Marc Novakowski", "author_id": 27020, "author_profile": "https://Stackoverflow.com/users/27020", "pm_score": 4, "selected": true, "text": "UITextFieldDelegate" }, { "answer_id": 342390, "author": "Matt Gallagher", "author_id": 36103, ...
2008/12/04
[ "https://Stackoverflow.com/questions/342181", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35478/" ]
342,189
<p>I've written a fairly simple java application that allows you to drag your mouse and based on the length of the mouse drag you did, it will shoot a ball in that direction, bouncing off walls as it goes.</p> <p>Here is a quick screenshot:<br> <a href="http://img222.imageshack.us/img222/3179/ballbouncemf9.png">alt text http://img222.imageshack.us/img222/3179/ballbouncemf9.png</a></p> <p>Each one of the circles on the screen is a Ball object. The balls movement is broken down into an x and y vector;</p> <pre><code>public class Ball { public int xPos; public int yPos; public int xVector; public int yVector; public Ball(int xPos, int yPos, int xVector, int yVector) { this.xPos = xPos; this.yPos = yPos; this.xVector = xVector; this.yVector = yVector; } public void step() { posX += xVector; posY += yVector; checkCollisions(); } public void checkCollisions() { // Check if we have collided with a wall // If we have, take the negative of the appropriate vector // Depending on which wall you hit } public void draw() { // draw our circle at it's position } } </code></pre> <p>This works great. All the balls bounce around and around from wall to wall. </p> <p>However, I have decided that I want to be able to include the effects of gravity. I know that objects accelerate toward the earth at 9.8m/s but I don't directly know how this should translate into code. I realize that the yVector will be affected but my experimentation with this didn't have the desired effect I wanted.</p> <p>Ideally, <strong><em>I would like to be able to add some gravity effect to this program and also allow the balls to bounce a few times before settling to the "ground."</em></strong> </p> <p>How can I create this bouncing-elastic, gravity effect? How must I manipulate the speed vectors of the ball on each step? What must be done when it hits the "ground" so that I can allow it to bounce up again, but somewhat shorter then the previous time?</p> <p>Any help is appreciated in pointing me in the right direction.</p> <hr> <p>Thanks you for the comments everyone! It already is working great!</p> <p>In my step() I am adding a gravity constant to my yVector like people suggested and this is my checkCollision():</p> <pre><code>public void checkCollision() { if (posX - radius &lt; 0) // Left Wall? { posX = radius; // Place ball against edge xVector = -(xVector * friction); } else if (posX + radius &gt; rightBound) // Right Wall? { posX = rightBound - radius; // Place ball against edge xVector = -(xVector * friction); } // Same for posY and yVector here. } </code></pre> <p>However, the balls will continue to slide around/roll on the floor. I assume this is because I am simply taking a percentage (90%) of their vectors each bounce and it is never truly zero. Should I add in a check that if the xVector becomes a certain absolute value I should just change it to zero?</p>
[ { "answer_id": 342233, "author": "torb", "author_id": 42986, "author_profile": "https://Stackoverflow.com/users/42986", "pm_score": 1, "selected": false, "text": "public void step()\n{\n posX += xVector;\n posY += yVector;\n\n yVector += g //some constant representing 9.8\n\n ...
2008/12/04
[ "https://Stackoverflow.com/questions/342189", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
342,218
<p>What techniques are available for sending an email via a webpage or a form on a webpage? </p> <p>I've got some background idea that you POST the form data to a script but I've don't really know what a cgi script is (I'd love to learn if this is the suggested method!) or what the current practice is.</p> <p>This is just to provide some way for users to contact the operators. The in-page form seems like it would be easier on the user than ask them to open their mail client. I was also concerned about bots harvesting the contact email address (in the case of mailto: links).</p>
[ { "answer_id": 342240, "author": "Matt Howell", "author_id": 2321, "author_profile": "https://Stackoverflow.com/users/2321", "pm_score": 0, "selected": false, "text": "<a href=\"mailto:someperson@someaddress.com\">Please spam me, kthx</a>\n" }, { "answer_id": 343578, "author"...
2008/12/04
[ "https://Stackoverflow.com/questions/342218", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40443/" ]
342,219
<p>I am trying to select a record out of the table1 by joining table2 and using table2 columns in the WHERE statement. Col1 and Col2 in table1 can be stored in col1 of table2. I need to join col1 of table2 with either the value of col1 or col2 in table1</p> <p>here is the sql statement I created so (pseudo):</p> <pre><code>SELECT t1.Col1, t1.Col2, t1.Col3, t1.Col4 FROM table1 t1 JOIN table2 t2 on t2.Col1 = t1.Col1 or t2.Col1 = t1.Col2 </code></pre> <p>What would be the best way to approach this?</p>
[ { "answer_id": 342241, "author": "Bill Karwin", "author_id": 20860, "author_profile": "https://Stackoverflow.com/users/20860", "pm_score": 4, "selected": true, "text": "... JOIN table2 t2 on t2.Col1 IN (t1.Col1, t1.Col2)\n" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/342219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26327/" ]
342,250
<p>I need to read the value of a property from a file in an Ant script and strip off the first few characters. The property in question is</p> <pre><code>path=file:C:/tmp/templates </code></pre> <p>This property is store in a file that I can access within the ant script via</p> <pre><code>&lt;property file="${web.inf.dir}/config.properties"/&gt; </code></pre> <p>I have two questions:</p> <ol> <li>How do I read the single 'path' property from the loaded property file?</li> <li>How do I remove the leading 'file:' from the property value?</li> </ol> <p>Ultimately, I'd like to have access to the following name-value pair within the Ant script:</p> <pre><code>path=C:/tmp/templates </code></pre> <p>Cheers, Don</p>
[ { "answer_id": 342288, "author": "Rob Hruska", "author_id": 29995, "author_profile": "https://Stackoverflow.com/users/29995", "pm_score": 0, "selected": false, "text": "<target name=\"foo\">\n <property name=\"my.property\" value=\"file:C:/foo/bar\"/>\n <exec executable=\"/bin/cut\" in...
2008/12/04
[ "https://Stackoverflow.com/questions/342250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2648/" ]
342,263
<p>When I try to run the following code (from the REPL) in Clojure:</p> <pre><code>(dotimes [i 5] (.start (Thread. (fn [] (Thread/sleep (rand 1000)) (println (format "Finished %d on %s" i (Thread/currentThread))))))) </code></pre> <p>I get the following error:</p> <pre><code>java.lang.Exception: Unable to resolve symbol: i in this context clojure.lang.Compiler$CompilerException: NO_SOURCE_FILE:6: Unable to resolve symbol: i in this context at clojure.lang.Compiler.analyze(Compiler.java:3713) </code></pre> <p>What am I doing wrong here?</p>
[ { "answer_id": 342454, "author": "Brian Carper", "author_id": 23070, "author_profile": "https://Stackoverflow.com/users/23070", "pm_score": 4, "selected": true, "text": "user> (dotimes [i 5] (.start (Thread. (fn [] (Thread/sleep (rand 1000)) (println (format \"Finished %d on %s\" i (Thre...
2008/12/04
[ "https://Stackoverflow.com/questions/342263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7648/" ]
342,268
<p>I am using the following method to browse for a file:</p> <pre><code> OpenFileDialog.ShowDialog() PictureNameTextEdit.Text = OpenFileDialog.FileName </code></pre> <p>Is there a way get ONLY the file name?</p> <p>The <strong>FileName</strong> method returns the entire path and file name.</p> <p>i.e. I want Foo.txt instead of C:\SomeDirectory\Foo.txt</p>
[ { "answer_id": 342272, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 7, "selected": true, "text": "Path.GetFileName(fullPath)" }, { "answer_id": 1136501, "author": "Community", "author_id": -1, "autho...
2008/12/04
[ "https://Stackoverflow.com/questions/342268", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4964/" ]
342,270
<p>I have a large set of XML files of a propriatary schema -the XML files define binary communication protocol (message structure).</p> <p>I'd like to leverage Google's protocol buffers technology. </p> <p>I am using existing code to load the XML files into an object model (in memory). I'd like to generate a .proto file from that object model. </p> <p>so basically what I am looking for is code/library (in C#/.NET) that represents the .proto file format as an object model and can save that object model into a .proto file.</p> <p>I took a look at Jon Skeet's dotnet-protobufs, I think I understand what it does (generate c# code based on .proto files) </p> <p>However, I didn't figure out if I can use it for my project (it probably has the .proto format object model there, but probably only code that can parse this format and not write it out)</p>
[ { "answer_id": 342272, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 7, "selected": true, "text": "Path.GetFileName(fullPath)" }, { "answer_id": 1136501, "author": "Community", "author_id": -1, "autho...
2008/12/04
[ "https://Stackoverflow.com/questions/342270", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38265/" ]
342,281
<p>I have been tasked with creating a program that will generate an amortization schedule. I have only done a bit of research so far, but I need to calculate out payments, interest per payment and principal per payment. Can any one point me in the right direction to figure this out? While I will be writing this in RPG, I am sure others could make use of this algorithm in the future.</p> <p>(Update) Okay, so how do I calculate based on a 365 day year?</p>
[ { "answer_id": 342338, "author": "Benry", "author_id": 28408, "author_profile": "https://Stackoverflow.com/users/28408", "pm_score": 3, "selected": false, "text": "var balance = 200000; // for example\nvar periods = 360; // 30 years\nvar monthlyRate = (0.065)/12; // 0.065= APR of 6.5% a...
2008/12/04
[ "https://Stackoverflow.com/questions/342281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2535/" ]
342,285
<p>I have a table in a SQL 2005 database that contains a column defined as a xml datatype. I'm trying to write stored proc that queries the xml and returns a resultset from a select statement. I've seen examples of returning scalar values or xml but not how to return a resultset.</p> <p>Am I going to have to use openxml or is there another solution?</p>
[ { "answer_id": 342316, "author": "GalacticCowboy", "author_id": 29638, "author_profile": "https://Stackoverflow.com/users/29638", "pm_score": 2, "selected": false, "text": "select xmlColumnName.value('XpathExpression', 'outputSqlType') from dataTable\n" }, { "answer_id": 342335, ...
2008/12/04
[ "https://Stackoverflow.com/questions/342285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27714/" ]
342,290
<p>I'm looking to inspect SQL statements in Java/jdbc code to ensure that the SQL to be executed is of acceptable quality. Neither PMD not Findbugs appears to have JDBC or sql rules. I could use p6spy to log the SQL and look at that way, but this is manual. </p> <p>I'm wondering if the strategy of of using PMD/Findbugs/etc to create a rule that any string passed to PreparedStatement where there is an "=" or "in" has only parametrized vars on the compare side.</p> <p>Has anyone done this? Or done this by other means?</p>
[ { "answer_id": 342321, "author": "Bill Karwin", "author_id": 20860, "author_profile": "https://Stackoverflow.com/users/20860", "pm_score": 2, "selected": true, "text": "=" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/342290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13753/" ]
342,293
<p>I think the question says it all. I have several monthly processes in stored procedures which take anywhere from a minute to an hour. If I declare them <code>WITH RECOMPILE</code>, an execution plan will be generated each time.</p> <p>If the underlying indexes or statistics or views are changed by the DBA, I don't want anyone to have to go in and force a recompile the SPs with an ALTER or whatever.</p> <p>Is there any downside to this?</p>
[ { "answer_id": 342319, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 1, "selected": false, "text": "WITH RECOMPILE" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/342293", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18255/" ]
342,320
<p>I have a very complicated .NET application that contains cut/copy/paste functionality. I want to enable/disable cut/copy/paste buttons depending on the selected control/content. The app has many user controls. What is the best way to achieve this?</p> <p>Thanks</p>
[ { "answer_id": 342336, "author": "grepsedawk", "author_id": 14388, "author_profile": "https://Stackoverflow.com/users/14388", "pm_score": 0, "selected": false, "text": "textBox.GotFocus += myFunctionalityEnabler;" }, { "answer_id": 342349, "author": "Mike Hall", "author_i...
2008/12/04
[ "https://Stackoverflow.com/questions/342320", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
342,333
<p>I see the following code in the attribute_fu plugin:</p> <pre><code>module AttributeFu module Associations #:nodoc: def self.included(base) #:nodoc: base.class_eval do extend ClassMethods class &lt;&lt; self; alias_method_chain :has_many, :association_option; end class_inheritable_accessor :managed_association_attributes write_inheritable_attribute :managed_association_attributes, [] after_update :save_managed_associations end end ... end end </code></pre> <p>When I try to replace</p> <pre><code>class &lt;&lt; self; alias_method_chain :has_many, :association_option; end </code></pre> <p>with: alias_method_chain :has_many, :association_option?</p> <p>I get the following error</p> <pre><code>/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/core_ext/module/aliasing.rb:31:in `alias_method': undefined method `has_many' for class `ActiveRecord::Base' (NameError) from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/core_ext/module/aliasing.rb:31:in `alias_method_chain' from /home/twong/git/physpace/vendor/plugins/attribute_fu/lib/attribute_fu/associations.rb:9:in `included' </code></pre> <p>I thought those two lines would do the same thing, but it looks like I'm wrong. Can somebody explain my error?</p>
[ { "answer_id": 342341, "author": "mat", "author_id": 42083, "author_profile": "https://Stackoverflow.com/users/42083", "pm_score": 0, "selected": false, "text": "self" }, { "answer_id": 344864, "author": "Matt Burke", "author_id": 29691, "author_profile": "https://Sta...
2008/12/04
[ "https://Stackoverflow.com/questions/342333", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4883/" ]
342,365
<p>What are some good examples of coding guidelines. I'm not really looking for anything specific to a single language.</p> <p>But what should I be doing/evaluating as I write coding guidelines? Such as how flexible should the guidelines and how much should decisions be left to the programmer or to someone else or even pre-decided by the guidelines.</p> <p>This set of guidelines that I am working on is supposed to cover a wide range of topics: comments, database design, and even some user interface guidelines.</p>
[ { "answer_id": 342408, "author": "John MacIntyre", "author_id": 29043, "author_profile": "https://Stackoverflow.com/users/29043", "pm_score": 3, "selected": false, "text": "if( !codingGuidelines.Followed)\n{\n reason = programmer.WhyNot();\n if( reason.Acceptable)\n {\n coding...
2008/12/04
[ "https://Stackoverflow.com/questions/342365", "https://Stackoverflow.com", "https://Stackoverflow.com/users/657/" ]
342,371
<p>Linux 2.6.18-92.el5, ruby 1.8.7, Rails 2.2.2, mysql gem 2.7</p> <p>I installed the MySQL binary distribution under /usr/local, then installed the mysql gem like this:</p> <pre><code>gem install mysql --no-rdoc --no-ri \ -- --with-mysql-include=/usr/local/mysql/include \ --with-mysql-lib=/usr/local/mysql/lib \ --with-mysql-config=/usr/local/mysql/bin/mysql_config </code></pre> <p>When I run <code>irb&gt; require 'mysql'</code> I get the error shown below:</p> <pre><code>irb(main):001:0&gt; require 'rubygems' =&gt; true irb(main):002:0&gt; require 'mysql' LoadError: libmysqlclient.so.16: cannot open shared object file: No such file or directory - /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.so from /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.so from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:36:in `require' from (irb):2 </code></pre> <p>After some Googling I found that I could use <code>ldconfig</code> to configure mysql.so to be available to the whole system. Once I added "/usr/local/ mysql/lib" to /etc/ld.so.conf and ran ldconfig, it worked fine:</p> <pre><code>irb(main):002:0&gt; require 'rubygems' =&gt; true irb(main):003:0&gt; require 'mysql' =&gt; true </code></pre> <p>OK, so I got it to work. But my question is, why was I getting that error? You used to be able to just <code>gem install mysql</code> and it would work. Has anyone else encountered the same error? Using <code>ldconfig</code> seems kind of brittle and unmaintainable. Is there a better solution?</p> <p>Any insight would be greatly appreciated.</p> <p>Thanks,</p> <p>Ethan</p>
[ { "answer_id": 353586, "author": "bradheintz", "author_id": 40093, "author_profile": "https://Stackoverflow.com/users/40093", "pm_score": 3, "selected": true, "text": "gem install mysql" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/342371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42595/" ]
342,378
<p>We offer a number of online services. We are required to develop a system which provides a quick/simple experience for users if they are transferred from one service (on <code>domain1.com</code>) to another service (on <code>domain2.com</code>).</p> <p>Is there a safe and secure way to log a user in automatically once he has been transferred to the new service?</p> <p>Yell at me if the solution below is completely insecure/wrong.</p> <p>We were considering a system similar to that provided by a number of online services for password recovery - they are emailed a link with a unique hash which expires, that allows them to change their password.</p> <p>The <code>domain1.com</code> site would generate a unique hash and store it in a database with the hash linked to a user along with an expire datetime field.</p> <p>The user will be transferred to <code>domain2.com/auto/?hash=d41d8cd98f00b204e9800998ecf8427e</code></p> <p><code>domain2.com</code> would next make a request to <code>domain1.com</code> with the hash to get the information about the user. <code>domain1.com</code> would then remove the hash from the database. <code>domain2.com</code> would log the user in and set cookies, etc.</p> <p>Could something based on OpenID or OAuth achieve the same results?</p>
[ { "answer_id": 342387, "author": "BenAlabaster", "author_id": 40650, "author_profile": "https://Stackoverflow.com/users/40650", "pm_score": 3, "selected": false, "text": "domain1.com" }, { "answer_id": 342498, "author": "Will Hartung", "author_id": 13663, "author_prof...
2008/12/04
[ "https://Stackoverflow.com/questions/342378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35293/" ]
342,409
<p>I have binary data in an unsigned char variable. I need to convert them to PEM base64 in c. I looked in openssl library but i could not find any function. Does any body have any idea?</p>
[ { "answer_id": 342439, "author": "Piotr Lesnicki", "author_id": 38796, "author_profile": "https://Stackoverflow.com/users/38796", "pm_score": 5, "selected": false, "text": "openssl enc" }, { "answer_id": 342755, "author": "Norman Ramsey", "author_id": 41661, "author_p...
2008/12/04
[ "https://Stackoverflow.com/questions/342409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
342,411
<p>I want some of the items to be bold depending on a property of an object i'm putting into the listbox.</p> <p>I think you can do it with changing templates but can't seem to find an example.</p> <p>Thanks!</p>
[ { "answer_id": 342460, "author": "a_hardin", "author_id": 1497, "author_profile": "https://Stackoverflow.com/users/1497", "pm_score": 3, "selected": false, "text": "<ListView x:Name=\"Notes\" Margin=\"4,4,4,4\" \n ItemsSource=\"{Binding Path=CurrentCustomer.CustomerNotes}\"\n ItemTem...
2008/12/04
[ "https://Stackoverflow.com/questions/342411", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
342,434
<p>I'm developing a Django app, and I'm trying to use Python's logging module for error/trace logging. Ideally I'd like to have different loggers configured for different areas of the site. So far I've got all of this working, but one thing has me scratching my head.</p> <p>I have the root logger going to sys.stderr, and I have configured another logger to write to a file. This is in my settings.py file:</p> <pre><code>sviewlog = logging.getLogger('MyApp.views.scans') view_log_handler = logging.FileHandler('C:\\MyApp\\logs\\scan_log.log') view_log_handler.setLevel(logging.INFO) view_log_handler.setFormatter(logging.Formatter('%(asctime)s %(name)-12s %(levelname)-8s %(message)s')) sviewlog.addHandler(view_log_handler) </code></pre> <p>Seems pretty simple. Here's the problem, though: whatever I write to the sviewlog gets written to the log file twice. The root logger only prints it once. It's like addHandler() is being called twice. And when I put my code through a debugger, this is exactly what I see. The code in settings.py is getting executed twice, so two FileHandlers are created and added to the same logger instance. But why? And how do I get around this?</p> <p>Can anyone tell me what's going on here? I've tried moving the sviewlog logger/handler instantiation code to the file where it's used (since that actually seems like the appropriate place to me), but I have the same problem there. Most of the examples I've seen online use only the root logger, and I'd prefer to have multiple loggers.</p>
[ { "answer_id": 343575, "author": "Philippe F", "author_id": 13618, "author_profile": "https://Stackoverflow.com/users/13618", "pm_score": 4, "selected": false, "text": "def init_logging():\n stdoutHandler = logging.StreamHandler( sys.stdout )\n stdoutHandler.setLevel( DEBUG )\n ...
2008/12/04
[ "https://Stackoverflow.com/questions/342434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33775/" ]
342,435
<p>Given an instance <code>x</code> of <code>Callable&lt;T&gt;</code>, how can I run <code>x</code> in a separate process such that I can redirect the standard input and output of the process? For example, is there a way to build a <code>Process</code> from a <code>Callable</code>? Is there a standard <code>Executor</code> that gives control over input and output?</p> <p>[UPDATE] It's not important that the <code>Callable</code> execute in a new process as opposed to a new thread. What I want is to put the <code>Callable</code> instance in a "harness", so that I can control its stdin/stdout. AFAIK, this calls for a new process.</p>
[ { "answer_id": 342476, "author": "noah", "author_id": 12034, "author_profile": "https://Stackoverflow.com/users/12034", "pm_score": 3, "selected": true, "text": "import java.io.InputStream;\nimport java.io.PrintStream;\nimport java.util.concurrent.Callable;\n\n\npublic interface MyCallab...
2008/12/04
[ "https://Stackoverflow.com/questions/342435", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1412/" ]
342,437
<p>Which method makes the most sense for importing a module in python that is version specific? My use case is that I'm writing code that will be deployed into a python 2.3 environment and in a few months be upgraded to python 2.5. This:</p> <pre><code>if sys.version_info[:2] &gt;= (2, 5): from string import Template else: from our.compat.string import Template </code></pre> <p>or this</p> <pre><code>try: from string import Template except ImportError: from our.compat.string import Template </code></pre> <p>I know that either case is equally correct and works correctly but which one is preferable?</p>
[ { "answer_id": 342484, "author": "orip", "author_id": 37020, "author_profile": "https://Stackoverflow.com/users/37020", "pm_score": 6, "selected": true, "text": "Template" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/342437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33786/" ]
342,438
<p>I have many requires and includes and i was wondering if there's something that can help me look at the whole of php code when a webpage is loaded. the reason i'm asking is that after fiddling with some code i cannot put any php code anymore as it will not be "sensed" by the compiler. like if i put anything inside the php tags </p> <p>it won't give me an error saying the function doesn't exist. Thanks to anyone taking the time reading this.</p>
[ { "answer_id": 342463, "author": "benlumley", "author_id": 39161, "author_profile": "https://Stackoverflow.com/users/39161", "pm_score": 3, "selected": true, "text": "error_reporting(E_ALL);\nini_set('display_errors', 1);\n" }, { "answer_id": 1738880, "author": "mattbasta", ...
2008/12/04
[ "https://Stackoverflow.com/questions/342438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/419730/" ]
342,443
<p>I work with an application which uses rather big numbers and I need to store data as an unsigned 64-bit integer. I prefer to just store it without worrying about bit manipulation or anything like that so different programs can use the data in different ways. </p>
[ { "answer_id": 342467, "author": "Ken Gentle", "author_id": 8709, "author_profile": "https://Stackoverflow.com/users/8709", "pm_score": 3, "selected": false, "text": "NUMERIC" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/342443", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10352/" ]
342,455
<p>I'm developing a script that involves creating an email contact and forwarding mail to that contact. Last part of the script is to automatically send a test email to the address to make sure the forwarding works.</p> <p>So I use the following code:</p> <pre><code>[void] [Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Core") [void] [Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Interop.Outlook") $olApp = New-Object Microsoft.Office.Interop.Outlook.ApplicationClass $msg = $olApp.CreateItem(0) $msg.Recipients.Add("me@example.com") $msg.Subject = "test" $msg.Body = "test" $msg.Send() </code></pre> <p>I get an error at line 6: <code>"You cannot call a method on a null-valued expression."</code></p> <p>I run the code at home, it works just fine. Difference: on a domain at work, using Exchange Server at work, using domain account at work.</p> <p>I am using the same version of Powershell and Outlook on both machines. It's preferable to use Outlook to send the message because I already have Outlook open and that way the message will show up in my Sent Items folder.</p>
[ { "answer_id": 38535871, "author": "nickdmax", "author_id": 2524721, "author_profile": "https://Stackoverflow.com/users/2524721", "pm_score": 1, "selected": false, "text": "$msg.Recipients.Add(\"me@example.com\")" } ]
2008/12/04
[ "https://Stackoverflow.com/questions/342455", "https://Stackoverflow.com", "https://Stackoverflow.com/users/456628/" ]
342,468
<p>I've been benchmarking the performance of a framework I'm writing in Perl and I'm getting a 50% decrease in requests per second over our existing codebase (some hit is understandable, because we're going from procedural spaghetti code to an OOP MVC framework).</p> <p>The application is running under mod_perl, and I've added <a href="http://search.cpan.org/dist/Moose/" rel="noreferrer">Moose</a> and all my framework code into the <a href="http://perl.apache.org/docs/2.0/user/config/config.html#C_PerlPostConfigRequire_" rel="noreferrer">startup.pl script</a>, which itself doubled my requests per second amount. I'm looking to further enhance this number to get it as close as possible to the existing amount. The argument is there that this is premature optimisation, but there are a couple of glaring inefficiencies that I'd like to fix and see how it effects performance.</p> <p>Like most frameworks, I have a configuration file and a dispatcher. The config part is handled by <a href="http://search.cpan.org/dist/Config-General/" rel="noreferrer">Config::General</a>, so a bit of IO and parsing is involved to get my config file loaded into the app. The biggest problem I see here is that I'm doing this for EVERY REQUEST that comes in! </p> <p>Running Devel::Dprof on my app points to Config::General::BEGIN and a bunch of related IO modules as one of the major slow points that isn't Moose. So what I'd like to do, and what makes a lot more sense in hindsight is take advantage of mod_perl's persistence and the startup.pl compilation stuff to only do the work to load in the config file once - when the server starts.</p> <p>The problem is that I'm not too familiar with how this would work. </p> <p>Currently each project has a PerlHandler bootstrapping class which is pretty lean and looks like this:</p> <pre><code>use MyApp; MyApp-&gt;new(config_file =&gt; '/path/to/site.config')-&gt;run(); </code></pre> <p>MyApp.pm inherits from the framework Project module, which has this code:</p> <pre><code>my $config = Config::General-&gt;new( -ConfigFile =&gt; $self-&gt;config_file, -InterPolateVars =&gt; 1, ); $self-&gt;config({$config-&gt;getall}); </code></pre> <p>To only do this at compile time, both my bootstrap and Project base modules will have to change (I think), but I'm pretty unsure as to what changes to make and still keep the code nice and lean. Can anyone point me in the right direction here? </p> <p><strong>UPDATE</strong></p> <p>I tried the BEGIN BLOCK in each project module approach as described by ysth in his answer. So I now have:</p> <pre><code>package MyApp::bootstrap; use MyApp; my $config; BEGIN { $config = {Config::General-&gt;new(...)-&gt;getall}; } sub handler { ..etc. MyApp-&gt;new(config =&gt; $config)-&gt;run(); </code></pre> <p>This quick change alone gave me a <strong>50%</strong> increase in requests per second, confirming my thoughts that the config file was a major bottleneck worth fixing. The benchmark figure on our crotchety old dev machine is 60rps, and my framework has went from 30rps to 45rps with this change alone. For those who say Moose is slow and has a compile time hit.. I got the same (50%) increase when compiling all my Moose code at start-up as I did from pre-compiling my config file.</p> <p>The only problem I have now is that this violates the DRY principal since the same Config::General->new code is in every BEGIN block with only the path to the config file differing. I have a few different strategies to limit this, but I just wanted to post the results of this change.</p>
[ { "answer_id": 342482, "author": "ysth", "author_id": 17389, "author_profile": "https://Stackoverflow.com/users/17389", "pm_score": 4, "selected": true, "text": "# this code goes at file scope\nmy $config;\nBEGIN {\n $config = { Config::General->new( ... )->getall }\n}\n\n# when creat...
2008/12/04
[ "https://Stackoverflow.com/questions/342468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3404/" ]
342,509
<p>Is it possible to read the data in the php $_SESSION array in the .htaccess file in Apache? So say I have the following:</p> <pre><code>$_SESSION['foo'] = 'bar'; </code></pre> <p>could I then in .htaccess do something like:</p> <pre><code>RewriteRule bla.png folder/{the php session var foo}/file.png </code></pre> <p>Is that possible?</p> <p>I already have a working workaround but if this is possible it would be way nicer.</p>
[ { "answer_id": 25286371, "author": "jave.web", "author_id": 1835470, "author_profile": "https://Stackoverflow.com/users/1835470", "pm_score": 4, "selected": false, "text": ".ht" } ]
2008/12/05
[ "https://Stackoverflow.com/questions/342509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35197/" ]
342,518
<p><em>Problem:</em> There are a bunch of .lnk files on the C drive that point to the J: drive, but the J: drive is gone, and the P: drive has replaced it. Various tricks have been done to get the .lnk files to still work anyway, but it's getting annoying, and it's time to just fix the things.</p> <p>Using Ruby, Python, WSH.JScript or Perl, can you iterate through an entire directory tree of .lnk files and change them so they point to p:/* instead of j:/*? How would you go about it?</p> <p><em>Note:</em> This is not a total unknown to me, but I ask the question anyway because the API for managing .lnk files in the ways I've found so far seem too cumbersome to be the best known way of doing this. This is one of those desparate "there's got to be a better way" type questions.</p>
[ { "answer_id": 1211860, "author": "Program.X", "author_id": 76037, "author_profile": "https://Stackoverflow.com/users/76037", "pm_score": 2, "selected": false, "text": " dim onlyFolder\n Set onlyFolder =fso.GetFolder(\"C:\\\") \n SearchFolder onlyFolder\n\n' for each aDrive in ...
2008/12/05
[ "https://Stackoverflow.com/questions/342518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42223/" ]
342,528
<p>Can all .NET exception objects be serialized?</p>
[ { "answer_id": 342534, "author": "Matt Briggs", "author_id": 10771, "author_profile": "https://Stackoverflow.com/users/10771", "pm_score": 2, "selected": false, "text": "System.Exception" }, { "answer_id": 342541, "author": "Barry Kelly", "author_id": 3712, "author_pr...
2008/12/05
[ "https://Stackoverflow.com/questions/342528", "https://Stackoverflow.com", "https://Stackoverflow.com/users/781/" ]
342,529
<p>Anybody ever had the error "Installation of the "Microsoft Expression Web 2" product has reported the following error: -2147024873.. " when trying to install Microsoft Expression Web 2 or Microsoft Expression Studio? This is the error I'm getting, but I can't figure out what the problem is. I have no beta or RC or pre beta software installed. I'm using office 2003, already have silverlight and .net 1 ,2 3, 3.5 frameworks installed. I also have 3.6g hd space free.</p> <p>Errors I found in the log file are as follows:</p> <pre><code>LIS: wait for package "{90120000-0115-0409-0000-0000000FF1CE}" to complete caching&lt;br&gt; LIS failed to cache download "{90120000-0115-0409-0000-0000000FF1CE}-C" resource "Setup.xml". Cache Error 0x80070017&lt;br&gt; Source Resolution aborted&lt;br&gt; LIS: start caching file "Setup.xml"&lt;br&gt; LIS failed to cache download "{90120000-0115-0409-0000-0000000FF1CE}-C" resource "branding.xml". Cache Error 0x80070017&lt;br&gt; Source Resolution aborted&lt;br&gt; LIS: start caching file "branding.xml"&lt;br&gt; LIS failed to cache download "{90120000-0115-0409-0000-0000000FF1CE}-C" resource "ShellUI.MST". Cache Error 0x80070017&lt;br&gt; Source Resolution aborted&lt;br&gt; LIS: start caching file "ShellUI.MST"&lt;br&gt; LIS failed to cache download "{90120000-0115-0409-0000-0000000FF1CE}-C" resource "osetupui.dll". Cache Error 0x80070017&lt;br&gt; Source Resolution aborted&lt;br&gt; LIS: start caching file "osetupui.dll" LIS failed to cache download "{90120000-0115-0409-0000-0000000FF1CE}-C" resource "Setup.xml". Cache Error 0x80070017&lt;br&gt; Source Resolution aborted&lt;br&gt; Log level changed from: Standard to: Verbose&lt;br&gt; Error: LIS: Failed to cache download "{90120000-0115-0409-0000-0000000FF1CE}-C" resource "Setup.xml". HResult: 0x80070017. &lt;br&gt; Rolling back chain&lt;br&gt; 12/04/2008 16:11:48 Rolling back package: OfficeMUI.en-us&lt;br&gt; There appears to be no rollback work to do for package: OfficeMUI.en-us path: C:\Documents and Settings\chaj17\Local Settings\Temp\XSetup_Web_2008_12_4_16_1_21\438d1ac8_d88e_46eb_ba69_11fef34cce74\Office.en-us\OfficeMUI.MSI&lt;br&gt; Stopping running ose&lt;br&gt; LIS: start uncaching for download "{90120000-0010-0409-0000-0000000FF1CE}-C"&lt;br&gt; LIS: finished uncaching for download "{90120000-0010-0409-0000-0000000FF1CE}-C"&lt;br&gt; LIS: start uncaching for download "{90120000-002C-0409-0000-0000000FF1CE}-C"&lt;br&gt; LIS: finished uncaching for download "{90120000-002C-0409-0000-0000000FF1CE}-C"&lt;br&gt; LIS: start uncaching for download "{90120000-0045-0000-0000-0000000FF1CE}-C"&lt;br&gt; LIS: finished uncaching for download "{90120000-0045-0000-0000-0000000FF1CE}-C"&lt;br&gt; LIS: start uncaching for download "{90120000-0045-0409-0000-0000000FF1CE}-C"&lt;br&gt; LIS: finished uncaching for download "{90120000-0045-0409-0000-0000000FF1CE}-C"&lt;br&gt; LIS: start uncaching for download "{90120000-0115-0409-0000-0000000FF1CE}-C"&lt;br&gt; LIS: finished uncaching for download "{90120000-0115-0409-0000-0000000FF1CE}-C"&lt;br&gt; Stopping running ose&lt;br&gt; Not showing completion dialog because it was not requested.&lt;br&gt; Catalyst execution finished: 12/04/2008 16:11:52. Return code: -2147024873.&lt;br&gt; PERF: TickCount=3954562 Name=RunSetup Description=End function&lt;br&gt; =========================================================================&lt;br&gt; Error: Installation of the "Microsoft Expression Web 2" product has reported the following error: -2147024873.&lt;br&gt; Info: Config_Products_InstallNew: End installation of new product: Microsoft Expression Web 2&lt;br&gt; Error: Config_Products_Install: Installation of Product Microsoft Expression Web 2 (failed): Installation of the "Microsoft Expression Web 2" product has reported the following error: -2147024873. Stack: at XSetup.OfficePackage.ConfigureNewInstall(Product product) at XSetup.Product.ConfigureNewProduct()&lt;br&gt; Info: Config_Products_InstallNew: End installation of new product: Microsoft Expression Web 2&lt;br&gt; Info: Expecting to find local release notes at 'http://go.microsoft.com/fwlink/?LinkId=114830'.&lt;br&gt; Error: XSetup_DoTasks:: Installation of the "Microsoft Expression Web 2" product has reported the following error: Installation of the "Microsoft Expression Web 2" product has reported the following error: -2147024873.. Stack: at XSetup.XSetupSession.OnDoTasksThreadDoWork(Object sender, DoWorkEventArgs e)&lt;br&gt; Error: Installation of the "Microsoft Expression Web 2" product has reported the following error: Installation of the "Microsoft Expression Web 2" product has reported the following error: -2147024873..&lt;br&gt; Info: End Setup session&lt;br&gt; -------------------------------------------------------------------------------------------------&lt;br&gt; Error: XSetup_DoTasks:: Installation of the "Microsoft Expression Web 2" product has reported the following error: Installation of the "Microsoft Expression Web 2" product has reported the following error: -2147024873.. Stack: at XSetup.XSetupSession.OnDoTasksThreadDoWork(Object sender, DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)&lt;br&gt; </code></pre>
[ { "answer_id": 342534, "author": "Matt Briggs", "author_id": 10771, "author_profile": "https://Stackoverflow.com/users/10771", "pm_score": 2, "selected": false, "text": "System.Exception" }, { "answer_id": 342541, "author": "Barry Kelly", "author_id": 3712, "author_pr...
2008/12/05
[ "https://Stackoverflow.com/questions/342529", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9266/" ]
342,532
<p>I'm trying to animate a block level element using jQuery. The page loads with the element styled with <code>display: none</code>. Id like it to <code>slideDown</code> whilst transparent and then <code>fadeIn</code> the content using the callback, however <code>slideDown</code> appears to set the visibility to full before <code>fadeIn</code> is called, resulting in the content being visible during the <code>slideDown</code> animation.</p> <p>Does anyone know of a way to accomplish this?</p>
[ { "answer_id": 342569, "author": "orip", "author_id": 37020, "author_profile": "https://Stackoverflow.com/users/37020", "pm_score": 0, "selected": false, "text": "$('#hiddenElement').css(\"opacity\", 0).slideDown().animate({opacity:1})\n" }, { "answer_id": 342574, "author": "...
2008/12/05
[ "https://Stackoverflow.com/questions/342532", "https://Stackoverflow.com", "https://Stackoverflow.com/users/199/" ]
342,543
<p>I'm using .net's PrintPreviewDialog and whenever it's generating a preview, it locks up my GUI in the background and makes it look like it has crashed until the preview is finished. Seeing how the .net's page progress window that pops up isn't a dialog, the back ground can be selected which then comes to the front in a half drawn, locked up manner. This also happens when the user clicks the actual "Print" button on the preview dialog, and when I just run PrintDocument.Print(). Is there an easy way to modify the following code to stop the GUI from hanging when the user is waiting for .net to draw the print pages:</p> <pre><code>//just showing a preview, hangs up background GUI on generating the preview // and when user prints straight from the preview this.printPreviewDialog.ShowDialog(this); //just trying to print a .net PrintDocument class, GUI hangs in background // when .net is drawing the pages this.printDocument.Print(); </code></pre>
[ { "answer_id": 373428, "author": "Matthew Savage", "author_id": 18434, "author_profile": "https://Stackoverflow.com/users/18434", "pm_score": 2, "selected": false, "text": "ThreadStart ts = () =>\n{\n printDocument.Print();\n\n // Start the message loop to prevent the thread from f...
2008/12/05
[ "https://Stackoverflow.com/questions/342543", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24571/" ]
342,546
<p>What would be the fastest way, to merge 2 XML files, so I would locate a node in first one, empty it, take all children from the same tag (same node) in second XML and put it in the first one.</p>
[ { "answer_id": 342564, "author": "Zachary Yates", "author_id": 8360, "author_profile": "https://Stackoverflow.com/users/8360", "pm_score": 0, "selected": false, "text": "try\n{\n XmlTextReader xmlreader1 = new XmlTextReader(\"C:\\\\Books1.xml\");\n XmlTextReader xmlreader2 = new Xm...
2008/12/05
[ "https://Stackoverflow.com/questions/342546", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24839/" ]
342,554
<p>Is it possible to create an HTML email signature for <strong>Outlook 2003</strong> or above that doesn't reference external images?</p> <p>That is, using those special "cid" reference but embed the image itself in the signature and not on the file system or network.</p> <p>This is for an web application that generates a "standard" email signature based on various input from a user. It has worked fine so far with a single "embedded" image. But a new feature is going to require the possible addition of multiple tiny images.</p> <p>Getting to user to save one email signature template and one image to the user's machine is about the limit of what I'd like to require of the user. But forcing the user to save multiple images seem to be pushing things a little to far in my opinion.</p> <p>So my problem is trying to embed the images into without having to inconvenience the user with multiple downloads first.</p>
[ { "answer_id": 343276, "author": "Oliver Giesen", "author_id": 9784, "author_profile": "https://Stackoverflow.com/users/9784", "pm_score": 4, "selected": true, "text": "file:///" }, { "answer_id": 2458592, "author": "Adam Patterson", "author_id": 295219, "author_profi...
2008/12/05
[ "https://Stackoverflow.com/questions/342554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19377/" ]
342,556
<p>I am experimenting with the new multiprocessing module in Python 2.6. I am creating several processes each with its own multiprocessor.JoinableQueue instance. Each process spawns one or more worker threads (subclasses of threading.Thread) which share the JoinableQueue instance (passed in through each Thread's <code>__init__</code> method). It seems to generally work but occasionally and unpredictably fails with the following error:</p> <pre><code> File "C:\Documents and Settings\Brian\Desktop\testscript.py", line 49, in run self.queue.task_done() File "C:\Python26\lib\multiprocessing\queues.py", line 293, in task_done raise ValueError('task_done() called too many times') ValueError: task_done() called too many times </code></pre> <p>My Queue get() and task_done() calls are right after each other so they should be equal. Anecdotally this seems to occur only when the work done between the get() and the task_done() is VERY quick. Inserting a small <code>time.sleep(0.01)</code> seems to alleviate the problem.</p> <p>Any ideas what is going on? Can I use a multiprocessor Queue with threads instead of the more traditional (Queue.Queue)?</p> <p>Thanks!</p> <p>-brian</p>
[ { "answer_id": 342586, "author": "jfs", "author_id": 4279, "author_profile": "https://Stackoverflow.com/users/4279", "pm_score": 2, "selected": false, "text": "from multiprocessing import Process, Queue\n\ndef f(q):\n q.put([42, None, 'hello'])\n\n if __name__ == '__main__':\n q =...
2008/12/05
[ "https://Stackoverflow.com/questions/342556", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43233/" ]
342,576
<p>There are a number of run-time differences in compatible code between these two versions of .NET.</p> <p>Here is a list of differences so far:</p> <ul> <li>Graphics.DrawRectangle - differs by 1 pixel</li> <li>Graphics.DrawString - Loses the line wrap if used with a StringFormat with both StringAlignments set to Center.</li> <li>Most file operations - compact framework needs a full path</li> <li><a href="http://blog.opennetcf.com/ctacke/CommentView,guid,80a1fabe-e206-4b93-a0e1-25bfc2185959.aspx" rel="noreferrer">The status of a socket after BeginAccept</a></li> <li>(In WinCE 5 at least) you cannot use a socket to send data synchronously with a timeout (without is okay but you risk hangs)</li> <li>Bitmaps (all Image-derived classes really) behave differently in <a href="http://blog.opennetcf.com/ctacke/2006/08/22/BitmapsInTheCompactFramework.aspx" rel="noreferrer">how their resources are cleaned up</a>. - ctacke</li> <li>The default font for labels and treeviews in the CF was larger - Darwyn</li> <li>When a label is disabled in CF it is just grayed out (the full .net framewark outlines the text with another color) - Darwyn</li> <li>Assembly paths are returned in a different format on the desktop from System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase - Qwertie</li> </ul> <p>Do we also have any more to add?</p>
[ { "answer_id": 391900, "author": "Qwertie", "author_id": 22820, "author_profile": "https://Stackoverflow.com/users/22820", "pm_score": 1, "selected": false, "text": "System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase\n" } ]
2008/12/05
[ "https://Stackoverflow.com/questions/342576", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1143/" ]
342,577
<p>If I have an NSString with a text file in it, how do I get an NSArray of NSString with each NSString containing a line of the file.</p> <p>In 10.5 I did this:</p> <pre><code>NSArray* lines = [str componentsSeparatedByCharactersInSet: [NSCharacterSet newlineCharacterSet]]; </code></pre> <p>But that doesn't work in 10.4, and my program needs to work in 10.4.</p> <p>As well, it needs to work with \r, \n and \r\n line endings. </p>
[ { "answer_id": 342595, "author": "e.James", "author_id": 33686, "author_profile": "https://Stackoverflow.com/users/33686", "pm_score": 4, "selected": true, "text": "unsigned length = [string length];\nunsigned paraStart = 0, paraEnd = 0, contentsEnd = 0;\nNSMutableArray *array = [NSMutab...
2008/12/05
[ "https://Stackoverflow.com/questions/342577", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39138/" ]
342,578
<p>How can the OpenFileDialog View Menu be set to Detail View?</p>
[ { "answer_id": 342611, "author": "DaEagle", "author_id": 43024, "author_profile": "https://Stackoverflow.com/users/43024", "pm_score": 0, "selected": false, "text": "Dim OpenFileDialog1 As New OpenFileDialog\nSendKeys.Send(\"{tab}{tab}{tab}{tab}{tab}{right}{right}{down}{up}{enter}\")\nOp...
2008/12/05
[ "https://Stackoverflow.com/questions/342578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4964/" ]
342,579
<p>A few quick searches discovered that I'm obviously <a href="http://morethanseven.net/2008/10/13/unit-testing-css-looking-solution/" rel="noreferrer">not the</a> <a href="http://www.thoughtballoon.co.uk/blog/2008/11/11/example-css-style-guide-unit-testing-for-css" rel="noreferrer">first person</a> to have the thought <strong>"Can I unit test my CSS?"</strong>. </p> <p>I'm wondering if anyone here has taken on CSS Unit Testing successfully? If you've tried and failed, or just have your own theories, please tell me why it (apparently) hasn't been done yet?</p>
[ { "answer_id": 22340521, "author": "boudu", "author_id": 2608997, "author_profile": "https://Stackoverflow.com/users/2608997", "pm_score": 2, "selected": false, "text": "Ex : base.css / form.css / article.css etc.\n" }, { "answer_id": 24869064, "author": "Heroselohim", "a...
2008/12/05
[ "https://Stackoverflow.com/questions/342579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9021/" ]
342,590
<p>Has anyone implemented sorting a list of domain names?</p> <p>I have seen some applications sort them as flat strings, but the problem is that you end up scattering all the related hosts in a domain:</p> <p>a.me.com a.you.com b.me.com b.you.com</p> <p>So, the basic logic I came up with reverse the order of the labels, then sort.</p> <p>FQDNs of one label should be treated as hostnames, and probably sorted separately, maybe at the top.</p> <p>Ideally I am looking for javascript and java versions.</p> <p>I also don't know if this design works well for the newer internationalized domain names.</p>
[ { "answer_id": 342667, "author": "Tom", "author_id": 40620, "author_profile": "https://Stackoverflow.com/users/40620", "pm_score": 2, "selected": false, "text": "hosts = [\"a.foo.com\", \"b.foo.com\", \"foo.com\", \"c.bar.com\"]\n\nsplit_hosts = []\nfor h in hosts:\n segments = h.spli...
2008/12/05
[ "https://Stackoverflow.com/questions/342590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2910/" ]
342,596
<p>I have a very simple problem and a solution that will work, but I'm looking for a simpler one.</p> <p>I'd like to prevent rows from being added to a database when multiple values equal existing values. For example, if a2=a1 AND b2=b1 then the data gets rejected. If only a2=a1 or only b2=b1 it is allowed. Basically I want it to act like a primary key that requires both values to match.</p> <p>I know I can do this through validation before I write to the database--ex. select * where a='a2' and b='b2' and then avoid writing new data when I get results. What I'd rather do is enable a MySQL setting, like primary key, that will block data like this automatically. </p> <p>I'm not very familiar with MySQL outside of basic features, so apologies if this is trivially easy. Googling for all sorts of things around unique index and primary key did not help.</p>
[ { "answer_id": 342607, "author": "gcores", "author_id": 40256, "author_profile": "https://Stackoverflow.com/users/40256", "pm_score": 4, "selected": true, "text": "CREATE UNIQUE INDEX index_name ON table(col1, col2);\n" }, { "answer_id": 342615, "author": "Stewart Johnson", ...
2008/12/05
[ "https://Stackoverflow.com/questions/342596", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30098/" ]
342,609
<p>I'm writing what will be an intranet application, and one of its features is roughly analogous to content voting - not unlike what SO, Amazon, and many other sites do.</p> <p>Assuming each votable piece of content has a unique ID, and each user (they're authenticated) has a unique ID, the easiest way would seem to be to have a "votes" table...</p> <pre><code>ContentID int UserID int VoteValue int </code></pre> <p>But this creates one row per vote - with millions of pieces of content and tens of thousands of users, that table's gonna be huge huge huge. Is this the best way to do it? I mean, if an int takes 4 bytes, each row takes 12 bytes. If a million pieces of content get a hundred votes, that's 400MB+ in storage, yeah? Seems... like a lot :). Even if the VoteValue is a tinyint (which is probably fine) and only 1 byte, that's still a couple hundred megabytes in the table. I mean sheesh.</p> <p>Is there a smarter way? Should I store this "votes" table in a separate database (ignoring potential data integrity issues) to partition it from the "main" data in terms of storage and performance?</p> <p>(I do realize that in today's world 400MB ain't a ton - but it seems like a LOT just to store votes, yeah?)</p>
[ { "answer_id": 342825, "author": "ysth", "author_id": 17389, "author_profile": "https://Stackoverflow.com/users/17389", "pm_score": 2, "selected": false, "text": " `vote_id` int(11) NOT NULL default '0',\n `voter_user` int(11) NOT NULL default '0',\n `voted_user` int(11) default NULL,\n ...
2008/12/05
[ "https://Stackoverflow.com/questions/342609", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40405/" ]
342,613
<p>How do you manage your database connections in your ASP.Net application?</p> <p>My understanding tells me the "best" way is to open a connection, make a query, close the connection - and do that multiple times because connection pooling makes the cost negligable.</p> <p>The problem comes when I have a DAL where each method looks after its own connection. E.G.</p> <pre> User x = DAL.GetUserDetails(); Customer y = DAL.GetCustomer(); </pre> <p>This is fine until we start talking about TransactionScope</p> <pre> using (TransactionScope t.... { DAL.UpdateCustomer(y); DAL.UpdateUser(x); t.Complete(); } </pre> <p>ASP.Net wants to now use DTC because (I'm guessing) there are multiple connections involved.</p> <p>Someone is going to say "Cache the connection somwhere" but I need to explicitly destroy the connection because of the way I am managing security (execute as / revert) and I don't want to have to make a call on every page to do that because someone will forget to make the call. I could also pass the connection into each method but thats not ideal because the page has to manage a connection.</p> <p>Am I making sense or have I missed something fundamental here?</p>
[ { "answer_id": 342636, "author": "JoshBerke", "author_id": 26160, "author_profile": "https://Stackoverflow.com/users/26160", "pm_score": 2, "selected": true, "text": "using (CustomTS.New())\n{\n CustomerDal.Update()\n userDal.Update()\n}\n" }, { "answer_id": 342759, "author":...
2008/12/05
[ "https://Stackoverflow.com/questions/342613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42975/" ]
342,619
<p>I've been using the Rome API to parse data from an XML feed pretty successfully so for, but have run in to a bit of a snag. </p> <p>Given the following snippet of XML:</p> <p>&lt;entry&gt;<br> &lt;id&gt;uniqueId&lt;/id&gt;<br> &lt;updated&gt;2008-11-05T01:32:35Z&lt;/updated&gt;<br> &lt;mm:status xmlns:mm=&quot;<a href="http://contentprovider.com&amp;quot" rel="nofollow noreferrer">http://contentprovider.com&amp;quot</a>; available=&quot;true&quot;/&gt;<br> &lt;title&gt;Title&lt;/title&gt;<br> ...<br> ...<br>&lt;/entry&gt;</p> <p>Using the SyndEntryImpl class I'm able to use its standard methods (getTitle, getPublishedDate, etc) to pull the title, id, updated date, etc, but havent figured out a way to get the metadata tag (&lt;mm:status ...). </p> <p>Getting a string representation of the feed entry would be an acceptable solution as I'd be able to use string functions to retrieve the information, but even with that I havent found an easy method. </p> <p>Has anyone run in to this in the past?</p> <p>Thanks. </p>
[ { "answer_id": 763083, "author": "Pat", "author_id": 20161, "author_profile": "https://Stackoverflow.com/users/20161", "pm_score": 1, "selected": false, "text": "import com.sun.syndication.io.ModuleGenerator;\nimport com.sun.syndication.io.impl.DateParser;\nimport com.sun.syndication.fee...
2008/12/05
[ "https://Stackoverflow.com/questions/342619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
342,632
<p>Any idea why the following code doesn't print the amount of characters in the input? I've taken this straight from the K&amp;R book. Learning C at the moment and this is really confusing, looks to me like I'm never reaching EOF. If that's the case then why would this be used as an example?</p> <pre><code>#include &lt;stdio.h&gt; main() { double nc; for (nc = 0; getchar() != EOF; ++nc) ; printf("%d\n", nc); } </code></pre>
[ { "answer_id": 342642, "author": "Robert Gamble", "author_id": 25222, "author_profile": "https://Stackoverflow.com/users/25222", "pm_score": 3, "selected": false, "text": "stdin" }, { "answer_id": 342645, "author": "Paige Ruten", "author_id": 813, "author_profile": "h...
2008/12/05
[ "https://Stackoverflow.com/questions/342632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
342,638
<p>I'm coming from a .net background and want to know the accepted way of creating a method that returns a boolean and modifies a string that was passed in via parameter. I understand Strings are immutable in Java so the below snippet will always produce an empty string. I am constrained to return boolean only. Exceptions can't be thrown. If I need to wrap the String class in, say, a StringHolder, what package could I find this in.</p> <pre><code>public static void DoStuff() { String msg = ""; if (GetMessage(msg)) { System.out.println(msg); } } </code></pre>
[ { "answer_id": 342652, "author": "Paul Tomblin", "author_id": 3333, "author_profile": "https://Stackoverflow.com/users/3333", "pm_score": 1, "selected": false, "text": " class StringHolder\n {\n String msg;\n }\n\n StringHolder sMsg = new StringHolder();\n sMsg.msg = \"\";\n if...
2008/12/05
[ "https://Stackoverflow.com/questions/342638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4458/" ]
342,641
<p>I'm looking for guidance on how to use PHP's Mailparse pecl extension. The <a href="http://us2.php.net/manual/en/book.mailparse.php" rel="noreferrer">documentation</a> on the PHP website isn't very helpful. </p> <p>Does anyone have experience with this and care to share a few pointers?</p>
[ { "answer_id": 342652, "author": "Paul Tomblin", "author_id": 3333, "author_profile": "https://Stackoverflow.com/users/3333", "pm_score": 1, "selected": false, "text": " class StringHolder\n {\n String msg;\n }\n\n StringHolder sMsg = new StringHolder();\n sMsg.msg = \"\";\n if...
2008/12/05
[ "https://Stackoverflow.com/questions/342641", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1103/" ]
342,655
<p>I have a strange encounter when creating a GridView using <code>SELECT..WHERE..&lt;field&gt; IN (value1, val2...)</code>.</p> <p>In the "Configure datasource" tab, if i hard code the values <code>SELECT .... WHERE field1 in ('AAA', 'BBB', 'CCC')</code>, the system works well.</p> <p>However, if I define a new parameter and pass in a concatenated string of values using a variable; be it a @session, Control or querystring; e.g. <code>SELECT .... WHERE field1 in @SESSION</code> the result is always empty.</p> <p>I did another experiment by reducing the parameter content to only one single value, it works well.</p> <p>in short, if I hardcode a string of values, it works, if I pass a variable with single value only, it works, but if i pass a varialbe with two values; it failed.</p> <p>Pls advise if I have make any mistake or it is a known bug.</p> <p>BR SDIGI</p>
[ { "answer_id": 12667285, "author": "Hutcho", "author_id": 1710769, "author_profile": "https://Stackoverflow.com/users/1710769", "pm_score": 2, "selected": false, "text": "CREATE PROCEDURE [dbo].[get_bars_in_foo]\n @bars varchar(255)\nAS\nBEGIN\n DECLARE @query AS varchar(MAX)\n ...
2008/12/05
[ "https://Stackoverflow.com/questions/342655", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
342,665
<p>We are using verisign's time stamp service currently, but every so often the time stamp server becomes unavailable - mostly due to our ISP failing.</p> <p>We now timestamp everything we build, even simple dev builds as we had a lot of trouble with Vista not running the unsigned/unstamped files properly.</p> <p>Can we setup a time stamp service to do the same? I've looked around and not really found any information at my current level of knowledge that tells me this can or cannot be done.</p>
[ { "answer_id": 12667285, "author": "Hutcho", "author_id": 1710769, "author_profile": "https://Stackoverflow.com/users/1710769", "pm_score": 2, "selected": false, "text": "CREATE PROCEDURE [dbo].[get_bars_in_foo]\n @bars varchar(255)\nAS\nBEGIN\n DECLARE @query AS varchar(MAX)\n ...
2008/12/05
[ "https://Stackoverflow.com/questions/342665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37558/" ]
342,675
<p>I've got a number of WebService methods that all include some very boilerplate code of wrapping the actual work in a try/catch/finally and performing the same tasks in the catch/finally. So as a way to encapsulate all of the shared catch/finally stuff I wrote a simple generic.</p> <p>This works and really eliminates a bunch of repetitive code but feels klunky, and the syntax is very obtuse. Every time I come back to this my brain gets twisted trying to figure it out (a clear sign it is not a good design). I'm looking for feedback on whether this is a crazy thing to do, and if there is a better way to approach it.</p> <p>Here is my template:</p> <pre><code>public delegate T2 RestfulServiceRequest&lt;T1, T2&gt;(T1 req); static class RestfulService { public static T2 ExceptionHandler&lt;T1, T2&gt;(RestfulServiceRequest&lt;T1, T2&gt; serviceCall, T1 req) { if (req == null) throw new BadRequestException(new ArgumentNullException("Invalid or missing request object")); try { return serviceCall(req); } catch (RestfulException e) { // log it and rethrow Logger.Write(e); throw; } catch (Exception e) { Logger.Error(e); // wrap in a consistent exception for propagation back to caller throw new InternalServerException(e); } finally { Logger.Debug("Complete"); } } } </code></pre> <p>}</p> <p>And here is a usage of it:</p> <pre><code>public class Initialization : IInitialization { // MyMethod thas uses the template public ApplianceInitResp CreateApplianceServer(ApplianceInitReq req) { return RestfulService.ExceptionHandler&lt;ApplianceInitReq, ApplianceInitResp&gt;(delegate(ApplianceInitReq x) { // do some work return new ApplianceInitResp(); }, req); } } </code></pre> <p>}</p>
[ { "answer_id": 342709, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 1, "selected": false, "text": "public interface IServiceResponse { ... }\npublic class ApplianceInitResp : IServiceResponse { ... }\npublic interface ...
2008/12/05
[ "https://Stackoverflow.com/questions/342675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43406/" ]
342,687
<h2>Context</h2> <ul> <li>Take a look at Wordle: <a href="http://www.wordle.net/" rel="noreferrer">http://www.wordle.net/</a></li> <li>It's much better looking than any other word cloud generators I've seen</li> <li>Note: the source is not available - read the FAQ: <a href="http://www.wordle.net/faq#code" rel="noreferrer">http://www.wordle.net/faq#code</a></li> </ul> <h2>My Questions</h2> <ul> <li>Is there an algorithm available that does what Wordle does?</li> <li>If no, what are some alternatives that produces similar kinds of output?</li> </ul> <h2>Why I'm asking</h2> <ul> <li>just curious</li> <li>want to learn</li> </ul>
[ { "answer_id": 1478314, "author": "Jonathan Feinberg", "author_id": 143938, "author_profile": "https://Stackoverflow.com/users/143938", "pm_score": 10, "selected": true, "text": "place the word where it wants to be\nwhile it intersects any of the previously placed words\n move it one ...
2008/12/05
[ "https://Stackoverflow.com/questions/342687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13477/" ]
342,708
<p>Wondering the most efficent way to make a binary search tree into a spell checker by reading in say 1000 word dictionary file and then having it check another document that say has a couple paragraphs. </p>
[ { "answer_id": 342806, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": 1, "selected": false, "text": "- C\n - A\n - R\n - end\n - T\n - T\n - end\n - U\n - P\n - end\n - T\n - end\n" }, ...
2008/12/05
[ "https://Stackoverflow.com/questions/342708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
342,737
<p>When creating links for an an html based email, how critical is it to use absolute links? Also, What are the benefits in using relative links in general?</p>
[ { "answer_id": 342751, "author": "balexandre", "author_id": 28004, "author_profile": "https://Stackoverflow.com/users/28004", "pm_score": 1, "selected": false, "text": "/portal/images/myImage.png\n" } ]
2008/12/05
[ "https://Stackoverflow.com/questions/342737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39781/" ]
342,758
<p>I'd like to implement a UITableView which displays say 20 rows at a time. But given the fact that I might actually have say 120 items to present, I'd like to handle this using some sort of paging:</p> <p>Populate table with first 20 items. When the user does a right-to-left swipe, reload the UITableView with the next 20 items. A left-to-right swipe would show the previous 20 items.</p> <p>I think subclassing UITableView and handle UITouches there is the way to go, but I'm not sure how to handle the touches correctly in order not to interfer with the standard event handling. </p> <p>Eg. if the user just touches (clicks) a row, I want the row to hightlight (selected) and then switch to a detail view presenting data corresponding to the selected row. But if the user does a horizontal swipe, I don't want the row below the swipe to be highlighted (and therefore selected), instead, i want to trigger my loadprevious page / loadnext page handling, which wil reload the table with the according 20 previous or next items, depending on the swipe direction. </p> <p>Any suggestions?</p>
[ { "answer_id": 698824, "author": "Bingosabi", "author_id": 84800, "author_profile": "https://Stackoverflow.com/users/84800", "pm_score": 2, "selected": false, "text": "- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView;\n\n- (NSInteger)tableView:(UITableView *)tableView...
2008/12/05
[ "https://Stackoverflow.com/questions/342758", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
342,767
<p>Hypothetical situation:</p> <p>Suppose I ran a hosting firm where I hosted subdomains for people. You could sign up and give me a few bucks a month, and I'd give you yourname.mycompany.com.</p> <p>Now, say I wanted mail.*.mycompany.com to point to one server and www.*.mycompany.com to point to another.</p> <p>Is this possible? The RFC seems to think not, <a href="http://en.wikipedia.org/wiki/Wildcard_DNS_record" rel="nofollow noreferrer">Wikipedia</a> seems to think not, but what's stopping a DNS server from having enough logic to return the right thing?</p> <p>And if so, are there DNS hosting providers that will do this for me so I don't have to run my own DNS?</p>
[ { "answer_id": 698824, "author": "Bingosabi", "author_id": 84800, "author_profile": "https://Stackoverflow.com/users/84800", "pm_score": 2, "selected": false, "text": "- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView;\n\n- (NSInteger)tableView:(UITableView *)tableView...
2008/12/05
[ "https://Stackoverflow.com/questions/342767", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6010/" ]
342,772
<p>Would anyone happen to know how to convert type <code>LPTSTR</code> to <code>char *</code> in C++?</p>
[ { "answer_id": 342786, "author": "John Z", "author_id": 43430, "author_profile": "https://Stackoverflow.com/users/43430", "pm_score": 3, "selected": false, "text": "LPTSTR szString = _T(\"Testing\");\nchar* pBuffer;\n" }, { "answer_id": 343038, "author": "Mark Ransom", "a...
2008/12/05
[ "https://Stackoverflow.com/questions/342772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37875/" ]
342,777
<p>I'm working on a Zend Framework (1.7) project with a structure loosely based on the structure of the quickstart application - front controller, action controllers, views &amp; models that use Zend_Db_Table to get to the database. One of my main models relies on some expensive joins to pull up its primary listing, so I'm looking into using Zend_Paginator to reduce the number of rows brought back from the database. My problem is that Zend_Paginator only comes with 4 adaptors, none of which really seem to be a good fit for me.</p> <ul> <li><strong>Array</strong> : Building the array to feed to ZP would involve fetching all the records which is what I'm trying to avoid</li> <li><strong>Iterator</strong> : A dumb iterator would present the same problems as an array and a smart one feels like it would be a poor fit for the Model</li> <li><strong>DbSelect</strong> : Getting a DbSelect object up to the Controller would uncomfortably tie the Controller to the inner workings of my DB (not to mention producing raw result rows rather than encapsulated objects)</li> <li><strong>DbTableSelect</strong> : same as DbSelect</li> <li><strong>Null Adapter</strong> : pass all the details back and forth manually.</li> </ul> <p>Passing the paginator into the model feels like it, too, would violate the MVC separation. Is the problem that I've built my model incorrectly, that I'm being to dogmatic about maintaining MVC separation or am I missing a clean, elegant way of sticking all the moving parts together?</p>
[ { "answer_id": 342912, "author": "rg88", "author_id": 11252, "author_profile": "https://Stackoverflow.com/users/11252", "pm_score": 0, "selected": false, "text": "$select = $db->from('users')->order('name'); \n$paginator = new Zend_Paginator(new Zend_Paginator_Adapter_DbSelect($select...
2008/12/05
[ "https://Stackoverflow.com/questions/342777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39413/" ]
342,829
<p>OK I'm redoing this since I messed it up. :) here's the xaml.</p> <pre><code>&lt;Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="ucWaitIndicator.Window1" x:Name="Window" Title="Window1" Width="640" Height="480"&gt; &lt;Window.Resources&gt; &lt;Storyboard x:Key="OnLoaded1"&gt; &lt;DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="path" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" RepeatBehavior="Forever"&gt; &lt;SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="360"/&gt; &lt;/DoubleAnimationUsingKeyFrames&gt; &lt;/Storyboard&gt; &lt;/Window.Resources&gt; &lt;Window.Triggers&gt; &lt;EventTrigger RoutedEvent="FrameworkElement.Loaded"&gt; &lt;BeginStoryboard Storyboard="{StaticResource OnLoaded1}"/&gt; &lt;/EventTrigger&gt; &lt;/Window.Triggers&gt; &lt;Grid x:Name="LayoutRoot"&gt; &lt;Path Data="M180.99244,64C116.37543,64 63.992443,116.38299 63.992443,181 63.992443,245.61742 116.37549,298 180.99244,298 245.60981,298 297.99244,245.61737 297.99244,181 297.99244,116.38304 245.60986,64 180.99244,64z M180.99244,0.5C205.91427,0.5 229.65641,5.5507355 251.25119,14.684582 256.64987,16.968037 261.91435,19.506668 267.02946,22.285378 307.95065,44.515015 339.31398,82.108706 353.37751,127.32482 356.89353,138.6289 359.32811,150.40922 360.56053,162.54492 361.79308,174.68071 361.79307,187.31935 360.56053,199.45508 355.63085,247.99793 331.46539,290.85483 295.8072,320.28259 277.97817,334.9964 257.2756,346.35331 234.66763,353.38507 223.36361,356.90106 211.58325,359.33566 199.44752,360.56808 187.31179,361.80063 174.67315,361.80063 162.53737,360.56808 113.99482,355.63844 71.137715,331.47319 41.70987,295.81476 26.995966,277.98571 15.63918,257.28314 8.6073667,234.67519 5.0914601,223.37117 2.6567941,211.59082 1.4243458,199.45508 0.19188775,187.31935 0.19188165,174.68071 1.4243458,162.54492 6.3541056,114.00227 30.519295,71.145355 66.177677,41.717426 84.006863,27.003489 104.70924,15.646738 127.31726,8.6149235 138.62133,5.0989907 150.40165,2.6643478 162.53737,1.4319025 168.60525,0.81567122 174.76199,0.5 180.99244,0.5z" Margin="10,10,0,0" x:Name="path" RenderTransformOrigin="0.5,0.5" Stretch="Fill" Stroke="Black" Height="77" HorizontalAlignment="Left" VerticalAlignment="Top" Width="77" MouseLeftButtonDown="path_MouseLeftButtonDown" MouseRightButtonDown="path_MouseRightButtonDown"&gt; &lt;Path.RenderTransform&gt; &lt;TransformGroup&gt; &lt;ScaleTransform ScaleX="1" ScaleY="1" /&gt; &lt;SkewTransform AngleX="0" AngleY="0" /&gt; &lt;RotateTransform Angle="0" /&gt; &lt;TranslateTransform X="0" Y="0" /&gt; &lt;/TransformGroup&gt; &lt;/Path.RenderTransform&gt; &lt;Path.Fill&gt; &lt;LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"&gt; &lt;GradientStop Color="Black" Offset="0" /&gt; &lt;GradientStop Color="#FF7E7E7E" Offset="1" /&gt; &lt;/LinearGradientBrush&gt; &lt;/Path.Fill&gt; &lt;/Path&gt; &lt;/Grid&gt; &lt;/Window&gt; </code></pre> <p>It's a continuous animation. In the codebehind I have the following:</p> <pre><code>public partial class Window1 : Window { public Storyboard myStoryboard; public Window1() { this.InitializeComponent(); // Insert code required on object creation below this point. myStoryboard = (Storyboard)TryFindResource("OnLoaded1"); myStoryboard.Begin(); } private void path_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { myStoryboard.Begin(); } private void path_MouseRightButtonDown(object sender, MouseButtonEventArgs e) { myStoryboard.Stop(); } } </code></pre> <p>I get really sporadic control using the start and stop methods. Sometimes a stop works, but only if I've done the rightclick start first. I don't understand why STOP is not stopping it, and start is not starting it?</p> <p>Thanks guys.</p>
[ { "answer_id": 342891, "author": "discorax", "author_id": 30408, "author_profile": "https://Stackoverflow.com/users/30408", "pm_score": 3, "selected": true, "text": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Windows;\nusing Sys...
2008/12/05
[ "https://Stackoverflow.com/questions/342829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22451/" ]
342,843
<p>I want to calculate what is $x percentage of a $total. $x could be 15%, 20%, etc, and $total could be 1000, 2000, etc. So I'd want the 15% of 1000, for example.</p> <p>What is the formula for calculating this? (I know this isn't <em>exactly</em> a coding question but I'm coding this feature and need help!</p>
[ { "answer_id": 342851, "author": "Steven A. Lowe", "author_id": 9345, "author_profile": "https://Stackoverflow.com/users/9345", "pm_score": 3, "selected": false, "text": "percentage = partialAmount / totalAmount\ntotalAmount = partialAmount / percentage\npartialAmount = percentage * tota...
2008/12/05
[ "https://Stackoverflow.com/questions/342843", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
342,844
<p>I'm designing an html email for a Holiday Art Market. The request is simply for graphic design, make it pretty-put the date/time etc., but I'm wondering if I can also implement an RSVP form in the email: Are you coming, yes or no? Can this be done in an email, or do I need to redirect to a website? If it can be done, how?</p> <p>Thanks again SOF community! </p>
[ { "answer_id": 342860, "author": "Steven A. Lowe", "author_id": 9345, "author_profile": "https://Stackoverflow.com/users/9345", "pm_score": 3, "selected": true, "text": "http://www.yourdomain.com/rsvp.aspx?by=email@receiver.com&response=no\n\nhttp://www.yourdomain.com/rsvp.aspx?by=email@...
2008/12/05
[ "https://Stackoverflow.com/questions/342844", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39781/" ]
342,862
<p>I've been trying to refactor a "bit" of code that I'd previously developed. Basically, the project was my response to not knowing how to use XSLT effectively, so I developed an XML transformation system in PHP. The program reads through the tags of an XML file and does something along these lines to convert it to HTML:</p> <pre><code>private function getTemplate(...) { switch ($nodeName) { case "a" : // code here to generate a link tag break; case "box" : // code here to generate the divs and whatnot to create a box break; case "ref" : // look up an external reference file and include a bibliography break; default : // do the default thing } } </code></pre> <p>That was all working great, except that I ended up with 26 branches to my switch, and that once switch block was over 1000 lines of code. Needless to say, it made maintenance slightly more difficult.</p> <p>What I've done now is to pull the code of each branch out into its own file (named "a.php", "box.php", "ref.php" ...) and <code>include</code> that file each time:</p> <pre><code>if (file_exists("templates/$nodeName.php")) { include "templates/$nodeName.php"; } else { // do the default thing } </code></pre> <p>Again, this works, but benchmarking it shows that it has slowed down processing times by 50%. I'm assuming that this is because there's now up to 4000 <code>include</code>s being done now.</p> <p>What I was considering was to put the code for each template into a function, and if the function hasn't been declared then include the file, and then run the function - the only problem with that is that the existing code has been written in the scope of the original function, using <code>$this</code>, etc.</p> <p>Given that this code is not run in real time (eg: it merely processes the XML into static HTML files which are stored - it's not done on the fly), do you have any advice for me here?</p>
[ { "answer_id": 342877, "author": "Steven A. Lowe", "author_id": 9345, "author_profile": "https://Stackoverflow.com/users/9345", "pm_score": 2, "selected": false, "text": "private function getTemplate(...) \n{\n $func = $nodeName + \"_converter\";\n if (function_exists($func)) //...
2008/12/05
[ "https://Stackoverflow.com/questions/342862", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9021/" ]
342,896
<p>I am planning to use this to poll a database which can take close to 10-15 minutes or more, so should I be using timers for this.</p>
[ { "answer_id": 343766, "author": "Tom Hawtin - tackline", "author_id": 4725, "author_profile": "https://Stackoverflow.com/users/4725", "pm_score": 1, "selected": false, "text": "java.util.concurrent.ScheduledThreadPoolExecutor" } ]
2008/12/05
[ "https://Stackoverflow.com/questions/342896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
342,910
<p>This is the trace of my app,when I updated my device to 2.2.</p> <p>any idea to get rid of this leak? because I think that's the culprit who keep crashing my application.<br> This is trace when I run my application in os2.2,see the image which show the part which might be generating leak,and if you can give me some hints to resolve it, will be greatly appreciated.</p> <p><a href="http://origindata.wapfly.com.au/extra/Picture%204.png" rel="nofollow noreferrer">alt text http://origindata.wapfly.com.au/extra/Picture%204.png</a></p> <p><a href="http://origindata.wapfly.com.au/extra/Picture%203.png" rel="nofollow noreferrer">alt text http://origindata.wapfly.com.au/extra/Picture%203.png</a> This is trace when I run my application in os2.1.it's very wired issue. <a href="http://origindata.wapfly.com.au/extra/Picture%205.png" rel="nofollow noreferrer">alt text http://origindata.wapfly.com.au/extra/Picture%205.png</a></p>
[ { "answer_id": 346038, "author": "wisequark", "author_id": 33159, "author_profile": "https://Stackoverflow.com/users/33159", "pm_score": 1, "selected": false, "text": "scan-build xcodebuild" } ]
2008/12/05
[ "https://Stackoverflow.com/questions/342910", "https://Stackoverflow.com", "https://Stackoverflow.com/users/451867/" ]
342,933
<p>I'd like to put in an UIButton in the center of the navigation bar. Based on the document, it appears I need to set title view, and make sure the leftBarButtonItem is nil. But it is not work for me. Here is the code.</p> <pre><code>UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [btn setTitle:@"List" forState:UIControlStateNormal]; self.navigationItem.leftBarButtonItem = nil; [self.navigationItem.titleView addSubview:btn]; </code></pre>
[ { "answer_id": 342952, "author": "August", "author_id": 30966, "author_profile": "https://Stackoverflow.com/users/30966", "pm_score": 3, "selected": false, "text": "self.navigationItem.titleView = btn;\n" }, { "answer_id": 346035, "author": "wisequark", "author_id": 33159...
2008/12/05
[ "https://Stackoverflow.com/questions/342933", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32096/" ]
342,954
<p>A bit of a neophyte haskell question, but I came across this example in Haskell's <a href="http://www.haskell.org/haskellwiki/99_questions/1_to_10" rel="noreferrer">tutorial examples</a>. For "find the last element of a list" there are some obvious versions, like </p> <pre><code>last' [x] = x last' (_:xs) = last' xs </code></pre> <p>But I can't make sense of an alternate version presented: </p> <pre><code>myLast' = foldr1 (const id) </code></pre> <p>So, in trying to make sense of what the application of the id function is doing, I tried in ghci:</p> <pre><code>const id 1 2 -&gt; gives 2 </code></pre> <p>This binds like this:</p> <pre><code>(const id) 1 2 -&gt; gives 2 </code></pre> <p>And not like this:</p> <pre><code> const (id 1) 2 -&gt; gives 1 </code></pre> <p>But I'm not making sense of this. <code>(const id)</code> should translate to something like </p> <pre><code>`(\x y-&gt;x) (\x-&gt;x)` </code></pre> <p>Shouldn't this return a function that simply returns the id of its first element? Or, how is the function order making (const id) behave differently than const? </p>
[ { "answer_id": 343036, "author": "Chris Conway", "author_id": 1412, "author_profile": "https://Stackoverflow.com/users/1412", "pm_score": 6, "selected": true, "text": "const" }, { "answer_id": 348064, "author": "Magnus", "author_id": 34996, "author_profile": "https://...
2008/12/05
[ "https://Stackoverflow.com/questions/342954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19479/" ]
342,961
<p>When you are developing a web-based application and you want to allow richly formatted text from the user you have to make a choice about how to allow that input. Many different markup languages have been created because it is arguably more difficult to sanitize HTML.</p> <p>What are the advantages and disadvantages of the various different markup languages like:</p> <ul> <li><a href="http://en.wikipedia.org/wiki/HTML" rel="noreferrer">HTML</a> </li> <li><a href="http://daringfireball.net/projects/markdown/" rel="noreferrer">Markdown</a></li> <li><a href="http://en.wikipedia.org/wiki/BBCode" rel="noreferrer">BBCode</a></li> <li><a href="http://www.textism.com/tools/textile/" rel="noreferrer">Textile</a></li> <li><a href="http://www.mediawiki.org/" rel="noreferrer">MediaWiki markup</a></li> <li><a href="http://en.wikipedia.org/wiki/Lightweight_markup_language" rel="noreferrer">other</a></li> </ul> <p>Or to put it differently, what factors do you consider when choosing to use a particular markup language.</p>
[ { "answer_id": 17640402, "author": "Community", "author_id": 2327283, "author_profile": "https://Stackoverflow.com/users/2327283", "pm_score": 0, "selected": false, "text": "<li>" } ]
2008/12/05
[ "https://Stackoverflow.com/questions/342961", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20267/" ]
342,964
<p>Suppose I have this interface</p> <pre><code>public interface IFoo { ///&lt;summary&gt; /// Foo method ///&lt;/summary&gt; void Foo(); ///&lt;summary&gt; /// Bar method ///&lt;/summary&gt; void Bar(); ///&lt;summary&gt; /// Situation normal ///&lt;/summary&gt; void Snafu(); } </code></pre> <p>And this class</p> <pre><code>public class Foo : IFoo { public void Foo() { ... } public void Bar() { ... } public void Snafu() { ... } } </code></pre> <p>Is there a way, or is there a tool that can let me automatically put in the comments of each member in a base class or interface?</p> <p>Because I hate re-writing the same comments for each derived sub-class!</p>
[ { "answer_id": 342968, "author": "James Curran", "author_id": 12725, "author_profile": "https://Stackoverflow.com/users/12725", "pm_score": 5, "selected": true, "text": "FlingThing()" }, { "answer_id": 343072, "author": "Dennis", "author_id": 73025, "author_profile": ...
2008/12/05
[ "https://Stackoverflow.com/questions/342964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18731/" ]
342,966
<p>How do I group search results returned by Lucene by fields (similar to SQL Server's)?</p>
[ { "answer_id": 343120, "author": "erickson", "author_id": 3474, "author_profile": "https://Stackoverflow.com/users/3474", "pm_score": 0, "selected": false, "text": "org.apache.lucene.search.Sort" }, { "answer_id": 7517135, "author": "mihaicc", "author_id": 648904, "au...
2008/12/05
[ "https://Stackoverflow.com/questions/342966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43478/" ]
342,969
<p>Case in point: </p> <p>I'm a on mac with bash v3.2.17, I'm using git installed via macports with the bash_completion variant.</p> <p>When I type <code>git checkout m&lt;tab&gt;</code>. for example, I get it completed to <code>master</code>.</p> <p>However, I've got an alias to <code>git checkout</code>, <code>gco</code>. When I type <code>gco m&lt;tab&gt;</code>, I don't get the branch name autocompleted.</p> <p>Ideally I'd like autocompletion to just magically work for all my aliases. Is it possible? Failing that, I'd like to manually customize it for each alias. So, how do I go about either?</p>
[ { "answer_id": 343013, "author": "Chris Lloyd", "author_id": 42413, "author_profile": "https://Stackoverflow.com/users/42413", "pm_score": 4, "selected": false, "text": "git-completion.bash" }, { "answer_id": 344211, "author": "mipadi", "author_id": 28804, "author_pro...
2008/12/05
[ "https://Stackoverflow.com/questions/342969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13989/" ]
342,973
<p>We use Perl for GUI test automation. It has been very successful. We have written a very lightweight DSL kind of language for GUI testing. The DSL is very similar to a object model.</p> <p>For example, we have an Application object at the root. Each property sheet in the application is a View object. Each page under the page is called Page object itself. From Perl we send commands to a GUI application and the GUI interpret the command and respond to the command nicely. To send a command we do the following:</p> <pre><code>socket_object-&gt;send_command("App.View2.Page2.Activate()") socket_object-&gt;send_command("App.View1.Page3.OKBtn.Click()") </code></pre> <p>This is not very readable. Instead, I want to write a Perl DSL for App, View and Page. Does Perl provide some sort of DSL structure where I can do the following?</p> <pre><code>App.View2.Page2.Activate(); App.View1.Page2.Click(); </code></pre> <p>Where App shall be an instance of the Application class. I have to get the object of View2 at run time.</p> <p>How to use such a things?</p>
[ { "answer_id": 343026, "author": "derobert", "author_id": 27727, "author_profile": "https://Stackoverflow.com/users/27727", "pm_score": 2, "selected": false, "text": "->" }, { "answer_id": 343054, "author": "Axeman", "author_id": 11289, "author_profile": "https://Stac...
2008/12/05
[ "https://Stackoverflow.com/questions/342973", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43056/" ]