admin-announcements

Announcements from the Clojurians Admin Team (@U11BV7MTK @U077BEWNQ @U050TNB9F @U0ETXRFEW @U04V70XH6 @U8MJBRSR5 and others)
lfn3 2015-11-27T02:39:12.000549Z

@eyelidlessness: re the bdd stuff - you know about the testing macro in core.test?

2015-11-27T04:17:47.000551Z

@lfn3 i do, but i found (along with my team) that the core test framework didn't tend to encourage expressing behavior. honestly it may be a naming preference more than anything, but the rspec-ish semantics of describe / it / should encourages good testing

agile_geek 2015-11-27T07:34:17.000554Z

Anyone used Cascalog on a very recent version of Hadoop? I’m using Hadoop 2.7.1 and my Map-Reduce jobs runs fine on a local hadoop instance for that version but not on the cluster. I get a Class Not Found Exception for

cascading.tap.hadoop.io.MultiInputSplit
. See https://www.refheap.com/112124

maleghast 2015-11-27T08:33:51.000555Z

Hey @agile_geek it’s months since I looked at Cascading in general, but when I did it was not Hadoop 2.x compatible...

agile_geek 2015-11-27T09:39:47.000556Z

@maleghast: might explain the issue then! I strongly suspected this. I’ve asked the Cascalog user Google mail list so may get confirmation.

maleghast 2015-11-27T09:41:10.000557Z

@agile_geek: Yeah, I was going to try it out a few months back ‘cos I’d seen some good talks and people like @otfrom had said very nice things(tm) but then I went and looked into it and it was all still tied to Hadoop 1.x and I was really turned off.

maleghast 2015-11-27T09:42:05.000558Z

Hopefully this is changing / has changed, but if it hasn’t you might want to look at Onyx as an alternative..? (I’m still finding my way and it might not be an analog / synonym after all, but maybe)

agile_geek 2015-11-27T09:42:34.000559Z

This http://www.cascading.org/support/compatibility/ suggests Cascading 3.0.2 does support 2.7.1 but I’m not clear whether Cascalog is using that version of Cascading’s API.

agile_geek 2015-11-27T09:43:53.000561Z

Strange thing is that I can run this on my local hadoop distribution of 2.7.1 but it fails in the cluster

agile_geek 2015-11-27T09:44:25.000562Z

I’m wondering if the distro of Hadoop I’m using has Cascading installed.

roelof 2015-11-27T09:59:06.000563Z

In the future I will try to make a sort of financial web app with clojure. I could store the amounts on a agents like this (def cash_on_hand (agent 0 :validator number?)) so I can change the amount of cash-on-hands

roelof 2015-11-27T10:00:16.000564Z

Now I wonder what I the best way to "store" the transactions so I can make a report on all the transaction of a account. Store it in a list of {} ?

agile_geek 2015-11-27T10:07:27.000565Z

@roelof: a vector of maps is probably a good place to start. How do you envisage accessing the transactions?

agile_geek 2015-11-27T10:08:58.000566Z

If you always have an id for the account and want to go straight to all the transactions for a specific account then a map with the key being the account id and the value the vector of transaction maps might be the model you are looking for.

agile_geek 2015-11-27T10:09:44.000567Z

Of course you would probably want to persist the data so in reality you would probably not use an atom and just persist to some data store.

agile_geek 2015-11-27T10:10:58.000569Z

Think about what your data should look like and how you would most frequently access it then model it accordingly.

roelof 2015-11-27T10:15:11.000571Z

@agile_geek: thanks . persistent is something that I would be adding later . I think I need a database for it

roelof 2015-11-27T10:15:33.000572Z

I have to figure out which one. pqsql, mysql or maybe datomic

trancehime 2015-11-27T10:15:42.000573Z

Hi, is anyone here familiar with postal ?

agile_geek 2015-11-27T10:17:06.000574Z

@roelof: sure. In general, use maps for key based access, vectors for random access and lists when you only ever access sequentially from the beginning. Lists are the least used data structure in Clojure.

roelof 2015-11-27T10:18:43.000575Z

agile_geek: then maps are my first choice

roelof 2015-11-27T10:19:04.000576Z

At this moment, my project is a toy project so I can experiment with things

trancehime 2015-11-27T10:19:40.000577Z

I'm in need of some clarification about something, since send-message doesn't appear to be actually delivering any mail if I use :host "localhost"

trancehime 2015-11-27T10:20:01.000578Z

On an Amazon Linux AMI instance

roelof 2015-11-27T10:20:47.000579Z

@agile_geek: can you recommend a database for my project ?

trancehime 2015-11-27T10:21:23.000580Z

I've fiddled around with using smtp specifically gmail, but apparently I'm thrown an error more specifically javax.mail.AuthenticationFailedException "Please log in via your web browser and try again" even after using correct credentials to authenticate to the SMTP

jaen 2015-11-27T10:42:34.000581Z

@trancehime: I remember this being fiddly as hell when we were setting that up, I'll see if I can remember what made it work. Using postal (or clojurewerkz mailer, which uses it under the hood)?

trancehime 2015-11-27T10:47:23.000582Z

I'm using postal yeah

jaen 2015-11-27T10:47:43.000583Z

I think setting "use less secure apps" as described here is what did it - https://support.google.com/accounts/answer/6009563?hl=en - but that didn't work immediately I think.

trancehime 2015-11-27T10:47:47.000585Z

Finicky as all hell. I use :ssl true for SMTP authentication to test email delivery through GMAIL, but that didn't work

trancehime 2015-11-27T10:47:55.000586Z

I've done that too

trancehime 2015-11-27T10:48:05.000587Z

Actually doing that is what threw me the authentication error in my logs

trancehime 2015-11-27T10:48:36.000588Z

I had to "use less secure apps" otherwise I'd receive an email telling me an insecure app was trying to access my email.

trancehime 2015-11-27T10:49:24.000589Z

So after fixing that little hiccup, I tried again, this time from my Amazon ec2 instance (because I develop on a Windows machine and I don't have enough time to get send-mail or whatever working on here) and that's how I got the AuthenticationFailedException error. z.z

jaen 2015-11-27T10:59:16.000590Z

The config that was working looks like so:

:mailer-delivery-mode :smtp
:mailer-user "<mailto:whatever@gmail.com|whatever@gmail.com>"
:mailer-password "password"
:mailer-host "<http://smtp.gmail.com|smtp.gmail.com>"
:mailer-port 587

jaen 2015-11-27T10:59:23.000591Z

I imagine you have it the same though

trancehime 2015-11-27T11:02:03.000592Z

I'll try port 587 ;o

trancehime 2015-11-27T11:02:07.000593Z

but for now I gotta go home

agile_geek 2015-11-27T11:08:03.000594Z

@roelof: start slowly so pick something you are familiar with already (if you are familiar with anything). I buck the trend towards NoSQL databases by not choosing them by default so I tend to start with the assumption that I need a Relational database. Then it’s up to you. Postgres or MySQL are good places to start. Once you’ve installed them and create the tables you need I would read up on how to use just clojure/java.jdbc to start with. Then you might want to consider a Clojure library that abstracts away from the low level jdbc api like Korma but personally I like yesql (and @krisajenkins didn’t pay me to say that!)

jaen 2015-11-27T11:08:50.000595Z

@trancehime: FYI, it says the settings need to be different if you use 2-step verification; I don't (no phone) so maybe that's why it was enough to set less secure apps - https://galleryserverpro.com/use-gmail-as-your-smtp-server-even-when-using-2-factor-authentication-2-step-verification/

jaen 2015-11-27T11:15:47.000598Z

Re: databases - if you don't want to use plain JDBC, then I think clojure.jdbc is nicer to use than clojure.java.jdbc and certainly has nicer documentation. Otheriwse yeah, yesql seems pretty cool for beginners (and if you are doing a web application you can choose to use the Luminus "framework" which has that set up for you). Also, I suggest using PostgreSQL over MySQL, mainly because PostgreSQL cares about quality of their database, unlike MySQL : V #flamebait

trancehime 2015-11-27T11:17:07.000599Z

Yeah, Ive been using yesql

trancehime 2015-11-27T11:17:30.000600Z

the database i hve to connect to is mysql, I don't have control over that

trancehime 2015-11-27T11:17:58.000601Z

oh wait

trancehime 2015-11-27T11:18:20.000602Z

I'm stupid, mobile app

jaen 2015-11-27T11:18:31.000603Z

Ha, yeah, I was adding to what @agile_geek replied to @roelof xD

trancehime 2015-11-27T11:18:58.000604Z

Still, yesql seems.better.rhan korma

trancehime 2015-11-27T11:19:06.000605Z

I say this as a clojure noob

jaen 2015-11-27T11:19:06.000606Z

But since you have a mobile app, you have a mobile phone and you might have 2factor auth turned on

jaen 2015-11-27T11:19:18.000607Z

So check out what that link suggest doing, may help.

trancehime 2015-11-27T11:19:22.000608Z

Haha no I mean Im using the slack mobile app

jaen 2015-11-27T11:19:36.000609Z

Well yeah, korma is too magical.

trancehime 2015-11-27T11:19:50.000610Z

But I guess your point still stands

trancehime 2015-11-27T11:20:05.000611Z

i think i may have fprgotten about 2 step auth

agile_geek 2015-11-27T11:21:29.000613Z

@roelof sure use

clojure.jdbc
instead as suggested by @jaen . I think it’s useful to understand the underlying jdbc abstraction before using anything on top. @jaen I like yesql as it doesn’t add another abstraction on top of SQL.

jaen 2015-11-27T11:23:19.000614Z

@roelof: here's link to clojure.jdbc docs for convenience - http://funcool.github.io/clojure.jdbc/latest/

jaen 2015-11-27T11:24:22.000615Z

@agile_geek: yeah, that is nice, but I sometimes feel it's lacking some conditional templating; as it is if I want to filter by say, a combination of three attributes, then I would have to write nine queries to cover all the possibilities, wouldn't I?

agile_geek 2015-11-27T11:28:14.000616Z

@jaen: yes. Although you could fall back to raw-sql and construct a query string dynamically. I think if your use case makes this common then it falls under Kris’ advice in ‘When Should I Not Use Yesql’ (maybe he needs to extend the paragraph to include this use case?)

jaen 2015-11-27T11:30:13.000617Z

Hmm, I don't think so

jaen 2015-11-27T11:30:22.000618Z

The paragraph only talks about translating into different dialects

jaen 2015-11-27T11:31:15.000619Z

For example the Ruby counterpart uses ERB for query substitution which gives more leeway in how to structure queries

jaen 2015-11-27T11:31:27.000620Z

I'm fairly convinced such an addition would make sense for yesql.

roelof 2015-11-27T14:39:17.000622Z

I think for a financial app nosql cannot be used. Can Atomic be a solution ?

dm3 2015-11-27T14:42:29.000623Z

what makes you think that?

roelof 2015-11-27T14:43:32.000624Z

I just googled and see a lot of pages that said Atomic is one of the best DB which can work with clojure

roelof 2015-11-27T14:45:10.000625Z

@agile_geek: Im not familiar with any of them. I come from the ruby world where all is things is hidden in I think thet call it a orm

agile_geek 2015-11-27T14:48:06.000626Z

@roelof: not used AtomicDB but I wouldn’t jump to a non-relational database unless you need massive scaling capability. Stick with Postgres. In the Rails would you will have had a relational database behind Rails.

roelof 2015-11-27T14:51:06.000627Z

@agile_geek: thanks. then I will read the docs to decide which middleware I can use the best

agile_geek 2015-11-27T14:55:29.000628Z

@roelof: I’m afraid that if you’re not familiar with relational databases this may be a steep learning curve as none of the Clojure abstractions hide the base SQL like feel from you…deliberately. An ORM is not sensible abstraction in Clojure as there are no Objects (the O of ORM)

roelof 2015-11-27T14:57:22.000629Z

oke, another steep learning code 😞 I think I will then firs make a app which work in memory with agents and maps

roelof 2015-11-27T14:57:39.000630Z

and go on learning about clojure more with 4clojure

roelof 2015-11-27T14:59:24.000631Z

@agile_geek: can you help me then with my question on the beginners channel