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 model; | |
import java.util.HashSet; | |
import java.util.Set; | |
/* the documentation did not specify how an album should handle duplicates so I | |
* adopted the iPhoto idea of completely ignoring duplicates. Hence the use of | |
* the Set Collection, rather than i.e. list. | |
* | |
* This method follows the main idea that you shouldn't write methods that you |
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.karlherler.crypto | |
import com.karlherler.crypto.javax.des.DES | |
class DESHash(msg: Array[Byte]) { | |
private val h0 = Array(0x01.toByte, 0x23.toByte, 0x45.toByte, | |
0x67.toByte, 0x89.toByte, 0xab.toByte, |
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.RuntimeException | |
import java.io._ | |
import scala.io.Source | |
class GenCaesar(cipher: Array[Byte]) { | |
def brute(b: Array[Byte]): IndexedSeq[(Int, Array[Byte])] = | |
(0 to 255).map { | |
i => (i, (b.map(decrypt(_, i)))) | |
} |
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
TrID/32 - File Identifier v2.10 - (C) 2003-11 By M.Pontello | |
Definitions found: 4540 | |
Analyzing... | |
File: decrypted\0.dat | |
50.0% (.JPG) JFIF JPEG Bitmap (4003/3) | |
File: decrypted\1.dat | |
Unknown! |
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.util.Calendar | |
import java.util.GregorianCalendar | |
val d = new GregorianCalendar(TimeZone.getTimeZone("Europe/Helsinki")) | |
d.set(Calendar.HOUR, 10) | |
val expiry = ((d.getTimeInMillis-System.currentTimeMillis)/1000L).toInt | |
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
// NOTE: I removed the seq(webSettings :_*) since it generates an error in this (also this comment doesn't exist in the file) | |
organization := "com.example" | |
name := "scalatra-sbt-prototype" | |
version := "0.1.0-SNAPSHOT" | |
scalaVersion := "2.9.1" |
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
Karls-MacBook-Air:helloworld kalle$ g8 --list | |
Getting net.java.dev.jna jna 3.2.3 ... | |
:: retrieving :: org.scala-tools.sbt#boot-app | |
confs: [default] | |
1 artifacts copied, 0 already retrieved (838kB/23ms) | |
Getting Scala 2.9.1 (for giter8)... | |
downloading http://scala-tools.org/repo-releases/org/scala-lang/scala-compiler/2.9.1/scala-compiler-2.9.1.jar ... | |
[SUCCESSFUL ] org.scala-lang#scala-compiler;2.9.1!scala-compiler.jar (40184ms) | |
downloading http://scala-tools.org/repo-releases/org/scala-lang/scala-library/2.9.1/scala-library-2.9.1.jar ... | |
[SUCCESSFUL ] org.scala-lang#scala-library;2.9.1!scala-library.jar (30302ms) |
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
# Fibonacci numbers module | |
print "I am imported!" | |
def printMe(): | |
print "From a.py" | |
# IGNORE, just some test methods | |
def fib(n): # write Fibonacci series up to n | |
a, b = 0, 1 |
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
#include <stdio.h> | |
int bitmap[20480]; | |
int myalloc(int blocksize) { | |
int i=0; //counter | |
int x=0; //done | |
int z=0; //potential spot | |
while (x==0) { | |
if(i<20480) { //we're still in a valid range |
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
[ | |
{ | |
id: 3065, | |
name: { fi-fi: "Käsisaippua (sininen)", et-ee: "Käteseep (sinine)", sv-se: "Handtvål (blå)", sv-fi: "Handtvål (blå)" }, | |
price:{ fi-fi: "4,40 €", et-ee:"4,40 €", sv-se: "43,00 kr", sv-fi: "4,40 €"}, | |
tags: ["hands", "wash", "designs"], | |
color: "blue", | |
height: 10, | |
space: 2, | |
}, |