Fork me on GitHub
#off-topic
<
2017-12-10
>
qqq03:12:51

After CryptoKittes someone neds to build FarmVille for ETH.

qqq03:12:06

Your neighbor's potatoes growing faster than yours? Spend ETH to buy virtual fertilizer!

noisesmith04:12:00

cryptotomogatchi: the block chain records for posterity that you were a bad pet owner and let your creature die because you forgot to feed it

qqq05:12:14

Someone is going to make millions of CryptoTulips. Unfortunately, I lack the artistic / marketing skills to pull it off.

dominicm13:12:24

Not sure if it's the code I write, but I find myself using a juxt-like util for build maps a lot.

dominicm13:12:27

I don't seem to find it in any other libraries though, which is making me question my need for it.

New To Clojure14:12:21

@dominicm How do you use it? It just concatenates result of two functions into string afaik

dominicm14:12:39

@ghsgd2 just to clarify, It's a util I wrote which looks like this:

((juxtamap
   :k inc
   :c dec) 10)
;; => {:k 11 :c 9}

dominicm14:12:20

It's useful for renaming keys & structuring unstructured data

dominicm18:12:09

@qqq looks very related to my motivations in attempting to avoid doing:

{:k/k (:k_k result)
 :k/something (inc (:k_k result))}
Instead doing
(juxtamap
  :k/k :k_k
  :k/something (comp inc :k_k))
The key difference is that local variables go away.

dominicm18:12:22

I suppose I've developed a little bit of a fascination with avoiding the naming of interim values. There's also a tedium sensation as I do it though.

qqq19:12:55

@dominicm: absolutely, what you want is "point-free programming" , "tacit programming", and "function level programming" -- they're all similar to your desire of "local variables go away"

qqq19:12:23

the basic idea is to focus on FUNCTIONS that take FUNCTIONS as input and produces FUNCTIONS as output, instead of mucking around with 8intermediate values

vemv19:12:25

Given a .clj file: - which namespace declaration aliases foo.bar to bar - that contains ::bar/quux, how do I programatically determine that ::bar/quux will be expanded to :foo.bar/quux?

dominicm19:12:49

You can look in ns-aliases.

vemv19:12:14

good option, but I was looking to do it statically

noisesmith19:12:42

statically in what context?

vemv19:12:00

without evaluating code

noisesmith19:12:12

that's what clojure.tool.analyzer.jvm is for

noisesmith19:12:16

there's no simple way to do it

dominicm19:12:36

I mean, depending on how much accuracy you require, you could parse the namespace declaration similar to how tools.namespace does it, and do a regex search for ::<symb>\/<symb>

vemv19:12:26

thanks! might cheat

vemv19:12:13

this is for cljs. tools.analyzer.js appears deprecated. there's https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/analyzer/api.cljc which I'm not sure if/how it can be used

noisesmith19:12:22

yeah - it depends on how accurate you need to be and how much of the language your user is allowed to use while expecting your tool to work

noisesmith19:12:56

for example someone could explicitly call alias, or call load-file on a file that defines a new alias via alias or require...

noisesmith19:12:06

or use a macro that does either of those things

noisesmith19:12:50

luckily clojure code tends to be pretty "conservative" in terms of that sort of thing, and any creation of aliases outside an ns form are very rare... but they are easy to do and at least nominally supported

qqq20:12:31

setting aside intrinsic / extrinsic motivation, is there a programming website where: person A registers an account person B deposits some money person A gets paid $5 for every programming exercise he/she completes ?

New To Clojure20:12:35

I know such website, but it's free for usage and no payment for exercises done

qqq20:12:58

so it's like an allowance, except for doing chores, you learn new programming languages

dominicm21:12:24

@qqq person B in this equation seems very generous

qqq22:12:51

@dominicm: it's a parent encouraging a child to program

dominicm22:12:16

@qqq ah, so it's targeted to personA

qqq22:12:43

also ,10k/ $5 = 2000 problems -- 10k is around college for 1 year, and solving 2000 programs would probabyl teach them alot more programming than 1 year of college

qqq22:12:39

A and B are not strangers. B is trying to figure out "given I'm willing to spend $X, how can I best advance career of A" ?

avfonarev23:12:37

Not related to the original question, but there is topcoder, which (at least many years ago) was paying for competitively solving "puzzles" mostly coming from client companies.

New To Clojure08:12:47

@U7ZSXG630 It's hard to understand why people used it. Getting paid only if your solution is better than 15 other is a bit questionable.

avfonarev11:12:23

Haven't looked at it in a while. They had very good algorithmic competitions, but the rest was puzzling indeed.

arnaud_bos04:12:39

Yes, can't wait for the next post.

qqq23:12:00

there's also project eule / beijing online judge, which provides problems for free, from which one can build the $5 / problem system