Posted
Filed under Htm&Javascript

delimiter $$
create trigger update_check BEFORE UPDATE on tb_list FOR EACH ROW
BEGIN
 
 IF NEW.tname <> OLD.tname THEN
           SET NEW.tname = OLD.tname;
 END IF;
END$$

delimiter ;

2015/03/31 23:08 2015/03/31 23:08
Posted
Filed under Htm&Javascript

[원문]http://stackoverflow.com/questions/1649086/detect-rotation-of-android-phone-in-the-browser-with-javascript
[설명] 크롬 <-- 안드로이드 에서 모바일 환경에서 핸드폰 회전할 때  width 값을  구할 수 있는 스크립트


var isMobile = {
    Android: function() {
        return /Android/i.test(navigator.userAgent);
    },
    iOS: function() {
        return /iPhone|iPad|iPod/i.test(navigator.userAgent);
    }
};
if(isMobile.Android())
    {
        var previousWidth=$(window).width();
        $(window).on({
        resize: function(e) {
        var YourFunction=(function(){

            var screenWidth=$(window).width();
            if(previousWidth!=screenWidth)
            {
                previousWidth=screenWidth;
                alert("oreientation changed");
            }

        })();

        }
    });

    }
    else//mainly for ios
    {
        $(window).on({
            orientationchange: function(e) {
               alert("orientation changed");
            }  
        });
    }

2015/03/26 10:11 2015/03/26 10:11
Posted
Filed under Mysql

1. MySQL Replication 환경에서 지우기

  - MySQL Replication MASTER 서버
    shell> mysql -u root -p
    mysql> RESET MASTER;

  - MySQL Replication SLAVE 서버
    shell> mysql -u root -p
    mysql> RESET MASTER;

2. MySQL Binary Log sequence number 또는 특정 일자로 지우기

  shell> mysql -u root -p
  mysql> PURGE BINARY LOGS TO 'mysql-bin.000015';
  shell> mysql -u root -p
  mysql> PURGE BINARY LOGS BEFORE '2009-05-01 00:00:00';

3. mysqladmin flush-logs 명령어를 통해서 MySQL Binary Log 지우기

   shell> mysqladmin -u root -p flush-logs

4. MySQL Binary Log 생성을 방지하는 방법

  /etc/my.cnf 파일에서 아래 라인을 주석 처리
  log-bin

5. MySQL Binary Log 를 특정 1주일까지만 생성 및 보관하기
  /etc/my.cnf 파일에서 아래 라인을 추가
  expire_logs_days = 7

[원문] http://faq.hostway.co.kr/Linux_DB/1307

 

2015/03/12 09:05 2015/03/12 09:05