input
stringlengths
51
42.3k
output
stringlengths
18
55k
Can you force activerecord associations to update without saving them? <p>I have a couple models which are associated with the <code>has_many</code> <code>belongs_to</code> pair. For the sake of demonstration, a client has one server but a server has many clients. I might do something like this:</p> <pre><code>clien...
<p>Call <code>#reload</code> on the objects to update them.</p>
Javascript: Why compare with null? <p>An open source JavaScript project I work on includes code:</p> <pre><code>if (color) { tapeDiv.style.backgroundColor = color; // set color here if defined by event. Else use css } </code></pre> <p>A contributor wants to change it to </p> <pre><code>if (color != n...
<p>Evaluate the assignment with all possible falsy values and you'll get your answer:</p> <pre><code>tapeDiv.style.backgroundColor = false; // does nothing tapeDiv.style.backgroundColor = 0; // sets as "black", // but ignored by FF tapeDiv.style.backgroundColor = null; //...
GCC compiler error: "redefinition...previously defined" <p>I'm getting a lot of " redefinition of x....x previously defined here". Please what does this error means?</p>
<p>You need to limit each file from being included only once. You can do this in 2 ways. </p> <p>1) At the top of your header files put:</p> <pre><code>#pragma once </code></pre> <p>Or 2) if your compiler doesn't support that, put at the top/end of your header files:</p> <pre><code>#ifndef _MYFILE_H_ #define _MYFI...
Modifying a type after it has been created with TypeBuilder.CreateType <p>I'm creating a dynamic class in a dynamic assembly at runtime, and want to be able to Define methods for that class on demand.</p> <p>Ex.</p> <ol> <li>Build the Type X</li> <li>Define Method GetA on Type X</li> <li>Create Type X</li> <li>Call G...
<p>You can't create "full" methods (discoverable via reflection) - however, you can use <code>DynamicMethod</code> to associate new IL blocks with a type (primarily for scope etc). But ultimately, what you describe is a job for the DLR in 4.0 (and a language such as Iron Python; C# and VB don't add language support for...
Is it possible to perform checks on what may be an uninitialized variable? <p>I'm working on a recursive method...</p> <pre><code>public BinaryTree&lt;T&gt; TreeMirror ( BinaryTree&lt;T&gt; tree ) { BinaryTree mirror = new BinaryTree(); mirror = clone(tree); ... TreeMirror(...) ... } </code></pre> <p>I...
<p>It's rare to see public recursive functions like that. A better solution might be to have the public method that creates the object, and then calls a private function which is recursive that just makes the necessary changes. </p> <p>It's generally difficult to have the recursive function signature match what you wa...
Why would I want to use jQuery? <p>(I understand that someone else asked a similar question and it was closed as 'argumentative', but I'm really interested in understanding the arguments around this.)</p> <p>I know JavaScript really well. I've been writing it professionally for years. I've internalized a lot of the cr...
<p>There are a few big benefits to using a framework over homegrown/handwritten code:</p> <ul> <li><p><strong>Abstractions</strong>. I'm sure you're very proud of the fact that you've slung enough JS to be able to write animations from scratch. You should be! However, abstracting common functionality away from yoursel...
Simple select nth highest <p>I'm trying to figure out which is the more efficient way to get the nth highest record in a mySQL database:</p> <pre><code>SELECT * FROM table_name ORDER BY column_name DESC LIMIT n - 1, 1 </code></pre> <p>or</p> <pre><code>SELECT * FROM table_name AS a WHERE n - 1 = ( SELECT COUNT...
<p>I tried EXPLAIN on both those queries on a database of mine (note: the optimizer may choose different plans for your schema/data) and it definitely looks like the first one wins in every regard: it's simpler to read and understand, and will most likely be faster. </p> <p>As aaronls said, and EXPLAIN confirms, the ...
PHP Fatal error: Cannot redeclare class <p>Does anyone know what can cause this problem?</p> <pre><code>PHP Fatal error: Cannot redeclare class </code></pre>
<p>You have a class of the same name declared more than once. Maybe via multiple includes. When including other files you need to use something like </p> <pre><code>include_once "something.php"; </code></pre> <p>to prevent multiple inclusions. It's very easy for this to happen, though not always obvious, since you...
How to use HTTP GET request in C# with SSL? (protocol violation) <p>I am currently trying to get a response from a server that is using SSL in C#. I have the code to do this in Java, but it looks like they do not translate 1:1. </p> <p>I do have some code that I found that works for regular pages, but not for the on...
<p>HTTP conversations over SSL use a properly issued certificate for validation. </p> <p>You could use the RemoteCertificateValidationCallback delegate for validating the SSL certificate as follows:</p> <pre><code>public static void ConnectSSL() { WebRequest request = WebRequest.Create("https://" + sslServerHost...
PHP Addslashes adding double backslashes when escaping a single quote <p>Addslashes seems to be a bit confused. Given the following 2 lines of code</p> <pre><code>$name = "Dave's test"; $newName = addslashes($name); </code></pre> <p>I am <em>expecting</em> $newName to be <strong>"Dave\'s test"</strong> (my one singl...
<p>Looks like error_log is calling addslashes internally. After reading the questions posted in reponse to my original question, I created a very trivial script...</p> <pre><code>&lt;?php $name = "Dave's test"; $newName = addslashes($name); echo "name=$name. newName=$newName"; err...
Ruby regular expression help using match to extract pieces of html doc <p>I have an HTML document of this format:</p> <pre><code>&lt;tr&gt;&lt;td colspan="4"&gt;&lt;span class="fullName"&gt;Bill Gussio&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td class="sectionHeader"&gt;Contact&lt;/td&gt; ...
<p>See <a href="http://stackoverflow.com/questions/701166/can-you-provide-some-examples-of-why-it-is-hard-to-parse-xml-and-html-with-a-rege">Can you provide some examples of why it is hard to parse XML and HTML with a regex?</a> for why this is a bad idea. Use an <a href="http://www.google.com/search?q=ruby%2Bhtml%2Bp...
Compiler error with `<<` <p>I've been working on getting this program complete where it saves multiple structs to a file, can read them back and edit them, then save them all back to a file. I've been working on the logic of this not to mention lots of help from others and a ton of googling hours... now I am getting a ...
<p>You have no <code>operator&lt;&lt;</code> defined that would specify how your <code>InventoryItem</code> should be printed to an output stream. You try to print it and the compiler doesn't know how. You need to define a function like this one:</p> <pre><code>std::ostream&amp; operator&lt;&lt;(std::ostream &amp;strm...
C#: Best way to inject CSS into MSHTML instance? <p>I'm trying to inject some CSS that accompanies some other HTML into a C# managed WebBrowser control. I am trying to do this via the underlying MSHTML (DomDocument property) control, as this code is serving as a prototype of sorts for a full IE8 BHO.</p> <p>The proble...
<p>Ended up solving this myself:</p> <pre><code>mshtml.HTMLDocument test = (mshtml.HTMLDocument)webBrowser1.Document.DomDocument; //inject CSS if (test.styleSheets.length &lt; 31) { // createStyleSheet throws "Invalid Argument if >31 stylesheets on page mshtml.IHTMLStyleSheet css = (mshtml.IHTMLStyleSheet)test.c...
Dynamic Compiled Plugins in .NET <p>Is there a possibility that I can put some of my code in non-compiled form with my application and then make changes to it on the fly and the application can then just use the new version onwards?</p> <p>If it is possible (which i secretly know it is using CodeDOM), are there any is...
<p>You've already said you know how to do with with CodeDOM - why not just use that?</p> <p>If you're happy with it being C# code, then <code>CSharpCodeProvider</code> does an admirable job. If you're feeling more adventurous, you might want to consider <a href="http://boo.codehaus.org">Boo</a> - <a href="http://manni...
Migrating / Upgrading NUnit to Team system <p>We are working on a C# windows application that is being upgraded from <strong>.Net</strong> <strong>1.1</strong> to <strong>3.5</strong>. The application uses <strong>NUnit</strong> for <strong>automated testing</strong> and we are in turn changing this to <strong>Team Sys...
<p>Here's how attributes map from NUnit to MSTest</p> <pre><code>[TestFixture] -&gt; [TestClass] [Test] -&gt; [TestMethod] [SetUp] -&gt; [TestInitialize] [TearDown] -&gt; [TestCleanup] [TestFixtureSetUp] -&gt; [ClassInitialize] [TestFixtureTearDown] -&gt; [ClassCleanup] </code></pre> <p>You can consider adding someth...
Getting the logical path in VIM when there's a symlink <p>I have the following setup:</p> <pre><code>mkdir /1 mkdir /1/2 mkdir /1/2/3 ln -s /1/2/3 /1/3 </code></pre> <p>If I do <code>cd /1/3</code>, and then <code>pwd</code>, I get <code>/1/3</code>. If I use <code>pwd -P</code>, I can get <code>/1/2/3</code>, or <co...
<p>It appears you can't, other than via <code>system('pwd -L')</code>. According to the <a href="http://groups.google.com/group/vim%5Fuse/browse%5Fthread/thread/602b96cd5441fb03/751fda406ec5940a?lnk=gst&amp;q=resolve%2Bsymlinks#751fda406ec5940a">vim_use mailing list</a> Vim automatically resolves symlinks nowadays.</p...
What is "tagged memory"? <p>What is "tagged memory" and how does it help in reducing program size?</p>
<p>You may be referring to a <a href="http://en.wikipedia.org/wiki/Tagged_union" rel="nofollow">tagged union</a>, or more specifically a hardware implementation like the tagged architecture used in LISP machines. Basically a method for storing data with type information.</p> <p>In a LISP machine, this was done in-memo...
What is the equivalent of glDrawPixels() in OpenGL ES 1.1? <p>Can anyone tell me the equivalent of <a href="http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=0650&amp;db=man&amp;fname=/usr/share/catman/g_man/cat3/OpenGL/gldrawpixels.z" rel="nofollow"><code>glDrawPixels()</code></a> in OpenGL ES 1.1?</p>
<p>You're forced to use a texture.</p>
vs 2008 javascript intellisense in XML file problem <p>I am trying to get javascript intellisense to work for jQuery in a .xml file. I've already used a custom XSD to provide intellisense for the XML. Under the tag, I have a mixture of HTML and javascript which are enclosed by . And it is all greyed out so no intellis...
<p><a href="http://blogs.msdn.com/webdevtools/archive/2008/11/07/hotfix-to-enable-vsdoc-js-intellisense-doc-files-is-now-available.aspx" rel="nofollow">http://blogs.msdn.com/webdevtools/archive/2008/11/07/hotfix-to-enable-vsdoc-js-intellisense-doc-files-is-now-available.aspx</a></p> <p>This is a hot fix for java scrip...
What are the correspondent of Servlet and Applet in .NET? <p>I am trying to understand what's the correspondent of servlets and applets in .NET but I don't have much experience in JAVA.</p> <p>I am thinking applets could be compared to the silverlight stuff, meaning you code independently from the browser, but then it...
<p>In .Net, HTTP handlers (.ashx) are probably the closest thing to a servlet. As for applets, there isn't a direct equivelent, but siverlight is probably the closest (although its closer to Flash/JavaFX)</p>
Create image with transparent background using GDI+? <p>I'm trying to create an image with a transparent background to display on a web page.<br /> I've tried several techniques but the background is always black.<br /> How can I create a transparent image and then draw some lines on it ?</p>
<p>Call <code>Graphics.Clear(Color.Transparent)</code> to, well, clear the image. Don't forget to create it with a pixel format that has an alpha channel, e.g. <code>PixelFormat.Format32bppArgb</code>. Like this:</p> <pre><code>var image = new Bitmap(135, 135, PixelFormat.Format32bppArgb); using (var g = Graphics.From...
How does Google App Engine compare to web hosting plans? <p>Google App Engine offers free quotas of 1 GB outbound traffic per day and 6.5 CPU-hours (based on a 1.2 GHz Intel x86 processor) per day.</p> <p>How do those free quotas compare to web hosting plans? For example, the traffic supported by the free quotas -- is...
<p>As you say, it depends on a lot. Not just the site you want to host, but who, specifically, you're comparing it to. To give you a rough idea, I host a site that gets from 20k to 30k pageviews a day on App Engine, and it costs me 17c a week. That's for extra storage over the default quota - all other quotas are well ...
Executable dll loading (x32, x64): pick the right one <p>I have a large project with several 3rd party libraries. I want to build everything for 32 and for 64 bit architecture. Several libraries create shared libs (dlls). What is the best way to provide those dlls to the compiled executables from my project? I thought ...
<p>Since a 32-bits executable cannot pick 64-bits DLLs and vice-versa. You just have one directory with everything 32-bits (executable + DLLs) and another one with everything 64-bits.</p>
readv(), writev(), WSARecv(), WSASend() <p>I hope you can help me out. </p> <p>I'm trying to send packets of 1000 bits across a network via TCP/IP and I was hoping to be able to use the Overlapped I/O technique in both Cygwin and Windows as well.</p> <p>In Cygwin, I am trying to use the "readv() and writev()" functio...
<p>If you want to use overlapped I/O on windows then you might like to take a look at some articles I wrote over at The Code Project which might provide you with a starting point. These use IO Completion Ports which are the most efficient way of doing overlapped I/O on Windows and come with complete source code. There'...
mysql dump tables only <p>In my database I have some tables and views. How can I export all the tables (and not the views) from my database from command line?</p>
<p>The current implementation mysqldump won't create dumps without views -- and furthermore, (last time I checked) views are actually created twice -- once as a table, then the table is dropped and replaced with a view. So you can't just filter out the "CREATE VIEW" command, unless that behavior has been modified.</p> ...
how to get the MS word screen position from the Ribbon control? <p>I want to get the word position, so that I can position my dialogs relative to the word on the screen in the event handler in the ribbon control</p> <p>private void button1_Click(object sender, RibbonControlEventArgs e)</p> <p>How to get that? I mean ...
<p>I've come across this same issue. Not sure why, but the RibbonControl class didn't provide a Location property.</p> <p>It's possible that coordinates are housed somewhere within the COM objects, but I'm no Excel expert.</p> <p>Anyone else come across this?</p>
Showing big images by DirectX faster? <p>as developer of industrial vision applications I frequently have rather clunky images like 6000x4000Pixels and bigger.</p> <p>While the camera and imageprocessing is working on a steady stream of new images (and this processing is the main task) I would like to allow the user t...
<p>You're going to be limited by max texture size (which varies from card to card), so you'll have to subdivide your big image into several smaller textures. Getting the actual texture data to your video memory should be plenty fast as long as the card is AGP or PCI-E.</p>
How to search for one value in any column of any table inside one MS-SQL database? <p>Is there a way to search for one value (in my case it is a UID of the type char(64)) inside any column of any table inside one MS-SQL database?</p> <p>I'm sitting in front of a huge database without any idea how the tables had to be ...
<p>Thanks for the question as this is a really useful topic. I will use this myself also now for reasons including the one you put forward. :-)</p> <blockquote> <p>How to search all columns of all tables in a database for a keyword?</p> </blockquote> <p><a href="http://vyaskn.tripod.com/search_all_columns_in_all...
Block elements inside a product list <p>I have a page which contains a products' list.</p> <p>I decided to use an unordered list instead of divs to display the products but there is a problem with that, since I can't insert other block level elements in the <code>&lt;li&gt;</code> to achieve some specific design I wa...
<ol> <li>The most important part of your HTML is that it makes semantic sense. If you want to display an inline element as a block level element that's perfectly acceptable, provided the HTML behind it makes sense. This is an important part of being able to separate content from presentation.</li> <li>Generally, if you...
How to use Dojo in my Django application? <p>How do I use Dojo in my Django application? Please show me comprehensive examples on how to do this.<br /> Any links to sample code for this combination will be appreciated</p> <p>NB: I also don't mind examples using Dojango.</p>
<p>You may have seen this blog post: <a href="http://blog.uxebu.com/2008/07/26/ajax-with-dojango/">http://blog.uxebu.com/2008/07/26/ajax-with-dojango/</a></p> <p>You can also try the various examples, blog articles and docs here. <a href="http://code.google.com/p/dojango/">http://code.google.com/p/dojango/</a></p>
Why does the UI thread get blocked when running something in a different thread? <p>Suppose I have normal <code>button.Click</code> event. </p> <p>If I try to access UI elements from inside of this event I could potentially got unwanted behavior - or even an exception (when debugging). The usual exception in such a sc...
<p>What is the framework here? winform? WPF?</p> <p>In winform (for a click event), you <em>are</em> on the UI thread. So you <em>can</em> just talk to the UI from the click event. If something else is happening, then there is something wrong. Are you sure you aren't in a timer-callback?</p> <p>In the more general se...
Time Zones <p>I know this isn't specific to PHP, but what's the point of using timezones listed like this :<a href="http://us2.php.net/manual/en/timezones.america.php" rel="nofollow">http://us2.php.net/manual/en/timezones.america.php</a>? For example "America/Indianapolis" and "America/New_York". What is the problem...
<p><code>'America/New_York'</code> doesn't depend on the date. <code>EST</code> is only valid in winter, while in summer you have to change it to <code>EDT</code>. Other problem with 3 letter codes is, that there are conflicts. <code>EST</code> means Eastern Standard Time, but it might be in America or Australia. </p>
Java: Rationale of the Cloneable interface <p>Why wasn't the <code>.clone()</code> method specified in the <code>java.lang.Cloneable</code> interface ?</p>
<p>Basically, it's a broken interface. Ken Arnold and Bill Venners discussed it in <a href="http://www.artima.com/intv/issues3.html">Java Design Issues</a>.</p> <p>Arnold:</p> <blockquote> <p>If I were to be God at this point, and many people are probably glad I am not, I would say deprecate <code>Cloneable</code>...
Tweaking asp.net mvc <p>I really love the "one model in - one model out" idea of Fubu MVC. A controller would look something like this</p> <pre><code>public class MyController { public OutputModel MyAction(InputModel inputModel) { //.. } } </code></pre> <p>and the service l...
<p>What you're looking for the is the ControllerActionInvoker. You'll have to implement your own and override/take over handling a lot of the pipeline work that ASP.NET MVC.</p> <p>For reference, check out Jonathon Carter's 2-part post on doing ControllerActionInvokers: <a href="http://lostintangent.com/2008/07/03/asp...
python code convention using pylint <p>I'm trying out pylint to check my source code for conventions. Somehow some variable names are matched with the regex for constants (<code>const-rgx</code>) instead of the variable name regex (<code>variable-rgx</code>). How to match the variable name with <code>variable-rgx</code...
<blockquote> <p>Somehow some variable names are matched with the regex for constants (const-rgx) instead of the variable name regex (variable-rgx).</p> </blockquote> <p>Are those variables declared on module level? Maybe that's why they are treated as constants (at least that's how they should be declared, according...
Capture multiple key downs in C# <p>How can I capture multiple key downs in C# when working in a <a href="http://en.wikipedia.org/wiki/Windows_Forms" rel="nofollow">Windows Forms</a> form?</p> <p>I just can't seem to get both the up arrow and right arrow at the same time.</p>
<p>A little proof-of-concept code for you, assuming <code>Form1</code> contains <code>label1</code>:</p> <pre><code>private List&lt;Keys&gt; pressedKeys = new List&lt;Keys&gt;(); private void Form1_KeyDown(object sender, KeyEventArgs e) { pressedKeys.Add(e.KeyCode); printPressedKeys(); } private void Form1_...
How to respond with a custom error response in Apache 2.2 (c++)? <p>I am currently trying to have my Apache module respond with custom error messages, so that a 400 for example contains additional information like "The coordinates are out of bounds".</p> <p>I found multiple sources on Google saying that it is possible...
<p>You can set it on the status_line member of request_rec.</p> <pre><code>snprintf(buf, buf_size, "%d Coordinate %d is out of bounds", 400, coord.x); req-&gt;status_line = buf; req-&gt;status = 400; </code></pre>
LINQ In Line Property Update During Join <p>I have two obects, A &amp; B for this discussion. I can join these objects (tables) via a common relationship or foreign key. I am using linq to do this join and I only want to return ObjectA in my result set; however, I would like to update a property of ObejctA with data...
<p>Add an update method to your ClassA</p> <pre><code>class ClassA { public ClassA UpdateWithB(ClassB objectB) { // Do the update return this; } } </code></pre> <p>then use</p> <pre><code>return from objectA in GetObjectAs() join objectB in GetObjectBs() on objectA.Id equals objectB.AId ...
How can I generate a client proxy for a WCF service with an HTTPS endpoint? <p>Might be the same issue as this previuos question: <a href="http://stackoverflow.com/questions/703698/generating-wcf-proxy-against-untrusted-ssl-endpoint">WCF Proxy</a> but not sure...</p> <p>I have an HTTPS service connfigured to use trans...
<p>ng5000,</p> <p>Seems like you may have another issue here (maybe IIS). Do you have any issues with transport-level security off? I would also make sure you can get to the web address in IE before checking the WCF stuff. Sounds like a IIS setting that's not correct in the security tab.</p> <p>If its still a pr...
Append new JavaDoc to existing from super method <p>I have generated an Interface which is very well documented. Every method does have his own JavaDoc. The clases which implement this Interface can have little differents in their logic.</p> <p>How can i add JavaDoc to the existing JavaDoc from the super class. The ke...
<p>I guess that when you need to add something to javadoc, you changed something. So maybe it will be correct to write javadoc in exactly same way.</p> <pre><code>/** * Enahnced swing paint for my cool component * @see JButton.paint(); */ public void paint(){ super.paint(){ //my stuff } </code></pre>
Short/quick explanation of .net mvc <p>What would be the shortest explanation for .net mvc (for a manager to understand at a high level, how it works, benefits etc).</p>
<p>You might start <a href="http://www.asp.net/mvc/" rel="nofollow">here</a>.</p> <blockquote> <p><strong>ASP.NET MVC</strong> enables you to build Model View Controller (MVC) applications by using the ASP.NET framework. ASP.NET MVC is an alternative, not a replacement, for ASP.NET Web Forms that offers th...
Why do I see HASH(0xABCDEF) in my Perl output? <p>I am running perl, v5.6.1 built for sun4-solaris-64int</p> <p>I am calling print on an array:</p> <pre><code>print "@vals\n"; </code></pre> <p>and the output looks like:</p> <pre><code>HASH(0x229a4) uid cn attuid </code></pre> <p>or another example:</p> <pre><code...
<p>Your braces in @foo = {} are creating it. The braces create an unnamed hash reference.</p> <p>If you want to set @foo to an empty list, use @foo = ()</p>
Why are my drop downs not working in ie7? <p>If you view this page: <a href="http://www.sussexjewelers.com/product_search.php?cid=69" rel="nofollow">http://www.sussexjewelers.com/product_search.php?cid=69</a></p> <p>The drop down menus (horizontal green bar) do not drop down in ie7. They do drop down in ie6, firefox, ...
<p>Your <code>&lt;style&gt;</code> and <code>&lt;script&gt;</code> tags should be inside your <code>&lt;head&gt;</code> tag, not outside your <code>&lt;html&gt;</code> tag.</p> <p>Also add a DOCTYPE</p> <p>XHTML</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/D...
How method hiding works in C#? <p>Why the following program prints</p> <pre><code>B B </code></pre> <p>(as it should)</p> <pre><code>public class A { public void Print() { Console.WriteLine("A"); } } public class B : A { public new void Print() { ...
<p>When you remove the <code>public</code> access modifier, you remove any ability to call B's <code>new Print()</code> method from the <code>Main</code> function because it now defaults to <code>private</code>. It's no longer accessible to Main.</p> <p>The only remaining option is to fall back to the method inherite...
Adding NAPDEF on Nokia <p>I am trying to add a new access point on a Nokia S60 device, but I am a little bitt puzzled on how to do it. According to the <a href="http://www.forum.nokia.com/info/sw.nokia.com/id/b5a43a09-2d4b-4ea9-ad76-ecee12913ac7/OMA%5FDM%5FManagement%5FObject%5Ffor%5FConnectivity%5FSettings%5Fv1%5F1%5F...
<p>It's not exactly an answer to your question but you might want to run some Symbian C++ code on the device to add the access point, if you can't find a way to do it successfully with OMA-DM.</p> <p>If that works better, you may still be able to work around the problem by using OMA-DM to install the .sis file contain...
Building RAD7 project from command line <p>Hey We have existing projects set with compilation dependencies in a RAD7 IDE. Is it possible to create automated build script from the existing project structure? We have IBM portal projects and regular WEB and enterprise projects.</p> <p>Maven and Ant are possible solutions...
<p>You need to look into "headless mode". That's basically running the IDE to perform its work without the IDE showing up.</p> <p>I don't have any direct experience but one of the teams in our lab used RAD in headless mode to automate builds for an Eclipse/System-z interface.</p>
How can I know the address of owner object in C++? <p>I would like to create in C++ a Notifier class that I will use in other objects to notify various holders when the object gets destroyed. </p> <pre><code>template &lt;class Owner&gt; class Notifier&lt;Owner&gt; { public: Notifier(Owner* owner); ~Notifier(); // ...
<p>Take a look at the <a href="http://www.vincehuston.org/dp/observer.html" rel="nofollow">GoF Observer Design Patter</a>.</p>
open_basedir not having any effect <p>For my web hosting panel, users need to be blocked from accessing files outside their own directory (<code>/var/www/u/s/username</code>). I tried to use this line in <code>httpd.conf</code> to prevent people from going up a directory.</p> <pre><code>&lt;Directory /var/www/users/&g...
<p>It might be a silly suggestion, but have you restarted the webserver after making the php.ini changes?</p> <p>Another method you might try using is to append a file using the "auto_prepend_file" directive to include a script to tighten up the open_basedir directive to the current users directory:</p> <p>From PHP.n...
SharePoint domains and Content Query Web Part <p>I have created a new sharepoint site on our moss server at <a href="http://sharepoint:12345" rel="nofollow">http://sharepoint:12345</a> and added a CQWP to it without issue.</p> <p>I have a domain name pointing at the same server. So I pointed to <a href="http://myinter...
<p>Have you set up an Alternate Access Mapping for the second domain?</p> <p><a href="http://technet.microsoft.com/en-us/library/cc263208.aspx" rel="nofollow">AAM on TechNet</a></p>
Problem using @SecondaryTable in Hibernate <p>Abridged version of my schema:</p> <pre><code>utility_company id int not null -- PK name varchar(255) not null utility_settings utility_id -- FK to utility use_magic tinyint(1) not null default 0 </code></pre> <p>There is a one-to-one mapping between these two tables. S...
<p>Your mappings are correct IMHO, and runs fine with <a href="http://www.datanucleus.org/products/accessplatform" rel="nofollow">DataNucleus AccessPlatform</a> as the JPA implementation. Maybe Hibernates log tells you more ?</p> <p>--Andy <a href="http://www.datanucleus.org" rel="nofollow">DataNucleus</a></p>
Programmatically determine if a COM library (.DLL) is installed <p>Is there a programmatic way in C# to determine whether a particular COM DLL has been installed? Or is this a matter of scanning the registry for the classId?</p>
<p>What I usually did (and would do, if I needed this again) is try to create an object instance of a class you know is in the COM library - either by ProgID or GUID - and checking for failure.</p>
Timeout Pattern - How bad is Thread.Abort really? <p>I've read at various websites that Thread.Abort is not very good to use. In this case, how do you implement a timeout pattern? For instance, I've read that MS uses the pattern below (which I've wrapped in an extension method) throughout the framework. Personally, I t...
<p>Basically you're talking about aborting an action which (as far as we know) has no graceful way of aborting.</p> <p>That means there's going to be no <em>safe</em> way of aborting it. <code>Thread.Abort</code> is just not a nice thing to do - there are various race conditions and ugly situations you can get into (s...
'for' loop through form fields and excluding one of the fields with 'if' <p>The problem I'm struggling with is as follows:</p> <p>I have:</p> <pre><code>{% for field in form %} {{ field }} {% end for %} </code></pre> <p>What I want is to put an 'if' statement to exclude a field which .label or whatever is provi...
<p>Yes, this should be possible:</p> <pre><code>{% for field in form %} {% ifnotequal field.label title %} {{ field }} {% endifnotequal %} {% endfor %} </code></pre> <p>Django's <a href="http://docs.djangoproject.com/en/dev/ref/templates/builtins/#ref-templates-builtins">template tags</a> offer <code>...
How can I su from root to db2inst1 and invoke a SQL script, in one line? <p>How can I <code>su</code> from <code>root</code> to <code>db2inst1</code> and invoke a SQL script all in 1 line? I am thinking about something like this:</p> <pre><code>su db2inst1 | db2 CONNECT TO myDatabase USER db2inst1 USING mypw; db2 -c ...
<p>You can use the <code>-c</code> or <code>--command=&lt;command&gt;</code> option to execute a command with <code>su</code>. In your case, something like this:</p> <pre><code>su -c 'db2 CONNECT TO myDatabase USER db2inst1 USING mypw; db2 -c -i -w -td@ -f /tmp/deploy/sql/My.sql' db2inst1 </code></pre>
Sql Query To get data <p>i have a table called DrTimings ,in which Doctors time for each day is this.</p> <pre><code>DrID(int identity) StartTime(DateTime) EndTime(DateTime) 1 3/31/2009 8:00:00 AM 3/31/2009 10:30:00 AM </code></pre> <p>I have another table called TimeList which conta...
<p>You are going to need to look at doing some Casting/COnverting of date values. This <a href="http://msdn.microsoft.com/en-us/library/ms187928.aspx" rel="nofollow">MSDN article</a> gives you a bit of information on what you need to work with. </p> <p>There are a number of ways that you can do this, but ideally you...
Registering bugs by email <p>What is a best way to parse an email with bug description. One client decided recently that it would be nice for user to be able to send an email to known mailbox and a bug would be registered in bug tracker (not exactly bu close). </p> <p>The problem is bug description has lot of fields l...
<p>We do something similar to this with RT, however the email isn't really parsed. All the emails go into a single queue where it is evaluated by our IT staff. Basically, the parsing is done by humans - they modify the ticket to have as much information as they can glean from the email.</p> <p>You're unlikely to get u...
Branch from the past in mercurial <p>I'm a single developer using Mercurial to create a program. I have so far committed at every step of developing, and I have messed things up and want to work on something else.</p> <p>How shall I go to a previous state (ie. rollback) and then create a branch, maintaining the newer...
<p>You don't want to use <code>hg rollback</code>, that only erases <strong>exactly one</strong> change (the most recent). See <a href="http://hgbook.red-bean.com/read/finding-and-fixing-mistakes.html#id519728" rel="nofollow">You Can Only Roll Back Once</a> in the hg book.</p> <p>To make a branch from an earlier revis...
ORACLE - Exporting Procedures / Packages to a file <p>I would like to programmatically export my Procedures / Functions and Packages into individual files (as a backup) and using Oracle 9.2.</p> <p>The closest solution i found was using DBMS_METADATA.GET_DDL , but how do i output the CLOB to a text file, without losi...
<p>Trying to get CLOBS (and LONGS) from command line utilities like SQL*Plus always seems to give me formatting/truncation problems. My solution was to write a simple utility in a non- type checking language (Perl) that uses <code>DBMS_METADATA</code> to bring the CLOB back into a string.</p> <p>Snippet:</p> <p>......
Tiles won't parse Struts tags <p>I'm tried using tiles but it seems that it's not parsing the Struts tags, It outputs them directly e.g. instead of ... What seems to be the problem?</p>
<p>You need to include the taglib library header in each JSP file, regardless of whether it's a tile or not:</p> <pre><code>&lt;%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %&gt; &lt;%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %&gt; &lt;%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %&gt...
How do I get rid of the unknown property name errors in Visual Studio? <p>When using jQuery UI and ThemeRoller the CSS files created contain several CSS properties that are not known by Visual Studio, such as <code>zoom</code> and <code>opacity</code>. How can I keep these from showing up as errors in the error list w...
<p>Go to Tools --> Options --> Text Editor --> CSS --> CSS Specific (or Validation) and uncheck the <code>Detect unknown properties</code> checkbox.</p>
Dynamically created expressions <p>I'm creating a dynamic expression, which will order items in a list by some rule (lambda exp.). This is the code:</p> <pre><code>Expression&lt;Func&lt;String, String&gt;&gt; exp = o =&gt; o; MethodCallExpression orderByExp = Expression.Call(typeof(Enumerable), "OrderBy", new Typ...
<p>order any enumerable by a property(no reflection):</p> <pre><code>public static IOrderedEnumerable&lt;T&gt; OrderBy&lt;T&gt;(this IEnumerable&lt;T&gt; items, string property, bool ascending) { var MyObject = Expression.Parameter(typeof (T), "MyObject"); var MyEnumeratedObject = Expre...
Autosizing departure board using Html, CSS and JQuery <p>I've got to develop an auto scaling arrivals and departures board at work.</p> <p>It's started out easily enough with me creating a table with percentage based column widths (and the overall table being 100% width).</p> <p>For now, I've got a small piece of JQu...
<p>CSS and HTML can be very finicky when it comes to this sort of thing especially since font-size can be very different on different computers. Case in point, if you are using the font, say, Verdana. It's a pretty common font. Unfortunately the way Macs, Windows, and Linux renders it is slightly different. There's rea...
Reload UITableViewController <p>I'm trying to reload data in a <code>UITableViewController</code> after a location is found. This also means after the <code>viewDidLoad</code> method. My class is extending a <code>UITableViewController</code> with this interface:</p> <pre><code>@interface RootViewController : UITableV...
<p>you have to do it on the <code>UITableView</code> over <code>[self.tableView reloadData];</code></p>
WinMM Library Issues <p>I wrote a WinMM library wrapper library that exposes WaveOut and WaveIn classes for the purpose of recording and playing raw audio streams.</p> <p>Everything works great, but in order to follow the operating system specs on how to handle the finished buffers, I added a thread that unprepares th...
<p>I would first create a separate <code>object</code> on which to lock. That should simplify a lot of your null-checking logic (by about half since you check before and after the lock).</p> <p>Second, <code>Dispose</code> will not set your variable to <code>null</code>, so your other checks will still pass through b...
C# Permutation of an array of arraylists? <p>I have an ArrayList[] myList and I am trying to create a list of all the permutations of the values in the arrays.</p> <p>EXAMPLE: (all values are strings)</p> <pre><code>myList[0] = { "1", "5", "3", "9" }; myList[1] = { "2", "3" }; myList[2] = { "93" }; </code></pre> <p>...
<p>I'm surprised nobody posted the LINQ solution.</p> <pre><code>from val0 in new []{ "1", "5", "3", "9" } from val1 in new []{ "2", "3" } from val2 in new []{ "93" } select String.Format("val0={0};val1={1};val2={2}", val0, val1, val2) </code></pre>
Unique record in Asp.Net SQL <p>I asked this question previously but the answers weren't what I was looking for. </p> <p>I created a table in Asp.net without using code. It contains two columns.</p> <p>YourUserId and FriendUserId</p> <p>This is a many to many relationship. </p> <p>Heres what I want:</p> <p>There c...
<p>You should create a compound primary key to prevent duplicate rows.</p> <pre><code>ALTER TABLE FriendRequests ADD CONSTRAINT pk_FriendRequests PRIMARY KEY (UserID, FriendUserID) </code></pre> <p>Or select both columns in table designer and right click to set it as a key.</p> <p>To prevent self-friendship, you'd c...
The referenced component 'System' could not be found. (or any other component for that matter) <p>The issue was reported as a bug to the VS team <a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=355654">here</a> but was closed as not reproducible since the original poster didn't ...
<p>In my case, the solution was completely different. It looked like it was an issue with NuGet paths (caused by my moving the project to a different solution and then back again.</p> <p>I edited the .csproj and removed all references to NuGet and associated packages. I also removed the packages folder from the soluti...
What are your web development standards? <p>I am trying to come up with a clear standard to present to my web team so that the frontend HTML/CSS developers and the backend developers can get on the same page. Currently, we all have our own coding styles, and we tend to end up creating more work for each other when we h...
<p>Do you have a css framework chosen out or developed? It's hard to create a system of standards a priori. I would work with your developers to choose a common CSS/Layout framework (such as, <a href="http://www.blueprintcss.org/" rel="nofollow">Blueprint</a>, <a href="http://960.gs" rel="nofollow">960 Grid System</a>,...
C# WebBrowser control not firing the DocumentCompleted event <p>I have a program that is using the C# WebBrowser control and it needs to detect which page is loaded to determine what to do next. The program works fine on most of the employee's computers at the office, but it does not work on some.</p> <p>I have deter...
<p>As explained by CodeBlock, this seems to be related by the installation state of <code>Microsoft.mshtml.dll</code></p> <p>We've got customers where the <code>Microsoft.mshtml.dll</code> is not present in GAC (nor in computer), and then the <code>WebBrowser</code> component never fires any event.</p> <p>By using Re...
Database replication from SQLserver 2000 to SQLserver 2008 <p>I'm trying to replicate a rather large database from SQLServer 2000 to SQLServer 2008, located on two different servers. I found an article about attempting this and have been trying to follow its direction. Here is the article.</p> <blockquote> <p><a hre...
<p>On the final step of the publication wizard you will have the two options: 1. Create the publication 2. Generate a script file with steps to create the publication</p> <p>The article referenced here is suggesting that you do not let the wizard create the publication but instead only choose to generate the script fi...
Is NAS / SAN + HTTP server a good match? <p>Is NAS / SAN + HTTP server a good solution for serving large number of static files over the internet?</p>
<p>Add some memory caching on your server, and you should be good. Apache has a couple of modules that do that.</p> <p>You could also take a look at static distributed caching services, if you want to improve latency for your users and reduce your bw costs, like Akamai and PantherExpress. The latter can be a good inve...
Best client/server UDP and TCP debugging tool? <p>I'm trying to find a simple TCP/UDP debugging tool. The tool should act like a client or a server, display incoming messages, allow sending messages, etc. Ideally, the tool would have a GUI and be extremely easy to use.</p> <p>For the life of me I can't find anything a...
<p>TCPIP Builder (Windows)</p>
How to use constant var in SSIS <p>I have defined a variable as:</p> <pre><code> DateSecondsOffset Int default as 1 </code></pre> <p>in a SQL Server Integration Service project. I use it as constant.</p> <p>In a task, I have the following SQL to set another var NextDT:</p> <pre><code> SELECT dateadd(s, max(times...
<p>If you're in a Script..</p> <pre><code>Dts.Variables("DateSecondOffset").Value </code></pre> <p>If you're referring to it in a field..</p> <pre><code>Scope::DateSecondOffset </code></pre> <p>Replace Scope with your scope which can be found in the "package explorer" tab under variables.</p> <p>If you're referrin...
Why isn't Smalltalk popular? <p>I’ve been looking at Smalltalk (VisualWorks) for the past couple of months - and the more I learn the more I’m impressed. However, I think I must be missing something as Smalltalk doesn’t seem to be popular these days - and perhaps it never was. </p> <p>What do the people who ha...
<p>There are a number of reasons that Smalltalk didn't "catch fire", most of them historical:</p> <ul> <li><p>when Smalltalk was introduced, it was too far ahead of its time in terms of what kind of hardware it really needed</p></li> <li><p>In 1995, when Java was released to great fanfare, one of the primary Smalltalk...
Opensource C/C++ decompiler <p>Duplicate of <a href="http://stackoverflow.com/questions/193896/whats-a-good-c-decompiler">http://stackoverflow.com/questions/193896/whats-a-good-c-decompiler</a> and <a href="http://stackoverflow.com/questions/205059/is-there-a-c-decompiler">http://stackoverflow.com/questions/205059/is-t...
<p>Check out <a href="http://boomerang.sourceforge.net/">Boomerang</a>.</p>
Basic ActiveRecordStore updated_at field not being updated on every request <p>I'm using the standard active_record_store in my app. In <code>environment.rb</code> I have:</p> <pre><code>config.action_controller.session_store = :active_record_store </code></pre> <p>And my <code>sessions</code> table was created with...
<p>Are you updating the session? If you aren't updating the values, then I believe the session won't be saved to disk.</p> <pre><code>class WhateverController &lt; ActionController def index session[:whatever] = true end end </code></pre>
Learning to work with audio in C++ <p>My degree was in audio engineering, but I'm fairly new to programming. I'd like to learn how to work with audio in a programming environment, partly so I can learn C++ better through interesting projects.</p> <p>First off, is C++ the right language for this? Is there any reason I ...
<p>It really depends on what kind of audio work you want to do, If you want to implement audio for a game, C++ is sure the right language. There are many libraries around, OpenAL is great, free and multiplatform. I also used DirectSound and Fmod with great sucess. Check them out, it all depends on your needs.</p>
Launch .jar files with command line arguments (but with no console window) <p>I have to do a demo of an application, the application has a server.jar and client.jar. Both have command line arguments and are executable. I need to launch two instances of server.jar and two instances of client.jar.</p> <p>I thought that ...
<p>Try:</p> <pre><code>javaw &lt;args&gt; </code></pre>
ASP.net AJAX Control Toolkit will not recognise my specified css classes in the autocomlete extender? <p>I am trying to specify CSS classes for the <a href="http://www.asp.net/AJAX/AjaxControlToolkit/Samples/AutoComplete/AutoComplete.aspx" rel="nofollow">autocomplete</a> control:</p> <pre><code>CompletionListCssClass=...
<p>are you sure you have the most recent version of the ajax control toolkit?</p>
Are custom facelet functions dirty? <p>I have several places in my facelets web app where we are using custom facelet functions. For some reason they feel dirty and I can't quite peg why. What is StackOverflow's view of custom facelet functions?</p>
<p>I can see how you might think that. I think excessive use of such functions is probably poor design. However, there are cases where your life is just easier defining a custom facelet function; therefore you shouldn't dismiss them out of hand.</p>
Silverlight Design Resources for the Inept <p>I'm steadily progressing on Silverlight from a programming standpoint. I believe I'm to the point where I want my application to look decent to begin demo'ing. Doesn't have to look awesome, but not like a 2 year old did it (although a 2 year old might be a step above my c...
<p>Check out the free icons at famfam: <a href="http://famfamfam.com/lab/icons/silk/" rel="nofollow">http://famfamfam.com/lab/icons/silk/</a></p> <p>The silk ones especially are really slick and have helped me a lot in the past. Good looking icons and buttons go a long way towards polishing the look of your app.</p>
Permissions problem using SyncToy to synchronize ClearCase with SharePoint 3.0 <p>So I am trying to setup a simple one way synch from a dynamic ClearCase view over to a MOSS document library. I'm using SyncToy 1.4 as my sync tool and it seems to work fine when it's copying new documents from ClearCase to SharePoint but...
<p>Is this similar to <a href="http://support.microsoft.com/kb/870853" rel="nofollow">Office 2003 and 2007 Office documents open read-only in Internet Explorer</a>, where SharePoint might considering synctoy access to its files as "browsing access" (always opened as <a href="http://spsstuff.blogspot.com/2006/07/office-...
Programmatically Controlling Windows Media Player, Preferably From Java <p>I'm adding functionality to an existing Java application that's already been deployed extensively. (So there are some design decisions that I can't touch unless I have a <i>seriously</i> compelling reason.) The app controls a PC broadcasting a...
<p>Your best bet is to use Jacob (or some other Java/COM bridge); I assume you don't want to just mute the system volume.</p>
HTML Class with <select> <p>I'm trying to design a Form class in PHP. So far, I have the <code>&lt;input&gt;</code> buttons pretty well working. But the <code>&lt;select&gt;</code> boxes have me stymied. I'm trying to figure out a "generic" way of adding the <code>&lt;option&gt;</code> tags, and am lacking the creat...
<p>This is my implementation of it from my bare-bones framework that I use in super simple projects:</p> <pre><code>function select($name, $options = array(), $attrs = array(), $showEmpty = false) { $attrs['name'] = $name; $attrs['class'] = isset($attrs['class']) ? $attrs['class'] . ' input' : 'input'; if(...
Debugging exception thrown in Objective C and XCode <p>I am a long time Microsoft developer and I am new to iPhone development using XCode. So, I am reading a book and going through examples trying to teach myself how to write an iPhone application using Objective-C. All has been good so far, however, once in a while...
<p>First and foremost, open <code>~/.gdbinit</code> (that's the file called <code>.gdbinit</code> in your home directory - yes, starts with a dot) and put this in it:</p> <pre><code>fb -[NSException raise] fb objc_exception_throw fb malloc_error_break </code></pre> <p>That'll initialize GDB with three default breakpo...
Are there any rules regarding special characters/entities and innerHTML? <p>When I use innerHTML from javascript, the browser (Safari and Firefox at least) seem to replace certain characters and numeric entities with their named entities.</p> <p>The character <code>\xa0</code> (non breaking space) gets replaced by <co...
<p>The HTML 5 spec has rules for serializing an HTML fragment when you call innerHTML on it, documented here: <a href="http://www.w3.org/TR/2009/WD-html5-20090212/serializing-html-fragments.html">Serializing HTML fragments</a> (note that innerHTML isn't in the HTML 4 spec, so the HTML 5 spec is the current reference).<...
Do organizations ever use SharePoint on a port other than 80? <p>Has anyone encountered SharePoint installations that are set up to use other than port 80? I'm not really concerned with test servers or administration interface usage.. just what users would be exposed to.</p> <p>My application is currently set to leve...
<p>I assume you're not referring to the admin interface of SharePoint?</p> <p>Even so, yes, people use different ports, even multiple IP addresses, host headers, etc. Your application should handle this, or it won't get very much use.</p>
Fast implementation of Rolling hash <p>I need a Rolling hash to search for patterns in a file. (I am trying to use the rabin-Karp string search algorithm).</p> <p>I understand how a good hash works and how a good rolling hash should work but I am unable to figure out how to efficiently implement the 'divide' (or inver...
<p>Cipher's "prime base" idea should work decently - though the solution he posted looks a bit sketchy.</p> <p>I don't think there's any need for inverse multiplication in this method. Here's my solution:</p> <p>Say the string we currently have hashed is "abc", and we want to append "d" and remove "a".</p> <p>Just l...
ASP.NET Page Base Class with OnLoad event not allowing Derived Class to fire OnLoad <p>I have a custom PageBase class that I am using for all of the pages in my project. In my BaseClass I have a <code>protected override void OnLoad(EventArgs e)</code> method declared. This method seems to make my derived classes unab...
<p>In your derived class:</p> <pre><code>protected override void OnLoad(EventArgs e) { //do the specific work //.... // base.OnLoad(e); } </code></pre>
ASP.NET Error when trying to access page <p>Im getting this odd error:</p> <p>Any help would be great? </p> <p><strong>This is the error:</strong></p> <blockquote> <h2>Server Error in '/Rugby' Application.</h2> <p><strong>Configuration Error</strong></p> <p><strong>Description:</strong> An error occurre...
<p>This sometimes happens when you have a Web.config in a subdirectory of the application's root.</p> <p>Alternatively, you may need to go into the virtual directory and configure it correctly as an application (as noted by the error message).</p>
What's the right way to check for inheritance from a class/interface? <p>The code below is looping through a dictionary of strings and <strong>IMyCompanySettings</strong> looking for values that implement <strong>IMyCompanyProductSetting</strong>. Clearly, trying to cast and raising an exception is a very expensive way...
<h2>Casting 101 [general info on casting stuff]:</h2> <p>Use <code>[object] is [interface/class]</code> expression:</p> <pre><code>if (setting is IMyCompanyProductSetting) { ... } </code></pre> <p>Alternatively you can use the <code>as</code> keyword which tries to cast the object and if it fails, instead of throw...
Object Instance in C# <p>Why do I get "Object Reference Not Set to Instance of an Object"</p> <pre><code>protected void GetData() { ... id = this.GetTabControl().ID; //&lt;---------here } ... protected ASPxPageControl GetTabControl() { return (ASPxPageControl)this.FindControl("DetailTab"); } </code></pr...
<p>Presumably because <code>GetTabControl()</code> is returning <code>null</code>. We can't tell <em>why</em> without more code though.</p>
Use DisplayNameAttribute in ASP.NET <p>I want to bind a List to a GridView on a web page, but override the way the property names display via annotation. I thought System.ComponentModel would work, but this doesn't seem to work. Is this only meant for Windows Forms?:</p> <pre><code>using System.ComponentModel; namesp...
<p>If all you care about is the header text in GridView, just use the HeaderText property of each field you bind. If you're autogenerating the columns, you just set the HeaderText after you've bound the GridView.</p> <p>If you want a GridView that takes into account some attribute you placed on the properties of your ...
Sharepoint List Definition that binds only to my Custom Content Type <p>I am developing a Sharepoint Solution, that implements a new list. This list has an event receiver attached to a Custom Content type. </p> <p>I am using VSeWSS 1.3 for this task and it's going ok (the content type gets created, a list is created...
<p>You will have to edit the Schema.xml for your custom list. Find the <code>&lt;ContentTypes&gt;</code> tag and remove any you do not wish to be shown.</p> <p>Your list definition will have a guid (eg. <code>&lt;Elements Id="0a8594c8-5cf1-492e-88ce-df943830c88c"</code>) that will specify the list from the schema xml ...
List all Tests Found by Nosetest <p>I use <code>nosetests</code> to run my unittests and it works well. I want to get a list of all the tests <code>nostests</code> finds without actually running them. Is there a way to do that?</p>
<p>Version 0.11.1 is currently available. You can get a list of tests without running them as follows:</p> <pre><code>nosetests -v --collect-only </code></pre>
A copyright / license comment for common utility apps while do contract work <p>I'm doing some contract work who need the source code for the application I'm writing. For the new files I'm writing for the customer, I'm giving them the copyright. However, there are some utility files (for OS abstractions like threadin...
<p>Not to sound trite, but your best option is to ask a lawyer. Shouldn't be more than a few hundred dollars.</p>
Need help to decide what is the best solution to tracking system (.NET) <p>That is my first question around here, my name is Anna!</p> <p>My problem: My client has several personal devices (blackbox with gps) to locate people/car... There are about 12000 people/car using that device... It sends their location to speci...
<p>The number of locations / time, as well as the way the location information is transmitted (is it TCP, UDP, etc) will help determine the optimal approach.</p> <p>Some questions:</p> <ul> <li>How frequently do the 12000 devices send a message?</li> <li>How are the locations transmitted? UDP? TCP?</li> <li>What rel...
What's your choice for your next ASP.NET project: Web Forms or MVC? <p>Let's say that you will start a new ASP.NET web site/application tomorrow. Would you chose Web Forms or MVC, and why?</p>
<p>MVC baby! And JQuery!</p> <p>Edit: OK, it's fair enough to say my response warrants a little more info. </p> <p>I'd choose MVC for the following reasons:</p> <ol> <li>I have worked in Rails and found it highly productive. ASP MVC has borrowed so much from Rails that it feels like a direct port in some ways (and t...
Weird error with Locale.getISOCountries() <p>I'm using this code:</p> <pre><code> for (final String code : Locale.getISOCountries()) { //stuff here } </code></pre> <p>But on compile I get this error:</p> <pre><code>[ERROR] Line 21: No source code is available for type java.util.Locale; did you for...
<p>Something screwy with your setup, the folllowing program works fine for me.</p> <pre><code>import java.util.*; import java.util.Locale; public class Donors { public static void main (String [] args) { for (final String code : Locale.getISOCountries()) { System.out.println (code); } ...
GetTcpTable equivalent on Linux <p>Is there an API call on Linux which returns currently opened TCP connections on the system (like <a href="http://msdn.microsoft.com/en-us/library/aa366026%28VS.85%29.aspx" rel="nofollow">GetTcpTable</a> call on Windows)?</p> <p>Thanks.</p>
<p>As per UNIX philosophy of "everything is a file", you can get what you want from reading <code>/proc/net/tcp</code>.</p>