New, improved Hexxed


I have not had much luck in hunting down what is wrong with my code or the Xerces-c SAX2 parser – but I do think I have successfully updated by hex editor, Hexxed, to handle 64 bit (ie >4GB) files.

Indeed it performs rather better than vi for some editing tasks (Hexxed has a vi like interface).

So, if a hex editor, capable of handling little and big endian code and able to display output in Unicode is what you are after, and if you are vi-conditioned, then maybe Hexxed is your thing.

Groovy code can be found at: https://github.com/mcmenaminadrian/hexxed

While a runnable jar for those of you who have Java but are not yet Groovy can be downloaded at: http://88.198.44.150/hexxed.jar

And there is more about it here: https://cartesianproduct.wordpress.com/2012/06/03/hexxed-usage-options/

Just remember it is code for playing with – don’t bet the farm on it. But, that said, I have no reason to think it does not work.

President Obama’s campaign and free software


It seems a row has broken out between staff on President Barack Obama’s re-election campaign over the fate of the free software it produced (the article linked President Barack Obamahere refers to it all as “open source” but on this issue I tend to side with RMS and not ESR).

Actually I do not blame the DNC at all for not wanting to release any source (if that is what they want to do – it is not entirely clear). It would simply be foolish to surrender an advantage they have over their opponents if there is no need to do so. Nor does there appear to be any ethical issue involved: the core idea of the free software movement is surely that any user of software should have access to the source code out of which it is built. If the DNC does not distribute the software then they are under no moral or any other obligation to hand out the source code.

By far the worst idea the article talks of is selling the software: that would truly be a breach of the ethics of free software – because plainly trying to use the built software as a revenue stream means keeping the software hidden or forcing users, 1970s Unix-style, to sign NDAs. Either of those is worse than keeping a piece of private software private.

There is a wider question, of course, could distributing the software help build a better world. But if the distribution helps the US republican party, then surely the answer for the DNC is no?

Life: rewritten


Well, what else was I going to do? This works and that means I think BINSIC does too. It’s not quite a fully functional BASIC – try as I might I cannot get GOTO or even GOSUB to work inside loops (though I might do better if plough on with the GOSUB stuff), but I’ll hopefully launch it all tomorrow evening.

10 REM Game of Life
20 PRINT "Conway's Game of Life"
30 PRINT "Copyright Adrian McMenamin, 2012"
35 PRINT "adrianmcmenamin@gmail.com"
40 PRINT "Licensed under the GPL version 3"
50 DIM A(48, 70)
60 DIM B$(24)
70 PRINT "Please enter your pattern"
75 PRINT " - up to 24 lines of 70 characters"
80 FOR I = 1 TO 24
90 INPUT B$(I)
95 LET T = 0
97 IF B$(I) = "DONE" THEN LET T = 1
98 IF T = 1 THEN LET B$(I) = ""
100 IF T = 1  THEN GOTO 150
110 PRINT B$(I)
120 NEXT I
150 REM Parse Input
160 LET P = 0
170 LET G = 0
175 LET Y = 0
177 LET Q = 0
180 FOR Y = 1 TO 24
190 LET Z = LEN B$(Y)
210 IF Z = 0 THEN NEXT Y
220 FOR Q = 1 TO Z
222 LET A(Y, Q) = 0
225 IF MID$(B$(Y), Q, 1) = " " THEN LET A(Y + 24, Q) = 0
230 IF MID$(B$(Y), Q, 1) <> " " THEN LET A(Y, Q) = 1
232 IF MID$(B$(Y), Q, 1) <> " " THEN LET A(Y + 24, Q) = 1
234 IF MID$(B$(Y), Q, 1) <> " " THEN LET P = P + 1
240 NEXT Q
250 FOR Q = Z + 1 TO 70
260 LET A(Y, Q) = 0
265 LET A(Y + 24, Q) = 0
270 NEXT Q
280 NEXT Y
300 REM Display Map
310 PRINT
320 PRINT
330 PRINT
340 PRINT "Generation ", G, " Population is ", P
350 FOR M = 1 TO 24
355 PRINT
360 FOR N = 1 TO 70
370 IF A(M + 24, N) = 1 THEN PRINT "*";
375 IF A(M + 24, N) <> 1 THEN PRINT " ";
380 NEXT N
390 NEXT M
400 REM Map next generation
410 FOR M = 1 TO 24
420 FOR N = 1 TO 70
430 LET A(M, N) = 0
440 IF M + 1 < 25 AND A(M + 25, N) = 1 THEN LET A(M, N) = A(M, N) + 1
450 IF M - 1 > 0 AND A(M + 23, N) = 1 THEN LET A(M, N) = A(M, N) + 1
460 IF N + 1 < 71 AND A(M + 24, N + 1) = 1 THEN LET A(M, N) = A(M, N) + 1
470 IF N - 1 > 0 AND A(M + 24, N - 1) = 1 THEN LET A(M, N) = A(M, N) + 1
480 IF M - 1 > 0 AND N - 1 > 0 AND A(M + 23, N - 1) = 1 THEN LET A(M, N) = A(M, N) + 1
490 IF M - 1 > 0 AND N + 1 < 71 AND A(M + 23, N + 1) = 1 THEN LET A(M, N) = A(M, N) + 1
500 IF M + 1 < 25 AND N - 1 > 0 AND A(M + 25, N - 1) = 1 THEN LET A(M, N) = A(M, N) + 1
510 IF M + 1 < 25 AND N + 1 < 71 AND A(M + 25, N + 1) = 1 THEN LET A(M, N) = A(M, N) + 1
520 NEXT N
530 NEXT M
540 LET P = 0
600 FOR M = 1 TO 24
610 FOR N = 1 TO 70
611 LET ZZ = 0
612 LET SC = A(M, N)
612 IF A(M + 24, N) = 1 THEN LET ZZ = 1
613 LET RES = 0
614 IF ZZ = 0 AND SC = 3 THEN LET RES = 1
615 IF ZZ = 1 AND (SC = 2 OR SC = 3) THEN LET RES = 1
616 LET A(M + 24, N) = RES
617 LET P = P + RES
650 NEXT N
660 NEXT M
700 PAUSE 50000
800 LET G = G + 1
900 GOTO 310

Why choice in software matters … a story from the real world


Ten years ago today something happened that has had a significant impact on many millions of people across the world … Mozilla 1.0 was released.

Image representing Mozilla as depicted in Crun...
Image via CrunchBase

Above all else Mozilla, and it’s leaner, fitter, offspring, Mozilla Firefox, is the most important piece of free (as in freedom) software ever produced. For sure, it stood on the shoulders of giants to get there, but by giving the world a real choice in browsers the Mozilla Foundation changed the rules for the Internet, forced Microsoft to get its act together and crushed that company’s attempts to bind us all into a proprietary software future (remember ActiveX anyone?) online.

It is probably going too far to say that without Mozilla there would be no Arab Spring, for instance, but maybe not by much. Because Mozilla and Firefox also taught the public that there were alternatives out there and so the future did not have to be about what ever Baby Blue said it was. And that willingness to experiment online is helping power the mass adoption of smart phones, which are the weapons of choice for online revolutionaries.

It is easy to forget how bad it had got before Mozilla came along … Internet Explorer was a truly atrocious application that was not updated for several years. Microsoft had no interest in open standards because it had no competition. Mozilla changed all that. Not instantly, but the pressure began immediately.

Hexxed usage options


So, you want a hex editor for your latest project and (naturally) you decide to have a look at Hexxed, the free, GPL licensed, hex editor you can download here: http://88.198.44.150/hexxed.jar. So what happens next?

bash-3.2$ java -jar hexxed.jar -u

usage: hexxed [options]
-b,–block use block:offset address output – default is
linear address
-be,–bigendian interpret data as big endian – default is cpu
endianness
-f,–file <arg> file to edit
-le,–littleendian interpret data as little endian – default is cpu
endianness
-o,–offset <arg> offset in file – default 0
-s,–blocksize <arg> size of block if block:offset addressing used –
default is 0x200
-u,–usage show this information
-w,–width <arg> width (in bits, 8 – 64 bits) of output data –
default is 8 bits
-x,–x <arg> width of window (default 640 pixels)
-y,–y <arg> height of window (default 480 pixels)

Subtext is, please do have a look at Hexxed. I know it’s not as fully featured as commercial or even other free hex editors, but this is just the first iteration and if you tell me it is useful and add what feature you’d like to see in it, it is quite likely that I will get on with adding it.

Update: I have now run Hexxed on Ubuntu and Debian Linux, Mac OSX and Windows XP, so it should work on anything with Java installed.

Who needs a free hex editor then?


OK, Hexxed, the hex editor I have been working on, is nowhere near being finished but it does seem to be in a good enough state to find testers.

It’s very rough round the edges but it will allow you to open, edit and save files. I have given it a Vi-like interface and I would be most interested in knowing what people feel about it – if you are a Vi user does the interface feel natural enough to you?

I guess, at this point, any testers will have to be familiar with running a Groovy project – and you can pull the sources from GitHub.

But if someone just wants a .jar file to run, then let me know and I will package it up.