Fork me on GitHub
#clojure-uk
<
2017-03-31
>
Rachel Westmacott07:03:25

disappointed to discover that I had only dreamt that I had fixed an issue with my REPL šŸ˜ž

Rachel Westmacott07:03:52

I wonder if guava has anything to say about "horrible stream-based messes in Java 8"?

dominicm07:03:54

What's the issue?

Rachel Westmacott07:03:18

intermittent - but I was getting an NPE on (reset)

Rachel Westmacott07:03:39

well, intermittent in the sense that sometimes it always happens and sometimes it doesnā€™t at all

Rachel Westmacott07:03:52

which suggests Iā€™m doing something specific

dominicm07:03:30

Potentially a race condition in the updating of state.

Rachel Westmacott07:03:48

it reloads some of the namespaces fine and then borks and canā€™t load some, and the whole thing falls over

dominicm07:03:20

(Removing the stop function from an atom before the stop is called for example!)

Rachel Westmacott07:03:27

if I manually reload the right three namespaces in dependency order then its fine until I hit (reset) again

dominicm07:03:54

Ah. A tough one.

Rachel Westmacott07:03:01

the NPE is because a namespace didnā€™t load

Rachel Westmacott07:03:16

I suspect it has something to do with AOT compilation

dominicm07:03:19

Any fully qualified ns in use?

Rachel Westmacott07:03:36

ā€œfully qualifiedā€?

dominicm07:03:55

Refresh is fully incompatible with aot. Don't use them in conjunction. A lein clean should solve that.

dominicm07:03:16

Some people use app.util/bar without requiring app.util.

Rachel Westmacott07:03:25

okay, so lein clean might sort out the intermittency

Rachel Westmacott07:03:33

thatā€™s good to know

dominicm07:03:56

If you've done an AOT (uberjar), lein clean is the answer.

dominicm07:03:27

But ensure it's off during development. I'm not sure how to do that in lein, skip-aot metadata maybe?

Rachel Westmacott07:03:18

mostly I steer as far from AOT as possible - but Iā€™m AOTing the whole app for the uberjar in an attempt (that seems successful) to speed up start up time

Rachel Westmacott07:03:47

for the jar I have one ns with :gen-class and a main- function

dominicm07:03:09

Absolutely a fine use of aot. Bad for dev though. Gotta turn it off & clean between uses.

Rachel Westmacott07:03:16

maybe a clean is all it will need if Iā€™ve jarred it recently

dominicm07:03:33

Potentially, depends on how you've setup your project.clj

Rachel Westmacott07:03:42

so do I need to explicitly disable AOT?

dominicm07:03:42

I know we do on our lein projects. I've not investigated whether it's still necessary though.

Rachel Westmacott07:03:47

the only reference to aot in my project.clj is :uberjar {:aot :allā€¦ in my :profiles

dominicm07:03:21

You may need an :aot :none at the top level / dev profile. But I'm again, uncertain. Try clean. If not, play with that. But I imagine you'd see if aot was happening when you did lein repl

dominicm07:03:37

If you get really desperate, make sure it still happens if you don't hook up your editor. Sometimes caches can be problematic, particularly on big projects.

Rachel Westmacott07:03:04

okay thanks, that gives me lots to go on if it recurs

Rachel Westmacott07:03:41

it certainly often feels (not just with this problem) that AOT and REPLs are not good friends

dominicm07:03:10

Might be worth paying close attention to what is reloading. Make sure there's nothing external in there.

Rachel Westmacott07:03:19

ā€œexternalā€?

dominicm07:03:55

E.g. Bidi.ring being reloaded.

dominicm07:03:15

As opposed to myapp.foo

Rachel Westmacott07:03:56

on a lighter note Iā€™ve been doing some ClojureScript recently and I think it should come with an addictiveness warning - itā€™s sooooo much fun!

dominicm07:03:44

Did you start that around the same time as the npe started?

dominicm07:03:58

Where do you put your compiled assets?

Rachel Westmacott08:03:19

./resources/public/js

Rachel Westmacott08:03:56

possibly about the same time - my project.clj certainly changed a lot when introducing Cljs to it

dominicm08:03:45

Watch your refreshed ns closely

Rachel Westmacott08:03:27

oooh, interestingā€¦ ā€¦but I have no cljc

dominicm08:03:39

You don't. A cljs library you use might.

dominicm08:03:46

(e.g. bidi)

Rachel Westmacott08:03:57

I do use bidi (but not in my cljs)

Rachel Westmacott08:03:05

still, it might be somewhere

dominicm08:03:43

šŸ˜‰. That's a good potential cause.

reborg09:03:43

Re: on knowing more about the content of the clj std lib, reasons, opportunities and suggestions šŸ™‚ https://labs.uswitch.com/an-introduction-to-the-clojure-standard-library/

reborg09:03:26

Ps. that's really our office library! šŸ™‚

dominicm09:03:56

That's pretty cool

rickmoynihan10:03:51

Thought you folks living in the big smoke would be interested...

thomas10:03:19

hmmm nice one

korny11:03:49

Nice - now can you do price per area per commute time? šŸ™‚

korny11:03:53

And extend it to us hicks who live outside the M25 šŸ™‚

rickmoynihan11:03:51

korny: I didnā€™t do the visualisations, and have never met the person who didā€¦ but we did do the data publishing work for the EPC data release which made this possible ( https://epc.opendatacommunities.org/ )

rickmoynihan11:03:28

so you can access the data and make your own šŸ™‚

korny11:03:42

Nice - by the way, is there any public data around property boundaries and the like? In Aus there was an awesome online map where you could browse all open property data - right down to individual property boundaries. It'd be handy to have something similar here...

korny11:03:54

The aus one is at http://services.land.vic.gov.au/maps/pmo.jsp (at least for Victoria)

glenjamin11:03:17

i think some people at the land registry were intending to publish that as open data

glenjamin11:03:30

but i also heard the land registry was being sold off to a private firm

korny11:03:37

I guess as I'm working in http://gov.uk I should ask around here...

otfrom12:03:02

rickmoynihan that's your publication? nice one šŸ˜„

otfrom12:03:37

korny lots more data available to gov't people than generally to us who rely on the OGL

rickmoynihan12:03:52

otfrom: well we built the app, prepped the data, and host and maintain it. Had to publish the data as is, so couldnā€™t clean it etcā€¦ the publication and data is the DCLGs.

otfrom12:03:39

well, by publication, I mean that you liberated it from DCLG's data dungeon. šŸ™‚

rickmoynihan12:03:18

thatā€™s one way of putting itā€¦ I wonā€™t comment on the accuracy of that statement though šŸ™‚

mattford12:03:36

Cool visualistion! In the bottom half of the map thereā€™s three super expensive satellites? What might they be?

mattford12:03:43

They seem very out on their own.

mccraigmccraig14:03:17

anyone know anything about java-2d in-memory representation ? i'm seeing a 5k^2 image OOM a 1GB jvm... though a trivial estimate would put that image unpacked to 200MB

Rachel Westmacott15:03:18

the image is 5k x 5k pixels?

Rachel Westmacott15:03:01

how many bytes per pixel?

Rachel Westmacott15:03:35

assuming 4 bytes per pixel:

(* 4 15000 15000)
=> 900000000

Rachel Westmacott15:03:46

(if youā€™re using a BufferedImage somewhere then this may explain: https://docs.oracle.com/javase/7/docs/api/java/awt/image/BufferedImage.html)

mccraigmccraig15:03:42

yeah, the image was 5k x 5k px

mccraigmccraig15:03:18

i assumed 8 bytes per pixel - 4x16-bit color chans, giving me ~200MB (i think you estimated a 15k^2 image)

mccraigmccraig15:03:22

anyway, looks like resizing the image to a few different resolutions was requiring ~600MB in total... works fine on a 2GB jvm

agile_geek17:03:08

Found this quote I hadn't seen before that struck a chord with the way I need tests. > The real value of tests is not that they detect bugs in the code but that they detect inadequacies in the methods, concentration, and skills of those who design and produce the code. - Tony Hoare

glenjamin18:03:50

Iā€™d say thatā€™s true of the process of creating good tests, but not a property of tests themselves

glenjamin18:03:41

although i suppose being reminded of what something is supposed to do after youā€™ve changed it would allow you to have less concentration and skill