This file contains hidden or 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
val people = | |
List(Person("Emre", List(Residence("Antwerp", "BE"))), | |
Person("Berk", List(Residence("Antwerp", "BE"))), | |
Person("Ergin", List(Residence("Istanbul", "TR"), | |
Residence("Ankara", "TR"))), | |
Person("Ahmet", List(Residence("Istanbul", "TR")))) |
This file contains hidden or 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
echo "You have, with high probability, at most" $(for age in {32..122}; do factor $age | cut -d' ' -f3 | grep -v "[0-9]\+"; done | wc -l) "prime birthdays left." |
This file contains hidden or 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 com.manning.gwtia.ch02.client; | |
import com.google.gwt.core.client.EntryPoint; | |
import com.google.gwt.user.client.ui.Label; | |
import com.google.gwt.user.client.ui.RootPanel; | |
public class HelloWorld implements EntryPoint { | |
@Override | |
public void onModuleLoad() { |
This file contains hidden or 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
find ~/dev -regextype posix-egrep -iregex ".*(java|xml)" -print0 | xargs -0 -I sourceFile sed '/^[ \t]*$/d' sourceFile | wc -l |
This file contains hidden or 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
.PS | |
box rad 0.15 | |
move down | |
move right | |
box rad 0.15 | |
spline <-> from 1st box .e right then down left to last box .w |
This file contains hidden or 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
.PS | |
box rad 0.15 | |
move down | |
move right | |
box rad 0.15 | |
spline <-> from 1st box .e right then down left to last box .w | |
.PE |
This file contains hidden or 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
## textbook.R | |
## Tested on: | |
## R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" | |
library(ggplot2) | |
library(car) | |
setwd("~/Documents/programming/R/") | |
textbook <- read.csv("textbook.csv", na.strings = "") |
This file contains hidden or 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 | |
grep -q closed /proc/acpi/button/lid/*/state | |
if [ $? = 0 ] | |
then | |
dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend | |
fi |
This file contains hidden or 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 xml.XML | |
object ProcessBlog extends App { | |
val myBlog = XML.loadFile("fzblogs.wordpress.2013-02-08.xml") | |
for (item <- (myBlog \\ "item")) { | |
val indexOfGist = item.text.indexOf("//gist") | |
if (indexOfGist > 0) { | |
println((item \\ "guid").text + " " + |
This file contains hidden or 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 | |
# Prints information about the Java threads that consumes most of the CPU | |
# Derived from the information given in the blog entry at | |
# | |
# http://nurkiewicz.blogspot.be/2012/08/which-java-thread-consumes-my-cpu.html | |
# | |
# Changelog: | |
# | |
# - Removed the `top', `perl', and `grep' dependencies. |