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
public class IcalParser { | |
public static void main(String [] args) throws IOException { | |
String [] subjectCode = new String [30]; | |
String [] aineNimi = new String [30]; | |
String [] attendingGroups = new String [30]; | |
String [] classTypes = new String [30]; | |
String [] startTimestamp = new String [30]; | |
String [] endTimestamp = new String [30]; | |
String [] classRooms = new String [30]; |
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
;;Draws some cube with point in positions :a :b :c and :c in 3d space. | |
(draw-cube {:a [10 10] :b [-10 -10] :c [10 -10] :d [-10 10]}) | |
(defn draw-tower [nr-of-blocks] | |
"Draws nr-of-blocks of cubes in some correlation with eachother in 3d space." | |
(repeat nr-of-block (draw-cube {{:a [(+ 10 10)] :b [(+ -10 -10)] :c [(+ 10 -10)] :d [(+ -10 10) (+ 10 10)}})) |
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 chat-server.echo-server | |
(:import (java.net Socket ServerSocket) | |
(java.io DataInputStream PrintStream))) | |
(defn run-echo-server [] | |
(let [echo-server (ServerSocket. 8887) | |
client-socket (.accept echo-server) | |
in (DataInputStream. (.getInputStream client-socket)) | |
out (PrintStream. (.getOutputStream client-socket))] | |
(while true |
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
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; | |
height: 100%; |
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 binary-clock) | |
(defn split-into-digits [time] | |
[(quot time 10) | |
(mod time 10)]) | |
(defn get-time [] | |
(let [dt (new java.util.Date) | |
digits (apply concat (map split-into-digits | |
[(.getHours dt) (.getMinutes dt) (.getSeconds dt)]))] |
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
(def roads '((12 41) (12 57) (41 22) (41 4) (53 41) (49 22) (57 75) (22 96) (4 66) (96 31) (96 76) (94 96) | |
(61 66) (28 94) (61 60) (50 60) (60 7) (28 91) (28 51) (60 79) (7 30) (30 24) (27 79) (30 65) | |
(30 97) (27 84) (97 2) (56 2) (14 56) (14 86) (86 23) (14 44) (70 44) (23 43) (43 90) (70 32) | |
(43 54) (82 54) (90 81) (83 82) (82 67) (83 46) (72 82) (100 67) (100 71) (26 72) (72 36) (36 64) | |
(71 89) (36 25) (26 20) (80 89) (64 48) (63 25) (11 48) (87 20) (80 1) (1 19) (1 21) (37 87) (37 69) | |
(19 5) (37 33) (69 10) (45 33) (35 33) (40 10) (13 45) (6 13) (15 40) (85 6) (6 47) (13 8) (47 98) (99 85) | |
(16 47) (88 98) (88 9) (55 99) (99 92) (9 93) (77 93) (59 55) (62 93) (18 77) (18 39) (18 73) (38 62) (58 73) | |
(95 73) (73 42) (34 95) (52 34) (34 74) (3 52) (3 68) (17 52) (74 29) (78 29) (29 1))) | |
(defn in? [seq el] |
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 break-time-slider [] | |
(let [init-value @settings/break-time] | |
[:p {:class "range-field"} | |
[:label {:for "break-time"} | |
(string/replace "Break time (% min)" #"%" @settings/break-time)] | |
[:input {:type "range" | |
:id "break-time" | |
:min "1" | |
:max "60" | |
;; How do I disable this input? |
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
;;cljs-ajax POST | |
(defn handler [[ok response]] | |
(.log js/console "Client handling response!") | |
(if ok | |
(.log js/console (str "Response: " response)) | |
(.error js/console (str "Errora: " response)))) | |
(defn send-msg [data] | |
(.log js/console "Client sending request!") |
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
def inc(x): | |
return x + 1 | |
def pipe(val, *args): | |
for func in args: | |
val = func(val) | |
return val | |
pipe(1, inc, inc, inc) |
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
//Basic math | |
import java.lang.Math; | |
//Collections | |
import java.util.*; | |
public class Main { | |
public static void main(String[] args) { |
OlderNewer