Saturday, July 31, 2010

More dollars than sense

I'd like to thank my friend Ying for finding this video. It basically showcases the attitudes of the occasional douchebag that you encounter at a track day who thinks they have the skills of a professional driver because he/she:

  • drives an expensive car.
  • has purchased every modification for his/her car that can be found in the catalogue.
  • does not understand the concept that skill is gained through practice and not by spending money on a car.

Due to the above flawed line of reasoning, these idiots also believe that letting faster drivers pass them is unacceptable because they refuse to accept that a cheaper slower car could be in any way faster than theirs. I have also heard the following nonsensical argument from one such fool: "Why should I waste my lap and let faster drivers pass?" Of course, the easy response is: "Why should every other faster driver in your group have to waste multiple laps by following your slow ass?"

Anyway, watch the video and have a good laugh.

Red Bumble Bee

Despite GM announcing many months ago that they were not releasing the Camaro here in Australia, they still seem to be testing it.  I spotted this left hand drive model today.



Sunday, July 18, 2010

Parking: An analysis

With all the douchebags in this world who don't have any respect for other people's cars, what can you do to reduce your chances of falling victim to the afore mentioned idiots when parking? Here is what I have found.

Standard Parking Spaces
The biggest threat here is from the uncontrolled swing of an opening door from the car beside yours. Therefore, you can minimize this risk by cutting it in half. Find a space at the end of the row and then park as far away as you can from the space beside yours.

It is even more ideal if the space is separated from the rest by a pillar.

Angle Parking Spaces
Once again, angle parking presents the risk of some fool letting their car door swing into yours. The most ideal angle parking space is not only at the end of a row, it is the space where your car's nose is pointed away from the other cars. This means that the car that parks next to you will less likely to be able to have its door swing into your car.

Parallel Parking Spaces
With parallel parking, the biggest threat posed is by other cars hitting the front or back of your car. I think it is safe to say that most people are better at driving forward than backwards, so they are more likely to hit the front of your car when reversing into or reversing in order to leave their space. Therefore, the most ideal parallel parking space is that at the start of the line and park as far forward in the space as you can.


Thursday, July 15, 2010

Find columns with a particular property

Here's a query I found handy when I needed to retrieve a list of columns from any table in a database that is a ROWGUID column.

SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE
COLUMNPROPERTY
(
OBJECT_ID(QUOTENAME(table_schema) + '.' +
QUOTENAME(table_name)) -- table ID
,column_name
,'IsRowGuidCol'
) = 1
ORDER BY table_name, ordinal_position

You can also replace 'IsRowGuidCol' with any other property listed here.

Saturday, July 10, 2010

Exe Crew Dyno Day - RE Customs



Today's dyno graph has been overlaid on to my previous dyno graph.

Since the last dyno reading (168.2 kW also at RE Customs), the only difference is the replacement of the stock mid-pipe back exhaust with a Fujitsubo Legalis-R system. As you can see, there has been a slight power improvement at low RPM as well as at mid range RPM, with little difference in peak power.

Thursday, July 8, 2010

Clean up orphaned identity range constraints

Consider the following scenario: You wanted to move a SQL Server database from one server to another, so you detached it from the original server and attached it at the destination. However, the database was replicated using merge replication and you forgot to delete the database's publications before detaching it. Now, after attaching the database, you find that there are leftover orphaned identity range constraints on the previously replicated tables. I was faced with this problem, so I constructed the following script after some searching on the internet.

DECLARE @constraintname SYSNAME
DECLARE @tablename SYSNAME
DECLARE c1 CURSOR FOR
SELECT SysObjects.[Name] AS [Contraint Name] , Tab.[Name] AS [Table Name]
FROM SysObjects
INNER JOIN (SELECT [Name],[ID] FROM SysObjects WHERE XType = 'U') AS Tab ON Tab.[ID] = Sysobjects.[Parent_Obj]
INNER JOIN sysconstraints ON sysconstraints.Constid = Sysobjects.[ID]
WHERE SysObjects.[Name] LIKE 'repl_identity_range%'
ORDER BY Tab.[Name]

OPEN c1
FETCH NEXT FROM c1 INTO @constraintname, @tablename
WHILE (@@fetch_status <> -1)
BEGIN
EXEC ('ALTER TABLE ' + @tablename + ' DROP CONSTRAINT ' + @constraintname)
FETCH NEXT FROM c1 INTO @constraintname, @tablename
END

DEALLOCATE c1
GO

Wednesday, July 7, 2010

Find text in stored procedures or views

This is a handy query that I found that searches through your SQL Server database stored procedures or views for occurrences of the specified text.

For example, to search for a stored procedure with the text "foo", use the following:

SELECT OBJECT_NAME(id)
FROM syscomments
WHERE lower([text]) LIKE '%foo%'
AND OBJECTPROPERTY(id, 'IsProcedure') = 1
GROUP BY OBJECT_NAME(id)

To search through views, replace 'IsProcedure' with 'IsView'.