Wednesday, November 25, 2009

MYSQL Text Field size limitation

MyISAM tables in MySQL have a maximum size of a row of 65,535 bytes, so all the data in a row must fit within that limit. However, the TEXT types are stored outside the table itself and only contribute 9 to 12 bytes towards that limit. (For more information about this refer to the MySQL Manual - Data Storage Requirements chapter).

TEXT data types are also able to store much more data than VARCHAR and CHAR text types so TEXT types are what you need to use when storing web page or similar content in a database.

The maximum amount of data that can be stored in each data type is as follows:

TINYTEXT 256 bytes 
TEXT65,535 bytes~64kb
MEDIUMTEXT 16,777,215 bytes ~16MB
BIGTEXT4,294,967,295 bytes~4GB

In most circumstances the TEXT type is probably sufficient, but if you are coding a content management system it's probably best to use the MEDIUMTEXT type for longer pages to ensure there are no issues with data size limits.

Sunday, November 22, 2009

embed youtube video in customized appearance player

We need to use youtube's "chromeless player"
and the control to the video, we are able to achieve by using Javascripts Player API

Requirement: Flash Player version 8.0 and above

Futher details on how to use this, please refer site below:
http://code.google.com/apis/youtube/js_api_reference.html


OR

i will reveal later.... 




Tuesday, November 3, 2009

To Make a fixed height <UL> to scroll

CSS Code:

.holder UL{
height: 50px;
overflow: auto;
overflow-x: hidden; // this line is to hide the horizontal scroll
}

Wednesday, October 28, 2009

Monday, October 26, 2009

Way to disable the right click mouse

With the code below, you may modify it to become code to detect the onmouseclick on the document.body and do some action after that.

 <HTML><HEAD> <script language="javascript">  function click(e) {   if (navigator.appName == 'Netscape'            && e.which == 3) {       alert("no right click please")       return false;       }    else {       if (navigator.appName == 'Microsoft Internet Explorer'           && event.button==2)          alert("no right click please")          return false;          }    return true;  } document.onmousedown=click </script> </HEAD> <BODY> No right mouse button here! </BODY></HTML>

Wednesday, October 14, 2009

JAVA SCRIPT - Convert From String to Unicode

function toUnicode(theString) {
  var unicodeString = '';
  for (var i=0; i < theString.length; i++) {
    var theUnicode = theString.charCodeAt(i).toString(16).toUpperCase();
    while (theUnicode.length < 4) {
      theUnicode = '0' + theUnicode;
    }
    theUnicode = '\\u' + theUnicode;
    unicodeString += theUnicode;
  }
  return unicodeString;
}

Tuesday, September 15, 2009

Google Mail Server Standard Edition

If you happen to have a domain name, but not intended to get a webhosting. Anyhow you need a mail server, you may consider the google mail server.

http://www.google.com/a/cpanel/domain/new


for hosting your MX record, you may consider ZoneEdit.com.
to add MX Record, follow the below link:

http://www.google.com/support/a/bin/answer.py?hl=en&answer=55378

Tuesday, September 8, 2009

Comparison In JAVA

Method 1
if(object.equals(null))   --> will return false
but,
Method 2
if(.equals(object) )  --> will return null


conclusion is, when running comparison, please use the Method 1
to avoid from the system throw the Null Pointer Exception

Thursday, August 20, 2009

JAVA - Convert Unixtimestamp to java.util.date

Solution that i got finally:

E.g.
long unixtime = new Long(1250740910) * 1000;
Date messageTime = new Date(unixtime);


*p.s. 1250740910 - the unixtimestamp


Struggling in JAVA

J2EE is very complicated. In terms of there are so many framework out there, and there are so many patterns out there, the settings and so on...
Before start to work in J2EE, you would have to have solid Object-Oriented Programming Concept, which i think i'm lacking of now.