I Eat Rainbows

The random ramblings of a self-professed rainbow eater

This Blog Has Moved

leave a comment »

to nsb0.net/blog. Feel free to check out the rest of the site as well, though as of now there’s not much there.

Written by Sohum

02.05.2009 at 17.28.20 (769)

Posted in Uncategorized

Java: First Impressions

with 2 comments

(For context, I’ve just spent most of my [Australian] summer on a large project in Common Lisp, and enjoy working in Ruby and Haskell.)

So I just finished my first small/medium-sized project in Java. There’s a few things that stuck out at me.

  1. Boilerplate, boilerplate, boilerplate! Why do I have to create so many oneline getX functions? What’s with the verbosity? What’s with the creating classes after classes for the simplest extensions?
  2. string1.Equals(string2)? Really?
  3. Uggh, lack of closures. Had to create an entire class hierarchy (complete with discounted boilerplate!) just to get a freakin’ lambda.
  4. No tuples. What. The FUCK.
  5. Oh, hey, this for (Type var : list) syntax is surprisingly elegant for Java – whaddya mean I can’t stick a literal list in there? No, of course not, that would make too much sense.
  6. Ick, no deep copy. Spent so long tracking down a bug that boiled down to array[][].clone not doing what you’d expect.
  7. Wait, are you seriously saying the () at the end of a function call with no arguments is non-optional?
  8. if statements. You want two clauses, you have to go if ((-a-) && (-b-)). And then they complain about Lisp’s parentheses.
  9. Nothing like macros or eval. There’s so many places I could’ve reduced duplication and verbosity – and Java code definitely needs it.
  10. Objects don’t evaluate to true? Seriously? You’re not Haskell, stop pretending your type system is anywhere near as robust. In the meantime, is being able to write if (obj) instead of if (obj != null) that terrible?
  11. What’s this about “int cannot be dereferenced”… oh, that’s right, you don’t have true OO. Seriously. It’s 2009. You should’ve fixed that a long time ago.
  12. Dying … of boredom … during compile cycles. After living with a REPL for so long it’s almost unbearable.
  13. Solitary mark in the plus column: The existing API stuff is really nice. I’m not sure there’s anything in there that’d be too hard to write, but it’s good to have tested code right there.
  14. Subjective little mark in the negative column: I don’t like C-style syntax in languages other than C. It just doesn’t fit well with Java’s verbosity.

Bear in mind that these were all issues that cropped up one small/medium project. I don’t think I’ll be willingly going back to Java again, but the concept of JVM languages is sounding more interesting.

Written by Sohum

17.03.2009 at 08.35.50 (399)

Posted in Java, technology

Tagged with , , , , , , , , , ,

Ramdisks, Firefox, and the speeding up thereof

leave a comment »

So this idea has been going around the internet, of putting your firefox profile directory into tmpfs, to get around sqlite’s insistence on reliability when speed is more important.

I implemented this, and liked it. Speed, nom.

But! I happen to be using an ailing old laptop, with roughly as much RAM as a toaster. It could just handle the extra load, but the profile directory was constantly spewing expletives at me – most notably, failing silently when trying to install addons.

There did exist RamFS, which grew and shrunk in RAM as needed. Still, that’s a lot of memory…

And, well, the idea itself didn’t seem that elegant to me. Storing an extra copy of your profile directory? and resynchronising it with the harddisk copy every so often? This is Linux, after all, the OS that gives you fine-grained control of your system should you so desire – surely there must be a cleaner way.

And then … from what I understood, SQLite was IO bound in writes. Reads shouldn’t really need locks or suchlike, right?

This is what I did:

$ x=[random junk firefox uses]
pushd
cd ~/.mozilla/firefox
mv $x.default $x.default.fs
mkdir $x.default.tmp
mkdir $x.default
echo firefox.tmp $(pwd)/$x.default.tmp ramfs noauto,user,exec 0 0 | sudo tee \ 
    -a /etc/fstab
echo firefox.cow $(pwd)/$x.default aufs \ 
    dirs=$(pwd)/$x.default.tmp:$(pwd)/$x.default.fs=ro,noauto,user,exec 0 0 | sudo \ 
    tee -a /etc/fstab
sudo sed -i 's/exit 0//' /etc/rc.local
echo "mount firefox.tmp\nmount firefox.cow\nchown -R $(whoami): \ 
    $(pwd)/$x.default.tmp\nexit 0" | sudo tee -a /etc/rc.local
echo rsync -av --delete $(pwd)/$x.default/ $(pwd)/$x.default.fs/ > ~/bin/cpfox
chmod +x ~/bin/cpfox
popd

Then crontab -e and add cpfox to it, maybe once every halfhour.

Neat, huh? At least the intent – aufs layering a dynamically growing ramfs on the filesystem, and the changes being synced across every so often. I’m not too sure if the actual implementation does what I want it to, and it could probably do with a ram-clear every now and then.

If anyone has any tips, please! Meanwhile, I hope this will help some people out there.

Written by Sohum

20.02.2009 at 21.53.46 (954)

Posted in linux, technology

Tagged with , , , , , ,

They Fight Crime! 1: The Republican Assassin

leave a comment »

He’s a suicidal Republican assassin trapped in a world he never made. She’s a psychotic impetuous lawyer with an incredible destiny. They fight crime!

This time, it would all be worth it.

He fired his grapple hook, and moved carefully up. Fourth … fifth … sixth. There. He carefully sliced some glass out, and slipped in.

He padded inside, carefully finding the bedroom. He’d been careless once before, but this was not the place for those thoughts.

He took a moment to look around. The standard donkey, the smiling blackface, that insipid slogan. His source had been right on the money – this was another of the fanatics. Volunteered day in day out at the local center, no doubt – it made him sick, and not just the exploitation of the system.

He looked at the mark. Stupidly beatific smile on his face, cuddled up. Safe and secure in his own dream world.

He sighed. This was always where he got second thoughts. Not because of any sympathy, no, absolutely not. But because the missions were all that gave him focus, drive, purpose. He had no desire to regress to listlessness.

He shook his head, and carefully assassinated the mark. He watched himself do this dispassionately – where’d the drive and zeal he’d once had gone?

He left via his getaway car, and drove away to the prebooked motel, already feeling drained.


The next day’s news. Happy shiny people talking about happy shiny policies and happy shiny ideas and happy shiny futures. He looked at his bag, and at the twist of rope sticking out, but didn’t even seem to have the energy to attempt it. What kind of life was this to lead? Why on earth was he doing this, when all it did was be sensationalised a little, never stopping or even giving pause to the country’s slow inexorable slide into its own destruction?

He kicked himself back into the bed. No, he just couldn’t take it. He could not force himself to live longer in this horrible, corroded country and world. He would simply -

His cellphone rang.

He hit answer and speaker. “Yes?” There was no need for names.

“Another specimen of the virus has been found. Head over to Shangri-La, and you’ll be given the details, and your payment for the last strain.”

He nodded listlessly, and, realising, spoke. “Yes.”

Maybe this time it would all be worth it.


“Police have found the dead bodies of prominent local Democratic supporters, Asheet Narjwal and Timothy Clyde, in their homes this morning. The state has offered protection to any other campaign leaders, and most have taken up the offer. Noted local libertarian Bartholomew Ressinger has turned down this offer, however.”

“Heh. I’ve got so much protection of my own that I’m confident I won’t need anything else. Heck, apart from all the tech, I’m a licensed gun owner! The killer’d have to be bloody suicidal to come after me…”

Written by Sohum

03.02.2009 at 20.42.40 (904)

Posted in writing

Tagged with ,

Red Sky

leave a comment »

Red sky at night
Sailor's delight
Red sky at morning
Sailor, take warning

Yawn. Daybreak. Open eyes, flick off autopilot, and look up.

The fog clears, reveals the world. Horizon curving up into the vertigo-inducing distance. Sky above me.

Red.

I have to fight the urge here, to sweep the flyke around. The sky is always red here, in the morning. Your sun dying does that.

I stretch, and sit up. I’ve travelled… a good distance throughout the night. Not that it matters, but I like covering these distances. It’s a goal, of sorts.

I splash my face, call up a food bar, and start looking for somewhere to touch down. The map shows me an city not too far off, next to a forest I can regen fuel in. Ok. Let’s try that.


Yup, definitely abandoned. Not a sign of life or power anywhere.

I park the flyke in the forest and head to the still-imposing city. There was apparently a military base here, and when I get there I see it’s been, unsurprisingly, swept clean. I’m about to leave when I notice a small disk, wedged into the far corner. Interesting.

I take it, and head for the city complex. There’s a few power cells (more power never hurts), and — jackpot! — a preserved garden, in some form of greenhouse. This will feed me for weeks, and will be a nice change from the Nutritious All-Natural freakin’ tasteless bars.

I carry my hoard back, and dump it into the flyke. The grass and that tree in a perfect circle around it’s disappeared, so the tank’s full. Hey, I can make that a project – find out how to make the regen signature less obvious.

I strap in, take off, and feed in the disk.

It’s a letter.

“If you’re reading this, sweetheart, I haven’t been able to convince the radzi to let you and Harz come with us. So, I want you to remember every single thing I’ve told you about living in a red giant world…”

I blank it. I do not feel comfortable reading some soldier’s goodbye to his family. They must be dead, the poor bastards. There were precious few of us who were prepped enough to survive alone on the ringworld after the radzi upped and left, let alone those who realised it would die as well. And then there’s me, but I got lucky.

It’s only after I’ve flown through the day, through the shadow square-created fog that always denies me a sunset, that I realise there’s far more used space on the disk than the letter would account for.


The brute-force attack is finished by morning – the passphrase is another message from the soldier. I feel nauseous at this, but control it before the flyke’s systems try to, uh, “help”. It’s decrypting the contents now anyhow.

I sigh. I’m going to have to regen fuel again today. A brute-force attack and then decrypting roughly four terabytes of data ain’t cheap. It’d better be worth it.

The city I land in has retained some of its beauty, since the Abandonment. If I squint I can almost see the children cavorting, their parents watching them and smiling, the radzi watching them and not smiling so much…

I shake my head, and scavenge. The shadow square’s almost here by the time I remember to head back, backpack depressingly light.
When I get in the flyke, it pings me. The decryption is complete. I take off, and run the binary in a sandbox.

It’s an AI. A sentient one, by its confused activity, until it finds the speakers and microphone interfaces.

“Hello? Harz? Maria? It was Harz who decrypted it, wasn’t it, he was always such a smart littl’ kid…”

Now I really do vomit. It’s a brain-scan of the soldier – he must have gone to terrible expense to get this done, not to mention ethical dilemmas and hiding it from his superiors. And now I’ve woken him up, to tell him what?

That his family, whose company he was expecting to wake up in, are dead? That he’s been in stasis for over ten years? That the world he knew has changed so drastically that he might as well as have flown to the other side of the galaxy? That all he has for company in an entire world is one wanderlust-infected old man, walking the world to his death?

I switch off the AI, and lie back. And – a part of my brain is churning away that cities must dissipate the fog somehow but I shut it up, because I can see the evening sky.

It’s red.

Written by Sohum

08.12.2008 at 11.57.16 (539)

Posted in writing

Tagged with ,

MicroNaNo 5: Victor Exiled

leave a comment »

This one’s kinda weird. It’s not so much a story as a stew of different random ideas that bounced through my head, and on top of that it’s not very well written. Sorry!


No one knew how it started.

There’s this theory that ideas, cultural concepts as they are, evolve and spread by natural selection. They are said to mutate, vary, breed, and procreate similarly to actual life. Furthermore, there are analogies to pathogens, ideas that don’t benefit the host but are exceedingly good at replicating. If this theory of memes is taken as true, we can never know how It started, save for valiant and dedicated efforts of future poltivologists.

All we know is that on the twenty-fifth of December, two thousand, three hundred and forty seven, a majority of humanity woke up with the burning desire to have no more Victors in their lives.

No one left for work. Well, I suppose a few people would have, and wondered at the lack of rush hour traffic. But most left their homes, carrying anyone named Victor with them. Some had enough presence of mind to go through their morning routine first, and some were bleary-eyed and in their nightwear.

I am told that there was a sense that the Victors had “won” something. At least, this was true in the local strain of the mirus, though I believe with my rudimentary knowledge of the theory that it was one of the fundamental concepts at the source.

Anyway. They marched us into the Outside exits, and very simply, kicked us out into the wasteland. We were shellshocked and culture shocked and many of us didn’t survive outside our environment. Some went crazy and ran off. Others refuse to do anything but sit by the entrance and hope they’ll be let in. We had a killer, who took out his anger on the rest of us. He died in the struggle.

But, on the whole, it seems like Victors have a strong survivalist streak.

So we regrouped. We gathered — it took two days for a sort of local gravity to attract everyone to one spot on the circumference of the arcology, and we think there’s another settlement diametrically opposite. We renamed, and we organised. At the suggestion of a historian, we tried eating this weird red round things, and drinking from what looks like a blue sewer, and they seem to satisfy our hunger and thirst.

We still don’t know why they did it, or what they thought afterwards. Our communications are choppy, and our power is rapidly running out. Some genius invented a way to power our radios by cranking this handle, and others are working on reverse-engineering our batteries for storage. We’ve been using as little power as possible, which means using high-powered portable computers for a /chance/ at choppy research access is right out.

And as for the future… well, who can say? Some of us remember enough geography to say that the city of ardent (ha, I don’t need to capitalise it anymore!) is to the west, and we may as well travel there to meet up with its Victors. And after that… I suppose we will eke out a sort of living and society.

We are Victors, exiled. We have to make the most of it.

Written by Sohum

19.11.2008 at 14.56.49 (664)

Posted in micronano, writing

Tagged with ,

MicroNaNo 4: Midnight Special

leave a comment »

My name is Avanya Ofiaragwalt.

It is my stage name, whatever. My act is very different from the normal ones Usmiecha sie Klaunow do, with very many reasons. For one, it is at night – late night. For two, it is not advertised, and only those who know and those who those who know have told ever come. For three, it is not a happy act.

No, not for me.

They tell me I am – a very good actor. They tell me this because they see my act, — they see my act, knowing what they will see — and they see what I do, and they think, “Oh, this woman, she must be acting, yes?” They cannot think of the idea that it is not an act. And I am not permitted to tell them. I am not permitted to tell anyone.

It is not an act. But it is – entertainment. If they thought it was real, they would still be entertained, those who come. Horrified, perhaps. Shocked. But not unentertained.

I am dragged out. Sometimes this is on a leash, sometimes just by my clothes. I scream, here. I scream and shout and dig my nails (my nails, which they always paint and manicure, every single time) into the ground. It looks like it is an act.

They – well, it’s not a they, yet. There is only one person at this point. It is different, each time — I do not know who it is, until they come to my room and drag me out. He leers at me, sometimes. He will do worse, later.

They all will. They – abuse me. Every time, I get many many bruises. My hair rips, and my makeup runs, and I am forced through indignities and humiliations. When the Vladca comes out, I have broken a bone, one or two times.

And always they will think it is an act. When they shout at me and laugh, it is an act. When I scream, it is an act. When I cry out, it is an act. When I bleed, it is an act. When I curse them and promise to kill them and swear at them and then collapse, it is an act.

When I flick out my small knife, and stab and kill the Vladca, they stop. They do not stop thinking it is an act, no. But they do realise they have never seen this before, or never heard of this being done.

When the others rise from their stupor, and start yelling, they do not know. They are confused. Still, they think it is an act.

When I run, run as fast as I can through the small flap I have cut away before, and they yelling gets louder, it looks like an act again. They think it is an act.

Then, when they hear the dogs, they clap. They clap loud enough for me to hear, though I am far and running. I think the others said it was still an act, and they believed them. It would not be hard to fool them.

I do not know if any of them ever wondered why the Midnight Special was never performed again.

Written by Sohum

12.11.2008 at 14.21.53 (640)

Follow

Get every new post delivered to your Inbox.