Skip to content

Instantly share code, notes, and snippets.

View aibrahim's full-sized avatar

Abdullah Mansour aibrahim

View GitHub Profile
(:require [clojure.core.async :as a
:refer [>! <! >!! <!! go chan buffer close! thread alts! alts!! timeout]])
(def URLS ["https://www.haskell.org"
"https://www.amazon.com"
"https://www.youtube.com"])
(defn time-now []
(. System (nanoTime)))
(ns demo.core
(:require [reagent.core :as reagent]))
(defn my-date-input []
(let [input-el (atom nil)]
(reagent/create-class
{:component-did-mount #(.dateDropper (js/$ @input-el))
:reagent-render (fn []
[:input {:ref #(reset! input-el %) :type "text"}])})))
##project.clj
[edu.stanford.nlp/stanford-corenlp "3.9.1"]
[edu.stanford.nlp/stanford-corenlp "3.9.1" :classifier "models"]
[edu.stanford.nlp/stanford-parser "3.9.1"]
[edu.stanford.nlp/stanford-parser "3.9.1" :classifier "models"]
##ns
(:import [edu.stanford.nlp.parser.lexparser LexicalizedParser])
##error
(defn fast-fib [n]
(if (== n 0)
[0, 1]
(let [[a, b] (fast-fib (/ n 2))
c (* a (- (* b 2) a))
d (+ (* a a) (* b b))]
(if (zero? (mod n 2))
[c, d]
[d, (+ c d)]))))
##foo.clj
(def one 1)
(def two 2)
(def three 3)
(def numbers '(one two three))
##core.clj
(:use test.foo)
A special religious service is being held in the German town of Wittenberg to mark the 500th anniversary of the Reformation.
On this day in 1517, Martin Luther is said to have nailed 95 theses to the door of All Saints' Church in the town.
The theologian said Christians could not buy or earn their way into heaven but only enter by the grace of God.
His criticism led to a split with the Roman Catholic Church and the birth of Protestantism.
The Reformation caused lasting change in Europe, leading to wars and persecution, but also to greater freedom of religion and expression.
Here are four things to know about Tuesday's events:
Storm in southern Germany
@aibrahim
aibrahim / sieve
Last active October 24, 2017 14:34
(require '[clojure.core.async :as a :refer [>! <! >!! <!! go chan buffer close! thread alts! alts!! timeout]])
(defn remove-multipliers [n l]
(filter (fn [x] ((comp not zero?) (mod x n))) l))
(def odds (rest (filter odd? (range 100000))))
(def N (count odds))
(def channels (mapv (fn [x] (chan)) (range N)))
(mapv (fn [c1 c2 x] (go (>! c2 (let [pass (<! c1)
import math
#seq_length = 1 #len(base_series)
inputs = numpy.arange(0,100,0.1)
seq_length = len(inputs)
#def unit(index): return [1.0 if i == index else 0.0 for i in range(seq_length)]
def create_ds(a):
X, Y = [], []
for i in range(0, len(a), 1):
Hydroflurocarbons (HFCs) are widely used in fridges, air conditioning and aerosol sprays.
Delegates meeting in Rwanda accepted a complex amendment to the Montreal Protocol that will see richer countries cut back their HFC use from 2019.
But some critics say the compromise may have less impact than expected.
Three-way deal
US Secretary of State John Kerry, who helped forge the deal in a series of meetings in the Rwandan capital, said it was a major victory for the Earth.
"It's a monumental step forward, that addresses the needs of individual nations but it will give us the opportunity to reduce the warming of the planet by an entire half a degree centigrade," he told BBC News.