Sunday, November 16, 2008
How to replace a bicycle tube/tyre ten times faster than I do
So I was a bit embarrassed to see these videos of a guy removing and inserting the tube (and outer tyre in the process, which seems to just speed things up) in about 80 seconds. I'm still a bit skeptical about dealing with the outer tyre, which seems much tighter and stiffer on my hybrid wheel, but I'll have to try it next time!
Tube comes out
Tube goes in
These videos come from the very useful homepage of Jim Langley. (Note: Opera users such as myself may want to identify as Firefox or IE due to some outdated JS-crippling)
Thursday, November 13, 2008
Meteor MMS on the Palm Treo 680
It's not possible to specify those settings completely in the Messaging program on the Treo 680; instead, you need to modify (or copy and use) the settings in (main) Prefs->Network. This configuration worked for us:
Service: Meteor MMS Copy
Connection: GPRS
User Name: my
Password: mms
APN: mms.mymeteor.ie
Then in the Messaging program, go to the Preferences menu, select the Network tab, change "Network Configuration" to manual and enter the "Edit..." dialogue, where you can enter the following settings:
Message centre number: +353857000000
Email centre number: [blank]
MMS HTTP Proxy: 10.85.85.85:8799
MMS URL: http://mms.mymeteor.ie
Network Profile: Meteor MMS Copy
This works for downloading MMS messages.
Tuesday, November 11, 2008
the arithmetic calculator exercise in GFA Basic
randomly entertaining Chinese sentence
Here's a nice one I found when looking up the character 肥 (fei2), which according to my book means "(of clothes, shoes) loose*, (of animals) fat":
我被两个肥胖的女人紧紧地挤在中间,以致于要站起来下公共汽车都很难。
I was so tightly wedged between two fat women that it was difficult for me to get up and leave the bus.
:D :D
* although I couldn't substantiate the first meaning from the online dictionary..?
Saturday, November 08, 2008
Common Lisp: arithmetic calculator exercise
Saturday, October 25, 2008
ntl's expanded internet pipe
They recently retooled their broadband packages, so that the old 6mbit price now gets you 10mbit and for €10 more per month you can get 20mbit (I wouldn't bother with that unless I was sharing with a few people, though).
I had to call up to get it though, since they weren't nice enough to automatically shift me over to the new package - this is really something ISPs should do when they improve their packages.
It's working pretty good too - close to the quoted 10mb:
Thursday, October 23, 2008
Lexmark X4550 wireless woes with OS X
After a long conversation with a fairly patient technical support guy at Lexmark proved mostly fruitless, I dug a little further and ran a packet sniffer (Wireshark) over an attempted print job.
This prompted me to double-check the printer settings, which showed a device URI of lexnet3://192.168.1.3:1. Which is certainly wrong, as the printer is at 192.168.1.4. I'm not sure why it doesn't just use DNS properly, but anyway.
Trying to correct this, I stumbled across this post explaining how to modify the device URI via the CUPS web interface available on OS X. And it works! Good old Unix!
article: "Early Childhood Education: The Key to Success in Life"
After emphasising some of the importance and benefits of preschool education, it lists some basic and simple ways in which you can help educate your bairns. As usual with such material, there are 'obvious' things that never occurred to me - like placing a young baby face-down from even one month of age, because he will naturally want to raise his head which will help build up his back muscles which will improve general strength and co-ordination. The paper-crumpling trick is clever too.
Well worth a read!
Friday, October 10, 2008
classy typing tutor
. o O ( "Cop smearer"?? )
Sunday, August 24, 2008
Ireland's gradual transformation to a police state
Well, here we are. The Department of Justice, Equality and Law Reform have made it so that all migrants to Ireland from outside the EU must be fingerprinted (and their details shared with who knows how many foreign agencies). And of course, the costs for this are passed on to the migrants themselves - they will pay another €50 on top of the old €100 "registration" fee to lose their privacy. I have to wonder what practical use there will really be for the fingerprinting.
The "Land of the 100000 welcomes" is long dead and buried by this point. What disturbs me is all the people who feel that all foreigners should be fingerprinted and they're lucky they're not just sent home immediately anyway. What if all Irish citizens had to be fingerprinted? Would that be okay? No? So why the double-standard, and where does it stop?
Saturday, August 23, 2008
Refactoring threats
Re: Do not run this script, ever!
2008-01-25 15:45 • by morry (unregistered) 173406
I've always thought it's better to put these things into the positive, i.e. don't use "don't". For example:
RUN THIS SCRIPT WHEN YOU WANT TO BE FIRED
EXECUTE THIS PROGRAM WHEN LIFE NO LONGER HAS MEANING FOR YOU
IF YOU LIKE EVERYONE HATING YOU, THEN START THIS JOB
MAKING TOO MUCH MONEY? DO THIS TO REDUCE YOUR PAYCHECK TO 0!
GET ESCORTED OUT BY MERELY PUSHING THIS SHINY RED BUTTON
Thursday, August 14, 2008
Stupid thing of the day
However, it can't upgrade itself from version 3.3.2 to 3.3.4.
WTF.
Wednesday, July 30, 2008
"Who gives a shit?" attitude -> better mental performance
For example, deciding whether to have cake or cornflakes for breakfast could be enough to make you perform poorly at an interview later on.
A further implication of this (to me) is that people who coast through much of the day like zombies (especially in the morning), not making many decisions, are much better able to perform when they need to, because they haven't depleted those resources yet.
The moral of the story: if you want to improve your overall mental performance, get into the habit of saying "who gives a shit?" about irrelevant decisions like where to put the furniture or whether the curtains need to be washed again this week. Don't deliberate over mundane issues. Don't waste your energy. Just pick the first reasonable option. I'd like to know if strategies like this can minimise this effect, or if we really have to go around like cattle - I know I do, most of the time... Is that what girlfriends are for? To decide where the couch and TV should be and what washing powder to use, so that I can reserve my brain power selfishly for 'clever' use later (which rarely happens)? Seems a little unfair, really...
I have more questions. How do we recover from the effects? How long does it take? Can we speed it up? What about meditation, or induced alpha/theta/delta brainwaves (i.e. by listening to binaural beats, say)? Why does it happen?
Enough rambling (I guess...), I'm off to dodge some decisions! Probably.
Wednesday, July 23, 2008
(Auto-)Growing Panes
After scratching my chin in confusion, I whittled out the following minimalish example that demonstrates the result:
import java.awt.Color;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import javax.swing.BoxLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
import javax.swing.border.LineBorder;
public class TextAreaExample {
public JPanel createContentPane() {
JPanel contentPane = new JPanel();
JPanel mainPanel = new JPanel(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
// ipadx > 0 causes textarea panel to grow horizontally forever if linewrap is set!
c.ipadx = 1;
JPanel leftPanel = new JPanel();
leftPanel.add(new JLabel("Left"));
mainPanel.add(leftPanel, c);
JPanel logPanel = new JPanel();
logPanel.setLayout(new BoxLayout(logPanel, BoxLayout.PAGE_AXIS));
JLabel label = new JLabel("Hello");
logPanel.add(label);
// create misbehaving textarea
JTextArea log = new JTextArea(10, 40);
log.setLineWrap(true);
log.setBorder(new LineBorder(Color.BLUE));
logPanel.add(log);
mainPanel.add(logPanel, c);
JPanel rightPanel = new JPanel();
rightPanel.add(new JLabel("Right"));
mainPanel.add(rightPanel, c);
contentPane.add(mainPanel);
return contentPane;
}
private static void createAndShowGUI() {
JFrame frame = new JFrame("JTextArea growth test");
TextAreaExample demo = new TextAreaExample();
frame.setContentPane(demo.createContentPane());
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}
}
I can get around it by setting a preferred size on the JTextArea (a size of 0,0 seems to do the trick without changing the initial layout), but what the hell?
Monday, July 21, 2008
Swing and a miss
/**
* Sets the the vertical alignment.
*
* @param alignmentX the new vertical alignment
* @see #getAlignmentX
* @beaninfo
* description: The preferred horizontal alignment of the component.
*/
public void setAlignmentX(float alignmentX) {
As you can see, the method description and param seem to conflict directly with the beaninfo description. I was sure the first two are a typo, copied from the alignmentY equivalent, but let's have a look at setAlignmentY:
/**
* Sets the the horizontal alignment.
*
* @param alignmentY the new horizontal alignment
* @see #getAlignmentY
* @beaninfo
* description: The preferred vertical alignment of the component.
*/
public void setAlignmentY(float alignmentY) {
???
Also, using it is confusing and the docs don't seem very helpful. I created a JPanel using a vertical BoxLayout, so that as you .add(component)s they stack up beneath each other.
To the empty box panel I added a JLabel with the text "Log" and beneath that, a JTextArea which would hold the log output.
However, I noticed on running the program that the label was not left-aligned - instead, it was indented by about 40 pixels beyond the log textarea beneath. Worse still, when text appeared inside the JTextArea, the label above would jump horizontally right, bizarrely. So the most logical thing to do seemed to be to call label.setAlignmentX(Component.LEFT_ALIGNMENT) to keep the label aligned to the left side of its containing box.
Seemed to be the logical thing to do. But no, this caused no obvious change. Various combinations of this did nothing, until I made the same call on the textarea underneath.
So if you have a vertical box containing a label with a textarea underneath it and you want the LABEL to be left-aligned, you have to tell the TEXTAREA to left-align itself.
...WHAT?
Wednesday, July 09, 2008
The great antivirus scandal of 2008
But the fact is, you can become automatically infected by a virus without running the infected program/trojan yourself; the virus scanner scans it automatically, but the file is designed to exploit a vulnerability in your virus scanner and you become infected.
That's a lot more dangerous than having no AV software and just being careful which programs you run...
Symantec is among the worst here, with about 32 vulnerabilities listed compared to 6 or 7 in FProt, AVG and BitDefender.
Personally, I think it serves AV vendors right for coding their products in languages as dangerous as C and C++, which are so vulnerable to buffer overflow mistakes. And nobody can code without mistakes. And the frequency of mistakes increases with code size, of course. They should have written their scanners/plugins in a better programming language (e.g. Lisp).
Tuesday, July 01, 2008
Update on Gambit-C Scheme benchmarks
The results in general are much better:
time ./fannkuch -:m20000 11 > output_fannkuch
real 0m9.931s
user 0m9.465s
sys 0m0.172s
time ./fasta -:m20000 25000000 > output_fasta
real 0m29.843s
user 0m25.220s
sys 0m2.700s
time ./binary-trees -:m20000 16 > output-binary-trees
real 0m2.770s
user 0m2.581s
sys 0m0.089s
time ./pidigits -:m20000 2500 > output
real 0m3.322s
user 0m3.093s
sys 0m0.110s
A range of improvement is apparent, with binary-trees benefitting a lot and pidigits not really getting much better.
I picked a 20 meg heap because a) it seems wasteful for individual programs to reserve (and probably waste) huge chunks of memory, if you're running a lot of programs b) when I tried higher values up to 50 megs on the fasta benchmark, it was faster, but only by another .2 seconds or so; about 1-2%... and c) Most other languages, and in this case SBCL, don't seem to request more than about 20 megs for their initial heap size either.
Of note is the fact that the prebuilt version produced slightly faster code than the version I compiled myself, specifying the optimisations mentioned in the INSTALL.txt document. Not sure why... These numbers are for the Gambit I compiled myself, and I didn't feel like dumping it and re-installing the prebuilt version just yet.
Anyway, these are nice results!
Sunday, June 29, 2008
How fast is Scheme? Well....
I don't know much about Scheme (or Lisp at all really; I've only become interested in it during the last month or so) but it seems that the Scheme compilers produce quite sluggish code, at least looking through the grainy, distorted lens that is the Computer Language Benchmarks Game.
From some of the microbenchmarks published by the Gambit guy(s) on their homepage, it looks as if it fares really well against the Chicken and Mzscheme compilers, but I wanted to examine its performance on problems relative to SBCL, which is the Common Lisp compiler I've arbitrarily chosen.
Since it's not featured on the language shootout, I pulled the SBCL code for a few tests there as well as the Gambit code which was already prepared on their site (why hasn't Gambit appeared on the shootout site for the nosy hackers who want to find out if less mainstream (man I hate that word) languages are ridiculously slow? Many of them aren't! And they're more expressive and comfortable than C++/Java, use them!) and ran a few comparisons.
SBCL comes out very much on top; in general the Gambit programs take two or three times as long to do their job (although I haven't looked at memory usage). But as far as Scheme compilers go, Gambit seems to be improving things.
(Really dodgy) timings on my Macbook (input values = whatever's on the shootout site):
Gambit:
pidigits
real 0m3.611s
user 0m3.508s
sys 0m0.066s
binary-trees
real 0m7.519s
user 0m7.309s
sys 0m0.130s
fannkuch
real 0m12.571s
user 0m12.089s
sys 0m0.205s
fasta
real 0m46.334s
user 0m42.284s
sys 0m2.668s
Lisp SBCL:
pidigits
real 0m2.422s
user 0m2.018s
sys 0m0.308s
binary-trees
real 0m1.899s
user 0m1.723s
sys 0m0.127s
fannkuch
real 0m6.221s
user 0m5.982s
sys 0m0.098s
fasta
real 0m20.730s
user 0m15.267s
sys 0m4.375s
(ratio-pidigits: 1.5
ratio-binary-trees: 3.959
ratio-fannkuch: 2.021
ratio-fasta: 2.235)
One thing I've noticed from these coarse measurements is the "sys" component of the execution time is mostly higher for SBCL; maybe this means a lot of allocation and de-allocation of stuff is going on ...Or something.
Extra legs on a dog
I particularly like:
JavaLanguage
- ..made by taking an 8-legged dog, housebreaking it, and tearing out its skeleton. Then giving it a machine shop.
a boneless 8-legged dog manages to be less useful than either an octopus or a dog - but it comes with a machine shop, so that's good.
That said, this is exactly the kind of thing that I would chuckle ceaselessly at, for which even fellow coders would shun me for being lame and non computer scientists would simply presume me to be insane. Fair play, really.
Tuesday, June 24, 2008
Lisp problem 10: RLE of a list
I guess there's a danger there of writing really poorly-performing functions on the assumption that the compiler will optimise them. Actually, I don't even know if SBCL does tail-call optimisation... It somehow seems easier to express tail-recursive solutions in Haskell, so far anyway - as a complete newbie to both languages.
;; P10: Run-length encoding of a list.
(defun encode (list)
(let ((chunked (pack list)) result)
(dolist (chunk chunked)
(setf result (append result
(list (list (length chunk) (car chunk))))))
result))
Oh yeah, how do you get around doing that ugly (append result (list (list x y))) stuff? I assume that's super slow, unless Lisp lists have a pointer to the last element for quick access since (you'd think?) appending is common. But then, some of the stuff I read in Practical Common Lisp suggests a push/reverse pattern, which to me seems a bit awkward.
99 lisp problems. Some are hard!
I figured the first few would be really easy with a smooth learning curve as the questions get more difficult. Certainly, I didn't expect to spend at least two hours screwing up question 9; an ostensibly straightforward problem requiring you to convert a sequence into a list of sublists, grouped by consecutively equal elements (i.e. (1 4 4 8 1 9 1 1 1 2 2 3) -> ((1) (4 4) (8) (1) (9) (1 1 1) (2 2) (3))).
After trying to solve this one a few different ways, I rejected a recursive approach and simply looped through all the elements, doing dirty stuff:
(defun pack (list)
(let (a main-list)
(dolist (x list)
(if (and (not (null a)) (eq x (car (last a))))
(setf a (append a (list x)))
(if (null a)
(setf a (list x))
(progn (setf main-list (append main-list (list a)))
(setf a (list x))))))
(setf main-list (append main-list (list a)))
main-list))
I had a quick peek at the solution provided on the site and didn't bother going through it except to note that it was indeed recursive (and not tail-recursive). Partly because some of the identifier names are in Portuguese and partly because it looks similar to the mess I had when I tried to do it recursively; I'm just not comfortable with how lists work yet - I was getting stuff like ((1 (1 (2 3)))) and ((1 (1 (2))) . 3) and all sorts of other crap.
I'm sure I could have done this quicker (and much longer and uglier) in Java, but not figuring it out properly in Lisp is making me feel a bit stupid. Wah.
Friday, May 23, 2008
From I Ran to Eye Rack
Another funny dodgy American pronunciation is the popular "eye-raq / eye-ran" thing. It was entertaining to hear that our ex-Taoiseach Bertie Ahern was introduced as "Bertie Ay-hern" by Nanci Pelosi on a recent trip to the US.
As culturally-prevalent-and-nobody-corrects-themselves pronunciation errors go, it seems as bad as the Japanese 'l'->'r' transliteration (take the eravator to the rower reveru, prease), since at least Japanese have the excuse that the 'l' sound doesn't appear in their language and they thus have trouble pronouncing it.
Tuesday, May 06, 2008
gymnastic bounces, late
Received 3/5/2008 (happy birthday):
Your membership in the mailing list Announce-gymnast has been disabled due to excessive bounces The last bounce received from you was dated 29-Dec-2003. You will not get any more messages from this list until you re-enable your membership. You will receive 2 more reminders like this before your membership in the list is deleted.
Excessive bounces, but the last one my account apparently sent was four and a half years ago? I don't think I even subscribed myself to that list, though I was in the gymnastics club in first year of college. Weird.
Friday, April 11, 2008
Java's arithmetic operators
@Test
public void testWeirdArithmeticOperators() {
double a = 1.0 / + + + 2.0;
assertTrue(0.5 == a);
String s = + + + + 0 + "abc" + "def";
assertEquals("0abcdef", s);
}
After playing about for a bit, switching some +es to -es and vice versa, I realised that the effect is that each + or - symbol could be rewritten as follows:
+ -> (+1)*
- -> (-1)*
So that the expression "+ + + 2.0" becomes "(+1) * (+1) * (+1) * 2.0" = 2.0, and the expression "- + + 2.0" becomes "-1 * +1 * +1 * 2.0" = -2.0. Thus, the sign of the result is negative for an odd number of - symbols and positive for an even number.
Seems a little pointless, but I suppose the logical way to see it is:
- + - x = - (+ - x) = - (+ (-x)). It makes sense then that the parser would accept it, but in it that form it looks wrong to (my) human eye.
Also, in writing this post I noticed that JUnit's assertEquals doesn't really like doubles:
assertEquals(0.5, 0) passes, as does assertEquals(Double.valueOf(0.5), Double.valueOf(0.0)) and other combinations. That's why I needed to use assertTrue(...) and == above. Huh.
Tuesday, April 01, 2008
the poor man's breakpoint
So instead of running tests/etc in the debug perspective and adding breakpoints where I want to stop (if that block of code is executed), I've taken to doing things like this instead:
throw new RuntimeException("FUCK");This means I get a stack trace showing how we got to the current state, which is often enough to realise what the problem is (at least, it was just now; I saw that a method I didn't expect to be called was being called by a parser for poorly-formed XML messages. Until that point, I didn't realise the messages were now poorly-formed as they weren't before I swapped XMLSerializer for LSSerializer earlier today).
Also, it's easy to search and remove your debugging throws afterward, since they contain the reasonably memorable, short string "FUCK". Of course, you wouldn't want to forget about it and leave one in a currently unused (as far as you know) method, lest an end-user find that their application is throwing an exception because FUCK. :)
Perhaps a more subtle keyword could be selected (how about "Fire in the hole" or "Get to the choppa!")...
Friday, March 28, 2008
how... odd
Here's a funny random thing. Residents in some countries can apply for an Irish visa online.
They're even nice enough to provide translations of the "Information on completing Online Application" into other languages, including Chinese. However, in their list of countries for which they allow online visa applications, China is not present.
So why the hell did they bother translating the "how to use the online application system" PDF into Chinese...?
Welcome to the Irish government. Home of weird bureaucracy and silly contradictions.
Also, the actual web application tells Opera users to upgrade their browser because of some buggy cookie test. As usual, an Irish government site/webapp ends up poorly designed and coded, and probably cost at least €10M. Saps.
Monday, March 24, 2008
Freeze! squad
Here's one of the things I really like about Mandarin Chinese - its simple straightforwardness; a lack of needless obfuscation. The Chinese phrase "别动!" (bie2 dong4) usually means "Don't move!". The character "队" (dui4) means a squad or team.
Combined, the resulting term "别动队" means "special ops team". Literally, "don't move squad".
:)
Thursday, March 20, 2008
When is a clone not a clone? When it's half a clone!
Behold (from one of Sun's references):
A clone of a multidimensional array is shallow, which is to say that it creates only a single new array. Subarrays are shared.Then that's hardly a clone now is it? Damn you
Wednesday, March 19, 2008
我找到了书!
Since the graphics tablet arrived, I started using it to sketch the characters in Seashore, a simple bitmap drawing program.

Then I check if I was correct (if not, I draw each character four times or so), clear the canvas (by hitting backspace) and grade myself in Anki, moving onto the next item. It's faster and easier, two reasons which have helped me keep doing it. Along with some truly inspiring ideas (the "how many things will I definitely do tomorrow" game and the "I'll just get the file out" trick) I read on Mark Forster's site, which you should incidentally go and read now, by the way, since it might just help you change your life for the better.
Tuesday, March 11, 2008
Newsflash: Eclipse is bloody slow
What's going on here? I know Java can be slow and Eclipse uses a fair bit of memory so I'm probably swapping to disk like a king, but it still seems excessive.
Friday, March 07, 2008
more on profiling
I'm hoping I can find more higher-level optimisations over the next while, but I've gotta draw a line now and get back to adding functionality, or I'll look like quite the sap when I have to demo the current stuff to my pals.
Thursday, March 06, 2008
Eclipse, TPTP and accursed JVMTI
Hitting the "Test availability" button for the post-1.5 JRE data collectors freezes Eclipse for about 10 seconds before popping up an alert box which states "The JVMTI agent org.eclipse.tptp.jvmti is not available", with a "Show details" button which expands the dialogue to display a completely blank textbox. This is clearly bollox. Searching the web leads to forum posts advising to meddle with the "Agent Controller" and RAServer programs, but I can't find them and never needed to before.
What Eclipse needs is a lightweight, simple profiler which doesn't run into stupid problems like this. For fuck's sake, I've spent over an hour getting nowhere with this stuff. Of course this would happen now, when I'm expected to give a demo of the code (running faster than what it replaces) on Monday morning.
Results of "Test Availability":

Trying to run the profiler:

An automatic update should not break Eclipse's profiler completely. Now I've gotta go with the good old "manually insert time measurement code all over the shop" technique, which fairly sucks.
Thursday, February 28, 2008
Functional Programming in Java? No, not Scala...
The notion is attractive, but then I saw some example code:
public int calcPriceInternalIterator(List items)
{
Iterator i = items.iterator();
UnaryFunction getItemPrice =
new UnaryFunction()
{
public Object evaluate (Object obj)
{
return new Double(((SETLItem)obj).getPrice());
}
};
Constant usd100 = new Constant(new Double(100));
BinaryPredicateUnaryPredicate moreThanUSD100 = new BinaryPredicateUnaryPredicate
(new UnaryCompositeBinaryPredicate(new IsGreaterThanOrEqual(), getItemPrice, usd100));
FilteredIterator fi = new FilteredIterator(i, moreThanUSD100);
Summer addPrice = new Summer();
Algorithms.foreach(fi, addPrice);
return addPrice.getSum();
}
And then in the concluding spiel:
In this article, I've introduced two functional programming techniques that can be easily integrated into your Java development practices.
... Now come on. I have no idea what that code does, because it's an ugly, bloated mess of syntax and verbose names (not to mention simply having far too many identifiers and tokens in the first place).
Java is a round hole. Functional programming is a square peg. Without modifying the syntax of the language, trying to fit the square peg in the hole may be possible, but far, far too complicated and impractical. No sane coder would want to work with that.
Tuesday, February 26, 2008
week of doom
I slightly underestimated the distance to the petrol station, so when I got my bottle of Club Orange and stuffed it into my backpack beside the Chinese food, I sat on my bike and noticed the front tyre was completely flat. Bollox, said I.
Anyway, I didn't want to faff about trying to fix it there because that takes me an hour and I had hot food in my bag. So after a longer-than-usual uncomfortable cycle home on a flat tyre, I pulled the takeaway out to find that it had leaked all the sauce from my chow mein into my backpack, all over my rain trousers and whatnot. And bollox again, I swore.
Next morning, we spent an hour fixing the puncture (I hate the damn things. Hate.) and I headed off to DCU. Some hours later, when I returned to my bike I noticed it was flat again. No problem, probably a slow puncture elsewhere, or a semi-sticky patch.. I'll just pump it up again and ride home. However, when I took the pump to college in my bag, I neglected to take the small attachment tube which connects it to the tyre's air valve. For the third time, bollox was uttered with some frustration.
Another trip home on a flat tyre, listening to the rim grind against tarmac through the outer tyre, and I left the bike 'til morning before swapping out the cursed inner tube with another I'd pulled out months ago with only one prior patch and which seemed to need only one more. This successfully carried me to college and back, but two days later it was flat again.
I put it out of my mind and on Sunday night, watched Lost at 9pm and prepared to do some catchup piano practice at 10 and a little more on Monday morning... when at about 3 minutes to ten, the power failed... apparently only on my road, or my half of the road even. So that lasted until about 3pm the next day, which caused some trouble since the piano is an electric keyboard.
When life gives you lemons, make cake! Unless you have a poxy electric cooker and the power is out.
...On the plus side, when I opened up my Macbook which had died in its sleep during the power outage (I put it to sleep with about 20 minutes left on the battery monitor, soon after the cut), I expected it to go through a normal bootup. Instead, I saw a funny progress bar whizz for a while, before it brought up the usual unlock dialogue which appears when you're logged on and wake the machine up. So there's a point where it wakes the machine from S3 (suspend-to-RAM) sleep and puts it straight into S4 (suspend-to-disk), then powers off, on the basis that the battery is about to run out which will destroy your S3 image and you'd have to boot again. Nice.
Sunday, February 17, 2008
The joys of Sozobon C
Having been slowly inching towards doing a little coding on the Atari ST, I decided to set some (very) small, straightforward goals to actually get started doing something useful. This seems to be a pretty important tactic for me, as otherwise, I can start to get lost in the haze of all my different interests and never really get anywhere.
I started laying these out in a simple todo list following the extreme programming task card style we used at Cellusys, like so:
In progress:
todo:
* ST: Display a sprite! (IH: 2)
done:
* ST: Switch to low res and back to original. (IH: 0.5 / AH: 0.5)
* ST: Print the current colour palette. (IH: 10m / AH: 20m)
* ST: Change the background colour to green. (IH: 2 (??) / AH: 10m)
Printing the palette took a bit longer since I decided to write a number->binary (string representation) conversion function, and realised I'd forgotten some pretty basic things about C. But that's part of the fun! Note my fairly pessimistic estimate of 2 hours to display a simple sprite. It's probably a good idea to err on the side of underestimating yourself when planning stuff that is somewhat beyond your ken, even if you used to do it ten years ago. To be honest though, I'm not really sure what to try after that. A little animation I suppose? Then eventually some screen flipping and fiddling with the palette and an XBIOS sound routine. Sounds like a plan...
Wednesday, February 06, 2008
The 1 percent rule
From a Wired article on geekiness in Futurama:
Cohen refers to a One Percent Rule that guided the writing on Futurama. When they were scripting the episode "Kif Gets Knocked Up a Notch," a character claims that he painstakingly programmed a holographic simulation using "4 million lines of BASIC." One writer pointed out that 99 percent of the audience wouldn't get the reference to an old programming language. Producer-writer Eric Kaplan responded, "Fuck them!"
Cooool.
Friday, January 25, 2008
Lambda the Ultimate! Mayest thou wrap with great haste.
While reading this interesting thread about "concept [representation?] programming", I immediately became frustrated at the massively long lines which forced me to scroll left to right and back constantly.
I started to search the web for a fix, tried using Google Translate (Chinese to English) to see if it would somehow fix the problem and when this failed, took a quick look in Opera's "view" menu. There I saw the obvious solution, "Fit to width". I kind of expected this to zoom the whole page out so small that I wouldn't be able to read anything, but nope; it just forces the page layout to conform to your browser window's width, effectively forcing word-wrapping. I love Opera.
Saturday, January 12, 2008
Dude, where's my fonts?
In my case, only the All Fonts and Gaeilge libraries were left, both empty. Trying to add more fonts had no effect, until I eventually realised I had to create a new library as a workaround and add fonts to that.
This worked, although due to the aforementioned .CFUserTextEncoding problem I had to open Font Book every login before applications that used interesting fonts, or they wouldn't find any.
Just for the sake of it, I opened up a bug report with Apple, not really expecting to hear anything back. A few weeks later though, I did hear back from them, with a solution that worked:
"Look for a directory called: com.apple.ATS inside of /var/folders
Once you find it, copy this directory to another location and then remove it."
Doing this and rebooting the MacBook, I logged in again and started Font Book to find, lo and behold (drumroll and angel choir) that the User and Computer font libraries were automatically added again and all the fonts loaded back into them. BRILLIANT, thanks Apple, I totally didn't expect that. Thumbs up from me!
Friday, January 11, 2008
The middle finger of .CFUserTextEncoding
The LyX error looked like this:
LyX: Creating directory
Same as entered returned
Failed to create directory. Exiting.
And Atlantis didn't give me any error message. So, after a long time fiddling around with directory permissions, changing my group from admin to user and chowning a bit, I noticed from a dtruss log of failed and successful (by simply running as another user with sudo) runs of the affected programs that the file ~/.CFUserTextEncoding was being accessed at some point.
So I had a quick look at this file in the failure (first) and success (...second) cases:
Macintosh:~ oisin$ more .CFUserTextEncoding
39:50
Macintosh:~ oisin$ more ../yunqing/.CFUserTextEncoding
../yunqing/.CFUserTextEncoding: Permission denied
Macintosh:~ oisin$ sudo more ../yunqing/.CFUserTextEncoding
0:0
Replacing mine with 0:0 and su'ing to myself to get a new shell, I was able to run LyX and Atlantis with no problems. So, I'm not sure what this means - maybe the crash wiped out an encoding method or wrote the wrong data to that file, and when applications read from .CFUserTextEncoding they tried to look for/save their settings in the wrong place.
Confusing, but at least there's a fix.
Monday, December 24, 2007
Where did Installer go in Leopard?
Another problem is that file associations got nuked. Fair enough, I can rebuild those as I run into them... but when I tried to apply a patch to NeoOffice, I'm told:
There is no default application specified to open the document "NeoOffice-blah.pkg".
Well, that's a bit strange, so I google and find that I need to use /Applications/Utilities/Installer.app for these. Great! Or not great, because the file is MISSING. I see similar problems on forums (what would we do without them? well, without the ones with actual answers anyway), and people generally recommend the poor user to reinstall via "Archive and Install" which supposedly keeps your user files/settings.
Before I made such a serious commitment to dig myself deeper in the shite, though, I did another quick google and found that as of OS X version 10.5 "Leopard", the Installer application is now located in /System/Library/CoreServices, along with a horde of other utilities.
So to others encountering this problem, DO NOT REINSTALL before checking there. It's unlikely that the program has let itself out the back door into the night. It's probably right there, hiding under your bed.
Don't be too hasty to reinstall your OS - there's usually a reasonable fix out there... Now if I can only find my font fix...
Tuesday, November 13, 2007
C++ FQA
This very good read takes the form of responses to answers on the C++ FAQ Lite. The author makes no attempt to hide his contempt for the language, and for well-explained reasons (for example, that the C++ grammar is actually undecidable and thus parsing it can sometimes have bizarre results).
I'd recommend this to anyone caught in the popular grip of C++, rather than finding out (or being caught in denial) about the pain awaiting programmers of any level. Hint: lack of garbage collection, extreme, multi-pronged lameness of templates and not-exactly-encapsulation feature heavily.
Personally, I've been working in Java for the last while anyway, but I've promised myself I'd get into (Smart)Eiffel for a while now, which seems like a much, much simpler and unambiguous language with garbage collection, a decent string class and no poxy operator overloading, and still reasonably efficient in the general case, compared to C++. Also, the D programming language may be worth a look, which seems to have some good built-in string handling (but no multiple-inheritance. Meh?).
Friday, November 09, 2007
Backflip
Everytime I try a backward somersault or handspring, I chicken out as soon as I start to fall back... like so:
How are you supposed to override that annoying reaction?
Thursday, November 08, 2007
Mac an Leabhair... the Macbook
Another fairly large skip in blogging activity... so, as part of my scholarship funding, IRCSET allow first year research students to buy a computer and put the tab on their expenses account, to the tune of €1500. Naturally, I arranged things so the computer and components came to €1490 or so - almost a bin-packing problem, but easily approximately solved.
The Macbook, a 13" white one (why pay 200 quid just to have it in black? pfft.... that'd only absorb heat and burn your err... legs, anyway) with a 2.16ghz Core2 Duo, 2 gigs of RAM (the most I've ever had in a machine before was a sad 512 megs) and a 160 gig hard disk (for research... and anime and music... not porn. Fine, for porn - are you happy now?).
Unfortunately, it came with two problems:
- The lock the sales guy sold me over the phone, which he assured would fit my machine, didn't fit the machine. In fact, it damaged the side of the case while I tried to gently fit it to the Macbook's lock slot.
This is kind of an understandable mistake - it looked almost exactly the same as another lock that did fit, and I didn't see anything on the Apple website about which lock fits which machine. - The version of OS X, which the salesman assured me would be 10.5 "Leopard" when I specifically asked him (and the previous salesman on the phone), turned out to be 10.4 "Tiger". Not that Tiger was bad, I was still delighted with its performance compared to my Windows XP, Ubuntu XFCE/Gnome and Mandriva KDE experiences. It was ridiculously fast, smooth and yes, things "just worked", to appropriate a shitty phrase.
So, for a couple of days I tried to get in touch with the sales guy, who seemed to suddenly go on annual leave, then I eventually got on the phone with another agent in Apple Education, who, when I called her for the second time 5 minutes later, told me an install disc for Leopard was on its way and I could keep the incompatible lock for which they had already sent out a compatible replacement, both without charge.
That just leaves the slight damage on the case from the weird lock, but I'm pretty impressed by their helpfulness, especially compared to Acer, who I dealt with when one of their firmware updates killed my old laptop's flash BIOS (those useless assholes charged me over €300 to replace the entire motherboard, because they apparently have no mechanism to recover from flashing the BIOS with an image from an 'incompatible' revision of the same motherboard model. The Taiwan guys sent me a text file describing some Phoenix BIOS "bootblok" recovery procedure, but either that wasn't implemented or the Official-Acer-Repair-Shop-Off-The-Naas-Road-Dublin-12 engineers were ripping me off).
Apple.getInstance().respect++;
Wednesday, October 10, 2007
grub got your goat?
So I was left with a slightly knacked partition table and decided to burn a proper GParted livecd which also contained a program called Testdisk. This was able to rebuild the partition table (although it disturbingly seemed to think the drive had 16 heads every time I loaded it, and complained that either this setting was wrong or the disk layout was crazy until I changed it to 255... every time), but at some point I managed to overwrite the MBR as well by picking the wrong option.
Attempts to reconstruct the GRUB bootloader's MBR claimed success, but actually trying to boot from the hard disk resulted in just a cursor flashing indefinitely. No message from GRUB, even.
Eventually, I found that the instructions I'd been following didn't tell me enough and that making the bootloader was a bit more involved than just:
"root (hd0, 1)
setup (hd0)",
and certainly more difficult than just running "grub-install /dev/hda2", which wasn't at all happy.
In the end, I started copying an entry from my boot partition's old GRUB menu.lst and replacing the now-inaccurate drive references:
The final sequence of commands to fix the thing was something like this:
root@gparted:~# grub
[ Minimal BASH-like line editing is supported. For
the first word, TAB lists possible command
completions. Anywhere else TAB lists the possible
completions of a device/filename. ]
grub> root (hd0,1)
grub> kernel /boot/vmlinuz-2.6.20-16-386 root=/dev/hda2 ro quiet splash
grub> initrd /boot/initrd.img-2.6.20-16-386
GRUB Error 16: Inconsistent filesystem structure
grub> setup (hd0)
[snip a few lines of blah followed by "success"!]
grub> quit
root@gparted:~# reboot
The "error 16" line when I tried to set up the initrd threw me, but after running e2fsck on the partition at least twice I decided it was just GRUB being a bollox and went ahead with it. GRUB's own filesystem mini-tests suggested things were okay anyway. So after rebooting everything was ok.... although once I logged in, I ran a command called "update-grub" which may be Ubuntu-specific. This seems to have incorrectly specified the root partition, but we'll see...
So anyway, try that more verbose tactic before executing GRUB's setup command, if you run into a similar problem.
Thursday, October 04, 2007
swiping a computer
Then I went back to my desk, without having to wait for someone to let me in like an orphan boy, and waiting around for someone to set my nicked (from someone who hopefully wasn't using it anymore) crappy Pentium III PC to allow network logins.
I'm going to assume that this amount of hassle, bureaucracy and poor inter-department communications is a normal thing.
Saturday, September 08, 2007
fantasy... reality. fantasy... reality.
...
"I'm devastated because I have an 8-year-old for which I now have to have an explanation," said another Los Angeles-area mother, Rosie Konkel. "She's always looked at this character as a very smart and proper young lady."
Here we have a problem. That is, these people seem unable to distinguish between the character played by an actress, and the actress herself, who has her own, (almost) private life. For example, just because the character is an unrealistically good, innocent girl does not imply that the actress playing her should be the same. That's why it's called "acting".
This seems like a fundamental division - character and actor - which should be understood by even young children, yet some adults can fail to grasp it.
I heard that an actor who played a rapist in "Fair City", the crappy soap opera, was spat at on the streets and threatened for his 'crimes'. Which is bloody ridiculous - do these people think all TV is a fly-on-the-wall recording of real life? How could they possibly fail to separate the character from the actor?
Maybe you should be forced to take an IQ test before you turn on your TV.
Friday, August 10, 2007
/etc/init.d/me status --not-too-verbose
Handily enough, one of the guys I made friends with at work introduced me to the Sportslink snooker club in Santry, so I've got a chance to practice some proper snooker and improve a little, rather than bang my head off the wall on my own.
At the moment in my fragments of spare time I'm sleeping, watching the X-Files and very slowly learning three languages (Eiffel, AutoIt v3 and Chinese). Verrrry slow....ly....
Tuesday, June 26, 2007
grid projectoring!
Good idea! I'm sure it'll be approximated in open-source form to use your standard webcam, if Pluribus turns out to be expensive...
Here's a nice shot showing the boundaries of each individual projector's display...
Monday, June 04, 2007
the vacuum of "just-finished-college"
But I still haven't really done any of it, except for starting to learn Eiffel. Anyway, I'll have to get cracking before I find a job, or I might never start on it.
Just in case anyone is interested in a (not very)proof-of-concept program where you can train the TD(λ) players against either other temporal difference learners or against random players and view the plays made in a single game, I've put up the windows/linux binaries here.
Sunday, May 27, 2007
gcc as a cross-compiler
What I don't understand is the amount of work necessary to do so. I first have to compile an oldish binutils with a native x86 linux target, then start using that binutils to build the same version of binutils, this time for the 68k Atari target... then build the entire gcc-3.3.3 for x86, and then again for 68k. Jesus.
I thought the whole idea of a modular compiler design was that it wouldn't cost too much to implement a new target machine - just a separate backend that can be plugged into your existing compiler, that accepts intermediate representation code from the frontend and produces assembly specific to the target machine which it can assemble and link.
So why do I have to recompile binutils and the entire gcc twice each? This doesn't seem right.
But then, I don't know much at all about gcc - perhaps there are other, much easier ways of accomplishing the same goal.
Please comment if you know anything about adding new backends to gcc!
Saturday, May 12, 2007
Postscript looking manky?
I scratched my head for a while, trying different viewers and the like, but eventually stumbled, completely accidentally on a fix which works for me, although results in massive bloat:
Run ps2ps on the postscript file. This is supposed to 'optimise' the postscript file somehow, but so far has resulted in them increasing in size for me, and looking weird on screen... however, the printer output is absolutely spot on. It just seems to convert everything into image data... which is a lame fix, but suits me for printing.
I'd appreciate it if anyone else knows more about this and maybe a better solution!
Tuesday, May 08, 2007
more exams
I'm not sure if I'll use Pauker at all for this - my exam performance in semester one this year was much worse than last year (68% average compared to 81%...??), probably because I was biting off too much to chew. The flashcards route needs more experimentation for general study.
Anyway, this time there are only three exams, one of which (Compiler Construction 2) is almost a gimme (although I thought its predecessor was a great exam and only ended up getting 63% or something on the paper, so I'll have to be wary), one of which should be alright given a bit of care and attention (Real-time Embedded) and one of which will require a bit more work since it's so bloody abstract (Z).
That said, JM seems really decent so I don't think he'll fuck us over on the exam.
Just have to stop procrastinating now...
Friday, May 04, 2007
birthday +/-
Then balanced it out by having a massive row today... logically.
Also, when I got home yesterday evening, my Firefox 2 had somehow lost the session with about 20 tabs open... which was frustrating, so I gave Opera a go... seems so much better than Firefox - much smaller memory/CPU footprint and faster response times, as well as some handy mouse gestures and that speed dial thing. It's pretty impressive! And looks like it works fine with SCIM...: 我想吃一点人东西。
Wednesday, May 02, 2007
finally some improvement!
Anyway, my agent was spending all its time choosing illegal moves and being punished by the environment which trivially rejected those moves until it returned a valid one. However, since I'm using a neural network as a function approximator for the TD(λ) agent, making 1000 illegal moves followed by one valid one isn't a great way to learn - the backpropagation for the many illegal moves not only slows the whole thing down, but much worse, it results in so much network noise that the reward for a good move seems to get drowned out, as one of my lecturers in DCU helpfully pointed out a few days ago.
So last night I realised that not only was training on illegal moves a waste of time, but more importantly, since illegal moves are well-defined, I could just have the environment tell the learning agent which moves are legal (by passing in an array of booleans, one for each action... false for illegal and true for legal). Then the agent devalues the illegal moves and pays attention to the valid moves instead... although this could have been implemented better. In fact, everything could do with a lot of refactoring - it's too coupled to add proper unit tests for some of the behaviour.
Anyway, I implemented this and now the agents train against each other at a rate of almost one game per second on my machine. Not blazingly fast, but enough to get the following modest result in enough time to do a demo hopefully:
score before training: 76%
score after training: 88%
Success: 22 tests passed.
Test time: 886.09 seconds.
That was for 100 evaluation games against two random players, followed by 500 training games against other TD(λ) players, followed by another 100 evaluation games against randomers. It's probably not totally accurate as it's learning even against the first random player, and also because random players don't play to win, so it's almost a different game!
Still, it's an encouraging result... actually the first encouraging result. Bit of a happy birthday present really...
Wednesday, April 25, 2007
boltzmann in action selection
The performance in Tyrrell's world wasn't all that great though, so I started decreasing the softmax temperature parameter to make it a bit more greedy... here's an interesting result:
with temperature ~=0.8:
Steps: 255 Sexed: 0
Steps: 11 Sexed: 0
Steps: 263 Sexed: 0
Steps: 274 Sexed: 0
Steps: 211 Sexed: 0
Steps: 257 Sexed: 0
Steps: 253 Sexed: 0
Steps: 251 Sexed: 0
Steps: 254 Sexed: 0
Steps: 307 Sexed: 0
Steps: 428 Sexed: 0
with temperature=0.14:
Steps: 391 Sexed: 0
Steps: 392 Sexed: 0
Steps: 393 Sexed: 0
Steps: 393 Sexed: 0
Steps: 392 Sexed: 0
Steps: 391 Sexed: 0
Steps: 394 Sexed: 0
Steps: 391 Sexed: 0
Steps: 394 Sexed: 0
Steps: 391 Sexed: 0
Steps: 392 Sexed: 0
Steps: 393 Sexed: 0
I'd have thought survivability was random if you did practically nothing, but I guess not? Anyway, that's obviously a bit too low.
Monday, April 23, 2007
MiniJavaBackend
Actually getting CALL working even half-properly was a total headwrecker. The documentation was shit, and there are still unexplained issues that I don't understand - for one, incoming parameters get copied into temporaries that are never referenced... instead, what look like older temporaries are used. Sob.
Monday, April 16, 2007
czt -> community Z tools
Never, ever, ever, ever, EVER use CZT. It is the most frustrating, dog-slow piece of shit software package I have used in my life, without exaggeration. With jEdit it's just unstable and crashy enough to warn the user away immediately.
As a plugin for Eclipse, it starts out nice, then after about one page of simple Z schemas, it parses the buffer repeatedly on every single keystroke, even if you tell it not to in the configuration page. It throws syntax errors on things that look right according to any examples of Z I have ((i,j) of a natural x natural type referenced in an axiomatic definition).
It started out in a promising fashion, and the output through latex looks nice, but now I'm in a position where I don't understand the errors it's giving me (after the unbelievable 3 minute delay every time I make a change (ie: hit some keys)) so I can't even convert what I have to tex and work on that directly - I have to delete all of the code that causes errors as quickly as possible so it will parse the buffer successfully.
Never, ever touch this stinking pile of pain. It's just not worth it.
Saturday, April 14, 2007
reinforcement learning with function approximation
Not sure now whether to have the TD net represent its estimated values like this or keep it as an expanded sigmoid for now.
Here's its performance just now on a 30-room random walk test - there are two actions: 0 is left and 1 is right. All rewards are 0 except when entering the terminal state (furthest room to the right) which gives a reward of +100. I kind of expected much better performance ages ago, but I guess it's harder to get these systems right than I thought. Although it completes the task in 15 moves a few times (the minimum amount), it often goes wrong.
learningRate: 0.5Sometimes it gets stuck in some weird state (local optima?) and never really learns anything. At this point, the action selection policy is just the action with the best estimated value unless the two actions appear worth the same, in which case it's a 50/50 tossup, or the epsilon-greedy function chooses a random action with probability 0.08.
steps taken on run 0: 697556
action 0 chosen: 91.2195%, action 1 chosen 8.78051%
steps taken on run 1: 67
action 0 chosen: 38.806%, action 1 chosen 61.194%
steps taken on run 2: 99
action 0 chosen: 42.4242%, action 1 chosen 57.5758%
steps taken on run 3: 121
action 0 chosen: 43.8017%, action 1 chosen 56.1983%
steps taken on run 4: 115
action 0 chosen: 43.4783%, action 1 chosen 56.5217%
steps taken on run 5: 27
action 0 chosen: 22.2222%, action 1 chosen 77.7778%
steps taken on run 6: 15
action 0 chosen: 0%, action 1 chosen 100%
steps taken on run 7: 35
action 0 chosen: 28.5714%, action 1 chosen 71.4286%
steps taken on run 8: 19
action 0 chosen: 10.5263%, action 1 chosen 89.4737%
steps taken on run 9: 17
action 0 chosen: 5.88235%, action 1 chosen 94.1176%
steps taken on run 10: 17
action 0 chosen: 5.88235%, action 1 chosen 94.1176%
steps taken on run 11: 15
action 0 chosen: 0%, action 1 chosen 100%
steps taken on run 12: 15
action 0 chosen: 0%, action 1 chosen 100%
I'm thinking the next step is to implement a softmax action selection method and maybe another test.. or, I dunno, actually carry on with the functional requirements of the thing. Time runneth short.
Tuesday, April 10, 2007
Bin Ankh
Japan, America and pacifism
Sunday, April 08, 2007
software for truly lame people: WhiteSmoke
The ad text read:
Write like an English pro using this software. With full-text analysis solution, convert simple English sentences to become more sophisticated automatically.
This premise raised my ire pre-emptively, since if the "simple" English sentences communicate the correct meaning, surely making them artificially "more sophisticated" is either distorting the meaning or at best, fluffing out concise text with superfluous padding. In a sense, de-optimising the text.
So I had a look at the site and found pretty much what I expected.
Before:
He was very interested in our product line, however, he has some issues with our priceing.
After:
He was very interested in our innovative product line, however, he has some significant issues with our pricing.
How does it know whether the product line is innovative, and is it even relevant? Obviously the assumption is that you would always refer to your products as "innovative" whether it is or not, but this just makes the word optional and eliminatable (okay, that's probably not a word, but it should be...).
Ignoring the fact that it corrects the obvious typo in "pricing" (which should be done by another single-purpose tool anyway) it also adds the modifier "significant". This is all clearly in the name of making simple text sound more formal and "clever", but I have two issues with this:
a) People should be able to do it themselves without changing the meaning inappropriately
b) This clearly changes the meaning inappropriately.
If someone doesn't speak enough English to write in an academic tone, they can get by with what they have and use a dictionary/thesaurus to get the meaning across. And a native English speaker has absolutely no excuse to even consider using this thing. Using an automated tool to make your writing look "clever" is the very opposite of clever. It's akin to having a voice filter on your phone that transforms your speech into a different accent (Cockney Skank to marbles-in-the-mouth Rupert). The whole concept is utterly lame and anyone caught buying such a tool should be whipped. Whipped!
Monday, April 02, 2007
TD(lambda) and bridge
Sunday, March 25, 2007
dodge this....
As NASA explains it, you might dodge a bullet but still get caught by its shrapnel. Among the questions they want to answer: Are you more likely to get cut off at the ankles by debris spattered along the horizon, or hit from above by material on high, ballistic trajectories?
Wednesday, March 21, 2007
consequences of blind faith
This really makes me wonder how people can possibly be that vicious and remorseless. This guy and his two friends beheaded 3 schoolgirls because they were students at a Christian school, as revenge (or something) against the Christian community for some previous violence against Muslims.
How could their made-up rubbish (religion) be more important than the lives of innocent civilians? He said at the sentencing that he didn't care about going to jail either, demonstrating a total absence of remorse.
As far as I see it, religion offers only the "blind faith" needed to murder innocents in the name of God and brotherhood. This is the same kind of conditioned psychotic mentality exhibited when fanatical Muslims burned down embassies and basically violently wrecked the place over those Muhammad cartoons. Idiots.
The old Christian phrase "love of money is the root of all evil" is inaccurate. I think the correct one should be "blind faith in religion is the root of all evil", because it allows apparently normal people to dehumanise and then horrendously butcher and murder other civilians.
Friday, March 16, 2007
China's new property law
"With the property law, finally, I won't be afraid of losing my bicycle. If I lose it, if it is still in China, it still belongs to me according to the law."
Sarcastic bastard. I love it!
Saturday, February 24, 2007
scim + firefox 2
/usr/lib/firefox/run-mozilla.sh: line 131: 2198 Segmentation fault "$prog" ${1+"$@"}I encountered this problem before and worked around it by specifying xim as the GTK input method module... but this meant I couldn't use any input methods.
So it happened again today when Firefox updated itself to 2.0.0.2, and I happened upon a much nicer workaround:
sudo vim `which firefox`then add:
GTK_IM_MODULE=scim-bridgea line before "moz_pis_startstop_scripts()".
This allows me to use SCIM in Firefox 2. Happy days...!
careful now... DOH!
...
Anyway, I did pretty shit in my fourth year semester one exams - worse than any other semester since I started the course in 2003. I think my average is about 67%, but I can't be sure until I get my Cryptography assignment marked... looks like I only scored 67% on that paper as well, though. Unnnh...
It's weird - I walked out of most of the exams thinking "I nailed that!", but nope. This means I need an average of 75% or better on my three subjects and final year project to get a first class honours degree. Usually I'd say "no problem, I keel you. Badges? We don't need no steenking badges!" but after last semester I dunno what to think - seems like my level of understanding sense was pretty inaccurate...
Friday, January 26, 2007
post-exam stress syndrome
Still, as long as I passed it, I can hopefully make up for it with the other stuff... I keep telling myself how I'll work more efficiently in semester two. I'd better...
In other news, this is great reading. In fact all the articles are cleverly written (and where does he find the stuff..??)
It is also important to remember that Glen and Sophie are characters in two separate productions. Hey, it's the magic of post production. Glen then sits down to talk to another new character about Sophie. This is where the seams are really starting to show, as Glen obviously is in a barracks in the middle of the jungle, while the man he is talking to is in an office, in different lighting, and in a different movie. This guy then hires someone to rescue Sophie.Brilliant.
Friday, January 19, 2007
Tuesday, January 16, 2007
私は茶を飲むのを好む。
For example... go to google translate.
Enter "Let's drink tea.", select English to Korean and translate.
Paste the result ("차를 마시자.") in to the box and translate back to English.
Surprisingly, the outcome is "Drink the car." What? Right...
It might be a good idea not to be organising any tea parties in Korean using translation tools to communicate for the time being...
Japanese isn't so accurate either: translating "I like to drink tea" to Japanese and back to English yields "I like the fact that brown is drunk". Firstly, that stuff should be solid or you should be seeing a doctor, and anyway, I don't want anybody drinking my brown. That goes straight in the jar under my bed.
Update 4th February 2011
- Now translating "Let's drink tea." to Korean and back results in "Janhaja tea". Eh.
- The Japanese round-trip for "I like to drink tea" is now accurate.
It's a pity I didn't save some more bad examples of which I compiled quite a few, to see how the state of the art (assuming Google Translate is reasonably representative of this) has advanced in the last four years.
exams...
Firstly, our software patterns & metrics exam is clearly structured - past papers online for the last few years are all "answer 3 out of 5 questions, each question on a well-defined area of the course: design patterns, architectural patterns, metrics, estimation and testing". That's the whole course. Easy peasy.
With the graphics course on the other hand, we'll be asked to answer 3 out of 4 questions from about 10 different areas... which means we have to study everything. Lame!
Tuesday, January 02, 2007
athbhliain faoi mhaise!
Thrilling stuff...
Saturday, December 23, 2006
Roujin Z?
Wednesday, December 13, 2006
(a) The complex conjugate of a complex number is the number with the same real value and imaginary magnitude, but the imaginary part is opposite in sign.
...
3.
* scale plots/images
A convolution is the result of the application of an impulse response function to an input signal.
The input signal consists of a series of samples (impulses) of various magnitudes. Each input produces a corresponding input response function
Since 'B' is composed of horizontal line samples, it appears as a horizontal broken line in the fourier transform. Conversely, the 'A' being composed of vertical lines appears as a vertical line in the fourier transform.
The diagonal crosspieces of the 'A' show up as rotated diagonals in the fourier transform, while the curving edges of the 'B' show up most as the vaguely rounded shapes at the edges of the horizontal line in the centre of the plot.
clear;
load 'p:\public\alistair\ab'
subplot(3,2,1), image(final);
colormap(gray(256));
y = fft2(final);
subplot(3,2,2), image(256*log(abs(y))/max(max(log(abs(y)))));
ydim = size(y, 1);
xdim = size(y, 2);
mask = zeros(ydim, xdim);
msize = 140;
mask(:, (xdim/2-msize/2):(xdim/2+msize/2)) = 1;
mask2 = zeros(ydim, xdim);
mask2((ydim/2-msize/2):(ydim/2+msize/2), :)=1;
y2 = mask .* y;
ya = ifft2(y2);
y3 = mask2 .* y;
yb = ifft2(y3);
subplot(3,2,3), image(abs(ya));
subplot(3,2,4), image(256*log(abs(y2))/max(max(log(abs(y2)))));
subplot(3,2,5), image(abs(yb));
subplot(3,2,6), image(256*log(abs(y3))/max(max(log(abs(y3)))));
----
lenna....
clear;
load 'p:publicalistairlenna';
subplot(2,3,1), image(xx);
colormap(gray(256));
ynew = 512;
xnew = 512;
scaled = zeros(ynew, xnew);
scaled(1:2:ynew, 1:2:xnew) = xx;
y = fft2(scaled);
subplot(2,3,2), image(256*log(abs(y))/max(max(log(abs(y)))));
subplot(2,3,3), image(ifft2(y));
mask = zeros(ynew, xnew);
msize = 128;
mask((ynew/2-msize):(ynew/2+msize),(xnew/2-msize):(xnew/2+msize)) = 1;
ya = mask .* y;
subplot(2,3,4), image(256*log(abs(ya))/max(max(log(abs(ya)))));
scaledimg = abs(ifft2(ya));
subplot(2,3,5), image(256*scaledimg/max(max(scaledimg)));
the 'ultimate' partner?
Meanwhile, nine out of ten women look for a man who can make her laugh and 73% want someone who will "automatically" pay for a meal.
Looks like 73% of women are greedy twats, then.
What a disgusting attitude that is, to expect men to 'automatically' pay for all meals. Why shouldn't they pay for it? Selfish arseholes.
Friday, December 08, 2006
Atari Falcon emulator
Hatari in CVS now has the beginnings of support for TT and Falcon emulation - no software that could emulate these machines successfully has ever been released or even publically mentioned before as far as I know.
Unfortunately, Hatari is only developed for Unix systems and the source doesn't seem very easily portable to Windows as yet (okay, I haven't looked at the source, but I'm guessing that that's the case). However, it compiles and runs just fine in Ubuntu and performs well. What a bombshell!
Here's the announcement on the great atari-forum.com site.

