Skip to content

Instantly share code, notes, and snippets.

View oc's full-sized avatar

Ole Christian Rynning oc

  • UPPERCASE
  • Oslo, Norway
View GitHub Profile
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6353f18f, pid=2928, tid=1072
#
# JRE version: 6.0_23-b05
# Java VM: Java HotSpot(TM) Client VM (19.0-b09 mixed mode, sharing windows-x86 )
# Problematic frame:
# C [libxml2.dll+0x3f18f]
#
~/noko:➔ java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04-307-10M3261)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03-307, mixed mode)
~/noko:➔ rvm use jruby
Using /Users/oc/.rvm/gems/jruby-1.5.6
~/noko:➔ gem install nokogiri
Successfully installed weakling-0.0.4-java
@oc
oc / MANIFEST.MF
Created October 18, 2010 16:36
blog post
Manifest-Version: 1.0
Created-By: oc
Main-Class: example.database.Main
Liquibase-Package: liquibase.change,liquibase.database,liquibase.parser,liquibase.precondition,liquibase.serializer,liquibase.sqlgenerator,liquibase.executor,liquibase.snapshot,liquibase.logging,liquibase.ext
@oc
oc / Main.java
Created September 16, 2010 17:14
package no.muda.jetty;
import org.constretto.ConstrettoBuilder;
import org.constretto.ConstrettoConfiguration;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.HandlerList;
import org.eclipse.jetty.webapp.WebAppContext;
import org.springframework.core.io.DefaultResourceLoader;
import java.io.IOException;
tweets = []
Dir['search*'].each do |f|
File.open(f).readlines.join.scan(/(<li class="hentry status .*?<\/li>)/m).each do |tweet|
author = tweet[0].scan(/;">(.*?)<\/a>.*?<span id="msgtxt/m)[0].to_s
text = tweet[0].scan(/<span id="msgtxt\d+" class="msgtxt \w+">(.*?)<\/span>/m)[0].to_s.gsub(/<.*?>/, '')
tweets << [author, text]
end
end
puts tweets.uniq.sort.size
package no.rynning;
import org.mortbay.jetty.Connector;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.nio.SelectChannelConnector;
import org.mortbay.jetty.webapp.WebAppContext;
/**
* OC's jettylauncher. DON'T MODIFY OR MOVE PLEASE!
*/
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.bring.no/logistics/shippingguide/1.0">
<soapenv:Header/>
<soapenv:Body>
<ns:ShippingGuideRequest>
<!--You may enter the following 4 items in any order-->
<ns:UserInformation>
<ns:Usercode>PUT-YOUR-USERCODE-HERE</ns:Usercode>
</ns:UserInformation>
<ns:RequestProperties>
<!--You may enter the following 8 items in any order-->
val chars = "abcdefghijklmnopqrstuvwxyz"
val rand = new scala.util.Random(System.currentTimeMillis)
def randChar(upperCase:Boolean) = {
val ch = chars(rand.nextInt(chars.length - 1))
if (upperCase) ch.toUpperCase else ch
}
scala> "Ole Christian Rynning".split(" ").map(_.map(ch => randChar(ch.isUpperCase)).mkString).mkString(" ")
res0: String = Aee Ochbivgjm Vgxwuuc
require 'rubygems'
require 'barby'
require 'prawn'
require 'barby/outputter/prawn_outputter'
require 'fastercsv'
LEN = 30
def add_data(pdf, id, name, email)
pdf.text "Hurtigregistrering", :size => 20, :at => [0, 300]
#!/bin/sh
exec scala "$0" "$@"
!#
import collection.mutable.ListBuffer
val random = new Random()
def sumPizzas(list:ListBuffer[Pizza]):Int = { list.foldLeft(0)(_ + _.totalPrice) }
object Orderer {
val maximumPrice = 1200