This file contains 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
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) | |
} |
This file contains 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
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 file contains 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
# 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, |
This file contains 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
var req = SC.Request.create({ | |
address: 'http://localhost:8080', | |
body: "Hello World" | |
}); | |
req.send(); |
This file contains 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
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') | |
}) |
This file contains 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
initMixin: function() { | |
var resizeF; | |
var thisView = this; | |
if (typeof window.onresize === "function"){ | |
resizeF = function(){ | |
window.onresize(); | |
thisView.checkBounds(); | |
}; | |
} | |
else { |
This file contains 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
initMixin: function() { | |
var resizeF; | |
var thisView = this; | |
if (typeof window.onresize === "function"){ | |
resizeF = function(){ | |
window.onresize(); | |
thisView.checkBounds(thisView); | |
}; | |
} | |
else { |