instruction stringlengths 0 30k ⌀ |
|---|
I was out running.. anyway.
In Toyota manufacturing lines they always know what path a part have traveled. Just so they can be sure they can fix it of something goes wrong. Is this applicable in software too?
All error messages should tell me exactly what path they traveled. Some do, the error messages with stack... |
Never produce to an unknown pathway, in software too? [Toyota principle] |
I was out running.. anyway.
In Toyota manufacturing lines they always know what path a part have traveled. Just so they can be sure they can fix it of something goes wrong. Is this applicable in software too?
All error messages should tell me exactly what path they traveled. Some do, the error messages with stack... |
|asp.net|asp.net-ajax|scriptmanager| |
What is the maximal value for a int32? |
|memory| |
I can never remember that number. I need a memory rule. |
What is the maximum value for a int32? |
|memorization| |
Using Resharper Unit Test Runner for MSTest via Gallio |
|unit-testing|resharper|mstest| |
I am attempting to get the <a href="http://www.jetbrains.com/resharper/">Resharper</a> test runner to recognize my MSTest unit tests via <a href="http://www.gallio.org/">Gallio</a>.
I have the following installed:
VSTS 2005 8.0.50727.762
Resharper 4.1
Gallio 3.0.0.285
I am also running Windows XP x64.
The u... |
I am attempting to get the <a href="http://www.jetbrains.com/resharper/">Resharper</a> test runner to recognize my MSTest unit tests via <a href="http://www.gallio.org/">Gallio</a>.
I have the following installed:
VSTS 2005 8.0.50727.762
Resharper 4.1
Gallio 3.0.0.285
I am also running Windows XP x64.
The u... |
|unit-testing|resharper|mstest|gallio| |
I am attempting to get the <a href="http://www.jetbrains.com/resharper/">Resharper</a> test runner to recognize my MSTest unit tests via <a href="http://www.gallio.org/">Gallio</a>.
I have the following installed:
VSTS 2005 8.0.50727.762
Resharper 4.1
Gallio 3.0.0.285
I am also running Windows XP x64.
The u... |
I check the Error property of the event args in the service method callback. I haven't had issues with the callback not being called. In the case where the server goes down, the call takes a few seconds then comes back with a ProtocolException in the Error property.
Assuming you have tried this and your callback r... |
You can either use
SELECT * FROM v$version;
or
SET SERVEROUTPUT ON
EXEC dbms_output.put_line( dbms_db_version.version );
if you don't want to parse the output of v$version. |
/sbin/chkconfig — The /sbin/chkconfig utility is a simple command line tool for maintaining the /etc/rc.d/init.d/ directory hierarchy. |
Thought about storing it in the registry or in Isolated Storage? Not sure if multiple applications can share Isolated Storage or not, though. |
Just checking if a letter is in A-Z because that doesn't include letters with accents or letters in other alphabets.
I found out that you can use the regular expression class for 'Unicode letter', or one of its case-sensitive variations:
string.matches("\\p{L}"); // Unicode letter
string.matches("\\p{Lu}... |
Just checking if a letter is in A-Z because that doesn't include letters with accents or letters in other alphabets.
I found out that you can use the regular expression class for 'Unicode letter', or one of its case-sensitive variations:
string.matches("\\p{L}"); // Unicode letter
string.matches("\\p{Lu}... |
Two methods:
select * from v$version;
will give you:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
PL/SQL Release 11.1.0.6.0 - Production
CORE 11.1.0.6.0 Production
TNS for Solaris: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production... |
As pointed out by [Corey Ross][1] the vtable is known at compile time for any leaf derived class, and so the cost of the virtual call really should be the same irrespective of the structure of the hierarchy.
This, however, cannot be said for `dynamic_cast`. If you consider how you might implement `dynamic_cast`, a... |
This is probably caused by the persistent connections to mysql going away (time out is likley if its happening over night) and rails failing to restore the connection, which it should be doing by default:
In the file vendor/rails/actionpack/lib/action_controller/dispatcher.rb is the code:
if defined?(ActiveRe... |
|principles|process|design-patterns| |
|design-patterns|error-handling|process|principles| |
I was out running.. anyway.
In Toyota manufacturing lines they always know what path a part have traveled. Just so they can be sure they can fix it of something goes wrong. Is this applicable in software too?
All error messages should tell me exactly what path they traveled. Some do, the error messages with stack... |
In addition to the other good answers, I would add that writing code that was transliterated from another language is just bad form. Makes the code clunky and non-straightforward, everybody will translate it differently (even speakers of the same language), and when it comes to multi-national teams it becomes impossibl... |
Jacco, your solution ising a custom IComparer isn't safe. The Sort routines require the comparer to conform to several requirements in order to function properly. First among them is consistency. If the comparer is called on the same pair of objects, it must always return the same result. (the comparison must also ... |
What is the closest thing to Slime for Scheme? |
Using Side-by-Side assemblies to load the x64 or x32 version of a DLL |
|c#|.net|64-bit| |
We have two versions of a managed C++ assembly, one for x86 and one for x64. This assembly is called by a .net application complied for AnyCPU. We are deploying our code via a file copy install, and would like to continue to do so.
Is it possible to use a Side-by-Side assembly manifest to loading a x86 or x64 asse... |
Bayesian filters have exactly this purpose. That's the techno you'll find in most tools that identify spam.
Example, to detect a language (from http://sebsauvage.net/python/snyppets/#bayesian) :
from reverend.thomas import Bayes
guesser = Bayes()
guesser.train('french','La souris est rentrée dans so... |
One thing that has bitten many when using EJBs, or J2EE in general, is the dependency on the application server you're running your EJBs on. The appserver tends to be supported for a particular set of operating system releases and JVM versions. Not having the source code to a significant part of your runtime environm... |
One possible error it can introduce is if you are compiling on a 64-bit system using C (not C++).
Basically, if you forget to include stdlib.h, the default int rule will apply. Thus the compiler will happily assume that malloc has the prototype of "int malloc();" On Many 64-bit systems an int is 32-bits and a pointe... |
In the most cases setter and getter do more as only setting and getting an internal field. An Object has to check internal rules that it hold only valid values. For example
- are null values possible?
- are empty strings possible?
- or negative values?
- or a zero value?
- or values from a list are va... |
First: Most of the time you most likely do not care, the difference will be very small. Make sure optimizing this call really makes sense first. Only if your measurements show there is really significant time spent in the call overhead, proceed to optimizing it (shameless plug - Cf. [How to optimize an application to ... |
<h2>Optimize only when needed</h2>
First: Most of the time you most likely do not care, the difference will be very small. Make sure optimizing this call really makes sense first. Only if your measurements show there is really significant time spent in the call overhead, proceed to optimizing it (shameless plug - Cf.... |
I think that you have to configure the Task Controllers of your tasks. In some cases it is enough to set the `access` attribute in a way that does not result in conflicts (e.g. `read` access to the first path and `read,write` access to the second path). If this is not the case then you can implement your own `TaskContr... |
Nope, there is no such function in .NET. You have roll out your own. Note that C# doesn't support tuples, so python-like syntax sugar is missing too. |
Nope, there is no such function in .NET. You have roll out your own. Note that C# doesn't support tuples, so python-like syntax sugar is missing too.
You can use something like this:
class Pair<T1, T2>
{
public T1 First { get; set;}
public T2 Second { get; set;}
}
static IEn... |
Once he has the basics, I suggest the [Tower of Hanoi][1] as a good exercise.
I recommend beginning with the wooden toy if you have one; let him try to solve the problem by himself and describe his method in a systematic way. Show him where recursion comes into play. Explain him how the number of moves depends on the ... |
`SHOW server_version;`
(for completeness) |
I think there is a good reason why there is no SuspendProcess() function in Windows. Having such a function opens the door for an unstable system. You shall not suspend a process unless you created that process yourself.
If you wrote that process yourself, you could use an event (see ::SetEvent() etc. in MSDN) or anot... |
Have you considered a portable implementation of printf? I looked for one a little while ago and settled on trio.
http://daniel.haxx.se/projects/trio/ |
Try to use always the smallest datatype that you can and index all the fields most used in queries.
Try to avoid server side cursors as much as possible. Always stick to a 'set-based approach' instead of a 'procedural approach' for accessing and manipulating data. Cursors can often be avoided by using SELECT stateme... |
|scheme|common-lisp|slime|emacs| |
I do most of my development in Common Lisp, but there are some moments when I want to switch to Scheme (while reading Lisp in Small Pieces, when I want to play with continuations, or when I want to do some scripting in Gauche, for example). In such situations, my main source of discomfort is that I don't have Slime (ye... |
I do most of my development in Common Lisp, but there are some moments when I want to switch to Scheme (while reading Lisp in Small Pieces, when I want to play with continuations, or when I want to do some scripting in Gauche, for example). In such situations, my main source of discomfort is that I don't have Slime (ye... |
|emacs|lisp|scheme|common-lisp|slime| |
Binary flags like this in your schema are a BAD idea. Consider the query
<pre>SELECT count(*) FROM users WHERE active=1</pre>
Looks simple enough. But what happens when you have a large number of users, so many that adding an index to this table would be required. Again, it looks straight forward
<pre>ALTER T... |
For me this is another discussion about a personal taste and it's rather difficult to be really objective. I personally prefer [Mercurial](http://www.selenic.com/mercurial/) over the other DVCS. I like to write hooks in the same language as [Mercurial](http://www.selenic.com/mercurial/) is written in and the smaller ne... |
Use an `interface` to achieve the same intention.
IFoo.cs
public interface IFoo
{
int DoFoo();
}
Foo.cs
pubic class Foo : IFoo
{
public int DoFoo()
{
return 1;
}
}
|
`%[number]` is the arguments used to invoke the file. `%1` is the path to the bat-file itself, `%2` is the first argument, `%3` is the second and so on.
Since the arguments are often file paths, there is some additional syntax to extract parts of the path. `~d` is drive, `~p` is the path (without drive), `~s` is the... |
The magic variables `%`*n* contains the arguments used to invoke the file: `%0` is the path to the bat-file itself, `%1` is the first argument after, `%2` is the second and so on.
Since the arguments are often file paths, there is some additional syntax to extract parts of the path. `~d` is drive, `~p` is the path (... |
The magic variables `%`*n* contains the arguments used to invoke the file: `%0` is the path to the bat-file itself, `%1` is the first argument after, `%2` is the second and so on.
Since the arguments are often file paths, there is some additional syntax to extract parts of the path. `~d` is drive, `~p` is the path (... |
The magic variables `%`*n* contains the arguments used to invoke the file: `%0` is the path to the bat-file itself, `%1` is the first argument after, `%2` is the second and so on.
Since the arguments are often file paths, there is some additional syntax to extract parts of the path. `~d` is drive, `~p` is the path (... |
There are a couple of approaches:
1. Use a Bag alorithm like the sets contained in Google Collections.
2. Create mutable container which you can use in the Map:
<pre><code>
class My{
String word;
int count;
}
</code></pre>
And use put("word", new My("Word") ); Then you can check if it exists an... |
The US NOAA has [coded METAR information](http://weather.noaa.gov/pub/data/observations/metar/stations/) available for cities worldwide. Given the ICAO airport code for the city in question (eg. [EGLL](http://weather.noaa.gov/pub/data/observations/metar/stations/EGLL.TXT)) you can quickly get a METAR report. |
The US NOAA has [coded METAR information](http://weather.noaa.gov/pub/data/observations/metar/stations/) available for cities worldwide. Given the ICAO airport code for the city in question (eg. [EGLL](http://weather.noaa.gov/pub/data/observations/metar/stations/EGLL.TXT) for London) you can quickly get a METAR report. |
In modern OS, application code and OS code run in separate address spaces. The application code cannot crash the operating system. See here:
[http://en.wikipedia.org/wiki/Ring_(computer_security)][1]
[1]: http://en.wikipedia.org/wiki/Ring_(computer_security)
The most common readon for a crash is code that ... |
Yes!
- Use [SandCastle][1] to build CHM/HTM documentation of the APIs.
- Use [DocBook][2] + [FOP][3] and other tools to produce other kinds of documentation in PDF, RTF, HTML etc...
They can be easily integrated with CruiseControl.NET through [NAnt][4].
[1]: http://www.codeplex.com/SHFB
[2]: http://w... |
There is [ProGuard](http://proguard.sourceforge.net/) which does not only pack your jars into one, but can also optimize, cleanup or obfuscate your classfiles, making the resulting jar much smaller than the sum of all jars before. |
There is [ProGuard](http://proguard.sourceforge.net/) which does not only pack your jars into one, but can also optimize, cleanup or obfuscate your classfiles, making the resulting jar much smaller than the sum of all jars before.
**UPDATE**:
I actually tried ProGuard with the JRST tool, and it is as you reported... |
Lambda expressions can be easily created via the System.Linq.Expressions namespace. |
The Apache Forrest project might go some way to giving you what you want.
You'll be generally better off writing your documentation in XML. From that you ought to be able to generate just about anything you need. |
For a fixed string-set use gperf.
If your string-set changes you have to pick one hash function. That topic has been discussed before:
http://stackoverflow.com/questions/98153/
|
you could do this by using an Environment variable. this way you can have more choices than just turning Error reporting on/off for a special directory. in your code where ever you wanted to change any behaviour for a specific set of directoris, or running modes, check if a environment variable is set or not. like this... |
DELETE * FROM table_name;
Premature optimization may be dangerous. Optimizing may mean doing something weird, but if it works you may want to take advantage of it.
SELECT DbVendor_SuperFastDeleteAllFunction(tablename, BOZO_BIT) FROM dummy;
For speed I think it depends on...
- The underlying databas... |
This might not be exactly what you need, but if you just want to have some XSL-FO test templates, you can use [this][1] transformation in Word to generate XSL-FO.
[1]: http://www.microsoft.com/downloads/details.aspx?FamilyId=E0FAA0AF-A185-4296-B74D-A9FE870C92CC&displaylang=en |
This might not be exactly what you need, but if you just want to have some XSL-FO test templates, you can use [this][1] transformation in Word to generate XSL-FO.
The book that I used to learn is from O'Reilly ([XSL-FO][2]), because frankly there are very little resources on the subject.
[1]: http://www.microso... |
It seems fitting I post an answer, since I left the comment :P
Basically, if you forget to include `stdlib.h` the compiler will assume `malloc` returns an `int`. Without casting, you will get a warning. With casting you won't.
So by casting you get nothing, and run the risk of suppressing legitimate warnings.
... |
For best array performance, make sure you're using a single dimension array with lower index of 0.
To access the elements of the array as fast as possible, you can use unsafe pointers like so:
int[] array = Enumerable.Range(0, 1000).ToArray();
int count = 0;
unsafe {
fixed (int* pArray = ... |
AFAIK rails page caching compares the cache time on request and regenerates if necessary. If you need to forcibly flush that cache check out Sweepers.
[http://www.railsenvy.com/2007/2/28/rails-caching-tutorial#sweepers][1]
[1]: http://www.railsenvy.com/2007/2/28/rails-caching-tutorial#sweepers |
The only sensitive answer is [PTU][1] from Intel. Of course its best to use it on an Intel processor and to get even more valuable results at least on a C2D machine as the architecture itself is easier to give back meaningful profiles.
[1]: http://softwarecommunity.intel.com/articles/eng/1437.htm |
[WordPress][1] keeps getting better and better.
[1]: http://wordpress.org |
[JavaRebel][1] speeds up development by automatically hot deploying code changes to the running program.
[1]: http://www.zeroturnaround.com/javarebel/features/ |
[FindBugs][1], [Proguard][2], [JProfiler][3], [Cobertura][4].
[1]: http://findbugs.sourceforge.net/
[2]: http://proguard.sourceforge.net/
[3]: http://www.ej-technologies.com/products/jprofiler/overview.html
[4]: http://cobertura.sourceforge.net |
Visual Studio 2008. VB.NET. |
One place to start would be that it may be doing math with your ListE`1::Count property. If that has some subtle flaw (i.e. it is more complicated than return this.innerList.Count) it could be causing the designer to arithmetic overflow on some operation. Normally arithmetic overflows do not occur unless specifically a... |
I still think that the limit isn't limited on the visual part. Sure, the monitors and resolutions are big enough to show even more characters in one line nowadays, but does it increase the readability?
If the limit is really enforced it's also a good reason to re-think the code and **not** to put everything into on... |
I have a feeling that Mercurial (and other DVCS) are more sophisticated than the centralised ones. For instance, merging a branch in Mercurial keeps the complete history of the branch whereas in SVN you have to go to the branch directory to see the history. |
Tools for converting from ASP to ASP.NET? |
In Vim, is there a way to paste text in the search line? |
|vim| |
Say in vim I want to search for <b>$maximumTotalAllowedAfterFinish</b> and replace it with <b>$minimumTotalAllowedAfterFinish</b>. Instead of typing the long text text:
<pre><code>:%s/$maximumTotalAllowedAfterFinish/$minimumTotalAllowedAfterFinish/g</pre></code>
Is there a way to COPY these long variable names down i... |
Set up the files and folders to be shared between deployed copies of the app, including (but not limited to) view caches, database config, maintenance page... |
The handling of app_offline.htm is hardcoded in the ASP.NET pipeline, and can't be modified. However, [creating your own HTTP module](http://support.microsoft.com/kb/307996) to do something similar is of course trivial -- the OnBeginRequest handler could look as follows in this case (implementation for a HttpHandler sh... |
The handling of app_offline.htm is hardcoded in the ASP.NET pipeline, and can't be modified: see <code>CheckApplicationEnabled()</code> in <code>HttpRuntime.cs</code>, where it throws a very non-configurable 404 error if the application is deemed to be offline.
However, [creating your own HTTP module](http://support... |
Hudson FindBugs plugin: how make the job fail if any problems? |
|continuous-integration|hudson| |
I'm playing with the wonderful [FindBugs plugin][1] for [Hudson][2]. Ideally, I'd like to have the build fail if FindBugs finds any problems. Is this possible?
[1]: http://hudson.gotdns.com/wiki/display/HUDSON/FindBugs+Plugin
[2]: https://hudson.dev.java.net/ |
There are a couple of approaches:
1. Use a Bag alorithm like the sets contained in Google Collections.
2. Create mutable container which you can use in the Map:
<pre>
<code>
class My{
String word;
int count;
}
</code>
</pre>
And use put("word", new My("Word") ); Then you can c... |
Everyone is correct that your problem is that anchors are inline elements, but I thought it is also worth mentioning that you have an H1 inside of your list as well. The H1 isn't allowed there and should be pulled out of the UL or placed into an LI tag. |
This is easy to implement with [error-correcting codes][1]. You could use a command-line tool such as *par2* (which is not exactly appropriate for this specific purpose btw, as it generates recovery blocks of varying size). Let's say you have (n+m) voters, and want a quorum of n votes. You split your private key into n... |
This is easy to implement with [error-correcting codes][1]. You could use a command-line tool such as *par2* (which is not exactly appropriate for this specific purpose btw, as it generates recovery blocks of varying size). Let's say you have (n+m) voters, and want a quorum of n votes. You generate n private keys K₁∘, ... |
You need to sort the colors array by its relative item in the numbers array. Specify a comparator that compares numbers and use that as the comparison for the colors array. |
Why not introduce an object to represent a number and a color and implement a comparator function for that?
Also, do you really need an array, why not use something derived from Collection? |
Hungarian is bad because it takes precious characters away from variable names in exchange for what, some type information?
First of all, in a strongly typed language, the compiler will warn you if you do any truly stupid.
Second, if you believe in good modularized code and don't do too much work in any 1 functio... |