27 Oct 2011

Linux: Slackware - Install Flash

Download the tar.gz file en extract it. Then copy libflashplayer.so to /usr/lib/mozilla/plugins

or

tar -xzvf install_flash_player_10_linux.tar.gz
cp -v libflashplayer.so /usr/lib/firefox-3.6.12/plugins

Linux: Slackware - HTC Desire HD USB Tethering

Run this command: dhclient usb0

14 Oct 2011

ASP.NET - Transfer to another page using gridview based on 'id'

This is for when you have a GridView with a link based on 'id'.

SQL table (tblMovies): movieID, Title, Year etc.

Page1.aspx

GridView settings
Propeties | Data | DataKeyNames : movieID

GridView tasks
GridView Tasks | Edit Columns | Add HyperLinkField

Add a HyperLinkField

HyperLinkField propeties
Appearance | HeaderText: Blahblah-whatever
Data | DataNavigateUrlFields : movieID
Data | DataNavigateUrlFormatString: ~/Page2.aspx?movieID={0}
Data | DataTextField: movieID

Page2.aspx

In the SqlDataSource you need to use a parameter for the 'id':
Parameter source: 'QueryString'
QueryStringField: movID

SELECT * FROM tblMovies WHERE (tblMovies.movieID = @movID)

This is just a help, not a guide

28 Sept 2011

VB.NET: Programmatically populate a DropDownList (aspx)

If you need to populate a dropdownlist by hand

However the value and the displayed text are both the same!

Me.ddlTest.Items.Clear()
Dim strDDL() As String = {"Aaa111", "Bbb222", "Ccc333"}
Me.ddlTest.DataSource = strDDL
Me.ddlTest.DataBind()

VB.NET: Windows version (aspx)

Sometimes we have to know which OS version the user is using (from an aspx page)

Dim strOS As String

Select Case Request.Browser.MajorVersion
   Case 6
      strOS = "Windows XP"
   Case 7
      strOS = "Windows 7"
   Case Else
End Select

VB.NET: Retrieve IP and resolve to hostname (aspx)

Our company upgraded to Windows 7 so this is what I had to do in order to retrieve the host computername

Dim host As System.Net.IPHostEntry
host = System.Net.Dns.GetHostByAddress(Request.ServerVariables.Item("REMOTE_HOST"))
Dim strComputerName As String = host.HostName

27 Sept 2011

Split MKV files

I found this through google

This works very very well with hacked PS3 using Showtime player!

splitMKV - split big MKV/AVI files + external SRT subtitles in smaller chunks (FAT32)
Here we go with another handy and cool tool: splitMKV. It will be included in multiAVCHD's full download, along with a standalone app download here: http://multiavchd.deanbg.com/splitMKV/

Those of you who have multiAVCHD can simply download the .exe (80KB) and put it in multiAVCHD's folder.

splitMKV is a CLI tool, but since it uses default split size of 4000MiB you can use drag&drop with your MKV/AVI files, too:

Code:

D:\>splitMKV.exe
splitMKV ver 0.02 - split MKV/AVI files with external SRT subtitles (deank@doom9)

Usage: splitMKV.exe input_file [output_folder] [/split:SIZE]
* input_file must be a MKV or AVI
* SIZE is set in MiB - i.e /split:4000 for FAT32 compatibility (default)

Use this to output directly to USB (standard 4gb chunks): c:\some\folder\splitMKV.exe d:\another\folder\test_movie.mkv x:\

It will process MKV or AVI files and will split them in smaller parts (set by /split: option) and on-the-fly it will split the corresponding SRT file, will set new timings and will fix errors in the SRT subtitle file.

Important: SRT files must be saved in ANSI format before processing.

Note: Using this tool makes sense only if you have external SRT subtitles to be split along with the input MKV/AVI file. Otherwise it is just a simple CLI4CLI (for mkvmerge).

The whole idea is to cut the steps for splitting and adjusting subtitles, when user splits the original video, so basically that's what splitMKV does.

Example: splitMKV.exe d:\test_movie.mkv

will split test_movie.mkv in 4GiB chunks along with test_movie.srt so you will get:

test_movie-part-001.mkv
test_movie-part-001.srt
test_movie-part-002.mkv
test_movie-part-002.srt
etc..

Example 2: splitMKV.exe d:\test_movie.mkv /split:700

will split test_movie.mkv in 700MiB chunks...

***

The tool was requested by OPPO BDP-83 blu-ray player users, since it can play MKV files off a USB stick. Because there is a 4GB limit for FAT32, this small tool will come in hand. Of course, splitMKV can be used with multiAVCHD before creating a compilation.

For example you want to create a DVD5 AVCHD disc from 8GiB MKV file. So you can split the MKV with splitMKV first and then create 2 or more DVD5 discs from the split parts.

The tool uses mkvmerge to split the input file and then mediainfo to recalculate the proper timings for newly created SRT segments.