« first day (1558 days earlier)      last day (3373 days later) » 

1:01 PM
What part? Looks okay to me @cel
@RobertGrant I'm pleasantly surprised he remembers my name...
 
user559633
what's the most lightweight way to emulate C++ namespaces in python? e.g. namespace mail_settings { api_key = 'somethingsomething'; } for use with use namespace mail_settings to bring into the module scope?
 
cel
@JonClements I just realized, that I removed it on purpose... was too shocked that I possibly made a bad edit :)
 
Arghghgh... that's all over the place as well...
 
user559633
lol at needless redesigns that break things
 
cbg
 
1:05 PM
Yeah it's when you're halfway through and you realise that version control and deployments would've been better than vim over SSH on the live server. And it's 2002 and IE6 hates you.
 
Waited quite long for the OP to edit and add detail
 
@RobertGrant didn't think you'd heard of PythonAnywhere until a couple of days ago - what's the convo. about if I may ask?
 
Voted.
@JonClements he mailed because I'd signed up to see how things were going
 
ahhh okies...
 
Sorry, I'm just being ridiculous
But we had a good chat via email
Mentioned some things vs Heroku that were much better on PA, and a couple of possible improvements
E.g. a little UI for pip install for webapps
 
1:08 PM
user image
13
 
@Ffisegydd well done :)
 
Quick everyone - downvote the julia thingy!
the power will go to his head!
 
Ta luv. Hit 9.999 and had to find an answer to undownvote :3
 
DING!
 
If only I'd upvoted you before you could get the screenshot
 
1:09 PM
I'd have deleted an answer.
 
Yeah the real trick is maintaining exactly 10000
 
@Ffisegydd Congrats ... I will be up there in a few years from now :)
 
I've actually had thousands of upvotes; the reason I'm on ~3k is because I'm terrible at maintaining 10000
 
I need to get safely above it before we celebrate too much.
 
there ya go - have another 10 - that should be safe enough for any downvotes - but won't cater for deleted questions though :(
 
1:17 PM
@Ffisegydd The next time I come to UK, you've gotta gimme a party ...
 
lol, why?
 
Coz you've reached 10000
 
@Ffisegydd next step 20k then, yeah? :p
 
A giant leap (from 10k to 20k)
 
user559633
TypeError: __init__() should return None, not 'str' argh, python nannystate
 
user559633
1:21 PM
guido van cameron
 
Why would that ever matter
 
user559633
i'm trying to emulate the namespace construction in python
 
user559633
...without doing something terrible like climbing up the stack and assigning directly
 
@tristan so what's wrong with using packages/modules?
 
I assume that the usual __new__ behavior is to call __init__ and discard its return value without looking at it
 
user559633
1:23 PM
i have a project where i want to clean up this call to a settings.py file that has ~900 lines, but i have to do it in multiple stages for "reasons", so i was going to abstract logical groups into namespaces as part of a "pull the tablecloth" magic trick to start the process
 
user559633
e.g. instead of

aws_ftp_user = 'a'
aws_ftp_pass = 'b'
site_ftp_user = 'a'
site_ftp_pass = 'b'

I want to move it to

namespace aws { }
namespace site { }
 
Could just use classes inside the settings.py, or make settings a package, then have sub modules for each group
 
user559633
with the trick being that naked calls to aws_ftp_user needs to work, as otherwise i'd have to search replace all calls to that with aws.aws_ftp_user if i did it with a class
 
okay, break into up into settings/ then various files
but have __init__.py in settings, from submodule import * each of the sub ones
 
user559633
yeah, i guess. then inside settings, i could just have import * that pulls in other modules
 
user559633
1:27 PM
cheers, that will have to work
 
@JonClements See I actually cared about 10k so I'll probably not worry too much about 20k.
 
@Ffisegydd taken the time to look at stackoverflow.com/tools yet?
 
"The page you're trying to visit requires the privilege “access to moderator tools.” " :(
 
@ReutSharabani yeah, @Ffisegydd is part of an elite club :)
 
1:31 PM
if rep >= 10000:
from stackoverflow import *
else:
print "lol noob"
 
@Jon next goal is Python Gold.
I'm on roughly 680/1000.
 
@BhargavRao, in regards to the print (sumymoment()) suggestion you just made, it is conventional to have no space between a function name and the opening parenthesis of its argument list.
So says the PEP 8:
> Yes: spam(1)
> No: spam (1)
 
Thanks ... hand slips over the spacebar
 
My five year plan is to get Python gold and then ascend to a form of pure energy.
8
 
@Ffisegydd Yeah, don't forget you also need 400 answers
 
1:39 PM
@Jon that's fine, I'm already on 300
 
@Kevin Err, well, you only need 22 upvotes for Python gold :)
 
Shouldn't take more than a few months, then.
 
@Kevin That code has another big problem - it's got a return inside a for loop.
 
That will be a fun surprise for him.
I guess I feel bad for closing as a typo since his code has an actual problem.
Ok, if he asks a near-identical follow up, nobody close it
 
Don't know what has happened today, Got +95 within 30 mins of logging into SO
 
1:47 PM
@Kevin I left him a comment, but as yet there's no reponse.
 
Just indicating to him that there's a problem, is itself helpful :-)
He might even solve it himself. "Oh, I should probably create a list and append to it incrementally" or something.
 
@PM2Ring Voting up your comment to attract his attention
 
Just burned through 15 NAA flags in the "old questions with new answers" queue
 
Ta, Bhargav.
@Kevin Maybe. I almost put a list comprehension solution into the comment, but I'm trying to break my habit of putting answers into comments. Besides, I want those damn points. :)
 
That guy is so good that he actually upvoted my answer before accepting :)
 
1:53 PM
Nice.
 
Finally got the Informed badge. Phew!
 
But that unconditional return in the for loop's a pretty bad error for someone who's been doing Python for at least a year. OTOH, even long-term experts do dumb things from time to time... being an expert just means you notice them & fix them before they do damage. Usually. :)
 
Not knowing you need parentheses to call a function is also a pretty bad error.
 
Ninja programmers, mines, etc
 
@RobertGrant ROFL
@Kevin Granted, but that could be just a dumb typo. Or a brain fart.
 
1:58 PM
Damn sure there is a dupe for this stackoverflow.com/questions/28068993/…
 
Seems like a common problem.
 
85
Q: Python read a single character from the user

Evan FosmarkIs there a way of reading one single character from the user input? For instance, they press one key at the terminal and it is returned. Sort of like getch(). I know that there is a function in windows for it, but I'd like something that is cross-platform. Thanks.

 
Nice target. I'll put that in the common questions list if it doesn't already exist.
 
Damnit davidism asked if I could produce a graph of the most common targets and I forgot, I'll try and do that this weekend.
 
2:02 PM
I still have this doubt --- Why downvote on the duplicate question?
 
GOOOOOOOOOONG
 
Hmm, that guy is on OSX, so I'm no longer sure the dupe target is useful to him, since the top answer only covers Windows/Linux.
... Unless Mac and Linux have the same interface for this kind of thing.
 
OP doesn't seem to have even noticed the dupe link. He's just talking about how the one suggestion given in the comments of his own post doesn't work.
 
Could be he hasn't refreshed the page.
 
2:07 PM
That is an unfortunate failure mode.
OP might grow a comically long beard and then become a skeleton before it occurs to him to refresh.
 
The meme suits better --- Waiting for someone to answer .... Still waiting
 
user image
3
(s/OP/Stack Overflow)
 
Oh-oh. That dupe link for Python read a single character from the user probably won't work: stackoverflow.com/questions/13740706/…
But this looks helpful stackoverflow.com/a/8718648/4014959
 
Oh! curses .... My favorite
 
@Robert umm... okay... so ended up okay then I think!? ;p
 
@PM2Ring We better inform georg about this dupe
 
@JonClements yeah, dunno :) certainly a good example of something that wasn't a programming problem, given that it was in the docs
 
@BhargavRao Maybe the OP will see my comment.
 
2:30 PM
Yeah, voting up to grab his attention
 
@RobertGrant Maybe you need to tell Joshua Frank that SO isn't actually a forum, let alone a discussion forum...
 
LOL, the comments can be made into a book
 
@BhargavRao Or at least moved to chat.
 
Yeah ...
Does break breakout of the innermost loop?
 
Yes, the innermost loop only
 
2:40 PM
Thanks
 
The stackoverflow.com/questions/28068993/… dude's just top-edited his question, so surely he's seen the links. But now he wants to fetch a char by calling his bash command via Python.
 
So flag for re-open?
 
Maybe not. Hopefully, he'll read my comments.
But I better leave you to it, it's getting late here.
rhubarb
 
(re)Cabbage folks
Been sort of lurking
 
2:49 PM
Cbg dude.
 
So, nice dictionary comprehension question
 
Have no words for it
 
deletes complex question. I have the dataset {'x':0, 'y1':1, 'y2':1},{'x':1, 'y1':2, 'y2':0}, ....
There's about 20480 dictionaries needing to be chained together to output as a string for charting software
(x refers to the x-value axis, and y1/y2 refer to the series data y points to be plotted against x)
 
Ok
 
I suggest doing programming to it.
3
 
2:54 PM
Now, I generate the y1/y2s through dict comprehension and relatively quickly, but what's an efficient method of inserting the x data
@Kevin The sarcasm, she hurts
 
;-)
 
{ 'y{0}'.format(s.reading.index):s.g for s in samples.filter(index=0)} #in the first sample's case
 
@Kevin what's "programming" - I've heard it mentioned a few times here...
it's just that it seems like something I should be aware of as it gets mentioned so often...
 
It's when you brainwash a prisoner of war so that he performs your commands in response to predetermined cues. Source: Tom Clancy spy novels
 
@JonClements Something to do with snakes.
@Intrepid what format do you want your data in at the end? {'x':[...], 'y1':[...], 'y2':[...]}?
 
2:57 PM
ahh... and a cobra is a snake, and it's also a lager I drink now and again... great... looks like I'm an expert already
 
Oooh wait no you want a string.
 
@Kevin I thought it was when someone picks what order my TV shows me stuff in
 
It's when you get your VCR to stop blinking "12:00" all the time
 
Ah, Well, I was close.
 
@Ffisegydd I need it like this: [{point}, {point}, {point}, .... ]
 
3:00 PM
@Kevin that's easy - you just pull the plug out
 
Ok, so I'm interpreting this question as "I have this dict comprehension that makes the dictionary {"y1":23, "y2":42} and I would like to make a change to the comprehension so it makes {"x": 99, "y1":23, "y2":42} instead."
 
Yeah understanding the problem is difficult, it doesn't help that I don't speak Scottish.
 
where: {point} = {'x': xvar, 'y1': y1var, 'y2':y2var}
@Kevin Well, not so much. That's just what I've got working now, trying to rework my first attempt which was naively slow
No matter which way I shake it, I seem to introduce something horribly, horribly slow
 
Where is this data coming from, anyway?
 
3:03 PM
How do you get the data?
Heh.
 
My own Django prototype DB
 
So you get it from a function? What does the function return? A tuple of values?
 
ducks in anticipation for thrown snakes/codes/beer
So, samples is a filtered QuerySet of all the possible samples/data points
 
cabbage
 
Each sample has a value, an index and a reference to the series it belongs to (reading)
cbg(davidism)
 
3:07 PM
cbg @davidism
 
cbg @davidism
 
@Ffisegydd 10K! Congrats!
 
Ta :3
 
Me 4k today ... :)
 
@davidism it's so beautiful, you can't imagine all the new features (I'm already bored, there is no secret 10k+ lounge, it was all lies).
 
3:09 PM
I imagine going on a delete spree for about 30 minutes then everything going back to normal.
 
I haven't deleted anything yet, but I have flagged 25 answers as NAA.
 
Only 779 rep to go and I'll join you in the secret lounge.
 
The best 10k+ privilege is probably the secret menu at Taco Bell. Try their Galaxy Nachos!
 
Alas there is no Taco Bell in Blighty.
 
3:12 PM
Make sure you've got the handshake down, because they'll shank anyone they think is a non-member.
 
Ahh... linkedin has just let me know that Martijn and Fizzy have looked at my profile :)
 
Oh thank goodness, the guy whose library I'm using replied on Github. Let me bug you sir until my problem is fixed.
Thankfully he appears to be the nicest guy in the world.
Rbrb
 
@RobertGrant Ahhh, the Intrepid way of doing things :P
 
You mean "not an answer". Flagged.
Huh, the close dialog doesn't go away after clicking the bright blue button.
 
3:20 PM
Yeah, have experienced that
 
Reminds me of my days interning at a printing company, when I was in correspondence with Bruce Lindbloom regarding his very useful webpage. Turns out he was a friend of my boss, because he showed up in my office one morning. Talk about direct feedback :-)
 
On a scale of 1 to 10, how bad is this: stackoverflow.com/a/28070678/948550 ?
 
On a scale of 1 to 10, how long is that ....
 
lol, sorry... I'm afraid of getting a thousand downvotes, but I like it too much to delete it :D
 
user559633
is there a way to call python with a debugging mode that will output/log whenever it increases a reference to an object?
 
cel
god, all problems in this questions are due to OP consistenly mispelling the package pyahocorasick :D stackoverflow.com/questions/28069901/…
 
user559633
heh python -v
 
DSM
Morning cabbage for all.
 
Cbg
 
cbg @DSM
 
user559633
3:39 PM
cbg
 
Bam rep cap.
 
Get a job!
 
GOOOOOOOOOONG
 
DSM
Awww, did I just miss out?
 
I have a job :P and I'm currently applying for more if you want to offer me one to stop me getting so much rep.
 
3:41 PM
Move to California.
 
cbg, people.
@davidism Who should move to CA, and why?
 
Me so davidism can get me a job so I'll stop getting rep.
 
@Ffisegydd oh, is getting too much rep a problem now?
 
Not for me personally.
 
Ah. Well, congrats on 10k.
 
DSM
3:44 PM
Bah, Kevin just beat me.
 
Ta
 
Sorry :-(
 
@DSM I wouldn't take that. Friends should never beat friends. Phone Programmer-Line.
 
@Ffisegydd Ever thought of trying something more adventurous? Like Ocaml or Common Lisp?
 
I'm currently learning R and Julia.
 
DSM
3:46 PM
@Kevin: No, it was a full thirteen seconds; it was a fair loss. Unless I find out you deflated my keyboard somehow, in which case we'll have words.
 
It's unusual-looking behavior because in doesn't feel like a comparison operator in the same way "<" and ">=" are
 
@Ffisegydd Ah, Julia. The language du jour.
I'd have thought getting rep on Python questions would be quite hard. Lots of competition.
 
DSM
Also lots of questions.
 
@Faheem there is a lot of competition, but also lots of questions. Also it helps to find a niche that you know really well.
 
@Ffisegydd Sure.
 
cel
3:47 PM
I wonder if julia becomes popular.
 
DSM
Speaking of Julia, I'm #7!
 
What sort of ranking does Bath have within the Uk? I guess Oxford and Cambridge still have the edge on science, with Warwick perhaps in close second in some things.
 
I need to get me some of that Julia cake...
 
@cel There are worse things. It's trying to be a Matlab killer. More power to it, I say.
 
@Feheem it depends on the department. I don't pay much attention to rankings though. I know we were Top University for Student Satisfaction for two years running. And two years ago we were Best Uni in UK (according to Times University List which is one of the main lists).
 
3:49 PM
Also, I think Edinburgh is pretty good.
@Ffisegydd Interesting. I think I was in Bath once. A very long time ago.
 
cel
@FaheemMitha Well, matlab and R are very, very popular. It won't be easy to become a successor.
 
@cel Agreed. But Julia seems to be getting some traction.
And the devs are really moving. Have you looked at Julia's commit log?
@Ffisegydd how do you like living in Bath?
 
@FaheemMitha Edinburgh was top of the UK rankings when I graduated
 
@FaheemMitha It's a beautiful and lovely city. Expensive though.
 
@IntrepidBrit Oh. But not now?
@Ffisegydd That's nice. Not too quiet, then?
 
DSM
3:51 PM
I almost went to Edinburgh. Have family there, and my great-aunt worked in admin at the university.
 
Since Intrepid left the university has dropped significantly, he was carrying them you see.
 
cel
@FaheemMitha yes, it looks very promising. I haven't seen it being used in science yet. Maybe it's too early...
 
@cel Yes, it will take a while.
 
@FaheemMitha It basically jostles between Cambridge, University of Edinburgh, Oxford, Imperial College London and Manchester I think?
But that might have changed in recent years
 
R was in development for a while before it really picked up steam. And that was a while back, in a less competitive environment.
 
3:53 PM
@Ffisegydd Well I certainly was carrying my joint honours degree. Only me and one other guy graduated that education pressure chamber!
 
R was based on S though, so had the advantage that S was already around.
 
When I first came across R (actually was recommended it) in 1999 or so, it wasn't anything like as popular as it was now.
 
DSM
@Fizzy: speaking of R, has the comment period on your CV closed?
 
@Ffisegydd True. But it wasn't (and isn't) S compatible.
 
3:53 PM
@FaheemMitha My advice - any one of the top5 are an excellent choice. Just pick based on who's lecturing and research areas
 
@IntrepidBrit To be clear, I wasn't looking for a university. Just curious.
 
@DSM you're welcome to comment on it, I've already sent it to them D:, but I can take into account feedback for next time.
 
@Ffisegydd I wanted to make a joke about the impossibility of an actual cake shaped like the Julia set, but I think an ordinary circular cake would qualify if you use the right complex polynomials.
 
I don't personally care for R at all - I think it is a crappy language. But it is certainly successful.
I occasionally recommend it to people too. Because in its niche it is hard to beat.
 
Funny, I expected OrderedDict to be hashable
 
3:55 PM
@FaheemMitha Fairy nuffs ;)
 
DSM
@Kevin: the circle is a Julia set, and lots of cakes are circular. (Well, after projection to 3D.)
 
@IntrepidBrit :-)
 
@Reut dict's aren't hashable either. They're collections that can change (like a list).
 
Now the question is, is the cylinder in the 3d Julia set?
 
cel
well, I think R is an extremely ugly language. But for statistics there is no real alternative
 
3:56 PM
oh right, immutability...
Well, dict is also unordered...
 
There is a funny web site called aaRgh. Or something like that.
@cel Not true. people use other things. Python, for example.
 
@Reut it's returned unordered to the user but internally it's probably ordered by the memory magic thing (I don't know...)
 
I have done (and do) statistics, and I actively avoid R. In recent years, I've only used ggplot2, and that is like a killer app. Has anyone here used the python ggplot2? I'm hoping it goes somewhere...
 
I had a question in an interview a while ago about how to make dicts hashable
 
DSM
@Fizzy: even if you're relatively new to a language, I think it's best to simply add it to the list of things you're familiar with (to the appropriate level) and instead concentrate on the things you'd use it for. You want to avoid the suggestion that someone will be paying you to study that language (even if that's what they're going to be doing in practice.)
 
3:58 PM
I couldn't do it cause I'm a bad programmer.
 
@DSM yeah iCodez made a similar comment, I did re-write it to try and show that I wasn't a complete beginner to the language.
 
In case anyone has not see it - tim-smith.us/arrgh
It's a funny read, and quite accurate.
 

« first day (1558 days earlier)      last day (3373 days later) »