gchristensen changed the topic of #nixos-chat to: NixOS but much less topical || https://logs.nix.samueldr.com/nixos-chat
<qyliss> I love Diffoscope so much
<qyliss> It is one of my best friends
<drakonis> please toss a coin to your reproducible builds friends, for they have done that work
<qyliss> indeed
<lassulus> Would be cool if diffoscope could follow symlnks to store paths snd diff them
drakonis has quit [Ping timeout: 246 seconds]
drakonis has joined #nixos-chat
<gchristensen> any tips on how to get 19 from "foo19" in Python?
<evanjs> gchristensen: Blah. All I'm seeing on SO is regex examples, more or less. Is that something you're trying to avoid in this case?
<infinisil> Regex seems appropriate here
<evanjs> `res = [re.findall(r'(\w+?)(\d+)', string_to_query)[1] ]` seems okayish
<jackdk> gchristensen: (lambda _: 19)('foo19') evaluates to 19
<infinisil> jackdk++
<gchristensen> oh neat
<gchristensen> jackdk: great solution
<evanjs> does that not always just evaluate to the left hand side? I'm probably just typing it in wrong haha
<gchristensen> it does :P
<evanjs> +1 whoosh for me
<infinisil> {^_^}: What's up with you though, where did you put the karma
<infinisil> jackdk++
<{^_^}> jackdk's karma got increased to 6
drakonis has quit [Quit: WeeChat 2.6]
drakonis has joined #nixos-chat
drakonis has quit [Remote host closed the connection]
drakonis has joined #nixos-chat
ivan has left #nixos-chat [#nixos-chat]
Taneb has quit [Quit: I seem to have stopped.]
monsieurp has quit [Quit: Lost terminal]
monsieurp has joined #nixos-chat
drakonis has quit [Quit: WeeChat 2.6]
Remosi has quit [Quit: ZNC - http://znc.in]
Remosi has joined #nixos-chat
Jackneill has joined #nixos-chat
aleph- has quit [Ping timeout: 260 seconds]
FireFly has quit [Quit: Goodbye]
FireFly has joined #nixos-chat
aleph- has joined #nixos-chat
<pie_[bnc]> gchristensen: int("".join([x for x in s if x.isalpha()])) ?
<pie_[bnc]> not sure if the funciton name is correct
<pie_[bnc]> anyway theres probably some reason this is terrib;e
<pie_[bnc]> also not isalpha
<pie_[bnc]> also instead of that maybe isint
<pie_[bnc]> also all the ways it could go bad
<pie_[bnc]> eh just use parser combinators ;P
<Guanin> pie_[bnc], gchristensen I'd go with isdigit: int("".join([x for x in "foo19" if x.isdigit()]))
__monty__ has joined #nixos-chat
Taneb has joined #nixos-chat
Synthetica has joined #nixos-chat
psyanticy has joined #nixos-chat
drakonis has joined #nixos-chat
<monsieurp> Guanin's solution is more elegant
<gchristensen> which was that?
<Guanin> gchristensen, int("".join([x for x in "foo19" if x.isdigit()]))
<Guanin> But it was basically the one from pie_[bnc] with the correct filtering
<gchristensen> ahh oops I missed that one
<gchristensen> nice
<Guanin> as far as I understand it, that one should be the most "pythonic" way
<Guanin> As they prefer list comprehension over higher order functions
<adisbladis> Guanin: It also performs about twice as well as the regex solution
<Guanin> Yeah, regex is nearly never the way to go, in my opinion (not necessarily because it's slow, but because it's a hell to maintain for people not fluent in regex)
<eyJhb> Anyone have experience with vim plugins in Python?
<eyJhb> Guanin: also RegEx is easy to screw up
<monsieurp> eyJhb: whats the actual question wrt vim + python?
<eyJhb> monsieurp: well, basically I am trying to figure out the best way to combine vim+python, to make a simple plugin which takes the current word under the cursor, make a HTTP POST to a website, parses it, displays it using a menu, users chooses another one, another HTTP POST is made and then finally the word is replaced with the chosen one
<eyJhb> So currently I am trying to 1. pass argument to a python function, 2. get the return value from that function (either string or dict)
<eyJhb> monsieurp: this is what I have https://termbin.com/auud (around line 28, testfunction)
neeasade has joined #nixos-chat
drakonis has quit [Ping timeout: 245 seconds]
drakonis has joined #nixos-chat
<joepie91> "You are about to close 927 tabs. Are you sure you want to continue?"
* joepie91 declares tab bankrupcy
<gchristensen> smash that yes button
<joepie91> anyway, that was 1 out of 10 windows...
<joepie91> in fairness, one of the bigger windows
<__monty__> eyJhb: Ah, you're simplifying the StackOverflow programmer's life? : >
* Synthetica checks tab bar
<Synthetica> ... Three
neeasade has left #nixos-chat [#nixos-chat]
endformationage has joined #nixos-chat
drakonis has quit [Ping timeout: 260 seconds]
<Church-> joepie91: snrk
Jackneill has quit [Remote host closed the connection]
mrCyborg has joined #nixos-chat
<joepie91> just got the most bizarre package delivery ever
<joepie91> inside the box, were... boxes
<joepie91> 2 of them empty, 2 of them filled
<joepie91> ... with more boxes, most of them empty
<joepie91> boxes being used as padding everywhere
<gchristensen> I've seen something like that too, pretty strange
<joepie91> this was the final yield
<gchristensen> hilarious.
<joepie91> spot the actual product :P
<gchristensen> that is way worse than mine :P
<joepie91> dear Lidl: perhaps it's time to invest in plastic air bags?
<samueldr> haven't you heard? PLASTIC = BAD
<samueldr> (only sith deal in absolutisms, etc)
mrCyborg has quit [Ping timeout: 260 seconds]
<eyJhb> __monty__: synonyms :p
<eyJhb> But I can't get ANYTHING to work
<eyJhb> Also, the documentation is horrible
<eyJhb> joepie91: I thought you had added a space between the brackets? <>
Synthetica has quit [Quit: Connection closed for inactivity]
mrCyborg has joined #nixos-chat
psyanticy has quit [Quit: Connection closed for inactivity]
drakonis has joined #nixos-chat
mrCyborg has quit [Quit: WeeChat 2.7]
wildtrees has joined #nixos-chat
arcnmx has quit [Ping timeout: 260 seconds]
<colemickens> I don't know whether to be more upset at my battery or the fact that upower can't be told to leave my damn computer alone when the battery reports 1%>
vesper has joined #nixos-chat
vesper11 has quit [Ping timeout: 260 seconds]
drakonis has quit [Ping timeout: 260 seconds]
drakonis has joined #nixos-chat
__monty__ has quit [Quit: leaving]