04 11 / 2013
The an interesting tradeoff between video viewing, video buffering and bandwidth costs. Something that the Youtube team has, most likely, spent a ton of time, thinking about.
The above video seems to be buffered 45 seconds over current playing time. I tried a bunch of other videos, and the buffer was almost always about 45 seconds. Seems to suggest that the biggest factor in determining the buffer size is my connection speed.
Haven’t tried this on slower connections. Intuitively, the slower your connection, the more the video should be buffered.
- Average length of a YouTube video is 4 minutes and 12 seconds.
- 4 billion video views per day.
- i.e 30.42 Trillion minutes, or 266 hours played per day.
- I’ll skip how i got to this (most likely incorrect) number, but Youtube is saving atleast 15% of their serving costs because of the buffer optimization.
14 10 / 2013
06 6 / 2013
04 6 / 2013
This is the YUI way of doing it. YUI has a namespace function.
This is the JQuery way of doing it.
Also read up on…
31 5 / 2013
So, stretching a background image to fill your entire page should be a simple task., but thanks to IE (and users who insist on using IE), it isn’t.
I’ve looked at quite a few options. the most simple one being
28 5 / 2013
Often, i’m just mucking around with code on github, and unwilling/unprepared to open it to the world. I realize that i could keep my repository private by just paying for a private repository. But i can’t be asked to pay for some of the stuff i have up on Git.
Although file content is encrypted, file names and issue lists are still human readable. I think i might have a solution for this (which the margin of this blog is too narrow to contain)
22 5 / 2013
For the last 2 years, i’ve had the marked misfortune of using Maven [1, 2, 3]. To quote kent spilner, “Maven is a horrible implementation of bad ideas”. But underlying the whole Maven vs Ant squabble, lies a deeper question, of whether your code should be explicit or implicit. Let me explain this with an example, entirely outside of the software development realm.
Lets say you want to make eggs. The old fashioned way of making eggs, say an omelette, will be
- Crack 2 eggs, Whisk them till they turn yellow
- Heat a pan
- Add butter
- Pour eggs into pan, and let heat till it resembles a pancake.
In the process of making an omelette, you have also now familiarized yourself with a few basic tools and techniques of cooking.
- Cracking an egg
- Using whisks
- Using frying pans
- Flipping omelettes/pancakes
Each of these techniques, individually is easy to master. When you use them together they can be applied to other recipes scrambled eggs, pancakes, toast, etc.
This is the “ant” way of doing things. Each individual ant directive is simple. Yet, once you’ve understood them, you can build, package or deploy almost anything. If you write bad ant scripts, things could go horribly wrong. But, no build platform is idiot proof enough to protect against bad engineering.
Maven on the other hand is like a “magic omelette maker”. Insert eggs, salt, butter in the correct order; set dial to “omelette” and you get an omelette. Using an omelette maker, teaches you nothing about the basics of cooking.
But there is another problem. It promises to “just work” and hence requires no deliberate though. So when your omelette does not turn out right, you have no clue as to what to change. And lets face it, no one reads manuals.
In reality, not everyone wants an omelette; not everyone likes their eggs done the same way. IMO, when it comes to cooking, or build scripts or anything else, you are better of learning the basics in small steps, and building upon your skills.