Stream

Join this community to post or comment

Tim Cross

General Discussion  - 
 
Can anyoone suggest a clojure or java library for doing string case conversion on peoples names. I have a database where all the surnames and given names are in upper case. Need to convert to proper case and need the library to be 'smart' i.e. can handle things like O'Tool, D'Arcy, van Dyke, McDonald, de Souza etc. The original app was in perl and used a perl module which did this quite nicely. Prefer a clojure lib, but even a java lib would do
1
Charles Duffy's profile photoTim Cross's profile photo
2 comments
 
The literal port is the likely fall back position - really just wanted to check there wasn't something similar already.
Add a comment...

Dan Jay

Development  - 
 
Clojure Web Framework featuring Om.next
1
1
Add a comment...
 
A new book on ClojureScript has been published !
https://www.packtpub.com/web-development/learning-clojurescript
Clojure is an expressive language that makes it possible to easily tackle complex software development challenges. Its bias toward interactive development has made it a powerf...
7
Add a comment...

Emanuel Goette

General Discussion  - 
2
Add a comment...

Chris Parbey

Development  - 
 
Live development of a Space Exploration Game in Clojure
https://www.livecoding.tv/tobiahrex/
1
Add a comment...

Brendon Williams

General Discussion  - 
 
Custom Type Hints
Is it possible to make custom type hints? Specifically, I want to define a hint for a list of a Record type.

These are my records for a neural net I'm writing:

(defrecord Layer [^doubles nodes ^doubles weights-from]) ; Add bias node field
(defrecord Net [^Layer input-layer hidden-layers ^Layer output-layer])

Ideally, I'd like it if I could annotate the "hidden-layers" field of Net. The obvious way would be something like Layer[], but that didn't work.
2
Rory Douglas's profile photo
 
This is about array hints but perhaps the same approach at REPL will help you http://asymmetrical-view.com/2009/07/02/clojure-primitive-arrays.html
Add a comment...
 
Run any JVM app (including Clojure) in the cloud...
3
2
Laurent Caillette's profile photo
2 comments
 
Oh man that's huge, there is a slide (Cloud Foundry Summit, June 2014, p.27) about JVM memory management directly using the MMU.
Add a comment...
 
Check out a new version of Scheje, now featuring lexical closures, contributed by @balajirrao !
https://github.com/turbopape/scheje
1
Add a comment...

Robert Medeiros

General Discussion  - 
 
There is a new core library forthcoming in Clojure. It addresses a long-standing need for better documentation and tooling and, more interestingly, not-so-subtly encourages Clojure developers to write code in a more Clojure-ic way (e.g. emphasis on namespaced keywords).
8
Add a comment...

Michael Wade

Clojure Idioms  - 
5
4
Add a comment...

Chris Parbey

ClojureScript  - 
 
Live coding of a Tiny Ball Picking Game with #Clojurescript
https://www.livecoding.tv/jiyinyiyong/
1
Add a comment...

About this community

*Community Moderation* Since this has become an issue of late, here are a few general guidelines for posts to the Clojure Google+ Community. First, this community is _very_ egalitarian. The members dictate content and how the community is used. Anyone wanting Moderator permissions only need ask. But there are a few obvious guidelines everyone should follow. 1. Posts to this Clojure community need to be related to Clojure. The Clojure community is dedicated to all things Clojure, and only things Clojure. 2. Be polite. Remember that while you may have interesting things to say, others do too. The members of this community are not personal twitter followers so dominating the conversation isn't very polite. 3. Be relevant. We want to strive for a high signal-to-noise ratio. Use the community search; re-posting old news from 2011 doesn't further this goal. That's it. Everything else is up to the members to create what we want out of this community. It can be a source of news, event organization, questions, hangouts, whatever we want to make of it.

Brendon Williams

General Discussion  - 
 
How can I stringify then read back Double/NaN?

(with-out-str (pr Double/NaN))
NaN

If I then try to read-string it back, because the enclosing Java class was dropped, it's interpreted as the undefined symbol NaN, instead of the predefined Double/NaN.

Yes, I know use of read-string is frowned upon, but this seems to be the best way to write/read a record to file.

1
Alex Nelson's profile photoDaniel Szmulewicz's profile photo
5 comments
 
An idea to explore is defining a custom tagged literal in the reader to handle this case.

Add a comment...

Brendon Williams

General Discussion  - 
 
I just wasted a ton of time assuming that (= (number? Double/NaN) false) while trying to find the source of "NaN contamination". 
Does this strike anyone else as odd?
1
1
Kalle Hallivuori's profile photoBrendon Williams's profile photo
3 comments
 
Thanks, I guess that makes sense. 
Add a comment...

Yasser Shah

General Discussion  - 
 
Live Development Space Exploration Game using Clojure https://www.livecoding.tv/macromancer/
2
1
Add a comment...

Yves Parrays

General Discussion  - 
 
Wow, I just had a 55x perf boost by replacing some xpath-based code by
a solution using clojure.data.xml/parse and specter.

I don't think that's normal. Is there a problem with clj-xpath right now?
3
1
Charles Duffy's profile photoIvan Toshkov's profile photo
4 comments
 
The Apache implementation of xpath was very slow last time we used it. A colleague implemented an alternative which handled large enough subset of xpath in a couple of days and it was a few times faster already.

Besides DOM in general and xalan in particular suck really bad! Even the read operations are stateful and aren't thread-safe because "the standard doesn't require it."
Add a comment...

Yves Parrays

General Discussion  - 
 
Dynamic vars & lazy evaluation
Is there an equivalent for bound-fn (cf. http://stackoverflow.com/questions/33500282/clojure-binding-of-dynamic-var-not-working-as-expected)
but for the `for` macro?
Having to remember to do (doall (for ...)) is *really* error prone and defeats the purpose of laziness.
1
Ivan Pierre's profile photo
6 comments
 
You can say : it's a closure, with eventual binds, if you're in the right place... very very bad.... :D
Even if it's nice for some simple cases... but it's to put the evil bad worrying tremendous ununderstandable bug.... in the place, and you even don't know where :D
Add a comment...

Chris Parbey

Development  - 
 
Watch live development of RTP Server in Clojure
https://www.livecoding.tv/slightlycyborg/
6
2
Add a comment...

Daniel Szmulewicz

Development  - 
 
Exploring the thorny topic of code reloading in Clojure.

http://danielsz.github.io/2016/05/06/Ghosts-in-the-machine
Some stories start with a side note. This is one of them. Then again, the side note might be the end of the story. I'm not sure anymore. But the journey we are going to embark on will quickly transcend it, leading us to explore programming semantics and revisit some timeless philosophical ...
10
2
Ivan Toshkov's profile photo
 
Neo is an agent?!? NOOOOOOoooooooooooooo
Add a comment...

Brendon Williams

Code reviews  - 
 
Review Request
I'm writing a Game of Life clone while learning Clojure.
In the paste below, I have the starting bits of the "environment".
In the record Enviro, "cells" is a 1D vector acting as a 2D matrix, and "dims" is the dimensions of the board.
I want to know if "set-cell-at" is as neat as it could be; it seems overly complicated.
4
Brendon Williams's profile photoBruno Kim Medeiros Cesar's profile photo
5 comments
 
(Caveat: my Clojure is a bit rusty)

In set-cells-at, specifically, you can make it niftier by using assoc-in, which would make it like

(defn set-cells-at [enviro cells x y]
(let [index (enviro-index enviro x y)]
(assoc-in enviro [:cells index] cell)))

https://www.conj.io/store/v1/org.clojure/clojure/1.8.0/clj/clojure.core/assoc-in

I have some other nits:

* Why use a 1-D array at all? If you used an MxN matrix, the above code would be

(assoc-in enviro [:cells x y] cell)

* "Enviro" seems a bad name, in my taste a class should have a full name, while the variables should be short... and enviro is in the middle :P I'd use

(defrecord Environment/Board/Game)
(defn create-dead-env ...)
(defn set-cell [env x y cell] ...)

Good luck!
---

One more data point in favor of gist.github.com is that I could reply you close to the source, with formatting, instead of here at G+ or having to make a pastebin myself :) I have nothing against pastebin for a read-only view, but hopefully now you know and can choose between more tools.

Add a comment...

Daniel Higginbotham

General Discussion  - 
 
Heyo, just wanted to let y'all now that 20% of Brave Clojure Jobs proceeds will be donated to ClojureBridge starting May 16th :) https://jobs.braveclojure.com/blog/posts/bridge-donations/
Holy moley, the first month has been awesome for this site! With twelve jobs posted since April 1st and $1100 in sales, I am extremely grateful to the companies who decided to give this site a shot. To celebrate this success, I'm extending the 50% off launch sale an extra two weeks; ...
5
1
Add a comment...