![]() |
| Home RSS Directory F.A.Q Suggest A Feed Try Custom Feed Sonneries Portable |
Latest Flows from this sub-category: random selection from this sub-category: |
The blog of John D. Cook Wed, 14 May 2008 04:25:01 +0200 I just picked up a copy of Windows PowerShell Cookbookby Lee Holmes. One of the first examples in the book is customizing the PowerShell command prompt. His example sets the command window title as part of the prompt function. For example, adding
$host.UI.RawUI.WindowTitle = "$env:computername $pwd.path"
to the function given in my previous post would display the [...]
Mon, 12 May 2008 14:19:30 +0200 By default, the PowerShell command prompt does not echo the current working directory. To customize the command prompt, simply create a function named prompt. If you want this customization to persist, add it to your profile.
For example, adding the following line to your profile will cause the working directory to be displayed much like it [...]
Sun, 11 May 2008 14:27:57 +0200 Jenga is a game where you start with a tower of wooden pegs and take turns removing pegs until someone makes the tower collapse. A style of mathematics analogous to Jenga reached the height of its popularity about 40 years ago and then fell out of fashion. I use the phrase “Jenga mathematics” to refer to generalizing a [...]
Sat, 10 May 2008 20:11:56 +0200 The duck-billed platypus is the most recent species to have its genome sequenced. These odd animals are even more strange at the DNA level. Some features of their DNA are avian, some are reptilian, and of course some are mammalian. See the Science Daily article for more details.
Fri, 09 May 2008 14:00:40 +0200 It’s infuriating to read published sample code that’s wrong. Sometimes code given in books is not even syntactically correct. I’ve wondered why publishers didn’t have a way to verify that the code at least compiles, and maybe even check that it gives the stated output.
Dave Thomas said in recent interview that his publishing company, The [...]
attached file: type: audio/mpeg size: 11.06 MB here Fri, 09 May 2008 13:45:47 +0200 The Stack Overflow podcast, episode 4, mentioned in passing that the Wikipedia database is about 10 GB. I was surprised it isn’t bigger. If that size is correct, you could download a snapshot of Wikipedia to your local hard drive.
Wed, 07 May 2008 23:46:35 +0200 Regular expressions are not a part of the C++ Standard Library quite yet, but there is a document (Technical Report 1, or TR1) that includes among other things a specification for regular expression support that will probably be added to the C++ standard eventually.
The Boost library has supported TR1 for a while. Microsoft just released [...]
Wed, 07 May 2008 12:26:10 +0200 An unbiased estimator, very roughly speaking, is a statistic that gives the correct result on average. For a precise definition, see Wikipedia. Unbiasedness is an intuitively desirable property. In fact, it seems indispensable at first.
In the colloquial sense, “bias” is practically synonymous with self-serving dishonesty. Who wants a self-serving, dishonest statistical estimate? But it’s important [...]
Wed, 07 May 2008 03:26:20 +0200 Roy Osherove just posted an article about his Introducing LINQ to Regex project.
LINQ stands for Language INtegrated Query, a way of baking query support into .NET programming languages. Microsoft has been promising a unified way to query all kinds of data for years now. Along the way they came out with a score of new libraries that [...]
Sat, 03 May 2008 16:15:41 +0200 I’ve made a few changes to my blog and my personal web site and would welcome your feedback.
I added a widget on my blog sidebar to make it easy to subscribe. It seems to work well. Let me know if you have problems.
I added tags to my blog posts. The tag links should help people [...]
Sat, 03 May 2008 14:04:49 +0200 In a recent interview, Donald Knuth made this comment about reusable code.I also must confess to a strong bias against the fashion for reusable code.
I also must confess to a strong bias against the fashion for reusable code. To me, “re-editable code” is much, much better than an untouchable black box or toolkit. I could [...]
Fri, 02 May 2008 15:49:33 +0200 Here is my list of the top five gotchas when learning Windows PowerShell.
5. PowerShell will not run scripts by default.
4. PowerShell requires .\ to run a script in the current directory.
3. PowerShell uses -eq, -gt, etc. for comparison operators.
2. PowerShell uses backquote as the escape character.
1. PowerShell separates function arguments with spaces, not commas.
See PowerShell [...]
Thu, 01 May 2008 13:34:42 +0200 Windows has never made it easy to read long environment variables. If I display the path on one machine I get something like this, both from cmd and from PowerShell.
C:\bin;C:\bin\Python25;C:\bin\TeX\miktex\bin;C:\bin\TeX\MiKTeX\miktex\bin;C:\bin\Perl\bin\;C:\ProgramFiles\Compaq\Compaq Management Agents\Dmi\Win32\Bin; ...
The System Properties window is worse since you can only see a tiny slice of your path at a time.
Here’s a PowerShell one-liner [...]
Wed, 30 Apr 2008 15:48:50 +0200 Two of my favorite cmdlets from the PowerShell Community Extensions are get-clipboard and out-clipboard. These cmdlets let you read from and write to the Windows clipboard from PowerShell. For example, the following code will grab the contents of the clipboard, replace every block of white-space with a comma, and paste the result back to the [...]
Wed, 30 Apr 2008 05:41:16 +0200 About a month ago I wrote a series of four blog posts on innovation. The most important theme from these posts is the statement by Seth Godin just posted an article on his blog entitled The fibula and the safety pin that fits in with a series of innovation post I did about a month ago [...]
Tue, 29 Apr 2008 13:36:42 +0200 Sweave is a tool for making statistical analyses more reproducible by using literate programming in statistics. Sweave embeds R code inside LaTeX and replaces the code with the result of running the code, much like web development languages such as PHP embed code inside HTML.
Sweave is often launched from an interactive R session, but this can [...]
Mon, 28 Apr 2008 20:44:07 +0200 I just published a new article on CodeProject: Calculating percentiles in memory-bound applications.
Finding the percentiles of a list of samples is trivial if you can read all the samples into memory and sort the list. If the list is too big to fit into memory, it’s still not terribly difficult, but there are a couple subtleties [...]
Mon, 28 Apr 2008 20:27:01 +0200 If you don’t know what a “feed” is, as in RSS feed etc., here’s a 60-second audio explanation.
Audio clip from Sixty Second Tech
Transcript
attached file: type: audio/mpeg size: 983.04 KB here Sun, 27 Apr 2008 21:26:45 +0200 Do you have a single program that you “live in” when you’re at a computer? Emacs users are known for “living” inside Emacs. This means more than just using the program for a large part of the day. It means using the program as the integration point for other programs, a sort of backplane for [...]
Fri, 25 Apr 2008 06:04:40 +0200 Suppose you’re doing something that has probability of success p and probability of failure q = 1-p. If you repeat what you’re doing m+n times, the probability of m successes and n failures is given by
Now suppose m and n are moderately large. The terms (m+n)! and m! n! will be huge, but the terms pm and qn [...]
Thu, 24 Apr 2008 04:37:19 +0200 Today I needed to use Fibonacci numbers to solve a problem at work. Fibonacci numbers are great fun, but I don’t recall needing them in an applied problem before.
I needed to compute a series of integrals of the form
f(x, y) = xa (1-x)b yc (1-y)d p(x, y)
over the unit square for a statistical application. The function [...]
Wed, 23 Apr 2008 05:29:38 +0200 Yesterday’s Science at NASA podcast had an entertaining story about duct tape and Apollo 17. (Transcript, audio)
The lunar rover lost a fender and they taped it back on with duct tape. That worked for a while, then they had to make a new fender with laminated maps and duct tape.
Why is a fender such a big [...]
attached file: type: audio/mpeg size: 2.95 MB here Wed, 23 Apr 2008 02:05:20 +0200 In a recent interview on the PowerScripting Podcast, Jeffrey Snover said that software versioning isn’t a problem, it’s a dilemma. The difference is that problems can be solved, but dilemmas can only be managed. No versioning system can do everything that everyone would like.
The same phenomena exists in biostatistics. As I’d mentioned in Galen and [...]
Tue, 22 Apr 2008 00:04:48 +0200 There are two kinds of errors discussed in classical statistics, unimaginatively named Type I and Type II. Aside from having completely non-mnemonic names, they represent odd concepts.
Technically, a Type I error consists of rejecting the “null hypothesis” (roughly speaking, the assumption of no effect, the hypothesis you typically set out to disprove) in favor of [...]
Sun, 20 Apr 2008 23:27:52 +0200 My first assignment as a professional programmer was to build another person’s program. I learned right away not to assume a project will build just because the author says it will. I’ve seen the same pattern repeated everywhere I’ve worked. Despite version control systems and procedures, there’s usually some detail in the developer’s head that doesn’t get codified and only the [...]
Fri, 18 Apr 2008 22:53:08 +0200 I just found out there’s a project called Pash to create an open source, cross platform version of Microsoft’s PowerShell. That should be very interesting.
Fri, 18 Apr 2008 13:30:18 +0200 The most recent edition of the .NET Rocks podcast interviewed Jeremy Miller and David Laribee. They made the observation that Microsoft’s development tools are implicitly designed to support database-first development rather than object model-first development. Because they are committed to agile and object model-first development, they’re feeling resistance from some of Microsoft’s products.
Miller and Laribee are part [...]
Thu, 17 Apr 2008 14:28:40 +0200 The most recent RunAs Radio podcast interviews Sean Siler on IPv6, the eventual replacement for IPv4, the current Internet protocol address scheme. At the current rate, we will run out of IPv4 addresses in May 2010. Previous estimated dates for running out of IP addresses have come and gone, and we keep coming up with ways to [...]
Wed, 16 Apr 2008 17:23:27 +0200 Suppose you need to evaluate the function f(x) = log(1 + ex). The most obvious code to write something like this in C:
double f(double x) { return log(1 + exp(x)); }
This is so simple you don’t even test it. Then someone calls you to say they’re getting strange output such as 1.#INF depending [...]
Tue, 15 Apr 2008 13:59:55 +0200 Here’s a quote from the Greek physician Galen (c. 130-210 A.D.)
All who drink of this remedy recover in a short time, except those whom it does not help, who all die. Therefore, it is obvious that it fails only in incurable cases.
Imagine a dialog between Galen and a modern statistician.
Stat: You say your new treatment [...]
|
|
contact |