instruction
stringlengths
0
30k
Check this out. Some people mention jQuery plugins in the comments as well. [PNG Fix from 24 Ways][1] [1]: http://24ways.org/2007/supersleight-transparent-png-in-ie6
I don't think that's possible. It would be relatively easy to add this functionality to the underlying C++ wxWidgets control, but since you're using wxPython, you'd then have to rebuild that as well which is a tremendous pain in the ass.
1. Use consistent formatting. 2. When working on legacy code employ the existing style of formatting, esp. brace style. 3. Get a copy of Scott Meyer's book Effective C++ 4. Get a copy of Steve MConnell's book Code Complete.
Yes there is tooling support for Visual Studio. It is still in Beta though. [Get Started Building Silverlight 2 Applications][1] 1) Install Visual Studio 2008 then Install Silverlight Tools Beta 2 for Visual Studio 2008 This add-on to Visual Studio 2008 allows you to use .NET to create Silverlight 2 Beta 2 Web s...
Yes there is tooling support for Visual Studio. It is still in Beta though. [Get Started Building Silverlight 2 Applications][2] 1) Install Visual Studio 2008 then Install Silverlight Tools Beta 2 for Visual Studio 2008 This add-on to Visual Studio 2008 allows you to use .NET to create Silverlight 2 Beta 2 Web s...
Yes there is tooling support for Visual Studio. It is still in Beta though. [Get Started Building Silverlight 2 Applications][1] 1) Install Visual Studio 2008 then Install Silverlight Tools Beta 2 for Visual Studio 2008 This add-on to Visual Studio 2008 allows you to use .NET to create Silverlight 2 Beta 2 Web s...
|visual-studio|
I didn't see the option to point the workspace (or it's VS equilivant, I'm still learning the terminology for VS, but it is called a workspace in Eclipse) to My Documents/Programming instead of, well, wherever it is now.
|visual-studio|
Do you use Phing?
|deployment|build-process|build-automation|
Does anyone use [Phing][1] to deploy PHP applications, and if so how do you use it? We currently have a hand-written "setup" script that we run whenever we deploy a new instance of our project. We just checkout from SVN and run it. It sets some basic configuration variables, installs or reloads the database, and genera...
|deployment|build-process|build-automation|phing|
stopping MSI from launching an EXE in the SYSTEM context
|msi|installation|windows-installer|installshield|
Ok, I've got a problem here with an MSI deployment that I'm working on (using Installshield) we have a program running in the background that needs to run per-user, this needs to start automatically without user intervention. The problem is with GPO/AD deployment the application is started in the SYSTEM context ...
|msi|installation|windows-installer|installshield|
Ok, I've got a problem here with an MSI deployment that I'm working on (using Installshield) we have a program running in the background that needs to run per-user, this needs to start automatically without user intervention. The problem is with GPO/AD deployment the application is started in the SYSTEM context ...
How to controll a webapplication through email? Or how to run php script by sending an email?
|cakephp|email|
Ok here is the thing. I wanna run a webapplication on php and mysql, useing the CakePHP framework. And to keep the threshold of using the site at a very low place, I want to not use the standard login with username/password. (And I don't want to hassle my users with something like OpenID either. Goes to user type.) But...
Ok here is the thing. I wanna run a webapplication on php and mysql, useing the CakePHP framework. And to keep the threshold of using the site at a very low place, I want to not use the standard login with username/password. (And I don't want to hassle my users with something like OpenID either. Goes to user type.) But...
How to control a web application through email? Or how to run php script by sending an email?
Ok here is the thing. I want to run a web application on php and mysql, using the CakePHP framework. And to keep the threshold of using the site at a very low place, I want to not use the standard login with username/password. (And I don't want to hassle my users with something like OpenID either. Goes to user type.) B...
Why not just have the sequence as increment by 100 all the time? each "nextval" gives you 100 sequence numbers to work with SQL> create sequence so_test start with 100 increment by 100 nocache; Sequence created. SQL> select so_test.nextval - 99 as first_seq, so_test.currval as last_seq from...
Why not just have the sequence as increment by 100 all the time? each "nextval" gives you 100 sequence numbers to work with SQL> create sequence so_test start with 100 increment by 100 nocache; Sequence created. SQL> select so_test.nextval - 99 as first_seq, so_test.currval as last_seq from...
Why not just have the sequence as increment by 100 all the time? each "nextval" gives you 100 sequence numbers to work with SQL> create sequence so_test start with 100 increment by 100 nocache; Sequence created. SQL> select so_test.nextval - 99 as first_seq, so_test.currval as last_seq from...
Reading default application settings in C#
For C++, check out [Boost IPC][1]. You can probably create or find some bindings for the scripting languages as well. Otherwise if it's really important to be able to interface with scripting languages your best bet is simply to use files or sockets or even a higher level abstraction like HTTP. [1]: htt...
For C++, check out [Boost IPC][1]. You can probably create or find some bindings for the scripting languages as well. Otherwise if it's really important to be able to interface with scripting languages your best bet is simply to use files, pipes or sockets or even a higher level abstraction like HTTP. [...
Which jQuery plugin should be used to fix the IE6 PNG transparency issue?
|jquery|png|
Is there an IE6/PNG fix that is officially developed by the jQuery team? If not which of the available plugins should I use?
|jquery|internet-explorer-6|png|
Only comment when it's only necessary to explain what the code is doing, where reading the code couldn't tell you the same. Don't comment out code that you aren't using any more. If you want to recover old code, use your source control system. Commenting out code just makes things look messy, and makes your comment...
**Caveat:** I don't know *ActiveScaffold*. This answer is based on me reading its source code. It looks like the `action_links` variable is a custom data structure, called `ActionLinks`. It's defined in `ActiveScaffold::DataStructures`. Internally, it has a `@set` variable, which is not a `Set` at all, but an `Ar...
I believe this idea to be an interesting theoretical debate, but not very practical for the following reasons: 1. To make sure the new version of the code works well, you need to have superb automatic tests, which is a goal that is very hard to achieve and one that many companies fail to develop. You can only go on ...
I'm working on a .net post-commit hook to feed data into OnTime via their Soap SDK. My hook works on Windows fine, but on our production RHEL4 subversion server, it won't work when called from a shell script. <pre> #!/bin/sh /usr/bin/mono $1/hooks/post-commit.exe "$@" </pre> When I execute it with parameters fro...
I'm working on a .net post-commit hook to feed data into OnTime via their Soap SDK. My hook works on Windows fine, but on our production RHEL4 subversion server, it won't work when called from a shell script. <pre> #!/bin/sh /usr/bin/mono $1/hooks/post-commit.exe "$@" </pre> When I execute it with parameters fro...
Best way to transfer an xml to SQL Server?
|sql-server|xml|
I have been hearing the podcast blog for a while, I hope I dont break this. The question is this: I have to insert an xml to a database. This will be for already defined tables and fields. So what is the best way to accomplish this? So far I am leaning toward programatic. I have been seeing varios options, one is Dat...
Would something like this work? from random import randint mcworks = [] for n in xrange(NUM_ITERATIONS): mctest = [randint(0, 100) for i in xrange(5)] if sum(mctest[:3])/3 == mcavg[2]: mcworks.append(mctest) # mcavg is real data In the end, you are left wit...
Would something like this work? from random import randint mcworks = [] for n in xrange(NUM_ITERATIONS): mctest = [randint(0, 100) for i in xrange(5)] if sum(mctest[:3])/3 == mcavg[2]: mcworks.append(mctest) # mcavg is real data In the end, you are left wit...
Including negatives? Infinite. Including only positives? In this case they wouldn't be called "integers", but "naturals", instead. In this case... I can't really solve this, I wish I could, but my math is too rusty. There is probably some crazy integral way to solve this. I can give some pointers for the math skille...
check for postback in JavaScript
|asp.net|javascript|
i need to run a js function onLoad(), but only do it if the page loaded the first time (not postback) basically, i need to check for IsPostBack in JavaScript thank you.
How can I check for IsPostBack in JavaScript?
I need to run a JavaScript function onLoad(), but only do it if the page loaded the first time (i.e. is not the result of a postback). Basically, I need to check for IsPostBack in JavaScript. Thank you.
|c#|.net|winforms|
I have a number of application settings (in user scope) for my custom grid control. Most of them are color settings. I have a form where the user can customize these colors with a button for reverting to default color settings. By default value I mean what I set in Settings.settings at design time. Is there a way to re...
@Ionut This handles generating the core dump, but it doesn't handle notifying the developer when other users had crashes.
Deploying a project using LINQ to SQL
|linq-to-sql|deployment|
I am working on a winforms application using LINQ to SQL - and am building the app using a SQL Express instance on my workstation. The final installation of the project will be on a proper SQL Server 2005. The database has the same name, and all tables are identical but the hostname is different. The only way I ...
|deployment|linq-to-sql|
I am working on a winforms application using LINQ to SQL - and am building the app using a SQL Express instance on my workstation. The final installation of the project will be on a proper SQL Server 2005. The database has the same name, and all tables are identical but the hostname is different. The only way ...
The following is the solution: private void frmMainLoad(object sender, EventArgs e) { ActiveControl = textBox1; } The better question would however be why... I'm not entirely sure what the answer to that one is.
The following is the solution: private void frmMainLoad(object sender, EventArgs e) { ActiveControl = textBox1; } The better question would however be why... I'm not entirely sure what the answer to that one is. Edit: I suspect it is something to do with the fact that both the form, and ...
function TForm2.EditDistance(s, t: string): integer; var d : array of array of integer; i,j,cost : integer; begin { Compute the edit-distance between two strings. Algorithm and description may be found at either of these two links: http://en.wikipedia.org/wiki/Lev...
function EditDistance(s, t: string): integer; var d : array of array of integer; i,j,cost : integer; begin { Compute the edit-distance between two strings. Algorithm and description may be found at either of these two links: http://en.wikipedia.org/wiki/Levenshtei...
I think the single most important thing to remember when dealing with exceptions at any level (making custom, throwing, catching) is that exceptions are only for exceptional conditions.
|.net|wpf|
As an example take the following code: public enum ExampleEnum { FooBar, BarFoo } public class ExampleClass : INotifyPropertyChanged { private ExampleEnum example; public ExampleEnum ExampleProperty { get { return example; } { /* set and notify */; } } } I want a...
Sorry if it's not a direct answer but these days I much prefer to use code metric tools or profilers rather than lines of code. [Ants profiler](http://www.red-gate.com/products/ants_profiler/index.htm) and [NDepend](http://www.ndepend.com) are two that immediately come to mind. It's just that these tools allow you ...
What GIS software are you using? ArcGIS offers the Polygon to Raster tool in ArcGIS 9.2 or later, which is scriptable as the PolygonToRaster_conversion function. PolygonToRaster_conversion (in_features, value_field, out_raster_dataset, cell_assignment, priority_field, cellsize)
I find RobyCopy is a good alternative to xcopy. It supports high latency connections much better and supports resuming a copy. <http://en.wikipedia.org/wiki/Robocopy>
I find RoboCopy is a good alternative to xcopy. It supports high latency connections much better and supports resuming a copy. <http://en.wikipedia.org/wiki/Robocopy> Robocopy is shipped as part of the Windows Server 2003 resource kit and can be download from the [Microsoft download site](http://www.microsoft.com...
I find RoboCopy is a good alternative to xcopy. It supports high latency connections much better and supports resuming a copy. ### References [Wikipedia - robocopy](http://en.wikipedia.org/wiki/Robocopy) ### Downloads * Robocopy is shipped as part of the Windows Server 2003 resource kit and can be download from...
Inherit from System.Exception. System.ApplicationException is useless and the design guidelines say "**Do not** throw or derive from System.ApplicationException." See http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx
I suggest that you create a specific structure to deal with pagination. Something like (I'm a Java programmer, but that should be easy to map): public class Page { private List results; private int pageSize; private int page; public Page(Query query, int page, in...
The base exception from where all other exceptions inherit from is System.Exception, and that is what you should inherit, unless of course you have a use for things like, say, default messages of a more specific exception.
Structs (<a href="http://www.fnal.gov/docs/working-groups/fpcltf/Pkg/ISOcxx/doc/POD.html">PODs</a>, more generally) are handy when you're providing a C-compatible interface with a C++ implementation, since they're portable across language borders and linker formats. If that's not a concern to you, then I suppose the...
Structs (<a href="http://www.fnal.gov/docs/working-groups/fpcltf/Pkg/ISOcxx/doc/POD.html">PODs</a>, more generally) are handy when you're providing a C-compatible interface with a C++ implementation, since they're portable across language borders and linker formats. If that's not a concern to you, then I suppose the...
Doesn't seem like there is an easy way at all. You would have to start hooking the call to WriteConsole and dumping the string buffers. See [this post][1] for a similar discussion. [1]: http://objectmix.com/tcl/366746-autoexpect-under-windows-later-mac-linux.html#post1359780 Of course, if this is a one off ...
Whats the best way to test a method from multiple threads?
|c#|multithreading|unit-testing|testing|
this kind of follows on from another [question](http://stackoverflow.com/questions/41290/file-access-strategy-in-a-multi-threaded-environment-web-app) of mine. Basically, once I have the code to access the file (will review the answers there in a minute) what would be the best way to **test** it? I am thinking cr...
Whats the best way to unit test from multiple threads?
|c#|unit-testing|testing|multithreading|
this kind of follows on from another [question](http://stackoverflow.com/questions/41290/file-access-strategy-in-a-multi-threaded-environment-web-app) of mine. Basically, once I have the code to access the file (will review the answers there in a minute) what would be the best way to **test** it? I am thinking cr...
this kind of follows on from another [question](http://stackoverflow.com/questions/41290/file-access-strategy-in-a-multi-threaded-environment-web-app) of mine. Basically, once I have the code to access the file (will review the answers there in a minute) what would be the best way to **test** it? I am thinking cr...
Sure; just start two different servers on two different ports in two different threads that each use the same handler. Here's a complete, working example that I just wrote and tested. If you run this code then you'll be able to get a Hello World webpage at both http://localhost:1111/ and http://localhost:2222/ ...
Not easily. You could have two ThreadingHTTPServer instances, write your own serve_forever() function (don't worry it's not a complicated function). The existing function: def serve_forever(self, poll_interval=0.5): """Handle one request at a time until shutdown. Polls for shutdown every p...
Use [`TextField.getCharBoundaries`][1] to get a rectangle of the first and last characters in the areas where you want a background. From these rectangles you can construct a rectangle that spans the whole area. Use this to draw the background in a `Shape` placed behind the text field, or in the parent of the text fiel...
Use [`TextField.getCharBoundaries`][1] to get a rectangle of the first and last characters in the areas where you want a background. From these rectangles you can construct a rectangle that spans the whole area. Use this to draw the background in a `Shape` placed behind the text field, or in the parent of the text fiel...
Put interesting comments in the code. // This better not fail during my next presentation, stupid @#$@#%$ code. Don't talk about them, let them be found by the audience. -Adam
This is something that was explained to me, and I think it is very useful. You may want to consider not going to slide heavy at the beginning. You want to show your listeners something (obviously probably not the code) up front that will keep them on the edge of their seats wanting to learn about how to do what you jus...
CTRL+3 brings up a type-ahead list of any menu command.
FYI, that Hanselman article has [an update][1] (your link is from 2003). [1]: http://www.hanselman.com/blog/11TopTipsForASuccessfulTechnicalPresentation.aspx
How do you get JQuery Intellisense Working in VS 2008?
|asp.net|visual-studio|jquery|
I thought JQuery Intellisense was supposed to be improved with SP1. I even downloaded an annotated version of jquery 1.2.6, but intellisense will not work in a separate jscript file. I have the jquery library referenced first on my web page in the <head> tag. Am I doing anything wrong?
How do you get JavaScript/jQuery Intellisense Working in VS 2008?
|asp.net|javascript|visual-studio|jquery|intellisense|
You should read [Mark Jason Dominus](http://plover.com) excellent presentaton on public speaking: [Conference Presentation Judo](http://perl.plover.com/yak/presentation/)
I've been moving from C# in my professional career to looking at Ruby and RoR in my personal life, and I've found linux to be slightly more appealing personally for development. Particularly now that I've started using git, the implementation is cleaner on linux. Currently I'm dual booting and getting closer to run...
There is a code snippet for it. Use that. Plus, check your code analysis afterwards; the snippet leaves out one of the constructors you should implement.
How well does .NET scale?