Archive for August, 2008

OpenJDK for Darwin

Friday, August 22nd, 2008

Landon Fuller has OpenJDK 7 binaries available for testing on Leopard.

Currently it only works for i386 boxes ( and possibly 64 bit machines also, ) at least until Zero works.

You will need to have freetype installed via MacPorts, and have X11.app installed and running if you are running any GUI apps.

Please report all bugs to the BSD porters mailing list.

So far, with the exception of a few GUI bits not drawing properly, it has worked really well.

Well done Landon ( and Kurt and all those other guys who have put in so much time into getting it to run on BSD. )

How to dance … Acid House edition

Monday, August 18th, 2008


http://www.next2friends.com/video/acid-house-dances-/MjhhZTczNTM0ZmRkNGY2YW

When animals attack … Orkney Great Skuas edition

Tuesday, August 12th, 2008

It’s been a while, but Aunty dishes up the goods …

A couple who became lost on hills on Orkney and were being attacked by birds had to be rescued.

The pair were lost for much of Monday at Hoy and were said to be cold, disorientated and frightened.

The woman had suffered an ankle injury, and they were being attacked by birds - Great Skuas - which were nesting in the area.

The Shetland Coastguard rescue helicopter found the couple and took them to safety.

“The couple were obviously quite distressed.

“They were suffering attacks from Great Skuas, which are aggressive birds which will dive bomb you if you approach their nests.

“Not only can this be extremely unnerving if you are not used to these animals, they can also cause some fairly serious injuries.”

Mac OSCON

Tuesday, August 12th, 2008

I was about to write about this myself, but I punched the words into Google first and out popped someone else who had noticed what I noticed, Apple’s presence at OSCON 2008 ….

How’s this for ironic: Microsoft is actually spending some sponsorship dollars here at OSCON (Open Source Conference) 2008, but Apple is stealing the show — without spending a dime. Here’s how.

when our resident blogger checked in with the OSCON registration desk today, he immediately noticed Microsoft’s logo on the conference bag. Lovely. It was right next to the Intel logo. Is this a “Wintel” event? Are we back in 1998? Somebody press Control+Alt+Delete

Yes, thats right, Micro$oft and Intel were the “Diamond Sponsors”, that mean they chipped in the most money, but neither of these companies are known as friends of open source, no matter how much they try to convince us otherwise, and they do. Both companies are blowing the open source trumpet, but intellectual property and lock in are still clubs that they wield against open source projects.

The “Platinum Sponsors” were Google and Sun, both of which have made great contributions to open source in their time, though Sun have been a little stingy with their documentation, I get the feeling that situation has changed, and they are no Intel by any means. Google, well you are completely dependent on them, so who cares, right ?

“Gold Sponsors” were BT, IBM, Yahoo and Zimbra, of note amongst them are IBM who used to be the old Micro$oft before they opened up their hardware specs for the IBM PC and got their arses kicked by the proprietary operating system that ran on it written by …. Micro$oft.

Meanwhile, Apple Corporate is nowhere to be seen at OSCON. Steve Jobs must be locked away, designing the next proprietary software platform tied to proprietary hardware and proprietary online Apple services.

Semi-proprietary operating system, you may well remember my dealings with Apple’s open source initiatives in the past, I still think I’m one of the few people who ever built Darwin from source back in the days of OpenDarwin, so I think I am more bitter, yet more realistic in my expectations of Apple, they have a fine OS, and do a fine job of it, but don’t expect them to not be a computer company rather than a software company ( and these days a music company. )

I also was a Mac user prior to MacOS X, and remember the transition period where Apple looked at every OS going, BeOS was a strong contender, Linux also was a strong contender, you guys remember MkLinux, right ? In the end they opted for Darwin, which was derived from NeXT’s NeXTSTEP OS, which in turn was derived from FreeBSD 3 and the Mach micro kernel.

Still, Apple is EVERYWHERE here at OSCON. The VAR Guy estimates that 20 percent to 35 percent of the crowd is carrying MacBooks or MacBook Pros. This strong connection between the open source industry and Apple is hardly surprising.

It seemed quite a bit more than 20 - 35 percent in reality, it was shocking just how many there were, everyone seemed to have one, it definitely seemed like the majority, Thinkpad users second and then a few micro laptops.

So here we are, at a big event where Microsoft is spending big marketing dollars — and Apple won the hearts and minds of attendees before they even arrived at OSCON.

Feeling under the weather

Monday, August 11th, 2008

Aunty

One stormy day in the summer of 2002, more than 100 extra people went to hospital in the UK with asthma symptoms compared to a normal day.

Heart attacks and strokes also increase a few days after a fall in temperature, because cold causes stress to the vascular system.

The lung disease chronic obstructive pulmonary disease (COPD), in which the bronchial tubes are damaged making it harder to breathe, is also affected by the weather.

a new service, launched by the Met Office in November last year, is already claiming success in keeping people well.

More than 8,000 patients in 189 practices across the UK have now signed up to use the ‘Healthy Outlook COPD Forecast Alert’ at a cost of just £18 per patient.

And the latest statistics show that there has been a 21% reduction in hospital admissions among those using the service, compared with the previous winter.

In practices not using the scheme, the fall was just 3%.

Holy Moses

Monday, August 11th, 2008

The word from Aunty is that Isaac Hayes has died …

Police were called after his wife found him unconscious next to a moving treadmill. He was taken to hospital, where he was pronounced dead.

The cause of death was not immediately known.

“Family members believe at this point it is a medical condition that might have led to his death,” a police spokesman said, adding Hayes was being treated for “a number of medical issues”.

Hayes suffered a stroke in 2006.

Isaac Hayes was no overnight success. An orphan from a poor background in rural Tennessee where he was raised by his maternal grandparents, he taught himself to play the piano, organ and saxophone.

His big break came in nearby Memphis when he signed for the Stax label as a session musician in 1964. Hayes took over keyboards from Booker T Jones, and his first paid sessions were with Otis Redding.

In partnership with songwriter David Porter, he was responsible for such classics as Sam and Dave’s Soul Man and Hold On I’m Coming.

His own work climaxed with his 1969 album Hot Buttered Soul, described by one critic as the most important black recording since James Brown’s Live at the Apollo.

It contained only four songs

Isaac Hayes became increasingly involved with humanitarian causes.

The 1990s saw him travel to the West African state of Ghana to shoot a video with Barry White. It was the first of many visits there during which he helped fund a school to help the spread of literacy.

He was made a Ghanaian king with the title Nene Katey Ocansey. In 2005, he married a Ghanaian woman - his fourth marriage. He has 12 children.

Aside from his charity work, he owned two restaurants and hosted a nightly five-hour radio show in Memphis.

But he’ll be best remembered as a man who influenced the course of black music.

Homeuro

Monday, August 11th, 2008

http://www.reuters.com/resources/r/?m=02&d=20080808&t=2&i=5500151&w=&r=2008-08-08T174555Z_01_L8727080_RTRUKOP_0_PICTURE0

Zoom Quilt

Friday, August 8th, 2008

No idea about this one, but I thought I would share it all the same.

Requires Flash, but not the latest greatest all singing all dancing version.

http://www.zoomquilt.org/

Blasting from the past

Tuesday, August 5th, 2008

Someone with far too much time on their hands has ported the original BASIC version of StarTrek to C#

May God have mercy on us all.

Ah, good old line-numbered BASIC. It’s all coming back to me now. Those line numbers were there to provide targets for GOTO and GOSUB statements. But, line numbers made editing a tad difficult. It was convention to enter in line numbers that were multiples of 10. That way, as you developed the program, you could go back and insert up to 9 additional statements in between existing lines without reworking all the GOTO/GOSUB references.

Oh bloody hell, I remember that, in fact I was thinking about it the other day, and not in a nostalgic way. Now machine code, thats nostalgia, though I guess line numbers were a natural successor in a way, like flexible addressing, hmmmm … I better stop or I’ll make it sound good.

due to the caps, I feel like the code is screaming at me

Ha ha, yeah …. things sure have changed …

Next, I had to decide what language to port it to. Staring at that BASIC code reminded me that C# brought goto back into the mainstream.

So it’s C#’s fault, eh ? I better move swiftly on before I start quoting Dijkstra, may God have mercy on us all.

Would it be possible to do an exact line-by-line port from BASIC to C#? Apparently so… and the result is some of the sickest code I’ve ever keyed into a computer. Want a comparison? Here’s a segment of BASIC code:


2950 PRINT "TORPEDO TRACK:"
2960 LET X=X+X[1]
2970 LET Y=Y+X[2]
2980 IF X<.5 OR X >= 8.5 OR Y<.5 OR Y >= 8.5 THEN 3420
2990 LET V[4]=X
2991 LET V[5]=Y
2992 GOSUB 9000
2993 PRINT
3020 IF A[INT(X+.5),INT(Y+.5)]#0 THEN 3080
3060 GOTO 2960
3080 IF A[INT(X+.5),INT(Y+.5)]#2 THEN 3230
3120 PRINT “*** KLINGON DESTROYED ***”
3130 LET P[1]=P[1]-1
3140 LET P[3]=P[3]-1
3150 IF P[3] <= 0 THEN 4040
3160 FOR I=1 TO 3
3170 IF INT(X+.5)#K[I,1] THEN 3190
3180 IF INT(Y+.5)=K[I,2] THEN 3200
3190 NEXT I
3200 LET K[I,3]=0
3210 GOTO 3370
3230 IF A[INT(X+.5),INT(Y+.5)]#4 THEN 3290
3270 PRINT "YOU CAN'T DESTROY STARS SILLY"
3280 GOTO 3420

And the C# version:


_2950: Console.WriteLine("TORPEDO TRACK:");
_2960: X = X + _X[1];
_2970: Y = Y + _X[2];
_2980: if (X < .5 || X >= 8.5 || Y < .5 || Y >= 8.5) goto _3420;
_2990: _V[4] = X;
_2991: _V[5] = Y;
_2992: _9000();
_2993: Console.WriteLine();
_3020: if (_A[(int)(X + .5), (int)(Y + .5)] != 0) goto _3080;
_3060: goto _2960;
_3080: if (_A[(int)(X + .5), (int)(Y + .5)] != 2) goto _3230;
_3120: Console.WriteLine(”*** KLINGON DESTROYED ***”);
_3130: _P[1] = _P[1] - 1;
_3140: _P[3] = _P[3] - 1;
_3150: if (_P[3] <= 0) goto _4040;
_3160: for(I = 1; I <= 3; I += 1) {
_3170: if ((int)(X + .5) != _K[(int)I, 1]) goto _3190;
_3180: if ((int)(Y + .5) == _K[(int)I, 2]) goto _3200;
_3190: ;} I = 3;
_3200: _K[(int)I, 3] = 0;
_3210: goto _3370;
_3230: if (_A[(int)(X + .5), (int)(Y + .5)] != 4) goto _3290;
_3270: Console.WriteLine("YOU CAN'T DESTROY STARS SILLY");
_3280: goto _3420;

To simulate line numbers, each line starts with a label consisting of an underscore followed by a number. That works fine for GOTO, but what about GOSUB? Examine line 2992. Subroutines were replaced with methods. That almost worked. In BASIC, you’re not forced to RETURN from subroutines. You can leave them via GOTO. That was used only in the case that the player is destroyed to send them back to the beginning of the program to start over. I replaced that GOTO with a return statement that passes a flag back to the caller. The caller inspects the flag and jumps back to the program start if need be. I also discovered that at one point, there is a GOTO that jumps into a FOR loop. C# won’t let you jump to a label in a sub-block of code. I transformed the FOR loop into a GOTO loop to make C# happy.

All the variables in the BASIC program, including the arrays, are real number type. However, in BASIC, an array and a scalar can share the same name; the interpreter is able to sort it all out. But, C# is less kind. To solve the problem, I prefixed array names with underscores. Also, arrays in BASIC are indexed from 1 instead of 0. To compensate, I increased the length of all arrays by 1. Index 0 is never used.

Well, BASIC to C# using labels is a fairly neat hack, but …. it is still painful. Notice the use of reals to compensate for the typing conversion. Whenever anyone goes on about the superiority of dynamic typing I always think of them as BASIC programmers.

Anyway pain aside, here comes the real gem and the reason for posting the article ….

Rewriting the game brought up an interesting aspect of the BASIC version. Targeting is done using polar coordinates, but you won’t find any trigonometric functions in the BASIC code. I assume the functions were unavailable. Instead, the angle is converted into a direction vector using different ratios that approximate the trigonometric functions. That means even if you worked out perfect targeting using trigonometry, when you entered in the angle, the actual trajectory will be slightly off. Nonetheless, it’s a pretty clever math trick. As for me, I took advantage of Math.Sin() and Math.Cos().

Now that is nostalgia, using math hacks because there wasn’t any support for things like trigonometry, not that from time to time in certain situations these old hacks don’t resurface, for example I remember coming across a pretty slick circle drawing algorythm a few years ago using ints and no trig at all, or having to provide your own divide route for chips without a divide instruction.

Three from the killer

Monday, August 4th, 2008

doG bless uTyoube, not that I quite understand the play-a-whole-track-with minimal-gfx thing that much, ( at which point I have to point you to pzar’s videos, interesting hobby you got there pzar ;) and the sound quality just bottoms out, but it is nice to listen to the occasional classic regardless, and I grew up up with cassettes, which had the most appalling sound quality, especially if they had been copied, especially if they were copies of copies … and so on. In this day and age you cannot always get everything you want via some legit download or some illicit P2P network, so if anyone has a copy of this, let me know.

Oh, and if you are going to listen to these, at least make sure you have an audio output that can reproduce the bass properly, for example, built in speakers on a MacBook == FAIL.


http://www.youtube.com/watch?v=wcCmqkWhRMU

(more…)