instruction
stringlengths
0
30k
There are several key aspects to multi-agent computing, distribution and independence are among them. Multi-agents don't have to be on different machines, they could as @Kyle says, be multiple processes on a single chip or machine, but they act without explicit centralised direction. They might act in concert, so t...
There are several key aspects to multi-agent computing, distribution and independence are among them. Multi-agents don't have to be on different machines, they could as @Kyle says, be multiple processes on a single chip or machine, but they act without explicit centralised direction. They might act in concert, so t...
I really like the telerik radgrid. Their product ain't cheap, but you get a lot of controls and features. And the data binding support is pretty good, both in a simple asp.net data source binding way and in a more custom handle-your-own-databinding-events kind of way.
To be honest, in Java there is not really an argument against overriding [equals()][1]. If you need to compare instances for equality, then that is what you do. As mentioned above, you need to be aware of the contract with [hashCode()][2], and similarly, watch out for the gotchas around the [Comparable][3] interf...
To be honest, in Java there is not really an argument against overriding [equals][1]. If you need to compare instances for equality, then that is what you do. As mentioned above, you need to be aware of the contract with [hashCode][2], and similarly, watch out for the gotchas around the [Comparable][3] interface ...
To be honest, in Java there is not really an argument against overriding *equals*. If you need to compare instances for equality, then that is what you do. As mentioned above, you need to be aware of the contract with *hashCode*, and similarly, watch out for the gotchas around the [Comparable][1] interface - in a...
In our big javascript applications, we write all our code in small separate files - one file per 'class' or functional group, using a kind-of-like-Java namespacing/directory structure. We then have: - A compile-time step that takes all our code and minifies it (using a variant of JSMin) to reduce download size ...
For Windows, I found Microsoft's own free [XML Notepad 2007][1] to be a great simple to use editor with a nice selection of features. Used it for both reviewing my XML output when developing and editing broken iTunes' libraries. ;) Requires .net 2.0 [1]: http://www.microsoft.com/downloads/details.aspx?familyi...
For Windows, I found Microsoft's own free [XML Notepad 2007][1] to be a great simple to use editor with a nice selection of features. Used it for both reviewing my XML output when developing and editing broken iTunes' libraries. ;) Requires .net 2.0 [1]: http://www.microsoft.com/downloads/details.aspx?familyi...
For Windows, I found Microsoft's own free [XML Notepad 2007](http://www.microsoft.com/downloads/details.aspx?familyid=72d6aa49-787d-4118-ba5f-4f30fe913628) to be a great simple to use editor with a nice selection of features. Used it for both reviewing my XML output when developing and editing broken iTunes' libraries....
Sql query, count and group by
|sqlquery|
if i have data like this: Key Name 1 Dan 2 Tom 3 Jon 4 Tom 5 Sam 6 Dan What is the sql query to bring back the records where the Name is repeated 2 or more times. So the result i would want is Tom Dan
|sql|
Couldn't be simpler... Select Name From Table Group By Name Having Count(Name) > 1 I hope that answers your question :)
Couldn't be simpler... Select Name, Count(Name) As Count From Table Group By Name Having Count(Name) > 1 Order By Count(Name) Desc This could also be extended to delete duplicates: Delete From Table Where Key In ( Select ...
why massive lookup table? let me come up with some simple example
why massive lookup table? string GetWrittenInteger(int n) { string[] a = new string[] {"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine" } string[] b = new string[] { "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Ninetee...
How do you pack a visual studio c++ project for release?
|c++|visual-studio|
I'm wondering how to make a release build that includes all necessary dll files into the .exe so the program can be run on a non-development machine without it having to install the microsoft redistributable on the target machine. Without doing this you get the error message that the application configuration is not...
How to convert std::string to LPCWSTR in C++ (Unicode)
|c++|
I'm looking for a method, or a code snippet for converting std::string to LPCWSTR
|c++|winapi|
Have a look at Sharepoint. If cost is an issue, Sharepoint portal sevices can also work for you. [Read this][1] for more info [1]: http://www.isaserver.org/img/upl/spskit/1overview/1overview.htm
There's a very simple way of comparing two arrays using CFML's underlying java. According to a recent blog by Rupesh Kumar of Adobe (http://coldfused.blogspot.com/), ColdFusion arrays are an implementation of java lists (java.util.List). So all the Java list methods are available for CFML arrays. So to compare 2 arr...
I have used ASP.NET MVC (I even wrote a HTTPModule that lets you define the routes in web.config), and I still get a bitter taste in my mouth about it. It seems like a giant step backwards in organization and productivity. Maybe its not for some, but I've got webforms figured out, and they present no challenge to me...
From what I'm seeing, it seems that it's not possible to directly access/ manipulate a Network Place from the command line, be it in PowerShell or the plain ol' command prompt. @slipsec (#13899): Thanks for the suggestion, but PowerShell doesn't support the port number in the destination path any more than the `ne...
Where are you trying to access the property? If you are in onInit, the control may not be loaded yet.
Asp.Net Routing: How do I ignore multiple wildcard routes?
|asp.net|asp.net-mvc|routes|
I'd like to ignore multiple wildcard routes. With asp.net mvc preview 4, they ship with: RouteTable.Routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); I'd also like to add something like: RouteTable.Routes.IgnoreRoute("Content/{*pathInfo}"); but that seems to break some of the helpers that generate ...
Parameterized queries are your friend, as suggested by Matt. Command = SELECT * FROM PEOPLE WHERE SURNAME=? They will protect you from headaches involved with - Strings with quotes - Querying using dates - SQL Injection
Frankly, I have yet to see the first installer that really allows both per-user and per-app installations. Many installers offer this options in their GUI, but the setting only affects where the shortcuts etc. go -- the binaries always fo to %ProgramFiles%. In fact, it is pretty hard to create Windows Installer pack...
Frankly, I have yet to see the first installer that really allows both per-user and per-machine installations. Many installers offer this option in their GUI, but the setting only affects where the shortcuts etc. go -- the binaries always fo to %ProgramFiles%. In fact, it is pretty hard to create Windows Installer p...
In your src folder of the flexbuilder project you should see the generated classes. For instance, if I use the manager to generate the proxy classes for www.example.com you should see the folders /com/example with the generated proxy classes inside. To consume these webservices in ActionScript use the statement: ...
In your src folder of the flexbuilder project you should see the generated classes. For instance, if you use the manager to generate the proxy classes for www.example.com you should see the folders /com/example with the generated proxy classes inside. To consume these webservices in ActionScript use the statement: ...
My favorite Monad tutorial: <http://www.haskell.org/all_about_monads/html/index.html> (out of 170,000 hits on a Google search for "monad tutorial"!) @Stu: The point of monads is to allow you to add (usually) sequential semantics to otherwise pure code; you can even compose monads (using Monad Transformers) and...
Is it possible to list named events in Windows?
|windows|events|
I would like to create events for certain resources that are used across various processes and access these events by name. The problem seems to be that the names of the events must be known to all applications referring to them. Is there maybe a way to get a list of names events in the system? I am aware that I ...
In java I would start with JDepend. .NET NDepend I dont know about c++ though :(
Try to avoid platform-dependent #ifdefs, as they tend to grow exponentially when you add new platforms. Instead, try to organize your source files as a tree with platform-independent code at the root, and platform-dependent code on the "leaves". There is a nice book on the subject, [Multi-Platform Code Management][1]. ...
Is Python good for big software projects (not web based)?
|python|ide|
Right now I'm developing mostly in C/C++, but I wrote some small utilities in Python to automatize some tasks and I really love it as language (especially the productivity). Except for the performances (a problem that could be sometimes solved thanks to the ease of interfacing Python with C modules), do you think i...
Do note that the alt attribute isn't intended to be a tooltip. Alt is for describing the image where the image itself is not available. If you want to use tooltips, use the title attribute instead.
You need at least a decent text editor as a baseline, [emacs with nxml mode][1] as mentioned before is a very good choice. However as the schema becomes larger and larger you may loose the overview, especially when you author an XML Schema document which can be very verbose. You'll need some sort of visualization: XML ...
I'm pretty much writing my own HTML - I'm using the ListView and Masterpages, but not really using the controls much anymore. My ListView laughs at your silly old repeater, by the way. However, bloatware isn't necessarily a bad thing. If I needed a low volume intranet application built, I'd much rather pay a less ex...
DBCC CHECKIDENT('TableName', RESEED, 0)
I've actually used GridView extensively for an adminsitrative console. I even created a custom DataFieldControl that sets the field's header text and sort expression based on data field, creates an Insert row in the bottom and automatically collects the values in the row and forwards them to the data source's insert me...
How about:- var noDupes = list.Distinct().ToList(); In .net 3.5?
Is there a way to parse a dependency tree from a build script output?
|c++|gcc|gnu|linker|
I have an inherited project that uses a build script (not make) to build and link the project with various libraries. When it performs a build I would like to parse the build output to determine what and where the actual static libraries being linked into the final executable are and where are they coming from. T...
While browsing through the options, I found that I had to set "Position each attribute on a separate line" and "Position first attribute on same line as start tag" under "Tools > Options ... > Text-Editor > XAML > Formatting > Spacing" and reset the Keyboard mappings under "Tools > Options ... > Environment > Keyboard"...
You can use mutliple classes in the HTML element's class attribute, each providing part of the styling. So you could define your CSS as: .ourColor { color: blue; } .ourBorder { border: 1px solid blue; } .bigText { font-size: 1.5em; } and then combine the classes as required: <h1 class="ourCol...
Use list comprehensions when the result needs to be iterated over multiple times, or where speed is paramount. Use generator expressions where the range is large or infinite.
Iterating over the generator expression or the list comprehension will do the same thing. However, the list comp will create the entire list in memory first while the generator expression will create the items on the fly, so you are able to use it for very large (and also infinite!) sequences.
It's best to use a combination, and you'll have to use your own judgement. Here's the guidelines I use: * If making a call to external code is part of your code's expected (outward-facing) behavior, this should be tested. Use a mock. * If the call is really an implementation detail which the outside world doesn't...
MVC or WebForms...it's your choice but if I can offer one piece of advice regarding webforms...I know it'll be tempting to start dropping controls and playing with code, but it will help you A LOT if you don't skip over learning about the request and page lifecycles...a couple weeks later you'll thank yourself for spen...
If you're looking for a search plugin specifically for this site, someone will have to write one.
You aren't gonna have a problem running Xcode on an iMac. Any iMac. Any development project can be done on an iMac. They're fast and modern machines. The cheapest iMac has a Dual Core Duo 2 chip with 1 gig RAM. Boost the RAM to 2 if you can (a cheap option - cheaper if you buy 3rd party RAM). Makes a huge difference ru...
When you `throw ex`, you're essentially throwing a new exception, and will miss out on the original stack trace information. `throw` is the preferred method.
You pretty much have to keep the left side of your where clause clean. So, normally, you'd do something like: WHERE MyDateTime >= @activityDateMidnight AND MyDateTime < (@activityDateMidnight + 1) (Some folks prefer DATEADD(d, 1, @activityDateMidnight) instead - but it's the same thing). The Ti...
A shared SAN with failover is a great solution with a great (high) cost. Are there any similar solutions with failover at a reasonable cost? Perhaps something like DRBD for windows? The problem with a simple shared filesystem is the lack of redundancy (what if the fileserver goes down)?
I can't see how licensing would be any different than for a co-lo provider.
Unfortunately, there's no legal way to run OS X in a virtual machine. For developing iPhone apps you probably don't need a particularly beefy machine, so maybe look into grabbing a [mac mini][1]? They're the cheapest Macs you can get, and should probably be just fine for doing iPhone work. Plus, now you have a mac...
The rule of thumb is to avoid Catching and Throwing the basic `Exception` object. This forces you to be a little smarter about exceptions; in other words you should have an explicit catch for a `SqlException` so that your handling code doesn't do something wrong with a `NullReferenceException`. In the real world tho...
If you throw a new exception with the initial exception you will preserve the initial stack trace too.. try{ } catch(Exception ex){ throw new MoreDescriptiveException("here is what was happening", ex); }
@Mike I recently did a test and this is the code I used. I'm not using policy stuff, but I used WS-Security with plain text authentication. CXF has really good documentation on how to accomplish this stuff. I used wsdl2java and then added this code to use the web service with ws-security. I hope this helps y...
Only way I could figure out how to do it without just moving the file and telling the user was to pass it off to the browser. navigateToURL(new URLRequest(File.applicationStorageDirectory.nativePath + "/courses/" + fileName));
Only way I could figure out how to do it without just moving the file and telling the user was to pass it off to the browser. navigateToURL(new URLRequest(File.applicationStorageDirectory.nativePath + "/courses/" + fileName));
That's quite odd, 100 classes really isn't that many. What is the compiler doing when the stack overflows? Is there a useful stack trace generated? What happens if you run `javac` directly on the command line instead of thorugh ant? One possible workaround is to simply increase the size of the stack using the `-Xss`...
This is part of a solution I use on a local intranet. Some of the variables you will have to collect yourself as I pull them from a database but you may pull them from somewhere else. The only extra but I've got in there is a function called **getMimeType** which connects to the database and pulls back the correct m...
[Eric Meyer](http://meyerweb.com) implemented a very similar thing as a WordPress plugin called [WP-GateKeeper](http://meyerweb.com/eric/tools/wordpress/wp-gatekeeper.html) that asks human-readable questions like "What colour is an orange?". He did have some issues around asking questions that a non-native English spe...
You could try using [Alice](http://www.alice.org/). It's a 3D program designed for use in introductory programming classes. The two biggest obstacles for new programmers are often: * syntax errors * motivation (writing something meaningful and fun rather than contrived) Alice uses a drag and drop interface f...
You could try using [Alice](http://www.alice.org/). It's a 3D program designed for use in introductory programming classes. The two biggest obstacles for new programmers are often: * syntax errors * motivation (writing something meaningful and fun rather than contrived) Alice uses a drag and drop interface f...
I use it as well and quite frankly wouldn't want to work without it. I've always had some kind of issue tracker available for the projects I work on and thus am quite used to updating it. With FB6 the process is now even better. Since FB also integrates with Subversion, the source control tool I use for my projec...
Can you use CruiseControl to build Cocoa/Objective-C projects?
|cruisecontrol|cruisecontrol.rb|continuiousbuild|testing|build-process|
Has anyone ever set up Cruise Control to build an OS X Cocoa/Objective-C project? If so, is there a preferred flavor of CruiseControl (CruiseControl.rb or just regular CruiseControl) that would be easier to do this with. I currently have a Ruby rake file that has steps for doing building and running tests, and w...
|testing|build-process|cruisecontrol|cruisecontrol.rb|continuiousbuild|
|testing|build-process|cruisecontrol|cruisecontrol.rb|continuousbuild|
|testing|cocoa|build-process|cruisecontrol|cruisecontrol.rb|
I know of a third party component that can do that. It's called ["*swfupload*"][1] and is free to use and open source, and uses javascript and flash to do the magic. here is a list of the features they offer: (from their site) > - Upload multiple files at once by ctrl/shift-selecting in dialog > - Javascrip...
Here are a few options: - [CodeDrawer][1] - [CC-RIDER][2] - [Doxygen][3] The last one, Doxygen, is more of an automatic documentation tool, but it is capable of generating dependency graphs and inheritance diagrams. It's also licensed under the GPL, unlike the first two which are not free. [1]: http:...
@Timbo: You are basically right about it being sort of like an abstract Tree class with three derived classes (Empty, Leaf, and Node), but you would also need to enforce the guarantee that some one using your Tree class can never add any new derived classes, since the strategy for using the Tree datat type is to wri...
To set the identity to 100: DBCC CHECKIDENT (MyTable, RESEED, 100) ---------- Aww snap!
Vim is a nice upgrade for Vi, offering decent features and a more usable set of keybindings and default behaviour. However, graphical versions like GVim, KVim and even Cream are extremely lacking in my opinion. I've been using [Geany](http://geany.uvena.de/) a lot lately, but it also has its shortcomings. I just can...
Are you calling msbuild to build? Or are you calling the VS.NET IDE exe to build. We've had no problems with our c#/VB.NET mix using CC.NET and NAnt and do not have to specify referenced assemblies inside of the build files. What we do is using the IDE exe to build solutions that contain the projects we want to bui...
I have a poor man's version of this I have used in the past... this requires jquery and firebug... <script type="text/javascript"> $(document).ready(function() { $('*[@id]').each(function() { console.log('#' + this.id + ' {}'); }); $('*[@clas...
Debug Companion VS plugin seem to be exactly what I was looking for, except that it won't see library project in my solution. Only when I added a console win application to the solution did something appear in that list of projects. The problem with the decompile/compile approach for me was that the code I was debug...
Tools>Options>General>Multiple Documents
If you don't need to compile one of the code screens, have you thought about just opening Notepad++ or PSPad in your other monitor and viewing the second batch of code that way? They have context sensitive coloring that would assist in reading. I do this all the time.
Where exactly in the code are you attempting to do this? It is possible that you are attempting to access the control too early in the [page lifecycle][1] and it has not been instantiated yet. [1]: http://msdn.microsoft.com/en-us/library/ms178472.aspx
Your solution will not scale unless you add a permanent index to each column, with all of the columns that are returned in the query in the list of included columns (a covering index). These indexes will be very large, and inserts and updates to that table will be a bit slower, but you don't have much of a choice if y...
If you created the UserControl during runtime (through ControlCollection.Add), you need to create it on postback too. Another case can be your UserControl does not match the designer.cs page
Asp.Net MVC: How do I enable dashes in my urls?