Monday, May 28, 2007

Creationism

The universe is complex.

Far too complex to have been produced by random processes from nothing.

It is just not possible for more-complex things to evolve from less-complex things.

There must have been a creator.

The complex universe was created by a creator.

[logical continuation...]

The creator must therefore have been more complex than the universe.

The creator is very complex.

Far, far too complex to have come from nothing...

...

Friday, May 25, 2007

ReSharper - Awesome, Expensive, Slow

ReSharper (R#) is great. The refactorings and code completions and cleanups and warnings are truly awesome. I now really want all the code that I work on to pass with few or no warnings. But I am going to have to uninstall it for two fairly mundane (i.e., should be easy to fix) reasons:

  1. It totally has screwed up all of the keyboard shortcuts. Even after flipping back to all VS 2005 shortcuts there are some things that don't work, and worse, there are many nice features of R# that are no longer available at the touch of a button.
  2. God damn it's slow! Not on a new file, or a small file. But on big old files that have lots (200 or more it seems) warnings. Each time you make an edit to the file it re-analyses it which takes a looong time. (7000 line file, 280 warnings, 15 seconds)

These should both be reasonably easy to fix:

  1. Don't frig with the shortcuts! Give me a list of functions for which you would like to add shortcuts and I will assign them. Maybe this is doable by the end user - I'm sure that I could eventually get my old studio shortcuts working again, but I am not paying US$250 for a tool only to spend hours repairing the damage it has done.
  2. Let me disable the automatic analysis of the current file. Maybe in that nice little coloured box at the top of the colour bar there that had a hand icon but does not seem to actually DO anything.

I have used R# for a couple of days now, and I love it! You have a convert people! But I CAN'T use it like it is.

Wednesday, May 23, 2007

Web 2.0 style guide

Orange! Light green! Dark blue! Light blue!

Very faint diagonal or way off-centre circular gradients.

Dark text on light same coloured background.

Dotted (light coloured) borders (and horizontal rules).

Shiny glass or gel (jelly!) looking buttons (that are not usually buttons) and text.

Text sitting on a shiny table and all manner of other (3d) surface effects.

Big bold headlines. Often multiple down or diagonally across the page.

Smaller (gray) body text with lots of white padding.

Many pointed stars.

Cute icons.

No underlined links.

Digg this, post on reddit, blog this, tag on del.icio.us, etc., etc., etc. buttons.

I'm not saying that any of this is good or bad, just what I have been noticing.

Implementing IExceptionHandler

When using the Enterprise Library Exception Handling Block, there are (at least) two things that you have to do to get your custom handler to work that I missed when I looked at the docs. Specify CustomHandlerData as the ConfigurationElementType for the handler class:

[ConfigurationElementType(typeof(CustomHandlerData))]
public class WatchdogHandler : IExceptionHandler {
...

Provide a constructor that takes a NameValueCollection:

public WatchdogHandler(NameValueCollection attributes) { }

Final note.

I have had weird problems with the Enterprise Library Configuration tool. When I first created the handler class it would not load the assembly in the tool. It said that no class that implemented IExceptionHandler could be found. When I fixed the problems with my class it still would not load. Frustrated, I created another handler class from scratch (no other classes in the assembly, no other bits of code lurking around to cause problems) and that one loaded. Then, magically, the other class loaded as well!? Perhaps it was after all the closing and re-opening of the tool that it started to work, but I am not convinced.

Thursday, May 17, 2007

Phrases which flip my “no-longer debateable” switch

For the bible tells me so.

If you have nothing to hide, what is the problem?

I'm not a racist but...

It's just a theory.

Others that just make my sigh and shake my head:

Anything that is described as having an infinite number of configurations or settings.

That [insert mechanical device here] totally breaks all the laws of physics.

Wednesday, May 02, 2007

Item: Ninjas, two score. Check.

Is there any problem that could not be solved by 40 Ninjas? Didn't think so.

Ninjas: not just for breakfast anymore.

Tuesday, May 01, 2007

No, that's not it, try again.

If there is only one valid entry for some field in an interface, why don't you just put it in for me?

I was using this form created by someone here today, it is a form for our overtime: “Please enter the date for last Saturday” Uh... okay. I guess that was the 22nd of April. 04 22 Bzzt! No sorry that is not the correct date. Please Enter the date for last Saturday. Oh yeah, it is the 21st. Bzzt, that date is too far in the past. Are you serious? The only date that I can enter is 28th April? Bingo.

Well bugger me. If you will only accept one value, and you know what that value is, why don't you just put that in there!? And why can't I enter a date from a past week? It is not an automated system, this gets sent to our HR department for manual human entry into another system. She asked me to resubmit my form from 2 weeks ago. Sheesh. I can see why you would want to make sure that someone selected a Saturday (the start of our billing week), but why force a single Saturday? The people in HR know what they are doing, I am not going to be able to slip in old forms just by putting in an old date, if they are not expecting them they are not going to process them.

If there is really no date selection, don't ask me to select one.

Friday, April 20, 2007

Make ‘em mandatory!

There is a town in the states called Kennesaw with what might be called the opposite of gun control laws. Each household is required to own and maintain a gun. Must be a real shoot-em-up town right? People gettin’ popped left and right? Check out the article.

When you think about it, the proposition “If we make guns illegal there will be less gun crime” is pretty nonsensical. I would suggest the simplified relation “Gun crime is proportional to the difference between the number of armed bad guys and the number of armed good guys”. From this it seems likely that decreasing the number of guns the bad guys have would be good, just as increasing the number of guns the good guys have should have a reducing effect on the level of gun crime. This subtraction however is problematic: it is difficult to actively reduce the number of bad guns. Installing gun control laws causes the good guys who have guns to turn them in and the bad guys to snigger. Arming the populace may well put guns in the hands of the bad guys, but I would argue that on balance more good guns are created than bad - criminals don't feel they need gun licences, don't register their guns, don't pay retail, don't install gun safes, don't enrol in official how to shoot safely courses. Gun control laws have the opposite to the intended effect.

If you make gun ownership criminal, only criminals will own guns.

Wednesday, April 18, 2007

Are you packing?

I would like to live in a world without guns. I would like to live in a world without violence of any sort. If people were never even verbally abusive to one another I would consider that we were on our way to the perfect society. If someone threatens your security with violence, I believe the first response should be to try to defuse the situation, to remove yourself and those dear to you from danger into safety. Only as a last resort would I consider meeting violence with violence. But to not take that last step. To turn the other cheek as it were - well I leave that to other folk. For me, if you threaten me and you leave me no other recourse than to violence, then violence you will get.

I am starting to believe that in some societies this necessarily extends to a willingness to counter gun violence with guns. I have often thought, and heard said by others, that the death toll in shooting rampages would be very much diminished[1] by some of the people involved (witnesses, victims) having guns (heroes). I think that is a very difficult argument to dismiss outright.

I recently watched a video by Penn & Teller on the bullshit that is gun control. Their argument is very America centric (citing constitutional amendments), but I think the arguments within translate nonetheless. Then yesterday there was the shooting at Virginia Tech. I wonder how far a lone gunman would progress into his spree if some significant portion of the populace were armed. I wonder how many criminals, who now find themselves in the wonderful position of being likely the only person with guns in a couple of minute radius, would reconsider all manner of crimes. Overnight there was also a shooting by a security guard of a man in Sydney. Two men approached him with a drawn gun, likely not expecting any resistance. He shot them and they fled. Criminals use guns to have a power advantage. By reducing the power of the populace (removing their guns) you let criminals easily tip the balance in their favour - carry a handgun. An armed populace (maybe as few as 2% carrying weapons) could greatly reduce a lone criminal's expectation of being ‘the most powerful’ in a certain situation merely by carrying a gun.

I am not saying that everyone should or needs to have a gun. But those considered stable enough, those who can show they can do so safely, those who wish to take on the responsibility of using a gun if the situation requires, why not?

Gun control folks are always carrying on about needing to ban guns. “If only we could remove all the guns we would be safe”. Well think about this: Virginia Tech was a gun free zone. For the 30 minutes or so between 9am and 9.30am there was only one person in the area who had a gun, and I think we all know now what he decided to do with it. I just wonder what may have happened if some of the teachers, the RA, the seniors, the janitors were armed. I wonder even what would have been different about that morning if the gunman had even the slightest doubts that perhaps he would meet with people in that place that were armed and prepared to defend themselves and others.

I don't think ideas that appear logically sound ought to be dismissed outright by ‘zero tolerance’ style arguments.

[1] There was a shooting at another school in Virginia, not so many years ago. Though there was a different outcome at the Appalachian School of Law. Two students at the scene were armed. They subdued the gunman after he took his first victims.

Friday, April 06, 2007

*Sniff*

You know how when sometimes you are just sitting there and you smell this smell and like, you smell it and you can't work out whether it's toast or dog shit... Yeah, I hate that.

Moo

The communist utopia can be build from a socialist regime by force in much the same way that a glass of milk can be build from a cow by cutting it in half. (Sounded better before I wrote it down...)

Thursday, April 05, 2007

Turn up the suck

I need to work out why the company I work for sucks.

We all want to know why our product sucks. I guess I could benefit from knowing why (you think) I suck.

Seth Godin's new book The Dip (under the lens here) seems just the ticket. I have not had much trouble in the past knowing when to quit. My problem has been more quitting when it is time to... (I just want to know how they get the little guy on the cover to walk along like that)

[Edit: I totally read “help you see what's causing your organization (or you) to suck” rather than “to get stuck”. Seth: Please tell us why we suck too! But in the end, one could say that people and companies and enterprises and relationships get stuck precisely because they suck.]

Swap Mouse

So I swap sides with the mouse a lot. I have to say I mostly use my left hand (even though I am a righty), but I swap often enough to have looked for a utility to easily swap the buttons.

I downloaded a couple of them and found them to be horrible. Some had graphical interfaces. One wanted to install and run at startup. One wanted to leave its little icon on the notification area. Geez Louise. All I want is a utility that I can double click that will swap the damn buttons around then go away. Silently if possible. So I made one.

It is all of two or three lines of code. (Well, okay, you know what I mean, three that I had to write myself). It is about 20KB, does not install, does its job quietly, and has a cool looking icon (well maybe not, but I had fun making it).

I used this as an opportunity to check out Google Code at the same time. So I have created a project called swapmouse, the executable is there now, the source will be linked up when I get home. Here is a link to the bare executable for SwapMouse for your convenience. Just put it in a directory under Program Files or somewhere (I usually make a Program Files\Utilities just for storing nice little programs that don't need to be installed) and make a shortcut to it. Enjoy.

Wednesday, April 04, 2007

404



    Error 4.04 - Date Not Found     Please try again at a later date. Maybe the 5th.


Tuesday, April 03, 2007

Last.FM gadget

This past weekend I have been working on a windows vista gadget for last.FM

Most of Saturday was spent fooling around with javascript for the first time in a long while. Trying to find syntax errors using notepad. Ugh. I finally relented and downloaded visual web designer. Next time I play with it I will hook up the script debugger. The rest of the time was spent parsing the XML and text responses that the last.fm 'APIs' respond with. It is a shame that the whole thing is not done in XML - the np.php (now playing) for example just responds with name value pairs in text. Not so nice. Plus it seems to me that the whole shebang is a little iffy at times. Just not responding to requests.

I will have a bit more of a look at the last.fm source tomorrow, for now I have only really looked at the myLastFm source code... Perhaps going back to the original source would be better. I want to know for instance whether the 'real' client polls the np.php for track updates (say every 5 seconds) or if it has some other way. I had envisioned getting the remaining track time and then waiting until around about the time the track should finish and then requesting new track info. But time remaining field seems to have been left out of the response (the myLastFm client looks for it too).

So for now I have working:

  • Basic gadget functionality (icons, page sizing, basic css and js)
  • Username and password configuration.
  • Password hashing.
  • Recently played tracks fly-out.
  • Now playing info (artist, album + cover art, track).

I think actual login (send username and password hash, receive sessionid and stream address) is close to working - just that when I was testing it last night the whole last.fm site stopped working, now np.php was not returning etc. Later it worked again, but I was past the stage of wanting to code - Guild Wars...

Thursday, March 29, 2007

x509 Certificates

How do you create a self signed certificate (for SSL) that (don't know how best to put it) carries it's password with it. It is just for testing, I just want the certificate the be used by the server in its call to AuthenticateAsServer. I (eventually) was able to create a self signed Root Authority certificate like this:

makecert -n "CN=Test Root Authority" -r -pe -ss my -sr LocalMachine -sky exchange -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12 TestRootAuthority.cer

and from it create a self signed certificate:

makecert -n "CN=Test Certificate" -in "Test Root Authority" -pe -ss my -sr LocalMachine -is my -ir LocalMachine -sky exchange -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12 Test.cer

Which works, as long as the server runs on a machine where the certificate is installed in the certificate store. It will not work if I try to just use the Test.cer file. That gives me:

The server mode SSL must use a certificate with the associated private key.

Regardless, I am still seeing the http connection attempt (that I am assuming to be a revocation list check or something) that I am trying to avoid. (thread on microsoft.public.dotnet.security)

Oh I don't know...

Wednesday, March 28, 2007

Spoke too soon!

None of the file operations work from the search results window.

I get “Interface not supported” errors... which I think could have something to do with it being a removable drive (or at least something to do with my specific removable drive) because I can't reproduce the problem using local folders... Grr...

Too late to start looking up error codes now.

Hey now that is cool.

Or: If you can look past the UAC prompts every time you do something outside of your Documents folder there are some neat features hiding there.

I was just looking at some files on my MP3 player. I was going to move some files that somehow got put into the Unknown Artist folder. I went into the folder where there are about five albums that must not have had the right artist info when I synced them.

Neat feature 1: The folder was being displayed as icons (I have not set up all my folders for view as details yet like I normally would...), go into the view dropdown (not sure that I like the fact that in one fell swoop we have decided that the menu bar is a bad idea...) to select details (so I can see the names better). What do I notice but there is a little slider on the left. I wonder what that does? It seems that (as vista is all vector icons and all) you can choose not only small or large icons, but 'any' size from small to HUGE. (We're talkin’ “My screen can show four icons at once” kinda big).

(Really) Neat feature 2: After playing with the icons for a bit. (“Look they're big. Ooh look they're small. Biiig. Widdle. Biiig... Weee” Ahem.) I right clicked on the ‘folder’ over on the left. (here again I don't like the look of that area, don't like the fact that there are no + symbols to tell if a folder had children... maybe you can turn this on somewhere?) Where is Search... Ctrl-F... no, that seems to try to execute a ‘crumb’ or something, which fails with an error and a tasty sounding *bung*. Where is the damn search. Well I'll be... There is is up there in the top right corner (just where it is in Explorer because I did not disable the search and install Google toolbar - trying the get the full Vista experience before I decide to replace everything with 3rd party tools.) And my doesn't it work well. Searching as I type... I like. Really. Search used to be bad on early XP, and then at some point it got totally fucked up (stupid search wizard, make me press back, sometimes I can't go back grr.) But this integrated search seems to work really well.

I like.

Tuesday, March 27, 2007

ASUS = ASUckS (for online software updates anyways)

One problem that I have with my new machine (other than not plugging in all of the power connectors at the start...) is that I am getting a μCode error on POST.

Seems like the BIOS needs to be updated for the latest Intel CPU stepping. Fine, no problem, I can do that.

Friday: Just go on over there to the ASUS support site... Hmm page not working. Saturday: Cool, page is up, search for P5B Deluxe, click on the WiFi edition... Click on downloads... hmm timeout. Saturday afternoon, Sunday: Nice, the downloads page is working now. Find the latest BIOS, there, download from USA - nope timeout, Global - instant timeout, Europe? - nada, China, Japan? - nope and no. Grr. Today: Yeah hay! It works... Well... from the Europe link anyways... But they (6.6MB, 9.6MB, 4.3MB) are downloading at 3.3KB/sec...

This is gonna take a while.

Gimme my gestures back!

Dammit.

Having installed Vista over the weekend I have to say that it does look kind of neat. I also have to say that I really fucking hate having to authorise every action two (or three!) times. The only way that I see to avoid this is to disable UAC after which Vista throws up it's hands and says “okay, no security for you!” and lets any application at any authorisation level do anything. Surely MS can do better than this? You mean to tell me there is no way to tell if a program execution or a file system change or any number of other things is initiated by a direct user interaction or by another running process? Damn.

If it is by a user interaction I should be able to say “You know what? I know what I am doing, if I double click on something I really, really (yes really) mean that I want to execute it.” “Yes I know that is a system file, yes I really want to delete it”. If it is the web browser or something trying the same trick, go ahead and warn me, but otherwise... stfu, ffs.

Worse, my favourite utility ever does not work on Vista. StrokeIt! Oh no! I need my mouse gestures. See, I usually use the mouse with my left hand, and as such ctrl-c ctrl-x etc are just a bit hard to do (without moving my hand from the mouse to the kb back to the mouse each time, and ctrl-c with the right hand is just out of the question), so I use mouse gestures. And let me tell you once you start with the gestures - you never go back. It is just so fast and natural that it really should be a system service. Dragging could really be considered the first ever gesture, it's just that no others followed after. Eg. I use drag up as copy, drag left as cut, drag down as paste. I have little squiggles that I use for inserting comments into source files etc.

I miss you StrokeIt, I hope the developers find the time to update for Vista (could be a mammoth task from what I have seen of the complexity of Vista’s API)