Skip to content

Instantly share code, notes, and snippets.

View jjhop's full-sized avatar
🗿
Big Heeaaddd!!!

Rafał Kotusiewicz jjhop

🗿
Big Heeaaddd!!!
  • buzzlers.com
  • Skarzysko-Kamienna/Poland
View GitHub Profile
Set<String> calledMethods = new Hashset<>()
new File(baseDir,"haiku.txt").withReader { reader ->
while (reader.readLine()) {
if (line.contains(') >>>>')) {
String[] splittedLine = line.split('>>>>', 2)
String l = splittedLine[0]
String rest = l.substring(l.indexOf('#'))
calledMethods.add(rest)

Keybase proof

I hereby claim:

  • I am jjhop on github.
  • I am jjhop (https://keybase.io/jjhop) on keybase.
  • I have a public key ASDVxYzT0l5h29T2Bx6z-Oogxb4ZfuY9HmC8hULhIm2-owo

To claim this, I am signing this object:

(require '[clojure.string :as str])
(defn parse-digits [input]
(->>
(str/split input #"")
(map #(.charAt % 0))
(filter #(Character/isDigit %))
(map #(Character/digit % 10))
(apply str)))
(cl:defpackage jjhop.util
(:export generate-password))
(defparameter *chars* '("a" "b" "c" "d" "e" "f" "g" "h" "i" "j"
"k" "m" "n" "o" "p" "q" "r" "s" "t" "u"
"v" "w" "x" "y" "z" "A" "B" "C" "D" "E"
"F" "G" "H" "J" "K" "L" "M" "N" "P" "Q"
"R" "S" "T" "U" "V" "W" "X" "Y" "Z" "2"
"3" "4" "5" "6" "7" "8" "9" "@" "#" "$"))
(defparameter *chars-length* (length *chars*))
(import '(java.util Date Calendar)
'(java.text SimpleDateFormat))
(defn yesterday-start-as-string []
"Returns the beginning of yesterday as a formatted string.
For example 2015-12-21 00:00:00 - hours, minutes and seconds are
always zeros."
(let [dt (.getTime (doto (Calendar/getInstance)
(.setTime (Date.))
(.set Calendar/HOUR_OF_DAY 0)
class InputDataWorkerSpecification extends Specification {
def "InputDataWorker#onMessage should consume message when dataDAO works properly"() {
given:
def dataDao = Mock(DataDAO.class)
def message = Mock(Message.class)
message.getBody() >> '528.;21.033333;d5252ccd-4312-473e-a974-65e707fa432f'
message.getMessageProperties() >> { new MessageProperties() {{
setDeliveryTag(Long.MAX_VALUE)
}}}
(ns game)
(defn- guess
[current-min current-max n]
(let [mid (int (/ (+ current-min current-max) 2))
res (do
(println (str "Czy twoja liczba to: " mid))
(read-line))]
(cond
(.equals res "<") (guess current-min mid (inc n))
(def upper-left '(0,0))
(def lower-right '(5,5))
(defn calculate-area [ul, lr]
(let [width (- (nth lr 0) (nth ul 0))
height (- (nth lr 1) (nth ul 1))]
(* width height)))
package imbir;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.Date;
defmodule GuessingGame do
def start do
IO.puts("Pomyśl liczbę (z przedziału 1 do 100), gdy będziesz gótów/gotowa wciśnij [ENTER].")
IO.read(:stdio, :line)
IO.puts("Będę zgadywał a Ty wciśnij
< - jeśli Twoja liczba jest mniejsza oraz
> - jeśli jest większa, od podanej przeze mnie,
= - jeśli zgadłem
i cokolwiek innego, gdy masz już dość :)")