軸はいろいろある。
キャリアカウンセラーの壁に貼ってあるバッド・カデルの図
https://www.waicrew.com/2015/02/07/
- "なにをするか"
| >>> s = [('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', 1)] | |
| >>> d = defaultdict(list) | |
| >>> for k, v in s: | |
| ... d[k].append(v) | |
| ... | |
| >>> d.items() | |
| [('blue', [2, 4]), ('red', [1]), ('yellow', [1, 3])] |
| #!/bin/env python | |
| # coding:utf-8 | |
| import csv | |
| import sys | |
| """ | |
| 根ノードから再帰的に深さ優先で木構造を作成しつつ探索も行う。 | |
| コスト集計も中途で行い、最低コストを上回った時点で以降の子孫ノードの探索を中止する。 | |
| 木構造のプログラムを書くのに慣れていないため、実直にコーディングした。 |
| [inet_http_server] ; inet (TCP) server disabled by default | |
| port=127.0.0.1:9001 ; (ip_address:port specifier, *:port for all iface) | |
| ;username=user ; (default is no username (open server)) | |
| ;password=123 ; (default is no password (open server)) | |
| [include] | |
| files = conf.d/*.ini |
| package com.example.service | |
| import scala.io.Source | |
| import scala.util.parsing.combinator.RegexParsers | |
| object CloudFlareLogParserService { | |
| def resolve: Unit = { | |
| val accessLog = | |
| """ |
| import java.io.File | |
| import java.net.InetAddress | |
| import com.maxmind.geoip2.DatabaseReader.Builder | |
| import com.maxmind.geoip2.exception.AddressNotFoundException | |
| object GeoipSample { | |
| def main(args: Array[String]): Unit ={ | |
| val database = new File("/tmp/GeoLite2-Country.mmdb") | |
| // This creates the DatabaseReader object, which should be reused across lookups. | |
| val reader = new Builder(database).build() |
| -- from decimal biginteger to hexdecimal text with any separator | |
| CREATE OR REPLACE FUNCTION serialnumber_hex(serial bigint, sep varchar) RETURNS varchar AS $$ | |
| DECLARE | |
| org varchar := ''; | |
| res varchar := ''; | |
| BEGIN | |
| org := to_hex(serial); | |
| WHILE 0 < length(org) LOOP | |
| res := concat_ws(sep, res, substr(org, 1, 2)); | |
| org := substr(org, 3, length(org)); |
軸はいろいろある。
キャリアカウンセラーの壁に貼ってあるバッド・カデルの図
https://www.waicrew.com/2015/02/07/
| #!/bin/sh | |
| # | |
| # gunicorn_sr Startup script for gunicorn for sr | |
| # | |
| # chkconfig: - 86 14 | |
| # processname: gunicorn | |
| # pidfile: | |
| # description: Python application server | |
| # | |
| ### BEGIN INIT INFO |
| CREATE TABLE addresses ( | |
| id INTEGER NOT NULL, | |
| email VARCHAR NOT NULL, | |
| owner_id INTEGER, | |
| PRIMARY KEY (id) | |
| ); | |
| CREATE TABLE users ( | |
| id INTEGER NOT NULL, | |
| name VARCHAR NOT NULL, | |
| PRIMARY KEY (id) |