Skip to content

Instantly share code, notes, and snippets.

@sunaot
sunaot / gist:946113
Last active June 12, 2019 10:28
和田省二さんの SQL 講座のメモ書き。文責は sunaot

SQL 講座

SQL

  • SELECT
  • FROM
  • WHERE
  • GROUP BY 句
  • HAVING
  • WINDOW
@sunaot
sunaot / gist:946062
Last active June 23, 2022 00:07
DB 設計勉強会 / タワーズクエスト社 和田省二さんを先生にむかえた勉強会のメモ。文責は sunaot です。

DB設計勉強会

全体のテーマ

データモデリング

  • データと情報
  • エンティティとリレーションシップ
  • リソースエンティティとイベントエンティティ
  • リレーションシップと多重度(カージナリティ)
  • PK と AK と FK
@ken39arg
ken39arg / gist:933833
Created April 21, 2011 06:14
JSでログの制御ってこれで良いのかな?
var IS_DEV = true;
// logger
var console = window.console;
if (IS_DEV === false || !console) {
console = {
log: function(){},
debug: function(){},
info: function(){},
warn: function(){},
@tmtm
tmtm / mysql_unicode_collation.rb
Created April 16, 2011 06:25
MySQL 5.5.11 unicode_ci で同一視される文字
#!/usr/local/bin/ruby
# -*- coding: utf-8 -*-
require 'cgi'
filename, = ARGV # path of file `ctype-uca.c'
ctype_uca = File.read(filename)
ctype_uca =~ /^uchar uca_length\[256\]={\n(.*?)};$/m or raise 'uca_length not found'
uca_length = $1.gsub(/\s/,'').split(/,/).map(&:to_i)
@ussy
ussy / pom.xml
Created December 20, 2010 14:57
Scala Advent Calendar jp 2010
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>sandbox</artifactId>
<packaging>jar</packaging>
<version>1.0.0-SNAPSHOT</version>
<name>sandbox</name>
<url>http://maven.apache.org</url>
// Kosso imageAsCropped
// added to TiBlob.m
// requires 4 arguments : x, y, width, height
- (id)imageAsCropped:(id)args
{
[self ensureImageLoaded];
if (image!=nil)
{
ENSURE_ARG_COUNT(args,4);
package oauth
import java.net.URLEncoder
import java.util.Random
import java.security.Key
import javax.crypto.spec.SecretKeySpec
import javax.crypto.Mac
import sun.misc.BASE64Encoder
wait-free/lock-free/obstruction-freeの定義について
▲全てに共通する概念
スレッドが他のスレッドの進行を禁止する事がないので、どれかのスレッドが
ロックを確保したままプリエンプションなどで全体の処理が停止する事態が発生しな
い。
これは必ずしもロックベースのアルゴリズムより高速であることを意味し
ない(現にロックの方が早い場合もある
wait-freeが一番強い条件で、それを弱める度に
<?php
/**
* Geohash
*
* @author Keisuke SATO
* @license MIT License
*
* # Based
* http://github.com/davetroy/geohash-js/blob/master/geohash.js
* Geohash library for Javascript
@retronym
retronym / drop-to-repl-2.8.scala
Created January 30, 2010 17:12
Embedding REPL in 2.8 working around classpath propagation changes.
object IntepreterFix {
import scala.tools.nsc._
import Interpreter._
def break(args: DebugParam[_]*): Unit = {
val intLoop = new InterpreterLoop
intLoop.settings = {
val s = new Settings(Console.println)
// need to pass this explicitly to the settings for Scalac.
// See: http://old.nabble.com/-scala--recent-changes-in-2.8-nightly-classpath-management-td26233977.html