Skip to content

Instantly share code, notes, and snippets.

Does it have sugar?
'Yes, this product has organic low-glycemic coconut palm sugar.'
what size mattress will it fit?
The Exclusivo Mezcla Waffle Textured Extra Large Fleece Blanket is a 50x70 inch throw blanket that can fit a mattress size of up to queen.'
Ninja Fryer
can I broil a burger?
'Yes, you can broil a burger in the Ninja AF101 Air Fryer.’
is there plastic inside?
No, the Ninja AF101 Air Fryer does not have any plastic inside.
@aria42
aria42 / conditional_features.py
Last active October 13, 2019 19:58
conditional_features.py
import pandas as pd
def build_conditional_features(df, cond_series, feat_cols=None):
"""
return a new dataframe with conditional features
"""
if len(cond_series) != len(df):
raise Exception("Condition series isn't same num rows as features")
if feat_cols is None:
aria42$ java -cp target/flare-0.1.0-SNAPSHOT-standalone.jar flare.examples.sentence_classification -n 8000 --train-file data/sentiment-train10k.txt --test-file data/sentiment-test10k.txt --embed-file data/glove.6B.300d.txt
WARNING: any? already refers to: #'clojure.core/any? in namespace: vertigo.core, being replaced by: #'vertigo.core/any?
{:train-file data/sentiment-train10k.txt, :test-file data/sentiment-test10k.txt, :embed-file data/glove.6B.300d.txt, :num-classes 2, :emb-size 300, :model-type :bilstm, :lstm-size 25, :num-data 8000}
Params ([lstm/input->gates/b [200]] [hidden->logits/W [2 50]] [lstm/input->gates/W [200 650]] [hidden->logits/b [2]])
Total # params 130302
Optimizing with flare.optimize.Adadelta
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Iteration 0
Caused by: java.lang.RuntimeException: No such var: api/es, compiling:(uncomplicate/neanderthal/linalg.clj:642:6)
at clojure.lang.Compiler.analyze(Compiler.java:6688)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3766)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6870)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$IfExpr$Parser.parse(Compiler.java:2797)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
D 17:09:06.2180230 ZoneChangeList.ProcessChanges() - id=10 local=False [name=Doomguard id=8 zone=HAND zonePos=0 cardId=EX1_310 player=1] zone from FRIENDLY DECK -> FRIENDLY HAND
D 17:09:06.2187700 ZoneChangeList.ProcessChanges() - processing index=1 change=powerTask=[power=[type=TAG_CHANGE entity=[id=8 cardId=EX1_310 name=Doomguard] tag=ZONE_POSITION value=4] complete=False] entity=[name=Doomguard id=8 zone=HAND zonePos=0 cardId=EX1_310 player=1] srcZoneTag=INVALID srcPos= dstZoneTag=INVALID dstPos=4
D 17:09:06.2187930 ZoneChangeList.ProcessChanges() - START waiting for [name=Doomguard id=8 zone=HAND zonePos=0 cardId=EX1_310 player=1] to load (powerTask=(not null))
D 17:09:06.2400590 ZoneChangeList.ProcessChanges() - END waiting for [name=Doomguard id=8 zone=HAND zonePos=0 cardId=EX1_310 player=1] to load (powerTask=(not null))
D 17:09:06.2401110 ZoneChangeList.ProcessChanges() - id=10 local=False [name=Doomguard id=8 zone=HAND zonePos=4 cardId=EX1_310 player=1] pos from 0 -> 4
D 17:09:06.2401530 ZoneChangeLi
(ns speed-test.core
;; Original Java Source
(:import LCS))
(set! *warn-on-reflection* true)
(defn time-it [num-trials f]
(loop [sum-ms 0 trials-left num-trials]
(let [start (System/currentTimeMillis)]
(f)
(defn example [datum]
[:li [:a {:href (str "#show/" (:key datum))}
[:div.class1.class2 {:id (str "item" (:key datum))}
[:span.anchor (:name datum)]]]])
(defn with-cdn [cdn-url form]
(clojure.walk/postwalk
(fn [node]
(if (rel-asset-path? node)
(cdn-url node)
node)
form)))