Fork me on GitHub
#clojure
<
2016-08-09
>
derwolfe01:08:43

from clojure would the easiest way to construct a simple CA be to use bouncy castle?

noobjure03:08:49

Hi. Just joined and look forward to interacting with everyone here. Was wondering whether anyone would be willing to link to a simple/beginner friendly project using Datomic that I could play with? Thanks in advance.

shaun-mahood03:08:49

Hi @noobjure. One good place to start is the day of datomic training and videos at http://www.datomic.com/training.html

cddr06:08:53

Just came across this on hacker news. Looks pretty cool: https://github.com/dgrnbrg

yonatanel07:08:42

@cddr: very interesting. thanks!

noobjure08:08:52

@shaun-mahood: thanks for the quick response. I've already looked through their documentations and videos and now was hoping to actually see it in action on someone else's work. Thanks again anyways.

bur12:08:02

Hello World

adamw12:08:44

err, sorry šŸ˜ž

peterromfeld13:08:25

@noobjure i found https://github.com/Datomic/day-of-datomic together with repl from editor very useful to learn and for datalog in general: http://www.learndatalogtoday.org/

yonatanel13:08:09

I'm trying to manage configuration in a Component. Currently I'm merging the map loaded from edn with the config component on Lifecycle/start. What is a good way to clean the merged values on Lifecycle/stop or Lifecycle/start?

(defrecord Config []
  component/Lifecycle
  (start [this]
    (merge this (load-config)))
  (stop [this]
    this))
I could assoc to a single key instead of merging everything directly, but then I'd have to use that key everywhere:
(defrecord Config []
  component/Lifecycle
  (start [this]
    (assoc this :config (load-config)))
  (stop [this]
    this))

yonatanel13:08:34

I see the approach of https://github.com/AvisoNovate/config is to first have the configuration and only then the component system. Configuration can still be reloaded on each call to the reset function of the reloaded workflow.

peterromfeld13:08:35

@yonatanel: we ended up not using system for the config and just use https://github.com/weavejester/environ but we dont make jars yet and just run services with boot tasks (upstart scripts running boot task šŸ™‚ )

emil0r14:08:09

Does anyone have an idea how UTF-8 can be mangled when saving to postgres? I get data from an external source, itā€™s UTF-8 coming in. When I save it to postgres it gets mangled into what appears to be Latin1. Saving to the same table from other data streams, also with UTF-8, doesnā€™t produce the same error

therabidbanana14:08:50

@emil0r: I had a similar problem a week or two ago - turned out that it was actually the transport format (transit without a preferred encoding set in my case) that was mangling the data, not anything within Postgres. Maybe worth looking into from that angle?

mtnygard15:08:57

@noobjure: Iā€™ve got a sample project at https://github.com/mtnygard/todo-backend-pedestal. It uses Pedestal for the HTTP partā€¦ feel free to use or ignore that. It shows how to use Datomic in a ā€œrealā€ app though.

noobjure15:08:36

@mtnygard: Just what I was after! Thanks for introducing the Todo-Backend work... will be lost in it for the new few days. Thanks again.

bur16:08:26

Anyone in possession of excellent Om Resources? Om-next would be even better šŸ™‚

akiva17:08:17

Might want to ask in the #C06DT2YSY channel.

akiva17:08:37

@dnolen is often active there and thereā€™s plenty of Om-Next discussion.

nipperstick17:08:41

Do you gents know of a dominant rustlang slack?

notid18:08:14

Is there an easy way to avoid boxing of floats when doing java interop? e.g.,

(set! (.someFloatValue some-object) (unchecked-multiply 1.0 3.0))
results in a Float.valueOf in the resulting bytecode

sattvik18:08:18

Does (float x) do the trick?

notid19:08:03

unfortunately no

notid19:08:48

I think clojure doesnā€™t support float literals, so the unchecked-multiply is applying to doubles

robert-stuttaford19:08:03

Long: 7, hex 0xff, oct 017, base 2 2r1011, base 36 36rCRAZY BigInt: 7N Ratio: -22/7 Double: 2.78 -1.2e-5 BigDecimal: 4.2M via http://clojure.org/api/cheatsheet

sattvik19:08:23

OK, well part of the problem is that set! does not support primitives.

notid21:08:54

ahh, ok. perhaps thereā€™s an alternative

bhagany22:08:37

Trying out the new alpha, and it looks like pr-str automatically outputs the new namespaced map syntax, like so:

user> (pr-str {:db/ident :foo})
"#:db{:ident :foo}"
Is there a way to keep the namespace on the key? I'm running into issues with edn parsers in other languages not knowing what to do.

bja22:08:17

you could probably use an older version of clojure's pr-str (edit: tools.reader doesn't contain pr-str)

bja22:08:34

instead of clojure.core/pr-str

bhagany22:08:29

awww at your edit

bja22:08:03

does clojure.pprint/pp print the old way?

bhagany22:08:13

checking...

bhagany22:08:28

why yes it does

bhagany22:08:01

that'll do for now. thanks!

bja22:08:07

that might not be ideal, but might work in a pinch

xcthulhu23:08:31

Has anyone else encountered bugs trying to handle byte-arrays in protocols? The following works fine:

(extend-type (Class/forName "[B")
  PrivateKey
  (private-key [data] (BigInteger. 1 data)))
But this throws java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Character
(extend-protocol PrivateKey
  (Class/forName "[B")
  (private-key [data] (BigInteger. 1 data)))

xcthulhu23:08:01

Maybe this is in JIRA already

atroche23:08:23

Is a way to destructure namespaced maps nicely? Iā€™m after something like this:

(let [m #::my-ns {:a 1
                  :b 2
                  :c 3}
      {:keys #::my-ns [a b c]} m]
  [a b c])