#clojure logs

2016-05-17

01:30ilevdHow I can setup timbre to print exceptions?
01:31dysfunit doesn't "print exceptions", but you can log an exception object you have caught
01:31ilevdAnd uncaught exceptions?
01:34ilevdHm, it seems I need to set stdout, stderr to file to do this
01:35dysfunyou can register a global uncaught exception handler
01:35dysfunand log it
01:38ilevdThanks, I think it's what I need
01:39dysfunbut you really should try and catch exceptions in your code
01:43ilevdI know, now I need quickly find an existing error
01:43dysfunah :)
03:11ilevdErrors in pmap aren't caught by setDefaultUncaughtExceptionHandler -_-
03:12dysfunanother reason not to use pmap
03:13ilevdOr i forgot to use doall..
04:00ilevdI do (future (try ... (catch Exception e (log e))), but message isn't infromative: java.util.concurrent.ExecutionException: java.lang.NullPointerException
04:00ilevdAny ideas?
04:01dysfunnullpointerexception means you've tried to call something as a function and it was null, or a function argument to a java function was null
04:02ilevdI expected some stacktrace, maybe line number
04:04amalloyblame whatever that log function is
04:12ilevdI can blame only myself
04:19ilevd.getStackTrace, .getMessage, .getCause return nil or java.lang.NullPointerException
04:53TMAilevd: the java.util.concurrent.ExecutionException wraps java.lang.NullPointerException
04:53TMAilevd: therefore .getCause returns the wrapped java.lang.NullPointerException
04:53TMAilevd: try .getStackTrace and .getMessage on the java.lang.NullPointerException from .getCause
05:40ilevd@(future 10)
05:40ilevd,@(future 10)
05:40clojurebot#error {\n :cause "no threads please"\n :via\n [{:type java.lang.SecurityException\n :message "no threads please"\n :at [clojurebot.sandbox$enable_security_manager$fn__857 invoke "sandbox.clj" 94]}]\n :trace\n [[clojurebot.sandbox$enable_security_manager$fn__857 invoke "sandbox.clj" 94]\n [clojurebot.sandbox.proxy$java.lang.SecurityManager$Door$f500ea40 checkAccess nil -1]\n [java.lang.Threa...
05:50paolo_hey guys, i'm having problems using eval: i can't use clojure.math functions inside the expression to be eval-ed, can anyone help me?
05:57TEttingerclojure.math may need to be required again in the evaled code, but I'm half asleep what am I doing
06:09Guest48if I'm using map to execute a function a bunch of times on a sequence, and my call to map immediately finishes and the function I'm executing does not executed (as the log statement never runs) - what fundamental point is it likely I'm missing? I can log the sequence just before I run the call to map, and it has some elements in it
06:10TMAGuest48: map returns a lazy seq; if you do not force the realization, it will never be realized
06:10Guest48ah so I should (doall (map ... ?
06:11Guest48the behaviour seems different in the repl
06:11TMAGuest48: if you map for the side effects, then yes.
06:11TMAGuest48: because the result is realized for printing out
06:12TMA,(= nil (map println [1 2 3]))
06:12clojurebotfalse
06:12Guest48TMA: thanks loads. I had a feeling there was some fundamental thing I was not grasping
06:12TMAGuest48: see -- if the result is not printed, then it is not realized even in the REPL
06:13TMA,(= nil (doall (map println [1 2 3])))
06:13clojurebot1\n2\n3\nfalse
06:13Guest48oooh
06:13Guest48It is taking me a while to grasp these fundamentals despite an embarrassing amount of time tinkering with clojure
06:14Guest48thanks for your very useful explanation and example
06:14TMAGuest48: it'll just click together sooner or later, keep trying :)
06:14Guest48:) yup will get there in the end!
06:14Guest48yes everything is now exactly working as expected
06:14Guest48thanks!
06:15TMAyou are welcome
10:35sdegutisHow are you?
10:43sdegutisOkay.
10:45fijroWhen evaling a var, you don't have to type out the whole namespace. I type `+` instead of `clojure.core/+`. In my program I need to simulate this behaviour - and would like to know where in the Clojure source code I can study how that works? In what function is the 'full' name of a var completed?
10:46justin_smithfijro: eval uses the bindings of the current namespace to figure out how to resolve a symbol
10:46justin_smithfijro: you don't need to simulate the behaviour, you can call resolve
10:46justin_smith,(resolve '+)
10:46clojurebot#'clojure.core/+
10:47hiredmanfijro: in the compiler if I recall there is a method named resolveSymbol
10:48fijrojustin_smith: thank you, that's great to know. I need to reimplement that function, because ns in my app is a list that begins with a list that begins with a symbol 'ns. Don't know if I have misunderstood clojure, but feels like the ns part of it was not programmed in the clojure way of 'everything is data'...
10:48hiredmanfijro: but you are likely to be more interested in resolve and ns-resolve
10:48justin_smithfijro: ns is a macro, it creates a namespace object
10:48justin_smithfijro: a namespace object owns some hash-maps from symbols to vars
10:49fijrohiredman: justin_smith: great to know. Thank you. The coffeeshop I'm coding in is closing and I've got to get going, but thanks!
11:53sdegutisFound a nice way of saying "(:quantity x) > 1"
11:53sdegutis,(map (comp pos? dec) (range 3))
11:53sdegutisHahahhahaha
11:53clojurebot(false false true)
11:53sdegutisI know it's cheating but totally worth it
11:54dysfunnot (comp pos? dec :quantity) ?
11:54sdegutisYeah that.
11:54sdegutisBut I got lazy and didn't want to make maps.
11:55sdegutisI wonder if there's a shortcut for (comp dec dec)
11:55sdegutisMan, I should make one. Fricken, what is it again? The thing that adds them together.
11:55dysfunyes, but it's longer
11:55sdegutisRepeatedly?
11:55sdegutisiterate?
11:55sdegutisYeah apply iterate repeat dec n
11:55sdegutisor something
11:57sdegutis,((->> dec (repeat 2) (apply comp)) 3)
11:57clojurebot1
11:58sdegutis,(def dec-by #(->> dec (repeat %) (apply comp)))
11:58clojurebot#'sandbox/dec-by
11:58sdegutis,((dec-by 2) 7)
11:58clojurebot5
11:58sdegutisSurely it can be prettier.
12:01sdegutisGranted this is only a stepping stone for pos?
12:01sdegutisSomething like greater-by?
12:03sdegutisOh wait that reads unlogical.
12:03sdegutisAnd that ladies and gentlemen is why I do not write helper functions.
12:40momerathcontains? is broken for transient sets; can anyone recommend a working equivalent? Allocation profiling definitely justifies trying to make this set transient.
12:42hiredmanhttps://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentSkipListSet.html
12:43hiredmanwhy people use transients for anything other that fast creation of a collection, I have no idea
12:43momerathah- yeah, I guess I could use that; thanks hiredman!
13:14sdegutismomerath: transients should only be used briefly and turned into non-transients as soon as possible
13:15sdegutismomerath: the purpose of transients is to increase performance in creation of data sets in spots where performance matters
13:15momerathsure- that's true of the set in question, though the function is complex; it's very much an inner-loop
13:17momerathI used a plain java.utils.HashSet and I'm now allocating about 15% less in what might be called a cycle
13:18dysfunif you're in a tight loop, it's what mutables were made for
13:32justin_smithdysfun: I'm gonna get a decorative noose to hang on the wall and have a plaque by it that says "The Tight Loop".
13:32justin_smithmomento mori kind of thing
13:36dysfunjustin_smith: that's just asking to be involved in some sort of event where a coworker goes crazy and hangs your manager with your tight loop
13:36dysfunand you're gonna be prime suspect
13:36justin_smiththat's why I wouldn't have a petard (which are notorious for hoisting their owners)
13:37dysfunin six months time, you'd better hope we start the "free justin_smith" campaign
13:37dysfun"free justin_smith, the rest of us have had to answer clojure questions"
13:54sdegutishello
13:55will_smhello
14:01sdegutisFk freeing justin_smith. I refuse to answer Clojure questions.
14:01sdegutisWait, how's that go?
14:21sdegutisWhat's a thing for like has-fraction?
14:21sdegutisLike, if you were to divine things, then it's intergral.
14:21sdegutisLike, (f 1/3) is false, but (f 2/4) is true
14:21dysfunwut?
14:22justin_smithdysfun: he's asking for a test for rationals vs. irrational numbers
14:22dysfunoh
14:22dysfunthen he should have said so!
14:22sdegutisI just mean 'does this thing have anythig beside szeroes after the decimal?"
14:22MJB47i though ti was a test if a fraction could be simplified or not?
14:22MJB47ah ok
14:22sdegutisHow do you say this mplore simply?
14:23justin_smithsdegutis: how does 2/4 satisfy but not 1/3 ?
14:23MJB47justin_smith said it well i think
14:23sdegutis"Is this thing really an integer?"
14:23sdegutisjustin_smith: 2/4 is 2.0 1/3 is 0.33
14:23MJB472/4 is not an integer
14:23luma2/4 is 0.5
14:23justin_smithsdegutis: wat
14:23idevwhere can I read an analysis of datomic vs relational model ?
14:23sdegutisMaybe (float x) = (int x) is what I want?
14:23justin_smithoh, he meant 4/2
14:23sdegutisjustin_smith: yes, 4/2
14:23sdegutisThanks
14:23idevI'm trying to figure out if EAV or Relational Model is the right appraoch for my needs
14:23MJB47oh
14:23sdegutisI do not understand math very well.
14:24justin_smith,(defn integral [n] (== (int n) n))
14:24clojurebot#'sandbox/integral
14:24justin_smith,(defn integral? [n] (== (int n) n))
14:24clojurebot#'sandbox/integral?
14:24justin_smith,(integral? (/ 4 2))
14:24clojurebottrue
14:24justin_smith,(integral? (/ 2 4))
14:24clojurebotfalse
14:24sdegutisYeah that's what I was thinking of a spossible solution
14:25sdegutisBut is it the RIGHR one?
14:25will_smyou're testing a string?
14:25justin_smithsdegutis: definitely use == instead of =
14:25sdegutisI'm testing a denomenator and a numerator
14:25sdegutisI have both individually
14:25sdegutisThey may be combined into a ratio if need be.
14:25lumathere's integer?, which returns true for int, long, bigint and biginteger
14:26sdegutisluma: but I have two ints
14:26sdegutisActually two longs.
14:27sdegutise.g. 11500/9
14:27luma,(integer? 4/2)
14:27clojurebottrue
14:27luma,(integer? (/ 4 2))
14:27clojurebottrue
14:27sdegutisWhy the crap does this warn on reflection (= (double 11500/9) (long 11500/9))
14:27sdegutis,(= (double 11500/9) (long 11500/9))
14:27clojurebotfalse
14:28sdegutisAh, == not =
14:28will_smis this the same as checking if (= 1 (gcd n d))
14:28sdegutiswill_sm: hmm interesting idea
14:28sdegutiswill_sm: what does gcd do? it's not in clojure.core
14:28will_smgreatest common divisor/factor, not in clojure
14:29luma,(integer (/ 11500 9))
14:29clojurebot#error {\n :cause "Unable to resolve symbol: integer in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: integer in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6688]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: integer i...
14:29luma,(integer? (/ 11500 9))
14:29clojurebotfalse
14:29sdegutisluma: int
14:29lumasdegutis, why isn't integer? good enough?
14:29sdegutisOh heck yeah, interger? works!
14:29justin_smith,(integer? (/ 4 2))
14:29clojurebottrue
14:29will_sm, (defn gcd [a b] (if (zero? b) a (recur b (mod a b))))
14:29sdegutis,(map integer? [4/1 4/2 4/3 4/4])
14:29clojurebot#'sandbox/gcd
14:29clojurebot(true true false true)
14:30sdegutisHeck yeah!!!
14:30justin_smith,(integer? (/ 4 2.0))
14:30clojurebotfalse
14:30sdegutisGreat job everyone.
14:30justin_smithsdegutis: as long as you never see floats, that should work
14:30sdegutisNever ever.
14:30sdegutisI have two longs.
14:31sdegutisWhat the crap?
14:31sdegutis(defn integer? [n] (or (instance? Integer n) (instance? Long n) (instance? clojure.lang.BigInt n) (instance? BigInteger n) (instance? Short n) (instance? Byte n)))
14:31sdegutisThat's it's real definition, no foolin
14:32sdegutisOh, it's because of /
14:32sdegutis,(type (/ 4 2))
14:32clojurebotjava.lang.Long
14:32sdegutisfricken,
14:32sdegutiswhatthecrap
14:32justin_smith,(type (+ (/ 1 2) (/ 1 2)))
14:32clojurebotclojure.lang.BigInt
14:32sdegutis,(for [i (range 5)] (class (/ 4 (inc i))))
14:32clojurebot(java.lang.Long java.lang.Long clojure.lang.Ratio java.lang.Long clojure.lang.Ratio)
14:33engblom,(type (/ 1 2))
14:33clojurebotclojure.lang.Ratio
14:34sdegutis,(for [i (range 5)] (class (/ (inc i) 4)))
14:34clojurebot(clojure.lang.Ratio clojure.lang.Ratio clojure.lang.Ratio java.lang.Long clojure.lang.Ratio)
14:35sdegutis,(clojure.lang.Numbers/divide 4 2)
14:35clojurebot2
14:35sdegutisThat's why.
14:35will_smsdegutis, so have you solved the problem?
14:35sdegutishttps://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Numbers.java#L155-L160
14:36sdegutiswill_sm: technically yes, but I won't be satisfied until I understand why '/ gives me the answer I want so easily.
14:38sdegutiswhich uses https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Numbers.java#L1012-L1033
14:39sdegutiswhich in my case of two longs always uses https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Numbers.java#L417 for ops() ctor
14:43sdegutisso (/) with two Longs uses https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Numbers.java#L489-L506
14:44sdegutisAnd oh look, it has a variable named "gcd" just lik will_sm was talkin bout (maybe-ish)
14:44lumayes, it's the same function
14:44lumagreatest common divisor
14:44will_sm(gcd 2 4)
14:45will_sm,(defn gcd [a b] (if (zero? b) a (recur b (mod a b))))
14:45will_sm(gcd 2 4)
14:45clojurebot#'sandbox/gcd
14:45will_sm,(gcd 2 4)
14:45clojurebot2
14:45will_sm,(gcd 3 4)
14:45clojurebot1
14:46will_sm,(gcd 6 8)
14:46clojurebot2
14:46sdegutisYall are good at math
14:47will_smI almost became a math major, glad I chose to earn a good living instead
14:47sdegutisi have no fricken clue what this code does in my last link
14:48sdegutisbut whatever, i trust that its doing the right thing based on what will_sm said plus his anecdotal qualifications
14:50sdegutisWHY WILL NOT THIS WORK
14:50sdegutis,(clojure.lang.Numbers$LongOps.)
14:50clojurebot#error {\n :cause "No matching ctor found for class clojure.lang.Numbers$LongOps"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.IllegalArgumentException: No matching ctor found for class clojure.lang.Numbers$LongOps, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyzeSeq "Compiler.java" 6875]}\n {:type java.lang.IllegalArgumentException\n :m...
14:50bikeshedrwill_sm, hey, don't discourage me :p
14:52sdegutisI almost worked at factory third shift for the rest of my life, until my hobby combined with a series of strange events led to me becoming a competent software engineer.
14:52kwladykawow.... i was rejected by Cognitect because i didn't know emac shortcuts.... recruitment process is totally random monster
14:52sdegutisSh!t, 90 are integers but 29 are not.
14:53hfaafbhow many does Cognitect employ
14:53sdegutiskwladyka: I was rejected by them because I am awkward and lack proper social skills.
14:53sdegutiskwladyka: but my employer is pretty happy with me so I guess cognitect missed out :P
14:53will_smbikeshedr, if it makes you feel better, I will be working in hell/imperative programming for at least the next year
14:54sdegutiskwladyka: meaning, don't worry if they rejected you, they probably missed out on a great employee by not hiring you :P
14:54kwladykasdegutis yeah... and i get in the same time feedback i have very strong skills etc..... but emacs...
14:54sdegutiswill_sm: what lang?
14:54dysfunimperative programming isn't *necessarily* hell
14:54will_smHaven't started yet but they use C++, Python, Java, & Go
14:54bikeshedrwill_sm, a little :)
14:54sdegutiskwladyka: meh it's just one editor out of many, granted it's pretty darn great
14:54sdegutiswill_sm: oh wow, you'll have fun with that one
14:54dysfunit just makes it a lot easier to make mess
14:55sdegutiswill_sm: life is a waterslide where you die at the end
14:55sdegutisHmm. How to figure out how many decimal places a thing has
14:55kwladykai really cared about that job and put a lot of energy in that, but during one pair session i was talking with true emacs user
14:56sdegutis(= (map f [1/4 2/4 3/4 4/4]) [2 1 2 0])
14:56sdegutisWhat's f?
14:56kwladykadamn... do you know good Companies coding in Clojure which looking remote contractor? :)
14:56dysfunwhat is a "true" emacs user anyway?
14:56kwladykadysfun only emacs matter, your editor sucks
14:57kwladykadysfun but i think you have distance to it :) ( i hope ;) )
14:57dysfunno, it's just that i deal with so much shit software on a daily basis that emacs is comparatively unannoying except when it randomly breaks during upgrade
14:58dysfunall software sucks, all hardware sucks
14:58dysfunanyone telling you otherwise is a liar
14:58kwladykai was trying emacs last 7 days very intensively. In my opinion emacs had great time, but time has changed :)
14:58kwladykadysfun true
14:59MJB47my biggest issue with emacs was i spent too much time configuring emacs
14:59MJB47instead of actually working on whatever i needed to work on
14:59MJB47:(
14:59dysfunyou do eventually get it into a steady state where it works 'enough'
15:00will_smI limited myself to tweaking emacs for 10 min, every other week
15:01ben_vulpes> emacs
15:02ben_vulpes> works enough
15:02ben_vulpeshow true
15:02ben_vulpesit helps to only scratch one itch at a time
15:02kwladykadysfun what you will stack with things like colour syntax for .less files :)
15:02kwladyka*but
15:02ben_vulpes"dang it would be neat if focus jumped to the compile buffer on compilation failures"
15:02kwladykai am trying atom editor, it looks very good, first impression is very strong
15:02dysfunyou will hate it before long
15:03ben_vulpesthat's the webkit one?
15:03dysfuntext editors are not meant to run in the browser
15:03dysfuni think it's browser and/or node-webkit
15:03MJB47electron
15:04MJB47which is like node webkit
15:04kwladykadysfun i don't have to use all features
15:05dysfunyeah, emacs people think that for the first week or so
15:05kwladykabut for using it as emacs it looks very good, but still i spend only few hours with it
15:05kwladyka*it - atom editor
15:06dysfun'using it as emacs'
15:06dysfuner, no. you have missed the point of emacs
15:06engblomkwladyka: Somehow I think you spend too much time thinking about the tools rather than coding :)
15:06BamBalaamHi everyone! Does anyone know of a Clojure and/or Overtone that does music pitch detection?
15:07kwladykaengblom i was forced to it as you can see from my recrutiment process
15:07BamBalaamIf not, any hint on any library for signal processing?
15:07dysfunhrm, i can't help but notice there's a big lack of signal processing libraries listed on clojure toolbox
15:08will_smBamBalaam, IDK, but if straight pitch detection can't be done, you can use a Fourier transform to pick out the most dominant frequencies
15:09dysfunhttps://sourceforge.net/projects/dsplaboratory/
15:09engblomBamBalaam: If you get something like that done, please drop me on PM a link to the project. I know a person needing a such library
15:10dysfunhttp://www.source-code.biz/dsp/java/
15:11BamBalaamwill_sm: it could be a good idea, for a quick and dirty first draft. I see how I could implement a FFT but not how to split open the music track in clojure
15:11BamBalaamdysfun: thanks for the links, will go through them
15:12will_smBamBalaam, what is the source of the audio? Is it files?
15:12BamBalaamengblom: Whatever I achieve will never be extremely good
15:13BamBalaamwill_sm: Yes, music files
15:14BamBalaamI think I'll start with really simple tracks just with basic notes/chords. If the solution works with more complex tracks, better, but not strictly necessary
15:15will_smFound this lib for working with audio files, https://github.com/candera/dynne
15:17BamBalaamwill_sm: thanks, will have a look at it ! :)
15:30kwladykadysfun no, i didn't but as i said i was using atom only 2-3 hours and i don't know too much about it yet. But generally it looks like you can do with it everything like with emacs. Only one thing what you can't do is run on ssh.
15:35sdegutisHow do you tell if a double only has 2 digits after the decimal?
15:38justin_smithwill_sm: even fourier is tricky - the stuff actually implemented (fft) doesn't give you the actual frequency, it gives you a set of evenly spaced bins and you need to figure out the centroid from that using statistical methods
15:40justin_smithBamBalaam: overtone is just a DSL for the supercollider API, it can use all the UGens that supercollider defines and they are well documented, including multiple pitch detection methods
15:41justin_smithBamBalaam: this article compares three methods https://ccrma.stanford.edu/~kermit/website/scpitch.html
15:42justin_smithbut frankly given examples and documented usage, it's a lot easier to just use sc directly and overtone just makes using it more complex
15:42will_smjustin_smith, gives a histogram of frequencies over some time interval. But yeah, given you still have lots of other problems such as start/end, chords, bin parameters and smoothing... how do ppl do it!
15:43justin_smithwill_sm: but the frequencies have no relationship to the input
15:43justin_smithwill_sm: they are just evenly spaced based on the algorithm parameters
15:43justin_smithfinding the actual frequencies in the input requires statistical analysis
15:43BamBalaamjustin_smith: I'm not extremely familiar with the supercollider API since I'm just starting with Overtone (or clojure for that matter!). It has pitch detection?
15:44BamBalaamjustin_smith: thanks for the article, will read it, it's interesting!
15:44justin_smithBamBalaam: it has multiple pitch detection algorithms
15:44BamBalaamjustin_smith: ok great, thanks for the information! :)
15:45will_smjustin_smith, wat. Fourier transform takes a signal and decomposes it to sine waves
15:45justin_smithwill_sm: for example, if your bin is enough samples for 1/20th of a second, your detected frequencies will always be 0, 20, 40, 60, 80, 100, .... hz
15:46justin_smithto detect a 90hz input you either naively assign 80 or 100, or you use the spectrum spread behavior of the algorithm to derive the actual centroid
15:48BamBalaamoops, quit irssi by mistake
15:48will_smjustin_smith, use a higher resolution than, in practice I haven't had issues with aliasing, but then again, i don't have much practice
15:48BamBalaambut thanks everyone for the pointers in the good direction :)
15:49justin_smithwill_sm: my point is that the fft only gives specific frequencies in the output, and will give you data per bin, and the frequencies of the bins are fixed by the algorithm, and have nothing to do with your input
15:50justin_smithwill_sm: often the naiive usage is sufficient, but with a little interpolation / analysis you can do a lot better
15:50justin_smithbut no, fft never actually gives you "the frequency of the input", the algorithm simply isn't capable of such a thing
15:53will_smjustin_smith, interpolation on results of fourier or resample audio? Have any source?
15:54justin_smithinterpolations of fft to find centroids that are the actual input frequencies
15:56justin_smithwill_sm: even the wikipedia page for fft will tell you that if your bin spacing is 20 hz, there will be no 90 hz bin - it's not even possible. The energy of a 90 hz input will be split evenly into the 80 hz bin and 100 hz bin. If you naiively scan for the bin with the most energy, that can cause a fundamental at 90 hz not to be detected
15:56will_smor double the samplerate
15:57justin_smithwill_sm: that's outside the algorithm, and you have the same problem again if you try a 95 hz input
15:57will_smI mean, take your audio and change the sample rate
15:57justin_smithpoint is that fft never gives you the actual input frequency directly, but statistical methods on fft results can
15:58justin_smithwill_sm: all that matters is the bin resolution in hz, but sure, changing input frequency can help you get more bin precision
15:59justin_smithbut I think this is all a bit OT for this channel
16:00will_smyeah, and we're getting nowhere lol. I might research it more later
16:01BamBalaamyour discussion is super interesting though haha
16:01BamBalaamI'm just an extreme noob in the subject
16:02BamBalaamand my teacher simply totaly overevaluated the difficulty of the subject, given how we have close to no knowledge in signal processing
16:02BamBalaam(I know the basic math behind it, and that's...pretty much it)
16:03BamBalaamBut I just might take the easy way out and try to use supercollider functions in Overtone (still gotta check how that's possible) and that might just be it
16:04will_smwhen I installed supercollider, it came with the SuperCollider IDE, you can try that. I have yet to try it. Think I'll stick to standalone music hardware
16:04justin_smithBamBalaam: overtone definstrument is a macro that generates supercollider instrument definitions that are loadable by the supercollider synth server, that runs separately (it's a c++ program)
16:04justin_smithand then overtone talks to the scsynth server via UDP
16:06justin_smithBamBalaam: also, there are very friendly interactive tools for this stuff in matlab too
16:06BamBalaamjustin_smith: I see. So in theory I could read the music file into a buffer, and use definstrument to interface with supercollider? I'll look into it
16:07BamBalaamjustin_smith: I know. Unfortunately I really *HAVE* to use Overtone. It's... Silly.
16:07BamBalaam*shrugs* University
16:07justin_smithyeah, sounds about right - though supercollider is much more oriented to real-time, while mathematica makes it easier to do offline analysis
16:07justin_smithahh, got it
16:07dysfunjulia is gonna shit all over mathematica one day
16:08will_smjustin_smith, you know if there is any significant latency from overtone->supercollider or supercollider->jack
16:09will_smI was really dissapointed with julia. Well, it was mostly the arrays. Weren't as good as numpy
16:09sobeli want to like Overtone more but i own a copy of Ableton Live
16:09justin_smithwell, overtone doesn't even touch the signal data, and jack is going to get the best latency performance available usually
16:10justin_smithsobel: that's like saying "I want to like clojure but I already have excel" - these are tools of different levels of power designed for different kinds of tinkering
16:11dysfunjustin_smith: i want to like clojure but i already have a banana
16:11sobelit's like saying "i want to like clojure but i already have excel AND know all its macros, have friends who regularly send me excel sheets, know how to extend it in C++ when needed, know how to interface it to all the services i need to integrate with my organization, ...
16:12sobeli want to like clojure but i have a hammock
16:12dysfunthen go lie in your hammock and stop trying to write code
16:12dysfunit won't make you happy
16:12sobel. o O (one day)
16:12justin_smithsobel: if you needed to get an array of detected pitches in hash-maps as edn from ableton live, how would you do that?
16:13will_smexport to midi and convert to edn
16:13sobeljustin_smith: probably export detected pitches through some interface in Max
16:13dysfunyeah, and how's the emacs support for ableton?
16:14sobelit's pointless
16:14sobelthat's how it is ;)
16:14justin_smithI'm just saying, these are different kinds of tools - you can get a csv out of excel too of course, but they are really oriented for different approaches
16:14justin_smithmax is just supercollider with point and click instead of text
16:14dysfunit's 2030 and the libreoffice import csv function still doesn't work by defualt
16:15sobeli used to do tons of CLI music/synthesis but i could not even come close to a good creative workflow that way
16:15justin_smithand ableton began life as a crazy max patch
16:15Gh0stInTheShell"Now it's the year three thousand and thirty, everybody wants to be an MC."
16:18will_smDon't have windows anymore, I miss my DAWs
16:18dysfuncan we invent our own expansions for acronyms we don't recognise?
16:22sdegutisWhy is it that (/ 23000 18) must exist
16:22sdegutis,(/ 23000 18)
16:22clojurebot11500/9
16:22sdegutis,(double (/ 23000 18))
16:22clojurebot1277.777777777778
16:22sdegutisfricken..
16:22dysfunyou'd love number theory sdegutis
16:23sdegutisdysfun: I'm guessing I'd actually find it incredibly inconvenient
16:24will_smyour hatred for these numbers is irrational
16:25dysfuninconvenient?
16:25dysfuni dunno, a lot of number theory is pretty important
16:26dysfune.g. RSA derives its hardness from number theory
16:26will_smAre you trying to count infinite decimal places now?
16:31will_smsdegutis, so what project are you working on?
16:32sdegutiswill_sm: a commercial website
17:08sdegutis,(double 95/15)
17:08clojurebot6.333333333333333
17:08sdegutisthanks OBAMA
17:25kenrestivothat's interesting. the compiler has no problem with [:timestamp] but pukes on [:@timestamp]
17:26kenrestivotells me that there's an unmatched delimiter [
17:26kenrestivonot being able to handle :@timestamp puts a cramp in using elasticsearch from clojure
17:26kenrestivo,(select-keys {} [:timestamp])
17:26clojurebot{}
17:26kenrestivo,(select-keys {} [:@timestamp])
17:26clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: :>
17:27kenrestivo:(
17:27justin_smithkenrestivo: that's terrible, but you can use [(keyword "@timestamp")] but the better option is not keywordizing
17:27kenrestivo,(select-keys {} [(keyword "@timestamp")])
17:27clojurebot{}
17:27kenrestivoi like keywords
17:27justin_smithbut you want to use "keywords" with invalid names
17:27kenrestivoalso clj-http does that when you {:as :json} but i can manually work around that
17:28kenrestivois :@ invalid?
17:28justin_smith,(select-keys {(keyword "@timestamp") ::yes} [(keyword "@timestamp")])
17:28clojurebot{:@timestamp :sandbox/yes}
17:28TEttingerI'd assume so, since @ is the deref macro
17:28justin_smithyeah, you are messing with the reader there
17:28kenrestivooh, reader macro. grrr..
17:28TEttingerat-timestamp
17:28kenrestivoi can mangle the names on ingress to remove @'s
17:29TEttingercan you use strings?
17:29justin_smithso you can use the keyword function, or accept that you want to look things up that are not valid keywords and switch to string lookup
17:29justin_smithI guess there's mangling too, but that's the least simple option
17:29kenrestivoi hate strings so i'd rather sanitize the keys.
17:30justin_smithinvalid keywords are worse than strings
17:30justin_smith,(keyword "\n\n\n")
17:30clojurebot:\n\n\n
17:30kenrestivohahaha
17:30kwladykawhat is the difference between paredit and parinfer?
17:30justin_smithparedit has commands for moving parens, parinfer moves parens when you indent
17:30TEttinger,(keyword "@$&^\ufeff()")
17:30clojurebot:@$&^()
17:31kwladykajustin_smith thx
18:08sdegutisHow do you say "this double has no more than 2 decimal places, I'm sure of that"?
18:08sdegutisOr better yet, "this double ends with a repeating decimal place"?
18:14sdegutisAh
18:14sdegutis(integer? (* x 100))
18:14sdegutisGot it.
18:15amalloy.(integer? (* 1.05 100))
18:16amalloy,(integer? (* 1.05 100))
18:16clojurebotfalse
18:17sdegutis,(integer? (* 100 (/ 52373 10)))
18:17clojurebottrue
18:17sdegutis,(integer? (* 100 (/ 23000 18)))
18:17clojurebotfalse
18:26amalloythose aren't doubles
19:18toastycjI read or heard somewhere that clojure syntax is a derivative of another general language ? I couldn't find reference to it anymore after googling a bit.
19:18toastycjIf somebody can let me know, it will be great.
19:18toastycjIt's not lisp, from what I heard.
19:19justin_smiththe closest relative is scheme
19:24ben_vulpesis let a recur target? i'm losing my mind over here
19:24ben_vulpesit shouldn't be right RIGHT?
19:24justin_smithno
19:25amalloythat question is curiously urgent when lacking punctuation
19:26amalloylike you're not just emphasizing the question, you're grabbing me by my collar and shaking me. "right RIGHT?"
19:27ben_vulpesyeah well when you feel the world moving under your feet and the only sane answer is "no you're wrong and stupid for making the mistake in the first place"...
19:31TEttingertoastycj, clojure can be described as a dialect of lisp, in the same way scheme is a dialect of lisp, and common lisp is a dialect of lisp (usually when people say Lisp without qualification they mean common lisp or the early lisps that predate common lisp)
19:32TEttingerclojure makes more departures from scheme and lisps in general than many other implementations, syntax-wise
22:53sdegutisamalloy: sometimes they are