Hey Mendy

Mendy's site
Posts I Like
Who I Follow

java.lang.IllegalArgumentException: Comparison method violates its general contract!

 I got it on a Comparator I wrote, which returned either -1 or 1 (no == check was performed , and I never returned 0) .

This will happen to you usually when switching to Java 7 from older versions of Java. 

Long story short , the solution was to add the following line to your Comparator :

if (o1 == o2) return 0;

nosql:

A post on the HP blog answering 5 questions about Hadoop:

  1. Why Hadoop?
  2. What is Hadoop?
  3. What does it do?
  4. What is it good for?
  5. What’s the future?

With the current momentum behind Hadoop, there’s no question that it’s here to stay. But it’s best to think of Hadoop as a starting point for interesting developments to come.

As you probably know, HP owns Vertica, a column-oriented SQL database for data warehousing and BI, but when talking about Big Data HP includes both Vertica and Hadoop.

Original title and link: Hadoop: Answering the Basic Questions: Why, What, How, Where (NoSQL database©myNoSQL)

1. download from the website

2. unzip the file

3. create a directory to store the db files C:\Users\men08j\Documents\mymongodb

4. open cmd, cd to the bin directory

$cd C:\User\men08j\Document\mongodb\bin

$mongod —dbpath “C:\Users\men08j\Documents\mymongodb”

5. Open browser

http://localhost:28017/

6.connect to the db server

run $mongo in command line

To jump to the selected URL as soon as the selection is made (i.e. without having to click a button), use the following code:

<form name="menuform">
<select name="menu2" 
onChange="top.location.href = this.form.menu2.options[this.form.menu2.selectedIndex].value;
return false;">
<option value="/index.html" selected>Home Page</option>
<option value="/internet/index.html">Internet Tutorials</option>
<option value="/internet/javascript/index.html">JavaScript Samples</option>
</select>
</form>

To make the selected URL open in a new window, use the following code:

<form name="menuform">
<select name="menu3" 
onChange="window.open(menuform.menu3.options[menuform.menu3.selectedIndex].value);
return false;">
<option value="/index.html" selected>Home Page</option>
<option value="/internet/index.html">Internet Tutorials</option>
<option value="/internet/javascript/index.html">JavaScript Samples</option>
</select>
</form>

To make the selected URL open in another frame, use the following code (where “framename” is the name of the target frame):

<form name="menuform">
<select name="menu4">
<option value="/index.html" selected>Home Page</option>
<option value="/internet/index.html">Internet Tutorials</option>
<option value="/internet/javascript/index.html">JavaScript Tutorials</option>
</select>
<input type="button" name="Submit" value="Go" 
onClick="top.framename.location.href = this.form.menu4.options[this.form.menu4.selectedIndex].value;
return false;">
</form>

FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video. It includes libavcodec - the leading audio/video codec library. It can be simple called from shell.

ffmpeg has two options, ‘-ss’ (seek to position), and ‘-t’ (recording duration). Basically, you set up a stream copy, use -ss to go to the point where you want to start the segment, then use -t to set the length of the recording from that position. You’ll have to do it once for each segment you want to create.

Try the:
-vcodec copy
option to copy as well as the -ss and -t options mentioned above.

Example: ffmpeg -vcodec copy -ss 00:01:00 -t 00:03:00 -i infile.mpg outfile.mpg

the -vcodec option chooses the video codec to use, more options are:
-vcodec <string> : Force video codec.
copy : Copy raw codec data as is.
dvvideo : DV Video (for video editing, I’ve heard)
ffv1 : FFV1 lossless video codec
h264 : H.264 (best mpeg-4 codec, I’ve heard)
mpeg2video : MPEG-2 Video
rawvideo : RAW Video
xvid : XviD ( MPEG-4 Part 2 ) 

Tutorials

http://www.catonmat.net/blog/how-to-extract-audio-tracks-from-youtube-videos/

http://www.catonmat.net/blog/converting-youtube-flvs-to-a-better-format-with-ffmpeg/

$ git log

shows the previous committed version

$ git reset —hard version_number

DataObject.java

import java.util.ArrayList;

import java.util.List;

public class DataObject{

        public List<String> ids = new ArrayList<String>(){ };

}

   public DataObject JSONToObject(String jsonString){

        Gson gson = new Gson();

        //convert the json string back to object

        DataObject obj = gson.fromJson(jsonString, DataObject.class);

        return obj;

    }