instruction
stringlengths
0
30k
Red-Gate [SQL Data Compare][1] will do this. Just create a blank data base with the same schema, and run a compare against the original and the blank database. It will generate scripts to insert all of your test data. [1]: http://www.red-gate.com/products/SQL_Data_Compare/index.htm
OK, I see. Well, as far as I know there isn't any code generator for Python. There is a good introduction on how to roll your own [here][1]. Actually, that's quite an under-used part of the environment, I suppose it's so because it needs you to use the IDE to compile the project, as it'd seem only the IDE knows abou...
I don't know the answer to your question, but I would highly recommend Add-In Express for doing the addin. See <http://www.add-in-express.com/add-in-net/>. I've used this in many projects, including some commercial software and it is completely awesome. It does all the Outlook (and office) integration for you so y...
If you like Eclipse for Java, I suggest Eclipse CDT. Despite C/C++ support isn't so powerful as is for Java, it still offers most of the features. It has a nice feature named Managed Project that makes working with C/C++ projects easier if you don't have experience with Makefiles. But you can still use Makefiles. I ...
Verging on religious but I would say that you're painting an overly grim picture of the state of modern OOP. I would argue that it actually **has** reduced costs, made large software projects manageable, and so forth. That doesn't mean it's solved the fundamental problem of software messiness, and it doesn't mean the a...
Finally always gets called, regardless of if the exception was correctly caught in catch(), or in fact if you have a catch at all.
In Java: Finally always gets called, regardless of if the exception was correctly caught in catch(), or in fact if you have a catch at all.
From [Marco Russo][1] NorthwindDataContext dc = new NorthwindDataContext(); dc.Log = Console.Out; var query = from c in dc.Customers where !(from o in dc.Orders select o.CustomerID) .Contains(c.CustomerID) select c; foreach (var c in quer...
Rss feed for game programmer?
|graphics|rss|ai|feed|
I was browsing [this thread][1], which has good recommendation but a bit too general for me. So, if anyone has a collection of nice game programming feeds,please share them. :) (both general and specific topics are welcome) [1]: http://stackoverflow.com/questions/5119/what-are-the-best-rss-feeds-for-programm...
use the Except extension method. var items1 = new List<string> { "Apple","Orange","Banana" }; var items2 = new List<string> { "Grapes","Apple","Kiwi" }; var excluded = items1.Except(items2);
I used [http://www.gamedev.net/][1] in college a lot, especially the [NeHe Tutorials][2] [1]: http://www.gamedev.net/ [2]: http://nehe.gamedev.net/
Here's a more simple version of the same thing, you don't need to nest the query: List<string> items1 = new List<string>(); items1.Add("cake"); items1.Add("cookie"); items1.Add("pizza"); List<string> items2 = new List<string>(); items2.Add("pasta"); items2.Add("pizza"); var...
Learn how the *Anchor* and *Dock* properties work on your controls, leave anything that can *AutoSize* itself alone, and use a <code>TableLayoutPanel</code> when you can. If you do these three things, you'll get a lot of the WPF design experience in Windows Forms. A well-designed <code>TableLayoutPanel</code> will ...
Keep in mind that a part of a Work Item Type definition for TFS is the definition of it's "Workflow" meaning the states the work item can be and the transitions between the states. This can be secured by security role. So - generally speaking - a "Change Request" would be initiated and approved by someone relativel...
You can find a good step by step detailed tutorial here: [http://www.eclipsepluginsite.com/][1] A decent book, that I've used is "[Eclipse: Building Commercial-Quality Plug-Ins][2]". [1]: http://www.eclipsepluginsite.com/ [2]: http://www.amazon.com/gp/product/0321228472/ref=cm_rdp_product/103-6772661-...
You can find a good step by step detailed tutorial here: [http://www.eclipsepluginsite.com/][1] Other tutorials: [http://www.ibm.com/developerworks/opensource/library/os-eclipse-snippet/index.html?ca=dgr-lnxw16RichEclipse][2] [http://www.vogella.de/articles/EclipsePlugIn/article.html][3] A decent book, t...
Sounds to me like your system is working, just not as well as you'd like. Is this a paid project? If it is, you could make pay be a meritocracy. Pay people based on how much of the work they get done. This would encourage cross discipline work. Although, it might also encourage people to work on pieces that weren't the...
javac will warn of return in finally if you use the -Xlint:finally. Originally javac emitted no warnings - if something is wrong with the code, it should fail to compile. Unfortunately backwards compatibility means that unanticipated ingenious foolishness cannot be prohibited. Exceptions can be thrown from finally b...
Adding control structures and returns to finally{} blocks are just another example of "just because you can" abuses which are scattered throughout virtually all development languages. Jason was right in suggesting it could easily become a maintenance nightmare - the arguments against early returns from functions apply...
|c#|
So I'm using an IDataReader to hydrate some business objects, but I don't know at runtime exactly what fields will be in the reader. Any fields that aren't in the reader would be left null on the resulting object. How do you test if a reader contains a specific field without just wrapping it in a try/catch?
How do I get javadoc to link to the Java API using an Ant task?
|ant|javadoc|
Right now my ant task looks like. <javadoc sourcepath="${source}" destdir="${doc}"> <link href="http://java.sun.com/j2se/1.5.0/docs/api/" /> </javadoc> And I'm getting this warning: javadoc: warning - Error fetching URL: http://java.sun.com/j2se/1.5.0/docs/api/package-list How do I get...
Use the process template editor, available as part of the [Visual Studio Team System 2008 Team Foundation Server Power Tools](http://msdn.microsoft.com/en-ca/tfs2008/bb980963.aspx).
Does this help? //get the full location of the assembly with DaoTests in it string fullPath = System.Reflection.Assembly.GetAssembly(typeof(DaoTests)).Location; //get the folder that's in string theDirectory = Path.GetDirectoryName( fullPath );
[A-star][1] with a specially crafted cost (G score) and heuristic (H score) function can handle it. For the cost you could keep track of the number of direction changes in the path and add infinite cost on the second change (ie. cut off the search for those branches). The heuristic takes some more thought, especi...
[A*][1] with a specially crafted cost (G score) and heuristic (H score) function can handle it. For the cost you could keep track of the number of direction changes in the path and add infinite cost on the second change (ie. cut off the search for those branches). The heuristic takes some more thought, especially...
David, thanks for the suggestions. I spent the weekend trialing the programs. Doxygen seems to be the most comprehensive of the 3, but it still leaves some things to be desired in regard to callers of methods. All 3 seem to have problems with C++ templates to varying degrees. CC-Rider simply crashed in the middle...
I think the easiest response is to: select top N points from users order by points desc If you want to put that in a stored proc which takes N as a parameter, then you'll either have to do read the SQL into a variable then execute it, or do the row count trick: declare @SQL nvarchar(2000) set...
@Espo thanks for the reality check - added the sub-select to correct for that. I think the easiest response is to: select userid, points from users where points in (select distinct top N points from users order by points desc) If you want to put that in a stored proc which takes N as a parameter, the...
Here's an example for the hidden div way: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style> *[data-when-js-is-on] { display: none; } </style> <script> ...
Are there any guidelines for designing user interface for mobile devices?
|user-interface|windows-mobile|usability|
There are three ways to submit a form that should be covered. Use both David McLaughlin's and Jimmy's suggestions. One will disable the submit button form element while the other disables the basic HTML form submit. For the third, these won't disable Javascript from doing a form.submit(). The `OnSubmit="return fa...
Do something like: //*[ends-with(name(), 'fu')] For a good XPath reference, check out the [W3Schools tutorial][1]. [1]: http://www.w3schools.com/Xpath/xpath_functions.asp
Instead of pointing www.yourdomain.com/test at your test server, why not use test.yourdomain.com? Assuming you have access to the DNS records for yourdomain.com, you should just need to create an A record mapping test.yourdomain.com to your test server's IP address.
I like **General Software** * [Stackoverflow][1] (perhaps too obvious) * [Deep Fried Bytes][2] * [Hanselminutes][3] **Dot Net** * [Alt.NET Podcast][4] * [Polymorphic Podcast][5] **Productivity** * [43 Folders][6] [1]: http://blog.stackoverflow.com/category/podcasts/ [2]: http://deepfriedb...
I like **General Software** * [Stackoverflow][1] (perhaps too obvious) * [Deep Fried Bytes][2] * [Hanselminutes][3] * [Software Engineering Radio][4] (via Brenden) **Dot Net** * [Alt.NET Podcast][5] * [Polymorphic Podcast][6] **Productivity** * [43 Folders][7] [1]: http://blog.stackoverflow...
I like **General Software** * [Stackoverflow][1] (perhaps too obvious) * [Deep Fried Bytes][2] * [Hanselminutes][3] * [Software Engineering Radio][4] (via Brenden) * [Herding Code][5] **Dot Net** * [Alt.NET Podcast][6] * [Polymorphic Podcast][7] **Productivity** * [43 Folders][8] [1]: http...
What are the Java regular expressions for matching IPv4 and IPv6 strings?
|java|regex|
Looking for a string to pass to String#matches(String) that will match IPv4, and another to match IPv6.
why are all links in my site are red, in google chrome and safari?
|css|google-chrome|safari|webkit|
just started using google chrome, and noticed in parts of our site, all the links on the page are bright red. They should be black with a dotted underline. Is there some gotcha in webkit rendering that turns all links red regardless of style?
Adding control structures and returns to finally{} blocks are just another example of "just because you can" abuses which are scattered throughout virtually all development languages. Jason was right in suggesting it could easily become a maintenance nightmare - the arguments against early returns from functions apply...
As others have pointed out, TFS gives you a lot more features then SVN does in the form of project management and such. Having used both, and worked with very large companies in implementing TFS, here's my two cents. 1) If you are using TFS 2005, upgrade to TFS 2008. You'll thank me. There are a ton of improvements ...
Since Agile development is about transparency and accountability it sounds like the testers should have assigned tasks that account for their velocity. Even if that means they have a task for surfing the web waiting for testing (though I would think they would be better served developing test plans for the dev team's ...
List<int> list = new List<int> { 1, 3, 5 }; list.ForEach(x => Console.WriteLine(x)); Edit: Dammit! took too long to open visual studio to test it.
I've never used Morotolla's SDK but from my limited work in JME the real hook in the 3rd party tools are the emulators. Setting up a JME dev environment quickly is something that Sun got surprisingly right. Just get NetBeans with the JME pack and there is a regular emulator right in the IDE, and then you can hook in ot...
[as3corelib][1] has the [DateUtil][2] class and it should be pretty reliable since it's written by some Adobe employees. [1]: http://code.google.com/p/as3corelib/ [2]: http://as3corelib.googlecode.com/svn/trunk/docs/com/adobe/utils/DateUtil.html
[as3corelib][1] has the [DateUtil][2] class and it should be pretty reliable since it's written by some Adobe employees. I haven't encountered any problems with it. [1]: http://code.google.com/p/as3corelib/ [2]: http://as3corelib.googlecode.com/svn/trunk/docs/com/adobe/utils/DateUtil.html
We've also run across this error and figured out that we were killing a SQL server connection from the database server. The client application is under the impression that the connection is still active and tries make use of that connection, but fails because it was terminated.
SQL Server Random Sort
|sql-server|
What is the best way to sort the results of a sql query into a random order within a stored procedure?
Is business logic subjective?
|business-logic|
I have a team lead who seems to think that business logic is very subjective, to the point that if my stored procedure has a "WHERE ID = @ID" -- he would call this *business logic* What approach should I take to define *business logic* in a very objective way without offending my team lead?
I use this code to keep my workstation from locking. It's currently only set to move the mouse once every minute, you could easily adjust it though. It's a hack, not an elegant solution. import java.awt.*; import java.util.*; public class Hal{ public static void main(String[] args) thr...
assembly.GetFiles()[0].Name
How to make git ignore changes in case?
|git|windows|
I am creating an application for a Windows Mobile computer. The catch is that the device (<a href="http://www.motorola.com/business/v/index.jsp?vgnextoid=d4397b103d175110VgnVCM1000008406b00aRCRD">Motorola MC17</a>) does not have a touch screen or universal keys - there are only six programmable hardware keys. <a href="...
I think [portaudio][1] is what you need. Reading from the mike from a console app is a 10 line C file (see patests in the portaudio distrib). [1]: http://www.portaudio.com/
The article referred to by @Lee Theobald is a good start. Some basic ideas I try to keep in mind when marking up: **Regarding html:** Try to write for the next person - that is, think about how easy or difficult it might be for someone else to come and pick up your work and carry on. To support this princi...
I got a solution playing with joins. The query is: SELECT page.id AS id, page.name AS name, tagstable.tags AS tags FROM page LEFT OUTER JOIN (SELECT pagetag.pageid, GROUP_CONCAT(distinct tag.name) as tags FROM tag INNER JOIN pagetag ON tagid=tag.id GROUP BY pagetag.pageid) AS tagstable ON tagstable....
I'd go with [Scratch][1], some points regarding it. - It's a graphical programming language. It isn't text based (this might be positive or negative). It does make it more intuitive and easy for kids (7 and up). - It's actually highly object. The objects you write these graphical scripts have the code...
About your first question... List, Map and Set serve different purposes. I suggest reading about the Java Collections Framework at [http://java.sun.com/docs/books/tutorial/collections/interfaces/index.html][1]. To be a bit more concrete: - use List if you need an array-like data structure and you need to itera...
Good guidance there from my former colleage Guy Starbuck. Another thing to add with that approach - you may have decided over time that you want to refactor the way your application is organized (folders etc) and this will give you an oppurtunity to do so. I've been in situations where we organized a solution hapha...
Only a good amount of accumulated statistics from previous projects can help you to give precise estimates. If you have a well defined set of requirements, you can make a rough calculation of how many test cases you have. As I said you need to have some statistics for your team. You need to know average bugs-per-loc nu...
It seems you have misplaced the parameters in File.Copy(), it should be File.Copy(string source, string destination). Also is "C:\Test2" a directory? You can't copy file to a directory. Use something like that instead: <pre> File.Copy( sourceFile, Path.Combine(destinationDir,Path.GetFileName(sourceFi...
Haskell's algebraic data types
|functionalprogramming|haskell|types|type-systems|type-theory|
I trying to grok all of Haskell's concepts. In what ways are algebraic data types similar to generic types, e.g., in C# and Java? And how are they different? What's so algebraic about them anyway? I'm familiar with universal algebra and its rings and fields, but I only have a vague idea of how Haskell's types wo...
|functional-programming|haskell|types|type-systems|type-theory|
Beginners Guide to Haskell?
|functionalprogramming|haskell|
I've been looking for a decent guide to Haskell for some time, but haven't been able to find one that seems interesting enough to read through and/or makes sense. I've had prior exposure to Haskell a few years back, but I can't remember much about it. I remember the "Aha!"-feeling was incredible when I finally got i...
|functional-programming|haskell|
Useful code which uses reduce() in python
|python|functionalprogramming|
Do anyone here have any useful code which uses reduce() function of python? Is there any code other than the usual + and * that we see in the examples? Refer [Fate of reduce() in Python 3000][1] by GvR [1]: http://www.artima.com/weblogs/viewpost.jsp?thread=98196
|python|functional-programming|
What's a good beginning text on functional programming?
|functionalprogramming|lisp|scheme|gettingstarted|
I like to study languages outside my comfort zone, but I've had a hard time finding a place to start for functional languages. I heard a lot of good things about [Structure and Interpretations of Computer Programs][1], but when I tried to read through it a couple of years ago it just seemed to whiz over my head. I do...
I'd go with [Scratch][1], some points regarding it. - It's a graphical programming language. It isn't text based (this might be positive or negative). It does make it more intuitive and easy for kids (7 and up). - It's actually highly object. The objects you write these graphical scripts have the code...
When I have used Doxygen it has produced a full list of callers and callees. I think you have to turn it on.
> pagetag.id and group_concat(tag.name) will be null for page 4 in the example you've posted above, but the page shall appear in the results. You can use the [`COALESCE`][1] function to remove the Nulls if you need to: select COALESCE(pagetag.id, '') AS id ... It will return the first non-null value from i...
The [Tango project][1] has some good icons For areas that only need 16x16, the silk icons from [famfamfam][2] are good too Both are Creative Commons licensed [1]: http://tango.freedesktop.org/Tango_Desktop_Project [2]: http://www.famfamfam.com/lab/icons/
How do you manage SQL Queries
|php|sql|mysql|
At the moment my code (PHP) has too many SQL queries in it. eg... // not a real example, but you get the idea... $results = $db->GetResults("SELECT * FROM sometable WHERE iUser=$userid"); if ($results) { // Do something } I am looking into using stored procedures to reduce this and m...
One of the best method to generate a random number is through [Clock Drift][1]. This primarily works with two oscillators. An analogy of how this works is imagine a race car on a simple oval circuit with a while line at the start of the lap and also a while line on one of the tyres. When the car completes a lap, a n...
**AIGameDev.com:** [http://feeds.aigamedev.com/AiGameDev][1] [1]: http://feeds.aigamedev.com/AiGameDev
If you have a Domino / Lotus Notes client installed on the same machine, you can use COM. Just do a Google search on 'Accessing the Domino Objects through COM' and you'll find the Domino Designer help entry for just about any version of Domino. You can also access Domino via the C API, but wouldn't recommend it. V...