Metadata in PDF files can be stored in at least two places:
- the Info Dictionary, a limited set of key/value pairs
- XMP packets, which contain RDF statements expressed as XML
global_variables.sort.each do |name| | |
puts "#{name}: #{eval "#{name}.inspect"}" | |
end |
// | |
// NSData+Base64.h | |
// base64 | |
// | |
// Created by Matt Gallagher on 2009/06/03. | |
// Copyright 2009 Matt Gallagher. All rights reserved. | |
// | |
// This software is provided 'as-is', without any express or implied | |
// warranty. In no event will the authors be held liable for any damages | |
// arising from the use of this software. Permission is granted to anyone to |
function! SuperTab() | |
if (strpart(getline('.'),col('.')-2,1)=~'^\W\?$') | |
return "\<Tab>" | |
else | |
return "\<C-n>" | |
endif | |
endfunction | |
function! SuperShiftTab() | |
if (strpart(getline('.'),col('.')-2,1)=~'^\W\?$') | |
return "\<S-Tab>" |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
* Only the releases of the stable versions are listed in principle. The releases of the unstable versions especially considered to be important are indicated as "not stable." | |
* The branches used as the source of each releases are specified, and the branching timing of them are also shown. BTW, before subversionizing of the repository, the term called "trunk" was not used, but this list uses it in order to avoid confusion. | |
* In order to show a historical backdrop, big conferences (RubyKaigi, RubyConf and Euruko) are also listed. About the venues of such conferences, general English notations are adopted, in my hope. | |
* ruby_1_8_7 branch was recut from v1_8_7 tag after the 1.8.7 release because of an accident. | |
* 1.2.1 release was canceled once, and the 2nd release called "repack" was performed. Although there were other examples similar to this, since the re-releases were performed during the same day, it does not write clearly in particular. | |
* Since 1.0 was released with the date in large quantities, the mi |
type ApacheLogRecord struct { | |
http.ResponseWriter | |
ip string | |
time time.Time | |
method, uri, protocol string | |
status int | |
responseBytes int64 | |
elapsedTime time.Duration | |
} |
package fizzbuzz | |
// This is church encoding of natural numbers | |
sealed trait Num { | |
def toInt : Int | |
override def toString = toInt.toString | |
} | |
final case object Z extends Num { | |
def toInt : Int = 0 |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant::Config.run do |config| | |
config.vm.box = "base" | |
config.vm.customize ["modifyvm", :id, "--memory", 1024] | |
config.vm.define :haproxy do |haproxy| | |
haproxy.vm.forward_port 80, 8000 | |
haproxy.vm.network :hostonly, "192.168.1.10" |
case class GenericCache[A[_,_], B, C](instance: A[B,C], getf: B=>C, putf: (B,C)=>Unit) { | |
def retrieve(b: B) = getf(b) | |
def insert(b: B, c: C) = putf(b,c) | |
} | |
//Notice how neither cache implementations have to even be aware of the existnace of the typeclass. much more flexible than inheritance | |
class FastCache[A,B] { | |
private var m = Map[A,B]() //excuse mutability for illustration purposes | |
def add(a: A, b: B): Unit = { | |
m = m + (a->b) |