Wednesday, October 26, 2011

Emacs: lines of code in various languages

After reading a flippant remark, I wondered what languages (and how much code in them) made up Emacs. Thanks to cloc and a few minutes with a spreadsheet, I now know the answer to that.

Saturday, May 14, 2011

w/aw

Whine: flat tire.
Possible anti-whine: discovered the source of the random noises from the back of the car: the CNG tank is loose. I probably wouldn't have noticed that for a long time if I hadn't had the flat.

baby's evening in

The other evening, my wife had to take my mom to a doctor's appointment, and then go shopping. She left the kid with me and made me promise not to use the computer in her absence. Fine, I said. I'll just use my phone...


Saturday, January 29, 2011

park and ride, liberty

I parked at the Park & Ride at Liberty this evening.  Pros: excellent view from where I was (fourth floor), clean, guards everywhere. Cons: driving to the exit sucks.  Also, Block A on every floor is right next to the ramp; if a car is backing out of a parking spot there and you're driving up the ramp, you'll have to stop partway to let it pass.  Also also, the drive to the exit uses the same ramp, and the signs are all wrong ("Keep Right" when it should say "Keep Left").

Still, the view is great.  Maybe I'll bring a camera next time.

Thursday, November 04, 2010

wanted: python to php

I'd like to see more <something> to PHP compilers. PHP code is easy to deploy, but annoying to write if you've used better languages.

Wednesday, October 27, 2010

buy spl, dol?

It has learnt through sources, that NTC has imposed 25 percent anti-dumping duty on import of hydrogen peroxide from Korea and Taiwan and 71 percent on its import from China.news item

Descon Oxychem Limited:

Sitara Peroxide Limited:

Sunday, October 24, 2010

Suture opening monologue

How is it that we know who we are? We might wake up in the night, disoriented, and wonder where we are. We may have forgotten where the window, or the door, or the bathroom is, or who is sleeping beside us. We may think perhaps that we have lived through what we just dreamed of. Or we may wonder if we are now still dreaming. But we never wonder who we are.

However confused we might be about every other particular of our existence, we always know that it is us. That we are now who we have always been. We never wake up and wonder, who am I? Because our knowledge of who we are is mediated by what we doctors of the mind call our self schemata -- the richest, most stable and most complex memory structures we have. They are the structures which connect us to our pasts, and allow us to imagine our futures. To lose those connections would be a sign of pathology, a pathology called amnesia.

But it makes no sense to begin the story here, without its history, its past. So, let me take you back to a proper beginning. To a time before identity has been confused.

Suture

Sunday, October 17, 2010

thanks, facebook.

The Imported Stories feature is no longer available. Most of the sites supported by this feature now allow you to publish stories to Facebook directly from the site.

Gee, thanks. I can no longer republish an RSS/Atom feed to my profile. Now I have to figure out how to republish my Blogger posts. Grr.

Update: I have to import as notes. Unfortunately, it only works for one site, and I already import my reddit submissions. Blah.

spendy phones

I found an HTC sales center in the Park Lane Tower today. The saleslady said they'd have the HTC Desire Z in at the end of the month, and it'll cost at least Rs 70k. 70k! That's about $815. I'll pass.

Monday, October 11, 2010

postcards and encryption

People used to use the postcards argument when trying to promote email encryption — “You put sensitive or private information in a letter, instead of writing it on a postcard.” Today, more people than ever use unencrypted email, text messages, and instant messaging. The usual case is that their passwords are encrypted (but that's not even true for a lot of POP3 users). Almost no one sends letters, though they do receive bills and such, and identity theft is a larger issue than it was fifteen years ago or so.

Is there a more relevant analogy than postcards for the current age?

Thursday, September 16, 2010

stopping at 3.2, it's late

Today's problem:

Compute the largest element of a list of reals.
Your function need not behave well if the list is empty.

My solution was to define two functions:

fun max (a:real) b =
     if a > b then a else b;
fun maxls L =
    if (tl L) = nil then (hd L)
    else max (hd L) (maxls (tl L));

The solution on the website is

fun maxList(L: real list) =
    if tl(L) = nil                             (* L is a single element *)
        then hd(L)                             (* the single element is the maximum *)
    else                                       (* assume there are at least 2 elements *)
        if hd(L) > hd(tl(L))                   (* the first element exceeds the second *)
            then maxList(hd(L)::tl(tl(L)))     (* eliminate second element *)
            else maxList(tl(L));               (* eliminate first element *)

My way's not as efficient, but it's easier to follow.

Wednesday, September 15, 2010

going through "elements of ml programming"

Just finished chapter 2 (“Getting Started in ML”). One question has me stumped. We're given a bunch of type expressions and asked to provide examples of values that have those types. The one that I can't seem to find an example for is:

((int * int) * (bool list) * real) * (real * string)

I can easily construct an example that matches

((int * int) * bool list * real) * (real * string)

but what has the type (bool list)? A tuple with one element is really just a parenthesized expression (consider the equivalent expressions a + (b * (c)) and a + (b * c)).

I'm doing the exercises with Moscow ML.

Tuesday, August 31, 2010

Tale of the Tesla coil, or learned idiocy [by Julian Assange, June 26, 2006]

Tiki Swain, is Science Works demonstrator. Science Works has a lightning generator, a 2 million volt Tesla coil, a very noisy and impressive machine. She writes:

So I've asked the question "What is lightning?". Usually I get the older kids (who've learnt a few things at school) saying "Electricity", "static electricity", "electric current", "a flow of electric charges". And younger kids say things like "It's a bright light", "a bolt from the sky", "it happens in a storm", "it's a light that comes with a big bang". This time, I got emotive/experiential words - very unusual. I'd ask what lightning was, and they'd say "It's scary". "It's loud". "It's exciting". "It's noisy".

The younger children's descriptions are powerful, communicatable phenominological descriptions of nature. The older children's descriptions are useless, unexperienced rules that they've learnt to regurgitate. One may as well say 'God makes it go'. And that is preceicely the point, authority makes it go.

By being an adult asking for a question to which she obviously already knew the answer, she had given them some kind of regurgitation context. The older children give answers that fit social expections not answers that are meaningful --- because the social expectation is to produce meaningless answers! The younger children are not yet sophisticated enough at understanding social context so reveal what they really think i.e something with predictive and descriptive power.

Why do things fall to earth? Answering 'gravity' only tells you about a rule human beings have agreed on. The rule is, when asked why stuff falls one should reply with the word 'gravity' and not, say 'love' or 'God'. But it is a pleasure to say that apples 'love' planets just as much as planets 'love' apples and that 'love' fades with inverse square distance. Ah huh! There is your true content, it's the predictive description of behavior in the last part of the sentence, which we may call anything we wish. The younger children describe the behavior of the natural world. The older children describe the behavior of society alone. They're not stupid. They know their survival depends on saying the right thing, at all possible times to people in power

Wednesday, June 23, 2010

These work well enough for me to be comfortable with them:

Problems: twittering-mode doesn't give me a threaded display. That might be a lot of work. It takes care of OAuth issues, though. Weblogger.el doesn't post labels on blogger posts. That might be easy to fix.

clone of my own

I was just finishing up on some commits at work when I lost power. The UPS my DSL modem is on isn't working properly, so I couldn't push the commits to the server.

When I got home I realized I could've simply cloned the work repo, put a copy of it on my USB stick, and done a git push from my home box. Blah.