Name: 튜토리얼에서 보면 제일 처음에 나오는 것이다.angularjs는 ng-app=""라는 지시자가 정의된 엘리먼트의 하위 엘리먼트에만 AngularJS application으로써 적용된다. ng-model이라는 것은 튜토리얼에서 따르자면 AngularJS application의 변수로 name이라는 것을 생성하는 것이다.ng-bind는 그렇게 생성된 변수를 실시간으로 복사해서 ng-bind 지시자가 적용된 곳에 바인딩 시켜준다. The name is ng-init은 AngularJS의 변수를 초기화 생성 해주는 지시자이다.페이지가 로드될 때 ng-bind="firstName"에 john이 바인딩 된다 My first expression: {{ 5 + 5 }} {{ name1 + name2 }} j..
ejs와 jade는 특수한 형태로 html 페이지를 생성해주는 외부모듈 라이브러리다. 예를 들어 ejs모듈 같은경우jsp에서와 같은 (데이터 출력), (자바스크립트 코드 입력) 같은 표현을 사용한다. html같은 경우 정적인 페이지 이기 때문에 서버에서 받아오는 매번 바뀌는 동적인 데이터를 표현할 방법이 없다.하지만 ejs를 이용하면 동적 데이터를 웹페이지에 나타낼 수 있다. 사용방법은 우선 설치를 해야한다.(CMD에서)>npm install ejs>npm install jade모듈이 잘 설치되었는지 확인한다.>npm list 인터넷이나 책을 보면 바로 require('ejs')라는 형식으로 바로 모듈을 사용하지만 본인은 오류가 나서 직접 로컬 프로젝트 폴더에 라이브러리를 옮겨서 사용했다. 간단하게 테스..
깊은복사, 얕은복사 (값에 의한 복사, 참조에 의한 복사)class Program { static void Main(string[] args) { Deep d1 = new Deep(); //struct 값형식 d1.a = 10; Deep d2 = d1; d2.a = 20; Console.WriteLine("d1.a의값 : {0}, d2.a의값 : {1}", d1.a, d2.a); //struct구조체는 값형식의 특성을 띄고 있습니다. //struct변수는 할당받은 값과 같은 값을 가지고 //복사가 이루어져 새로운 인스턴스를 생성한 것 같은 특징을 띄고 있습니다. //결과적으로 d2가 가지고 있는 a변수의 변경에 d1은 영향을 받지 않습니다. //이런것을 '깊은복사'라고 합니다. Shallow s1 = n..
__filename : 현재 파일의 위치__dirname : 현재 폴더의 위치 process 객체속성들 argv 실행시 넘겨줄 매개변수 env 컴퓨터 정보 version node.js의 버전 versions node.js에 종속된 프로그램들의 버전을 가져옵니다.(객체) arch 실행되고 있는 플랫폼 메서드들 exit() 프로그램 종료(인자로 1을 넘겨줄 경우 비정상적인 종료) memoryUsage() 메모리 사용정보 객체 uptime() 현재프로그램의 실행 시간 console.log()로 출력 모듈node.js에서 모듈이란 기능을 쉽게 사용할 수 있도록 미리 속성이나 메서드를 정의해 놓은 것 exports객체require()를 이용해서 외부 파일을 가져오는데 exports객체를 이용해서 속성이나 메서드를..
이클립스에 node.js를 설치하기 위해 삽질을 좀 했습니다. 사실 엄청 간단한건데 인터넷에 의지하다 보니 다 비슷 비슷한 내용을 보여주고 있어 서버시작을 못하는 부분에 대해서는 참고할 만한 내용이 없었습니다. 진행하기 위해서는 우선은 윈도우에 node.js가 설치되어 있어야합니다. 그리고 cmd창에 npm install -g nodeclipse npm install -g express npm install -g coffee-script 를 입력해줘서 설치해줘야 합니다. 1. 이클립스 마켓플레이스에 들어갑니다. node를 검색해서 아래 보이는 것을 인스톨합니다. 2. 인스톨이 끝나고 재부팅을 하면 이제 이클립스창의 window - preferences - nodeclipse 에서 node.js path를..
프로그래밍에서 다뤄지는 모든데이터는 결국 byte데이터 입니다.프로그래밍 하시는 분들은 아시겠지만 1byte는 8개의 bit를 가지고 한개의 bit는 이진수로 1과 0의 값을 가집니다.일련의 데이터를 바이트배열로 변환하는 작업을 직렬화, 다시 그 바이트배열을 원래 형태의 데이터로 복원하는 작업을 역직렬화라고 합니다. System.BitConverter BitConverter클래스는 getBytes함수를 통해 바이트 배열로 변환을 해줍니다. 다시 역직렬화를 위해서는 ToBoolean등의 함수를 사용하여 하면 됩니다. byte[] ibytes = BitConverter.GetBytes(450000); byte[] bbytes = BitConverter.GetBytes(true); byte[] dbytes =..
호스트OS인 윈도우에서 NAT환경의 게스트OS인 리눅스에 접속하는 방법 우선 NAT환경으로 리눅스에 셋팅되어 네트워크 연결이 가능하다는 가정하에 정리한다. Edit - Virtual Network Editor - Nat Settings.. 에서 Port Forwarding에 추가를 해야한다.타입은 TCP로 호스트 포트는 윈도우에서 접속할 포트를 적어준다. 1024이상을 적는다. 나는 9999포트를 넣었다. 아이피는 해당 게스트OS 리눅스의 ifconfig의 ip를 적는다. 버츄얼 머신 포트는 게스트OS로 접속될때 포워딩 될 포트를 적는다. SSH의 포트인 22를 넣었다. 이제 호스트OS인 윈도우의 방화벽 포트를 열어줘야 된다. NAT Settings..에서 설정한 포트인 9999를 열어준다.제어판 - 방..
자바 7 (Diamond)지시자 제네릭스를 사용할 때 기존의 list1변수처럼 인스턴스 생성을 해왔지만, 자바7 부터는 지시자로 new연산자 부분을 함축할 수 있게 되었다. 자바7 부터는 정수형․실수형 리터럴에 _구분자를 넣을 수 있게 되어 숫자를 구분하기가 수월해졌다. switch문의 인자로 String타입의 값을 사용할 수 있게 되었다. try~catch문의 catch문에서 익셉션타입을 여러개 정의 할 수 있게 되었다. 기존에 파일 입출력을 사용하기 위해서는 자원을 가져다 쓰고 나면 finally부분에서 자원을 해제해줘야만 했다. 자바 7부터는 위와 같은 표현이 가능하다 try키워드문의 인자에 자원을 할당하는 코드를 생성하면 자원해제는 자동으로 관리해준다. try블록에 존재하는 기능이 한번에 자동으로..
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication141119 { class Program { static void Main(string[] args) { int n = 0; string t = null; //////////////////////////////////////////////////////// try { n = 10 / n; //예외 구문을 사용하지 않고 위 라인의 코드를 사용하면 DevideByZeroException을 경험할 것이다. } catch { } ////////////////..
닷넷 프로그램은 CLR환경이 초기화 된 후 개발자가 작성한 소스코드가 실행되는 구조다. 그런데 가끔은 이 초기화 과정에어 어떤 값을 전달하고 싶을 때가 있는데 아쉽게도 소스코딩으로만으론 이 초기화 코드를 작성할 수 없다. 그래서 닷넷은 app.config라는 설정파일을 제공한다. 비주얼 스튜디오 환경에서솔루션 탐색기의 프로젝트에 대고우클릭 - 추가 - 새항목 - 응용프로그램 구성파일을 선택하면 app.config 파일이 생성된다. 이 파일은 XML형식을 따른다. app.config에 들어가는 엘리먼트를 알아보면 1. supportedRuntime supportedRuntime은 닷넷CLR의 버전을 명시하고 있다.이것은 초기에 4.5버전을 가지고 있으며, 원한다면 프로젝트 - 속성 - 응용프로그램탭 - 대..
animate함수는 요소에 대하여 애니메이션 효과를 지정하여 보여줄 수 있도록 합니다. animate의 함수 형태1234$(선택자).animate(object);$(선택자).animate(object, speed);$(선택자).animate(object, speed, easing);$(선택자).animate(object, speed, easing, callback);csobject는 객체타입으로 속성을 지정한다.speed는 밀리초를 지정하여 애니메이션이 수행될 시간을 지정한다. (1000은 1초)easing은 애니메이션의 부드러운 효과를 나타낼 때 사용한다.callback은 콜백함수로써 애니메이션이 끝난 후 수행될 함수를 지정한다. animate에 지정할 수 있는 효과 속성opacity, top, lef..
Templeate method패턴은 추상메서드를 사용한 패턴으로써 메소드의 실행 알고리즘은 추상클래스에서 담당하고, 이 추상클래스를 상속받는 클래스는 추상클래스의 추상메서드를 구현하는 패턴입니다. 이 패턴을 사용함으로써 생기는 이점은 알고리즘의 변경사항이 생길 때, 각각의 클래스에 대한 변경을 추상클래스 하나의 변경으로 축소함으로써 일일이 변경해야되는 막가파식 코딩을 막을 수 있습니다. //템플레이트 메소드 패턴 abstract class LotteWorld{ int token; abstract int 표내기(); abstract void 타기(); protected void 체험(){ int currentToken = 표내기(); //System.out.println(currentToken); if(c..