instruction
stringlengths
0
30k
WMI is definitely the way to go. You can get quite a bit of useful audit information through that API.
Simplest solution? Don't let the browser cache at all. Append the current time (in ms) as a query. (You are still in beta, so you could make a reasonable case for not optimizing for performance. But YMMV here.)
We went with gSOAP rather than Axis to avoid having a dependency on both a JRE and Axis just for building a C++ project. It's worked ok, which is good since the gSOAP code is horrible and makes it very daunting to fix any bugs in it. A warning about gSOAP linking though: you can never use more than one WSDL in a si...
perldoc doesn't have an option to search for a particular entry in perlvar (like -f does for perlfunc). General searching is dependent on your pager (specified in the PAGER environment variable). Personally, I like "less." You can get [less for windows](http://gnuwin32.sourceforge.net/packages/less.htm) from the [GnuWi...
Rather than tick the standard "this field cannot be blank" checkbox (for example), you need to use the Data Validation rules instead. Lets say you have two views with a textbox in each that cannot be blank, but you want to only enforce the current view. Here's the structure of the form: fields: - currentView (n...
The vcvarsall.bat batch file which is run by the Visual Studio command prompt is simply trying to keep your system environment variables and paths nice and clean (and is important if you have multiple versions of Visual Studio). If you're happy limiting your setup to one version and having a long path and set of env...
ApexSQLScript is a great tool for scripting out an entire database - you can then check that into source control and manage changes. I've also found that documenting the sprocs consistently lets you pull out information about them using the data about the source code in sys.sql_modules - you can use tags or whatever...
The .FromFile method will not work on xbox or zune. You have two choices: 1. Just use the content pipeline ... on xbox or zune (if you care about them), you can't have user-supplied content anyways, so it doesn't matter if you only use the content pipeline. 2. Write code to load the texture (using .SetData), or ...
[GStreamer][1] is a popular choice. It's a full multimedia framework much like DirectShow or QuickTime, has the advantage of having legally licensed codecs available, and has excellent Python bindings. [1]: http://gstreamer.freedesktop.org/
Not sure I understand... All you can really do is optimize the rule, that's the part that needs to be fastest. You can't speed up the loop without just throwing more hardware at it. You could parallelize if you have multiple cores or machines.
Some areas like Flash can be read in one cycle, so do not need to be cached.
Sara Ford has a lot of tips like these about Visual Studio Here's one that references what aaronjensen said about File.CloseAllButThis: [http://blogs.msdn.com/saraford/archive/2008/01/08/did-you-know-you-can-close-all-but-this-on-files-in-the-file-tab-channel.aspx][1] [1]: http://blogs.msdn.com/saraford/ar...
I would recommend going the SQL Express route and including it in the install package. The installer has a ton of command-line options, and you can use SQL scripts to do any post-install configuration to the database (i.e., enabling/disabling CLR integration, OpenRowset, other features). In addition, it's much more...
I personnally side with McConnell's explanation from Code Complete. Use them whenever you can. They enhance your code's readability and remove the few and scarce confusions that might occur. There is one thing that's more important though....Consistency. Which ever style you use,make sure you always do it the sam...
If you only going to display data from DB XSL templates may be convenient solution, but if you gonna handle user interaction. Hm... I don't think it'll be maintainable at all.
I've always found two main issues when working with XML transformations: Firstly they tend to be quite slow, the whole XML file must be parsed and validated before you can do anything with it. Being XML it's also excessively verbose, and therefore larger than it needs to be. Secondly the way transformations work ...
I think the key question to ask here is 'Who / What is going to be using the history'? If it's going to be mostly for reporting / human readable history, we've implemented this scheme in the past... Create a table called 'AuditTrail' or something that has the following fields... [ID] [int] IDENTITY(1,1) NOT N...
I think the key question to ask here is 'Who / What is going to be using the history'? If it's going to be mostly for reporting / human readable history, we've implemented this scheme in the past... Create a table called 'AuditTrail' or something that has the following fields... [ID] [int] IDENTITY(1,1) NOT N...
This question is too subjective for StackOverflow, as per the [FAQ](http://stackoverflow.com/faq) > **What kind of questions should I not > ask here?** > > Avoid asking questions that are > **subjective**, argumentative, or require > extended discussion. This is a place > for questions that can be answered! ...
This question is subjective, and should be avoided on StackOverflow, as per the [FAQ](http://stackoverflow.com/faq) > **What kind of questions should I not > ask here?** > > Avoid asking questions that are > **subjective**, argumentative, or require > extended discussion. This is a place > for questions that c...
How about using: double pi = Math.PI; If you want better precision than that, you will need to use an algorithmic system and the Decimal type. Skizz
You want to reduce unnecessary trips to the DB, so performing validation within the application is a good practice. Also, it allows you to handle data errors where it is most easy to recover from: up near the UI (whether in the controller or within the UI layer for simpler apps) where the data is entered. There ar...
Why do you or do you not implement using polyglot solutions?
|programming-languages|language|polyglot|
Polyglot, or multiple language, solutions allow you to apply languages to problems which they are best suited for. Yet, at least in my experience, software shops tend to want to apply a "super" language to all aspects of the problem they are trying to solve. Sticking with that language come "hell or high water" even ...
@Daniel, incase you are still interested, there is a new solution shared by [Paul Galbraith][1], a tool that allows for online backup of innodb tables called ibbackup from oracle which to quote Paul, > when used in conjunction with > innobackup, has worked great in > creating a nightly backup, with no > downti...
@Daniel, in case you are still interested, there is a newish (new to me) solution shared by [Paul Galbraith][1], a tool that allows for online backup of innodb tables called [ibbackup][2] from oracle which to quote Paul, > when used in conjunction with > [innobackup][3], has worked great in > creating a nightly...
This is a permissions problem where the user that your web server is running under does not have read and/or execute permissions to the necessary directories in the symbolic link path. The quick and easy way to check is to `su - web-user` (where `web-user` is the user account that the web server is running under) and ...
It might be a good idea to use GameCanvas class if you are writing a game. It is much better for such purpose and when used properly it should solve your problem.
Here's the best solution I've found so far. This [MSDN article][1] gives the source code for a cell class that adds an Enabled property. [1]: http://msdn.microsoft.com/en-us/library/ms171619.aspx
Here's the best solution I've found so far. This [MSDN article][1] gives the source code for a cell class that adds an Enabled property. It works reasonably well, but there are two gotchas: 1. You have to invalidate the grid after setting the Enabled property on any cells. It shows that in the sample code, but I...
[Bitmap][1] class from System.Drawing.dll assembly: Bitmap bitmap = new Bitmap(@"C:\image.png"); Color clr = bitmap.GetPixel(0, 0); [1]: http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.aspx
How's the ActionScript2 -> ActionScript3 learning curve?
|flash|actionscript-3|
I knew ActionScript and ActionScript2 inside out, but I've been away from Flash for a couple years. What's the magnitude of becoming fluent in ActionScript3 and the new Flash functionality? From Colin Moock's blog, I heard that some of the fundamental movieclip methods have changed...
[Sonar][1] is a quality control tool. It gauges quality of Java applications through the observance of coding rules conventions, metric measures and advanced indicators. Sonar is based on the following projects : - [JavaNCSS][2]: Quality Metric - [Checkstyle][3]: Style Cheking - [PMD][4]: Code scannin...
Code Analysis In Python
|python|static-analysis|cyclomatic-complexity|
What tools are good to use for code analysis in python? I have a large source repository split across multiple projects, and I would like to be able to run tools across the directories to see details like Cyclomatic Complexity, and perhaps be able to spot errors using static analysis. Ideally, I would like to be ...
I'm not sure how you do the XOR bit (at least it should be slow; I don't think any of current GPUs accelerate that), but here's my idea: 1. have two input images 2. turn on occlusion query. 3. draw the two images to the screen (i.e. full screen quad with two textures set up), with a fragment shader that computes a...
No ... on all Windows platforms DWORD is 32 bits. LONGLONG or LONG64 is used for 64 bit types.
It is defined as: typedef unsigned long DWORD; However, according to the MSDN: > On 32-bit platforms, long is > synonymous with int. Therefore, DWORD is 32bit on a 32bit operating system. There is a separate define for a 64bit DWORD: typdef unsigned _int64 DWORD64; Hope that helps.
No it does not. But if the protocol of the URL is HTTP, you'll get a [`HttpURLConnection`](http://java.sun.com/javase/6/docs/api/java/net/HttpURLConnection.html) as a return object. This class has a `setRequestMethod` method to specify which HTTP method you want to use. If you want to do more sophisticated stuff yo...
For most people I interview for Java developer positions labeled blocks are very surprising. Here is an example: // code goes here getmeout:{ for (int i = 0; i < N; ++i) { for (int j = i; j < N; ++j) { for (int k = j; k < N; ++k) { //do somet...
I've used that technique in the past, and there are applications where we use it at my current place of employment. (I will admit, I am not totally a fan of it, but I'll play devil's advocate) Really that is one of the main advatages, and pushing this idea can be kinda neat. You're able to dynamically create the xsl...
You are using the wrong SMTP-server. If you you are only going to send emails to you gmail-account, have a look at my answer [here][1]. If you also need to send email to other accounts, ask you ISP for your SMTP-details. [1]: http://stackoverflow.com/questions/29988/how-to-send-email-from-a-program-without-us...
You are using the wrong SMTP-server. If you you are only going to send emails to your gmail-account, have a look at my answer [here][1]. If you also need to send email to other accounts, ask you ISP for your SMTP-details. EDIT: I think it is always better to use the ISP SMTP-server as they (should) have people mo...
Do you have control over the input format? | (pipes), and \t usually make for better field terminators.
Comparing and constrastign the langauge between the two can be quite difficult, as in many ways it is the associated libraries that you use in association wit hthe language that best showcase the various advantage of one of another. So I'll try to list out as many things I can remember or that have already been post...
If there is an argument to gcc to do this, I don't know what it is. We end up piping the dependency output through sed to rewrite all occurrences of <blah>.o as ${OBJDIR}/<blah>.o
Another huge gotcha: when outputting XML through a web page (ASP.NET), you don't want to include the Unicode Byte-Order Mark. Of course, the ways to use or not use the BOM are almost the same: http://today.icantfocus.com/blog/microshaft/troubleshooting-common-problems-with-the-xmlserializer/ BAD (includes BOM): ...
Batch script to copy newest file
|batch-file|windows|
I need to copy the newest file in a directory to a new location. So far I've found resources on the [forfiles][] command, a [date-related question][1] here, and another [related question][2]. I'm just having a bit of trouble putting the pieces together! How do I copy the newest file in that directory to a new place? ...
I'm not sure this is possible at all within gdb but then I'm no expert. However I can comment on the _Linux_ dynamic linker. The following should print the path of all resolved shared libraries and the unresolved ones. ldd path/to/executable We need to know how your shared libraries were linked with your...
I prefer to go with: Company.Website.Tests I don't care about any sub-namespaces like Company.Website.Controls, all of the tests go into the same namespace: Company.Website.Tests. You don't want your test namespaces to HAVE to be in parrallel with the rest of your code because it just makes refactoring namespace...
A bigger question you should be asking yourself is - why do I have a category code in the parts table that doesn't exist in the categories table?
1. Install unixutils for Windows (http://unxutils.sourceforge.net/) 2. Call: perldoc perlvar | grep -A10 %env
You could either: - put everything bar the very outermost shell into a 'common' DLL; - use a DEF file to generate export functions from your EXE. The second is very uncommon but it is possible to generate an import library just from the DEF file. Use LIB /DEF to generate the import library. See [Working with I...
Do you mean between Xen and the host or between different guests? If guests, I don't think there is something provided but you should probably use NFS as it is the best supported file system that supports a decent number of permissions and attributes but assumes a trusted network.
First realize that you're re-inventing the wheel here. There are a number of decent object-relational mapping libraries for database access in just about every language. For C/C++ you might look at: <http://trac.butterfat.net/public/StactiveRecord><br/> <http://debea.net/trac> Ok, with that out of the way, you...
There's no way you can know how long the client had to wait purely from the server side. You'll need some JavaScript. You don't want to synchronize the client and server clocks, that's overkill. Just measure the time between when the client makes the request, and when it finishes displaying its response. If the...
I don't know if you can force read only to be the only option, but you can implement your own event handler to override the ItemUpdating event. Just cancel the update and any changes will be discarded. Sahil shows a very basic event handler that performs the cancel [here][1]. [1]: http://blah.winsmarts.com/2...
After over 15 years of Windows development I recently wrote my first cross-platform C++ app (Windows/Linux). Here's how: - STL - Boost. In particular the filesystem and thread libraries. - A browser based UI. The app 'does' HTTP, with the UI consisting of XHTML/CSS/JavaScript (Ajax style). These resources a...
A natural progression IMO from DAO is ADO.net. I think you would find it pretty easy to pick up having the understanding/foundation of DAO. It uses DataAdapters and DataSets similar to recordsets. [Modifying Data in ADO.NET][1]. I would suggest looking into [Linq][2] when you get a chance. [1]: http://ms...
> I can't think of a way to do this without including a username and password for the smtp server in the application... You only need a username and password for authenticating yourself to a smarthost. You don't need it to send mail directly, you need it to send mail through a relay, e.g. your ISP's mail server. I...
Always using braces is a good idea but the standard answer that's always given "what if somebody adds a line of code and forgets to add the braces?" is a rather weak reason. There is a subtle bug which can be introduced by not having the braces from the start. It's happened to me a few times and I've seen it happen ...
If you want to jump on the same bandwagon everyone else does, jQuery is the end-all, be-all. You don't have to think, just listen to everyone else. :P Personally, I use and love [**MochiKit**][1]. It seems to do everything jQuery does, but the philosophy is a bit different and the community is by far smaller. Ther...
Is this for a Rails application or a Ruby one? Really with either you may be able to stick your properties in a yaml file and then `YAML::Load(File.open("file"))` it.
Is this for a Rails application or a Ruby one? Really with either you may be able to stick your properties in a yaml file and then `YAML::Load(File.open("file"))` it. ---------- **NOTE from Mike Stone:** It would actually be better to do: File.open("file") { |yf| YAML::load(yf) } or YAML.load_...
From the NHibernate documentation, you could use one of the [inheritance mappings][1]. You might also have a separate class for each table, but have them all implement some common interface [1]: http://www.hibernate.org/hib_docs/nhibernate/html/inheritance.html
Generally no. If your computers are all Dell, though, you might be able to get some information (maybe the serial number?) for the PC itself. The monitor, if it supports [VESA EDID][1] (DDC, EDID, EEDID), may also include a 32 bit serial number - which may or may not have any relation to the serial number printed o...
|windows|batch-file|
Using Python is more than "syntactic sugar" unless you *enjoy* writing (or having your IDE generate) hundreds of lines of boiler plate code. There's the advantage of Rapid Development techniques when using dynamically typed languages, though the disadvantage is that it complicates your API and integration because you n...
since I doubt that you will know the name of every admin and there is no start folder for just admins, then I think a better solution would be for you to have the configuration app check to see if the user running it is an admin then exit gracefully if it is not.
since I doubt that you will know the name of every admin and there is no start folder for just admins, then I think a better solution would be for you to have the configuration app check to see if the user running it is an admin then exit gracefully if it is not. EDIT: Perhaps I should explain further why I think...
Take a look at when the drag panel extender and popup control extender actually extend your panel. Chances are those extenders work on an initialization event of the page. When the update panel fires and updates your page the original DOM element that was extended was replaced by the result of the update panel. Whic...
We use SBCL, UCW, CL-SQL and MySQL as our back-end for [Paragent.com][1]. It has worked very well for us. We also have a number of clients using UCW/CL-SQL/MySQL for custom sites we have built them through our consulting arm [Bitfauna][2]. [1]: http://paragent.com [2]: http://bitfauna.com
You can use "OK" and "Cancel" By substituting `MessageBoxButtons::YesNo` with `MessageBoxButtons::OKCancel` [MessageBoxButtons Enum][1] [1]: http://msdn.microsoft.com/en-us/library/system.windows.forms.messageboxbuttons.aspx Short of that you would have to create a new form, as I don't believe the Enum ...
Good question. I'm not a ruby guy (i use java with flex), but what I believe differentiates blazeds vs commercial livecycle ds is 1. Streaming protocol support (rtmp) - competition for comet and such, delivering video 2. Some advanced stuff for hibernate detached objects and large resultset caching that I don't f...
I think you should just start working on it without telling your boss. This is truly how I've done my best work. I just don't tell my boss what I'm doing and slowly replace bad/legacy code when I have time. It has acutally saved my ass on more than one occasion.
**WordPress** actually has a forum plugin - it's nothing fancy but it's there. It handles user management et al and has a big community for plugins and themes. I think it is probably the easiest CMS to install & run (I've done some legwork here). There are plugins that update the core & plugins automatically (take that...
<a href="http://acko.net/dev/farbtastic">Farbtastic</a> is a nice jQuery color picker But apparently doesn't work in IE6 <a href="http://www.eyecon.ro/colorpicker/#about">Here</a> is another jQuery color picker that looks nice, not sure about it compatibility though.
Abstract enums are potentially very useful (and currently not allowed). But a proposal and prototype exists if you'd like to lobby someone in Sun to add it: http://freddy33.blogspot.com/2007/11/abstract-enum-ricky-carlson-way.html Sun RFE: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6570766
I'm the one supporting CairoPlot and I'm very proud it came up here. Surely matplotlib is great, but I believe CairoPlot is better looking. So, for presentations and websites, it's a very good choice. Today I released version 1.1. If interested, check it out at [CairoPlot v1.1](http://linil.wordpress.com/2008/09/1...
There really isn't an easier way to do this. These APIs are not exposed by the .NET Framework (yet), so the only way to do it is through some kind of interop (or WPF). As for working with both Windows versions, the code you have should be fine, since the runtime does not go looking for the entry point to the DLL unt...
Pros: Access to the libraries available for JVM or CLR. Cons: Both naturally lag behind CPython in terms of features.
try to use oledbConnection , oledbCommand and oledbDataReader from System.data.oledb if you are using sqlserver DB use SqlConnection , sqlCommand and sqlDataReader
try to use oledbConnection , oledbCommand and oledbDataReader from System.data.oledb if you are using sqlserver DB then from System.data.SqlClient use SqlConnection , sqlCommand and sqlDataReader
**Jython** and **IronPython** are useful if you have an overriding need to interface with existing libraries written in a different platform, like if you have 100,000 lines of Java and you just want to write a 20-line Python script. Not particularly useful for anything else, in my opinion, because they are perpetually ...
For VS2005, I've been using [CoolCommands 4.0][1]. The feature description is more complete for the [older 3.0 version][2]. Version 3 had an .msi installer. Version 4 is a [.zip file][3] (which was easier for my environment anyway). My favorite features (a subset of the complete list): - From the Solution e...
As a completely different way of handling the same problem, we use a bug tracker with an XML-RPC interface, and our (RCP also, btw) app talks to that using a custom submission dialogue. It means we can send the log files to help diagnose the problem, without the user having to find them. I'm sure most bug tracker...
The Flickr API is very nice and easy to use and will be much easier than scraping the feed yourself. Getting a key takes about 2 minutes - you fill in a form on the website and then email it to you.
The easiest way I found is to create a new <code>PrinterSettings</code> object. It starts with all default values, so you can check its *Name* property to get the name of the default printer. <code>PrinterSettings</code> is in System.Drawing.dll in the namespace <code>System.Drawing.Printing</code>. <pre><code>P...
Here's a slew of alternatives. [http://java-source.net/open-source/code-coverage][1] [1]: http://java-source.net/open-source/code-coverage
Really for issues like these, the best thing to do is [ASKTOM][1]. In particular the his answer to that question contains links to the online Oracle doc, where a lot of the those sorts of rules are explained. One thing to keep in mind, is that explain plans are really best guesses. It would be a good idea to l...
I would advise not trying to use Eclipse's plugins as your primary access to Subversion. If you are developing on Windows, TortoiseSVN is the best program that I have seen for Subversion access. Explore to the directory of which you wish to merge, right click on it and use the Tortoise SVN merge option. Assuming a...
Traditionally a program is compiled and a script is interpreted, but that is not really important anymore. A more modern definition might be that a program is intended to be used by a customer (perhaps an internal one) and thus should include documentation and support, while a script is primarily intended for the use o...
Traditionally a program is compiled and a script is interpreted, but that is not really important anymore. You can generate a compiled version of most scripts if you really want to, and other 'compiled' languages like Java are in fact interpreted (at the byte code level.) A more modern definition might be that a pro...
Traditionally a program is compiled and a script is interpreted, but that is not really important anymore. You can generate a compiled version of most scripts if you really want to, and other 'compiled' languages like Java are in fact interpreted (at the byte code level.) A more modern definition might be that a pro...