한글로 되어 있음. 꼭 봐야 됨
-
This is Slide 1 Title
This is slide 1 description. Go to Edit HTML and replace these sentences with your own words. This is a Blogger template by Lasantha - PremiumBloggerTemplates.com...
-
This is Slide 2 Title
This is slide 2 description. Go to Edit HTML and replace these sentences with your own words. This is a Blogger template by Lasantha - PremiumBloggerTemplates.com...
-
This is Slide 3 Title
This is slide 3 description. Go to Edit HTML and replace these sentences with your own words. This is a Blogger template by Lasantha - PremiumBloggerTemplates.com...
2016년 6월 1일 수요일
2016년 1월 28일 목요일
Laravel - Code bright for Laravel PHP 라는 책을 집필한 저자의 블로그
http://daylerees.com/codebright/codebright
http://daylerees.com/php-pandas/
Code bright for Laravel PHP 라는 책을 집필한 저자의 블로그
2015년 12월 20일 일요일
cookie encrypt - decript
$enc = trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $sSalt, base64_decode($sCookieId), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)));
$dec = trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $sSalt, $sCookieId, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));
$dec = trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $sSalt, $sCookieId, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));
2015년 10월 28일 수요일
PHP DesignPattern 예제는 여기..
http://www.php5dp.com/a-simple-php-design-pattern-the-factory-method/
http://designpatternsphp.readthedocs.org/en/latest/README.html 여긴좀...
http://designpatternsphp.readthedocs.org/en/latest/README.html 여긴좀...
2015년 10월 16일 금요일
PHP 의존성 주입 예제
이해가 되는 슬라이드
http://www.slideshare.net/rifat/dependency-injection-10624875?qid=5def2560-b50b-4e50-8592-cb7d4d077516&v=qf1&b=&from_search=6
http://modernpug.github.io/php-the-right-way/#dependency_injection 에서 발췌
위키백과에서 인용:
위와 같은 설명은 실제보다 훨씬 어렵게 느껴지게 만드는 점이 있습니다. 의존성 주입이라는 것은 특정 컴포넌트의 의존 관계를, 생성자에서 주입하거나 메소드 호출 혹은 프로퍼티 설정을 하는 방식으로 지정할 수 있게 하는 것입니다. 간단한 얘기입니다.
간단한 예제를 통해서 기본적인 개념을 보여드리겠습니다.
아래 코드를 보면 데이터베이스와 통신하기 위한 어댑터를 필요로 하는
아래와 같이 리팩터링하여 의존성 주입을 사용하도록 하면 의존 관계를 약화시킬 수 있습니다.
이제
http://www.slideshare.net/rifat/dependency-injection-10624875?qid=5def2560-b50b-4e50-8592-cb7d4d077516&v=qf1&b=&from_search=6
http://modernpug.github.io/php-the-right-way/#dependency_injection 에서 발췌
의존성 주입
위키백과에서 인용:
의존성 주입(Dependency Injection, DI)은 프로그래밍에서 구성요소간의 종속성을 소스코드에서 설정하지 않고 외부의 설정파일 등을 통해 컴파일 시점이나 실행 시점에 주입하도록 하는 디자인 패턴 중의 하나이다.
위와 같은 설명은 실제보다 훨씬 어렵게 느껴지게 만드는 점이 있습니다. 의존성 주입이라는 것은 특정 컴포넌트의 의존 관계를, 생성자에서 주입하거나 메소드 호출 혹은 프로퍼티 설정을 하는 방식으로 지정할 수 있게 하는 것입니다. 간단한 얘기입니다.
기본 개념
간단한 예제를 통해서 기본적인 개념을 보여드리겠습니다.
아래 코드를 보면 데이터베이스와 통신하기 위한 어댑터를 필요로 하는
Database
라는 클래스가 있습니다. 생성자에서 어댑터 인스턴스를 생성하는 방식으로 되어 있어서 두 클래스는 서로 강한 의존 관계를 가지고 있습니다. 그래서 Database
클래스를 테스트하기도 어렵습니다.<?php
namespace Database;
class Database
{
protected $adapter;
public function __construct()
{
$this->adapter = new MySqlAdapter;
}
}
class MysqlAdapter {}
아래와 같이 리팩터링하여 의존성 주입을 사용하도록 하면 의존 관계를 약화시킬 수 있습니다.
<?php
namespace Database;
class Database
{
protected $adapter;
public function __construct(MySqlAdapter $adapter)
{
$this->adapter = $adapter;
}
}
class MysqlAdapter {}
이제
Database
는 내부에서 직접 의존 관계에 있는 클래스 인스턴스를 생성하지 않고, 외부에서 전달받게 되었습니다. 어댑터 인스턴스를 인자로 전달받는 메소드를 만들어서 해당 어댑터를 사용하도록 설정하는 방식을 적용하거나, $adapter
프로퍼티를public
으로 만들어서 프로퍼티를 직접 설정하게 할 수도 있을 것입니다.2015년 10월 15일 목요일
php design patterns
http://wafe.github.io/php-the-right-way/pages/Design-Patterns.html
http://www.phptherightway.com/pages/Design-Patterns.html
http://mytory.net/archives/1948/
https://sourcemaking.com/design_patterns/observer/php
http://designpatternsphpko.readthedocs.org/ko/latest/
http://dsheiko.com/weblog/design-patterns-by-php-and-js-es5-examples/
http://www.phptherightway.com/pages/Design-Patterns.html
http://mytory.net/archives/1948/
https://sourcemaking.com/design_patterns/observer/php
http://designpatternsphpko.readthedocs.org/ko/latest/
http://dsheiko.com/weblog/design-patterns-by-php-and-js-es5-examples/
2015년 3월 18일 수요일
2015년 3월 9일 월요일
connecting-to-php-service-from-ios.html
http://divcode.blogspot.kr/2012/08/connecting-to-php-service-from-ios.html
2014년 10월 7일 화요일
두 박스간 스케일 비율 계산
this.percentageBetweenContainer=function( argContainer ) {
var pntContainer=argContainer;
var floatXScale=1.0;
var floatYScale= 1.0;
var floatRet=1.0;
if( pntContainer.w > posBounds.w && pntContainer.h > posBounds.h ){
return floatRet;
}
floatXScale=(pntContainer.w)/(posBounds.w);
floatYScale=(pntContainer.h)/(posBounds.h);
if(floatXScale<floatYScale){
floatRet=floatXScale;
}else{
floatRet=floatYScale;
}
return floatRet;
}
var pntContainer=argContainer;
var floatXScale=1.0;
var floatYScale= 1.0;
var floatRet=1.0;
if( pntContainer.w > posBounds.w && pntContainer.h > posBounds.h ){
return floatRet;
}
floatXScale=(pntContainer.w)/(posBounds.w);
floatYScale=(pntContainer.h)/(posBounds.h);
if(floatXScale<floatYScale){
floatRet=floatXScale;
}else{
floatRet=floatYScale;
}
return floatRet;
}