« first day (988 days earlier)      last day (3966 days later) » 
00:00 - 14:0014:00 - 21:00

12:05 AM
cabbage guis
Rhubarb then.....
 
freakin idiot downvoters, who doesn't care explaining what is wrong in a perfectly working answer for the OP's question.. sometimes SO is pretty annoying.. :(
cabbage @PythonInProgress
 
 
1 hour later…
1:15 AM
Who will ask the 200k python question
 
I do
:)
I have a question preformatted for the occasion:)
 
Lol
 
but maybe not.. probably I will sleep by then
 
1:36 AM
 
2:33 AM
Is this the place to ask Django questions?
 
The chat?
Well, I don't know anything about django
 
It's a place to ask
However I can't help you there either
 
I was looking through Django's decorators
but it's like every other line I don't understand
so thought I try and ask here
 
About decorators in general or specific to Django?
 
well how about decorators in general first? it's like a function that takes in a function and spits out a function, right?
 
2:36 AM
Yeah
 
here are some code from Django's Contrib.auth.decorator
def user_passes_test(test_func, login_url=None, redirect_field_name=REDIRECT_FIELD_NAME):
"""
Decorator for views that checks that the user passes the given test,
redirecting to the log-in page if necessary. The test should be a callable
that takes the user object and returns True if the user passes.
"""

def decorator(view_func):
@wraps(view_func, assigned=available_attrs(view_func))
def _wrapped_view(request, *args, **kwargs):
if test_func(request.user):
return view_func(request, *args, **kwargs)
oh wow, that code didn't paste well
no indents
 
Indent the whole thing by 4 spaces
 
here let me type it in line by line
 
Don't bother
 
def user_passes_test(test_func, login_url=None, redirect_field_name=REDIRECT_FIELD_NAME):
oh
 
2:38 AM
What don't you understand?
 
so that line def decorator(view_func):, that's standard syntax for decorators right
takes in a function called "view_func"
 
It doesn't matter what you call it
 
what is @wraps?
ok right
I see at the top it says "from functools import wraps"
 
@wraps would be another decorator defined somewhere else
 
ok so seems like what this thing is doing is,
If some whatever function passed in returns true, then go ahead and run that function
If not, the redirect it to... something
oh it's redirecting it to some default view function
boy it's going to be hard for me to understand this well enough to write a customized version of my own
I should just stick with a few if-statements in my code....
none of this decorator stuff for me... yet
anyway, thanks =) sorry to clutter up the chat room
 
2:51 AM
no worries ;)
 
3:14 AM
"Even in a raw string, string quotes can be escaped with a backslash, but the backslash remains in the string; for example, r"\"" is a valid string literal consisting of two characters: a backslash and a double quote;"
Does that make sense?
Ok nvm
 
@Haidro I'm going to sleep now, but I created an ALARM clock in python, to catch 200k:
rhubarb
~
 
Rhubarb
 
 
1 hour later…
4:32 AM
Cabbage!
Where do you see the total amout of messages?
 
Go to the chat room page and it should be in the bottom right hand corner of the box
86898 messages (including this one)
 
Nah, I only see averages or perday/perweek
It should be 199975 according to Peter
 
that's questions tagged
 
ha! :)
 
not messages in the chat room
 
4:39 AM
What a stupid peas from me :)
 
Peas isn't in the official Salad dictionary
 
It is in the one from pastebin.com/z7zQqzCw :)
 
Oh, right, didn't see the parens around 'Black Eyed' ;)
 
5:01 AM
199,991 questions!
 
omahgawd omahgawd
 
Calm down!
Or, actually, keep panicing
 
5:50 AM
6 to go!
 
5..
 
I feel like it will be: 199998 - 199999 - 200000 - #$#%@ - 200134
 
4 left
 
A person mixes us break & return and ... anglicanmemes.files.wordpress.com/2013/06/…
 
6:06 AM
For the record, I was first nswering that question :D
 
Why bother answering? It will be closed :)
It's a peas rather than a code :)
 
6:24 AM
Holy shit
Pardon my language, but I'm almost 6k rep
 
Have an upvote :)
 
<3
OMG THANK YOU
Enlightened badge and nice answer!
 
yep =)
>>> "baby" % {"babe": "bebe"}
"baby"
This one was my favourite question :)
And I'm still 300rep to 2k :(
 
I'm still 9,375 rep to 20k :(
 
I'm... cbf maths
 
6:30 AM
lol
 
Hmm, maybe not enlightened
I thought I was first to answer
 
Enlightened takes a while to come through
 
Ah
 
One time it took over an hour
 
:O
 
6:33 AM
cbf?
 
Should be cby
didn't see that before
 
cby doesn't make any sense either :)
 
"Can't be yammed" ;)
3 left
2
Melon to whoever upvoted my 'print() not working' answer ;)
 
6:49 AM
You're welcome :)
 
Here, have an upvote back ;)
I wonder what the 200,000th python question will be? o.O
 
almost 10! almost another "Enlightened" :) thanks
why does "tagged" say: python × 199145 ?
Not counting "on hold" questions?
or deleted ones
 
Probably just hasn't updated yet
Cabbage now has support for Python 2!
199,999 python questions!
 
f5 f5 f5 f5
 
7:07 AM
Ah, such a beautiful answer
 
Not really :)
 
@mishik I don't understand what you're saying
My code works fine
 
It does, but the amount of memory usage is n^2
If you need a value for 77 only, you will still get all the values for 2-100
 
0
Q: position of tags in a html page using python 2.7 with beautifulsoup

RanjanI am trying to parse a html page with the given format: When iterating over the div tags I want to figure out whether it is under img tag with id 'first', 'second' or 'third'. Is there a way to do that? I have the list of img blocks and div block...

!
Ok you guys don't need to go crazy
 
WEEEEEEEEHAAAA!
 
7:14 AM
@mishik OP needs all values though. It's an if/elif for a reason
 
He only needs one for len(g)
 
Cabbage, Banana Morning Folks! :)
 
Cabbage
Potato?
@Haidro, no offence, really. The solution is really beautiful :)
OP seems to be missing a good sense of designing the structure :)
 
Hooray! I answered the 200 thousandth python question!
 
what?
 
7:20 AM
Banana! Have an upvote!
 
@Haidro How do you know? (link?)
 
1
A: position of tags in a html page using python 2.7 with beautifulsoup

HaidroUse .find_previous_sibling: >>> for divtag in div_Blocks: ... print divtag.find_previous_sibling('img') ... <img class="outer" id="first"/> <img class="outer" id="first"/> <img class="outer" id="first"/> <img class="outer" id="second"/> <img class="outer" id="second"/> <img class="outer" id...

 
@InbarRose right above
 
Look: "200000 questions with the tag python"
 
oh. cool :)
 
7:22 AM
How lucky it was a BeautifulSoup question
 
8 more rep till 6k rep :O
Wait nvm, just got it :D
 
wow @Haidro you caught up to me fast. :)
 
Lol so I did
Must just be the school holidays
 
Did you want a downvote to get to exactly 6k? ;)
 
7:24 AM
@Volatility :)
 
Lol
Actually
Yes, so I can get a screenie :)
 
Done ;)
 
lol
 
Not both of you @@@
 
5998 )))))))
MWAHAHA
 
7:26 AM
Wow
 
6002!
 
Got it, thanks
I got it just before it went to 6002
 
banansome
 
@mishik well said,.
 
Melon :)
 
7:29 AM
@Volatility Is it possible to edit your starred comment and add something on how it's the 20000th python question?
 
Oh, when did that get starred?
 
People will see from comments :)
I did :)
 
Nah, too late to edit now :/
 
:(
 
Hello, i am new here. I am working on a project related to python. Can somebody help me out?
 
7:35 AM
@Denzil Welcome! What's the project about?
 
Cabbage! Will be happy to asparagus!
 
@mishik No need to alienate newcomers ;)
 
@Haidro can you suggest some websites ?
 
@Volatility They want to learn python, right?:)
 
@Denzil Lol, I'm not the man for that. Sorry
 
7:39 AM
What's the question? " can you suggest some websites"?
 
Wait, what. did you edit your comment ;3?
 
oh sorry :(
Wait for a while.
 
Lol
 
I have created an ftp server and client program in python. The client can connect to the server when they are in the same network. But i don't know how to do it when the computers are connected to different networks.
 
7:44 AM
If your server does not have real ip address then I'm afraid it's not possible
At least not without extra configuration on gateways
But that's more of a network question for "Server Fault"
 
@InbarRose I got downvoted
Dinner, rbrb
 
@Haidro Sorry to hear - I meant look at my awesome answer :)
 
@mishik Did you downvote? Not going to scream at you or anything :p
 
Quite opposite :)
 
Haidro, I don't think your answer is correct btw.
 
7:59 AM
Let me check
 
looks like the OP has a situation where he gets a list. A list with a length he doesn't know.. and he wants to do X on that list... and get (a, b) from it....
There is no way to create a dictionary ahead of time for that.. since the list will have different values each time.
 
Ah, so shouldn't I just do xrange(2, len(g))?
 
...
 
`len(g)+1
 
:) Yes... but there is much more to do as well.....
 
8:03 AM
Alright, time to do some reading... Rhubarb!
 
"and he wants to do X on that list" I don't see this in the question
@mishik rhubarb!
 
mishik - your answer is also wrong.
g = range(3):
('rea: 400', "ref:  '0': {'sds': 200}, '1': {'sds': 300}, '2': {'sds': 400},")
too many extra spaces, and an extra comma.
also - why do you put extra " around the 'keys'
 
"" - because those were in OP
extra ",", yeah I know
 
Yay enlightened badge
 
8:10 AM
My second one too :)
 
8:21 AM
2
Q: Python string similarity with probability

tenstarHow do i get the probability of a string being similar to another string in python? I want to get a decimal value like: 0.9 #means 90% etc. preferably with standard python and library. e.g. : similar("Apple","Appel") #would have a high prob. similar("Apple","Mango") #would have a lower prob.

Some people are so silly sometimes.
 
heh, "probability"
rbrb dinner
 
rhymes with Volatility
 
:)
The guy who answered... what was he thinking...
def similar(w1, w2):
    w1 = w1 + ' '*(len(w2)-len(w1))
    w2 = w2 + ' '*(len(w1)-len(w2))
    return sum([1 if i==j else 0 for i,j in zip(w1,w2)])/float(len(w1))
What... what.... is that?
It is not even accurate.
...sometimes... I just don't know...
 
8:31 AM
legend?
 
Great guy = legend
Must just be slang here...
 
Okay - I am not asking what it means... I have no idea why you are saying that...
What is legend about him?
 
He says that I am awesome :)
 
oh...
That makes him a legend?
low standards these days...
 
Lol
 
9:05 AM
actually me and my friends call eachother legends alot ahaha
like if we do something crazy
'dude youre a legend'
 
Oh yay 200 rep today :D
 
@Haidro niiice
 
ty
 
@Haidro :)
You realize its the same OP.
 
Wow
 
9:16 AM
@InbarRose Yes
 
sucsessfully implemented A* pathfinding!
 
yay!
 
well my partner did @Dan Doe
 
Ooh, is he the brother of John Doe?
 
ahaha his name is acctually daniel
and his last name is czech so doe is easier
 
9:19 AM
Oh :(
 
ahaha well his name isnt acctually daniel its Zdenek
 
:/
Totally unrelated, then
 
ahah yup
 
0
A: Spell checker speed up

Inbar RoseHere you go.... from operator import itemgetter from difflib import SequenceMatcher class Corrector(object): def __init__(self, possibilities): self.possibilities = possibilities self.sums = sum(self.possibilities.values()) def correct(self, word): corrections ...

@Haidro :)
 
9:26 AM
ha, thanks :)
I was just showing Haidro that :)
 
Ugh, Cabbage is become less and less cabbage-related
 
@InbarRose He accepted your answer too
 
I saw, thanks :)
 
:)
 
9:29 AM
I like answering questions like that.
Where you have to think a little, and come up with a nice algorithm. And you can wrap it in a good robust class/method/function :)
 
OMG I'll show you what I did a few days ago that took me so long to make, but go no attention
0
A: how to make a counter in python

HaidroConsider using threading.Thread: import time import threading class MyTimer(threading.Thread): def __init__(self): self.h = 0 self.m = 0 self.s = 0 def count(self, t, stop_event): while self.s <= 60: print self.h, 'Hours', self.m, 'Minutes', s...

:) thanks.
 
thanks?
 
Someone upvoted
 
oh....
 
9:35 AM
@ChristianCareaga Lol thanks
 
Anyway - what you wrote haidro, its... kind of... very non-robust, and it could most definitely have better solutions.
 
it was a good answer
 
@InbarRose Definitely lmao
OPs question wasn't 100% clear tho
rbrb everyone
 
@Haidro for sure, but still - try to wrap your answers into a function or a class - it helps you as well to answer the question, since things get better perspective when you think "input/output" as opposed to trying to mash it all together with prints.... and also it looks MUCH better as an answer, and it usually forces robustness, which is also usually more elegant. :)
 
10:20 AM
Hello All of you
 
10:30 AM
Hmm, maybe I should answer more often
 
10:50 AM
cbg
 
11:09 AM
cabbage
does anyone know how to bind enter key press event if user is typing in entry field in tkinter
 
 
1 hour later…
12:17 PM
dffffsasaas
 
12:27 PM
@Bhai I am sure it took you a long time to get up the courage to speak, but could you have at least formed actual words?
 
Cabbage
 
I just finished...
The hardest quest on RS...
 
12:42 PM
Congrats?
Did it involve brassica prime?
 
Nah, Brassica Prime hasn't been in-game since 2009
 
12:57 PM
Indeed - our lord no doubt has better things to do by Cabbage! :-D
 
:D
 
1:27 PM
cabbage!
@Haidro i did miss 200k :(:(
 
For Haidro incase he hasn't seen this already ;-)
 
I was so tired, even my 200kCatcher was ringing, I stopped it and go back to bed ;)
@JonClements I was wondering, what are the chances to create the new IDLE2? My editor is nearly in early-alpha stage, so I'm going to put that on GitHub to work on it together -- for example with the sopython community.. and after we "finished" we can commit it to the standard lib.. hmm? What do you think?
 
@JonClements DAFUQ
Sorry, artichoke*
 
@petervaro it's been part of python for ages... people have suggested alternatives to tkinter for years but without luck
The "standard" is very slow to change
 
@PeterVaro Getting something into the stdlib is not something that happens quickly.
 
1:41 PM
@JonClements but I'm suggesting tkinter also! My editor uses only modules in the standard lib, and using only basic tkinter
 
It's a place libraries go to die.
See requests - we all know it'll end up in the stdlib at some point, but it's not happening fast.
 
oh... :(
 
Is this video about "how this channel became all about salad"?
 
Before something goes into the stdlib, it has to be rock solid, and it's unlikely to ever change (significantly) again.
 
hm..
I completely understand it has to be solid.. but never change..?
 
1:44 PM
The history of sqlite and bsddb kinda show how bad it is in that regard
 
The stdlib can't have breaking changes, for obvious reasons, and Python has a very slow release cycle.
so updating a library in the stdlib isn't a simple task
 
Moratoriums on releases - solid unit and regression tests that guarentee Pythons support for major releases etc...
 
so that's the reason why the current IDLE is sooooo lame
 
(slow compared to a normal library, that is.)
 
Cross platform stuff etc... etc...
 
1:46 PM
Yeah, I'd argue editors are just not suited to the stdlib
it's not the right place for them
 
A solid api
 
the same thing for GUI toolkits, to be honest.
 
I think IDLE was a "mistake" in the sense Python should have some gui editor available if none other was available
 
i c
 
Now if Carlsberg did GUIs ;-)
 
1:48 PM
well, thanks.. those are not good news, but somehow understandable facts..
 
Better than getting your hopes up
 
absolutely! that's why I said THANKS:):)
 
Launch it as an open source product and it gets used a lot - you're still helping a lot of people!
 
Make your own stdlib, with blackjack and hookers.
 
@JonClements will do that!
 
1:51 PM
Plus you might get a few people thinking it's fantastic and wanting to make pull requests and stuff
Going to keep an eye on this Tim Odell - be interesting to see how he does for future albums
One you might even like @petervaro open.spotify.com/track/5FKnuwsKf7YFpmhA5Wnl0q
 
thanks, check this later -- I'm currently listening something..
 
Wow. That sucks
Just lost 20 rep from a question deleted, I wish I could check what it was
 
00:00 - 14:0014:00 - 21:00

« first day (988 days earlier)      last day (3966 days later) »