Blog Information Profile for donner

The issue with BETWEEN is that it does not behave consistenly. Sometimes it is inclusive of the 2nd DateTime value, sometimes it is not.
Consider the following: (more…)

My fellow Americans,

Our country, and with us the entire Western world, is in dire straits today. Our parents and grand-parents have built unprecedented wealth for America’s middle class since the end of World War II. Over the past decade, special interest groups have siphoned this wealth off into their pockets at a rate that was unforseeable and unimaginable.
By using and abusing the power of a friendly and impassive government, businesses in health care, investment banking, real estate, energy, natural resources, military contracting, telecommunications, and countless other groups, have been lining the pockets of their executives and lobbyists like there was no tomorrow.

Well, tomorrow has come after all. Today, we must recognize that our value system has been corrupted in this process. We have forgotten that only honest, hard work will lead to prolonged riches and wealth. The exploitation of our middle class for short-term profits on balance sheets has already lead to disaster and must end.

How did this happen? How did we get here? Ladies and gentlemen, we have followed Republican doctrin for too long. I will explain to you what this means.
Republican doctrin claims that free markets are self-regulating, that the bad guys will eventually get weeded out by cleansing market forces, helping these complex systems to remain stable over long periods of time. This doctrin has been applied to virtually every area of our lives. Health care, company stocks, energy, natural resources, and even our environment have been turned into free markets by Republican doctrin. And yet, many of these markets are failing us today.
Markets are made up of humans, and humans give in under pressure. This “giving-in” began in small areas at first. The pressure of seeing a neighbor selling his home for a higher price leads to cheating on the specs of one’s own home, for instance. The pressure of seeing a competitor’s stock price going up faster leads to overstating revenues on one’s balance sheet. We have become comfortable with lying, cheating, bullying, all in the interest of personal gains. We have learned to value personal gains above everything else. We reward those who take shortcuts, in the business world, in sports, in our personal lives. We even believe that this is inherently good.

Encouraged by society’s acceptance of small sins in our daily lives, people in powerful positions have begun to believe that it is ok to cheat at a larger scale. Our leaders started to think that it is ok to twist the facts a little bit in the interest of personal gains - with big consequences. We will forever remember a president who cheated a bit on intelligence reports so that he could justify a war and help his friends. These friends and their lobbyists made hundreds of billions of dollars in the process through weapons deals and army contracts that this president awarded them.

Left to themselves without proper oversight and regulation, greed and selfishness have become forces that shaped many of our markets, and greed and selfishness will soon shape this country and its people as a whole. We need to open our eyes, see what is going on, and stop it.

My fellow Americans, John McCain is a decent man and an accomplished politician. He may own more houses than most of you, but that does not make him a bad choice for President of the United States. My fellow Americans, what makes John McCain a bad choice for President of the United States is that he is in denial about our current situation. He his in denial about the fact that we are moving fast on a downward slope. John McCain refuses to recognize how bad things have gotten, and he will not begin recognizing that when he is in office. John McCain represents the Republican establishment, ladies and gentlemen, and the Republican establishment has brought this country to the edge of the cliff that we are barely hanging on to today.

John McCain is telling us that he will save the country by continuing to rob the American middle class. Ladies and gentlemen, the pitcher has gone to the well once too often. Republican policies have not worked, neither economically nor socially. Our children and grand-children will be in debt for their entire lives, paying the price for Republican politics that has brought unprecedented riches to a very small group of people, many of which are not Americans, but are in the Middle East or the Far East. This is what John McCain represents, and he has said or done nothing that would raise the slightest doubt about what he represents.

This election is not about how we can prolong our comfortable lifestyles for another 4 or 8 years! This election is about saving this country from economical and fiscal disaster. We must stop gambling with our children’s future. We must start rebuilding this country from the ground up. We must start by rewarding good, honest work, and by punishing people who put short-term personal gains above the long-term prosperity of this once proud nation. We can no longer be proud of our country, my fellow-Americans, and it breaks my heart.

There will be a cost, my fellow-Americans, that we will have to share. There will be pain, and there will be blood-letting. There will be many tough years ahead, and success will not come overnight. As a country, we have made mistakes, and we must pay the price. We cannot cheat ourselves out of the hole that we are in. My promise to you is that I will dedicate my term as President of the United States to uprooting the culture and the establishment of short-cut takers.

We need all the innovation that we can get. We will have to boost our eduction system, and we will have to re-energize science and technology. We will need to learn how to do things differently than we were used to in the past.

But you must never forget our cause - rebuilding America and making it the world’s leading nation once again. We must lead the world through new and high ethical standards in our legislature, in our judicial system, and in daily politics. We must drain the swamps of special interest that local, regional, and national politics have become. We must fight relentlessly, beheading every monster that sticks its head out of the swamp. We must educate ourselves. We must recognize nonsense when we hear it. We must be transparent, we must be credible. We must prevail, and with your help, we will!

Ladies and gentlemen, thank you and have a good night!

Crude oil futures swung wildly again today, first rising to a record and then tumbling as investors wrestled with the latest developments.

With little in the way of news to explain oil’s turnabout, analysts pointed to Saudi Arabia’s weekend decision to boost production and to Tuesday’s expiration of crude options, which are agreements to buy or sell futures at higher or lower prices. A sense that the Saudis may be getting serious about boosting output could be growing among some investors. Also, a weaker dollar makes oil less expensive to investors dealing in other currencies. Investors were also mulling the effects of an overnight fire at a StatoilHydro ASA drilling rig in the North Sea, which could affect as much as 150,000 barrels of daily oil production.

Another likely contributor to the current market uncertainty is Dan Hobson, a Llama Farmer on New Zealand’s South Island, according to Addison Legweak, director of market research at Energy Tradition in Paris, Texas. Dan is an avid bean enthusiast and has been suffering from flatulence for the last few days. Winds caused by a strong jet stream brought some of the gases to the off-shore rigs on the US Pacific coast, where work has been negatively affected. Wall Street’s reaction was immediate and profound.

Frank Ramirez, manager at an Exxon facility near Anchorage, Alaska, reported that a herd of moose blocked the access road to his plant for 20 minutes this morning. His personal assistant Sylvia S. was unable to report to work on time, and he had to make his own coffee. The national average price of a gallon of gas rose 0.3 cent between 9am and 11am as a direct consequence of this earth-shattering event.

Later in the day, Mr. Ramirez had lunch with his mistress and spent a happy hour at the local motel. The markets calmed somewhat and August Brent crude futures fell 40 cents in London to settle at $134.71 on the ICE Futures exchange.

For the 2nd time in about a year I ran into what appears to be a fraudulent seller on Ebay. The last time it was someone who messed up by purchasing a large lot of bad memory chips himself, but who still went ahead and sold it off on Ebay (see my earlier post about this incident). I was not successful in getting my money back from Paypal back then because of a technicality.

3 weeks ago I purchased a (luckily) very small and inexpensive item, 2 RCA extension couplers for about $5 including shipping. I never received anything, never got a response to my emails to the seller, and was unable to get in touch with him otherwise. The seller, James H Linker who does business out of Las Vegas, seems to have disappeared from the face of the earth. His feedback on Ebay is private, so I cannot see what the other people’s damage is, but his negative feeback count is going up every day (see this archived page with serenitydigital’s feedback, which I am sure will not be accessible online much longer). What is striking, though, is that for the better part of 2 years he seems to have been receiving exclusively positive feedback. All the negative feedback is from the past month.

Why would someone risk his reputation as a seller for $5? What happened? Did this person have an accident, become ill, get deported from this country? Maybe I will never find out.

What prompted me to start another blog entry about this incident is my increasing frustration with Ebay and Paypal, though. These companies have been able to establish a quasi-monopoly and they are becoming very sophisticated in disenfranchising their users by making it so difficult to claim a loss.

Ebay no longer handles claims themselves, but referred me to the Paypal dispute process. I just started a dispute there. This will take many weeks. I am just waiting for Paypal to send me back to Ebay, and this process continuing back and forth until I become too tired to continue.

As I read through various policy documents online, I come across some interesting stuff. For instance, Ebay requires buyers to pay for an appraisal if one of their sellers sells you Chinese junk instead of that Louis Vuitton handbag that you always wanted … There is a growing number of little nuissances that one has to put up with as an Ebay shopper. Unfortunately, the options are limited when dealing with a monopoly. I will look for alternative sources in the future, maybe pay a little more for having peace of mind. Ebay’s business model is built on circumventing basic consumer rights that it took a century to establish in this country. If they prevail with this model, other stores will start cutting back on consumer protection as well. I don’t want this to happen. Let’s avoid Ebay!

later on 5/28: I just found this thread on the Ebay forums (6/11/2008: this link is no longer good since Ebay removed the discussion from the forum). Nobody knows anything and everybody is speculating. What is interesting, though, is that some of the comments pointed me to the seller’s page on Ebay. Here the feedback is visible, and wow, there is a lot of negative feedback.

Update 6/8: PayPal refunded the $5.something today. This is nice, but since PayPal’s communication makes it sound like they did me a favor, the positive outcome does little to improve my level of comfort as a buyer. I feel that I am at the mercy of Ebay/PayPal with no leverage if a deal blows up. In my experience this happens with one out of every 30 transactions. 

Why do I find all the examples of how to use recursion in SQL Server 2005 too complicated (including the one in the Microsoft help)?

Here is mine that does the bare minimum. (more…)

Others have shown how to copy music files from an iPod to the local harddrive without costly software.
If you follow these instructions, you find yourself with a huge number of files in a single directory. All the files on the iPod have 4-letter names, such as BQEH.mp3. This is easy enough to fix, for instance with the free tool Id Renamer.
However, I was unable to find a utility that can distribute thousands of files into subdirectories, based on ID3 tags such as Artist and Album title. This is necessary not only because I like to organize my music collection in subfolders so that I can find things easier, but more importantly because an excessive number of files in a single directory is something that degrades the performance of most file systems.
Doing this by hand would have taken hours, so I decided to spend the time writing a little utility instead - MP3Filer. This is a Win32 command line application written in C++ that uses the Windows Media Format SDK 9. It took about 8 hours to write and test, and I am making it available for free under no license whatsoever.
This is work in progress, and I am planning to add functionality that will eventually allow me to rip the music from an iPod directly (without the help of another tool), name the files appropriately and store them in nicely organized folders on my harddrive. For now, all it does is moving MP3 files from the current directory into subdirectories (\author\album) and create the directories if they do not already exist.

What you need in order to use the utility:

  • Download the zipped executable, MP3Filer.zip
  • Unpack the file into a directory that contains MP3 files, or in a directory that is included in your system’s search path

 What you need in order to compile the utility:

  • Download the project source files in zipped format, MP3Filer_Source.zip 
  • Visual Studio 2005 
  • The WMFSDK 9 from Microsoft
  • Edit the Additional Include path and the Additional Library path in the project properties to match the location of the SDK files

And no, this is not an April-Fool’s-Day joke.

I wanted to know exactly how much throughput I get from my new switch (HP ProcCurve 1400-24G) and found a network performance test tool that is available on many platforms - iPerf. I installed it on my Pc (Asus P5NSLI MB with dual-core Intel Pentium 4 3.4 GHz, a Raid 0 configuration, and a Marvell on-board Ethernet controller), a Synology Rackstation RS-407 NAS (ARM CPUrunning Linux, Raid 5), and a Sun Fire V20z rack server with two 2.4GHz Athlon processors running Windows Server 2003 x64 (2 Broadcom NetXtreme Gigabit Ethernet controllers, single SCSI disk).

Test configuration

I purchased the HP switch because it supports Jumbo frames. I tested the transfer rate between all three stations in both directions with three different MTU settings. All NICs support Jumbo frames and the value can be configured in the NIC driver settings (Windows) or in the Synology administration UI.

MTU=1500

1500 is the default (non-jumbo). I limited the MTU size for all three network cards to 1500 and ran iPerf in all 6 constellations.

iperf -c rackstation -P 1 -i 10 -p 4000
    -l 8K -f k -t 10 -d -r -L 4001

The results did not exactly blow me away. I have a mix of Cat-5 and Cat-5e cabling in the house and was concerned that I would experience bandwidth limitations. Since the servers in the test were directly connected to the switch with newly purchased Cat-6 patch cables, I expected a significantly higher transfer rate between the servers than between the workstation and either of the servers. The workstation was connected via 15 feet of Cat-5 cable, a Cat-5 wall jack, and a Cat-6 patch cable.

Test configuration
iPerf reported transfer rates between 150 and 250 kbps, not exactly Gigabit-like. So I turned up the MTU and hoped for the best.

MTU=4000

The next MTU size that is supported by all three network card drivers was 4000. I expected transfer rates to go up consistently.

Test configuration
iPerf now reported between 100 and 400 kbps, except between the workstation and the Sun server - there the performance descreased to a fraction of what it should be.

MTU=9000

9000 is the largest supported frame size. I set the MTU to 9000 on all sides and ran the same iPerf tests again.

Test configuration
Now iPerf reports over 500 kbps download speed from the Synology NAS, which would be nice if traffic between the Sun server and the workstation wasn’t so unrealistically slow. In addition, there now are oddities between the Sun and the Synology as well. I was able to consistenly reproduce these results.

I cannot say yet why I am observing these things. I opened a support case with HP networking and I am still waiting for an answer there. I did do some basic file transfer tests with a tool, by simply copying a large 1 GB video file between the participants, and while I did not measure such low transfer rates as iPerf reported, it definitely appears that the upload speed is consistently going down when Jumbo frames are enabled.

250,000 Mbps (bits) is a little over 30 MBps (bytes). Copying a 1GB file across the network takes about 30 seconds with MTU=1500. It does not get any faster than that, but downloads become substantially slower, e.g. > 2 minutes per GB when I set MTU=9000. The SMC Gigabit switch that I replaced and that did not have Jumbo frame support had the exact same performance. So, maybe the HP switch does not really support Jumbo frames? I am still waiting for a definitive answer from support, but if you have a Giga switch that performs better with Jumbo frames I’d like to hear about it.

Needless to say, I turned Jumbo frames off again and I am running with the basic MTU of 1500. While the iPerf numbers are not impressive the subjective performance gain from upgrading to a Gigabit switch was much more dramatic. It almost seems that iPerf does not function correctly with larger MTU sizes, too.

August 21, 2009

There is an old saying, “The jug goes to the well until it breaks”. The jug started to break as recent as last year, in March 2008. One of the large American investment firms, Bear Stearns, went belly-up in the wake of a crisis of the world’s financial markets. This crisis was caused by a lack of regulation and oversight of the US mortgage industry during the 8 years the administration of George W. Bush was in office. (more…)

When you have query that does complex calculations, maybe even has function calls in the select list

select
       costly_function_A() as result_A,
       costly_function_B() as result_B
from
       table_T

and then you need to return the result of such a calculation, but also manipulate it further and return the result of this operation as well,

select
       costly_function_A() as result_A,
       costly_function_B() as result_B
       result_A/result_B as result_ratio
from
       table_T

the result is the following dilemma:

Msg 207, Level 16, State 1, Line 4
Invalid column name 'result_A'.

It is not allowed. Invoking the function twice in the query

select
       costly_function_A() as result_A,
       costly_function_B() as result_B
       costly_function_A()/costly_function_B() as result_ratio
from
       table_T

would work, but is not an option because it nearly doubles the execution time. So what does SQL Server offer in terms of query-writing tricks that let us get around this issue?

There are 2 choices - neither is particularly elegant.

First, we can put the costly stuff into a derived table where it gets executed only once, and do the secondary calculation in an outer query:

select
       costly_T.result_A,
       costly_T.result_B
       costly_T.result_A/costly_T.result_B as result_ratio
from
(
       select
              costly_function_A() as result_A,
              costly_function_B() as result_B
       from
              table_T
)
as costly_T

Or we can use a view. If you do not already use views, don’t introduce one, but go with the derived table. If you do have views, you may already have the necessary layer of abstraction that is needed here.

I installed the Synology Rackstation last night and so far I like it a lot.
2 TB Rackstation with Raid 5.
I installed four Seagate Barracuda ST3500630AS (500GB each) and, let me tell you, this configuration is anything but quiet. I have it sitting in a 42U rack cabinet in my basement, which is now filled with the airplane-like hum of four harddisk drives and nine fans.
Second, it is slow. The Gigabit network connection does not help if the unit’s processor is hopelessly overwhelmed - which it is even when I am the only user. I am in the process of copying content from a server with a 100MBit network connection, while the NAS is on a Gigabit connection. At the same time I am configuring Joomla, which I just installed on the Synology, and every page request takes long enough to return that I have time to write this report. Response time on any web page, photo station, Joomla, or administration page, is somewhere between 3 and 5 seconds, even when the shares are idle. It is possible that the server is still busy indexing my content, so I will give it a few days and test performance again.

< ... a few hours later ...>
So I just updated the firmware to enable SSH access to the NAS, which worked beautifully, and was able to connect right away. Luckily, top is available and I noticed that a convert process is running and routinely taking up to 100% CPU. I assume that it is still creating thumbnails for the 10’s of thousands of pictures that I uploaded earlier today. This would account for the sluggish performance.

< ... the next day ...>
I was able to install the Bootstrap and get iperf installed on the Rackstation. With both my workstation and the Rackstation connected to the new Gigabit switch, I had somewhat higher expectations regarding transfer rates than what I am actually measuring:

------------------------------------------------------------
Client connecting to 10.10.1.176, TCP port 4000
TCP window size: 102 KByte (default)
------------------------------------------------------------
[ 7] local 10.10.1.109 port 3044 connected with 10.10.1.176 port 4000
[ 6] 0.0-10.0 sec 118 MBytes 98.9 Mbits/sec
[ 6] MSS size 4034 bytes (MTU 4074 bytes, unknown interface)
[ 7] 0.0-10.0 sec 303 MBytes 255 Mbits/sec
[ 7] MSS size 4022 bytes (MTU 4062 bytes, unknown interface)

After a little bit of Googling I set the MTU size of the network card on the workstation to 9000. The results are better:

------------------------------------------------------------
Client connecting to 10.10.1.176, TCP port 4000
TCP window size: 109 KByte (default)
------------------------------------------------------------
[ 7] local 10.10.1.109 port 3441 connected with 10.10.1.176 port 4000
[ 7] 0.0-10.0 sec 575 MBytes 482 Mbits/sec
[ 7] MSS size 8948 bytes (MTU 8988 bytes, unknown interface)
[ 6] 0.0-10.6 sec 712 KBytes 549 Kbits/sec
[ 6] MSS size 8960 bytes (MTU 9000 bytes, unknown interface)

After making sure that the patch cables on both ends are Cat 5e (is Cat 5 Enhanced the same as Cat 5e?), the numbers went up a little still, but since the cable in the wall is Cat 5 and will not be replaced unless absolutely necessary … I suppose this is as good as Gigabit Ethernet gets. I ordered Cat 6 patch cables anyways, since there will be more Gigabit traffic in the house soon. We’ll see if it makes a difference.


eth0 Link encap:Ethernet HWaddr 00:11:32:01:86:86
inet addr:10.10.1.109 Bcast:10.10.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:9004 Metric:1
RX packets:63186085 errors:0 dropped:0 overruns:0 frame:0
TX packets:37736653 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:512
RX bytes:2705338793 (2.5 GiB) TX bytes:3908546493 (3.6 GiB)
Interrupt:21

My switch is the SMC GS16 (no jumbo frame support, or I am sure SMC would mention it on their web site). Why I get a 500% improvement in throughput by enabling Jumbo frames on the client is beyond me. I was hoping that by plugging my laptop directly into the switch, with the RS407 plugged directly into the switch, I would get better transfer rates again, but no. It appears that the Intel PRO 1000 network controller in my Lenovo T60p laptop does not support Jumbo frames, at least there is no way of enabling them in the most recent drivers. The desktop is an Asus P5NSLI and enabling Jumbo frames on the onboard Marvell Yukon PCI Gigabit Ethernet Controller really seems to make all the difference.

The HTTP performance is still poor. The image thumbnails are apparently all created, since the machine is mostly idling along (why it does not go into hibernation is yet another question to answer), but it still responds slower to page requests than most external sites that I go to. Apache uses almost 100% of CPU time when it puts the HTTP response together - and these are light-weight pages.

Top shows CPU usage on the Synology

Overall, I still like the Synology. It is comparatively expensive - the Acer Aspire Easystore withg 2 TB (the device is not marketed in the US) is available for almost half of what I paid. Still, a read transfer rate of almost 30MB/s over the network is pretty cool. Copying an 800MB VCD image from the NAS to the local disk takes less than 30s. I am looking forward to filling up all this space now.

< ... after one week ...>

I just noticed that the iPerf results above were Kilobits, not Megabits. Now it starts to make sense. Setting the MTU to 9 kB does not work after all if the switch does not support it. Or whatever else causes the slowdown. Since I did not really notice a problem with transfers, I am not so sure how meaningful these results are anyways. I set the MTU back to 1.5 kB. The Cat 6 patch cables arrived, btw, and I did not notice a difference.

Useful resources:

< ... update ...>
Synology released new firmware for the Rackstation a few months back. I have been using it for some time. The new Web interface really makes the product much more usable. There is now a Surveillance station that captures camera streams and records to disk. Unfortunately, it does not work with my camera. Still, if you don’t have it, I highly recommend getting the update.

Next Page »