I’ve always been interested in Postgres – it never seemed to be quite as crazy as MySql, and since I’ve used Access (LoLWUT?), Ingres (party like it’s 1989), DB2 (meh), Oracle (and the difference between god and Larry Ellison is…), SQLite (awesome!), ESE (key-value FTW), SAPDB (why?), MySQL (how did this ever become popular?), different versions of SQL Server, and a few I don’t quite recall at various times I thought I’d give it a try. Here are few gotchas that tripped me up, considering my primarily SQL Server background.
#1 The user-name in the connection string for the otherwise quite awesome looking npgsql seems to need to be lower-case. I created the login via SQL as PascalCase. When it showed up in the pgAdmin III tool it was all lower-case, so maybe it is Postgres’ fault…not sure.
#2 Database functions execute by default with the rights of the Invoker. You can change this with a little bit of extra stuff in the create function statement, by switching to SECURITY DEFINER instead of SECURITY INVOKER (the default). In the MS SQL Server world stored procedures (the closest analogue to Postgres functions) run with the security rights of the creator.
#3 When calling pg_get_serial_sequence to get the name of the sequence that is defined for a serial column I had to double-quote the name of the table like this, which I found slightly odd:
select * from pg_get_serial_sequence('"<table name>"', 'Id')
Otherwise all pretty cool and straightforward.
I recorded a version of the ‘Single Page Web Applications’ talk I did for DDD Brisbane 2012 and put it up on Vimeo. I know the audio is not fantastic, but I don’t have a very nice speaking voice anyway. If anyone has any feedback I’m keen to hear it.
DDD2012 from Joseph Cooney on Vimeo.
I recently decommissioned an old laptop, and salvaged 4GB of laptop ram out of it. Having no other good use to put this to, I wondered if my iTunes isolation mechanism (a very early Mac mini) might be able to be upgraded to Mountain Lion if it had enough ram – it was currently running snow leopard, had a dual-core CPU, all that seemed to be missing was and additional 2GB of RAM, exactly the same kind of RAM I’d just taken out of the decommissioned laptop.
Unfortunately early model mac minis weren’t built to be serviced anywhere outside of factories in china where they were also assembled. Step 1 involved prying open the case with a paint-scraper or similar device. Not having a paint scraper, and not wanting to wait until the effects of whisky wore off, and the realization that I was risking wrecking a good machine for no real gain dawned on me I pressed on with the most similar tool I had to hand – a barbie mate. The brushed aluminium case and the stainless steel sure looked good together.
It worked, after a fashion, and after several other harrowing steps the upgrade was complete. I turned it back on and the machine still worked, but unfortunately the upgrade to mountain lion was prevented by the lack of 64-bit BIOS (I believe – it was never able to boot into 64-bit mode, and I’m going to chalk that up as the cause). Oh well, at least iTunes has a bit more RAM to play with now.
I’ve upgraded to a more recent version of blogengine.net…
Which seems to have worked.
Things are pretty bad when your “we’re down” page is down. Twitter has been horribly slow for me for the last 2 days, so I’m not surprised.
For a while I’ve toyed around with the idea of programatically generating t-shirt ‘designs’ (and I use the word in the loosest possible sense) from one’s twitter feed. The mechanics I had in mind were something like this:
- You have a fetish for self-promotion, decide you want a coffee cup or t-shirt with some stuff from your twitter feed on it, and you aren’t too fussy about aesthetics.
- You tweet to @tweet2tshirt asking it to pretty please make you a t-shirt design.
- @tweet2tshirt tweets you back with a link to this item on cafe press, when it is done.
Which is pretty much how it works.
What do the ‘designs’ look like? I’m glad you asked. The short answer is ‘not very good’, and come in two varieties, incorporating your profile picture, some of your ‘greatest tweets’ and some images from your twitter feed. These get programatically combined into a gloriously large 2600 x something large PNG and uploaded to Cafe Press. Depending on what you’ve put on twitter the designs are going to look more or less crappy.
So a PNG like this becomes available as a cup, t-shirt, iPad cover etc.
Automating the publishing to cafe press has been by far the most problematic of all the steps. Yes, after working on this for a little while I really hate the site of my own face, and pictures of my friend’s faces.
If you’re a technologist reading the previous list of words – Transaction, Argument , Class, Message, Service, Agent and Method – each of those words probably had a special meaning to you. Certainly when I read them I can’t help but mentally pre-pending words like ‘distributed’, ‘atomic’, or ‘database’ to a word like Transaction. But as shocking as it may sound to technologists these are normal English-language words that have existed long before Babbage decided there were far too many errors in logarithmic tables, and have a broader meaning than the precise and narrow confines we choose to use them in. This is one of the things that makes communication between technical and non-technical people even harder than it should be, and woe betide any programmer working on a system who has one (or…shudder several) domain objects whose names collide with these words that software development has hijacked. “Oh, you’re working on an event planning system for school classes? Here’s your cyanide pill.”
It gets worse once you realise that many of our narrow definitions of words are kind of at odds with their real-world “pre-technology” definitions. Transactions have existed ever since the first chicken was exchanged for the first sack of wheat (or something like that), and yet technologists have chosen to define it (fairly narrowly) as a unit of work (usually atomic, consistent, isolated and durable) against a software system such as a relational database. Only infrequently during database transactions is the ‘exchange or transfer of goods, services, or funds’ recorded. And while technologists don’t think of transactions as being exclusively atomic, consistent, isolated and durable it is more-often-than-not the assumption that goes along with the word ‘transaction’, so much so that a special type of transaction, deemed a ‘long running transaction’ has been created, which much more closely aligns with the normal commercial and financial sense of a transaction. Similarly parent-child relationships (in the context of software development and modelling) are at odds with the commonly understood human reality. In software development a parent-child relationship is often described as:
each parent can have many children, but each child has only one parent
While programmers and data modellers may reproduce asexually, most humans would consider a child to typically have two biological parents, making discussions of ‘parent-child relationships’ with non-technologists fraught with misunderstanding.
Fortunately the first step to solving a problem is often realizing that you have one, and so by recognising that the words that we (as technologists) use have broader meaning outside of technology, and that the misunderstandings arising from these differences in meaning can be critical, we can begin to put in place strategies that can close the gap. I think each project should draw up a list of domain words and technology words if they don’t already have some kind of glossary. If there are any domain words clash with commonly used technology words then just top yourself now. Or agree to pre-pend a word that disambiguates – no more mentioning of ‘transaction’ – something is either a ‘financial transaction’ or a ‘database transaction’. Similarly the subject matter experts should probably look at a list of commonly used technology words (like the one I’ve created below) and see if these are synonyms for business terms, and whether this could also be a source for confusion.
All the good words were taken
While it is not unusual for specialisations to adopt jargon (the term ‘stress’ to a mechanical engineer means something quite different to the rest of us), software development is in the unenviable position of dealing with a lot of abstract concepts that require precise terms to describe them. In the same way that history and mythology are chopped up in a blender to serve as the raw materials for many Hollywood films so to do human languages get chopped up into pieces by programming language designers looking to create easily-readable natural syntax. Here is a rough list of words I came up with that I thought had a better-than-average chance of causing confusion between technologists and non-technologists. Feel free to use it as the basis for your own list to help drive out ambiguity on your project:
First, there was ILDASM, and it was good. Then there was Anakrino, and it was better. Then, there was Reflector and it seemed as if the world of .NET class browsing and decompilation had reached its zenith. From time to time I found something new to surprise and delight me. Reflector was fast, useful and showed a depth of features and progressive refinement that meant I never had to think twice about what tool to use for a .NET class browser (like the one in visual studio? You’ve got to be kidding!) Then red-gate bought reflector from Lutz (the original author) and I was a little un-easy. Red-Gate were (and are?) well regarded in the SQL Server tools space, and their head honcho Neil Davidson was often doing good things in the microISV community. Bugs started to creep in (like one time it perpetually wanted to update, and then crashed on update), and it tried to up-sell me to the ‘Pro’ version, with features I didn’t really think I needed. Then on February 2nd 2011 Red-Gate announced that reflector would no-longer be free. The developer reaction was as swift as it was vehement. To paraphrase a friend of mine (who was talking about timesheets at the time I think) it wasn’t so much the money that he objected to, but the lying. Some people say you can’t put a price on trust, but red-gate did – $35. Red-Gate had said quite clearly when they took over the reigns of reflector that they intended to continue to make it available for free, and had reneged on that commitment. There were some dissenting voices that pointed out that I spend more than $35 on coffee some days (which is completely untrue, the most I’ve ever spent on coffee in one day has got to be only about $30…totally fucking different).
I, like many other developers started canvassing around for a replacement to reflector. In the ensuing weeks a number of free and commercial applications were announced looking to step into the power vacuum left by reflector, many of them based on the excellent work done by the MONO project with their Cecil decompiler.
In no particular order we have:
and many others
Shortly afterwards red-gate reversed some of their decisions regarding reflector, but the damage had been done, the cat was out of the bag, wheels had been set in motion, and a million other clichés that you’d normally avoid like the plague meant that the whole house of cards was ready to fall like dominoes, or something like that.
ILSpy Goes Metro
In case you hadn’t guessed from the title I chose ILSpy, figuring that I was less likely to find myself in the same predicament I currently found myself in if I chose something that I could hack on myself. ILSpy works much like reflector does, and I was soon browsing inheritance hierarchies with glee, except for a few small UI warts that kind of annoyed me with ILSpy. No matter, I thought, I have the source code, I know C# and have some familiarity with WPF. I’m sure I can manage.
This is what the main-line official build of ILSpy looks like
One thing led to another, and this is now what my custom build of ILSpy looks like.
The great thing about ILSpy is, it is really easy to hack on. The other developers (which I’ve never spoken to or communicated with, so I’m basing this purely on the source code) seem more interested in building real features than adding UI accoutrements and pushing pixels (which is really my strong suit). Special thanks must go out to Paul Jenkins and his MahApps.Metro control templates (I see now that I should upgrade to 0.3). Thanks also to Derek Orr and Mike Wise for some UI suggestions, some of which I haven’t had time to implement yet. The Metro Design Language may not be to everyone’s tastes, and to those people I say “sod off”.
I know a thing or two about Microsoft, and have a complete and total physiological addiction to passing acquaintance with coffee. I was doppio disappointed when I spotted this item in the Microsoft store.
I’m prepared to look past the fact that the picture has been strangely taken with a weird reflection that makes the cup look striped when it is not, but I’m not prepared to forgive the fact that they got the molecular structure of caffeine wrong on the cup. Or is this part of an elaborate biochemical joke? The title of the item in the company store is “Caffeine Coffee Cup 11oz Chocolate” (emphasis added). Apart from the missing nitrogen (which could just be a syntax thing – my organic chemistry is a little rusty) this looks like Theobromine, the delightful xanthine alkaloid found in…chocolate. Either way they should change the advertising copy, which clearly says “the molecular formula for caffeine on the other”.