« first day (3211 days earlier)      last day (1755 days later) » 
03:00 - 14:0014:00 - 00:00

2:04 PM
Also, the dude is pretty relentless, I'm still getting requests
 
@Quark uhm, assuming you read a string from left to right. you start with getting the longest substring that starts at the beginning of the string, right? as soon as you encounter the first duplicate character, shrink the substring from the left. once expanding to the right is viable again, because the duplicate on the left side was shrunk away, you can begin expanding to the right again.
 
in the end, you traverse the string twice, which is O(n). you solution of finding all unique-character substrings and sorting them by length is .. O(more than n)
 
O(N^2) to get all substrings, O(N^2 log N ) to sort N^2 substrings, O(N^3) to iterate through all N^2 substrings and filter out ones that have duplicate chars
Or, hmm, that last one is actually O(N^2 * (the average length of a substring taken from a string with length N)). Is "the average length of a substring taken from a string with length N", proportional to N?
A string of length N has N substrings of length one, and N-1 substrings of length 2, and N-2 substrings of length 3, and [...] and 1 substring of length N... Carry the one, multiply by planck's constant...
 
And add three for good luck.
 
2:18 PM
What is the simplest example of something that is O(log N)? I've absorbed the general concept of big O notation but can't visualize the O(log N) situation?
 
@Dodge something that works with powers-of-something
 
def digital_sum(x):
    if x < 10:
        return x
    return (x%10) + digital_sum(int(x / 10))
 
you have N-length input and you do something with 10^k as long as 10^k < N
 
where does this question start?
 
8 hours ago, by Quark
Can anyone give me an idea for this problem? - https://leetcode.com/problems/longest-substring-without-repeating-characters
 
2:21 PM
Many "divide the problem space in half and recurse" algorithms are also logarithmic.
E.g. binary search
 
ah, good one
 
Ah... ok. A bit clearer now. Thanks.
 
@piRSquared seems pretty clear to me what he wants to do, but I doubt there is a more efficient way
 
Perhaps "divide in half" is too broad. You can divide into tenths, for example, and still be logarithmic. Dividing into anythingths is fine as long as the number you're dividing by doesn't vary
 
Cool, I can comprehend that. And so that's it, huh... O(1), O(N), O(N**whatever), and O(log N)?
 
2:34 PM
unclear or confusing isn't what I mean exactly. there is a laundry list of things they want to do. They haven't made any effort to boil the problem down. Nor have they provided sample functions to demonstrate what they're after. So they want 1) map several different dictionaries onto different columns (they could look up or ask about doing this for one column) 2) generate random numbers, they could generate random numbers for the whole thing first then mess with the other conditions
3) apply a function result to another column... again this is a question that is easily looked up
@MisterMiyagi
 
@Dodge and O(N log(N)) and O(exp(N)) and O(N!) and ...
any sequence is valid inside big-O, it's just that some of them are equivalent or subclasses of others
 
@AndrasDeak Ok O(n!) is unique but the others are combinations or permutations of the aforementioned basic complexities?
 
In short they're asking three unrelated questions in one. I think that is too broad.
 
@Dodge no, it's not more unique than exp(N), or N^N or whatever
it's just that we like to think in simple terms, and simple in this scenario is "polynomial or logarithmic or exponential or, hmm, okay, I'm running out of go-to ideas"
 
I've read it just as "how do I generate content for all rows at once given some row-dependent function"
but I see what you mean
 
2:38 PM
O(1), O(N), O(N**whatever), O(log N), O(exp(N)), O(N!) and combinations thereof will encompass quite a lot of the algorithms you're likely to analyze but there's definitely no law that says there aren't other possibilities out there
 
@AndrasDeak Hmmm... I meant that O(N!) is an "atomic complexity concept" like O(N) or O(N*N). But I guess that is not helpful to do that sort of categorization.
 
@Dodge what do you mean by "atomic complexity concept"?
 
yes, my point is that this concept probably does not exist
 
Haha, that was in quotes for a reason. I mean there appears to be some basic building blocks in terms of describing computational complexity like the ones that Kevin listed. I tried to describe that with the term "atomic complexity concepts" lol
@AndrasDeak got it
 
Just two pages ago I came up with O(N^2 * f(N)), where f(N) is "the average length of a substring taken from a string with length N". I have since decided that f(N) is proportional to N, so it's not an "atomic complexity" by your standards
 
2:42 PM
@Dodge for instance N! = Γ(N+1) which is asymptotically exp(N*log(N) - N)
 
If I have a reference cycle like this, is there anything I can/should do about it? Implementing __del__ wouldn't help, so is my only choice to let the garbage collector handle it?
class Foo:
    def __init__(self, func):
        self.func = func

class Bar:
    def __init__(self):
        self.foo = Foo(lambda x: self.some_method(x) if x else x)
 
Almost all concepts in math can be described in terms of simpler concepts, so it's a bit of a fuzzy category to call any concept "atomic"
 
there are just some very common complexities because they describe common algorithms/data structures
e.g. O(n) and O(1) directly match native operations on arrays/structs/hashtables
 
That said, you might be able to formalize the definition as something along the lines of "not expressible on one line using only the concepts {addition, multiplication, exponentiation...}"
 
@Aran-Fey I wouldn't worry about it, that is exactly what garbage collection is there for
in case of doubt, use a weakref
 
2:45 PM
Figured it out
def __init__(self):
    self.foo = Foo(weakref.WeakMethod(self._key))

def _key(self, x):
    return self.some_method(x) if x else x
I don't trust the garbage collector with reference cycles anymore after my data compression library used 800MB more than necessary
 
O(hailstone_sequence_length(N)) is atomic, maybe. You get $500 if you can prove otherwise :-P
 
@Aran-Fey as long as you have those 800MB to spare, there is nothing wrong in using it
 
@Aran-Fey If the problem is "the ref cycle detector never noticed that my objects were genuinely 100% inaccessible", that's troubling and may merit a bug report to CPython. If the problem is "my objects didn't get collected because they were accessible by some obscure chain of objects that I don't actually care about", then I worry that weakrefs may cause problems down the line.
 
Nvm, it doesn't work with WeakMethod because calling that only returns the actual method. Where'd I leave my actually useful WeakMethod implementation again...?
 
Then again, weakrefs wouldn't exist if they were never an appropriate solution for this kind of problem... Maybe I just lack the imagination to think up a valid use case.
 
2:55 PM
I'm pretty sure they were inaccessible - when I rewrote the code with weakrefs it used less memory and still worked correctly. I'm not sure why that memory was never freed - maybe the gc never ran because I still had some free RAM? Dunno. But I don't have that code anymore, so I couldn't even make a useful bug report.
I'm pretty sure I've copied my self-made WeakMethod into at least 50% of my projects. I should probably turn that thing into a standalone module.
 
Well, if you find yourself in a similar situation in the future and you're worried the gc isn't running, I think you can manually start it with gc.collect().
 
I know, but I prefer to write my code in such a way that it cleans itself up automatically
 
By calling gc.collect :P
 
...periodically from a background thread? :P
 
docs.python.org/3/library/gc.html#gc.set_threshold talks a little bit about how the gc decides that it's time to run itself. I think it's theoretically possible for it to go an arbitrarily long time without running, but it's hard to imagine a practical program that never does enough allocations/deallocations to trigger an automatic collection
 
3:02 PM
"weakling" is still available on PyPi. Tempting...
 
I don't think "amount of available RAM" is taken into account when deciding collection frequency. Well, maybe it uses it to set the threshold right at the beginning of the program, but I don't think it changes the frequency later as available RAM grows/shrinks
gc.get_threshold() returns (700, 10, 10) on my machine and I see those values in a #define statement in gcmodule.c so I suspect it's constant across all CPython environments
 
3:30 PM
Well this is fun, I might be spending the evening at work at this rate. The dam that's on the BBC that might burst is upstream of the river that flows right past where I work and they're currently closing the bridges around me :/
 
Ooof, sorry to hear that :( The good news is you can finally work on that backlog! (Really, sorry!)
 
This is true, ever the optimist :P
 
How long would it take to drive upstream, past the dam, past the lake being dammed, and then downstream to the other side of the river?
 
There's a lot of people who work here that have been displaced due to the evacuation. They're in a slightly worse position since their houses are on the line. Thankfully I live miles away
Well, there's a full evacuation there, so there's no getting to the dam itself. I know one route round the bridge but it goes down through the valley so I'm guessing it's shut. Problem is, they're not telling us about the closures so it's guesswork
 
 +--->---->---->---->---->--->-+
 |                             |
 ^                             v
 |      *******************    |
 |      *                 *    |
 |      *                 *    |
 ^      *     lake        *    v
 |      *                 *    |
 |      *                 *    |
 |      *                 *    |
 ^      *******************    v
 |             dam             |
 |           *     *           |
 |           *     *           |
 ^           *     *           v
 |           *     *           |
 
3:39 PM
Ah ok. The issue here is that there are several bridges to cross in any direction other than down the valley, and they're shutting the bridges. So it's a case of not getting out of the area I'm in
 
Oh, if it's like this:
                     *******************
                     *                 *
                     *                 *
                     *     lake        *
                     *                 *
                     *                 *
                     *                 *
                     *******************
                            dam
                          *     *
    ***********************     *
    *                           *
    *                           *
    *     *****************     *
Then there indeed seems to be no route out of your peninsula
 
@roganjosh Stay safe, my friend
In other news, I came in to work this morning and realized it's my workaversary
 
Yeah, that's the case, Kevin. And thanks but thankfully I'm not in any danger, the valley is pretty deep on all sides
 
Incensed by the inconvenience, roganjosh coded long into the night... And thus "Uber, but with helicopters" was born
 
3:46 PM
On the upside, I'm pretty sure there'll be plenty of happy people on the night shift :)
You're on to something... <runs off to the engineering workshop>
 
Uber, but with a hundred drones carrying a lawn chair
 
Oh good, torrential rain has just swept in.
 
That's a "no" for the hundred drones plan, then
 
It is a complicating factor for sure
 
force majeure
 
4:01 PM
Seems like they are jumping the gun a tad, since the dam hasn't actually collapsed - but I would move to higher ground, judging from the pictures
 
The issue is that it was massively spilling over yesterday which caused the damage... and now we have torrential rain
So very quickly it's going to spill over again. I've been to look at the river and it's already about to burst its banks again (as it did a few days ago) and that's before any potential dam spill. The police are concerned it might take the bridge out
 
@PaulMcG your link said something like "could collapse any minute"
(it changed so I can't give a direct quote)
 
4:24 PM
Now the factory is evacuated. We're all just huddled on this little spit of high ground. Didn't expect to be a live correspondent today :P
 
4:47 PM
Yeah, I'm here for the night. It feels a little like a loaded gun pointing this way looking on the map :/
 
[concern intensifies]
 
@roganjosh stay safe, man
 
Cheers. I've managed to get a place to stay so that's good, and it's on a hill, bonus
 
wim
@Kevin UberCHOPPER is actually a thing already (in I think, Dubai, and maybe Netherlands)
 
5:03 PM
I would propose "Uber with helicopters, but specifically for getting people out of dangerous areas" but people seem to dislike businesses that profit off of disasters
 
wim
surge pricing 100x
 
Which always seemed like a self-perpetuating problem to me. If it became socially acceptable to drive down to hurricane-ravaged towns and sell gallons of water, then ten times as many people would do it, and no single profit-seeker could price their product at 100x market value, because nine of their competitors would undercut them by selling at 99x. And so forth all the way down to 1x
... Theoretically, at least. I'm told that real-world economics rarely look like the things I've read in textbooks. Alas.
 
5:37 PM
recbg
 
6:02 PM
hello
 
@Kevin tit-for-tat price cuts are too slow to not make profits in the time scale. People hardly browse for the cheapest solutions in such situations :P
 
my backend is serving a huge, i mean massively huge json response. I wonder if there is a solution to either compress that so that the server won't timeout
 
If you're concerned about the front-end timing out waiting for the backend generating a JSON document... sounds like you should probably re-think whether the front-end actually needs/wants everything in that document...
 
@roganjosh True, I'll have to bring the competition to them. I'll literally follow the first profiteer around and shout "don't listen to him, I've got water for half that cost!"
 
@JoeSaad Do you know what the data looks like roughly? There might be different ways to represent the data. But then again, I probably couldn't help you with that.
 
6:06 PM
it actually needs all this data in the frontend. all this data is needed for a chart i am displaying on frontend
 
And the third profiteer will follow me and shout "I've got it at quarter cost!". It's a conga line of savings!
 
okay... but for instance... if you've got a million rows or something, you could (for instance) - aggregate the data in the backend to show the chart, and then if you need row details, have a separate request to get those and paginate them... that kind of thing...
 
@Kevin I've just had a flashback to being a teenager working on a market with trailers outside selling meat. They were shouting something like "4 joints for a tenner" and getting nothing. They switched it up with a discount of "8 for 20 quid" and people flocked in. Kinda tragic to watch, really
 
i agree with this chart, it's already been aggregated but it is huge, i'll talk with my team about further aggregating them. @JonClements there is no way to compress the json response and then decompress it on the frontend? I am just thinking.. i have no clue, haven't faced this situation before
 
Why send all that data to the front-end? Can't you resample in pandas?
 
6:09 PM
Reminds me of how a fast food chain tried to introduce the "Third-pounder" as a competitor of the quarter pounder, but nobody bought it because three is less than four.
Not a lot of people remember the day from high school where they learned how to apply reciprocals to inequalities, I guess
 
@roganjosh agreed
 
Apologies for the CAPS, my phone is dumb... or I tend to use "WHY" when I chat to my friend :)
 
@roganjosh My old landlord at new year also did an offer on bottled beers (mostly because of his sense of humour and liked mucking the younger lads about) - bottles were £1.50 each or 3 for a fiver... The later "offer" did remarkably well :p
 
@Kevin or just fractions
 
wim
puzzle time!
 
wim
def check(x):
    if x+1 is 1+x:
        return False
    if x+2 is not 2+x:
        return False
    return True
 
@JonClements that's beyond tragic, that's plain depressing that students fall for that!
 
wim
What x is gonna make check(x) return True?
defining your own class is disqualified
 
Something something overflow?
wait no...
 
6:15 PM
@JoeSaad We have some code that tries to address a similar issue, haven't fully tested yet, but it uses a streaming aspect to REST. Using requests in the client, I do a GET with stream=True, while on the server side, the server code looks like it sends a generator back as its response (I believe).
 
wim
if/when you find an answer, don't spoil for others
 
^^ server implemented in Flask
 
I found the answer, but I had to check the source code for something first.
 
when you say "server implemented in Flask" I imagine some literally built the physical server with Flask somehow and my brain explodes.
 
@Kevin... umm... I just went for a... "I bet this has to do with... and if I take the lowest one and try that..." and think I might be right
 
6:21 PM
Pretty much my thought process.
 
@PaulMcG thanks! is there an example written somewhere for that?
 
Here's a nonspoilery way to compare answers... When I do hashlib.sha256(str(the_answer).encode()).hexdigest(), I get 'a770d3270c9dcdedf12ed9fd70444f7c8a95c26cae3cae9bd867499090a2f14b'
 
a770d3270c9dcdedf12ed9fd70444f7c8a95c26cae3cae9bd867499090a2f14b :p
 
👍
Really I just want an excuse to use cryptographic hashes more often
 
this problem is going to drive me crazy for the next few days
 
6:29 PM
Just run sha256 on every possible bytes object until you get 'a77...' ;-)
Never mind that there are 18 septillion bytes objects with a length of 8 or less...
 
I think I know the answer. I just need to learn the hashing algo real quick to do some mental arithmetic
18 septillion probably exceeds my working memory
 
Well, you know what they say... sooner started - sooner done :)
 
@JoeSaad See flask.palletsprojects.com/en/1.1.x/patterns/streaming - we are using stream_with_context in the server.
 
I will look into this. Thanks @PaulMcG
 
NB - we have NOT done any heavy testing with this yet, so I can neither confirm nor deny that this may in any way address your issue
I just got the server-client stuff working like 2 days ago
 
6:38 PM
cbg room 6!
Nice to see the regulars still hanging around
 
cbg stranger :p
 
I've popped in a couple of times in the recent past :P
 
hashlib.sha256(f"Pir_{str(the_answer)}".encode()).hexdigest()
#'511b9bc6ff30b459cf953b78aa6138e87f069cf3ffe79fa770b2fc9658c9e677'
 
o/ @cs95
 
6:42 PM
@piRSquared yeah... looks like we all agree it's that then :)
 
Too bad 2.7's intern function only takes strings, or else the answer could be anything you want.
 
@piRSquared yo!
I've started riding a bike to work. Who knew riding a bike was fun + good exercise! ;D
 
Oh, 3.X has intern too, it's just in the sys module now. Still only works on string tho
 
@Kevin wait a sec... I was thinking something like this, but it says python 3 it only takes strings...
ooohhhh wait...
 
@Dair Yes, that's what I'm saying -- intern only takes strings, and that's a shame, because if it accepted other types, then maybe you could intern x+2 for some arbitrary value x
 
Sam
6:48 PM
Hi all, how would I go about using sklearn to one-hot-encode a nested list of categorical labels whilst persisting the nested structure? I've made an attempt here but I feel i've made it harder than it needs to be.. additionally the one-hot-encoding stage doesn't actually compile. I've made a minimal example: repl.it/repls/TroubledQualifiedSoftwareengineer
 
wha?
edit: no im an idiot
and now im curious what answers others used.
 
Hmm. I wonder if some_string.encode() returns different values depending on your system localization settings?
 
oops, 'a770d3270c9dcdedf12ed9fd70444f7c8a95c26cae3cae9bd867499090a2f14b'
false alarm, everything is fine. no need to panic
 
@ParitoshSingh phew... you caught it just before I was about to panic
 
6:52 PM
:)
 
I'm not 100% convinced that there's only one solution, even though we've all apparently come up with the same one so far
 
Sam
@piRSquared I think I may have seen this. That solution works well with Pandas Dataframes. I'm trying to do it directly on lists. I assume this makes a difference
Its the reshaping that is throwing me.
 
see another answer on the same question. stackoverflow.com/a/45312840/2336654
 
Ok I got it.
 
MultiLabelBinarizer takes a nested list.
 
6:55 PM
@Kevin Isn't the encoding stuff sensitive to white space?
 
Im having a hard time envisioning a different solution if custom classes are disallowed
 
so, like if I decide to print the answer and you don't we would get a very different hash, among other things etc.
 
@Dair Sure, in the sense that "foo".encode() and "foo ".encode() give different values
 
oh wait...
I get it now, I just put the answer.
 
can we hack a builtin's method?
 
6:57 PM
@piRSquared sounds like a pokemon :)
 
It wasn't specifically disallowed. :P
 
@piRSquared If I were the puzzlemaster, I would award 90% credit for doing that, mostly because overwriting builtin methods is a pain in the butt
 
wait I got: '511b9bc6ff30b459cf953b78aa6138e87f069cf3ffe79fa770b2fc9658c9e677'
 
yes, you used piR's code. check the f string
it has a surprise prepended to it :P
 
>>> float.__contains__ = lambda self, other: False
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: can't set attributes of built-in/extension type 'float'
 
6:59 PM
Nice.
 
... Which is not to say that hacking float.__contains__ is particularly useful for solving this puzzle. That's just an example.
 
well you could indefinitely call eval i think...
 
Yeah you can indefinitely call eval once you have the "minimal" answer and generate (essentially) infinite hashes.
 
Hmm, you lost me. If you hash the answer a million times, you'll have a million identical hashes. Or are you saying that the hash of the hash of the answer is different than the hash of the answer? True, but not applicable to the challenge as far as I can tell.
 
7:04 PM
So: answer is an answer. eval("answer") is also an answer. so is eval(eval("answer")) and so on. those each generate a different hash.
it's more of a technicality.
 
def wrap(function):
    def wrapper(x):
        print("oops")
        return True
    return wrapper
@wrap
def check(x):
    if x+1 is 1+x:
        return False
    if x+2 is not 2+x:
        return False
    return True
presenting exhibit 'A' of "there is no way this should be accepted, but i felt like trying it"
 
If you're saying "there are an infinite number of distinct expressions that all evaluate to the right answer", that's true. If the answer was 42 (spoilers: it isn't), then some legal expressions would be "42", "43-1", "44-2", "45-3"...
 
Oh yeah. That's way better than my stupid idea lol.
 
^ what they meant to say was "yep kevin, that is exactly what i meant to say, you're very perceptive for figuring out my idea"
 
Hat-tip to the police here. Someone asks "They're saying that the dam collapsing is inevitable" and they respond "That's the rumour, yes", then make a joke about what someone is wearing and walk off. Nuts.
 
7:14 PM
stay safe roganjosh. and that's definitely commendable.
 
It's like I'm living in SO Meta :P
 
I wonder if the check function has different answers for different implementations of Python
 
wim
dam diagram with ascii police officer please
 
KPython, the maliciously compliant implementation of Python written solely to challenge people's assumptions about guaranteed behavior, returns False for any is comparison, no matter what it is.
 
I instead decide to implement id to be random.random
so sometimes, check works, sometimes it doesn't...
regardless of value.
 
7:20 PM
KEP314: make the not operator return the opposite of the boolean value passed to it... unless it is capitalized NOT then it always returns False
 
In KPython, not is a postfix operator, so you can write sarcastic code: return True... not
Ellipsis optional.
 
^ yes, I wish that
 
sounds like a parsing nightmare since ellipsis is already a thing...
 
Sam
@piRSquared Thanks I'll take a look now
 
KPython is already a nightmare for 99 other reasons, so I may as well add even more impossible features
 
Sam
I dont think the binarizer is what Im after either.
 
Postfix unary operators are only available in the Undying Lands, as the secret of their construction has long been lost by Man
 
@Sam I see, you want to factorize... one moment
 
Sam
Yeah, I just want it as a one-hot-encoded set, whilst persisting the nested structure i guess
 
np.split(np.unique(np.concatenate(data), return_inverse=True)[1], [*map(len, data[:-1])]) @Sam
 
7:38 PM
I'm surprised you need np.concatenate there. Most numpy functions accept array-likes.
 
Sam
Thanks I'll give that a go now. I'll also update my example with the desired output..
Original nested list:
values = [
  ['Sam', 'Sam', 'Ieuan'],
  ['Ieuan', 'Alice', 'Eve'],
  ['Alice', 'Eve', 'Ieuan', 'Ieuan', 'Sam']
]
# Desired Output
# Ieuan = [1, 0, 0, 0]
# Alice = [0, 1, 0, 0]
# Eve = [0, 0, 1, 0]
# Sam = [0, 0, 0, 1]

# values_encoded = [
#   [[0, 0, 0, 1], [0, 0, 0, 1], [1, 0, 0, 0]],
#   [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0]],
#   [[0, 1, 0, 0], [0, 0, 1, 0], [1, 0, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1]]
# ]
 
oooh, concatenated into the 1d array, I see
 
Sam
Sorry if my initial question was convoluted lol
 
code_map = {
    'Ieuan': [1, 0, 0, 0],
    'Alice': [0, 1, 0, 0],
    'Eve': [0, 0, 1, 0],
    'Sam': [0, 0, 0, 1]
}

lengths = np.cumsum([*map(len, values[:-1])])
one_dim = np.concatenate(values)

np.split([*map(code_map.get, one_dim)], lengths)
 
Sam
This is my approach
values = [
  ['Sam', 'Sam', 'Ieuan'],
  ['Ieuan', 'Alice', 'Eve'],
  ['Alice', 'Eve', 'Ieuan', 'Ieuan', 'Sam']
]
label_encoder = LabelEncoder()
label_encoder.fit(list(set(x for l in values for x in l)))
label_encodings = [label_encoder.transform(x) for x in values]
nb_classes = len(result)
one_hot_targets = [np.eye(nb_classes)[label] for label in label_encodings]
Maybe I can integrate yours @piRSquared, I don't want to assume I know the encodings upfront
 
7:54 PM
lengths = np.cumsum([*map(len, values[:-1])])
one_dim = np.concatenate(values)
uniques, factorized = np.unique(one_dim, return_inverse=True)

np.split(np.eye(len(uniques), dtype=int)[factorized], lengths)
 
Sam
Ah, very nice
Thanks
Better than mine :p
 
not as useful as actually marking them when interacting on the site but better than nothing
 
Sam
@piRSquared Bonus point if you can reverse the encoding to the original labels ;D
 
First, I switch to pd.factorize because it doesn't sort like np.unique does..
lengths = np.cumsum([*map(len, values[:-1])])
one_dim = np.concatenate(values)
factorized, uniques = pd.factorize(one_dim)

code_map = dict(zip(map(tuple, np.eye(len(uniques))), uniques))

a = np.split(np.eye(len(uniques), dtype=int)[factorized], lengths)
Then the bonus points
[[*map(code_map.get, map(tuple, x))] for x in a]

# [['Sam', 'Sam', 'Ieuan'],
#  ['Ieuan', 'Alice', 'Eve'],
#  ['Alice', 'Eve', 'Ieuan', 'Ieuan', 'Sam']]
 
Sam
Ahhh perfect! Thank you!!!
 
8:02 PM
@wim Forgive my ignorance, is that a particular old man who I should recognize?
 
@PaulMcG Richard Stallman
 
GNU guy... I think
What @Dair said
 
and yeah, he is the GNU guy lol.
 
Ok, I probably could have googled a few guesses
 
@AndrasDeak they will never do that
 
8:09 PM
maybe not, but that would make the most sense and would be the most helpful
 
what was the name of the SO alternative that Atwood was working on again?
 
none
 
it's not an SO alternative, but Discourse
 
ah thanks.
 
pack your bags
it's time to jump ship (jk)
 
8:11 PM
/knocks two kids and a pregnant women out of the life raft
 
> Daily vote limit reached; vote again in 3 hours.
wow, it's been a while
 
Is there an exchange rate for rep?
 
@AD what % up/down
 
Yeah, but I mean I literally remember seeing a post by one of the devs saying - (paraphrase) "we are not going to point them out in posts so they can enjoy the sites normally" (I really don't feel like looking for it again but I bet the recent feature-complete re-tagging has brought it back to the surface on Meta.SE)
 
@piRSquared I'm out of meta comment votes this time, but 77.5% downvotes on main, 19.1% downvotes on meta
 
8:13 PM
@JGreenwell I think that's actually kind of a fair point, but still it's a bit silly. Not all but much of the staff is low rep. I immediately suspect they are staff if they have below 10k and have a diamond.
 
afternoon coffee rbrb
 
actually it's not even suspect at that point, I just assume.
 
@Dair and when they do get mistaken for mods or the other way around it's always "harmful". But anyway I understand their point too.
 
I personally don't care (not compared to all the other stuff - very low on the priority list) :)
 
i need food and coffee lol.
 
8:16 PM
I need brown paperbags & see through ones
 
Is it not time to start off an objective debate on what way it goes forward? Kicking it off; just stop trying to moderate content. All our lives are easier - no work to do and the content survives when we need it.
 
I've made the point somewhere recently that going on strike would only hurt us
in CHATLAB and Talktave, Jul 24 at 8:16, by Andras Deak
the problem is that the only people seeing problems would be the same people on strike
around that ^
 
Every discussion relies on some capitulation to a new idea.
 
Hey, I need help phrasing a question well about argparse.
I am trying the make the argparse work with these default arguments 'python setup.py build_ext --inplace' then use the last one for the normal arguments.
 
@roganjosh to quote one of the harbingers of the new era:
 
8:22 PM
Would I call it "How do I work with external arguments with my own in argparse?". I am kind of confused on how to phrase it.
 
This is directionally accurate though I disagree with the characterization.. The Company has always owned the values (even when it was just Jeff and Joel setting it up); they attracted a group of people who shared those values. Now those values are changing, and likely those that can't change with those values will stop participating as much and be supplanted by those that do share those values. — George Stocker ♦ 6 hours ago
so according to the seemingly most active moderator in the effort to kill the old meta comment culture the old people who made SO a success can go suck on a lemon :P
 
@NiNisanNijackle You lost me at "then use the last one for the normal arguments."
Last one what?
 
@PaulMcG I set up an alias called compy, it points to a script that does this 'python setup.py --one_3rd_party_arg --another_3rd_party_arg'
 
so do you mean multiple arguments with a default argument?
 
I used to be really active in moderating main but I've kinda just lost interest. Not for some particular cause. It's not a strike, as such, but an acceleration of what is naturally happening.
It's no consequence to me, really, when I get the answers I want. If the site goes over the precipice then it would be
 
8:29 PM
@JGreenwell, yea kind of. it's what the documentation of the library says I should put. I wouldn't really call it default args though. More like mandatory args for a 3rd party library.
 
or an argument which causes the script to run a new instance of itself (passing the arguments)?
 
shortcut = python setup.py build_ext --inplace
 
if its mandatory - don't make it an argument just make it run (might tie it to an argument mind you or have it a separate argument to run manually but oh, you used argument Y - that also means I will use logic of argument X)
 
shortcut file.py
I am trying to only read one arg, but because of the other args before it. It probably confuses it with the stuff I set an alias for. I don't really know what to work with those args.
 
8:33 PM
thanks
 
If that doesn't work you could use nargs to process the arguments as a list
 
wim
@AndrasDeak harsh
 
I started in 2015
 
wim
8:49 PM
@AndrasDeak did he mention he was due to get on a plane shortly thereafter?
 
I'll just say myself the trouble and just use input(). It does suck without the autocomplete. Either ways, it does what I need.
 
@wim ha
 
fair enough, I certainly below to the "make something that works first then improve it" philosophical software engineering camp
this way you just know where to look when your ready to improve it :)
 
rbrb
 
@AndrasDeak sigh I've given up on getting that person to answer a question
 
8:54 PM
if you want to ask a question post an answer...no wait
 
or a question (were he does at least give a partial answer)
 
wim
(and if you feel like voting on the tail of crap while you're there, please do so)
 
just because it's late and it's wrong doesn't make it bad
 
wim
frontal lobe unable to detect sarcasm
 
ah, the age old "how do I make variable numbers of dynamic variables" to which the answer is always - don't
 
9:02 PM
It's garbage. My sarcasm detector is off the scale.
 
@wim I think we should leave an explanatory comment because the answerer doesn't know any better
 
oh, wow - the answers on that question just X-X. If I ever saw this in production it would make what I did to people who used goto seem tame
I beat if you say "writing to locals()" that answer will say "no, I'm using vars()".....and I'm really, really going to have to fight my urge to throw-out a RTFM comment
 
wim
@JGreenwell I'd like to speak to the variableVariablesManager manager!
 
@AndrasDeak I'm not sure on your criteria but I definitely can't tell what you'd consider a reasonable mistake and someone who just posts something blatantly against an already-well-answered question
 
@wim that seems to be the only locals() answer on that question so I think it should stay with explanations
@roganjosh Hanlon's razor will guide you
 
wim
9:12 PM
disagree, that detail already discussed in Nadia's 2009 answer
 
ah, I missed that tiny sentence in the middle, you're right
 
wim
I wonder why she stopped contributing, she used to post a lot of good content.
 
the punishment for using goto involved a bat
The first time it was used it involved old COBOL code on our legacy server & the developer in question (upon seeing his own code) self-inflicted his beating. It was deserved:
  IF  UNITX < UNITZ
     MOVE UNITX TO WS
     GO TO C10-RESULT.
  END-IF.
MOVE UNITZ TO WS.

C10-RESULT.
  MOVE WS TO RESULT.
I apologize for the COBOL - commits harakiri with a wiffle ball bat
 
"attempts harakiri with a wiffle ball bat" FTFY
 
recbg
@wim maybe she forgot her password.
... or maybe she got fed up with the hvs
 
 
2 hours later…
11:12 PM
cbg
 
03:00 - 14:0014:00 - 00:00

« first day (3211 days earlier)      last day (1755 days later) »