“Write once, attempt to debug everywhere”

“Write once, attempt to debug everywhere” is probably way more accurate than “Write once, run anywhere” – at least for GUI apps. There’s something rather special about ideas that are theoretically amazingly wonderful yet end up being a major pain in the butt when you try to put them in practice, isn’t it?

The older Wikipedia App happened to be in PhoneGap, and I consider it one of my biggest blunders to not have torn it down on day 0 and rewritten it in something saner. I once started writing a blog post for the Wikimedia Blog about why we switched from PhoneGap to native apps, but it was killed for having too much profanity in it :) Someday, perhaps.

PHP being insane, part 5832

Somehow: ( $a && $b ) || ( $b && $c ) || ( $a && $c )

Became: $a ? ( $b || $c ) : ( $b && $c )

Became: count( array_filter( array( $a, $b, $c ) ) ) >= 2

Became: "$a$b$c" > 1

God dammit PHP…

(from discussion among me, ^d, ori-l, bd808 and anomie on #mediawiki-core about how to represent ‘if at least 2 of three conditions are true’)

Doing Laundry

At a hotel in SF, doing my laundry. This trip has made me more amenable to taking my time to do things. Feel more happy in general and less restless :)

Devlog for Tuesday, September 24, 2013

I’ve given up on trying to make DevLogs really comprehensive and complete, and just try to make them – even if they are incomplete. Perhaps this will help me actually write more devlogs, and thus make it more comprehensive…

I started on the Functional Programming in Scala course today. I wanted to do it the last time, but did not find the time. This time will be different – I’m in a different spot mentally, and a big drain on my emotional / time resources (“college”) is no longer a factor. I’ve already gone through the first week’s lectures (most seem straight ports from SICP), and am 2/3 of my way through the assignments for the first week. Though I’m normally not fond of the typical types of exercises (“How many ways can you make change for this scenario?”), doing them functionally seems to be enough of a twist to keep me interested. The regular languages I seem to work with these days (Java, PHP, Puppet, Python and a bit of JS) aren’t exactly well tuned to the functional style of programming (except JS, but I don’t really do that much JS these days) – so going through this course and hopefully building something in Scala can exercise my ‘OMG HOLY SHIT THIS NEW THING IS AWESOME!!1’ muscles.

The course recommends using Scala IDE. Which is Eclipse based. Despite my deep distaste for Eclipse, I’ve given it a shot and it seems fairly stable and much less shitty than the Eclipse I’m used to! Let’s see how that goes.

The way I learn the best seems to be to find a project I want to build, and then build it in a new language. I’m looking around for fun projects that I could build with Scala, and I’m pretty sure I’ll find one at some point. I should also try to diversify the communities I contribute to, so perhaps I should look for a non-Wikimedia project where I can contribute to in Scala. Should be fun :D

Other than that – I’ve been investigating performance problems with the Campaigns API – turns out Mediawiki’s Parser is really, really slow. Who would’ve thought, eh? ;). The ‘solution’, of course – is to just add more caching. Which is a sortof biggish, hairy-ish problem because of the number of changes that can cause cache invalidation. The way Mediawiki handles caching is… rather complex – but that is more due to how much functionality exists rather than anything else. Needs a proper ‘clean’ solution that is not just “Let’s cache everything for 5 minutes!!!1”. Should be fun to write up and fix!

I’ve also been spending time integrating Mediawiki-Vagrant with Wikimedia Labs. This will make it easy for anyone to setup a base mediawiki installation on Labs, and save time dicking around various mundane deployment-of-test-instance issues (did I turn on caching? How do I get this extension on? etc). This is interesting because it merges two different puppet repos – operations/puppet.git and mediawiki/vagrant.git on one machine and provides different ways of managing them. Since this is also using puppet as a sort of ‘deployment’ tool (rather than just a configuration-of-systems tool), that is an interesting / fun aspect too. Should be able to get the patch merged in a few weeks.

I visited San Francisco for the last 2 weeks. I don’t really feel insecure anymore :)

Comments on again

WordPress decided to be a dick and turned off comments without telling me. They’re back on now.

Why does all software suck?

An Entire Night Wasted

[Warning: Childish rant ahead]

My natural sleep cycle seems to be one that tends towards the darker times – sleeping before 3AM feels like an abomination, before midnight unheard of. My best work seems to be done between 2AM and 5AM. My current ‘sleep cycle’ has me sleeping at about 8AM, and waking up at about 5PM. Plenty of sleep for the day, eh?

It is probably not healthy. I don’t look, or feel healthy. But that is the way it is.

SO IT FUCKING SUCKS WHEN THE POWER GOES OUT AT MIDNIGHT, BECAUSE I HAD JUST STARTED GETTING SHIT DONE. AND THEN YOUR PHONE REFUSES TO TETHER INTERNET, BECAUSE FUCKING ASSHOLES. AND THEN THE POWER COMES BACK AFTER THREE FUCKING HOURS AND YOU STILL CAN NOT GET ON THE INTERNET BECAUSE THE FUCKING LINE IS DEAD. IT IS MIDNIGHT AND YOU ARE IN FUCKING CHENNAI SO YOU CAN NOT EVEN GET THE FUCK OUT OF THIS PRISON. YOU CAN NOT SLEEP BECAUSE YOU JUST WOKE UP. FUCK THIS SHIT.

I’m scarily addicted to the internet. All my friends are there.