長澤 太郎さん ( @ngsw_taro )
Svetlana Isakovaさん( @sveta_isakova )
https://speakerdeck.com/svtk/whats-new-in-kotlin
八木俊広さん ( @sys1yagi )
https://speakerdeck.com/sys1yagi/kotlin-korutinwo-li-jie-siyou-2019-kotlinfest2019
| import android.util.Log | |
| import androidx.lifecycle.Lifecycle | |
| import androidx.lifecycle.LifecycleObserver | |
| import androidx.lifecycle.OnLifecycleEvent | |
| object IndentProvider { | |
| private var depth = 0 | |
| private const val SPACE = " " |
| import UIKit | |
| extension UIScrollView { | |
| struct DefaultProperty { | |
| let contentOffset: CGPoint | |
| let contentSize: CGSize | |
| let contentInset: UIEdgeInsets | |
| let zoomScale: CGFloat | |
| } |
長澤 太郎さん ( @ngsw_taro )
Svetlana Isakovaさん( @sveta_isakova )
https://speakerdeck.com/svtk/whats-new-in-kotlin
八木俊広さん ( @sys1yagi )
https://speakerdeck.com/sys1yagi/kotlin-korutinwo-li-jie-siyou-2019-kotlinfest2019
| fileprivate func directoryExistsAtPath(_ path: String) -> Bool { | |
| var isDirectory = ObjCBool(true) | |
| let exists = FileManager.default.fileExists(atPath: path, isDirectory: &isDirectory) | |
| return exists && isDirectory.boolValue | |
| } |
| #include <iostream> | |
| #include <iomanip> | |
| #include <random> | |
| #include <unistd.h> | |
| using namespace std; | |
| const int MAX_FLOOR = 14; | |
| const int ELEVATOR_COUNT = 4; | |
| const int RAISING_PROBABILITY = 10; |
| // The following data should be run in the console while viewing the page https://read.amazon.com/ | |
| // It will export a CSV file called "download" which can (and should) be renamed with a .csv extension | |
| var db = openDatabase('K4W', '3', 'thedatabase', 1024 * 1024); | |
| getAmazonCsv = function() { | |
| // Set header for CSV export line - change this if you change the fields used | |
| var csvData = "ASIN,Title,Authors,PurchaseDate\n"; | |
| db.transaction(function(tx) { |
この投稿では、iOSのファイルシステムについて理解し、データを永続化(iCloud含む)する方法を紹介する。尚、サンプルコードは動かない可能性もあるので参考程度にして下さい。
アプリがファイルシステムとやり取り出来る場所は、ほぼアプリのサンドボックス内のディレクトリに制限されている。新しいアプリがインストールされる際、インストーラーはサンドボックス内に複数のコンテナを作成し、図1に示す構成をとる。各コンテナには役割があり、Bundle Containerはアプリのバンドルを保持し、Data Containerはアプリとユーザ両方のデータを保持する。Data Containerは用途毎に、さらに複数のディレクトリに分けられる。アプリは、例えばiCloud Containerのように、実行時に追加のコンテナへのアクセスをリクエストすることもある。
図1. An iOS app operating within its own sandbox
これは stfuawsc_itg Advent Calendar 2014 4日目の記事です。
プログラミングをしていると、いろいろなバージョンの環境を行ったり来たりしたくなることがあります。たとえば言語処理は python 2 へ nltk を入れてやりたい。シミュレーションは python 3 へ numpy 入れてやりたいとか。
そういうふうに言語やモジュールのバージョンをいろいろ組合せた環境を気軽に切り替えられると便利です。
実際そういうことを可能にするツールはたくさんあります。virtualenv, pyenv など。
ここで紹介する conda というツールもその1つです。
virtualenv などでは、モジュールを入れるときは通常の python の流儀でインストールするのですが、インストールがうまくいかないというのはよくあることです。conda ではあらかじめビルドされたものを入れるので、楽です。もちろん conda に用意されていないモジュールもありますが、そういうのは pip 等通常の方法で入れて共存できます。
ではさっそく conda で python の環境を作る方法です。
全体的に簡略化し、必要と思われる部分を抜粋しました。
Not running
アプリは起動されていないか、実行されていたけれどもシステムによって終了されています。
Inactive