android + phoneGap

phoneGap 2015. 3. 30. 09:42

(그냥 android WebView를 이용해도 될 것 같은데.. 이부분은 좀 있다 확인하고..)


본 글은 andoid에서 phoneGap의 WebView를 추가하려면..



1. cordova.apache.org*을 다운받아서 android밑에 unzip

2. /framework/cordova-x.x.x.jar 를 만든다.  (  framework에서 run ant jar 하면 됨) 

3. .jar를 /libs 밑으로 복사



4. andoid 프로젝트에 /res/xml/main.xml 같은 layout 파일에 CordovaWebView 추가 


5. andoid 소스에 CordovaInterface implements 구현.




6. Camera이용시에  setActivityResultCallback(CordovaPlugin .. ) 및 startActivityForResult(CordovaPlugin.. ) 추가



7. ThreadPool 추가.  public ExecutorService getThreadPool()  ==> plugins이 thread를 가지기 위함.


8. /assets/www 밑에 HTML들 복사

9. /framework/res/xml 밑에 있는 config.xml을  프로젝트의 /res/xml 밑으로 복사 



원본 링크




Posted by yongary
,

Scrum

IT 2015. 3. 27. 17:21


위키kr :  Scrum(애자일 개발 프로세스)


- 매일15분씩 회의. (어제한일, 오늘한일, 장애상황)


- 스프린트 (한 주기) 관리  ( 30일 +- 1~4주)


- Sprint backlog

  다음 Sprint의 backlog도 미리 준비한다.



==========링크내용===================================

제품 책임자(Product Owner) 
제품 백 로그를 정의하여 우선순위를 정해 준다.

스크럼 마스터(ScrumMaster) 
프로젝트 관리자(코치)

스크럼 마스터는, 일반적인 관리를 수행하는 프로젝트 관리자들과는 달리 팀원을 코칭하고 프로젝트의 문제 상황을 해결하는 역할을 하며, 제품 책임자는 스프린트 목표와 백로그등의 결정에 있어 중심이 되는 상위 관리자로, 제품 책임자가 독단적으로 목표를 결정하지 않고, 고객과 관리자 및 팀원들이 모여서 목표를 정한다.

이런 과정을 거친 뒤, 개발 팀원들이 주도적으로 스프린트 목표를 달성하기 위한 작업을 정해 나가게 된다. 보통, 각 작업들은 4시간에서 16시간 정도 걸리도록 정한다. 물론, 작업을 정하고 할당하는데는 고객이나 제품 책임자와는 상관 없이 팀원 자율로 진행된다. 이와 같은 자율적인 행위를 통해서 팀원들은 의사를 활발하게 주고 받게 되고, 끈끈한 협업체계를 가지게 된다.

Posted by yongary
,

SIGINT 라고 가끔 본 적이 있을 것이다.

이 것은 Interrupt 시그널을 의미한다.



Interrupt (^c)     시그널은 2  

Quit     (^\)    시그널은 3

EOF(or Exit ^D)    시그널은 1


이 중에서 2,3번 시그널이 shell script가 도는 동안에 동작안하게 하고 싶으면..


trap "" 2 3    <- 이렇게 무시를 걸어 놓으면 된다.



trap 2 3 reset  <-shell script종료 후에는

Posted by yongary
,

Shared Memory

Linux/Linux:c개발 2015. 3. 27. 15:33

Linux  c개발시  shm 사용방법.


  shmget  : malloc 처럼 공유메모리 생성


  shmat   : 생성된 공유메모리를 해당 프로세서로 가져옴(첨부-attach)


  shmdt    :  가져온 메모리를 다시 반납. (분리-detach )


  



Posted by yongary
,

Linux를 하다보면, 터미널로 접속해서 프로세스를 실행시키고,

나중에 다시 접속해보면.. 죽어있는 경우가 있다.

- 백그라운드로 실행해도 그러하다..

 ( 백그라운드 실행은 명령어 뒤에 & 추가=>   $shell.sh &  )


이럴경우 

1. nohup으로 실행 :  $nohup shell.sh &


2. screen명령어로 실행.(화면까지 보존)


-------screen 사용법--------------

screen -S 스크린네임.


ctrl+a=>c생성


ctrl+a=>shift+a타이틀변경


ctrl+a=>shift+" 리스트


선택


ctrl+a=>c화면 클리어


ctrl+a=>d 나가기(리스트는 있고, 모드만 종료)


screen -r 모드진입(리스트 출력)


ctrl+a=>shift+" 리스트


ctrl+a=>shift+k 리스트선택 종료.



ctrl+a=>Shift+s 화면 분활 화면

ctrl+a=>tab 으로 화면  이동

ctrl+a=>shift+q 종료


ctr

Posted by yongary
,

volatile 키워드는 멀티thread시에 도움이 된다.

 1. 읽고 쓰기에 대한 원자성. ( byte단위의 원자화는 보장함. alignment는 맞춰줌. 

 2. 컴파일러의 임의 리오더링을 방지.



반면,

synchronized는 블록으로 묶인 부분 혹은 변수를 원자화(makes atomic ) 함.


<Wikipedia singleTon 예제>

public class SingletonDemo {

    private static volatile SingletonDemo instance = null;

    private SingletonDemo() {  } 

    public static SingletonDemo getInstance() {
        if (instance == null) {
            synchronized (SingletonDemo.class){
                if (instance == null) {
                    instance = new SingletonDemo();
                }
            }
        }
        return instance;
    }

}


Posted by yongary
,

자동화 테스트 툴

IT 2015. 3. 12. 09:20

TDD : Test Driven Development

=> 웹 자동화 테스트툴- Sellinium.



BDD: Behavior Driven Development

=> Cucumber.

Posted by yongary
,

core 할당

Linux 2015. 3. 11. 14:40

멀티코어 linux에서 코어를 할당하는 방법:


taskset -pc {해당 process를 
기동할 core 번호} process-pid

) taskset -pc 0 {process-pid}




만약 cloud상의 VM상에서

이와 같이 특정 core에 할당한 후에는 해당 VM reboot하여야 하며

isolcpus 옵션grub.conf 파일에 추가되어서 VM이 생성되어야 한다. 


<grub.conf>

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/mapper/VolGroup-lv_root
# initrd /initrd-[generic-]version.img
#boot=/dev/xvda
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-431.3.1.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-431.3.1.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD console=hvc0 KEYTABLE=us rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=VolGroup/lv_root rd_NO_DM rhgb quiet isolcpus=0
initrd /initramfs-2.6.32-431.3.1.el6.x86_64.img
title CentOS (2.6.32-358.14.1.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-358.14.1.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD console=hvc0 KEYTABLE=us rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=VolGroup/lv_root rd_NO_DM rhgb quiet isolcpus=0
initrd /initramfs-2.6.32-358.14.1.el6.x86_64.img
title CentOS (2.6.32-279.2.1.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-279.2.1.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD console=hvc0 KEYTABLE=us rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=VolGroup/lv_root rd_NO_DM rhgb quiet isolcpus=0
initrd /initramfs-2.6.32-279.2.1.el6.x86_64.img
title CentOS (2.6.32-279.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-279.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD console=hvc0 KEYTABLE=us rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=VolGroup/lv_root rd_NO_DM rhgb quiet isolcpus=0
initrd /initramfs-2.6.32-279.el6.x86_64.img

Posted by yongary
,

-F_ 없어도 됨(2210)

echo ${JOB_NAME} | awk -F_ '{print $3}' |xargs -I {} rm -rf /tmp/doxygen/{}; 

 

수많은 프로세스들 한방에 죽이기

ps -ef | grep 키워드 | awk '{print $2}' | xargs -I {} sudo kill {}

 

find . -name "*.js" -print  | xargs grep -n         keywordToFind

                   (filename)           (linenumber)   

 

Posted by yongary
,

$mongo 해서 client접속하면..

>show tables 


  //이 중에서  heart  category(테이블)을

  /user:"kim", pic:1, heart:20, date:'20140303'   이러한 테이블(category)로 가정.  (_id는 자동 삽입됨. _class도 간혹 자동삽입-코드일경우)



> db.heart.find()    -> 전체 record list.


> db.heart.find().sort( {pic:1} )    -> 전체 리스트를 pic필드로 asending 소팅.


> db.heart.find().limit(2)  -> 리스트 중 2개만 출력.   

                             =  db.heart.aggregate({ $limit:2 }) 


> db.heart.distinct("user")   ->  [ "kim", "lee" ]

> db.heart.distinct("user").length   ->   2



> db.heart.aggregate({     $group:{_id:"$pic"}      })  ->  pic필드를 기준으로 그루핑.  ({ => ([{ 이렇게 대괄호 추가가능.(이전버전인듯)


db.heart.aggregate({     $group:{ _id:"$pic", heartSum:{$sum:"$heart"} }      })  -> 각 그룹별로 heartSum산출.


   -->복합 aggregate

> db.heart.aggregate(    

{$group:{ _id:"$pic", heartSum:{$sum:"$heart"} }},

{$sort:{"hearts":1}},

{$limit:2}

)



//일반적인  Query .

db.inventory.find( { type: 'food', price: { $lt: 9.95 } } )



//aggregate에 Query  추가.

db.heart.aggregate(

bla.. bla..    ,

{ $match : { score : { $gt : 70, $lte : 90 } } }

)




///////spring-data-mongo에서 적용시에는

    AggregationOperation match = Aggregation.match(Criteria.where("service").is("EFT").and("source").is("MARKUP"));
    AggregationOperation group = Aggregation.group("card_acceptor").and("amount_sum").sum("amount").and("tran_count").count();
    Aggregation aggregation = newAggregation(match, group);
    AggregationResults<StoreSummary> result = this.mongoTemplate.aggregate(aggregation, "eft_transactions", StoreSummary.class);


Posted by yongary
,