6/27/2013

Detect web browser language


 $client_language=$_SERVER['HTTP_ACCEPT_LANGUAGE'];
 $find_str="KR";
 $find_pos=strpos($client_language,$find_str);
 if($find_pos==TRUE)
 {
    print("found ko");
 }
 else
 {
    print("not found ko");
 }
?>

6/20/2013

Google Chrome cash directory change.


open Chrome property dialog.

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"

Add cache directory name.

--disk-cache-dir="R:\TEMP\CHROME"


-- complete .

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"  --disk-cache-dir="R:\USERTEMP"


-- remove previous chrome cache dir.

C:\Users\ your name dir \AppData\Local\Google\Chrome\User Data\Default

/Default/Cache

/Default/Media Cache


Round View - android


- android Resource res drawable

rounded_corner_view.xml



http://schemas.android.com/apk/res/android
">   
   
   



Layour background


android:layout_height="wrap_content"
android:background="@drawable/rounded_corner_view"
android:padding="12dip"
android:orientation="vertical">
 

6/10/2013

visual studio 2012 initialize. reset


Visual Studio 2012 too slow.

initialize user data.


start menu --> command   

devenv.exe /resetuserdata 

For more information, http://www.microsoft.com

6/07/2013

serial port cts rts checking signal cable. linux and win32



// win32

int IsCTSEnabled(int handle)
{
  int status;

  GetCommModemStatus(handle, (LPDWORD)((void *)&status));

  if(status&MS_CTS_ON) return(1);
  else return(0);
}

// linux.

// ref
/*
TIOCM_LE  DSR (data set ready/line enable)
TIOCM_DTR DTR (data terminal ready)
TIOCM_RTS RTS (request to send)
TIOCM_ST  Secondary TXD (transmit)
TIOCM_SR  Secondary RXD (receive)
TIOCM_CTS CTS (clear to send)
TIOCM_CAR DCD (data carrier detect)
TIOCM_CD  Synonym for TIOCM_CAR
TIOCM_RNG RNG (ring)
TIOCM_RI  Synonym for TIOCM_RNG
TIOCM_DSR DSR (data set ready)
*/
int RS232_IsCTSEnabled(int handle)
{
  int status;

  ioctl((int handle, TIOCMGET, &status);

  if(status&TIOCM_CTS) return(1);
  else return(0);
}