Skip to content

Instantly share code, notes, and snippets.

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)
}
grammar Jdk7Lambdas;
lambda_type
: SHARP return_type LPAREN (arg_list) RPAREN;
arg_list: | arg_type (COMMA arg_type)*;
arg_type: TYPE;
<?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>
(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))))
(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))))
))
<!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>
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) {
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;
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;
#!/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"