Categories

Hey Look, a Flying Segway

a.k.a. the De Lackner DH-4 Aerocycle

The pilot stood to the rear of the pedestal… and guided his craft by simply leaning in the desired direction of travel.

Sound familiar?  Looks pretty familiar too (well, from the ankles up):

De Lackner HZ-1 Aerocycle

 

 

 

 

 

 

Soft Re-Launch

For those tuning in at home, yes, I’ve finally relaunched under WordPress, such as it is.

This all started back in 2007 because of the pending Blogger FTP cutoff.  They pulled that plug in 2010.  In between, and since, I’ve been playing with numerous versions of WordPress, themes and plug-ins.   I’ve finally gotten the site back to the original level of functionality, including all the old archives imported from Blogger, and even the hand-coded deep archives going back to December 2001.  I think that means that pretty much everything that was ever on this site is still here.  Although, going by my first post, there must have been a precursor, I just don’t remember what it was.    Fortunately or unfortunately the Internet Archive does remember.  Mmm  mm,  1996-licious.

In any case, we’re coming up on the 10-year anniversary of this blog as such.  Does it count when you’ve taken years off at a time?  Will there be a party?  Will I at least finally come up with a theme I like?  Stay tuned to find out.

Why Would I Believe This?

“Trusteer Rapport?”  This is just a ridiculous thing for my bank to attempt…

What If We All Suddenly Became Rational?

(Shudder)

http://thisisnthappiness.com/post/3505600711/advertising-doesnt-work

I Buy It

http://thisisnthappiness.com/post/3926904033/habitual-drunkenness-is-usually-psychologists

Habitual drunkenness is usually, psychologists inform us, the result of the inability to accommodate oneself wholly to reality. It is often a vice in that unfortunate class of people who have imperfectly coordinated artistic facilities. They yearn vaguely for something other than the world they know but they lack the capacity to create a world nearer to their hearts’ desire. Still more, do they lack the capacity to attain a comprehensive vision of the beauty emanate in this world. Neither the art of escape nor the art of revelation is possible to them. Nevertheless they have perceptions they cannot use and impulses that never come to fruition. Drink, or some other drug, by relieving their sense of impotence and by blurring the unfriendly outlines of the real world brings them solace and becomes a necessity.

 

via Google Books.

Volcanos: Nature’s Nukes

An oldy but a goody.

Courtesy of NASA, who else?

Blogger Pulling the Plug on FTP

So, blogger is discontinuing support for FTP-updated blogs, which essentially means they will no longer support self-hosted blogs. You can either point your domain (or a sub-domain) over to them, or you’re SoL.

And by “SoL” I mean “switching to WordPress.”

I guess I should say “thank you” for finally making me do it… maybe.

What’s Magical About 1272 Bytes?

So here’s a bit of Windows Vista Ultimate 64-bit arcana for you… I was doing some research on the performance and efficiency of relative cluster sizes, and because of this I wanted to know how many files of certain sizes were on my disk. So I started running some searches, with various cluster sizes that I was considering, hoping to get some data points against which to run some statistical analysis. Here’s what I ended up with, running Vista’s file search in “non-indexed” mode, and choosing to include hidden and system files:

File Size File Count
<64KB 72,781
<16KB 53,480
<8KB 42,696
<4KB 31,542
<2KB 15,822
<1KB 19,528
<0.5KB 10,058

Did you notice something odd? That’s right, the number of files <1KB in size is greater than the number of files <2KB in size! This is mathematically impossible, of course.

Using a manual binary search algorithm, I finally arrived at the magic point: something weird happens between the 1272 and 1273 byte count, as the following two screen shots illustrate (click for larger versions, look at the upper right and lower left of each).

search for files <1273 bytes in size

search for files <1272 bytes in size

Logically, the second search should yield slightly fewer results, assuming there are a couple of files on the drive that are exactly 1273 bytes (in reality, there are exactly 15 1273-byte files–this should be the delta between the two searches). In fact, the second search yields more than twice as many!

I was hoping I could narrow down what was going on by searching for specific file types instead of the *.* pattern, but as soon as I did that, everything seemed to work. Interestinly, if I then went back to the *.* pattern, the 1272B search produces a correct (lower) number! However, if I then run a 1KB search I get the higher number again, and if I repeat the 1272B search I again get a higher number.

Pretty strange, huh?

In case you’re wondering:

Intel E8400

8GB DDR800

Windows Vista Ultimate, 64-bit, SP1 and all “important” updates applied

Seagate 1TB SATA at default cluster size

Be the Google

Would you like 500mb of web hosting, plus Python, plus Django, plus a lot of Google database and application goodies? Would you like it for free? Then, my friend, what you need is Google App Engine. No mention yet of what the pricing is like after you hit your 5 million hits per month. But trust me, if you’re at 5 million hits per month, you don’t care.

Sorry Amazon S3, but you can basically suck it.

Update: um, yeah, it’s wait-listed. Though if you have Google Apps, you’re probably in.

Return a Record for Each Date Between Two Dates in SQL Server >= 2005

Blogging this so I don’t forget it…

It used to require some fairly ugly, resource intensive hacks (cursors, temp tables, etc.) to emit an inclusive list between two data points when the source data might not include an entry for every point (for example, a calendar, where not every day contains an event). In SQL Server 2005 and above, this is trivially easy, with a Common Table Expression (CTE) and a Recursive Query. To emit one record for every date between 1/1/2008 and 1/31/2008, you do this:


WITH datecte(anydate) AS (SELECT CAST('1/1/2008' AS datetime) AS anydate
UNION ALL
SELECT anydate + 1 AS anydate
FROM datecte AS datecte_1
WHERE (anydate < CAST('2/1/2008' AS datetime) - 1))
SELECT anydate
FROM datecte AS datecte_2

If you need more than 100 days (the recursion limit is 100), add this to the end:

OPTION (MAXRECURSION 1000)

The fact that they stop recursion short at 100 by default would seem to indicate that this is an expensive procedure, but even if you’re just using this to produce a dummy table with all the dates for several years, it’s a nice shortcut.

I just tried the following query, which emits a record for every day between 1/1/2000 and 12/31/2020:


WITH datecte(anydate) AS (SELECT CAST('1/1/2000' AS datetime) AS anydate
UNION ALL
SELECT anydate + 1 AS anydate
FROM datecte AS datecte_1
WHERE (anydate < CAST('1/1/2021' AS datetime) - 1))
SELECT anydate
FROM datecte AS datecte_2
OPTION (MAXRECURSION 10000)

On my P4-641+ the script emits 7671 records in 0 (that's zero) seconds and "spikes" the processor to all of 3%. Granted this is not a complex query, but at least we know the recursion (if it really is recursion internally, which I doubt) isn't expensive by itself.