Apache: Permanent Redirect Directive in Apache httpd conf

December 4th, 2008 by jeremychone | No Comments »

Redirecting from the http.conf

<VirtualHost *:80>
  ServerName mydomainname.com
  Redirect permanent / http://www.otherdomainname.com/
</VirtualHost>

Windows: Removing Old Exchange Email Address from Oulook

December 3rd, 2008 by jeremychone | No Comments »
  1. Close Outlook
  2. Open your c drive. Start > run and type c: and click okay
  3. Click Tools > Folder Options and click on the View tab.
  4. Make sure Show Hidden files and Folders is selected, and Hide Operating System files is unchecked.
  5. Also make sure that hide extensions for known file types is unchecked and click Apply and Okay.
  6. Click the Search Icon
  7. Select All Files and Folders.
  8. In the “All or Part of a file name” box, type *.nk2 and click search.
  9. Delete any files you find.
  10. Do another search, this time for *.oab, delete the files you find.
  11. Click Start > Run, type outlook.exe /cleanprofile and click okay

YouTube: Upload HD Video to YouTube

December 2nd, 2008 by jeremychone | No Comments »

You need to encode the video for HDTV 720p, and then upload it.

See also:

Note for Adobe CS4 Premiere:

Choosing the h.264, YouTube preset, and then increase the definition to 720p (by increasing the level) does NOT work (you can upload the video, but you will not get the full HD -fmt=22-). You need to select the following:

  1. Format: H.264
  2. Preset: HDTV 720p 23.976
  3. Change the Frame Rate from 23.976 to 30 (Not sure if this is a must, but read somewhere that YouTube perfers 30fps)

YouTube: HD Video play back

November 30th, 2008 by jeremychone | No Comments »

You can change the video playback mode by adding &fmt=XX to the youtube URL (in the embed code or in the browser URL)

HD (720p): http://www.youtube.com/watch?v=Mgan4rt7ZHw&fmt=22

Regular: http://www.youtube.com/watch?v=Mgan4rt7ZHw

Apparently, the fmt params are:

  • fmt=6 is flv format and 480×360 at a low bitrate.
  • fmt=18 is MP4 and is a higher bitrate, but same resolution.
  • fmt=22 is 720p
<object width=”480” height=”397“>

<param name=”movie” value=”(VIDEO EMBED URL)&ap=%2526fmt%3D22“></param>

<param name=”wmode” value=”window“></param>

<embed src=”(VIDEO EMBED URL)&ap=%2526fmt%3D22” type=”application/x-shockwave-flash” wmode=”window” width=”480” height=”397“></embed>
</object>

The (Video Embed URL) = http://www.youtube.com/v/[videoID] (e.g., http://www.youtube.com/v/Mgan4rt7ZHw)

From CNET: YouTube videos go HD with a simple hack
See also:
How To: Watch YouTube Movies in Full 720p HD Glory

Pics: 300 free icons

November 29th, 2008 by jeremychone | No Comments »

Crystal Clear

jQuery: is hidden (toggle, show, hide)

November 28th, 2008 by jeremychone | No Comments »

To know if a element is hidden or visible, you can use “$.is()” methods and the “:hidden” or the “:visible” filter selector.

alert(”Is myDiv hidden? ” + $(’#myDivId’).is(’:hidden’));

More on jQuery selectors

RegEx: Best RegEx Eclipse Plugin QuickRex

November 12th, 2008 by jeremychone | No Comments »

Sql: Select rows with duplicate values (select, count, group by, having)

November 8th, 2008 by jeremychone | No Comments »
select count(lastName), lastName from employee group by lastName having count(lastName) > 1;

Mysql: Java Web App and MySql 5.x UTF-8

November 8th, 2008 by jeremychone | No Comments »

To fully support UTF-8 with mysql, make sure of the followings:

  1. Set HttpServletRequest UTF-8 character encoding.
    request.setCharacterEncoding(”UTF-8″);
  2. Set HttpServletResponse UTF-8 character encoding
    response.setContentType(”text/html; charset=UTF-8″);
  3. Create the Column, Table, or DB need to have the UTF8 charset and collation
    CHARACTER SET utf8 COLLATE utf8_general_ci
  4. THE TRICK: Add the character encoding instruction in your JDBC URL
    jdbc:mysql://localhost:3306/DATABASENAME?useUnicode=true&characterEncoding=UTF8

Related links:

Tomcat: Virtual Hosting and Web App

November 2nd, 2008 by jeremychone | No Comments »

To map a domain name to a “war” web application.

File: [tomcat-path]/conf/server.xml

<Service>….
<Service>….
<Engine>…

<Host name=”www.yourdomain.com” appBase=”webapps/webappname”
unpackWARs=”true” autoDeploy=”true”
xmlValidation=”false” xmlNamespaceAware=”false”>
<Context path=”" docBase=”.”/>
<Alias>yourdomain.com</Alias>
</Host>

</Engine>
</Service>
</Server>
Note: This obviously assumes that this domain name is mapped to the specific tomcat instance.