« first day (2091 days earlier)      last day (2857 days later) » 

2:08 AM
        if msg_info[0].lower() == "command":
            msg_info = msg_info[1].strip().split(" ")
            header = msg_info[0].lower()
            if len(msg_info) == 2: #two word commands
                if header == "nick":
                        nick = msg_info[1]
                        NickServ.nick_change(self,nick)
                elif header == "join":
                        room_name = msg_info[1]
                        RoomServ.join_user(self,room_name)
                elif header == "leave":
is using too many conditionals bad habit
 
 
1 hour later…
3:35 AM
@MarkoMackic it can be if a decision/expression tree or dict would be a better option
This answer is a good example of using a dictionary as it shows how to set a default behavior (using dict and get or single if/else) and shows how to split any repeated code to a separate function which is called through dict
Though I would look at hardmooth's comment if you decide on a default (maybe > 2) behavior - i.e. use try/except over if/else
 
 
2 hours later…
5:55 AM
cbg
 
So Im having a problem with a module in wx called calendar, it's not working on my windows install for some reason...
No module named 'wx.calendar'
I reinstalled and tried a different version to no avail
 
6:58 AM
@Withnail relevant to your interests? :P bbc.co.uk/news/world-us-canada-36730174 (cc. @DSM @idjaw)
 
How to get data from the Google Sheet based on time-stamp range?
E.g What if I want to get the data from Google Sheet added on specific date or time ?

is there any way to filter out this data in GET method?
 
@Jd16 hello. Please think about your question for a minute. Think about what information you have access to, and what information we have. We know nothing apart from what you've just asked in your question.
We have no idea what you're doing.
You've just asked a broad and unclear question that no one could answer.
 
7:13 AM
Okay Sorry
let me reframe it
I know how to get data from google sheet with help of a python package. I use gspread package for that. What I want is, I want to get data from the google sheet based on the date range or time range I specify. For Example : if I pass get(google sheet, "22/1/2016") then it should return me the rows which are entered in that "google sheet" on date : "22/1/2016"
is this possible ?
 
No, you'll have to get the data back and then filter what you want to exclude.
You could use finding possibly github.com/burnash/gspread#finding-a-cell
 
So it is not possible to filter out data based on date and time when we get data from google sheet. Right ?
 
I don't know, I've never used the library, have you read the docs?
 
Yes I read it. We can filter out the with Range of Values in the sheet. like
 
I think you should ask a question on the main site, where you can explain your issues in detail and show what code you have so far.
 
7:27 AM
okay
 
As it's really unclear what you want right now.
@ADG please see sopython.com/chatroom
In particular, please don't post large chunks of code.
Instead, use pastebin or some alternative.
 
ADG
ok
 
And you're asking us to compare <SOME LANGUAGE> and Python, no idea what the first one is.
 
ADG
java: dpaste.de/oJnw and python: dpaste.de/BWLp
though it's pretty understandable
 
For you, maybe, not necessarily for others.
 
ADG
7:31 AM
because i think i am doing something wrong in python
 
Well your Python code is bad.
 
And as it stands, won't work
 
ADG
i switched from java
java code "accepted solution" and python "wrong answer at test 4" :(
i'm trying to learn this great langauge
 
I'd suggest you go through some tutorials then.
All you've done is write Java code in Python.
 
ADG
7:33 AM
im doing delve into python 3
no i first did in python submitted 8-9 times wondering what was wrong and got accepted the first time in java
 
One suggestion: Never use is operator to compare two objects in Python.
is operator is to check if both the objects are the same.
Use == to compare.
 
ADG
i think it wass python coding practice/ pythonic way of comparing
 
@ADG that's not what I meant. All you've done is taken what would be Java code (using Java styles and techniques) and written it in Python.
 
Hey up, Fizzy. And cabbage to the salad people. :)
 
You've not used any of the things that makes Python Python.
 
ADG
7:35 AM
i dont get to see python tricks or something else other than advanced coders solutions
all i see mostly is basic python syntax
 
Also, exit and return are not the same. exit makes the program terminate.
 
You've also not imported exit
 
@thefourtheye I know what you mean, but it'd be less confusing to say something like "the is operator checks if two names both refer to the same object".
 
cabbage
 
@PM2Ring I agree. Your way is better :)
Cabbage @BhargavRao :)
 
7:39 AM
cbg \o
 
What happened to your left hand? :O
 
Oh, it's there, \o/
 
ADG
changing to '==' worked
dont know why but both sides had integers
 
@BhargavRao Jaya \o/
 
ADG
this makes me feel less trusty of python or my skills in python
 
7:41 AM
You should continue with your Python tutorials, and should concentrate on how people write idiomatic Python code.
 
@PM2Ring Jaya is victory, So isn't it \/ ... So confusing!
 
What you basically wrote there was Java code, it was just written in Python.
 
Ya, it looked basically like translating word by word from one language to another :)
 
@ADG Take a look at this:
>>> a,b=1000,2000;c=a+a;c==b,c is b,id(c),id(b)
(True, False, 3072615712, 3072615792)
 
ADG
oh
but why?
does it compare the hascode with is?
 
7:45 AM
@BhargavRao I'm sure you've seen people with both arms in the air saying "jaya!" :)
 
Wait, what, what device?
 
Cabbage!
 
@ADG No, it tests if b and c are both references to the same object. In CPython (standard Python), it does that by comparing their addresses in RAM, which is what the id function returns in CPython.
 
cabbage all!
 
ADG
my coding style can be reflected by the fact the percentage of java files at github.com/adityagupta1089/Codeforces-Solutions
@PM2Ring In java I think that most objects are compared by their hashcode which is somewhat like id, so what I told. Thanks for the help
 
7:49 AM
@ADG In Python, two different objects can have the same hash.
 
ADG
Oh.
 
>>> a='my string';b='my'+' string';a is b,id(a),id(b),hash(a),hash(b)
(False, 3072113744, 3072113664, 1124306912, 1124306912)
OTOH
>>> a='my string';b='my string';a is b,id(a),id(b),hash(a),hash(b)
(True, 3072113784, 3072113784, 1124306912, 1124306912)
In the 2nd example, Python is smart enough to realize that it can re-use the existing 'my string' so it just binds the name b to the same string object that it bound a to.
You may find this article helpful: Facts and myths about Python names and values, which was written by SO veteran Ned Batchelder.
 
8:05 AM
Classic example of completely forgetting to include relevant context in a question:
@MartijnPieters Currently i havent connected anything to device. i expected to read all zero. WIth wired connection i could able to read Zero values. I have attached image of wire output file here — Ajit 29 mins ago
(and sorry for the long delay between posts, train network problems, last comment made it in first).
 
@MartijnPieters It must be contagious: your previous chat post was rather bewildering without this context. :)
 
@PM2Ring :-P
 
8:22 AM
From the HNQ a little while ago, a collision of rocket scientists: "How does a spacecraft know that it is in orbit?"
I had to down vote this answer. This is what the mission controllers on Earth used. It says nothing about what Juno used, and hence it does not answer the question. (Why so many upvotes?) Sorry, Mark. — David Hammen 9 hours ago
 
@PM2Ring Looks like you are stalking following Mark Adler ;)
I am the reference, having been part of all of that. This post could be cited in Wikipedia as an original source. — Mark Adler Oct 16 '15 at 16:38
This perhaps is one of the best comments you'll ever read on Stack Overflow!
 
@BhargavRao :) Well, it's not surprising to bump into Mark on space.SE.
David Hammen does seem to know his stuff, but my money's on Mark
 
Yep, I guess Mark will soon edit the answer to address Hammen's concerns.
 
It may be that Hammen is correct and that Mark's answer is based entirely on previous space mission experience, not on actual factual knowledge of how the Juno mission does this. I stands to reason that that wheel was not re-invented, of course.
 
8:38 AM
@MartijnPieters Sure. But maybe Mark has relevant inside knowledge that he can't be too explicit about.
 
happily breaking a NDA ;-)
 
@JonClements cabbage \o
 
@Ffisegydd: Yannis does have an excellent point. In the Teachers Lounge, anyone using the SO mods group will get their head bitten off. ;-) The retort to his comment is: but your TL groups are not run by the users themselves; SO mods can't unsubscribe from that group.
 
Is this comment ok?
@CopyandPaste It's unclear what specific problem the OP has and why they can't just do something like what you did in your answer. — PM 2Ring 7 hours ago
 
8:43 AM
Yep.
That comment below the answer though :D
 
@MartijnPieters I'll just nod sagely and pretend I know what that's about :)
 
@JonClements see the top-starred and pinned message ;-)
@JonClements then follow the comments there!
 
Rightio :0
 
> And yes, it can - and often is - abused.
 
@BhargavRao Cruel, but fair. :)
 
8:45 AM
@PM2Ring Yup, It was directed at the answer's first revision.
 
@BhargavRao if you ever get elected as a moderator on any of the SE sites, try it out. Use stackoverflow mods: <message here> and see how quickly your head is bitten off ;-)
 
@MartijnPieters I need to become a mod, atleast for doing that!
 
@MartijnPieters So you broadly agree with Fizzy's proposal? I reckon it could be good, as long as it's fairly easy to add & remove yourself from groups.
 
@MartijnPieters I always find it funny it's not the SO mods that are overly worried about it... it's everyone else going "what did you just do!" :p
 
“Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it saying 'End-of-the-World Switch. PLEASE DO NOT TOUCH', the paint wouldn't even have time to dry.” ― Terry Pratchett, Thief of Time
3
 
8:58 AM
@JonClements we have merely taught the rest of the room well.
Why get hot and bothered when you can get everyone else to do it for you? :-D
@PM2Ring I don't know, I'm ambivalent about the proposal, really. But Yannis' objection doesn't quite apply, that's all. :-)
 
@MartijnPieters Is that another way of saying "Why have a dog if you're going to bark yourself?" :p
 
cabbage
 
@JonClements yup.
 
Wow - haven't heard youtube.com/watch?v=oOg5VxrRTi0 in a while :)
i am a penguin, i am a rock star i rule the world - one of the better bits of garbage I've seen recently :p
 
9:12 AM
Mornin' all
 
Morning Prof
 
How are you, @Bhargav?
 
Doing quite well, ty! What about you?
 
Not too bad - a bit busy, but just waiting for some data to download so popped in here
 
Replace "compiling" with "Downloading" here xkcd.com/303
 
9:21 AM
heya @JonClements! :)
 
@PaoloCasciello wow - blast from the past - how goes it? :p
 
@JonClements yeah. :/ i was (and i'm still) very busy. how's going?
 
Always the same old - good to see you about again though :)
 
i promised myself to find the time to come back here. :)
 
A wise choice even if I say so myself :)
 
10:09 AM
@BhargavRao running tests
... I should feel bad about myself
 
10:34 AM
morning cabbage.
 
@khajvah Yep, That's another reason for slacking!
@Withnail cbg
 
10:52 AM
@BhargavRao Or npm installing
 
So there's a lot of reasons to slack from work!
 
my current 'off to xkcd' reason is 'building gradle files/apk' in android :)
it takes an annoyingly long time even for my simple projects.
 
Can i use APIView in Django rest with only "POST" method
 
sopython.com/chatroom Probably worth reading the rules, saying hi, generally being polite before you launch into a question.
 
ok
hi bro
 
10:59 AM
Are you using the DRF APiView decorator?
 
not decorator i am using APIView class based view
I have written a view with only post method. but when i post something to view, it gives error method "GET" not allowed
i am using Postman tool to post values to view
 
Hm, interesting. If it's a correct POST request, the dispatch method should automatically route it to the .post() method.
(The last two mornings I've loaded chat to be greeted by notifications from Fizz, I feel loved. :P )
 
is there anythin wrong. nb:my indentation is correct in original code
 
i'd delete that and use pastebin
 
Seconded. If you'd read the room rules as Withnail asked, you'd have known that.
 
Damn, I can't find the image that said "move code to pastebin" within time.
 
is there anything wrong in that view
code in pastebin link
when i try to post value of id to that view via postman method, its giving error "method GET not allowed"
when i pass value as json via browsable api, it gives same error
 
Broadly looks ok. I'd still hazard the request isn't right. Trailing slashes in urls.py problems, all that stuff. Probably stick a question on the main site.
 
I am going to post a question in main site. But just curios. If i give a dummy get method in the same class, then get method gets called when i post as well as try to get that url
 
@sudheeshks Protip, when you post the question on the main site. Don't link it here.
 
11:21 AM
i have not posted yet in main site
 
That's what makes me think either the request is wrongly headered, or the dispatch method's been overwritten somewhere.
 
@sudheeshks also post your urls.py with the question
 
cbg \o
 
morning
 
11:38 AM
cbg o/
 
yay my distributed architecture werks
 
Gmail flaking out again, gnngh.
 
I am so skilled at finding bugs just because I am a terrible programmer.
 
I want that on a tshirt. :D
 
12:00 PM
I must be missing something obvious. But when I print the answers generated by the extra_questions they are not kept in the same order. With 3 questions it's printing 1,3,2
 
dat >80 char line
 
I'll gladly pep 8 my code when i can get it working
 
pep8 is not about prettiness, it can help you too
of course if it fits in your screen...
 
pep8 is love, pep8 is life
 
12:07 PM
Though, any inklings as to why the order is getting scrambled?
 
user559633
oooh scrambled eggs. that's a good brekkies idea
 
mmmm, scrambled eggs
 
rhubarb, will bbl.
 
@clickhere presumably because they're not in your database in an ordered fashion
 
@WayneWerner, I have ordered them in my database. They also render in my template in the correct numerical order. But when the view gets back the post data, the answers given don't coorelate with the order I gave them in the form
 
12:11 PM
Are you doing multiple form elements with one name?
 
Then why does order matter? They have a name, right?
 
user559633
Does your templating or form handler return the form elements as a dict?
 
self.fields['custom_%s' % i]
"yup"
(which should then make the answer to the problem obvious, if you understand that dictionaries/sets(?) are unordered collections)
 
ah, from the docs form.cleaned_data is a dictionary
 
user559633
12:14 PM
:)
 
yay, I can work with this.. i think
i have order!
thanks guys!
 
stackoverflow.com/jobs/118252/… Wow... 1-2k salary? Not sure if that's monthly or yearly...
but hey, they provide "equity"!
 
@WayneWerner lol
 
That's a really weird problem to have
 
okay, I don't know how to uninstall stuff I just installed...can anyone help...?
I've installed this library: github.com/trevp/tlslite
as per instructions in their readme: python setup.py install
unfortunately that script doesn't have an uninstall command...
 
12:29 PM
454
Q: python setup.py uninstall

flybywireI have installed a python package with python setup.py install. How do I uninstall it?

but the accepted answer is no good
 
I even tried the pip alternative...but after a pip uninstall I drop into the intrepreter and import that particular lib, it doesn't throw an exception...
 
@deostroll did you use a virtualenv?
 
not virtualenv...but a docker container
 
you can remove the files manually
 
yes the same problem persists even inspite of manual removal of files
 
12:36 PM
this doesn't sound like a pip or package issue
 
Grrr. I just spent 30 minutes or so stuffing around with a Hindi Unicode question, and the OP couldn't even be bothered confirming that he's using Python 2. stackoverflow.com/q/38242942/4014959
But then I spent <5 minutes doing a quick groupby question, and got an upvote within a minute of posting. :) stackoverflow.com/q/38245082/4014959
Ah. The Unicode guy literally just responded...
 
okay, even after a apt-get remove python in a docker container...python still works in the shell?
 
@deostroll Can you not just re-build your image and build a new container?
 
destroy your docker container and start a new one up. I'm assuming that you have relevant images sans that library. If not, now is a good time to learn about responsible image creation ;)
also, you could run what, docker diff?
 
9
A: How does one remove applications installed through "python setup.py install"?

desguaMartin v. Löwis answered this here: "You need to remove all files manually, and also undo any other stuff that installation did manually. If you don't know the list of all files, you can reinstall it with the --record option, and take a look at the list this produces." examples: python setup....

 
12:42 PM
then just remove the files that were changed by the tlslite
 
Amazing what you can find when you Google.
 
I know I usually am ;)
(amazed, that is. By what I find when Googling, that is.)
 
@deostroll this is a docker issue then
 
It's probably not docker that's the problem - just how Python is installed in the container. At least I certainly hope that's the problem.
 
I'd hazard a guess that OP is using a docker image that installs a version of python specifically.
All apt-get remove will do is remove the system version, and probably completely wreck your container.
 
12:45 PM
Now the Unicode guy wants to ask me natural language processing stuff, which is not my domain. I know that some of you guys do that stuff, but I can't invite him here since he's a 1-rep HV new user.
 
Nice.
 
upvote his question/answer? :P
 
That's a super intense question, that's a complicated enough domain in ascii alphabets. :)
 
@WayneWerner Maybe. Let's see if he gives me an accept first... :)
 
TIL...
import unicodedata
print(unicodedata.name('💩'))
 
12:50 PM
I still wonder why pile-of-poo on some systems has eyes and a grin...
 
The designers were watching Bob Ross?

"Let's make this a *happy* poo"
 
Howdy Ho!
 
Literally a happy little accident? :)
 
lol
 
trolol. Nice.
 
12:56 PM
morning everyone
 
My wife was told somewhere that it was supposed to be chocolate. Though the unicode name seems to belie that explanation.
 
eh, not a question for this group...but what happens to those one-off docker containers?
 
morning cabbage, @corvid
@deostroll when they're destroyed they go to Docker heaven. It's pretty crowded up there. But that's OK, containers stack really neatly.
 
They go to a nice Docker farm somewhere in the country, where they can play outside all day
 
@WayneWerner unicodedata can be fun stackoverflow.com/a/37530609/4014959 And Unidecode is pretty damn awesome when you need to manhandle Unicode.
 
12:59 PM
Morning cabbage.
 
Hi, corvid. Hi, Dennis.
 
exactly when do they go to heaven... :) ?
 
hate these annoying hangover days
 
@deostroll They sit there and decay, getting slowly more depressed at their decrepitude, wishing that someone would relieve them of their pain.
 
@Ffisegydd Like Meeksees?
 
1:09 PM
Hey @MorganThrapp I think you might enjoy this soul duet. Rachelle Ferrell & Will Downing: Nothing Has Ever Felt Like This
 
You just know that CRIMSON acronym's been worked out after the fact because it's to do with blood and someone thought it was funny: stackoverflow.com/jobs/116111/…
 
@PM2Ring Yeah, it's interesting. It's a little, I'm not sure what to call it, lounge? for my taste, but it's definitely interesting.
 
Guys I wanna go to Australia
 
I can get you free transport to Oz. 1) Build a time machine. 2) Go back to Victorian England. 3) Steal some bread. 4) $$$AUD profit!
 
@MorganThrapp It get's quite funky towards the end.
@corvid I'm sure you'd love it here.
 
1:14 PM
Because of their glorious accents
 
@PM2Ring unidecode looks pretty nice
 
@WayneWerner I learned about it via one of Martijn's answers.
 
@PM2Ring Oooo, you're right. Yeah, the end there I really like.
 
@Withnail Make sure you don't accidentally go to France. Then you'll end out in a musical.
 
Snort.
"Do you hear the people sing..."
"GIVE ME THE GUILLOTINE, PLEASE!"
 
1:19 PM
Oh. Wat. Don't be knocking Les Mis.
 
Scarred by having had to sing it in school.
 
I <3 Les Mis. But WTF Russel Crowe?
 
OH. WAT. Russell Crowe was not that bad.
He wasn't the best, but he wasn't as bad as a lot of people make out.
He gave it a bloody good go, British (or Australian) spirit and all that.
 
Lés Mis - where we learned that Wolverine can really sing, and Russel Crowe can't.
I suspect he can sing, but Javert was waaaaaay the wrong range for him
 
@MorganThrapp Here's an up-tempo straight-ahead jazz number from Rachelle. I might've posted this one before, but it's so good it deserves repeating. :) Don't Waste Your Time
 
1:21 PM
Sounded like he was trying to make a happy 💩 whenever he was singing
 
FWIW, Russell Crowe has a rural property not far from here.
 
@PM2Ring inherited from his uncle?
 
@PM2Ring Yeah, that's much more my speed.
 
@WayneWerner indeed, he was by far the weakest singer
 
1:25 PM
He was the weakest singer, definitely, but he wasn't as bad as people said.
 
well, it is a musical, not a singing competition
 
stackoverflow.com/questions/38245499/… Unclear, Give me teh codez, just nuke it.
 
@PM2Ring I was referring to the movie "a good year"
:)
 
@khajvah Ah, ok. I haven't seen all of his movies.
 
1:31 PM
youtube.com/watch?v=-i0InwW0V9k Youtube recommended this after that Rachelle video. Not really related? But pretty awesome
@MorganThrapp wow, 17 downvotes on that question. Harsh.
 
@WayneWerner Yeah, that's one of the most heavily downvoted questions I've ever seen.
I mean, it's remarkably bad, but not THAT much worse than other terrible give me teh codez questions.
 
I think the answers deserve more downvoting than the question
 
How did it get an upvote though? Who looked at that and said "Yeah, that's a good question that shows research effort"?
I agree. That's why I downvoted all the answers.
 
IKR?
Probably one of the answerers, I'm sure
 
That would make sense.
 
1:36 PM
typo stackoverflow.com/questions/38246485/… just have their own datetime.py file, whoops
I believe it was either the random or time module that bit me
or more accurately, shadowing said modules
 
@WayneWerner Yeah, that "untethered" yo-yo work is pretty impressive.
@MorganThrapp I just voted to dupe close it to idjaw's canonical. But I'm tempted to downvote for those giant images of text...
 
@PM2Ring Yeah, it's pretty bad.
 
hamma
 
Thanks, Fizzy!
 
1:48 PM
\o/ Hammertime!
 
Yay! Op deleted screenshots in response to my comment.
 
There are two kinds of people in this world, those that post screenshots of text, and those who understand accessibility.
 
@WayneWerner And the nth type who something something repeated jokes about base confusion.
 

« first day (2091 days earlier)      last day (2857 days later) »