instruction
stringlengths
0
30k
What are the advantages of VistaDB
|sql-server|database|sqlite|firebird|vistadb|
I have seen the references to VistaDB over the years and with tools like SQLite, Firebird, MS SQL et. al. I have never had a reason to consider it. What are the benefits of paying for VistaDB vs using another technology? Things I have thought of: 1. Compact Framework Support. SQLite+MSSQL support the CF. 2. ...
In addition to 'automated frameworks', I highly recommend Damian Conway's _Perl Best Practices_. I don't agree with 100% of what he suggests, but most of the time he's bang on.
I believe there's no way to achieve that. You can only defragment the file after it's been written.
I have always liked the icon selections at <a href="http://www.virtuallnk.com/">VirtualLNK</a>. They have a good number of icon packages that have a modern look at a reasonable price.
Kill a specific PHP script running on FastCGI / IIS?
|php|iis|fastcgi|
I'm a PHP developer, but honestly my knowledge of server management is somewhat lacking. I fired off a script today that took a regrettably long time to run, and because it had an embedded call to `ignore_user_abort()`, pressing "stop" in the browser was obviously futile. There was a time limit of 15 minutes enforced i...
Files on Windows and Contiguous Sectors
|windows|filesystems|
Is there a way to guarantee that a file on Windows (using the NTFS file system) will use contiguous sectors on the hard disk? In other words, the first chunk of the file will be stored in a certain sector, the second chunk of the file will be stored in the next sector, and so on. I should add that I want to be able ...
_This would-be quick advice became a long answer. Sorry._ As tyler pointed out in his nice answer, calling `Dispose()` is a great programming practice. This is because this method is supposed to "rally together" all the resource-freeing needed so there are no unneeded open resources. If you wrote some text to a file...
_This would-be quick advice became a long answer. Sorry._ As tyler pointed out in his nice answer, calling `Dispose()` is a great programming practice. This is because this method is supposed to "rally together" all the resource-freeing needed so there are no unneeded open resources. If you wrote some text to a file...
I am looking for a reliable technique for adding Ajax to a working ASP.NET MVC application. I want to use jQuery, and understand how to use the ajax functionality from jQuery. What I need to know is how I should write my controller so that I can run the site without javascript, but at the same time make ajax calls poss...
Statistics. The de facto standard for testing RNGs is the [Diehard suite][1]. Alternatively, the [Ent program][2] provides tests that are simpler to interpret but less comprehensive. As for shuffling algorithms, use a well-known algorithm such as [Fisher-Yates][3] (a.k.a "Knuth Shuffle"). The shuffle will be unif...
Technically a JPanel may start off non-opague. This was true for the Gtk look & feel in 1.5 (or 1.4?), but no other PL&Fs as far as I am aware.
I've found Cygwin to be very useful in the past. FWIW, lately however I've shied away from it in favor of the following: 1. [XAMPP][1] 2. [Unixutils][2] I like these tools even better. [1]: http://www.apachefriends.org/en/xampp-windows.html [2]: http://unxutils.sourceforge.net/
I'm not fully following your question. You say > Assume that you have a algorithm that generates randomness. Now how do you test it? What do you mean? If you're assuming you can generate randomness, there's no need to test it. Once you have a good random number generator, creating a random permutation is easy...
Martin, you are absolutely right of course. But I would deliver the launcher with the installer. Or just download the installer, launch it and quit myself as soon as possible. The reason is bugs in the launcher. You would never, ever, want to be dependent on a component you cannot update (or forget to include in th...
I would choose varchar unless the column stores fixed value like US state code -- which is always 2 chars long and the list of valid US states code doesn't change often :). In every other case, even like storing hashed password (which is fixed length), I would choose varchar. Why -- char type column is always ful...
Disable Specific Keys in IE 6
|internet|explorer|6|
I need to disable specific keys (Ctrl and Backspace) in Internet Explorer 6. Is there a registry hack to do this. It has to be IE6. Thanks.
|internet-explorer-6|
I need to disable specific keys (Ctrl and Backspace) in Internet Explorer 6. Is there a registry hack to do this. It has to be IE6. Thanks. Long Edit: @apandit: Whoops. I need to more specific about the backspace thing. When I say disable backspace, I mean disable the ability for Backspace to mimic the Back...
|internet-explorer-6|kiosk|
What is PHP Safe Mode GID?
|php|unix|gid|uid|
According to the [PHP Safe Mode Docs](http://uk3.php.net/features.safe-mode) on safe\_mode\_gid: > By default, Safe Mode does a UID compare check when opening files. If you want to relax this to a GID compare, then turn on safe_mode_gid. Whether to use UID (FALSE) or GID (TRUE) checking upon file access. To a PHP...
According to the [PHP Safe Mode Docs](http://uk3.php.net/features.safe-mode) on safe\_mode\_gid: > By default, Safe Mode does a UID compare check when opening files. If you want to relax this to a GID compare, then turn on safe\_mode\_gid. Whether to use UID (FALSE) or GID (TRUE) checking upon file access. To a P...
|php|unix|
IMO, it's really overly defining "object-oriented", but what they are referring to is that Ruby, unlike C#, C++, Java, et al, does not make use of *defining* a class -- you really only every work directly with objects. Conversely, in C# for example, you define *classes* that you then must *instantiate* into object by ...
I just viewed source with a DOM inspector and it appears that they are `span`s for each cell with a margin set (as [Darren][1] said) to positionthe right column over. [1]: #50820
I just viewed source with a DOM inspector and it appears that they are `span`s for each cell with a margin set (as [Darren][1] said) to position the right column over. [1]: #50820
What are the (technical) pros and cons of Flash vs AJAX/JS?
|ajax|flash|ria|
We provide a web application with a frontend completely developed in Adobe Flash. When we chose Flash 6 years ago, we did so for its large number of features for user interaction, like dragging stuff, opening and closing menus, tree navigation elements, popup dialogs etc. Today it's obvious that AJAX/JS offers rough...
JS and Flash both have great presence on the web with overlapping capabilities. One area JS is still lacking is in rendering video.
This is really probably getting down to what these people see others doing in c# and java as opposed to c# and java supporting OOP. Most languages cane be used in different programming paradigms. For example, you can write procedural code in c# and scheme, and you can do functional-style programming in java. It is more...
You can use [pgrep][1] to get the process ID of Jack's instance of AwesomeApp: pgrep -u Jack AwesomeApp <br/> So if you launch the supervisor application from a shell script, you could do something like the following: AWESOME_ID=`pgrep -u $USER AwesomeApp 2>/dev/null` # run the supervisor appli...
I've been incorporating context-sensitive screencasts into my applications. I've found this helps non-technical users grasp the application quickly, without asking for live help.
Easy - don't start at all projects you're likely to lose interest in. Spend more time to make sure you want to commit yourself to an idea before beginning any work.
To add to aku's excellent answer, for English speakers, IDA Pro is available at <http://www.hex-rays.com/>.
Assuming a mythical object TreeItem, that conatins a Children collection to represent your hierarchy. public void HandleTreeItems(Action<TreeItem> item, TreeItem parent) { if (parent.Children.Count > 0) { foreach (TreeItem ti in parent.Children) ...
Mocking Static Blocks in Java
|java|unit-testing|mocking|static-block|
My motto for Java is "just because Java has static blocks, it doesn't mean that you should be using them." Jokes aside, there are a lot of tricks in Java that make testing a nightmare. Two of the most I hate are Anonymous Classes and Static Blocks. We have a lot of legacy code that make use of Static Blocks and these a...
@Coincoin has covered the bases; I just want to add that with regex it's particularly easy to end up with hard-to-read, hard-to-maintain code. Regex is a powerful and very compact language, so that's how it often goes. Using whitespace and comments within the regex can go a long way to make it easier to maintain re...
I'm not sure about why that can't be passed as Object[], but wouldn't be easy if you just create a real class to wrap an array and handle your "weird logic" in there? You'd get the benefits of using a real reference object were you could add "intelligence" to your class. Edit: How are you casting your Array, coul...
I suppose we can read something into the lack of immediate answers to this question and that is that not many/any of the acive stackoverflow responders are using D. I was also a little surprised about the level of its ranking in the TIOBE listing that you link to. Having said that, Walter Bright has been working on ...
First, it is impossible to know for sure if a certain finite output is "truly random" since, as you point out, [any output is possible][1]. What can be done, is to take a sequence of outputs and check various measurements of this sequence against what is more likely. You can derive a sort of confidence score that t...
Is there a way to guarantee that a file on Windows (using the NTFS file system) will use contiguous sectors on the hard disk? In other words, the first chunk of the file will be stored in a certain sector, the second chunk of the file will be stored in the next sector, and so on. I should add that I want to be able ...
I would start here: http://technet.microsoft.com/en-us/sysinternals/bb897428.aspx and follow Mark's documentation of the defrag stuff: http://technet.microsoft.com/en-us/sysinternals/bb897427.aspx
I agree with all the security concerns. Your assumption that "the users and their email providers takes care of their email account security" is not correct when it comes to the sender's e-mail address. But since you specifically asked "how do I go from an email is sent to an account that is not read by humans to t...
I know of no such guarantees. But also keep in mind that NTFS "files" are comprised of multiple data streams. So you are actually looking for a way to guarantee that a **stream** is contiguous.
A generic method should give you intellisense: class MyType<K,V> {K Key{get;set;} V Value{get;set;}} public IQueryable<T> GetSomeData<T,K,V>() where T : MyType<K,V> where T : new()
A generic method should give you intellisense: public class MyType {Key{get;set;} Value{get;set}} public IQueryable<T> GetSomeData<T>() where T : MyType, new() { return from a in db.MyTable where a.MyValue == "A" select new T {Key=a.Key,Value=a.MyValue}; }
I'm still not seeing why the passwords have to be unique? What's the downside if 2 of your users have the same password? This is assuming we're talking about passwords that are tied to userids, and not just unique identifiers. If *that's* what you're looking for, why not use GUIDs?
If you're inserting multiple rows the use of the OUTPUT and INSERTED.columnname clause on the insert statement is a simple way of getting all the ids into a temp table. DECLARE @MyTableVar table( ID int, Name varchar(50), ModifiedDate datetime); ...
If you use slides at all, follow [Guy Kawasaki's 10/20/30 rule][1]: - No more than 10 slides - No more than 20 minutes spent on slides - No less than 30 point type on slides -Adam [1]: http://blog.guykawasaki.com/2005/12/the_102030_rule.html
Is there some way of recycling a Crystal Reports dataset?
|crystalreports11|subreport|grouping|dataset|
I'm trying to write a Crystal Report which has totals grouped in a different way to the main report. The only way I've been able to do this so far is to use a subreport for the totals, but it means having to hit the data source again to retrieve the same data, which seems like nonsense. Here's a simplified example: ...
|asp.net|crystalreports11|dataset|grouping|subreport|
|asp.net|crystal-reports|dataset|grouping|subreport|
|asp.net|crystal-reports|dataset|
How do I create a spring bean for a Java double primitive?
|java|spring|
I'd like to create a spring bean that holds the value of a double. Something like: <bean id="doubleValue" value="3.7"/>
One way of looking at the problem is as follows: First, a can be any value from 0 to 500. Then if follows that b+c+d+e = 500-a. This reduces the problem by one variable. Recurse until done. For example, if a is 500, then b+c+d+e=0 which means that for the case of a = 500, there is only one combination of valu...
One way of looking at the problem is as follows: First, a can be any value from 0 to 500. Then if follows that b+c+d+e = 500-a. This reduces the problem by one variable. Recurse until done. For example, if a is 500, then b+c+d+e=0 which means that for the case of a = 500, there is only one combination of valu...
If you want to put a System.out.println("anything"); to your code you can simply do as follows: Only write ", then mark the "" and press Crtl-Space Up-Arrow and enter (you should land on "sysout"). Voila, there it is :)
If you've already read the [Cygwin User Guide](http://cygwin.com/cygwin-ug-net/), take a look at [Ten Steps To Higher Cygwin Productivity](http://www.weiqigao.com/blog/2006/08/14/ten_steps_to_higher_cygwin_productivity.html). Also, if you're using a shell such as bash in Cygwin, and you're familiar with Emacs, consi...
Typically you would create your site so that it works without JavaScript being enabled. Then you would add the [unobtrusive JavaScript][1] needed to enhance your site with Ajax e.g. adding event handlers for links, form submits, etc. to make GET / POST requests and update your UI accordingly. The only changes you wo...
Are you sure you want that? It means that when you check out a file, it will be out of sync with the rest of your files. Your project may not build or function properly until you update all files.
There's a lot of theory on testing randomness. For a very simple test on a card shuffling algorithm you could do a lot of shuffles and then run a chi squared test that the probability of each card turning up in any position was uniform. But that doesn't test that consecutive cards aren't correlated so you would also wa...
I assume that you're actually creating an XML dom tree because you want to validate that what goes into this file is valid XML, since otherwise you'd just write a static string to a file. If validating your output is indeed your goal, then I'd suggest from xml.dom.minidom import parseString doc = par...
Joyent's [**Slingshot**][1] might be a good bet. > Joyent Slingshot allows developers to deploy Rails applications like a standard desktop application, which work online and offline (with synchronization), have drag and drop, and interact with all the other desktop applications. > With Joyent Slingshot: >* Cre...
If you want no disassemble native x86/64 app use [IDA][1], .NET exe/dll can be disassembled using Reflector. There are [tons][2] of utility to extract resources. Can you elaborate your question a bit? [1]: http://www.idapro.ru [2]: http://www.google.ru/search?complete=1&hl=en&newwindow=1&client=firefox-a&rls=...
If you want to disassemble native x86/64 app use [IDA][1], .NET exe/dll can be disassembled using Reflector. There are [tons][2] of utilities to extract resources. Can you elaborate your question a bit? [1]: http://www.idapro.ru [2]: http://www.google.ru/search?complete=1&hl=en&newwindow=1&client=firefox-a&rl...
Where do the Python unit tests go?
|python|unit-testing|
If you're writing a library, or an app, where do the unit test files go? It's nice to separate the test files from the main app code, but it's awkward to put them into a "tests" subdirectory inside of the app root directory, because it makes it harder to import the modules that you'll be testing. Is there a b...
try c# much :)
Sounds to me like you are treating a symptom: poor design with dependencies on static initialization. Maybe some refactoring is the real solution. It sounds like you've already done a little refactoring with your `staticInit()` function, but maybe that function needs to be called from the constructor, not from a stat...
I'm not sure about other databases, but for SQL Server I recommend the Execution Plan. It very clearly (albeit with lots and vertical and horizontal scrolling, unless you've gota 400" monitor!) shows what steps of your query are sucking up the time. If you've got one step that takes a crazy 80%, then maybe an index ...
Thanks for the quick response. However, note the required output does not have property names in the "cell" array ( that's why I was using object[]): "cell":["FAMIA","Familia Arquibaldo",... vs. "cell":{"CustomerID":"FAMIA","CompanyName","Familia Arquibaldo",... The result is meant to be used with a JQuery g...
In addition to the page mentioned by @pauljette, this page has good performance optimization advice: [http://msdn.microsoft.com/en-us/library/ms345118.aspx][1] There's a lot you can do to speed up the performance of XML queries, but it will never be as good as properly indexed relational data. If you are selecti...
Why the claim that c# guys don't get object-oriented programming? (vs class-oriented)
|oop|languages|
This caught my attention last night. On the latest [ALT.NET Podcast][1] Scott Bellware discusses how as opposed to Ruby, languages like c#, java et al. are not truly object oriented rather opting for the phrase "class-oriented". They talk about this distinction in very vague terms without going into much detail or ...
|oop|languages|
This caught my attention last night. On the latest [ALT.NET Podcast][1] Scott Bellware discusses how as opposed to Ruby, languages like c#, java et al. are not truly object oriented rather opting for the phrase "class-oriented". They talk about this distinction in very vague terms without going into much detail or ...
I'll take a stab at this. Python and Ruby are duck-typed. To generate any maintainable code in these languages, you pretty much have to use test driven development. As such, it is very important for a developer to easily inject dependencies into their code without having to create a giant supporting framework. S...
You can set triggers on the events in the update panel you want updated or you can explicitly say updatepanel.update() in the code behind.
What about registering a PostBackTrigger (instead of an AsyncPostBackTrigger) that will refresh every panel when a specific event fires. Or add the trigger that already refreshes some UpdatePanels to the other UpdatePanels as well.
You can do this using func_get_args like so: //function to return first non-empty value passed in to it, //useful for getting a default value function defaultValue() { $args = func_get_args(); foreach($args as $arg) { if(!empty($arg)) { return $arg; ...
You can do this using func_get_args like so: error_reporting(E_ALL); ini_set('display_errors', 1); function defaultValue() { $args = func_get_args(); foreach($args as $arg) { if (!is_array($arg)) { $arg = array($arg); } ...
This is a good technique if you want to refresh updatepanel from [client side Javascript][1]. [1]: http://encosia.com/2007/07/13/easily-refresh-an-updatepanel-using-javascript/