« first day (2111 days earlier)      last day (2840 days later) » 

2:01 PM
just read this one:
> I don't to type in the notepad program because it defeats the purpose of python scripting.
talk about defeating purposes
 
"If Python is meant to be so good, why doesn't it write itself?"
6
 
srsly bro
 
@AndrasDeak Oh woah - I also didn't realize that about genexps
 
so basically he wants notepad++
or whatever that one is called
 
DSM
In my interview they asked for a decorator with arguments, but I'm pretty sure that would kill this kid.
 
2:02 PM
> We recently sent you an email asking for feedback regarding your recent experience of getting in touch with us about your move.
 
PyCharm--
 
@DSM if he they are an intern you need to step it down a notch.
 
I know you did, I deleted it, you don't need to send me another email reminding me to provide the feedback, I'll just delete this one too.
 
@Ffisegydd your move, Fizzy
 
my last intern was "explain the logic error with provided code"
 
DSM
2:03 PM
I should ask him what
 
was it a real time error?
 
DSM
myset = set(['a', 'b', 'c', 'd'])
mydict = {item: (yield ''.join([item, 's'])) for item in myset}
print(mydict)
will give..
 
"If you are allergic to Documentation, you can probably still eat Q&A." — Sumurai8 2 hours ago
 
Just stare at him awkwardly for the entire interview, if he buckles then he's not strong enough.
 
my last job interview was "write a recursive method for fib and a generator"....also gave them a functional version for kicks but that wasn't asked
 
2:05 PM
:|
 
Coding questions are pointless, other than a fizzbuzz test to filter out the complete frauds.
 
@DSM trick question, <generator object <dictcomp> at 0x7fa1e35f1dc8>
 
DSM
@AndrasDeak: oops, I meant print(list(mydict)).
 
2:05 PM
Not a trick question at all. I'd hire you on the spot for that answer.
 
@Ffisegydd Does any speaking count as buckling?
 
:D
@Ffisegydd and if I miss the memory address?
 
Ah well no then.
Gotta get that part right.
 
I'm happy to say that I got the result right (mod order:P)
 
@JRichardSnape Any sound, fidgeting, whatever. They should just stare back at you dead in the eye.
 
2:06 PM
do people actually get jobs with python, then?:P
 
@Kevin it was a little better because it was whiteboard and I didn't have time to Google but yeah, I actually liked the idea of the "find logic problems" as a better test
 
@Ffisegydd Good, good. That was my assumption.
 
@AndrasDeak I have yet to
 
Every job posting for Python requires experience in some third party library I've never touched. I should touch more third party libraries.
 
My interview was 5 different branches of a code base each having a more difficult bug than the other. Had to make the code work
 
2:08 PM
mostly from C#/ASP.Net and math (i.e. teaching)
 
I think it's probably best if you keep the touching to a minimum.
 
Had to start from the unit tests and figure out what's wrong
 
The two that I've done were - build a multi-path story app (i.e. you can enter text in one of four boxes and it creates a link to a new page where that text is centre of the story, and so on), and the other was create an API to hit a weather API, manipulate the data, and regraph it. /notevencompetentatthose
 
There's a gradient of realism for interview questions. On one end is Fizzbuzz, on the other end is "Over the weekend, fix this actual bug we have in our actual code base. No we won't be paying you, why do you ask?"
 
oh, that is evil:
value = 42 #ascii e
valuŠµ = 23 #cyrillic e
print(value)
 
2:10 PM
@DSM yes, decorator wit arguments is a tricky case. Usually the arguments have to be retained (via a closure or whatever) as the returned decorated value can only take a single argument, the function being decorated.
 
@idjaw that's a really good way to find free debugging power
let all the applicants debug for free
 
@Kevin yeah, I'm pretty sure I've debugged a few Oracle databases in the area during the interviews
 
@AndrasDeak I was once applying for a researcher role (or was about to, I pulled out) - and part of the application process for initial sift was to provide 5 x 250 word research proposals around X topic areas. Free labour. \o/
 
I really need to start charging people for stuff
 
DSM
2:13 PM
I've only got 90 minutes with the kid, so I have to keep the number down (number of questions, that is). Plus I have a twenty-minute pandas question, where I give him a data file requiring a bit of processing and by the end I want a plot.
 
@Withnail lol:D
some people, and some HR departments, have no shame *gasp*
 
Actually, I'm pretty comfortable naming them - it was ResPublica, the UK Think Tank. Pretty sure they got a bunch of decent ideas out of that recruitment, even before they'd interviewed anyone. Super bad form.
 
@Withnail I've had a few places try and get me to complete a literary review to even be considered for a position, so I believe that....and it is really annoying when the positions are so few and far between around here
 
@Withnail Well, of course a think tank. Just shows you how good they think. "Hey, how can we get free labor?"
 
lol.
 
2:16 PM
rhubarb for now
 
see you
 
Businesses have regard for humans the same way humans have regard for skin cells. With this in mind it is easier to understand how they can pull such flagrant BS with a straight face.
 
plagiarism isn't just vlq
 
> This answer has severe formatting or content problems.
 
2:20 PM
Tbh, I now take the view that if somewhere has BS recruitment practices, it's almost always an indicator of BS practices generally. So not a place I want to work.
 
plagiarism seems like a severe content problem
 
I usually flag such answers for mod attention
 
That works too.
 
Ads with 'We're seeking financially motivated sporty whatevers' - bin. 'You'll have at least a 2:1 from at least a red-brick uni' - bin. 'You'll have X+ years in this thing' - red flag.
reflects ...this may be why I don't have a job. :)
 
@Withnail So far I've never worked anywhere that has rubbish recruitment practices, mostly because they raise a bunch of red flags.
 
2:24 PM
Yeah. I applied for a job somewhere once, and was chatting to a guy that worked there - he said "If you don't enjoy this process, you won't enjoy working here, bear that in mind." Sadly, I loved the process and fluffed a segment of my final interview, and never followed up the invite to re-apply. But I stand by that - if you hate the recruitment process for a place, it's probably a bad sign.
 
Let's say that you have two tags, the formal name rsa-archer-grc and the vernacular archer. Which should be the primary and which should be the synonym?
 
I'm inclined to make the vernacular the synonym.
 
Or does it even matter? I guess synonymity is commutative.
 
depends on the number of questions these tags hold
the system may not let you synonymize them
 
Of course archer is a question of phrasing
 
2:28 PM
I get that reference.
 
I didn't but Google's got my back.
 
god damn, they translated v for vendetta speech, revolution is starting in here
 
x = 23
class Fred:
    x = 42
    y = (x for i in range(10))
print(list(Fred.y)[0])
#expected result: 42
#actual result: 23
That one is actually unsurprising...
because x = 42 isn't a naked x, it's actually Fred.x
though I can understand how that would be surprising if you didn't understand binding
 
Class scope is super weird.
y = x is valid
lambda and comprehension "scopes" are weird too
 
@davidism And the change of scope rules for list comps means that this will do different things on Py 2 vs Py 3:
x = 23
class Fred:
    x = 42
    y = [x for i in range(1)]
print(Fred.y)
 
2:37 PM
So if Javascript has 'hoisting', then Python classes have unhoisting?
 
In [1]: x = 23
In [2]: class Fred:
   ...:     x = 42
   ...:     y = (x for i in range(10))
In [3]: def scope():
   ...:     x = 16
   ...:     print(list(Fred.y)[0])
In [4]: scope()
23
 
So in Wayne's example, it's used x=23 in the list comprehension, because it's actually Fred.x that has the 42 bound to it, right?
 
For some reason, certain words I always write backwards
 
@Withnail I'm not exactly sure, because like I said y = x is valid, print(Fred.y) would output 42.
 
It's got to be to do with when the generator object is actually created and what scope that is in.
 
2:40 PM
Yeah, I have a feeling lambda would act similarly.
 
I think so too.
 
@davidism Added my own little piece of snark to your comment
 
At least it didn't have "upvote 2 downvote favorite" or whatever the really lazy copypasta is.
In [1]: x = 23
In [2]: class Fred:
   ...:     x = 42
   ...:     y = lambda: x
In [3]: Fred.y()
Out[3]: 23
 
Jim
an ugly lambda y = (lambda x=x: [x for i in range(1)])() does the trick and prints 42 but damn that's ugly.
 
2:43 PM
Dammit Jim!
(sorry I had to)
 
Well, that's @DSM's intern question sorted, then ;)
 
x = 2

class Fred:
    x = 4
    y = (x for i in range(10))
    z = [x for i in range(10)]
    o = x

print Fred.x # 4
print next(Fred.y) # 2
print Fred.z[0] # 4 in Python2, 2 in Python3
print Fred.o # 4
 
They made the scope consistent in the wrong direction.
Paging @MartijnPieters, we have an emergency in the department.
 
@davidism has it tried to eat an alligator again? sheesh... stupid snake...
 
Whut?
(Dev salary)
 
Jim
2:48 PM
In Py3 comps and genexps don't get to see the class namespace, in Py2 comps do and genexps again don't. Here's a breakdown on these from a PyDev thread.
 
If they launched that in response to complains about Documentation, at least they're literally putting their money where their mouth is
 
@RobertGrant What is that exactly?
 
I wish Py 3 had given us a keyword arg for comprehensions & gen exps that let us choose whether we wanted to create a new scope or not. But I guess that's a little messy if we also want to maintain Py 2 compatibility, i.e., having gen exps by default create a new scope & comprehensions run in the existing scope.
 
The Stack Overflow Salary Calculator - I picked a Developer salary with skill level of 0 and 0 years of experience. $86k. $94k if in London, NY or San Fransisco.
 
I don't think Stack Overflow can correctly asses 0 skill programmers based on their survey audience.
 
2:51 PM
It's the salaries of SO devs
 
Or 0 experience too honestly. That's a very high rate coming out of college.
 
The scale they use for skills is B, A, A+, A+++.
Yup.
 
wtf is that skill level measurement?
 
For those who can't handle the numbers 1 to 4
 
seriously? (most of us are a 1 - 2).....Oh ok...that helps narrow it down mate
 
2:52 PM
@Jim nice find. Makes sense too: since comprehensions are basically functions, the scope behaves like methods.
 
@Jim nice
 
Apparently I should be making over double what I'm making now.
 
25 years and a 5 gets you a decent amount of cash :)
 
@idjaw They have a handy rating chart
 
@MorganThrapp it's for SO dev salaries
 
2:53 PM
@MorganThrapp Apply to SO.
 
As in SO employees
 
I guess I need to work for SO.
 
@WayneWerner Ah yes, the obvious "more info" link
that I never click on
that I should click on...
:D
 
That is literally the dumbest ranking system I've seen. (A+++, A+, A, B). Wtf.
 
Mmm, I'm an F in likert scale design
 
2:55 PM
It's not even internally consistent.
 
I like their skill assessment categories a lot.
 
@Withnail It's for people who don't feel confident enough to ask a question on SO.
 
"How would you rate this app on a scale of "Alligator to Unicorn, with Egg being the midpoint"" #qualresearchfury
 
Anyway - I obviously can't work for SO - the Skill scale doesn't go up to 11.
 
^^ BOOM!!!
 
2:56 PM
It might go up to Muffin though.
 
Oh, how disappointing. The room hasn't been deleted for being a hive of rebellion
8
 
I don't need a skill chart. I just change my head and become anyone I want to be. Today I'm a gas station clerk. Tomorrow? Medieval knight.
 
@idjaw don't do that - we like our Cap'n just the way he is!
 
Think of it this way... everyone knows roughly what a 'B' performance is from school. If you're not performing at that level, then you should feel inadequate and start learning. That's why the scale bottoms out at B.
 
@JonClements Captain Canuck it is. For the people.
 
2:58 PM
Cap'n my Cap'n!
 
Didn't realise idjaw was a lego figure. :D
 
@IntrepidBrit yet
 
@Withnail he's "Le Gogh" :)
 
that's my cousin. We don't talk about him here
 
3:01 PM
:D
 
@Ffisegydd How long should I hold my breath for? Going slightly blue now
 
Also, impressive that they actually guessed the name of the function but decided to ask a question on SO rather than Google the answer first
 
@IntrepidBrit that's one way of becoming a mod I guess...
 
:keels over:
 
3:07 PM
@IntrepidBrit Jon and Martijn were dispatched to negotiate a trade agreement and that all escalated into a war for a planet, but they're back now
 
What do Jedi ninjas even know about trade?
This is why the Old Republic SO is going to crumble. People are making blatantly terrible decisions
 
@IntrepidBrit Blue's a good Scottish colour.
 
@IntrepidBrit give us what we want or we'll disembowel you where you stand? That's trade, right?
 
And mostly what we want is the right to sell opium to your countrymen.
 
3:10 PM
@JonClements All of a sudden I don't want free trade with Europe
 
@treyhunner Here's a #pythonoddity about class, comprehension, and lambda scope: https://gist.github.com/davidism/645100dc43633c02d60f156ef4d0d451
wrote up that nifty scope discussion
 
Hey that would go really well on SOD
 
Umm... so apparently... $166,870 is what gets calculated...
 
Seems fair. I can offer you a Freddo and a lolly per day. Get you some great exposure though.
 
@KevinMGranger good idea, I'll add something
 
3:27 PM
83
A: Accessing class variables from a list comprehension in the class definition

Martijn PietersClass scope and list, set or dictionary comprehensions, as well as generator expressions do not mix. The why; or, the official word on this In Python 3, list comprehensions were given a proper scope (local namespace) of their own, to prevent their local variables bleeding over into the surround...

you are welcome. ;-)
 
@MartijnPieters great, now my little example in the documentation feels inadequate.
 
Oof, that is a hefty explanation.
always like to see Martijn bringing out dis.dis()
 
bye all
 
see you!
 
rhubarb("Andy K")
 
3:42 PM
@MartijnPieters I pulled some references and cited your answer, that was really interesting.
 
@davidism Hmm - approved it and then just realised I think there's a typo "expect b, c and e to print global" should be ...print class`", I think?
 
Is there a name for this antipattern?
for i in range(3):
    if i == 0:
        thing()
    elif i == 1:
        other_thing()
    elif i == 2:
        last_thing()
I'm trying to make copying the returned value of a function see the light
 
I guess I should have tried out the editing myself, TBH. Anyhow, ho hum.
 
@JRichardSnape missing out on that sweet rep. :-P
 
3:50 PM
@Kevin a case of misunderstanding ?
Oh, I crack myself up. No-one else though. I'm going home.
 
@Kevin I'm sure I've seen that patten referenced before.
 
Maybe OP read about Duff's device and got really confused
TBF OP's code is more like
for i in range(3):
    if i == 0:
        thing()
    elif i == 1:
        other_thing()
    elif i == 2:
        last_thing()
    f()
Which is slightly less trivial to unroll.
thing()
f()
other_thing()
f()
last_thing()
f()
 
for fun in [thing, other_thing, last_thing]:
	fun()
	f()
But that probably doesn't work for the real case
 
cabbage
 
Jim
does anybody know if there's a way to disable Pythons peephole optimizer without altering the source?
 
3:59 PM
Or it's what you were trying to avoid in the first place
writes a decorator that calls f after the decorated function is called
 
Yeah OP's code is unfortunately not so homogeneous in its cases so iterating through a list of something isn't easy
 
I really wish day one of all programming classes was just "If your variable ends in a number, you're probably doing it wrong" repeated for 2 hours.
 
Or to put it another way:
hour1 = variable_number_end_lesson
hour2 = variable_number_end_lesson
for h in [hour1, hour2]:
    h()
 
user3838356
Why is it so bad to have a variable name end in number?
 
Because it probably means you should be using a list.
If you have row1, row2, row3, row4, etc, just make it a list.
Of course, then we'll just end up with rowa, rowb, rowc but I can dream.
 
4:05 PM
Hah yeah I was about to suggest that
 
@Ezze Note that he said "probably". It can be handy to use numbered variables if there's only a few of them when you're just playing around and figuring out how are you're going to organize stuff.
 
row, rowrow, rowrowrow, rowrowrowyour, rowrowrowyourboat
5
 
Variable names shouldn't have numbers for the same reason your children's names shouldn't.
 
It's like eval or exec. If you need numbers, you know why you need them.
 
Oh, that beautiful moment when you realise you've already written a script for something you need to do. CMD+F - 'joinfiles' - 1 result, joinfiles.py \o/
 
4:09 PM
hello gyus, can someone help me?
i'll practice with django by tutor, create a simple blog.
 
@Kevin I hope that doesn't apply to cats... one of ours was called "Seven"
 
Star Trek references are acceptable.
 
Not Se7en? Missed opportunity.
 
@ArtyomChebotaryov please read sopython.com/chatroom
 
Dogs have pet Cats? What a time to live on earth!!
 
4:10 PM
@Jonc I assume.
 
@Kevin my Mexican-Asian friend Juan Tu will be sad to hear that
 
@Kevin [cough]
 
Awkward.
 
Fine. Errata: variable names shouldn't have digits for the same reason your children's names shouldn't.
 
One Piraeus is your brother?
 
4:10 PM
@Withnail Conversely, there's the rather annoying feeling when you write a bunch of code to do some task, then you go to save it only to discover you've already written a script with that exact same name that does the exact same thing.
 
Can anyone guess what Zero's granny is called?
 
minus three?
 
+1 (to Bhargav)
 
@Ffisegydd Nan
 
YES!
 
4:12 PM
That's epic ^
 
I knew I wouldn't be let down.
 
hello gyus, can someone help me?
i'll practice with django by tutor, create a simple blog.
My post on main page have a too much chars, how can i cut them to 300 symbols, eg?
i think that may realize in models by adding a new textfield like a short_text, but where in code i need to set this textfield? same in models?
@davidism sorry, what i doing wrong??
 
Hahaha :-) Kudos ... "Nan" is the first actually new "Zero's relative is called X" number based joke I've heard in decades :-)
 
Asking if you can ask a question.
 
@PM2Ring :D I once asked the classic "What do you call a black guy flying a plane" to a table full of white South Africans, got the classic answers of "A thief", "A planejacker", or whatever, they're trying to guess what you call someone who steals a plane. "A pilot" I say.
AND YOU ALL FEEL CRAP ABOUT YOURSELVES, I smugly think.
 
wim
4:14 PM
"A pilot, you racist!" is the one I've heard
 
Well yeah, I probably said that :)
 
@ZeroPiraeus :bows:
 
@ArtyomChebotaryov From your description you want to filter in the template
Have a look at truncatechars and truncatewords in the docs. You can certainly filter it in the view, but it's probably more hassle than it's worth.
 
@Withnail Thanks!
 
@RobertGrant :) That's kinda the inverse of Q:"What do you call a <low status ethnic group> guy in a suit?" A: "The defendant."
 
4:20 PM
Full disclosure: I thought you were just saying "idiots, they don't call her a number at all!" because I am slow. Hence that anecdote :)
 
DSM
So I didn't get to any of my fun questions, some of which were very clever. :-( Candidate is smart enough but woefully inexperienced, so I don't think I can even recommend him as an intern. :-/
 
That's a shame, on both counts.
 
Do interns require experience?
(I suppose it depends on the nature of the internships)
 
Yeah
 
That pilot joke reminds me of a comic I saw online where a girl says to her friends, "what's long and shoots white stuff out the end?" and one girl starts to say "a pe--" and all the other girls answer "an icing bag!". The final panel indicates that nobody noticed her near-gaffe but she turns red anyway.
 
DSM
4:24 PM
If it were a longer internship, it'd be okay, because he can clearly learn. But if you're not yet at the you-know-dictionaries stage, there's too much to catch up on before he could be helpful to the team which would be hiring him.
 
Same principle of finding humor in denying the most obvious choice
 
I love it when we explain jokes
 
so good
 
Jokes are like cats. You can take them apart to find out how they work, but then they stop working.
 
Oh man. That's given the biggest belly laugh in ages.
Totally stealing that.
 
4:26 PM
Might as well, I already stole it from somewhere else.
 
DSM
A vile den of comedic thievery in here.
 
user3838356
Waaaait... so you should not take cats apart?
 
That depends on whether having a still-working cat is valuable to you.
 
I'm reminded of Stewart Lee, a fair chunk of whose act consists in minutely dissecting his own jokes.
 
4:31 PM
And depending on whether you've sedated the cat, whether having still-working eyes is important to you.
 
user3838356
A fully-functional cat has more chance to hurt your eyesight than an about-to-get-taken-apart one, if we take into account their whole lifespan
 
user3838356
Cats are scary.
 
We domesticated wolves. We got this.
Might take another hundred thousand years though
 
user3838356
I sure didn't
 
with blanket(cat).dissect()
 
4:36 PM
This example also needs to be updated to remove the variable str that shadows the builtin. I overlooked that part yesterday. Anybody free enough to edit that and add Py3's new maketrans?
 
@BhargavRao done. Needs approval
 
Nooo, You forgot to add a line that maketrans in Py3 is under stdtypes. So you need str.maketrans and not string.maketrans :P
Edit it in asap
 
oooh
bleeeh sorry
 
-3
Q: What does TypeError: input expected at most 1 arguments, got 3 mean

aidan68945TypeError: input expected at most 1 arguments, got 3 I honestly can't figure out what this means, it is just making me feel very stupid

 
4:46 PM
I don't want to be mean, but really? If you can't figure out what that means, maybe this is not the career choice for you.
@corvid Yeah, I discovered I could make over double what I make now if I work for SO.
 
Mine says 100k, I find that bretty hard to believe
 
Yeah, mine has me at $98,400.
Which, I mean, I'll take it but it seems crazy high.
 
@MorganThrapp meh, args/kwargs counting is weird
It's a dupe, but it's not the worst problem to be confused by.
 
Maybe it has to do with their office being in New York or San Francisco. San Francisco is absurdly expensive, it doesn't even make sense
 
@corvid Maybe.
 
4:50 PM
@BhargavRao Take a look let me know
 
Looks fine to me.
I am not sure whether we should add the bytes details as it is under strings.
 
(To be clear: I'm not posting to get an answer, just to show you how much FML I feel :))
 
Gents...Anybody care to give advices to get a remote job...:)
I'm learning Python and web dev.
 
Remote jobs are advertised on Stack Overflow jobs
 
No...
 
4:54 PM
You'll go far.
 
I mean...advices...
 
@Rober
 
I'd probably apply for one and if you don't get it, ask what was the problem and fix that, and apply for another one.
 
4:56 PM
:D
@RobertGrant .. ok...but with my current level I feel not even 1 millions miles close
 
so what do you think you need to do to change that?
pretend this is a job interview for one of those remote jobs and you are being asked that question. How would you answer that?
 
Work Hard...:)
 
I'd probably apply for more junior positions, but then remote is probably harder as you'll need supervision and guidance
If you want to get better, that is
 
I see
 
I could be wrong, but I would be hard pressed to believe a company would hire a junior for a remote position
 
4:58 PM
@idjaw .. Trust me...I'm trying to learn as much as I can...problem is I'm working for as a Field Engineer...so it's easting my time...
 
You lose nothing but a bit of time by applying, but I'd probably at least have looked at jobs and be moderately confident that you could do what their specs say you need to be able to do
Rbrb
 
rbrb
 

« first day (2111 days earlier)      last day (2840 days later) »