Theory of Relativity In Words of Four Letters or Less

Just remembered a site I found a few months ago and I had to re-read it right now:

Albert Einstein’s Theory of Relativity In Words of Four Letters or Less

The creator of this document explains Einstein’s Theory of Relativity by using only words of four letters or less. It is fascinating to see how this leads to very easy understandable sentences. Though I have to admin that I still don’t get the whole theory. Guess I have to read it again.

Here’s an example:

Say you woke up one day and your bed was gone. Your room, too. Gone. It’s all gone. You wake up in an inky void. Not even a star. Okay, yes, it’s a dumb idea, but just go with it. Now say you want to know if you move or not. Are you held fast in one spot? Or do you, say, list off to the left some? What I want to ask you is: Can you find out? Hell no. You can see that, sure.

jQuery submit() on form element does not work

If you encounter the strange behaviour that a call to submit() on a form element does not work, one possible reason could be that you have an input element with the name “submit” in your form, mostlikely a submit button. Change the name attribute of that element to something else and the submit() will work.

This just happend to me and it took quite a while to figure out what the problem was.

Apart from that jQuery really rocks!

XAMPP / WAMP problem with port 80

I tried to install XAMPP on a Vista machine but I couln’t get the apache web server running. Port 80 was already used by another process. Since I have not installed the usual suspect Skype, I installed WAMP which comes with a port check tool that gives more detailed information than the one in XAMPP. And it told me the service using port 80 was microsoft-httpapi/2.0. After some googeling I learned that this is the SQL Server Reporting Services service from my SQL Server 2008 installation. To solve the problem do the following:

  • Open the SQL Server Configuration Manager
  • Double-click on SQL Server Reporting Services
  • Stop the service
  • On Tab Service changed the start mode to manual

Then port 80 is not used anymore and XAMPP and WAMP can be used without problems.

XAMPP slow on Vista

Just installed XAMPP lite on my Vista machine. The installation went smooth but the web server feels somehow slow. There is often a delay of about 1-2 seconds without any CPU load when I open a web page. I encountered this problem before on other Vista machines but never found a solution for it. Now I found a solution:

  • Open notepad.exe as administrator (right-click Notepad icon -> run as administrator)
  • Click on File -> Open
  • Change the selection Text files (*.txt) to All files (*.*)
  • Open the file C:WindowsSystem32driversetchosts
  • Change the line
    ::1             localhost


    #::1             localhost
  • Save and close notepad

That’s it.

GROUP BY understanding problem

I am going to take the Microsoft MCTS Exam 70-433 – SQL Server 2008 Database Development. So I bought the corresponding book from Microsoft Press for this very exam:

ISBN-13: 978-0735626393
ISBN-13: 978-0735626393

Altough I have a lot of experience with SQL in general and the SQL Server in particular I decided to read Chapter 1 where they explain the SQL basics, to be sure to get it all. When I came to the part where they explained  the GROUP BY clause, I stumbled across the following simple SQL statement (page 20):

SELECT Production.Product.ProductSubcategoryID
     , AVG(ListPrice) AS 'Average'
     , MIN(ListPrice) AS 'Minimum'
     , MAX(ListPrice) AS 'Maximum'
FROM Production.Product
WHERE ListPrice <> 0
GROUP BY Product.ProductSubcategoryID;

The result set:

ProductSubcategoryID | Average  | Minimum | Maximum
NULL                   159.1333   133.34    196.92
1                      1683.365   539.99    3399.99
2                      1597.54    539.99    3578.27

What follows is this explanation of the result set:

The top row, where the ProductSubcategoryID is listed as NULL, is the summary row that provides the average, minimum and maxiumum list prices of products across all subcategories.

Aggregate functions with a simple GROUP BY do return a summary row? Could it be that I missed that all the years? Obviously the first row is simple the group of rows with ProductSubcategoryID of NULL and not a summary row. Or do I miss something here?

I know there is a WITH ROLLUP clause which produces summary rows, but this is explained in the next chapter of the book, so I don’t think it a simple typo.

Btw, this example uses the AdventureWorks2008 example database from Microsoft.