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 about these "generators", but MSBuild ignores them.
[1]: http://www.drewnoakes.com/snippets/WritingACustomCodeGeneratorToolForVisualStudio/ |
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 you just work with it like any toolbar and just focus on the specifics of what you need it to do. You won't ever have to worry about the Outlook extensibility at all. Highly recommended.
Anyway, just wanted to mention it as something to look in to. It will definitely save some headaches if you're comfortable with using a 3rd party component in the project. |
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 do C and Java coding and I'm really happy with CDT. I'm developing the firmware for a embedded device in C and a application in Java that talks to this device, and is really nice to use the same environment for both. I guess it probably makes me more productive.
|
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 average developer is an OOP expert. But the modularization of function into object-components has certainly reduced the amount of spaghetti code out there in the world.
I can think of dozens of libraries off the top of my head which are beautifully reusable and which have saved time and money that can never be calculated.
But to the extent that OOP has been a waste of time, I'd say it's because of lack of programmer training, compounded by the steep learning curve of learning a language specific OOP mapping. Some people "get" OOP and others never will. |
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 query) Console.WriteLine( c );
[1]: http://programminglinq.com/blogs/marcorusso/archive/2008/01/14/the-not-in-clause-in-linq-to-sql.aspx |
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-programmersdevelopers |
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 results = from item in items1
where items2.Contains(item)
select item;
foreach (var item in results)
Console.WriteLine(item); //Prints 'pizza' |
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 do its best to size the controls so that they fit the form properly. Combined with *AutoSize* controls, docking, and the *AutoScaleMode* mentioned by Soeren Kuklau you should be able to make something that scales well. If not, your form might just have too many controls on it; consider splitting it into tab pages, floating toolboxes, or some other space.
In WPF it's a lot easier because the concept of auto-sizing controls is built-in; in most cases if you are placing a WPF element by using a coordinate pair you are doing it wrong. Still, you can't change the fact that at lower resolutions it doesn't take much 120 dpi text to fill up the screen. Sometimes the problem is not your layout, but an attempt to put too much into a small space. |
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 relatively high up in an organization (someone with "Sponsorship" rights related to spending the resources to make a (possibly very large) change to the system. Ultimately this person would be the one to approve that the change was made successfully.
For a "Bug" however, ANY user of the application should be able to initiate a Bug.
At an organization I implemented TFS at, only Department Heads can be the originators of a "Change Request" - but "Bugs" were created from "Help Desk" tickets (not automated, just through process...) |
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-6782251 |
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, that I've used is "[Eclipse: Building Commercial-Quality Plug-Ins][4]".
[1]: http://www.eclipsepluginsite.com/
[2]: http://www.ibm.com/developerworks/opensource/library/os-eclipse-snippet/index.html?ca=dgr-lnxw16RichEclipse
[3]: http://www.vogella.de/articles/EclipsePlugIn/article.html
[4]: http://www.amazon.com/gp/product/0321228472/ref=cm_rdp_product/103-6772661-6782251 |
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 theirs to begin with, or internal sabotage.
Obviously, you'd have to be on the lookout for people trying to game the system, but it might work. Surely testers wouldn't want to earn half of what devs do. |
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 blocks, but in that case the exhibited behaviour is almost certainly what you want. |
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 more-so to this case of "late returns".
Finally blocks exist for one purpose, to allow you to completely tidy up after yourself, no matter what happened in all the proceeding code. Principally this is closing / releasing file pointers, database connections etc., though I could see it being stretched to say adding in bespoke auditing.
Anything that affects the return of the function should lie in the try{} block. Even if you had a method whereby you checked an external state, did a time consuming operation, then checked that state again in case it became invalid, you would still want the second check inside the try{} - if it sat inside finally{} and the long operation failed, you would then be checking that state a second time needlessly. |
|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 the javadoc to properly link to the API? I am behind a proxy. |
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, especially when you want to keep the heuristic admissible (never overestimates minimum distance to goal) and monotonic. (Only way to guarantee A* finds an optimal solution.)
Maybe there is more information about the domain available to create the heuristic? (ie. x,y coordinates of the nodes in the graph?)
Of course, depending on the size of the graph you want to solve, you could first try simpler algorithms like breadth first search or Dijkstra's algorithm: basically every search algorithm will do, and for every one you will need a cost function (or similar) anyway.
[1]: http://en.wikipedia.org/wiki/A*_search_algorithm |
[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 when you want to keep the heuristic admissible (never overestimates minimum distance to goal) and monotonic. (Only way to guarantee A* finds an optimal solution.)
Maybe there is more information about the domain available to create the heuristic? (ie. x,y coordinates of the nodes in the graph?)
Of course, depending on the size of the graph you want to solve, you could first try simpler algorithms like breadth first search or Dijkstra's algorithm: basically every search algorithm will do, and for every one you will need a cost function (or similar) anyway.
[1]: http://en.wikipedia.org/wiki/A*_search_algorithm |
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 of the analysis and CodeDrawer does not show many of the relationships. Doxygen worked pretty well, but it too did not find and show all relations and instead overwhelmed me with lots of macro references until I filtered them out.
So, maybe I should clarify "large codebase" a bit for eventual other suggestions: >100k lines of code overall spread out over more than 100 template files plus several actual class files pulling it all together.
Any other tools out there, that might be up to the task and could do better (more thoroughly)? Oh and specifically: anything that understands IDL and COM interfaces? |
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 @SQL = "select top " + @N +" points from users order by points desc"
execute @SQL
or
SELECT UserID, Points
FROM (SELECT ROW_NUMBER() OVER (ORDER BY points DESC)
AS Row, UserID, Points FROM Users)
AS usersWithPoints
WHERE Row between 0 and @N
Both examples assume SQL Server and haven't been tested. |
@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, 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 @SQL = "select userID, points from users "
set @SQL = @SQL + " where points in (select distinct top " + @N
set @SQL = @SQL + " points from users order by points desc)"
execute @SQL
<strike>or
SELECT UserID, Points
FROM (SELECT ROW_NUMBER() OVER (ORDER BY points DESC)
AS Row, UserID, Points FROM Users)
AS usersWithPoints
WHERE Row between 0 and @N
</strike>
Both examples assume SQL Server and haven't been tested. |
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>
document.getElementsByTagName("style")[0].textContent = "";
</script>
</head>
<body>
<div data-when-js-is-on>
JS is on.
</div>
</body>
</html>
(You'd probably have to tweak it for poor IE, but you get the idea.) |
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 false"` method only applies when a user clicks the submit button or presses Enter in a input form element. Client side scripting will need to be handled as well. |
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://deepfriedbytes.com/
[3]: http://www.hanselminutes.com/
[4]: http://altnetpodcast.com/
[5]: http://www.polymorphicpodcast.com/
[6]: http://www.43folders.com/podcast |
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.com/category/podcasts/
[2]: http://deepfriedbytes.com/
[3]: http://www.hanselminutes.com/
[4]: http://www.se-radio.net/
[5]: http://altnetpodcast.com/
[6]: http://www.polymorphicpodcast.com/
[7]: http://www.43folders.com/podcast |
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://blog.stackoverflow.com/category/podcasts/
[2]: http://deepfriedbytes.com/
[3]: http://www.hanselminutes.com/
[4]: http://www.se-radio.net/
[5]: http://herdingcode.com/
[6]: http://altnetpodcast.com/
[7]: http://www.polymorphicpodcast.com/
[8]: http://www.43folders.com/podcast |
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 more-so to this case of "late returns".
Finally blocks exist for one purpose, to allow you to completely tidy up after yourself, no matter what happened in all the preceeding code. Principally this is closing / releasing file pointers, database connections etc., though I could see it being stretched to say adding in bespoke auditing.
Anything that affects the return of the function should lie in the try{} block. Even if you had a method whereby you checked an external state, did a time consuming operation, then checked that state again in case it became invalid, you would still want the second check inside the try{} - if it sat inside finally{} and the long operation failed, you would then be checking that state a second time needlessly. |
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 in TFS 2008 that make it workable.
2) If you live in Visual Studio and you want the IDE integration, go with TFS. I've used SVN integration and almost always drop back to using TortoiseSVN.
3) If you like the idea of accounts being integrated with Windows Authentication, go with TFS. The manageability from that end is nice. There may be hooks for SVN - I'm not positive, but if you like the GUI driven management, TFS is hard to beat.
4) If you need to track metrics or have easier ways of implementing things like check-in policies, go with TFS.
5) If you have people who won't implement it if it isn't MSFT, go with TFS.
6) If you do more than just .NET (Java work, Eclipse, etc) go with SVN. Yes there are very good products out there (like Teamprise) that work well with TFS. But unless the other languages are a small part of your shop, just stick with SVN.
Outside of that, the SCM features of both are about equivalent. They both do branching and merging, the both do atomic check-ins, they both support renames and moves. I think for people just getting started with the branching and merging concept, having the branches be visible in Source Control Explorer is nice.
TFS really isn't that expensive ($1200 maybe?). Compared to SVN it is, perhaps. The integration to reporting services and SharePoint is nice, but again, if you aren't using that, then it doesn't matter.
What I'd say is to download the 180-day trial of TFS and give it a go. Run a trial side-by-side. I think you'll be happy no matter which way you go. |
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 tasks). This will show the inefficiencies in your organization which isn't popular but that is what Agile is all about. The bad part of that is that your testers may be penalized for something that is a organizational issue.
The company I worked for had two separate (dev and qa) teams with two different iteration cycles. The qa cycle was offset by a week. That unfortunatey led to complexity when it came to task acceptance, since a product wasn't really ready for release until the end of the qa's iteration. That isn't a properly integrated team but neither is yours from the sound of it. Unfortunately the qa team never really followed scrum practices (No real planning, stand up, or retrospective) so I can't really tell if that is a good solution or not. |
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 other proprietary emulators such as those from Motorolla.
Not sure what kind of apps you are looking to do, but if you're interested in games I thought [Beginning Mobile Phone Game Programming][1] was a great starting point:
[1]: http://www.amazon.com/Beginning-Mobile-Phone-Game-Programming/dp/0672326655 |
[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) throws Exception{
Robot hal = new Robot();
Random random = new Random();
while(true){
hal.delay(1000 * 60);
int x = random.nextInt() % 640;
int y = random.nextInt() % 480;
hal.mouseMove(x,y);
}
}
} |
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="http://en.wikipedia.org/wiki/Fitts%27s_law">Fitt's law</a> is not applicable here, most Microsoft guidelines are also moot. For now I'm mimicking Nokia's S60 keyboard layout as close as possible, since it's the most popular phone platform among my target audience.
<img src="http://www.ixbt.com/short/images/motorolaMC17_2.jpg" alt="Motorola MC17"/>
Are there any guidelines for creating a simple, discoverable user interface on such a constrained device? What fonts and colours should I use to make my UI readable? How do I measure if the items on-screen are big enough? What conventions should I follow? |
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 principle, you should try and make sure your markup is as legible as possible - class and id tags in particular should relate *as much as possible* to their intended content. In other words, try to use your tags to describe the kind of content they will have.
For example, "Sub-navigation", "content" etc.
The aim is to provide markup that someone can pickup having not looked at before and get a sense of the logical structure of the document.
Also, try to avoid the addition of markup that is purely to achieve a visual effect. But bear in mind that any website that requires even slightly sophisticated styling is unlikely to be able avoid non-semantic markup, due to weaknesses in current implementations of CSS and browser-compatibility issues.
**Regarding CSS files:**
Many people divide their css up into sections using comments, separating them into functional or structural areas. So you might have a section for your header, your footer, or typography and so on. Others take this further and split css across files, having one for typography, one for layout etc. However, this can according to Yslow! can have a negative impact on page loading, due to increased http requests.
I could write more, but as you can see I struggle to be concise. I hope this is of some use to you.
-Sam |
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.pageid=page.id GROUP BY page.id
And this will be the output:
id name tags
---------------------------
1 page 1 tag2,tag3,tag1
2 page 2 tag1,tag3
3 page 3 tag4
4 page 4 NULL
is it possible to boost the query speed writing it another way?
|
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 attached to them and can be reused and moved around.
- **Very Important**: quick and impressive results. Kids need to get going fast and get results in order to get hooked.
[1]: http://scratch.mit.edu/ |
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 iterate over the elements
- use Map if you need something like a dictionary
- use a Set if you only need to decide if something belongs to the set or not.
About your second question...
The main difference between Vector and ArrayList is that the former is synchronized, the latter is not synchronized. You can read more about synchronization in [Java Concurrency in Practice][2].
The difference between Hashtable (note that the T is not a capital letter) and HashMap is similiar, the former is synchronized, the latter is not synchronized.
I would say that there are no rule of thumb for preferring one implementation or another, it really depends on your needs.
[1]: http://java.sun.com/docs/books/tutorial/collections/interfaces/index.html
[2]: http://www.amazon.com/Java-Concurrency-Practice-Brian-Goetz/dp/0321349601 |
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 haphazardly without thought (let alone major changes in the application) which led to a desire to organize things differently - and the move from VSS to TFS is a great oppurtunity to do so.
As far as the original question:
> And: this migration will for sure mean that our working habits have to be modified in some way. Do you think that this changes could be a problem for the organization? Think to a group of about 20 .net developers, in a single site
I would say - yes your working habits will change but much more for the better.
1. You no should use "Check-out" Locks and "Get-Latest on Check-out".
2. You can now effectively Branch and Merge
3. You will now have "Changesets" all files checked-in at the same time will be grouped together. This makes historical change tracking much easier - but more importantly - rollbacks are much easier (ie find all files checked in at the same time and roll them back)
4. Associating Check-ins to Work Items. Don't overlook Work Items! The biggest mistake you can make is to only use TFS as a VSS replacement. The Build and Project Management features are excellent - you paid for them - USE THEM!
As far as details on how your experience will change, another former colleague of mine (and Team System MVP) Steve St. Jean wrote a detailed article on the differences: [From VSS to TFS][1]
[1]: http://sstjean.blogspot.com/2006/10/document-from-vss-to-tfs-introduction.html |
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 number to estimate total bugs count. If you don't have such numbers for your team, you can use [industry average numbers][1]. After you have estimated LOC (number of test cases * NLOC) and average bugs-per-lines, you can give more or less accurate estimation on time required to release project.
From my practical experience, time spent on bug-fixing is equal or more than time spent on original implementation.
[1]: http://amartester.blogspot.com/2007/04/bugs-per-lines-of-code.html |
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(sourceFile))
)</pre>; |
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 work. |
|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 it, and it was actually fun to play with, so I'm looking to rediscover the lost art of Haskell.
I'm familiar with Ruby and its functional programming tricks, so I think I'm not completely in the dark. Any links? |
|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 way better with books than web sites, but when I visit the local book store the books on LISP look kind of scary.
So what's a good starting point? My goal is to be able to use a functional programming language to solve simple problems in 6 months or so, and the ability to move to more advanced topics, recognize when a functional language is the right tool for the job, and use the language to solve more problems over the course of 2-3 years. I like books that are heavy on examples but also include challenges to work through. Does such a thing exist for functional languages?
[1]: http://www.amazon.com/Structure-Interpretation-Computer-Programs-Second/dp/0070004846/ref=pd_bbs_7?ie=UTF8&s=books&qid=1219429954&sr=8-7 |
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 attached to them and can be reused and moved around.
- **Very Important**: quick and impressive results. Kids need to get going fast and get results in order to get hooked.
I'd like to note that although many of us started programing at a young age in basic or logo and because programmer later in life doesn't mean those are good languages to start with. I think that kids today have much better options, like scratch or Alice.
Text based languages (python, ruby, basic, c# or even c) are dependent on external libraries and tools (editors, compilers) while something like Alice or scratch is all inclusive and will teach kids (not aimed at teens) programming concepts. Later they can move on and expand their learning.
[1]: http://scratch.mit.edu/ |
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 it's list of parameters.
[1]: http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#function_coalesce |
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 make things a little more robust, but I have some concerns..
I have hundreds of different queries in use around the web site, and many of them are quite similar. How should I manage all these queries when they are removed from their context (the code that uses the results) and placed in a stored procedure on the database? |
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 number will be generated based on the difference between the position of the white line on the road and on the tyre.
Very easy to generate and impossible to predict.
[1]: http://en.wikipedia.org/wiki/Hardware_random_number_generator#Clock_drift |
**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. Very messy. You also still need the Domino / Lotus Notes client installed.
If you do _not_ have Domino / Lotus Notes client installed on the same machine and the Domino server is running http, you could also do it via http. This will not be nearly as fast. You would also probably want some custom http views setup on the Domino server to make your life easier. |