2022年7月31日日曜日

iPhone・iPadの標準カレンダーとGoogleカレンダーを完全同期する方法

 https://ipark-tajimi.com/archives/79

①iPhone・iPadの [Safari] から以下のURLを直接入力します。
https://www.google.com/calendar/iphoneselect

②Googleカレンダーの同期設定画面が表示されます。
同期したいカレンダーにチェックを入れます。
※『共有カレンダー』の欄に、他の人が作成した共有カレンダー名が表示されているので必要ならチェックを入れます。
設定が完了したら、画面右下の「保存」をクリックします。

2013年10月4日金曜日

read ios application source


design pattern

http://www.raywenderlich.com/46988/ios-design-patterns/

*NSKeyedUnarchiver can be used to save data.
-to save data:
NSMutableArray *albums;
albums = [NSMutableArray arrayWithArray:
@[[[Album alloc] initWithTitle:@"Best of Bowie" artist:@"David Bowie" coverUrl:@"http://www.coversproject.com/static/thumbs/album/album_david%20bowie_best%20of%20bowie.png" year:@"1992"],
[[Album alloc] initWithTitle:@"It's My Life" artist:@"No Doubt" coverUrl:@"http://www.coversproject.com/static/thumbs/album/album_no%20doubt_its%20my%20life%20%20bathwater.png" year:@"2003"],
[[Album alloc] initWithTitle:@"Nothing Like The Sun" artist:@"Sting" coverUrl:@"http://www.coversproject.com/static/thumbs/album/album_sting_nothing%20like%20the%20sun.png" year:@"1999"],
[[Album alloc] initWithTitle:@"Staring at the Sun" artist:@"U2" coverUrl:@"http://www.coversproject.com/static/thumbs/album/album_u2_staring%20at%20the%20sun.png" year:@"2000"],
[[Album alloc] initWithTitle:@"American Pie" artist:@"Madonna" coverUrl:@"http://www.coversproject.com/static/thumbs/album/album_madonna_american%20pie.png" year:@"2000"]]];

NSString *filename = [NSHomeDirectory() stringByAppendingString:@"/Documents/albums.bin"];
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:albums];
[data writeToFile:filename atomically:YES];

-to read data:
NSData *data = [NSData dataWithContentsOfFile:[NSHomeDirectory() stringByAppendingString:@"/Documents/albums.bin"]];
albums = [NSKeyedUnarchiver unarchiveObjectWithData:data];


*when to set layout
note that the toolbar isn’t initiated with a frame, as the frame size set in viewDidLoad isn’t final. So set the final frame via the following block of code once the view frame is finalized by adding the code to
- (void)viewWillLayoutSubviews
{
    toolbar.frame = CGRectMake(0, self.view.frame.size.height-44, self.view.frame.size.width, 44);
    dataTable.frame = CGRectMake(0, 130, self.view.frame.size.width, self.view.frame.size.height - 200);
}

*how to remove all the subviews.
[scroller.subviews enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
        [obj removeFromSuperview];
}];

*to save user data before the application entered background.
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(saveCurrentState) name:UIApplicationDidEnterBackgroundNotification object:nil];
- (void)saveCurrentState
{
    [[NSUserDefaults standardUserDefaults] setInteger:currentAlbumIndex forKey:@"currentAlbumIndex"];
    [[LibraryAPI sharedInstance] saveAlbums];
}
NOTE: need to call loadPreviousState from viewDidLoad()

*post notification
[[NSNotificationCenter defaultCenter] postNotificationName:@"BLDownloadImageNotification"
                                                        object:self
                                                      userInfo:@{@"imageView":coverImage, @"coverUrl":albumCover}];
*receive notification
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(downloadImage:) name:@"BLDownloadImageNotification" object:nil];

2013年10月3日木曜日

HTC One Google Play edition の root 化

  • bootloaderをunlockする
    • adb reboot bootloader
    • 端末が再起動されるので、起動されたあと、下記コマンド
      • fastboot oem unlock
    • 参考サイト
      • https://source.android.com/source/building-devices.html
  • UPDATE-SuperSUをsdcardに保存する
    • DL先:http://forum.xda-developers.com/showthread.php?t=1538053
    • 下記コマンドでshared storageにcopy
      • adb push UPDATE-SuperSUXXXX.zip /mnt/sdcard/
  • recoveryモードでこのzipファイルを選択してinstall
    • この状態でadb reboot recoveryでリカバリモードに入れないので、まずは下記をインストール
      • ClockworkMod TouchをDL
        • DL先:http://forum.xda-developers.com/showthread.php?t=2173863
      • adb reboot bootloader
      • fastboot flash recovery recovery-clockwork-touch-xxx.img
    • adb reboot recoveryでリカバリモードに入る
    • install zip -> choose zip from sdcard で先ほどコピーしたzipファイルをinstall
元ネタ:http://mmasashi-js.blogspot.jp/2013/07/htc-one-google-play-edition-rooted-2.html

2013年8月16日金曜日

ios開発時のdebug方法

http://d.hatena.ne.jp/Psychs/20081120/1227203259

2013年6月18日火曜日

iOS データ保存

You might want to persist the score by saving it to the NSUserDefaults or a keychain. More on secure storage of data with a keychain.

2013年4月19日金曜日

gmailの文字化け対策

■対策
gmailの署名にユニコードの文字を入力する。

■手順
・Gmailの送信用文字コードをutf-8にする。
・Gmailの署名にノーブレークスペースを追加する。
 →追加の仕方:下記で[入力方法]で検索

以上

2013年2月12日火曜日

Launch controls on stopped applications

新しいアプリステートのstop状態が追加された。

使い方、確認の仕方
http://y-anz-m.blogspot.jp/2011/05/android-31-platform.html

詳細:
http://developer.android.com/about/versions/android-3.1.html

2012年12月22日土曜日

mac air のファンが止まらない理由

とりあえずcpuの占有率の高いActivityをKillすればよいようだ。

Activity Monitorで

元ネタ
http://miwluv.blogspot.jp/2011/06/mba-macbook-air.html

マックのWireless Cardを検出できない場合


command + option + P + R
押したまま電源を入れる
ずっと押しっぱなし
2回起動音がしたあと、設定値が全部戻されるとのこと。

2012年12月17日月曜日

about android webview


before loadurl, must invoke setWebViewClient.
WebView
webview.setWebViewClient(new WebViewClient());
webview.loadUrl(uri.toString());

2012年12月12日水曜日

Finder と iterm2の連携について

enter this command to launch finder.
  open .

to launch iterm2 from finder.
http://code.google.com/p/cdto/



2012年11月26日月曜日

iOS xcode 設定

1. Go to the Project Settings screen, select the Artists target and under Build Settings type “compiler” into the search box. This will filter the list to bring up just the compiler options:

2. Under the Warnings header, also set the Other Warning Flags option to -Wall. The compiler will now check for all possible situations that can cause problems.

3. For the exact same reason, also enable the Run Static Analyzer option under the Build Options header:

4. To try out ARC

Search for “automatic” and set the Objective-C Automatic Reference Counting option to Yes.  

Androidにインストール済みAPK解析

Androidにインストール済みAPK一覧を表示する。
adb shell pm list packages -f

特定APKを解析する
aapt dump badging target.apk

2012年11月23日金曜日

Redmine 2.1をCentOS 6.3にインストールする手順

基本は下記に通りで問題なし
http://blog.redmine.jp/articles/redmine-2_1-installation_centos/

■注意事項
1. iptablesでHTTPを許可について、特に設定しなかった。
2. rmagickを設定する必要はない(個人的に要らない)
    # bundle install --without development test postgresql sqlite
 ではなく、下記を設定した。
  # bundle install --without development test postgresql sqlite rmagick

internetに公開する際の設定事項
http://blog.redmine.jp/articles/project-visibility/

2012年9月24日月曜日

git server

■prepare サーバー
例えば、StopWatchというプロジェクトをリポジトリにあげるとき、
1. git clone --bare StopWatch StopWatch.git
2. mv StopWatch.git ~/Repository/   ## scp -r StopWatch.git user@git.example.com:/opt/git

■ローカル
1. git remote add origin /Users/your_usr_name/Repository/StopWatch.git
2. modify files and commit it.
3. git push origin master

下記エラーが出た場合
fatal: remote origin already exists.

$ git remote rm origin
$ git remote add origin git@github.com:you/yourrepo.git
$ git push -u origin master

2012年9月20日木曜日

mountain lion's web server

config file: /etc/apache2/httpd.conf
web server root directory: /Library/WebServer/Documents/
sudo apachectl start

2012年9月3日月曜日

useful perl script


read english words for me.
perl -e 'while(<>){`say $_`}'

2011年12月26日月曜日

use windows exe from cygwin

1. add a dummy function

function adb {
    TOP=/cygdrive/c/Android/android-sdk
    "$TOP"/platform-tools/adb.exe "$@"
}

2. create a dummy symbol link
cd /usr/bin
mv gvim gvim.org

ln -s /cygdrive/c/Program\ Files\ \(x86\)/Vim/vim73/gvim.exe gvim


xperia take root

1. download the latest version of the following script.
DooMLoRD_v3_ROOT-zergRush-busybox-su.zip


This script will:
      (1) root ur device using latest zergRush exploit (16 Nov)
      (2) install Busybox (1.18.4)
      (3) install SU files (binary: 3.0.3 and apk: 3.0.6)
  
Before u begin:   
      (1) make sure u have installed adb drivers for ur device
      (2) enable "USB DEBUGGING" 
            from (Menu\Settings\Applications\Development)
      (3) enable "UNKNOWN SOURCES"
            from (Menu\Settings\Applications)
      (4) [OPTIONAL] increase screen timeout to 10 minutes
      (5) connect USB cable to PHONE and then connect to PC
      (6) skip "PC Companion Software" prompt on device



2. run this script


3. after Superuser is installed.
    adb shell
    su
    mount -o rw,remount /dev/block/mtdblock3 /system


4. and then you will find that you can change any file under system.


ENJOY!!

2011年12月5日月曜日

save log to sdcard

# logcat -v time -f /sdcard/logcat.txt -r 1024000 & http://developer.android.com/guide/developing/tools/logcat.html