Fork me on GitHub
#beginners
<
2019-04-18
>
alexmiller01:04:32

ctrl-d is eof, might work

markx01:04:10

@alexmiller Not really just for read-line. I need to interrupt the loop.

alexmiller01:04:02

have you tried throwing it in the pool?

markx02:04:04

hmm, what is “throwing it in the pool”? 😅

alexmiller03:04:42

that's when you take your computer, and throw it in the pool

alexmiller03:04:02

sometimes, that's the only thing that works

elecbuggy07:04:49

can anyone help me for install clojure at win10 #clj-on-windows

seancorfield07:04:32

@codestar8 He's trying to follow https://github.com/clojure/tools.deps.alpha/wiki/clj-on-Windows which is the new PowerShell module installer.

seancorfield07:04:28

Those instructions from Eric are about getting Java and Leiningen installed, not the new Clojure CLI tools.

codestar819:04:43

Ahhh ok. Not sure what PowerShell is?

seancorfield20:04:06

Microsoft's "next gen" command line shell https://docs.microsoft.com/en-us/powershell/ -- it was open sourced three years ago but I haven't seen it running anywhere except Windows...

markx08:04:24

@alexmiller Yeah very funny. I’d appreciate the joke better if someone could help me with my question.

orestis10:04:12

You might just need to kill the REPL entirely.

orestis10:04:10

I don’t think there’s any support for interrupting something that you started with repeatedly, barring throwing an exception inside it, which read-line probably doesn’t?

markx10:04:58

That’s just an example. I can pass something into the loop or throw an exception if needed. My real use case is to keep reading from a telnet connection, and I need the ability to stop it. If I can’t stop it, then I will have to start a new repl after everytime I run the app.

lennart.buit11:04:07

I think nrepl allows interruption?

markx11:04:29

So it’s due to the lein repl’s limitation? How normally would you handle ctrl-c in clojure or java programs?

tabidots10:04:47

Why is it that core.matrix has this name when specifying it as a dep [net.mikera/core.matrix "0.62.0"] but when you require it, you must call it clojure.core.matrix?

victorbjelkholm42910:04:46

net.mikera/core.matrix is the dependency's name on clojars, so that's what you need to reference it by

tabidots10:04:17

Oh, alright. So those two things are completely independent, and a library creator can make the require name whatever they want by manipulating the folder structure etc.?

victorbjelkholm42910:04:56

AFAIK, yes, people can chose whatever NS they want and it might have collisions with other libraries if you're not careful. Usually people use a reversed TLD that they own as the ns

tabidots10:04:10

Gotcha. Yeah I’ve been noticing the reversed TLD thing. That practice comes from Java, right?

victorbjelkholm42911:04:50

not sure, I have about 0 Java knowledge, only time I touch Java is when I need to figure out something in Clojure... (and debugging Jenkins failures)

mattias50414:04:19

Yeah, it’s standard Java package naming practice.

alexmiller12:04:17

There is some Java support for signal handling

alexmiller12:04:39

That’s setting it up for the main Clojure repl as an example

alexmiller12:04:33

Uses a very old weird api hence the com.sun api. Last I checked there was no official replacement yet

dumrat17:04:15

Trying to migrate this sql file (001-site.up.sql) with ragtime :

-- Create site and site_translation tables

CREATE TABLE site (id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
                   name VARCHAR(255) NOT NULL,
                   base_url VARCHAR(511) NOT NULL);

--;;

CREATE TABLE site_translation (site_id INT(11) NOT NULL,
                               language VARCHAR(5),
                               display_name VARCHAR(255) NOT NULL,
                               FOREIGN KEY (site_id) REFERENCES site(id))
  DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

--;;

INSERT INTO site (name, base_url)
VALUES ('miyuru_gee', '');

SET @ins_id1 = LAST_INSERT_ID();

INSERT INTO site_translation (site_id, language, display_name)
VALUES (@ins_id1, 'en-US', 'Miyuru Gee');

INSERT INTO site_translation (site_id, language, display_name)
VALUES (@ins_id1, 'si', 'මියුරු ගී');

--;;

INSERT INTO site (name, base_url)
VALUES ('ananmanan', '');

SET @ins_id2 = LAST_INSERT_ID();

INSERT INTO site_translation (site_id, language, display_name)
VALUES (@ins_id2, 'en-US', 'Ananmanan');

INSERT INTO site_translation (site_id, language, display_name)
VALUES (@ins_id2, 'si', 'අනංමනං');
And I keep getting errors. The latest is:
Applying 001-site
Execution error (SQLSyntaxErrorException) at com.mysql.cj.jdbc.exceptions.SQLError/createSQLException (SQLError.java:120).
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SET @ins_id1 = LAST_INSERT_ID();

INSERT INTO site_translation (site_id, languag' at line 4
I have spent too much time on getting this migration task going. How am I supposed to do this?

dumrat17:04:15

Trying to migrate this sql file (001-site.up.sql) with ragtime :

-- Create site and site_translation tables

CREATE TABLE site (id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
                   name VARCHAR(255) NOT NULL,
                   base_url VARCHAR(511) NOT NULL);

--;;

CREATE TABLE site_translation (site_id INT(11) NOT NULL,
                               language VARCHAR(5),
                               display_name VARCHAR(255) NOT NULL,
                               FOREIGN KEY (site_id) REFERENCES site(id))
  DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

--;;

INSERT INTO site (name, base_url)
VALUES ('miyuru_gee', '');

SET @ins_id1 = LAST_INSERT_ID();

INSERT INTO site_translation (site_id, language, display_name)
VALUES (@ins_id1, 'en-US', 'Miyuru Gee');

INSERT INTO site_translation (site_id, language, display_name)
VALUES (@ins_id1, 'si', 'මියුරු ගී');

--;;

INSERT INTO site (name, base_url)
VALUES ('ananmanan', '');

SET @ins_id2 = LAST_INSERT_ID();

INSERT INTO site_translation (site_id, language, display_name)
VALUES (@ins_id2, 'en-US', 'Ananmanan');

INSERT INTO site_translation (site_id, language, display_name)
VALUES (@ins_id2, 'si', 'අනංමනං');
And I keep getting errors. The latest is:
Applying 001-site
Execution error (SQLSyntaxErrorException) at com.mysql.cj.jdbc.exceptions.SQLError/createSQLException (SQLError.java:120).
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SET @ins_id1 = LAST_INSERT_ID();

INSERT INTO site_translation (site_id, languag' at line 4
I have spent too much time on getting this migration task going. How am I supposed to do this?

dumrat17:04:31

Should I just skip using these clojure libraries and just resort to using a mixture of sql + bash scripts?

ghadi17:04:16

maybe ask in #sql @dumrat

ghadi17:04:19

but it says there is something wrong with the syntax, that's for sure

dumrat17:04:48

@ghadi Yeah, forgot to mention, this script runs fine when invoked in mysql with source 001-site.up.sql.

ghadi17:04:56

I figured

ghadi17:04:09

you might be calling an api that doesn't expect Multiple statements

ghadi17:04:18

#sql would know better

dumrat17:04:04

@ghadi Sure, will ask there. Thanks.

gurpreetsk117:04:04

Hi all. I'm beginning to learn clojure and need some ideas for a good first clojure project. Thanks in advance 😀

orestis17:04:12

I’ve had good success doing Advent of code puzzles or similar katas

dumrat17:04:34

Hi Gurpreet, Depends on you I guess. I found that doing project Euler problems with Clojure great fun. It was a total different way of thinking about programming puzzles generally.

ericcervin20:04:19

Have you done other programming languages? I like using Clojure to reproduce projects I've done in other languages.

tabidots01:04:46

Advent of Code and Project Euler are where it’s at. I am going back and forth between those and developing a number theory library (at least for myself, if it’s not good enough for production 😅)

joaohgomes00:04:33

While you're learning it's nice to see other people's code for comparison. I like code wars.

gurpreetsk108:04:21

Thank you all for your suggestions 🙏

k.i.o17:04:40

does spec somehow related to structural type systems?

k.i.o17:04:07

thanks, i watched this talk 3 times already 😃

jamie96217:04:08

this talk sets spec against type systems very well

k.i.o17:04:36

just reading about structural type systems, so decided to ask more experienced colleagues

k.i.o17:04:17

intuitively i feel they are somewhat related

noisesmith17:04:43

my understanding is that it isn't a type system at all, that said I know nothing about structural type systems