Fixed it (again)

A sort of follow-up to ‘Fixed it’ – Minor adjustments to the script I propably use the most. I now use iTerm2.app.

The script provides me with the following features:

#gives me a list of terminal profiles
% it list
#open a new iTerm session with the specified profile
% it <profile>
  1. #!/bin/bash
  2. #http://mkaz.com/ref/macosx/iterm.html
  3. #http://www.macosxhints.com/article.php?story=20070409141256538
  4. arg=$1;
  5. if [[$#” = “0” ]]; then
  6. echo “Usage: ‘it bookmarkname’ or ‘it list’” && exit 1
  7. elif [[ “$1” = “list” ]]; then
  8. defaults read ~/Library/Preferences/com.googlecode.iterm2|grep -e ‘\bName =‘|awk{$1=“”;$2=“”; print $0}|tr -d ‘;’
  9. else
  10. osascript <<ENDSCRIPT
  11. on run argv
  12.   tell application “iTerm”
  13.   activate
  14.   tell the current terminal
  15.   launch session “$1”
  16.   end tell
  17.   end tell
  18. end run
  19. ENDSCRIPT
  20. fi

I wonder if it should default to the default profile, so no arguments would just open a default terminal?

Module::Build 0.30

I was evaluating an issue with an older Module::Build when I fell over this in the Changes file of Module::Build:

0.30 – Thu Sep 25 20:57:36 2008

– First non-beta release since April 2007. In the meantime, Sarkozy
became president of France, the 35W bridge fell in Minneapolis,
Phelps won a lot of gold, a new tribe of indigenous people was
discovered in the Amazon, and Bob Barker stopped doing The Price Is
Right. As of this moment though, the U.S. economy still hasn’t
collapsed completely.

Fixed it

I am using iTerm on OSX. A nice alternative to the Terminal application delivered as part of the OS. well I use both happily anyway.

I fell of this script called ‘it’ at Mac OS X Hints, which I am using constantly. iTerm has been upgraded on several occasions since and I still use ‘it’.

At some point I cleaned up my bookmarks listing and to my surprise, ‘it’ was still showing old bookmarks. After brief googling I found out that the resource file had changed it’s name from: iTerm.plist to: net.sourceforge.iTerm.plist.

So I changed the script a little and it worked again, check it out if you are using iTerm.

  1. #!/bin/bash
  2. #http://www.macosxhints.com/article.php?story=20070409141256538
  3. arg=$1;
  4. if [[$#” = “0” ]]; then
  5. echo “Usage: ‘it bookmarkname’ or ‘it list’” && exit 1
  6. elif [[ “$1” = “list” ]]; then
  7. defaults read ~/Library/Preferences/net.sourceforge.iTerm|grep Name|awk{$1=“”;$2=“”; print $0}|tr -d ‘;’
  8. else
  9. osascript <<ENDSCRIPT
  10. on run argv
  11.   tell application “iTerm”
  12.   activate
  13.   tell the current terminal
  14.   launch session “$1”
  15.   end tell
  16.   end tell
  17. end run
  18. ENDSCRIPT
  19. fi

Nemid

Nemid is the big system to make it easier to be a citizen in Denmark.

So you can log in with a single ID and control all of your relations to the public sector and related. All in all a good idea (I am not going to discuss the technical details, which might beg to differ).

Anyway – it is nice when it works… but it is having it’s share of system hiccups.

nemlogin-2010-11-2-14-171.png
I have marked a little thing here that changes with every reload of the page indicating that an error happened.

Should we trust people who display debug information in production with all of the information relating to taxes, pension, banking etc.?

It would be so easy to obtain this information by other means.

Twitter fun

Sometimes tweets come in an order, where you somehow think that they are related. Should of course be read bottom up.what_are_you_waiting_4-2010-10-19-15-25.png

The next one is funny in Danish. It is one of those where a nick means something unintended, but funny in another language.

balletrusse-2010-10-19-15-25.png

Nike+ GPS app for iPhone

Not long ago Nike launched a new app for the iPhone to integrate with Nike+ their social site for runners.

The app looked very promising and it was only $2.99. The app utilizes the built in GPS, so you need to have a newer iPhone like 3 GS or 4.

The app has some really cool features like route maps, including a pace indicator on the map, visualized as a heat map.

It has customizable spoken feedback something the Nike+ app from Apple does not have.

In general the application holds a lot of potential and it is most certainly a welcome application comparing to the Apple application, which holds only back functionality.

The only major drawback, which is a bug with actually kills the app totally and makes it useless is it ability to synch with Nike+, which does not work. So I posted to the Nike+ forums requesting assistance.

If you look at the thread a lot of people was experiencing the issue, no particular pattern standing out.

A post to the forum about changing the clock from 12 hour to 24 hour representation got me thinking.

Being a computer programmer myself, I often see that bugs are related to one of the 3 E’s

  • Execution
  • Environment
  • Encoding

In this case it would fall under the encoding category. What encoding covers all issue related to expectations and assumptions about data and it’s representation. I am not going to bore you with the details, but it is a beautiful example I am going to use for a presentation on application testing tomorrow, when I am doing a presentation for some fellow software developers.

Please note the 3Es is a term I am using, it is definition work in progress, so it is not a common term.

So I changed my International settings to ‘United States’ instead of ‘Denmark’ and it worked (post about it in the forum)

Here follows a graphical version of the guide to make the change.

Select settings on your iPhone:

IMG_0016-2010-09-27-10-09.png

Select ‘General’:

IMG_0017-2010-09-27-10-09.png

Select ‘International’:

IMG_0018-2010-09-27-10-09.png

Your ‘Region Format’ is probably something else. If it already says ‘United States’ you might have another issue, which is not fixed by this approach.

IMG_0019-2010-09-27-10-09.png

Changed to the ‘United States’ and go back to the Nike+ GPS app and try to synchronize again. It might takes several sync if you have more than one run, if seems to be in batches in the vicinity of 5 or so.
IMG_0020-2010-09-27-10-09.png

Happy sync’ing…

When your task count reaches the number of the beast

My favorite filters in Jira today showed me that Everything is 666

jira666-2010-09-3-14-11.png
I wonder what this means… should I stop working or should I work more?

[rt.cpan.org #60678] 1. 2010 UN Report Highlights Falun Gong Persecution in China

I got this weird mail in RT queue for Games::Bingo.

First I thought it was spam, but then I read it and it struck me. Could somebody be reading these mails using RT as a proxy?

You locate some newsletter you want to receive, you provide it with the email address of a RT queue, which is public available, like all of the CPAN queues.

You sit back and wait and at some point the mail arrives and you can read it, without anybody tracing your email. Of course you there is the problem of providing the RT queue email to the subscription/sender, but I guess there are ways around that like using kiosk machines etc.

Or perhaps it is just spam? and I am being paranoid

Staden

I was filling in a form on a website yesterday and when I picked Denmark as my country I was presented with a list of cities/regions in Denmark.

staden-2010-08-27-14-121.png

The one I have marked ‘Staden Kobenhavn’ is a bit funny in that sense that, staden is what we normally call Freetown Christiania… how would have imagined it had it’s own pick in a drop-down.

Perl::Critic and Subversion, part 2

I tried to spark some debate in relation to my blog post on Perl::Critic and Subversion.

Only a few people responded, but at least it was some very good responses. Clearly one of these two-camps discussions, but the positive thing is that both camps have valid arguments and this is good since then people evaluating the practice if using Perl::Critic in pre-commit hooks can weigh these against each other and try to map them on to their local organization and practices.

As Jefffrey Thalhammer formulates it:

Teams should use Perl-Critic in whatever manner best suits their collective values, abilities, and priorities.

Pros:

- Strict control of code base
- Enforcing of coding guidelines for common code base

Cons:

- Latency in productivity
- Redtape over productivity

Both camps can however agree on several aspects are good practices, such as:

- Use of version control
- Unit-testing
- Continuous integration (CI)

And of course that static analysis is a good thing, when used properly.

This does not seem as many arguments, but many of the arguments in this debate are more or less related to the general use of static code analysis and do therefor not weigh in as arguments for or against the configuration of a pre-commit hook.

Ovid gave some marvelous input and then disregarded the whole debate as silly, saying that the pre-commit hook should assist the developer in making the right judgment, so he or she could choose to or not to commit.

From Ovids comment I do however deduct a very interesting aspect of programming and that is that programming is a very subjective activity and different developers would probably be able to implement the same functionality in very different ways, rendering different results when subjected to static code analysis.

I have passed on Ovid’s very pragmatic approach to Alexander, who’s CPAN contribution sparked the whole thing. And one of the more important things we can all agree on and that is the tools must be flexible enough to accommodate all camps. Perl::Critic is such a tool, so a pre-commit hook should be implemented in the same spirit.

The whole discussion seems to be leaning on the discussion on what quality really is, since this definition does seem to make the foundation for use of static analysis. This is again a very subjective discussion, which probably have even more camps, so we better not start a flame war about that.

All in all we can agree not to agree, so in regards to Jeffrey’s quote above I think we can conclude that the tools are there, put them to good use in the way, which makes the most sense in your situation.

Please feel free to chip in if you have an opinion on static analysis used in pre-commit hooks for SCMs.