***** **** ******** ******** ** **** ** ** **** ** ****
** ** ** *** ** ** ** ** ** ** ** ** ** **
** ** ** *** ** ** ** ****** ** ** ** ** ** ******
** ** ** *** ** ** ** ** ** ** ** **** **
***** ************ ** ** ****** **** ****** ** ** *** ****
軸はいろいろある。
キャリアカウンセラーの壁に貼ってあるバッド・カデルの図
https://www.waicrew.com/2015/02/07/
- "なにをするか"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.service | |
import scala.io.Source | |
import scala.util.parsing.combinator.RegexParsers | |
object CloudFlareLogParserService { | |
def resolve: Unit = { | |
val accessLog = | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python | |
# coding:utf-8 | |
import csv | |
import sys | |
""" | |
根ノードから再帰的に深さ優先で木構造を作成しつつ探索も行う。 | |
コスト集計も中途で行い、最低コストを上回った時点で以降の子孫ノードの探索を中止する。 | |
木構造のプログラムを書くのに慣れていないため、実直にコーディングした。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> 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])] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/benoitc/gunicorn/blob/master/examples/frameworks/tornadoapp.py | |
# gunicorn -k tornado tor:app | |
import tornado.ioloop | |
import tornado.web | |
import tornado.options | |
tornado.options.define('port', type=int, default='8080', help=u'port number') | |
class MainHandler(tornado.web.RequestHandler): | |
def get(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Animal | |
def initialize(species) | |
@species = species | |
end | |
def bark() | |
"bowbow" | |
end | |
def mew() | |
"mewwww" | |
end |