Saturday, July 20, 2013

Modifying Subtitles with Python

Ok, so I have not been completely idle despite my debilitating sickness. I have actually been working on a problem regarding downloaded movies and their subtitles. I noticed that sometimes, movies that I have acquired have no subtitles. And the subtitles that I have downloaded from sites like opensubtitles.org are not synchronized with the movie itself.

So I spent an hour or so to write a simple Python app (now on Github) that will correct the problem. Just determine how far forward to push the subtitles so that it would be in synch with the movie.

For example, the following will push the subtitle movie by 2 minutes and 3 seconds:

python subtitle.py IronMan3.srt 00:02:03,000

I've tried it on a couple of subtitles. It all works great so far. Of course, it only pushes the subtitles forward -- not backward. It also does not do any error checking. It's also probably not very efficient.

Ah well, it does the job as I need it so far...


Sunday, July 14, 2013

Securing Documents

Several months ago, a NSA contractor named Ed Snowden released confidential   information which he had obtained as part of his job. 

The result of his whistle blowing/traitorous activities was felt around the world. People were outraged that the NSA was monitoring the emails and phone records of ordinary Americans. 

So how can the NSA prevent future breaches like this?

I think that, for each confidential document, they should separate how they got the information from what the information actually contains. Then just encrypt the how and make it available to those with the proper security clearance.

For example, suppose you have a confidential document XYZ and that document contains confidential information (the sky is falling) the source of the information (chicken little said so). If you want document XYZ available throughout the organization then just encrypt the source of it. That way even if it does get leaked -- the details of it will be based on the credibility of the leaker and not on the NSA itself. Making it hard to copy files to a physical device also helps. 

Also works for newspaper journalists. 

Sunday, July 7, 2013

Sick

I have been sick for nearly 2 months. No motivation to write any code. Ugh.

Why Google's Go Programming Language Sucks

They say that history repeats itself. Sometimes, this is made quite event in the IT field due to the fast pace of technology. I would hazard to guess that there is a general feeling that when history repeats itself in IT, that is generally considered not a good thing. Unless there is a radical change, reinventing something that has previously existed and touting it as "the next big thing", is not really productive.

Google's programming language "Go" is a good example. The language was invented at around 2007; After that, Google announced the new programming language to the world at around 2009. So what problem does Go solve? None. It's just a language that is basically like C with a few niceties here and there.

But really, why does Google Go suck (in my humble opinion)? Let me count the ways.

1. No Object Oriented Programming.

There is no inheritance, no method overloading, object oriented programming. Other than C or Javascript (which have been around for a while), what language does doesn't have it? OOP is proven and yet the designers of Go have decided to ignore it.

Why even bother with it then? Just use server-side Javascript with V8 to do everything.

2. No asserts. 

God, why not?

3. Pointers.

This is perhaps just a personal preference. Coming from a Java/Python background, I simply prefer languages that get out of the way and let me express what I want without having to worry too much about details. Like pointers. I had enough of that when I was doing C. Not that it was that bad, it's just... why put it in a brand new language?

4. Mascot.

The mascot sucks. Purely, subjective, I know.

Well, that ends my rant. Basically, Google's Go doesn't really do anything for me at all because I consider it a step back in terms of programming languages. There is an adage "use the right tool for the job". However, sometimes someone invents a tool, slaps "Google" on it, markets and popularizes it, that actually doesn't ever seem to be the right tool for any job.