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 $tree = $('#tree1'); | |
$('#collapse').click(function() { | |
var tree = $tree.tree('getTree'); | |
tree.iterate(function(node) { | |
if (node.hasChildren()) { | |
$tree.tree('closeNode', node, true); | |
} | |
return true; | |
}); |
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
"Apache Directory Studio.exe" -vm "C:\Program Files (x86)\Java\jre7\bin\java.exe" |
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
package main | |
import scala.annotation.tailrec | |
class Tailrec { | |
def tail1(i: Int): Int = { | |
if (i >= 10) i | |
else tail1(i+1) | |
} |
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
case class Emp(id: Long, | |
firstName: Option[String], | |
lastName: Option[String]) | |
case class EmpProj(id: Column[Long], | |
firstName: Column[Option[String]], | |
lastName: Column[Option[String]]) | |
implicit object EmpShape extends CaseClassShape(EmpProj.tupled, Emp.tupled) |
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
javap -verbose MyClass | findstr "major" |
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
Always specify an Expires header. It will normally be set to -1 for immediate expiration of HTML pages or a date well into the future for other resources such as images, CSS and Javascript. | |
In practice, caching ‘forever’ typically means setting an Expires header value of Sun, 17-Jan-2038 19:14:07 GMT since that’s the maximum value supported by the 32 bit Unix time/date format. If you’re using IIS6 you’ll find that the UI won’t allow anything beyond 31-Dec-2035. | |
Use Cache-Control: no-cache for dynamic HTML pages | |
Use the Last-Modified header with the current file time for static HTML | |
For all other file types set an Expires header to the maximum future date your web server will allow | |
"All HTTP date/time stamps MUST be represented in Greenwich Mean Time (GMT), without exception." |
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
class Memoize1[-T, +R](f: T => R) extends (T => R) { | |
import scala.collection.mutable | |
private[this] val vals = mutable.Map.empty[T, R] | |
def apply(x: T): R = { | |
if (vals.contains(x)) { | |
vals(x) | |
} | |
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
trait A { | |
println("constructing A") | |
val a = { | |
val x = value | |
println(s"calculating A.a = $x") | |
x | |
} | |
def value = { | |
println("A.value called") | |
0 |
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
package scalaz_memo_example | |
import scala.util.control.Exception.allCatch | |
import scalaz._ | |
import Scalaz._ | |
object Main{ | |
def timer[T](f : => T):T = { | |
val start = System.currentTimeMillis |
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
-Dscalac.patmat.analysisBudget=off -Duser.timezone=UTC -Xmx2g -XX:MaxPermSize=256m -XX:ReservedCodeCacheSize=512m -Xss2m -noverify -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5007 |
OlderNewer