instruction
stringlengths
0
30k
I've followed this otherwise [excellent tutorial][1] on getting Xen working with Ubuntu but am not able to get a console into my virtual machine (domU). I've got the `extra = '2 console=xvc0'` line in my /etc/xen/**hostname_here**.cfg file like they say, but am not able to get a console on it. If I statically assign...
I've never come across a tool that would do the job. Instead I've used individual files, numbered so that I know which order to run them: essentially, a manual version of Rails migrations, but without the rollback. Here's the sort of thing I'm talking about: 000-clean.sql # wipe out everything in the ...
What Craig said, plus if you do want to change the default it's in Tools -> Options -> Projects And Solutions. I've never changed the default and never created a solution/project in the default location, which might tell you something about how relevant it is...
Tools -> Options -> Projects & Solutions. There is a Visual Studio Projects box.
The best way of going through a proxy that requires authentication is using [urllib2][1] to build a custom url opener, then using that to make all the requests you want to go through the proxy. Note in particular, you probably don't want to embed the proxy password in the url or the python source code (unless it's just...
I don't trust programmatic migrations. If it's a simple change, such as adding a NULLable column, I'll just add it directly to the live server. If it's more complex or requires data changes, I'll write a pair of SQL migration files and test them against a replica database. When using migrations, *always* test the ro...
Run Purify. It is a near-magical tool that will report when you are clobbering memory you shouldn't be touching, leaking memory by not freeing things, double-freeing, etc. It works at the machine code level, so you don't even have to have the source code. One of the most enjoyable vendor conference calls I was...
E-mail Notification's
|.net|email|
In a .net system I'm building, there is a need for automated e-mail notifications. These should be editable by an admin. What's the easiest way to do this? SQL table and WYSIWIG for editing?
E-mail Notifications
How about using the new Workflow components in .Net 3.0 (and 3.5)? That is what we use in combination with templates in my current project. The templates have the basic format and the the tokens that are replaced with user information.
The cell location is an attached property - the value belongs to the TextBlock rather than Grid. However, since the property itself belongs to Grid, you need to use either the property definition field or the provided static functions. TextBlock tb = new TextBlock(); // // Locate tb in the second row, ...
WPF makes use of a funky thing called [attached properties][1]. So in your XAML you might write this: <TextBlock Grid.Row="0" Grid.Column="0" /> And this will effectively move the TextBlock into cell (0,0) of your grid. In code this looks a little strange. I believe it'd be something like: g.Childre...
WPF makes use of a funky thing called [attached properties][1]. So in your XAML you might write this: <TextBlock Grid.Row="0" Grid.Column="0" /> And this will effectively move the TextBlock into cell (0,0) of your grid. In code this looks a little strange. I believe it'd be something like: g.Childre...
How to structure a java application, in other words: where do I put my classes?
following on from my [previous question](http://stackoverflow.com/questions/19454/enforce-attribute-decoration-of-classesmethods) I have been working on getting my object model to serialize to XML. But I have now run into a problem (quelle surprise!). The problem I have is that I have a collection, which is of a abs...
If you want to have a go at doing a highly parallel version of a simple task, or see real solutions, you could do worse than look at the [wide finder](http://www.tbray.org/ongoing/When/200x/2007/09/20/Wide-Finder) project. Basically it's about how to do parallel regex matching of log files efficiently, but trying to a...
Use the following script. <SCRIPT TYPE="text/javascript"> <!-- function submitenter(myfield,e) { var keycode; if (window.event) keycode = window.event.keyCode; else if (e) keycode = e.which; else return true; if (keycode ==...
Can Slickedit automatically update it's tag files?
|slickedit|ide|
I prefer SlickEdit for my IDE but the only way I can get it to update the tag files to incorporate code changes is to recreate the project and/or run start a re-tag manually. Is there a way to setup Slick Edit so that it automatically incorporates changes in the code base that happen after project creation. This pro...
|slickedit|ide|fix-title-typo|
Can SlickEdit automatically update its tag files?
|ide|slickedit|
Take a look at HUDSON (https://hudson.dev.java.net/) . It's highly customizable, and, i my humble opinion, easier than CruiseControl.
Not sure why you are wanting to do this - regex for HTML sanitisation isn't always the best method (you need to remember to sanitise attributes and such, remove javascript: hrefs and the likes)... but, a regex to match HTML tags that aren't `<p></p>`: `(<[^pP].*?>|</[^pP]>)` Verbose: ( < ...
Create an assembly using VS.NET. Add an installer class to the project - select 'Add - New Item'. Select intaller class. This class derives from System.Configuration.Install.Installer. It has a number of virtual methods such as Install(). This will be called when by the windows installer engine at install time. Th...
There is support for exactly this in .NET/Windows Installer Create an assembly using VS.NET. Add an installer class to the project - select 'Add - New Item'. Select intaller class. This class derives from System.Configuration.Install.Installer. It has a number of virtual methods such as Install(). This will be cal...
There is support for exactly this in .NET/Windows Installer Create an assembly using VS.NET. Add an installer class to the project - select 'Add - New Item'. Select intaller class. This class derives from System.Configuration.Install.Installer. It has a number of virtual methods such as Install(). This will be cal...
Does make think one of the targets is failing? If so, it will stop the make after the running jobs finish. You can use -k to tell it to continue even if an error occurs.
I do think that games and puzzles are a good place to start as they can give great scope for developing more complex versions. For example a **tic-tac-toe** program can be built as a simple command line program initially that lets two players play the game. This step can be used to show how a simple data structure o...
When ever I need to do something similar, usually I end up using <a href="http://search.cpan.org/~ebohlman/XML-Parser-EasyTree-0.01/EasyTree.pm">XML::Parser::EasyTree </a> it has better documentation and is simpler to use. I highly recommend it.
What control is this? ("Open" Button with Drop Down)
|.net|.net-2.0|winforms|
|.net|winforms|.net-2.0|
The "Open" button on the open file dialog used in certain windows applications includes a dropdown arrow with a list of additional options -- namely "Open with..". I haven't seen this in every windows application, so you may have to try a few to get it, but SQL Server Management Studio and Visual Studio 2005 will ...
Any pitfalls developing C#/.NET code in a Virtual Machine running on a MAC?
|macos|.net|vmware|vista|
I am considering buying an Apple MAC book Pro, are than any pitfalls developing C#/.NET code in a Virtual Machine running on a MAC? For this purpose, is it better to run Vista or XPPro?
|.net|macos|vmware|
I found the answer here: http://blog.sqlauthority.com/2007/08/22/sql-server-t-sql-script-to-insert-carriage-return-and-new-line-feed-in-code/ You just concatenate the string and insert a CHAR(13) where you want your line break. Example: DECLARE @text NVARCHAR(100) SET @text = 'This is line 1.' + CHAR(13) + 'This...
I found the answer here: http://blog.sqlauthority.com/2007/08/22/sql-server-t-sql-script-to-insert-carriage-return-and-new-line-feed-in-code/ You just concatenate the string and insert a CHAR(13) where you want your line break. Example: DECLARE @text NVARCHAR(100) SET @text = 'This is line 1.' + CHAR(13) + 'This...
Use more generics abstract class Vehicle<T> where T : Axle { public string Name; public List<T> Axles; } class Motorcycle : Vehicle<MotorcycleAxle> { } class Car : Vehicle<CarAxle> { } abstract class Axle { public int Length...
> but is it good or bad The first adjective that comes to mind is "unnecessary". C++ has free functions and namespaces, so why would you need to make them static functions in a class? The use of static methods in uninstantiable classes in C# and Java _is a workaround_ because those languages don't have free fun...
Why Subversion over VSS? * Free software * Easier to manage * "check-ins" are <b>atomic</b>! * Easy to Branch and Merge * Continued development (i.e. VSS is dead end) * Better tools for tracking changes and viewing logs * Toolset and platform agnostic, but also integrates with many tools I made the proposal...
version control practice
|version-control|
In my current job the supervisor's practice is to only check in production ready code. Most recently the project I was on involved work by 3 different developers with some file overlap. This meant manually integrating changes despite the fact that some changes took a day and then it was done. I wanted to see if this...
Code that is checked in should be unit tested, but, to me, "production ready" implies that it's gone through integration and system testing. You can't do that until a code freeze, so I don't see how you can do that before every check in.
You can try WMICodeCreator it generates vbscript jscript vb.net and c# code [Download WMICodeCreator from Microsoft][1] [1]: http://www.microsoft.com/downloads/details.aspx?familyid=2cc30a64-ea15-4661-8da4-55bbc145c30e&displaylang=en
How to start using ndepend?
|.net|static-analysis|ndepend|
I recently downloaded ndepend and ran an analysis on an open source project I participate in. I did not now where to look next - a bit of visual and information overload and it turned out I don't even know where to start. Can anyone suggest starting points? - What information should I look for first? - What p...
OK, rails is actually pretty good, but there is just a little bit too much magic going on in there (from the Ruby world I would much prefer merb to rails). I personally use Pylons, and am pretty darn happy. I'd say (compared to django), that pylons allows you to interchange ints internal parts easier than django does. ...
Windows Mobile and CE used to suck, really, really badly. These days however it's definitely passable and worth checking out, especially if you code C#. Just remember that it is the baby brother of the full framework and has nowhere near enough toys and throws a lot of NotImplementedExceptions. :)
Guids will certainly be slower (and use more memory) than standard integer keys, but whether or not that is an issue will depend on the type of load your system will see. Depending on your backend DB there may be issues with indexing guid fields. Using guids simplifies a whole class of problems, but you pay for it ...
This is a perfectly good use of GUIDs. The only draw backs would be a slight complexity in working with GUIDs over INTs and the slight size difference (16 bytes vs 4 bytes). I don't think either of those are a big deal.
Quick ls command
|unix|ls|command|
I've got to get a directory listing that contains about 2 million files, but when I do an "ls" command on it nothing comes back. I've waited 3 hours. I've tried "ls | tee directory.txt", but that seems to hang forever. I assume the server is doing a lot of inode sorting. Is there any way to speed up the ls command to j...
|unix|bash|command|ls|
If the pages are static, why would you change them on the fly instead of preprocessing all pages on a site, adding the piece of requiered javascript to each one of them? This is simple and probably more efficent (you probably have more pageviews than pages to change) This could be done a lots of way. I would suggest...
Try upgrading to jQuery 1.2.6, you should be on the latest release of jQuery if you are having problems first ensure you are on the latest and greatest.
How many constructor arguments is too many?
|untagged|
Let's say you have a class called Customer, which contains the following fields: - UserName - Email - First Name - Last Name Let's also say that according to your business logic, all Customer objects must have these four properties defined. Now, we can do this pretty easily by forcing the constructo...
One thing you need to keep in mind is the size of your data set. I believe that Dillie-O was the only one who even remotely hit the point. If you have a small, single user, consumer app then I would say DB. I have a DVD management app that uses the file system (in Program Files at that) and it is a PIA to backup. ...
Or if using the Visual Studio command line, cl.exe /Fa[assembler code filename] If you just want to view the assembler code in the IDE you can start the debugger and then select the Go To Dissassembly choice on the right click menu.
You might also want to add a way to pin and unpin that 64-bit pointer to a 32-bit memory address. Since this is Delphi, I'm pretty sure it's Windows specific, so you might as well use [Address Windowing Extensions][1]. That way, you can support allocating, freeing, and pinning and unpinning memory to a 32-bit address r...
What areas of specialization within programming would you recommend to a beginner
|language-agnostic|education|
I am a student studying software development, and I feel programming, in general, is too broad of a subject to try to know everything. To be proficient, you have to decide which areas to focus your learning and understanding. Certain skill sets synergize with each other, like data-driven web development and SQL experie...
|language-agnostic|education|
I am a student studying software development, and I feel programming, in general, is too broad of a subject to try to know everything. To be proficient, you have to decide which areas to focus your learning and understanding. Certain skill sets synergize with each other, like data-driven web development and SQL experie...
|java|architecture|
First of all, I know how to build a java application. But I was always puzzled where to put my classes. There are proponents for organizing the packages strictly domain oriented, others separate by tier. I for myself have always problems a) with naming, b) with placing Where do you put your domain specific consta...
Is there a reason you can't just send the data to a page which handles sending the mail? It is pretty easy to send an email in most languages, so unless there's a strong reason to push it to client side, I would recommend that route.
Use attached properties of the Grid class. in C#: `Grid.SetRow( cell, rownumber )` In XAML: `<TextBlock Grid.Row="1" />` Also, I would advice if you do not use dynamic grids, use the XAML markup language. I know, it has a learning curve, but once you mastered it, it is so much easier, especially if...
Use attached properties of the Grid class. in C#: <pre><code>Grid.SetRow( cell, rownumber )</code></pre> In XAML: <pre><code>&lt;TextBlock Grid.Row="1" /&gt;</code></pre> Also, I would advice if you do not use dynamic grids, use the XAML markup language. I know, it has a learning curve, but once yo...
Class names should always be descriptive and self-explanatory. If you have multiple domains of responsibility for your classes then they should probably be refactored. Likewise for you packages. They should be grouped by domain of responsibility. Every domain has it's own exceptions. Generally don't sweat it unti...
Another possibility is to use DTS or Integration Services (DTS for SQL Server 7 or 2000, SSIS for 2005 or higher). Both are from Microsoft, included in the Sql Server installation (in Standard edition at least) and have an FTP task and are designed for import/export jobs from Sql Server.
I think the best introduction to the (any) subject are some good examples. [This article][1] at codeProject gives a fairly easy to follow guide trough web service security for a .NET application. [1]: http://www.codeproject.com/KB/webservices/WS-Security.aspx
Use packages to group related functionality together. Usually the top of your package tree is your domain name reversed (`com.domain.subdomain`) to guarantee uniqueness, and then usually there will be a package for your application. Then subdivide that by related area, so your `FileStorageStrategy` might go in, say,...
To submit the form when the enter key is pressed create a javascript function along these lines. <pre><code> function checkSubmit(e) { if(e && e.keyCode == 13) { document.forms[0].submit(); } } </code></pre> Then add the event to whatever scope you need eg on the div tag <pre><code>&lt;div...
I believe you suffer from having a different instance of the VCL in each of your dlls and exes. Classes from the dll are not the same as the ones from your exe, even if they are called the same. Also global variables (Application, Screen) are not shared between them. Neither is the memory since they both have their own...
From the code you've posted, it's not clear that after an exception is thrown the system is definitely able to restart - e.g. if the exception comes from doStuff(), then the control flow will pass back (after the 10 minute wait) to openConnection(), without ever passing through closeConnection(). But as others have ...
[Sharepoint][1] also does a good (ok decent) job of versioning MS-specific documents. [1]: http://office.microsoft.com/en-us/sharepointtechnology/default.aspx
<pre> ssize_t recvfrom(int socket, void *restrict buffer, size_t length, int flags, struct sockaddr *restrict address, socklen_t *restrict address_len); ssize_t recvmsg(int socket, struct msghdr *message, int flags); [..] If address is not a null pointer and the socket is not con...
<pre> ssize_t recvfrom(int socket, void *restrict buffer, size_t length, int flags, struct sockaddr *restrict address, socklen_t *restrict address_len); ssize_t recvmsg(int socket, struct msghdr *message, int flags); [..] If address is not a null pointer and the socket is not con...
http://www.yoda.arachsys.com/csharp/threads/
I use TeamCity with an nant build script. TeamCity makes it easy to setup the CI server part, and nant build script makes it easy to do a number of tasks as far as report generation is concerned. Here is an article I wrote about using CI with CruiseControl.NET, it has a nant build script in the comments that can be ...
+1 for Umbraco as a great CMS. As far as multilingual support though, I'm in the same boat as seanb. I know it supports it, but I've never dealt with it myself.
I would personally not approve of this because sometimes that's the best way to catch problem code with less experienced developers (by seeing it as they are working on it) and when you "check in early and often" you can rollback to earlier changes you made (as you were developing) if you decide that some changes you m...
wouldn't it be a good idea to have a testing branch of the repo that can have the non "production ready code" checked in after the changes are done and tested? the main trunk should never have code checked in that breaks the build and doesn't pass unit tests, but branches don't have to have all those restrictions in...
Identifying ASP.NET web service references
|web-services|iis|reflection|esb|
At my day job we have load balanced web servers which talk to load balanced app servers via web services (and lately WCF). At any given time, we have 4-6 different teams that have the ability to add new web sites or services or consume existing services. We probably have about 20-30 different web applications and corre...
Strong Validation in WPF
|language-agnostic|education|