This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-17
Channels
- # admin-announcements (4)
- # aws (26)
- # beginners (88)
- # boot (132)
- # cljs-dev (4)
- # cljsrn (35)
- # clojars (11)
- # clojure (41)
- # clojure-art (33)
- # clojure-austin (1)
- # clojure-chicago (4)
- # clojure-dev (3)
- # clojure-russia (2)
- # clojured (3)
- # clojurescript (9)
- # community-development (19)
- # datomic (34)
- # devcards (2)
- # editors-rus (4)
- # hoplon (29)
- # leiningen (4)
- # music (2)
- # off-topic (21)
- # om (69)
- # other-lisps (1)
- # perun (6)
- # re-frame (1)
- # reagent (9)
- # spacemacs (3)
- # yada (13)
I am following Eric Normand's Web with Clojure tutorial and I am completely stuck with Postgres. I can't seem to get it to work with 'creatdb'
Ok I see. It has a different terminal. Seems the best option for installing it is the Postgres app.
@grounded_sage: are you sure postgres is installed correctly on your system? what is the output of which postgres
?
@shanekilkelly: It's giving me nothing now. The previous installs gave me something but weren't working so I thought I would try it this way... still confused.
The Brew installed ones and enterprise ones both gave me something back. I think the enterprise one kept setting up a new user on the computer... which I didn't like.
Ok, when you use brew it installs the postgres binaries to /usr/local, which is visible on your shell path. Postgres.app keeps everything inside the app package, so those programs are not visible on the shell path.
I haven't installed the command line tools... I don't know where ~/.bash_profiles is http://postgresapp.com/documentation/cli-tools.html
If you just want to creat a database, then I suggest launching postgres.app and then using a graphical tool like pgadmin to connect and create your database
I tried doing a search earlier for .bash_profile and nothing came up so I created my own... didn't do anything lol
Ok, then you know that '~/.bash_profile' is a file in your home directory? If you can edit that then the instructions in the linked article should allow you to get this working
Wades-Air:webdev wade$ lein run 8000 2016-01-17 22:37:51.076:INFO::main: Logging initialized @3705ms Exception in thread "main" org.postgresql.util.PSQLException: ERROR: syntax error at or near "NOT" Position: 133, compiling:(/private/var/folders/m9/rcs8n7hd74q_qw084n6bc93c0000gn/T/form-init6970411645438536527.clj:1:124) at clojure.lang.Compiler.load(Compiler.java:7142) at clojure.lang.Compiler.loadFile(Compiler.java:7086) at clojure.main$load_script.invoke(main.clj:274) at clojure.main$init_opt.invoke(main.clj:279) at clojure.main$initialize.invoke(main.clj:307) at clojure.main$null_opt.invoke(main.clj:342) at clojure.main$main.doInvoke(main.clj:420) at clojure.lang.RestFn.invoke(RestFn.java:421) at clojure.lang.Var.invoke(Var.java:383) at clojure.lang.AFn.applyToHelper(AFn.java:156) at clojure.lang.Var.applyTo(Var.java:700) at clojure.main.main(main.java:37) Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "NOT" Position: 133 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:334) at clojure.java.jdbc$db_do_execute_prepared_statement$fn__371.invoke(jdbc.clj:753) at clojure.java.jdbc$db_transaction_STAR_.doInvoke(jdbc.clj:595) at clojure.lang.RestFn.invoke(RestFn.java:425) at clojure.java.jdbc$db_do_execute_prepared_statement.invoke(jdbc.clj:752) at clojure.java.jdbc$db_do_prepared.doInvoke(jdbc.clj:786) at clojure.lang.RestFn.invoke(RestFn.java:442) at clojure.java.jdbc$execute_BANG_$execute_helper__404.invoke(jdbc.clj:892) at clojure.java.jdbc$execute_BANG_.doInvoke(jdbc.clj:896) at clojure.lang.RestFn.invoke(RestFn.java:425) at webdev.item.model$create_table.invoke(model.clj:8) at webdev.core$devmain.invoke(core.clj:69) at clojure.lang.Var.invoke(Var.java:379) at user$eval5.invoke(form-init6970411645438536527.clj:1) at clojure.lang.Compiler.eval(Compiler.java:6703) at clojure.lang.Compiler.eval(Compiler.java:6693) at clojure.lang.Compiler.load(Compiler.java:7130) ... 11 more
Got it working. There was an error in the video training. On that note I am off to bed. Thanks @shanekilkelly for helping out
Hi, does a series of progressive exercises to obtain basic fluency in Clojure exist anywhere that you know of?
many are listed at http://clojure.org/community/resources - issue with additions https://github.com/clojure/clojure-site/issues or PR welcome (PRs require signed Clojure CA - http://clojure.org/community/contributing_site)
"At this time, http://4clojure.com does not provide information regarding the sale of foreclosed homes, and has no plans of doing so in the future." I actually laughed out loud.
Is there a better way to write this:
clojure
(zipmap (keys (stasis/slurp-directory "resources/articles/" #"\.md$")) (map #(md/md-to-html-string %) (vals (stasis/slurp-directory "resources/articles/" #"\.md$"))))
Essentially I would like to keep the keys of a persistent array map and just operate on their values
into an empty map {} and then destructure the data structure that I am trying to work with? In this case
(stasis/slurp-directory "resources/articles/" #"\.md$")
I feel like I always struggle with this type of manipulation in clojure, as if the elegant approach isn't there to be found in core.
versus the lack of ability to do something like this using a core function:
(defn hashmap-set
[keyvals]
(persistent!
(reduce
(fn [ret [k v]]
(assoc! ret k (conj (get ret k #{}) v)))
(transient {}) keyvals)))
my favorite exploitation of clojure data transforms:
(defn produce
"Returns a lazy sequence of colls from a recursive, axiomatic,
transformative process."
[seed prep-f get-xf]
(letfn [(process
[coll]
(lazy-seq
(when (seq coll)
(let [new-coll (into (empty coll) (get-xf coll) (prep-f coll))]
(cons new-coll (process new-coll))))))]
(process seed)))
from my generative function library: https://github.com/decomplect/ion/blob/master/src/ion/ergo/core.cljc
hello! My web form send form params to server that connect to google spreadsheet api, writes new line, and return response up to client
when I run the app in my hosting provider, I see that a new line is created in my spreadsheet but the server doesn't return anyresponse to client
@kopasetik: the recur
passes 2 arguments. You could fix the loop
binding to be
(loop [n n
vctr vctr]
or just eliminate loop
and let it recur to createSchedule
.@kopasetik: That just fixes the shape of the code. I haven’t looked into what it is really doing.
Speaking of that, the ClojureScript docstring for range
indicates it returns a lazy seq. Wonder if that is strictly speaking, true.
Well, suffice it to say, in ClojureScript, it returns a deftype
that conspires to implement things like IIndexed
in O (1) as opposed to O (n).