case class Person(id: Long, name: String, organizationId: Long)
object Person {
def groupByOrg: Map[Long, Seq[Person]] = ...
(最終更新: 2015/4/19)
License: CC BY-SA 4.0
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
/** | |
Copyright (c) 2017 Koki Ibukuro | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
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
--[[ json.lua | |
A compact pure-Lua JSON library. | |
The main functions are: json.stringify, json.parse. | |
## json.stringify: | |
This expects the following to be true of any tables being encoded: | |
* They only have string or number keys. Number keys must be represented as | |
strings in json; this is part of the json spec. |
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
<!-- | |
http://george-osd-blog.heroku.com/25 | |
http://george-osd-blog.heroku.com/26 | |
--> | |
<?xml version="1.0"?> | |
<!-- インストールしたTsungのPathとあっていること --> | |
<!DOCTYPE tsung SYSTEM "/home/ec2-user/opt/tsung-latest/share/tsung/tsung-1.0.dtd"> | |
<tsung loglevel="notice" version="1.0"> |
このgistは Cloud Foundry Advent Calendar 2013 の16日目の記事です。
現在、CloudFoundryのComponentsはGo化しつつあります。それにより、Rubyで実装されていたものに対して性能向上していたり、ソースが読みやすくなっていたりする(こちらは主観ですが・・)半面、開発者にとっての課題も生まれています。その課題のひとつが__依存パッケージ管理__です。まずはRubyの外部パッケージ管理について簡単に振り返りつつ、Goのそれを見ていこうと思います。
Rubyでは外部パッケージはGemファイルとなっており、大抵の場合、Bundlerで管理します。また、最新版が動くとは限らないため設定ファイルにバージョンを指定してそれを使用します。Gemファイル自体はRubyGems.orgに置かれており、ここからダウンロードされます。
Goではソースコード中のimport句でパッケージを指定します。設定ファイルは使いません。以下に例を示します。
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
--EVAL 'this script' 1 some-key | |
local key = KEYS[1]; | |
local value = redis.call('GET', key); | |
local jvalue = cjson.encode(cmsgpack.unpack(value)); | |
return jvalue; |
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
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class BezierMesh | |
{ | |
public Mesh mesh; | |
public List<Vector2> uvs; | |
// Calculate UVs for our tessellated vertices |
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
require 'socket' | |
require 'net/http' | |
require 'uri' | |
class Proxy | |
PORT = 8888 | |
def initialize | |
@server_socket = TCPServer.open(nil, PORT) | |
@responses = {} |