instruction
stringlengths
0
30k
My understanding of spooling is that it's a bit of a red herring on your execution plan. Yes, it accounts for a lot of your query cost, but it's actually an optimization that SQL Server undertakes automatically so that it can avoid costly rescanning. If you were to avoid spooling, the cost of the execution tree it si...
Scope and garbage collection: When you leave the unattached block, any variables declared in it go out of scope. That lets the garbage collector clean up those objects.
Scope and garbage collection: When you leave the unattached block, any variables declared in it go out of scope. That lets the garbage collector clean up those objects. [Ray Hayes][1] points out that the .NET garbage collector will not immediately collect the out-of-scope objects, so scoping is the main benefit. ...
It is not possible to convert any arbitrary string representing a number into a double or float without losing precision. There are many fractional numbers that can be represented exactly in decimal (e.g. "0.1") that can only be approximated in a binary float or double. This is similar to how the fraction 1/3 cannot be...
Get a good understanding and feel on how the Garbage Collector behaves, and you will understand why what you are thinking of here is not recommended. unless you really like the CLR to spend time rearranging objects in memory *alot*. - [http://msdn.microsoft.com/en-us/magazine/bb985010.aspx][1] - [http://msdn.mi...
> Konrad Zuse's PlanKalkül (1940s) - never implemented There was actually an implementation of the language published by Rojas *et al.* somewhere around the year 2000.
Hmmm...You might be able to employ <a href=www.cutepdf.com>CutePDF</a> printer in a creative way to solve this problem. Essentially, it takes *anything* that can be fed through a standard print driver and makes a PDF out of it. It's free.
Just two things, really: 1. "A user interface is well-designed when the program behaves exactly how the user thought it would" - [quoted][1] from Joel Spolsky's [User Interface Design For Programmers][2] 1. Put your designs in front of a user. A real end-user is best, but for lightweight, rapid feedback, you can'...
Using factories or factory methods for all object creation, you can avoid invalid objects without throwing exceptions from constructors. The creation method should return the requested object if it's able to create one, or null if it's not. You lose a little bit of flexibility in handling construction errors in the use...
Task/issue tracking system with command-line interface
|task-tracking|
Are the any task tracking systems with command-line interface? Here is a list of features I'm interested in: - Simple task template Something like plain-text file with property:type value, for example: > description:string > some-property:integer required - command line interface ...
Are the any task tracking systems with command-line interface? Here is a list of features I'm interested in: - Simple task template Something like plain-text file with property:type value, for example: > description:string > some-property:integer required - command line interface ...
|task-tracking|
Are the any task tracking systems with command-line interface? Here is a list of features I'm interested in: - Simple task template Something like plain-text file with property:type pairs, for example: > description:string > some-property:integer required - command line interface ...
Delphi 2009 has the option to make warnings into failures. That would do what you want to do as far as making it fail. To prevent the implicit importing you need to import it explicitly, or remove the unit that is implicitly importing it.
The .Net framework after v2 has a useful feature where you can mark an assembly with the InternalsVisibleTo attribute that allows the assembly to be accessed by another. A sort of assembly tunnelling feature.
As the others point out, a seperate test project (for each normal project) is a good way to do it. I usually mirror the namespaces and create a test class for each normal class with 'test' appended to the name. This is supported directly in the IDE if you have Visual Studio Team System which can automatically generate ...
How to share individual rules between .drl files in JBoss Rules?
|drools|jboss-rules|modularisation|
We are using [JBoss Rules][1] (a.k.a. Drools) and have several *.drl* files that each contain several rules. Is there a way to avoid duplication between files, so that we can define common rules that are available to more than one *.drl* file? Unfortunately, there does not seem to be any kind of *include* or module ...
I'm not sure if there is something more native to get this done, but there seems to be a [command that hacks the SWF to add a ScriptLimits tag](http://www.buraks.com/swfsli/) to extend the timeout period.
mailto links just doesn't support this feature , sorry. however, you could use a specific subject and filter it in your inbox <a href="mailto:webmaster@website.com?subject=Urgent">Send a email</a>
I use UnitTest++. The tests are in a separate project but the actual tests are intertwined with the actual code. They exist in a folder under the section under test. ie: MyProject\src\ <- source of the actual app MyProject\src\tests <- the source of the tests If you have nested folders (and who doesn't) th...
The mode property from the authenticationsection: [AuthenticationSection.Mode Property (System.Web.Configuration)][1]. And you can even modify it. // Get the current Mode property. AuthenticationMode currentMode = authenticationSection.Mode; // Set the Mode property to Windows. aut...
The mode property from the authenticationsection: [AuthenticationSection.Mode Property (System.Web.Configuration)][1]. And you can even modify it. // Get the current Mode property. AuthenticationMode currentMode = authenticationSection.Mode; // Set the Mode property to Windows. aut...
Performance when checking for duplicates
|c#|performance|.net-2.0|collections|
I've been working on a project where I need to iterate through a collection of data and remove entries where the "primary key" is duplicated. I have tried using a List<int> and Dictionary<int, bool> With the dictionary I found slightly better performance, even though I never need the Boolean tagged...
How do I fix "501 Syntactically invalid HELO argument(s)"?
|email|exim|
I'm using exim on both the sending and relay hosts, the sending host seems to offer: HELO <it's own name> Response: 501 Syntactically invalid HELO argument(s) I thought it was mean't to do: HELO <smart_host> Has anyone else had this? - thanks.
I'm using exim on both the sending and relay hosts, the sending host seems to offer: HELO foo_bar.example.com Response: 501 Syntactically invalid HELO argument(s) I thought it was mean't to do: HELO smtp.example.com Has anyone else had this? - thanks.
I'm using exim on both the sending and relay hosts, the sending host seems to offer: HELO foo_bar.example.com Response: 501 Syntactically invalid HELO argument(s)
I always use [WinGREP][1], but I've had issues with it not letting go of files. [1]: http://www.wingrep.com
What are the major vulnerabilities of Windows 2003 + Apache?
|security|
I am searching for a host for a new commercial website. Among other things, I'd like to know what the various OS - Webserver combinations have in terms of vulnerabilities. What are the vulnerabilities of Windows 2003 + Apache?
javascript library to show photo album
|javascript|
I visited few web sites in the past where they had a set of photo thumbnails and clicking on one of them created a cool effect of an expanding popup showing the full size image. Is there any available free javascript library that will do this? I'm interested mostly in the popup effect and less in the rest of the al...
With the help of the answers (and after getting the inside and outside loops correct) I got this to work: var t = eval( "(" + request + ")" ) ; for (var i = 0; i < t.data.length; i++) { myTable += "<tr>"; for (var j = 0; j < t.hdrs.length; j++) { myTable += "<td>" ; if (t.data[...
the numbers. in command mode type a number ( any number of digits ) type a command. that command will be executed $number times ie: 99dd erases the next 99 lines.
If you want to quickly compare features on CMS's, then take a look at [CMS Matrix][1] - has practically every cms known to man on there. [1]: http://www.cmsmatrix.org/
If you want to quickly compare features on CMS's, then take a look at [CMS Matrix][1] - has practically every cms known to man on there. *Edit* To be a little more precise, from the site > CMSMatrix is the number one content management system comparison site on the Internet. It allows users to evaluate over 950 ...
Just do it and schedule it into your normal process. Estimate refactoring time into starting a new change or into finishing a change (ideal). I always refactor while I'm initially exploring new code (extracting methods, etc).
Speak in a language he can understand. Refactoring is paying design debt. Ask your boss why he pays the company credit card bill every month vs not paying it until there is a collections notice. Tell him refactoring is like making your monthly payment.
Even in a DDD, I would keep Data Access classes and routines separate from Entities. Reasons are, 1. Testability improves 2. Separation of concerns and Modular design 3. More maintainable in the long run, as you add entities, routines I am no expert, just my opinion.
Eclipse is a good one for mac, or Apple's own free Xcode which can be d/l'd off their development site.
Less money now for me to refactor... or more money later to fix whatever goes wrong and for me to refactor.
If it's code running inside a loop that will likely cause an exception over and over again, then throwing exceptions is not a good thing, because they are pretty slow for large N. But there is nothing wrong with throwing custom exceptions if the performance is not an issue. Just make sure that you have a base excepti...
You may use a little bit generic exceptions for that conditions. For e.g. ArgumentException is meant to be used when anything goes wrong with the parameters to a method (with the exception of ArgumentNullException). Generally you would not need exceptions like LessThanZeroException, NotPrimeNumberException etc. Think o...
Drobo for local backup DVD for short-term local archiving Amazon S3 for off-site,long-term archiving
Throwing exceptions causes the stack to unwind, which has some performance impacts (admitted, modern managed environments have improved on that). Still repeatedly throwing and catching exceptions in a nested situation would be a bad idea. Probably more important than that, exceptions are meant for exceptional condit...
You can also do this by using some XmlSerializer attribute black magic: [XmlIgnore] public bool MyValue { get; set; } /// <summary>Get a value purely for serialization purposes</summary> [XmlElement("MyValue")] public string MyValueSerialize { get { return this.MyValue ? "1" :...
For now I have worked around this by creating a new data contract type that can wrap either another data contract type or a simple type. Instead of passing type Object, now I pass this wrapper class. This works OK, but I'd still like to know if there is a solution to the original issue.
Visual Studio 2008 SP1 has re-added support for classic ASP, but I don't believe either version supports the type of outlining you're looking for.
shmuel613, it would be better to update your original question rather than replying. It's best if there's a single place containing the complete question rather than having it spread out in a discussion. Ben's answer is reasonable, except he seems to have a 'not' where he doesn't want one. Dropping the table only if...
If the network is unavailable, you may want to check your VirtualBox configuration and make sure you have a network card configured. If you do, then the next stop would be the OS running in the virtual machine. An unfortunate fact of some operating systems is that they don't always appreciate hardware changes. If the O...
C# Unsafe/Fixed Code
|c#|.net|unsafe|fixed|
Can someone give an example of a good time to actually use "unsafe" and "fixed" in C# code? I've played with it before, but never actually found a good use for it. Consider this code... fixed (byte* pSrc = src, pDst = dst) { //Code that copies the bytes in a loop } compared to simply using.....
Using that method, you can set the subject line and body text with a URI like mailto:me@here.com?SUBJECT=Support mail&BODY=This is a support mail However, the length of the subject and body text will [have some limitation][1] There is no way I can think of to attatch a file using this method or something s...
Try cout << typeid(a).name() << endl; You might have to activate RTTI in your compiler options for this to work. Additionally, the output of this depends on the compiler. It might be a raw type name or a name mangling symbol or anything in between.
The Java String class is immutable for efficiency reasons. It is therefore extremely difficult to logically extend without error; the implementers have therefore chosen to make it a final class meaning it cannot be extended with inheritance. The functionality you wish your class to support is not properly part of t...
Broadcast is not what you want. Since there could and probably will be devices attached to this network which don't care about your message, you should use Multicast. Unlike broadcast messages, which must be sent to and processed by every client on the network, Multicast messages are delivered only to interested client...
You can create your own version of String class and add a method :-)
Generally you have two options, one exclude modules DLL's from instrumentation in Purify, it helps some times. Second is get BoundsChecker, this does compile time instrumentation much slower but the level of detail is an order of magnitude better. We generally use Purify on check-in, sanity checking, and BoundsCheck...
Oracle doesn't require you to use `nvarchar` to store Unicode strings—the server can be configured to store `varchar2` in UTF-8. If you only supported ASCII before, it should be transparent. That should prevent the need for all the application-side search-and-replace for `'` to `N'`. As for Damien's point: it might ...
(0..8).map{65.+(rand(25)).chr}.join() I spend too much time golfing. (0..50).map{ ('a'..'z').to_a[rand(26)] }.join() For lots of good WTFBBQ factor.
(0...8).map{65.+(rand(25)).chr}.join() I spend too much time golfing. (0...50).map{ ('a'..'z').to_a[rand(26)] }.join() For lots of good WTFBBQ factor.
(0...8).map{65.+(rand(25)).chr}.join I spend too much time golfing. (0...50).map{ ('a'..'z').to_a[rand(26)] }.join For lots of good WTFBBQ factor. And one more that's even more confusing, but more flexible and wastes less cycles: o = [('a'..'z'),('A'..'Z')].map{|i| i.to_a}.flatten; st...
The `git://` protocol uses port 9418, so you should make sure your firewall allows outbound connections to this port.
Carlos Aguilar Mares has had an online converter for about 40 forevers - [Code Translator][1] **but I would agree that Reflector is the better answer.** [1]: http://www.carlosag.net/Tools/CodeTranslator/Default.aspx
haha, that article has a disclaimer, but I understand what you are saying. We use Fogbugz and the only 'Feature' that I am aware of is under category and I don't think you can associated it with sub-tasks. You can type in 'Case N' is the feature for this task if you just wanted to reference it in the case text. ...
Using the where method doesn't alway work var results = from p in db.Products where p.Name == nameTextBox.Text select p;
Thanks for the clarification, Chris. I would reiterate: 1. just use a pre-existing solution like this: <http://www.southbaypc.com/HotCorners/> (untested anything that does the same thing would work). If it allows you to run your pre-selected screensaver, then all you need to do is ... 2. ... make an exe that does w...
Try this: function exist(sFN) { return (typeof sFN == 'function'); }
I try to use fairly generic functions and just pass the differences in them. This way you only have one function to handle most of your database SELECT's. Obviously you can create another function to handle all your INSERTS. eg. function getFromDB($table, $wherefield=null, $whereval=null, $orderby=null){ ...
Windows API spying/hijacking techniques
|c++|windows|winapi|
I'm interested in using API spying/hijacking to implement some core features of a project I'm working on. It's been mentioned [in this question][1] as well, but that wasn't really on topic so I figured it'd be better with a question of its own for this., I'd like to gather as much information as possible on this, di...
I guess if such a feature exist it's browser-specific. [from w3's website:][1] > User agents may support MAILTO URL > extensions that are not yet Internet > standards (e.g., appending subject > information to a URL with the syntax > "?Subject=my%20subject" where any > space characters are replaced by > "%20...
You could also try [Free Pascal][1]. It is an free ((l)gpl) object-pascal compiler which is compatible with the Delphi-compiler. It has an console-based IDE, which proofs that you can make very good console-applications with it, and which you can use as an example. If you wan to use a graphical-ide to build your con...
How can I Trim the leading comma in my string.
|c#|trim|string|
I have a string that is like below. ,liger, unicorn, snipe in other languages I'm familiar with I can just do a string.trim(",") but how can I do that in c#? Thanks.
|c#|trim|string|.net|
I have a string that is like below. ,liger, unicorn, snipe in other languages I'm familiar with I can just do a string.trim(",") but how can I do that in c#? Thanks. ---------- There's been a lot of back and forth about the StartTrim function. As several have pointed out, the StartTrim doesn't affect ...
Depends on what you care about. If you mean WALL TIME (as in, the time on the clock on your wall), time.clock() provides NO accuracy because it may manage CPU time.
Yes, everything is possible but you will need to customize it a little bit. I would recommend you to build a custom web part to display your results. Here is a nice article that you can learn to start with this: http://msdn.microsoft.com/en-us/library/ms584220.aspx
Yes, everything is possible but you will need to customize it a little bit. I would recommend you to build a custom web part to display your results. Here is a nice article to start with: http://msdn.microsoft.com/en-us/library/ms584220.aspx
If optimal speed is not a consideration, the following psuedo code will generate a Voronoi diagram the hard way: for yloop = 0 to height-1 for xloop = 0 to width-1 // Generate maximal value closest_distance = width * height for point = 0 to number_of_points-1 ...
How can I avoid ta warning fom an unused parameter in PLSQ?
|oracle-database|plsql|function|parameters|
Sometimes, in PL SQL you want to add a parameter to a Package, Funtion or Procedure in order to prepare future functionallity. For example: create or replace function doGetMyAccountMoney( Currency IN char := 'EUR') return number is Result number(12,2); begin Result := 10000; IF ...
How can I avoid the warning fom an unused parameter in PLSQ?
Sometimes, in PL SQL you want to add a parameter to a Package, Funtion or Procedure in order to prepare future functionallity. For example: create or replace function doGetMyAccountMoney( Type_Of_Currency IN char := 'EUR') return number is Result number(12,2); begin Result := 10000; ...
Sending 'application/javascript' MIME t Type Header Causes 500 Error with PHP5 & IIS7
|php|iis-7|mime-types|500-error|