instruction
stringlengths
0
30k
Drop into DOS (or indeed PowerShell itself) and type this: powershell -? You'll see that powershell.exe has a "-noexit" parameter which tells it not to exit after executing a "startup command".
To access the contents of a zip file you have to unzip it, although the zipfile package makes this fairly easy, as you can unzip each file within an archive individually. [Python zipfile module][1] [1]: http://docs.python.org/lib/module-zipfile.html
@superjoe30 Yes, absoluteley. Once you start using version control you never go back. I use it for everything, even my "home" folder. @Orion Edwards Subversion does not require a server. You can access a local repository directly (via a client, of course), and there is no server process involved.
Simple text display is easy to do in OpenGL using GLUT bitmap fonts. These are simple 2D fonts and are *not* suitable for display *inside* your 3D environment. However, they're perfect for text that needs to be overlayed on the display window. Here are the sample steps to display Eric Cartman's favorite quote colore...
I thought about facial recognition many years ago but my search only found a web API - no plugin api. My idea was to use an external facial recognition program to slowly index my entire catalogue of pictures and reliably tag them according to who was in them. It wouldn't need to be 100% accurate, but anything over 85% ...
RGB to monochrome conversion
|colors|rgb|monochrome|
How do I convert the RGB values of a pixel to a single monochrome value?
You have all the basic shell commands, for example grep, cut, sed and awk at your disposal. You can also use Perl or Ruby for more complex things.
You have all the basic bash shell commands, for example grep, cut, sed and awk at your disposal. You can also use Perl or Ruby for more complex things.
Initialization Troubles with BIRT Runtime Engine API
|sql|reporting|birt|
I'm new to BIRT and I'm trying to make the Reprt engine running. I'm using the code snippets provided in http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.php But I have a strange exception: java.lang.AssertionError at org.eclipse.birt.core.framework.Platform.startup(Platform.java:86) and nothing in t...
I'm new to BIRT and I'm trying to make the Reprt engine running. I'm using the code snippets provided in http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.php But I have a strange exception: java.lang.AssertionError at org.eclipse.birt.core.framework.Platform.startup(Platform.java:86) and nothing in t...
You MUST use volatile when implementing lock-free data structures. Otherwise the compiler is free to optimize access to the variable, which will change the semantics. To put it another way, volatile tells the compiler that accesses to this variable must correspond to a physical memory read/write operation. For ex...
Configure IIS7 to allow downloading *.exe files
|iis-7|download|executable|
There is no blanket answer to this, but ALMOST always, using flat files is not a good idea. You have to parse through them (i suppose) and they do not scale well. Starting with a proper database, like Oracle or SQL Server (or MySQL, Postgres if you are looking for free options) is a good idea. For very little overhead,...
Interactive world map - suggestions?
|flash|maps|interactive|imagemap|
I'm looking to create a "Countries You've Visited" map - just like the ones you've probably seen on Facebook, TravelAdvisor and whatnot. I've tried different flash kits, but they're not quite as advanced as I'd like them to be. The main problem I've encountered with all the different kits is changing the background ...
It's an array delete ([]) you're referring to, not a vector delete. A vector is std::vector, and it takes care of deletion of its elements.
It takes some setting up, but I'm a fan of [Adobe's GIL][1] (now part of [Boost][2]). [1]: http://opensource.adobe.com/wiki/display/gil/Generic+Image+Library [2]: http://www.boost.org/doc/libs/1_36_0/libs/gil/doc/index.html
The question is a little ambiguous, which explains the wide disparity in answers you're getting. You actually asked what the difference is between lambdas and delegates in the .NET framework; that might be one of a number of things. Are you asking: - What is the difference between lambda expressions and anonymous...
I think the best solution would be to make a generic window which can take a few parameters which describe the monster. Im not entirely up-to-date with VB, but in an OO language we would have a Monster base class, and inheritance to create a Pikachu. The base class would define basic things a monster has (like a pi...
What's the best way to distribute Java applications?
|java|jar|software-distribution|
Java is one of my programming languages of choice. I always run into the problem though of distributing my application to end-users. Giving a user a JAR is not always as user friendly as I would like and using Java WebStart requires that I maintain a web server. What's the best way to distribute a Java applicati...
A few basic keyboard shortcuts for clipboard operations, text selection, and navigation that work in most Windows programs: **Clipboard** - Ctrl+X - Clipcoard Cut - Ctrl+C - Clipboard Copy - Ctrl+V - Clipboard Paste **Selecting Text** - Ctrl+A - Select All (in the current field or document) - S...
After some pondering I found this solution: Object^ BaseClass::Clone() { if(this->GetType() != BaseClass::typeid) { throw gcnew System::NotImplementedException("The Clone() method is not implemented for " + this->GetType()->ToString() + "!"); } BaseClass^ base = gc...
We run into this topic *all* the time, and the first question I have taken to asking people is "Why do you need a wiki"? Almost always the answers are things "ease of editing", "multiple contributors", and "Word is to heavyweight". *Very* rarely have we seen anyone ask for what I consider to be uniquely wiki-like fea...
|iis|ssl|website|
I'm using IIS 5.1 in Windows XP on my development computer. I'm going to set up HTTPS on my company's web server, but I want to try doing it locally before doing it on a production system. But when I go into the Directory Security tab of my web site's configuration section, the "Secure communication" groupbox is dis...
The second example will ensure compatibility with ASCII standards of HTML transmition. So my vote is for the second example, so you don't have to ensure the HTML is output and encoded as UTF-8 all the way through all the proxy servers and any other kind of caching and translation that might occur.
It doesn't **need** to be WIA. I was mostly looking at the WIA setup because it offers the same basic interface for different scanners. I've got 3 scanners on this machine and the TWAIN drivers/software for all of them suck (like blocking the screen during scanning). For document management, I'm really looking for s...
You're correct; As long as there's unicode at both ends of the pipe, it really doesn't matter. Personally, I would use the first simply because it's more readable. And, honestly, unicode has been widespread for some time. I personally believe that it's time to leave anyone who can't handle UTF-8 behind.
Make sure SQL Server knows the order of Days, Months and Years in your string by executing SET DATEFORMAT mdy;
You may need to manually create a certificate first (on WinXP there does not seem to be a built-in mechanism, so you need to use OpenSSL). Check out these two links: [http://www.somacon.com/p41.php][1] [http://dotnetyuppie.com/2008/04/26/enabling-ssl-https-for-iis-in-windows-xp/][2] [1]: http://www.somacon...
That is because IIS 5.1 under the limited Windows XP version is limited to only HTTP. You need to have a full version of IIS 6.0 on Windows 2003 to do this. Luckily you can download a VHD image of Windows 2003 from Microsoft and run it under a Virtual PC instance. Plus I would recommend this since you are trying to ...
Two of my personal favourites, which I see rarely used: 1. Snippets (particularly for properties, which was made even better for 2008) 2. The ObsoleteAttribute
honestly the experts by the very definition should know this stuff. But to answer your question: [http://msdn.microsoft.com/en-us/library/ya5y69ds.aspx][1] The compiler flagging for numbers are widely known for these: Decimal = M Float = F Double = D // for example double d = 30D; ...
I have a little site inside the corporate network which contains a virtual directory with an exe file inside it. In addition I have an html file with a link to that exe. When I click the link, instead of asking me whether to open or save it just runs the exe. The permissions on that virtual directory are read and sc...
Force IIS7 to suggest downloading *.exe files in "Local intranet" zone
|iis-7|executable|download|
Problem:<br/> 1. html file on local server (inside our organization) with link to an exe on the same server. 2. clicking the link runs the exe on the client. Instead I want it to offer downloading it. Tried so far:<br/> 1. Changed permissions on the exe's virtual directory to be read and script. 2. Added Con...
You can see examples of templating in the default Starertkit module, the FAQ module, repository module and UDT. All of these have varying levels of control for templating.
I had the same mistake a couple of month ago. I'm not quite sure what actually fixed it but my code looks like the following: IDesignEngine engine = null; DesignConfig dConfig = new DesignConfig(); EngineConfig config = new EngineConfig(); IDesignEngineFactory factory = null; config.setLogConfig(LOG...
I had the same mistake a couple of month ago. I'm not quite sure what actually fixed it but my code looks like the following: IDesignEngine engine = null; DesignConfig dConfig = new DesignConfig(); EngineConfig config = new EngineConfig(); IDesignEngineFactory factory = null; config.setLogConfig(LO...
Check out Networking education topics at the XNA Creator's Club website. It delves into topics such as network architecture (peer to peer or client/server), Network Prediction, and a few other things (in the context of XNA of course). This may help you find the answers you're looking for. [http://creators.xna.com/...
Is **E-mailing the photo in** an available option? Most people who want to share photos probably already know how to send photos in email. And most email clients has already solved the problems of file uploading. Just setup one gmail/whatevermail account and have your website poll the inbox. It's something lik...
A batch file should continue executing, even if the previous command has generated an error. Perhaps, what you are seeying is the batch aborting due to a restart?
A batch file should continue executing, even if the previous command has generated an error. Perhaps, what you are seeying is the batch aborting due to some other error?
Yes. That is possible using [Com Callable Wrappers][1]. Basically you are enabling your .Net classes to be called through COM/ActiveX from your win32 code (Delphi or C++). [1]: http://msdn.microsoft.com/en-us/library/f07c8z1c.aspx
I don't know of any particular option to force ksh to be compatible with a particular older version. That said, perhaps you could install a very old version of ksh on your linux box, and have it behave in a compatible manner? It might be easier to install a more modern version of amy shell on the AIX/HP-UX boxes, a...
Extreme Programming by Kent Beck
If you are doing this with Flash and using Flickr, then I would check out the AS3 Flickr library: <http://code.google.com/p/as3flickrlib/> which has support for uploading images. Upload requires authentication. The library also contains a Flex based control for handling this: http://www.mikechambers.com/blo...
Random in python 2.5 not working?
|python|
I am trying to use the import random statement in python, but it doesn't appear to have any methods in it to use. Am I missing something?
You did not say which database, but with mysql here is an easy way to get a date from a timestamp (and the varchar type conversion should happen automatically): mysql> select date(now()); +-------------+ | date(now()) | +-------------+ | 2008-09-16 | +-------------+ 1 row in set (...
I found one possible solution in the [Color FAQ][1]. The *luminance component* Y (from the *CIE XYZ system*) captures what is most perceived by humans as color in one channel. So, use those coefficients: mono = (0.2125 * color.r) + (0.7154 * color.g) + (0.0721 * color.b); [1]: http://www.poynton.com/notes...
I've recently used [Tag Lib Sharp][1] to write some C# apps for cleaning up and maintaining my music library. I found the library very easy to use and although i've only used it for MP3's, it appears to support a range of other music/video formats. [1]: http://www.taglib-sharp.com/Main_Page
I do not agree DannySmurf Some WPF layout objects can clog up your memory and make your application really slow when they are not garbadge collected. So I find the choice of words to be correct, you are leaking memory to objects you no longer use. You expect the items to be garbadge collected, but they aren't, becau...
[This MSDN article](http://msdn.microsoft.com/en-us/library/bb332387.aspx#tbconimagecolorizer_grayscaleconversion) uses (0.299 * color.R + 0.587 * color.G + 0.114 * color.B); [This Wikipedia article](http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale) uses (0.3* color.R + 0.59 * color.G + 0.11 * co...
Anyone know a good workaround for the lack of an enum generic constraint?
|c#|enums|flags|
What I want to do is something like this: I have enums with combined flagged values. public static class EnumExtension { public static bool IsSet<T>( this T input, T matchTo ) where T:enum { return (input & matchTo) != 0; } } So then I could do: MyEnum tester = My...
|c#|flags|enums|
You can setup `svn:ignore` property on configuration files, so that `svn update` doesn't erase them, and then use `svn export /target/path/` to get rid of `.svn` files in your Subversion repository.
Chris is right. More specifically, two or three pieces of information in the packet header should be different: - the sequence number (which is intended to be unpredictable) which is increases with the number of bytes transmitted and received. - the timestamp, a field containing two timestam...
SmtpClient.SendAsync bug in ASP.NET 2.0
|asp.net-2.0|asynchronous|smtp|
I may be wrong, but if you are working with SmtpClient.SendAsync in ASP.NET 2.0 and it throws an exception, the thread processing the request waits indefinitely for the operation to complete. To reproduce this problem, simply use an invalid SMTP address for the host that could not be resolved when sending an e...
|smtp|asynchronous|asp.net-2.0|
I may be wrong, but if you are working with SmtpClient.SendAsync in ASP.NET 2.0 and it throws an exception, the thread processing the request waits indefinitely for the operation to complete. To reproduce this problem, simply use an invalid SMTP address for the host that could not be resolved when sending an e...
Almost all the client programs written here where I work are in .NET; it's a terrific platform for business applications. Having said that, most of the programs out there that .NET would be a good target for are being deployed as web applications instead; the rest are typically graphical and cpu-intensive applications...
How can I determine the length of a .wav file in C#?
|c#|audio|compression|
In the uncompressed situation I know I need to read the wav header, pull out the number of channels, bits, and sample rate and work it out from there: (channels) * (bits) * (samples/s) * (seconds) = (filesize) Is there a simpler way - a free library, or something in the .net framework perhaps? How would I do thi...
What is the best way to log out another user from their session on Mac OS X Leopard?
1. ?? - great operator 2. using - great operator that can be used for more than just calling Dispose 3. readonly - should be used more 4. netmodules - too bad there's no support in Visual Studio
1. ?? - great operator 2. using - great keyword that can be used for more than just calling Dispose 3. readonly - should be used more 4. netmodules - too bad there's no support in Visual Studio
My goodness, if the question was about Microsoft SQL Server then we'd have been in business! Sybase, sadly, is a whole 'nother database these days, since about 1997, in fact, give or take a year. If the input format simply has to be 'DD-MON-YYYY' and no exceptions, then I think a fair amount of validation was be ...
I didn't know the "as" keyword for quite a while. MyClass myObject = (MyClass) obj; vs MyClass myObject = obj as MyClass; The second will return null if obj isn't a MyClass, rather than throw a class cast exception.
- TransactionScope and DependantTransaction in System.Transactions is a lightweight way to use transaction processing in .NET - its not just for [Database transactions either][1] - String.IsNullOrEmpty is one that I am surprised to learn a lot of devs don't know about - List<T>.ForEach - iterate through your generic ...
"[yield][1]" would come to my mind. Some of the Attributes like [[DefaultValue()]][2] are also among my favorites. The "[var][3]" keyword is a bit more known, but that you can use it in .net 2.0 Applications as well (as long as you [use the .net 3.5 Compiler][4] and set it to output 2.0 code) does not seem to be kno...
"[yield][1]" would come to my mind. Some of the Attributes like [[DefaultValue()]][2] are also among my favorites. The "[var][3]" keyword is a bit more known, but that you can use it in .net 2.0 Applications as well (as long as you [use the .net 3.5 Compiler][4] and set it to output 2.0 code) does not seem to be kno...
diff.rb is what you want, which is available at <http://users.cybercity.dk/~dsl8950/ruby/diff.html>
What's the difference between XML-RPC and SOAP?
|xml|web-services|
I've never really understand why a web service implementer would choose one over the other. Is XML-RPC generally found in older systems? Any help in understanding this would be greatly appreciated.
The stack is the memory set aside as scratch space for a thread of execution. When a function is called, a block is reserved on the top of the stack for local variables and some bookeeping data. When that function returns, the block becomes unused and can be used the next time a function is called. The stack is alwa...
For arrays, use the minus operator. For example: >> foo = [1, 2, 3] => [1, 2, 3] >> goo = [2, 3, 4] => [2, 3, 4] >> foo - goo => [1] Here the last line removes everything from foo that is also in goo, leaving just the element 1. I don't know how to do this for two strings, but until s...
As soon as callback methods are called from other context i'm usually using something that I'm call callback context: var ctx = function CallbackContext() { _callbackSender ... } function DoCallback(_sender, delegate, callbackFunc) { ctx = _callbackSender = _sender; delegate(); } ...
And don't forget the free open source [TraceTool][1] [1]: http://tracetool.sourceforge.net/
The [Python tutorial][1] is actually pretty good. There's also a [video series on showmedo][2] about python. Between those two resources, you should have more than enough to learn the basics! [1]: http://docs.python.org/tut/tut.html [2]: http://showmedo.com/videos/python
CONVERT(VARCHAR(10),GetDate(),102) Then you would need to replace the "." with "-". Here is a site that helps http://www.mssqltips.com/tip.asp?tip=1145
It is possible to host the CLR or DLR in unmanaged code as it is a COM component. From that point you can load the managed assemblies you need to interact with. From MSDN: [Hosting the Common Language Runtime][1] [1]: http://msdn.microsoft.com/en-us/library/9x0wh2z3.aspx
Managing authorized_keys on a large number of hosts.
|unix|authentication|ssh|openssh|