Log in

No account? Create an account
Shevek's Journal [entries|friends|calendar]

[ website | Anarres ]
[ userinfo | livejournal userinfo ]
[ calendar | livejournal calendar ]

[23 Aug 2032|12:00am]
Write here anything you like. All replies to this entry will be screened. Please leave contact details if you want me to reply without unscreening your comment.

I can't always find the link between an LJ name and a person I might have met, so if you friend me, please do introduce yourself.

If I haven't added you on LinkedIn/Dopplr/Facebook/etc, it's not personal - I haven't added anyone else either, and messages sent to me via those services are ignored. One social network is plenty, and this is it.
16 comments|post comment

[06 Mar 2012|06:06pm]
I have yet to read a Java vs python comparison which was written by anyone with any serious enterprise development experience.

If enterprises were all writing hello world all the time, perhaps python would be the answer.

But it isn't. We are writing serious enterprise applications which need things like the existence of a debugger, syntax checking, data validation, threading, and so forth actually matter.

Python can read a file in one line: f.read(). Java can read and VALIDATE it in two. This matters.

An error which you weren't forced to handle isn't an error which won't happen. It will happen anyway. Your program will crash.
7 comments|post comment

[28 Feb 2012|01:04am]
Today I was browsing my screenshots, and I found that I had failed the UK citizenship test. I took it again, just for fun, and failed with flying colours for not knowing that the UK is 4.7% Muslim. Or was it 0.8%? But I still know what Hansard is.

Then I took the US citizenship test, an entirely lighter form of entertainment, and which I passed, despite claiming that the "Rule of Law" means that "Everybody must follow the law, except the government."

If you do the US one, I suggest selecting "50 questions" and reload it a few times, it's amusing. Here are some choice selections.

6) Why do some states have more Representatives than other states?
A. because they have more rich people

14) What is one reason colonists came to America?
B. look for the Great Canyon

16) Name one American Indian tribe in the United States.
D. Macedonian

17) Who lived in America before the Europeans arrived?
A. Deer Hunters
B. Asians
C. American Indians
D. Christians
[I won't even choose.]

25) What major event happened on September 11, 2001, in the United States?
A. American army attacked Iraq

29) What happened at the Constitutional Convention?
C. The meeting was interrupted by British Army.

34) What does the Constitution do?
A. lets women drive a car

49) What did the Declaration of Independence do?
C. announced the name of our country
6 comments|post comment

[26 Feb 2012|12:04am]
Nobody in the USA has heard of Flanders and Swann. If the country had an editor, I would write to him to express my unmitigated disgust.
17 comments|post comment

[21 Feb 2012|12:56am]
I was wrong about the Gideon Bible: apparently this is a high class brothel. It also supplies, according to this menu (I kid you not) the Bhagavad Gita, the Book of Mormon, Eight Noble Truths (Buddhism), the King James Bible, the Koran, the New American Bible, Tao Te Ching, the Torah, or for the particularly desperate, a copy of "What Is Scientology".

I might have to take a picture of the "Spiritual Menu" in the morning or nobody will believe me.
8 comments|post comment

[20 Feb 2012|11:24pm]
I am staying in a hotel which has a definite air of brothel. The heavy pink strip lighting, and black-suited bouncers in place of desk staff were the first hint, but I think it was the courtesy vibrator on the nightstand which really gave it away.

No Gideon Bible.
2 comments|post comment

[31 Jan 2012|01:15am]
I'm not all that good at looking after myself. I finally got a warmer blanket and now I'm sleeping a lot better. Of course I should have done this ages ago.
3 comments|post comment

[28 Jan 2012|03:46pm]
In a continued attempt to reorganize my electronic life a little, I have started uplodaing my more useful projects to https://github.com/shevek

I'm still open to suggestions about social networking. I'm inclined to regard G+ as a sorry debacle and facebook as a no-go zone. I hope this isn't the modern compromise we have to make.
16 comments|post comment

[26 Jan 2012|12:08am]
On my last trip to England, the substantive changes were that the pick-a-teddy machines now contain angry birds, and Sainsbury's sells newspapers in Polish. Otherwise, much the same.
6 comments|post comment

[21 Aug 2011|12:28am]
If according to the BBC and/or OED, "friend has been redefined by the Facebook generation to simply mean someone you regularly interact with online" then which word can we use for the concept we used to term "friend"? Or has the concept become obsolete?
6 comments|post comment

[17 Aug 2011|11:56pm]
In all this discussion of inequality, nobody has mentioned "The Fortune at the Bottom of the Pyramid", which I believe is a proximate cause of much of that inequality.
3 comments|post comment

[14 Aug 2011|11:02pm]
Why is David Cameron promising a social fightback? What has the government got to do with it? It's spent years making itself irrelevant in social issues, and by the policy of "big society" in governmental issues too. Now it wants "in"? I find this dubious.
3 comments|post comment

[02 Aug 2011|06:45pm]
My talk at the weekend was titled "How to get fired with the Java type system." Making good use tricks like this will either make you the master programmer of your organization, or get you fired. I am not responsible.


The idea was to teach people three or four simple things which they can all do, using Java as an example of a very restrictive, simple, relatively inextensible language. There is so much power in the basic type system to prove things which people normally only check at runtime that I do wonder sometimes...

I also have a mild suspicion that "get fired" means "all fired up" over here, rather than "unemployed" fired, which was my intent.

Edit: Since slideshare is causing troubles, here is the same PDF: http://www.anarres.org/academic/2011-shdh45.5/talk.pdf
6 comments|post comment

[20 Jul 2011|10:43am]
[Ed: I have been dealing with some very poor code recently; my tone in this post reflects that.]

The Java type system is a wonderful thing when used correctly. It lets you make very powerful statements about the intent of your code, and the compiler will guarantee them correct, or reject them as incorrect. However, it also lets you do arbitrary casts and use erasure, which most people do, while simultaneously cursing that same erasure, frequently for reasons they don't understand.

So, here is a pattern which will help you to achieve type safety in a situation where many (most?) people will use erasure or unsafe casts:

public interface Target<T> {
public T get();
public void process(T value);

public class Handler {
public void handle(Target<?> t) { ... }

Now, how do we call t.process(t.get()) safely? t.get() returns a capture of ?, which can only be assigned to Object. But Object cannot be passed to t.process(). Here is the answer: We write an auxiliary private method within which we use a temporary type variable to capture the ?.

private static <T> void _handle(Target<T> t) {
T value = t.get();

Now, in some very limited circumstances (possibly even this one, since I wrote this code cold), the Java compiler can work out that the ? has been captured, and will perform this type variable substitution automatically, but there are enough circumstances where this trick is useful that I found it worth posting.

A more complex example might be trying to call "new Outer(inner)" where Inner<? extends Foo> and Outer<? extends Foo>, given an Inner<?>. Watch for situations where all you need is to explicitly capture a type variable, and capture it.
post comment

[04 Jun 2011|01:50pm]
I was at Microsoft Silicon Valley Campus the other week, and they asked me to write my own name badge, so I wrote "Anonymous" in big, clear letters. The goon on the door clearly didn't care what my name badge said, as long as I was wearing one. Later, however, was a different story. One conversation went like this:

Him: "Are you anonymous?"
Me: "We are all anonymous."
Slightly uncomfortable pause.
Him: "Did you know that there is a group called anonymous?"
Me, confidently: "Yes, I am well aware of that."
Him: *longer pause, sidles away with a worried look*

A week or two later, I find myself in Berlin. The hotel described this as a "double room for single occupancy". I'm glad it's only that because it contains one bed, which is only 2'6" wide, which is narrower than many Berliners on their own, never mind in pairs.

No jokes about donuts please, it's been done to death.

In other news, I MIGHT be in Eindhoven at the weekend, and will be in England for a couple of weeks after that, leaving on the 26th. I intend to be sociable, if you all offer opportunities.
13 comments|post comment

[03 Mar 2011|11:11pm]
I have now watched many films, and come to the conclusion that in any fight, one should kill the people with the more complicated hats first.
4 comments|post comment

[23 Feb 2011|07:16pm]
Yesterday was my first day back at work after two and a half weeks of fairly severe illness. I only lasted about an hour and a half, but today I managed most of the day. I'm now half asleep, and hoping to be back to it tomorrow.

I remember the doctor's somewhat worried face when she came back in and said "It's not flu." I think we converged on [hand,] foot and mouth disease. It's common here, but not in England. Well. Mooooooooo.
21 comments|post comment

[26 Jan 2011|09:04pm]
We are watching Snatch, with the subtitles for the benefit of the Americans.
11 comments|post comment

[18 Jan 2011|01:54am]
I have been reading the California Drivers' Manual. It is the California equivalent of the Highway Code, and it scares the living daylights out of me. It is available for free on the internet. It is hard to condense the horror to one or two gems, so I offer the following extended list.

p.51 Do not use your horn [...] if a driver is going slowly, and you want him or her to drive faster. The driver may be intoxicated.

p.49 Do not rely on traffic signals. Some drivers do not obey traffic signals.

p.52 Be very careful when using flares. They may cause fires, [Nuh-uh!]

p.53 Persons who present dangers are:
- Distracted people, such as: drivers talking on cell phones.
- Confused people, such as: tourists.

p.68 Never turn your vehicle’s ignition to the “lock” position while it is still in motion or the steering will lock and you will lose control of your vehicle.

p.63 Avoid the following driving behaviors: talking on a cell phone or text messaging, and reading the newspaper, etc.

p.70 Do not shoot firearms on a highway or at traffic signs.

p.70 Do not tow anyone who is riding [...] on skis.

p.73 To keep from getting tired on a long trip, try chewing gum.

p.50 [At night] Do not drive using only your parking lights.

p.49 At 35 mph, it takes about 210 feet to react and bring the vehicle to a complete stop. [UK Highway Code figures say 105ft, perhaps this is a comment on California's terrible roads.]

p.48 Avoid driving directly alongside other vehicles [..]. Another driver might crowd your lane or change lanes without looking and crash into you.

p.33 Before changing lanes, signal, look in all your mirrors, [...] [Note order: Signal, mirror, maneuver, right?]. Also p.54: "signal, look, ..."

p.82 In a bus, taxi, camper, or motor home, the law does not apply to non-driving passengers. [I clearly need to find the definition of "passenger" in American english]

p.70 Do not allow anyone to ride in the trunk of your vehicle. Convictions will result in penalties for both the driver and the person(s) riding in the trunk. [Neat, you can get fined for being kidnapped.]

It is also hard to summarize the sense that it is assumed that all drivers will be exceeding the speed limit, treat mirrors as an optional afterthought, and will have one or more speeding and/or DUI convictions. So I leave you to consider the fact not that the following is true, but that it is necessary to document it:

p.58 You must obey any traffic direction, order, or signal by a traffic or police officer or a fire fighter even if it conflicts with existing signs, signals, or laws. [Everybody has exceptions to everything. It's how political power is measured.]
59 comments|post comment

[25 Dec 2010|08:56pm]
For anybody who needs a little help, or wants a good laugh, I made this poll. I'm quite curious to see what people's ranking of "badness" is (maybe overall ranking in a comment?) and I want some fun.

Mom, I'm ...

... gay.
... pregnant.
... gay and pregnant.
... in jail.
... in the army.
... dropping out of college.
... becoming a girl/boy/other.
... in a car crash, in your car.
... dating a Montague. (Or Capulet, etc as appropriate.)

(pause) No, it's OK, I'm only ...

... gay.
... pregnant.
... in jail.
... in the army.
... dropping out of college.
... becoming a girl/boy/other.
... in a car crash, in your car.
... dating a Montague. (Or as above.)

Did I miss anything important?

I wish you could answer a poll multiple times.
5 comments|post comment

[ viewing | most recent entries ]
[ go | earlier ]