This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-22
Channels
- # admin-announcements (7)
- # beginners (56)
- # boot (69)
- # cider (168)
- # cljs-dev (2)
- # clojure (170)
- # clojure-austin (25)
- # clojure-beijing (3)
- # clojure-belgium (2)
- # clojure-france (3)
- # clojure-poland (17)
- # clojure-russia (115)
- # clojure-uk (40)
- # clojurebridge (3)
- # clojurescript (87)
- # cursive (9)
- # datomic (30)
- # dirac (18)
- # editors (3)
- # emacs (14)
- # hoplon (195)
- # immutant (14)
- # jobs (3)
- # jobs-discuss (4)
- # leiningen (11)
- # melbourne (5)
- # mount (42)
- # off-topic (5)
- # om (24)
- # onyx (48)
- # parinfer (53)
- # proton (1)
- # protorepl (2)
- # re-frame (3)
- # reactive (2)
- # reagent (29)
- # rum (5)
- # spacemacs (4)
- # untangled (91)
- # yada (1)
Is anyone interested in exploring the serialization possibilities of Clojure’s s-expression into Amazon’s recently announce Ion s-expression notation? http://amznlabs.github.io/ion-docs/spec.html
Hi, I'm trying to compile yesql locally and I've got this exception java.lang.ClassNotFoundException: yesql.types.Query. Did anyone get such exception?
The strangest thing is that it compiles on my MacBook without any problems, but I get errors on my PC on Debian Stable.
are you sure you have checked out the same sha on places where it works and where it doesn't?
I've forked yesql. Here's the repo: https://github.com/mrroman/yesql.
it is much more likely to be some confusion in the test running process (you think it is passing on the mac, but it isn't) and your changes broke something
hi guys i'm facing issue of too large buffer size when i rquest an api here is the log "2016-04-18 12:35:47,390 (qtp1320509032-20) [INFO] : ([0m[34m[46mf15c[0m) [36mStarting [0m:post /api/v1/location/current/tempr/five for 192.168.0.8 {"origin" "<chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop>", "host" "192.168.0.15:7000", "user-agent" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36", "content-type" "application/json", "content-length" "51", "connection" "keep-alive", "accept" "/", "accept-language" "en-US,en;q=0.8,hi;q=0.6", "accept-encoding" "gzip, deflate", "postman-token" "5b16c467-e709-b616-a8a2-51bee3062e66", "cache-control" "no-cache"} 2016-04-18 12:35:47,403 (qtp1320509032-20) [INFO] : ([0m[34m[46mf15c[0m) 12.903034677.6177216 2016-04-18 12:35:47,832 (qtp1320509032-20) [INFO] : ([0m[34m[46mf15c[0m) {:latitude 12.9030346, :longitude 77.6177216} 2016-04-18 12:35:47,894 (qtp1320509032-20) [INFO] : ([0m[34m[46mf15c[0m) [36mFinished [0m:post /api/v1/location/current/tempr/five for 192.168.0.8 in ([33m506[0m ms) Status: [39m201[0m 2016-04-18 12:35:47,955 (qtp1320509032-20) [WARN] : (null) java.io.IOException: Response header too large at org.eclipse.jetty.http.HttpGenerator.generateResponse(HttpGenerator.java:400) at org.eclipse.jetty.server.HttpConnection$SendCallback.process(HttpConnection.java:637) at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:246) at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:208) at org.eclipse.jetty.server.HttpConnection.send(HttpConnection.java:471) at org.eclipse.jetty.server.HttpChannel.sendResponse(HttpChannel.java:763) at org.eclipse.jetty.server.HttpChannel.write(HttpChannel.java:801) at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:142) at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:135) at org.eclipse.jetty.server.HttpOutput.close(HttpOutput.java:166) at org.eclipse.jetty.server.HttpWriter.close(HttpWriter.java:49) at java.io.PrintWriter.close(PrintWriter.java:339) at ring.util.servlet$set_body.invokeStatic(servlet.clj:89) at ring.util.servlet$set_body.invoke(servlet.clj:84) at ring.util.servlet$update_servlet_response.invokeStatic(servlet.clj:115) at ring.util.servlet$update_servlet_response.invoke(servlet.clj:107) at ring.adapter.jetty$proxy_handler$fn__7450.invoke(jetty.clj:26) at ring.adapter.jetty.proxy$org.eclipse.jetty.server.handler.AbstractHandler$ff19274a.handle(Unknown Source) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) at org.eclipse.jetty.server.Server.handle(Server.java:497) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257) at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555) at java.lang.Thread.run(Thread.java:745) Caused by: java.nio.BufferOverflowException at java.nio.Buffer.nextPutIndex(Buffer.java:513) at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:163) at org.eclipse.jetty.http.HttpGenerator.putSanitisedValue(HttpGenerator.java:1057) at org.eclipse.jetty.http.HttpGenerator.putTo(HttpGenerator.java:1079) at org.eclipse.jetty.http.HttpGenerator.generateHeaders(HttpGenerator.java:703) at org.eclipse.jetty.http.HttpGenerator.generateResponse(HttpGenerator.java:385) ... 25 more Commit failed " any anybody explain me the exact issue
this file is importing the query type without loading the clojure file that creates the type
so of course you'll get an error about the type not existing, the real mystery is why it works anywhere else
I suspect, that for some reason lein is loading namespaces for the tests in a different order, which could be the result of different jvms maybe or different lein versions
if you create a file called src/user.clj with the contents:
(alter-var-root #'clojure.core/*loading-verbosely* (constantly true))
that will print out the namespace loading informationI have in the deb repo, Java HotSpot(TM) 64-Bit Server VM 1.7.0_80-b15. It still doesn't compile.
but in theory you'll be able to compare that output to confirm that the namespaces are being loaded in a different order
Hello, I’m using clj-http.client, and when issuing POST request it seems we need to give a stringified json body (www/post "
. Any idea why passing the json directly does not work ?
(I mean, I guess the string is the json, so by passing the string you are passing json directly)
@hiredman @lucj06 according to the docs it does actually support that, from the README (client/post "
it is true, clj-http will do some encoding and decoding for you if you pass it the right options (:content-type :json)
but you aren't passing json directly, you are passing a clojure datastructure (or even jvm datastructure depending on your view point)
@hiredman: I've fix this issue with yesql by adding yesql.types to (:require). I wonder how fast do they accept pull requests .
I'm relatively new to Clojure (I'm half way through Clojure for the brave and true) and for a fun project I wanted to use a Java library in my Clojure program. In an example for the library there is this code:
server.addListener(new ServerAdapter() {
@Override
public void sessionAdded(SessionAddedEvent event) {
event.getSession().addListener(new SessionAdapter() {
@Override
public void packetReceived(PacketReceivedEvent event) {
// do more stuff with the event
}
});
}
I am currently trying to execute that method including that build(Server server), I was recommended to use reify, but how exactly would I use it?
This code fails to work with Exception in thread "main" java.lang.IllegalArgumentException: only interfaces are supported
(. server addListener (reify ServerAdapter
(sessionAdded [SessionAddedEvent event])))
meme3: also `Note that the first parameter must be supplied to correspond to the target object ('this' in Java parlance). Thus methods for interfaces will take one more argument than do the interface declarations.`
@pastafari: Ah, ok, I'll see if that fixes it
Hmmm, (. server addListener (proxy ServerAdapter [] (sessionAdded [this event]))
seems to not work with: java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol
I made a mistake (writing from top of my head without checking :)). (proxy [ServerAdapter] [] (sessionAdded [event] )))
Well, I have to do this: https://github.com/Steveice10/ClassicProtocolLib/blob/master/example/org/spacehq/mc/classic/protocol/test/MinecraftClassicProtocolTest.java#L50
ok, so you want:
(proxy [ServerAdapter] []
(sessionAdded [event]
(comment Here to put the method body))
(sessionRemoved [event]
(comment Here to put the method body)))
Here is an example (the second part of a snippet), how you can "switch" by class: http://clojuredocs.org/clojure.core/condp#example-542692cbc026201cdc326be2
well, I'm impressed. just got my 15 month old abandonware project running again in only 30 minutes (haven't tried lein ancient
yet thobut)
http://ww.telent.net/2014/12/8/ann_sledge_we_re_lost_in_music I've actually just been using youtube instead for the last year, but of course it's tricky finding Prince songs on youtube
can someone point me to good reading on the rpoper way to write a macro that contains a macro?
I feel like one macro is not “fully expanding” into another, which makes me believe I dont really understand fully what is going on.
for example, I want to wrap some nicer looking behaviors into my clj.tests …
(deftest truth-test
(when- "something is truthy"
(is (= true false))))
Hi, which book(s) would you guys recommend after finishing Clojure for the Brave and True? Perhaps something more intermediate rather than introductory.
@curlyfry: Maybe Applied Clojure (or Clojure Applied, can't remember the word order)
i have read clojure for brave and true and ordered “joy of clojure"
yes! validated! tnx @borkdude 😄
Hi, I’m working on my first CLojure project, kinda a consumer of RabbitMQ messages. At first I used a single file with all the function I needed. I’m cleaning this up and creating several files that I load in the main core.clj. Some functions (that are not in the same files) need the same clojars (like clj-http, log, …) what is the recommended way to load the commun lib ?
lucj06: you should use either leiningen (http://leiningen.org/) or boot (https://github.com/boot-clj/boot)
I’ve created the project with leiningen but I use the single core.clj file to put everything ...
@lucj06: check out #C053AK3F9
@bostonaholic: thanks, will do this
i realize i might be opening a can of worms here, but what is everyone’s thought on dynamic vs static typing? more and more I’m coming under the impression that the industry as a whole is leaning towards static typing being a better choice
how does core.typed compare? what are the benefits/drawbacks?
this is an interesting read: http://martintrojer.github.io/beyond-clojure/2016/04/19/beyond-clojure-prelude
core.typed is not really usable in my experience, you're better of using something like Schema
has anyone seen “Types are like the Weather, Type Systems are like Weathermen - Matthias Felleisen”?
you can always disable most of the checks once you're confident you're code is "safe" with the latter
if I have a clj file in test/clj/testing_util/core.clj
and I try to run run-all-tests #”.*-test”
.. it’s not picking up on my namespaces.. does that file have to be in a top level somewhere? do I need to set my ‘starting namespace’ higher?
bojan.matic mpenet: core.types isn’t usable… and that’s sad because it sort of feels like a failure of the gradually typed approach more than core.types as a technology.
@lwhorton: clojure.test/run-all-tests
does not search for files. It only searches namespaces that have already been loaded.
bojan.matic: it's hard to retrofit something that complex to a dyn language imho. It works as advertised, but it makes the dev workflow painful imho
i’m using mike’s awesome https://github.com/mike-thompson-day8/cljsbuild-none-test-seed/issues/4 for using goog and require to load up all the files… so they’re all there (i can put a breakpoint in the index.html and inspect them all)
@bojan.matic: in haskell it's at the root of the language, it's more than just for checking
@stuartsierra: it’s just for some reason unless I structure my items like /test/cljs/runner.cljs
the runner doesn’t pick up on any other namespaces 😕
If you're talking about Clojure*Script* test then I don't know.
clojure.test
in Clojure (JVM) and whatever ClojureScript has now — they don't know anything about each other.
You said you had a file named testing_util/core.clj
, which I took to mean you were talking about clojure.test
on Clojure(JVM)
@bojan.matic: I don't see the industry shifting one way or the other really
@mpenet: really? All I seem to be finding is people gravitating away from dynamic typing, I can't find counter examples
plenty of dyn languages do fine with other ways of checking code correctness, without hindering productivity
Maybe I hang out in the wrong clubs
@bojan.matic Regarding the fact that there surely are millions of developers world wide I think it is hard to say that there is a certain movement. Especially in niches like clojure / erlang / haskell. I mean, it was pretty obvious for node.js, as well as C and Java. Also C# has a big movement, being backed by Microsoft and then there is all the Apple stuff (Objective C / Swift I guess). But apart from that? For instance, not long ago Perl 6 was released. How would you tell if there is a movement to it or away from it? As long as you are not part of that community I guess it is almost impossible to do so.
matthias felleisen gave a great keynote at clojurewest speaking to some of these typing matters and core.typed tangentially https://www.youtube.com/watch?v=XTl7Jn_kmio
@spieden: i actually shared that same talk little further up 😄
@ghadi: ion provides blob, clob, and structs and type annotations, in addition to the s-expression “container type.” Would it be possible to explore a transit -> ion and vice versa as a lossless transformation?
My question is not whether ion is better than edn/transit, but to understand the transformation process between them, whether it will be lossy etc.,
I would like to try a sample out this weekend, and would be curious to see if anyone has pointers.
I would love to read a history of ion, they include a symbol type, and their extension mechanism is called sexps in the spec
From what I read, it provides a "pure sequence-of-values data model”, which is compelling.
well, it isn't that compelling from clojure because of all the other options people have mentioned that provide that, but it is an interesting case of convergent evolution
In addition, ion-value, its primitive type has value types. https://github.com/amznlabs/ion-java/blob/master/src/software/amazon/ion/IonValue.java