Skip to content

Instantly share code, notes, and snippets.

View nbeloglazov's full-sized avatar

Mikita Belahlazau nbeloglazov

View GitHub Profile
(ns mouse-example
(:require [quil.core :as q]))
(def w 1000)
(def h 1000)
(def acc 500)
(let [id (atom 0)]
(defn next-id []
(swap! id inc)))
(ns sandbox.core
(:use [incanter core io charts]))
(use '[incanter core io charts])
(def data (read-dataset "http://xweb.geos.ed.ac.uk/~weather/jcmb_ws/JCMB_2014_Oct.csv" :header true))
(def head-data (head 10 data))
@nbeloglazov
nbeloglazov / instructions.md
Last active August 29, 2015 14:13
Setting up Hatnik to automatically update version in README
  1. Login to http://hatnik.com
  2. Click "Add action".
  3. Enter library.
  4. Change action type to Pull Request.
  5. Enter you repository.
  6. Setup pull request operation: file=README.md, regex={{library}} "[^"]+", replacement={{library}} "{{version}}".
  7. Test pull request if you want to. It will open pull request using "2.3.4" as "new" version for the library. To test pull request use "Test" button.
  8. Click "Create".

Note: Hatnik will not open pull request if version in README is correct, only if you forget to update it next time you do release.

(defn take-potential-divisors [p coll]
"Takes only those number from coll, whose square less or equal than p"
(take-while #(>= p (* % %)) coll))
(defn prime? [p coll]
"Test whether p is prime or not. coll - prime numbers less than p"
(nil? (some #(zero? (rem p %))
(take-potential-divisors p coll))))
(def primes (lazy-cat [2 3]
(filter #(prime? % primes)
(range 5 100))))
package com.itransition.training.beloglazov.hexarray;
import java.util.Arrays;
/**
* @author Nikita Beloglazov
*
*/
public class HexArray {
import java.io.*;
public class Solution {
private class Node {
private Node left;
private Node right;
private int distLeft;
private int distRight;
private int distTop;
(reduce +
(filter #(or (zero? (rem % 3))
(zero? (rem % 5)))
(range 1 1000)))
import java.io.*;
import java.util.*;
import java.io.*;
import java.util.List;
import java.util.Scanner;
public class Solution {
public class Node {
import java.util.*;
import java.io.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Application extends JFrame {
private enum AlgoState {
import java.io.*;
import java.util.*;
import java.io.*;
import java.util.List;
import java.util.Scanner;
public class Solution {
public class Node {