« first day (3156 days earlier)      last day (1778 days later) » 
01:00 - 17:0017:00 - 00:00

1:48 AM
cbg
 
 
2 hours later…
4:06 AM
cbg
 
 
1 hour later…
5:29 AM
recbg
 
@U9-Forward your question at its heart was a cumcount and pivot problem with some extra work. Funny enough I've seen at least two other questions asking something very similar
guess a lot of people need a pivot in their lives
 
@cs95 Haha, lol, your answer was very good tho, a fast approach, accepted yours over wen's solution as he said yours is faster :P
 
wen, eh? I like him as a person but god I wish he'd format his code better sometimes...
if your answer has horizontal scroll you're doing it wrong...
 
@cs95 Yeah, i guess his using spyder or something... that's why he always has Out[some number here]:
But for me it doesn't have a horizontal scroll
Yeah but if so, you can make variables...
@cs95 Wen, i remember once he got suspended...
 
5:47 AM
err, I use IPython, I just remove the prompts
@U9-Forward let's respect his privacy and not discuss that.
 
He keeps changing his name, from Wen, to W-B, then to Wen-Ben, and now WeNYoBen
 
fun fact, if you're using IPython, you can use the %history magic to spit out code
WITHOUT the prompts
can't show the outputs as well, sadly.
 
@cs95 Okay, oh that's right, IPython too
I use IDLE :P
But sometimes IPython too
 
oh, windows / sympathy
 
Haha lol yes
 
5:57 AM
I have a windows at home I use Sypder on. Takes a while to get used to, but very comfortable once you do
the most important thing is a good keyboard
 
@cs95 Just one thing, idle doesn't have a horizontal scroll bar, and doesn't close your bracket when you have an open bracket.
 
6:17 AM
Quick question, why are these two equivalent
In [1]: a = [[1,2],[],[4,5]]

In [2]: list(filter(None,a))
Out[2]: [[1, 2], [4, 5]]

In [3]: list(filter(lambda x:x, a))
Out[3]: [[1, 2], [4, 5]]
Why does None work to filter out empty lists, I know lambda x:x will return False for empty lists, but not very clear on how None achieves the same thing
 
@DeveshKumarSingh HAHA regarding my answer :P
 
yes, I want to know the logic behind it, I never saw None being used in filter
 
@cs95 Sorry, but i realized many answers are faster than yours, jezrael's new answer is the fastest, and GZ0 has one that's almost as fast as jezrael's, can i accept theirs?
 
I guess since it's your question, it's your prerogative to accept whichever answer you feel is the best
 
Yeah
 
6:24 AM
: stackoverflow.com/questions/56488925/… asking for tool recommendation
 
@DeveshKumarSingh the docs can answer that
 
If function is None, the identity function is assumed, that is, all elements of iterable that are false are removed. guess I should read the docs past the first line :) Thanks @Aran-Fey
 
@DeveshKumarSingh the truthiness value of None is False
>>> None == True
False
 
uh, how is the truthiness of None relevant here?
 
In [8]: bool(None) == bool([])
Out[8]: True
 
6:30 AM
And since when is truthiness checked with x == True? :P
 
I think all elements of iterable that are false are removed assumed that the truthiness of the iterable is False, evaluated with bool(iterable)
Also
In [9]: None == False
Out[9]: False
@Aran-Fey so you check if with bool(x) == True ?
 
Just bool(x) will give you the same result, but yeah
 
yes bool(x) if used in a conditional, otherwise we need explicit comparison I guess
 
@DeveshKumarSingh These all return False:
>>> all([not i for i in [None, False, 0, [], (), set(), dict()]])
True
>>>
 
In [19]: y = bool([])

In [20]: y
Out[20]: False

In [21]: y = bool([]) == False

In [22]: y
Out[22]: True
@U9-Forward Yes their truthiness evaluates to False
 
6:34 AM
@DeveshKumarSingh Umm, what's your point, that's what is should do
 
I was agreeing with you
 
@DeveshKumarSingh Oh good lol :-)
 
@U9-Forward you don't have to ask for permission. Although I don't always use performance to determine what answer to accept, because performance isn't everything (it sure is important though)
 
@cs95 I wish there was something like "accept all answer" :P, maybe i should create a meta topic of this (just kidding)
 
6:47 AM
It irks me when someone uses performance as a reason to shoehorn an OP into accepting their answer
Thank goodness there isn't
 
Haha lol
 
I agree that performance should be order of magnitude faster to make a difference? Perhaps 10-20 times faster?
btw max or min on characters works by their ord value right?
In [25]: max('Abcd')
Out[25]: 'd'
since ord('d') is the largest ?
 
yeah
 
If performance was a criteria for acceptance, there's a lot of low hanging fruit to everyone's answer that can be improved on
 
@Aran-Fey cool thanks
So a variable declared outside the for loop gets overwritten if is reused in the loop
In [30]: i = 1

In [31]: for i in range(4):
    ...:     pass
    ...:

In [32]: i
Out[32]: 3
 
6:57 AM
@DeveshKumarSingh Haha!! always following where i go haha, i said ord and you're double-checking :P
@DeveshKumarSingh Of course, otherwise it would be like a list comprehension
>>> a = [num for num in range(4)]
>>> num
Traceback (most recent call last):
  File "<pyshell#124>", line 1, in <module>
    num
NameError: name 'num' is not defined
>>>
 
but I though the variable in the for loop don't go out of the scope to look into global scope
 
for loops don't have their own scope
modules, classes and functions are the only things with scopes
 
@Aran-Fey Yeah
 
(comprehensions are internally functions)
 
you are correct, but how is i overridden by the for loop ? and is this related to for loop not having it's own scope in any way
 
7:00 AM
Suddenly -4 rep in a second, that doesn't seem right...
@DeveshKumarSingh if it wasn't, the below won't work
for i in range(4):
    print(i)
Error:
 
@Aran-Fey I did not know that =0
 
NameError: name 'i' is not defined
 
is that part of the spec?
 
@Aran-Fey I didn't know that either
 
@DeveshKumarSingh not sure what you mean by "how". It just assigns a value to it, like i = 3 would
 
7:02 AM
haha @U9-Forward you are not going to make many friends here if you keep talking about your rep :) anyways congratulations :)
 
@Arne I don't think so. They do have their own scope per the spec, but the implementation as a function is a CPython implementation detail I think
that was probably the easiest way to give them their own scope
 
@DeveshKumarSingh That's true, i am just surprised...
 
@U9-Forward You'll probably never see me with more than 21k rep. I tend to bounty it all away
 
@Aran-Fey I gave away 50 rep from bounties, and earned 75 rep from bounties
Yeah
Okay, whoever saw this is lucky. :P
 
7:08 AM
rbrb
 
@Aran-Fey Aah so when you say for loop doesn't have it's own scope, it means the variables assume the outside scope, for loop outside functions have variables in global scope, and for loop inside functions have variables in local scope of function
 
yeah
 
okay now i got it from this answer
guess i was missing the "assuming outside scope" part
 
Hey guys!Anyone used selenium webdriver on linux?
 
maybe we should have a separate chat room just for "no actually, nobody here has experience with X"
 
7:32 AM
does df.apply(func) work similar to map(func) in terms of applying func to items in the dataframe
 
8:03 AM
@DeveshKumarSingh in terms of speed?
Or are you referring to the generic python map (pandas also has a map)? df.apply will apply the function row-wise to your df, so it's basically equivalent to regular map
 
@roganjosh yes that was my question, I answered this assuming that python map is equivalent to df.apply(func)
another question, I learned today that we can use dict based indexing in str format
example this
In [34]: a = {1:2,3:4}

In [35]: "{0[1]} {0[3]}".format(a)
Out[35]: '2 4'
but I am unable to think on how to create that format string for a dict with string keys e.g. {'1':2 , '3':4} , how would I achieve that?
I just found out that I can do this for keys which are non numeric strings
In [36]: a = {'a':2,'b':4}

In [37]: "{0[a]} {0[b]}".format(a)
Out[37]: '2 4'
 
 
1 hour later…
9:22 AM
: stackoverflow.com/questions/56491162/… unclear what is being asked, it already has 2 downvoted and deleted answers
 
Sounds perfectly clear to me... even includes a code sample that shows exactly what they're trying to do
 
the fact that 4/5 answers misunderstood suggests that it's fundamentally flawed
it's the "I can't believe this is really what you're asking" kind of unclear
unrelated, but the one actual answer is ugh
 
yes, exactly, also is it possible if you could look at my question above ?
 
@DeveshKumarSingh I don't think that's possible.
 
even I thought so, but why might that be?
 
9:35 AM
I think implicit quotes are added around stuff inside [] in a format field, except for ints numbers?
hmm, good reason to use f-strings I guess
 
@AndrasDeak I guess you are right
In [43]: a = {'1':2 , '3':4}

In [44]: "{0['1']} {0['3']}".format(a)
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-44-05763aaad177> in <module>
----> 1 "{0['1']} {0['3']}".format(a)

KeyError: "'1'"
 
>>> a = {1:-1, 2.:-2, "3":-3}

>>> f'{a[1]} {a[2.]} {a["3"]}'
'-1 -2 -3'
ah, the same rules don't apply to f-strings at all
 
@AndrasDeak thanks works like a charm :)
In [46]: a = {'1':2 , '3':4}

In [47]: f"{a['1']} {a['3']}"
Out[47]: '2 4'
 
I don't know why I thought it did
>>> a = {'lancelot': 'spam'}

>>> f'{a[lancelot]}'
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-50-6bb75d529671> in <module>
----> 1 f'{a[lancelot]}'

NameError: name 'lancelot' is not defined
 
In [48]: a = {'lancelot': 'spam'}

In [50]: f"{a['lancelot']}"
Out[50]: 'spam'
yes we would need single quotes to tell the f-string it is a string key
but
In [51]: a = {'lancelot': 'spam'}

In [52]: "{[lancelot]}".format(a)
Out[52]: 'spam'
 
9:40 AM
my point exactly...
 
one more reason f-strings are good :) perhaps that's how string format was defined in cpython
 
"perhaps"?
 
I mean when you said implicit quotes are added around stuff inside [] in a format field that is a cpython implementation detail right
 
Huh, string literal concatenation with f-strings is weird
>>> f'{'
  File "<stdin>", line 1
SyntaxError: f-string: expecting '}'
>>> f'{'"
  File "<stdin>", line 1
    f'{'"
        ^
SyntaxError: EOL while scanning string literal
>>> f'{'"""
...
 
9:42 AM
>>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 8637678}
>>> print('Jack: {0[Jack]:d}; Sjoerd: {0[Sjoerd]:d}; '
...       'Dcab: {0[Dcab]:d}'.format(table))
Jack: 4098; Sjoerd: 4127; Dcab: 8637678
what it doesn't discuss is what happens to ints and floats
technically it's just a tutorial but still
 
yes, I observed it just now, I was going through Corey Schafer's video on string formatting, and thought about that
 
> Because arg_name is not quote-delimited, it is not possible to specify arbitrary dictionary keys (e.g., the strings '10' or ':-]') within a format string. The arg_name can be followed by any number of index or attribute expressions. An expression of the form '.name' selects the named attribute using getattr(), while an expression of the form '[index]' does an index lookup using __getitem__().
 
how about a f-string for {"'1'":2} ?
 
let me know when you run into that
>>> f"""{d["'1'"]}"""
'2'
 
I would say never, but yes tripled quotes strings are the answer here
@AndrasDeak so the idea is to surround your string with what is not used in the key also how did you come with that?
anyways, my next attempt will be to find a f-string for a = {"""'"1"'""":2}
 
9:53 AM
that is still doable
 
yes, but how do you approach this?
 
since you can't escape the quotes inside the format expression you have to put unused type of quotes outside
and there aren't many unused quote types left :P
 
Guess the output:
>>> a = 'a'
>>> b = 'b'
>>> ab = 'foo'
>>> f'{f"{a+b}"}'
 
but the string is valid since it is a triple-quoted string, with a single and double quotes string inside I guess
 
Level 2: >>> f'{f"{a+b}":{a}<3}'
 
9:55 AM
@DeveshKumarSingh I don't understand what you're saying/asking
 
@AndrasDeak I mean I was wondering why this string """'"1"'""" is valid
 
why would it not be?
 
that's just a triple-quoted string
 
@AndrasDeak it will be, apologies i was talking to myself I guess
 
10:20 AM
can I anything related to GeoDjango here?
can I ask*
 
you can edit/delete messages for 2 minutes
before asking anything, please read the rules, all of that page
 
on it :)
 
thanks
 
11:11 AM
@DeveshKumarSingh exact self-dupe posted... (already closed) stackoverflow.com/questions/56493117/…
Eh, answerer unhamnered it
 
@Andras wow... only just realised you haven't got your Python gold badge yet... I just assumed you had one :)
 
Nah, half my rep is matlab :)
 
for your sins :)
 
I'm not a very eager dupe hunter anyway...
 
Why not? SO search makes it a breeze :p
 
11:30 AM
yeah, super useful :P
 
Wow... Using the concepts of Selection and Iteration design a program... wouldn't have thought Michael Jackson was still popular these days :)
 
11:42 AM
dupe for "append returns None" stackoverflow.com/questions/56493534/…
 
I don't think that edit should be approved, it keeps the useless stack snippet and appends "Please help me in fixing this."
 
if it didn't add the last sentence, i'd have liked it better
 
yeah
 
@AndrasDeak :( the answerer was downvoted in the older question so he reopened it with his golden hammer and answered it. That’s a clear misuse of golden hammer
 
their answer was probably wrong from when the question was less clear according to their description
and they answered before unhammering
 
11:56 AM
Hah and the answerer explicitly asked the OP to ask another question and when you pointed it out, they didn’t have a response
 
They did.
 
Sam
12:37 PM
How do you get the active network interface using python?
I currently have psutil.net_if_addrs().keys()
but that returns all of them.
 
@AndrasDeak OPs initial question here stackoverflow.com/questions/56491162/… was very unclear, and hence got put on hold as too broad. I gave it an answer myself but realsed that it was indeed too ambiguous so also voted to close. Suggested OP to ask again after having updated it, as it did seem clearer to me after having modified it, because it would most likely not get reopened
 
The last time I needed to query information about my network connection, I parsed the output of ipconfig. I suspect this is not the idiomatic solution.
 
@yatu it got closed as unclear, and if the question is made clearer that's exactly what we have reopening for. Reposting questions with no changes is never the right move. But as I've said in a comment, whatever.
 
I don't think it likely for a question with 6 downvotes to get reopened 30 minutes after
having been put on hold :) but yeah for the rest I agree @AndrasDeak
 
Has someone seen this pycharm warning before: "Parameterized generics cannot be used with class or instance checks", This is related to this question here
Can't seem to find anything online for it
although it goes away when I do keys_and_types.get(test_key) but I am unsure why
 
12:48 PM
And the quesiton did have changes. As I've said, the question only started making sense once it was closed. Hence my suggestion to reask. Otherwise I definitely wouln't have unhammered it @AndrasDeak
 
@DeveshKumarSingh ha, that's hilarious
I think pycharm assumes that you are doing typing.SomeGeneric[type] instead of a dictionary access
 
seems like pycharm has type hinting enabled, and the error is due to that
@Arne okay I don't know much about the typing module per se, so perhaps you are correct
 
I can repro it in the intended way, writing an answer right now
 
good, perhaps I will learn more about type hinting that way
@Arne perhaps file that bug with pycharm and get some cash prize? Or pycharm doesn't do that
 
I complained about a couple of bugs at them already, never got anything =D
but sure, that's probably the right thing to do
 
1:07 PM
: stackoverflow.com/questions/56494923/… unsure if it is closable as a typo?
 
We need a "braino" close reason
 
and braino will be? a brain-fart moment?
 
Yeah.
 
hah cool if some people would just run their code and read the exception
 
some people^TM think the spirit of the typo close reason is "on topic but unlikely to help future readers" which covers brainos
 
1:12 PM
(I don't legitimately believe that a braino close reason would be a good idea, since we'd have to close a large chunk of what we currently consider good questions)
 
@DeveshKumarSingh there is not that much to learn, I think. type annotation in python is completely disconnected from the actual class system. for simple types, you can just use the class itself as its type annotation and it will be interpreted correctly, like foo: int or bar: MyClass. But for anything like "this is a list of strings" you have to use typings class definitions that are only related to python's classes in so far as they describe them in a type hinting context.
 
There are low effort brainos of the form "I typed some nonsense and I refuse to read the error message". There are high effort brainos of the form "I correctly handle 16 different corner cases but I guess there must be one more I missed"
I have seventeen corner cases written down in my correctness proof but I spilled barbecue sauce on one of them, please help
 
@Kevin but images are frowned upon in the questions for the proof of barbecue sauce being spilled :(
 
oh, he filed the bug already: youtrack.jetbrains.com/issue/PY-36317
 
@Arne hah, well it's not a bug per se, it sounds more like a github issue
 
1:18 PM
> Type: Bug
:p
 
hm, i think the Q is fine.
dont know the answer though
im gonna go digging
 
yeah, I don't think that's too broad
 
But I thought he's asking strftime to guess the format, which it cannot without you explicitly telling it
 
then the answer is "not possible"
 
1:31 PM
yes I already mentioned that in the comments
 
You can choose one of your liking and use it Or just do '{}'.format(datetime.datetime.utcnow()) which will give you '2019-06-07 13:31:55.864508'Devesh Kumar Singh 1 min ago
Is that not just a worse and more obfuscated version of what OP already has?
 
yes, that's one answer I could think of, is that wrong?
 
and it's definitely not an answer; the answer should be a string -> datetime transformation
 
Wait, I'm confused. Is he trying to turn a string into a datetime, or a datetime into a string?
 
former
they might just be confused between strftime and strptime
 
1:34 PM
In any case my crystal ball has turned a shade of burnt sienna which means that this is probably a dupe
Or rather, "is there any way at all to guess the format of a date-looking string?" is probably a dupe. "... Using only the standard library?" might not be a dupe because not many people have that level of faith in the stdlibs
 
They might be asking "is there a default format strftime uses that agrees with a default in strptime?"
 
I agree. And I understand where the OP is coming from -- for the sake of symmetry, why shouldn't there be a no-explicit-formatting solution for string-date conversion, since there's one for date-string conversion?
 
yup
OP confirms strptime
one angle could be finding dates or timezones for which it's impossible to have a unique default format
 
@Kevin perhaps a new feature request?
 
That'll bump it up from negative one hundred points to negative 99 ;-)
 
1:44 PM
I often find myself writing classes that will never be instantiated, like in this example. Decorating all those methods with @classmethod is annoying, so I'm wondering if anyone knows a better way to do this kind of thing?
 
datetime.str is just a single call to isoformat... I don't suppose there's an anti-isoformat somewhere?
 
@Aran-Fey SimpleNamespace? What do you need it to be a class for?
To have an abstract base class?
hmm, then again I also don't see why it has to be a classmethod rather than static so I'm probably not the right one to help
 
It's mostly because using classes makes it easier to implement all those functions. (In reality the abstract base class defines more than 1 abstract method). Defining a bunch of functions and then passing them to the Serializer constructor feels messy
def dump_string(text):
    return text.encode('utf-8')

StringSerializer = Serializer(dump_string)

def dump_int(number, string_serializer=StringSerializer):
    return string_serializer.dump(str(number))

IntSerializer = Serializer(dump_int)
^ worse than using classes, IMO
 
1:56 PM
@Kevin nope, best i looked. and the call to iso format is with a space separator. And the iso formatting itself is written directly as a string formatting with a call to _format_time. That's where i stopped looking for some kind of property that would have stored the "antidote format" ready to be used.
 
@Kevin My IDE's gonna complain a lot if I do that :(
 
at this point i've decided that there isnt a ready-to-use string format that will convert back the string into datetime, and it's just simpler to write it once somewhere, relying on the fact that you know python will always do it as a space separated iso format. (which, apparently at that point, is no longer an iso format)
 
@Aran-Fey hmm, OK
 
@Aran-Fey Might be a valid use case for functools.singledispatch ?
 
The main advantage of using classes is that it makes customization trivial (through class attributes/overriding methods). If you have something like this, it's trivial to swap out the default StringSerializer used by IntSerializer by making a subclass:
class IntSerializer(Serializer):
    STRING_SERIALIZER = StringSerializer

    @classmethod
    def dump(cls, number):
        return cls.STRING_SERIALIZER.dump(str(number))

    @classmethod
    def load(cls, byte_data):
        return int(cls.STRING_SERIALIZER.load(byte_data))
No idea how you'd do that if IntSerializer was a Serializer instance
 
2:02 PM
And how about using actual serialiser instances rather than just the classes, sparing all those classmethod decorators? Should this be a singleton kind of thing?
or then having to instantiate them would be equal burden to you
 
@JonClements Hmm, I don't think that helps me if there's more than 1 abstract method to implement?
Yeah, instantiating them is also kind of a pain. Not sure if it's more or less of a pain than slapping @classmethod on everything, but I'm hoping that there's a better solution
 
@JonClements Yep, that'll do it. Too bad I can't* post an answer since it already got mentioned in the comments, and also the OP isn't using 3.7.
(*well, I could, but I don't much like reiterating in a post what's been said in a coment)
 
Actually quite surprised something like that only got introduced in 3.7
 
@JonClements so this function was hidden in the depths of python docs :) nice thanks
 
@ParitoshSingh If Wikipedia is to be believed, space separated iso formats are still compliant with the standard.
> It is permitted to omit the "T" character by mutual agreement as in "2007-04-05 14:30" [...] By mutual agreement of the partners in information interchange, the character [T] may be omitted in applications where there is no risk of confusing a date and time of day representation with others defined in this International Standard.
 
2:09 PM
I'd imagine the function is just a wrapper around datetime.strptime anyway
 
(actually, a strict reading of this might indicate that the only valid separators are "T" or the empty string, not space, but both en.wikipedia.org/wiki/… and Python's documentation imply that a space is also OK for some reason)
 
It's the Microsoft approach to conforming to standards... also known as the "meh... it's close enough" approach :)
 
haha
what's puzzling me is that i..seem to have...uh, misplaced that fromisoformat method? This is datetime.datetime.fromisoformat right?
 
Maybe the ISO committee has a funny definition of "omit"
Misplaced in the docs? Here it is: docs.python.org/3/library/…. Misplaced in your REPL? Make sure you're using 3.7+.
 
oh! that'd do it
thanks, python 3.6 here
derp, the docs even mention it at the end
 
2:14 PM
Let me get onto the balcony of my glass house so I can throw stones at you
 
heh :P
 
Thought exercise: what kind of stone is best for throwing at people if you don't want to hurt them? Pumice is very light but it typically has jagged edges. Can you sand pumice?
Google tells me that the pumice stones used for personal exfoliation are pretty smooth. Light, smooth, available at Walmart -- the ultimate rock
 
Thought Exercise taken too far: if you throw diamonds at people, you've more than compensated them for the damage you dish out. At that point, would you call it a net "benefit" since they end up cashing out from the ordeal big time?
 
but what's the use of throwing stones when you don't want to hurt them
 
[later, at the jeweler's] "sir, I can't buy this diamond, as it is a blood diamond. There is literally blood on it."
@DeveshKumarSingh The recipient is trapped at the bottom of a well and I have no rope but I do have five hundred cubic feet of pumice stones.
 
2:25 PM
@Kevin aah so you want to trap them under those stones, so they die of suffocation and are ridden of their misery
 
2:38 PM
pumice stones are porous, I wouldn't be surprised if you could breathe through a pile of them
it also floats on water so if the well has water in it the person can just use all that pumice as a floatation device (no, I will not consider the fact that this is not how physics works :P)
 
Hi Guys, I am new to python. Can anyone please let me know, how to deploy python code on server? I have server's ssh credentials. Any hint is appreciated :)
 
Deploy what python code?
for instance flask has a separate section in its docs about deployment
 
@AndrasDeak Hey Andras, I have a flask-restful code as a backend and angular 6 in frontend.
 
yeah, in that case the docs linked above sound like the right place for you to start reading.
 
Cool! will dig up the docs then! :)
 
3:05 PM
Do we have a dupe target for "Why is threading.Thread(target=foo(1,2,3)) running foo in the main thread?"?
All of the "hey this callback is broken if I call it" questions in the common questions list are about tkinter which is unsatisfying to me
 
<3 Kevin
Rakesh was already on it...
 
they've toned it down of late. Apparently they are susceptible to (my) prodding
 
3:40 PM
In a fit of madness I decided to do everything there is to do in Breath of The Wild, including collecting all 900 of the obligatory collectible that have no purpose once you have 450 of them. I have done everything remotely interesting that there is to do in the game. For my efforts, the percent complete field of my save file reads "99.5%".
 
so cruel :(
do you have to jump across a flagpole or something to finish it officially?
or is there no "finish it officially"?
 
Going to a named location in the game is worth about 0.1%. There are about 500 named locations in the game. I have no way of determining which named locations I've been to besides looking at them on the in-game map.
So I'm going to fire up my "calculate a reasonably short path that traverses a collection of points in 2d space" program and point it at the list of named location coordinates that I mercifully found online
 
Yep. Divine beasts: complete. Shrines: complete. Korok seeds: complete. Only one category remains.
Checking every location should be only about 60% as painful as when I had 898 korok seeds and had to pore over the map, following my 900-leg route, to find the two I skipped.
 
Umm... quite impressed I remembered that int.from_bytes exists :)
 
3:46 PM
One was in a location that you'd be likely to come across 20 minutes into the game. The other was behind a puzzle which I couldn't solve and said "I'll make a note of this and come back to it later" and then I did not make a note of it and then I forgot about it.
 
Past Kevin does it again
 
@Kevin reminiscent of the "Low Orbit Tea Cannon"... /me taps paws... :p
 
that must have been fanfic at best
 
I've been getting flack from my meatspace friends for collecting 900 macguffins while simultaneously claiming that I don't have the time to do any of the things I promised to them I would do, such as catch up on Game of Thrones.
 
hehe
 
3:51 PM
To which I reply: sorry not sorry. The goblin in my brain that controls the "hyperfocus" lever is untameable and does as it pleases.
 
if only watching a tv show was as easy and comfortable as playing a video game
 
If there were four times as many episodes and they were all 25% as long I would have finished them all in a week.
I know this because last month I watched 80 fifteen minute long videos about DnD whenever I was cooking dinner or waiting for code to compile
 
yeah, I understand
 
When you have a problem with your playgroup, communicate it in person in a non-accusatory way. There, I saved you 20 hours.
 
cbg
 
4:09 PM
cbg
 
Kevin? Who's Kevin? — Aran-Fey 7 mins ago
He's the apple king. By divine right he shows up as the result of max calls even when he's not in the iterable.
 
Highest score at index 1 and you weren't even playing! Quite a feat indeed. You even broke 0 indexing I think
 
@Kevin I didn't get the reference. Was another comment deleted?
 
It's the last sentence of the question
 
4:21 PM
That comment references the OP's claim of "I would expect the outcome to be 9 since Kevin has the highest number at index 1" despite there being no Kevin key in the code
 
oh...I guess I missed that part as I skimmed it
 
4:38 PM
this edit; "Comment: spelling text and code formatting in the". Also changes "know" to "no". Great job.
 
I have a category table like this:

Model:

class Category(models.Model):
parentId = models.ForeignKey('self',on_delete=models.CASCADE,null=True)
name = models.CharField(max_length = 200, db_index = True)


categoryId parentId name
1 NULL 'Vehicle'
2 1 'Car'
3 1 'Bike'
4 NULL 'Wood'
5 4 'Table'
sorry
 
Formatting code in chat is a pain: see the illustrated guide
 
Not a huge deal that the above block isn't formatted, since it's still readable without whitespace
 
Sure, I just assumed that was what the "sorry" was about
 
I remember this model from the other day. Categories can have parent categories, yadda yadda, we want to find everything's parent in less than O(N^2) time, etc
Some fancy ORMs can automatically resolve foreign key relations like that without you having to do anything.
"Which ORMS specifically?" you ask? NHibernate for one. Not that it's particularly useful for me to tell you that, since that's a .NET ORM.
 
4:49 PM
Does the optimisation process have a name?
My understanding of your comments is that some ORMs can do better than a recursive approach to multiple generations?
 
I'll try to clarify with an illustrative example. If the WIDGETS table has a sprocket_id column which is a foreign key to the SPROCKETS table, then the Widget class defined by the ORM will have a .sprocket attribute which refers directly to the Sprocket instance rather than the sprocket_id integer.
I don't know if I'd call this an "optimization" because widget.sprocket takes the same number of DB queries as Sprockets[widget.sprocket_id] since that's what it's doing under the hoold
 
SQLAlchemy will do that. I somehow read it in the context of my own current issue of a machine that has part x which we stock in stores, and part x itself is made of components y and z, which we also stock... giving multiple generations. So the parts list of the machine will include x, plus all the sub-components of x in the case that it's just x that is broken
 
Hmm, tricky, since x can be composed of multiple components, and z can be a component of multiple parts.
 
It can be solved recursively, I guess I just hoped you'd pointed me towards something different :)
 
01:00 - 17:0017:00 - 00:00

« first day (3156 days earlier)      last day (1778 days later) »