Rodhos Soft

備忘録を兼ねた技術的なメモです。Rofhos SoftではiOSアプリ開発を中心としてAndroid, Webサービス等の開発を承っております。まずはご相談下さい。

文字横に画像

試行錯誤の結果次のようになった。 + (NSAttributedString *)backSymbol { UIImage *image = [UIImage imageNamed:@"backbutton"]; NSTextAttachment *attachment = [[NSTextAttachment alloc] init]; attachment.image = image; NSMutableAttributedString …

delayする実験

#include <iostream> #include "rx-includes.hpp" class Man { public: Man(); ~Man(); void hello(); private: int age; std::string name; }; template <typename T> class AbstBase { public: T hoge; }; class FuncClass { public: FuncClass() : connectStateOb(std::shared_p</typename></iostream>…

分割コンパイル

cpp

hojo.hpp int hello(); hojo.cpp #include "hojo.hpp" int hello() { return 1000; } hello.cpp #include <iostream> #include "hojo.hpp" using namespace std; int main(){ cout << "Hello world." << endl; int x = hello(); cout << x << endl; return 0; } という</iostream>…

最低限webpackを使う

node package.config { "name": "hoge", "version": "1.0.0", "description": "hoge", "main": "index.js", "scripts": { "build": "webpack", "watch": "webpack -w", "test": "echo \"Error: no test specified\" && exit 1" }, "author": "KatagiriSo", "…

ffmpeg

動画変換 https://ffmpeg.org/ それFFmpegで出来るよ! - Qiita ffmpeg -i input.mp4 output.avi

node for mobile調べ

GitHub - JaneaSystems/nodejs-mobile: Full-fledged Node.js on Android and iOSAndroidはV8 JavaScript engineをつかう。 iOSは略sampleがあるので フレームワークをそのsampleに入れるだけで動く。 NodeRunnerというクラスがあるので、それにjsのソースの…

filterに注意

list[]のfilterに渡すクロージャでreturnを書き忘れてもコンパイルが通ってしまう‥。

canvasのimageData

const imagedata:ImageData = context.createImageData(sw,sh) sw,sh 単位はCSSピクセル ImageDataを作成して返却 返却されたピクセルはすべて透明な黒 sw,shの代わりにimagedataを渡しても良い。 その場合、渡したimagedataの寸法の 新たなImageDataが作成…

環境モナドを作ってみる

環境モナドを作ってみました。 gistb15f8bd0d01559dc9178c748a5f1e49c

状態モナドを作ってみる

typescriptで状態モナドを作ってみます。状態モナドは という状態を受け取って結果と変化した状態を返す関数です。これを export type State<R,S> = (s:S) => {result:R,state:S} と定義しておきます。初期値を作る関数を export const unit = <R,S>(result:R) => (sta</r,s></r,s>…

htmlのタグをつける

for i in range(1,200): display = "" if i==1 or i>99: display=" style=\"display:none;\"" print("<option data-value=\""+str(i) + "\""+ display + ">"+str(i)+"回</option>")

checkのあるなし

let checked = ($("[data-hoge]").is(":checked")) ? true : false; チェックを付けたい場合 $("[data-btn-hoge] input").prop("checked",true);

htmlスクロール禁止

iOS

以下を参照 iOSはoverflow:hidden;でスクロールを無効にできない - Qiita スクロール禁止が overflow:hidden や preventDefault(); でできないときの対処法 - Qiita

英単語

ends up ...で終わる

console.logの置き換え

console.log\((.*)\) で debuglog($1)

JQuery

正規表現でJQueryの"[hoge] [data-btn-fuga]"を[hoge] [data-btn="fuga"]に変換したい。 "(\[.*\])\s*\[data\-btn\-([a-z0-9]*)\]" `$1 [data-btn="$2"]` 置換はVSCodeでおこなった。

iosのwkWebViewでズームさせない

<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,muser-scalable=no"></meta>

ローカルHTMLのメモ

iOS

WKWebViewで実装すると フォルダ参照ならhtml内のlinkは./でプロジェクト直下になっているようだ。WKWebViewは今の所、コード上で貼り付けるしかない。WKNavigationDelegateでnavigationResponseでdocument.locationの移動を検知できる。 decisionHandler(.a…

サブモジュール

git

SourceTreeの古いバージョンだとサブモジュール追加が失敗する。 git submodule add https://hoge.git hoge みたいにコマンドラインでやる。

チェック

チェックの有無の取得 <p>hoge<input type="checkbox" data-detail value="1"></p> let checked = ($("[data-detail]").is(":checked")) ? true : false;

ビルド設定表示

プロジェクトファイルのある階層で xcodebuild -showBuildSettings 環境変数 https://pewpewthespells.com/blog/buildsettings.html

Macでアプリを開く

以下を参照した。 qiita.com open -a hoge hogeはApplication/で.appを除いた名前。(フルパスを渡しても良い) bashの.profileにaliasを作る。 alias hoge="open -a hoge"

cmakeの仕方

以下を参考にする。 qiita.com コマンドラインのビルド main.cpp, hello.hppがあるとする。 これらをまず g++ -c main.cpp hello.hpp とコンパイルして.oファイルを作る。 そしてリンクする。 g++ -o a.out main.o hello.o cmake CMakeLists.txtを作る cmake…

canvas

お絵描きのサンプル マウスをダウンして描画開始、動かしたら線を引いて、マウスをあげたら描画終了 pathの構造 path 複数のsubpathから構成されている。 subpath 座標点のリストを持ちlinesegmentとも呼ばれる。 subpath closedかどうかのフラグを持つ cont…

display

css

block (p、div、ul、h1〜h) 横いっぱいに広がり、縦に並ぶ inline ( a、span、omg) 要素が横に並んでいく inline-block none 非表示 blockは改行が入り、幅と高さが設定される。 左右、上下の余白が設定できる。 inlineは改行は入らず幅と高さが設定できない…

セレクタ

css

以下が詳しい。 weboook.blog22.fc2.com

Slickの導入

サイトからDL slick - the last carousel you'll ever need htmlから読み込む <script type="text/javascript" src="/js/slick/slick/slick.min.js"></script> <link rel="stylesheet" type="text/css" href="/js/slick/slick/slick.css" media="screen" /> </link>

Discriminated Unions

https://www.typescriptlang.org/docs/handbook/advanced-types.html

リセットを取り消す

git

git reflogでリセットしたHEAD{}を探してリセットする。

Web技術の情報

developers.google.comgoogle、よく書かれている。