instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>Is there actually a way to determine whether the sheet of glass that one has received from a Chinese supplier on eBay is actually a sheet of Borosilicate glass, and not just a piece of normal glass intended for glazing purposes?</p> <p>Are there any laminations, or markings/features, visible under a certain light o...
<p>Google turned up this thread: <a href="http://arstechnica.com/civis/viewtopic.php?t=96214" rel="nofollow noreferrer">http://arstechnica.com/civis/viewtopic.php?t=96214</a></p> <p>There don't seem to be any easy, definitive tests. You have two main options, both of which seem to require a fairly high level of labora...
<blockquote> <p>"toughened" glass,</p> </blockquote> <p>Lead, cadmium and barium would have that effect. It goes without saying that you wouldn't want that kind of glass anywhere near your neighborhood. </p> <p>Even those items that mention borosilicate glass in the product description may have never seen any boron...
436
<p>By default when you add an image (icon, bitmap, etc.) as a resource to your project, the image's <strong>Build Action</strong> is set to <strong>None</strong>. This is done because the image is magically stored inside a .resources file.</p> <p><strong><em>I</em></strong> want the resource to be stored as an embedde...
<p><strong><em>Note: This answer is not the recommended way of handling image resources. It just addresses the particular problem as described by the question (i.e. to include an image as an embedded resourse).</em></strong></p> <p>Don't add the image as a resource. I would rather do the following:</p> <ul> <li>Creat...
<p>This depends on how you want to use the image. </p> <p>If you want to localize and access specific images for a specific culture, then using the <code>ResourceManager</code> is a good way to go because it provides some nice functionality for satellite assemblies, searching, fallbacks, etc.</p> <p>If you just want...
35,211
<p>How do you update a summary field's value from post function in JIRA?</p>
<p>There is an inbuilt post function that allows you to change the summary - though only to a hard coded value.</p> <p>If you wanted to modify the current summary, you will need to create a post function as mentioned.</p> <p>If you have a commercial license, you should have access to the JIRA source. Check out the c...
<p>Ok, I'll try to explain... For simplicity, suppose we have a post function and we want summary value changed to "foobar":</p> <pre><code>public class SomePostFunction implements FunctionProvider { public void execute(Map transientVars, Map args, PropertySet ps) throws WorkflowException { String newValu...
11,715
<p>One of my clients uses McAfee ScanAlert (i.e., HackerSafe). It basically hits the site with about 1500 bad requests a day looking for security holes. Since it demonstrates malicious behavior it is tempting to just block it after a couple bad requests, but maybe I should let it exercise the UI. Is it a true test if...
<blockquote> <p>Isn't it a security flaw of the site to let hackers throw everything in their arsenal against the site?</p> </blockquote> <p>Well, you should focus on closing holes, rather than trying to thwart scanners (which is a futile battle). Consider running such tests yourself.</p>
<p>If it's not hurting the performance of the site, I think its a good thing. If you had 1000 clients to the same site all doing that, yeah, block it. </p> <p>But if the site was built for that client, I think it's fair enough they do that. </p>
4,374
<p><strong><em>Edit:</em></strong> This question had been tagged "Tolstoy" in appreciation of the quality and length of my writing:) Just reading the first and the last paragraph should be enough:) If you tend to select and move code with the mouse, the stuff in middle could be interesting to you.</p> <p>This questio...
<p>In Emacs:</p> <ul> <li>kill-line C-k </li> <li>transpose-lines C-x C-t</li> </ul> <p>C-a C-k C-k -- kill whole line including newline (or <code>kill-whole-line</code> by C-S-backspace).</p> <p>C-u &lt;number> C-k -- kill &lt;number> of lines (including newlines).</p> <p>C-y -- yank back the most recently killed ...
<p>Using the <strong>Brief</strong> keyboard mapping this is done using the <strong><kbd>Alt</kbd>+<kbd>L</kbd></strong> to mark the line and the <strong><kbd>-</kbd></strong> key on the numeric keypad (or <strong><kbd>Alt</kbd>+<kbd>D</kbd></strong>) to cut the line to clipboard. The cut will remove the line entirely,...
8,568
<p>I'm trying to create the IDL for the IConverterSession interface and I'm confused by the definition of the <a href="http://msdn.microsoft.com/en-us/library/bb905204.aspx" rel="nofollow noreferrer">MIMETOMAPI</a> method. It specifies the <code>LPMESSAGE pmsg</code> parameter as [out] yet the comments state its the po...
<p>I think in this case the documentation is misleading when it marks the parameter as [out]. You have to pass a valid LPMESSAGE to the method, and that's why is not a double pointer. So i would go with [in] on your idl definition.</p>
<p>The correct documentation can be found here: <a href="https://learn.microsoft.com/en-us/office/client-developer/outlook/mapi/iconvertersession-mimetomapi" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/office/client-developer/outlook/mapi/iconvertersession-mimetomapi</a>. The caller must supply a messag...
12,809
<p>I have a table that has a primary key that's an INT... I have another table, that has a foreignkey relationship to that first table, but it's a NULLABLE INT.</p> <p>This is perfectly ok, and 100% acceptable to SQL... however LINQ to SQL is complaining about mismatched types ("int to Nullable[int]").</p> <p>Error M...
<p>I found the problem. You can create the association ONLY if the parent class doesn't have the Nullable field as the key.</p> <p>So, this:</p> <p><a href="http://www.singingeels.com/Articles/UserImage.aspx?ImageID=43d83ac4-707d-47fc-832c-588261e6a5d7">alt text http://www.singingeels.com/Articles/UserImage.aspx?Imag...
<p>Here's what I threw together. Table2's Table1Id column is a nullable foreign key to Table1. I even threw in a few data records and tested some Linq queries...</p> <p><img src="https://i.stack.imgur.com/ZSRVN.png" alt="enter image description here"></p> <p><em>EDIT</em>: Since I'm getting some downvotes (apparentl...
38,958
<p>I have an STL file and I would like to know how many grams would this print consume. Is there a software so I can get it or an online link that can say me that?</p>
<p>You can not tell this by looking at the STL file alone, because how much material will be used depends on the print settings (obviously, printing at 100% infill will consume much more material than 10%).</p> <p>The best way to check the material usage is to load the model into a slicer and slice it using your prefe...
<p>This is a link I found that analyzes your G-code ( filament usage, time, etc.): <a href="http://gcode.ws/" rel="nofollow noreferrer">gCodeViewer</a></p> <p>From the description (emphasis is mine):</p> <blockquote> <ul> <li>Analyze GCode <ul> <li>Print time, <strong><em>amount of plastic used</em></stron...
548
<p>I need to add user roles and permission system into my web application built using PHP/MySQL. I want to have this functionality: </p> <ol> <li>One root user can create sub-roots, groups, rules and normal users( all privileges) .</li> <li>Sub-roots can create only rules, permissions and users for his/her own group (...
<p>The pattern that suits your needs is called <a href="http://en.wikipedia.org/wiki/Role-based_access_control" rel="noreferrer">role-based access control</a>.</p> <p>There are several good implementations in PHP, including <a href="http://framework.zend.com/manual/1.12/en/zend.acl.html" rel="noreferrer">Zend_Acl</a> ...
<p>I have groups and users (like active directory LDAP solution). So if I give access to group I need that users in this group have herited accesses.</p> <p>So, based on the @suresh-kamrushi answer below, I made this : </p> <pre><code>INSERT INTO `permission` (`bit`, `name`) VALUES (1, 'add-yes'), (2, 'add-no'), ...
43,245
<p>I need to hide (make private) the <code>-init</code> method of my class in Objective-C.</p> <p>How can I do that?</p>
<h3><code>NS_UNAVAILABLE</code></h3> <pre><code>- (instancetype)init NS_UNAVAILABLE; </code></pre> <p>This is a the short version of the unavailable attribute. It first appeared in macOS <a href="https://developer.apple.com/library/content/releasenotes/General/MacOSXLionAPIDiffs/Foundation.html" rel="noreferrer">10.7...
<p>I have to mention that placing assertions and raising exceptions to hide methods in the subclass has a nasty trap for the well-intended.</p> <p>I would recommend using <code>__unavailable</code> as <a href="https://stackoverflow.com/a/5772821/2400328">Jano explained for his first example</a>.</p> <p>Methods can be...
23,698
<p>I'm writing a C# POS (point of sale) system that takes input from a keyboard wedge magcard reader. This means that any data it reads off of a mag stripe is entered as if it were typed on the keyboard very quickly. Currently I'm handling this by attaching to the KeyPress event and looking for a series of very fast ke...
<p>One thing you can do is that you should be able to configure your wedge reader so that it presents one or many escape characters before or after the string. You would use these escape characters to know that you are about to have (or just had) a magcard input.</p> <p>This same technique is used by barcode reader d...
<p>I second <a href="https://stackoverflow.com/questions/42437/best-way-to-handle-input-from-a-keyboard-wedge#42448">@jttraino's idea</a>. </p> <p>It is the way to go for bar scan/code readers and other such devices that are plug and play (PnP). I have used the same technique to configure a couple of 1D and 2D bar cod...
6,390
<p>I'm trying to implement a pop-up menu based on a click-and-hold, positioned so that a (really) slow click will still trigger the default action, and with the delay set so that a text-selection gesture won't usually trigger the menu. </p> <p>What I can't seem to do is cancel the text-selection in a way that doesn't...
<p>Try this:</p> <pre><code>var input = document.getElementById('myInputField'); if (input) { input.onmousedown = function(e) { if (!e) e = window.event; e.cancelBubble = true; if (e.stopPropagation) e.stopPropagation(); } } </code></pre> <p>And if not, have a read of:</p> <p><a hre...
<p><code>$(this).focus()</code> (or anything along the lines of <code>document.body.focus()</code>) seems to do the trick, although I haven't tested it much beyond ff3.</p>
13,888
<p>Can't understand why the following takes place:</p> <pre><code>String date = "06-04-2007 07:05"; SimpleDateFormat fmt = new SimpleDateFormat("MM-dd-yyyy HH:mm"); Date myDate = fmt.parse(date); System.out.println(myDate); //Mon Jun 04 07:05:00 EDT 2007 long timestamp = myDate.getTime(); System.out.println(timesta...
<p>What milliseconds? You are providing only minutes information in the first example, whereas your second example grabs current date from the system with milliseconds, what is it you're looking for?</p> <pre><code>String date = "06-04-2007 07:05:00.999"; SimpleDateFormat fmt = new SimpleDateFormat("MM-dd-yyyy HH:mm:s...
<p>When you parse a date it only uses the information you provide. In this case it only knows MM-dd-yyyy HH:mm.</p> <p>Creating a new date object returns the current system date/time (number of milliseconds since the epoch). </p>
10,027
<p>I have some servers in Europe and some in Asia.<br> I would like to be able to work out where the current server is by querying ... something. </p> <p>Is there some global variable I can query or sp_xxx I can execute to find out the locale of the server? </p>
<p>I'd go with a parameter in a table.</p> <p>There can be multiple solutions to the problem, though, and they may or may not work depending on a number of factors. For example, is there any difference in the database server or operating system configuration which could tell one location from the other?</p>
<p>If the dataserver is properly configured for XP calls, you can execute</p> <pre><code> xp_cmdshell 'domainname' </code></pre> <p>which will allow you to get the output of the OS 'domainname' command. You can then parse that to determine your locale.</p>
31,710
<p>I've never had to do IPC on Windows before. I'm developing a pair of programs, a standard GUI/CLI app, and a windows service. The app has to tell the service what to do. So, assuming the communication is local only, what would be the best communication method for these two processes?<br /> By best I mean more robust...
<p>IPC in .Net can be achieved using:</p> <h1>WCF</h1> <p>using named pipes <strong>requires .Net 3.0</strong> and above.</p> <h2>Code example</h2> <ul> <li>The WCF class <strong>NetNamedPipeBinding</strong> can be used for interprocess communication on the same machine. The MSDN documentaion for this class includes ...
<p>Your best bet is to use WCF. You will be able to create a service host in the windows service and expose a well defined interface that the GUI application can consume. WCF will let you communicate via named pipes if you choose, or you can choose any other communication protocal like TCP, HTTP, etc. Using WCF you ...
7,285
<p>I have a staging Rails site up that's running on MySQL 5.0.32-Debian.</p> <p>On this particular site, all of my tables are using <code>utf8 / utf8_general_ci</code> encoding.</p> <p>Inside that database, I have some data that looks like so:</p> <pre><code>mysql&gt; select * from currency_types limit 1,10; +------...
<p>AHA! Seems I had some table information encoded in latin1 before, and stupidly changed the databases to utf8 without converting.</p> <p>Running the following fixed that currency_types table:</p> <pre><code>mysqldump -u root -p --opt --default-character-set=latin1 --skip-set-charset DBNAME &gt; DBNAME.sql mysql -...
<p>My DB was already set by default to utf8, but I encountered the same problem.</p> <p>Also after adding the following usual meta tag, the problem was still there:</p> <pre><code>&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; </code></pre> <p>Then I created a dedicated <code>connection....
45,035
<p>I am debugging a VB6 executable. The executable loads dlls and files from it's current directory, when running. When run in debugger, the current directory seems to be VB6's dir. </p> <p>How do I set working directory for VB6?</p>
<p>It doesn't seems to be a "out of the box" solution for this thing.</p> <p>Taken from <a href="http://discuss.fogcreek.com/joelonsoftware1/default.asp?cmd=show&amp;ixPost=19026&amp;ixReplies=5" rel="noreferrer">The Old Joel On Software Forums</a> </p> <blockquote> <p>Anyways.. to put this topic to rest.. the fo...
<p>Current directory for any program - including vb6 - can be changed in the properties of the shortcut. I've changed it to the root of my source tree, it makes using File-Open quicker.</p>
18,646
<p>I'm looking for the .NET-preferred way of performing the same type of thing that ShellExecute does in Win32 (opening, printing, etc. for arbitrary file types).</p> <p>I've been programming Windows for over 20 years, but I'm a complete newbie at .NET, so maybe I'm just looking in the wrong places. I'm currently usin...
<p><a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx" rel="noreferrer">Process.Start</a>.</p> <p>Note that advanced uses (printing etc) require using a <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo_properties.aspx" rel="noreferrer">ProcessStar...
<pre><code>System.Diagnostics.Process.Start(&quot;explorer.exe&quot;, path); </code></pre>
32,262
<p>Let's say I need to implement domain model for StackOverflow. </p> <p>If I am doing ORM, how can I define (and map) property for fetching "last comments" and other "last" things? It looks to me like this should be reflected in the domain model.</p> <p>Sometimes I might need "all comments" though...</p>
<p>See <a href="http://www.quirksmode.org/css/box.html" rel="noreferrer">this article</a>.</p> <p>Basically, in the "traditional" CSS box model, the width of a box element only specifies the width of the <em>content</em> of the box, excluding its border (and padding).</p> <p>In CSS3, you can switch to a different box...
<p>This will get you fairly close but not 100% of the way (pun intended). To give an element 100% height it needs to know "100% of what?". All parent elements must also be given 100% height and this includes the body. Or as the W3C put it: "If the height of the containing block is not specified explicitly (i.e., it dep...
39,415
<p>I have a Java object which is able to configure itself given an XML configuration description (it takes other descriptions as well, but I'm interested in the XML at the moment). I'm wondering if I can embed the XML description directly into a Spring application context description. I'm imagining something like:</p> ...
<p>Spring's <a href="http://www.springframework.org/schema/beans/spring-beans-2.5.xsd" rel="nofollow noreferrer">XSD</a> allows <code>&lt;constructor-arg&gt;</code> to contain any XML through:</p> <pre><code>&lt;xsd:element name="constructor-arg"&gt; &lt;xsd:complexType&gt; &lt;xsd:sequence&gt; &lt;xsd:ele...
<p>Wouldn't it be cleaner if your bean had a property telling it the location of the config file, and it loads the config from the classpath (or absolute location on the filesystem)? That way your Spring config looks cleaner and it's easier to edit the XML config of your bean since it's in a separate file.</p> <p>Mayb...
42,484
<p>I've seen different program managers write specs in different format. Almost every one has had his/her own style of writing a spec.</p> <p>On one hand are those wordy documents which given to a programmer are likely to cause him/her missing a few things. I personally dread the word documents spec...I think its beca...
<p><a href="http://www.joelonsoftware.com/articles/fog0000000036.html" rel="nofollow noreferrer">Joel on Software</a> is particularly good at these and has some good articles about the subject...</p> <p>A specific case: <a href="http://www.joelonsoftware.com/articles/AardvarkSpec.html" rel="nofollow noreferrer">the wri...
<p>One of the Microsoft Press books has excellent examples of various documents, including an SRS (which I think is what you are talking about). It might be one of the requirements books by Weigert (I think that's his name, I'm blanking on it right now). I've seen US government organizations use that as a template, and...
4,308
<p>I want to create a delegate type in C# inside a method for the purpose of creating Anonymous methods.</p> <p>For example:</p> <pre><code>public void MyMethod(){ delegate int Sum(int a, int b); Sum mySumImplementation=delegate (int a, int b) {return a+b;} Console.WriteLine(mySumImplementation(1,1).ToStri...
<p>Why do you want to create the delegate type within the method? What's wrong with declaring it outside the method? Basically, you can't do this - you can't declare a <em>type</em> (any kind of type) within a method.</p> <p>One alternative would be to declare all the Func/Action generic delegates which are present in...
<p>What about this:</p> <pre><code>static void Main(string[] args) { Expression&lt;Func&lt;int, int, int&gt;&gt; exFunc = (a, b) =&gt; a + b; var lambda = exFunc as LambdaExpression; Delegate del = exFunc.Compile(); Console.WriteLine(del.DynamicInvoke(2, 2)); } </code></pre>
46,864
<p>A few days ago, I asked <a href="https://stackoverflow.com/questions/242577/c-what-is-string-really-good-for">why its not possible to store binary data, such as a jpg file into a string variable</a>.</p> <p>Most of the answers I got said that string is used for textual information such as what I'm writing now.</p> ...
<p>I see three major problems with storing binary data in strings: </p> <ol> <li>Most systems assume a certain encoding within string variables - e.g. if it's a UTF-8, UTF-16 or ASCII string. New line characters may also be translated depending on your system.</li> <li>You should watch out for restrictions on the siz...
<p>Depends on the language. For example in Python string types (str) are really byte arrays, so they can indeed be used for binary data.</p> <p>In C the NULL byte is used for string termination, so a sting cannot be used for arbitrary binary data, since binary data could contain null bytes.</p> <p>In C# a string is a...
32,039
<p>I am implementing long running processes that require to a process bar - or progress percentage - to be displayed. The overall logic of the long running process is complex (various paged data retrieval), and as a result, I end up hardcoding lots of percentages in various places within the code.</p> <p>What are cons...
<p>I've found the pattern used in JFace around <a href="http://help.eclipse.org/indigo/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/core/runtime/IProgressMonitor.html" rel="nofollow noreferrer">IProgressMonitor</a> to work out pretty nicely. You might gain some insight by having a look at the...
<p>If you know in advance the 'length' of the task you're going to perform, and have a way of knowing how far along you are, you should let the bar determine the percentage. For example, if you have to process a known number of files, give this number to the progress bar on construction. Then, during the process either...
35,606
<p>I'm developing a mission-critical solution where data integrity is paramount and performance a close second. If data gets stuffed up, it's gonna be cata$trophic.</p> <p>So, I'm looking for the C/C++ version of JTA (Java Transaction API). Does anyone know of any C or C++ libraries that supports distributed transacti...
<p>Encina, DCE-RPC, TUXEDO, possibly CORBA (though I hesitate to suggest using CORBA), MTS (again, hmm).</p> <p>These are the kind of things you want for distributed transaction processing.</p> <p><a href="http://www.zois.co.uk/tpm/encina.html" rel="nofollow noreferrer">Encina</a> used to have a lot of good documenta...
<p>There are hundreds. Seriously.</p> <p>As far as general areas go. Check out <a href="http://en.wikipedia.org/wiki/Service-oriented_architecture" rel="nofollow noreferrer">Service Oriented Architecture</a>, most of the new products are coming out in that area. Eg. <a href="http://roguewave.com/products/hydra/hydr...
16,029
<p>Will a query like this on a recordset work</p> <p>rs.open "select * from table where vd=1; update table set vd1 = 1 where vd=2 or vd=3;"</p> <p>or is there anything wrong</p> <p>thanks</p>
<p>Resharper does have some shortcomings...but it is possible to configure it to do what you want...</p> <p>You can configure keyboard options in Visual Studio. Also, you can use the Unit Test Explorer in Resharper to find the tests you want and add them to the current session. I usually configure a shortcut (Alt+U) t...
<p>Resharper and I think there are shortcuts, but yes it has some shortcomings. Like no testcoverage like <a href="http://www.exactmagic.com/products/testmatrix/" rel="nofollow noreferrer">TestMatrix</a> has. But then life is not perfect anyway.</p> <p>TestMatrix seems to b dead BTW.</p>
43,668
<p>How do I load a dropdown list in asp.net and c#?</p>
<p>You can also do it declaratively:</p> <pre><code>&lt;asp:DropDownList runat="server" ID="yourDDL"&gt; &lt;asp:ListItem Text="Add something" Value="theValue" /&gt; &lt;/asp:DropDownList&gt; </code></pre> <p>You can also data bind them:</p> <pre><code>yourDDL.DataSource = YourIEnumberableObject; yourDDL.DataBin...
<p>If you have a collection of employee objects, you could add them like so:</p> <pre><code>List&lt;Employee&gt; ListOfEmployees = New List&lt;Employees&gt;(); DropDownList DropDownList1 = new DropDownList(); foreach (Employee employee in ListOfEmployees) { DropDownList1.Items.Add(employee.Name); } </code></pre>
48,857
<p>This one is a case of not doing your homework.:-) </p> <p>Apart from dynamic loading advantage, does it make sense to include a JavaScript library(jQuery in my case ) from a Google server when I can load it from my server as a single file comprised of the 19kb jQuery zip file + the additional JavaScript code I hav...
<p>Consider that a jQuery script downloaded from the google CDN might well already be cached on a visitor's browser, since it has consistent headers and cache control no matter where it is downloaded from. Hence, on average most users will only have to download your site-specific javascript scripts. Also, CDN generally...
<p>Is this a real question? Just make sure your Cache-Control in your HTTP headers are properly configured and the end user's client will only pull it once. This is an absolutely trivial amount of data.</p>
40,404
<p>Selecting a large amount of text that extends over many screens in an IDE like Eclipse is fairly easy since you can use the mouse, but what is the best way to e.g. select and delete multiscreen blocks of text or write e.g. three large methods out to another file and then delete them for testing purposes in Vim when ...
<p>Well, first of all, you can set <code>vim</code> to work with the mouse, which would allow you to select text just like you would in <code>Eclipse</code>.</p> <p>You can also use the Visual selection - <kbd>v</kbd>, by default. Once selected, you can <code>yank</code>, <code>cut</code>, etc.</p> <p>As far as comm...
<p>v enters visual block mode, where you can select as if with shift in most common editors, later you can do anything you can normally do with normal commands (substitution :'&lt;,'>s/^/#/ to prepend with a comment, for instance) where '&lt;,'> means the selected visual block instead of all the text.</p>
8,298
<p>I have a html div layered on top of an interactive flash movie, but when the mouse moves over the div, it can't interact with the flash (the view changes as the mouse moves or is clicked). Is there a way to have the flash recieve the mouse movements and clicks but leaving the html visible?</p> <p>I can't modify the...
<p>Try something like this:</p> <pre><code>&lt;object&gt; &lt;param name="wmode" value="transparent" /&gt; &lt;embed src="example.swf" wmode="transparent"&gt;&lt;/embed&gt; &lt;/object&gt; </code></pre> <p>The main things to note are the <code>&lt;param /&gt;</code> tag with the transparent attribute, and...
<p>should be aware that wmode=transparent will kill use of scroll wheel in firefox. this is true even in FP10</p>
44,087
<p>I'm mostly a Rails developer but sometimes, I have to code in PHP. Because stackoverflow.com <em>prefers questions that can be answered</em>, I'd like to have a idea which one of the two is closest to PHP?</p> <p>Sometimes, I'm under the impression that CakePHP is a outdated copy of Rails that wants to look like Ru...
<p>there are loads of questions dealing with the php framework issue. for example: </p> <ul> <li><a href="https://web.archive.org/web/20081219171154/https://stackoverflow.com/questions/249984/php-framework-decision-analysis-paralysis" rel="nofollow noreferrer">php-framework-decision-analysis-paralysis</a></li> <li><a ...
<p>I like symfony because it doesn't have PHP4 compatibility as a business goal. This lets the framework ditch some of the cruft and limitations of PHP4 and leverages the much stronger OOP in PHP5.</p>
45,582
<p>Is there a tool to integrate <a href="http://en.wikipedia.org/wiki/Mercurial" rel="nofollow noreferrer">Mercurial</a> into Visual Studio?</p> <p>I am just curious. Mercurial is pretty nice, even with 'just' <a href="http://tortoisehg.sourceforge.net" rel="nofollow noreferrer">TortoiseHG</a>, but integration with Vi...
<p><a href="http://sharesource.org/project/visualhg/" rel="nofollow noreferrer">VisualHG</a></p> <p>Way to go, me. (Found the answer myself afterwards. Oh well, someone might find this useful.)</p>
<p>There is also <a href="http://bitbucket.org/zzsergant/hgsccpackage/wiki/Home" rel="nofollow noreferrer">HgSccPackage</a>, which does not need TortoiseHG to work.</p>
14,324
<p>Some API returns me XmlCursor pointing on root of XML Document. I need to insert all of this into another org.w3c.DOM represented document.</p> <p>At start: XmlCursor poiting on <code></p> <p>&lt;a&gt; &lt;b&gt; some text &lt;/b&gt; &lt;/a&gt; </code></p> <p>DOM Document: <code></p> <p>&lt;foo&gt;</p> <...
<p>Try something like this:</p> <pre><code>Node originalNode = cursor.getDomNode(); Node importNode = document.importNode(originalNode.getFirstChild()); Node otherNode = document.createElement("someOtherInsertedElement"); otherNode.appendChild(importNode); document.appendChild(otherNode); </code></pre> <p>So in other...
<p>I was having the same issue.</p> <p>This was failing:</p> <p><code>Node importNode = document.importNode(originalNode);</code></p> <p>This fixed the problem:</p> <p><code>Node importNode = document.importNode(originalNode.getFirstChild());</code></p>
10,889
<p>What's the easiest way to get the filename associated with an open HANDLE in Win32?</p>
<p>There is a correct (although undocumented) way to do this on Windows XP <strong>which also works with directories</strong> -- the same method <a href="http://msdn.microsoft.com/en-us/library/aa364962.aspx" rel="noreferrer">GetFinalPathNameByHandle</a> uses on Windows Vista and later.</p> <p>Here are the eneded decl...
<p>On unixes there is no real way of reliably doing this. In unix with the traditional unix filesystem, you can open a file and then unlink it (remove its entry from the directory) and use it, at which point the name isn't stored anywhere. In addition, because a file may have multiple hardlinks into the filesystem, e...
9,094
<p>Does anyone here know of good batch file code indenters or beautifiers?</p> <p>Specifically for PHP, JS and SGML-languages.</p> <p>Preferably with options as to style.</p>
<p>Try quoting the wildcard:</p> <pre><code>$ find /usr -name \*.sh </code></pre> <p>or:</p> <pre><code>$ find /usr -name '*.sh' </code></pre> <p>If you happen to have a file that matches <strong>*.sh</strong> in the current working directory, the wildcard will be expanded before find sees it. If you happen to hav...
<p>For finding files on your disks, lean to use "locate" instead that is instantaneous (looks into a daily built index) you example would be:</p> <pre><code>locate '/usr*.sh' </code></pre>
3,937
<p>I have a class 'Database' that works as a wrapper for ADO.net. For instance, when I need to execute a procedure, I call Database.ExecuteProcedure(procedureName, parametersAndItsValues).</p> <p>We are experiencing serious problems with Deadlock situations in SQL Server 2000. Part of our team is working on the sql co...
<p>First, I would review my SQL 2000 code and get to the bottom of why this deadlock is happening. Fixing this may be hiding a bigger problem (Eg. missing index or bad query). </p> <p>Second I would review my architecture to confirm the deadlocking statement really needs to be called that frequently (Does <code>select...
<p>If you are getting problems with deadlocks, it would be better to look at what the SQL code is doing. For example, lock-escalation deadlocks are very easy to create if you have serializable isolation level (or whatever the equivalent is in your rdbms) - and can be mitigated in a few ways, such as re-ordering queries...
41,484
<p>Lets say I need to write several functions processing some data. These functions are performing a single task - some mathematical calculations. I suppose there is no need to combine them with some data members.</p> <p>Shall I use:</p> <ol> <li>a class without data members and declare these functions as static meth...
<p>SharePoint is very good at document sharing.</p> <p>Documents generally follow a process for approval, have permissions, live in clusters... and these things lend themselves well to SharePoints document libraries.</p> <p>However there are somethings that don't lend themselves well to living inside SharePoint... do...
<p>Definetely, use a tool. </p> <p>The main benefit here is version control. Being able to jump easily to a previous version, diff'ing and seeing who modified what (see most VCS' blame/annotate tool- it prints out a text file showing when/who modified each line in the text file).</p> <p>Second, you can probably benef...
42,257
<p>I am a little curious about the cute little kaleidoscopic images associated with each user on this site. How are those generated? Possibilities are:</p> <ol> <li>A list of images is already there in some folder and it is chosen randomly.</li> <li>The image is generated whenever a user registers. </li> </ol> <p>In ...
<p>It's called an <a href="https://en.wikipedia.org/wiki/Identicon" rel="nofollow noreferrer">Identicon</a>. If you entered and e-mail, it's a based on a hash of your e-mail address. If you didn't enter an e-mail, it's based on your IP address.</p> <p>Jeff <a href="https://blog.codinghorror.com/identicons-for-net/" ...
<p>I believe the images are a 4×4 grid with the upper 2×2 grid repeated 4 times clockwise, just each time rotated 90 degrees, again clockwise. Seems the two colours are chosen randomly, and each 1×1 block is chosen from a predefined set.</p> <p>EDIT: obviously my answer was ad hoc. Nice to know about identicons.</p> ...
12,743
<p>In Visual Studio with TFS as source control, when I view the history and double click a cs file, the file is loaded in notepad. How can i change the application to be notepad++? </p> <p>I also would like the OS's default application for the file to still be visual studio</p>
<p>After pouring over <a href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx" rel="nofollow noreferrer">ProcessMonitor</a> logs I think I found the solution!</p> <p>You need to change the what the Windows shell (explorer) thinks the "Edit" action for text files. I was able to change this key:</p> <p><...
<p>The only thing that works for me is when I set the default program for the particular file type in Windows Explorer to open with the VS IDE: </p> <pre><code>C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe </code></pre> <p>This opens the code in a new instance of VS. Not ideal, but at least it's...
18,451
<p>Prior to C# generics, everyone would code collections for their business objects by creating a collection base that implemented IEnumerable</p> <p>IE:</p> <pre><code>public class CollectionBase : IEnumerable </code></pre> <p>and then would derive their Business Object collections from that.</p> <pre><code>public...
<p>I am generally in the camp of just using a List directly, unless for some reason I need to encapsulate the data structure and provide a limited subset of its functionality. This is mainly because if I don't have a specific need for encapsulation then doing it is just a waste of time.</p> <p>However, with the aggre...
<p>this is the way:</p> <p>return arrays, accept <code>IEnumerable&lt;T&gt;</code></p> <p>=)</p>
4,183
<p>I'm overthinking this. I have colors stored in a database table, and I want to set the background of specific cells in a table to those colors. In other words:</p> <pre><code>&lt;table&gt; &lt;tr&gt; &lt;td ???set color here???&gt; ...content... &lt;/td&gt; &lt;td ???next col...
<p>You can make a custom CSS file with database data by creating a custom HttpHandler.<br> But the simple way woud be:</p> <pre><code>&lt;td style="background-color:#000000"&gt; ... &lt;/td&gt; </code></pre> <p>with</p> <pre><code>&lt;td style='background-color:&lt;%= GetCellColor() %&gt;'&gt; ... &lt;/td&gt; </cod...
<p>Why not have the DB populate the CSS?</p> <pre><code>.dark { background-color:[database field] } &lt;td class='dark'&gt;&lt;/td&gt; </code></pre>
48,688
<p>If you have a binary file format (or packet format) which is described as a C structure, are there any programs which will parse the structure and turn it into neat documentation on your protocol?</p> <p>The struct would of course contain arrays, other structures, etc., as necessary to describe the format. The doc...
<p>Maybe you should think about this a different way. </p> <p>"Can I create a documentation format for my packet for which I can generate a C struct?" </p> <p>Consider for example using XML to define the packet structure and add elements for comments and so forth. It wil be fairly easy to write a simple program th...
<p>If you know perl you can try playing with Jeeves:</p> <p><a href="https://www.rodhughes.com/perl/advprog/examples/Jeeves/" rel="nofollow noreferrer">https://www.rodhughes.com/perl/advprog/examples/Jeeves/</a></p> <p>(This source is there; I assume it's all right to use. ;) )</p> <p>I'm trying to work out somethin...
48,302
<p>I've got an error in my build which says:</p> <blockquote> <p>Error 12 Cannot implicitly convert type 'System.Collections.Generic.IEnumerator&lt; BaseClass>' to 'System.Collections.Generic.IEnumerator&lt; IParentClass>'. An explicit conversion exists (are you missing a cast?)</p> </blockquote> <p>Is...
<p>No you can't, because generics aren't covariant in C# at the moment. .NET itself has some support (for delegates and interfaces) but it's not really used yet.</p> <p>If you were returning <code>IEnumerable&lt;BaseClass&gt;</code> instead of <code>IEnumerator&lt;BaseClass&gt;</code> (and assuming .NEt 3.5) you could...
<p><code>IEnumerator&lt;BaseClass&gt;</code> and <code>IEnumerator&lt;ParentClass&gt;</code> are unrelated, eventhough their generic parameters are. I would instead use a LINQ <code>Select</code> extension method like so:</p> <pre><code>return this.Select(x =&gt; (IParentClass)x).GetEnumerator(); </code></pre> <p>or...
28,430
<p>I'm trying to access the message in a jthrowable while handing an exception generated when I fail to find a class. However, I am unable to access the message ID of getMessage() on the jthrowable object, and I don't know why. I've tried changing the signature of getMessage to "()Ljava/lang/String" (without the semi...
<p>Okay, so it looks like my problem was that <code>GetObjectClass</code> doesn't act the way you'd expect it to on a jthrowable, or at least the results of it are not useful for the purposes of getting methods. Replacing that portion of the code with this works:</p> <pre><code>java_class = (*jEnv)-&gt;FindClass (jEn...
<p>I tried your approach, and it worked for me. A few things though: I'm using the C++ interface (though that shouldn't make a difference), and I'm using Java 6 update 10, x64 edition, on Ubuntu 8.04. Perhaps the Java version and/or platform used will make a difference.</p> <pre><code>#include &lt;cstdio&gt; #include ...
26,504
<p>I am using Crystal Reports 10. The reports are obtaining data from an Oracle 10G database. We have some data in Arabic. When I try to display the Arabic data it is showing as ?.</p> <p>Any ideas on what I can do to display this correctly?</p>
<p>I've never used crystal reports and my oracle knowledge is limited, however I've done some work in Arabic. Things to look out for.</p> <p>Does the Database have the arabic locale installed can it display right to left text.</p> <p>Under windows check the languages settings and check that the option to include supp...
<ol> <li>Make sure you have Arabic support installed in Windows.</li> <li>Add the correct LANG and NLS_LANG to your registry (for me it's ARABIC__QATAR.AR8MSWIN1256)</li> </ol>
46,406
<p>I'd like to use a different icon for the demo version of my game, and I'm building the demo with a different build config than I do for the full verison, using a preprocessor define to lockout some content, use different graphics, etc. Is there a way that I can make Visual Studio use a different icon for the app Ic...
<p>According to <a href="http://msdn.microsoft.com/en-us/library/aa381033(VS.85).aspx" rel="noreferrer">this page</a> you may use preprocessor directives in your *.rc file. You should write something like this</p> <pre><code>#ifdef _DEMO_VERSION_ IDR_MAINFRAME ICON "demo.ico" #else IDR_MAINFRAME ICON "full.ico" #endif...
<p>This will get you halfway there: <a href="http://www.codeproject.com/KB/dotnet/embedmultipleiconsdotnet.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/dotnet/embedmultipleiconsdotnet.aspx</a></p> <p>Then you need to find the Win32 call which will set the displayed icon from the list of embedded icons...
9,839
<p>Is it possible to generate a XML Schema of a Database programatically with .Net and C#? I want to look into NDbUnit but for big databases it would not really be feasible to make a Schema manually? </p>
<blockquote> <p>Is it possible to generate a XML Schema from a Database?</p> </blockquote> <p>It sure is, <a href="http://www.altova.com/dev_portal_xml_schema.html" rel="noreferrer">XMLSpy</a> can generate XML Schema from a database.</p> <p>There's <a href="http://dwightrau.blogspot.com/2008/02/generate-or-create...
<p>Use MyGeneration's typed-dataset-template to auto-generate the XSD (<a href="http://www.mygenrationssoftware.com" rel="nofollow noreferrer">http://www.mygenrationssoftware.com</a>). Its free, OSS, and works great. Also, the NDbUnit team is presently working on an add-on tool to NDbUnit that will make it possible t...
38,240
<p>Given this algorithm, I would like to know if there exists an iterative version. Also, I want to know if the iterative version can be faster.</p> <p>This some kind of pseudo-python...</p> <p>the algorithm returns a reference to root of the tree</p> <pre><code>make_tree(array a) if len(a) == 0 return Non...
<p>A recursive function with only one recursive call can usually be turned into a tail-recursive function without too much effort, and then it's trivial to convert it into an iterative function. The canonical example here is factorial:</p> <pre><code># naïve recursion def fac(n): if n &lt;= 1: return 1 ...
<p>Here is stack based iterative solution (Java):</p> <pre><code>public static Tree builtBSTFromSortedArray(int[] inputArray){ Stack toBeDone=new Stack("sub trees to be created under these nodes"); //initialize start and end int start=0; int end=inputArray.length-1; //keep memoy of the position...
29,189
<p>I have a git repository with multiple branches. </p> <p>How can I know which branches are already merged into the master branch?</p>
<p><code>git branch --merged master</code> lists branches merged into <em>master</em></p> <p><code>git branch --merged</code> lists branches merged into <em>HEAD</em> (i.e. tip of current branch)</p> <p><code>git branch --no-merged</code> lists branches that have not been merged</p> <p>By default this applies to onl...
<p>I diff the <code>git branch</code> against <code>git branch --merged main</code> as follows:</p> <pre><code>diff &lt;(git branch) &lt;(git branch --merged main) </code></pre> <p>Then you'll see any local branches that haven't been merged into main.</p>
28,078
<blockquote> <p>Clarification: this is not about <em>user agent</em> calls to pages, but Classic ASP calling ASP.NET!</p> </blockquote> <p>I have applications that are midway through a transition from Classic ASP to ASP.NET. There are a half million lines of code, so a complete rewrite of everything at once was simp...
<p>Doing a bit more searching I found </p> <blockquote> <p><a href="https://stackoverflow.com/questions/11219/calling-rest-web-services-from-a-classic-asp-page">Calling REST web services from a classic asp page</a></p> </blockquote> <p>which in turn linked to</p> <blockquote> <p><a href="http://www.aspfree.com/c...
<p>I use <a href="http://prototypejs.org" rel="nofollow noreferrer">Prototype</a> with a lot of classic ASP pages for AJAX calls. I prefer working with JSON than XML for my data layer. Ajax + JSON is much lighter and faster and easier to deal with than SOAP + XML. </p>
31,224
<p>We are building a query to count the number of events per hour, per day. Most days there are hours that do not have any activity and therefore where the query is run the count of activities per hour show up but there are gaps and the query excludes these. We still want to show the hours that do not have activity and...
<p>You are going to somehow need a table of days and hours, and then you will have to do an outer join between that table and your query. Here's how I would do it. Note that this solution will only work in SQL Server 2005 and 2008. If you don't have those platforms, you'll have to actually create a table of times in...
<p>It sounds like you could use a "left outer join" using another table that has the numbers 1 through 24 in it...</p>
48,846
<p>In our product we ship some linux binaries that dynamically link to system libraries like "libpam". On some customer systems we get the following error on stderr when the program runs:</p> <pre><code>./authpam: /lib/libpam.so.0: no version information available (required by authpam) </code></pre> <p>The applicati...
<p>The "no version information available" means that the library version number is lower on the shared object. For example, if your major.minor.patch number is 7.15.5 on the machine where you build the binary, and the major.minor.patch number is 7.12.1 on the installation machine, ld will print the warning.</p> <p>Yo...
<p>Have you seen <a href="http://answers.google.com/answers/threadview/id/786136.html" rel="nofollow noreferrer">this</a> already? The cause seems to be a very old libpam on one of the sides, probably on that customer.</p> <p>Or the links for the version might be missing : <a href="http://www.linux.org/docs/ldp/howto/...
16,663
<p>Are there good efficiency savings using Sql Server 2005 over Sql Server 2000?</p> <p>Or does it just have more services etc</p> <p>Has anyone seen their system work any quicker after making the upgrade?</p>
<p>The surrounding tools such as Analysis Services were substantially rewritten and can get you a variety of wins depending on your requirements. However I don't see a lot of really fundamental changes from 2000 to 2005 in the core database engine.</p> <p>There are some improvements that may get you better performanc...
<p>2005 provides MVCC - row level versioning essentially - so as a developer there are some efficiencies: less locking to worry about.</p>
16,789
<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 appropriat...
<p>I've developed a couple of WordPress plugins, and I've found it's really easy to extend. Haven't worked with Zend though. </p> <p>You should check the WordPress plugin api. Mostly the part about actions, filters and hooks: <a href="http://codex.wordpress.org/Plugin_API" rel="nofollow noreferrer">http://codex.wordpr...
<p>I guess you could do that, just import the framework into the one page you need it for. I don't know how Zend works, but check the paths as to where to put your directories so that Zend finds them.As I said <em>I guess</em> you could do that, just experiment and tell us how it went!</p> <p>Beware of name conflicts ...
49,449
<p>How can I get a record id after saving it into database. Which I mean is actually something like that.</p> <p>I have Document class (which is entity tho from DataBase) and I create an instance like </p> <pre><code>Document doc = new Document() {title="Math",name="Important"}; dataContext.Documents.InsertOnSubmit(d...
<p>Once you have run .SubmitChanges then doc.docId should be populated with the Id that was created on the database.</p>
<p>Linq to SQL does change tracking by default. So once your row is inserted, your object is updated and added to the datacontext. You will have a new valid row in your documents collection.</p> <p><a href="http://blogs.msdn.com/charlie/archive/2007/03/04/samples-update.aspx" rel="nofollow noreferrer">This</a> blog po...
48,408
<p>I can switch between windows with "C-x o", but if I have opened multiple frames, can I move between them without the mouse as well? </p> <p>I just realized that the question probably sounds braindead without this detail: I'm on Mac OS X (Finnish keyboard) and switching between windows of the same application is dif...
<p>If you want an Emacs-centric method, try C-x 5 o.</p>
<p>I believe you can switch between frames the same way you switch between applications.</p> <p>On Windows I use Alt-TAB, on Unix I have my machine setup to use Ctrl-Alt-TAB</p>
11,853
<p>I'm able to successfully uninstall a third-party application via the command line and via a custom Inno Setup installer. </p> <p>Command line Execution:</p> <pre><code>MSIEXEC.exe /x {14D74337-01C2-4F8F-B44B-67FC613E5B1F} /qn </code></pre> <p>Inno Setup Command:</p> <pre><code>[Run] Filename: msiexec.exe; Flags:...
<p><strong>Step 1:</strong> <a href="https://stackoverflow.com/questions/15109/visual-studio-2005-setup-project-install-crashes-over-terminal-server#15286">Check the MSI error log files</a></p> <p>I'm suspicious that your problem is due to running as LocalSystem. </p> <p>The Local System account is not the same as a ...
<p>This is bizarre. LocalSystem definitely has the privileges to install applications (that's how Windows Update and software deployment in Active Directory work), so it should be able to uninstall as well.</p> <p>Perhaps the application is initially installed per-user instead of per-machine?</p>
7,927
<p>I have a tool which automatically creates InstallShield installers (InstallScript, not MSI), and my main problem at the moment is that when upgrading an installation, I need a way to prevent features from being <strong>upgraded</strong>. During the installation, I want to check the version of a exe-file installed on...
<p>If there are parts of your installation that are versioned/maintained independently, you may want to create separate installations for them. Then you could use your InstallScript as a bootstrapper to upgrade each installation separately based on your conditions.</p>
<p>If there are parts of your installation that are versioned/maintained independently, you may want to create separate installations for them. Then you could use your InstallScript as a bootstrapper to upgrade each installation separately based on your conditions.</p>
32,678
<p>I'm kinda stuck with this one so I hoped someone could help me.</p> <p>I am doing a Winforms application and I need to show a Modal Dialog (form.ShowDialog) that returns a value (prompts the User some values and wraps them in a Object). </p> <p>I just can't see how to do this rather than give a reference into the ...
<p>Add a static method to your form, like this:</p> <pre><code>public class MyDialog : Form { // todo: think of a better method name :) public static MyObject ShowAndReturnObject() { var dlg = new MyDialog(); if (new dlg.ShowDialog() == DialogResult.OK) { var obj = // ...
<p>Or you could create a new ShowDialog method inside your form class that does basically what Matt Hamilton's does. Maybe even an extension method if it's something you do to lots of forms in your problem.</p>
29,624
<p>Say I have an MSSQL table with two columns: an int ID column that's the identity column and some other datetime or whatever column. Say the table has 10 records with IDs 1-10. Now I delete the record with ID = 5.</p> <p>Are there any scenarios where another record will "fill-in" that missing ID? I.e. when would...
<p>No, unless you specifically enable identity inserts (typically done when copying tables with identity columns) and insert a row manually with the id of 5. SQLServer keeps track of the last identity inserted into each table with identity columns and increments the last inserted value to obtain the next value on inse...
<p>One scenario not already mentioned where another record will "fill-in" missing IDENTITY values is when the IDENTITY is reseeded. Example (SQL Server 2008):</p> <pre><code>CREATE TABLE Test ( ID INTEGER IDENTITY(1, 1) NOT NULL, data_col INTEGER NOT NULL ); INSERT INTO Test (data_col) VALUES (1), (2), (3...
28,179
<p>I'm teaching (or trying to teach) computer programming to a grad-student. Her previous experience amounts to little more than writing spreadsheet formulae. Which IDE or text editor should I recommend?</p> <p>Please bear in mind that:</p> <ul> <li>I only meet my student about once a week.</li> <li>She uses Window...
<p>The <a href="http://www.microsoft.com/Express/" rel="nofollow noreferrer">Visual Studio Express</a> products are all free. Unless the fact that you're using Linux changes things :)</p>
<p>My suggestion is <a href="http://www.textpad.com/" rel="nofollow noreferrer">Textpad</a>. You can teach her javascript, all the basic, and some advanced concepts are there. It's fun for the student see the output in a browser, and you can even teach a little HTML if the mood strikes.</p>
9,733
<p>Is there a difference between <code>NULL</code> and <code>null</code> in PHP? Sometimes they seem to be interchangeable and sometimes not.</p> <p>edit: for some reason when I read the documentation linked to in the answer (before posting this question) I read it as "case sensitive" instead of "case insensitive" whi...
<p>Null is case insensitive.</p> <p>From the <a href="http://ca3.php.net/manual/en/language.types.null.php" rel="noreferrer">documentation</a>:</p> <blockquote> <p>There is only one value of type null, and that is the <strong>case-insensitive</strong> keyword NULL.</p> </blockquote>
<p>Either will work. But the official PHP style guide, PSR-12, recommends lowercase.</p> <p><a href="https://www.php-fig.org/psr/psr-12/" rel="nofollow noreferrer">https://www.php-fig.org/psr/psr-12/</a>, Section 2.5</p>
3,034
<p>Is it possible in a large GWT project, load some portion of JavaScript lazy, on the fly? Like overlays. </p> <p>PS: Iframes is not a solution.</p>
<p>Check out <code>GWT.runAsync</code> as well as the Google I/O talk below, which goes into lazy loading of <code>JavaScript</code> in <code>GWT</code> projects.</p> <ul> <li><a href="http://code.google.com/p/google-web-toolkit/wiki/CodeSplitting" rel="nofollow noreferrer">http://code.google.com/p/google-web-toolkit/...
<p>I think this is what you are looking for.</p> <pre><code>&lt;body onload="onloadHandler();"&gt; &lt;script type="text/javascript"&gt; function onloadHandler() { if (document.createElement &amp;&amp; document.getElementsByTagName) { var script = document.createElement('script'); script.type = 'te...
9,809
<p>I tried this:</p> <pre><code>ALTER TABLE My.Table DROP MyField </code></pre> <p>and got this error:</p> <p>-MyField is not a constraint.</p> <p>-Could not drop constraint. See previous errors.</p> <p>There is just one row of data in the table and the field was just added.</p> <p><strong>EDIT:</strong> Just to ...
<p>I think you are just missing the COLUMN keyword:</p> <pre><code>ALTER TABLE TableName DROP COLUMN ColumnName </code></pre> <p>You will also need to make sure that any constraint that is depending on ColumnName is dropped first. </p> <p>You can do this by:</p> <pre><code>ALTER TABLE TableName DROP ConstraintName ...
<pre><code>ALTER TABLE TABLE_NAME ADD COLUMN SR_NO INTEGER(10)NOT NULL; </code></pre>
31,260
<p>Is there any way to use C# to build a container application where each tab is actually its own process like with Google chrome?</p>
<p>You can use the <a href="http://pinvoke.net/default.aspx/user32/SetParent.html" rel="noreferrer">SetParent</a> Win32 call to do this, but it's really fraught with problems. I had enough troubles getting it all to work nicely using windows from different AppDomains - there'd be even more difficulties with whole extra...
<p>Without looking too deep into the extensibility stack, you can use the <a href="http://msdn.microsoft.com/en-us/library/system.addin.hosting.addinprocess.aspx" rel="nofollow noreferrer">System.Addin</a> namespace to build an application that inherently can create addins as visual individual tabs and set each tab/add...
23,982
<p>I am working on a project that I need to use the Infragistics WebGrid control for some lists of data. I am loading the data on the client-side using JavaScript for display on a Map, and then I need to display that same data within multiple WebGrids. All the data available will be displayed in the WebGrids, but only ...
<p>The only thought that comes to mind is performance-related. We found that dynamically creating and populating rows for an UltraWebGrid was appreciably slower than we would have liked. (In our case we were moving rows from one grid to another and hit performance issues when the number of rows was too great.)</p> <p...
<p>The only thought that comes to mind is performance-related. We found that dynamically creating and populating rows for an UltraWebGrid was appreciably slower than we would have liked. (In our case we were moving rows from one grid to another and hit performance issues when the number of rows was too great.)</p> <p...
28,719
<p>I tried printing something after 7 weeks of not using the printer (before it worked greatly) and I think it doesn't extrude properly (although I'm not sure about it).</p> <p>When I tell the printer to extrude filament it works just fine, but during the print there seems to be a problem with it (see image below). Whe...
<p>I would first check that your nozzle temperature is correct for the PLA you are using. If it is correct, try increasing it 5-10 °C. I experienced an identical issue and found that it was an incorrect nozzle temperature.</p>
<p>This has happened to me before. As suggested in another answer by @HandyHowie I would try to increase the nozzle temp. PLA usually requires around 190-210 °C however I have found this usually varies from PLA type. I would try using something like 230 °C as this seems to work for me.</p> <p>Another issue could be wit...
2,102
<p>How do I publish a Web Service to a server with MSBuild?</p>
<p>Take a look at the <a href="http://www.microsoft.com/downloads/details.aspx?familyId=0AA30AE8-C73B-4BDD-BB1B-FE697256C459&amp;displaylang=en" rel="nofollow noreferrer">Web Deployment Project</a>. It is basically an msbuild file that makes it wasy to perform your deployment steps. I use it in combination with the <a ...
<p>Wouldn't it be the same way to publish an ASP.NET application?</p>
36,298
<p>This is in regards to a situation where Session is used to store some temporary data - one example being information entered during a multi-step registration process.</p> <p>If a website has a number of such sections - which wants to utilize the session as temporary data store for pages within the section, what is ...
<p>Time should keep the session clean. Sessions <em>should</em> expire and in doing so nuke all their data. This is default behaviour.</p> <p>I'll agree that storing too much data in a session is not a great thing for server-resources but as you know, it's sometimes a necessary evil. If you're really that bothered, co...
<p>If you want to store bulk data you have following alternatives:</p> <ol> <li>Cache</li> <li>Database</li> </ol> <p>It is not recommended to store large amount of data in the session.</p>
23,972
<p>There are so many options when it comes to PHP development environments and you have to piece it all together yourself.</p> <p>I'm wondering if someone has come up with what they think is the ideal setup that gets out of your way and lets you develop.</p> <p>Right now I use vim and svn from the command-line. I wr...
<p>I recommend to use a complete featured IDE like the PDT (the eclipse PHP project), it gives you: debugging (using Xdebug or ZendDebugger)</p> <p>SVN/CVS very convinient integration</p> <p>DB integration (the DTP plugin)</p> <p>and much more, based on features of the PDT and eclipse plugins</p> <p>if you have som...
<p>If you are working from the command line, using <a href="http://git-scm.com/docs/git-svn" rel="nofollow noreferrer">Git's SVN module</a> eases most of the SVN pain - it handles deletes and moves automagically. </p> <p>The GUI front ends (kgit or qgit) provide a very intuitive history browser.</p>
25,445
<p>I need to populate a context menu from a database at run time. I do not know the number of items that will be in the list, so I would like to handle the click event in a single place. How do I declare the handler so I can tell which menu item actually triggered the click.</p> <pre><code>Public Function GetBookmar...
<pre><code>Dim mnuitm As New ToolStripMenuItem mnuitm.Name = name_cbk.Items(i) mnuitm.Text = name_cbk.Items(i) AddHandler (mnuitm.Click), AddressOf item_Click menulist.Items.Add(mnuitm) </code></pre>
<p>Your ForwardToList_Click() should include parameters for the sender and event args:</p> <pre><code>Public Sub ForwardToList_Click(sender As Object, e As EventArgs) '... End Sub </code></pre> <p>"sender" is the control that caused the event, which is what I believe you're looking for.</p>
37,948
<p>Strange question, but: Sharepoint 2007 greets you with the Administrator Tasks on the Central Administration after installation.</p> <p>I just wonder if this list is "safe" to be used for my own Administration Tasks? The reason why i'm asking is because I found that Sharepoint uses a lot of "black magic" and unlogi...
<p>The behaviour does seem confusing, but intensional. I reproduce here the entirety of the unicode documentation from the <a href="http://docs.python.org/lib/built-in-funcs.html" rel="noreferrer">Python Built-In Functions documentation</a> (for version 2.5.2, as I write this):</p> <blockquote> <p><strong>unicode([o...
<p><code>unicode</code> does not guess the encoding of your text. If your object can print itself as <code>unicode</code>, define the <code>__unicode__()</code> method that returns a Unicode string.</p> <hr> <p>The secret is that <code>unicode(r)</code> is not actually calling <code>__str__()</code> itself. Instead, ...
13,224
<p>I have a UIImagePickerController as one view in a TabBar setup. Is it possible to tell the UIImagePickerController to not show the Cancel button in the top navigation bar when browsing photos libraries?</p>
<p>Here is a code snippet in C# that I'm using in my WPF application. This will give you the current time (adjusted for Daylight Savings Time) for the time zone id you provide.</p> <pre><code>// _timeZoneId is the String value found in the System Registry. // You can look up the list of TimeZones on your system using ...
<pre><code>//C#.NET public static bool IsDaylightSavingTime() { return IsDaylightSavingTime(DateTime.Now); } public static bool IsDaylightSavingTime(DateTime timeToCheck) { bool isDST = false; System.Globalization.DaylightTime changes = TimeZone.CurrentTimeZone.G...
27,988
<p>Suppose I have a table with a numeric column (lets call it "score").</p> <p>I'd like to generate a table of counts, that shows how many times scores appeared in each range.</p> <p>For example:</p> <pre> score range | number of occurrences ------------------------------------- 0-9 | 11 10-19 ...
<p>Neither of the highest voted answers are correct on SQL Server 2000. Perhaps they were using a different version.</p> <p>Here are the correct versions of both of them on SQL Server 2000.</p> <pre><code>select t.range as [score range], count(*) as [number of occurences] from ( select case when score between 0...
<p>Perhaps you're asking about keeping such things going...</p> <p>Of course you'll invoke a full table scan for the queries and if the table containing the scores that need to be tallied (aggregations) is large you might want a better performing solution, you can create a secondary table and use rules, such as <code>...
28,760
<p>I'm trying to the the flv Flash player <a href="http://www.jeroenwijering.com/?item=JW_FLV_Player" rel="nofollow noreferrer">from here</a> in a windows forms application. I currently have it playing 1 .flv file with no problems but I really need to be able to play multiple files. Has anyone had experienace of using ...
<p>Can you get the control to run the way you want it in a webpage/browser? If yes (and the problem is with winforms, I'd just embed it in a browser control. If no, I'd as the creators directly.</p>
<p>Hmm I ran into this same problem as well. The prob is that loadmovie method doesnt seem to clear the last movie. And so far I haven't found any technique to load a new movie into the same flash player.</p>
6,515
<p>Is there a way to keep the "Loading..." graphic from appearing when cfdiv refreshes? I'd like to prevent the flicker of loading the graphic then loading the new html.</p>
<p>By adding these lines at the bottom of the header, it overwrites the "Loading..." html and seems to prevent the flickering effect in both IE and FireFox: </p> <pre><code> &lt;script language="JavaScript"&gt; _cf_loadingtexthtml=""; &lt;/script&gt; </code></pre> <p>While this seems to do the trick, it would be...
<p>You can create functions to change the message prior calling the ajax load that can set the message and image to a new value.</p> <pre><code>function loadingOrder(){ _cf_loadingtexthtml="Loading Order Form &lt;image src='/CFIDE/scripts/ajax/resources/cf/images/loading.gif'&gt;"; } function loadingNavigation()...
16,528
<p>What is the most efficient way to go through and update every single node in a drupal site, to, for instance mechanically add tags? Drupal 6 has a shiny new batch API, but what to do in Drupal 5?</p> <p>I started writing a script that keeps a pointer and then goes around all nodes on a cron, loads them and then sav...
<p>I don't suggest working directly on the database level since some modules might want to update some other related tables. The most reliable and flexible way is to write a script to load, change and save nodes in a loop. You can also try using additional special modules for Drupal 5:</p> <ul> <li><a href="http://dru...
<p>hmm i'm not familiar with drupal 5's database structure, but if it's similar enough to drupal 6, you could just modify this all pretty easily by just working off the <code>term_node</code> table. it's a mapper of node id's to term id's:</p> <pre><code>term_node - nid - vid - tid </code></pre> <p>nid is the node id...
23,671
<ul> <li>I created a protected folder on my ASP.NET site with the "ASP.NET Configuration" tool.</li> <li>It made a database called App_Data/ASPNETDB.MDF where it stores one (1) user.</li> <li>While uploading I noticed now that the database has grown to 10 MB and the .ldf file is 5 MB. (!)</li> <li>I tried to look at it...
<p>The size of the database is really irrelevant. There may only be 1-2KB worth of data in the file, but when SQL Server creates the database files, it doesn't know how much data you intent to put in them, so it adds some extra space. This way, when you do add more data (as most users do), it will all be contiguous, an...
<p>I think this is just the default size for the aspnetdb, at least in sql 2005 express all my aspnetdb databases are 10mb initially</p>
41,466
<p>I keep hearing that </p> <pre><code>catch (Exception ex) </code></pre> <p>Is bad practise, however, I often use it in event handlers where an operation may for example go to network, allowing the possibility of many different types of failure. In this case, I catch all exceptions and display the error message to t...
<p>The bad practice is</p> <pre><code>catch (Exception ex){} </code></pre> <p>and variants:</p> <pre><code>catch (Exception ex){ return false; } </code></pre> <p>etc.</p> <p>Catching all exceptions on the top-level and passing them on to the user (by either logging them or displaying them in a message-box, dependi...
<p>I've been working a fair bit with exceptions, and here's the implementation structure I'm currently following:</p> <ol> <li>Dim everything to Nothing / String.Empty / 0 etc. outside of Try / Catch.</li> <li>Initialise everything inside Try / Catch to desired values.</li> <li>Catch the most specific exceptions first...
13,995
<p>How can I add horizontal scroll capabilities to the asp.net listbox control?</p>
<p>Example to add horizontal scroll:</p> <pre><code>&lt;asp:ListBox ID="List" runat="server" Height="320px" Width="100%" style="overflow-x:auto;"SelectionMode="Multiple"&gt; &lt;/asp:ListBox&gt; </code></pre> <p>CSS3 overflow-x Property: <a href="http://www.w3schools.com/cssref/css3_pr_overflow-x.asp" rel="nofollow">...
<p>If you are doing it only for display purpose, You can do it in another way by using Textbox with mulitiline property. By appending the text with new line as such!</p> <pre><code> List&lt;Yourclass&gt; result = null; result = Objname.getResult(Parameter1, Parameter2); foreach (Yourclass res in result) ...
6,746
<p>What is the best way to measure exception handling overhead/performance in C++?</p> <p>Please give standalone code samples.</p> <p>I'm targeting Microsoft Visual C++ 2008 and gcc.</p> <p>I need to get results from the following cases:</p> <ol> <li>Overhead when there are no try/catch blocks</li> <li>Overhead whe...
<p>Section 5.4 of the <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/TR18015.pdf" rel="noreferrer">draft Technical Report on C++ Performance</a> is entirely devoted to the overhead of exceptions. </p>
<p>Won't the answer depend on what cleanup has to happen as a result of a throw? If an excpetion is thrown that causes a whole load of objects to go out of scope up the stack, then that will add to the overhead.</p> <p>In other words, I'm not sure if there is a an answer to the 3rd question that is independent of the ...
6,485
<p>I seem to be in the minority, but to be honest I am not comfortable with linq and don't see any benefits in my personal development (not to say there are no benefits, just a personal opinion based on my situation).</p> <p>I build web applications (.net, .net mvc) and I love having part of my data layer in stored pr...
<p>I actually <em>do</em> use Linq, but not for querying SQL. I use it as a really easy way of querying datatables to, for example, find the highest value in a datatable. Previously I would have used a for-loop for this code, but Linq makes it neater, and clearer as to my intent.</p> <p>Once you realise that Linq is a...
<p>I hate SQL, and have been using LINQ for the last year or so. I definitely prefer LINQ syntax over SQL syntax anyday. </p>
35,532
<p>I looking for a way to programmatically start a VOIP call using the SIP stack on a S60 Symbian mobile phone. </p> <p>Some of the later S60 devices have a built-in SIP client. Is it also possible to access the SIP stack using some S60 library on those devices. Or does anyone know of an external SIP stack that can be...
<p>The APIs for making VoIP calls do <strong>not</strong> require special access, you merely have to download the SDK plug-in API. See <a href="http://wiki.forum.nokia.com/index.php/Utilizing_Nokia_VoIP_Client" rel="nofollow noreferrer">http://wiki.forum.nokia.com/index.php/Utilizing_Nokia_VoIP_Client</a> for details.<...
<p>These APIs require special access, but <a href="http://nds2.content.mosh.nokia.com/entity/6/4452B13D5F854A8DE040050A45306C1B/Developing_3rd_party_VoIP_clients_on_S60_platform_v1_0_en.pdf?c=m&amp;type=6" rel="nofollow noreferrer">here</a>'s some documentation about them.</p>
43,711
<p>In my ASP.net MVC app I have a view that looks like this:</p> <pre><code>... &lt;label&gt;Due Date&lt;/label&gt; &lt;%=Html.TextBox("due")%&gt; ... </code></pre> <p>I am using a <code>ModelBinder</code> to bind the post to my model (the due property is of <code>DateTime</code> type). The problem is when I put "01/...
<p>I just came across this very simple and elegant solution, available in MVC 2:</p> <p><a href="http://geekswithblogs.net/michelotti/archive/2010/02/05/mvc-2-editor-template-with-datetime.aspx" rel="noreferrer">http://geekswithblogs.net/michelotti/archive/2010/02/05/mvc-2-editor-template-with-datetime.aspx</a></p> <...
<p>I guess personally I'd say its best or easiest to do it via a strongly typed page and some defined model class but if you want it to be something that lives in the binder I would do it this way:</p> <pre><code>public class SomeTypeBinder : IModelBinder { public object GetValue(ControllerContext controllerContex...
16,176
<p>I'm looking for a library in Python which will provide <code>at</code> and <code>cron</code> like functionality.</p> <p>I'd quite like have a pure Python solution, rather than relying on tools installed on the box; this way I run on machines with no cron.</p> <p>For those unfamiliar with <code>cron</code>: you can...
<p>If you're looking for something lightweight checkout <a href="https://github.com/dbader/schedule">schedule</a>:</p> <pre><code>import schedule import time def job(): print("I'm working...") schedule.every(10).minutes.do(job) schedule.every().hour.do(job) schedule.every().day.at("10:30").do(job) while 1: ...
<p>I don't know if something like that already exists. It would be easy to write your own with time, datetime and/or calendar modules, see <a href="http://docs.python.org/library/time.html" rel="nofollow noreferrer">http://docs.python.org/library/time.html</a></p> <p>The only concern for a python solution is that your...
48,824
<p>I've seen ReSharper recommended a lot Unfortunately, it doesn't support C++ in Visual Studio. Is there anything out there you can recommend? I already use Visual Assist, and it does its job very well, but it's quite limited in comparison with ReSharper.</p> <p>Any suggestions?</p>
<p>Refactor Pro is <a href="http://www.devexpress.com/Products/Visual_Studio_Add-in/RefactorCPP/" rel="noreferrer">available</a> for Visual C++, this will give you some functionality. Also check out CodeRush, I think it also supports C++.</p>
<p>The solution is to code in Eclipse or NetBeans, but such IDEs are not Visual Studio.</p>
23,917
<p>I have a <code>div</code> and an <code>iframe</code> on the page the <code>div</code> has</p> <pre><code>z-index: 0; </code></pre> <p>the <code>iframe</code> has its content with a popup having a <code>z-index</code> of 1000</p> <pre><code>z-index: 1000; </code></pre> <p>However, the <code>div</code> still overs...
<p><a href="http://www.quirksmode.org/bugreports/archives/2006/01/Explorer_z_index_bug.html" rel="noreferrer">Explorer Z-index bug</a></p> <p>In general, <a href="http://www.quirksmode.org/" rel="noreferrer">http://www.quirksmode.org/</a> is an excellent reference for this sort of thing.</p>
<p>Without seeing a code snippet, it's hard to determine what the issue is. You may want to try appending an iframe under your popup that is the same size as your popup. With IE7 if you render the iframed popup after the other iframe has already loaded you should be able to cover up elements that are beneath. I believe...
14,953
<p>I'm trying to do Ruby password input with the <a href="http://highline.rubyforge.org/" rel="noreferrer">Highline gem</a> and since I have the user input the password twice, I'd like to eliminate the duplication on the blocks I'm passing in. For example, a simple version of what I'm doing right now is:</p> <pre><cod...
<p>The code by David will work fine, but this is an easier and shorter solution:</p> <pre><code>foo = Proc.new { |prompt| prompt.echo = false } new_pass = ask("Enter your new password: ", &amp;foo) verify_pass = ask("Enter again to verify: ", &amp;foo) </code></pre> <p>You can also use an ampersand to assign a block ...
<p>I don't think the language supports a construct like this. The only way I can see to generalize this in any way is:</p> <pre><code>def foo(prompt) prompt.echo = false end new_pass = ask("Enter your new password: ") { |prompt| foo(prompt) } verify_pass = ask("Enter again to verify: ") { |prompt| foo(prompt) } </co...
35,634
<p>In the Full .NET framework you can use the Color.FromArgb() method to create a new color with alpha blending, like this:</p> <pre><code>Color blended = Color.FromArgb(alpha, color); </code></pre> <p>or</p> <pre><code>Color blended = Color.FromArgb(alpha, red, green , blue); </code></pre> <p>However in the Compac...
<p>Apparently, it's not quite that simple, but <a href="http://blogs.msdn.com/chrislorton/archive/2006/04/07/570649.aspx" rel="nofollow noreferrer">still possible</a>, if you have Windows Mobile 5.0 or newer.</p>
<blockquote> <p>Apparently, it's not quite that simple, but still possible, if you have Windows Mobile 5.0 or newer.</p> </blockquote> <p>Wow...definitely not worth it if I have to put all that code in (and do native interop!) Good to know though, thanks for the link.</p>
3,533
<p>We decided to use the minimumRequiredVersion in our clickOnce application manifest, and now when we try to rollback to a previous version when the user launches the application it fails to start. It says the application manifest has a earlier version than the required version and the user can not use the application...
<p>You have to deploy a new version with a higher version number. There is no built in rollback feature.</p>
<p>If you want to rollback the version to a previous one before the clients minimum required version then you will need to reinstall the clickonce application.</p> <p>Take a look at this link to see how it can be done in code: <a href="http://www.jamesharte.com/blog/?p=11" rel="nofollow noreferrer">ClickOnce and Expir...
29,900
<p>In other words, is this Singleton implementation thread safe:</p> <pre><code>public class Singleton { private static Singleton instance; private Singleton() { } static Singleton() { instance = new Singleton(); } public static Singleton Instance { get { return instance;...
<p>Static constructors are guaranteed to be run only once per application domain, before any instances of a class are created or any static members are accessed. <a href="https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/static-constructors" rel="noreferrer">https://learn.microsoft.c...
<p>The static constructor is locked. While the type initializer is running, any other thread which attempts to access the class in such a way that would trigger the type initializer will block.</p> <p>However, the thread which is running the type initializer can access uninitialized static members. So be sure not to ca...
2,874
<p>I'm having trouble with global variables in php. I have a <code>$screen</code> var set in one file, which requires another file that calls an <code>initSession()</code> defined in yet another file. The <code>initSession()</code> declares <code>global $screen</code> and then processes $screen further down using the v...
<p><code>Global</code> DOES NOT make the variable global. I know it's tricky :-)</p> <p><code>Global</code> says that a local variable will be used <em>as if it was a variable with a higher scope</em>.</p> <p>E.G :</p> <pre><code>&lt;?php $var = "test"; // this is accessible in all the rest of the code, even an inc...
<p>It is useless till it is in the function or a class. Global means that you can use a variable in any part of program. So if the global is not contained in the function or a class there is no use of using Global</p>
13,312
<p>Has anyone gotten VisualWorks running under OpenBSD? It's not an officially supported platform, but one of the Cincom guys was telling me that it should be able to run under a linux compatibility mode. How did you set it up?</p> <p>I already have Squeak running without a problem, so I'm not looking for an alternati...
<p>if you're wondering about setting up linux compatibility mode and you're running the GENERIC kernel:</p> <pre><code># sysctl kern.emul.linux=1 </code></pre> <p>to enable at boot uncomment the kern.emul.linux=1 line in /etc/sysctl.conf</p>
<p>if you're wondering about setting up linux compatibility mode and you're running the GENERIC kernel:</p> <pre><code># sysctl kern.emul.linux=1 </code></pre> <p>to enable at boot uncomment the kern.emul.linux=1 line in /etc/sysctl.conf</p>
10,716
<p>We're trying to show 4 trend graphs and will be adding data to them them at a rate of about 1 point every second. In the end each trend needs to show around 600 points. </p> <p>Currently we are using the graphing tools from Syncfusion but they are unable to redraw the graphs at the speed we require. I believe the...
<p>Look no further, use <a href="http://visifire.com/silverlight_chart_designer.php" rel="nofollow noreferrer">visifire</a>.</p>
<p>I am not sure how well it will fit your needs, but you might take a look at <a href="http://www.visifire.com/" rel="nofollow noreferrer">http://www.visifire.com/</a><br> Visifire is an open source graphing control for Silverlight and WPF.</p>
42,210
<p>I need to change the DataTemplate for items in a ListBox depending on whether the item is selected or not (displaying different/more information when selected).</p> <p>I don't get a GotFocus/LostFocus event on the top-most element in the DataTemplate (a StackPanel) when clicking the ListBox item in question (only t...
<p>The easiest way to do this is to supply a template for the "ItemContainerStyle" and NOT the "ItemTemplate" property. In the code below I create 2 data templates: one for the "unselected" and one for the "selected" states. I then create a template for the "ItemContainerStyle" which is the actual "ListBoxItem" that co...
<p>It should also be noted, that the stackpanel isn't focuable, so it's never going to get focus (set Focusable=True if you /really/ want it focused). However, the key to remember in scenarios like this is that the Stackpanel is <strong>child</strong> of the TreeViewItem, which is the ItemContainer in this case. As Mic...
17,614
<p>I am having a problem like that i am having some 10 parameters. I am dispalying the parameter values in the textbox(10 different). I need to display the textbox based on my parameter values</p> <p>If the parameter has values - show them in textbox If the parameter has no values - hide the textbox.</p> <p>Currently...
<p>Reporting Services does not have an event based model that would allow you to hook in custom code in order to dynamically create report objects. Using expressions to hide and show objects is the correct way of achieving this sort of functionality. </p>
<p>I don't think the default report viewer control that comes with SSRS supports this. You may have to build your own report viewer interface that calls the reporting services manually.</p>
26,015
<p>Well I would like to make a custom run dialog within my program so that the user can test commands without opening it themselves. The only problem is, msdn does not provide any coverage on this. If I cannot make my own custom run dialog and send the data to shell32.dll (where the run dialog is stored) I will settle ...
<p>VBScript's CreateObject() function just creates an instance of a COM object. You can do exactly the same thing in C++, you just need to read a <a href="http://progtutorials.tripod.com/COM.htm" rel="nofollow noreferrer">tutorial on how to access COM objects using C++</a> first.</p>
<p>Creating a simple RUn dialog is not a big problem (the user interface). The data entered by the user can be run via <a href="http://msdn.microsoft.com/en-us/library/bb762153(VS.85).aspx" rel="nofollow noreferrer">ShellExecute</a>. If you want to call the Run dialog then you should use COM.</p>
35,414
<p>I was getting bad data from an application I was writting using C++ in Visual Studio 2k3 so I decided to debug it. Then I found it was throwing an exception but one I can't track down.</p> <p>Then I placed some try/catch blocks and low and behold, when I don't debug there is no exception. That is, I have code that ...
<p>You can try placing a</p> <pre><code>DebugBreak(); </code></pre> <p>call in the <code>catch</code> clause. If the app is running in the debugger, it should get control. If it's not running in the debugger you should get an opportunity to attach the "Just in Time" debugger (which is usually Visual Studio if you ha...
<p>If you're using a good IDE that allows conditional breakpoints (such as, "break here if i == 5"), then it's possible the condition itself is causing the exception. </p> <p>Had that one for while... my head hurt when I found it.</p>
26,324
<p>In the project I am currently working on, we have the need to develop a web chat application, not a very complex chat, just a way to connect two people to talk about a very specific topic, we don't need any kind of authentication for one of the two users, we don't have to support emoticons, avatars, or stuff like th...
<p>You might also want to look into <a href="http://en.wikipedia.org/wiki/Comet_(programming)" rel="noreferrer">Comet</a>.</p> <p>It's used by GTalk, Meebo, and many <a href="http://ajaxian.com/archives/comet-a-new-approach-to-ajax-applications" rel="noreferrer">other chat applications</a>. A few years ago when I was ...
<p>I thought everyone used cometd for this sort of thing. </p>
5,601
<p>I am trying to make a gridview sortable which uses a stored procedure as a datasource, I would not want it to rerun the query each time to achieve this. How would I get it to work my current code is:</p> <pre><code>protected override void OnPreRender(EventArgs e) { if (!IsPostBack) { SqlCommand cmd2 = n...
<p>If you are not paging the results, and just doing a read, then something like the jquery tablesorter plugin would be a quick and easy fix. I have used this on tables of up to 1400 rows and works great, although ~> few hundred probably better on slow putas.</p> <p>If the gridview is editable, then aspnet event/input...
<p>You could try storing the data in view state (or cache).</p>
38,070