Saturday, August 30, 2008

Video broadcast formats

It is hard to remember and keep track of various media/formats for video. Now a friend of mine gave this link, I see apple's nice page for broadcast formats. As more and more video formats are introduced every year, it is one year old but useful.

Thursday, August 28, 2008

Insight in Usian Bolt sprint

I watched spectacular 100m run in 9.69 sec by sprinter Usian Bolt. I became curious in sprint techniques and training. I got several doubts like, what is humanly achievable target (As Green did 12m/s for a 10m split, so can it be done in 8s for all 100m), why are women always behind men in sprint, why do they say hight is negative point in sprint, why is that all short distance runners are strong built, but all long distance runners are lean people, and why can not runners can get all medals on track compared to swimmers winning six to eight gold medals etc.

Stride rate vs. Stride length: Speed is stride rate multiplied by stride length. Improving either one of them makes a runner faster. Usian bolt is taller and is able to finish the 100m in 41 strides (41 right leg steps and 40 left leg steps). That is around 2.5m per stride and 4.2 strides per seconds. Silver medal winner took 45 strides and completed in 9.89 seconds. His stride frequency is 4.5 strides per second. His frequency is faster, but could not match the Usian Bolt because his stride length compensated him much more.

Impluse and strength: Runner has to hit the ground harder and to rebound and run faster. However that strength also reates backward friction on the ground and reduces the speed. Trick is to use more force, but less impulse. Impulse is calculated physically as force multiplied by time the force is applied. So the player has to hit the ground for shorter duration and contact time.

Disadvantages of tall person in sprint: Starting position will be uncomfortable. Pickup from stand still and balancing takes some time. Taller person tends to have more weight and so ground and air resistance will be more. So Usian bolt had to use more power to succeed.

Advantages of strength in sprint: Extensors in hip, knee and ankle are helpful to get long stride. The more force the sprinter can hit the ground with, the more faster he can move. The more faster the muscles can recover, the less fatigue sprinter faces. It is difficult to keep the speed achieved without strength.

Sprinter needs the following and training improves each of them.
- good posture and fast pickup
- able to accelerate till the maximum speed is achieved.
- fast leg speed
- large stride like raising knees higher
- fast and equal in flight and ground contact time.
- speed endurance for the last 30m.
- less energy consumption like keeping torso straight, reducing ground contact time.

Phases of sprinting: Startup speed for fast sprinter is around 3mps. It reaches around 5mps after 10m split, 8mps after second split, and reaches 11mps after 50m. Some sprinters are able to increase speed up to 70m, and some could not. Most sprinters after this de-accelerate, but only few can manage with the same speed. The last portion needs speed endurance.

Short distance runners for 100m or 200m need quicker speed acceleration capacity, and long distance runners for 400m, 800m or more need more speed endurance.
Long distance runner needs
- Larger oxygen intake - VO2
- Larger lactate threshold - 80% of VO2
- Exercise economy - less amount of oxygen need for same speed.
A taller or huge runner has hard time to achieve all of these qualities needed for endurance.

More details later.

Reference books:
* Physiology of sports
* Physiological aspects of sport

Tuesday, August 26, 2008

Flash internals, security and inside look

SWF (Shockwave video files) and FLA (flash video files) are every where now. Adobe/Macromedia provides good software, but was also smart to get their plugins on all most all computers by default now. Most websites are designed in flash format. See flash file internals for the file format and details.

However if I want to do any thing sophisticated like dynamic changes to images or movies, I have no control. The reason claimed is security and sandbox. Well, it is secure (not completely though, see flash problems) from browsing point of view assuming that providers are really careful and not harmful to users. It is very difficult to create secure movies (with no breaches on user computer). Coming to why I looked at flash internals, it is equally difficult for creating private(with ownership and secrecy) flash videos. Solution is not going to some other apple or microsoft technologies, but to have open and secure protocol so that others can extend. It is proprietary and there is no way other than waiting for Adobe to come up with secure extensions.

I see announcements about their new protocol RTMP recently. Common sense says it is no more secure than obscure. It just seems business strategy to keep people locked for some more time and also to buy their new servers. We either need alternatives like open source or corporates with open standard protocols like HTTP and RTSP.

Monday, August 25, 2008

Same origin policy

After reading all those cross domain attacks, I was wondering how the browsers are protecting naive user from the cross domain manipulated page displays from scripts. The reason it works is because all browsers follow same origin policy. The same origin policy prevents document or script loaded from one origin from getting or setting properties of a document from a different origin.

More details on single origin policy on google help pages.

Wednesday, August 13, 2008

Flash cookies - good and bad

I delete my cookies once a month or so. I do not care my session experience for more than month, and also my tastes change over the time. I am watching Olympics and visit sports website frequently now a days, but I do not want to see any ads and popup ads for fitness in coming weeks or after month. I deleted cookies, and visited some other website. I got similar ads after deleting cookies.

It is sure that both the websites are using same advertising company. However there can only be two reasons why I got the same ad. That advertiser has nothing else to show, or he tracked my behavior even after my cookies are cleared. So I did little research and found that there are some other cookies allowed by flash which comes installed in all browsers as part of Adobe's business partnership with HP and Dell computers.

Those cookies may be giving me better user experience in filling forms or giving contextual user experience, but why did it allow the tracking websites without telling me? That is also 100KB per website compared to 4KB browser cookies. Some bloggers were even saying that some websites are using flash cookies and restoring regular cookies from them, since most users are deleting regular cookies. I am not sure how much truth is in those fears, but I deleted all my old websites and allowed only few trusted sites like youtube, amazon and google. I googled around and found that I can change my settings.

Visit the control panel for flash related global storage settings and set the limits or disable all websites to save some information.
Visit the page 
Controlling storage for visited websites
 and see the websites that have already have saved information, delete the ones you do not want or delete all.

Sources:
Flash cookies explained
Local Shared Objects
Local Shared Objects(LSOs) details from wikipedia
Webserver cookies threaten privacy

Friday, August 8, 2008

netcat useful examples

a. Transferring file between machines using client and server mode
server machine:
$ cat myfile | nc -l 9898

$client machine:
nc serverip 9898 > myfile

b. Port scanning
$ nc -z 192.168.0.1 80-90

c. Connecting a webserver
$ echo -e "GET http://www.google.com HTTP/1.0\n\n" | nc www.google.com 80

d. TCP proxy logging everything between server and client

$ mknod backpipe p
$ nc -l -p 80 0<backpipe | tee -a inflow | nc localhost 81 | tee -a outflow 1>backpipe

e. remote shell
$ nc -l -p 9898 -e /bin/bash

f. Chat application
my machine
$ netcat -l -p 9898

your machine
$ nc mymachine 9898

References:
http://www.stearns.org/doc/nc-intro.current.html
http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/

Saturday, August 2, 2008

World and India rice production

World produced 425 million tonnes of rice and consumed 424 million tonnes in 2008. Total world exports are around 27 million tonnes. India produced 92 million tonnes in crop year 2007 and 96 million tonnes in 2008. It consumed 85 million tonnes in 2005, 88 million tonnes in 2007 and 90 million tonnes in 2008. India exported 4.5 million tonnes in 2006, 5 million tonnes in 20007 and only 3 million tonnes in 2008.

China produced 129 million tonnes, consumed 128 million tonnes in 2007. It consumed 135 million tonnes in 2006, and the reason for decrease in consumption is because people started eating other food.

It is expected that India needs 128 million tonnes for domestic consumption by 2012. Indians consume 80 kg per year per person. In china, consumption is 90 kg per person per year.

In addition to India and china, U.S. exports 3.5 million tonnes, Thailand, the largest exporter exports 9 million tonnes of its 18 million tonnes production and Pakistan exports 2.9 million tonnes of its 5.5 million tonnes. India and China will not be able to export as their population is growing and their production is not increasing rapidly. India and china maintained carryover stock of 50 million tonnes for future use and the total world stock of rice is around 90 million tonnes.

India uses 5.6 million hectares or 13.8 acres of land for rice production, where as U.S. uses 2.6 million acres of land.

India banned export of rice since March' 2008 to mitigate effect of global food crisis on it. However this can contribute little more to global food crisis and price rises in rest of the countries.

Sources:
Bangladesh rice prices effected by India
Good forecast and rice export ban
India may lift ban on rice export in four to five months
India rice productivity analysis
Rice production by state wise in India
Rice production by country.
The truth of trade about rice