Archive for June, 2006

.Net and Math.Floor()

Wednesday, June 21st, 2006

Most of my time at work is spent working with .Net and C#. I just discovered what I consider to be a significant flaw in .Net (1.1).

The Floor function is a standard function across many languages. Basically you give it a decimal and it removes everything after the decimal point, giving you an integer.

The problem is that the Microsoft implementation of the Floor returns a double which is a floating point number. Floating point numbers are an approximation. For example if you set a floating point variable to 5, it might actually hold the value 5.00000002004. For most maths operations this is sufficient.

In the case of Floor, this is retarded. This means that suppose I give Floor a value of 5.8, instead of getting back 5 (or 5.0), I get back 5.000000203. Earth to Microsoft: If I have called Floor I want an int (of sufficient precision).

In Microsoft’s defence there are two reasons why this makes some sense:
1. There are precision issues, a int64 doesn’t cover all the available returns
2. All the other Math functions work with doubles only

Reason 2 isn’t a good reason. The reality that the Floor is not truly Math Functions in the same way that say Sin and Cos are. When you use Floor you deliberatly losing precision. The only reason to do this is for user display, or when you are not truly doing a mathematical operation.

Regardless, this is still a stupid decision by Microsoft. At least they should provide overloads that take a decimal (which is not floating point) and return an int of sufficient precision.

SQL Server Version Control

Sunday, June 11th, 2006

I’ve put up a brief article on version control with SQL Server. This could be more generally applied to version control for any database.

eMusic sends Spam

Thursday, June 8th, 2006

Update: I recieved a response from eMusic saying that this appears to be the action of a sub-affiliate of an affiliate. “eMusic does not send out spam email. The only time that will get an email that discusses our service is if you have visited the website for information and entered your email address.”

Original: eMusic has positioned itself as a online, independant music reseller. They are customer friendly, in that they sell music that is not encumbered with DRM.

Until now I had considered eMusic to be one of the few online music sites that do the right thing by all concerned.

That is until I recieved this email:

eMusic stands alone as the only digital music service entirely
focused on serving the needs of independent music fans and independent labels.

Get 50 Free Mp3s just for trying us out.

http://www.multiproductsone.com/CTMV1851_2/3923/lvlu1qryG/gfdphtrq/u.htm

Delivering more than one million downloads each month, eMusic is
among the top digital music services, offering a diverse catalog of 600,000 tracks from established and emerging artists in every genre from the worlds top independent labels. Founded in 1998, eMusic was the first service to sell songs and albums in the popular MP3 format and the first company to launch a digital music subscription service.

http://www.multiproductsone.com/CTMV1851_2/3923/lvlu1qryG/gfdphtrq/u.htm

To be removed from this email list, use this URL.
http://www.multiproductsone.com/ATMV1851_3/3923/lvlu1qryG/gfdphtrq/u.htm

eMusic.com, Inc. 9710 Scranton Road, Suite 280 San Diego, CA 92121
If you prefer not to receive e-promotions from us in the future, you may go to the following address to unsubscribe: http://multiproductsone.com/UTMV1851/3923/lvlu1qryG/gfdphtrq/u.htm.

Your receipt of this material is subject to the Privacy Policy, which is available on the web at http://multiproductsone.com.

If you would like to write us or call us regarding any questions or
comments, you may use the address and phone number below:
1 7 7 9 N C O N G R E S S A V E STE 208 B O Y N T O N B E A C H , F L 3 3 4 2 6 - 8 2 0 5 ( 5 6 1 ) - 2 4 4 - 5 1 2 1
r e f c o d e - eoenFjkrZ-zywiamkj

^^^^^^ end email

Now it is possible that this is being sent through an affiliate who gets paid for referrals, and is choosing to advertise by sending spam. If that is the case eMusic should keep a tighter reign on their affiliate. I’m contacting eMusic to ask if they are aware this is occurring.

In my opinion any product that is sold through spam is one I will never buy.