Spurious Logic

Older Posts »

godammit

You know what’s worse than getting a defect fix back in your queue?

Getting a defect fix back in your queue, for the second time, when you were very confident of the previous fixes (in fact even proud that you managed to crack that tough problem) and the only place that the problem is presenting is on QA’s side.

I never, ever, want to be the dev who seriously says ‘but it works on my machine’ but when I’ve tried from team mates machines, remote desktopped into QA boxes and I still can’t reproduce the problem it makes me want to pull my hair out.

My first instinct as a developer is to say “they’re doing something wrong” but the fact is that if QA say’s it’s slow for them, well then, it’s slow for them.

It doesn’t help that as a performance issue there’s a whole host of potential other issues which could also be impacting on all of this from computer hardware, anti-virus or other programs to network latency.

Oy Vey.

>edit – 2 weeks later<  
To paraphrase Homer Simpson; "JavaScript! The cause of, and solution to, all of life's problems."
(more…)

Listen to the music

As I’ve said before I’m a fairly long time user of eMusic but this has come to an end.

It’s a combination of a couple of different factors. I haven’t found compelling music with them in the last six months or so and their selection seem to be branching off into more mainstream and conversely, more niche music. Any time I log in now it’s punting crappy indie-lite bands or amorphous musical noodlings. Neither of which I mind too much but I’m not happy paying a monthly subscription on the off chance I’ll actually find something I like. Also, right now, I need that monthly subscription.

So off into the wilds of yon internet I travelled to find a decent, legal, music supplier. Of course there’s always youTube but honestly you spend more time searching for and queueing up music than you do listening. And then halfway through you get rick-rolled.

Next on the list is grooveshark.com. Basically users upload music and anyone can listen to it. It works the same as youTube except that there is some tagging of tracks and organization of albums. It is Ad-supported  which I didn’t realise this as I’m running ad-block. Legality aside, my problems with this is similar as with youTube. i.e. You spend more time looking for albums than you do listening. In addition to that, there are often duplicate tracks in albums or mis-tagged tracks. Which leads to all sort of confusion. Though if I want to listen to any chart or popular rap stuff, this the the place to go.

I really, really want to like bandcamp.com, but it just doesn’t do it for me. It’s got the same problem as jameundo.com in that there’s no editorial control. Anyone can put their stuff up there so you get professional musicians rubbing shoulders with someone struggling to play twinkle twinkle.

Looking at my list of complaints, the problem is not finding music. It’s finding the music I want to hear. eMusic did that reasonably well until the signal to noise ratio dropped.

 

Image from wikimedia commons

crunchcrunchcrunch

Well, it’s not quite 80 hour work weeks but a project is getting near code complete for the first release so between that additional pressure and parenting time at home and trying to buy a house there’s been no time for posts.

Hopefully I will be back posting weekly by the end of the month, but probably not before that.

Yes, it is yet another why I’m not posting post.

ka-Pow!!!

Take that! unnecessary table variable! Removed by the power of common table expressions!

I have a table in the form:

ID Seller Description
1 Alice widget1
2 Alice widget2
3 Bob widget1
4 Bob widget3
5 Bob widget4

But what I really need is a table with an extra column with a sales id for each seller, like this;

ID Seller Sales Id Description
1 Alice 1 widget1
2 Alice 2 widget2
3 Bob 1 widget1
4 Bob 2 widget3
5 Bob 3 widget4

In a past life I would have written the alter script to add in the column, with an empty field (null or -1); created a temporary table to iterate over every ‘Alice’ sale and set those values, followed by those for ‘Bob’. And this is what you get when you’re thinking procedurally. Using Common Table Expressions and a Partition makes this far more efficient (at the cost of more complicated code).

WITH cte (ID, seller, sales_id)
AS
   (
      SELECT
         ID,
         seller,
         ROW_NUMBER() OVER (PARTITION BY ID ORDER BY ID)
      FROM sales WITH (NOLOCK)
   )
UPDATE S
SET S.sales_id = C.Pattern_ID
FROM sales S
INNER JOIN cte C
   ON S.ID = C.ID
AND S.seller = C.seller

And hey! a legitimate reason to actually use a <table> on a webpage without designers shaking their goate-ed heads at my foolishness.

Mental Block

Following on from my gearshift analogy yesterday, my personal programming mental block is the syntax of the switch statement. I know how it works, I know what it does, I just can’t get the syntax right without looking it up. Regardless of the programming language. Java, C# or TSQL. I get as far as CASE … before I have to research it. It’s a pain in the ass but I just can’t get it to stick and I don’t use it often enough to memorise it properly. Ah well.

Just for reference, in TSQL this is what you want to be doing:

SELECT
   CASE tab1.col_name
      WHEN 1 THEN 'one'
      WHEN 2 THEN 'two'
END
FROM table1 tab1

Yes it’s trivial, but it just won’t stick. Maybe it will now.

mental gearshift

And this is what happens if you’re doing SQL and then get shunted up into procedural code and then back down again.

In C#:

  • you have variable names like local_Variable_Name instead of localVariableName.
  • The fact that you can call methods without prefixing the name with EXEC seems… just, wrong.

In TSQL

  • you keep on forgetting to use SET before variable assignment.
  • the fundamental set based versus procedural programming approaches which means that fast running procedures become very, very slow when you get them wrong.

oy vey. The trials of a generalist.

<meta> Having great big images and cleverly formatted text is great for show and all but it does mean that I’m not posting as much as I’d like, so, I’m going to try and set up a separate Articles section for longer/better posts and have a the usual blog style on the front page. </meta>

image from wikimedia commons

How deep does the rabbit hole go?

I find myself slipping more and more into extreme geekery.

This week I’ve:

  1. started obsessing about getting myself a new mechanical pencil.
    Currently the front runners are a straight replacement of what I currently have or this. I’m thinking that the MUJI pencil is more practical, cheaper and I prefer it’s clean design. I’ve had my current one for around 2 years at the moment and it’s been perfect for notes and sketches
  2. got really excited about a project here at work dealing with translating arbitrary input strings out into four distinct columns using a set of user defined rules. Taking a project from requirements all the way through design, feedback to implementation, testing and deployment is something I haven’t done in a while and it makes a very nice break from maintenance work.
  3. performed binary to digital conversion in my head for fun…

Image from : By John Tenniel (Alice in Wonderland) [Public domain], via Wikimedia Commons

New years resolution

Well, 3rd week of January resolution. I’m going to track my time and the task I work on in the office as accurately and honestly as I can.

Currently we’ve got a very rough cut timetable system where everyone fills in their time after the fact using very broad work categories. 99% of the time this works absolutely fine. Last week we had a request to give a total amount of time for a particular project. Of course no-one on the team was tracking this one project distinct from the others so the best we could do was dead reckoning. It’s definitely wrong but it should at least be in the right ball park.

A co-worker turned me on to Grindstone which is a fine granularity recording mechanism for windows. You set up tasks, hit the start button and away you go. At the end of the day/week you can get a bunch of nice reports on the time you spent on the different task.

The only difficult bit is to be honest with it. That time you spend on youtube? You’ll be tempted to mark it as “working on defect” but you’re only tricking yourself.

I would hesitate to recommend it for project managers to enforce it on your employees because it rely’s entirely on the honesty of your staff (which shouldn’t really be a problem) but more than that, it gives the developers a very big brother feeling. It’s not enjoyable working if there’s no wiggle room and if developers can’t even pretend they enjoy their jobs, then they won’t be very productive.

Image is taken from commons.wikimedia.org (resized and resampled)

Older Posts »