« first day (1837 days earlier)      last day (3101 days later) » 

12:00 AM
bleh, still no. I'll have to look at it more later
rhubarb for now
 
@AdamSmith Maybe I'm misunderstanding what you're trying to do
but would this work? board = [range(1, 10) for x in range(1, 10)]
 
(or, are you trying to access every element of board?)
 
@AdamSmith I failed a very simillar question in a google interview
 
@AdamSmith are you doing this: "Validate Sudoku with size NxN"?
 
12:26 AM
Words. I am at a loss for them.
I completely remove Pygame. Update to 2.7.10. Reinstall pygame1.9.2a0. Framerate halved; memory leak plugged.
I install pygame1.9.1release over top of it. Framerate restored; memory leak still plugged.
I guess 1.9.2 solved the memory leak and 1.9.1 didn't overwrite the changes to 1.9.2's slowdown thing, whatever that was.
 
Air
@Augusta It was probably a security fix. Row, row, row your boat...
 
Which was?
The thing that creates the lag or the thing that solves the leak?
 
Air
The former. Now you gonna get hacked! (In case it's not obvious, I'm 100% bullshitting here.)
 
Onoes!
 
Air
rhubarb now
 
12:42 AM
rhubarb to you
 
@Augusta I'm always amazed any of this shit stuff ever works.
 
They... also moved around some functions... from one module to another... without explaining why or to what benefit.
 
I'm still convinced computers run on magic.
 
So now I don't know whether I should use the module from its new location, or use the thing that (seems to have) replaced it. The docs were no help.
 
@MorganThrapp I'm pretty sure they do
 
12:49 AM
The more I learn about programming/hardware, the more convinced I am.
 
Computers run on smoke. When the smoke escapes, the computer breaks.
Smoke and sparks.
As far as I know, magic is massless, but I could be wrong about that.
 
@Augusta And blood. I've never managed to install a CPU cooler without ripping my hand open.
 
i always thought computers ran on tears
 
I'm a priestess, not a magician. That crap is a mystery to me. -_-
If you cry directly into a computer, it gets slower, not faster, though. I guess the tears have to be compatible?
I'm not a sorceress, either.
 
yeah. maybe your tears' firmware isn't up to date
 
12:51 AM
That stuff's batshit bonkers; I don't think it even has rules. You just want something, and it happens. If it doesn't work you just don't want it enough.
I guess that *is* magic...
Shows you how much I know! :I
Gotta fly. Be back later.
Rhubarb, you lot! :v
 
wait
before you go
why does everyone keep saying rhubarb?
 
... oh my god what have i joined
 
1:07 AM
LOL
@AmagicalFishy The future!
 
cbg
 
@JonClements i am mushrooms and peas
 
@idjaw yep!
@JoranBeasley I feel like it would be easy-ish to do it using nested for loops and indices, but grouping sounds more fun
 
@AmagicalFishy not just artichoke? :p
 
a little. ;)
@AdamSmith I think I managed to get most of it w/o nested for loops
and can (i think) manage to get the individual squares
with some slicing and fancy use of modular-3
 
1:13 AM
[[(0, 0), (1, 0), (2, 0),
  (0, 1), (1, 1), (1, 2),
  (0, 2), (1, 2), (2, 2)], ...]
is what I'm looking for
each subsection of 3x3 squares inside the sudoku
(although I need a general solution for NxN size boards)
I can do it with some variety of zipped groupers
but I don't have the time to sit down and hash it out just yet
at home now and the wife is bugging me to play Rocket League with her haha :) rhubarb for now
 
@AdamSmith If you just need to hash it, just use hash. ;)
 
hash(it_out)
 
haha, hubarb
rhubarb*
 
hash(stuff) - hash('it') Boom. Hashed 'it' out.
 
1:43 AM
cbg! potato, banana? pineapple.
 
cbg :)
 
thing is, that translation is actually pretty accurate to what i received from a contact recently
 
missing: mushroom asparagus bla bla bla
 
Ooo... "bla bla bla" sounds interesting - does it make a nice soup?
 
1:50 AM
@JonClements i mean, after "how are you" one should at least wait for an answer not directly continue with "great"
 
I don't know - I know some people that will hold both sides of a conversation for you and appear perfectly happy while doing so :)
 
rolf
 
Cbg all.
How do you know when to stop adding features?
 
you have the mvp yet?
 
?
I gotta head out for a bit... rhubarb to all.
 
2:47 AM
Did I mark the dupe correctly or is it simply too broad? stackoverflow.com/questions/33358717/…
 
I'm not even entirely sure what they're asking, but the dupe looks ok. I voted as too broad though, based on their "enumerate everything" comment.
That dupe's probably too broad too, but I don't feel strongly enough about it to vote.
 
yeah, also it's old so I don't really care either way...
 
I answered it.
 
a good opinionated answer :)
 
well, I think it's fairly objective...
 
2:54 AM
Nah, that's pretty much the definition of opinion. Also, you don't actually describe the downsides, and even if you did it looks like it would just be a rehash of the dupe.
 
at least the "from a python programmer's point of view" is stated so all is good (TM)
 
Its accepted answer is also wrong.
 
13 mins ago, by davidism
That dupe's probably too broad too, but I don't feel strongly enough about it to vote.
On the whole, I would have avoided adding more noise to the pile. (Or at least to this new pile.)
 
Any one wanna see a sketch of Tux with a creepy twist riding a python?
 
The accepted answer basically complains about not being able to do lambdas in Python. I must be missing something.
 
3:08 AM
Some one on another irc drew it for me.
 
Only Tristan's allowed to show us creepy sketches of pythons.
 
Tristian's an artist? I didn't know that!
 
nope, not going there, the image is borderline enough
 
LOL!
 
it's really not
 
3:28 AM
 
3:52 AM
Brainbench was founded in January 1998 (until 8 December 1999 the name was Tekmetrics.com) and was later acquired by PreVisor. Brainbench provides online certifications mainly in the Information Technology field and others in general. The company has provided its services to over 5000 corporate and over 6 million individual clients. Some of Brainbench's 630 exams are available free of charge, while others are administered for a fee. == Tests classification == Several online tests are available for those who register on the site. The tests available are classified as follows : == References == ...
 
4:18 AM
@AaronHall No, he's railing about the restrictions of lambdas: "you can't define a function (a real function, not just an expression) inline"
 
4:29 AM
sure you can, just use a mixture of FunctionType and compile, but not that you should
 
5:28 AM
Morning CBG all
 
6:25 AM
I added basic instructions, a help window, and keyboard controls to my sliding tile puzzle. Anyone want to try the new version?
 
Hey up all
 
cbg
 
 
2 hours later…
8:08 AM
Speaking of the certification: cafepress.com/asscert.394177296
 
Cbg :)
 
 
1 hour later…
user559633
9:28 AM
morning cabbage
 
user559633
charles cabbages analytical engine
 
9:50 AM
cbg
skype </3 ubuntu
 
10:00 AM
Cabbage!
 
Leafy greens where?
 
@Kevin were you corrected yet?
The statement

RESULT = yield from EXPR
is semantically equivalent to ....
 
 
1 hour later…
What kind of flag should that get?
NAA?
 
I put NAA
 
Good enough for me.
 
It is a troll attempt.
I'd go with spam even if it is declined.
@TigerhawkT3 Congrats on the shiny new gold badge in your kit.
And welcome to the Py gold hammerers group :D
 
11:43 AM
@BhargavRao I have hammered many dupes already. :)
 
12:00 PM
They are asking me take input from std input can I take input using raw_input() is both the same thing
 
Yeah
 
So what does sys.stdin.readline() do I assigned line =sys.stdin.readline();print line it printed blank it did not ask any input from me
 
What does print repr(line) show?
 
'' that's all
I think it is the fault of my canopy when I saved it as a script and tried running it as python script that problem did not happen. Weird I going to shoot this canopy someday :(
 
12:15 PM
Hmm, I can't replicate. sys.stdin.readline() works the same as raw_input() for me. (Except that there's a newline at the end of the returned string)
This may or may not be useful:
6
Q: How to flush the input stream in python?

AmjithI'm writing a simple alarm utility in Python. #!/usr/bin/python import time import subprocess import sys alarm1 = int(raw_input("How many minutes (alarm1)? ")) while (1): time.sleep(60*alarm1) print "Alarm1" sys.stdout.flush() doit = raw_input("Continue (Y/N)?[Y]: ") print...

 
@Kevin yeah when ran as a script it did the same thank you :)
 
NAA
Lots of NAAs today, 18 flags under review :(
 
12:36 PM
The linked one is gone now. You're making a difference :-)
 
I refresh that New Answers to Questions More Than 30 Days Old page and find atleast 3 new NAAs every time :D
 
@AnttiHaapala good find
 
It makes me sad when a self-answered question gets a poor reception.
 
cbg all!
 
Unlike ordinary downvoted questions, self-answers are usually posted with pure intentions
 
12:46 PM
morning all
 
So downvotes give the OP a feeling of "I go out of my way to show something cool and I'm punished for it"
> Feel free to edit this post, refactor, etc, or respond with questions. Hope this helps someone!
 
Agree with you there @Kevin. Have a look at this too meta.stackoverflow.com/questions/289064/…
 
@Kevin do you have the link?
 
@idjaw It's the one Bhargav posted above: stackoverflow.com/questions/59914/…
It's hard to tell that it's a self-answer unless you can see deleted posts or unless you look at the edit revisions though
 
yeah I can't see deleted posts yet
 
12:50 PM
That deleted self answer tho :D
@idjaw Star the question and come back later
> userid 26, respect
 
There are self-answers, and immediate self-answers.
Self-answers are basically "OP had no way of knowing they would find the solution on their own a few days later."
 
This one was an immediate self-answer, going by the first revision of the question.
Note that I'm not calling it a good self-answer, since it was an explanation-less code dump.
 
Immediate self-answers are more "I didn't have enough trouble with this to ask a sincere question, and neither has anyone else at this point, but maybe someone else will want to in the future... and I want to preempt their question."
 
quality and intent are orthogonal concepts here
 
Thus far, I have not seen any good immediate-self-answers.
 
12:58 PM
 
They're totally cool by site rules, so I don't flag or anything, but my downvote threshold is lower for those than usual.
hands Kevin a glass of water
And by your description of it, this immediate-self-answer (ISA) was bad too.
 
Although mine wasn't so much a "preemptive answer", since there were many questions much like it asked before I made that post. I was aiming for more "authoritative and without the distracting cruft that accomadates most questions of this type"
self answers are tricky because a question that's never been asked before is probably too broad, and a question that has been asked many times before is likely to get closed as a dupe.
 
That's less a general rule and more the current state of SO.
 
@TigerhawkT3 See Martijn's 3 questions :-P
 
Pretty much.
My main issue with ISAs is that they are not questions that someone couldn't solve on their own.
 
1:04 PM
Wow, saw a self answer with Here is an answer suggested by TigerhawkT3 as the first sentence :D
 
Wait what where?
 
The SO guidelines suggest "Focus on questions about an actual problem you have faced." but they neglect to add "... And which you have not yet been able to solve"
So the "official" culture of the site doesn't preclude ISAs. Of course, what the official docs think is the culture, and what actually is the culture, do not always perfectly coincide
 
This is the same reason that half of the all-time-most-upvoted questions would be insta-closed if they were asked today.
 
1:10 PM
I have no memory of that question, no memory of making those comments, and don't see where I suggested that approach...
 
Happens all the time :D
 
Looks like it was a couple weeks after I started answering questions, back in March.
The self-answer links to my profile but not to where the suggestion came from. ¯\(°_o)/¯
jonrsharpe's answer on that question references my approach as well (possibly just because it's referenced in the self-answer).
 
Which would you rather do, subclass something or delegate to it?
 
I liked this question... I shared it on twitter :D :D
 
googling "delegate"...
 
1:23 PM
That "find the quarter" code looks like what I used to do exactly that in some code for work, and I do think I posted it somewhere on SO for some reason... but where and why...
It was already deleted. :(
 
I guess I pick "delegate" since I use the decorator pattern pretty frequently
 
I had a fun comment, too: "Python programmers are very emphatic, so we use three > to point to our code where just one would suffice. By contrast, Linux users are financially motivated, so you see commands like $ ls."
 
@BhargavRao That Q's deleted. =(
 
Here's the LoggerAdapter from the logging module: hg.python.org/cpython/file/tip/Lib/logging/__init__.py#l1556
You'd use that to delegate
 
@QuestionC The question was why use >>> instead of > for the prompt
:D
 
1:25 PM
Well, not even for the prompt. The questioner seemed to think they needed to start every line of code with that.
 
I subclassed Logger directly. Another group used the LoggerAdapter. I think they can use my code because of that...
Delegating means you need to write a delegation method for every method you want to emulate.
 
It bothers me when I see code that uses the ">>>" prompt, if I want to run the code myself and see if it produces the output the poster claims.
 
I agree
but sometimes I want the output right next to the input
 
I would like a REPL that lets you paste in code that uses ">>>", and automatically strips them out, and also ingores lines that are obviously output
It doesn't seem like it would be too hard to strip ">>>" and "..." and skip lines that have neither... The only hard part is when people try to troll you with >>> print(">>> when this is printed, your REPL will think it is code")
 
But maybe we could write an SO extension that takes everything after the >>> and puts it in a codeblock at the end of the post?
 
1:31 PM
Yes... Or perhaps a "copy just the code" context menu item
Assuming JS can interface with the clipboard. No idea if it can.
 
You could use the Python compiled to JS, probably.
 
> Automatic copying to clipboard may be dangerous, therefore most browsers (except IE) make it very difficult
 
New talk idea: using Python to script the DOM.
 
I give this userscript idea a 6.5/10 on the difficulty scale. Possible to do, but will require many swear words.
 
I frequently include >>> and ... to show interactive output, generally for "here is the data structure, here is a loop with a print(), and now you see the result." The alternative is "Code: xyz (line separator or non-breaking space) Result: abc."
 
1:36 PM
I don't begrudge users for including ">>>". That is often the clearest way to convey information. I just rue that it makes my life harder in a particular corner case.
Pedestrians often block my left turn on my commute to work, but this does not mean I wish they all had stayed home.
 
Well, you could paste the >>> code into an editor that allows column-mode editing, like Notepad++.
 
Funny. Doesn't seem like a bad question to me either.
 
It was bad until he got to >the person doing the tutorial I was watching didn't explain
 
1:39 PM
Last I checked, multi-cursor editing isn't super-well supported in Notepad++. IIRC You can do it, but you have to ctrl-click each line manually
 
I guess you could write a small Python program: with open('file.txt') as f, open('out.txt', 'w') as o: for line in f: if line.startswith('>>> ') or line.startswith('... '): o.write(line[4:]).
What do you mean by multi-cursor? I just mean holding Alt while you click and drag.
 
@Kevin Alt+Shift+Arrow will add additional cursors on that line.
 
Oh, I didn't know there was a keyboard shortcut for it. Thanks.
(heh heh heh. There's no better way to get correct information than by asserting incorrect information and getting "well actually"d)
 
No problem. That plus regex find and replace are most of what I use N++ for.
 
1:45 PM
I use it for my Python development...
 
I wonder why they picked Alt+shift+Arrow when Alt+Arrow doesn't appear to be taken by anything.
I guess the shift is supposed to imply that the shortcut has something to do with selection
 
Yes, Shift is selection. Alt is the additional modifier, not the base.
And explicit is better than implicit. :)
 
@TigerhawkT3 I use PyCharm.
I couldn't give up Ctrl+B to jump to declaration of the method.
 
I just search for def myfunc.
I learned Python using Pyscripter, but it's kind of abandonware, with no updates for Python versions after 3.3.
And it literally will not run with Python versions for which it hasn't been compiled. There's some kind of hard-coding in there, I think.
 
My boss came in just now. "you know that feature that you've been sweating over that we said we needed by Nov 1? We don't actually need it for the foreseeable future. Can you work on this other thing instead?"
I am... Conflicted
 
1:51 PM
I love such things
 
"hurry up and wait" scenarios bother me inherently, even if the outcome is positive for me
 
As long as they're not also complaining you wasted so much time on it!
 
They haven't yet, but they can always play that card later.
 
The fun part is the time you need for the context switch to now stop working on it, and then later picking it up again.
 
Agreed
 
1:54 PM
"And if you hadn't spent all of October working on X, then we wouldn't have to make you work on Y over Christmas"
 
Kevin, you need to practice the Zen of Wally.
Dilbert isn't a comic strip, it's a documentary/historical record.
3
 
2:06 PM
How much garlic do we have on hand?
 
I'm like 95% Wally by volume, I'm good on that account
 
Ah, so your boss just thought you were sweating over that feature, but you were wisely letting it age? Good, good.
 
I think I might be literally magic because most of the problems I ignore, eventually cease to be problems
the rationality angel on my shoulder says "or most problems in your place of business are false alarms, and you're just better at identifying them than a random number generator would be".
Quiet, rationality angel. I want to be magic.
 
You are totally magic.
Just don't forget import magic.
 
There, it's two against one.
 
2:12 PM
You have to read the questions well before criticizing. — Fawy 2 mins ago
:D
 
Ehehehehehehe.
At least you've never spent time translating a song into Klingon. My rationality angel gave up and went to the pub on that one.
In my defense, it was a short song.
 
You guys mind if I shamelessly advertise a question I just posted on SO here?
 
Has it been 24+ hours?
 
it has if I move really, really, really fast
 
Anyone in here inclined to answer questions, is probably already watching the new questions queue, so additional advertisement would have little effect
I'm reading it now, myself
 
2:16 PM
Ah, groovy. Thanks. :D
 
I'm not sure how multiprocessing interacts with URL requests, but I expect the OS can only send a limited number of requests at a time. So maybe it's not as parallelizable as it initially seems.
 
Oh, man. That'd be a bummer, haha. I'm too deep into the hole to have that happen now!
 
I know very little of OS design so that's just a guess
ParseHTML ought to parallelize well, though, assuming it's light on I/O
 
It is, yeah. The main I/O is done by the thread which writes the dict. to a file
(At least, I think so. I've only just had my first experience w/ the threading and multiprocessing modules a couple of days ago—so I'm still not excellent at knowing whether or not a task is I/O bound or CPU bound)
I think you're right about the URL request thing, though. I'm reading here that getting content is mostly I/O boun
d
I'm pretty sure BeautifulSoup-ing is CPU bound
 
That seems likely.
 
2:30 PM
That means I've been shifting everything all wrong! Thanks for your help, @Kevin. :D I think I know how to satiate my addiction and speed this up more
 
Second opinion please: have I misunderstood this question >
0
Q: Creating class variables in Python with inheritance

Tony EnnisI have the following: class X(object): def __init__(self, *args, **kwargs): type(self).label_type = xyzzy(self.__class__.__name__) class Y(X): def __init__(self, *args, **kwargs): super(Y, self).__init__(self, *args, **kwargs) When I create a new instance of Y, a class...

 
I feel a bit like a rubber duck but I'm glad I did something useful.
 
A metaclass is wild overkill if the other answer is correct!
 
It was socratic method, you just didn't use questions :P
 
I haven't yet found it necessary to mess with metaclasses in any of my programs. I did have a class variable once, but I hated it and refactored it out as soon as I understood argument passing more thoroughly.
 
2:37 PM
@jonrsharpe I think you are correct and I think the other answer is insufficient. I think the OP wants referentially separate class vars for each subclass.
Y.label_type = "whatever" will change X.label_type in the other guy's implementation, but not yours.
 
@jonrsharpe my understanding of the question is the same as yours...
 
@Kevin not just me, then; good. The OP's edit hasn't clarified much, frankly.
@hiroprotagonist OK, thanks
@Kevin no, it will just shadow the inherited attribute - X.LABEL_TYPE will be unchanged
 
Oops, I think I oversimplified.
 
@TigerhawkT3 "static"/"constant" class attributes are often handy, but I don't think I've ever used a class variable in anger
 
Well, even so, OP probably wants Y.label_type to evaluate to "Y" and not "X"
 
2:42 PM
@Kevin that was my reading, yes - " a class variable called label_type is created using Y, not X. This is good and works fine."
 
Variable, attribute... sorry, it's a bit late here. :P
 
DSM
'orning 'abbage, 'ov'n'rs.
 
Variables are variables even if they're not variable. But that opinion may vary.
 
@TigerhawkT3 oh, I assumed you were distinguishing between constant and variable attributes - I'm surprised you've never felt the need for class attributes
 
Hi DSM, if that's what you're saying :)
 
2:44 PM
@Kevin at least your jokes are constant
 
@DSM, here's a ha'penny. Go buy yourself a christmas goose.
 
It was in an OO Tkinter app, and the object had to be accessible by objects of external classes. Making the object a class attribute was the easy way to do that. I did eventually realize that I could just pass the object reference into each object of these external classes, since they got instantiated within the main app class.
 
I don't use class variables much myself, except perhaps as makeshift enums
 
@Kevin I only use them when I need each instance of the class to have consecutive unique ids.
 
Software recommendation question with an upvote. I suspect someone intends to answer it.
 
2:53 PM
@TigerhawkT3 looks like that's not going to work out for them
 
I don't get riled up much if someone squeezes in an answer to a recommendation question before it's closed. There are worse sins than being helpful and off topic at the same time
 
There are worse sins, but we squished a little one. :)
 
I asked a question about - Names in class scope are not accessible few days ago and today I asked a Java programmer and I was told that you can use a name that's defined within the class without you define it.
 
@direprobs ...what?
 
for reference about what I'm talking about search for: [Names in class scope are not accessible] here=> python.org/dev/peps/pep-0227
 

« first day (1837 days earlier)      last day (3101 days later) »