This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-25
Channels
- # admin-announcements (3)
- # alda (2)
- # beginners (10)
- # boot (44)
- # cider (31)
- # cljs-dev (5)
- # cljsjs (2)
- # cljsrn (17)
- # clojure (181)
- # clojure-austin (2)
- # clojure-brasil (18)
- # clojure-canada (1)
- # clojure-conj (5)
- # clojure-dev (11)
- # clojure-gamedev (30)
- # clojure-russia (380)
- # clojure-spec (50)
- # clojure-uk (35)
- # clojurescript (146)
- # clojutre (1)
- # component (1)
- # cursive (62)
- # datomic (27)
- # dirac (7)
- # editors (23)
- # emacs (7)
- # events (34)
- # funcool (22)
- # hoplon (134)
- # jobs (22)
- # jobs-rus (7)
- # juxt (1)
- # kekkonen (1)
- # lein-figwheel (54)
- # leiningen (7)
- # luminus (2)
- # off-topic (5)
- # om (4)
- # onyx (27)
- # proton (5)
- # protorepl (2)
- # re-frame (16)
- # reagent (29)
- # rethinkdb (2)
- # schema (1)
- # untangled (61)
- # yada (9)
Hey guys, how's core.unify coming along? http://take.ms/UvqPi
I think it is largely abandoned. There was some discussion about removing it because of course core.logic also does unification. Some chimed in about a standalone unifier still being valuable. But I don't think anyone else has stepped up to take care of it
so I have this weird error when I run tests (everything fine in the repl):
FAIL in () (NO_SOURCE_FILE:209)
expected: (= :events/bad-event (:events/type (events/ws-msg->bad-event ws-msg msg-or-ex-info)) "We can correctly create :events/bad-event events")
actual: (not (= :events/bad-event :events/bad-event "We can correctly create :events/bad-event events"))
false
either I am missing some keyword equality fundamentals here or there is something off
the test is:
(is (= ::events/bad-event (::events/type (events/ws-msg->bad-event ws-msg msg-or-ex-info)) "We can correctly create :booma.events/bad-event events"))
@richiardiandrea I think you just have your message inside one too many )
s
I.e., it should be (is (= ::events/bad-event (::events/type (events/ws-msg->bad-event ws-msg msg-or-ex-info))) "We can correctly create :booma.events/bad-event eventsโ)
oh rrrrrright lol
I still double and triple check before posting here about these kind of errors ... but well, what can you do ๐ thanks @joshmiller
I should write a spec for that
Can anyone recommend a good tutorial or video on concurrent (DB) execution? I'm looking at doing a POC for work to get some info from a DB (MS SQL Server) and then fire off a few concurrent queries to retrieve related information.
the simplest thing would be to execute your queries inside futures, futures begin executing immediately on another thread, and you can get the result of executing the future by using deref, derefing a future will block if the future hasn't completed executing yet. you'll also need to make sure the driver (presumably some jdbc driver) can execute concurrent queries on a single connection, or else you will need to create a new connection for each future
@yogidevbear if your db driver has an asynchronous option then concurrent queries are straightforward, otherwise futures ... once you have responses in futures ztellman/manifold has a bunch of useful stuff for composing operations (i.e. when those concurrent queries require further concurrent queries)
Thanks guys, I'll take a look at your suggestions ๐
in a similar vein @yogidevbear promesa is worth a look, and cats' alet macro http://funcool.github.io/cats/latest/#alet is a thing of beauty ๐
I'm trying to update my nrepl client to use a single connection. I'm a little stuck though because if multiple threads access that connection, to ask for a new session, won't they each get the same session (and leave data on the connection too?) Any advice to handle this scenario?
@pvinis are you sure this is clojure-related question? If you are building a native osx app, then you are probably using some library to access Cocoa APIs from Clojure and via this library you should be able to talk to osx frameworks to create status menu items and anything osx-related.
Iโm not a Java person, but if I was forced to write native osx apps in Clojure, I would try to use something more direct, some wrapper of OSX frameworks, not going through a general multi-platform Java library like AWT (my $0.02)
you could write the menu item app in swift and let it talk to your Clojure server (background process) via some protocol, e.g. json or better edn
@pvinis you might want to checkout BitBar: https://github.com/matryer/bitbar
Hi! I'm reading this http://stackoverflow.com/questions/22716492/how-to-configure-leiningen-to-use-a-corporate-repository about how to configure leiningen to use a corporate repository, but it seems the password is right there in the :repositories
value, is there any better way around this? perhaps in the ~/.lein/profile.clj ?
@aaelony: we use entries in our profiles.clj like this:
:user {...
:deploy-repositories [["snapshots" {:url ""
:sign-releases false}]
["releases" {:url ""
:sign-releases false}]]
:mirrors {#".+" {:name "Internal nexus"
:url " "
:repo-manager true}}}
Hello All! Just joined the slack, is this the right place to get some development support?
If so, I have an interop question.. I'm trying to make some libgdx game goodness, and I need to access the libgdx keys: https://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/Input.Keys.html I have libgdx core in my project deps: [com.badlogicgames.gdx/gdx "1.9.3"] but I'm not entirely sure how to use it. one answer I came across involved the following line, and I dont really understand the use of the $ in it: "com.badlogic.gdx.Input$Keys/toString"
@idiomancy in my experience, itโs an inner class in Java
thanks, @jcsims I'll bash my head against this for a little bit to see if I can get this working.
Essentially, I'm trying to manipulate the libgdx classes, but the Interop seems to be really complex, because its split into n packages and libraries.
But, ultimately, the specific thing Im trying to do boils down to (in Java) "if (Gdx.input.isKeyPressed(Keys.SPACE)) {doThing}"
but, like, I'm not sure what imports I would have to make in order to get "(if (Gdx.Input/isKeyPressed Keys/SPACE))" to work
I canโt recall exactly - the static field access on a static class might be com.badlogic.gdx.Input$Keys/SPACE
the first couple sections here might be helpful: http://clojure.org/reference/java_interop
it should be something like :
(:import (com.badlogic.gdx Input
Input$Keys))
within your ns declaration @idiomancy@sarcilav oh.. weird.. do I have this usage correct?
(ns neofight.core
(require [clojure.core.async :as async])
(:import
(com.badlogic.gdx ApplicationListener)
(com.badlogic.gdx Input Input$Keys)
(com.badlogic.gdx.backends.lwjgl LwjglApplication)))
(def INPUTS-LISTENTED-TO
[Keys/SPACE])
;=> *out*
CompilerException java.lang.RuntimeException: No such namespace: Keys, compiling:(C:/Users/Tyler/code/neofight/src/neofight/core.clj:13:1)
oh! okay. Awesome. okay, you guys are the best, I swear I will read that whole java interop page before I ask another question
you have (require โฆ) instead of (:require โฆ)
and it is I think more common to use [ ] rather than ( ) in :import, although either is ok
Hi all. I have a large lazy list of datomic transactions that need to be run (~500k transactions). Evaluating these fn's is not very quick and I was hoping for some way to execute this using multiple threads. Has anyone done something like this before?
hey y'all. I'm trying to learn about macros, and I'm wondering if there's a way to turn something like this:
(defmacro add
[a b]
`(+ ~a ~b))
into a macro which will inline the result of a + b
instead of inlining the addition operationThe point of the quote is to insert code into that place, rather than the results of running that code. If you want the result, then you donโt want to be quoting what led to that result
I was hoping for something like this: (def cool-number 5)
then (ident cool-number)
would expand to 5
because if you do it at compile time, how could we know that cool-number
just points at a literal
I'm asking about this for cljs actually... I want to inline constants via macros so that the js output from the cljs compiler can be statically analyzed more thoroughly
@idiomancy not sure, I'm pretty new to cljs
Man, you're blowing my mind right now. You want a macro that causes a value to expand to itself.
I gotta run, but I'll check back in a bit. If you have any idea if/how to do this... I would so appreciate it
would it be too much to ask for the specific example that is giving you trouble (not enough for static analysis)
Im sure people here are way better with "how to do x" than "how to do x in this specific way"
he does some setting of vars in the local environment, interacting with the compiler
(def my-class
(.createClass js/React #js
{:displayName (macros/ident constants/form-field)
...}))
so cljs will output something that looks like this:
var my_class = React.createClass({ displayName: "form-field-string" });
boot.user=> (defmacro ident [x] (var-get (resolve x)))
#'boot.user/ident
boot.user=> (defn foo [] (ident clojure.pprint/pprint))
#'boot.user/foo
boot.user=> (foo)
#object[clojure.pprint$pprint 0x22bce3d4 "clojure.pprint$pprint@22bce3d4"]
this is what i've got so far, but i'm getting an error PersistentList cannot be cast to symbol
but the idea is to get the values for the vars passed in and then walk the tree replacing them
notice this does have serious issues with scoping. I think that ztellman/riddley has done some work on this
And I'll bet zach would actually dig something like this, as I can see him inlining vars a bunch
and for you to inline vars, those vars need to already exist so hopefully that's already been taken care of
so how would I use it in this kind of context:
(def my-class
(.createClass js/React #js
{:color iss.constants/blue
:fontSize (macros/add 1 2)}))