« first day (3349 days earlier)      last day (1600 days later) » 
00:00 - 20:0020:00 - 00:00

12:06 AM
My orbit search was a DFS, with the assumption that the graph was a tree already.
 
bug squashed. Has it been 15 minutes yet?
 
1:09 AM
Anyone else have problems with gnome displaying animated gifs incorrectly? A lot of gifs that look correct in my browser glitch out in gThumb
 
 
5 hours later…
wim
6:31 AM
another fun puzzle
I like the robot themed ones!
 
7:22 AM
@WayneWerner wim already gave you a lot of feedback, but if you want you can also take a look at this github-actions CI/CD configuration that I'm using for a project. Its design is very similar to what we use at my dayjob as well, and it works good enough most of the time.
 
wim
7:50 AM
 
Hi
What does the line number indicate in the output of compile() command?
My command was compile(testContent, "<string>", 'exec') and the output was <code object <module> at 0x108db08a0, file "<string>", line 27>.
Does it mean the python file compiled successfully ?
 
"successful" in so far as there being no syntax errors in there
a code object is the expected output of the compile function. Since you compiled it in exec mode, you can test it's functionality by throwing it into exec
# like this
code_obj = compile(testContent, "<string>", 'exec')
exec(code_obj)
 
Thank you @Arne Where does this line number come from ?
 
huh, the docs don't say anything about a line number. Is it just the length of the input file, or the line in the code where compile was run? I'd have to test
 
I have more than 200 lines in my python file
 
8:08 AM
yeah, it's neither of the two that I had guessed
 
okay
 
is there a way to traverse units in python? like if I want to convert 1 mile to metres, in my head I first do 1 mile = 1.6km and 1 km = 1000m. How would this sort of a logic be implemented?
So then you avoid having to hardcode all conversions
 
8:27 AM
google is your friend: pint.readthedocs.io/en/0.9
Anybody knows why proc.stdout.read() can't be used with a with statement and has to be manually closed? Also how bad is it if an exception happens and it nevers gets closed? Is that a memory leak?
 
@YatShan I found it.. for whatever reason, co_firstlineno is part of a codeobject's repr. So the line that you see refers to the first line in the string that contains executed code ¯\_(ツ)_/¯
 
@Arne You're great. It is the line number of first line in python file that gets compiled.
 
I was wondering if you could use like a directed graph for conversions, nodes are the units and edges are the conversions
 
@YatShan glad I could help =)
 
@Arne Many Thanks :)
 
8:46 AM
I am programming a function which can differentiate expression given in prefix notation, however, I am not good with regEx. I wanna write something like if string == tan [something]: return diff(something) * Derivate of tan[something] , another example, if string = ( [+ or -] [something1] [something2]): return diff(something) + diff(something2)
 
Hey Guys.Sorry to persist with this question but now I got proper results.. kind of :D Looking at this paste pastebin.com/3ZEG1RbX, I am trying to find cycles in my directed graph data and output the edges connected back to the starting node in the cycle. However, for cycle ('d', 'z'), ('z', 'd') I get outputed ('d', 'z') instead of ('z', 'd'). Can someone help me correct ?
 
How should I that?
 
9:41 AM
m.log(75557863725914323419141,2)
Out[13]: 76.0
 
Is there any way to get kaggle competition solutions which have more than certain number of votes, using kaggle API?
 
How to deal with this?It is clearly wrong.
 
10:24 AM
@AjayMishra don't use float math
although you can't not use float math if your result is a float
this is your problem:
>>> (2**76 - 75557863725914323419141)/75557863725914323419141
-6.617444900424221e-23
 
Somebody knows a library like github.com/keredson/mailtest but that works with smtp_ssl? Cause mailtest doesn't. Or how do you guys test mail sending code?
 
>>> from mpmath import mp

>>> mp.log(75557863725914323419141, 2)
mpf('76.0')

>>> mp.dps = 50
... mp.log(75557863725914323419141, 2)
mpf('76.000000000000000000000095469549411979844748550691335')
 
11:05 AM
I wish googles indexer would automatically lead me to the 3.6/8 docs of python, not always to 2.7 and then I gotta switch, that's kinda annoying
 
every time you click those 2 links you reinforce those search hits...
 
@Hakaishin I've got a userscript for that
 
11:28 AM
@Aran-Fey Uuuh lovely, I was thinking about something like this.
thanks
stupid question, but where to I put it to use it?
 
You need to install a userscript addon like TamperMonkey
 
@AndrasDeak I know, but this is def a problem google should fix not a something that should be done in a weird crowd effort to change
 
Then just click the "raw" link on the gist to install the script
 
uuuuuw it works :) thanks, amazing
 
@Aran-Fey that only works post-click, right? Still useful for the user though
 
11:36 AM
yeah, it triggers when docs.python.org loads and then redirects you if necessary
 
12:15 PM
Hmm I finished reading teamten, now I'm bored while some tests run
anybody got a tech related blog, which is sfw?
 
12:40 PM
Ok guys I'm running into weird territory with mocking and testing. I have following sudo method I want to test:
def send_email_with_attachment():
  try:
    msg = create_msg()
    msg.add_attachment()
    send_email(msg)
    return msg
  except SMTPSenderRefused:
    msg = create_msg()
    send_email(msg)
    return msg
 
sudo?
 
So create an email, add a file try to send it, if the file is to big, try to send the mail without the file
pseudo
 
not the source of your problem, but "attachment" is misspelled (in English)
 
funnily enough it wasn't in my code :p
 
12:41 PM
anyways now I want to test it like this:
def raise_exception(*args):
    raise smtplib.SMTPSenderRefused("42", "AttachementTooBig", "Test sender")

with patch('send_email', side_effect=raise_exception) as mock:
  msg = send_email_with_attachement()
  self.assertEqual("Bla", msg.getContent())
 
attachement :P
 
gaaar
just ignore it :D
 
I'm trying :D
 
do you use pytest to run your test suite?
 
the problem is, send_email is throwing the exception twice now, the first time it gets caught, but it gets rethrown again. Can I make a mocked function only raise an exception once?
no unittest
 
12:43 PM
ಠ_ಠ
 
Idk what people have with unittest, it's fine
 
that's the point
 
heh
 
unit test is "fine", pytest is great. but it's good enough I guess
 
12:44 PM
I think he's saying that if you were using pytest you wouldn't have this issue
 
i see. anyways any idea to my problem?
yeah, welp i got a hammer now
 
are you sure the mock does anything at all?
because it looks like you have bound send_mail by name in the code where you call it in send_email_with_attachment. mocking send_mail might not influence it at that point
 
nono it gets called, the above is just an abbreviated example
 
well I need the full example for debugging =/
btw I think side effect can just be handed an exception instance, and it will know that it is supposed to raise it. or at least that's how it works in pytest
so no dedicated raise function needed
 
ok, nvm I ended up with:
def raise_exception(*args):
    try:
        if not raise_exception.has_been_called:
            pass
    except AttributeError:
        raise_exception.has_been_called = True
        raise smtplib.SMTPSenderRefused("42", "Attachement too big", "Test sender")
@Arne that works in unittest too, but the point is it should call it only once
 
12:52 PM
ahh, I think I got your test case now
 
yeah I tested the normal case, now I can also test the case where the attachement is too big
 
would be a little cleaner I think
 
1:19 PM
In java you always know what exception methods throw right? Wouldn't that be nice to have in python too? Is hard to implement or is there a design idea behind not having this?
 
@Hakaishin That's true enough for checked exceptions, but do you always know about runtime exceptions? My Java is rusty.
 
@IljaEverilä I think so
 
Even if your function contains the line raise ValueError("wrong value"), you can't be sure that it raises a ValueError, because maybe the user did ValueError = DivideByZeroError earlier
You definitely can't determine all the exceptions that might be thrown by a function and all the functions it calls and all the functions those functions call etc, because function names can be reassigned too
And heaven help you if the user is dynamically creating exceptions like NotEnoughCheeseError = type("NotEnoughCheeseError", (Exception,), {})
All you really know for sure at compile time is "the function object defined under the name <X> contains a raise statement"
 
1:39 PM
Fun stuff. I like the "let it crash" mentality.
 
same
 
Same. The best way for a program to terminate is by running successfully to completion. The second best way is to crash promptly with a descriptive stack trace.
 
And then your supervisor brings you back to life from a clean slate...
 
imo, writing a lot of stuff to handle types or exceptions "sanely" will only ever be able to handle things that would be easy to debug anyway. the really tricky bugs won't be stopped, and now you also need to deal with bugs that are caused by the type/exception infrastructure.
 
Open question: suppose that the user promises not to rebind any function names, and promises that a variable will never change type during its lifetime. Then is it possible to get a reasonably complete listing of the exceptions a function might raise?
I'm inclined to say "yes", if you also throw in "all user defined functions are type-annotated" and "you have prepared a collections of exceptions that might be thrown by all the builtin functions you're using"
You can't use introspection to determine that math.asin(100) raises a ValueError, because there's no Python code to introspect
 
1:48 PM
I guess the magic word is "reasonably" complete, due to things that you mention, and having to evaluate if the code for example does division and is it checking for zero and such.
 
if you handle all possible exceptions you'll write little code that does anything else though, right?
 
Even with my demands you're still probably going to get false positives like "a() / b() may throw ZeroDivisionError" even if b() only ever returns nonzero numbers
Unless type annotation is a lot more sophisticated than I thought and you can specify things like "returns a float between 1 and 2"
Don't say "surely you can just look at the function body and figure out what range of values it can return?" because then we're back in the middle of Halting Problem territory
 
so we have "just let it crash" vs " do a nauseating amount of work"
 
Option 3: wait for someone else to do a nauseating amount of work and publish it on pypi
Where's my exception deducer, open source community? [I tap my foot impatiently]
 
I don't know but how are you supposed to sell software to people who dont know anything about programming without doing a nauseating amount of work? I mean I can't print a traceback to some customer...
 
2:08 PM
The halting problem is crazy, does anyone know of a python program on GitHub that illustrates the " 'pathological' program g called with an input can pass its own source and its input to f and then specifically do the opposite of what f predicts g will do. No f can exist that handles this case" part?
Would like to wrap my head around that
 
Now, when I say it's good to crash promptly with a descriptive stack trace, that doesn't mean the stack trace has to go to stdout. You can print "sorry, an unexpected error occurred. Please contact the application administrator" and save the stack trace to a log file the user will never see, and email a copy to you.
@Dodge g would be pretty easy to define: def g(x): return not f(g,x). The hard part is writing an f implementation that does a not-too-shabby job of predicting the output of functions that aren't maliciously designed to foil it.
 
More like def g(x): while f(g, x): pass
 
Hmm true
 
@Kevin I would love this. From what I can tell, though, apart from being able to say it (which could be a between 1 and 2) it might be hard for mypy etc to inspect and test with any confidence?
 
Consider the non-malicious function hailstone_search(). It iterates over the integers from 1 to infinity looking for a hailstone sequence that doesn't terminate with a 1. If it finds such a sequence, it returns it. Otherwise, it loops forever.
 
2:18 PM
cbg all
 
A not-too-shabby halt-checker should be able to tell you whether this function halts or not. Since the collatz conjecture is widely considered to be "completely out of reach of present day mathematics", you're going to have a real hard time writing a halt-checker that works in this scenario.
 
Different question, can HTML contain < or > characters that are not part of a tag like <p>? For example inside of attributes (<a class="<">) or inside of a <script>?
 
and that's it then, the halting problem basically says that it is impossible for one function to determine if another function is an infinite loop while also handling all malicious cases?
 
Yeah, and if you handle only non-malicious cases, you have a couple of Fields Medals to pick up
 
Oh, I bet comments are allowed to contain unescaped angle brackets...
 
2:23 PM
And a robust AI that is wrapped in a single function that is as smart as say... a smart person, that could parse code and identify all simple cases like while loops still won't work because it could be presented with something that no human understands (collatz conjecture stuff) and still fail in its assessment?
 
Yeah.
 
@Aran-Fey Also text? eg <h1>Some < wacky > heading <h1>
 
@Kevin From data privacy point of view this is impossible for us.
 
@toonarmycaptain Wait, that's allowed? Really?
 
@Aran-Fey I just tried it to make sure.
 
2:29 PM
Well, just because a browser allows it doesn't mean it's allowed :P
 
web browsers may be the most forgiving piece of software ever made, given how much effort they put into rendering syntactically invalid HTML as best as they can
 
It must be interesting work developing web browsers... I imagine you have to start from a standpoint that nothing is going to be strictly correct html/css etc... and work out what's most likely meant...
 
@Aran-Fey Well, that's a little bit post hoc ergo propter hoc, isn't it?
 
Imagine a browser that displays only "page cannot be displayed" if the html contains the illegal tag sequence <br></br>
 
The internet would be a much better place if all browsers did that tbh
 
2:33 PM
It's going to be hard to put that genie back in the bottle
 
My last and only educational experience in HTML was before CSS was standard, so what is prohibited by spec and what is 'allowed' because I can see it works might be different.
 
Hello
 
Welcome
 
honestly this is the reason why I never want to work with html, css, javascript anymore. It's just terrible
@Aran-Fey fully agree
 
thanks
I have 6 years of experience in Java. I have also a little knowledge in python
 
2:42 PM
I'd like javascript if there were fewer than four ways to do OOP. I would like html/css if every browser rendered all pages identically.
 
Now I am facing some problems in installing libraries in pycharm
I cant install pandas
I have stuck with this problem since last 3-4 hours
 
@Sagor, sounds like a real problem. Are you getting an error message or anything?
 
Command "python setup.py egg_info" failed with error code 1 in C:\Users\USER\AppData\Local\Temp\pip-install-2gr9qjel\pandas\
 
Anything else? I'm interested in seeing the full output from top to bottom. If it's long, you can upload it to pastebin or similar, and post a link here
 
ok.
 
2:46 PM
For Windows, it's probably easier to just install Anaconda or use one of the unofficial binaries to get pandas
 
It doesn't save progress too well, but I was last trying to show that multiplication for natural numbers is associative.
 
yeah dont bother with the official pandas
use the unofficial binaries, they just work
 
What the... Why is it trying to import Cython
 
@Hakaishin just write good code that doesn't crash. you don't need an exception handling or type assertion framework for that, just lots of QA, plus a nauseating amount of work invested into parts that actually mean something
 
2:51 PM
@Kevin because it compiles with Cython, no?
 
The water in my knee tells me that solving this error is 7 difficulty points out of 10. Installing the unofficial libraries is around a 4, so maybe try that first
 
Sometimes you need to follow the path less taken.
 
ok. May be development with python is more enjoyable in linux , right ?
 
Everyone that uses Linux says so ;-)
 
@Sagor Yes, in fact, we can generalize this statement to : Development with X is more enjoyable in Linux.
 
2:53 PM
cbg
 
Unless X is a maliciously designed function that detects what OS you're using and mails you a package of live bees if it's not Windows
 
I blinked, and so many days went by, it's insane. Rip advent of code this year for me :P
 
This is all written in Cython. It's compiled in setup.py
 
@roganjosh Ok, makes sense. In that case, I'm baffled by how I have a working pandas installation, but no Cython. Did I use the unofficial binaries...? I can't remember.
 
@Kevin Maybe you have Cython and you just don't know it.
 
2:55 PM
Maybe you are Cython and you just don't know it.
 
Mmm. Possibly. It's a pain in the backside to get it to work otherwise
 
@Dair Maybe. import Cython doesn't work, but it might be, like, squirreled away under a pseudonym for some reason.
 
@Kevin Maybe Cython is a maliciously designed package that detects what OS you're using and mails you a package of live bees if it's not Linux.
 
cabbages all
 
Hold that thought, I need to sign for a package.
 
2:58 PM
@Sagor everything is more enjoyable in linux :) Except interfacing with windows software, which obviously is not linuxes fault
@Dair yes
 
[faintly, from the other room] Yes, I'll sign... I wonder who this could be from? [sound of cardboard ripping, followed by angry buzzing] Aieee! They're in my eyes! [screams fade into distance]
 
why does python show [MSC v.1900 64 bit (AMD64)] on win32
when my windows is 64bit?
 
is "on win32" a part of the message?
Im confused as to what is being shown vs what is your words for stuff
 
If his install is anything like mine, the message is:
c:\>python
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:21:23) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
Give or take the processor type and number of bits etc. So yes, the "on win32" is part of it
 
That's the same thing as sys.platform, it's an identifier for your OS. It doesn't actually care about bitness
 
3:03 PM
AAARRRGH. Why is this **** so annoying
Can't uninstall 'numpy'. No files were found to uninstall.
Requirement already satisfied: numpy in
so what is it now, is it there or not, pip ist trolling me
 
sounds like problem solved :P
 
then why does it say 32? You wanna tell me windows calls their os win32 even if it runs 64bit? That sounds ludicrous
 
It wouldn't be the dumbest thing windows has ever done :>
 
Is there any practical reason to choose one of these two over the other?
for ... :
    if x:
        continue
    if y:
        # do stuff

for ... :
    if x:
        continue
    elif y:
        # do stuff
dis.dis is telling me the only difference is where the jump points to if the first if is entered, but that shouldn't matter because the continue takes control of the jump destination at that point.
 
if this is all the code that there is, then control flow wise, it doesn't really matter. however, usually i find conditionals will tend to belong in elifs sometimes for purely logical reasons
 
3:11 PM
I usually go with the first style. Not for any objective reason, really.
 
The main stipulation is that continue is guaranteed in the first if.
 
like especially when checking conditions that have some type of logical link to each other. Say, if x ==0 and then the next condition is elif x==1 or so on.
 
@ParitoshSingh For the sake of readability.
 
Aye, pretty much
For the same reasoning, sometimes if is better, and sometimes elif is more appropriate. Depends on the conditions themselves.
One last consideration in this particular example is following the "guard" pattern throughout.
 
@ParitoshSingh is you ICSE from ? :P
 
3:14 PM
I'd normally use repeated if statements for checking requirements.
 
On a similar basis, I often find myself choosing between two styles:
def f():
    if cond:
        return 23
    return foo()

def g():
    if cond:
        return 42
    else:
        return bar()
 
if any of the if statements are entered, then requirements are not met, so continue.
 
I usually choose f's style, since less indentation gives me more room to work without hitting the right edge of the screen
 
for ... :
    if x:
        continue
    if not y:
        continue
    # do stuff
For the example you wrote, this could be the "guard" pattern applied on y
I think i got kevind
@anky_91 uh, im sorry i have no idea what you said there xD
 
he he, i meant you sound like an ICSE student . irrelevant though
 
3:17 PM
But yeah, essentially if you're already using a "guard" against further execution, via use of return or continue, then you can leverage that throughout to essentially get all guard conditions out of the way. What's left is code that doesn't need an indentation level
@anky_91 Ah :) Well, no, but it's complicated :P
 
Ok. I figured it out. Multiplication of natural numbers is indeed associative
 
@KieranMoynihan it's actually this :)@ParitoshSingh understood
 
I was in CBSE till 10th, and GCE A levels for what you'd call 12th.
 
3:20 PM
I'm getting really confused by pandas setup.py. On the one hand, it looks guaranteed to throw an exception if you don't have Cython, but then there's checks later on in the script as though it can fall back to some other compile option
 
Sounds like a chicken and egg problem. :P
 
@ParitoshSingh sure :)
 
@roganjosh Some weird fate wants it that I just today updated my pandas and destroyed my whole system with it. Luckily I could delete my venv and start from a fresh venv and now I could just install pandas, numpy, matplotlib no problems. So in case you still have the issue you could also try that
 
I don't have any issues, I'm just trying to understand what the code does :)
 
@roganjosh Didn't you try to install it and it didnt work?
 
3:24 PM
So it looks like you can compile pandas without Cython. I'm not totally clear on what logic is going on there
@Hakaishin many years ago. I just use the binaries now or Anaconda. I think you've got me mixed up with someone else struggling; I just gave a suggestion on how to get around the issues :)
 
and there's me doing pip install pandas and it just works :)
 
Same deal, except i use conda install instead. :)
 
@Kevin have you tried out MTG Arena yet?
 
According to: stackoverflow.com/questions/33330393/… my current situation is impossible
 
@ParitoshSingh I recently found a solution to the chicken/egg problem: make a chicken stir fry, and break an egg on top of it :P
 
3:36 PM
I got python 3.6
but mock cant be found
should I just install the package called mock? Is this the official one?
 
@inspectorG4dget Sounds like a Proof of Concept is due
 
Oh i needed to add unittest. lol
 
Random question, what's the name for a person that helps illegal immigrants cross the border?
 
Woah. That's a pretty hefty salary. I'm guessing there's one too many zeros in there :)
 
like smugglers?
 
3:41 PM
@Aran-Fey traffickers
 
that's the one I was looking for, thanks
 
@roganjosh Looks like it's time to become a crypto dev
 
No kidding!
 
@ParitoshSingh Ramsay put out that PoC a long time ago: youtube.com/watch?v=mCknnSo6djI
 
@Aran-Fey No worries. Thinking about it more, the term will almost certainly default to drugs unless you say explicitly "human traffickers" btw
 
3:52 PM
Yeah, I did say it like that
 
@JonClements No. Playing against people online doesn't seem as satisfying to me as paper magic, so I haven't really looked into it.
 
1200k just seems awkward as a comp description. I wanna agree that there's one too many 0s in there as a typo - I mean, 84k - 1200k is just too wide a band
 
Given that they raised $40m and the job comes with share options, the typo is basically a certain :)
 
How to add limit of lines text file can hold?
So when new lines get added, old ones get deleted. (So it never goes above more than 20 lines for example)
 
you could use a post-save check to delete the first n-k lines
 
4:05 PM
Or, you're gonna be carrying the company on your shoulders. I'm quite surprised that they're investing in Python tbh. I watched crazy documentaries about High-Frequency Trading and they got to the point that they found it was faster to send market signals via telecommunication towers across the US than use cabling and relays. The market is shaving nanoseconds
 
I mean, they did buy an entire floor of a New York hotel for the sole reason that the undersea cables come there
 
If you want to make it impossible for a user to open a text file in Notepad and add more than 20 lines to it, you can't do that with Python. You'd basically have to write your own operating system that imposes that requirement.
 
umm... couldn't you write your own Notepad with python, to impose that restriction?
 
I have a function that adds logs to text file but i dont want it to go on forever
 
If you want to make it impossible for your Python script specificially to add more than 20 lines to a file, you can open the file, call readlines(), check its length, delete a line if it's too long, append your line, open the file in "w" mode, and call writelines()
 
4:07 PM
at some point old logs should get deleted
So i can check number of lines:
def file_len(fname):
    with open(fname) as f:
        for i, l in enumerate(f):
            pass
    return i + 1
 
'logging' can already so something similar with RotatingFileHandler. Are you sure you're not reinventing something here?
 
so if file_len returns over 20, i need to delete from top of the file file_len - 20 number of lines
but thats what i need help with, whats the best way to remove x lines from top of a file, i dont have much experience in python
 
def logFunc(outfilepath):
    with open(outfilepath, 'a') as outfile: outfile.write(logMessage)
    clearLines(outfilepath)

def clearLines(infilepath):
    with open(infilepath) as infile: lines = collections.deque(infile, 20)
    with opne(infilepath, 'w') as outfile: outfile.write(''.join(lines))
 
yea
thank you
 
4:14 PM
The majority of "how do I modify my file in XYZ way?" questions can be answered with "load the contents of the file into a list, modify the list, and write the list back to the file"
I see a lot of cognitive dissonance among new users that are very proficient with manipulating lists, and understand that a file can be loaded/dumped to/from a list, but struggle with manipulating files because they don't make the connection
Perhaps they're holding out hope that there's a more direct method of manipulating the file that solves their problem without having to do this kind of round trip. And sometimes, there is. For example, RotatingFileHandler takes care of size-limited log files. But a lot of the time, you've just got to buckle down and write your own solution.
 
Thats true, you should always try to solve the problem yourself, thats how you learn the most anyway.
 
RotatingFileHandle seems to care about file size in bytes, rather than numLines. This might be "close, but no cigar", to what Garrus is looking for
 
I won't do this again :D
 
@inspectorG4dget Sure, it's not a direct replacement but I was curious to see if they were aware of logging. I'm not sure I can envisage a practical situation where line count matters absolutely rather than file size but <shrug/>
 
@roganjosh agreed. Didn't think you were trying to red-herring OP. In fact, I was entirely unaware of RFH until you mentioned it, so thank you for teaching me somthing new
 
4:25 PM
@Kevin oh... do join... it'd be interesting to play someone I actually know :)
 
I remember the name well because it's one of those imports that Spyder will auto-complete for you, but which is totally broken if you try to run the code outside of Spyder :P
 
Hmm, playing against a non-stranger is more compelling... I'll put it on my list
 
Oh, curious, have you tried out spyder 4 yet?
 
Yes, I ditched it, but it was during their many betas
Are you using the release version?
 
I was setting up anaconda today, ended up accidentally installing it
 
4:32 PM
From what I could see, their auto-complete got dumber but at least it worked, while they just abandoned the issues in 3.
 
Initial confusion aside (also, it's dark by default!) I think it might be an excellent release. I've been surprised by the experience so far. Just had to change 1 shortcut around though
 
Hmm, maybe I'll have another go if it's coming with your recommendation :) You already commented on the dark theme when I posted a few months back at the silly things it was doing :P
 
If you do, i personally can't get used to the loss of ctrl+return as my "run selection", and that was the shortcut i decided to change back
But it's got a couple of very "jupyter-esque" things now that i found out about as a consequence of the shortcut changes
 
What's jupyter-esque? Special breakpoints to run things in isolation?
 
Aye, essentially the ctrl+enter and shift+enter (and that's how i found out about it actually) now by default try to run "cells"
Which apparently can be demarcated by a #%% comment on a new line
 
4:41 PM
Oh, interesting
 
So, if you want to declare a chunk of code as a cell, just add that demarcation below it, and suddenly life's made super simple if you want to run a block quickly
The editor seems much better at giving suggestions, though it was still slightly sluggish. (But i hadn't installed Kite, which is apparently a new auto suggestion library that can optionally be used. Not open source though, but free)
The other thing i found out was that it gives a ridiculously good "docstring template" now. I don't know whether that was a thing in older versions, but i loved it
 
Yeah, they did change the library for suggestions because it was inexplicably borked in 3
 
declare any function/class/method, press a shortcut, and suddenly a numpy like docstring layout with parameters and return ready to be typed in is generated
 
@ParitoshSingh Oh, that was totally broken in beta. Triple quotes made it crap itself becayse it tried to load the docstring template. If that's been fixed then that's a major issue closed
 
oh, i don't know if it tries that still. Since i found out about the shortcut, i'd just press that combination without writing triple quotes myself
 
4:48 PM
It used to do it by default (or at least that was my impression) so it'd go crazy when I tried to write SQL which I generally have in triple quotes. That was a big part of me ditching the beta version
It used to stall and suddenly the "cursor" (?) would appear after the second " so suddenly you're typing in the middle of the quotes you just tried to open. Anyway, it sounds like it's functional now so I'll try it out again :)
 
5:13 PM
aye, my first impressions have been very positive so far. Don't hold me to it if they turn out to be misleading though :P
 
You mean I can't haul you up in court and look super-disgruntled on the front pages of newspapers? Disappointing
 
I suppose if you reallyyy want to, we could try that out sometime.
 
Mate, I have all the training I need from APILN. I'm just waiting for someone to ghast my flabbers
 
6:07 PM
cabbage
 
6:23 PM
"On a side note, and unrelated to the attack vector, NBU also advises Python developers to avoid using "pip" — a Python package installer — when downloading Python libraries, as pip does not support cryptographic signatures." here. Great.
 
That's fair. A system without third-party packages is much safer.
Jokes aside, with setup.py and friends in principle you can investigate the source first... not sure if that's any safer in practice, I'd think not. What do they suggest instead?
 
They don't :/
 
@AndrasDeak in the same vein, the safest computer is one that is buried 50 feet underground without any Internet connection.
 
m8_
Silly question, when using pypyodbc, is there a way to continue the connection string (pypyodbc.connect(r"Driver={SQL Server};Server=SERVER_NAME\SQL2014;Database=DB_NAME;Trusted_Connection=yes;") on the next line?
I tried using / like with other strings but that results in a connection error
 
A connection error? It sounds like you stepped out of the with block
 
m8_
Sorry, DatabaseError: DatabaseError: ('08001', '[08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.')
 
What, exactly, is the code here?
 
m8_
6:42 PM
cnxn = pypyodbc.connect(r"Driver={SQL Server};Server=SERVER_NAME\SQL2014;Database=DB_NAME;Trusted_Connection=yes;"
then my query
 
@wim nice
 
m8_
then df = pd.read_sql_query(my_query, cnxn)
 
You didn't assigng the connection to a name
 
m8_
Just updated
It connects when the string is all on one line. Trying to use `` results in that DatebaseError\
 
Mmm, "exactly" is doing some work here
 
m8_
6:45 PM
typos be trollin
 
What happens if you query the DB outside of pandas?
 
wim
7:08 PM
how does vanilla mean 'bland' when vanilla beans are/were rare, exotic and luxurious?
 
ice cream?
 
reddit.com/r/explainlikeimfive/comments/1bp7vu/… indicates that "vanilla" as in "boring" originated in the 1970s, in the context of unadventerous and/or heteronormative sexual activity. Provides this screenshot of the OED as a citation.
 
That is weird that I associate ice cream without flavor with vanilla when it clearly has a flavor, wonder what ice cream without any flavor would actually taste like
 
milk or cream
 
that's what "vanilla" already tastes like, maybe they lie and leave out the vanilla
 
7:17 PM
Have you ever drunk either?
milk and cream and vanilla are three very distinct tastes
 
I drink milk, cream only the whipped version
 
Speculation in the comments, and by the linked SMBC, is that the term was coined at that time because "vanilla" shares an etymological root with a certain other V word that is often involved in hetero sex
 
@Kevin hmm, that's a weird conclusion. Definitely not what I'd think given current use.
 
Viewed in the original context, it doesn't seem that wild of a theory. But it would be quite hard to guess its origins without research, given its G-rated use these days.
 
yeah
 
7:21 PM
This has been a boon for the vanilla flavoring industry in that most people have come to associate something vanilla as bland or flavorless, meaning that the vanilla industry can now sell the public a flavorless flavoring,
 
that comes out of the butt of platypodes
or is it some other animal, or some other flavouring?
My bad, it's beavers. Much more vanilla than platypodes.
 
Read that the platypus is the only animal that can make its own custard because it produces milk and eggs
 
wim
7:54 PM
I don't think that's true
echidnas are also producing milk and eggs
 
they also eat eggs, but only because English uses the same word for eggs and eggs
 
Any sufficiently determined mammal with access to surgical tools can use their eggs for culinary purposes
 
wim
birds too
@Kevin checks out books.google.com/…
 
00:00 - 20:0020:00 - 00:00

« first day (3349 days earlier)      last day (1600 days later) »