« first day (1570 days earlier)      last day (3382 days later) » 

12:06 AM
That is a bizarre and very wrong way to check for int and long.
@shuttle87 use isinstance(index, int)
 
ok will do
I was a bit confused by this line of code
was this a good way to do things in a really old python version?
 
no, that was always a terrible idea
 
ok
 
user559633
 
the odd thing is that the rest of the code uses isinstance
I found another piece in the code where something similar was written this time with a comment "uses fast path for int and long", is this a pypy specific thing?
 
12:14 AM
well, maybe they had a reason, but I can't see it
if you're really concerned, try profiling before and after the change
but I'd just go with isintance, it sounds like they were prematurely optimizing
 
oh ok
 
12:49 AM
Hi I posted a question and edited the status of this this week and still have not answer. Can I post the question here?. Maybe someone can help me...
 
sure, post a link
 
0
Q: UndefinedMetricWarning in classification report with scikit-learn?

john doeI have a text classification task with 5 categories the problem is that I am getting bad precision and this warning, probably as a result from unbalaced data(Im not sure): /usr/local/lib/python2.7/site-packages/sklearn/metrics/metrics.py:1771: UndefinedMetricWarning: Precision is ill-defined and...

 
 
2 hours later…
2:53 AM
What does cleaning data in django do?
 
what command is that?
 
self.cleaned_data?
like with a form you can do something like username = self.cleaned_data.get("username")
 
that's to distinguish it from the raw data before it's been processed and validated by the form
 
so is that just for like security reasons?
 
no, what gave you that impression?
it's just the data after it's been processed
 
3:03 AM
because you clean the data before you process it for errors
like if I want to raise a validation error I clean the data first
so does cleaning the data convert it to unicode? I'm still confused on what it does
 
I'm confused by what you're confused about. cleaned_data is the result of the form handling the request data
It's just a name, don't read into it.
 
but I don't have to clean it
I had a form where I didn't clean it and it works, I want to know the benefit of cleaning it
can anyone tell me why this won't raise validation errors pastebin.com/QrvcFs9v
 
change the elifs to separate ifs
the data before cleaning has not been run through the validation processing, so there's no guarantee that it's correct
 
what do you mean through the validation process?
In my views I use form.is_valid()
and then grab the cleaned data again
changing them to if statements didn't raise validation errors.
 
what do you think the method clean_password1 is doing? It's validating or formatting data
 
3:15 AM
I think it's formatting data
 
have you actually read the docs?
these are really basic questions
 
yes, but I couldn't find much on cleaning data
there was a lot of confusing stuff
 
I don't think I can help then, I'm not getting through here
 
can you help at least fix my validation errors they aren't appearing
 
rename the method to clean, then go read the docs
 
3:17 AM
I have a login form that works with clean_username and clean_password method..
 
yeah, because those are the name of fields, there is no passwords field on that form
now please, I'm serious, all this is answered in the docs
 
can you link me to which doc because I couldn't find one that had stuff about cleaned data
 
Listen, there's no polite way to say this, but if you can't search for the phrase "cleaned_data" on the django docs site, there are bigger problems: docs.djangoproject.com/en/1.7/ref/forms/validation
 
I fixed my problem by just renaming clean_passwords to clean_password2
 
yes, that will work too, because password2 is the name of a field on the form
 
3:28 AM
if I make it just clean I get "string indices must be integers"
 
go read the docs please
 
and I don't know what that means
 
4:03 AM
cabbage
 
cbg
 
brief cbg
 
@davidism (looks at older posts) Looks like you have been having some fun sarcasm
 
cbg @Jon
 
cabbage
 
4:11 AM
1 message moved to Trash
please read sopython.com/chatroom before continuing
 
I have been using pygame for a while, but lately it has been more trouble than its worth. Being rather cpu intensive and failing to install/behave properly on my Mac. Any suggestions? I just need to display blocks and lines, but a background image with simple camera control would be great.
There is pyqt and kivy...
 
pyglet, but install it from source, the beta release is very outdated
 
@davidism I'll try it, thanks
 
4:40 AM
Isn't this too broad?
 
5:29 AM
Cbg
 
 
1 hour later…
6:31 AM
i guess ill ask this here so i dont get banned,
would anyone know of a good way to pad a string with zero easyly. but not just a group of zeros bytes at the front of the file but zero bytes in between each character of the string.
this-
"30 2A 32 2C 31 2A 32 2C 32"
to this-
"30 00 2A 00 32 00 2C 00 31 00 2A 00 32 00 2C 00 32"
 
>>> s='abcde'; '\0'.join(s)
'a\x00b\x00c\x00d\x00e'
 
hmm ok thanks ill give that a try.
 
in your example " 00 ".join(s.split())
 
@JoranBeasley Fair call; I assumed the given example is in hex, since Death_Dealer mentioned "zero bytes".
 
yes the string i working with is hexlifyed.
 
6:47 AM
So if your string is literally 30 2A 32 2C 31 2A 32 2C 32 then use Joran's solution. But if it's \x30\x2a\x32\x2c\x31\x2a\x32\x2c\x32 == 0*2,1*2,2 then use my solution.
 
i used your solution PM 2Ring, thanks.
i knew there would be a ore elegant way to handle that it works great.
 
Cool. I'm glad I guessed right. :)
Maybe I should've just written my own answer instead of trying to improve this answer via comments. Oh well.
 
7:45 AM
1712
>>> sum(map(ord,'hello every body :)'))
1712
 
@Kasra I hear it was a good year? :p
 
@JonClements yep :D
 
I'll see your 1712, and give you 300
>>> sum(bytearray('cbg'))
300
 
@JonClements I am, yeah ;)
 
@JonClements so i couldn't figure it out ? ;)
 
7:49 AM
for two more days actually => going back home on wednesday
cbg(all) # btw
 
@Peter where about in our glorious city are you?
 
that's a very good question sir -- not so sure, give me a sec ;)
@JonClements here
 
My knowledge of London is beyond minimal.
 
so is mine :)
 
Ahh... okay... haven't been in that area for a while... I know central and northern London most
 
8:04 AM
umm.. well, how 'bout tomorrow afternoon?
and I can be almost anywhere
although I only have an offline map, since I only have roaming
but I guess it could work :P
 
Umm... we'll see how today goes - I'm actually 4 days late on a project delivery - not sure I've got time to take a day off.... as much as I'd love to
 
all righty then -- to be honest, I'm quite sure this was not the only time I visited my brother..
although the first time in 2 years since he lives here..
:P
 
You got an all zones travelcard for while you're there?
 
yepp, for 5 days period I guess
 
there's a brilliant gourmet steak/burger restaurant in Camden next to the lochs... that's worth checking out
 
I was at Camden the day before yesterday
:P
 
You're getting around then :p
 
If something had been organised, I could have come for during a weekend possibly.
Hopefully next time.
 
...next time in budapest :)
 
well... I was going to say sopycon London Summer 2015... but I think you wanted to host the first one at your place :p
@Peter well I'd love to visit Budapest... :p
 
8:16 AM
you are all very welcome here (there), you know that :)
 
Also be nice to meet Coltrane in person :)
 
8:34 AM
ahh.. I miss him so much here :P
he is at a dog-hotel now..
(I bet he is having a fun time tough)
 
re-re-cbg
 
heya @AnttiHaapala
 
heya, whatsthat
 
@Peter in your absence, at the bar, trying to pull some tomatoes...? :p
 
:D
@AnttiHaapala what's what? "heya"?
=> hey you
anyway, it's time to get back into the city.. so.. bbl folks
rhubarb(all)
 
8:41 AM
Cabbage!
 
my knowledge of London is that it is damned expensive, a 4 star hotel at Kensington is the worst hotel I have stayed at in anywhere in Europe, it is almost easier to find a 3G/4G prepaid simcard with unlimited net than to find a free WIFI, which itself is impossible, and decent food is at restaurants with French name. But sightseeing is nice and ...
@PeterVaro did you go already?
 
cbg @poke!
 
user3522371
Is it bad to install Python 32 bits on a 64 bits processor and use lot of other Python libraries within it ?
 
No
 
user3522371
@poke so I can use Numpy, Python and openCV in their 32 bits version on my computer of 64 bits processor without getting problems when I program with them later ?
 
8:51 AM
Yeah, most of your programs likely run at 32bit.
 
You can get 64 bit libraries for all of those I'm pretty sure.
As we told you last time you came in
 
@Ffisegydd my linux box is 64bit for those, and I'm fairly sure my windows partition has 64bit as well
 
I see you didn't listen to anything we said
 
I remember faffing around because I'd somehow installed 32bit Python and couldn't work out why numpy/scipy/pandas were getting the strop
 
user3522371
@Ffisegydd I searched all this weekend about 64 bits Numpy to install it and i did not find.
 
8:57 AM
We. Linked. You. To. The. Exact. Page. IT'S RIGHT NEXT TO 32BIT! breathe
 
user3522371
@Ffisegydd how to install whl file in windows ? (for Numpy reasons)
 
I am stood waiting for a bus. I do not have a computer or the inclination to help you more than I tried to last time you were in.
 
user3522371
@JonClements Do you mean you installed in the past Numpy 32 bits on your 64 bits processor and you got few troubles while programming ?
 
Nope - what I mean, was strangely what I wrote
I feel strangely reminded of this David Mitchell rant
 
user3522371
@JonClements Please answer me: if I install Python, Numpy and OpenCV in their 32 bits version on my computer of 64 bits processor: will I have programming troubles in the future related to these 32 bits versions ?
 
9:05 AM
He doesn't have to answer you at all
 
@Begueradj please read what people write - poke's already answered you and I'm busy... try and show some attention and patience
 
We're volunteers here, and you're abusing our politeness.
 
user3522371
@Ffisegydd I said Please answer me. I think this is polite. I did not shoot any person with a gun. I myself answered to questions of people on stackoverflow
 
:D
 
*closing 120 tabs…*
 
9:09 AM
In general you're abusing our politeness. Your question has been answered, repeatedly, and yet you still dog people.
 
cbg all
 
Cbg
 
@JonClements bananas!
 
9:49 AM
re-cbg
 
Cabbage!
 
coleslaw (cabbage, but somewhat oily and a little tart)
 
Stupid chat.
 
I just said this in response to a comment encouraging use of Python 2 input(). I linked to Ned Batchelder's Eval Is Dangerous, but is there a canonical SO answer I can link to? I see there's sopython.com/canon/27/… but it doesn't really go into the dangers of eval().
 
10:31 AM
Cbg
 
Cbg old bean.
 
@PM2Ring It would appear bad use of eval translates to other domains as well. For example, eval(parse()) is frowned upon in R. stackoverflow.com/questions/11025031/…
 
@JonClements That’s a question. :P
 
10:35 AM
ooops
 
well the NAA's obvious anyway
 
Love that question… “I DON'T WANT ANY PYTHON CODE” – 6 minutes later – “i have written my own little function, i couldn't wait.”
 
Sure; evalof unsanitized strings is dangerous in any language (and its often slow since it requires the invocation of a new command interpreter). But it'd be nice to have a Python-specific answer for the newbies who might get confused if we link to them an answer that focuses on another language.
 
Okay... so I post a delv-pls for an answer, quoting the link to the question, and @BhargavRao posts a cv-pls to the answer.... good job us cough
 
10:37 AM
evil twins for evil posts
 
@JonClements Oh, pity. I wanted to put as a reason to close "HE DOES NOT WANT ANY PYTHON CODE" :-D.
 
If you want to look at it from a glass half full perspective, consider that you've supplied the edit audit mechanism will loads of new content. :) — Jeeped 20 hours ago
hah! In reply to davidism's little edit-adventure.
 
I've put a delete vote on the question as well - there's already loads of dupes for that, and that Q is just a mess
 
@poke Ta. I saw that one, but thought it was a bit ambivalent; newbies need to know that they don't yet know Python well enough to use eval()safely.
 
@Fenikso haha
 
10:39 AM
@Ffisegydd that's one way of looking at it :p
 
@PM2Ring You can’t use eval safely… ;P
 
@poke Well you can if the string is safe, but if you know it's safe, there's probably a better way to do it than using eval. :)
 
Surely you can? As long as the program has no user input then eval could be used safely (though it would still suggest that the author needs to re-write their logic).
 
@AndriniainaAndyNkiliMeyong so that you loose 20 reps for the above lol . Voted for delete . lol :-) — Avinash Raj 2 mins ago
Perfect reply
 
10:43 AM
cbg
 
And it be deleted
 
Eg, this is a totally pointless but safe use of eval:
>>> s='2+3';c=eval(s);print c
    5
 
Umm... apparently Raspberry Pi 2 is available...
 
@Jerry cbg
@JonClements oh my goodness. I hope it's a totally different shape so I can buy all new accessories
I mean...HAVE TO buy all new accessories
 
Ironically, I'm tempted to advise this person to use exec to parse that JSONP; it also needs regex substitution to fix the keys.
 
I don't know why people bother doing that... although, I guess if they're smoking weed, it makes sense to them or something :p
 
@JonClements I thought it was an audit
 
@BhargavRao umm... that might well end up being a dupe of "asking user for input until they give a valid response" or something... at least, I imagine that's what'll it end up being (if ever clarified)
I use to go to school with a James Waddington...
 
Where did ya read that?
 
10:53 AM
I use to go to school with a James Waddington...
 
Oh one of the commenters - their name
 
It's annoying when people answer homework questions.
 
Naw, better leave HW to users with rep<500
 
Well, if the OPs got code and a specific error - I don't mind at all.... it's just when it's "gimme teh codez - I no how use Goggle!"
 
@JonClements yeah if it fits the normal rules it's fine, but say in that one the OP said it was homework, and didn't provide any evidence of her having tried anything
 
10:56 AM
We should create a new tag It will help us identify those questions to cv
 
[tag:icanhazcodez?]
Nooo
The question mark makes it, SO.
 
Lol ... Yeah
 
@RobertGrant Hints for homework questions are ok, IMHO, but complete working answers for the whole assignment probably deserve a downvote. I wouldn't downvote Padraic's answer, because I agree with him that the whole assignment consists of more than just getting user input. But still I'd prefer it if he'd just given hints, or at least some example code that can't be simply copypasted into the final program.
 
Yeah, maybe I was a bit harsh
Just annoys me when people start to get further and further into their education and what they can do, as opposed to what they can ask other people to help them with, is still relatively little
 
Downvote was unnecessary, But not a great answer to upvote
 
11:07 AM
It can be fun to reply to homework questions with code that uses advanced syntax far beyond the OP's skill level, so the OP isn't game to submit it, or if they do submit it their teacher knows they must've cheated. :)
 
Haha yeah, or somehow encodes a URL to the SO post
That would be amazing
 
@RobertGrant On the plus side - let's competition in the programming market - as they won't get/keep a job for long :)
 
Or supply the answer as a linked .pyc file
@JonClements unfortunately that's what I worry about - people getting jobs they shouldn't, asking for help because "they're new", then quickly getting promoted out of the way
All because enough people did their work for them
major extrapolation may be present here
 
programmers not willing/able to pull their weight become fairly obvious, fairly quickly...
Interesting way to start a question: this is one of the dumbest questions ever!
 
I've worked in some corporates and you'd be surprised :)
UKBA contains one 600GBP/day (5 years ago) "UNIX expert" and we had to spell grep over the phone to him because a) he didn't know enough to do something himself, so we had to tell him what to type and b) he didn't know what grep was
So, enjoy that :)
 
11:16 AM
Well, that's certainly not what happens (in my experience at least) in the majority of cases
 
It's just hard to get rid of people. Even if a contractor is bad, it's worth just paying them out and not renewing. If you're hiring a permie then it's definitely better to move them to another role than fire them.
 
Or - just up the reviewing procedures ;)
 
Yeah, so I don't mean like a Google interview or whatever, but say for a standard corporate coding role, where they don't have a very difficult technical interview, I've seen some fun stuff happen. One person I worked with who was a senior coding person didn't know the difference between MB and GB.
And asked me what it was
 
> I'll try post some code up of what I have soon
So why not wait with posting the question?
 
sighs
 
11:26 AM
But nice name though .... geekcrap
 
Geeks crap, surely? Or geek scrap.
 
Umm... well this joke appeared to flop
 
@JonClements I added to the madness.
 
@JonClements there is an art to using humour on Meta. The secret is hiding a real issue in the post...
 
@JonClements What about the numbers 8, 13 and 69
 
11:38 AM
and OP deleted at -10...
 
I thought he'll wait until -41, and then delete it
 
It's so tempting to get that undeleted, downvote it to -42, then get a mod to lock it :p
 
Yeah, Please do it
 
Yeah I want that.
 
11:40 AM
@BhargavRao What, like this user did?
(Technically speaking, that user waited for -40, being clearly short-changed in the humour department).
 
Lol, yeah.. That rocked
 
Wow, I never saw that.
 
What was the joke in the -40 question?
 
Why can't we edit locked questions? Is there some meta posts as to why?
 
I think that's the definition of locked
 
11:47 AM
What if the locked posts contained an edit? A necessary edit?
 
@BartoszMarcinkowski If it's the question I'm thinking of, calling it a joke is a long stretch. The post asked a question about unprotected sex & pregnancy.
 
my god, who is that guy
 
@BhargavRao: That question is lacking in a proper problem statement. It should just be closed.
 
@MartijnPieters Fine, I'll vote as unclear
 
12:13 PM
@BhargavRao: there is a 'must include code and a clear problem description' off-topic reason as well.
@TanveerAlam Can you please review our chatroom rules? Your question is too recent to poke people with it here.
 
1 message moved to Trash
@ReutSharabani yes.
 
@MartijnPieters I apologize, i was not getting any response for a while thats why I thought I should share here.
 
@TanveerAlam it was only created 38 minutes ago, which is very recent. If you want live feedback, try codementor.io rather than SO.
 
@RobertGrant Thanks for sharing codementor.io
 
12:29 PM
Sure
There are other mentor sites, but that's the only one I remember
 
Of course, they generally cost money.
 
airpair.com and hackhands.com are two other such sites.
 
hackhands sounds like some sort of comic book bad guy
brb
 
@TanveerAlam: Maybe your question got a downvote because it looks like you're asking for opinions, and such questions aren't suitable for SO.
 
12:41 PM
umm... devious that one - starts off reading like a self-answer, then turns out it's not
 
user3522371
Hello, is it possible to use OpenCV version 3 with Python 2.7 together ?
 
@PM2Ring Sorry, but I was not asking for opinion, I am confused whether ` except all_errors+(Exception,) as e:` was a correct way to handle exceptions.
 
@TanveerAlam well, you were asking for suggestions without saying your error handling requirements
In fact you just showed printing the error, which as @PM2Ring says, means you don't need any handling other than what he mentioned.
 
Merely lumping all exceptions together & printing them only counts as handling them in a very minimal sense. If you're really doing some actual processing when you get an exception, then you should put that into your example code.
 
@RobertGrant I think my question representation was bad. the main concern was the ` except all_errors+(Exception,) as e:` is correct in any way. I mean instead of Exception if it was like ` except all_errors+(TypeError,) as e:` would it be right way to do?
 

« first day (1570 days earlier)      last day (3382 days later) »