$('#gs_country').val('au');
$('#gs_country').trigger({ type : 'keypress', charCode : 13 });


// 한줄로 
$('#gs_country').val('au').trigger({ type : 'keypress', charCode : 13 });


MSSQL에서 WITH 문을 사용한 쿼리에서 검색 속도가 느려서 개선함. 


declare @ordDateS nvarchar(20)

declare @ordDateE nvarchar(20)

set @ordDateS = #{ordDateS};

set @ordDateE = #{ordDateE};


...

WHERE ORDERT.ORD_DATE BETWEEN @ordDateS+' 00:00:00' AND @ordDateE+' 23:59:59'


변수를 바로 넣지 말고 위에서 선언을 한뒤 쿼리를 돌리면 매우 빨라짐. 


MyBatis에서 DB로 쿼리를 바로 던지지 않고 뭔가를 하나 봄. 

Intel Edison CPU info

root@edison:~# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 74
model name      : Genuine Intel(R) CPU   4000  @  500MHz
stepping        : 8
microcode       : 0x810
cpu MHz         : 500.000
cache size      : 1024 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fdiv_bug        : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov                                    pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_                                   tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf nonstop_tsc_s3 pni pc                                   lmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 mov                                   be popcnt tsc_deadline_timer aes rdrand lahf_lm 3dnowprefetch ida arat epb dther                                   m tpr_shadow vnmi flexpriority ept vpid tsc_adjust smep erms
bogomips        : 998.40
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 74
model name      : Genuine Intel(R) CPU   4000  @  500MHz
stepping        : 8
microcode       : 0x810
cpu MHz         : 500.000
cache size      : 1024 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
apicid          : 2
initial apicid  : 2
fdiv_bug        : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov                                    pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_                                   tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf nonstop_tsc_s3 pni pc                                   lmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 mov                                   be popcnt tsc_deadline_timer aes rdrand lahf_lm 3dnowprefetch ida arat epb dther                                   m tpr_shadow vnmi flexpriority ept vpid tsc_adjust smep erms
bogomips        : 998.40
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:


앱엔진에서 Maker에 아래와 같은 에러가 뜨면

Your project must be configured to use a JDK in order to use JSPs      Google App Engine Problem


해결 방법은

1. 프로젝트를 delete 한뒤
2. jre로 실행되던 환경을 jdk로 변경
3. 다시 프로젝트를 추가


2. jre로 실행되던 환경을 jdk로 변경
2.1 eclipse.ini 또는 sts.ini 파일의 가장 상위에 아래 추가 (javaw.exe경로는 환경에 맞춰서 변경)
     -vm
     C:\Program Files\Java\jdk1.7.0_65\bin\javaw.exe

2.2 Window->Preferences->Java->Installed JREs 에서
     Add를 눌러 Standard VM에 C:\Program Files\Java\jdk1.7.0_65 추가 

3. 다시 프로젝트 import 

한뒤에는 컴파일 및 실행, deploy 모두 잘 됨. 


eclipse의 logcat이 아래 처럼 나와서 가독성이 떨어진다고 생각 한다면 



$WORKSPACE\.metadata\.plugins\org.eclipse.core.runtime\.settings\com.android.ide.eclipse.ddms.prefs 

위의 파일 안에서 logcat.view.colsize.Text=4000  정도로 셋팅 해주면 한줄로 표시 해 준다. 
자신의 모니터 사이즈와 적절히 맞추면 가독성이 좋아 짐. 

드디어 iOS 7 다운이 시작 되었습니다. 

접속자가 폭주 하는지 3분만에 대기 28분이 넘었습니다. 

아~ 기대 됩니다. ^ ^ 

추석 선물이군요.










nginx 를 셋팅 하다 


$cat /etc/nginx/nginx.conf  와 같은 파일을 vi 로 열면 모두 거무튀튀 하게 보인다. 

주석과 구분이 안될 때 vim 설정을 하면 컬러풀하게 나오게 된다. 


참조: http://www.vim.org/scripts/script.php?script_id=1886


1. vim 의 syntex 폴더에 위의 링크에서 받은 최신 버젼 nginx.vim 을 넣고 

2. filetype.vim 파일을 찾아서 

...

augroup filetypedetect


" Ignored extensions

if exists("*fnameescape")

아래에 밑의 줄을 넣으면 완료. 


au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/conf/* if &ft == '' | setfiletype nginx | endif 



linux에 따라 위치가 다르면 

find / -name *.vim 및 find / -name filetype.vim 으로 검색을 하면 syntex 폴더 및 파일을 를 찾을 수 있다. 






'Android' 카테고리의 다른 글

android 3D engine  (0) 2009.09.23
ARCHOS 안드로이드 타블렛 PMP  (0) 2009.09.02
Windows7 x64에서 안드로이드 드라이버 설치  (0) 2009.08.24

iOS에서 Document에 zip 파일을 넣어서 풀기


plist 에 UIFileSharingEnabled key를 추가 하고 YES로 설정 후 


앱을 실행하면 itunes application에서 파일 추가 가능. (아래 이미지는 이미 풀어진 스크린샷)


zip 압축 풀기는 아래 참조 

http://code.google.com/p/ziparchive/wiki/PageName

 

기존 문서에는 libz.1.2.3.dylib 넣으라고 나오는데 그냥 libz.dylib 넣으면 됨. 


끝. 



'iOS' 카테고리의 다른 글

JSONKit for iOS  (0) 2011.06.28
Objective-C Outlet  (0) 2010.08.07
UIView Flip 효과 - iPhone  (0) 2010.06.29
구글 앱엔진 Java 에서 BlobStore 저장용 URL을 바로 받아 오기. 

public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException
{
    final String url = blobstoreService.createUploadUrl("/upload");

    final PrintWriter printWirter = res.getWriter();

    res.setContentType("text/plain");
    printWirter.write(url);

} 
다운 받는 곳 
https://github.com/johnezang/JSONKit

사용법

#import "JSONKit.h"

... 


NSString *filePath = [[NSBundle mainBundle] pathForResource:@"items" ofType:@"json"];   

NSString *a = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];

    

// 클래스의 종류 내용보기 

//    NSLog(@"class:%@ a:%@",[a class], a);

    

// JSON NSArray NSDictionary 변환 

NSArray *array = [a objectFromJSONString];

NSLog(@"class: %@, %d", [array class], [array count]);

    

// Array에서 Dictionary 가져오기 

NSDictionary *dic = [array objectAtIndex:0];

NSLog(@"dic name:%@", [[dic valueForKey:@"name"] description]);

 

'iOS' 카테고리의 다른 글

iOS에서 Document에 zip 파일을 넣어서 풀기  (0) 2012.05.16
Objective-C Outlet  (0) 2010.08.07
UIView Flip 효과 - iPhone  (0) 2010.06.29

메모리 관리 Memory management

Memory management is the programming discipline of managing the life cycles of objects and freeing them when they are no longer needed. 

메모리 관리는 오브젝트의 라이프 사이클 관리와 필요 없을때 해제 하는 프로그래밍 제어 방법을 말한다. 

Managing object memory is a matter of performance; if an application doesn’t free unneeded objects, its memory footprint grows and performance suffers. 

오브젝트 메모리 관리는 더 나은 퍼포먼스를 위해서 하는것이다; 어플리케이션이 필요없는 오브젝트를 해제 하지 않으면, 메모리공간을 차지 하고 퍼모먼스를 악화 시킨다. 

Memory management in a Cocoa application that doesn’t use garbage collection is based on a reference counting model. 

가비지 컬렉션을 사용하지 않는 Cocoa 어플리케이션의 메모리 관리는 레퍼런스 카운팅 모델을 바탕으로 하고 있다. 

When you create or copy an object, its retain count is 1. 

오브젝트를 create 하거나 copy 할때, retain count(유지 카운트) 는 1 이다. 

Thereafter other objects may express an ownership interest in your object, which increments its retain count. 

그 후에 다른 개체들은 당신의 객체에 ownership(소유권)을 명시(추가)할 수 있다,  이것은 retain count 를 증가 시킨다. (주고 retain 명령으로 추가함.)

The owners of an object may also relinquish their ownership interest in it, which decrements the retain count. When the retain count becomes zero, the object is deallocated (destroyed).

객체의 소유자들이 객체들의 ownership 연결이 줄어 들게 되면, retain count는 줄어 든다. retain count가 0이 되면, 객체는 해제 된다. 

To assist you in memory management, Objective-C gives you methods and mechanisms that you must use in conformance with set of rules.

메모리 관리를 돕기위해, Objective-C는 메소드와 방법을 제공할것이다. 당신은 적절한 해결 방법을 사용하면 된다.  

Note: In Mac OS X, you can either explicitly manage memory or use the garbage collection feature of Objective-C. Garbage collection is not available in iOS.

가비지 콜렉션은 iOS에서는 사용할수 없다. 


메모리 관리 규칙 Memory-Management Rules

Memory-management rules, sometimes referred to as the ownership policy, help you to explicitly manage memory in Objective-C code.

메모리 관리 규칙, 가끔 소유권 정책을 확인하자,  Objective-C 코드의 메모리 관리에 도움을 준다. 

  • You own any object you create by allocating memory for it or copying it.

      어떤 객체든 

    메모리에 할당하거나 복사해서 만들어 소유해야 한다. 
  • 관련 메소드들 Releated methodallocallocWithZone:copycopyWithZone:

    mutableCopymutableCopyWithZone:

  • If you are not the creator of an object, but want to ensure it stays in memory for you to use, you can express an ownership interest in it

    . 자신이 만든 객체가 아닌, 그러나 그것을 메모리에서 계속 사용하길 원한다면, 소유권(ownership)을 명시 해야한다. 

    Related method: retain 

  • If you own an object, either by creating it or expressing an ownership interest, you are responsible for releasing it when you no longer need it.

     만들거나 소유권을 획득한 객체를 소유하고 있다면, 더이상 사용하지 않을때는 해제를 해야할 책임이 있다. 

    Related methods: releaseautorelease

  • Conversely, if you are not the creator of an object and have not expressed an ownership interest, you mustnot release it.

    반대로, 만들거나 소유권을 가지고 있지 않은 객체는 해제 하지 않아도 된다. 

If you receive an object from elsewhere in your program, it is normally guaranteed to remain valid within the method or function it was received in. If you want it to remain valid beyond that scope, you should retain or copy it. If you try to release an object that has already been deallocated, your program crashes.

메모리 관리 형태 Aspects of Memory Management

The following concepts are essential to understanding and properly managing object memory: 다음의 개념들은 올바른 객체 메모리 관리를 이해하기 위한 기초이다 :

  • Autorelease pools. Sending autorelease to an object marks the object for later release, which is useful when you want the released object to persist beyond the current scope. Autoreleasing an object puts it in an autorelease pool (an instance of NSAutoreleasePool), which is created for a arbitrary program scope. When program execution exits that scope, the objects in the pool are released.

  • Deallocation. When an object’s retain count drops to zero, the runtime calls the dealloc method of the object’s class just before it destroys the object. A class implements this method to free any resources the object holds, including objects pointed to by its instance variables.

  • Factory methods. Many framework classes define class methods that, as a convenience, create objects of the class for you. These returned objects are not guaranteed to be valid beyond the receiving method’s scope.



참조 : 
footprint : 접지면, (컴퓨터) 가 차지하는 공간, 메모리 차지 공간을 얘기 하는 듯. 
relinquish : 버리다, 포기하다. 
objective-c 에서는 다른 객체를 참조 하는 변수를 outlet 이라고 부른다. 
outlet 은 GUI 구성을 하는 Interface Builder 에서 변수로 다른 객체를 연결 할때 사용함. 

IBOutlet UIView *view2;


위와 같은 형태로 주로 사용되는데 
IBOutlet 에서 IB는 Interface Builder의 줄인말인듯. 

참조를 하기 위해서는 아래와 같이 선언하고 .m 에서 접근 하면 된다. 

@property (nonatomic, retain) IBOutlet UIView *view2;

'iOS' 카테고리의 다른 글

JSONKit for iOS  (0) 2011.06.28
UIView Flip 효과 - iPhone  (0) 2010.06.29
Protocols - Objective-C  (0) 2010.06.27
  


#pragma mark - Flip screen


- (void)flipAction:(id)sender

{

[UIView setAnimationDelegate:self];

[UIView setAnimationDidStopSelector:@selector

            (animationDidStop:animationIDfinished:finished:context:)];

[UIView beginAnimations:nil context:nil];

[UIView setAnimationDuration:0.75];

[UIView setAnimationTransition:([self.tableView superview] ? UIViewAnimationTransitionFlipFromLeft UIViewAnimationTransitionFlipFromRight)

forView:self.tableView cache:YES];

if ([instructionsView superview])

[instructionsView removeFromSuperview];

else

[self.tableView addSubview:instructionsView];


[UIView commitAnimations];

// adjust our done/info buttons accordingly

if ([instructionsView superview] == self.tableView)

self.navigationItem.rightBarButtonItem = doneButton;

else

self.navigationItem.rightBarButtonItem = flipButton;

}

'iOS' 카테고리의 다른 글

Objective-C Outlet  (0) 2010.08.07
Protocols - Objective-C  (0) 2010.06.27
서버에서 다운 받기 - Objective-c  (0) 2010.03.11
Protocol : 메소드 선언의 집합

java의 interface라는 개념이 Protocol을 도입한 개념임. 

서로 다른 객체가 같은 메소드의 집합을 가지는 경우, 상속 관계는 아님. 

프로토콜은 메소드의 명칭들을 정해 놓으면 그 프로토콜을 따를 때 메소드의 명칭들이 같아지므로 사용성이 좋아지는 것을 목적으로 한다. 



'iOS' 카테고리의 다른 글

UIView Flip 효과 - iPhone  (0) 2010.06.29
서버에서 다운 받기 - Objective-c  (0) 2010.03.11
xcode 에서 회사 이름 바꾸기  (0) 2010.01.01

I WORK TEST add iwork
참고

다운받기
git clone git://eagain.net/gitosis.git

인스톨 작업
cd gitosis python setup.py install






그냥 참고
1) Fast 3D Triangle-Box Overlap Testing (삼각형과 박스의 충돌 검사)
    홈페이지 주소 : http://www.acm.org/jgt/papers/AkenineMoller01/ 이런연결 끊어졌네요..ㅡㅡ;

2) A Fast Triangle-Triangle Intersection Test (삼각형대 삼각형 충돌검사)
   홈페이지 주소 : http://www.acm.org/jgt/papers/Moller97/ 끊어짐.

3) Fast, Minimum Storage Ray-Triangle Intersection (직선과 삼각형의 충돌검사)
   홈페이지 주소 : http://www.acm.org/jgt/papers/MollerTrumbore97/ 끊어짐.


Collision Detection

http://code.google.com/p/gjkd/
http://code.google.com/p/mpr2d/

'영상처리' 카테고리의 다른 글

얼굴인식 : OpenCV in Flash  (2) 2009.07.08
영상처리 : 색의 이해  (0) 2009.07.08
erica 예제 c3-06-Synchronous Downloads


NSURL *url = [NSURL URLWithString: [urlArray objectAtIndex:[which intValue]]];
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
NSURLResponse *response;
NSError *error;

NSData* result = [NSURLConnection sendSynchronousRequest:
theRequest
theRequest returningResponse:&response error:&error];



덤으로 무비 플레이어

- (void) startPlayback : (id) sender
{
MPMoviePlayerController* theMovie=[[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:self.savePath]];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myMovieFinishedCallback:) name:MPMoviePlayerPlaybackDidFinishNotification object:theMovie];
[theMovie play];
}

'iOS' 카테고리의 다른 글

Protocols - Objective-C  (0) 2010.06.27
xcode 에서 회사 이름 바꾸기  (0) 2010.01.01
아이폰 강좌  (0) 2009.12.24

+ Recent posts