instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>We've got an interesting case where we are trying to determine how different instances of our app were launched. Is there any way for .NET to be able to query another running instance and get the command line parameters passed to that instance? I've not been able to find any way to do it in .NET so far, so I thought...
<p>You can retrieve this information through WMI.</p> <p>See the <a href="http://msdn.microsoft.com/en-us/library/aa394372.aspx" rel="nofollow noreferrer">Win32_Process</a> class, in particular its command line property. This <a href="http://www.codeproject.com/KB/cs/EverythingInWmi02.aspx" rel="nofollow noreferrer">...
<p>For future reference, here is a code snippet from how I got it to work. This was just for a test to see how it all worked. The actual implemented code parses the command line parameters for what we need.</p> <pre><code>try { ManagementScope connectScope = new ManagementScope(); connectScope.Path = new Managem...
6,597
<p>What is the best way to draw a variable width line without using glLineWidth? Just draw a rectangle? Various parallel lines? None of the above?</p>
<p>You can draw two triangles:</p> <pre><code>// Draws a line between (x1,y1) - (x2,y2) with a start thickness of t1 and // end thickness t2. void DrawLine(float x1, float y1, float x2, float y2, float t1, float t2) { float angle = atan2(y2 - y1, x2 - x1); float t2sina1 = t1 / 2 * sin(angle); float t2cosa1...
<p>A rectangle (i.e. GL_QUAD or two GL_TRIANGLES) sounds like your best bet by the sounds of it, not sure I can think of any other way.</p>
12,718
<p>I try to use the Forms-Based authentication within an embedded Jetty 6.1.7 project.</p> <p>That's why I need to serve servlets and html (login.html) under the same context to make authentication work. I don't want to secure the hole application since different context should need different roles. The jetty javadoc ...
<p>Finally I got it right, solution is to use latest jetty 6.1.12 rc2. I didn't check out what they changed - I'm just happy that it works now.</p>
<p>Use the web application descriptor:</p> <p>Paste this in to your web.xml:</p> <pre><code>&lt;login-config&gt; &lt;auth-method&gt;BASIC&lt;/auth-method&gt; &lt;/login-config&gt; &lt;security-role&gt; &lt;role-name&gt;MySiteRole&lt;/role-name&gt; &lt;/security-role&gt; &lt;security-constraint&gt; &lt;di...
9,866
<p>I'm experiencing a bug with a published flash movie. When I embed the movie in an HTML page (with SWFObject 2.1), and assing it the wmode param value of 'transparent', all my functions based on the MouseWheel event stop working. The movie is based on AS2. Anyone familiar with this bug? </p>
<p>There is a workaround at Adobe Developer Connection:</p> <p><a href="http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&amp;productId=2&amp;postId=13086" rel="nofollow noreferrer">Workaround to support mouse wheel for FireFox with wmode</a></p>
<p>Mousewheel doesn't work for me either in AS3 when I set wmode=transparent. Furthermore, my flash application acts really strange and crashes frequently with wmode=transparent. </p> <p>Plus, it doesn't seem to work at all on firefox under linux... the flash app is always above everything. </p> <p>I would not reco...
40,491
<p>Can iPhone applications compiled against 2.1 be successfully installed via iTunes on a 2.0 device?</p> <p>I know iPhone applications compiled with 2.1 can <em>run</em> on a 2.0 device (assuming they're not using anything new from 2.1). But am not sure if iTunes will let the install take place.</p> <p>Does anyone h...
<p>I believe apps that are compiled against 2.1 will be marked as "Requires iPhone 2.1 Softwar Update" when viewed through iTunes. (but not when viewed from an iPhone - the iPhone's App Store app only displays a subset of an app's metadata.)</p> <p>One example: <a href="http://phobos.apple.com/WebObjects/MZStore.woa/w...
<p>Short answer, yes.</p> <p>There have been some apps that dont work 100% in 2.1, but the two firmwares are pretty much backwards compatible</p>
17,494
<p>My everyday IDE is Eclipse which has a wonderful Open Resource feature (CTRL+SHIFT+R or Navigate > Open Resource) which allows the user to search for files/resources across multiple projects.</p> <p>I can't find a similar feature in SQL Server Management Studio, is there one?</p>
<p>You can search for objects in a sql database using the Information Schema Views <a href="http://msdn.microsoft.com/en-us/library/ms186778.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms186778.aspx</a> There's one for tables, columns, functions, sprocs, etc. </p> <p>select * from INFORMATI...
<p>I hope someone has a better answer to this than I do. In the past, I've used a CURSOR to search through all the databases and insert results into a temp table. I could then select from the temp table and show the results. </p> <p>I don't have this code laying around anymore. If no one comes up with a better ans...
17,963
<p>I'm doing a custom 404 page for a large website that's undergoing a redesign. There are about 40 high-use pages that customers may have bookmarked, and our new site structure will break these bookmarks. </p> <p>On my custom 404 page, I want to alert them to the new URL if they attempt to navigate to one of these ...
<p>I would use the Dictionary&lt;T,T&gt; from the System.Collections.Generic namespace.</p>
<p>Dictionary would be fine. Wether you store it as the interface type IDictionary or Dictionary itself wouldn't matter much in this case as it's not going to be passed much around, besides on the 404 page itself.</p> <p>Have you considered doing some URL rewriting to still support the old URLs?</p>
26,675
<p>Is it possible to remote-debug a Visual C++ 6.0 application running on a Windows NT machine from a developer workstation running Windows XP? If so, is there a procedure written up somewhere?</p>
<p>Take a look at <a href="http://www.codeproject.com/KB/debug/remotedebug.aspx" rel="nofollow noreferrer">this article.</a> Also <a href="http://msdn.microsoft.com/en-us/library/bt727f1t.aspx" rel="nofollow noreferrer">this</a> may be helpful although you don't mention which version of the IDE you're using. </p>
<p>Yes -- you can also use a newer version of Visual Studio. As long as you have the PDB file for the target application it doesn't matter what version it was built with (well, VS6 might not understand a newer PDB, but backwards should be fine).</p> <p>The remote debugging experience on newer VS versions is a lot smo...
6,812
<p>I have a query where i have a date column (time) which tells about "IN" &amp; "OUT" timing of the people attendance by this single column</p> <p>My queries are :-</p> <p>1) How to get the daily attendance of each employee 2) How to come to know if the employee is present less than 5 hours</p> <p>Please let me kno...
<p>You'll need to group the query by the user and the items for a particular day then compare the maximum and minimum values, e.g. </p> <pre><code>declare @users table ( UserId int, DateColumn datetime ) insert into @users values (1, '2008-10-31 15:15') insert into @users values (1, '2008-10-31 10:30') ins...
<pre><code> select datediff(minute, TimeFrom, TimeTo) as AttendedTimeInMinutes, case when datediff(minute, sTimeFrom, sTimeTo) &lt; 5 * 60 then 'less than 5 hours' else '5 hours or more' end from YourTable </code></pre>
31,567
<p>We have our JBoss and Oracle on separate servers. The connections seem to be dropped and is causing issues with JBoss. How can I have the JBoss reconnect to Oracle if the connection is bad while we figure out why the connections are being dropped in the first place?</p>
<p>There is usually a configuration option on the pool to enable a validation query to be executed on borrow. If the validation query executes successfully, the pool will return that connection. If the query does not execute successfully, the pool will create a new connection. </p> <p>The <a href="http://community....
<p>A little update to @skaffman's answer. In JBoss 7 you have to use "class-name" attribute when setting valid connection checker and also package is different:</p> <p><code>&lt;valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker" /&gt;</code></p>
15,639
<p>What's the best way to store tags for a record? Just use a varchar field? What about when selecting rows that contains tag x? Use the like operator?</p> <p>thanks!</p>
<p>Depends on two things: <br> 1) The amount of tags/tagged records<br> 2) Whether or not you have a religious opinion on normalization :-)<br></p> <p>Unless dealing with very large volumes of data, I'd suggest having a 'Tags' table mapping varchar values to integer identifiers then second table mapping tagged records...
<p>No, it is generally a bad idea to put multiple pieces of data in a single field. Instead, use a separate Tags table (perhaps with just a TagID and TagName) and then, for each record, indicate the TagID associated with it. If a record is associated with multiple tags, you will have duplicate records with the only d...
17,505
<p>I'm having real difficulties with XAML files in Silverlight since they get very big very fast when using Blend. It just becomes a wall of text after only a handful of controls are added and animated.</p> <p>I'm hoping a better vesion of Blend will come out soon, so that our designers will never even have to see XAM...
<p>It does require a little bit of work to maintain XAML files, but basically, what you need to do is split them up in resource files (XAML Resource Dictionaries) using a scheme that makes sense to you.</p> <p>For example we use a scheme where we have a folder structure like this:</p> <ul> <li><p>Resources (contains...
<p>I'm a Creative Developer and work in Blend extensively.</p> <p>I published a few thoughts last year on <a href="http://blogs.vertigo.com/personal/alanl/Blog/archive/2007/11/30/keeping-xaml-clean.aspx" rel="nofollow noreferrer">keeping XAML clean</a>.</p> <p>Silverlight currently does not support MergedResourceDict...
33,204
<p>I have written code to read a windows bitmap and would now like to display it with ltk. How can I construct an appropriate object? Is there such functionality in ltk? If not how can I do it directly interfacing to tk?</p>
<p>It has been a while since I used LTK for anything, but the simplest way to display an image with LTK is as follows:</p> <pre><code>(defpackage #:ltk-image-example (:use #:cl #:ltk)) (in-package #:ltk-image-example) (defun image-example () (with-ltk () (let ((image (make-image))) (image-load image "t...
<p>Tk does not natively support windows bitmap files. However, the "Img" extension does and is freely available on just about every platform. You do not need to read the data in, you can create the image straight from the file on disk. In plain tcl/tk your code might look something like this:</p> <pre><code>package re...
10,335
<p>Say I have a bitmap image, is it possible to iterate through all the individual bytes in the image? If yes, how?</p>
<p>I found this: <a href="http://channel9.msdn.com/forums/TechOff/108813-Bitmap-to-byte-array/" rel="nofollow noreferrer">http://channel9.msdn.com/forums/TechOff/108813-Bitmap-to-byte-array/</a></p> <p>Saying that you could use a Memorystream and the .Save method it'd look like this:</p> <pre><code>System.Drawing.Bit...
<p>Another solution is to use LockBits and Marshal.Copy to convert your bitmap into an array. I needed this solution because I had two images that differed only in their color depth and the other proffered solutions don't handle that well (or are too slow).</p> <pre><code>using (Bitmap bmp = new Bitmap(fname)) { /...
43,812
<p>Anyone know off the top of their heads how to convert a System.Xml.XmlNode to System.Xml.Linq.XNode?</p>
<p>I've never tried, but my first thought would be something like:</p> <pre><code>XmlNode myNode; XNode translatedNode = XDocument.Parse(myNode.OuterXml); </code></pre>
<p>I don't think there is, but why would you need to? Each is the lowest 'leaf' of the Xml structure for different ways of reading the document.</p> <p>If you use Linq to Xml and XDocument you'll have all the linq-style syntax and new functionality, but really all that's about selecting a node.</p> <p>Once you have t...
28,634
<p>I'm working on a sparse matrix class that <strong>needs</strong> to use an array of <code>LinkedList</code> to store the values of a matrix. Each element of the array (i.e. each <code>LinkedList</code>) represents a row of the matrix. And, each element in the <code>LinkedList</code> array represents a column and the...
<p>For some reason you have to cast the type and make the declaration like this:</p> <pre><code>myMatrix = (LinkedList&lt;IntegerNode&gt;[]) new LinkedList&lt;?&gt;[numRows]; </code></pre>
<p>If I do the following I get the error message in question</p> <pre><code>LinkedList&lt;Node&gt;[] matrix = new LinkedList&lt;Node&gt;[5]; </code></pre> <p>But if I just remove the list type in the declaration it seems to have the desired functionality.</p> <pre><code>LinkedList&lt;Node&gt;[] matrix = new LinkedLi...
26,679
<p>I see <code>__all__</code> in <code>__init__.py</code> files. What does it do?</p>
<p>It's a list of public objects of that module, as interpreted by <code>import *</code>. It overrides the default of hiding everything that begins with an underscore.</p>
<p>This is defined in PEP8 <a href="https://www.python.org/dev/peps/pep-0008/#global-variable-names" rel="nofollow noreferrer">here</a>:</p> <blockquote> <p>Global Variable Names</p> <p>(Let's hope that these variables are meant for use inside one module only.) The conventions are about the same as those for functions....
6,662
<p>I need a byte buffer class in Java for single-threaded use. I should be able to insert data at the back of the buffer and read data at the front, with an amortized cost of O(1). The buffer should resize when it's full, rather than throw an exception or something.</p> <p>I could write one myself, but I'd be very sur...
<p>Not sure if it is &quot;the best&quot;, but you have a nice example of <a href="http://ostermiller.org/utils/CircularBuffer.html" rel="noreferrer">Circular Byte buffer here</a>.</p> <p>Those <a href="http://ostermiller.org/utils/" rel="noreferrer">Java Utilities - OstermillerUtils</a> classes are under <a href="htt...
<p>Another solution is to use <a href="http://www.jboss.org/jbossremoting/docs/api/org/jboss/remoting/transport/multiplex/utility/GrowablePipedOutputStream.html" rel="nofollow noreferrer">GrowablePipedOutputStream</a> and <a href="http://www.jboss.org/jbossremoting/docs/api/org/jboss/remoting/transport/multiplex/utilit...
42,172
<p>I have built a web page which contains a Crystal Report built using the Crystal libraries included in Visual Studio 2008. </p> <p>It '<a href="http://jcooney.net/archive/2007/02/01/42999.aspx" rel="noreferrer">works on my machine</a>' but when deployed to the web server the icons (Export, Print etc) on the Crystal...
<p>Doh! Someone else here at work figured this out. It was really simple and I should have been able to sort it, but hey, that's how it goes sometimes.</p> <p>Here the fix:<br> On the web server, copy the 'aspnet_client' folder from 'C:\Inetpub\wwwroot' to 'C:\Inetpub\wwwroot\your-website-name'. </p> <p>That's all ...
<p>I took over maintaining some code produced by another developer who had left and suffered this issue too. In my case the compiled report was looking for the images in the crystalreportview115 folder which existed in my local development path and therefore worked locally. The only folder on on the target server was t...
7,674
<p>The 'click sound' in question is actually a system wide preference, so I only want it to be disabled when my application has focus and then re-enable when the application closes/loses focus.</p> <p>Originally, I wanted to ask this question here on stackoverflow, but I was not yet in the beta. So, after googling for...
<p>I've noticed that if you use WebBrowser.Document.Write rather than WebBrowser.DocumentText then the click sound doesn't happen.</p> <p>So instead of this:</p> <pre><code>webBrowser1.DocumentText = "&lt;h1&gt;Hello, world!&lt;/h1&gt;"; </code></pre> <p>try this:</p> <pre><code>webBrowser1.Document.OpenNew(true); ...
<p>Definitely feels like a hack, but having done some research on this a long time ago and not finding any other solutions, probably your best bet.</p> <p>Better yet would be designing your application so it doesn't require many annoying page reloads.. for example, if you're refreshing an iframe to check for updates o...
3,163
<p>This may be an oxymoron, but how would one update a data entity in the functional programming style? From all I've read, functional-style programming uses transformations to return an output on immutable entities. The only thing I can think of would be to completely replace the original entity, but that seems almost...
<p>Are you talking about on disk database entities or data-structures in memory.</p> <p>For the latter, functional languages use persistent data-structures, which are implemented such that the new version and the old version are both available after the update, but they share common parts (so that it is efficient). S...
<p>The short answer is that in the functional style, each data entity would be immutable, so an update is really a new data entity with the updated value, kind of like how strings work in .NET.</p> <p>The real interesting challenges come when dealing with IO, it becomes tough to model I/O in a purely functional manner...
33,380
<p>I found this low temperature filament for 3d printing, <a href="https://www.sainsmart.com/products/low-temperature-filament-0-5kg-1-75mm-white" rel="nofollow noreferrer">Low Temperature Filament 0.5kg 1.75mm, White</a> </p> <p>Correct me if I'm wrong but I'm pretty sure I can use it for a <em>really</em> precise no...
<p>You won't need specialized nozzles, you understand the material wrong:</p> <p>The benefit the properties of this material grant is not super fine prints (which you can get with small nozzles like 0.1 mm already), it is that you can print at super low temperatures. Printing it at standard 200°C will mean, that it wo...
<p>I have been looking for some where that could make a custom nozzle and the only place I have found so far that I think might be able to is: <a href="https://www.emachineshop.com/" rel="nofollow noreferrer">https://www.emachineshop.com/ </a></p> <p>You would need to draw up the design of the nozzle in the software o...
764
<p>What are some hidden features of <a href="http://en.wikipedia.org/wiki/Microsoft_SQL_Server" rel="nofollow noreferrer">SQL Server</a>?</p> <p>For example, undocumented system stored procedures, tricks to do things which are very useful but not documented enough?</p> <hr> <h2>Answers</h2> <p><em>Thanks to everybo...
<p>In Management Studio, you can put a number after a GO end-of-batch marker to cause the batch to be repeated that number of times:</p> <pre><code>PRINT 'X' GO 10 </code></pre> <p>Will print 'X' 10 times. This can save you from tedious copy/pasting when doing repetitive stuff.</p>
<p>For SQL Server 2005:</p> <pre><code>select * from sys.dm_os_performance_counters select * from sys.dm_exec_requests </code></pre>
14,748
<p>I want to change item's height and width according to a slider, but as far as I know, there's no measureitem method as CListBox. How can I fix this?</p> <p>Thank you!</p>
<p>All items in CListCtrl have to have the same size. I believe you can use OnMeasureItem in the container that holds the CListCtrl, but it won't be called for each item, but only once for the entire control.</p>
<p>The workaround is to attach an <strong>image list</strong> to the <strong>CListCtrl</strong>. The rows will then take on a height based on the height of the image list.</p>
29,949
<p>What's the best value for money c# code protection? Some just use obfuscation, others add win32 wrapping, some cost a fortune. So far I've come up with <a href="http://www.eziriz.com/" rel="nofollow noreferrer">http://www.eziriz.com/</a> who's Intellilock looks promising. Any other suggestions? Any reasons why this ...
<p><a href="http://www.smartassembly.com/product/editions.aspx" rel="nofollow noreferrer">Smartassembly</a> does very decent job. It's very very good, and easy to use. It even makes it harder to look at obfuscated file since it even makes it harder to decompile.</p> <blockquote> <p>Why choose {smartassembly}?</p> ...
<p>Our <a href="http://www.ssware.com/cryptoobfuscator/obfuscator-net.htm" rel="nofollow noreferrer">Crypto Obfuscator</a> product is affordable - license does not cost thousands of dollars - and provides strong obfuscation to your assemblies.</p>
9,658
<p>I am developing an application trying to employ the Observer pattern. Basically I have a base form from which various components (forms) can be loaded.</p> <p>The base form references each of the components and some of the components reference each other.</p> <p>If I want one of the components to listen for events...
<p>You can solve this in various ways. One simple way is to have a special class which knows about the base form and the various components. This class is responsible for creating the form and the components. Since it knows about them, it can attach event handlers to the appropriate events. It essentially just "plugs i...
<p>You could go for the EventBroker pattern as seen in <a href="http://msdn.microsoft.com/en-us/library/cc540687.aspx" rel="nofollow noreferrer">Microsoft's Patterns and Practices</a> Library.</p> <p>However I'm not sure myself if that's so good a pattern, personally I prefer to create architecture where objects don't...
47,913
<p>I would want to do something like:</p> <pre><code>&gt;&gt;&gt; lst = [1, 2, 3, 4, 5] &gt;&gt;&gt; lst.find(lambda x: x % 2 == 0) 2 &gt;&gt;&gt; lst.findall(lambda x: x % 2 == 0) [2, 4] </code></pre> <p>Is there anything nearing such behavior in Python's standard libraries?</p> <p>I know it's very easy to roll-you...
<p>You can use the filter method:</p> <pre><code>&gt;&gt;&gt; lst = [1, 2, 3, 4, 5] &gt;&gt;&gt; filter(lambda x: x % 2 == 0, lst) [2, 4] </code></pre> <p>or a list comprehension:</p> <pre><code>&gt;&gt;&gt; lst = [1, 2, 3, 4, 5] &gt;&gt;&gt; [x for x in lst if x %2 == 0] [2, 4] </code></pre> <p>to find a single el...
<p>Generators and list comprehensions are more pythonic than chainable functions.</p> <pre class="lang-py prettyprint-override"><code>&gt;&gt;&gt; lst = [i for i in range(1, 6)] &gt;&gt;&gt; lst [1, 2, 3, 4, 5] &gt;&gt;&gt; gen = (x for x in lst if x % 10 == 0) &gt;&gt;&gt; next(gen, 'not_found') 'not_found' &gt;&g...
37,018
<p>I want to run text through a filter to ensure it is all UTF-8 encoded. What is the recommended way to do this with PHP?</p>
<p>Your question is unclear, are you trying to encode something? If so <a href="http://us2.php.net/manual/en/function.utf8-encode.php" rel="nofollow noreferrer"><strong>utf8_encode</strong></a> is your friend. Are you trying to determine if it doesn't need to be encoded? If so, <strong>utf8_encode</strong> is still ...
<p>You need to know in what character set your input string is encoded, or this will go nowhere fast.</p> <p>If you want to do it correctly, this article may be helpful: <a href="http://www.joelonsoftware.com/articles/Unicode.html" rel="nofollow noreferrer">The Absolute Minimum Every Software Developer Absolutely, Pos...
10,534
<p>I'm using Express currently. What extra features do I get with the full edition?</p>
<p>There are no differences in Management Studio. The differences are in the database engine LIMITATIONS! The engine is the same but it will deny you some features.</p> <p>Import/Export wizard in the express edition can be found at: C:\Program Files\Microsoft SQL Server\90\DTS\Binn\DTSWizard.exe</p> <p>If you dont ha...
<p>One of the feature which prevents me from using Studio Express is the ability to import and export data via the SSIS (SQL Server Integration Services). It is hard to be a true DBA with just Studio Express. From a developer's standpoint, Studio Express would typically be sufficient.</p>
14,289
<p>I am writing a query in which I have to get the data for only the last year. What is the best way to do this?</p> <pre><code>SELECT ... FROM ... WHERE date &gt; '8/27/2007 12:00:00 AM' </code></pre>
<p>The following adds -1 years to the current date:</p> <pre><code>SELECT ... From ... WHERE date &gt; DATEADD(year,-1,GETDATE()) </code></pre>
<p>The other suggestions are good if you have "SQL only".</p> <p>However I suggest, that - <strong>if possible</strong> - you calculate the date in your program and insert it as string in the SQL query.</p> <p>At least for for big tables (i.e. several million rows, maybe combined with joins) that will give you a cons...
5,010
<p>What's the best way for a common library to know what context - a.k.a. the calling app - it is in? I'm in a very controlled enterprise environment... is there a better way for the library to know what application it is getting called from than reading a setting in the config file? What do you use for this type of th...
<p>There may be a way to do it. I will most likely get down votes for this since I don't plan to answer your actual question at all, but I just couldn't move on without saying something. To me this is an example of the worst sort of coupling possible. Your actually has to look at a DB and behave differently depending o...
<p>getenv() will get you environment variables, which in turn should should give you what you want. But generally, having different behavior depending on the name of the calling program is <em>not</em> considered a best practice. An exception would be if you wanted to print out the calling program's name in a log mes...
25,829
<p>When would you call Java's <code>thread.run()</code> instead of <code>thread.start()</code>?</p>
<p>You might want to call run() in a particular unit test that is concerned strictly with functionality and not with concurrency.</p>
<pre><code>public class TestClass implements Runnable { public static void main(String[] args) { TestClass tc = new TestClass(); Thread t1 = new Thread(tc); System.out.println("Before Starting Thread " + Thread.currentThread().hashCode()); t1.start(); System.out.println("Aft...
32,900
<p>I've got a complex dialog, and it is full of whitespace and I can't shrink it. In Designer, it has lots of components that then get dynamically hidden, and a few which are dynamically added. I've added dumping of size policies, size hints, and minimum sizes, but still can't figure out why Qt won't let me drag it s...
<p>I don't know of any tools for doing this, but I have managed it before by changing the palette of the different elements in the dialog, then looking at what is taking up more (or less) room than I expected, and focusing my investigation on those elements.</p> <p>In a more general sense, make sure you've set the dia...
<p>Lots of trial and error. I have discovered that inserting stretches in strategic spots often helps me produce the effect I want. For example, if I have a QPushButton in a layout that I want to be the minimum size I will do something like the following:</p> <pre> <code> QHBoxLayout* layout = new QHBoxLayout; QPushB...
28,746
<p>I've done some research on <a href="http://dx.doi.org/10.1016/j.ipm.2007.12.010" rel="nofollow noreferrer">using tags from social bookmarking sites for web search</a>, but I'd like to learn more about other ways in which users might use tags for information retrieval. </p> <p>Do you use the tags on sites like Stac...
<p>I use them for searching for my stack (C#, ASP.NET, WinForms etc). I have them set up in Launchy as shortcuts.</p> <p>I have posted some thoughts ideas on my <a href="http://cantgrokwontgrok.blogspot.com/2008/09/stackoverflow-crackoverflow-or.html" rel="nofollow noreferrer">StackOverflow blog post</a> - feel free t...
<p>Tags and hierarhical views (like a dictionary structure) are the two main methods for information organization. </p> <p>As dictionary structures are more familiar to most users (many real life analogies exists like looking for a specific art book in a library or looking for milk in a mall), at first they are usuall...
10,610
<p>using ASP.NET I need to update an excel template.</p> <p>Our server is running Windows 2008 in 64 bit mode.</p> <p>I am using the following code to access the excel file:</p> <pre><code> ... string connection = @"Provider=MSDASQL;Driver={Microsoft Excel Driver (*.xls)};DBQ=" + path + ";"; ... </code><...
<p>The Microsoft Office team has just <strong>released</strong> a <strong><a href="http://www.microsoft.com/downloads/details.aspx?familyid=C06B8369-60DD-4B64-A44B-84B371EDE16D&amp;displaylang=en" rel="nofollow noreferrer">64-bit driver</a></strong></p>
<p>Install the 32-bit Oracle driver and enable 32 bit applications?</p>
45,671
<p>I have a file that has one entry per line. Each line has the following format:</p> <pre><code> "group:permissions:users" </code></pre> <p>Permissions and users could have more than one value separated by comas like this:</p> <pre><code> "grp1:create,delete:yo,el,ella" </code></pre> <p>I want is to return the f...
<p>You can use awk, with the -F option to use : as the field separator: </p> <pre><code>[user@host]$ echo "grp1:create,delete:yo,el,ella" | awk -F ':' '{print $3}' yo,el,ella </code></pre> <p>That will get you just the users string, separated by commas. Then you can do whatever you want with that string. If you want ...
<p>Here's one way to do it entirely in a shell script. You just need to change IFS to get it to break "words" on the right characters. Note: This will not handle escapes (e.g. ":" in some file formats) at all.</p> <p>This is written to allow you to do:</p> <pre><code>cat file | name-of-script </code></pre> <p>The ...
44,958
<p>I would like to return a string with all of the contents of a CSS rule, like the format you'd see in an inline style. I'd like to be able to do this without knowing what is contained in a particular rule, so I can't just pull them out by style name (like <code>.style.width</code> etc.) </p> <p>The CSS:</p> <pre><c...
<p>Adapted from <a href="http://www.javascriptkit.com/domref/cssrule.shtml" rel="noreferrer">here</a>, building on scunliffe's answer:</p> <pre><code>function getStyle(className) { var cssText = ""; var classes = document.styleSheets[0].rules || document.styleSheets[0].cssRules; for (var x = 0; x &lt; clas...
<p>Based on @dude answer this should return relevant styles in a object, for instance:</p> <pre><code>.recurly-input { display: block; ...
42,020
<p>I am trying to use MS access to connect to a Oracle database. I keep on getting the following error message:</p> <p>ORA-12154: TSN- could not resolve the connect identifier secified</p> <p>The Oracle Drivers OracleClient10g can verify that the database server exists.</p> <p>I have a section in my tsnnames.ora fil...
<p>I don't have Access, but using Excel 2007, I had to do the following:</p> <ol> <li>Open ODBC Administrator (in the Administrator Control Panel)</li> <li>For either User DSN or System DSN, click Add...</li> <li>Select "Oracle in OraDb10g_home1" as the driver</li> <li>In the Oracle ODBC Driver Configuration, I entere...
<p>Try changing (CONNECT_DATA = (SERVICE_NAME = UBASE) ) to (CONNECT_DATA = (SID = UBASE) ) in your TNSNAMES.ora file.</p> <p>ServiceName and SID aren't necessarily the same and consequently aren't always interchangeable. </p> <p>The SERVICENAME parameter refers to a particular GLOBAL_DBNAME specified in the listene...
30,720
<p>I would like to serialize and deserialize objects without having to worry about the entire class graph.</p> <p>Flexibility is key. I would like to be able to serialize any object passed to me without complete attributes needed throughout the entire object graph.</p> <blockquote> <p>That means that Binary Serial...
<p>Have you considered serializing to JSON instead of XML?</p> <p><a href="http://james.newtonking.com/projects/json-net.aspx" rel="noreferrer">Json.NET</a> has a really powerful and flexible serializer that has no problems with Hashtables/generic dictionaries and doesn't require any particular attributes. I know beca...
<p>The simplest thing to do is mark your objects with the Serializable attribute and then use a binary formatter to handle the serialization. The entire class graph shouldn't be a problem provided that any contained objects are also marked as Serializable.</p>
13,218
<p>Does excess use of AJAX affects performance? In context of big size web-applications, how do you handle AJAX requests to control asynchronous requests?</p>
<p>excess use of anything degrades performance; using AJAX where necessary will improve performance, especially if the alternative is a complete full-page round-trip to the server [a 'postback' in asp.net terminology]</p>
<p>If the site is busy then it will, eventually, kill the server, unless your in a farm. As to the site itself it <strong>shouldn't</strong>.</p>
12,480
<p>I recently bought a 3D printer called Dreamer NX from FlashForge. The dealer told me to use FlashPrint software that belongs to the FlashForge printer manufacturer. But, many people advise me to use Ultimaker Cura. Are there many differences between these two software packages?</p>
<p>The commonality of the 2 slicers is that both are developed and maintained by a printer manufacturer. The largest difference is that FlashPrint is <a href="https://en.wikipedia.org/wiki/Proprietary_software" rel="nofollow noreferrer">closed/proprietary software</a>, while Ultimaker Cura is released in source (<a hre...
<p>Perhaps this is veering out a little bit from being an answer to the specific differences between software functionality, but one important difference that shouldn't be overlooked is that whatever you learn with Cura is applicable to <em>all FDM 3D printers</em>.</p> <p>Surely some setting tweaks you do might be sp...
1,450
<p>These ribbon in stackoverflow and uservoice.com looks nice. is there any javascript library/jquery plugin for that effect?</p>
<p>With some tuning, this is a valid equivalent, you receive notifications with fade-in/fade-out effect and it disappears automatically too:</p> <p><a href="http://projects.zoulcreations.com/jquery/growl/" rel="nofollow noreferrer">http://projects.zoulcreations.com/jquery/growl/</a></p> <p>It is based on the way it l...
<p>After some googling i found a similar jquery effect tutorial here <a href="http://roshanbh.com.np/2008/07/top-floating-message-box-using-jquery.html" rel="nofollow noreferrer">http://roshanbh.com.np/2008/07/top-floating-message-box-using-jquery.html</a></p>
43,236
<p>This question is addressed to a degree in this question on <a href="https://stackoverflow.com/questions/33664/best-practices-for-managing-linq-to-sql-dbml-files">LINQ to SQL .dbml best practices</a>, but I am not sure how to add to a question.</p> <p>One of our applications uses LINQ to SQL and we have currently ha...
<p>Take advantage of the namespace settings. You can get to it in properties from clicking in the white space of the ORM.</p> <p>This allows me to have a Users table and a User class for one set of business rules and a second (but the same data store) Users table and a User class for another set of business rules.</p>...
<p>The approach that we've used it to keep 2 .dbml files. One of them holds the Stored Procs and all production DB access is done through this. The other is in a unit test folder and holds tables and their relationships and is used for DB data manipulation and querying for unit tests.</p>
6,362
<p>For an embedded system I need to place a few data structures at fixed addresses, so that a separate control CPU can access them at a known location. I'm using linker scripts for the embedded target to accomplish this, plus #defines of those same addresses for the control CPU.</p> <p>It bothers me that these address...
<p>This isn't quite the solution you are looking for but one option is to utilize the build system to configure these values. Create a config.h.in and a target.ld.in which acts as templates and have the build system produce a config.h with the correct define and a target.ld with the correct address for the target you a...
<p>You could use the emdedded-C specific construct @ to place an object anywhere in the address space.</p> <pre><code>static struct SOMESTRUCT somestruct @ 0x40000000; extern int someextint @ 0x3ffffffc; char somebuffer[77] @ 0x80000000; </code></pre> <p>Assuming a 32-bit MCU.</p>
16,861
<p>In a project I am interfacing between C++ and a C library that uses stdbool.h defined as such.</p> <pre><code>#ifndef _STDBOOL_H #define _STDBOOL_H /* C99 Boolean types for compilers without C99 support */ /* http://www.opengroup.org/onlinepubs/009695399/basedefs/stdbool.h.html */ #if !defined(__cplusplus) #if !d...
<p>I found the answer to my own question by finding a more compatible implementation of <code>stdbool.h</code> that is compliant with the C99 standard.</p> <pre><code>#ifndef _STDBOOL_H #define _STDBOOL_H #include &lt;stdint.h&gt; /* C99 Boolean types for compilers without C99 support */ /* http://www.opengroup.org/...
<p>Logically, you are not able to share source code between C and C++ with conflicting declarations for bool and have them link to each other.</p> <p>The only way you can share code and link is via an intermediary datastructure. Unfortunately, from what I understand, you can't modify the code that defines the interfa...
4,511
<p>I am writing a script that powers on a system via network. And then i need to run a few commands on the other host. How do I know whether the system has powered on?</p> <p>My programming language is Perl and the target host is RHEL5.</p> <p>Is there any kernel interrupt or network boot information that indicates ...
<p>Well, I'd say the system is booted when it can perform the request you've made of it. That is, the sshd daemon is running. That's booted sufficiently for your purposes (I assume - substitute for whatever daemon you really need).</p> <p>So, I'd send the power-on signal, and check back every 15-30 seconds to see if...
<p>How about adding a script to the remote machine which gets run on startup to have it tell you when it is ready.</p>
23,584
<p>if a mobile application needs to get data from multiple servers, is it better to call each server from the mobile device, or call one server which then talks to all the other servers? </p> <p>"should synchronization be initiated by the server or the mobile client?" to what degree does client do the book keeping. </...
<p>Some of the main issues with mobile synchronization of personal information are the battery life of the handset and the temporary loss of connectivity.</p> <p>That's why the usual way of doing what you describe is to have a server handle most of the complicated logic and multiple data sources to create the set of d...
<p>Very vague question, but I would say both could be necessary. Your servers should coordinate as much as they need to make sure the data stored between them stays consistent. A buggy or malicious client should not be able to cause corruption or inconsistencies in the data stored on the server. The client should do wh...
33,561
<p>Are there any good database schema comparison tools out there that support Sybase SQL Anywhere version 10? I've seen a litany of them for SQL Server, a few for MySQL and Oracle, but nothing that supports SQL Anywhere correctly. </p> <p>I tried using DB Solo, but it turned all my non-unique indexes into unique one...
<p>If you are willing to download SQL Anywhere Version 11, and Compare It!, check out the comparison technique shown here:</p> <p><a href="http://sqlanywhere.blogspot.com/2008/08/comparing-database-schemas.html" rel="nofollow noreferrer">http://sqlanywhere.blogspot.com/2008/08/comparing-database-schemas.html</a></p> ...
<p><a href="http://www.sqldelta.com/" rel="nofollow noreferrer">SQLDelta</a> is awesome. It is for SQL Server. I've used it with SQL 2000 and 2005. It will compare stored procedures, tables, views, permissions, indexes, etc. It can also compare data between tables I believe. You can sync the changes or generate SQL Scr...
13,027
<p>I'm getting odd results from a <code>MySQL SELECT</code> query involving a <code>LEFT JOIN</code>, and I can't understand whether my understanding of <code>LEFT JOIN</code> is wrong or whether I'm seeing a genuinely odd behavior.</p> <p>I have a two tables with a many-to-one relationship: For every record in <code>...
<p>You need to <code>GROUP BY d.dateID</code>. In two of your cases, <code>s.DateID</code> is <code>NULL</code> (<code>LEFT JOIN</code>) and these are combined together.</p> <p>I think you will also find that this is invalid (ANSI) SQL, because d.date is not part of a <code>GROUP BY</code> or the result of an aggrega...
<p>replace GROUP BY s.dateID with d.dateID.</p>
25,158
<p>What is the c# equivalent of the following c++:</p> <pre><code>srand((unsigned)(time(NULL))); weight=(double)(rand())/(RAND_MAX/2) - 1; </code></pre>
<p>To do random value generation in .NET, you should use the Random class. to seed it with a time value, use: Random rand = new Random((int)DateTime.Now.Ticks);</p> <p>For further specifics, it's best to check out the docs about the Random class in the MSDN, e.g. which methods are available. </p>
<p>To do random value generation in .NET, you should use the Random class. to seed it with a time value, use: Random rand = new Random((int)DateTime.Now.Ticks);</p> <p>For further specifics, it's best to check out the docs about the Random class in the MSDN, e.g. which methods are available. </p>
48,028
<p>Can someone describe what a symbol table is within the context of C and C++?</p>
<p>There are two common and related meaning of symbol tables here.</p> <p>First, there's the symbol table in your object files. Usually, a C or C++ compiler compiles a single source file into an object file with a .obj or .o extension. This contains a collection of executable code and data that the linker can proces...
<p>Symbol table is an important data structure created and maintained by compilers in order to store information about the occurrence of various entities such as variable names, function names, objects, classes, interfaces, etc.</p>
9,458
<p>I have a <code>Person</code> model that has a foreign key relationship to <code>Book</code>, which has a number of fields, but I'm most concerned about <code>author</code> (a standard CharField).</p> <p>With that being said, in my <code>PersonAdmin</code> model, I'd like to display <code>book.author</code> using <c...
<p>As another option, you can do look ups like:</p> <pre><code>class UserAdmin(admin.ModelAdmin): list_display = (..., 'get_author') def get_author(self, obj): return obj.book.author get_author.short_description = 'Author' get_author.admin_order_field = 'book__author' </code></pre> <p>Since...
<p>AlexRobbins' answer worked for me, except that the first two lines need to be in the model (perhaps this was assumed?), and should reference self:</p> <pre><code>def book_author(self): return self.book.author </code></pre> <p>Then the admin part works nicely.</p>
19,806
<p>Could you give some guidance for good resources (books, online tutorials) about embedded assembly in C/C++ for windows?</p>
<p>I believe what you're asking about is called inline assembler, not embedded. You can include inline assembly code using the __asm keyword in C/C++. See <a href="http://msdn.microsoft.com/en-us/library/4ks26t93(VS.80).aspx" rel="nofollow noreferrer">MSDN inline assembler article</a> for some info.</p>
<p>This is one of the best win32 assembly sites around: <a href="http://win32assembly.online.fr/" rel="nofollow noreferrer">http://win32assembly.online.fr/</a></p>
44,504
<p>Why is that Web Service files (.asmx) have their code-behind placed in app_code folder by default unlike the regular .aspx files?</p>
<p>It is unusual to call non-lisp code from lisp, and rarely necessary. CLX (the X11 client implementation for CL) doesn't link to the Xlib implementation but "speaks" X11 directly. On any system, your CL implementation is likely to already have excellent operating system hooks rendering this unnecessary.</p> <p>That ...
<p><a href="http://common-lisp.net/project/cffi/" rel="nofollow noreferrer">CFFI</a>!</p>
49,667
<p><strong>EDITED (after 1st answer):</strong></p> <p>Can anyone help by pointing to some good references for the creation and presentation of a 3D environment (a real room) on a website.</p> <p>Ideally it will not involve too much expense or too high a learning curve as this is a one off requirement for a small proj...
<p><a href="http://en.wikipedia.org/wiki/VRML" rel="nofollow noreferrer">VRML</a>, <a href="https://java3d.dev.java.net/" rel="nofollow noreferrer">Java3D</a>, or Flash depending on how adventurous you are.</p> <p>See <a href="http://www.papervision3d.org/" rel="nofollow noreferrer">Papervision3D</a> (<a href="http://...
<p>Check the stores and gallery i'm operating at <a href="http://enjoy3d.com" rel="nofollow noreferrer">enjoy3d.com</a> .. They use various implementations of Papervision3D. I have developed a toolset and art-pipeline that allows me to create a rich immersive environment in less than a week. And I am currently working ...
23,998
<p>I have a structure like this:</p> <pre><code>&lt;ul&gt; &lt;li&gt;text1&lt;/li&gt; &lt;li&gt;text2&lt;/li&gt; &lt;li&gt;text3&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>How do I use javascript or jQuery to get the text as an array?</p> <pre><code>['text1', 'text2', 'text3'] </code></pre> <p>My plan after this...
<pre><code>var optionTexts = []; $("ul li").each(function() { optionTexts.push($(this).text()) }); </code></pre> <p>...should do the trick. To get the final output you're looking for, <code>join()</code> plus some concatenation will do nicely:</p> <pre><code>var quotedCSV = '"' + optionTexts.join('", "') + '"'; </cod...
<p>You may do as follows. one line of code will be enough </p> <ul> <li><code>let array = $('ul&gt;li').toArray().map(item =&gt; $(item).html());</code></li> <li><p>Get the interested element</p> <ol> <li><p>get children</p></li> <li><p>get the array from toArray() method</p></li> <li><p>filter out the results yo...
30,674
<p>Closed as exact duplicate of <a href="https://stackoverflow.com/questions/145856">this question</a>.</p> <p>I have an array/list of elements. I want to convert it to a string, separated by a custom delimitator. For example:</p> <pre><code>[1,2,3,4,5] =&gt; "1,2,3,4,5" </code></pre> <p>What's the shortest/esiest w...
<pre><code>String.Join(",", arr.Select(p=&gt;p.ToString()).ToArray()) </code></pre>
<pre><code>String.Join(",", array.Select(o =&gt; o.ToString()).ToArray()); </code></pre>
49,889
<p>You could very well leave out "as a technical lead", but I think it puts the situation into context. I'm a technical lead, we're building a new app, and I have an idea of the language I would like the team to use. If one or more want to use a different language (out of personal preference), is it appropriate for me ...
<p>I don't think you need to "reject it out of preference". You need to determine the root cause for why it isn't a preference of yours and reject it for those reasons.</p> <p>If you can rationalize your decision with those reasons, you'll sound more credible to your reports as well as having good documentable reason...
<p>It should be the team's decision.</p>
47,736
<p>Would it be useful to include the class name and variable name in any NullPointerException message? I know that it might not always be possible because of changes made by a JIT but is seems like the info should be available often (class members, etc).</p> <p>From: <a href="http://jamesjava.blogspot.com/2005/04/wha...
<p>That depends. If you get the stack trace, it is clear what class threw the exception. This usually leads to making sure your environment will give you stack traces when there are unhanded exceptions.</p>
<p>Are you throwing <code>NullPointerException</code>? I think you should probably do <code>null</code> validation in the code. I would also consider using open source logging tools like <code>Log4J</code>.</p>
12,453
<p>I'm looking for a bare bones simple example C app for unpacking a zip file using zlib. It must support fairly new version of .zip and must have source right down to the zlib calls.</p>
<p>The zlib-bin source package on my system (linux) has some example programs called "minizip" and "miniunzip" which shows just that.</p>
<p>The <a href="http://www.zlib.net/zpipe.c" rel="nofollow noreferrer" title="zpipe.c">zpipe.c</a> example on the zlib.net web site is pretty straight forward. There is also a pretty good <a href="http://www.zlib.net/zlib_how.html" rel="nofollow noreferrer" title="description">description</a> of what it does.</p>
43,098
<p>I'm planning to write gateway web application, which would need "terminal window" with VT100/ANSI escape code support. Are there any AJAX based alternatives for such a task?</p> <p>I'm thinking something like this: <a href="http://tryruby.hobix.com/" rel="noreferrer">http://tryruby.hobix.com/</a></p> <p>My preferr...
<p>Try</p> <p><a href="http://wiki.kartbuilding.net/index.php/Anyterm" rel="noreferrer">AnyTerm</a></p> <p><a href="http://wiki.kartbuilding.net/index.php/Ajaxterm" rel="noreferrer">AjaxTerm</a></p> <p><a href="http://www-personal.umich.edu/~mressl/webshell/" rel="noreferrer">WebShell</a></p>
<p>AjaxTerm has a terminal, with mostly felicitous terminal emulation, done on the Python backend (it just pushes display updates to the client Javascript).</p> <p>The <a href="http://antony.lesuisse.org/qweb/trac/wiki/AjaxTerm" rel="nofollow noreferrer">AjaxTerm</a> website has been down for some time, but you can st...
30,351
<p>I have an Apex class (controller) originally developed under Developer Edition and need to upload it to production which is Enterprise Edition.</p> <p>The upload fails with following message</p> <pre><code>classes/RenewalController.cls(RenewalController):An error occurred on your page. package.xml(RenewalControll...
<p>Controller class may reference other custom SalesForce objects like pages. If controller is uploaded before these objects <em>Save error: An error occurred on your page.</em> is reported.</p> <p>Correct order of uploading of custom components should be used.</p>
<p>Controller class may reference other custom SalesForce objects like pages. If controller is uploaded before these objects <em>Save error: An error occurred on your page.</em> is reported.</p> <p>Correct order of uploading of custom components should be used.</p>
12,927
<p>Because of several iframes, XUL browser elements, and so forth, I have a number of window objects in my XULRunner application. I'm looking for the best way to find the window object that a specified node belongs to using JavaScript.</p> <p>So, to be more specific, given node x, I need to find the specific window ob...
<p>+1 to your question, it was exactly what I was looking for and thanks for the hint given directly by answering yourself.</p> <p>I Googled a bit and according to <a href="http://www.quirksmode.org/dom/w3c_html.html" rel="noreferrer">http://www.quirksmode.org/dom/w3c_html.html</a> cross-browsers tables I think the ri...
<p>You may want to use <strong>self</strong>. self is a reference to the current document.</p> <p><strong>From within the iframe:</strong></p> <pre><code>&lt;body&gt; &lt;div id="example"&gt;Example!&lt;/div&gt; &lt;script type="text/javascript"&gt; window.onload = function () { var exampleNode = documen...
27,668
<p>I am working on adding in a settings bundle for my application as a cheap way of getting a GUI on my preferences. Is it possible to launch this from a button in my application or will my users always have to access it manually via the built in settings application?</p>
<p>They may have to go to the settings application, depending on how you do it.</p> <p>See <a href="http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Introduction/chapter_1_section_1.html" rel="nofollow noreferrer">this document,</a> the Applications Preferences section....
<p>No, you can't--they'll have to exit your app and launch settings. It's a pain, and as stated above, a design decision you'll have to make.</p>
43,589
<p>I am currently working in C/C++ in a Unix environment and am new to Linux environments. I would like to learn about the Linux OS and learn C# as the next level of programming language for my career.</p> <p>I decided to put Ubuntu Linux on my laptop. But I am not sure whether we can write, compile and run C# program...
<p>Learn <a href="http://www.mono-project.com/Main_Page" rel="noreferrer">Mono</a>.</p> <blockquote> <p>The Mono Project is an open development initiative sponsored by Novell to develop an open source, UNIX version of the Microsoft .NET development platform. Its objective is to enable UNIX developers to bu...
<p>A Vista virtual machine in seamless mode running Visual Studio? Then it will appear to integrate into your desktop like any other app, but you'll have the benefit of running the real MS stuff (with C#, having real MS is still a benefit rather than a liability).</p>
34,176
<p>Working with Microsoft SQL Server I found extremely useful SQL Server Profiler and Estimated Execution Plan (available in Management Studio) to optimize queries during development and production system monitoring.</p> <p>Are there similar tools (open source or commercial) or techniques available for MySQL?</p>
<p>You can get information about how a query will execute using <a href="http://dev.mysql.com/doc/refman/5.0/en/explain.html" rel="nofollow noreferrer"><code>EXPLAIN</code></a>.</p> <p>For example:</p> <pre><code>EXPLAIN SELECT * FROM foo INNER JOIN bar WHERE foo.index = 1 AND bar.foo_id = foo.id </code></pre> <p>It...
<p>As RoBorg suggests, you can use EXPLAIN to show the details of how MySQL will execute your query. I found <a href="http://dev.mysql.com/doc/refman/5.0/en/using-explain.html" rel="nofollow noreferrer">this article</a> more useful, as it tells you how to interpret the results and improve your SQL.</p> <p>Also helpful...
43,649
<p>I'm running a PL/SQL block that is supposed to be calling a stored procedure who's output parameters are supposed to be populating variables in the PL/SQL block.</p> <p>The procedure compiles, and the PL/SQL block runs successfully. But I'd like to check the values of the variables populated by the procedure. Is th...
<pre><code>dbms_output.put_line(varHere); </code></pre>
<p>A fourth option (the one I usually default to) also exists.....logging debugging messages to a database table. This gives you the advantage of being able to sort, query, filter your debug messages as required.</p> <p>As darreljnz mentioned above, log4plsql also probably supports logging to the database. I find th...
31,773
<p>How does unix handle full path name with space and arguments ?<br> In windows we quote the path and add the command-line arguments after, how is it in unix?</p> <pre><code> "c:\foo folder with space\foo.exe" -help </code></pre> <p><strong>update:</strong></p> <p>I meant how do I recognize a path from the command ...
<p>You can either quote it like your Windows example above, or escape the spaces with backslashes:</p> <pre><code> "/foo folder with space/foo" --help /foo\ folder\ with\ space/foo --help </code></pre>
<p>If the normal ways don't work, trying substituting spaces with <code>%20</code>.</p> <p>This worked for me when dealing with SSH and other domain-style commands like <code>auto_smb</code>.</p>
7,358
<p>I have a Java array such as: </p> <pre><code>String[] arr = new String[] {"123","doc","projectReport.doc"}; </code></pre> <p>In my opinion the natural way to access would be: </p> <pre><code> #set($att_id = $arr[0]) #set($att_type = $arr[1]) #set($att_name = $arr[2]) </code></pre> <p>But that it is not working...
<p>You can use use Velocity 1.6: for an array named <code>$array</code> one can simply do <code>$array.get($index)</code>.</p> <p>In the upcoming Velocity 1.7, one will be able to do <code>$array[$index]</code> (as well as <code>$list[$index]</code> and <code>$map[$key]</code>).</p>
<p>I ended up using the <a href="http://velocity.apache.org/tools/releases/1.4/javadoc/org/apache/velocity/tools/generic/ListTool.html" rel="nofollow noreferrer">ListTool</a> from the velocity-tools.jar. It has methods to access an array's elements and also get its size.</p>
23,304
<p>Does anybody have a system that they use to maintain the same eclipse configuration between computers? How well does it work?</p> <p>I am getting to a point where I have a reasonable setup to get a new Eclipse installation to the same point as my others, and I miss the emacs functionality of having all your custom...
<p>If you want to go with the preconfigured distribution, but still want to let your developers choose, which plugins from a restricted set of plugins to install additionally, then its worth to create a company internal update site, which <strong>mirrors selected features</strong> and plugins, so your developers can in...
<p>We do not have <em>exactly</em> a common eclipse configuration but rather a common eclipse <strong>distribution</strong>.</p> <p>A new developer copy that distribution, and launches it through a custom "eclipse.exe" which:</p> <ul> <li>calls a script checking if there is any in-house updates I have set up since th...
45,801
<p>I'm writing a <a href="http://en.wikipedia.org/wiki/Windows_Forms" rel="noreferrer">Windows Forms</a> application which is supposed to play three sound files and at the end of each sound file, it's to change the source of an image.</p> <p>I can get it to play the sounds using <code>System.Media.SoundPlayer</code>. ...
<p>Did you try <a href="http://msdn.microsoft.com/en-us/library/system.media.soundplayer.playsync.aspx" rel="noreferrer">SoundPlayer.PlaySync Method</a>? From the help:</p> <blockquote> <p>The PlaySync method uses the current thread to play a .wav file, preventing the thread from handling other messages until ...
<p>What you probably want to do is do an async sound, but then disable your UI in such a way that it doesn't respond to user response. Then once the sound is played, you re-enable your UI. This would allow you to still paint the UI as normal.</p>
17,910
<p>I'm executing the following query:</p> <pre><code>Select guiPolygonID, dbo.fn_Yval(p1X, p1Y, p2X, p2Y, 4.003318) From [vPolygonSegments] Where dbo.fn_Yval(p1X, p1Y, p2X, p2Y, 4.003318) &gt; 0 </code></pre> <p>The important parts of function fn_Yval (all params are of type float):</p> <pre><code>set @m = (@p2Y - @...
<p>The problem here is that the function in the select cause is evaluated before the function in the where clause is evaluated. This condition is very rare, but it is possible, so you need to code against it. I would suggest that you modify the function so that it can safely handle divide by zero circumstances. Chan...
<p>I don't know that this will answer the question in any way, but you're evaluating fn_Yval twice for each record. Why not make the result of the function a column in the view? Then, your where clause could be something like "where Yval > 0".</p> <p>Edit: Out of curiosity, fn_Yval doesn't have any side effects, doe...
49,124
<p>I thought they could be, but as I'm not putting my money where my mouth was (so to speak) setting the readonly attribute doesn't actually seem to do anything.</p> <p>I'd rather not use Disabled, since I want the checked check boxes to be submitted with the rest of the form, I just don't want the client to be able t...
<p><code>READONLY</code> doesn't work on checkboxes as it prevents you from editing a field's <em>value</em>, but with a checkbox you're actually editing the field's <em>state</em> (on || off)</p> <p>From <a href="http://www.faqs.org/docs/htmltut/forms/_INPUT_DISABLED.html" rel="noreferrer">faqs.org</a>:</p> <blockqu...
<p>No, but you might be able to use javascript events to achieve something similar</p>
18,777
<p>Does anyone have a simple, efficient way of checking that a string doesn't contain HTML? Basically, I want to check that certain fields only contain plain text. I thought about looking for the &lt; character, but that can easily be used in plain text. Another way might be to create a new System.Xml.Linq.XElement ...
<p>The following will match any matching set of tags. i.e. &lt;b>this&lt;/b></p> <pre><code>Regex tagRegex = new Regex(@"&lt;\s*([^ &gt;]+)[^&gt;]*&gt;.*?&lt;\s*/\s*\1\s*&gt;"); </code></pre> <p>The following will match any single tag. i.e. &lt;b> (it doesn't have to be closed).</p> <pre><code>Regex tagRegex = new R...
<p>Beware when using the HttpUtility.HtmlEncode method mentioned above. If you are checking some text with special characters, but not HTML, it will evaluate incorrectly. Maybe that's why J c used "...depending on how strict you want the check to be..."</p>
25,056
<p>There must be an easy way to do this, but somehow I can wrap my head around it. The best way I can describe what I want is a lambda function for a class. I have a library that expects as an argument an uninstantiated version of a class to work with. It then instantiates the class itself to work on. The problem is th...
<p>Does the library really specify that it wants an "uninitialized version" (i.e. a class reference)?</p> <p>It looks to me as if the library actually wants an object factory. In that case, it's acceptable to type:</p> <pre><code>lib3 = Library(lambda: Multiply(5)) </code></pre> <p>To understand how the lambda work...
<pre><code>def mult(x): def f(): return Multiply(x) return f op3 = mult(5) lib3 = Library(op3) print lib3.Op(2) </code></pre>
47,032
<p>I'm trying to understand the best way to get the connection to my databases.</p> <p>At the moment I've got a method which parses the URL (depending on the URL called the application has to connect to a different database, like customer1.example.com will connect to the customer1 database) and calls </p> <pre><code>...
<p>Are the databases on the same server?</p> <p>I have a application where some of the model objects are from one database and others are from a different database. I override the table_name function to specify the database. Won't work if they are different servers but will work for different databases in the same s...
<p>I'm not a Ruby programmer, but generally speaking a connection pool is a good idea. You can make that connection pool a singleton and hand out/take back connections. The pool can check after taking back a connection whether everything is still in order. </p> <p>You should have a distinct life cycle and ownership fo...
20,171
<p>How do I use the UNIX command <code>find</code> to search for files created on a specific date?</p>
<p>As pointed out by Max, you can't, but checking files modified or accessed is not all that hard. I wrote a <a href="http://virtuelvis.com/2008/10/how-to-use-find-to-search-for-files-created-on-a-specific-date/" rel="noreferrer">tutorial</a> about this, as late as today. The essence of which is to use <code>-newerXY<...
<p>I found this scriplet in a script that deletes all files older than 14 days:</p> <pre><code>CNT=0 for i in $(find -type f -ctime +14); do ((CNT = CNT + 1)) echo -n "." &gt;&gt; $PROGRESS rm -f $i done echo deleted $CNT files, done at $(date "+%H:%M:%S") &gt;&gt; $LOG </code></pre> <p>I think a little additio...
19,106
<p>I have an old server with a defunct evaluation version of SQL 2000 on it (from 2006), and two databases which were sitting on it.</p> <p>For some unknown reason, the LDF log files are missing. Presumed deleted.</p> <p>I have the mdf files (and in one case an ndf file too) for the databases which used to exist on t...
<p>I found this answer, which worked with my SQL 2000 machines:</p> <p><strong>How to attach a database with a non-cleanly detached MDF file.</strong></p> <p><strong>Step 1:</strong> Make a new database with same name, and which uses the same files as the old one on the new server.</p> <p><strong>Step 2:</strong> St...
<p>In Enterprise Manager, right-click the server and choose Attach Database. Select the MDF file and click Ok. It will then ask you if you want to create a new log file or not. Say Yes.</p>
15,398
<p>I have a function, <code>a()</code>, that I want to override, but also have the original <code>a()</code> be performed in an order depending on the context. For example, sometimes when I'm generating a page I'll want to override like this:</p> <pre><code>function a() { new_code(); original_a(); } </code></p...
<p>You could do something like this:</p> <pre><code>var a = (function() { var original_a = a; if (condition) { return function() { new_code(); original_a(); } } else { return function() { original_a(); other_new_code(); } ...
<p>I had some code written by someone else and wanted to add a line to a function which i could not find in the code. So as a workaround I wanted to override it.</p> <p>None of the solutions worked for me though.</p> <p>Here is what worked in my case:</p> <pre><code>if (typeof originalFunction === "undefined") { ...
37,935
<p>I'm using MS Sql 2005.</p> <p>Why does this give me the correct results (returns 169 rows)...</p> <pre><code>select * from [import_Data] where [import_Data].name not in ( select [import_Data].name from [import_Data] inner join [resource] on [import_Data].name = [resource]...
<p>My guess is that there is a null resource.name in your resource table which is throwing all the comparisons off. Why do nulls cause a problem? Per "Guru's Guid to TSQL" and I'm paraphrasing "ANSI guidelines state that an expression that compares a value for equality to NULL always returns NULL." So any null in the...
<p>You probably have a <code>null</code> in the <code>name</code> column of the <code>[resource]</code> table somewhere. The behaviour of <code>=</code> and <code>not in</code> are different when nulls are involved.</p> <p>Try:</p> <pre><code>select * from [resource] where name is null and IsDeleted = 0 </code></pre>...
44,406
<p>I can use CreateProcess to launch an EXE. I want to have the contents of an EXE in a memory buffer and do CreateProcess (or an equivalent) on it without having to write it to a file. Is there any way to do that?</p> <p>The backstory : we make games. We send a plain EXE to our distributors, which then wrap it using ...
<p>It's actually quite easy. Similar technique has been described in a paper I read like 3 years ago.</p> <p>Windows allow you to call the <a href="http://msdn.microsoft.com/en-us/library/ms682425.aspx" rel="noreferrer">CreateProcess</a> function with <strong>CREATE_SUSPENDED</strong> flag, that tells the API to keep ...
<p>Look at <a href="http://boxedapp.com/boxedappsdk/" rel="nofollow noreferrer">BoxedAppSDK</a></p> <p>It supports launching exe from a memory buffer.</p> <p>hope it helps.</p>
39,247
<p>Recently our site has been deluged with the resurgence of the <a href="https://en.wikipedia.org/wiki/Asprox_botnet" rel="noreferrer">Asprox botnet</a> <a href="http://en.wikipedia.org/wiki/SQL_injection" rel="noreferrer">SQL injection</a> attack. Without going into details, the attack attempts to execute SQL code by...
<p>I went back to Michael's post, did some more poking and realized that I did need to do a double conversion, and eventually worked out this little nugget:</p> <pre><code>Convert.ToString(Convert.ToChar(Int32.Parse(EncodedString.Substring(intParseIndex, 2), System.Globalization.NumberStyles.HexNumber))); </code></pre...
<p>Try removing the <code>0x</code> first and then call <code>Encoding.UTF8.GetString</code>. I think that may work.</p> <p>Essentially: 0x44004500</p> <p>Remove the 0x, and then always two bytes are one character:</p> <pre><code>44 00 = D 45 00 = E 6F 00 = o 72 00 = r </code></pre> <p>So it's definitely a Unico...
2,256
<p>I've found a few pages (some that even link to a number of other pages) on the Microsoft website that I bookmarked last night for reading today, but I'm curious as to other good non-Microsoft resources for discussing ASP.NET web applications, both Forms and MVC (including comparisons/contrasts between the two).</p>
<p>Keep your eye out on the MVC forums, read up on blogs:</p> <ul> <li><a href="http://haacked.com" rel="nofollow noreferrer">Phil Haack</a></li> <li><a href="http://computerzen.com" rel="nofollow noreferrer">Scott Hanselman</a></li> <li><a href="http://blog.wekeroad.com" rel="nofollow noreferrer">Rob Conery</a></li> ...
<p><a href="http://haacked.com/" rel="nofollow noreferrer">Phil Haack's blog</a> seems to be a good source. He's an insider and can tell you the tricks there are to know. In the end it all depends on how you prefer to learn - some people like videos, others prefer books. For me the best way is to learn by doing it. So ...
37,778
<p>We're moving to cheap office space that provides a lot of stuff: receptionist, copiers, printers, microwave and internet access - all of it shared with strangers.</p> <p>What should I ask to find out if the network is safe to use, and if it's not inherently safe, what can I do to make it safe?</p>
<p>Consider it a hostile network if you share it with strangers.</p> <p>You can put your own section of the network behind a firewall, so the rest of the office is outside. You might have to have your own printer for that though.</p> <p>To set up such a firewall, you would have to only use one of the office network c...
<p>A good hardware Firewall would be an excellent investment for the company, but might be a little rich for one person. <a href="http://www.download.com/Comodo-Firewall-Pro/3000-10435_4-10750532.html" rel="nofollow noreferrer">Comodo</a> firewall can be set to a paranoid level, even locking down the registry, and is f...
28,591
<p>I have a char in c#:</p> <pre><code>char foo = '2'; </code></pre> <p>Now I want to get the 2 into an int. I find that Convert.ToInt32 returns the actual decimal value of the char and not the number 2. The following will work:</p> <pre><code>int bar = Convert.ToInt32(new string(foo, 1)); </code></pre> <p>int.pa...
<p>Interesting answers but the docs say differently:</p> <blockquote> <p>Use the <code>GetNumericValue</code> methods to convert a <code>Char</code> object that represents a number to a numeric value type. Use <code>Parse</code> and <code>TryParse</code> to convert a character in a string into a <code>Char</...
<p>This worked for me:</p> <pre><code>int bar = int.Parse("" + foo); </code></pre>
29,580
<p>When I debug my ASP.NET web site code using the Microsoft debug symbol's for .NET .. I keep getting this silly 'result' for most of the variables when I'm debugging .NET framework code (which of course is provided by the Microsoft Symbol Server, which I told VS2008 to grab the info, from)</p> <pre><code>Cannot obta...
<p>Shawn Burke described a method of disabling this on his <a href="http://blogs.msdn.com/sburke/archive/2008/01/29/how-to-disable-optimizations-when-debugging-reference-source.aspx" rel="noreferrer">blog</a>. </p> <p>First, create a CMD that'll load Visual Studio without JIT optimization.</p> <pre><code>set COMPLUS_...
<p>Finally, this solution worked for me when attaching to the aspnet_wp.exe Visual Studio 2008, .NET framework 2.0 : go into the project properties, into Build tab, Advanced button -> set Output Debug Info to "full". Hope this helps someone.</p>
37,625
<p>In PHP, how can I replicate the expand/contract feature for Tinyurls as on search.twitter.com?</p>
<p>If you want to find out where a tinyurl is going, use fsockopen to get a connection to tinyurl.com on port 80, and send it an HTTP request like this</p> <pre><code>GET /dmsfm HTTP/1.0 Host: tinyurl.com </code></pre> <p>The response you get back will look like</p> <pre><code>HTTP/1.0 301 Moved Permanently Connecti...
<p>Another simple and easy way:</p> <pre><code>&lt;?php function getTinyUrl($url) { return file_get_contents('http://tinyurl.com/api-create.php?url='.$url); } ?&gt; </code></pre>
8,769
<p>Netbeans is great but there's no way to wrap text in it (or hopefully I haven't found it yet). Is there any way to do this, and if not, is there any similarly good IDE for Java with this functionality (hopefully free as well).</p>
<p>You can use word wrap in Netbeans.</p> <p>Add the following to netbeans.conf (netbeans_installation_path/etc/netbeans.conf, by default /etc/netbeans.conf under linux):</p> <pre><code>-J-Dorg.netbeans.editor.linewrap=true </code></pre> <p>to the sixth line so it looks like this:</p> <pre><code>netbeans_default_op...
<p>Get a bigger monitor. </p> <p>At 1920 x 1080 you don't need no steenkin word-wrap.</p> <p><strong>Update:</strong> Wow, still getting downvotes. Maybe it's just how I said it. At least it hasn't caught up to the Eclipse answer yet. </p> <p>I really thought this was a legitimate suggestion. I never thought that ha...
31,927
<p>I have a form with a few buttons which execute code when pressed like running validations on the database.</p> <p>Some code can run for a few minutes so is there any way to show the time remaining or a message to display the % of process completed?</p> <p>Or pop out a message when code evaluation starts and the me...
<p>What you are probably looking for is a "Progress Bar".</p> <p>I've used the Microsoft ProgressBar control (you can find it under Insert->ActiveX Control), and it's not that hard to use. Just set the value of it to a percentage (as an integer, not a decimal).</p> <pre><code>'foo, being the ProgressBar me.foo = 70 '...
<p>In order to do this the "normal" way, you'd need to run your validation in another thread and have it report its progress back to the UI thread. However, I don't believe VBA supports any kind of multithreading.</p> <p>If your validation routines involve a loop, or even just many separate discrete operations, you c...
43,737
<p>When I do a cvs status, I see working revision and repository revision numbers. What is the difference between the two, or rather, what do they mean?</p>
<p>the <em>working revision</em> is just the revision you are currently using. the <em>repository revision</em> is the revision currently in the repository.</p> <p>basically, if the <em>repository revision</em> is larger than your <em>working revision</em>, someone has committed changes to that file, and perhaps you s...
<p>Thanks, that makes sense... except: Say I have a file A.java, latest revision is 1.10. I do a cvs up -r1.9 A.java. cvs status shows both working and repository revision to be 1.9...</p> <p>What's going on??</p>
38,990
<p>Below is the code that i cannot get to work. I know i have established a connection to the database but this returns nothing. What am i doing wrong?</p> <pre><code>$result = "SELECT * FROM images WHERE path = ?"; $params = array("blah"); $row = sqlsrv_query($conn, $result, $params); $finished = sqlsrv_fetch_array(...
<p>You may need to replace your ntwdblib.dll as explanied on the <a href="http://www.php.net/manual/en/function.mssql-connect.php" rel="nofollow noreferrer">mssql_connect() page of the php.net manual</a>.</p>
<p>Would it be worth checking that the query is not returning an error?</p> <pre><code>$result = "SELECT * FROM images WHERE path = ?"; $params = array("blah"); $row = sqlsrv_query($conn, $result, $params); if( $row === false ) { print_r(sqlsrv_errors()); } </code></pre>
29,474
<p>I'm looking for someone to explain how to drag and drop in javascript, I want a horizontal line with some customizable images in it.</p> <p>I've had a look at the online tutorials for these but find them very hard to use.</p>
<p>I would recommend that you look into one of the Javascript Frameworks out there. We use <a href="http://www.prototypejs.org/" rel="noreferrer">prototype</a> with scriptaculous. </p> <p>You can look at a demo for Drag and Drop in Scriptaculous <a href="http://github.com/madrobby/scriptaculous/wikis/puzzle-demo" rel=...
<p>the answer is here <a href="https://stackoverflow.com/questions/4911928/jquery-drag-and-drop-div-selection-with-images-and-text/5266416#5266416">jQuery drag-and-drop DIV selection with images and text</a></p> <pre><code>&lt;script type="text/javascript" src="http://www.dynamicdrive.com/dynamicindex11/domdrag/dom-dr...
31,921
<p>What is the best way to have synchronized a collection of objects between various threads in .Net?</p> <p>I need to have a List or Dictionary accessed from different threads in a thread safe mode. With Adds, Removes, Foreachs, etc.</p>
<p>You could implement a lock-free queue:</p> <p><a href="http://www.boyet.com/Articles/LockfreeQueue.html" rel="nofollow noreferrer">http://www.boyet.com/Articles/LockfreeQueue.html</a></p> <p>Or handle the synchronization yourself using locks:</p> <p><a href="http://www.albahari.com/threading/part2.html#_Locking" ...
<p>Hashtable.Synchronized method returns a synchronized (thread safe) wrapper for the Hashtable.</p> <p><a href="http://msdn.microsoft.com/en-us/library/system.collections.hashtable.synchronized(VS.80).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.collections.hashtable.synchronized(VS....
11,987
<p>OK, so things have progressed significantly with my DSL since I asked <a href="https://stackoverflow.com/questions/82776/how-do-i-reference-a-diagram-in-a-dsl-t4-template">this question</a> a few days ago.</p> <p>As soon as I've refactored my code, I'll post my own answer to that one, but for now, I'm having anothe...
<p>I've recently faced a related problem, and managed to make it work, so here's the story.</p> <p>The task I was implementing was to load and display a domain model and an associated diagram generated by ActiveWriter's DSL package. </p> <p>Here's how I've implemented the required functionality (all the methods below...
<p>Maybe my answer is a little bit too late, but did you confirm using DSL Explorer that your compartments have items?</p>
13,097
<p>What is the best script to use for showing the current visitors or guests Online?</p> <p>Thanks!</p>
<p>As @Ryan Smith suggested, this greatly depends on the implementation details of the website. I'm sure that there is a off-the-shelf framework offering a storefront application with all the bells and whistles (such as the types of scripts you are mentioning); however, these can range anywhere from being free and open...
<p>I think it all depends on how your tracking who's online within your application.</p> <p>Usually, when someone logs-in, you create a session for them that you could iterate through based on whatever language you are using.</p> <p>You have to keep in mind that HTTP is a stateless environment, so determining when so...
47,180
<p>I have a ComboBox that I bind to a standard HTTPService, I would like to add an event listener so that I can run some code after the ComboBox is populated from the data provider.</p> <p>How can I do this?</p>
<p>Flex doesn't have a specific data-binding events in the way that say ASP .Net does. You have to watch for the dataProvider property like John says in the first answer, but not simply to the combobox or its dataProvider property. Let's say you have a setup like this:</p> <pre><code>&lt;!-- Assume you have extracted ...
<p>You can use <code>BindingUtils</code> to get notified when the <code>dataProvider</code> property of the combo box changes:</p> <pre><code>BindingUtils.bindSetter(comboBoxDataProviderChanged, comboBox, "dataProvider"); </code></pre> <p><code>BindingUtils</code> lives in the <code>mx.binding.utils</code> package.</...
4,605
<p>Other than the fact that <strong>ASP.NET MVC Web Application</strong> has more clarity in its implementation of the MVC pattern and that it strictly follows the MVC pattern, how is it different from <strong>ASP.NET Web Application</strong>?</p> <p>If you make your <strong>ASP.NET Web Application</strong> have a <st...
<p>This recent question may address your concerns: <a href="https://stackoverflow.com/questions/267924/how-does-the-mvc-pattern-differ-if-at-all-from-the-dal-bll-design-pattern">How does the MVC pattern differ, if at all, from the DAL / BLL design pattern?</a></p>
<p>It takes a bit more experience, discipline and work to design an ASP.NET MVP Web Application so that your application supports test automation. When you can slap an advanced GridView onto a page along with a SqlDataSource and bind it directly to a stored procedure you throw your test automation out the window.</p> ...
34,830
<p>I'm looking at developing a simple validation framework for WPF (the IDataErrorInfo method doesn't provide enough info for my needs), and am wondering if there is a way to be notified when a Property is going to validate? Please note that I need to know any time it is going to attempt validation rather than only whe...
<p>The problem you are going to run into is that WPF databinding and validation are tied to the IDataErrorInfo interface. The bindings check for validation based on the UpdateSourceTrigger property of the binding. So if your binding has "UpdateSourceTrigger=PropertyChanged" then everytime the property changes it calls ...
<p>You need to look into inheriting from ValidationRule and then adding the new rule to all you binding objects.</p>
44,480
<p>I'm trying to get more acquainted with problems that require Graphs to be solved (are are best solved by graphs). </p> <p>If someone has an old ACM Programming Competition problem that utilized graphs, or have another problem that they found particularly enlightening as they worked it out I would appreciate it. I...
<p>To get a better grasp of operations on graph, you might want to just implement some known <a href="http://en.wikipedia.org/wiki/Graph_theory#Algorithms" rel="nofollow noreferrer">Graph algorithms</a>.</p> <p>Try implementing a <a href="http://en.wikipedia.org/wiki/Nurikabe" rel="nofollow noreferrer">Nurikabe</a> so...
<p>You don't say what language you are using (thinking of using). If I may, I'd suggest Lisp or Python. They're both good for easy graph manipulation. If you want to be really fancy, you might want to create a pretty output using PyGame.</p> <p>As for problem, have a look at a simple program and convert it into a g...
18,894
<p>I've just bought my first 3D printer (Malyan M200 V2). For the most part, it's been really good and I've had no issues, apart from when printing the first few layers the printer doesn't seem to extrude enough material and doesn't form the correct shape. Whether it's a circle, rectangle, or anything else. So for exam...
<p>PLA doesn't need a raft.</p> <p>Try printing without a raft. If you print with a raft because of adhesion problems, solve those first. A raft is only needed for filaments that shrink a lot and/or are printing at very high temperatures.</p> <p>If you want a raft, check the distance between raft and print object and k...
<p>In Cura, you can indeed set the height of the first layer separate from the subsequent layers. So if the first layer is printing nicely, that's a good sign. That's usually the place prints fail. There are a few settings, but here are a few things to just double check:</p> <ul> <li>Is your nozzle set to the right siz...
2,176