View gist:297421
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 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)))) |
View gist:297541
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
package com.itransition.training.beloglazov.hexarray; | |
import java.util.Arrays; | |
/** | |
* @author Nikita Beloglazov | |
* | |
*/ | |
public class HexArray { |
View gist:300791
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
import java.io.*; | |
public class Solution { | |
private class Node { | |
private Node left; | |
private Node right; | |
private int distLeft; | |
private int distRight; | |
private int distTop; |
View Task1
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
(reduce + | |
(filter #(or (zero? (rem % 3)) | |
(zero? (rem % 5))) | |
(range 1 1000))) |
View gist:314954
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
import java.util.*; | |
import java.io.*; | |
import javax.swing.*; | |
import java.awt.*; | |
import java.awt.event.*; | |
public class Application extends JFrame { | |
private enum AlgoState { |
View gist:314955
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
import java.io.*; | |
import java.util.*; | |
import java.io.*; | |
import java.util.List; | |
import java.util.Scanner; | |
public class Solution { | |
public class Node { |
View gist:314957
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
import java.io.*; | |
import java.util.*; | |
import java.io.*; | |
import java.util.List; | |
import java.util.Scanner; | |
public class Solution { | |
public class Node { |
View gist:359028
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
#include <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <deque> | |
using namespace std; | |
enum Color | |
{ | |
BLACK, WHITE, NONE | |
}; |
View gist:411000
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
#include <iostream> | |
#include <vector> | |
#include <cmath> | |
#include <stdio.h> | |
#include <deque> | |
using namespace std; | |
const int INF = (1 << 31) - 1; |
View gist:489845
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 quiz-1 | |
(:import (java.text SimpleDateFormat ParsePosition) | |
(java.io File)) | |
(:use [clojure.contrib.duck-streams :only (read-lines)])) | |
(def *my-email* "me@mydomain.com") | |
(defn- get-id [f] | |
(bigint (.getName f))) |
OlderNewer