なるテク

なるほど!なテクニックや技術をまとめるブログ

鍵導出関数

ってなんのこと? Key derivation function - Wikipedia PBKDF2 - Wikipedia kdfにも複数種類あるようだ。 phpの実装例 http://php.net/manual/ja/function.hash-pbkdf2.php NISTでの説明。 https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublica…

sassドキュメント:variables

sassの変数にはスコープが存在する。 Variables are only available within the level of nested selectors where they’re defined. http://sass-lang.com/documentation/file.SASS_REFERENCE.html#variables_ ネストに気をつけて使えば他の変数とかぶる心配…

postgresqlのコマンドライン操作

コマンドライン操作の開始 psql コマンドを使用する。 https://www.postgresql.jp/document/9.3/html/app-psql.html # 対話的問い合わせの開始 $ psql -d database_name # テーブル一覧の表示 ==>\d サンプルデータの操作 Sample Databases - PostgreSQL wik…

ubuntuのapt-getとデーモン周りの操作

apt-get周り こちらの記事の通り apt-get dpkg apt-cache の三種類で色々わかるようだ。 PostgreSql コマンドの覚え書き - Qiita デーモン・サービス周り initctl service コマンドで操作するようだ。

sqlのwindow関数のframe

window関数のframeについてまとめたい。 なおwindow関数はpostgresql, prestoでは利用可能で、MySQLでは利用できない。 今回使ってみるのはpresto 0.152である。 WITH data AS ( SELECT * FROM (VALUES ('2016-12-01', '/', 100), ('2016-12-01', '/category…

redashコードリーディング:開発環境の準備

redash 0.12.0について redashを開発するにはvagrantを使って動かせば良いらしい。 Setting up development environment (using Vagrant) · GitBook 早速やってみると Problems with Vagrant · Issue #1322 · getredash/redash · GitHub vm内でのpipが悪かっ…

prestoクエリサンプル:window関数内で集約関数を利用する

TreasureData by IDC Frontier presto version 0.152.3の場合。 *基本的に標準sqlに従っているので他のクエリにも応用可能なはず。 クエリ あるサイトの日ごとの各ページのpv数データから、全期間でのpv数をページごとに出し、pv数が多い順にランキング付け…