« first day (3266 days earlier)      last day (1686 days later) » 
02:00 - 19:0019:00 - 00:00

2:02 AM
cabbage
 
 
3 hours later…
4:38 AM
cbg guys o/
 
5:21 AM
@wim Yep. It's calling the main function from the timeit module
 
6:16 AM
@smci their input is a list of a tuple. Strange as it seems, the lst[0] would actually work (albeit it was rightly pointed out to that both nest/unnest should be removed).
The highest voted answer has even kept this to reproduce the desired output for the given input.
 
 
2 hours later…
8:11 AM
is there a standard portable way of prepending a directory to the os.environ['PATH']
 
you mean a venv, os.environ, ...?
 
@MisterMiyagi better^? :D
 
you're thinking something like os.pathjoin(newdir, os.environ['PATH']) which would insert either a semicolon or a colon depending on whether you are on Windows or a real computer?
 
yes
exactly
including the last words
os.pathsep
no function :(
os.pathsep.join(...)
and is there a way to run command shell
without knowing which computer :P
 
unintelligently os.system()
 
8:18 AM
nope :P
 
subprocess has the shell: bool parameter to run commands in a shell. should allow you to launch an interactive one.
 
>>> subprocess.call([], shell=True)
/bin/sh: 0: -c requires an argument
2
>>> subprocess.call('', shell=True)
0
nope
 
-i :P
 
hm, the subprocess docs include how the shell is selected. you could use that to decide which shell to launch
not sure if its sensible to launch a shell without knowing which...
 
I didn't see anything like that in the subprocess docs
 
8:24 AM
see the description of shell=True here docs.python.org/3/library/subprocess.html#subprocess.Popen
 
ah, thanks
 
interactive = subprocess.Popen([os.environ["SHELL"]) but then how do you usefully communicate with it?
 
it's basically /bin/sh on POSIX and COMSPEC on windows
 
or is that COMSPEC on Windows?
 
I wanna run user's shell :P
I am doing bigdada
meaning spark and lots of b*tthurt
 
8:27 AM
sounds that way ^^
 
why do you want an interactive shell? for the user to type things into?
 
shell = os.environ.get('SHELL') or os.environ['CMDSPEC']
ya
got all the spark environment variables unf*d there.
 
cbg
 
was there a way to activate a venv scriptedly? :P
venv.create(rel('spark-venv'))
 
8:50 AM
Hi everyone, I'm facing a really basic issue. I can't read a xlsx file while I'm giving the full path, not a relative one
I get this error : No such file or directory
I use the function read_excel from pandas
 
if the error says the file does not exist, there is a good chance it really does not exist
does os.path.exists return True for the path?
 
Narrator: It doesn't.
 
Talking at the camera no spoilers, please!
 
It says False, but it is. I might do something wrong when I give the path
 
please check the path for typos
does the relative path work?
 
8:57 AM
MisterMiyagi, may I borrow your crystal ball for a sec?
I see a path... a Windows path, with backslashes... a Windows path with backslashes that's not a raw string literal... a Windows path with backslashes that contains accidental escape sequences because it's not a raw string literal *returns crystal ball*
 
sure thing hands over crystal ball
 
sorry, I got impatient and took it without waiting for permission
 
I wonder why Python has "True, False" and not "true, false".
 
@Aran-Fey I knew that. pats crystal ball
@TheLittleNaruto all constants are uppercase: docs.python.org/3/library/constants.html
 
Thank you Watermelon MisterMiyagi
@AndrasDeak Congratulations to Prashanth Chandrasekar
 
9:18 AM
question, do comments that were deleted still appear in my activity/all_actions/comments history, or are they deleted from there as well? I might have just forgotten to hit "send", but before I write the same comment again I'd like to make sure there wasn't something wrong with it.
 
pretty sure they're removed from the history when deleted
 
@Aran-Fey How should I set the path then?
 
with forward slashes ?
 
r'as a raw string literal like this'
Or forward slashes.
 
@Aran-Fey then I'll fail on the side of caution. It wasn't a good comment anyway.
 
9:32 AM
@TheLittleNaruto Doesnt work neither
@Aran-Fey Nope...
Is it ok if the data are not in the cwd?
 
I guess the crystal ball must be broken
 
Apparently
 
@Aran-Fey did you tune in to the right channel? I may have used it to watch TV lately
 
ah, that would explain why the vision started with 2 minutes worth of ads
@Mez13 With an absolute path it doesn't matter
 
@Aran-Fey I thought so...But I don't know what's the pbm then
 
9:40 AM
open('filename') looks for filename in the current working directory. Probably if you show us the open() or similar which is not working, we can tell you immediately what's wrong
 
Actually, when I move the file to my working directory, it works
But I'd prefer to avoid it
 
do you want to hear that again
if you show us the open() or similar which is not working, we can tell you immediately what's wrong
probably
and/or the resulting traceback
 
10:02 AM
What's the open()?
 
well whatever it is that you hope should work but is not working
you have an actual path you believe is correct, yes? show us
you get an actual error message, yes? show us
 
dataPath='C/Users/ms250183/Documents/Projects/Skoda/External/UC_PredictionPartConsump/Data' pd.read_excel(dataPath+'/test.xls')
 
this looks for a directory named C in the current directory
you probably mean /C
 
Yep, sorry, I miscopied
 
a better design anyway is to let your script accept a path name as an argument instead of hard-code paths in the script itself
then you can test it on a different data set or run it again when you receive a new file
 
10:07 AM
Accept a path name as an argument? What do you mean?
And, btw, do you see what's wrong in what I've shared?
 
python yourscript.py /C/Users/ms250183/Documents/Projects/Skoda/External/UC_PredictionPartConsump/Data/test.xls
and then yourscript.py would simply import sys and do pd.read_excel(sys.argv[1])
 
Ok
 
or python yourscript.py test.xls if the file happens to exist in the current directory so you don't have to spell out the full path
 
But why this would work while it's doesnt work in the console?
Because, yes, it still doesnt work
 
besides the missing/ we can't know if /C and /C/Users etc actually exist on your system
they certainly don't on mine
if you say it does but Python says it doesn't, I'm going to trust Python
 
10:10 AM
@tripleee Ofc not
 
but we can't investigate without access to your computer
 
What the heck kind of path is /C/Users? Are you running this in a linux emulator (minGW, msys, cygwin, etc)?
 
looks ike some sort of Cygwin or WSL or some other way to make Windows look more like Linux
 
Don't you think that me and Python are both right? And the problem just come from a bad way from my side to give the path?
 
then that's where you are wrong
 
10:11 AM
@Aran-Fey Nope, pure windows
@tripleee Yes, and I came here to find some help, haha
I feel like in a loop
 
then the correct path would look like C:/Users/ etc
 
Well, thanks anyway guys!
I think, I'll move the data to the cwd :)
 
I would have thought my last comment would have solved it for you
 
@Mez13 Is it Windows? If yes; then which terminal are you using(the default one or something else?) ?
 
@TheLittleNaruto I'm using pycharm, not a terminal
 
10:15 AM
Did you enable VIM environment when installing PyCharm ?
 
VIM?
 
cabbage
 
11:19 AM
cabbage
 
user10984358
11:44 AM
Heya fellas, is timeit only for one liners? I have a one liner and a normal code that does the same logic, how do I check for the total time of the normal code? Start time - end time at the end of code?
 
Why would it only work with one-liners? Just pass a multi-line string to it
 
user10984358
Like a comment block? I’ve never used multi line strings
 
A string in triple quotes can span multiple lines
 
>>> timeit('''x = 3
... y = x + 1''')
0.09006416999909561
 
user10984358
You can have single quotes inside triple quotes?
 
user10984358
11:48 AM
There’s a path as a raw sting inside
 
yes, you can
 
user10984358
Alrighty, thank you will try this now.
 
that's pretty much the reason triple quotes exist
 
You can also pass a regular old function object to timeit
 
12:13 PM
Hi guys, I have a 30 GB .npy file, and 32 GB of available memory. Is there anyway I can shuffle the entire array without loading the entire file in memory (because I can't). Constraints: can not break in chunks. Currently I am using np.random.shuffle after loading the file in mmap_mode= 'r+'
And it has been 6 hours since :|
 
Hmm, maybe if you were using a file format where all lines are the same length. Then you could write your own Fisher-Yates shuffle with a little bit of file.seek() arithmetic
But I don't think .npy files are laid out that way
 
Yeah, the file format is the biggest problem there. No matter what kind of clever algorithm for shuffling an array without having it in memory you come up with, it doesn't matter if there's no way to load/write the file without loading the whole thing
 
user10984358
so i ran some tests and the results are not what i expected
 
user10984358
l=[]
with open(r"paramListAll.params") as f:
	for i in f.read().splitlines():
		splitList=i.split()
		if splitList:
			if splitList[0].startswith('-'):l.append(splitList[0][1:])
 
user10984358
took 8 nsec
 
user10984358
12:25 PM
[i.split()[0][1:] for i in open(r'\paramListAll.params').read().splitlines() if i.split() and i.split()[0].startswith('-')]
 
user10984358
took 1 msec
 
Calling split three separate times is probably slowing you down
 
that's one heck of a time difference, though. Must be pretty long lines
 
Do assignment expressions exist yet? You could use one here
 
user10984358
540 lines
 
12:27 PM
long lines, not many lines
 
user10984358
that matters? TIL then
 
I notice you only seem interested in the first element of splitList. Consider using str.partition, which only splits on the first instance of the target character
 
user10984358
@Kevin yeah that was what i was expecting
 
user10984358
thanks for the suggestion i will look into that
 
Also try doing for i in f: instead of for i in f.read().splitlines(). I forget if trailing newlines are treated the same way, but I don't think it matters in your case
 
user10984358
12:30 PM
what i am trying to do is get a list of "flags" that comes when you do comandLineTool -h for a 15 year old tool that is not at all documented
 
My bad, assexps haven't been invented yet. Planned for 3.8. python.org/dev/peps/pep-0572
 
user10984358
when is 3.8's tentative release ? i saw someone mentioning PyCon 2019
 
for line in f: will include trailing newlines, but since you are splitting off the first space-delimited string, should be no harm
And much more memory efficient.
 
do assexps even work in the if condition of a comprehension? Like [x for y in lst if x := y]
 
:facepalm:
I spent 40 minutes figuring why `NamedTuple Ingredient` was throwing a `TypeError: Ingredient() got an unexpected keyword argument 'name'`! It was defined as `def Ingredient(NamedTuple):` instead of `class Ingredient(NamedTuple):`
Right in front of my nose!
 
12:34 PM
ha, I've had that same problem more often than I'd like
 
Hmm, on second thought partition might not be appropriate here, since the behavior is different for leading delimiters. " foo bar".split() gives ['foo', 'bar'], but " foo bar".partition(" ") gives ('', ' ', 'foo bar')
 
@Aran-Fey if you put round braces around the assexp, yes
>>> [x for y in lst if (x := y)]
 
I guess you can still do " foo bar".split(None, 1)
 
So this NamedTuple is not the same as collections.namedtuple (which would be used as Ingredient=namedtuple('Ingredient', list_of_ingredient_attrs)? An unfortunate name collision.
 
user10984358
i just tried partition wanted to ask why that and not maxSplit arg
 
12:35 PM
@Arne huh, do assexps always require parentheses?
 
partition is faster for one
 
Yes, I knew I would not be the first! Maybe we need a pull request that changes the error message?
 
Also has more predictable returned values
 
@Aran-Fey no, but I don't know the rule off the top of my hat
>>> if x := True:
...  print(x)
...
True
 
Always returns 3 values, regardless of whether the delimiting string is present or not, or if it at the beginning or end of the string being partitioned. split(max=1) requires a little more if-elseing.
 
12:37 PM
I'll add it to my list of reasons to dislike assexps
 
Agreed, quite unfortunate @PaulMcG
 
python.org/dev/peps/pep-0572/#exceptional-cases gives some examples of where parens are needed for assexps. TLDR: if an equals sign or colon is nearby.
Ain't nobody want to figure out what lambda: x := y does
 
@MisterMiyagi one question; should we define app specific constants in same way?
 
>>> [x for y in lst if x := y]
  File "<stdin>", line 1
    [x for y in lst if x := y]
                         ^
SyntaxError: invalid syntax
🤔
 
Aren't all constants app specific? Except for, like, pi and stuff
 
12:41 PM
True and False
 
We must see @Arne pass 5000 rep
 
To answer the actual question: I use all caps for my app-specific constants, yeah. Like WINDOW_SIZE and stuff.
 
@ReblochonMasque soon, hopefully. I can't wait to finally ... checks SO privilege page ... add all the wiki tags that I want without anyone being able to stop me!
 
Yes, there is before, and after... you'll see! :D
 
@Arne Hmm, I don't see anything in the PEP that forbids that specifically. Maybe it's a quirk of the parser that they'll have ironed out by the public release.
 
12:49 PM
I just had someone edit one of my (very old) answers by capitalizing the first word of each comment in my posted code (formerly all lower case), citing something called "The Jon Skeet Decree". What is this?
 
On the other hand, in the PEP there are only two examples of valid assexps in the if clause of a list comp, and they're both parenthesized
 
there are a couple of omissions in that list given the current implementation. For example: SyntaxError: assignment expression cannot be used in a comprehension iterable expression
@Kevin yep, it seems conditions of comprehensions require parantheses around assexps.
 
I just wish the requirements were explicitly documented
 
I reverted the edits and asked them to desist.
 
@PaulMcG The only thing I could find was codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question where Jon Skeet writes "Please use capital letters where appropriate" but that's in the context of asking questions and "where appropriate" is begging the question anyway
 
12:56 PM
@Kevin Maybe they were afraid that if they list all the special cases, people would be even more mad than they already are?
 
75% chance of that, 25% chance of "oh, we didn't even think of that case"
 
There is an issue on the bug tracker where discrepancies between PEP and implementation are tracked bugs.python.org/issue35224
(contains mild amounts of spice)
 
please anyone help me.. problem about machine learning stackoverflow.com/questions/58097278/…
 
@TheLittleNaruto by law of PEP8 constants SHALL be written in ALL_CAPS python.org/dev/peps/pep-0008/#constants
 
At a glance I can't tell if [x for y in lst if x := y] was brought up.
 
1:05 PM
wasn't assignment in comprehension-if-clauses part of the reason to have asspressions in the first place?
 
yeah, one of their main use cases. a bit sad imo if you have to use parentheses there since it doesn't look ambiguous at all, and also isn't enforced in proper if clauses.
 
Yeah, but all of the if-clause examples in the PEP have the assexp as one part of a larger expression, e.g. filtered_data = [y for x in data if (y := f(x)) is not None]
 
@PabitraRoy Room rules strongly discourage raising recently posted questions for help. Give the general community a chance to post answers. (You've already gotten a constructive comment.)
 
@PaulMcG tried with the comment. but no improvement
 
@PabitraRoy please be aware that "I have no previous experience in <question topic>" practically begs to close a question as too broad. We can help on isolated problems, not solve and teach tasks from the ground up.
 
1:11 PM
List of current hard coded assexp exceptions: github.com/python/cpython/blob/master/Python/symtable.c#L34-L44
 
@MisterMiyagi ok i will keep that in mind.
 
you may just want to remove that line, or try to narrow down the topic a bit
either way, good luck
 
@MisterMiyagi I removed that line.
@MisterMiyagi thanks for your suggestion
 
2:02 PM
I do not personally feel bound by this decree
 
2:24 PM
@Kevin cars vs pups, apparently
cbg
 
Ah yes, the eternal rivalry...
 
> Puppis, the Poop Deck, was originally part of an over-large constellation, the ship of Jason and the Argonauts, Argo Navis, which centuries after its initial description, was divided into three parts, the other two being Carina (the keel and hull), and Vela (the sails of the ship).
 
I might expect there to be three tables, then
Two is an odd number
 
Cabbage @wim
 
@Arne I think they get deleted from everywhere, including your notifications
 
2:40 PM
I learned many things today about strings and generators reading your code here: github.com/wimglenn/advent-of-code-wim/blob/master/aoc_wim/… , thank you!
 
@SayandipDutta the npy format is documented so you could write a parser of your own to break it into chunks after all (but then you have to do the shuffling smartly)
 
I should probably look at wim's AOC day 13 implementation to get some inspiration, been stuck there
 
I think the npy shuffling problem is a bit of a "between a rock and a hard place" situation. Any approach will either require 1) loading the entire data into memory, which may be impossible here or 2) rearranging data in the file N times via O(N) time deletion and insertion, for a total of O(N^2) time
Where N is the length of the array. I assume it's pretty big, unless it's like, four elements of 16 GB apiece
Maybe you can get away with loading only half of the data into memory, by doing something like:
seq = list(range(N))
random.shuffle(seq)
pending = {}

next_idx_to_write = 0
for idx, row in enumerate(memory_mapped_input):
    output_idx = seq[idx]
    pending[output_idx] = row
    while next_idx_to_write in pending:
        memory_mapped_output.append(pending.pop(next_idx_to_write))
        next_idx_to_write += 1
So basically you load rows into memory until you find the one that's supposed to appear first in the output. Once it exists, you append it to the output. Then you repeat this process for the second row, and the third, etc, until you've appended every line.
I was going to say "On average, shuffling a list will put the first element somewhere near the middle of the list, so the average length of the pending dict will be N/2", but I think that's misleading
Maybe we should be looking at the worst case instead, where the first element appears at the very end, in which case we're not saving any memory at all
 
3:05 PM
@Kevin seq = np.random.permutation(N) docs.scipy.org/doc/numpy-1.15.0/reference/generated/…
(Much less memory)
 
And it's not as if the worst case is particularly rare -- the probability of pending growing to a length of N*P is 1-P. For example, pending will have N*0.75 elements 25% of the time.
Nor can you do "just keep generating random permutations until you get one that looks like it won't be memory-intensive" because that will strongly bias your results towards permutations where early elements stay near the beginning of the list
 
3:28 PM
Just spent twenty minutes trying to debug this:
>>> print(re.match("-", '-08'))
None
 
I'm kind of an engineer/analyst, and I've coded a lot of engineering stuff on a lot of complicated data. Now my company wants to take it all into a project, automate the whole thing. I'm trying to make a sequence of steps/ workflow that explains everything for the developers to automate and improve. Are there any suggestions for templates/ best practices. I am communicating consistently with the main developer, so there is no communication barrier.
 
The markup engine probably mangled the encoding so I'll just reveal the solution: chr(45) aka HYPHEN-MINUS is not the same as chr(8722) aka MINUS SIGN
 
wim
they are both chr(45) in chat
 
Nice. The other day I had this:
>>> ' ' == ' '
False
and that is conserved in chat ^
 
wim
left space looks wider
 
3:32 PM
not to me
 
wim
and on my system MINUS SIGN and HYPHEN-MINUS have quite significantly different looking glyphs
 
but it is wider
@wim same here
 
wim
I often use EN DASH to skirt around the silly "no -1 in comment" rule
@ReblochonMasque good to hear!
 
Here's how they look on my console.
 
Hi everyone
I was solving this problem codechef.com/problems/ATM2
Initially I wrote this solution
no_test_cases = int(input())
for _ in range(no_test_cases):
    result = []
    no_people, units_money = map(int, input().split())
    money_to_be_withdrawn = list(map(int, input().split()))
    for i in money_to_be_withdrawn:
        if units_money >= i:
            result.append(1)
            units_money -= i
        else:
            result.append(0)
    for i in result:
        print(i, end='')
This wasn't getting accepted despite giving correct output
Then I tried using this modified version
no_test_cases = int(input())
for _ in range(no_test_cases):
    result = ''
    no_people, units_money = map(int, input().split())
    money_to_be_withdrawn = list(map(int, input().split()))
    for i in money_to_be_withdrawn:
        if units_money >= i:
            result = result + '1'
            units_money -= i
        else:
            result = result + '0'
    print(result)
The second one got accepted, whats wrong with the first one?
 
3:39 PM
I'm guessing the former produces output like "[0, 1, 1, 0]", when the desired output is "0110"
Or, no
 
It wouldn't right?
 
I misread the final for loop.
 
The first solution never prints any newlines.
 
wim
Kevin your console is hideous
 
I know :>
 
3:40 PM
it keeps other people from using his workstation
 
wim
the biased single quotes are particularly offensive
 
Thats the reason for the error? @Aran-Fey
 
@RaphX ah, I think Aran-Fey is on to something. Try running your code on the sample input. Your first code will probably print "110100010"
I almost never use the end="" trick to format my output, exactly because it can cause surprising behavior if you don't think about edge cases like these. I much prefer accumulating my data in lists of strings and joining them together with ""
 
Its not printing it in a single line but when I am using the string method there is an extra newline between the output strings opposed to the list method
I guess thats the reason for the error
Is it always needed to have newlines between each output case?
 
If that's what is required by the problem, sure
The example output listed is 11010<newline>0010 so it makes sense that it would reject output that doesn't have the newline
 
3:48 PM
Cool any further suggestions on improving its efficiency?
 
When you say "Its not printing it in a single line", that might be because the user is adding a newline to stdin when he presses enter after typing his input. But if you use an environment where stdin and stdout aren't mixed, then you'll see that the newline isn't present in stdout.
For example, look at ideone.com/TT4pmn. Ideone has separate boxes for stdin and stdout, and you can see that the output is "110100010" with no newline
 
@RaphX I don't recommend doing result = '' followed by result = result + '1'. Accumulating strings in this way will take O(N^2) time*. Better to use a list, result = [] followed by result.append("1"), and print "".join(result) at the end.
(*unless CPython is doing some terribly clever optimization under the hood, but I wouldn't count on it)
 
Even if you can get it, the advice is to act like it doesn't so as to not disadvantage other implementations of Python without the optimization.
 
This might be controversial, but from a style standpoint I don't think I like for i in money_to_be_withdrawn:. I like to reserve i exclusively for values that will be used to index a sequence. In this context I'd use something like for amount in money_to_be_withdrawn:
 
3:54 PM
> Oh, and in April we learned that simply having Internet Explorer on your computer — not even using it — is a security risk.
best part ^
@Kevin I agree
the only exception is bash where anything I'm looping with interactively is called k
 
Some people might have a more lax standard, such as "reserve i for integer values", in which case your usage is acceptable.
 
Ok thanks a lot! @Kevin
 
does anyone here use Slack?
 
wim
yes
I love slack
it makes the SO chat look like a retarded dinosaur
 
ok, I have this problem with Slack at work, and I'm hoping you have a solution for this:
People at work tend to think of a thing they want to say, but break up that ONE thing into anywhere between 3 and 20 messages, each of which contains somewhere between 1 and 5 words
 
4:09 PM
They must be fired forthwith
 
linesplitting. tell them it's a crime
 
sounds like you have a problem with people, not slack
 
this leads to my getting a bajillion notifications for what is effectively ONE GORAM THOUGHT
@Aran-Fey oh this is very true
 
wim
ha
turn off notifications
 
i know what you need to do!
 
4:09 PM
violence sometimes is the answer
 
design a machine learning solution for this problem!
 
Ha, Serenity cursing in lieu of salad cursing
 
!!!! im sure you can invent a problem, and a consequent ml solution, all at once!
 
turning off notifications would lead me to miss messages. I wonder if I could hijack the notification settings to include a saturation count
 
Reminds me of the querents that come in here and write "hey guys, I have a question. I've got input that looks like:". And then a full minute passes, or more, before they write their next message
Love it love it love it
 
4:11 PM
I prefer those to "hey guys, I have a question." [zZzZzZ]
 
@PaulMcG I'm a little too Yam'd for salad cursing
 
I also prefer both of those to "I have a question. How do I frotz my input? I can't show you what the input looks like, though, because it's proprietary"
 
so, has anyone ever written a saturation counter for slack messages? Any ideas where/how to start?
 
Maybe you then suggest numpy.DataFrame.frotz_int32 and they say, "that didn't work, I got Can't frotz a float using frotz_int32. What could that possibly mean?"
 
Uh, just for the record, I was kidding when it came to overengineering solutions by the way.
 
4:15 PM
@Kevin honestly that's the easy scenario, because then you can wave them goodbye
 
@ParitoshSingh you're not wrong though. Writing an ML solution would be the way to ultimately go, so that "mySlack" can learn to send me ONLY the notifications I want to see. Until then, a sat monitor is going to have to suffice
 
@AndrasDeak Not me, I'm an S-class clinger.
good thing, then, that I don't engage with numpy questions to begin with
 
I...uh..ah...yep.
 
Every baby bird I pick up must be nursed back to heath, even the ones that persistently try to eat my face
 
wim
4:27 PM
How do I frotz this input .. I can't use for loops, if statements, or third party libraries. I'm not going to explain why not.
 
also no builtin imports
 
Questions that restrict what I can use are fun puzzles. It's a shame that 90% of them are homework questions where the querent is trying to hide the fact that it's a homework question, which I don't answer on principle.
 
wim
4:47 PM
earlier on SO days, before things got more strict and formal here, it was somewhat a sport to give crazy horrible code for such questions. insane hacks which nonetheless worked.
 
5:03 PM
I was aware of python's inconsistency with casing, but I didn't know there's even a PascalCase-named module in the standard library...
 
wim
which?
 
xml.etree.ElementTree
And now a thematically relevant puzzle: Add one statement that prevents this code from crashing
...  # your code here

from .dom import minidom

print('You win!')
 
wim
oh yeah, I remember being surprised by that one once
there's a camel case module too
 
which one's that?
 
wim
cProfile
 
5:10 PM
that still exists?
 
wim
I think so?
 
apparently it does
I thought the puzzle'd be solved in 30 seconds, but I guess not...
 
wim
nobody here but us chickens
 
if(going_to_crash): dont()
GOTO 5
I'm disappointed that `#\` didn't work. You can't put line continuations in a comment? :<
 
nope
to be honest, I'm not sure if the intended solution works in all python implementations. It's kind of... well... doing something that shouldn't wouldn't usually happen
 
wim
5:29 PM
the starboard is boring as heck right now.. doesn't anyone have a funny gif or something
 
best I can do is a cute gif of Komi-cat
 
wim
 
 
1 hour later…
6:46 PM
i see SO didn't fix their "x questions with new activity" expansion feature that lags when u have more than 3 digit questions :P
 
sounds like someone needs a userscript
 
i clicked it after 1113 new activity, but I'm too fascinated by how long this will take to just kill the process, that chrome is recommending me to do.
userscript might help, but then we won't have a feature that is teaching us to spam refresh everytime it comes up.
oh god, it just finished and expanded the page downwards to fit all 1113 items...
just wonderful, and now clicking it again will just add new ones, i wonder how many more can I add before it crashes my browser.... I assume chrome will just keep eating my memory.....
 
@roganjosh Wondering whether Postgres and SQL Server share any replication protocols ...
 
I understand that python logging allows to creates parent child relationship using: logger = logging.getLogger(parent.child). Here the chain is: Root logger <- parent <- child

I have configured the root logger format using: logging.basicConfig(format='%(levelname)s:%(message)s')

However, when I use the flask's app.logger.info('some message'), which I believe is the child of the root logger; it is not inheriting the format of the python root logger. Does child logger inherit format of root logger?
 
@holdenweb I meant to have a play today but I just didn't have chance, but that also seems like a good angle to try
 
6:58 PM
@Kevin "Any statement about computer technology involving the word 'just' is suspect."
 
Uuugh, did duckduckgo always have a dark background? I might be going crazy
Apparently I have a dark theme. Have I always had one?
oh well
 
02:00 - 19:0019:00 - 00:00

« first day (3266 days earlier)      last day (1686 days later) »