razzy` has quit [Quit: ERC (IRC client for Emacs 26.1)]
razzy has joined #picolisp
<viaken>
tankf33der: Not sure how much help you want, but in mathy terms it's asking you to find the largest noninfinite Manhattan Voronoi cell. The solution space isn't big enough to worry about fancy algorithms for it. You can iterate over the grid 0, 0 to max-x, max-y and check each point to see which is closest. Removing the infinite cells is the only trick and there's an easy solution to it.
<razzy>
DKordic: large number of complicated sentences that describe numerical solving of differential equations.
<tankf33der>
viaken: insane.
<razzy>
things do not have to be sane to be usefull
<DKordic>
razzy: Oh, right I wanted to say a cute... "Cons"truction ;) . I wouldn't say differential equations in general :) . Resembles Complex Number arithmetic, right?
<razzy>
hmm, i think i do not understand what you mean, DKordic. i think i do not want to explore it further
<DKordic>
razzy: OK. I thought I could mention it since You asked about Infinitesimals and Infinities.
<razzy>
complex numbers are just 2dimensional numbers in some defined space.(the space have some weirdness i do not remember it)
xkapastel has joined #picolisp
alexshendi has joined #picolisp
alexshendi has quit [Read error: Connection reset by peer]
rob_w has quit [Quit: Leaving]
<viaken>
So, I'm attempting to solve this thing...
<Regenaxer>
cool
<viaken>
I'm running into a situation where I need to (for X (range 1 3) (for Y (range 1 3) (mini (manhattan (X Y)) other-list], but apparently that's not kosher.
<viaken>
Actually, it might be easier to just paste the code.
<Regenaxer>
(for .. (range is not good anyway, as it builds a list needlessly
<Regenaxer>
(for X 3 is enough
<Regenaxer>
Imagine (for X (range 1 10000000, a *lot* or garbage
<viaken>
Well, I can't trust that it starts at 1. I can use the (X 5 (<= maximum-thing X) '(inc X)) for.
<Regenaxer>
ok, then (for (N 7 (>= 22 N) (inc N)) is better
<viaken>
I misread the docs. I thought it was odd to need to quote the increment.
<Regenaxer>
Is this a kind of distance function, avoiding squares and root?
<viaken>
I was having trouble calling it directly, so I curried it hoping that would help. Yes, it's a kind of distance function. It's not so much avoiding squares/roots as it is using a different geometry: https://en.wikipedia.org/wiki/Taxicab_geometry
<Regenaxer>
Ah, makes sense
<Regenaxer>
at least in cities with a grid of streets
alexshendi has joined #picolisp
<tankf33der>
viaken: write working prototype rest i will help
<viaken>
Well, I'm stuck on another silly problem: How can I keep/update a count?
<viaken>
I was going to use a global a-list, but I can't work out how to update it.
<viaken>
Found my problem
<viaken>
I needed another set of parens.
<Regenaxer>
Perhaps you can use 'accu'?
<beneroth>
hey friends
<beneroth>
Regenaxer, cool, I'm looking forward to your new bulk-import function.
<Regenaxer>
Hey beneroth
<Regenaxer>
ok :)
<Regenaxer>
Looks promising so far
<beneroth>
I've got to migrate a database of about 20k main records (with other records attached) into pilDB in January :)
<Regenaxer>
Will let run some tests over the weekend
<beneroth>
nice
<Regenaxer>
oh, 20k is tiny
<beneroth>
T
<beneroth>
no problem, the export takes long (FileMaker), but import is a few min, last time I tried.
<Regenaxer>
So 'create' will not really improve anything
<tankf33der>
viaken: do you have
<Regenaxer>
T
<tankf33der>
pseudo code?
<beneroth>
what do you do? regular gc'ing of index leafs or what?
<tankf33der>
it will help me too
<Regenaxer>
Mainly sorting, traversing and pruning
<Regenaxer>
One index after the other
<beneroth>
Regenaxer, bulk export/import is the main disadvantage on graph DBs over relational DBs (they can do memdump, depending on the requirements), so this might be a very useful optimization :)
<Regenaxer>
the important point is that the btree nodes must be inserted sorted
<Regenaxer>
yeah
<Regenaxer>
Also in pil building complex indexes is expensive
<beneroth>
naturally
<Regenaxer>
+Idx and subclasses
<beneroth>
I look forward to read that code, nice Christmas gift :)
<Regenaxer>
good :)
<Regenaxer>
I'm still tuning some parameter(s)
<Regenaxer>
But basically it is finished
<Regenaxer>
Not very long
<beneroth>
nice. no hurry.
<Regenaxer>
T
<Regenaxer>
The code is only 50 lines or so
<viaken>
tankf33der: Working: http://sprunge.us/QAD8IG?t= - (day6-1 "6_data.txt") will produce the result if 6_data.txt contains the input.
<beneroth>
this 20k records database will be the biggest I have for a while, I think. well I might be able to get a project with a bigger (and growing) database, but I don't know yet if my offer will be accepted.
<viaken>
Regenaxer: Thanks for 'accu'.
<Regenaxer>
viaken, is it useful here?
<beneroth>
it's a ruined project, they outsourced it far away, stuff doesn't work, I recommend redoing the whole thing. Will try to sell them pilDB :)
<viaken>
It is!
<Regenaxer>
perfect
<tankf33der>
viaken: i will test it tomorrow
<Regenaxer>
beneroth: I'm testing with random data
<viaken>
tankf33der: Except I missed something somewhere, because AoC says I got the wrong answer. It is correct for the sample data.
<beneroth>
ah I did some C# today and sincerely missed (group).. Linq's GroupBy() is retarded.
<beneroth>
Regenaxer, good approach! fuzzing!
<tankf33der>
viaken: eh, tricky
<tankf33der>
i will ping you tomorrow
<tankf33der>
viaken: what is yout timezone?
<viaken>
EST
<beneroth>
UTC−5 ?
<beneroth>
or Egypt Standard Time (UTC+2) ?
<beneroth>
or European Summer Time ?
<beneroth>
EST can stand for different time zones
<Regenaxer>
Eastern Standard?
<beneroth>
yeah that would be the one related to USA, UTC-5
<Regenaxer>
In the US everything is related to USA ;)
<beneroth>
yeah, I find this narcissistic :P
<viaken>
UTC-5, yes. I've only ever seen it referred to as EST/EDT, sorry.
<Regenaxer>
"D" is for daylight saving?
<viaken>
yep
<Regenaxer>
I hope summer time switches are stopped in Europe as soon as possible
<Regenaxer>
stupid system
<Regenaxer>
Unfortunately it seems to be not so soon
<viaken>
Habits die hard.
<viaken>
Especially when this many people share them.
<Regenaxer>
yes, sigh
<viaken>
Florida tried to get rid of it this year, but it may have stalled.
<beneroth>
swiss population voted No when daylight saving time was proposed. but it got introduced anyway.
<Regenaxer>
:(
<beneroth>
but I hope Europe will go back to normal (winter) time and not stay on summer time.
<Regenaxer>
Me too. Ethernal summer time would be a horror
<beneroth>
not healthy.
<Regenaxer>
Getting up even one hour earlier in winter
<beneroth>
the daylight saving time were introduced to save some energy in the summer, but that didn't work out.
<beneroth>
yeah
<beneroth>
and more driving in dark in winter
<Regenaxer>
Even now I hate if it is dark when I get up
<Regenaxer>
T
<beneroth>
you can be glad that you mostly work from home. its not unusual in winter to leave in the morning when its dark and only come home when its dark again.
<Regenaxer>
True
ubLIX has joined #picolisp
permagreen has quit [Read error: Connection reset by peer]
alexshendi has quit [Read error: Connection reset by peer]
alexshendi has joined #picolisp
mtsd has joined #picolisp
<viaken>
tankf33der: Fixed another bug, but still doesn't give right answer. I may have to visualize the output to figure out what's going on. http://ix.io/1vpN/picolisp
<viaken>
May not be the prettiest code, but there we go.
<tankf33der>
thanks
<tankf33der>
i will compare with python tomorrow
<tankf33der>
bed.
<tankf33der>
afk
<razzy>
is there only one good answer?
<razzy>
to the manhatten code chalenge
alexshendi has quit [Remote host closed the connection]
mtsd has quit [Remote host closed the connection]
xkapastel has quit [Quit: Connection closed for inactivity]
xkapastel has joined #picolisp
alexshendi has joined #picolisp
<viaken>
razzy: Everyone gets a sample problem and each person gets an individualized problem input. There are 2 good answers. My code solves the sample, but fails at my personalized input.
<viaken>
Also, I might be able to clean that up a bit with 'by'.