Adjust first names with AppleScript in an Address Book Group

Jeroen | May 2, 2008 1:47 | 1:47

At my company the sysadmins provide a little service when putting all phone numbers of colleagues on my cell phone. Every colleague is prefixed with a dot. My car’s carkit though lists all numbers grouped by alphabet. So this leads to like a couple hundred entries grouped under a single dot. Fortunatly I can sync my phone to my Apple’s Address Book. When it’s in there, the following little AppleScript allows me to change all first names starting with a dot to something without a dot.

First I transfer all dot-prefixed entries to a special group, then this script runs the people in that group through a little check and adjustment when needed.

(The syntax of AppleScript is a real pain.)


on lstripString(theText, trimString)
	set x to count trimString
	try
		repeat while theText begins with the trimString
			set theText to characters (x + 1) thru -1 of theText as text
		end repeat
	on error
		return ""
	end try
	return theText
end lstripString

tell application "Address Book"
	set infoSupporters to people of group "InfoSupport"
	repeat with p in infoSupporters
		if first name of p starts with "." then
			set new_first_name to my lstripString(first name of p, ".")
			set first name of p to new_first_name
		end if
	end repeat

	display dialog "Done!"
end tell

J-Spring 2008 in review

Jeroen | April 20, 2008 22:46 | 22:46

Eclipse University banner.Last week I presented at J-Spring 2008. It was one of the first times I presented to such a large group of unknowns. The room wasn’t packed, but still quite full. Afterwards I heard the head count was over 70 people attending my session. Good to see that many people interested in ANTLR. I was in the before last round of sessions and not everyone of the 1000 people attending was on the premises anymore. So all in all. I think I did good by at least attracting 10% of those people still there.

My presentation went very smooth. In 45 minutes I crammed 42 slides, 3 short demo’s and a 5 minute Q&A.

I did fumble on one single thing.

ANTLR does allow more than 2 nodes with the same root node in a tree.

It’s all supported in the tree grammar syntax. The grammar I demoed was indeed binary, I thought the question was about that fact, while in hindsight I realised the person was asking if ANTLR support AST’s with more than 2 child nodes on a node.

J-Spring, ready or not, here I come…

Jeroen | April 16, 2008 0:19 | 0:19

I’ve just put some final touches to a presentation and demo I’m giving on ANTLR v3. On april 16th I will be presenting at the Dutch NL-JUG J-Spring conference. It’s a Dutch conference focussed on all things Java.

Hope to see you there, and if not, my employer is probably going to post my slides very soon somewhere linked of of this page.

ANTLR J-Spring session approved

Jeroen | March 3, 2008 20:48 | 20:48

I recently got word from the NL-JUG that they have granted me a presentation slot based on my session proposal regarding ANTLR.

I think it will be a tricky session to pull of properly. I’ll have to make a guess about how much my audience will know about grammar definition, parsers and compilers. But hey, that challenge is part of the reason I made my session proposal.

More details will follow.

Looking into integrating ANTLR v3 with javax.script

Jeroen | February 13, 2008 0:09 | 0:09

I’ve been looking into integrating ANTLR v3 with javax.script. It should all be pretty simple, but I have not implemented a simple mock-up yet to test my conclusions.

Then I remembered a ex-colleague of mine who wrote a Dutch article about integrating a JavaCC generated language with javax.script.

Dutch article about JavaCC and javax.script

Technically that does not look that hard at all.

The hardest thing I’m running into right now is outlining a subject as a little case study. I am also wondering about what problems might arise when trying to integrate a generated parser within the confines of an application. I can think up a number of ways to connect a parser to an application’s in memory model. Should I try to detail logic in my parser grammar or should I unlock my memory model with a bit of dedicated API for the parser as to keep inline Java action blocks to a minimum.

Interesting course offer by InfoSupport

Jeroen | February 4, 2008 23:08 | 23:08

One in the shameless plug department.

My employer InfoSupport will be offering a very interesting course from the 21st till the 24th of April.

It’ll be a very nice course presented by one of our top trainers. If there are seats remaining I, I’ll sign up for this one. But I’m guessing that the available seats will fill up rather quick. So hurry ad head on over to Java Spring Class 2008 and sign up.

Some cutting and pasting from the above link:

*snip*

Course outline
Get your hands on JSF, AJAX, EJB 3.0 and Web Beans.
This course provides you with a fair knowledge of Java Server Faces technology and also shows how to combine this technology with AJAX. The ins and outs of EJB 3 Simplified Components and the new persistence API are presented to you. The latest developments on Web Beans, a JSR based upon the JBoss SEAM application framework, are also treated. This specification enables the usage of EJB 3 components as JSF managed beans. All topics are put into practice in multiple hands-on exercises.

This course also looks ahead and presents you the plans for the future.

Course content

  • Java Server Faces and Ajax
  • Session Beans 3.0
  • What is new in Session Beans 3.1
  • Java Persistence API 1.0
  • What is new in Java Persistence API 2.0
  • Tips and tricks for EJB 3.0
  • SEAM
  • Web Beans

Eclipse article published

Jeroen | September 19, 2007 14:03 | 14:03

Today I got word from Ron that the Eclipse article about the Dutch railways has been published.

Take a look overhere for more info: http://www.eclipse.org/community/ Here is a direct link to the PDF file containing the article.

Things to do…

Jeroen | July 24, 2007 21:48 | 21:48

There is a lot of stuff going on here in the second half of this year:

  • There’s probably a guest lecture coming up for a shark pool of students. :p
  • I’m going to be supervising a graduate student for my employer.
  • From what I understand there will be counseling a group of second and third year student in customer role for nine weeks as well.
  • There’s something interesting about Eclipse Europa around the corner to in a few months.
  • Still working on my own education, I really need to give that a bit of a kicker.
  • Not to mention the fact that there is also my latest contract which is lots of fun, but also very intense right now. Since I have to get a grasp at the problem domain and the existing implementation at the same time. But we’re getting there.
  • I’ve heard something about a code review coming up for another customer which will require some effort on my part.
  • Let’s not forget the request my employer has made about certification. They really would like me to get started on a java business components certification followed by a java architect certification.
  • Not to mention the things I do besides work. There are lots of things happening there as well.

When to plan my vacation… Oh man… I better get started…

And now… now I’m working from my couch.

Jeroen | July 13, 2007 13:23 | 13:23

While I’m at it. I’m working from my couch right now. So far it’s great. No distractions at all. I can play the music I like all day.

One disadvantage… Nobody interupts me, so I must be carefull to take my breaks every now and then. (Writing this post is one of them.)

So thumbs up over here… (While scratching my head.)

Couch potatoo
I just noticed, I am wearing the same t-shirt for three days. Now THAT… is bad.

My first hotel night for a contract… ever!!

Jeroen | July 11, 2007 19:11 | 19:11

For a new contract I am going to stay the night in a hotel every now and then. The job is kinda far from home for me. So the client and my employer agreed to let me stay in a hotel and let me work from home. Seems reasonable to me. (Don’t worry my employer discussed this with me properly.) Also there is a matter of Java Swing technology and oh something with the latest and greatest Java version 6 (update 2 already?).

Now why on earth would I stay in a hotel for work? Well there are a number of advantages. First: You work crazy hours a few days because there is nothing better to do. Second: You can take this time back at the end of the week where it’s more precious to me to actually have those hours for myself. Especially next week, I hope.

The room is rather small. Doesn’t have a bath tub, only a shower and a toilet. But!! There is free wireless… Fast free wireless. So I am not complaining at all. I brought enough stuff to do… Work and university related. The important thing is to keep myself busy enough so I don’t start feeling lonely or cramped up in here.

To give you a sense of the size where I am sitting now:

Spread eagle in a hotel room.

Just so you know I am enjoying myself here:

Kowabunga!!