instruction
stringlengths
0
30k
|sql|database|evaluation|
We're living in a golden age of databases, with numerous high quality commercial and free databases. This is great, but the downside is there's not a simple obvious choice for someone who needs a database for his next project. - What are the constraints/criteria you use for selecting a database? - How well do the ...
We're living in a golden age of databases, with numerous high quality commercial and free databases. This is great, but the downside is there's not a simple obvious choice for someone who needs a database for his next project. - What are the constraints/criteria you use for selecting a database? - How well do the ...
|database|sql|evaluation|
|sql|database|evaluation|
We develop on the trunk unless the changes are too major, destabilizing, or we are nearing a major release of one of our products, in which case we create a temporary branch. We also create a permanent branch for every individual product release. I found Microsoft's document on [Branching Guidance][1] quite helpful. Er...
I've been trying to find the original game I was thinking of - I think it was called 'bots or something like that, and ran on my Mac back in around system 6 days. I'll have to do some digging next time I'm back at my parents place. Thinking more about it over the last day or so, I suppose it's really not all that di...
It looks like the Compressed Folder shell extension ignores directories (but not files) whose names begin with a dot, unless explicitly given as a parameter (i.e. selected for the Send To command). It's hard to find out what else it excludes, as I can't even find out *what* the "compressed folder" sendto item is doi...
The way I check in Windows if a file has been completely uploaded by ftp is to try to rename it. If renaming fails, the file isn't complete. Not very elegant, I admit, but it works.
The words you want to google for are [JavaScript Worker Threads][1] Apart from from [Gears][2] there's nothing available right now, but there's plenty of talk about how to implement this so I guess watch this question as the answer will no doubt change in future. Here's the relevant documentation for Gears: [Work...
There is no true multi-threading in Javascript, but you can get asynchronous behavior using setTimeout() and asynchronous AJAX requests. What exactly are you trying to accomplish?
Send to zipped Folder does not traverse into folders without names before dot (like ".svn"). If you had other folders that begin with dots, those would not be included either. Files without names are not excluded. Hidden attribute does not come into play. Might be a bug, might be by design. Remember that Windows exp...
AFAIK Visual Studio Express does not come with 64bit support.
I'm a big believer in Use Cases, detailing the system behaviour in response to user actions. Collectively these can form a loose set of requirements, and in a SCRUM environment can help you prioritise the Use Cases which will form that particular sprint's implemented features. For example, after talking to your fun...
There is only one point where q4e is actually better: dependency viewer. You could see the dependency tree, manage your dependencies visually and even see them in a graph. But, m2eclipse works in a better way, specially because you can create you own build commands (in the run menu). q4e comes with some predefined comm...
c# straight forward answer // Main.cs created with MonoDevelop // User: jboker at 09:28�09/06/2008 // using System; namespace q47407 { class MainClass { public static void Main(string[] args) { string s = Console.ReadLine(); string[] r = s....
using System; namespace q47407 { class MainClass { public static void Main(string[] args) { string s = Console.ReadLine(); string[] r = s.Split(' '); for(int i = r.Length-1 ; i >= 0; i--) Console.Write(r[i] + " "); Console.WriteLine(...
Tomcat vs Weblogic JNDI Lookup
|java|tomcat|jakarta-ee|jndi|weblogic|
The Weblogic servers we are using have been configured to allow JNDI datasource names like "appds". For development (localhost), we might be running Tomcat and when declared in the <context> section of server.xml, Tomcat will hang JNDI datasources on "java:comp/env/jdbc/*" in the JNDI tree. **Problem:** in ...
I don't particularly care for the exact implementation [**@Jon**][1] suggests, but the idea behind it is sound and I would concur that emitting these would be a good thing to do. A slightly better implementation, though this is all subjective to some degree, would be to create a server-side model (read: C# class(es...
What are the advantages of installing programs in AppData like Google Chrome?
|windows-installer|
I've learned never to use `include` in PHP except inside the core libraries that I use and one central `include` of these libraries (+ config) in the application. Everything else is handled by a global `__autoload` handler that can be configured to recognize the different classes needed. This can be done easily using a...
We use something similar to bcwoord to keep our database schema's synchronized across 5 different installations (production, staging and a few development installations), and backed up in version control, and it works pretty well. I'll elaborate a bit: ---------- To synchronize the database structure, we have...
We use something similar to bcwoord to keep our database schema's synchronized across 5 different installations (production, staging and a few development installations), and backed up in version control, and it works pretty well. I'll elaborate a bit: ---------- To synchronize the database structure, we have...
Attempting to manage maintenance of current production code in line with new development is problematic at best. In order to mitigate those problems code should branch into a maintenance line once testing efforts have completed and the code is ready for delivery. Additionally, the mainline should branch to assist in re...
For me, it depends on the software I'm using. Under CVS, I would just work in "trunk" and never tag/branch, because it was really painful to do otherwise. In SVN, I would do my "bleeding edge" stuff in trunk, but when it was time to do a server push get tagged appropriately. I recently switching to git. Now I...
These are all weighty topics, but here is my recommendation for updating. You did not specify your platform, but for NANT build environments I use [Tarantino][1]. For every database update you are ready to commit, you make a change script (using RedGate or another tool). When you build to production, Tarantino che...
You might also look into setting up your own site as a delegate for another OpenID provider. That way, you can use your own custom URL, but not worry about security and maintenance as mentioned already. However, it's not very difficult, so it may not meet your criteria :) As an example, you would add this snippet ...
It depends on your situations. We use Perforce and have typically have several lines of development. The trunk is considered "gold" and all development happens on branches that get merged back to the mainline when they are stable enough to integrate. This allows rejection of features that don't make the cut and can ...
If he's interested, aren't the minor details the good parts? Using python, you've already cut the GUI off of it so that confusion is gone. Why not pick a project, a game or something, and implement it. The classic hi-lo number guessing game can be simply implemented from the command line in 20-30 lines of code (depe...
First of all, start out like everyone else does: with a [Hello World][1] program. It's simple, and it gives them a basic feel for the layout of a program. Try and remember back to when you were first programming, and how difficult some of the concepts were - start simple. After Hello World, move on to creating s...
I would actually argue to pick a simpler language with fewer instructions. I personally learned on BASIC at home, as [did Jeff][1]. This way, you don't have to delve into more complicated issues like object oriented programming, or even procedures if you don't want to. Once he can handle simple control flow, then mo...
Something you should be very mindful of while teaching your brother to program is for him not to rely too heavily on you. Often when I find myself helping others they will begin to think of me as answer book to all of their questions and instead of experimenting to find an answer they simply ask me. Often the best teac...
I agree with [NilObject](http://stackoverflow.com/questions/3058/what-is-inversion-of-control#3082), but I'd like to add to this: > if you find yourself copying an entire method and only changing a small piece of the code, you can consider tackling it with inversion of control If you find yourself copying and pas...
I just noticed that Chromium was installed in AppData in both Vista and XP. If Google does that and if other applications does this, than is that becuase there is some form of protection? Should we write installers that does the same thing as Google?
|windows-installer|windows|
|windows|google-chrome|windows-installer|
Reconnecting JMS listener to JBossMQ
|java|jboss|jms|jbossmq|
We have a Java listener that reads text messages off of a queue in JBossMQ. If we have to reboot JBoss, the listener will not reconnect and start reading messages again. We just get messages in the listener's log file every 2 minutes saying it can't connect. Is there something we're not setting in our code or in JBossM...
The Chrome installer really ought to allow global installation (with elevation) in addition to per-user. I don't want to have to maintain an installation for every user; I want to be able to centrally manage upgrades and so on. Chrome doesn't allow that. That said, the option to install per-user is quite nice, as ...
I think your best bet is to use Rewritable media for this. You can create your application easily, like HTML site or something like that, and after the last link or last page, however you decide to do you could execute a script with some command-line burner that would erase the rewritable media, or even write an ISO th...
I think your best bet is to use Rewritable media for this. You can create your application easily, like HTML site or something like that, and after the last link or last page, however you decide to do you could execute a script with some command-line burner that would erase the rewritable media, or even write an ISO th...
I think trying to use XmlHttpRequest will be a huge headache, unless its the type of headache you don't mind - to do it properly you're almost reinventing the wheel. Then again, people like to reinvent wheels in their spare time, just to say, "Hey, I did it". Not me... I would get a framework like prototype or Ex...
If you will be deploying on IIS 6 or IIS 7, just use the built-in IIS compression. We're using it on production sites for compressing HTML, CSS, and JavaScript with no errors. It also caches the compressed version on the server, so the compression hit is only taken once.
From the [Sql 2005 February 2007 Feature Pack][1]: > The Microsoft OLE DB Provider for DB2 is a COM component for integrating vital data stored in IBM DB2 databases with new solutions based on Microsoft SQL Server 2005 Enterprise Edition and Developer Edition. SQL Server developers and administrators can use the pro...
You can use the extended syntax: preg_match("/ test /x", $foo, $bar);
Whether you do it in classes or in a more procedural style, you simply need to check to ensure that: 1. There is a session; 2. That the session is valid; and, 3. That the user in possession of the session has proper privileges. You can encapsulate all three steps into one function (or a static method in a Sessi...
The XPath for this is: > /books/book/authors/author[contains(., > 'Ritchie')] In C# the following code would return "Ritchie, Dennis M.": xmlDoc.SelectSingleNode("/books/book/authors/author[contains(., 'Ritchie')]").InnerText;
The XPath for this is: /books/book/authors/author[contains(., 'Ritchie')] In C# the following code would return "Ritchie, Dennis M.": xmlDoc.SelectSingleNode("/books/book/authors/author[contains(., 'Ritchie')]").InnerText;
TFS Lifecycle Management for Build Environment
|tfs|msbuild|
How would you manage the lifecycle and automated build process when some of the projects (C# .csproj projects) are part of the actual build system? Example: A.csproj is a project that uses MSBuild tasks that are implemented in BuildEnv.csproj. Both projects are part of the same product (meaning, BuildEnv.csproj fr...
I don't think that the well-known spoofability of MAC addresses is an issue in this case. I think tweakt is just wanting to use them for initial identification. The device can read its own MAC address, and the installer can (as long as it's printed on a label) read the same number and know, "OK - this is the box that I...
G'day, A good static analysis tool for security is [FlawFinder][1] written by David Wheeler. It does a good job looking for various security exploits, However, it doesn't replace having a knowledgable someone read through your code. As David says on his web page, "A fool with a tool is still a fool!" HTH. c...
Please tell me what are you doing to /boot that you need more than 64MB on it? Unless you never intend to clean it, anything more is a waste of space. Kernel image + initrd + System.map won't take more than 10MB (probably less - mine weight 5MB) and you really don't need to keep more than two spares. And with the cu...
As everyone else has said, it most certainly would not be faster to add an index than it would be to do a full scan of that column. However, I would suggest tracking the query pattern and find out which column(s) are searched for the most, and add indexes at least for them. You may find out that 3-4 indexes speeds ...
I don't think there's anything magic about what you're doing here - couldn't what you're doing be described as: "At production we burn a unique number into each of our devices which is both readable by the end user (it's on the label) and accessible to the internal processor. Our users have to enter this number int...
If you are gonna be working through a release cycle, big feature, you get marooned to a branch. Otherwise we work in trunk, and branch for every production release at the moment we build. Previous production builds are moved at that time to old_production_<currentbuildlabel> and current prod release is always just ...
You may get both added and removed lines with git log, like: git log --shortstat --reverse --pretty=oneline From this, you can write a similar script to the one you did using this info. In python: #!/usr/bin/python """ Display the per-commit size of the current git branch. """ ...
There is no way (that I know of) to do what you ask with typical WinForms. If you're doing custom painting/drawing, you can zoom that by using a zoom transform, but so far as I know there is no "Zoom" property for the form in the entire world of .NET and native Windows/C++ APIs combined. You could probably rig so...
I'm not familiar with the specific services listed, but the field of natural language processing has developed a number of techniques that enable this sort of information extraction from general text. As Sean stated, once you have candidate terms, it's not to difficult to search for those terms with some of the other ...
I think your best bet is to use Rewritable media for this. You can create your application easily, like HTML site or something like that, and after the last link or last page, however you decide to do you could execute a script with some command-line burner that would erase the rewritable media, or even write an ISO th...
The only tool I found is [Kaxaml][1], which does nice formatting ("XAML Scrubber" entry in the left menu), but being a stand-alone editor doesn't quite make the cut. [1]: http://www.kaxaml.com/
You can't pass parameters to user scripts — instead, user scripts operate on the context you're working in (e.g. the selected file, the selected text, etc.). You should use the context to determine what the user really wants.
How do I become "test infected" with TDD?
|unit-testing|testing|tdd|
I keep reading about people who are "test infected", meaning that they don't just "get" TDD but also can't live without it. They've "had the makeover" as it were. The question is, how do I get like that?
In C foo() and foo(void) are different functions. foo() accepts an infinite number of arguments, while foo(void) accepts 0 arguments. In C++ they mean the same thing. I suggest that you use void consistently when you mean no arguments. If you have a variable a, "extern int a;" is a way to tell the compiler that 'a' ...
How about some simple testing? Used the code below: long start = System.currentTimeMillis(); String a = "a"; String b = "b"; for (int i = 0; i < 10000000; i++) { //ten million times String c = a.concat(b); } long e...
where year(date1) = year(date2) and month(date1) = month(date2) and day(date1) = day(date2)
* You should add delimiters: the first character of the regex will be used to indicate the end of the pattern. * You should add the 'x' flag. This has the same result as putting (?x) at the beginning, but it is more readable imho.
Is it only CSS files that get corrupted? Do JS files (or any other static text files) come through ok? Also can you duplicate the behavior if you browse directly to the CSS file? I've only enabled compression on Windows 2003 server's IIS using this approach: 1. IIS → Web Sites → Properties → Service tab, ch...
As Cheekysoft suggests, I would tend to move all major exceptions into an ExceptionHandler and let those exceptions bubble up. The ExceptionHandler would render the appropriate view for the type of exception. Any validation exceptions however should be handled in the view but typically this logic is common to man...
These are not really opposite choices. You will have to include the checking code anyway. I read your question as procedural programming vs. OO programming. Writing a few lines of code, or a function, and including it in your page header was how things were done in PHP3 or PHP4. It's simple, it works (that's how we ...
My main Mac is a MacBook, juiced with 4GB of RAM, and I find that perfectly good for development (in either Windows or OSX). I could have got an iMac for a bit more money, but I already had a 20" LCD monitor laying around, and I wanted the portability. The MacBooks are as powerful as the iMacs (excluding the graphic...
Windows Home Server versus Vista Backup and Restore Center
|windows-vista|backup|home-server|
I've been using Window Home Server for my backups here at home for most of a year now, and I'm really pleased with it. It's far better than the software I was using previously (Acronis). I'm thinking about a backup strategy for my work machine and I'd like to know how WHS compares with Vista's built-in backup and res...
No, but a wrapper is rather trivial: public class ReadOnlyDictionary<TKey, TValue> : IDictionary<TKey, TValue> { IDictionary<TKey, TValue> _dict; public ReadOnlyDictionary(IDictionary<TKey, TValue> backingDict) { _dict = backingDict; } public voi...
No, but a wrapper is rather trivial: public class ReadOnlyDictionary<TKey, TValue> : IDictionary<TKey, TValue> { IDictionary<TKey, TValue> _dict; public ReadOnlyDictionary(IDictionary<TKey, TValue> backingDict) { _dict = backingDict; } public voi...
As I understand it, random access is in constant time for both Python's dicts and lists, the difference is that you can only do random access of integer indexes with lists. I'm assuming that you need to lookup a node by its label, so you want a dict of dicts. However, on the performance front, loading it into memor...
Inversion of Control is what you get when you program callbacks, e.g. like a gui program. For example, in an old school menu, you might have: print "enter your name" read name print "enter your address" read address etc... store in database thereby controlling the flow of user inte...
Recursion is a method of solving problems based on the divide and conquer mentality. The basic idea is that you take the original problem and divide it into smaller (more easily solved) instances of itself, solve those smaller instances (usually by using the same algorithm again) and then reassemble them into the fina...
How about some simple testing? Used the code below: long start = System.currentTimeMillis(); String a = "a"; String b = "b"; for (int i = 0; i < 10000000; i++) { //ten million times String c = a.concat(b); } long e...
The win32 api has a function called [waveInGetNumDevs][1] for it. [1]: http://msdn.microsoft.com/en-us/library/ms713732(VS.85).aspx
Multiple threads and performance on a single CPU.
|performance|multithreading|
Is here any performance benefit to using multiple threads on a computer with a single CPU that does not having hyperthreading?
C# Console?
|c#|.net|console|
Does anyone know if there is a c# Console app, similar to the Python or Ruby console? I know the whole "Compiled versus Interpreted" difference, but with C#'s reflection power I think it could be done.
|c#|.net|console|interactive|
Does anyone know if there is a c# Console app, similar to the Python or Ruby console? I know the whole "Compiled versus Interpreted" difference, but with C#'s reflection power I think it could be done. **UPDATE** Well, it only took about 200 lines, but I wrote a simple one...It works a lot like osql. You enter comm...
In terms of speed of computation, No. In fact things will slow down due to the overhead of managing the threads. In terms of responsiveness, yes. You can for example have one thread wait on an IO operation and have another run a GUI at the same time.
The [LVN_ODCACHEHINT][1] notification message will let you know how many items it is going to ask. This could help you in deciding how big your cache should be. [1]: http://msdn.microsoft.com/en-us/library/bb774855(VS.85).aspx
How to start coding the "Dining Philosophers Problem" simulation?
|c#|puzzle|deadlock|homework|