« first day (3864 days earlier)      last day (1067 days later) » 

3:00 AM
@Kevin thanks for the code, I will try to trace it with a debugger, my mental debugger is just not good enough to understand this at first sight
also cbg room 6
 
 
5 hours later…
8:10 AM
cbg
 
8:30 AM
I've got a weird issue with Pandas. I'm using a colleague's code and at one point they have loc_pairs = unique_destinations.merge(unique_collections, how='cross'). This throws an error for me: pandas.errors.MergeError: No common columns to perform merge on. Merge options: left_on=None, right_on=None, left_index=False, right_index=False. That would be fine, but for the fact...
... That the docs say explicitly "When performing a cross merge, no column specifications to merge on are allowed."
 
Alright, I was looking at the source code, but after seeing cross_col = f"_cross_{hashlib.md5().hexdigest()}" I don't think I can do this anymore
 
Oh my
I have a lot of respect for this colleague too, so I'm increasingly inclined to think they've broken something in a later release. Question is; do I want to see the kind of things you've just seen?
Stuff like this is not helping my confidence :'(
Yeah, I'm done. That module is just littered with #TODO and this . I think I'll just downgrade and hope
 
8:58 AM
@roganjosh for what it's worth that doesn't sound like a contradiction. You can't specify columns: pandas infers them. And in this case it couldn't infer.
 
What's there to infer for a cross product, though?
 
No idea what that is :P
 
Ok. I've switched to a virtualenv and installed his requirements.txt and it's now working. I was trying to avoid that at the start just to mess about a bit with some ideas. Pandas definitely changed/broke their cross merge. I'll find the working version... once this gigantic model runs to completion
Or I could just open another terminal :P (it's still too early for me!). Works in pandas==1.2.1. Doesn't work in pandas==1.1.4
So I guess I'm late to the party on finding the bug
 
Why aren't you on new pandas in the first place?
 
9:11 AM
Why should I be? Given my little snippets of code links of "should we be doing this?" and "Ugh, spaghetti", would you charge headlong into upgrading to every new release?
 
Probably :P Especially when something is already broken.
 
Umm, would now be a bad time to point out that the docs say 'cross' was added in version 1.2.0?
 
No, it would be the time for me to eat my hat
 
That would be an unorthodox error for that
@Aran-Fey explains the bug reports I couldn't find
 
@roganjosh Taking an early lunch? Bon appetite
 
9:35 AM
@AndrasDeak remind me never to challenge you to a game of Jenga :P
 
Hi everyone
I am trying to add a timezone value I have as hours using timedelta but since timedelta doesn't support float values I am having a problem ( the float value being 5.5). How do I adjust for it using an alternative if possible?
Is the only option here to convert that '0.5' into minutes or seconds ?
 
Probably, or using actual timezones
Subtracting yourself sounds like a bad idea
 
Why does timedelta care about time zones?
 
Could you please elaborate what you mean by 'actual timezones'? @AndrasDeak
 
@roganjosh implementing time zone conversion with timedelta
 
9:44 AM
Oh no, I've just exploded a question bomb in my brain. Now I wonder what days=1 means when it comes to things like daylight savings
 
@RaphX make your datetime timezone-aware and let the library convert to a different timezone
Doing dates right is Hard
This is like crypto and parametrized sql queries. Let the library do it right.
 
The library says:
class datetime.tzinfo
An abstract base class for time zone information objects. These are used by the datetime and time classes to provide a customizable notion of time adjustment (for example, to account for time zone and/or daylight saving time).
So it doesn't mention timedelta
If you're using timedelta to account for timezones then that's flat-out wrong @RaphX and I agree totally with Andras. If you're trying to use timedelta in a way that is timezone aware, then I've realised I don't have a clue how that actually works
 
thanks! @AndrasDeak @roganjosh
 
9:59 AM
semi related, i heard great things about arrow for timezone shennanigans
 
cbg :)
 
cbg :)
 
 
2 hours later…
12:14 PM
My faith in coding challenge websites has sunk lower than ever after seeing two O(N^2) solutions on top of the "Best Practices" leaderboard (for an O(N) task)
 
Maybe they're O(N^2 / 1,000,000,000), which is still O(N^2), but perhaps satisfactory for smallish N
 
that's still not how big-O notation works ;)
 
Where you see problems, you could perhaps see an opportunity to dominate the leaderboard <you're welcome for my inspirational words, courtesy of the adverts for our mental health services at work>
 
"best practices" sounds like something assigned manually
 
Indeed it is
 
12:19 PM
I hereby define Big K notation as "however I think big-O notation works"
 
I'm practicing Java for a potential job interview, but I'm starting to think I don't want that job after all... Java is driving me up the wall
 
The worst big-Offender I've heard of said in a university lecture "O(n), so for n=10 it's O(10), for n=100 it's O(100), for n=10000 it's O(10000)"
 
By a student or the teacher?
 
lecturer
 
The selected solutions have O(log z) performance, where z is the number of solutions submitted, and performance is measured by amount of time the underpaid intern spends picking one that looks good enough
 
12:21 PM
Ouch.
 
yup
 
@Aran-Fey we're making a new one
coding challenge website that is
 
With blackjack! And hookers!
 
RIP Antti's reputation
class Solution is a must
Will you run users' code yourselves? Because then I have already lost faith :P
 
@Aran-Fey I'm curious about why you're going for java?
 
12:22 PM
unless it's python-specific
 
@AndrasDeak python-specific.
 
OK, hope there still is
 
and yes, will run users' code ourselves naturally :P
AND ast parse it etc...
 
whitelist-based, I hope
 
@roganjosh My dad (kinda) knows a guy who works there, so...
 
12:23 PM
nope,
 
I've spent an entire week trying to get into the bowels of jsprit and I'm currently re-writing it to special-case the problem we're solving.... but in python
 
I guess AST can be filtered
 
@AndrasDeak running inside a container inside a C debugger, so good luck trying to break out...
 
blacklist based, we simply reject all solutions for which "eval" in solution is True
Airtight
 
@AnttiHaapala How does the C debugger increase security?
 
12:24 PM
Maybe it sets up a tiny little venv in which the assembly runs
Just a smidgen of memory space and some stubbed out OS calls
 
By venv do you mean something more than a venv?
 
@Aran-Fey I've jokingly suggested before that we'd have a position for you at the place we work. Given all the remote working, I'm still happy to put you forward for something btw
 
Wait, does "C debugger" mean "a Python debugger written in C" or "a C debugger, written in whatever"
 
C debugger running CPython, I bet
 
@Kevin actually ... it is C debugger written in Python :P
 
12:26 PM
Now that's pulling yourself up by your bootstraps
 
so in Linux there is a thing called seccomp
 
Run the C debugger in Python that's running in a Python debugger written in C, for additional security
 
@Kevin wait until you hear that the outermost python is run by the C in the C debugger
 
@roganjosh Hmm. I don't think it's a good idea to pick 100% remote job (in another country, no less) for my first job in IT. Seems like a big leap to make. I'm more of a baby steps kinda guy (:
Thanks for the offer though
 
there is seccomp-bpf which allows writing small kernel-level opcode programs that detail what system calls can be run...
 
12:29 PM
I hope everybody is keeping a remote position open for me, for the day I abandon the widget logistics industry and retreat to a cabin in the woods (with cable)
 
... so the trick is to kill the program on almost all system calls, except the very few that are safe as-is, or then some that instantly drop into the C debugger which can then inspect the state of the arguments
 
Antti's coding challenge site will have "nice try" wall of shame instead of "best practices"
 
@Aran-Fey My first programming job was for a company in Dubai and I was head of Data Science with only a little MATLAB experience behind me and no other programming experience :P
 
@AndrasDeak that's good one
 
Wow
 
12:31 PM
If you don't have faith in yourself @Aran-Fey, I do. And I'm not a "people" person. Add me on LinkedIn
 
@roganjosh Remote? What was the name
 
Fetchr
 
The courier service?
 
I don't have a LinkedIn. Should I have a LinkedIn?
 
Yes
 
12:32 PM
anyway my coding challenges will be something like "do this transformation using dictionary comprehensions", or "write a function that given an iterator returns 1 if there is one and only one true in the argument, without using any loops yourself" and while, for, nested functions etc banned :P
 
I feel an odd nostalgia for the "verb+R" startup naming scheme
 
You'll get a huge amount of annoying crap, but holy yam @Aran-Fey why aren't you publicising your blog etc.?
 
@roganjosh Well there is a warehouse unit of it in my locality here
 
@Aran-Fey yes.
 
@CoolCloud I don't work for them any more. That was years ago. Dare I ask how it's working now?
 
12:34 PM
It is the place where all the uncool entrepreneurs and professional handwavers pat each other on their back.
 
@roganjosh Nope, no idea. Google told me about it being here
 
basically, I guess, using the verbr naming scheme, LinkedIn could be more appropriately named CircleJ*rkr.
 
Oh, well don't blame me if they screw up :P I've moved on
 
"crcljrkr" is surprisingly pronounceable, to my eyes
 
@AnttiHaapala lol. I couldn't find a way to express LinkedIn but you've done it for me
 
12:36 PM
@roganjosh Atleast their website looks nice, unlike others
 
you're sending mixed signals to Aran-Fey
 
@roganjosh btw connection req sent
@AndrasDeak what's wrong with good ol' cj?
 
@roganjosh Well, I'm only just starting to get into the job market. Never had enough time for a "real" job in the past, with university and helping out my dad with his work
 
Just heads-up that I was repeatedly told that one shouldn't give their main phone number to recruiters, because they will sell your data and you'll still be spammed years later.
 
@AndrasDeak True
 
12:39 PM
get a dual sim phone :P
with a burner prepaid
 
@Aran-Fey I think I'm well off with your age then. I thought (ballpark) 35
 
That's my ballpark age and half the time I don't consider my job "real"
 
I always thought Aran-Fey was somewhat younger
 
Wow, and here I thought I'd made myself seem younger than I really am!
 
heh
 
12:46 PM
making CRUD apps isn't true Computer Science
 
you're welcome
How can jobs be real if companies aren't real?
 
I'm, uh... *does some quick maffs* 28 btw
 
I can't even guess at your age, @Kevin. I've mentally bundled up with your general mystique
 
that's alright I think, people who don't wish to disclose such PII shouldn't be guessed at anyway
 
As a perfectly reflective hovering orb, most ways to deduce age are ineffective on me
 
12:48 PM
lol, when I was 20 and was writing flaming emails at a multinational corp about the crap the team in the states had written, then this Irish guy, 60 yo with white beard comes to visit Finland and he's like "omg I thought you were of my age or sth" :D
 
guesses are PII now? :P
 
well, he literally didn't say "omg -- or sth"
@Kevin I've reduced my age estimate of your age to the range [23, 90]
 
Sounds about right (or is it?)
 
[10,90] seems apt
 
No, I think we can rule out [10, 23]. Or can we?
 
12:52 PM
@CoolCloud well it is possible if there have been multiple people impersonating as Kevin over time.
 
Trying to remember if I've ever claimed to have voted or driven or rented a car
 
Hmmmm Kev1 and Kev2 or maybe till Kevn :p
 
@AnttiHaapala The Dread Pirate Kevin has been terrorizing rooms/6 for generations
Kev[n]... That's a good one
 
Sometimes they mess up and show up at the same time. That's why we had 3 Kevins for a while
 
Some bug in system prolly
 
12:55 PM
@Kevin I might or might not reveal that the only time someone has DUI has been both unlicensed and underage so idk HOW much it would reveal...
 
True, one can attempt to do any of those things at any age, and perhaps even get away with it
 
underaged to do either legally in their home country...
 
Living near the NJ/PA border, I hear stories of the period where the drinking age for the two states were 18/21 respectively. Apparently it was quite routine for young adults to cross over the river just to find a bar that would serve them.
Wikipedia tells me this was from 73 to 80ish
 
This is just misdirection :P
 
@Kevin here in that time 73-80ish, in Sweden butter was so much cheaper that many people would take a bus trip of 100+ km to Sweden to buy butter
 
1:10 PM
wasn't butter always cheaper?
 
I have a passing familiarity with the Swedish Butter Predicament
Or am I thinking of the Norwegian butter crisis... That one was in '11
 
there was specifically a weight quota on butter and margarine per person at Finnish customs
 
> A number of individuals were apprehended by the authorities for attempting to smuggle butter across the border,[15] while Swedes posted online adverts offering to drive butter to Norwegians at prices of up to NOK 460 (€59; £50; $77) per packet.
 
sounds like the UK milk monopoly :d
 
Fa"moo"sly, cows can only graze on our sweet pastures (separately what on Earth are you talking about?)
The UK has a monopoly on milk? It's news to me that we even export milk
£1.5bn in exports of milk products. Ok. I'll shut up
Still, you can have cows. I don't think we're fighting that :P
 
1:52 PM
I've got a nonzero vector, V, and a scalar s. I want to find a vector parallel to V, with magnitude ||V|| + s. Is there a name for this operation? The internet insists that "vector-scalar addition" is intentionally not defined.
It's easy enough to solve for symbolically: V * (1 + s/|V|). Now I just need a name for my function.
 
2:11 PM
@Kevin not that I know of
 
I'm calling it "V extended by s" for now. I think it goes wobbly if I change basis vectors and/or do affine transformations on the plane, but that's not a practical issue for this XY problem.
 
It's not a linear operation
 
Oh yeah, that reminds me of another terminology question I came up with last night. Is there a name for an affine transformation that turns circles into circles?
Rotation is circle-preserving, and so is translation, reflection, and scaling both X and Y by the same value. Skewing is not circle-preserving. Most randomly chosen transformation matrices are probably not circle-preserving.
(Insofar as it is possible to randomly choose an object that is isomorphic to a four-tuple of arbitrary reals)
 
Angle-preserving?
 
Hmm, yeah, I think that's equivalent. Any thoughts on how to test whether a matrix is angle preserving? I'm toying around with testing that |m*J| == |m*K|, where J and K are axis-aligned unit vectors.
 
2:26 PM
That could work. I think eigenvalues have to be unit length.
 
How do people deal with load balancers in highly available multinode clusters?
afaik people typically have multiple instances running of their uService to share the load
but it is the load balancer that acts as a sort of broker in these cases
what about the load balancer itself?
if you have multiple instances of a load balancer to not overload it, you need another broker again to distribute the load over the balancers
so if you go down the rabbit hole it is an endless game
 
Well, this isn't a python question, but I'll entertain it because I don't know what room you should use. NginX can be the broker
We've got kubernetes scaling the backend but I don't know enough about that, tbh
 
@roganjosh I know. But I thought this room would be my best bet to get an answer to my question.
Also
Why aren't there more microservices written in C? It looks like most of them (based on what I found online) are written in Python or Java
 
same reason why python and java exist even though we had C.
 
If you think about it Linux is actually an ecosystem of microservices. And everything there is written in C
 
2:40 PM
Now it's becoming very subjective
 
mathworld.wolfram.com/SimilarityTransformation.html looks relevant to my interests, although I don't see a trivial way to construct a similarity tester
 
@Kevin I don't think so. That relates two matrices
 
Wishful thinking on my part then :-)
My cocktail napkin math simplifies to a fairly straightforward conclusion:
For a matrix representing a 2d affine transformation on homogeneous coordinates,
    m =
    a b c
    d e f
    0 0 1

m is circle/angle/similarity preserving iff
    (a+c)^2 + (d+f)^2 = (b+c)^2 + (e+f)^2
As expected, the equality holds for all conventional rotation/translation/reflection/XY-scaling matrices
 
2:55 PM
@wwii I disagree entirely. Why do you think they're doing that?
 
"but can't get to name each list with a unique name" , "How can I save each table with different names in the loop output i.."
 
"How can I save each table with different names in the loop" doesn't mean they're looking to fiddle with globals() or anything; it could be a database table
 
OK, I asked them in a comment. We/I can wait for a response.
 
Perhaps you could also test m by proving that m/det(m) is an isometry, although that might require extra bookkeeping if using homogeneous coordinates
 
@Kevin right, xy scaling too
 
2:59 PM
@wwii sure. It's odd enough for me to be defending a scraping question at all
 
So: both eigenvalues have same magnitude?
 
I don't have super good intuition when it comes to eigenvalues, but I'm going to say "yes"
 
@roganjosh I originally thought they were having trouble getting the (html) tables or the name attribute for those tables.
 
Re-reading @wwii I've got myself confused. Maybe they want variable variables, or they need a nudge in the right direction. As it is, I'm inclined to vote close it
 
Unfortunately all too often I don't thoroughly read a question before pulling a trigger.
 
3:08 PM
The tie-breaker for me is that it's just scraping. It's not gonna get attention from me.
 
4:02 PM
cabbage
 
@roganjosh milk marketing board
not your monopoly on milk but the monopoly on your milk
 
 
1 hour later…
5:22 PM
Anyone familiar with the upcoming pattern matching feature in 3.10?
 
it's come up here a few times
 
I'm watching a PyCon presentation about it. I'm not sure how I feel about it...
the example given doesn't seem to really show its strength
 
oh its powerful for sure
 
Very powerful and complex for very few use cases. Perfect python material :P
 
it makes the walrus operator look a sensible idea :)
 
5:33 PM
indeed :P
 
@Code-Apprentice You mean something like the switch statement?
 
(mind you - I have find a few practical uses for the walrus operator - so I'm not anti-it...)
 
I'm starting to like the walrus
 
i can't wait for people to think its a switch statement and use it that way
 
@JonClements nah
pattern matching > asspressions still
 
5:34 PM
im not anti patma either, it's just another one of those "so easy to abuse" things though
 
@12944qwerty yes, it looks a lot like a switch from C or Java
but more complex
 
Yeah... I'm not sure if I'll use it.. I'm probably going to be using if elif else statements either way
 
@12944qwerty it actually has different uses than just as a switch statement. It allows you to extract data from more complex data types in a concise way.
and to perform different actions based on the shape of the data.
 
@Code-Apprentice I am looking forward to it
the use case is very common... pattern matching of JSON-formatted messages.
 
I know, but I think it could be done easily with conditions. I think it's like a shorter if elif else....
 
5:37 PM
@ParitoshSingh harder
 
@AnttiHaapala I'll definitely keep it in mind and look for situations where I can use it. The first example from this pycon talk was an area() function and my initial reaction is why isn't that just a member method of the class?
I'm just so used to doing a lot of OO in Python
 
@Code-Apprentice with many protocols the structures are not even well-defined etc.
and no, you absolutely cannot use if/else/elif for that.
it is utterly unreadable mess.
 
@12944qwerty yah, pattern matching doesn't necessarily add any new computational power to python. You can do the same thing with other constructs
 
so for example:
 
@AnttiHaapala "unreadable" doesn't mean "you can't do it".
 
5:39 PM
well, you don't know if it is right, because, it is unreadable.
 
yah, I think the power of pattern matching will be to make code more understandable in some situations.
I'll have to dust off my Haskell and apply the way I think there to Python now.
 
foo = {"cmd": "spam", "args": {"first": "alot", "extra": 42}}

match foo:
    case {"cmd": "spam", "args": {"first": str(argvalue) }}:
        print(argvalue)
    case _:
        print("Malformed message")
so how to write that otherwise:
 
ooohh...yah, that's really nice
 
Hm, that's not easily possible in conditions
 
now you would have to write if foo.get('cmd') etc...
 
5:45 PM
how does that even work o.o
 
@12944qwerty simple. stop thinking switch. start thinking "constructs" and "deconstructing" the input
 
@12944qwerty is basically tuple-unpacking but for a dict
 
calling patma a switch is honestly an insult to what it can do, and where it's really appropriate.
 
something like this:
try:
    if foo["cmd"] != "spam":
        raise Exception()

    argvalue = foo["args"]["first"]
    if not isinstance(argvalue, str):
        raise Exception()

    print(argvalue)
except Exception as e:
    print("Malformed message")
 
5:47 PM
@AnttiHaapala Thanks for that example. That makes things click a lot for me. Definitely more than the area() example from this talk.
 
you can use it with dataclasses too:
from dataclasses import dataclass

@dataclass
class InventoryItem:
    name: str
    unit_price: float
    quantity_on_hand: int = 0

x = InventoryItem("hammer", 0, 42)

match x:
    case InventoryItem(unit_price=0):
        print("Free stuff")
 
@AnttiHaapala this doesn't check for the "extra" key?
 
IDK what dataclasses are
 
@12944qwerty it doesn't, because that's how dictionary matching happens
 
@12944qwerty nope, it just ignores 'extra'.
 
5:51 PM
it is possible to test that too:
 
@AnttiHaapala surely unit_price should be Decimal :)
 
foo = {"cmd": "spam", "args": {"first": "alot", "extra": 42}}

match foo:
    case {"cmd": "spam", "args": {"first": str(argvalue), **extra_args}}:
        print(argvalue, extra_args)
    case _:
        print("Malformed message")
@JonClements you can go make a pr to the dataclasses docs :P
 
@AnttiHaapala or you can match 'extra' explicitly, right?
 
yes...
with sequences it is explicit...
 
case {"cmd": "spam", "args": {"first": str(first), 'extra': int(extra)}}:
like this?
 
5:53 PM
Hm, is there a python 3.10 interpretter available yet? Like beta testing or something?
 
i believe so, yah
 
x = "count", 1, 2, 5, 3

match x:
    case ("count", 1, 2, 5):
        print("Three, sir, three")

    case ("count", *rest):
        print("Here, and rest was", rest)
> Here, and rest was [1, 2, 5, 3]
 
where is rest defined?
So matching unpacks it all, and loops through it to make sure it's same?
 
Hello. What is the most used Python tool to plot a 2D parameter space?
 
matplotlib i think
 
5:58 PM
I mean specific package before the plot
 
@Marco "matplotlib"
 
 
Question, I submitted an edit. But I realized I have to edit one more thing. Can I edit my edit by clicking the button or does it make a new edit?
 
For examples
 
6:01 PM
@12944qwerty Edits the old one, AFAIK.
 
@Marco You want a visual 2D type of thing? Try matplotlib.org
@CoolCloud Ok, I hope that's what happened....
 
Which question?
 
@12944qwerty You mean use the parametric space?
 
@Marco Yes...
@CoolCloud I did it with two questions by accident oops. Should I link? (both are new contributor's posts)
 
@12944qwerty I could accept the edit
 
6:08 PM
You could, but it was just formatting problems.
 
@12944qwerty Thanks. This is a common use? stackoverflow.com/questions/62285945/…
 
6:49 PM
I don't think I understand what you're asking. That's 2D plotting with matplotlib, which has been suggested a few times to you. You're coming across as though you think you have an edge case but with nothing to show how it would be
 
I already understood that using matplotlib is enough, my last question was if the case I showed is a common case.
 
@AnttiHaapala tbh I was shocked and amazed we exported anything other than finance :P
@Marco plotting a squashed circle?
 
@Marco what are you really trying to ask? See also chat.stackoverflow.com/transcript/6?m=51387652#51387652 I guess
 
A pattern emerges...
@Marco we're a helpful bunch (in your case, perhaps more than you expect). It really helps us to be specific on what you're asking or we'll just mentally fill gaps as we can, to try help you. We needn't do that if you're specific
 
7:11 PM
@roganjosh I am not talking about your milk exports. I know you export cheese, but it is not worth it.
There are two worthy exports from the UK: Scotch whisky and Scotch Irn Bru.
 
I'll have you know that cheese is news-worthy every so often.
And your last comment is just baiting, so I'll leave that be :P
 
7:26 PM
@AnttiHaapala "from the UK (as of May 2021)"
 
7:44 PM
Reinventing millennium old math: I found the intersection of a vector and a circle, without using angle math. And the symbolic solution is a mere 1104 characters long
Now I can look it up and see the nice version that Archimides wrote on a grain of rice in 7 AD
A lot of approaches include the step "now apply the quadratic formula, very painfully, to this expression of like eight variables", so I'll pat myself on the back for inadvertently avoiding that
 
OK, @AndrasDeak and @roganjosh. Thanks.
I verified that I just needed a simple 2D plot. The word parameter space can mean something very simple or more complex, but that uncertainty was clarified by other information that I obtained myself.
It is only necessary to plot several functions on the same graph.
In my case* it is only necessary to plot several functions on the same graph.
 
8:16 PM
I have lots of questions, but they won't be helpful for you. In any case, I don't know what you're asking now. matplotlib will do exactly what you need out-of-the-box
 
8:26 PM
@roganjosh I have no more doubts, thank you.
 
8:51 PM
cbg
 
cbg
Been 4 days and OP hasn't accepted an answer or even reply to anything. sigh stackoverflow.com/questions/67506892/…
 
@CoolCloud and what do you want me to do? Downvote your answer?
 
@CoolCloud Many do that unfortunately :(
 
@AndrasDeak If you wish so :)
 
Mar 22 '18 at 11:19, by Andras Deak
Accept on a dupe I answered 2.5 years ago... probably a new record
@CoolCloud Which is to say, stop complaining here unless you have something actionable for us to do.
 
8:55 PM
@12944qwerty Typical
 
Wow... 2.5 years damn
 
9:19 PM
Not really worth of a question IMO so... Consider this list of tuples a = [(1, 1), (3, 4), (3, 2), (2, 4)]. I want to get the max on it based on the first value and that can be done with max(a, key= lambda tup: tup[0]). However, in case of a "draw", I want to get the tuple that has the LOWEST value on the second tuple index. If it was the other way around, I could do with max(a, key= lambda tup: (tup[0], tup[1])) but that's not the case..
Is there a way to do this with a one liner?
 
So (tup[0], -tup[1]) then
 
Have you been able to do this in multiple lines?
 
Lol, time to stop programming for the day. Thanks @Aran-Fey
I haven't tried, @12944qwerty
 
eh, it's nice to see a straight-forward question tbh
 
I'd suggest trying multiple lines, then compact it. That would be a lot easier
 
9:22 PM
True. Questions that go Question -> Answer -> Done are the best kind of questions
 
Those exist?
I thought it was "? -> guess -> ??? -> cautious guess -> ?!? -> crystal ball shaking -> actual question -> ugh, answer"
 
are you not entertained (seeing the turnaround)?
 
You forgot the facepalm
 

« first day (3864 days earlier)      last day (1067 days later) »