Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
name: history | |
channels: | |
- defaults | |
dependencies: | |
- conda | |
- python=3.7 | |
- conda-env | |
- conda-build | |
- conda-verify | |
- anaconda-navigator |
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 NestedIfs { | |
public static int run(int a, int b){ | |
int res= 0; | |
if( (a-b) == 0){ | |
int c= a+b; | |
if(c != 0){ | |
c= 5; | |
}else{ | |
c= 2; | |
} |
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 static GeoPoint[] read(String vUrl, String eUrl)throws IOException { | |
List<GeoPoint> res= new SingleLinkedList<GeoPoint>(); | |
try(BufferedReader vBr = new BufferedReader(new InputStreamReader(new URL(vUrl).openStream())); | |
BufferedReader eBr = new BufferedReader(new InputStreamReader(new URL(eUrl).openStream()))) { | |
for(String line= vBr.readLine(); line != null; line= vBr.readLine()){ | |
String[] coords= line.split(" ");//latitude, longitude | |
res.add(new GeoPoint(Double.parseDouble(coords[0]), Double.parseDouble(coords[1]))); | |
} | |
for(String line= eBr.readLine(); line != null; line= eBr.readLine()){ | |
String[] data= line.split(" ");//start end nbDirs Duration Length |
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 fib-seq | |
(lazy-cat [0 1] (map + (rest fib-seq) fib-seq))) | |
(def primes (lazy-cat [2] (filter (fn[candidate] | |
(not-any? #(zero? (mod candidate %1)) | |
(take-while (partial > (Math/sqrt candidate)) | |
primes))) | |
(iterate (partial + 2) 3)))) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 sizes[k n] | |
(condp = k | |
n #{(vec (repeat k 1))} | |
1 #{[n]} | |
(reduce (fn [res s0] | |
(reduce #(conj % (sort (conj %2 s0))) | |
res | |
(sizes (dec k) (- n s0)))) | |
#{} | |
(take (- n k)(iterate inc 1))))) |
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 <tuple> | |
#include <cmath> | |
#include <cstdlib> | |
#include <vector> | |
/* | |
STEPS=100; | |
PREFIX=chaos-game-frame-${STEPS} | |
for i in $(seq $((3 * $STEPS)) $((8 * $STEPS))); do | |
./chaos-game-double $(bc -l <<< "scale=2;$i / $STEPS") | convert pgm:- ${PREFIX}-$i.png; |
NewerOlder