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.Objects; | |
import java.util.concurrent.Callable; | |
import java.util.concurrent.TimeUnit; | |
import java.util.function.Predicate; | |
class Builder<T> { | |
private TimeUnit timeUnit; | |
private long period; | |
private int attempts; | |
private Callable<T> task; |
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 org.neo4j.graphdb.GraphDatabaseService; | |
import org.neo4j.graphdb.Label; | |
import org.neo4j.graphdb.Node; | |
import org.neo4j.graphdb.Transaction; | |
import org.neo4j.graphdb.factory.GraphDatabaseFactory; | |
import org.neo4j.io.fs.FileUtils; | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.Iterator; |
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 sun.jvm.hotspot.utilities.Bits; | |
import java.util.Arrays; | |
import java.util.stream.IntStream; | |
/** | |
* @author tk.roman | |
*/ | |
public class Heys { | |
// N ^ 2 = 16 => use ints |
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 <fstream> | |
#include <iostream> | |
#include <vector> | |
using namespace std; | |
const char* A = "A.txt"; | |
const char* B = "B.txt"; | |
vector<int> fillVector(const char*); |
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 <fstream> | |
#include <iostream> | |
#include <vector> | |
using namespace std; | |
const char* A = "A.txt"; | |
const char* B = "B.txt"; | |
vector<int> fillVector(const char*); |
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
require 'mathn' | |
size = gets.chomp.to_i | |
$array = Array.new(size) { |iarray| iarray = Array.new(size) { |j| j = gets.chomp.to_i } } | |
m = Matrix.rows($array) | |
puts m.det |
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
;; scheme code: | |
(define (partial-tree elts n) | |
(if (= n 0) | |
(cons '() elts) | |
(let ((left-size (quotient (- n 1) 2))) | |
(let ((left-result (partial-tree elts left-size))) | |
(let ((left-tree (car left-result)) | |
(non-left-elts (cdr left-result)) | |
(right-size (- n (+ left-size 1)))) | |
(let ((this-entry (car non-left-elts)) |
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
require 'net/http' | |
require 'nokogiri' | |
require 'Qt' | |
APPID = "QV4WQY-RYGTU7UPH2" | |
WADDR = 'http://api.wolframalpha.com/v2/query' | |
def queryWA(qry) | |
uri = URI(WADDR) | |
res = Net::HTTP.post_form(uri, 'input' => qry, 'appid' => APPID) |
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 "stl_queue.hpp" | |
STLQueue::STLQueue() { | |
queue = new deque<double>; | |
} | |
void STLQueue::push(const double n) { | |
queue->push_back(n); | |
} |
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
/* | |
* Licensed to the Apache Software Foundation (ASF) under one or more | |
* contributor license agreements. See the NOTICE file distributed with | |
* this work for additional information regarding copyright ownership. | |
* The ASF licenses this file to You under the Apache License, Version 2.0 | |
* (the "License"); you may not use this file except in compliance with | |
* the License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* |