Wednesday 20 January 2010

Subtitles editor

Yippee!
I got a software to edit subtitles - here

I took the first one (Aegisub) and installed it.

I wanted to shift the time of subtitles forward by 20 Seconds. It is pretty simple.
Just open the file with Aegisub and click on "Open Shift Times Dialogue" - the icon on toolbar with the pic of an arrow and a vertical stripe. Enter the required values.
:)

Now I can watch any movie with better understanding. \0/

By the way, if you have a movie without subtitles, then search for subtitle file of that movie on internet. Some of them have .srt extension. (I used the same.) There can be .sup too. I don't know what the difference is. But .srt worked for me.
Take the file. Rename it with the same name as that of your movie file name. (keep the extension as .srt; don't change that).
Keep both the movie file and srt file in the same folder.
Open your movie player. I used VLC player. In that, select Video menu-> Subtitles Track -> Track 1.
It should work. (You might need to restart the VLC player.)

Saturday 16 January 2010

Behavior of "inherited protected" variable in Java

Something to remember before going ahead –
There are 2 basic aspects of a variable– inheritance (can be inherited or not; with values – yes/no) and access (can be accessed or not; with values – default/public/private - ignore protected for now)

Consider 2 scenarios:
Scenario 1:

As shown in the above figure –
Result is -
B inherits x, C can access x through object of A and through object of B both.
D inherits x.
E cannot access x at all.

Scenario 2:

As shown in the above figure –
Result is:
B, C inherit x.
Class D cannot access x at all.

Conclusion:
This is about variable x of B.
When protected variable is inherited inside package (Scenario 1), it behaves like default for access and yes for inheritance.
When protected variable is inherited outside package (Scenario 2), it behaves like private for access and yes for inheritance.

Thus, the table is as follows - (click on the table image)

Tuesday 12 January 2010

When you want to carry your heavy laptop

For those who didn’t know if we can remove the battery of laptop, we can remove it and can reduce its weight. This is if we can use it like a computer (i.e. with electric cable always plugged in laptop). Just find how you can remove the battery and reduce the weight of your bag. I could do it for my hp laptop. Now it is easy for me to carry my laptop every weekend to Mumbai. Yippee!