Skip to content

Instantly share code, notes, and snippets.

View paulitex's full-sized avatar

Paul Lambert paulitex

View GitHub Profile
@paulitex
paulitex / gist:2578816
Created May 2, 2012 18:08
Mutable Map test
object Test extends App {
val runs = 100
val puts = 100
var acc = 0L;
for (k <- (0 until runs)) {
val map = collection.mutable.Map[String, Int]()
val start = System.currentTimeMillis
for (i <- (0 until 100000)) {
map += (i.toString -> i)
}
import org.scalatra.util.MutableMapWithIndifferentAccess
import scala.collection.mutable.{ Map => MMap }
/**
* Provides a Rails/Scalatra like map that sits in the session
* and destroys values after the request they were accessed in has returned
*
* @author paulitex
*
*/
# This all assumes you have the process running in
# a terminal screen and you're on Linux-like system.
# First off, suspend the process and background it
ctrl-z # suspend the process
bg # restart/continue the process in the background
# Now create files to log to. They can be called anything,
# Personally I would end the in .log. E.g. could be
# /var/logs/myprocess-stdout.log,
var req = SC.Request.create({
address: 'http://localhost:8080',
body: "Hello World"
});
req.send();
textedit : SC.TextFieldView.create({
isTextArea: YES,
layout: {centerY: 0, centerX: 0, width: 170, height: 170},
sizeCheck: function(key){
if (key) console.log('%@ did change!'.fmt(key));
}.observes('value', 'fieldValue')
})
initMixin: function() {
var resizeF;
var thisView = this;
if (typeof window.onresize === "function"){
resizeF = function(){
window.onresize();
thisView.checkBounds();
};
}
else {
initMixin: function() {
var resizeF;
var thisView = this;
if (typeof window.onresize === "function"){
resizeF = function(){
window.onresize();
thisView.checkBounds(thisView);
};
}
else {