Archive for ‘Programming’ Category
Browse:
Information Technology » Programming »
Description:

Programming related posts.

Subcategories:

Avidemux script to join multiple flv files

datePosted on 15:42, August 15th, 2014 by yk

Some video sites allow you to download a show but they are broken up into multiple FLV files. The attached Avidemux Tinypy script will allow you to choose folder and join all the FLV files that are found inside and save it in a MKV container (more video player friendly).

If you need to join other file types, modify the following lines:
ext="flv"

If you need to save as another file container type, modify the following lines:
adm.setContainer("MKV")
and
outputFile = inputFolder+"\\"+directoryName+".mkv"

Pardon the messy code, it was done as a quick and dirty script.

Click here to download the script

Query error: Incorrect string value

datePosted on 16:39, April 20th, 2013 by yk

I was inserting records into a MySQL table using php and got an error that says:
Query error: Incorrect string value: '\xE2\x82...' for column 'message' at row 1 - Invalid query: INSERT INTO `my_table` (`message`) VALUES ('The price is xE2x82 500')

The original string in the ‘message’ field is actually
The price is € 500

This error is surprising given that the string is actually in UTF-8 encoding and the field in the MySQL table is declared as utf8_unicode_ci type.

The solution that I found it is to call the php function utf8_encode to encode string before inserting into the MySQL table.