Archive for February 2009
ubuntu: install multimedia codecs without internet connection
Problem: You can’t play certain audio/video formats, because required codecs are not installed. So you need to install this extras but again, your machine don’t have direct internet connection.
Solution:
I am still looking for solution. if you have any, let me know.
I think this can solve it http://crashsystems.net/2009/01/keryx-tutorial/
Still trying out and not sure, if it provide an alternative.
Javascript CSV parser
var expr = /,(?=(?:[^\"]*\”[^\"]*\”)*(?![^\"]*\”))/g;
var array = str.split(expr);
it works for me
function parseLineCSV(lineCSV) {
// parse csv line by line into array
var CSV = new Array();
// Insert space before character ",". This is to anticipate 'split' in IE
// try this:
//
// var a=",,,a,,b,,c,,,,d";
// a=a.split(/\,/g);
// document.write(a.length);
//
// You will see unexpected result!
//
lineCSV = lineCSV.replace(/,/g," ,");
lineCSV = lineCSV.split(/,/g);
// This is continuing of 'split' issue in IE
// remove all trailing space in each field
for (var i=0;i
<lineCSV.length;i++) {
lineCSV[i] = lineCSV[i].replace(/\s*$/g,"");
}
lineCSV[lineCSV.length-1]=lineCSV[lineCSV.length-1].replace(/^\s*|\s*$/g,"");
var fstart = -1;
for (var i=0;i=0) {
for (var j=fstart+1;j<=i;j++) {
lineCSV[fstart]=lineCSV[fstart]+","+lineCSV[j];
lineCSV[j]="-DELETED-";
}
fstart=-1;
}
}
fstart = (lineCSV[i].match(/^"/)) ? i : fstart;
}
var j=0;
for (var i=0;i
<lineCSV.length;i++) {
if (lineCSV[i]!="-DELETED-") {
CSV[j] = lineCSV[i];
CSV[j] = CSV[j].replace(/^\s*|\s*$/g,""); // remove leading & trailing space
CSV[j] = CSV[j].replace(/^"|"$/g,""); // remove " on the beginning and end
CSV[j] = CSV[j].replace(/""/g,'"'); // replace "" with "
j++;
}
}
return CSV;
}
It works for me, I got it from here http://purbayubudi.wordpress.com/2008/11/09/csv-parser-using-javascript/