00:11
alexshendi has quit [Ping timeout: 256 seconds]
01:08
alexshendi has joined #picolisp
02:14
f8l has quit [Ping timeout: 246 seconds]
02:35
f8l has joined #picolisp
02:50
orivej has quit [Ping timeout: 268 seconds]
02:53
aw- has joined #picolisp
04:21
<
viaken >
Most people who would need to see that probably wouldn't accept that source, but ...yeah. That's a thing.
05:00
<
clacke[m] >
i .. whu ...
05:33
alexshendi has quit [Ping timeout: 255 seconds]
06:08
karswell has quit [Read error: Connection reset by peer]
06:08
karswell has joined #picolisp
06:41
rob_w has joined #picolisp
07:05
<
Regenaxer >
Hi beneroth
07:05
<
beneroth >
Hi Regenaxer :)
08:24
alexshendi has joined #picolisp
08:39
orivej has joined #picolisp
09:00
orivej has quit [Ping timeout: 256 seconds]
09:13
orivej has joined #picolisp
11:04
<
tankfeeder >
hi all
11:04
<
tankfeeder >
(((lena kate) . 100) ((mike lena) . -45))
11:05
<
tankfeeder >
i need something like this ^^^. Dictionary access on two persons with value.
11:05
<
tankfeeder >
any hints ?
11:05
<
Regenaxer >
Hi tankfeeder
11:05
<
Regenaxer >
rassoc?
11:06
<
tankfeeder >
let me try
11:08
<
aw- >
hi tankfeeder
11:08
<
aw- >
interesting question..
11:09
<
aw- >
i did something similar to this recently
11:15
<
cess11 >
When was 'rassoc introduced?
11:16
<
tankfeeder >
21feb15
11:16
<
cess11 >
: (version)
11:16
<
cess11 >
-> (3 1 8 0)
11:17
<
cess11 >
Doesn't look right. Is Debian that much behind?
11:18
<
tankfeeder >
does your json parser can help this part of task ?
11:20
<
Regenaxer >
cess11: Debian testing is now on (17 12 26)
11:20
<
Regenaxer >
Stable on 16.12.8
11:23
<
cess11 >
This is Jessie, tried reinstalling, it seems the package and version it gets are picolisp_3.1.8.0_amd64.deb.
11:25
<
Regenaxer >
yeah, sorry, it is stretch
11:26
<
Regenaxer >
on Jessie I have 3.1.8.0-4
11:26
<
Regenaxer >
Debian is always
*very* outdated :(
11:27
<
cess11 >
Right, same, with -4. I think I'll need to set up some scripts and only build from the rolling release on this machine.
11:28
<
aw- >
tankfeeder: yes, seems like valid JSON.. i just loaded the input and it was parsed correctly
11:29
<
aw- >
also checked with online JSON validator, and it passed
11:31
<
tankfeeder >
aw-: yes, its valid, what about skip numbers if red in object ?
11:31
<
aw- >
well once the data is in a JSON list, then it's up to you to figure out how to "parse" it
11:32
<
aw- >
correction: once the data is in PicoLisp list
11:32
<
aw- >
my parser only converts JSON to Pil lists
11:48
alexshendi has quit [Read error: Connection reset by peer]
11:49
<
tankfeeder >
i see, the same as buildin json.l
12:19
<
cess11 >
'red will always be before ;, right? It would easy to do an initial check for red; with 'match and either fish out numbers in the entire line or just what's left after 'reverse and 'member/similar.
12:21
<
cess11 >
If that is enough it is easier than using a JSON parser, but it could probably be easy too, just put an extra check on the stream in the block that works inside {} that stops the parsing and goes directly to printing the sum.
12:22
<
cess11 >
Or if one can be sure 'red is always an attribute 'match for just this would be good enough I think.
12:37
<
aw- >
yeah there's likely many ways to solve that problem
12:45
mtsd has joined #picolisp
13:13
<
tankfeeder >
new price dumper
13:31
<
beneroth >
hetzner is pretty good, one of the biggest providers in Germany
13:34
<
beneroth >
though they were among the first ones to forbid mirroring wikileaks on their servers back in 2010 (forbidding wikileaks without any legal reason)
13:35
<
beneroth >
this generated some backslash, so they changed their mind again to allow it until someone comes with a warrant (which afaik never happened)
13:38
<
clacke[m] >
2.5 EUR for 2 GB RAM, wow
13:52
<
viaken >
I think I'm paying 5 USD for 0.5GB currently.
13:53
<
viaken >
It's all in Ansible, though. Wouldn't be a hard transition.
14:11
mtsd has quit [Ping timeout: 260 seconds]
14:22
<
joebo >
I'm stumped on fish
14:23
<
joebo >
I want to exclude all lists/sublists that have a 1 in them
14:23
<
joebo >
I would have though this would work
14:23
<
joebo >
: (fish '((X) (not (member 1 X))) '(1 (2 1 3 4)))
14:24
<
joebo >
-> (((2 1 3 4)))
14:38
<
Regenaxer >
Yeah, such negation is difficult with 'fish'
14:39
<
Regenaxer >
It stops when it
*finds* a sublist which satisfies the condition
14:40
<
Regenaxer >
Try this: (fish '((X) (nor (find pair X) (member 1 X))) '(1 (2 1 3 4)))
14:40
<
Regenaxer >
This excludes all lists which have sublists, not sure if it what you need
14:40
<
joebo >
Regenaxer: thanks! It's close
14:41
<
Regenaxer >
The list (1 (2 1 3 4)) doesn't need a quote btw
14:41
<
joebo >
bad habit :)
14:41
<
Regenaxer >
no problem
15:00
<
joebo >
this seems to do the job of what I'm looking for
15:00
<
joebo >
(let L (list (1 (2 1 3 4))) (recur (L) (make (for C L (link (if (not (atom C)) (if (not (member 1 C)) (recurse C)) C))))))
15:04
<
Regenaxer >
good, self-made "fish" :)
15:10
rob_w has quit [Remote host closed the connection]
15:24
<
joebo >
that solves part2 tests
15:24
<
joebo >
I didn't try the full input though
15:25
<
joebo >
that was tricky!
15:25
<
tankfeeder >
ah, you did it.
15:25
<
tankfeeder >
lets try on full input.
15:39
<
tankfeeder >
on full input returns 0
15:44
<
joebo >
how did you injest the full input? I can troubleshoot
15:46
<
tankfeeder >
this is fuill
15:46
<
joebo >
(setq Input (in "/mnt/c/temp/input.json" (line)))
15:46
<
tankfeeder >
yea, for example
15:46
<
tankfeeder >
already choped
15:46
alexshendi has joined #picolisp
15:47
<
tankfeeder >
parse returns something, filterRed returns NIL
15:55
<
joebo >
well noRed is finding a match
15:55
<
joebo >
: (match (list '@X ~(chop "\"red\"") '@Y) (car (parse Input)))
15:55
<
joebo >
seems like this check may not be right
15:55
<
joebo >
or there is tricky data in there :)
15:58
<
tankfeeder >
i'm playing without output from json.l
15:58
<
tankfeeder >
parser
16:00
<
tankfeeder >
output examples from json.l
16:02
alexshendi has quit [Ping timeout: 256 seconds]
16:02
<
joebo >
tankfeeder: I may have a fix
16:03
<
joebo >
can you see if 68466 is the right answer
16:03
<
tankfeeder >
yes, correct
16:03
<
joebo >
updated the gist
16:03
<
joebo >
I didn't account for nested arrays in my initial implementation
16:04
<
tankfeeder >
aha, i see the diff.
16:05
<
joebo >
actually, the nested arrays didn't make a difference... it was testing for :"red" that fixed it
16:05
<
joebo >
instead of "red"
16:06
<
joebo >
either way!
16:10
<
tankfeeder >
commited, reference to you, day 14 tomorrow
16:10
<
tankfeeder >
thanks.
16:12
<
joebo >
my pleasure - fun problem :)
16:17
aw- has quit [Quit: Leaving.]
17:24
alexshendi has joined #picolisp
18:34
karswell has quit [Ping timeout: 248 seconds]
18:53
alexshendi has quit [Ping timeout: 256 seconds]
18:56
alexshendi has joined #picolisp
19:22
<
beneroth >
amazon sells "Amazon smart phones". apparently some are sold cheaper but have ads on the lock screen.
19:22
<
beneroth >
apparently, clicking on this ads unlocks the phone reliably.
20:00
alexshendi has quit [Ping timeout: 256 seconds]
20:13
alexshendi has joined #picolisp
20:58
alexshendi has quit [Read error: Connection reset by peer]
22:12
karswell has joined #picolisp
22:49
karswell_ has joined #picolisp
22:50
karswell has quit [Read error: Connection reset by peer]