Wednesday, December 29, 2010

Firefox Extension: Bulk Player Mate for YouTube


This extension lets you play all or any of the YouTube video links on a page by just several clicks.

For example, if we want to watch some videos of Shania Twain, we can go to www.youtube.com and input Shania Twain into the search box. We would get so many results. To narrow it down, we input the owner's name as well -- Shania Twain by ShaniaTwainVEVO. Now we get some videos as the search result.

Right click on the result page and the context menu pops up. The Bulk Player Mate menu item is at the bottom. Clicking on it brings up the Select Video dialog.

Alternatively, you can open the dialog through Tools menu of the menu bar.

The detected YouTube videos are split into 3 groups:
  • text links
  • {img} -- links with thumbnails.
  • {embed} -- embedded videos on the page.
These videos may be duplicated with the other group, so you can usually choose to show one group to select your videos in the Select Video dialog. Certainly you can choose to show all videos.

We can see there are many videos listed in the scroll box. We just ignore those we don't care and select the wanted videos by clicking on the little checkbox at the beginning of the record of the video.

You may also notice that the videos are sorted by the Description column. But they may not be in the order we want. We can click to highlight one row (or multiple rows by Shift-click on the last row) and use the Up/Down buttons on the right side to move the video up or down.

After selecting all the videos we want to play and move them into the right order, we can press the OK button to play them all.

A new tab will be opened to play the selected videos one by one. The features of the player are:


1) The videos you select are inserted into the input box automatically for you.

2) There are some controlling buttons at the bottom-left corner of the player. You can use them to play from the beginning, go to the previous video, or go to the next video.

3) Use the buttons at the bottom-right corner of the player to choose the size of the player.

4) Shows which video in the list is being played.

5) The full-screen button of the video. Once you click it for one video, the rest videos will all be played in full-screen mode, seamlessly.


Download and Installation
Download the extension from https://addons.mozilla.org/en-US/firefox/addon/269153/.

Bulk Player is also a standalone tool. You can manually input videos and play them without install the Bulk Player Mate extension

The videos in this example are randomly searched and chosen. We do not own them and we are not in any way related to them or the people who own them.


Tuesday, December 28, 2010

Linux ACPI issue


In a previous post, I had a temporary solution for the ACPI issue of the kernel on my machine. It worked but the machine hesitated all the time. Recently, I played with the kernel parameters related to the ACPI and got some interesting results.

1. Use the option acpi=off. The auto shutdown problem was gone, but the system became sluggish.

2. Use the option acpi=ht. The result was same as acpi=off.

3. Use the options pci=noacpi acpi=noirq pnpacpi=off noapic nolapic. This basically turned off most of the ACPI functions, but not as many as acpi=ht. The auto shutdown problem was gone, and the system worked well. However, only one CPU was recognized.

4. Use the options pci=noacpi acpi=noirq pnpacpi=off. The auto shutdown problem came back.

5. Use the options noapic nolapic. The auto shutdown problem was gone, and the system worked well. However, only one CPU was recognized.

6. Use the options noapic. The auto shutdown problem was gone, and the system worked well. Both CPU's were recognized. This one seemed to be the best solution.

Enter multiple paragraphs in a cell of the Google Docs' spreadsheet


You cannot simply press the Enter button to insert a line break into the cell in the Google Doc's spreadsheet. That would finish the editing of the cell and the next cell would be focused. Instead, you need to press

Alt-Enter
or
Ctrl-Enter

Monday, December 6, 2010

MD5 example in Java


Both Linux and Windows have tools to compute the MD5 (Message Digest algorithm 5) hash value of a file.

In Linux, run
        md5sum <file_name>
       
In Windows, run
        fciv.exe <file_name>
       
If the tools are not installed, it is very easy to build your own one in Java. Just create a new text file named Md5.java and copy&paste the following code into it.

import java.security.MessageDigest;
import java.io.FileInputStream;
import java.math.BigInteger;

public class Md5 {
   public static void main(String[] args) {
      if (args.length < 1)
      {
         System.out.println("Syntax: java Md5 <file_name>");
         return;
      }

      try {
         // Create a message digest with MD5 algorithm.
         MessageDigest md = MessageDigest.getInstance("MD5");

         // Read the file and update the digest.
         FileInputStream fis = new FileInputStream(args[0]);

         byte[] buf = new byte[1024];
         int n = 0;
         while ((n = fis.read(buf)) != -1) {
            md.update(buf, 0, n);
         };

         fis.close();
 
         // Complete the hash computation. And return it as a BigInteger.
         BigInteger i = new BigInteger(1, md.digest());

         // Output the result.
         String s = String.format("%1$032x", i);
         System.out.println(s);
      }
      catch (Exception x) {
         System.out.println("Error:");
         x.printStackTrace();
      }
   }
}

Save the file and compile it
        javac Md5.java
       
Run it like this
        java Md5 <file_name>

 
Get This <