'분류 전체보기'에 해당되는 글 333건
- 2014.03.22 mint linux, ssh 활성화
- 2014.03.13 [git] 파일 하나만 다른 브런치로부터 가져오기
- 2014.03.05 [git] 파일 하나만 전의 리비전으로 되돌리기
- 2014.03.05 [git] 다른 브랜치의 파일 비교하기
- 2014.03.03 [objc] Appirater, 앱평가 알림 라이브러리
- 2014.03.02 [shellscript] 디렉토리 안의 파일 보기
- 2014.03.01 [shellscript] parameter
- 2014.03.01 [linux] 파일 찾기, find
- 2014.03.01 [shellscript] 기본 문법
- 2014.03.01 [shellscript] Hello World
- 2014.02.28 [TerminalIDE] vim
- 2014.02.28 [Python][TerminalIDE][Android] TerminalIDE(android)에서 Python 사용하기
- 2014.02.28 [app] 안드로이드에서 개발환경을 만든다! Termianl IDE
- 2014.02.27 [python] window mp3player lib
- 2014.02.26 [objc] NSDate 날짜비교
- 2014.02.26 [objc] singleton, sharedInstance, 싱글톤
- 2014.02.25 [objc] #define 대신에 const를 써보자
- 2014.02.25 [objc] property 있는데 셀렉터 없다고 하면서 죽을 때
- 2014.02.25 [firefox] 파이어폭스 속도 향상
- 2014.02.25 [firefox] 설정 초기화
- 2014.02.24 [objc] 디바이스가 iPhone5s인가 체크, device model
- 2014.02.20 [objc] xib와 커스텀 UIView 만들기
- 2014.02.19 [pod] pod가 문제를 일으킬 때
- 2014.02.18 [c] c style array
- 2014.02.18 [git] git, 리모드 브랜치부터 새로운 로컬브랜치를 생성
- 2014.02.07 [objc] 본문에 이미지 포함시키기, 본문보다 이미지를 앞에 위치시키고 싶을때
- 2014.02.01 Unity3D, 회전하는 지구와 달 만들기
- 2014.01.17 [objc] push 메세지를 클릭해서 앱을 실행시킬 경우
- 2014.01.17 [objc] UTC시간 관련
- 2014.01.14 Test
git checkout [branch_name] -- [filename]
http://stackoverflow.com/questions/2364147/how-to-get-just-one-file-from-another-branch
git checkout HEAD path/to/file.txt
git checkout [commit revision] [file name]
http://stackoverflow.com/questions/2733873/reverting-a-single-file-to-a-previous-version-in-git
git diff --name-status branch1..branch2
git difftool branch1:config/environment.rb branch2:config/environment.rb
http://blog.firsthand.ca/2011/05/compare-git-branches-compare-two-files.html
static NSString *_appId = @"593799029";
// 경고창이 표시될때까지의 날짜
static double _daysUntilPrompt = 5;
// 경고창이 표시될때까지의 기동회수
static NSInteger _usesUntilPrompt = 20;
//특정의 조건으로 경고창을 표시하고 싶을 때
static NSInteger _significantEventsUntilPrompt = -1;
// 나중에 를 선택했을 경우, 몇일후 경고창을 재표시할것인가를 지정
static double _timeBeforeReminding = 1;
//YES를 할 경우 매번 경고창을 표시
static BOOL _debug = NO;
for f in `ls`; do
echo "File -> $f"
done
http://superuser.com/questions/31464/looping-through-ls-results-in-bash-shell-script
* 쉘스크립트이름 : $0
* 파라메터 개수 : $#
-> 파라메터에 *를 사용하면, 자동으로 해당파일 이름들로 변환된다.
-> *.txt를 파라메터로 했을 때, txt파일이 5개 있다면 $#의 값은 5가된다.
* 파라메터 : $0〜$n
if [ "$#" -eq 0 ]
// 파라메터가 없을 때
http://blog.naver.com/PostView.nhn?blogId=eleexpert&logNo=140125262113
*
*** if
x=10
if [ $x = 10 ]; then
echo 10
else
echo not 10
fi
※띄어쓰기 주의
*** For
#!/bin/bash
for i in 1 5 10; do
echo $i
done
for((i=10;i>0;i--));do
echo $i
done
*** 문자 포함
string='My string';
if [[ $string == *My* ]]
then
echo "It's there!";
fi
http://stackoverflow.com/questions/229551/string-contains-in-bash
*** 참고할만한
hello.sh
#!/bin/bash
echo "Hello World"
$ chmod +x
$ ./hello.sh
Hello World
$
https://play.google.com/store/apps/details?id=com.spartacusrex.spartacuside&hl=en
git도 되고
vim도 되고
자바도 되고
심심할 일은 없겠다.
if ([date1 compare:date2] == NSOrderedDescending){
}
* NSOrderedSame : 같을때
* NSOrderedDescending : date1가 date2보다 이후
* NSOrderedAscending : date1이 date2보다 이전
http://stackoverflow.com/questions/5965044/how-to-compare-two-nsdates-which-is-more-recent
+ (ClassType*)sharedInstance{
static ClassType *instance;
static dispatch_once_t predicate;
dispatch_once(&predicate, ^{
instance = [[ClassType alloc] init];
});
return instance;
}
url 입력창 about:config
network.http.pipelining false -> true
앱캐시를 켜는 듯??
#import <sys/sysctl.h>
size_t size;
sysctlbyname("hw.machine", NULL, &size, NULL, 0);
char *machine = malloc(size);
sysctlbyname("hw.machine", machine, &size, NULL, 0);
NSString *platform = [NSString stringWithUTF8String:machine];
free(machine);
//iPhone5s의 경우, platform이"iPhone6"
//angeOfString:@"iPhone6"].location != NSNotFound <- 이렇게 체크
* iPod5th : iPod5,1
* iPhone4 : iPhone3,1
* iPhone4S : iPhone4,1
* iPhone5 : iPhone5,2
* iPhone5s : iPhone6,1
1. UIView를 계승한 클래스 만듦.
2. xib만듦
3. UIView에.. 추가
+ (id)customView
{
CustomView *customView = [[[NSBundle mainBundle] loadNibNamed:@"xibview" owner:nil options:nil] lastObject];
// make sure customView is not nil or the wrong class!
if ([customView isKindOfClass:[CustomView class]])
return customView;
else
return nil;
}
4. xib의 Custom Class에 CustomView지정.
5. 사용
CustomView *cView = [CustomView customView];
int array[10];
for(int i=0;i<10;i++){
array[i] = 0;
NSLog(@"%d", array[i]);
}
for(int i=0;i<10;i++){
array[i] = i;
NSLog(@"%d", array[i]);
}
git checkout -b test origin/test
http://stackoverflow.com/questions/1783405/git-checkout-remote-branch
메일 타입을 HTML로 해서
이미지 데이터를 포함시킨다.
NSData *imageData = UIImageJPEGRepresentation(myImage, 1.0f);
NSString *encodedString = [imageData base64Encoding];
[emailBody appendString:[NSString stringWithFormat:@"<p><b><img src='https://t1.daumcdn.net/cfile/tistory/275C1D4656E67CA00C",encodedString]];
http://stackoverflow.com/questions/14859463/how-to-send-image-in-email-body
** 지구와 달이 될 오브젝트를 생성
Shphere를 2개 생성해서 배치
** Texture입히기
지구와 달에 입힐 이미지를 프로젝트에 추가후, 오브젝트에 드래그&드롭
** 그룹핑
달을 지구주위로 돌게 하기 위해, 달 오브젝트를 지구 오브젝트에 드래그&드롭
** 스크립팅
자바스크립트 생성.
자전하는 코드를 작성.
달은 지구에 속해있으므로 공전된다.
#pragma strict
var speed:float;
function Start () {
}
function Update () {
var direction = -1;
this.transform.Rotate(Vector3.up * direction * speed *Time.deltaTime);
}
** 스크립트 적용
지구오브젝트와 달 오브젝트에 각각 스크립트를 적용.
** 속도 조절
Script의 speed의 수치를 조절
참고
http://www.youtube.com/watch?v=PQA80_J2-OQ
push 메세지를 클릭해서 앱을 실행시킬경우
두가지 경우에 대해 처리를 해주어야 한다.
1. 앱이 기동하지 않은 경우.
ApplicationDelegate의
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
메소드가 불린다.
launchOptions에 푸시메세지에서 설정한 정보를 얻을수 있다.
2. 앱이 기동하여 백그라운드에 있는경우.
-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
메소드가 불린다.
userInfo에 푸시에서 설정한 정보를 얻을수 있다.
앱이 포어그라운드에 있을 경우에도 핸들링이 되므로,
푸시를 누를 경우에만 이벤트를 핸들링 하고 싶을 경우.
[application applicationState]을 조건으로 추가해주면 된다.
-(NSString *)getUTCFormateDate:(NSDate *)localDate
{
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
NSTimeZone *timeZone = [NSTimeZone timeZoneWithName:@"UTC"];
[dateFormatter setTimeZone:timeZone];
[dateFormatter setDateFormat:@"yyyy-MM-dd hh:mm:ss"];
NSString *dateString = [dateFormatter stringFromDate:localDate];
return dateString;
}
"yyyy-MM-dd HH:mm:ss"
로 하면, 12시간 표시로 할 경우
로컬라이즈된 오전, 오후 표시가 된다.
Test
2014. 1. 14. 20:31보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.