Any minute now...



This is the young man who decided to wait for Longhorn...
This is the young man who decided to wait for Longhorn...

The word 'longhorn' could be replaced with the name of just about any 'version next.'

I've done this as a variation of a poster I saw in a real estate agent's office which said 'This is the young man who decided to wait for the price of houses to come down.' (The afore mentioned real estate agent being my father.)

And, I've used a cartoon picture courtesy of TurboSquid. TurboSquid seem to sell 3d-models. Groovy stuff.

 

Treat Your Eyes

css, html,

If, like me, you often finding yourself giggling along to a good Cascading Style Sheet, then you'll enjoy Roger Johansson's series of tips on CSS.

While he is clearly an anal-retentive git, for insisting on saving every byte possible in his CSS, he's still a master stylist. Damn fine work.

 

Today's HOT Dos Tip...

Beat your face against a brick wall if you didn't know about this short-cut in the command prompt.

cd progr*

That's right honey. You can use wildcards, such as the '*', with the 'cd' command.

This is particularly useful with loooooong directory names and weird directory names.

Here's a CSS version of the graphic...

C:\>cd progr*

C:\Program Files>_

Every time another programmer spots me doing this they gasp in amazement, fall on the floor and begin to twitch. It's an embarrassment. Thanks to Edgar Smith for showing me this one, a few years back now...

...
 

Can You Lower The Quality To Save On Costs?

How much would you pay for a bad heart-transplant?

How much would you pay for a ticket onboard on a faulty airplane? Is 80% of the regular price okay? Is 60% okay?

What would you pay for a television that is only slightly likely to blow up and kill you?

I say this, because some people seem to get confused about the Traditional 'Quality Triangle'.

The three corners of the quality triangle are:

  • Cost
  • Time
  • Complexity (or 'features')

You can only control two of these at once. If you specify the time it will take and the features needed, then you cannot control the cost.

Some people seem to think that the third corner is 'Quality' (instead of complexity/features). This implies that if you are happy with lower quality you can save on time or cost.

Not true. When quality is lower, the triangle snaps. Costs suddenly blow out, deadlines whoosh past, complex workarounds are needed. Your customers leave and you are out of work.

Don't f*ck with quality. It will f*ck you.

 

Simple Example of Using the World's Simplest Code Generator....

The World's Simplest Code Generator can be used for millions of little tasks in any programmer's daily life. Here is one simple example.

Just say you Urgently need to know the number of rows in EVERY user table in your database...

In sql analyzer, run this:

select name from sysobjects where type = 'u'

This returns a list of all the user tables...

Orders
Products
Order Details
CustomerCustomerDemo
CustomerDemographics
Region
Territories
EmployeeTerritories
Employees
Categories
Customers
Shippers
Suppliers

Now paste that data into the first box in 'The World's Simplest Code Generator'

And paste this 'Pattern' into the second box:

SELECT
       '$1' AS 'Table Name', 
      COUNT(*) AS 'Count' 
FROM [$1]
UNION

Click [calculate] and 'Voila!'

You have this looooong script:

SELECT
       'Orders' AS 'Table Name', 
      COUNT(*) AS 'Count' 
FROM [Orders]
UNION
SELECT
       'Products' AS 'Table Name', 
      COUNT(*) AS 'Count' 
FROM [Products]
UNION
SELECT
       'Order Details' AS 'Table Name', 
      COUNT(*) AS 'Count' 
FROM [Order Details]
UNION
SELECT
       'CustomerCustomerDemo' AS 'Table Name', 
      COUNT(*) AS 'Count' 
FROM [CustomerCustomerDemo]
UNION
SELECT
       'CustomerDemographics' AS 'Table Name', 
      COUNT(*) AS 'Count' 
FROM [CustomerDemographics]
UNION
SELECT
       'Region' AS 'Table Name', 
      COUNT(*) AS 'Count' 
FROM [Region]
UNION
SELECT
       'Territories' AS 'Table Name', 
      COUNT(*) AS 'Count' 
FROM [Territories]
UNION
SELECT
       'EmployeeTerritories' AS 'Table Name', 
      COUNT(*) AS 'Count' 
FROM [EmployeeTerritories]
UNION
SELECT
       'Employees' AS 'Table Name', 
      COUNT(*) AS 'Count' 
FROM [Employees]
UNION
SELECT
       'Categories' AS 'Table Name', 
      COUNT(*) AS 'Count' 
FROM [Categories]
UNION
SELECT
       'Customers' AS 'Table Name', 
      COUNT(*) AS 'Count' 
FROM [Customers]
UNION
SELECT
       'Shippers' AS 'Table Name', 
      COUNT(*) AS 'Count' 
FROM [Shippers]
UNION
SELECT
       'Suppliers' AS 'Table Name', 
      COUNT(*) AS 'Count' 
FROM [Suppliers]
UNION

(remove the word 'UNION' from the very end, before you use it...)

Execute the script in SQL Query Analyser... and here's the result:

a grid showing the sizes of each column in the database

Okay -- now any DBA could've solved that problem in a few other ways, that show off all their fancy-schmancy dba skills and justify all the time they spend reading big thick books about system stored procedures, when they should be down at the local bar trying to meet a life partner.

But the power of 'The World's Simplest Code Generator'is that you can use it to multiply the little bit of knowledge you do have, and get results on a broad number of programming problems in a big big hurry.

Here's some suggested uses:

  • XML: turn a CSV list into a scrap of XML, great for test purposes. For example, testing an RSS reader!
  • HTML: need to craft a HTML table by hand, or to write a html list by hand?
  • C# property getters and setters: Got a list of variable names that you need setters and getters for? (examples provided in the comments here
  • VB.Net property getters and setters: Got a list of variable names that you need setters and getters for? (examples provided in the comments here
  • .Net: repetitive code for validation, or perhaps serialization; need .net wrappers for interop purposes?
  • SQL: Stored procedures to write? Insert/Update statements, union statements, backup scripts...
  • PHP: I don't write PHP myself, but I know this tool could come in handy there
  • Batch files:Some times an administration task will require the construction of a big verbose chain of commands like this: "if not exist x md x"... bring on the WSCG....
  • Any other language you like

This, however, can leave you with so much spare time that they inscribe your name on a plaque on a bar stool down at the local pub. So use this tool wisely and in moderation.

 

Online petition for less on-line petitions.

html,

Are you sick of on-line petitions asking for new things in .net 2.0? Sign the new 'no more petitions' petition. If enough people sign up then I will print out all of the names, in triplicate and forward them to the fbi the cia and the w3c. Cheers.

 

Act Local, Blog Global

It's backup day -- the 3rd of the month.

Have you got your life in order?

Are your relatives all patched up?

Are you all set up for firewalls, virus protection, spam filters and pop up blockers?

If not, answer these two questions for yourself.

What is your goal? What is the next action?

And if, along the way, you need to clear space off a chock-full hard drive, you might want to look at one of these two apps:

where did all that space go??
SpaceMonger (my favourite)

or

where did all that space go??
SequoiaView

I'm a sucker for a squarified tree map.

Best of luck.

 

The World's Simplest Code Generator

Are you a programmer? Meet your new best friend.

Update! New version out now: the World's 2nd Simplest Code Generator

the worlds simplest code generator

Enter comma separated data into the first box. Type a 'Pattern' into the second box. Press 'Calculate' and Voila! The data and the pattern are merged.

<% 'For Each Item In Request.Form ' Response.Write "Item: " & Item & " Value:" & (Request.Form(Item)) & "
" 'next Dim sRows Dim sRowArray Dim sRow Dim sFields Dim sFieldArray Dim sField Dim sTemplate Dim sResponse Dim sReponseLine Dim iFieldNum sRows = Request.Form("TextRows") sTemplate = Request.Form("TextTemplate") if Replace(sRows,"vbcrlf","") = "" then sRows = "me,you" + vbcrlf + "you,me" end if if sTemplate = "" then sTemplate = "$1 loves $2 " + vbcrlf end if sRowArray = Split(sRows, vbCrLf) sResponse = "" Dim iRowNum For each sRow in sRowArray sFieldArray = Split(sRow, ",") iFieldNum = 0 iRowNum = iRowNum + 1 sResponseLine = sTemplate For each sField in sFieldArray iFieldNum = iFieldNum + 1 sResponseLine = Replace(sResponseLine, "$" & iFieldNum, sField) Next sResponse = sResponse & sResponseLine Next %>

Merge These Rows

Into This Pattern



Result


If you use this generator, you might find it useful to store your Patterns in the comment area below...

 

Software Idea: Automatic ScreenShot Journal

Every N seconds, a windows service takes a screen shot of your desktop and saves it as a thumbnail. At the end of a week you can use this to determine what you were doing at any point in time. You can then quickly allocate periods of time to certain projects/project tasks in your timesheeting software.

Note that this is *not* a big brother style application where the screen shots are sent off to some managerial person who can then fire you for playing winnable solitaire Whack Your Boss too much.

Gus points out that you could also watch a high-speed animation of your week, particularly if N is small enough.

Timesheeting, by the way, is the most unenjoyable activity in the world. Its very existence is proof that a powerful and malevolent force, just beyond the flimsy barriers of reality continually warps the universal fibril.

If I wasn't so lazy I'd forward this idea to the LazyWeb...

 

Whack Your Boss

Go on. You know you want to.

My favourite is the umbrella.

(Strange that the uri is 'wackyourboss' with no 'H', even though the artwork and title *do* have an 'H'... maybe the address they were after was taken. Why am I such a geek that I notice these things?)