« first day (1467 days earlier)      last day (3464 days later) » 

5:00 PM
@MartijnPieters From where did you learn python ?
 
@d-coder Long time ago; 1999 I think.
I did look at the language briefly before that.
I think I just took the tutorial at the time.
 
I mean to ask books in particular
 
Yeah, February 1999; saw an article about the Zope platform in a magazine, which seemed to fit the needs of the web dev company I was with at the time.
Any books I used at the time are long since out of date.
This was Python 1.4 or 1.5.
 
@MartijnPieters You rep is so high!
 
DSM
Yeah, 1.5.1 and 3.4 are worlds different.
 
5:03 PM
@d-coder that's because I wrote 11000+ answers.
e.g. too much time on my hands.
 
DSM
Should we close a file_ptr.close (no missing brackets) question as a typo, or is there a canonical link for that error?
 
Seems fine as a typo close
 
@DSM I'm sure I've seen it crop up a few times - don't have a link to hand at the moment though
 
Typo's more appropriate imo
 
@MartijnPieters No wonder you have such great experience.
 
5:04 PM
There's going to be a "didn't actually call a function" that can be used
 
hi @SeanVieira, good to see you in chat!
 
@MartijnPieters Did you write any modules ?
 
thanks for all the Flask answers :)
 
@d-coder too many to count.
@SeanVieira: cabbage!
 
@MartijnPieters Great! Wish I could write one someday. Really useful one :)
 
5:09 PM
When you say "module", do you mean "code that someone somewhere has ever imported", or "something distributed alongside a fresh Python install"?
Personally, I've made hundreds of the former, and 0 of the latter.
 
@Kevin The latter one actually :)
 
@JonClements I've never seen parentheses on the left hand side of an assignment statement before.
Or, more specifically, I've never seen it done when only one assignment is taking place. (a,b) = my_tuple doesn't count.
 
DSM
aargh
I was about to give that as a counter.
 
@Kevin adds a certain unique style to it though doesn't it :)
 
5:13 PM
I really should run my messages through my "is this actually factually true for all possible interpretations" filter, before I actually submit
 
DSM
Finding those exceptions is a good debugging trait and a good trait in comedians. In other circumstances I admit it tends to make you want to punch someone in the face.
 
@JonClements It may be worthwhile to put the int call in the while loop, like credit = int(raw_input("Please input your change: ")). That way, the while credit == 0 loop will actually do something.
Namely, prevent the user from entering "0"
 
Now the email server is running... I now have the "fun" of talking a technophobe through adding a new mail account to their email client... better grab a large brandy first...
 
Actually, why is he doing raw_input twice? This is all sorts of weird.
 
@Kevin It's okay... the original code is probably worth an A* at GCSE level anyway
 
5:17 PM
Guys! I want to be an expert in python like you all here. Where to start ?
 
Write a whole bunch of programs
If your reply is "but there are no programs that I want to write", then my reply is "then why do you want to be a programmer?"
 
DSM
Start with competence. It's underrated. I'm nowhere near an expert in Java, but I can get what I need done in it, and that's a useful skill. The extra glamour (?) of being a wizard isn't particularly useful to me.
 
I can think of logic but I have problem in writing in pythonic way .
 
That's fine. Better to have working ugly code than broken beautiful code.
 
like using writing whole function instead of generator expressions or lambda functions.
When I see answers posted by others here it kinda puts my answer at shame!
 
DSM
5:23 PM
Even though we talk like they are, "lambda functions" aren't really a thing. lambda is a keyword which lets you write simple functions in a certain way. That's it.
 
Yeah anonymous functions.
I was giving examples.
 
DSM
No, I mean, they're not anything special. They're not a new kind of function you need to learn. They're perfectly ordinary.
 
From where do you all read/ learn python from ? I fond the documentation boring
*find
 
From the documentation.
 
Why is python changing ? Instead of adding extra modules they change from a scratch.
any reason ?
 
5:27 PM
And from people on SO saying, "actually, this way is better / faster / shorter / more correct". If other people are putting your answers to shame, then you're already learning.
 
@Kevin Very true! You people inspire me :)
To become more efficient.
 
@d-coder But they are adding extra modules. We were all very excited when asyncio was introduced.
 
@davidism - glad I can help keep things going there :-)
 
They only change the language itself when there's no real alternative. Nothing you write in a module could ever replicate what the new nonlocal keyword does.
 
DSM
Why, some of us twisted ourselves into knots of joy. #nopunintended
 
5:31 PM
Not nothing @Kevin (though it would be a function, not a keyword) ... but the introspection code would be pretty fragile, and very slow in comparision
Actually, I'm probably wrong - frames are immutable, aren't they? (Runs to check docs)
 
I didn't know that module was there till you mentioned it.
Switch case please!
Tell me it's included in recent release
 
Nope, there's no switch keyword on the horizon
 
DSM
Get used to disappointment.
 
Why ?
 
The devs seem quite content to go without it. "An if ... elif ... elif ... sequence is a substitute for the switch or case statements found in other languages."
 
5:34 PM
But it's time consuming right ?
checking for each condition ?
 
DSM
It's a trickier issue than you may think. You can read PEP 3103 for some of what's involved.
 
I doubt that it's much slower than a switch would be.
If you're writing code that's super time critical, you probably shouldn't be writing it in Python. Switch to Fortran for a free 100x speed boost. </lame-excuse>
 
math classes are so lame
 
No, you're lame for not liking them.
That's not true, I'm sorry. I have no idea whether you're lame or not.
 
@Kevin Plot twist! There is no math classes.
 
5:40 PM
@DSM Thanks! It is trickier actually
 
In certain situations, you can turn a switch block into Python code that uses no conditionals at all. For example:
switch(x){
    case 1: y =  4; break;
    case 2: y =  8; break;
    case 3: y = 15; break;
    case 4: y = 16; break;
    case 5: y = 23; break;
    case 6: y = 42; break;
}

becomes

y = {1:4, 2:8, 3:15, 4:16, 5:23, 6:42}[x]
 
Yeah! I agree.
SO uses python ?
 
No, afaict
I remember seeing their post about technologies they use
 
Of course, all of the reasons why it's a terrible idea to add switch to python will no doubt evaporate when Guido does decide to include it.
 
They didn't use Python in 2011. I doubt they use it now.
 
5:49 PM
Yeah, they're mostly .NET / C# on SO - and they're doing pretty crazy things with C# to get the performance they want, from what I've heard in passing
 
The PEP's position seems to be "it's not impossible to do switch well, but I haven't seen a good approach yet" and "it doesn't have popular support, so let's not bother".
If both of those change over time, I think we can embrace switch at that point, without any hypocrisy.
 
I for one welcome the switch to our new Overlords (see what I did there?)
 
@vaultah I'll leave a note to him in case the question can be saved before closure.
 
@Kevin I think that's a fair summary of the PEP, yeah (have read it through more than once on thinking I'd come up with a good syntax) ... I've seen a bit of a cultish "if we don't have it, it must be a bad idea" attitude from quite a number of pythonistas (including core devs), though.
 
5:54 PM
What he's tried: the three lines he showed us already. His current output: None, the program isn't fully written yet. Expected output: numToBaseB(7, 2) -> 111
@ZeroPiraeus mm hmm, I agree that that kind of thinking is problematic
 
... but then I'm biased - I think dictionary dispatch is a goddamn ugly hack.
 
@Kevin Beats me.
 
And I think that dispatch would be the better approach under the hood. We must now duel.
Well, not now.
 
Have at thee (at some unspecified future moment)!
 
Pistols at dawn? No, I'll be sleeping. Pistols at noon! No, I'll be sluggish from lunch.
3
Pistols when you least expect it.
 
5:57 PM
Hey hey hey - sample output:
Sorry Output should be >>> numToBaseB(4, 2) '100' >>> numToBaseB(4, 3) '11' — Peter Krasinski 1 min ago
 
"here's what I have so far": nothing
 
I would have accepted his small incomplete code sample, if it actually worked :-I but numToBaseB(0, 3) should return "0", not ""
 
@inspectorG4dget What is happening thala?
 
DSM
Apropos of nothing, one thing I find hard to deal with is people who cannot admit they're wrong about something. I make ten mistakes before breakfast, and if my code isn't buggy it's because I wasn't paying enough attention. So the idea of being unwilling to admit "oops, I typed Y where I meant Z" but instead needing to construct a storyline about how actually it wasn't a mistake when it really was is entirely foreign to me.
 
I like this‌​, because with careful choice of units, it is always true.
 
6:01 PM
@thefourtheye: There was a gunman near Parliament in Ottawa. All public buildings are in lockdown. This includes my university campus
I'm in my lab on campus
 
@inspectorG4dget yeah... I've been keeping an eye on the news
 
@inspectorG4dget Take care thala... Hope you are comfortable there
 
Stay safe :-)
 
DSM
This has been a difficult week.
 
thanks @Kevin. The lab is accessible with only a key card. So I'm safe for the time being
 
6:04 PM
Ready some HCl or something to throw at any intruders
 
@ZeroPiraeus Reminds me of this one:
> Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
 
@JonClements Puppy, how do you know that he is in Chem lab?
 
DSM
@inspectorG4dget: do you know how wide the shutdown region is?
 
@thefourtheye I don't... but it'd be more useful to be in a chem lab than a computer lab right now :)
 
DSM
@Zero: my supervisor used to say things take pi times longer than you expect. Seems about right, and feels sciency.
 
6:06 PM
@JonClements Lets hope that @inspectorG4dget doesn't have to weaponize today :-)
 
Coincidentally, I took some mandatory corporate training regarding "active shooter emergencies" just yesterday >_>
 
@DSM: all of downtown, AFAIK. All public buildings are locked down. The lab is inaccessible without a key card, and there's a row of computers from the door to my desk (a lot of metal through which a bullet would have to travel)
@Kevin: Nice!
 
I remember "don't panic", "form a plan" and "when the SWAT team shows up, do not hug them"
3
 
This may not be the appropriate time to say this, but "Happy Diwali" @inspectorG4dget
 
@inspectorG4dget If the televised version of HHGttG taught me anything, it's that a bank of computers provides an effective if temporary shield from gun-wielding crazies ...
 
6:10 PM
yup
 
@Zero and if that doesn't assure @inspectorG4dget - what will? :)
 
DSM
@inspectorG4dget: :-( I've refrained from emailing my Ottawa/Hull crew. Only a few work near the Hill.
 
@JonClements I thought so ;-)
 
Also, I believe that a bad guy can't even hit a good guy at point blank range with a machine gun - so that's also good
 
Stormtroopers taught me that.
 
6:11 PM
Ooo... about to be press conference
@inspectorG4dget besides, can't you just do "Go go gadget <insert suitable device here>" ?
 
@Ffisegydd Cbg(name_i_cant_pronounce)!
How's life?
 
@Iplodman Cbg(name_I_can_pronounce_but_choose_not_to_to_spite_you)
 
;)
 
Not sure if "I plod, man" or "Ip lod man"
 
Life is okay. Churning out thesis. Hit 100 pages today.
It's "I plod, man" in my head
 
6:14 PM
Well, badguys can't hit goodguys, unless the badguys are stormtroopers and the goodguys are redshirts - even though the stormtroopers miss every shot, the redshirt still dies
 
That's a bit like the "cat with a piece of buttered toast stuck to its back"
 
Eye-plod-man :P
 
@thefourtheye: This is how you should have said it :P
 
@Ffisegydd What's it about?
 
Physics.
 
DSM
6:15 PM
Wait, so it's not "ihh-ploh-dee-man"?
 
is it possible to retrieve all models from a flask-sqlalchemy db?
 
@inspectorG4dget No no no guns, till you are safe at home...
 
@DSM It's actually pronounced the same as @Ffisegydd's name, but that's my secret.
Oh no! My secret! :C
 
Oh... I thought it was "ip - low - de - man"
 
@DSM: so much commotion here. We're confined to classrooms, offices and labs, to the point where we can't even go to the bathroom without an escort (in some cases)
 
6:16 PM
umm... Canadian police press conference... listens intently
 
@Ffisegydd Woo! Physics!
 
DSM
@iG4: remind me -- U of O, right?
 
@inspectorG4dget Supposition: as a result of karma, bad guy bullets are sentient, and seek to avoid striking any living being, but red shirts provide perfect camouflage, and therefore appear to the bullets to be empty space.
 
In particular my thesis is about what happens when you put an elephant on a piece of glass.
 
@DSM: indeed.
@ZeroPiraeus: that makes sense
 
6:18 PM
The redshirt thing is an outdated stereotype. With modern 25th century medical advances, a red shirted person can live a long and meaningful life.
 
Oh right... doing bits in English/then French...
 
@Ffisegydd I hope you're not kidding me, because if you are you're a horrible human being.
 
import time; x=2
is valid

import time; for i in range(3): print('a')
is not valid. why?
 
Would I kid you?
 
Radio presenter here has just gone: "Obviously, Canada's a bilingual country so he's doing a French translation. We'll come back to him when he starts talking English again..." :p
 
6:19 PM
I did the only thing I could - I set up a facebook page, accumulating names of friends, and their known statuses (safe, not in Ottawa, etc). Please contribute if you know anything useful
 
@Ffisegydd I hope not, and as an extension-- please, please, please send that to me when it exists as a final form.
 
@JonClements: watching the CTV live stream?
 
@inspectorG4dget just an audio stream
 
@ChillarAnand Interesting.
 
6:20 PM
@Iplodman I'm studying what happens to the atomic structure of glasses under pressure. We don't use elephants though.
 
@Ffisegydd God dammit, you lied to me!
 
@Ffisegydd elephants would make the thesis fairly interesting though... :p
 
@Ffisegydd Not even as a unit?
 
Perhaps the component atoms of the pressurization machine once belonged to an elephant. Prove me wrong!
This is the same principle by which "all water went through at least one dinosaur's digestive tract" works
 
@Kevin it's all made from hardened steel, so unless the elephant literally owned the steel I think we're safe from RSPCA/American-version-of-RSPCA.
 
6:22 PM
I don't see why, if horse power can be a thing, elephant pressure can't be also.
 
@inspectorG4dget wow... all the Canadian embassys are being shut/locked down as well
 
@ChillarAnand > Also note that the semicolon binds tighter than the colon in this context
 
Incidentally my press is made from the same material that battleship cannons are made from.
 
@ZeroPiraeus Like: "when 8.7x10^-3654/elphant is applied to glass..."
 
6:23 PM
Exactly :-)
 
It's about 1ft high and weights about 50kg. Dense little git.
 
@JonClements Sorry, what's going on?
 
The American version is the "ASPCA". Guess what the first A stands for.
 
Aardvark. Prove me wrong!
 
Arithmetic?
 
6:23 PM
@JonClements: that makes sense I guess. Do you happen to know in which countries these embassies are being locked down?
 
@Kevin Aeronautical?
@inspectorG4dget all of them
they've already locked down the one in London
 
I award all of you no points.
 
@vaultah melon
 
Donkey-holes?
 
@JonClements: must be precautionary. But wow!
 
DSM
6:24 PM
@Kevin: I use that routine more often than I should.
 
@ChillarAnand Althought I'm not sure about it
 
See... whoever decided to raise the threat level from "low" to "medium" should be told to not do that in the future - look what's happened because of it :)
 
Sandler's earlier work still has its charm, regardless of his more recent stuff.
 
Wow... that's quite a title "Deputy Commander Major General" :)
 
@Ffisegydd Is there any way you know of to have two line breaks after a paragraph has ended in LateX, that doesn't make the compiler moan about badboxes?
 
6:26 PM
"Don't raise the threat level... threatening things will happen!"
 
@inspectorG4dget luckily they didn't raise it to "high" I guess
 
@Iplodman have you tried forcing with \newline{}?
 
@JonClements Just watched The Dictator. "President Prime Minister Admiral General Haffaz Aladeen"
 
@Ffisegydd Yep, still moans at me. Also tried `\\`.
 
@thefourtheye I loved that film :)
 
6:27 PM
No idea then. I usually don't need to.
You could possibly adjust the paragraph spacing in your preamble
 
@JonClements Me too Puppy... Same pinch :)
 
@Ffisegydd Interesting idea.
 
indeed. Raising to "High" would have likely been disastrous
 
I'm lowering my own personal threat level to "world peace". Hmm, nothing is happening. It must be broken.
 
@Ffisegydd I guess at least \\newline doesn't make horrible spacing errors like `\\` does.
 
Oh the irony of this statement from 7 hours ago: Canada has raised its terror threat level from low to medium but has stressed there is no specific threat.
 
@JonClements: did they just say that they don't know if there's a second suspect? He seemed to have side-stepped that question
 
Would someone mind filling me in on what this Canada kerfuffel is about?
 
Dude open up the BBC.
 
6:31 PM
@inspectorG4dget I think he has side-stepped slightly.... "they're stating it's looking less likely there was a second shooter"
 
> A huge security operation has parts of Canada's capital in lockdown after a gunman shot and killed a soldier at a war memorial, then opened fire in the parliament building.
 
@Kevin Jeez.
 
"we're not going to comment on the weapon" <- REALLY?! FFS!
 
Well, I heard an audio of gun fire earlier, and there was a prolonged burst of fire... must have been about 50 shots or so...
so it's certainly not a hand gun
 
6:35 PM
well, word on the street is that it's a rifle (second hand information - a friend heard from a witness)
 
Commenting on the weapon may embolden the enemy! Or something.
 
over time, I've heard that it's an automatic rifle (not a bolt action)
 
A random JAVA Spring question out of the blue. Can I inject a child class's object to its interface?
 
k. I'm going down to the cafeteria to get lunch. If I'm not back, I love you all. Bury my computer with me so I can sochat from the afterlife
 
@inspectorG4dget Don't forget to delete "THE FOLDER" :D
 
6:40 PM
@thefourtheye Do you mean Java? it's one of my pet peevs ;)
 
Computer experts like us shouldn't have to enlist our friends' help to delete THE FOLDER after our demise. You should just encrypt it with a password that only you know.
And configuring your browser to erase your history periodically and automatically, goes without saying.
 
@Kevin Incognito mode is our friend... ;)
 
Alternatively, don't be so uptight. When you're dead, you should have bigger concerns than whether your grandma stumbles upon your THE FOLDER.
(Skeptic alternative: or, having ceased to exist, you'll have no concerns at all)
 
@Kevin Exactly :D
 
6:45 PM
@Kevin (Skeptic alternative on the skeptic alternative: or, make concerns cease to exist)
 
not sure why - but craving for fried egg on toast - thoroughly enjoying it
 
Due to my pickyness as a child, I have never eaten a fried egg. Your craving is alien to me.
 
@Kevin Actually, come to think of it, when you're dead you shouldn't have any concerns at all! Either your heaven sorts that stuff for you, THE FOLDER was destroyed in the same incident as you were, or more to the point, you're dead. Not much concerning gets done at that point.
 
I often wonder, among all of the things I've never tried, is there something that's way way better than the stuff I consider my "favorite" these days?
Maybe I'm just wild for hummus, but I'll never find out!
@Iplodman I'm now inventing a peer-to-peer religion, where the quality of your paradise is directly proportional to your total approval rating amongst your friends and family.
That's one situation where you don't want your loved ones thinking that you're a super creepazoid, even posthumously.
 
6:57 PM
@Kevin I think that I should be weighed against my peers (If I'll ever be on your level), since none of my IRL friends are coders :C
That would be a serious detriment to how ultra-not-really-interesting I am.
Just kidding, but my life and stories are boring to anyone not into coding ;-;
 
I blame the expansion of popular culture. Back in the day, when everyone's TV only got channels 3 6 and 10, you could converse with any complete stranger on the street, and have a 33% chance that you could talk about what was on last night.
Nowadays, those odds are down to a fraction of a percent.
 
@Kevin That's an interesting idea for a thesis, I might add.
The effect of the development of modern technology during the 21st century on the ever declining odds of having viewed any particular given footy match.
 
Thanks, I stole it from an article I read last week.
 
@Ffisegydd as I'm not watching netflix/stuff at the moment, I'm preloading Civ:BE
 
I'm back, all. Alive... for the moment.
 
7:08 PM
Technology gives us a nice way of finding niche subgroups, like the one we're chatting in right now, but it doesn't prepare you for making small talk with strangers on the bus.
 
@Kevin Unless they're into subject cabbage, which you also happen to be into.
 
Turn to the sixty year old blue collar worker and ask, "so... What Python tutorial do you like best?" and you won't get a favorable response
 
I've never had an opportunity to talk to a stranger on a bus, however. This is a shame, too.
 
"emacs or vim? Gryffindor or Slytherin? Jacob or Edward?"
 
@Kevin Did you see that ludicrous display last night?
 
7:11 PM
The problem with arsenal is, they always try to walk it in!
(I've tried that before. They usually say "who's arsenal?". I guess it only works across the pond)
 
What was Wenger thinking sending Walcott on that early?
 
@Iplodman I've had strangers decide to talk to me on a bus...
 
@JonClements Hm, really?
Never for me, but I'm always with someone.
 
DSM
Back from lunch. @iG4: I didn't think he was playing.
 
Walcott went in real early. Like, before the game started. Just running around alone in a dark stadium.
 
DSM
7:36 PM
Anderlecht 0-0 Arsenal at the half.
 
Gah, LaTeX isn't letting me put one image of an old guy next to an image of another old guy in one figure.
 
Yeah, well, old guys in latex ... no-one wants to see that.
4
 
;)
 
7:53 PM
@Iplodman: try using subfloats with adequately small dimensions
 
@inspectorG4dget Too complicated for me, bud! :P
I'll just go without that source.
 
@Iplodman are you writing LaTeX code or ...?
 
@inspectorG4dget Yep.
 
Check this out
 
I was just looking at that ;)
 
8:03 PM
see the 0.3\textwidth? That's the parameter you should change
anyway, the campus lockdown just ended. I'm going home. Rbrb, everyone!
 
one year ago: "our parametrized SQL is hard to maintain, let's use an ORM". six months ago: "our ORM produces big nasty queries, let's switch to ORM #2". Today: "neither of our ORMs are any good, let's use parametrized SQL". It's the ciiiircle of life
 
DSM
@inspectorG4dget: happy to hear. Stay safe!
 
@inspectorG4dget Rhubarb! :)
 
http://stackoverflow.com/questions/26516133/learning-proper-python-s‌​tyle-and-patterns
Resource recommendation
 
8:22 PM
this guy needs the "we're all adults here" speech, I think
"I wouldn't want users to have any weird namespace collisions". Not sure what he means by that.
 
obviously not as worded, but the intent is
 
8:42 PM
So it can be unlocked from 11pm tomorrow night rubs hands
 
DSM
Substitute Lukas Podolski netted a dramatic late winner as Arsenal came from behind with two goals in the final two minutes to beat Anderlecht 2-1 and hand manager Arsene Wenger a 65th birthday to remember at the Constant Vanden Stock Stadium.
 
9:01 PM
Rhubarb all!
Have a nice night, everyone! :)
 
@Iplodman you too "ip lo deem an"
 
9:23 PM
cbg
New light arrived today.
Saw stars for a while after switching it on for the first time and not properly pointing it away from me..
 
LOL
I notice I keep getting adverts for LED lights pop up now :)
 
PR to add slugs to sopython urls: github.com/sopython/sopython-site/pull/3
any feedback?
ping @corvid @Ffisegydd @poke @MattDMo
 
Looks fine to me.... (if it works) :p
 
lol, it works
I mostly want to know if this is "good enough" or if we should be able to specify the slug manually to get urls like "/wiki/enhancement-proposals".
 
I thought that having it like /wiki/derp would be better but now I actually think about it I'm not so sure.
Just having the slug is a good thing, I say keep it as SO does it as you mentioned.
 
9:37 PM
As long as we can still cheat and just do /18 or something
the slug should just be for friendlier urls
 
Exactly.
 
yeah, the slug is optional
just like so
 
I'm happy
 
I'll wait a day to hear from the others.
 
But yeah I'm happy with it.
 
9:53 PM
@davidism hai
Cabbage.
 
cbg
 
Time to knock off, night all, cabbage!
 
@poke what do you think of the proposed url slug handling?
 
Do you want my comment here or there?
 
here or there
 
9:59 PM
@davidism awh I had that same kinda thing half done :\
 
I put my comment there anyway.
 

« first day (1467 days earlier)      last day (3464 days later) »