« first day (1717 days earlier)      last day (3222 days later) » 

9:01 PM
starred that
 
May the competition of "OS Wars" continue! :p
 
No, just stop it.
 
Let's talk about editors instead.
 
(ahhh... my normal sarcasm wasn't obvious then?)
 
I have never had an issue with mine. I've had lots of issues with Linux installs over the years :p circumstantial evidence ftw.
 
9:03 PM
Besides, I already won the war, there's no point in further humiliating yourselves.
 
DSM
Lack of interop with Office, the world's most common collection of everyday business software, makes working full-time on Linux a no-go for me.
 
os.popen seems to have always been available as a context manager...
 
@poke and @AaronHall thanks so much, i really should frequent chat rooms more, cool! thought it was kinda like IRC where all members know each other, form a gang, talk to each other and don't reply to anyone else unless he begs so much for it.... but it's cool in here
 
We all have nominal reputations to uphold...
 
@Fischer I think you meant @AnttiHaapala ;)
 
9:05 PM
Fair, I also need to use scientific software, but I simply run a virtual machine.
 
We do all know each other and we do have a gang, you just happen to be a part of it now. You can get your tattoo on the way out.
 
no, you've basically accurately described us.
You will code eternal, slithery and cold blooded.
 
@Ffisegydd There is a tattoo!?!?!
 
Our sworn enemies are JS.
 
huh
I thought Lounge?
 
9:06 PM
And php
And lounge. And ruby. And R.
 
@Fischer Yeah, you meant @AnttiHaapala
 
DSM
The Lounge is its own thing. Scary place.
 
Don't go there. You'll not come back the same.
 
There's also an empty expansion I run...
 
Hey guys
 
9:12 PM
cbg
 
wb @Dracunos
 
GOOD MORROW.
 
How have you all been?
 
Bit my tongue :(
 
Hey @Dracunos, doing well
How're you?
 
9:15 PM
@Ffisegydd Isn't it against the law to spell tongue any other way than "thongue" in that context?
 
@davidism for your perusal techcrunch.com/2015/06/29/…
 
@davidism I totally agree with you. But, I gotta make sure my script runs across all platforms (and most of my friends, who don't seem to understand the power of Linux, get addicted to Windows, just because they can play games in it) -_-
 
(I wasn't being serious. (Yes I was.))
 
Will play with that live coding tomorrow
 
I'm doing okay. I think I get Friday off for independence day, so that's cool
 
9:18 PM
Plus it's YC backed so it must be good.
 
ok, who can explain this? on linux:
>>> os.popen('exit 42').close() >> 8
42
 
I'm one of those evil programmers that refuses to go Linux because of video games. Windows + python builds character
 
Should put that on a tshirt.
 
DSM
@davidism: about once a week I visit you and see only the forest. Where are these coding tutorials I keep hoping to see?
 
"Coding on Windows builds character!"
 
9:19 PM
Character like Emperor Palpatine, or character like John Galt?
 
DSM
If Kevin were here he could come up with an encoding joke. :-/
 
@DSM the current tutorial is "how to be patient"
@Augusta neither of those are good characters
 
@davidism Exactly.
 
That sounds like an awesome shirt. Too bad I only wear solid colors and an ac/dc shirt my gf forced me to get
 
He's in a meeting and just randomly thought of that joke. Truly being Kevin is a curse.
 
DSM
9:20 PM
I know who Palpatine is, but who is John Galt?
 
@Ffisegydd Is it still full desktop streaming, or does it stream the code only?
 
DSM
(Heh.)
 
@DSM :-|
 
No idea. On my phone so can't check
 
Calvin's dad from Calvin and Hobbes: "Coding Python on Windows builds character"
 
9:21 PM
@poke looks like full streaming, just targeted at developers
 
I'm at a loss when it comes to most famous people names
 
Ah, okay
 
I imagine that you don't need such throughput for text.
 
@Dracunos A girlfriend that forces you to wear AC/DC t-shirts isn't the worst world you could hope for. Do you at least get to wear stripes sometimes?
 
As opposed to vidya gaems.
 
9:22 PM
so no actual benefit over twitch
 
Ugh, hate stripes :p she wishes I'll wear all this crazy stuff
 
Well require less bandwidth.
 
It better have native support for Linux, or at least contribute to OBS.
 
DSM
Plaid shirts haven't been mentioned nearly enough in this conversation. Stripes themselves aren't much fun, but if you cross them, the become awesome.
 
If it's targeted at text
 
9:23 PM
@DSM John Galt is an anarchist-libertarian-type from an Ayn Rand story nobody should ever read. His claim to fame is vanishing from a weird fictional America run by trains with mind-control powers and slowly abducting millionaires and bookies.
He has a hundred-page speech in the story.
 
That sounds like a riveting read :p
 
@Augusta but who is John Galt?
 
Hold on. There's Salad for this...
 
DSM
@Augusta: yeah, I was dropping the "who is John Galt?" question, and was insufferably pleased with myself that I managed to find a natural way to fit it into a conversation..
 
Are we all not getting the jokes we're throwing around?
 
9:24 PM
I think you should paste his entire speech here. It's not code so it doesn't break the rules
 
"Yam," I think. "Yam, I do not want to talk about it."
 
@DSM for good measure: :-|
 
DSM
@davidism: oh, come on. I should get some props for that one. (mutters "llanfair" to himself)
 
@DSM I'm really embarrassed that I missed that the first time. =_=;
 
> On POSIX systems, if the return code is positive it represents the return value of the process left-shifted by one byte
 
9:26 PM
@ZeroPiraeus stop reading the docs, it's too easy
 
I actually managed to meet my numbers this month. Now comes the difficult job of not having much to do but having to look like I'm busy until Wednesday
 
The docs don't explain why.
 
@poke Hmm... That seems to work. But, why does Windows just rush out of the program once it encounters that thing?
 
(it's clearer that that's the link in the 2.x docs; rewriting has obscured the causal link)
 
that explains why
 
9:28 PM
@Waffle'sCrazyPeanut I don’t think it “rushes” out of the program. It just terminates the raw_input properly
 
@poke If it did, then it shouldn't print This is what actually happened here! Nothing happens here too!
 
@davidism TIL something about os.popen() I'll probably never use :-)
 
It prints both the lines!
But, KeyboardInterrupt should be caught only at bing() and not at __main__
 
Hmm, the raw_input is terminated with the EOFError though, and the KeyboardInterrupt is only interpreted afterwards
 
This is all why subprocess is a best practice, I'm sure.
 
9:30 PM
I guess it’s because of the input loop… maybe…
 
@poke So, the conclusion is that even if I make use of EOFError, I can't get what I needed in cmd, right?
 
you can just pass the EOFError; you don’t have to print anything in there
 
Are post titles not supposed to name the language they're in, or does it matter? I've seen corrections over it, but I have yet to determine if anyone actually cares.
 
Don't just throw tags in the title, but if they fit naturally it's fine.
 
9:34 PM
That makes sense.
 
I usually edit them out completely unless I can foresee the same question being asked with the same title for a different system.
 
@poke: I think you misunderstood. The string "This is what actually happened here!" is inside the catching function in bing() and "Nothing happens here too!" is inside the catching function in __main__. If it does catch it in bing() (and it does), then why should it propagate into the catching function in __main__? That shouldn't happen, right?
 
@davidism err... why cvpls when you could already close using gold badge? :0
 
That's kind of the edit I'm looking at. It's a pretty sweeping question, but I don't know if the tags naturally narrow it, or if it bears repetition.
 
I don't have gold yet.
Like "how to aggregate over two columns" could be asked in SQLAlchemy and any other sql-related system, so I'd leave "in SQLAlchemy" in there
 
9:35 PM
oh - mis-read - poke did it - fine :)
 
@Waffle It’s because the EOFError is raised first, and only then the CTRL+C is interpreted, causing the KeyboardInterrupt—but at that time, bing() completed
 
Close though, 65 more points.
 
@Augusta One reason that might not be immediately obvious is that SE puts the most popular tag into the title anyway for SOE purposes. See google.com/search?q=Why+is+[]+faster+than+list%3F for an example.
 
Oh. That makes a lot of sense, then.
Okay, thanks.
 
@poke Please, let's consider a similar example.
def bing():
    try:
        raw_input()
    except EOFError:
        print 'This is what actually happened here!'
    except KeyboardInterrupt:
        print 'Ahh!!! Nothing happens!'

try:
    bing()
    print 'Yoo hoo...'
except KeyboardInterrupt:
    print 'Nothing happens here too!'
^^^ There...
Same situation. Once bing() is called, I press Ctrl-C
If this goes right, then I should get 'This is what actually happened here!' and 'Yoo hoo...'
 
9:40 PM
so it looks like Windows passes Ctrl-D before Ctrl-C?
 
def bing():
    try:
        raw_input()
    except EOFError:
        print 'EOFError is caught'
        print 'but this line is not printed'

try:
    bing()
except KeyboardInterrupt:
    print 'the keyboard interrupt is faster'
Try that :)
 
What lively code :)
 
I'm trying to follow this. Can you concisely summarize, @poke?
 
@poke: KeyboardInterrupt is faster, huh? This is so bad... It just quits without doing anything that precedes bing()
For instance, it never prints "Yoo hoo..."
 
@AaronHall When pressing CTRL+C, the EOFError seems to be raised first while raw_input is still waiting on the user input. Just after EOFError is caught, the CTRL+C seems to be interpreted in the input loop to raise a KeyboardInterrupt
 
9:43 PM
a try should really only have one line thats being tried
in general
 
@Waffle'sCrazyPeanut maybe try catching them both together, as this answer suggests? stackoverflow.com/a/24338247/541136
@poke do you think this would work? ^^
 
@AaronHall Wait, that works!
 
ok, then I have a winner.
 
I tried a tuple but I didn't try it by casting as a single error
 
No, that shouldn’t work.
 
9:45 PM
@poke Thanks for your explanation and @AaronHall thanks for your suggestion! :)
 
Too bad IDontLIkeYouException, YouAreBeingMeanException was given in the top answer 4 years ago...
I'd hear poke out on this one
 
Try should only have one expression?
 
@poke It works. I get This is what actually happened here! Yoo hoo...
 
The EOFError is still raised first, so a KeyboardInterrupt is never caught at the same point. And then after the EOFError is handled, the interrupt comes through. So that would happen one step later
 
@AaronHall lol as you pointed out 2 years ago :P
 
9:47 PM
@poke Let me show you what I have...
 
Yeah, good idea ^^
 
def bing():
    try:
        raw_input()
    except (EOFError, KeyboardInterrupt) as err:
        print 'This is what actually happened here!'

try:
    bing()
    print 'Yoo hoo...'
except KeyboardInterrupt:
    print 'Nothing happens here too!'
^^ There...
 
This still gives me “This is what actually happened here! Nothing happens here too!”
 
that second bit will never ever be reachable
what
hmm
 
lol
 
9:48 PM
@poke What? It works for me! o_O
 
versions of Python please, everyone who is trying this.
and system
 
I got This is... Yoo Hoo
 
@AaronHall 2.7.8 (win 8.1)
 
PowerShell vs Cmd too maybe?
 
user559633
i refuse to be a part of the system
 
9:49 PM
2.6 win
cmd
 
@Joran As per above, it seems that EOFError is raised first before the CTRL+C is handled by the input loop. So after catching the EOFError, the interrupt comes making it caught in the next step
 
I got the YooHoo text
and theres no way I can seem to get into the except block
 
Python 2.7.6 on Windows 8.1 in both PowerShell and cmd.
 
cygwin with 2.7.8 gave me what Waffle expects
 
@Joran Did you just press Enter? :P
 
9:50 PM
2.6.6 windows cmd gives me what waffle expects
 
on input I press ctrl-c
 
no i mean I get "This is what actually..." and then "Yoo Hoo"
 
super odd
 
ofc i didnt press enter ... what kinda newb do you think i am :P
 
There.
 
9:52 PM
I get the input and then "Yoo hoo...".
win7sp1, 2.7.8
"This is what actually happened here!" on interrupt.
 
I get the same on the dev version of 3.6
 
"This is what actually happened here!
"Yoo hoo..."
on interrupt, rather.
 
why is poke getting weirdness?
Is it the powershell?
is Ctrl-c being repeated?
 
@poke: Yay! I got back to the same situation again (it doesn't work) -_-
 
It might actually be my terminal..
 
9:55 PM
Admin privs?
 
^ Standard PowerShell console
 
actually even using Waffles Original code I get the expected output ....
wtf
I hate inconsistent behaviour
 
^ Standard cmd.exe console
 
What the..??? O_O
 
Just tell your friends to stick with cygwin on Windows...
 
Is this weirdness related to the raw input function?
 
works fine for me in PS also
 
I think Powershell isn't letting him catch the keyboard interrupt
 
^ It’s getting worse.
 
I just ran in powershell and also got the expected output
I think poke is trolling us :P
 
9:58 PM
I’m dead serious here.
 
(jk i dont really :P)
 
How's your keyboard, poke?
 
def bing():
    try:
        raw_input()
    except (EOFError, KeyboardInterrupt) as err:
        print 'This is what actually happened here!'

try:
    bing()
    print 'Yoo hoo...'
except KeyboardInterrupt:
    print 'Nothing happens here too!'
But, when I use this...
 
do you have one of thos fancy keyboards with macros and stuff?
 
Crazy
 
9:59 PM
Wait, I get the same output...
I'm dead!
 
in none of the examples have I been able to get "Nothing happens here too!"
 
I just got "Yoo hoo..." a few minutes back
 
@JoranBeasley Nope
 
@poke: There's something weird going on in cmd
 
It’s super weird everywhere :P
 
10:01 PM
Does anything inconsistent happen if a blind exception is used?
 
I still dont understand how you guys get into the second block
 
bahaha…
^ I give up.
 
I used to hate this kind of Windows nonsense, but that doesn't make it any less irritating when you have to first understand it and then find a way to program around it
 
@poke Meh, that's new... O_O
 
Does it make any difference if you put a pass statement (at the same level as the try) so that the function is returning from its main logic rather than dropping off the end of an error handler then dropping out the end of a function? Scraping the barrel for ideas here ...
 
10:04 PM
I think cmd.exe/powershell is catching the KeyboardInterrupt signal and then repeatedly sending it to the Python process. Maybe.
 
@poke IDLE is a different interface to the interpreter, again suggesting it's the shell/term
 
@AaronHall As I said before, the intial exception thrown that stops raw_input is not a keyboard interrupt. If you remove the KeyboardInterrupt from the except in bing, you get the same result (on my machine).
@holdenweb It doesn’t make much sense though that IDLE catches no exception at all (although I can no longer reproduce that situation now…)
 
@poke If we only talked about things that made sense Windows people would have nowhere to come for help :)
 
Here's what I get in Windows with python 3.3:
>>> def bing():
...     try:
...         raw_input()
...     except (EOFError, KeyboardInterrupt) as err:
...         print('This is what actually happened here!')
...
>>> try:
...     bing()
...     print('Yoo hoo...')
... except KeyboardInterrupt:
...     print('Nothing happens here too!')
...
KeyboardInterrupt
 
10:11 PM
Ah well, rhubarb time for me. Hasta la cabbage. Millenium hand and shrimp
 
See you
 
Python3 behaves inconsistently for me too, sometimes catching the interrupt in main and sometimes not.
 
ok, after naming raw_input to input:
>>> def bing():
...     try:
...         raw_input()
...     except (EOFError, KeyboardInterrupt) as err:
...         print('This is what actually happened here!')
...
>>> try:
...     bing()
...     print('Yoo hoo...')
... except KeyboardInterrupt:
...     print('Nothing happens here too!')
...
This is what actually happened here!
Yoo hoo...
 
But what is consistent over all of it is that the exception caught within bing is an EOFError and not a KeyboardInterrupt.
You can verify that with this:
print('This is what actually happened here!', type(err))
 
yeah...
I'm going to keep looking for problems with windows shell...
 
10:17 PM
Anyway, bedtime. Rhubarb!
 
(My internet keeps disconnecting often...)
@poke No please... Don't go!!! Whaaaa....
 
I’m pretty much out of ideas anyway :P
 
cmd module?
 
One last idea would be this:
 
Rhubarb poke. A thought- Joran seems to get expected behaviour throughout - main difference pyhton 2.6? ...
 
10:19 PM
def bing():
    try:
        input()
    except EOFError:
        raise KeyboardInterrupt()

try:
    bing()
except KeyboardInterrupt:
    print('Nothing happens here too!')
That way, at least you get a consistent KeyboardInterrupt back from bing.
 
Or is windows version old too?
 
yikes
I hate that idea... maybe raise from?
lose the stack trace...
 
A stack trace for keyboard interrupt?
 
shrugs
 
I’d argue that the less output a keyboard interrupt generates, the better it is, because usually, it should be a way to terminate your program gracefully.
 
10:25 PM
What does it mean when Community approves an edit?
 
edits are reviewed
 
If yours passes, it's approved.
 
Anyway, I’m finally out, rhubarb!
 
bye poke
 
10:27 PM
Is see, thanks.
 
@poke Alright, good night! I'll be happy to hear if someone comes up with an idea :)
 
I thought it might have been because the edit was modified by a reviewer, and I guess now I know. :v
 
@poke I actually have only two. First one, writes the output to a file and second one, quits.
 
guess I misunderstood
 
hah
Looks like I was wrong about the title thing. :v
I figured pygame would make sense, since python is the more popular tag.
Oh well! v( o_o )v
 
10:29 PM
I don't know why reading these on the job injury reports is making me chuckle
 
@AaronHall No worries! :D
 
@Augusta are you digging into the review queue now?
 
I've decided to wait before I open that can of worms. I actually should try and get some work done today as well. =_=;
 
@Dracunos links
 
Anyways, thanks all. If anyone ever comes up with something to solve that mystery in cmd, please feel free to ping me :)
C'yall later...
 
10:33 PM
rhubarb
 
I shall ask it (??)
Wait, this problem hasn't come up in SO, right?
 
yeah, ask away.
Before you post the ask, spend some more time researching it, then if you have the answer, post that with the question, and get credit for both.
 
@AaronHall Yeah, probably. But, I've been smacking my head for about 2 hours now. I came here only because I realized that I've failed.
 
So, I'm learning that applying layer after layer of weird hacks and makeshift corrections to a module continuously as the night goes on is a mistake for reason that my comments become less and less coherent as dawn approaches.
Who knew!?
 
That sounds about right
write the unittests first
then make them pass.
 
10:48 PM
I don't think there's Salad for "What was I thinking??" and I would like to now humbly suggest "Cilantro."
 
Then you'll only have the edgecases you missed when alertly writing the unittests
I created a room so I can get away from salad.
 
I have never heard the term unittest before; would it be appropriate to assume that the idea is to write the smallest section of code needed to try a particular block, leaving out the working bits elsewhere?
 
@Augusta the word you're looking for is "artichoke?!"
 
Or is it another thing I should do better by looking up?
See, I was thinking "artichoke," but I was thinking of something more self-ashamed.
 
you define how big the unit of code is
 
10:50 PM
I see.
 
maybe it's like an acceptance test for a class
maybe each method gets a unittest. Up to you
 
Makes sense.
 
i'm trying to convert a command line program to a gui program in pyside and i'm having some issues with my functions, in the command line program i have a lot of functions and i know exactly how to call each of them after the previous one is executed
will it be good practice to merge all my small functions into one super function and call it at once?
 
no
 
I've kind of picked this up on my own and I have no idea what good data structure is supposed to look like, so I've guessed my way through it based on whim, presumption, and other peoples' examples, not in that order. My code is very probably a joke.
But it runs! Mission: &INVALID_MISSION_STATUS !!
 
10:54 PM
@davidism do you have any experience in pyside/pyqt?
 
def demo():
  for _ in range(10):
    try:
      try:
        input()
      except BaseException as inner:
        print('inner:', inner)
    except BaseException as outer:
      print('outer:', outer)
 
Haha, no links, it's an internal email.
 
I need to get the ceiling value for a float. But it doesn't feel right to import math just for a single operation. Should I use something like val = int(val) + bool(val%1)? Is this question as stupid and petty as I feel it is?
(Also that code doesn't work with negatives but whatever. =_= )
 
I can't replicate poke's experience at all with that
I want to say it's a powershell issue, but he said it happened in cmd.exe...
 
I guess val = int(val) + cmp(val,0) works better.
 
11:02 PM
I do get EOFErrors in 2.6.8...
 
better-ish.
 
don't use cmp
it's deprecated
 
Aww, zero changed his avatar back :(
 
Damnitall. >_<
Ha ha
 
The rainbow one was much better
I know, right?
 
11:04 PM
@Augusta There was nothing wrong with your title. I've reinstated it :-)
 
maybe relevant to the Ctrl-C gang stackoverflow.com/questions/4606942/…
 
@ZeroPiraeus Oh, cool. :v Thanks!
 
@ZeroPiraeus beat me to it
 
Are you sure? We're both talking about this `cmp`, right?
https://docs.python.org/2/library/functions.html?highlight=cmp#cmp
I'm just wondering what to use instead.
 
>, <, >=, <=, ==, and !=
 
11:06 PM
Doesn't that kind of take one expression and turn it into six lines of code, though?
Maybe that's okay.
Man, what a drag.
XD
 
Does that apply to 2.7, as well, though?
 
"Would I rather write code that will work in the future or not?"
 
Touche.
Also, (a > b) - (a < b) is pretty neat, too.
Okay, cool. Thanks for that!
 
going home
goodbye!!
 
11:10 PM
bye
 
Rhub-- err
See you later
 
11:22 PM
This is when the chat becomes deathly quiet
 
Well. It was.
 
They say that some nights at this hour, the spirits in the native burial ground on which this room was built become restless.
surreptitiously rattles ornaments on mantelpiece
 
Grim spectres of users departed, bound to this namespace by wrongs left unrighted, return to haunt these halls, sorrowfully decrying past injustices;
* "Why was my question closed!!!?" *
3
 
@ZeroPiraeus Going through the conversation once more, you had suggested something that I've missed. It is [Ctrl-Z] and [RETURN] that offers the EOFError
 
Poor souls-- no upvote can give them the satisfaction they long for...
 
11:30 PM
Ha, really? Glad to be of assistance :-)
 
@ZeroPiraeus That should serve as a nice workaround that can be added to my script, thanks for that.
 
So, I've coded pretty frequently for a few years now in a bunch of different languages, but have never taken an academic Computer Science class
I'm now taking one focused on Java—and learning about "garbage collectors" and pointers and all these things that were once magic
That being said: How does Python deal with its pointers? I assume that it has pointers, we, as people who write the code, just aren't required to explicitly deal with them
 
I only know python. Everything is magic :D it's like living in a programming fairyland
 
I only knew Python at first, too, and all my other experience doesn't require pointer-stuff (like PHP and things like this)
so this is like wizard training for me. :D
 
11:45 PM
re-cbg
 
cgb
 

« first day (1717 days earlier)      last day (3222 days later) »