off-topic

https://github.com/clojurians/community-development/blob/master/Code-of-Conduct.md Clojurians Slack Community Code of Conduct. Searchable message archives are at https://clojurians-log.clojureverse.org/
idiomancy 2021-03-18T12:05:47.024400Z

does anyone happen to be a geolocation pro? im trying to figure out if ip addresses follow rules such that i could geolocate on only, eg the first two blocks of an ip address -- to just get a narrowed down location, like the country or even continent of origin like 71.59.66.61 -> 71.59.xx.xx -> USA

idiomancy 2021-03-18T12:06:47.026200Z

basically i want to bin these ips in some way that reduces the number of geolocation calls I have to make

idiomancy 2021-03-18T12:07:05.026700Z

because i have 500k or so

idiomancy 2021-03-18T12:07:38.027600Z

(analysing activity logs to find regional patterns)

idiomancy 2021-03-18T13:04:01.028700Z

seems like its not that simple

seancorfield 2021-03-18T16:29:51.030300Z

@idiomancy Definitely no simple patterns, Iā€™m afraid. We have a huge database of IP ranges to locations, and we also use https://ipinfo.io to supplement that.

šŸ‘ 1
emccue 2021-03-18T16:51:50.031Z

I had a java lib somewhere that did a rough lookup

idiomancy 2021-03-18T17:50:48.035400Z

yeah i ended up grabbing a free databaae, loading it up locally into a dataframe, and left outer joining it to my ip list, which i quantized into nearest "allocated ip range for country" cutoff

dpsutton 2021-03-18T20:44:02.037Z

a fun day because

update a = null,
       b = (case a ...)
where a is not null
in postgres and h2 uses the pre-updated version of a (ie, before it is "set" to null) whereas mysql uses the updated version of a so its null in the case statement

šŸ¤Æ 2
dpsutton 2021-03-18T21:01:37.037900Z

So thanks to everyone who works on transaction consistency and fighting tearing reads

borkdude 2021-03-18T21:55:34.038200Z

mysql is wrong

šŸ˜† 2
dpsutton 2021-03-18T21:56:36.038400Z

i agree and i didn't like it

dpsutton 2021-03-18T21:57:04.039Z

and it took a while to track down why it could be failing. and it "works" if you select because there's no overwriting. which makes it even harder to diagnose lol

dpsutton 2021-03-18T21:59:21.039500Z

ie select what your update will do rather than actually set things

phronmophobic 2021-03-18T22:01:23.040Z

it might also depend on your mysql settings and if you're using InnoDB? https://dev.mysql.com/doc/refman/5.7/en/innodb-transaction-isolation-levels.html

dpsutton 2021-03-18T22:02:28.040900Z

quite possibly. locally its just brew install and let 'er rip. but that is what customer environments could look like as well. but was just super surprising and did not endear mysql to me