Skip to content

Instantly share code, notes, and snippets.

import kafka.api.FetchRequest
import kafka.consumer.SimpleConsumer
import kafka.message._
import kafka.utils.Utils
import kafka.api.OffsetRequest
import java.io.{File, FileOutputStream}
import com.yammer.metrics.Instrumented
import com.yammer.metrics.reporting.ConsoleReporter
import java.util.concurrent.TimeUnit
// Run with:
java -cp . -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ParallelCMSThreads=24 -XX:+PrintGCDetails -XX:+PrintGCDateStamps Repro
import java.util.Map;
import java.util.Random;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashMap;
class Repro {

If you’ve got the weekend to check out the town, here are a few places worth heading:

There are quite a few neighborhoods that have sprung up alongside streets designed as mixed-use live/work/eat/drink/relax areas. Here are a few of them:

Mississippi
- Head over to N Fremont and Mississippi Ave (near the MAX) and start walking up the street. Por Qué No is one of the best taquerias in town. You’ll pass several other places like The Rebuilding Center (a warehouse of donated / deconstructed homes filled with reclaimed material; take a walk through if you’re near; it’s an incredible place), Ruby Jewel is a great ice cream shop, there’s Sunlan (a lightbulb shop; the woman who owns it is a bit of a savant — stop in), Fresh Pot (coffee), Miss Delta (cafe/bar), a few food carts up toward Skidmore, a store for buying coffee beans for roasting, an itzakaya — lots of stuff. Albina Press is also great for enjoying an americano or iced coffee and has free wifi.

Alberta
- Or, head up a bit further to NE 15th and

cscotta@insight:~$ ruby --version
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]
cscotta@insight:~$ gem --version
NOTE: Gem::Specification#default_executable= is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem::Specification#default_executable= called from /Users/cscotta/.rvm/gems/ruby-1.9.2-p0@global/specifications/bundler-1.0.2.gemspec:10.
NOTE: Gem::Specification#default_executable= is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem::Specification#default_executable= called from /Users/cscotta/.rvm/gems/ruby-1.9.2-p0@global/specifications/rake-0.8.7.gemspec:10.
NOTE: Gem::Specification#default_executable= is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem::Specification#default_executable= called from /Users/cscotta/.rvm/gems/ruby-1.9.2-p0/specifications/ar_mailer-1.5.1.gemspec:11.
@cscotta
cscotta / Example.json
Created May 14, 2011 20:33
Map Operation
// Sample Event Stream:
{ "event_type": "identification", "name": "nachos" }
{ "event_type": "event", "data": {"meat_type": "carnitas", "cheese_temp": 103, "vegetables": ["tomatoes", "olives"] } }
{ "event_type": "event", "data": {"meat_type": "beef", "cheese_temp": 101, "vegetables": ["tomatoes", "olives"] } }
{ "event_type": "event", "data": {"meat_type": "chicken", "cheese_temp": 98, "vegetables": ["tomatoes", "olives"] } }
// Sample Query:
{
"stream_id" : "nachos",
[info] == throughput ==
[info] Running overlock.atomicmap.ThroughputTest
2 CPU's
created 1048576 keys
warming up JIT
Warmup took 30.480539s for 60079285 ops with ratio 0.01745320371239438
noThreads trial_1 trial_2 trial_3 trial_4 trial_5 trial_6 trial_7 trial_8 trial_9 trial_10 trial_11 trial_12 trial_13 trial_14 trial_15 trial_16 trial_17 trial_18 trial_19 trial_20 mean stddv
2
java.lang.ClassCastException: java.lang.String cannot be cast to scala.runtime.Nothing$
cscotta@tacobot:~$ python
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from multiprocessing import Queue
>>> q = Queue(maxsize=32768)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/multiprocessing/__init__.py", line 212, in Queue
return Queue(maxsize)
Process: Python [57254]
Path: /System/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python
Identifier: Python
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: zsh [56894]
Date/Time: 2011-05-02 15:41:35.750 -0700
OS Version: Mac OS X 10.6.7 (10J869)
Report Version: 6
D/PackageManager( 59): Services: com.urbanairship.airmail.AirMailService
E/AndroidRuntime( 335): java.lang.RuntimeException: Unable to instantiate application
com.urbanairship.airmail.AirMailApplication: java.lang.ClassNotFoundException:
com.urbanairship.airmail.AirMailApplication in loader
dalvik.system.PathClassLoader[/data/app/com.urbanairship.airmail-1.apk]
E/AndroidRuntime( 335): Caused by: java.lang.ClassNotFoundException:
com.urbanairship.airmail.AirMailApplication in loader
dalvik.system.PathClassLoader[/data/app/com.urbanairship.airmail-1.apk]
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/ostruct.rb:83:
[BUG] rb_gc_mark(): unknown data type 0x0(0x100148380) corrupted object
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
Abort trap