array를 json으로 변경


JSON.stringify(Array);

'WEB > javascript' 카테고리의 다른 글

[javascript] 정렬하기  (0) 2014.08.01
자바 스크립트 상속 구조  (0) 2014.07.05

자바로 프로그램을 완성하고 나서 설치형 파일로 배포 하는것이 엄청 불편하다.

MS 진영에서는 설치 파일을 MS Visual Studio에서 제공하는것으로 알고 있으나, 자바에는 그런 기능이 없다.

그리하여 여러군데를 찾아 배포할 수 있는 파일을 만들어주는 무료 툴을 찾았다.


install factory보다는 강력하고 유명한 배포툴인 인스톨 쉴드만큼의 기능을 제공한다.



일단 홈페이지에서 파일을 다운 받는다.

http://www.jrsoftware.org/isdl.php



중간에 설치에 아래 그림과 같은 설정을 해주어야한다.


다른 파일을 같이 포함하여 파는줄 알고 체크를 해제하였으나, 스크립트에 문법을 포함하겠는지를 물어보는 화면이다.





위와 같이 설치가 완료되면 프로그램을 사용할 수 있다.


간단한 설정 몇가지를 알아본다면.


; 표시는 주석이며, [SETUP] 등 카테고리 마다의 설정이다.

또한 #define을 사용하여 이름을 명명할 수 있다.




; Script generated by the Inno Setup Script Wizard.

; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!


#define EMSDIR "파일 경로"

#define EMSDIR_OUT "현재 파일위치"


;톰켓위치

#define TOMCAT "{pf}\Apache Software Foundation\Tomcat 7.0"

[Setup]

; NOTE: The value of AppId uniquely identifies this application.

; Do not use the same AppId value in installers for other applications.

; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)

AppId={{1B453729-1A6A-42A3-A386-D5701937489C}

AppName=EMS

AppVersion=1.5

;AppVerName=EMS 1.5


;회사주소

AppPublisher=abc

AppPublisherURL=http://www.abc.com

AppSupportURL=http://www.abc.com

AppUpdatesURL=http://www.abc.com

DefaultDirName={#EMSDIR}

DisableDirPage=yes

DefaultGroupName=EMS

DisableProgramGroupPage=yes

OutputDir={#EMSDIR_OUT}

OutputBaseFilename=EMS

Compression=lzma

SolidCompression=yes



[Files]

;파일 복사 스크립트 recursesubdirs : 하위 디렉토리 까지

;copy DB File

Source: "{#EMSDIR_OUT}\EMS\*"; DestDir: "{#EMSDIR}"; Flags:"recursesubdirs";


;파일 복사 스크립트 recursesubdirs : 하위 디렉토리 까지

;copy tomcat files

Source: "{#EMSDIR_OUT}\tomcat\*"; DestDir: "{#TOMCAT}"; Flags:"recursesubdirs";


;파일 복사 스크립트 recursesubdirs : 하위 디렉토리 까지

;copy serial dll file

Source: "{#EMSDIR_OUT}\serial\*"; DestDir: "{syswow64}"; Flags:"recursesubdirs";


[Languages]

Name: "english"; MessagesFile: "compiler:Default.isl"


[Run] 

;톰켓을 서비스 등록한다.

;set tomcat service to automatic start

Filename: "{cmd}"; Parameters: "/c ""{#TOMCAT}/bin/Tomcat7.exe"" //US/Tomcat7 --Startup=auto"; Flags:"runhidden";


;윈도우 설정인 전원 옵션

;set power option

Filename: "{cmd}"; Parameters: "/c powercfg -change -monitor-timeout-ac 0"; Flags:"runhidden";

Filename: "{cmd}"; Parameters: "/c powercfg -change -monitor-timeout-dc 0"; Flags:"runhidden";

Filename: "{cmd}"; Parameters: "/c powercfg -change -disk-timeout-ac 0"; Flags:"runhidden";

Filename: "{cmd}"; Parameters: "/c powercfg -change -disk-timeout-dc 0"; Flags:"runhidden";

Filename: "{cmd}"; Parameters: "/c powercfg -change -standby-timeout-ac 0"; Flags:"runhidden";

Filename: "{cmd}"; Parameters: "/c powercfg -change -standby-timeout-dc 0"; Flags:"runhidden";

Filename: "{cmd}"; Parameters: "/c powercfg -change -hibernate-timeout-ac 0"; Flags:"runhidden";

Filename: "{cmd}"; Parameters: "/c powercfg -change -hibernate-timeout-dc 0"; Flags:"runhidden";


;윈도우 방화벽 제거

;set firewall stop

Filename: "{cmd}"; Parameters: "/c sc stop ""MpsSvc"""; Flags:"runhidden"; 

Filename: "{cmd}"; Parameters: "/c sc config ""MpsSvc"" start= disabled"; Flags:"runhidden"; 


;윈도우 업데이트 방지

;set window update stop

Filename: "{cmd}"; Parameters: "/c sc stop ""wuauserv"""; Flags:"runhidden"; 

Filename: "{cmd}"; Parameters: "/c sc config ""wuauserv"" start= disabled"; Flags:"runhidden"; 


;자바 업데이트 방지

;java update

Filename: "{cmd}"; Parameters: "C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f"; Flags:"shellexec runhidden"; 


[Registry]

;레지스트리 등록, 자바 업데이트 방지

;disable java update

Root: HKLM; Subkey: "SOFTWARE\JavaSoft\Java Update\Policy"; ValueType: dword; ValueName: "EnableJavaUpdate"; ValueData: "0";


;작업 표시줄 없애는 레지스트인데 동작을 안한다 ㅠㅠ.

;not working !!!! - taskbar auto hide

;Root: HKCU; Subkey: "Software\Micros0000000000oft\Windows\CurrentVersion\Explorer\StuckRects2"; ValueType: binary; ValueName: "Settings"; ValueData: "28 00 00 00 ff ff ff ff 03 00 00 00 03 00 00 00 6b 00 00 00 22 00 00 00 00 00 00 00 de 02 00 00 00 04 00 00 00 03 00 00";


;디렉 토리 삭제

[InstallDelete]

Type: filesandordirs; Name: "{#TOMCAT}\webapps\ROOT";






위와 같이 파일 복사, 삭제, 레지스트리 설정, cmd실행 창 제어 등 많은 기능들을 할 수 있다.


이 설정을 컴파일하면 하나의 설치 파일이 생성된다.(.exe)


'기타' 카테고리의 다른 글

[eclipse] camel 표기법변환  (0) 2014.10.26
[이클립스] 주석 설정  (0) 2014.09.02
[이클립스] 프로퍼티 파일 한글 깨짐  (0) 2014.08.23
ai (일러스트파일) png 변환  (0) 2014.08.13
[MAVEN] 명령어  (0) 2014.08.12

js 문법을 체크해준다.






특정 경고를 무시할 때는 아래와 같이 해준다.

/* jshint ignore:start */

function a(){

}

/* jshint ignore:end */





특정 라인만 무시할려면 아래와 같이 해준다.


// jshint ignore:line




자세한 설명은 아래 링크 참고


사이트 : http://www.jshint.com/

옵션 : http://blog.outsider.ne.kr/1007



기본적인  angluarjs 옵션들.


{

  "curly": true,

  "eqeqeq": true,

  "immed": true,

  "latedef": true,

  "newcap": true,

  "noarg": true,

  "sub": true,

  "undef": true,

  "unused": true,

  "boss": true,

  "eqnull": true,

  "multistr": true,

  "node": true,

  "predef": [

    "suite",

    "setup",

    "test",

    "angular",

    "describe",

    "beforeEach",

    "inject",

    "it",

    "expect"

  ]

}


'WEB > 프론트 개발환경' 카테고리의 다른 글

Grunt 설정  (0) 2014.03.15
개발환경 셋팅  (0) 2014.03.15
자바 스크립트 기술기반  (0) 2014.03.15

* rev : 이름 변경


// Renames files for browser caching purposes

        rev: {

            dist: {

                files: {

                    src: [

                        '<%= config.dist %>/scripts/{,*/}*.js',

                        '<%= config.dist %>/styles/{,*/}*.css',

                        '<%= config.dist %>/images/{,*/}*.*',

                        '<%= config.dist %>/styles/fonts/{,*/}*.*',

                        '<%= config.dist %>/*.{ico,png}'

                    ]

                }

            }

        },


: .


* cssmin, uglify : 파일명을 주어 원하는 이름으로 빌드 되도록 한다.


cssmin: {

            dist: {

                files: {

                    '<%= config.dist %>/styles/rest-min.css': [

                        '.tmp/styles/{,*/}*.css',

                        '<%= config.app %>/styles/{,*/}*.css'

                    ]

                }

            }

        },

        uglify: {

            dist: {

                files: {

                    '<%= config.dist %>/scripts/rest-min.js': [

                        // '<%= config.dist %>/scripts/scripts.js'

                        '<%= config.app %>/scripts/{,*/}*.js'

                    ]

                }

            }

        },

        concat: {

            dist: {}

        },




'WEB > 프론트 개발환경' 카테고리의 다른 글

jshint  (0) 2014.03.15
개발환경 셋팅  (0) 2014.03.15
자바 스크립트 기술기반  (0) 2014.03.15
개발환경 구성을 Yeoman을 통해 구성한다.

* yo - the scaffolding tool from Yeoman
* bower - the package management tool
* grunt - the build tool

* Nodejs 설치

: 노드 기반 패키지

- http://www.nodejs.org/

- 설치 후 환경 변수 추가!



* Git 설치

: 패키지를 git에서 가져오는 경우도 있음.

http://git-scm.com/

- 설치 후 환경 변수 추가!


* Ruby on rails 설치

: 프로그램 구현을 루비로도 구성되어 있음.

http://rubyonrails.org/download

- 설치 후 환경 변수 추가!


* Yeoman 설치 

: 손쉬운 자바 스크립트 개발 환경 설치

: yo + bower + grunt

http://yeoman.io/gettingstarted.html

: 위 사이트를 참고하여 설치한다.



git 패키지 내려받기 후 작업 리스트


1. grunt 설치

npm install -g grunt


2. grunt 설치

npm install -g grunt-cli


3. grunt 설치

npm install grunt


4. 모든 패키지 설치

npm install


5. bower 설치

npm install -g bower


6. bower 패키지 설치

bower install


7. grunt 빌드

grunt build


8. 서버 키기

grunt server

'WEB > 프론트 개발환경' 카테고리의 다른 글

jshint  (0) 2014.03.15
Grunt 설정  (0) 2014.03.15
자바 스크립트 기술기반  (0) 2014.03.15

Yeoman :

http://yeoman.io/


yo + bower + grunt  조합으로 손쉽게 개발환경을 꾸밀수 있도록 해준다.



이번 개인적인 프로젝트는


Yeoman : yo + bower + grunt 환경에


sublime text2 : 개발 도구


angularjs : js 프레임워크


twitter bootstrap : ui 프레임워크


이런 기술 기반으로 시작해보자!


회사외 업무를 진행하느라 어려움이 많겠지만 해보고 싶은거 다 해보자!

'WEB > 프론트 개발환경' 카테고리의 다른 글

jshint  (0) 2014.03.15
Grunt 설정  (0) 2014.03.15
개발환경 셋팅  (0) 2014.03.15

2014. 02. 03 


강변 CGV 수상한 그녀 완전 대박!!!!!!!!


별점 만점!!


심은경 매력 터진다. 나중에 꼭 또 봐야지 !!


http://movie.naver.com/movie/bi/mi/basic.nhn?code=107924




http://troy.labs.daum.net/


다음에서 만들었나 보네요

datatype: "local" 인 상황에서

데이터를 넣는 방식이 아래와 같았다.


function setJqGrid(gridId, json, maxLine){

$(gridId).clearGridData();  // 이전 데이터 삭제

if(json.length>0){

for(var i=0; i<json.length; i++){

jQuery(gridId).jqGrid('addRowData',i+1,json[i]);

if(maxLine < i){

break;

}

}

}

}



그랬더니 엄청 느리네 ??



그래서 아래와 같이 변경하였다.


function setJqGrid(gridId, json, maxLine){

$(gridId).clearGridData();  // 이전 데이터 삭제

if(json.length>0){

jQuery(gridId).jqGrid('setGridParam',

       { 

           datatype: 'local',

           data:json

       })

   .trigger("reloadGrid");

}

}



속도 개선이 확 되었다.

결론 : jqGrid는 그렇게 느리지 않다.


'WEB > jqGrid' 카테고리의 다른 글

[jqGrid] 함수  (0) 2014.01.19
[jqGrid] 정렬 기능 정리  (0) 2014.01.19

지정된 양식에 하나의 ROW만 존재한 상황에서

두번째 줄부터는 아래와 같은 함수를 이용하여 값을 write한다.


1) ROW가 있는지 확인

 - 해당 ROW가 정해져있는 양식이 있는지 확인

 - 없으면 create row


2) Cell이 있는지 확인

 - 해당 ROW는 위에서 만들었기 때문에 존재함.

 - 해당 ROW, CELL에 정해져 있는 양식이 있는지 확인

 - 없으면 create cell 

 - 바로 위 row에서 style을 가지고와서 지정

 - 값 wirte



protected void writeLabelCell(HSSFSheet sheet, int _row, int _col, String str){

try{

HSSFRow row = sheet.getRow(_row);

if(row == null){ 

row = sheet.createRow(_row);

}

HSSFCell cell = row.getCell(_col);

if(cell == null){ // CELL이 없으면 바로 위 행의 ROW의 CELL 스타일을 가지고 옴.

HSSFRow refRow = sheet.getRow((_row-1));

HSSFCell refCell = refRow.getCell(_col);

cell = row.createCell(_col);

cell.setCellStyle(refCell.getCellStyle());

}


try{

row = sheet.getRow(_row);

cell = row.getCell(_col);

cell.setCellValue(str);

}catch(Exception e){

e.printStackTrace();

}

}catch(Exception e){

e.printStackTrace();

}

}

+ Recent posts