ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Check also http://www.picolisp.com for more information
ubLIX has quit [Quit: ubLIX]
joebo has quit [Ping timeout: 260 seconds]
joebo has joined #picolisp
joebo has quit [Ping timeout: 250 seconds]
joebo has joined #picolisp
aw- has joined #picolisp
xkapastel has quit [Quit: Connection closed for inactivity]
rob_w has joined #picolisp
<tankf33der> morning
<tankf33der> I will ignore this task
<tankf33der> insane.
<Regenaxer> I don't understand it at a short glance. What do you think is the difficult part?
groovy2shoes has quit [Excess Flood]
groovy2shoes has joined #picolisp
rgrau has quit [Ping timeout: 250 seconds]
<tankf33der> everything. sometimes i dont understand.
rgrau has joined #picolisp
<Regenaxer> Me too
<Regenaxer> At least I would need some time to meditate on it
<tankf33der> i dont have energy, every year is harder and harder.
<Regenaxer> BTW, I'm now working on a function to make imports of large amounts of data into the DB easier (and - most of all - faster)
<Regenaxer> An old problem, and not so trivial to generalize
<Regenaxer> I'm now testing with an import of 100 million objects
<tankf33der> how faster now ?
<Regenaxer> a lot
<Regenaxer> In fact, doing it the "naive" way is not usable at all
<Regenaxer> as you noticed
<tankf33der> yea
<Regenaxer> I always did a lot of tuning in the past
<Regenaxer> But I had to program it new each time
<Regenaxer> The reason is disk cache
<Regenaxer> If an index is larger than RAM, it does not fit into the caches, and import slows down
<Regenaxer> almost stops
<Regenaxer> Now I think I found a generic way
<Regenaxer> If it works out well, I'll include this function into @lib/db.l
<Regenaxer> The name is 'create'
<tankf33der> maybe possible import NY taxi data then ? and make marketing announce ?
<Regenaxer> Would be a great test - but better no marketing yet ;)
<Regenaxer> I need to test and optimize more
<Regenaxer> It still takes time to import a large set of data of course
<Regenaxer> And I must test with big data because the effect gets visible only when the DB is larger than memory
<Regenaxer> An RAM on my test machine is 12 GiB
<tankf33der> afk
<Regenaxer> cu
xificurC has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
xificurC has joined #picolisp
<DKordic> razzy: "(W "Automatic differentiation")"?
jibanes has quit [Ping timeout: 268 seconds]
jibanes has joined #picolisp
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.
<viaken> Anyway, this is what I'm working with: http://sprunge.us/DYdl6M?t=
<viaken> If I uncomment line 16, it segfaults.
<Regenaxer> Not the problem, but better stick with the naming conventions
jibanes has quit [Ping timeout: 272 seconds]
<Regenaxer> (format (pack @X)) needs no 'pack'
<viaken> That's good
jibanes has joined #picolisp
<Regenaxer> (manhattan (X Y)) needs to be manhattan (list X Y))
<Regenaxer> X is not a function :)
<viaken> It's always the stupidest issues I get stuck on.
<Regenaxer> yeah, easy to fall into
<Regenaxer> Is it necessary to build 'manhatten' on the fly
<Regenaxer> Builds a function on every iteration
<Regenaxer> Why not call it directly?
<Regenaxer> (mini '((P1) (+ (abs (- (car P1) X) ... ))) Points
<Regenaxer> (mini '((P) (+ (abs (- (car P) X) ... ))) Points
<Regenaxer> (mini '((P) (+ (abs (- (car P) X) ... ))) Points)
<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'.