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 java.io.*; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
/** | |
* Created with IntelliJ IDEA. | |
* | |
* @author M. Akkerman |
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
private static void copy(BufferedReader reader, PrintWriter writer) { | |
String line; | |
while ((line = reader.readLine()) != null) { | |
writer.println(line); | |
} | |
} |
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
<project name="myProject" default="generate"> | |
<property name="outputFile" location="outputFile.htm"/> | |
<property name="fileName" value=""/> | |
<property name="relativeFileName" value=""/> | |
<property name="target" value="${basedir}"/> | |
<taskdef resource="net/sf/antcontrib/antlib.xml"> | |
<classpath> | |
<pathelement location="ant-contrib.jar"/> | |
</classpath> |
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 java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
public class CopyUtil { | |
public static void copy(Object src, Object dst) { | |
try { | |
for (Method getter : src.getClass().getDeclaredMethods()) { | |
final String getterName = getter.getName(); | |
if (!getterName.startsWith("get") || getter.getReturnType() == void.class) | |
continue; |
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 math | |
def is_prime(n): | |
if (n == 2): | |
return True | |
if (n == 1 or n % 2 == 0): | |
return False | |
square = int(math.ceil(math.sqrt(abs(n)))) + 1 | |
i = 3 | |
while i <= square: |
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
class Voertuig(object): | |
def __init__(self,naam,snelheid): | |
self.naam = naam | |
self.snelheid = snelheid | |
class Auto(Voertuig): | |
def __init__(self,naam,snelheid): | |
super(Auto,self).__init__(naam,snelheid) | |
def rijden(self): | |
print self.naam, "lekker stukje rijden" |
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
class Voertuig(val naam:String, var snelheid:Int = 0) { } | |
trait Auto extends Voertuig { | |
def rijden() { | |
println( "Ik rij in mijn " + naam) | |
} | |
} | |
trait Boot extends Voertuig { | |
def varen() { |
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
Object.prototype.mixin = (aClass) -> | |
for key, value of aClass | |
@[key] = value | |
for key, value of aClass.prototype | |
@::[key] = value | |
@ | |
class Voertuig | |
constructor: (@naam, @snelheid=0)-> |
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 -ef | grep -v grep | grep -i --color=auto $@ |
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
sudo hdparm -I `sudo fdisk -l | grep Disk\ / | awk '{print $2}' | sed -e 's/.$//' ` | grep --c |
OlderNewer