Skip to content

Instantly share code, notes, and snippets.

View sarcilav's full-sized avatar

Sebastian Arcila Valenzuela sarcilav

View GitHub Profile
def steps(n, m)
d = n - m
ans = d/5
d = d%5
ans += d/2
d = d%2
ans + d
end
t = gets.to_i
(ns Player
(:gen-class))
; Auto-generated code below aims at helping you parse
; the standard input according to the problem statement.
(def tick (atom 0))
(def distance-stress 11)
(defn log [& args]
(binding [*out* *err*]
(defn permutations [s]
(lazy-seq
(if (seq (rest s))
(apply concat (for [x s]
(map #(cons x %) (permutations (remove #{x} s)))))
[s])))
(defn cost [proposoals s]
{:permutation s
:cost (apply + (map-indexed (fn [project candidate-str]
#include <WiFi.h>
#include <WiFiClient.h>
#include <WiFiServer.h>
#include <WiFiUdp.h>
#include <SPI.h>
char ssid[] = "NULL_INDUS"; // your network SSID (name)
char pass[] = "90046686"; // your network password
(let [ex-agent (agent {:user_id 1 :user_email "s@gmail.com"})
fn-agent (fn [{id :user_id email :user_email}]
(println "staring super heavy IO task")
(Thread/sleep 10000)
(println "email send to" email))]
(println "sending task to agent")
(send-off ex-agent fn-agent)
(println "end let"))
(defn subseq? [s l]
"subseq? returns true if you can transform l by only removing elements into s"
(if (empty? l)
(empty? s)
(if (= (first l) (first s))
(recur (rest s) (rest l))
(recur s (rest l)))))
(defn preffix [& args]
(map first (take-while (partial apply =) (apply map vector args))))
(defn suffix-with-p [s p]
(drop (count p) s))
(defn nice-print [col]
(println (count col) (apply str col)))
(defn *nice-print [& args]
function pulls2 {
bopen=0
while getopts ":o" Option
do
case $Option in
o ) bopen=1 ;;
esac
done
echo $bopen
if [ $bopen -eq 1 ]; then
curl -v http://quiet-journey-7568.herokuapp.com/registers.json -X POST -H "Content-Type: application/json" -d '{"lng": "-32.323", "lat": "114.133111", "imei": "loa0"}'
* Adding handle: conn: 0x7fe4ab803a00
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7fe4ab803a00) send_pipe: 1, recv_pipe: 0
* About to connect() to quiet-journey-7568.herokuapp.com port 80 (#0)
* Trying 23.23.214.121...
* Connected to quiet-journey-7568.herokuapp.com (23.23.214.121) port 80 (#0)
> POST /registers.json HTTP/1.1
@sarcilav
sarcilav / output
Last active December 17, 2015 02:09
#include <stdio.h>
int main()
{
int near_max = (int) ((1LL<<31) - 2);
do {
printf("%d\n", ++near_max);
} while (near_max > 0);
return 0;