2014-01-01から1年間の記事一覧
GridView は、横幅が自動計算されるため、比率を合わせるには、設定時に計算する必要がある。FrameLayout を入れていた場合は、以下のように onMeasure を オーバーライドし、height を再計算する。 xml の 属性に、layout_height_ratio="0.8" のように指定…
void checkSize (View view) { final Point size = getWindowSize(); // window のサイズを 通知する view.measure (size.x, size.y); // サイズ取得! final int w = view.getMeasuredWidth(); final int h = view.getMeasuredHeight(); } Point getWindowS…
class Api::FilesController < Api::ApplicationController def create # file = params[:data] data_str = params[:data_str] file = File.new # file.data = data file.data_str = data_str end end class File < ActiveRecord::Base mount_uploader :data…
composer で S3 の ライブラリを取得する $ curl -sS https://getcomposer.org/installer | php $ vi composer.json { "require": { "aws/aws-sdk-php": "*" } }$ php composer.phar install 利用する $ vi hoge.php
Storyboard や、 xib ファイルから viewController を取得し、view を取り出したものを指定すると、表示が崩れる。コード上でUIView や UIButton を生成し、inputAccessoryView に渡す必要がある。
Failed to mount folders in Linux guest. This is usually because the "vboxsf" file system is not available. Please verify that the guest additions are properly installed in the guest and can work properly. The command attempted was: mount -…
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x17001f8c0 of class AVPlayerItem was deallocated while key value observers were still registered with it. Current observation info: ( Conte…
scaffold と言っても、rails の scaffold とは何も関係がありません。 Google社製の、簡易フレームワーク(設定ガイドライン)です。google/gae-secure-scaffold-pythonセキュリティの設定や、URLのディスパッチ、フォルダの構成、デプロイスクリプトなどが…
Xamarin Studio 5.3 の不具合で、以下のコードが必ずエラーになる。 UIRemoteNotificationType notificationTypes = UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound; UIApplication.SharedApplication.…
WebUtility.UrlEncode ("あい うえお"); こちらを使う System.Uri.EscapeUriString ("あい うえお");
void Sample () { Hoge hoge = new Hoge (); hoge.OnSuccess += (sender, e) => { Console.WriteLine ("end"); }; } async Task Sample () { var taskCompletionSource = new TaskCompletionSource<string>(); Hoge hoge = new Hoge (); hoge.OnSuccess += (sender, </string>…
審査期間は、今は1週間かからない程度です。 アプリが動く状態になっていなければなりません。 シェア文言にデフォルト文言を入れるのが目的の場合 iOS OS の機能を使ってシェアしてください。 規約違反ですが、問題なくデフォルト文言と画像が設定できます…
縦画面時は44px、横画面時は32px の画像を用意する必要があるが、 元からその2種類を登録するメソッドがあった。 - (void)setupNavigationBar { UIBarButtonItem *refreshBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItem…
hoge = ()-> fuga = 1 return
N-06D のOS は 4.0.4 で minSdkVersion に 14 を指定しているのに、 インストール出来なかった。これは、N-06D のカメラに、オートフォーカスがないことが原因で、 permission に CAMERA を追加すると、自動でオートフォーカス必須に設定されてしまう。 そこ…
日本だけであればいくつかAPIが存在したが、 海外にも対応する必要があったので、海外のAPIだが、使用されているAndroidアプリの評価が高く、有料の、 wundergroundを使用してみた。http://www.wunderground.com/weather/api/d/docs?d=data/index&MR=1 サポ…
<ScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true" android:paddingTop="10dp" android:overScrollMode="never" > </ScrollView> android:overScrollMode="never" これで消えます。
これでは GoogleMap が null になってしまう。 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_map); setupMap(); } private void setupMap () { final FragmentMa…
IPアドレスによって、1秒間に1リクエストに制限する設定。 超えた場合は、503を返します。burst の設定がある場合は、rate を超えても、burst回数までは許容し、rate のペースでレスポンスを返します。 limit_req_zone $binary_remote_addr zone=one:10m rat…
fastcgi_cache_path /var/cache/nginx/fscgi levels=1:2 keys_zone=fscgi_dayo:10m inactive=10m; server { listen 80; server_name test.com; access_log /var/log/nginx/access_dayo.log ltsv; error_log /var/log/nginx/error_dayo.log warn; root /var/w…
Mp3Info は、パス指定でなければ利用出来ないので、 current_path によって、一時ファイルを開き直している。 class ItemDataUploader < CarrierWave::Uploader::Base include CarrierWave::MimeTypes storage :fog process :set_content_type process :chec…
micro インスタンスは、その他のタイプとは違い、 バースト、低速モードというものがあり、 低速モードがあるのでsmallにしないと使い物にならないという人がいるが、それは嘘で、 CPUを制限し、低速モードにさせなければsmallよりも高速に処理を行うことも…
Internal Server Error SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed これで直る curl -o cert.pem http://curl.haxx.se/ca/cacert.pem mv cert.pem /usr/local/etc/openssl
df -h これで使用ディスク100%になっているが、 実際にファイルを見ても見つからない場合、 du -h -d 1 プロセスがファイルを開いているが、ファイルは削除されている状態の可能性がある。 プロセスが使用中のファイルを調べ、deleted になっていると、その…
java が起動しないことが原因。Macなら、 システム環境設定 > Java > セキュリティ > サイトリストの編集Windowsなら、 コントロールパネル > Java > セキュリティ > サイトリストの編集ここに、 https://secure.sakura.ad.jp を追加。 さらにChromeでは開け…
Rails は、内部の日時をUTCで管理しているため、 DBに保存された時間と、表示される時間が異なります。$ config/application.rb config.active_record.default_timezone = :local config.active_record.time_zone_aware_attributes = false config.time_zone…
いらない項目だけ非表示にする remove_filter :user 既存を残し、必要な物を追加する preserve_default_filters! filter :created_at, as: :date_range 条件によって項目を出す。 false の時は、デフォルトで表示される場合も、非表示になる filter :hoge, :…
composite_primary_keys の gem をインストールするmodel に、主キーを配列で指定、display_name も指定 class Hoge < ActiveRecord::Base self.primary_keys = :user_id, :teacher_id def display_name "#{self.user_id}, #{self.teacher_id}" end end これ…
before_create do # hoge end この中の処理が原因だった。
_adView = [[appCMoveIconView alloc] initWithViewController:self horizontal:appCHorizontalLeft vertical:appCVerticalBottom]; [self.view addSubview:_adView];追加した後、画面から抜けるときに削除しなければならない。 [_adView removeFromSupervie…