mysql 5.7 메뉴얼인데.. 1970 epoch 기준으로 timestamp를 사용되는데 32bit 인가..

mysql 64bit면 더 길게 저장이 되려나?



아무튼 차이점은 timestamp는 UTC + epoch(2038년 문제 발생)

datetime은 9999년까지 가능


The DATETIME type is used for values that contain both date and time parts. MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD HH:MM:SS' format. The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'.


The TIMESTAMP data type is used for values that contain both date and time parts. TIMESTAMP has a range of '1970-01-01 00:00:01' UTC to '2038-01-19 03:14:07' UTC

[링크 : http://dev.mysql.com/doc/refman/5.7/en/datetime.html]


8바이트 먹지만 DATETIME형을 쓰는게 2038 문제 회피에 유리하다 인가?

[링크 : http://stackoverflow.com/questions/2012589/php-mysql-year-2038-bug-what-is-it-how-to-solve-it]


[링크 : http://mysqldba.tistory.com/268]

[링크 : http://blog.naver.com/gigar/60115731039]

[링크 : http://linux.systemv.pe.kr/timestamp-datetime-기능-개선/]


DATETIME에는 NOW() 함수로 현재 시간을 넣어 줄 수 있네

[링크 : http://jsonobject.tistory.com/122]

Posted by 구차니
Programming/php2017. 1. 4. 09:21

문구를 보는데 이게 먼가 싶은데..

일단 XN[NAME] 으로 X는 타입 N은 자릿수 인거고 뒤에는 array의 key값이 되는 듯?


array unpack ( string $format , string $data )

string pack ( string $format [, mixed $args [, mixed $... ]] )

[링크 : http://php.net/manual/en/function.unpack.php]


format

The format string consists of format codes followed by an optional repeater argument. The repeater argument can be either an integer value or * for repeating to the end of the input data. For a, A, h, H the repeat count specifies how many characters of one data argument are taken, for @ it is the absolute position where to put the next data, for everything else the repeat count specifies how many data arguments are consumed and packed into the resulting binary string.

[링크 : http://php.net/manual/en/function.pack.php]

[링크 : http://www.w3schools.com/php/func_misc_unpack.asp]


+

2017.01.06

"C*"은 그럼 singed char를 무한반복해서 unpack 하라는 의미였고

"i1"은 signed integer를 1번 만 하라는 의미였군

'Programming > php' 카테고리의 다른 글

PHP 최적화 관련  (0) 2017.01.09
php 로그인 관련 - 세션  (0) 2017.01.06
php foreach / array  (0) 2017.01.03
php "str"과 'str' 차이점  (2) 2017.01.03
php class 그리고.. 구조체가 없다?  (0) 2017.01.02
Posted by 구차니
프로그램 사용/vi2017. 1. 3. 11:53

'프로그램 사용 > vi' 카테고리의 다른 글

vi 현재 위치에서 끝까지 복사  (0) 2017.02.01
vi 단어 단위 이동  (0) 2017.02.01
vimdiff 사용법  (0) 2016.11.17
vi 스크롤  (0) 2016.11.10
vi ctrl-s / ctrl-q  (0) 2016.11.09
Posted by 구차니
Programming/php2017. 1. 3. 11:23

배열 초기화 방법


$array['foo'] = "bar";

$array['bar'] = "foor";

[링크 : http://blogchannel.tistory.com/110]


<?php

$array = array(

    "foo" => "bar",

    "bar" => "foo",

);


// as of PHP 5.4

$array = [

    "foo" => "bar",

    "bar" => "foo",

];

?> 

[링크 : http://php.net/manual/en/language.types.array.php]


var_dump() 는 일종의.. 디버깅용도로 볼수 있을려나?

[링크 : http://php.net/manual/en/function.var-dump.php]


foreach (array_expression as $value)

    statement

foreach (array_expression as $key => $value)

    statement 

[링크 : http://php.net/manual/en/control-structures.foreach.php]

[링크 : http://blog.habonyphp.com/entry/php-배열에만-동작하는-반복문-foreach문]

'Programming > php' 카테고리의 다른 글

php 로그인 관련 - 세션  (0) 2017.01.06
php pack / unpack  (0) 2017.01.04
php "str"과 'str' 차이점  (2) 2017.01.03
php class 그리고.. 구조체가 없다?  (0) 2017.01.02
php 변수 스코프  (0) 2017.01.02
Posted by 구차니
Programming/php2017. 1. 3. 10:25

간단하게 요약(?) 하자면

array에는 되도록이면 'a' 로 해서 확장없이 빠르게 처리하는게 유리할 듯?



echo $data["a"]    이 경우 "a" 안에 치환할게 있는지 검사후 그냥 문자열 "a" 로 인식합니다.

echo $data['a']     이 경우 'a' 는 문자열이므로 바로 $data 에서 index 가 'a' 인 값을 찾을 수 있습니다.

[링크 : http://www.technote.co.kr/php/technote1/board.php?board=study&command=body&no=138]


다음과 같이 더블쿼터의 경우 더블쿼터 안에 있는 문자열에서 변수 등 치환할 값이 있으면 

그를 치환하여 출력한다. 하지만 싱글쿼터의 경우에는 치환할 값을 찾지 않고 그대로 값을 출력한다. 

[링크 : http://luckyyowu.tistory.com/61]


Single quoted

The simplest way to specify a string is to enclose it in single quotes (the character ').

To specify a literal single quote, escape it with a backslash (\). To specify a literal backslash, double it (\\). All other instances of backslash will be treated as a literal backslash: this means that the other escape sequences you might be used to, such as \r or \n, will be output literally as specified rather than having any special meaning.

[링크 : http://php.net/manual/en/language.types.string.php#language.types.string.syntax.single]


Double quoted

If the string is enclosed in double-quotes ("), PHP will interpret the following escape sequences for special characters:

As in single quoted strings, escaping any other character will result in the backslash being printed too. Before PHP 5.1.1, the backslash in \{$var} had not been printed.

The most important feature of double-quoted strings is the fact that variable names will be expanded. See string parsing for details.

[링크 : http://php.net/manual/en/language.types.string.php#language.types.string.syntax.double]


<?php

$juice = "apple";


echo "He drank some $juice juice.".PHP_EOL;

// Invalid. "s" is a valid character for a variable name, but the variable is $juice.

echo "He drank some juice made of $juices.";

// Valid. Explicitly specify the end of the variable name by enclosing it in braces:

echo "He drank some juice made of ${juice}s."

?>


He drank some apple juice.

He drank some juice made of .

He drank some juice made of apples. 

[링크 : http://php.net/manual/en/language.types.string.php]

[링크 : http://php.net/manual/en/language.types.string.php#language.types.string.parsing]

'Programming > php' 카테고리의 다른 글

php pack / unpack  (0) 2017.01.04
php foreach / array  (0) 2017.01.03
php class 그리고.. 구조체가 없다?  (0) 2017.01.02
php 변수 스코프  (0) 2017.01.02
php print_r  (0) 2017.01.02
Posted by 구차니

단종된게 대개 그렇지만, 보안상의 이유로 더 이상 유지하지 않기로..

[링크 : http://blog.learningtree.com/rhel-7-new-features-samba-4-changes/]


요건 다 예전 문서가 되어버리네.

[링크 : https://help.ubuntu.com/community/Swat]

[링크 : https://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/SWAT.html]

Posted by 구차니
프로그램 사용/gcc2017. 1. 2. 15:14

'프로그램 사용 > gcc' 카테고리의 다른 글

문자열에 escape 로 특수문자 넣기  (0) 2017.06.19
gcc cpp type (유니코드 문자열)  (0) 2017.04.04
gcc make CFLAGS=-D 관련  (0) 2016.11.17
gcc -fPIC  (0) 2016.06.22
gcc dependency .d 파일?  (0) 2016.03.28
Posted by 구차니
프로그램 사용/aws2017. 1. 2. 11:50

Function as a Service

msec 단위과금


장점으로는 딱 서비스에 집중하고 서버 구성이나 운영은 전혀 고민할 필요없다. 정도?



[링크 : http://www.zdnet.co.kr/column/column_view.asp?artice_id=20160614172904]

[링크 : http://blog.aliencube.org/ko/2016/06/23/serverless-architectures/]

[링크 : https://aws.amazon.com/ko/blogs/korea/serverless-architecture-by-korean-developers/]

'프로그램 사용 > aws' 카테고리의 다른 글

aws EC2 요금제  (0) 2024.05.10
aws 스토리지  (0) 2024.05.06
aws 리전별 가격비교  (0) 2024.05.06
aws vpc  (0) 2024.05.06
아마존 AWS 가입  (0) 2024.04.22
Posted by 구차니
Programming/php2017. 1. 2. 09:33

->는 구조체가 아니라 클래스에 쓰는 애라..

[링크 : http://php.net/manual/kr/language.oop5.php]

    [링크 : http://php.net/manual/kr/language.oop5.constants.php]


그리고 구조체는 없으니까 array로 대체해서 쓰던가 말던가?!!

[링크 : http://www.phpschool.com/gnuboard4/bbs/board.php?bo_table=qna_function&wr_id=313395]



php관련 예제들 중에 -> 나오면 일단 클래스 쓰고 있다고 보면 되겠군..

'Programming > php' 카테고리의 다른 글

php foreach / array  (0) 2017.01.03
php "str"과 'str' 차이점  (2) 2017.01.03
php 변수 스코프  (0) 2017.01.02
php print_r  (0) 2017.01.02
php 게시판  (0) 2016.12.28
Posted by 구차니
Programming/php2017. 1. 2. 09:18

음.. C로 치면 전역 변수로 쓰면

함수 내에서 반드시

$GLOBALS["var"]

이런식으로 불러와야 한다. 아구 귀찮아..


[링크 : http://php.net/manual/en/reserved.variables.globals.php]


아무튼 자매품(?)으로

$_GET

$_POST

$_SESSION 등이 있네

Table of Contents ¶

[링크 : http://php.net/manual/en/reserved.variables.php]

'Programming > php' 카테고리의 다른 글

php "str"과 'str' 차이점  (2) 2017.01.03
php class 그리고.. 구조체가 없다?  (0) 2017.01.02
php print_r  (0) 2017.01.02
php 게시판  (0) 2016.12.28
php db connection pool  (0) 2016.12.28
Posted by 구차니