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 WicketUtils { | |
class RepeaterWrapper[A](val l : List[A]) { | |
def toRepeater(id : String, f : (A, WebMarkupContainer)=>Any) : RepeatingView = { | |
val rep = new RepeatingView(id) | |
for(a <- l ) { | |
val row = new WebMarkupContainer(rep.newChildId) | |
rep.add(row) | |
f(a, row) | |
} |
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
grammar Jdk7Lambdas; | |
lambda_type | |
: SHARP return_type LPAREN (arg_list) RPAREN; | |
arg_list: | arg_type (COMMA arg_type)*; | |
arg_type: TYPE; |
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
<?xml version="1.0" encoding="UTF-8" ?> | |
<root> | |
<div thid="d"> | |
<span style="color: aqua;" thid="s">hello world</span> | |
</div> | |
<h1 thid="invisible">title</h1> | |
</root> |
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
(ns s99) | |
(defn last-99 "P01" [l] | |
(reduce #(do %2) l)) | |
(last-99 '(1 3 5 6)) | |
(defn penultimate "P02" [l] | |
(first (rest (reverse l)))) |
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
(defn permutations "P26" [n xs] | |
(if (= 1 n) | |
(map list xs) | |
(reduce #(let [s (split-at (inc %2) xs) | |
ps (permutations (dec n) (last s)) | |
a (last (first s))] | |
(concat %1 (map (fn [p] (cons a p)) ps ))) | |
'() (range 0 (inc (- (count xs) n)))) | |
)) |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>Insert title here</title> | |
</head> | |
<body> | |
<ul id="list"> | |
<li>Oh hai !</li> | |
</ul> |
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
Collection<Link> links = Link.select(); | |
e.register("ul#content > li", new Repeater<Link>( | |
new SimpleValue<Iterable<Link>>(links)), new SubTemplator() | |
.register("ul.tags li", new Repeater<String>( | |
new TransformValue<Iterable<String>, Link>( | |
new ElementDataValue<Link>()) { | |
@Override | |
protected Iterable<String> transform(Link s) { |
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 jawher.moulder.examples; | |
import static jawher.moulder.moulds.Moulds.*; | |
import java.util.Arrays; | |
import org.jsoup.Jsoup; | |
import org.jsoup.nodes.Document; | |
import org.junit.Before; | |
import org.junit.Test; |
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 jawher.moulder.examples; | |
import static jawher.moulder.moulds.Moulds.*; | |
import java.util.Arrays; | |
import org.jsoup.Jsoup; | |
import org.jsoup.nodes.Document; | |
import org.junit.Before; | |
import org.junit.Test; |
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
#!/bin/bash | |
PID=`ps x | grep libflashplayer.so | grep -v grep | awk '{print $1}'` | |
FD=`lsof -p $PID | grep Flash | awk '{print $4}' | sed 's/u$//'` | |
while IFS=' ' read -ra ADDR; do | |
for x in "${ADDR[@]}"; do | |
echo "cp /proc/$PID/fd/$x ~" | |
done | |
done <<< "$FD" |
OlderNewer