パネルみたいに回ったりめくれたり
これiphoneぽいですよねw
ちょっとやってみた
xxxViewController.h
#import <UIKit/UIKit.h> @interface xxxViewController : UIViewController { UIImageView *imageView; } @property (nonatomic, retain) IBOutlet UIImageView *imageView; - ( IBAction ) touch_image:(id) sender; //画面触ったらaction起こるようにする @end
xxxViewController.m
#import "xxxViewController.h" @implementation xxxViewController @synthesize imageView; // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; //起動時の画像をimageViewにセット imageView.image = [ UIImage imageNamed: @"img1.jpg" ]; } - ( IBAction ) touch_image:(id) sender { //画面にタッチしたら呼ばれるアクション [ UIView beginAnimations: @"samapleAnimation" //この名前でアニメーションを定義する context: nil ]; [ UIView setAnimationTransition:UIViewAnimationTransitionCurlUp // 上にめくれる感じ // UIViewAnimationTransitionCurlDown 下にめくれる感じ // UIViewAnimationTransitionFlipFromRight 右から左へ回転する感じ // UIViewAnimationTransitionFlipFromLeft 左から右へ回転する感じ forView: imageView // このビューにたいして適用 cache: YES ]; // 表示内容をキャッシュ imageView.image = [ UIImage imageNamed: @"img2.jpg" ]; // 変わる画像 [ UIView commitAnimations ]; // アニメーション定義完了と実行 }
UIImageViewでスライドショー
UIImageViewで画像表示 のコードをいじる
xxxViewController.m
imageView.animationImages = [ NSArray arrayWithObjects: // 変更する画像の設定 [ UIImage imageNamed: @"img1.jpg" ], [ UIImage imageNamed: @"img2.jpg" ], [ UIImage imageNamed: @"img3.jpg" ], [ UIImage imageNamed: @"img4.jpg" ], nil ]; imageView.animationDuration = 10.0f; //1回のアニメーションの長さ(=10秒) imageView.animationRepeatCount = 0; //何回繰り返すか(0=無限) [ imageView startAnimating ]; //アニメーション開始!!
画像のサイズに注意
1024*1024以下にする
画像のサイズが大きすぎても失敗する
(Simulator上では動作するが実記では動作しない)
[ imageView isAnimating ] //現在アニメーション中かどうか アニメーション中=YES 停止中=NO [ imageView stopAnimating ] //停止
UIImageViewで画像表示
xxxViewController.h
#import <UIKit/UIKit.h> @interface xxxViewController : UIViewController { UIImageView *imageView; } @property (nonatomic, retain) IBOutlet UIImageView *imageView; @end
xxxViewController.m
@implementation xxxViewController @synthesize imageView; // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. [super viewDidLoad]; imageView.image = [ UIImage imageNamed: @"hoge.png" ]; }
Resources の下のxxxViewController.xib を開いてInterface Builderを起動
File's Owner を選択して Library から ImageView を View に設置(D&D)
File's Owner を右クリックして Outlets から imageView を選択して View の UIImageView と結ぶ
ビルドと実行 を行うと Simulator が立ち上がって実行される
iphoneアプリのTouchTermを使ってみた
せっかく新しくレンタルサーバ借りたしiphoneも持ってることだし、
SSHクライアント使ってみた。
探したらいまは450円でした。
なんかネットみてたら無料とか100円とかいろいろ書いてる人いたのに。。。残念。
鍵設定
- 起動したらまずは、[Settings]タブを開く
- [Settings]->[Security]->[Manage SSH Keys]->[Create New Key]の順に開いて必要項目を埋めて鍵作成
- [Connections]タブで新規Connectionをするとき、さきほど作成した鍵を選択する
- 鯖側に鍵登録。/home/user/.ssh/authorized_keysに公開鍵の情報を貼り付け。
作成した鍵は[Manage SSH Keys]で[E-Mail Public Key]でPCのアドレスとかに送ることが出来るから便利。
wifi環境だとストレス感じることなく操作できる!
3G環境だと多少ラグはありますが想定内のレベル。
便利便利!
ServersMan@VPSを試してみた
DTI、ワンコイン(490円)から利用できるVPS
というこて早速試してみた。
4/2に申し込みを行ったのですが、予想以上の申し込み数で〜ということで
今日の13時にやっと使えるようになりました。
早速メールで受け取ったVPSサーバ情報をもとにログイン確認。
ぼくが契約したのは一番安いお手軽プランの「ServersMan@VPS Entry」
月額利用料490円
OS CentOS 5
メモリ256MB
ストレージ 10GB
十分でしょう。
perlもはいってます
$ perl -v This is perl, v5.8.8 built for i386-linux-thread-multi Copyright 1987-2006, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page.
とりあえずログインできたから満足ですが、認証部分だけ設定しておいた。
これからなにしようかなー。
ユーザwajiを作成
# useradd waji # passwd waji Changing password for user waji. New UNIX password: Retype new UNIX password: passwd: all authentication tokens updated successfully.
ユーザを管理者グループに設定
# usermod -G wheel waji # vi /etc/pam.d/su 編集してコメントをはずす #auth required pam_wheel.so use_uid ↓ auth required pam_wheel.so use_uid
鍵認証
rootからログアウトして、wajiでログインしなおす
$ pwd $ mkdir .ssh $ chmod 700 .ssh/ $ vi .ssh/authorized_keys 自分の公開鍵を貼り付ける $ chmod 600 .ssh/authorized_keys $ exit
ログアウトして、鍵認証でログインしなおす
$ su - Password: # vi /etc/ssh/sshd_config PermitRootLogin no rootでのログインを禁止 PasswordAuthentication no パスワードでのログインを禁止 PermitEmptyPasswords no パスワードなしでのログインを禁止 # /etc/rc.d/init.d/sshd reload Reloading sshd: [ OK ]