Composition

June 30th, 2008

Tim Bray over at ongoing has a post up on megapixels. He has a decent (and from what I understand, correct) explanation of what is good and bad about racing towards higher pixel counts.

I agree with his explanation, I disagree with his conclusion, and here I am treading on thin ice. I don't really take that many photographs, not anymore anyways. Besides the only reason I know anything about photography is because of my dad, who's a better photographer than I ever will be. I however like cameras, old, heavy ones which have that loud shutter releases.

Old cameras with satisfying sounds do not produce pictures which are easily digitized, and hence do not support Tim's idea of Lightroom composition. But this is not my main reason for disagreeing with Tim. Digital cameras are great, it costs little or nothing to shoot a picture, and shooting a bad one is almost free, and free is a great thing when you are either experimenting or learning.

That said, 15 years ago, one essentially had a copy of nearly every photograph one took, and you ended up looking at both the good and the bad, because deleting a photo was too expensive. I once felt that being able to get rid of photos as easily as one now can somehow took away from what was recorded, its somehow bad that one can choose what one saves. I have gotten over that feeling (film is surprisingly expensive when you are a student and your parents aren't paying for it :)). Composing post fact seems worse somehow. My dad and I used to take photographs in the jungles in India. The animals aren't usually tame, and they don't always tend to show up at photogenic locations with perfect lighting. Worse still, you don't always have time to compose, and as a result when you find something interesting enough you shoot as many photos as possible hoping that some of them are composed reasonably well.

In cases where composing photos is easier (flowers for instance, since that is what Tim talks of), it seems like there is artistic value to actually composing things, besides maybe you end up with more relevant pixels once you are done. I don't know, somehow the idea of lightroom composing rubs me the wrong way. But then again I don't really know that much about this.

Canned Responses

January 16th, 2008

This is where I bitch about serialization in C++. If you do not understand what that previous statement was about, you might want to skip all of this entry. Really, skip this entry, it does not help you with much. Yes, I am home for the winter, I am leaving in a couple of days. It was good to be home, this is my last winter break for a while. But really, this entry is about serialization, maybe somewhat about reflection, but mostly about serialization. Leave it alone, it doesn't link to that much even.

Before I begin bitching, there are a couple of things that need to be put out. Yes I am aware of the existence such things as s11n, and the Boost Serialization library. I have even spent a few days looking at such things as Thrift, and the promise of writing something like an IDL, passing it through a compiler, producing C++ code which then serializes itself. Really this is a great idea, and if I was worried about writing serialization code for myself I'd have picked one of those. Overall, I would probably have gone with s11n for things I was adapting to be serializable, and Thrift for everything else. But then again, I could also use Python, Java, C# or any of the dozen languages which provide nice serialization interfaces.

The thing is I am not writing code for myself, well I am, but not really. I am trying to see if this class I am TAing can be made doable in C++. I don't like all of those solutions for various reasons, listed forthwith.

  1. s11n, boost: I think any serialization depending on me completely specifying what needs to be serialized in code has issues. In short, there are times when data fields are added to classes, and people forget to change code. This is somewhat panful to debug (think of forgetting to initialize stuff in a constructor and such), adding another place where you need to worry about this seems like a poor decission.
  2. Thrift, ...: Learning another language, merely for the privilege of serialization seems a little counterproductive. Besides why pick Thrift's IDL over any of the other serializable language. After all managed code is supposed to become as fast as native code, give or take a little

No sir, I do not like either of those choices, and for once in my life, I find myself wanting something lots of languages have, in C++, because pig headedly this is the Java alternate some of us backed.

s11n's author aptly states that serialization is easy, it is deserialization that really sucks. Assuming we are not going down blind alleys (as I once was), packing data in a known format, with know boundaries, is a fairly reasonable strategy of assuring oneself that the data seen on the receiving end did indeed originate from a compatible library. You ask what of data which has boundaries and properties identical to what you're expecting, but is actually corrupt. Well no matter how much you worry about solving problems involving arbitrary data, one must always remember that provably showing equivalence between two generators of data is unsolvable.

Now the only real reason deserialization is so hard, is because in some cases you want people to be able to encapsulate arbitrary data in objects belonging to your class. Arbitrary data is somewhat hard to dynamically recreate. And by somewhat I mean a lot.

Let us assume then that we neither want to learn an IDL, nor do we want to face the problems I feel exist with using libraries like s11n. However, we also recognize the fact that s11n or boost is probably much better done than anything we can produce, and perfect in a reasonable amount of time (a few hours in particular). Now if we had reflection, or what some fancy sites seem to call meta-object programming, we could go through the process of producing code which automatically serializes all data fields in an object. Well C++ doesn't really have reflection, and C++'s version of RTTI is not very useful for these purposes.

But we are stubborn, pig headedness always comes with stubbornness. Well if we had multi-pass compilers, we could use C++'s macro system (which is arguably not very powerful), to build ourselves a reflection framework, and then use said reflection framework in the way mentioned above. After all, we know that C/C++ macros are mere text replacement tools, and hence it makes perfect sense to write #defines which produce other #defines. Of course the C++ compiler is single pass, probably for many many reasons, including the avoidance of infinite loops. Ah the avoidance of infinite loops, always a worthy cause.

Well I am lost. I have ideas, none of them seem to work. Writing serialization code by hand seems to be very very painful, and is one of those things I know is going to come back to haunt me later this semester. We need better alternates to Java. And other things...

Panda

Updates, sort of

December 16th, 2007

There are a couple of entries I have been meaning to write, but have on hold for various reasons. We'll deal with those later.

Since it is clear that I write something only when classics essays are bothering me, this entry is going to be updates about life. Clearly this needs to be done, and who knows, writing scathingly harsh satire might actually be fun.

Updates then, I will be in Delhi from the 22nd of December through the 19th of January. Hopefully some of this time will be spent doing work for 138, the class I am TAing next semester.

I will be at Microsoft starting in August next year. There was this one group at Microsoft working on stuff that was too interesting to pass on. Can't say too much more than that.

Panda

More Essays Need Writing

November 12th, 2007

I got back from one of those trips out west yesterday. They are really quite bad, mostly because getting back makes one waste almost all of a day. Going west has always been much easier than coming back east, it really doesn't work out well. Besides someone chose to fight with the crew on one of my flights yesterday, making it somewhat unpleasant. Besides I don't like MD-88s, they tend to be non-uniform in the amount of leg space they provide.

But now I am back, and I need to write three essays, revise one, and make sure one makes sense. By tomorrow. While also working on type inference. And writing code for research. It is interesting how all seems to go well until I hit one of these points, and titter between giving up and just handing in some junk. And junk is truly how I'd describe some of these essays. Except that they seem to do well when handed in, my last one supposedly analyzed the topic well.

I managed to read most of a Murakami on my flight to San Francisco. It was a very nice book, well written and all, but put me in a funk. This seems to be the general effect of reading Murakami on planes for me. Which is strange, though being in a funk has some good effects. I got more work done on my second flight, than I have in the last couple of days. I also discovered this pen I had lying around which writes really well. I have not used many of my nicer pens for a while, and increasingly hole ridden pockets are making pens hard to carry around.

We had an argument about the ANSI C standard earlier this week. It was not an argument, more of a question, who's entire basis was knowing some subtle details in the standard. I don't even know the standard. What is amusing is that this came a day after a discussion about what time was. I got to meet a couple of friends I hadn't seen in a while, it was nice, we went to this Indian restaurant in the bay area I like a lot.

I have been working on these Classics essays for most of the day. Some of them have even been interesting. But I need to do other things, and this is pretty tiring. A lot of this is just about expressing my opinions on issues I don't have clearly defined opinions on. Or on things I don't wish to express an opinion about. I want to not give up on this class though. This is all very strange, I think there's a time when I wouldn't have done this. Someone, somewhere in the past, had a thing about how education is supposed to change us, since not changing is not learning. Or some such weird new age philosophy. It was a company, so one can be fairly sure it was printed in multiple colors on card stock. So strange, and all.

Leopard and General Absence

October 30th, 2007

Those fine folks out at Cupertino have another iteration of their operating system out. They tend to be really good at timing these things, and I find myself contributing to their coffers every year right around my birthday. So after being delayed for a weekend (they didn't ship copies to university bookstores in time for the release, and university bookstore's were selling it for cheaper than the Apple Store), I finally have Leopard. Which is good, I guess. I bought this OS in part because of the promise DTrace held, and in part because of Time Machine. I am currently not doing anything requiring DTrace, and I haven't yet taken the time to teach myself enough about it, and Time Machine requires that I reformat my external, something I am not quite prepared to do yet.
Read the rest of this entry »

Random Thoughts

October 21st, 2007

Funny man in Rome, fat man in France, strangely unrelated. I am writing an essay on one. The other is this weird childhood memory a book in the living room brings back. There's some sort of a British connection between both, but some connections are worthless. Besides I am pretty sure Roman virtues from the Early Republic had fairly limited appeal for the Gaulic tribes inhabiting France back then. That said, the Gauls seem to have been less Asterix like, and more Spartan like every day. Here lay a group of people who were so fierce that the Romans were afraid of them, fierce not weirdly clever mind you.

I was walking around New York a couple of days ago, one of those short visits where one gets to enjoy expensive hotels and rain. I went to an Afghani restaurant, supposedly owned by someone who was a judge in Kabul in the late 70s. Funny considering his leaving the country would neatly coincide with the rise of the communists, and such things usually have interesting stories. The restaurant itself didn't have a story, it wasn't even exceptionally good. At least I didn't really pay for the food. The rain did actually suck.

I am not sure why I wrote this, I didn't have that much to say. Observations for the night: scheme's cool, coding is fun, writing papers is less fun than it used to be.

Panda

Somewhat General Update

October 16th, 2007

I keep meaning to post, but never really get around to doing it. This is somewhat of a general post, glossing over some of the stuff I have been meaning to post about. In reverse chronological order even. We had this startup talk today, and this thing was probably better attended than any recent CS talk in recent history. The free food helped, but considering all the other people give out free food too, that couldn't be the only reason for attendance. It's interesting to look around the room to see who's attending one of these things, for instance today's was attended by quite a few CS professors, professors who don't normally attend these things. And then there were all the other people I had never seen, and the usual CS department attendees at these things. But this in general fits in with Itay and other people's observations about how everyone in the class below us seems to be infected with the startup bug. Well not everyone, but the people we happen to be close to, and it is sort of interesting, since most people my year seem to be looking for more traditional jobs. Traditional jobs with exciting work, but traditional large companies nevertheless, and one wonders what changed between now and then.

Read the rest of this entry »