qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
377,464
<p>I have plsql procedure which accepts certain parameters e.g. v_name, v_country, v_type.</p> <p>I wish to have a cursor with a select statement like this:</p> <pre><code>select column from table1 t1, table2 t2 where t1.name = v_name and t1.country = v_country and t1.id = t2.id and t2.type = v_type </code></pre> <p>If certain parameters are empty can I only add the relevant where clauses to the cursor? Or is there a better way to accomplish this?</p>
[ { "answer_id": 377599, "author": "WW.", "author_id": 14663, "author_profile": "https://Stackoverflow.com/users/14663", "pm_score": 3, "selected": false, "text": "CREATE OR REPLACE FUNCTION find_country( v_name t1.country%TYPE,\n v_type t2.type%TY...
2008/12/18
[ "https://Stackoverflow.com/questions/377464", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26108/" ]
377,477
<p>I'm trying to do some research on flash objects in browsers. For example memory usage etc. With Adobe Flex Builder 3 im trying to do some profiling on swf files but the problem is that I can only do this on debug swfs. Almost all adds/games/video are release version. Is there a way to some testing on those?</p>
[ { "answer_id": 377599, "author": "WW.", "author_id": 14663, "author_profile": "https://Stackoverflow.com/users/14663", "pm_score": 3, "selected": false, "text": "CREATE OR REPLACE FUNCTION find_country( v_name t1.country%TYPE,\n v_type t2.type%TY...
2008/12/18
[ "https://Stackoverflow.com/questions/377477", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47351/" ]
377,486
<p>I've got a simple class that inherits from Collection and adds a couple of properties. I need to serialize this class to XML, but the XMLSerializer ignores my additional properties.</p> <p>I assume this is because of the special treatment that XMLSerializer gives ICollection and IEnumerable objects. What's the best way around this?</p> <p>Here's some sample code:</p> <pre><code>using System.Collections.ObjectModel; using System.IO; using System.Xml.Serialization; namespace SerialiseCollection { class Program { static void Main(string[] args) { var c = new MyCollection(); c.Add("Hello"); c.Add("Goodbye"); var serializer = new XmlSerializer(typeof(MyCollection)); using (var writer = new StreamWriter("test.xml")) serializer.Serialize(writer, c); } } [XmlRoot("MyCollection")] public class MyCollection : Collection&lt;string&gt; { [XmlAttribute()] public string MyAttribute { get; set; } public MyCollection() { this.MyAttribute = "SerializeThis"; } } } </code></pre> <p>This outputs the following XML (note MyAttribute is missing in the MyCollection element):</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;MyCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; &lt;string&gt;Hello&lt;/string&gt; &lt;string&gt;Goodbye&lt;/string&gt; &lt;/MyCollection&gt; </code></pre> <p>What I <em>want</em> is</p> <pre><code>&lt;MyCollection MyAttribute="SerializeThis" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; &lt;string&gt;Hello&lt;/string&gt; &lt;string&gt;Goodbye&lt;/string&gt; &lt;/MyCollection&gt; </code></pre> <p>Any ideas? The simpler the better. Thanks.</p>
[ { "answer_id": 377494, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 5, "selected": true, "text": "IList IEnumerable [Serializable]\npublic class MyCollectionWrapper {\n [XmlAttribute]\n public string SomeProp {...
2008/12/18
[ "https://Stackoverflow.com/questions/377486", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3464/" ]
377,506
<p>I have the following code sample :</p> <pre><code>public class Base { public virtual void MyMethod(int param) { Console.WriteLine(&quot;Base:MyMethod - Int {0}&quot;, param); } } public class Derived1 : Base { public override void MyMethod(int param) { Console.WriteLine(&quot;Derived1:MyMethod - Int {0}&quot;, param); } public void MyMethod(double param) { Console.WriteLine(&quot;Derived1:MyMethod - Double {0}&quot;, param); } } class Program { static void Main(string[] args) { Base objB = new Base(); objB.MyMethod(5); Base objBD = new Derived1(); objBD.MyMethod(5); Derived1 objD = new Derived1(); objD.MyMethod(5); Console.ReadLine(); } } </code></pre> <p>The output of the above code is as follows:</p> <blockquote> <p>Base:MyMethod - Int 5</p> <p>Derived1:MyMethod - Int 5</p> <p>Derived1:MyMethod - Double 5</p> </blockquote> <p>For the third invocation of 'MyMethod' using 'objD' why is the 'DOUBLE' overload being used when I am actually passing it an INT.</p> <p>The second invocation using 'objBD' seems to behave correctly. Please suggest.</p>
[ { "answer_id": 377533, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 3, "selected": false, "text": "new override new public void MyMethod2(int param) {base.MyMethod(param);}\n" }, { "answer_id": 377542, "a...
2008/12/18
[ "https://Stackoverflow.com/questions/377506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40981/" ]
377,513
<p>I'm getting the following error when I try to use the JSTL XML taglib:</p> <pre><code>/server-side-transform.jsp(51,0) According to TLD or attribute directive in tag file, attribute xml does not accept any expressions </code></pre> <p>I'm looking into the tlds etc, but if anyone knows what this is an can save me some time, it'd be appreciated!</p> <p>If it helps, I get this error running the example code</p> <pre><code>&lt;c:set var="xml"&gt; &lt;paragraph&gt; This document uses &lt;bold&gt;unusual&lt;/bold&gt; markup, which we want to replace with &lt;bold&gt;HTML&lt;/bold&gt;. &lt;/paragraph&gt; &lt;/c:set&gt; &lt;c:set var="xsl"&gt; &lt;?xml version="1.0"?&gt; &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"&gt; &lt;xsl:template match="paragraph"&gt; &lt;p&gt;&lt;xsl:apply-templates/&gt;&lt;/p&gt; &lt;/xsl:template&gt; &lt;xsl:template match="bold"&gt; &lt;b&gt;&lt;xsl:value-of select="."/&gt;&lt;/b&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; &lt;/c:set&gt; &lt;x:transform xml="${xml}" xslt="${xsl}"/&gt; </code></pre> <p>in my /server-side-transform.jsp - my taglib directives are:</p> <pre><code>&lt;%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %&gt; &lt;%@ taglib uri="http://java.sun.com/jstl/xml" prefix="x" %&gt; </code></pre> <p>and I do have standard.jar and jstl.jar in /WEB-INF/lib.</p>
[ { "answer_id": 3418955, "author": "Sandeep More", "author_id": 412372, "author_profile": "https://Stackoverflow.com/users/412372", "pm_score": 2, "selected": false, "text": "<%@ taglib prefix=\"c\" uri=\"http://java.sun.com/jsp/jstl/core\"%> <%@ taglib prefix=\"c\" uri=\"http://java.sun....
2008/12/18
[ "https://Stackoverflow.com/questions/377513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2362/" ]
377,523
<p>How can I constrain a vertical WPF <code>StackPanel</code>'s width to the most narrow item it contains. The <code>StackPanel</code>'s width must not be greater than the width of any other child element.</p>
[ { "answer_id": 377767, "author": "Kent Boogaart", "author_id": 5380, "author_profile": "https://Stackoverflow.com/users/5380", "pm_score": 1, "selected": false, "text": "StackPanel" }, { "answer_id": 378370, "author": "PaulJ", "author_id": 11308, "author_profile": "ht...
2008/12/18
[ "https://Stackoverflow.com/questions/377523", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4227/" ]
377,551
<p>How can I get the (physical) installed path of a DLL that is (may be) registered in GAC? This DLL is a control that may be hosted in things other than a .Net app (including IDEs other than VS...).</p> <p>When I use System.Reflection.Assembly.GetExecutingAssembly().Location, it gives path of GAC folder in winnt\system32 - or in Design mode in VS gives the path to the VS IDE.</p> <p>I need to get the path where physical dll is actually installed - or the bin/debug or (release) folder for VS. </p> <p>Reason is that there is an XML file I need to get at in this folder, with config setting that are used both in design mode and at runtime.</p> <p>Or how is it best to handle this scenario? I have a dubious network location I am using for design mode at the moment... (Don't think that ApplicationData folder is going to cut it (but have the .Net version soved as that's installed via ClickOnce ans can use the Clickonce Data folder) )</p>
[ { "answer_id": 377715, "author": "BFree", "author_id": 15861, "author_profile": "https://Stackoverflow.com/users/15861", "pm_score": 2, "selected": false, "text": "Stream s = Assembly.GetExecutingAssembly().GetManifestResourceStream(\"MyProject.MyXmlFile.xml\");\nXmlDocument d = new XmlD...
2008/12/18
[ "https://Stackoverflow.com/questions/377551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41557/" ]
377,556
<p>I'm programming a simple network chat with a Python server and a Java client. But one question came into my mind:</p> <p>Which "network protocol" should I use for communication? There are some possibilities for me:</p> <ul> <li>YAML: Nice to parse, problem: parsed objects contain language specific parts</li> <li>XML: Easy to parse, big overhead for simple tasks</li> <li>create an own "language": Problems with escaping, but most flexible</li> </ul> <p>So what is the best practice for this? Are there other alternatives?</p>
[ { "answer_id": 377577, "author": "Mapad", "author_id": 28165, "author_profile": "https://Stackoverflow.com/users/28165", "pm_score": 4, "selected": true, "text": "import json" }, { "answer_id": 384085, "author": "James Brady", "author_id": 29903, "author_profile": "ht...
2008/12/18
[ "https://Stackoverflow.com/questions/377556", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32043/" ]
377,561
<p>In a HTML page references to Javascript files are rewritten with one additional subdirectory at the end:</p> <p>/+sfgRmluamFuX1R5cGU9amF2YV9zY3JpcHQmRmluamFuX0xhbmc9dGV4dC9qYXZhc2NyaXB0+. </p> <p>Why is that and can it be a source to potential problems?</p> <p>In our source code we have Javascript includes like this one:</p> <p>On development machines and the test server everything works fine. However, when installed on a production server, the code is somehow changed and looks like this one:</p> <p>This is for every script. Since we are experiencing problems with some of the Javascripts, I wonder whether this can be the cause of them. I googled for quite a while and did not find any good explanation for this code addition, the only one I found was that this can be generated by a proxy server.</p>
[ { "answer_id": 377571, "author": "annakata", "author_id": 13018, "author_profile": "https://Stackoverflow.com/users/13018", "pm_score": 1, "selected": false, "text": "alert('LOADED!')" }, { "answer_id": 377582, "author": "Community", "author_id": -1, "author_profile":...
2008/12/18
[ "https://Stackoverflow.com/questions/377561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
377,570
<p>I'm stuck with the following:</p> <p>I have an Access2003 report "rptInvoices". Group levels are on CustomerID and PackingListID. </p> <p>What I like to achieve is that every 2nd (or 3rd etc.) page of an invoice starts with a blank section (of say 9cm) at the top of the page. For this I would use an empty PageHeader section. If the Report's property PageHeader had a value like NotWithGroupHeaderX, this would be easy. </p> <p>Since there isn't such a value: how can I hide the PageHeader on a report if there's a GroupHeader named grhCustomerID on that page?</p> <p>Maybe I need a different approach, but I just don't see it.</p>
[ { "answer_id": 377759, "author": "Fionnuala", "author_id": 2548, "author_profile": "https://Stackoverflow.com/users/2548", "pm_score": 0, "selected": false, "text": "Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)\n Me.PageHeaderSection.Visible = False\nEnd ...
2008/12/18
[ "https://Stackoverflow.com/questions/377570", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
377,574
<p>I have 1 table called urltracker that holds information about the number of times a specific url has been clicked. The table is structured into 4 columns id, urlclicked, referrer and timestamp. The urltracker creates another entry in the table every time a url has been clicked.</p> <p>What i would like to do is display a specific url and the number of times it has been clicked, the user would then be able to drill down into the data by clicking to reveal all the specific times this url has been clicked.</p> <p>I'm no sql expert but this sounds like i need to initially display all the distinct URL's followed by a sub query which displays all the entries for this specfic url.</p> <p>Am i right in thinking this or is there an easier way?</p>
[ { "answer_id": 377596, "author": "Rockcoder", "author_id": 5290, "author_profile": "https://Stackoverflow.com/users/5290", "pm_score": 2, "selected": false, "text": "SELECT urlclicked, \n COUNT(*)\n FROM urltracker\nGROUP BY urlclicked\n SELECT id, \n urlclicked, \n re...
2008/12/18
[ "https://Stackoverflow.com/questions/377574", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47373/" ]
377,585
<p>I am newbie to <code>Spring Webflow</code>, I have am using Custom <code>FlowHandler</code> </p> <p>I can reach the respective Controller, but if set an attribute in a request Object I don't get it in JSP that is <code>View state</code>.</p> <p>How can I proceed in this?</p>
[ { "answer_id": 380456, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": -1, "selected": false, "text": "<on-start> \n <evaluate expression=\"XXXXControllerwsf.firstHit(flowRequestContext)\" result=\"flowScope.res\"/>\n</o...
2008/12/18
[ "https://Stackoverflow.com/questions/377585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
377,614
<p>I'm trying to have text spans pop up on a hover pseudo-class for different lines in a menu (list items). I can have the pop-ups occupy the same space in the div if the menu/list is horizontal, but a vertical list places the popups at the same vertical height as the "parent" list/menu item.</p> <p>Here is the relevant code I have so far:</p> <pre><code>&lt;div id="greenback"&gt; &lt;div class="serviceframe"&gt; &lt;div class="serviceslist"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=""&gt;item 1&lt;span&gt;this is popup1.&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;p&gt;&lt;li&gt;&lt;a href=""&gt;item 2&lt;span&gt;This is popup 2's text but I want it to appear in exactly the same place as popup 1's text does.&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/p&gt; &lt;p&gt;&lt;li&gt;&lt;a href=""&gt;item 3&lt;span&gt;same here - how can I get all popups positioned in exactly the same place?&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/p&gt; &lt;/ul&gt; &lt;/div&gt;&lt;!-- closes serviceslist--&gt; &lt;/div&gt;&lt;!-- closes serviceframe --&gt; &lt;/div&gt;&lt;!-- closes greenback--&gt; </code></pre> <p>CSS:</p> <pre><code>ul { list-style: disc url(w-arrow.png) outside; } #greenback { position: relative ; top: 0em ; width: 800px ; height: 250px ; background-color: #7EBB11 ; border: 3px solid #112D82 ; } /*********SERVICE LIST MENU**********/ .serviceframe { position: relative ; width: 100% ; height: 94% ; background-color: #666666 ; top: 3%; bottom: 3%; } /*--serviceframe is now sitting in greenback--*/ .serviceslist { position: relative ; width: 100% ; height: 90% ; top: 1% ; background-color: #7EBB11 ; font-family: Optima, Calibri, Candara, Century-Gothic, Arial, sans-serif; font-size: 100% ; color: black ; display: table-cell ; vertical-align: middle ; z-index: 100 ; } .serviceslist a {position: relative; display: table-cell; text-align: left; height: 100%; font: 1em sans-serif; text-decoration: none; color: #112D82; background: #7EBB11 ; } /*appearance of the &lt;a&gt; item (but before the &lt;span&gt; tag) on hover*/ .serviceslist a:hover { color: white; } /*appearance of the spanned content within &lt;a&gt;&lt;/a&gt; tags when not hovered*/ .serviceslist a span {display: none;} /*appearance of spanned content within &lt;a&gt; tags when hovered*/ .serviceslist a:hover span { position: absolute; display: table-cell; margin-top: 0em; margin-left: -50%; z-index: 100; width: 40%; height: auto; color: #FFFFFF; background-color: #7EBB11; font: 14px Verdana, sans-serif; text-align: left; } </code></pre>
[ { "answer_id": 378065, "author": "Steve Perks", "author_id": 16124, "author_profile": "https://Stackoverflow.com/users/16124", "pm_score": 2, "selected": true, "text": "<ul>\n <li><a href=\"\">item 1<span>this is popup1.</span></a></li>\n <li><a href=\"\">item 2<span>This is popup 2's ...
2008/12/18
[ "https://Stackoverflow.com/questions/377614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
377,628
<p>I have a project in which I want to be able to call wp_list_pages() on a page that also uses the Zend Framework to power some complex interfaces manages custom data outside of wordpress.</p> <p>This page should also redirect the user to the wordpress login screen if they're not already logged in with the appropriate level of authorization.</p> <p>How would this work at a high level, i.e. do I need to edit the wordpress bootstrap file to conditionally implement the custom interface based on a specific URL or something, but still include certain files to be able to call wp_list_pages() on that custom interface?</p>
[ { "answer_id": 378329, "author": "Fernando Briano", "author_id": 1492, "author_profile": "https://Stackoverflow.com/users/1492", "pm_score": 1, "selected": false, "text": "wp_list_pages()" }, { "answer_id": 378674, "author": "Community", "author_id": -1, "author_profi...
2008/12/18
[ "https://Stackoverflow.com/questions/377628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
377,631
<pre><code>echo date('r',strtotime("16 Dec, 2010")); //Tue, 16 Dec 2008 20:10:00 +0530 echo date('r',strtotime("16 Dec 2010")); //Sat, 16 Jan 2010 00:00:00 +0530 </code></pre> <p>That's just wrong... Either it should fail or it should parse correctly. Do you know any robust natural language date/time parser in php? How do you parse natural language date time in php?</p> <p>Edit:</p> <pre><code>var_dump(strtotime("16 Dec, abcd")); //bool(false) </code></pre> <p>"16 Dec, 2010" is either a valid GNU date input format or it is not. In the first case it should return the correct answer and in the second it should return false. This is what I mean by 'wrong'. </p> <p>Edit:</p> <p>The purpose is as hop guessed to accept a significant variety of user input.</p>
[ { "answer_id": 377735, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "strptime()" } ]
2008/12/18
[ "https://Stackoverflow.com/questions/377631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17674/" ]
377,632
<p>I have an xml file which I would like to create a form/table around to add, edit and delete records using PHP. Currently I use simpleXML to load the XML file, and display its content on various pages.</p> <p>Is there any way I can create a table that shows all results, and allows me to either edit or delete that particular row of the table which represents a full record within the XML file. </p> <p>When clicking edit I would like the details from the record to appear in a form which the user can change and then save out, updating the XML file and the corresponding web page.</p> <p>I need this done in PHP, preferably using SimpleXML, though open to suggestions of other ways to do this with PHP.</p> <p>Cheers</p>
[ { "answer_id": 1795427, "author": "Witman", "author_id": 218120, "author_profile": "https://Stackoverflow.com/users/218120", "pm_score": 2, "selected": false, "text": "<?php\n//REQUIRED INPUTS:\n// - xml: path to xml document\n// - xsl: path to xsl style sheet\n// - pCount: number of par...
2008/12/18
[ "https://Stackoverflow.com/questions/377632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47378/" ]
377,633
<p>I have searched high and low and cannot find a Samsung Omnia SDK.</p> <p>I know its possible to use the .net framework for development , but i want more , specifically being able to access the motion sensor and maybe the GPS as well.</p> <p>Any idea or directions are welcome.</p>
[ { "answer_id": 1795427, "author": "Witman", "author_id": 218120, "author_profile": "https://Stackoverflow.com/users/218120", "pm_score": 2, "selected": false, "text": "<?php\n//REQUIRED INPUTS:\n// - xml: path to xml document\n// - xsl: path to xsl style sheet\n// - pCount: number of par...
2008/12/18
[ "https://Stackoverflow.com/questions/377633", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42069/" ]
377,636
<p>ive got the problem that i dont know how to stop my function with mouseover and restart it with mouseout</p> <p>first here is my test-code:</p> <p> </p> <pre><code> &lt;script type="text/javascript"&gt; function fadeEngine(x) { var total_divs=3; //setze hier die nummer der gewollten divs var y=x; if(x==total_divs) y=1; else y++; $("#fade"+x).css("display","none"); $("#fade"+y).fadeIn("slow"); setTimeout('fadeEngine('+y+')',3000); //modifi alle 3000 miliseconds nen neuen div } fadeEngine(0); //Initialisation des Scripts &lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ /* $("#container").hover(function(){ stop('mouse over'); },function(){ alert('mouse out'); }); */ /* $("#container").hover(function() { $(this).stop().fadeTo("slow", 1.00); }, function() { $(this).stop().fadeTo("fast", 0.50); }); */ }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="container" style="width:200px;height:200px;background:#afafaf;color:#red;"&gt; &lt;div id="fade1"&gt;Content one&lt;/div&gt; &lt;div id="fade2" style="display:none"&gt;Content two&lt;/div&gt; &lt;div id="fade3" style="display:none"&gt;Content three&lt;/div&gt; &lt;/div&gt; &lt;div class="blocker"&gt;&amp;nbsp;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>How i can do this to stop my function fadeEngine if im go over the contentdiv and start it if im move out of the div?</p> <p>thanks a lot for help</p>
[ { "answer_id": 377679, "author": "Adam Bellaire", "author_id": 21632, "author_profile": "https://Stackoverflow.com/users/21632", "pm_score": 0, "selected": false, "text": "stop() $(\"#fade\"+y).stop();\n setTimeout clearTimeout() var timeout = setTimeout('fadeEngine('+y+')',3000);\n// la...
2008/12/18
[ "https://Stackoverflow.com/questions/377636", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
377,640
<p>Which MVC-framework is the best option (performance/ease of development) for a web application, that will have + 2 million visits per week.</p> <p>Basically the site is a search engine,but also there will be large amounts of XML parsing, and high db traffic.</p> <p>We are using Java, over Jboss 4.2.3x, with PG as DB, and Solr for the searches.</p> <p>We were thinking on code JSPs with taglibs, and Servlets, but we were feeling like there would be a better alternative, which don't know yet, as we are starting on the Java Web applications world.</p> <p>Any opinions, and shares of your experience will be appreciated!<br> Thanks in advance!</p>
[ { "answer_id": 377679, "author": "Adam Bellaire", "author_id": 21632, "author_profile": "https://Stackoverflow.com/users/21632", "pm_score": 0, "selected": false, "text": "stop() $(\"#fade\"+y).stop();\n setTimeout clearTimeout() var timeout = setTimeout('fadeEngine('+y+')',3000);\n// la...
2008/12/18
[ "https://Stackoverflow.com/questions/377640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/314728/" ]
377,644
<p>Is there some way I can show custom exception messages as an alert in my jQuery AJAX error message?</p> <p>For example, if I want to throw an exception on the server side via <a href="http://en.wikipedia.org/wiki/Apache_Struts" rel="noreferrer">Struts</a> by <code>throw new ApplicationException(&quot;User name already exists&quot;);</code>, I want to catch this message ('user name already exists') in the jQuery AJAX error message.</p> <pre><code>jQuery(&quot;#save&quot;).click(function () { if (jQuery('#form').jVal()) { jQuery.ajax({ type: &quot;POST&quot;, url: &quot;saveuser.do&quot;, dataType: &quot;html&quot;, data: &quot;userId=&quot; + encodeURIComponent(trim(document.forms[0].userId.value)), success: function (response) { jQuery(&quot;#usergrid&quot;).trigger(&quot;reloadGrid&quot;); clear(); alert(&quot;Details saved successfully!!!&quot;); }, error: function (xhr, ajaxOptions, thrownError) { alert(xhr.status); alert(thrownError); } }); } }); </code></pre> <p>On the second alert in the error callback, where I alert <code>thrownError</code>, I am getting <code>undefined</code> and the <code>xhr.status</code> code is <code>500</code>.</p> <p>I am not sure where I am going wrong. What can I do to fix this problem?</p>
[ { "answer_id": 381056, "author": "Vitor Silva", "author_id": 1842864, "author_profile": "https://Stackoverflow.com/users/1842864", "pm_score": 3, "selected": false, "text": "Response.StatusCode" }, { "answer_id": 450540, "author": "Sprintstar", "author_id": 15233, "au...
2008/12/18
[ "https://Stackoverflow.com/questions/377644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
377,654
<p>I am adding a custom background image to my navigation bar by creating an image view and doing a <code>[navigationController.navigationBar addSubview:imageView]</code>.</p> <p>The background comes in fine. But as soon as I do this, my other navigation items start behaving in a strange manner. Sometimes the <code>navigationItem.title</code> appears, the back button disappears. And this is totally random. Any idea what could be causing this?</p> <p>Thanks.</p>
[ { "answer_id": 912242, "author": "CIFilter", "author_id": 89170, "author_profile": "https://Stackoverflow.com/users/89170", "pm_score": 2, "selected": false, "text": "drawRect: leftBarButtonItem rightBarButtonItem titleView navigationItem UINavigationBar - ( void )drawRect:( CGRect )rect...
2008/12/18
[ "https://Stackoverflow.com/questions/377654", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46297/" ]
377,667
<p>I have been searching for several hours but i couldn't find anything about this... Basically I would like to create a template or plug-in for word 2007 that would allow someone to create new pages for a CMS. What I have in mind is something similar to blog post template. I know how to create a basic template but I can't find a way to publish the created document using a publish button inside the Word.</p> <p>thnx in advance</p>
[ { "answer_id": 378352, "author": "Renaud Bompuis", "author_id": 3811, "author_profile": "https://Stackoverflow.com/users/3811", "pm_score": 0, "selected": false, "text": ".dotm project ActiveDocument.SaveAs Sub FileSave()\n ' First Save the main document\n ActiveDocument.Save\n ...
2008/12/18
[ "https://Stackoverflow.com/questions/377667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
377,686
<p>I have a client and a server both written in .net 3.5 so I've got no interoperability issues.</p> <p>The server is fully accessible on port 443 (I'm hosting it so I can open other ports if needed)</p> <p>The client is however less accessible. It's often behind a corporate firewall, or behind a NAT, or uses an http/https proxy to connect to the internet.</p> <p>I need to establish an encrypted bi-directionnal communication between the client and the server.</p> <p>The two bidirectional channels provided in WCF don't seem to do the trick :</p> <ul> <li><p>NetTcpBinding doesn't seem to support http proxies (<a href="http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/0900c7f0-948f-45f1-a53e-9434921af5ce" rel="nofollow noreferrer">source</a>)</p></li> <li><p>WSDualHttpBinding requires that the client has a public URI that provides a callback endpoint for the service, which is unfortunately not the case here (<a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.wsdualhttpbinding.aspx" rel="nofollow noreferrer">source</a>)</p></li> </ul> <p>Can WCF establish this kind of encrypted bi-directional connection (silently using https tunelling if needed), without tuning the firewall/proxy settings on the client side ?</p>
[ { "answer_id": 378197, "author": "Brann", "author_id": 47341, "author_profile": "https://Stackoverflow.com/users/47341", "pm_score": 0, "selected": false, "text": "<system.net>\n <defaultProxy useDefaultCredentials=\"true\">\n <proxy bypassonlocal=\"False\" proxyaddress=\"http://g...
2008/12/18
[ "https://Stackoverflow.com/questions/377686", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47341/" ]
377,691
<p>I have a button, I need to display a pop-up in javascript. So on its client click I call a javascript function which does that.</p> <p>if user clicks "yes", I need to do a post back and call buttons server side click event, here is what I am doing inside the javascript function</p> <pre><code>__doPostBack(deleteLinkButton, 'Click'); ' Where deleteLinkButton is a variable that has client Id of the button. </code></pre> <p>Postback happens but it does not go in the click handler for that button.</p> <p>What can be wrong?</p>
[ { "answer_id": 378197, "author": "Brann", "author_id": 47341, "author_profile": "https://Stackoverflow.com/users/47341", "pm_score": 0, "selected": false, "text": "<system.net>\n <defaultProxy useDefaultCredentials=\"true\">\n <proxy bypassonlocal=\"False\" proxyaddress=\"http://g...
2008/12/18
[ "https://Stackoverflow.com/questions/377691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38997/" ]
377,695
<p>I am trying to get the size of an array populated by stdin:</p> <pre><code>char *myArray; cin &gt;&gt; myArray cout &lt;&lt; sizeof(myArray); </code></pre> <p>This returns 4 when I enter a string greater with a length greater than 4 e.g. "40905898"</p> <p>Where am i going wrong?</p>
[ { "answer_id": 377717, "author": "mmx", "author_id": 33708, "author_profile": "https://Stackoverflow.com/users/33708", "pm_score": 4, "selected": false, "text": "sizeof char* string #include <string> using namespace std; string line;\ncin >> line;\ncout << line.length() << endl;\n cin >>...
2008/12/18
[ "https://Stackoverflow.com/questions/377695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
377,709
<p>I am considering adding validation on some insert and update statements for MS SQL Server 2005. I want to be able to check the values inserted before it is written into the table - in this particular case, it is an integer field where the data must conform to a rule. So a simple schema could be:</p> <pre><code>([id] [int] identity(1,1), [name] [nvarchar], [magicvalue] [int]) </code></pre> <p>And magicvalue is the one I'm going to validate. However, it is a general question for the "best practice" when indexes and foreign key constraints are not suitable. I guess I am unsure whether triggers or constraints are the way to go, or if there are other ways. </p> <p>An example is optional :)</p>
[ { "answer_id": 377720, "author": "Galwegian", "author_id": 3201, "author_profile": "https://Stackoverflow.com/users/3201", "pm_score": 1, "selected": false, "text": "CREATE TABLE [dbo].[SalesHistory](\n [SaleID] [int] NOT NULL,\n [Product] [char](150) NULL,\n [SaleDate] [...
2008/12/18
[ "https://Stackoverflow.com/questions/377709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20941/" ]
377,716
<p>I'm reading &quot;<a href="http://jspro.org/" rel="nofollow noreferrer">Pro JavaScript Techniques</a>&quot; by <a href="https://en.wikipedia.org/wiki/John_Resig" rel="nofollow noreferrer">John Resig</a>, and I'm confused with an example. This is the code:</p> <pre><code>// Create a new user object that accepts an object of properties function User( properties ) { // Iterate through the properties of the object, and make sure // that it's properly scoped (as discussed previously) for ( var i in properties ) { (function(){ // Create a new getter for the property this[ &quot;get&quot; + i ] = function() { return properties[i]; }; // Create a new setter for the property this[ &quot;set&quot; + i ] = function(val) { properties[i] = val; }; })(); } } // Create a new user object instance and pass in an object of // properties to seed it with var user = new User({ name: &quot;Bob&quot;, age: 44 }); // Just note that the name property does not exist, as it's private // within the properties object alert( user.name == null ); // However, we're able to access its value using the new getname() // method, that was dynamically generated alert( user.getname() == &quot;Bob&quot; ); // Finally, we can see that it's possible to set and get the age using // the newly generated functions user.setage( 22 ); alert( user.getage() == 22 ); </code></pre> <p>Now running that in the <a href="https://en.wikipedia.org/wiki/Firebug_%28software%29" rel="nofollow noreferrer">Firebug</a> console (on Firefox 3) throws that <em>user.getname()</em> is not a function. I tried doing this:</p> <pre><code>var other = User other() window.getname() // --&gt; This works! </code></pre> <p>And it worked!</p> <p>Why?</p> <p>Doing:</p> <pre><code>var me = this; </code></pre> <p>seems to work a bit better, but when executing &quot;getname()&quot; it returns '44' (the second property)...</p> <p>Also I find it strange that it worked on the window object without modification...</p> <p>And a third question, what's the difference between PEZ solution and the original? (He doesn't use an anonymous function.)</p>
[ { "answer_id": 377754, "author": "PEZ", "author_id": 44639, "author_profile": "https://Stackoverflow.com/users/44639", "pm_score": 2, "selected": false, "text": "function bindAccessors(o, property, value) {\n var _value = value;\n o[\"get\" + property] = function() {\n return _value...
2008/12/18
[ "https://Stackoverflow.com/questions/377716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7595/" ]
377,722
<p>I have always been interested in algorithms, sort, crypto, binary trees, data compression, memory operations, etc.</p> <p>I read Mark Nelson's article about permutations in C++ with the STL function next_perm(), very interesting and useful, after that I wrote one class method to get the next permutation in Delphi, since that is the tool I presently use most. This function works on lexographic order, I got the algo idea from a answer in another topic here on stackoverflow, but now I have a big problem. I'm working with permutations with repeated elements in a vector and there are lot of permutations that I don't need. For example, I have this first permutation for 7 elements in lexographic order:</p> <p>6667778 (6 = 3 times consecutively, 7 = 3 times consecutively)</p> <p>For my work I consider valid perm only those with at most 2 elements repeated consecutively, like this:</p> <p>6676778 (6 = 2 times consecutively, 7 = 2 times consecutively)</p> <p>In short, I need a function that returns only permutations that have at most N consecutive repetitions, according to the parameter received.</p> <p>Does anyone know if there is some algorithm that already does this?</p> <p>Sorry for any mistakes in the text, I still don't speak English very well.</p> <p>Thank you so much, Carlos</p>
[ { "answer_id": 379635, "author": "krusty.ar", "author_id": 43981, "author_profile": "https://Stackoverflow.com/users/43981", "pm_score": 1, "selected": false, "text": "funciton custom_perm(int max_rep)\n do\n p := next_perm()\n while count_max_rerps(p) < max_rep\n return p\n" }, ...
2008/12/18
[ "https://Stackoverflow.com/questions/377722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/449425/" ]
377,763
<p>Is there any performance penalty for the following code snippet?</p> <pre><code>for (int i=0; i&lt;someValue; i++) { Object o = someList.get(i); o.doSomething; } </code></pre> <p>Or does this code actually make more sense?</p> <pre><code>Object o; for (int i=0; i&lt;someValue; i++) { o = someList.get(i); o.doSomething; } </code></pre> <p>If in byte code these two are totally equivalent then obviously the first method looks better in terms of style, but I want to make sure this is the case.</p>
[ { "answer_id": 377788, "author": "mmx", "author_id": 33708, "author_profile": "https://Stackoverflow.com/users/33708", "pm_score": 3, "selected": false, "text": "o for new" }, { "answer_id": 377996, "author": "SamBeran", "author_id": 43379, "author_profile": "https://...
2008/12/18
[ "https://Stackoverflow.com/questions/377763", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24545/" ]
377,768
<p>I am looking for a more elegant way of concatenating strings in Ruby.</p> <p>I have the following line:</p> <pre><code>source = "#{ROOT_DIR}/" &lt;&lt; project &lt;&lt; "/App.config" </code></pre> <p>Is there a nicer way of doing this?</p> <p>And for that matter what is the difference between <code>&lt;&lt;</code> and <code>+</code>?</p>
[ { "answer_id": 377787, "author": "Keltia", "author_id": 16143, "author_profile": "https://Stackoverflow.com/users/16143", "pm_score": 10, "selected": true, "text": "<< source = \"#{ROOT_DIR}/#{project}/App.config\"\n + source = \"#{ROOT_DIR}/\" + project + \"/App.config\"\n File.join" ...
2008/12/18
[ "https://Stackoverflow.com/questions/377768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11755/" ]
377,776
<p>If i have a parameterized SQL statement like this: </p> <pre><code>SELECT * FROM table WHERE my_field = :field_value </code></pre> <p>Does anyone know if PDO will recognize this(see below) as the same SQL statement and use the cache instead of assuming it's a completely different SQL statement:</p> <pre><code>SELECT * FROM table WHERE my_field = :new_field_value </code></pre> <p>So, I guess the question is: if the name of a parameter changes in a parameterized select statement but nothing else changes, will I still get the performance benefit of caching? Or do I have to make sure that the parameter name stays the same?</p>
[ { "answer_id": 378670, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 3, "selected": true, "text": "PDO::ATTR_EMULATE_PREPARES" } ]
2008/12/18
[ "https://Stackoverflow.com/questions/377776", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2494/" ]
377,779
<p>I am displaying Japanese characters in a VB6 application with the system locale set to Japan and the language for non Unicode programs as Japanese. A call to GetACP() correctly returns 932 for Japanese. When I insert the Japanese strings into my controls they display as “ƒAƒtƒŠƒJ‚Ì—‰¤” rather than “アフリカの女王”. If I manually set the Font.Charset to 128 then they display correctly.</p> <p>What is the best way to determine the correct Charset for a given LCID in VB6?</p>
[ { "answer_id": 939842, "author": "Ant", "author_id": 11529, "author_profile": "https://Stackoverflow.com/users/11529", "pm_score": 3, "selected": true, "text": "Private Const LOCALE_SYSTEM_DEFAULT As Long = &H800\nPrivate Const LOCALE_IDEFAULTANSICODEPAGE As Long = &H1004\nPrivate Const ...
2008/12/18
[ "https://Stackoverflow.com/questions/377779", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5025/" ]
377,785
<p>I just don't get it. I use cocos2d for development of a small game on the iPhone/Pod. The framework is just great, but I fail at touch detection. I read that you just need to overwrite the proper functions (e.g. &quot;touchesBegan&quot; ) in the implementation of a class which subclasses CocosNode. But it doesn't work. What could I do wrong?</p> <p>the function:</p> <pre><code>-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{NSLog(@&quot;tickle, hihi!&quot;);} </code></pre> <p>did I get it totally wrong?</p>
[ { "answer_id": 379892, "author": "Genericrich", "author_id": 39932, "author_profile": "https://Stackoverflow.com/users/39932", "pm_score": 4, "selected": false, "text": "-(BOOL)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {\nUITouch *touch = [touches anyObject];\nCGPoint lo...
2008/12/18
[ "https://Stackoverflow.com/questions/377785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
377,794
<p>I am trying a straightforward remote json call with jquery. I am trying to use the reddit api. <a href="http://api.reddit.com" rel="nofollow noreferrer">http://api.reddit.com</a>. This returns a valid json object.</p> <p>If I call a local file (which is what is returned from the website saved to my local disk) things work fine. </p> <pre><code>$(document).ready(function() { $.getJSON("js/reddit.json", function (json) { $.each(json.data.children, function () { title = this.data.title; url = this.data.url; $("#redditbox").append("&lt;div&gt;&lt;a href=\"" + url + "\"&gt;" + title + "&lt;/a&gt;&lt;div&gt;"); }); }); }); </code></pre> <p>If I then try to convert it to a remote call:</p> <pre><code>$(document).ready(function() { $.getJSON("http://api.reddit.com", function (json) { $.each(json.data.children, function () { title = this.data.title; url = this.data.url; $("#redditbox").append("&lt;div&gt;&lt;a href=\"" + url + "\"&gt;" + title + "&lt;/a&gt;&lt;div&gt;"); }); }); }); </code></pre> <p>it will work fine in Safari, but not Firefox. This is expect as Firefox doesnt do remote calls due to security or something. Fine.</p> <p>In the jquery docs they say to do it like this (jsonp):</p> <pre><code>$(document).ready(function() { $.getJSON("http://api.reddit.com?jsoncallback=?", function (json) { $.each(json.data.children, function () { title = this.data.title; url = this.data.url; $("#redditbox").append("&lt;div&gt;&lt;a href=\"" + url + "\"&gt;" + title + "&lt;/a&gt;&lt;div&gt;"); }); }); }); </code></pre> <p>however it now stops working on both safari and firefox. The request is made but what is return from the server appears to be ignored.</p> <p>Is this a problem with the code I am writing or with something the server is returning? How can I diagnose this problem?</p> <p><em>EDIT</em> Changed the address to the real one.</p>
[ { "answer_id": 377832, "author": "Jennifer", "author_id": 22360, "author_profile": "https://Stackoverflow.com/users/22360", "pm_score": 2, "selected": true, "text": "$(document).ready(function() {\n $.getJSON(\"http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&...
2008/12/18
[ "https://Stackoverflow.com/questions/377794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3431280/" ]
377,798
<p>I'm using SQL Server 2005.</p> <p>I have a field that must either contain a unique value or a NULL value. I think I should be enforcing this with either a <code>CHECK CONSTRAINT</code> or a <code>TRIGGER for INSERT, UPDATE</code>.</p> <p>Is there an advantage to using a constraint here over a trigger (or vice-versa)? What might such a constraint/trigger look like?</p> <p>Or is there another, more appropriate option that I haven't considered? </p>
[ { "answer_id": 377849, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 3, "selected": true, "text": " field is null or dbo.fn_count_maximum_of_field(field) < 2\n declare @retVal int\n\n select @retVal = max(occurre...
2008/12/18
[ "https://Stackoverflow.com/questions/377798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20377/" ]
377,819
<p>Let's say I have a class like this:</p> <pre><code>class ApplicationDefs{ public static final String configOption1 = "some option"; public static final String configOption2 = "some other option"; public static final String configOption3 = "yet another option"; } </code></pre> <p>Many of the other classes in my application are using these options. Now, I want to change one of the options alone and deploy just the compiled class. But if these fields are in-lined in the consumer classes this becomes impossible right?</p> <p>Is there any option to disable the in-lining of compile time constants?</p>
[ { "answer_id": 377825, "author": "Yuval Adam", "author_id": 24545, "author_profile": "https://Stackoverflow.com/users/24545", "pm_score": 3, "selected": false, "text": "final" }, { "answer_id": 377828, "author": "Bombe", "author_id": 43582, "author_profile": "https://...
2008/12/18
[ "https://Stackoverflow.com/questions/377819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27784/" ]
377,840
<p>How to truncate and shrink large log files in SQL Server 2005? How to apply truncation at regular intervals?</p> <p>Is there any difference between truncation and shrinking?</p> <p>Thanks in advance</p>
[ { "answer_id": 377844, "author": "mmx", "author_id": 33708, "author_profile": "https://Stackoverflow.com/users/33708", "pm_score": 0, "selected": false, "text": "DBCC SHRINKFILE" } ]
2008/12/18
[ "https://Stackoverflow.com/questions/377840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29515/" ]
377,841
<p>I am trying to implement a wpf user control that binds a text box to a list of doubles using a converter. How can i set the instance of user control to be the converter parameter?</p> <p>the code for the control is shown below</p> <p>Thanks </p> <pre><code>&lt;UserControl x:Class="BaySizeControl.BaySizeTextBox" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:BaySizeControl" &gt; &lt;UserControl.Resources&gt; &lt;local:BayListtoStringConverter x:Key="BaySizeConverter"/&gt; &lt;/UserControl.Resources&gt; &lt;Grid&gt; &lt;TextBox Name="Textbox_baysizes" Text="{Binding RelativeSource={RelativeSource self}, Path=Parent.Parent.BaySizeItemsSource, Converter={StaticResource BaySizeConverter}}" /&gt; &lt;/Grid&gt; &lt;/UserControl&gt; </code></pre>
[ { "answer_id": 377868, "author": "Frederic", "author_id": 42826, "author_profile": "https://Stackoverflow.com/users/42826", "pm_score": 4, "selected": true, "text": "<TextBox Name=\"Textbox_baysizes\">\n <TextBox.Text>\n <MultiBinding Converter=\"{StaticResource BaySizeConverte...
2008/12/18
[ "https://Stackoverflow.com/questions/377841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18966/" ]
377,846
<p>So I have this GIF file on my desktop (it's a 52 card deck of poker cards). I have been working on a program that cuts it up into little acm.graphics.GImages of each card. Now, however, I want to write those GImages or pixel arrays to a file so that I can use them later. I thought it would be as straight forward as writing .txt files, but a couple of Google searches later I am more confused than before.</p> <p>So how do I go about making .gif files out of pixel arrays or GImages (I've got loads of both)?</p>
[ { "answer_id": 377893, "author": "Brendan Cashman", "author_id": 5814, "author_profile": "https://Stackoverflow.com/users/5814", "pm_score": 4, "selected": true, "text": "BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);\n\nWritableRaster raster = image....
2008/12/18
[ "https://Stackoverflow.com/questions/377846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29182/" ]
377,850
<p>I have a MySQL query in which I want to include a list of ID's from another table. On the website, people are able to add certain items, and people can then add those items to their favourites. I basically want to get the list of ID's of people who have favourited that item (this is a bit simplified, but this is what it boils down to).</p> <p>Basically, I do something like this:</p> <pre><code>SELECT *, GROUP_CONCAT((SELECT userid FROM favourites WHERE itemid = items.id) SEPARATOR ',') AS idlist FROM items WHERE id = $someid </code></pre> <p>This way, I would be able to show who favourited some item, by splitting the idlist later on to an array in PHP further on in my code, however I am getting the following MySQL error:</p> <blockquote> <p><em>1242 - Subquery returns more than 1 row</em> </p> </blockquote> <p>I thought that was kind of the point of using <code>GROUP_CONCAT</code> instead of, for example, <code>CONCAT</code>? Am I going about this the wrong way?</p> <hr> <p>Ok, thanks for the answers so far, that seems to work. However, there is a catch. Items are also considered to be a favourite if it was added by that user. So I would need an additional check to check if creator = userid. Can someone help me come up with a smart (and hopefully efficient) way to do this?</p> <p>Thank you!</p> <p>Edit: I just tried to do this:</p> <pre><code>SELECT [...] LEFT JOIN favourites ON (userid = itemid OR creator = userid) </code></pre> <p>And <strong>idlist</strong> is empty. Note that if I use <code>INNER JOIN</code> instead of <code>LEFT JOIN</code> I get an empty result. Even though I am sure there are rows that meet the ON requirement.</p>
[ { "answer_id": 377900, "author": "soulmerge", "author_id": 44562, "author_profile": "https://Stackoverflow.com/users/44562", "pm_score": 5, "selected": true, "text": "items.id SELECT\n items.name,\n items.color,\n CONCAT(favourites.userid) as idlist\nFROM\n items\nINNER JOIN ...
2008/12/18
[ "https://Stackoverflow.com/questions/377850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37472/" ]
377,854
<p>jQuery return links are not working. I have Used jQuery and the basic Ajax feature. My jQuery returns the links from file <code>Links_ajax.php</code>.</p> <p>I giving the code samples.</p> <p>GetCustomerData.php has:</p> <pre><code>&lt;html&gt; &lt;script type="text/javascript"&gt; &lt;script src="ajax.js" type="text/javascript"&gt; $(function() { ..... $.ajax({ type: 'POST', url: 'Links_ajax.php', data: 'category='+category , success: function(data){ $("#response").html(data); } }); } ...... } ... &lt;! Links return here &lt;div id="response"&gt; &lt;/div&gt; &lt;/html&gt; &lt;? echo "Some Code"; ?&gt; .... </code></pre> <p>My Links_ajax.php has the following code</p> <pre><code>.... echo '&lt;a href="getCustomerData.php?id=10" onclick="requestCustomerInfo();return false;"&gt;show me &lt;/a&gt;'; echo '&lt;a href="getCustomerData.php?id=11" onclick="requestCustomerInfo();return false;"&gt;show me &lt;/a&gt;'; .... </code></pre> <p>Now I come to the Main Page getCustomerData.php. I have used the Ajax feature that returns link from Links_ajax.php.</p> <pre><code> ..... </code></pre> <p>So, my ajax.js has the following Ajax scripts.</p> <pre><code>var url = "GetCustomerData.php?id="; // The server-side script function handleHttpResponse() { if (http.readyState == 4) { if (http.status == 200) { var results = http.responseText; document.getElementById('divCustomerInfo').innerHTML = results; } } } function requestCustomerInfo(event) { if(event &amp;&amp;event.preventDefault) event.preventDefault(); else if (window.event &amp;&amp; window.event.returnValue) window.eventReturnValue = false; var sId = 10; http.open("GET", url + escape(sId), true); http.onreadystatechange = handleHttpResponse; http.send(null); } function getHTTPObject() { var xmlhttp; if (window.XMLHttpRequest){ xmlhttp = new XMLHttpRequest(); } else if (window.ActiveXObject){ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); if (!xmlhttp){ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } } return xmlhttp; } var http = getHTTPObject(); // We create the HTTP object </code></pre> <p>......</p> <p>Now I come to the problem. When I execute the GetCustomerdata.php, I am able to get all the links from ajax.JQuery. And upon clicking that, I need a basic Ajax feature since loading the same <code>&lt;div&gt;</code> <code>&lt;/div&gt;</code>. But I am unable to view it even though I done. Is there anything wrong in my code? Or do I have to use any other feature?</p>
[ { "answer_id": 405139, "author": "Alec Smart", "author_id": 426996, "author_profile": "https://Stackoverflow.com/users/426996", "pm_score": 1, "selected": false, "text": "success: function(data){\n //$(\"#response\").html(data);\n alert(data);\n }\n `$(\"#response\").html(data)...
2008/12/18
[ "https://Stackoverflow.com/questions/377854", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44984/" ]
377,864
<p>Is it possible is asp to detect from the MobileCapabilities object if the device support arabic or not</p>
[ { "answer_id": 500948, "author": "Asaf R", "author_id": 6827, "author_profile": "https://Stackoverflow.com/users/6827", "pm_score": 1, "selected": false, "text": "Accept-Language: he-IL\n" }, { "answer_id": 1292940, "author": "David d C e Freitas", "author_id": 40961, ...
2008/12/18
[ "https://Stackoverflow.com/questions/377864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
377,865
<p>We are experiencing an exceedingly hard to track down issue where we are seeing ClassCastExceptions <em>sometimes</em> when trying to iterate over a list of unmarshalled objects. The important bit is <em>sometimes</em>, after a reboot the particular code works fine. This seems to point in the direction of concurrency/timing/race condition. I can confirm that neither the JAXBContext, nor the marshallers and unmarshallers are being used concurrently. We've gone as far as serializing access to them through locking.</p> <p>However, since we run on an OSGi platform where individual bundles are getting initialized asynchronously through Spring DM it can be that 2 different bundles are creating their JAXBContext at the same time.</p> <p>In any case I would appreciate any pointers towards an explanation for what could cause these <em>intermittent</em> ClassCastExceptions. The intermittent is important since they indicate that the code itself is normally working fine but that some external factor seems to influence the behaviour.</p> <p>Here's a specific example of the exception (note I removed the company specific stuff):</p> <pre><code>Caused by: java.lang.ClassCastException: com.sun.org.apache.xerces.internal.dom.ElementNSImpl cannot be cast to com.foobar.TunnelType at com.foobar.NetMonitorImpl.getVpnStatus(NetMonitorImpl.java:180) </code></pre> <p>That method at line 180 is a for() construct looping over a Collection of TunnelType objects inside of an unmarshalled object (said unmarshalling works fine BTW).</p> <p>Given that the actual object unmarshalling went fine, is it even physically possible for JAXB to leave ElementNSImpl objects inside of nested collections?</p> <p>Runtime environment:</p> <ul> <li>JAXB 2.1</li> <li>OSGi</li> <li>Spring DM</li> <li>The JAXBContext is initialised with the ClassLoader of the bundle containing the classes to be marshalled/unmarshalled</li> </ul>
[ { "answer_id": 670410, "author": "ivan_ivanovich_ivanoff", "author_id": 76393, "author_profile": "https://Stackoverflow.com/users/76393", "pm_score": 2, "selected": false, "text": "JAXBContext.newInstance(MyClass1.class,MyClass2.class, [...]);\n" }, { "answer_id": 1158738, "a...
2008/12/18
[ "https://Stackoverflow.com/questions/377865", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1996/" ]
377,872
<p>I dynamically create an element (div) in javascript, on which i register an event listener:</p> <pre><code>var tooltip = document.createElement('div'); tooltip.onclick = function() { alert('hello'); } </code></pre> <p>Now, if I attach this element to the document body:</p> <pre><code>document.body.appendChild(tooltip); </code></pre> <p>all is well and the event is captured. However (for positioning purposes) i want to attach this element to a (static) sub-element within my page, e.g:</p> <pre><code>document.getElementById('id').appendChild(tooltip); </code></pre> <p>and the element is generated and positioned correctly - but the onclick event now is no longer captured. Any thoughts? This is x-browser, so i must be missing something.</p> <p>Thanks, Don. </p>
[ { "answer_id": 378061, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "<html>\n<head>\n\n<script type=\"text/javascript\">\n\nfunction makeDiv() {\n var tooltip = document.createElement('div');\n\...
2008/12/18
[ "https://Stackoverflow.com/questions/377872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
377,883
<p>I'm making a simple tool that will get a string of MySQL commands and run it (on several DB servers sequentially). I trust the users to be sensible, but mistakes happen, and I'm looking for a way to prevent basic typos:</p> <p>Is there a way to validate, at runtime, (relatively simple) MySQL queries to see if they're syntactically correct?</p> <p>I'm not looking for semantic correctness, e.g. table names or join applicability; just something like a spellcheck for SQL queries.</p> <p>In other words, </p> <pre><code>SELECT * FROM x; </code></pre> <p>or</p> <pre><code>INSERT INTO x SET id=1,bar="foo"; </code></pre> <p>would be marked valid, whereas any of those would not:</p> <pre><code>SELECT FROM x; SECLET * RFOM x; ISNETR INTO x SET id=1; HJBGYGCRYTCY; </code></pre> <p>For <code>SELECT</code>s, I could bend <code>EXPLAIN</code> to my needs - run <code>EXPLAIN SELECT (...)</code> and watch for errors, but is there a way to check for other commands as well? </p>
[ { "answer_id": 377905, "author": "soulmerge", "author_id": 44562, "author_profile": "https://Stackoverflow.com/users/44562", "pm_score": 2, "selected": false, "text": "CREATE TEMPORARY TABLE users SELECT * FROM users;\nINSERT INTO users(name) VALUES('UniqueName');\nDROP TABLE users;\nSEL...
2008/12/18
[ "https://Stackoverflow.com/questions/377883", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19746/" ]
377,901
<p>I'm implementing a JAX-WS webservice that will be consumed by external Java and PHP clients.</p> <p>The clients have to authenticate with a username and password stored in a database per client.</p> <p>What authentication mechanism is best to use to make sure that misc clients can use it?</p>
[ { "answer_id": 9076363, "author": "Philipp", "author_id": 740514, "author_profile": "https://Stackoverflow.com/users/740514", "pm_score": 3, "selected": false, "text": "//First, try authenticating against two predefined parameters in the HTTP \n//Request Header: 'Username' and 'Password'...
2008/12/18
[ "https://Stackoverflow.com/questions/377901", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33468/" ]
377,911
<p>I'm writing an utility (<a href="http://reg2run.sf.net" rel="nofollow noreferrer">http://reg2run.sf.net</a>) which in case execution without arguments works as windows application (shows OpenFileDialog, etc), otherwise - as console application.</p> <p>So, in first case I don't want to show a console window, that's why project is Windows Application. But in second - I need to show it, and it's created with </p> <pre><code>if (ptrNew == IntPtr.Zero) { ptrNew = GetStdHandle(-11); } if (!AllocConsole()) { throw new ExternalCallException("AllocConsole"); } ptrNew = CreateFile("CONOUT$", 0x40000000, 2, IntPtr.Zero, 3, 0, IntPtr.Zero); if (!SetStdHandle(-11, ptrNew)) { throw new ExternalCallException("SetStdHandle"); } StreamWriter newOut = new StreamWriter(Console.OpenStandardOutput()); newOut.AutoFlush = true; Console.SetOut(newOut); Console.SetError(newOut); </code></pre> <p>And what I want - is to grab parent process standard output and use it, if it exists (in case execution via cmd.exe or Far Manager). How can I do it?</p> <p>I tried</p> <pre><code>static Process GetParentProc() { int pidParent = 0; int pidCurrent = Process.GetCurrentProcess().Id; IntPtr hSnapshot = CreateToolhelp32Snapshot(2, 0); if (hSnapshot == IntPtr.Zero) { return null; } PROCESSENTRY32 oProcInfo = new PROCESSENTRY32(); oProcInfo.dwSize = (uint)Marshal.SizeOf(typeof(PROCESSENTRY32)); if (!Process32First(hSnapshot, ref oProcInfo)) { return null; } do { if (pidCurrent == oProcInfo.th32ProcessID) { pidParent = (int)oProcInfo.th32ParentProcessID; } } while (pidParent == 0 &amp;&amp; Process32Next(hSnapshot, ref oProcInfo)); if (pidParent &gt; 0) { return Process.GetProcessById(pidParent); } else { return null; } </code></pre> <p>and</p> <pre><code>StreamWriter newOut = GetParentProc().StandardInput; </code></pre> <p>but got InvalidOperationException: StandardIn has not been redirected. Because of</p> <pre><code>GetParentProc().StartInfo.RedirectStandardOutput = false </code></pre>
[ { "answer_id": 378004, "author": "Barry Kelly", "author_id": 3712, "author_profile": "https://Stackoverflow.com/users/3712", "pm_score": 4, "selected": true, "text": "rxvt/W11/wrap/wrap.c hideConsole() CreateFile(\"CONOUT$\" ...) GetConsoleScreenBufferInfo() SetConsoleTitle FindWindow Sl...
2008/12/18
[ "https://Stackoverflow.com/questions/377911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41956/" ]
377,912
<p>I have the function</p> <pre><code>sublist(_,[_],_) :- !. sublist(X,[Y|T],Z) :- R is X - Y, sublist(X,T,[R|Z]). </code></pre> <p>an example call is <code>sublist(2,[1,2,3],Z)</code>. At the end of execution it just gives me 'yes', but i'd like to see the contents of Z.</p> <p>I know it's something simple as i have other instructions that do similar things, but this one isn't working.</p>
[ { "answer_id": 379025, "author": "Kaarel", "author_id": 12547, "author_profile": "https://Stackoverflow.com/users/12547", "pm_score": 1, "selected": false, "text": "sublist/3 sublist(_, [], []) :- !.\n\nsublist(X, [Y | T], [R | Z]) :-\n R is X - Y,\n sublist(X, T, Z).\n ?- sublist(...
2008/12/18
[ "https://Stackoverflow.com/questions/377912", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42789/" ]
377,916
<p>I'm planning to use MS entity framework for new web apps (come on EF v2!).</p> <p>So does it make sense to plan ahead by adding timestamp columns to all entity tables in existing and future databases, to support concurrency checks? Is there any reason why it would be a <em>bad</em> idea to have a timestamp column in every table?</p> <p>Note that the point is to add support for optimistic concurrency, not auditing.</p>
[ { "answer_id": 377934, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 4, "selected": true, "text": "varbinary(8) timestamp timestamp" } ]
2008/12/18
[ "https://Stackoverflow.com/questions/377916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47346/" ]
377,920
<p>I'm creating a Q&amp;A application in CakePHP, and I want to exclude my associations in some cases. Imagine the following:</p> <p>I'm listing all questions on the first page using $this->Question->findAll();. Since I have the following association in my model:</p> <pre><code>public $hasMany = array('Answer' =&gt; array('className' =&gt; 'Answer', 'order' =&gt; 'Answer.created DESC', 'foreignKey' =&gt; 'post_id', 'dependent' =&gt; true, 'exclusive' =&gt; false, ) ); </code></pre> <p>All answers will get selected at the start page, which is not optimal. How could i do to exclude the answers in this particular method?</p> <p>Thanks</p>
[ { "answer_id": 377969, "author": "duckyflip", "author_id": 7370, "author_profile": "https://Stackoverflow.com/users/7370", "pm_score": 4, "selected": true, "text": "$this->Question->unBindModel(array('hasMany' => array(’Answer’)))\n" } ]
2008/12/18
[ "https://Stackoverflow.com/questions/377920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41596/" ]
377,924
<p>I got a table with a custom TableCellEditor (extending DefaultCellEditor) with a JFormattedTextField as the editor component.</p> <p>Now I got problem: when I press a separate button while editing. When the button is pressed, the editor remains "open and active" while I'd want it to stop editing so that the changes made would be available for the operations caused by the button.</p> <p>So how to cause the editing to be stopped when a distinct button is pressed. I tried <em>setFocusLostBehavior(JFormattedTextField.COMMIT)</em> for the <em>JFormattedTextField</em> but it didn't seem to have effect.</p> <p>Hope somebody has some good ideas =)</p>
[ { "answer_id": 377937, "author": "asalamon74", "author_id": 21348, "author_profile": "https://Stackoverflow.com/users/21348", "pm_score": 5, "selected": true, "text": "jtable.putClientProperty(\"terminateEditOnFocusLost\", Boolean.TRUE);" } ]
2008/12/18
[ "https://Stackoverflow.com/questions/377924", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28482/" ]
377,927
<p>I am writing a console program in C#.</p> <p>Is there a way I can use a Console.Clear() to only clear certain things on the console screen?</p> <p>Here's my issue:</p> <p>I have a logo (I put it on screen using Console.WriteLine()) and a 2d array which I want to keep constant and clear everything below it. </p>
[ { "answer_id": 378036, "author": "Diadistis", "author_id": 47401, "author_profile": "https://Stackoverflow.com/users/47401", "pm_score": 6, "selected": true, "text": "static void Clear(int x, int y, int width, int height)\n{\n int curTop = Console.CursorTop;\n int curLeft = Console...
2008/12/18
[ "https://Stackoverflow.com/questions/377927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47415/" ]
377,930
<p>Given a string S, what is the best algorithm to find a substring which repeats maximum number of times.</p> <p>For example, in "assdssfssd", it is "ss" which repeats maximum number of times.</p>
[ { "answer_id": 377947, "author": "Can Berk Güder", "author_id": 2119, "author_profile": "https://Stackoverflow.com/users/2119", "pm_score": 1, "selected": false, "text": ">>> str = 'Can Berk Güder'\n>>> letters = [l for l in str]\n>>> uniq_letters = set(letters)\n>>> counts = [(letters.c...
2008/12/18
[ "https://Stackoverflow.com/questions/377930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39615/" ]
377,942
<p>Similar to the XP login screen, in Flex 3, how can I display a warning to the user in a textbox that the CAPS LOCK key is enabled?</p>
[ { "answer_id": 377959, "author": "mmattax", "author_id": 1638, "author_profile": "https://Stackoverflow.com/users/1638", "pm_score": 1, "selected": false, "text": "\nif(flash.ui.Keyboard.capsLock){\n // caps lock is on...\n}\n \n<mx:Box width=\"100%\" id=\"capsbox\"\n visible=\"{fl...
2008/12/18
[ "https://Stackoverflow.com/questions/377942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5592/" ]
377,960
<p>I want to set the font color of a cell to a specific RGB value.</p> <p>If I use</p> <pre><code>ActiveCell.Color = RGB(255,255,0) </code></pre> <p>I do get yellow, but if I use a more exotic RGB value like:</p> <pre><code>ActiveCell.Color = RGB(178, 150, 109) </code></pre> <p>I just get a grey color back.</p> <p>How come can't I just use any RGB value? And do you know any workarounds?</p> <p>Thanks.</p>
[ { "answer_id": 378014, "author": "LeppyR64", "author_id": 16592, "author_profile": "https://Stackoverflow.com/users/16592", "pm_score": 4, "selected": true, "text": " Public Sub checkPalette()\n Dim i As Integer, iRed As Integer, iGreen As Integer, iBlue As Integer\n Dim lcolor...
2008/12/18
[ "https://Stackoverflow.com/questions/377960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45467/" ]
377,961
<p>Hey there, I've got a block of HTML that I'm going to be using repeatedly (at various times during a users visit, not at once). I think that the best way to accomplish this is to create an HTML div, hide it, and when needed take its innerHTML and do a replace() on several keywords. As an example HTML block...</p> <pre><code>&lt;div id='sample'&gt; &lt;h4&gt;%TITLE%&lt;/h4&gt; &lt;p&gt;Text text %KEYWORD% text&lt;/p&gt; &lt;p&gt;%CONTENT%&lt;/p&gt; &lt;img src="images/%ID%/1.jpg" /&gt; &lt;/div&gt; </code></pre> <p>Would the best way to replace those keywords with dynamic data be to go...</p> <pre><code>template = document.getElementById('sample'); template = template.replace(/%TITLE%/, some_var_with_title); template = template.replace(/%KEYWORD%/, some_var_with_keyword); template = template.replace(/%CONTENT%/, some_var_with_content); template = template.replace(/%ID%/, some_var_with_id); </code></pre> <p>It just feels like I've chosen a stupid way to do this. Does anyone have any suggestions on how to do this faster, smarter, or better in any way? This code will be executed fairly often during a users visit, sometimes as often as once every 3-4 seconds.</p> <p>Thanks in advance.</p>
[ { "answer_id": 377976, "author": "annakata", "author_id": 13018, "author_profile": "https://Stackoverflow.com/users/13018", "pm_score": 1, "selected": false, "text": "with(document.getElementById('sample'))\n{\n innerHTML = innerHTML.replace(a, A).replace(b, B).replace(c, C); //etc\n}\n...
2008/12/18
[ "https://Stackoverflow.com/questions/377961", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
377,968
<p>Like the question says, if I have a request for a page on my site like this</p> <p><a href="http://somename.something.here/Dada.aspx" rel="nofollow noreferrer">http://somename.something.here/Dada.aspx</a></p> <p>to something like this</p> <p><a href="https://somename.something.here/Dada.aspx" rel="nofollow noreferrer">https://somename.something.here/Dada.aspx</a></p>
[ { "answer_id": 377980, "author": "Bork Blatt", "author_id": 5381, "author_profile": "https://Stackoverflow.com/users/5381", "pm_score": -1, "selected": false, "text": "Response.Redirect(\"WebForm2.aspx\")\n" }, { "answer_id": 377989, "author": "BobbyShaftoe", "author_id":...
2008/12/18
[ "https://Stackoverflow.com/questions/377968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17787/" ]
377,990
<p>I have a set of five boolean values. If more than one of these are true I want to excecute a particular function. What is the most elegant way you can think of that would allow me to check this condition in a single if() statement? Target language is C# but I'm interested in solutions in other languages as well (as long as we're not talking about specific built-in functions). </p> <p>One interesting option is to store the booleans in a byte, do a right shift and compare with the original byte. Something like <code>if(myByte &amp;&amp; (myByte &gt;&gt; 1))</code> But this would require converting the separate booleans to a byte (via a bitArray?) and that seems a bit (pun intended) clumsy... <em>[edit]Sorry, that should have been</em> <code>if(myByte &amp; (myByte - 1))</code> <em>[/edit]</em></p> <p>Note: This is of course very close to the classical "population count", "sideways addition" or "Hamming weight" programming problem - but not quite the same. I don't need to know how many of the bits are set, only if it is more than one. My hope is that there is a much simpler way to accomplish this. </p>
[ { "answer_id": 378018, "author": "faulty", "author_id": 20007, "author_profile": "https://Stackoverflow.com/users/20007", "pm_score": 3, "selected": false, "text": "if (bool1 || bool2 || bool3 || bool4 || bool5)\n int counter = 0;\nif (bool1) counter++;\nif (bool2) counter++;\nif (bool3)...
2008/12/18
[ "https://Stackoverflow.com/questions/377990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6903/" ]
377,992
<p>I've been playing around with Qt for a few hours now. I found that qmake produces Xcode project files on Mac OS X instead of good ol' makefiles. I don't want to launch Xcode every time I want to build "Hello, world".</p> <p>How do I make qmake generate regular makefiles or, if that's something that cannot be done on the Mac, how do I compile <code>.xcodeproj</code> files from the command line?</p> <p>I tried <code>xcodebuild -project myProject -alltargets</code>. I get a lot of output followed by <code>Abort trap</code>.</p>
[ { "answer_id": 378102, "author": "Olie", "author_id": 34820, "author_profile": "https://Stackoverflow.com/users/34820", "pm_score": 6, "selected": false, "text": "$ man xcodebuild\n $ xcodebuild -project myProject.xcodeproj -alltargets\n" }, { "answer_id": 378614, "author": "...
2008/12/18
[ "https://Stackoverflow.com/questions/377992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47135/" ]
377,999
<p>I find that what not to do is a harder lesson to learn than what should be done. </p> <p>From my experience, what separates an expert from an intermediate is the ability to select from among various seemingly equivalent ways of doing the same thing.</p> <p>So, when it comes to JavaScript <strong>what kinds of things should you not do and why</strong>?</p> <p>I'm able to find lots of these for Java, but since JavaScript's typical context (in a browser) is very different from Java's I'm curious to see what comes out.</p>
[ { "answer_id": 378031, "author": "annakata", "author_id": 13018, "author_profile": "https://Stackoverflow.com/users/13018", "pm_score": 6, "selected": false, "text": "undefined" }, { "answer_id": 378049, "author": "scunliffe", "author_id": 6144, "author_profile": "htt...
2008/12/18
[ "https://Stackoverflow.com/questions/377999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2443/" ]
378,030
<p>I have a windows service that runs fine, but I have to have it run under a special user account.</p> <p>Currently I go into services and change the logon as section, but for deployment this has to be done more professionally.</p> <p>Is there a way for me to have it logon as a custom user account programatically, or during the installation process of the service?</p>
[ { "answer_id": 378042, "author": "Charles Bretana", "author_id": 32632, "author_profile": "https://Stackoverflow.com/users/32632", "pm_score": 3, "selected": true, "text": " public class MyServiceInstaller : Installer\n {\n private ServiceInstaller servInst;\n private Se...
2008/12/18
[ "https://Stackoverflow.com/questions/378030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39677/" ]
378,040
<p>I have a problem that I would like have solved via a SQL query. This is going to be used as a PoC (proof of concept).</p> <p>The problem:</p> <p>Product offerings are made up of one or many product instances, a product instance can belong to many product offerings. This can be realised like this in a table:</p> <pre><code>PO | PI ----- A | 10 A | 11 A | 12 B | 10 B | 11 C | 13 </code></pre> <p>Now I would like to get back the product offer from a set of product instances. E.g. if we send in 10,11,13 the expected result back is B &amp; C, and if we send in only 10 then the result should be NULL since no product offering is made up of only 10. Sending in 10,11,12 would result in A (not A &amp; B since 12 is not a valid product offer in it self).</p> <p>Prerequisites: The combination of product instances sent in can only result in one specific combination of product offerings, so there is only one solution to each query.</p>
[ { "answer_id": 378074, "author": "hamishmcn", "author_id": 3590, "author_profile": "https://Stackoverflow.com/users/3590", "pm_score": 1, "selected": false, "text": "select distinct po \nfrom tbl \nwhere po not in ( select po from tbl where pi not in (10,11,13) )\n" }, { "answer_...
2008/12/18
[ "https://Stackoverflow.com/questions/378040", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47431/" ]
378,066
<p>If I have a form-backing object that has a complicated object tree -- say a Person that has a Contact Info object that has an Address object that has a bunch of Strings -- it seems that the object needs to be fully populated with component objects before I can bind to it. So if I'm creating a new Person, I need to make sure it has all the component objects populated off the bat, and if I'm retrieving a Person from the database, I need to make sure that any objects that aren't populated from the database get populated with empty objects.</p> <p>First question, of course -- am I correct in my assumptions above? It does seem that if I try to bind to person.contactInfo.homeAddress.street and there is no ContactInfo, I get a null pointer exception.</p> <p>Second, what's the best way to initialize my object. I can think of a couple of approaches. One is to initialize all member objects at declaration:</p> <pre><code>public class Person { String name; ContactInfo contactInfo = new ContactInfo(); //getters, setters, etc. } public class ContactInfo { String phone; Address homeAddress = new Address(); } </code></pre> <p>and so forth.</p> <p>Another approach is to have a PersonFactory that initializes everything (or to have a factory method Person.getInstance that initializes everything).</p> <p>In the case of retrieving a Person from the database, the first approach will solve the issue (i.e. if this particular person doesn't have an address in the database, the object will still have an Address), but this will mean creating each object twice. Not sure how to handle this otherwise, except to make the DAO explicitly populate everything even if nothing has been retrieved from the database. Or to give the factory a method to go through the object and "fill in" anything that's missing.</p> <p>Suggestions?</p>
[ { "answer_id": 379304, "author": "Olivier", "author_id": 43585, "author_profile": "https://Stackoverflow.com/users/43585", "pm_score": 1, "selected": false, "text": " < form:input path=\"person.contactInfo.homeAddress.street\"/> person.contactInfo.homeAddress.street person.getContactInf...
2008/12/18
[ "https://Stackoverflow.com/questions/378066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1237/" ]
378,089
<p>The most recent Crystal XI component for Delphi was released for Delphi 7. That VCL component compiles in D2007, but gives me errors at runtime. What is the best way to display a database-connected Crystal Report in a Delphi 2007 application?</p>
[ { "answer_id": 378099, "author": "JosephStyons", "author_id": 672, "author_profile": "https://Stackoverflow.com/users/672", "pm_score": 3, "selected": true, "text": "...\nuses\n CrystalActiveXReportViewerLib11_5_TLB, OleAuto;\n...\n\nprocedure TForm1.Button1Click(Sender: TObject);\nvar\...
2008/12/18
[ "https://Stackoverflow.com/questions/378089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/672/" ]
378,092
<p>I'm using HTTPService with a POST operation to submit a Base64 encoded file (taken from bitmap data within the app) but I could really do with getting some idea of the progress of the POST operation (e.g. like the FileReference.upload()).</p> <p>I don't think this is possible, but it would be awesome if it is (via any means, I'm willing to change my setup to get this).</p>
[ { "answer_id": 389926, "author": "ForYourOwnGood", "author_id": 48728, "author_profile": "https://Stackoverflow.com/users/48728", "pm_score": 4, "selected": true, "text": "\nprivate function forYou() : void{\n var req : URLRequest = new URLRequest(\"PUT YOUR URL HERE\")\n var loa...
2008/12/18
[ "https://Stackoverflow.com/questions/378092", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6432/" ]
378,096
<p>In a stylesheet i have:</p> <pre><code> * HTML BODY { padding-right: 0px; padding-left: 0px; padding-bottom: 25px; padding-top: 190px; } * HTML #maincontent { width: 100%; height: 100%; } </code></pre> <p>i know that a . means class and a # means applied to the id, but what does * HTML mean?</p>
[ { "answer_id": 378113, "author": "Greg", "author_id": 24181, "author_profile": "https://Stackoverflow.com/users/24181", "pm_score": 2, "selected": false, "text": "* HTML BODY <html> <body> * HTML BODY" }, { "answer_id": 378119, "author": "Mark Pim", "author_id": 38883, ...
2008/12/18
[ "https://Stackoverflow.com/questions/378096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46716/" ]
378,097
<p>I have a TreeView control showing multiple TreeNodes in an organised heirarchy. I want to stop the user selecting the highest level Nodes (this was achieved by using the BeforeSelect Event). I also want to stop the TreeView from highlighting the top level nodes if the user selects them i.e. stop the TreeView from changing the background color of the node and 'selecting' it.</p> <p>The TreeView that I am using is the WinForms version of the control.</p> <p>Below is the source code I am currently attempting to use:</p> <pre><code>private void tree_BeforeSelect ( object sender, TreeViewCancelEventArgs e ) { if ( e.Node.Level == 0 ) { e.Cancel = true; } } </code></pre> <p>This does de-select the Node but only after a noticible flash (~200ms) which is undesirable.</p>
[ { "answer_id": 972830, "author": "OneSHOT", "author_id": 1996973, "author_profile": "https://Stackoverflow.com/users/1996973", "pm_score": 3, "selected": true, "text": "private void treeView1_MouseDown(object sender, MouseEventArgs e)\n{\n TreeNode tn = treeView1.GetNodeAt(e.Location)...
2008/12/18
[ "https://Stackoverflow.com/questions/378097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1816/" ]
378,101
<p>I've created a simple HttpModule to log the uses of my existing webservice. There's a dll containing a single class </p> <pre><code>public class TrackingModule : System.Web.IHttpModule { public TrackingModule(){} public void Init(System.Web.HttpApplication context) { context.BeginRequest+=new EventHandler(context_BeginRequest); } public void Dispose() { } private void context_BeginRequest(object sender, EventArgs e) { try { Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.Publish( new Exception("Log attept") ); HttpApplication app = (HttpApplication)sender; string method = app.Request.RawUrl; SaveUseToDatabase( app.Request.UserHostAddress, method ); } catch( Exception ex ) { try { Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.Publish( ex ); } catch{} } } } </code></pre> <p>After compiling the dll I add it to webservice's bin folder and in webservice's web.config I add:</p> <pre><code>&lt;system.web&gt; &lt;httpModules&gt; &lt;add name="TrackingModule" type="WebserviceTrackingModule.TrackingModule, WebserviceTrackingModule"/&gt; </code></pre> <p>This works fine on my computer, but when I copy it to production server, nothing happens. No new entries in database, no entries logged by ExceptionManager. As if it's not there at all.</p> <p>What can I be missing?</p> <p>Edit: After performing another test I can add that it works when I add it for a webservice that has it's own top-level virtual directory. It doesn't work for webservices that reside in virtual directories that are subfolders of another virtual directory.</p> <p>I know that HttpModules settings are being inherited by subdirectories, but it looks like the existence of parent directory gets in the way.</p>
[ { "answer_id": 378136, "author": "Bullines", "author_id": 27870, "author_profile": "https://Stackoverflow.com/users/27870", "pm_score": 0, "selected": false, "text": "<add name=\"TrackingModule\" type=\"WebserviceTrackingModule.TrackingModule\" />\n" } ]
2008/12/18
[ "https://Stackoverflow.com/questions/378101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34402/" ]
378,105
<p>We have a custom section in my app.config file related to our IoC container class. How can I get intellisense when editing the config file for this section, as well as getting rid of the compiler messages informing me of the missing schema.</p> <p>I found this question here: <a href="https://stackoverflow.com/questions/229155/appconfig-configsections-custom-settings-can-not-find-schema-information">app.config configSections custom settings can not find schema information</a>, but I don't understand if it applies to my problem or not, and how to use the answer there if it does.</p> <p>I also found this page <a href="http://www.radsoftware.com.au/articles/intellisensewebconfig.aspx" rel="nofollow noreferrer">How to get Intellisense for Web.config and App.config in Visual Studio .NET</a>, but it says to remove the xmlns attribute before running the application. Is that really the only/best way?</p> <p>Here is an example of a simple file:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;configuration&gt; &lt;configSections&gt; &lt;section name="ServiceContainers" type="LVK.IoC.RegistrationsSectionHandler, LVK"/&gt; &lt;/configSections&gt; &lt;ServiceContainers&gt; &lt;Registration type="DatabaseConnection" class="DatabaseConnection"&gt; &lt;Parameter name="connectionString" type="System.String" value="TYPE=MSSQL2000;SERVER=localhost;DATABASE=db"/&gt; &lt;/Registration&gt; &lt;/ServiceContainers&gt; &lt;/configuration&gt; </code></pre> <p>Basically I would like to be able to type <code>&lt;R</code> inside the <code>&lt;ServiceContainers&gt;</code> node, and get Registration suggested to me in the intellisense dropdown, as well as the appropriate attributes for it.</p>
[ { "answer_id": 378162, "author": "Steven A. Lowe", "author_id": 9345, "author_profile": "https://Stackoverflow.com/users/9345", "pm_score": 5, "selected": true, "text": "<xs:include schemaLocation=\"YOUR_DIRECTORY\\namespace.assemblyname.xsd\"/>\n" }, { "answer_id": 25770350, ...
2008/12/18
[ "https://Stackoverflow.com/questions/378105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/267/" ]
378,106
<p>I've downloaded the svntask for ant from tigris.org, so it is the "official" one.</p> <p>I have a simple task to update my entire project</p> <pre><code>&lt;target name="prepare"&gt; &lt;svn username="user" password="pass"&gt; &lt;update&gt; &lt;fileset dir="."/&gt; &lt;/update&gt; &lt;/svn&gt; &lt;/target&gt; </code></pre> <p>Running this task took about 2 hours.</p> <p>Running a <code>svn update</code> on the command line took about 5 seconds.</p> <p>(in both cases, there were no updates to bring down from the server)</p> <p>I've also tried chaning the method that svntask uses to interface with subversion, I've tried both the svnkit method and the command line method.</p> <p>Any ideas why this may be taking so long? Obviously this is unacceptably slow.</p> <p>Thanks</p>
[ { "answer_id": 378358, "author": "FoxyBOA", "author_id": 19347, "author_profile": "https://Stackoverflow.com/users/19347", "pm_score": 1, "selected": false, "text": "<svn username=\"user\" password=\"pass\" svnkit=\"true\">\n <target name=\"prepare\">\n <svn username=\"user\" password=\...
2008/12/18
[ "https://Stackoverflow.com/questions/378106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
378,117
<p>I've been tasked with rewriting the Javascript engine currently powering my customer's internal website. While reviewing the code I've come across this function <em>flvFPW1</em> which I do not recognize, nor can I decipher the code(my Javascript knowledge is modest at best). A Google search gives me a few hits, but most if not all page hits are from the Javascript used on that particular page. In other words, I cannot find a description for this function, even though it is obviously used by others. </p> <p>Can someone here enlighten me?</p> <p>Thanks / Fredrik</p>
[ { "answer_id": 378152, "author": "scunliffe", "author_id": 6144, "author_profile": "https://Stackoverflow.com/users/6144", "pm_score": 1, "selected": false, "text": "javascript:alert(flvFPW1);\n" }, { "answer_id": 378243, "author": "Ates Goral", "author_id": 23501, "a...
2008/12/18
[ "https://Stackoverflow.com/questions/378117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3999/" ]
378,118
<p>Should I instantiate my worker variables inside or outside my for loop</p> <p>E.g.</p> <p>a)</p> <pre><code>bool b = default(bool); for (int i = 0; i &lt; MyCollection.Length; i++) { b = false; foreach(object myObject in myObjectCollection) { if (object.Property == MyCollection[i].Property) { b = true; break; } } if (b) { DoSomethingWith(MyCollection[i]); } } </code></pre> <p>b)</p> <pre><code>for (int i = 0; i &lt; MyCollection.Length; i++) { bool b = default(bool); foreach(object myObject in myObjectCollection) { if (object.Property == MyCollection[i].Property) { b = true; break; } } if (b) { DoSomethingWith(MyCollection[i]); } } </code></pre> <p>EDIT: Seems universally agreed that there will be no difference where the IL is concerned. But for readability and clarity of scope... inside is better</p>
[ { "answer_id": 378140, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 2, "selected": true, "text": "using System;\n\nclass Test\n{\n static void Main() {}\n\n static void DeclareInside()\n {\n for (int i=0...
2008/12/18
[ "https://Stackoverflow.com/questions/378118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12918/" ]
378,133
<p>Given a DOM element how do I find its nearest parent with a given css class?</p> <pre><code>$(".editButton").click(function() { (magic container selector goes here).addClass("editing"); }); </code></pre> <p>I don't want to use lots or $(...).parent().parent() since I don't want to be bound to a particular dom structure.</p>
[ { "answer_id": 378148, "author": "Bill Zeller", "author_id": 19234, "author_profile": "https://Stackoverflow.com/users/19234", "pm_score": 6, "selected": true, "text": "$(this).parents('.classYouWant:first').addClass(\"editing\");\n" }, { "answer_id": 378160, "author": "missa...
2008/12/18
[ "https://Stackoverflow.com/questions/378133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2443/" ]
378,134
<p>Here's the deal. </p> <p>My WinApp is running, right? in let's say process 'A'.It creates a file and keeps the handle (keeps the file open for writing, this is a must).<br> Then it starts other msbuild process, let's call it 'B'. This process is started with the <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.process(VS.80).aspx" rel="nofollow noreferrer">System.Diagnostic.Process</a> class.<br> At some point, my WinApp (A) needs to delete the previously created file (remember it was created by A itself), and that's when I get an IOException with the message "The process cannot access the file 'X' because it is being used by another process". And it actually is!... If I terminate process 'B', only then 'A' can successfully delete the file.</p> <p>So my questions are:<br> 1) Is there a way I can tell the process I create not no handle the files I opened?<br> 2) Is there another way to achieve my scenario?</p>
[ { "answer_id": 378313, "author": "Arnout", "author_id": 3496, "author_profile": "https://Stackoverflow.com/users/3496", "pm_score": 3, "selected": true, "text": "System.Diagnostic.Process.Start bInheritHandles true UseShellExecute CreateProcess" }, { "answer_id": 378359, "aut...
2008/12/18
[ "https://Stackoverflow.com/questions/378134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23893/" ]
378,153
<p>I am having some issues with using the OrderBy extension method on a LINQ query when it is operating on an enum type. I have created a regular DataContext using visual studio by simply dragging and dropping everything onto the designer. I have then created seperate entity models, which are simply POCO's, and I have used a repository pattern to fetch the data from my database and map them into my own entity models (or rather, I have a repository pattern, that builds up and IQueryable that'll do all this).</p> <p>Everything works just fine, except when I try to apply an OrderBy (outside of the repository) on a property that I have mapped from short/smallint to an enum.</p> <p>Here are the relevant code bits:</p> <pre><code>public class Campaign { public long Id { get; set; } public string Name { get; set; } .... public CampaignStatus Status { get; set; } ... } public enum CampaignStatus : short { Active, Inactive, Todo, Hidden } public class SqlCampaignRepository : ICampaignRepository { ... public IQueryable&lt;Campaign&gt; Campaigns() { DataContext db = new DataContext(); return from c in db.Campaigns select new Campaign { Id = c.Id, Name = c.Name, ... Status = (CampaignStatus)c.Status, ... }; } } </code></pre> <p>And then elsewhere</p> <pre><code>SqlCampaignRepository rep = new SqlCampaignRepository(); var query = rep.Campaigns().OrderBy(c =&gt; c.Status); </code></pre> <p>This triggers the following exception: System.ArgumentException was unhandled by user code Message="The argument 'value' was the wrong type. Expected 'IQMedia.Models.CampaignType'. Actual 'System.Int16'." Source="System.Data.Linq" StackTrace: ved System.Data.Linq.SqlClient.SqlOrderExpression.set_Expression(SqlExpression value) ved System.Data.Linq.SqlClient.SqlBinder.Visitor.VisitSelect(SqlSelect select) ved System.Data.Linq.SqlClient.SqlVisitor.Visit(SqlNode node) ved System.Data.Linq.SqlClient.SqlBinder.Visitor.VisitIncludeScope(SqlIncludeScope scope) ...</p> <p>(sorry about the danish in there, ved = by/at).</p> <p>I have tried typecasting the Status to short in the orderBy expression, but that doesn't help it, same if i cast it to the actual enum type as well.</p> <p>Any help fixing this is greatly appreciated!</p>
[ { "answer_id": 378191, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 1, "selected": false, "text": "Campaign Campaigns Campaigns Campaign select new [Function] ABS [Function(Name=\"ABS\", IsComposable=true)] \n ...
2008/12/18
[ "https://Stackoverflow.com/questions/378153", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40240/" ]
378,157
<p>I am trying to use regular expressions to find a UK postcode within a string.</p> <p>I have got the regular expression working inside RegexBuddy, see below:</p> <pre><code>\b[A-Z]{1,2}[0-9][A-Z0-9]? [0-9][ABD-HJLNP-UW-Z]{2}\b </code></pre> <p>I have a bunch of addresses and want to grab the postcode from them, example below:</p> <blockquote> <p>123 Some Road Name<br /> Town, City<br /> County<br /> PA23 6NH</p> </blockquote> <p>How would I go about this in Python? I am aware of the <code>re</code> module for Python but I am struggling to get it working.</p> <p>Cheers</p> <p>Eef</p>
[ { "answer_id": 378222, "author": "kristina", "author_id": 4243, "author_profile": "https://Stackoverflow.com/users/4243", "pm_score": 0, "selected": false, "text": "import re\nre.findall(\"[A-Z]{1,2}[0-9][A-Z0-9]? [0-9][ABD-HJLNP-UW-Z]{2}\", x)\n" }, { "answer_id": 378228, "a...
2008/12/18
[ "https://Stackoverflow.com/questions/378157", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30786/" ]
378,158
<p>I have an executable module created by third party. I would like to "inject" my code (kind of watchdog running in separate thread) into this process. </p> <p>So far there are two possible ways - one is to run my code as executable and dynamically load a proess on top of it (seems to be very hard and tricky) or to make my code a shared object, load it via LD_PRELOAD and initialize from some static variable constructor.</p> <p>Are there more convenient ways to do this ? My OS are Linux x86 and Solaris-SPARC.</p> <p>Update: If possible, I'd like not to patch the process, but load my code dynamicaly.</p>
[ { "answer_id": 7706456, "author": "RushPL", "author_id": 403571, "author_profile": "https://Stackoverflow.com/users/403571", "pm_score": 0, "selected": false, "text": "#include <stdio.h>\n#include <sys/types.h>\n#include <pwd.h>\nint main()\n{\n struct passwd* pswd = getpwuid(1000);\n...
2008/12/18
[ "https://Stackoverflow.com/questions/378158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18174/" ]
378,161
<p>I’m working on an in-house app that tracks a bunch of tasks. I wanted to have a simple task monitor that would list the task name and the task’s status. I need this to look just a little nice, I’m no designer so whatever I do is going to suck, but a basic text display won’t work for the project requirements.</p> <p>What I am essentially attempting to do is show something similar to the Firefox download window, the I-Tunes download window, and well I could name more but they all look basically the same. In each of these apps, each of the ‘progress panels’ is selectable. So to implement this I thought it would be simple to just use a list of JPanels each with a JProgressBar and a JLabel, each of which can just accept focus to determine if it and others are selected. I thought this was going to be an easy task, but if I use a JList it just displays text. I then just figured I would show all the task panels in a larger panel, but I cannot get the inner panels to recognize focus.</p> <p>Is there a pattern for this? Is there a rolled standard solution that I just have not found? Or is there a better method for doing this? I don’t want to re-invent the wheel, but I thought this was just going to be simple.</p>
[ { "answer_id": 378174, "author": "Elie", "author_id": 23249, "author_profile": "https://Stackoverflow.com/users/23249", "pm_score": 0, "selected": false, "text": "JTable JPanel JProgressBar JLabel JList" }, { "answer_id": 378211, "author": "coobird", "author_id": 17172, ...
2008/12/18
[ "https://Stackoverflow.com/questions/378161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47438/" ]
378,167
<p>Looking for advice (perhaps best practice).</p> <p>We have a MS Word document (Office 2007) that we are extracting text from a cell.</p> <p>We can use the following:</p> <pre><code>string text = wordTable.cell(tablerow.index, 1).Range.Text; </code></pre> <p>The text is extracted; however we seem to get extra characters trailing, for example <code>\r\a</code>.</p> <p>Now we could add the following:</p> <pre><code>.... wordTable.cell(tablerow.index, 1).Range.Text.Replace("\r\a,""); </code></pre> <p>But this seems a little too lazy, and pretty much a waste of time that would most likely lead to problems down the road.</p> <p>We could also have a method that receives the string to clean:</p> <pre><code>private string cleanTextWordCellBreak(string wordTextToClean) { // Clean the text here return cleanstring; } </code></pre> <p>then we could use it:</p> <pre><code>cleanTextWordCellBreak(wordTable.cell(tablerow.index, 1).Range.Text; ); </code></pre> <p>This seems closer to a better way of handling the issue. What would you do?</p>
[ { "answer_id": 378286, "author": "Hans-Eric", "author_id": 39348, "author_profile": "https://Stackoverflow.com/users/39348", "pm_score": 3, "selected": true, "text": "\\r\\a private string stripCellText(string text)\n{\n return text.Replace(\"\\r\\a\", \"\");\n}\n\nstring text = str...
2008/12/18
[ "https://Stackoverflow.com/questions/378167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44376/" ]
378,204
<p>I have two arrays containing the same elements, but in different orders, and I want to know the extent to which their orders differ.</p> <p>The method I tried, didn't work. it was as follows:</p> <p>For each list I built a matrix which recorded for each pair of elements whether they were above or below each other in the list. I then calculated a pearson correlation coefficient of these two matrices. This worked extremely badly. Here's a trivial example:</p> <pre> list 1: 1 2 3 4 list 2: 1 3 2 4 </pre> <p>The method I described above produced matrices like this (where 1 means the row number is higher than the column, and 0 vice-versa):</p> <pre> list 1: 1 2 3 4 1 1 1 1 2 1 1 3 1 4 list 2: 1 2 3 4 1 1 1 1 2 0 1 3 1 4 </pre> <p>Since the only difference is the order of elements 2 and 3, these should be deemed to be very similar. The Pearson Correlation Coefficient for those two matrices is 0, suggesting they are not correlated at all. I guess the problem is that what I'm looking for is not really a correlation coefficient, but some other kind of similarity measure. Edit distance, perhaps?</p> <p>Can anyone suggest anything better?</p>
[ { "answer_id": 378221, "author": "jamesh", "author_id": 4737, "author_profile": "https://Stackoverflow.com/users/4737", "pm_score": 5, "selected": true, "text": "List 1: A B C D E\nList 2: A D C B E\n A B C D E\n0 3 2 1 4\n A B C D E\n0 1 2 3 4\n A B C D E\n0 -2 0 2 0\n A B C D E\n 4 ...
2008/12/18
[ "https://Stackoverflow.com/questions/378204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11522/" ]
378,207
<p>suppose I declare a dynamic array like</p> <pre><code>int *dynArray = new int [1]; </code></pre> <p>which is initialized with an unknown amount of int values at some point.</p> <p>How would I iterate till the end of my array of unknown size?</p> <p>Also, if it read a blank space would its corresponding position in the array end up junked?</p> <h1>Copying Input From users post below:</h1> <p>Thing is:</p> <p>a) I'm not allowed to use STL (means: no )</p> <p>b) I want to decompose a string into its characters and store them. So far I wanted to use a function like this:</p> <pre><code> string breakLine (string line){ int lineSize = line.size(); const char *aux; aux=line.data(); int index=0; while (index&lt;=lineSize){ mySynonyms[index]=aux[index]; index++; } </code></pre> <p>I thought that the array aux would end up junked if there was a large blank space between the two numbers to be stored (apparently not). And I was wondering if there was a way to iterate till an undefined end in this type of array. Thanks for you answers.</p>
[ { "answer_id": 378235, "author": "Nemanja Trifunovic", "author_id": 8899, "author_profile": "https://Stackoverflow.com/users/8899", "pm_score": 4, "selected": true, "text": "std::vector" }, { "answer_id": 378238, "author": "xtofl", "author_id": 6610, "author_profile":...
2008/12/18
[ "https://Stackoverflow.com/questions/378207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45963/" ]
378,210
<p>I have built a database in MS Access. There I have a table called Customers which also has a cell called Employee type: integer. I also built a program in C++ which controls all data.</p> <p>Let's say I have a string like this:</p> <pre><code>string sqlString = "SELECT * FROM Customers Where Customers.Employee = '" + id + "' "; </code></pre> <p>Id passes through my function correctly and is an integer, so I get an error in compilation saying: "Invalid pointer addition".</p> <p>If I declare id as a string of course there's no error but there are no results in my form also. If I declare in database cell Employee as text and build my query like this:</p> <pre><code>string sqlString = "SELECT * FROM Customers WHERE Customers.Employee = 128"; </code></pre> <p>I get results, but I need that Employee as an integer cause its a foreign key from another table.</p> <p>So, what should I do with my query to have results passing integer as parameter through variable id, to be ok with the cell Employee from database which is also integer? Any ideas? I would really appreciate some help here.</p> <hr> <p>As I said, if I convert id to string, there are no results in my form since Employee in database is an integer. So this:</p> <pre><code>std::ostringstream buf; buf &lt;&lt; "SELECT * FROM Customers Where Customers.Employee = '" &lt;&lt; id &lt;&lt; "' "; string str = buf.str(); </code></pre> <p>won't do the job or any other conversion.</p> <p>How can I pass id as an integer in my query?</p>
[ { "answer_id": 378251, "author": "Bill Zeller", "author_id": 19234, "author_profile": "https://Stackoverflow.com/users/19234", "pm_score": 2, "selected": false, "text": "std::ostringstream buf;\nbuf << \"SELECT * FROM Customers Where Customers.Employee = '\" << id << \"' \";\nstring str...
2008/12/18
[ "https://Stackoverflow.com/questions/378210", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
378,217
<p>Following on from <a href="https://stackoverflow.com/questions/367966/how-to-intercept-debugging-information-debugview-style-in-c">this question</a> I now have code that can attach to a process using the Mdbg API.</p> <p>The problem is that I can't detach from the process if I need to. When I call <strong>mgProcess.Detach().WaitOne();</strong> ( where mgProcess is a MDbgProcess created from an MDbgEngine object ) I get the following error message:</p> <pre><code> Process not synchronized. (Exception from HRESULT: 0x80131302) at Microsoft.Samples.Debugging.CorDebug.NativeApi.ICorDebugController.Detach() at Microsoft.Samples.Debugging.CorDebug.CorController.Detach() in C:\mdbg\src\debugger\corapi\Controller.cs:line 89 at Microsoft.Samples.Debugging.MdbgEngine.MDbgProcess.Detach() in C:\mdbg\src\debugger\mdbgeng\Process.cs:line 716 </code></pre> <p>If I just try to call <strong>mgProcess.Detach()</strong> or <strong>mgProcess.CorProcess.Detach()</strong> I get the same result.</p> <p>Does anyone know the correct way to detach an Mdbg process?</p>
[ { "answer_id": 378363, "author": "glenatron", "author_id": 15394, "author_profile": "https://Stackoverflow.com/users/15394", "pm_score": 3, "selected": true, "text": " MgProcess.CorProcess.Stop(0);\n MgProcess.Detach();\n" }, { "answer_id": 1733728, "author": "Saurabh", ...
2008/12/18
[ "https://Stackoverflow.com/questions/378217", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15394/" ]
378,225
<p>I have this:</p> <pre><code>If String.IsNullOrEmpty(editTransactionRow.pay_id.ToString()) = False Then stTransactionPaymentID = editTransactionRow.pay_id 'Check for null value End If </code></pre> <p>Now, when <code>editTransactionRow.pay_id</code> is Null Visual Basic throws an exception. Is there something wrong with this code?</p>
[ { "answer_id": 378233, "author": "Patrick Desjardins", "author_id": 13913, "author_profile": "https://Stackoverflow.com/users/13913", "pm_score": 4, "selected": false, "text": "If String.IsNullOrEmpty(editTransactionRow.pay_id) = False Then\n stTransactionPaymentID = editTransactionRo...
2008/12/18
[ "https://Stackoverflow.com/questions/378225", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
378,247
<p>I have a digital certificate that identifies an user. I need to use it to Digitally sign pdf files.</p> <p>Does anyone have an example that does not uses a third party component? I need to get this done but it would be nice to fully understand how things are done.</p> <p>C# Examples please :)</p>
[ { "answer_id": 2778679, "author": "AffineMesh", "author_id": 156810, "author_profile": "https://Stackoverflow.com/users/156810", "pm_score": 3, "selected": false, "text": "Doc theDoc = new Doc();\ntheDoc.Read(Server.MapPath(\"../Rez/Authorization.pdf\"));\nSignature theSig = (Signature)t...
2008/12/18
[ "https://Stackoverflow.com/questions/378247", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32037/" ]
378,259
<p>How do you round a Double down to the nearest integer in VB .NET?</p>
[ { "answer_id": 10460151, "author": "Chris Pitman", "author_id": 213421, "author_profile": "https://Stackoverflow.com/users/213421", "pm_score": 5, "selected": true, "text": "Math.Truncate Math.Floor" }, { "answer_id": 51799820, "author": "Rajaram1991", "author_id": 335451...
2008/12/18
[ "https://Stackoverflow.com/questions/378259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4575/" ]
378,265
<p>i'm using the <a href="http://msdn.microsoft.com/en-us/library/bb775248(VS.85).aspx" rel="nofollow noreferrer">Win32 progress dialog</a>. The damnest thing is that when i call:</p> <pre><code>progressDialog.StopProgressDialog(); </code></pre> <p>it doesn't disappear. It stays on screen until the user moves her mouse over it - <em>then</em> it suddenly disappers. </p> <p>The call to <code>StopProgressDialog</code> returns right away (i.e. it's not a synchronous call). i can prove this by doing things after the call has returned:</p> <pre><code>private void button1_Click(object sender, EventArgs e) { //Force red background to prove we've started this.BackColor = Color.Red; this.Refresh(); //Start a progress dialog IProgressDialog pd = (IProgressDialog)new ProgressDialog(); pd.StartProgressDialog(this.Handle, null, PROGDLG.Normal, IntPtr.Zero); //The long running operation System.Threading.Thread.Sleep(10000); //Stop the progress dialog pd.SetLine(1, "Stopping Progress Dialog", false, IntPtr.Zero); pd.StopProgressDialog(); pd = null; //Return form to normal color to prove we've stopped. this.BackColor = SystemColors.Control; this.Refresh(); } </code></pre> <p>The form:</p> <ul> <li>starts gray</li> <li>turns red to show we've stared</li> <li>turns back to gray color to show we've called <strong>stop</strong></li> </ul> <p>So the call to <code>StopProgressDialog</code> has returned, except the progress dialog is still sitting there, mocking me, showing the message:</p> <blockquote> <p>Stopping Progress Dialog</p> </blockquote> <p><a href="https://i.stack.imgur.com/5YXHR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5YXHR.png" alt="alt text"></a> </p> <hr> <h2>Doesn't Appear for 10 seconds</h2> <p>Additionally, the progress dialog does not appear on screen until the</p> <pre><code>System.Threading.Thread.Sleep(10000); </code></pre> <p>ten second sleep is over.</p> <hr> <h2>Not limited to .NET WinForms</h2> <p>The same code also fails in Delphi, which is also an object wrapper around Window's windows:</p> <pre><code>procedure TForm1.Button1Click(Sender: TObject); var pd: IProgressDialog; begin Self.Color := clRed; Self.Repaint; pd := CoProgressDialog.Create; pd.StartProgressDialog(Self.Handle, nil, PROGDLG_NORMAL, nil); Sleep(10000); pd.SetLine(1, StringToOleStr('Stopping Progress Dialog'), False, nil); pd.StopProgressDialog; pd := nil; Self.Color := clBtnFace; Self.Repaint; end; </code></pre> <hr> <h2>PreserveSig</h2> <p>An exception would be thrown if <code>StopProgressDialog</code> was failing.</p> <p><em>Most</em> of the methods in IProgressDialog, when translated into C# (or into Delphi), use the compiler's automatic mechanism of converting failed COM HRESULTS into a native language exception. </p> <p>In other words the following two signatures will throw an exception if the COM call returned an error HRESULT (i.e. a value less than zero):</p> <pre><code>//C# void StopProgressDialog(); //Delphi procedure StopProgressDialog; safecall; </code></pre> <p>Whereas the following lets you see the HRESULT's and react yourself:</p> <pre><code>//C# [PreserveSig] int StopProgressDialog(); //Delphi function StopProgressDialog: HRESULT; stdcall; </code></pre> <p>HRESULT is a 32-bit value. If the high-bit is set (or the value is negative) it is an error.</p> <p>i am using the former syntax. So if <code>StopProgressDialog</code> is returning an error it will be automatically converted to a language exception. </p> <p><strong>Note:</strong> Just for SaG i used the <code>[PreserveSig]</code> syntax, the returned HRESULT is zero;</p> <hr> <h2>MsgWait?</h2> <p>The symptom is similar to what <a href="http://blogs.msdn.com/oldnewthing/archive/2005/02/17/375307.aspx" rel="nofollow noreferrer">Raymond Chen described once</a>, which has to do with the incorrect use of PeekMessage followed by MsgWaitForMultipleObjects:</p> <blockquote> <p>"Sometimes my program gets stuck and reports one fewer record than it should. I have to jiggle the mouse to get the value to update. After a while longer, it falls two behind, then three..."</p> </blockquote> <p>But that would mean that the failure is in IProgressDialog, since it fails equally well on CLR .NET WinForms and native Win32 code.</p>
[ { "answer_id": 378403, "author": "Ian Boyd", "author_id": 12597, "author_profile": "https://Stackoverflow.com/users/12597", "pm_score": 0, "selected": false, "text": "[ComImport]\n[Guid(\"EBBC7C04-315E-11d2-B62F-006097DF5BD4\")]\n[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]\npub...
2008/12/18
[ "https://Stackoverflow.com/questions/378265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12597/" ]
378,284
<p>I am developing a web-app using zend framework. I like how all the autoloading works however I don't really like the way Zend_Controller names the controllers by default. I am looking for a way to enable zend_controller to understand my controller class named Controller_User stored in {$app}/Controller/User.php . Is there anyway I can do this with least amount of extra code?</p>
[ { "answer_id": 696336, "author": "Jeffrey04", "author_id": 5742, "author_profile": "https://Stackoverflow.com/users/5742", "pm_score": 1, "selected": true, "text": "class Coolsilon_Controller_Dispatcher \n extends Zend_Controller_Dispatcher_Standard { \n public function __construct...
2008/12/18
[ "https://Stackoverflow.com/questions/378284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5742/" ]
378,294
<p>What is the best way to limit the amount of text that a user can enter into a 'textarea' field on a web page? The application in question is ASP .NET, but a platform agnostic answer is preferred.</p> <p>I understand that some amount of javascript is likely needed to get this done as I do not wish to actually perform the 'post' with that amount of data if possible as ASP .NET does have an upper limit to the size of the request that it will service (though I don't know what that is exactly).</p> <p>So maybe the real question is, what's the best way to do this in javascript that will meet the following criteria:</p> <p>-Must work equally well for both users simply typing data and copy/paste'ing data in from another source.</p> <p>-Must be as '508 compliance' friendly as possible.</p>
[ { "answer_id": 378321, "author": "Logan Serman", "author_id": 29595, "author_profile": "https://Stackoverflow.com/users/29595", "pm_score": 4, "selected": false, "text": "function limit(element, max_chars)\n{\n if(element.value.length > max_chars)\n element.value = element.valu...
2008/12/18
[ "https://Stackoverflow.com/questions/378294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1680/" ]
378,296
<p>I have an ATL control that I want to be Unicode-aware. I added a message handler for WM_UNICHAR:</p> <pre><code>MESSAGE_HANDLER( WM_UNICHAR, OnUniChar ) </code></pre> <p>But, for some reason, the OnUniChar handler is never called.</p> <p>According to the documentation, the handler should first be called with "UNICODE_NOCHAR", on which the handler should return TRUE if you want to receive UTF-32 characters. But, as I said, the handler is never called.</p> <p>Is there anything special that needs to be done to activate this?</p>
[ { "answer_id": 39879596, "author": "KW Tu", "author_id": 6927685, "author_profile": "https://Stackoverflow.com/users/6927685", "pm_score": -1, "selected": false, "text": "void CMFCProView::OnUniChar (UINT xChar, UINT nRepCnt, UINT nFlags)\nvoid CMFCProView::OnChar (UINT xChar, UINT nR...
2008/12/18
[ "https://Stackoverflow.com/questions/378296", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9936/" ]
378,299
<p>I'm working in two different Oracle schemas on two different instances of Oracle. I've defined several types and type collections to transfer data between these schemas. The problem I'm running into is that even though the type have exactly the same definitions (same scripts used to create both sets in the schemas) Oracle sees them as different objects that are not interchangeable.</p> <p>I thought about casting the incoming remote type object as the same local type but I get an error about referencing types across dblinks.</p> <p>Essentially, I'm doing the following:</p> <pre><code>DECLARE MyType LocalType; -- note, same definition as the RemoteType (same script) BEGIN REMOTE_SCHEMA.PACKAGE.PROCEDURE@DBLINK( MyType ); -- MyType is an OUT param LOCAL_SCHEMA.PACKAGE.PROCEDURE( MyType ); -- IN param END; </code></pre> <p>That fails because the REMOTE procedure call can't understand the MyType since it treats LocalType and RemoteType as different object types.</p> <p>I tried DECLARING MyType as follows as well:</p> <pre><code> MyType REMOTE_SCHEMA.RemoteType@DBLINK; </code></pre> <p>but I get another error about referencing types across dblinks. CASTing between types doesn't work either because in order to cast, I need to reference the remote type across the dblink - same issue, same error. I've also tried using SYS.ANYDATA as the object that crosses between the two instance but it gets a similar error.</p> <p>Any ideas?</p> <p><strong>UPDATE:</strong> Tried declaring the object type on both sides of the DBLINK using the same OID (retrieved manually using <code>SYS_OP_GUID()</code>) but Oracle still "sees" the two objects as different and throws a "wrong number or types of arguements" error.</p>
[ { "answer_id": 380453, "author": "tuinstoel", "author_id": 43901, "author_profile": "https://Stackoverflow.com/users/43901", "pm_score": 4, "selected": true, "text": "SELECT SYS_OP_GUID() FROM DUAL; \n\nSYS_OP_GUID()\n--------------------------------\nAE34B912631948F0B274D778A29F6C8C\n c...
2008/12/18
[ "https://Stackoverflow.com/questions/378299", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24179/" ]
378,303
<p>I want to get a list of all Django auth user with a specific permission group, something like this:</p> <pre><code>user_dict = { 'queryset': User.objects.filter(permisson='blogger') } </code></pre> <p>I cannot find out how to do this. How are the permissions groups saved in the user model?</p>
[ { "answer_id": 378837, "author": "Daniel Naab", "author_id": 32638, "author_profile": "https://Stackoverflow.com/users/32638", "pm_score": 6, "selected": false, "text": "from django.contrib.auth import models\n\ngroup = models.Group.objects.get(name='blogger')\nusers = group.user_set.all...
2008/12/18
[ "https://Stackoverflow.com/questions/378303", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42546/" ]
378,319
<p>I frequently find myself with a folder open in Windows, wishing to have a command prompt open with the same working directory.</p> <p>I am aware of Power Toys "Command Prompt", but that only works as a context menu item on the folder, and not from inside the folder if you are already there. I know you can navigate to the parent directory, and use it from there, but if the parent has thousands of directories in it, this is not so convenient. I have tried some home-brewed batch files associated with folder actions in explorer, but those suffer from similar problems.</p> <p>So, what is the quickest way to open a command prompt with a working directory of the current windows explorer folder?</p> <p>My current approach: (horrible)</p> <ul> <li><strong><kbd>Alt</kbd> - <kbd>D</kbd>, <kbd>Ctrl</kbd> - <kbd>C</kbd></strong> (copy path)</li> <li><strong><kbd>Win</kbd> - <kbd>R</kbd>, "cmd", <kbd>Enter</kbd></strong> (start command prompt)</li> <li><strong>"cd", <kbd>Space</kbd></strong> (start a change directory command)</li> <li><strong><kbd>Alt</kbd> - <kbd>Space</kbd>, <kbd>e</kbd>, <kbd>p</kbd></strong> (paste directory)</li> <li><strong><kbd>Enter</kbd></strong> (execute change directory)</li> </ul> <p>I know there is something better! What is it?</p>
[ { "answer_id": 379804, "author": "clawr", "author_id": 46201, "author_profile": "https://Stackoverflow.com/users/46201", "pm_score": 9, "selected": false, "text": "Open Command Window Here Open PowerShell Here Open Command Window Here" }, { "answer_id": 7560350, "author": "ct...
2008/12/18
[ "https://Stackoverflow.com/questions/378319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44743/" ]
378,330
<p>In my C# winforms app, I have a datagrid. When the datagrid reloads, I want to set the scrollbar back to where the user had it set. How can I do this?</p> <p>EDIT: I'm using the old winforms DataGrid control, not the newer DataGridView</p>
[ { "answer_id": 378523, "author": "BFree", "author_id": 15861, "author_profile": "https://Stackoverflow.com/users/15861", "pm_score": 6, "selected": true, "text": "FirstDisplayedScrollingRowIndex DataGridView DataGrid public void ScrollToRow(int theRow)\n{\n //\n // Expose the prote...
2008/12/18
[ "https://Stackoverflow.com/questions/378330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3047/" ]
378,331
<p>What is the advantage of doing a logical/soft delete of a record (i.e. setting a flag stating that the record is deleted) as opposed to actually or physically deleting the record?</p> <p>Is this common practice?</p> <p>Is this secure?</p>
[ { "answer_id": 26126502, "author": "Max", "author_id": 1891133, "author_profile": "https://Stackoverflow.com/users/1891133", "pm_score": 2, "selected": false, "text": "TableName,OldValues,NewValues,Date,User,[..] *Values varchar fieldname : value xml" }, { "answer_id": 28978134, ...
2008/12/18
[ "https://Stackoverflow.com/questions/378331", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21826/" ]
378,338
<p>I want to exceute a simple command which works from the shell but doesn't work from Java. This is the command I want to execute, which works fine:</p> <pre><code>soffice -headless "-accept=socket,host=localhost,port=8100;urp;" </code></pre> <p>This is the code I am excecuting from Java trying to run this command:</p> <pre><code>String[] commands = new String[] {"soffice","-headless","\"-accept=socket,host=localhost,port=8100;urp;\""}; Process process = Runtime.getRuntime().exec(commands) int code = process.waitFor(); if(code == 0) System.out.println("Commands executed successfully"); </code></pre> <p>When I run this program I get "Commands executed successfully". However the process is not running when the program finishes. Is it possible that the JVM kills the program after it has run?</p> <p>Why doesn't this work?</p>
[ { "answer_id": 559824, "author": "Greg Ball", "author_id": 64499, "author_profile": "https://Stackoverflow.com/users/64499", "pm_score": 0, "selected": false, "text": "String[] commands = new String[] {\"soffice\",\"-headless\",\"-accept=socket,host=localhost,port=8100;urp;\"};\nProcess ...
2008/12/18
[ "https://Stackoverflow.com/questions/378338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37298/" ]
378,346
<p>I'm not a Notes programmer, however, for my sins, have been working on some Notes features for an in-house project recently. I need to enable/disable editing of a field depending on circumstances. It seems to me to be a fairly standard feature, I need, but I can't find any information on how to do this anywhere.</p> <p>In form setup (and other field's <code>onchange</code>) code, something like the following:</p> <pre><code>if some requirement = true then textField.enable = true else textField.enable = false end if </code></pre> <p>I've seen other places where there's a workaround of conditionally hiding paragraphs based on some code, having 2 paragraphs with opposite hiding conditions, one with an editable field, the other with a computed field. However, I don't know enough about Notes to see how this is implemented (I can see it done on other forms, but there seem to be some 'magic' steps within Notes which I either can't see or don't get).</p> <p>[EDIT] The reply from Kerr seems to be what I'm looking for, but I still can't find out where the InputEnabled property is located. Should have said in the initial question, I'm using Notes 7.0.3.</p> <p>In fairness, it doesn't matter what the circumstances are for when to enable/disable the field, it's just some boolean condition that is set, in my case only on form loading so I don't even have to worry about this changing dynamically while the form is displayed.</p> <p>I've got a few issues with Notes, my largest bugbear being that it's so tied so tightly to the Designer UI, which is utter shite. I can do this sort of thing programmatically in most GUI languages (C#, Java, Delphi, even VB), but I need to open property boxes in Notes and set them correctly. </p> <p>This would be OK as an <em>optional</em> method, but <em>forcing</em> you to go this way means you can only work as well as the IDE lets you in this case, and the IDE here seems to actively work against you. You can't open multiple functions/scripts, you can't swap from one script to another without going back to the menus on the left, you can't easily search the codebase for occurrences of variables/fields (and believe me, this is a major failing for me because either Notes or the internal codebase in my case seems to make a lot of use of global variables!), you can only work with fields through the property boxes that get displayed, you can't edit code in Designer while debugging through the main Notes client. </p> <p>While the Java side of the coding is better than LotusScript, it's still fairly crappy (why can't you debug INTO Java code?? Why do you need to re-import JAR files for each Java class, does each class have a different CLASSPATH???). Possibly this was improved in Notes 8, I hear it's based on Eclipse. Does anyone know whether this is true or not?</p>
[ { "answer_id": 559824, "author": "Greg Ball", "author_id": 64499, "author_profile": "https://Stackoverflow.com/users/64499", "pm_score": 0, "selected": false, "text": "String[] commands = new String[] {\"soffice\",\"-headless\",\"-accept=socket,host=localhost,port=8100;urp;\"};\nProcess ...
2008/12/18
[ "https://Stackoverflow.com/questions/378346", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18744/" ]
378,365
<p>I want find the index of a given DOM node. It's like the inverse of doing </p> <pre><code>document.getElementById('id_of_element').childNodes[K] </code></pre> <p>I want to instead extract the value of <code>K</code> given that I already have the reference to the child node and the parent node. How do I do this? </p>
[ { "answer_id": 378386, "author": "Greg", "author_id": 24181, "author_profile": "https://Stackoverflow.com/users/24181", "pm_score": 0, "selected": false, "text": "var K = -1;\nfor (var i = myNode.parent.childNodes.length; i >= 0; i--)\n{\n if (myNode.parent.childNodes[i] === myNode)\n...
2008/12/18
[ "https://Stackoverflow.com/questions/378365", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
378,376
<p>I'm currently using the default cookies as my single sign on (SSO) but some users are getting strange errors after I push an update. I'm considering moving to active record to store sessions but was wondering how I tell rails that the sessions are in another database?</p> <p>So if I store sessions via AR in App1DB how can all the other apps know thats where to look for sessions?</p>
[ { "answer_id": 378529, "author": "Samuel", "author_id": 32465, "author_profile": "https://Stackoverflow.com/users/32465", "pm_score": 4, "selected": true, "text": "# config.action_controller.session_store = :active_record_store\n CGI::Session::ActiveRecordStore::Session.establish_connect...
2008/12/18
[ "https://Stackoverflow.com/questions/378376", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9826/" ]
378,380
<p>I have a Windows application written in C++ that occasionally evaporates. I use the word evaporate because there is nothing left behind: no "we're sorry" message from Windows, no crash dump from the Dr. Watson facility...</p> <p>On the one occasion the crash occurred under the debugger, the debugger did not break---it showed the application still running. When I manually paused execution, I found that my process no longer had any threads.</p> <p>How can I capture the reason this process is terminating?</p>
[ { "answer_id": 378399, "author": "chills42", "author_id": 23855, "author_profile": "https://Stackoverflow.com/users/23855", "pm_score": 4, "selected": true, "text": "adplus -crash -p yourprocessid\n" }, { "answer_id": 378472, "author": "Martin York", "author_id": 14065, ...
2008/12/18
[ "https://Stackoverflow.com/questions/378380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4841/" ]