« first day (1576 days earlier)      last day (3596 days later) » 

05:10
Is the site down?
nope
It is back up now...
 
3 hours later…
08:00
cbg
-2
A: Python comment multiple line not working in array

Kasra ADActually what you have here might be a string, that you can use str.replace like following : >> print s = 1,2,3,4 >>> s=s.replace('2','\n"""\n2').replace('3','3\n"""\n') >>> print s 1, """ 2,3 """ ,4

:(
downvote that to oblivion
@AnttiHaapala As if that question itself wasn't bad enough, the answers are even worse!
08:06
Yeah
@AvinashRaj sorry but your "answer" did not even try to begin to answer the question
Is the other answer correct? (It looks good)
stackoverflow.com/a/28391875/918959 this is the most correct answer and yet the wording is pretty bad.
yeah I meant that
Perhaps leave a comment asking him to explain better
"Again, the fact it does not have {} is way messed up than this." Poor thing. It must be terrible to be forced to code in Python when you obviously hate the language. :rolls eyes:
@AnttiHaapala Now imagine that array is huge. hundreds of lines ... Write a word about the overhead too
Of weeding out
ah it is not that huge
if one edits it with an editor it is small, megaitems are small, 100 MI are not :D
@AnttiHaapala I'm only refraining from downvoting that because I have a sense of humour. :)
at least I did answer the exact problem.
@AnttiHaapala I expected that frenzy guy to do this actually but now you've done it ... So +1 deflected towards yours
08:23
when everyone else just were telling how to create more of those multiline problems
Thanks @Bhargav Rao, you are an eye opener :) — code frenzy 54 secs ago
Duh!
Do I open eyes?
if everything is blcak there, the answer is "no", you did not ope n your eyes
s;dbv;sevdhu
I can't see what I'm typing
08:36
@AnttiHaapala Add import sys there else he'll come back and tell sys not defined
@BhargavRao :D:D
I've faced such OPs ....
yeah, I flagged all 3 answers already
09:56
re-cbg
user559633
cbg
10:41
cbg
user559633
i don't know how anyone got a lot of work done before huge (or multi) monitors existed
@tristan I would imagine, they would have seen in their brains...
user559633
Sure, and most of the stuff that I "need" a huge monitor for is web dev stuff, which wasn't as feature heavy in the past
11:39
Phew, finally completed the survey
user559633
user559633
where would you expect error messages (e.g. this field is required) to show up?
user559633
turning the box a shade of red is ugly, as is adding text below
user559633
adding text to the right is kind of possible, but it's already quite a wide form and adding to the right comes with mobile concerns
cbg!
11:53
@tristan Is there a Submit button?
If you don't want to turn the whole input box red, how about turning just the box title, or the box title background area red? And putting an error message near the submit button (if there is one). You could also ghost the submit button until all input boxes contain valid data.
user559633
12:09
@PM2Ring yeah, there's a submit button further down
user559633
the difficulty is that it's a multi page form.
@tristan Oh. They're evil. You should be able to do a "partial submit" for each page, and then at the end you have a data summary to verify before the final submit, with the option of going back to any page in case the data is wrong.
user559633
i decided to go with an errors summary at the top to help people using screenreaders, shade the box with some red, and target the box on the frontend with more help
user559633
@PM2Ring yeah, i save state as the user goes on the front and back
user559633
(it's technically a single page form, but i just render it in an accordion style because otherwise it's too long to visually scan quickly)
12:19
Rightio.
I wonder, do data URIs work here...
user559633
thanks for the feedback
I guess not. :)
@BhargavRao Maybe. I'm waiting for some feedback from the OP. I'm guessing he's never used a language like C where you need to know about data alignment. And depending on what he's doing with that binary file it may be essential to have the data properly aligned.
Oh Ok..
12:29
Hopefully, he's currently reading the Wiki article I linked to & trying to get his head around it. :)
Yeah ... Even the python docs has a good lot of material
Sure, but it is aimed at people who are already familiar with the concept of alignment, and are trying to interface Python with C.
Yep ... :)
Even with C, alignment is mostly handled automatically for you; you really learn about this stuff doing assembler.
On the early OS versions of the Amiga, doing improperly aligned data accesses would crash the machine. After a few dozen reboots you learn to be very careful. :)
Is there an answer about "what counts as a duplicate"?
cbg
@BhargavRao good answer
yesterday I got only 173 rep
hope today I will break 200
0
A: querying gpsd through python: units of measure

Antti HaapalaIt would absolutely not slow down your program to convert the units in Python, and neither would it reduce accuracy. 1.852 km/h is exactly equal to 1 knot; 1 foot is exactly equal to 0.3048 meters. Thus you get: knots = speed / 1.852 altft = alt / 0.3048 And these numbers are as exact as possi...

guess that's a troll
I didn't want to answer that one when I read his in the free world quip.
I want 200 rep, now at 193
hope that does not get deleted :P
13:56
Is that better? :)
thanks :D
@AnttiHaapala thanks... :)
still better to make some rep
10 more ... Enjoy...
whew :D
now I need not worry about deleting 1 answer
thanks
14:02
rhubarb
14:13
I am abusing my delete votes, but stackoverflow.com/questions/19298697/… <- I think such questions in search results do not help anyone
user559633
14:31
stackoverflow.com/questions/28395005/… is there a reason why my most thorough answer to this question isn't blowing away the other?
user559633
14:43
nm, got the accept
ok here is a general question: I have a few point on a line and I want to know how evenly spread they are. So [0.1, 0.1, 0.2] on the line 0,1 is not as well-spread as [0.1, 0.5, 0.7]. Any ideas?
cbg
user559633
stackoverflow.com/questions/28395202/… any idea why i'd be eating a downvote here?
it is doing wrong there:
trying to install virtualenv... without having virtualenv, to the global location
user559633
err, yeah, thanks @AnttiHaapala, fixing now
user559633
14:57
Woke up too early and not braining right
dunno how the mac setup is done (bleh, osx, bleh), but should install the virtualenv itself usually globally, and properly...
user559633
i keep things in a vacuum -- i have a virtualenv that i activate in a general env
user559633
Come to think of it, i'm not entirely sure what the user wants
I was send here from the unix room :) Does anyone know how to uninstall locally installed python packages?
user559633
You should go to the linux room for that
15:07
Oh, they said I should come here, lol
user559633
(serious answer though, run rm on the file)
Ok, well I want to remove all python versions apart from 2.7.6
2to3 pip pip2.7 python python2.7 python2-config smtpd.py
idle pip2 pydoc python2 python2.7-config python-config
user559633
no you don't.
user559633
Ubuntu?
15:09
Yes
14.04
user559633
You might have software installed with a dependency on one of those versions of python.
user559633
Do you mean "python packages installed through aptitude?"
guys, is there a better way to filedialog.askopenfilenames() in tkinter?
Well basically, I want python 2.7.6 to run when I run python in terminal
instead 2.7.5 runs
can't I just uninstall 2.7.5?
user559633
15:14
@crossboy007 look into the $PATH variable in Linux
kiancross@whb:/usr/local/bin$ $PATH
bash: /home/kiancross/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games: No such file or directory
user559633
i didn't say vomit it at me
user559633
i said look into it and learn what it does
Oh right, lol
user559633
:) the first match of python in those dirs will be the one that gets called
15:18
13
Q: Two versions of python on linux. how to make 2.7 the default

AnthonyI've got two versions of python on my linuxbox: $python Python 2.6.6 (r266:84292, Jul 10 2013, 22:48:45) [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> $ /usr/local/bin/python2.7 Python 2.7.3 (default, Oct 8 2013, ...

That recomends not to change it because other packages may rely upon it?
user559633
i don't know what that's on about
Ok, I will disregard all that imformation then
@crossboy007 First: do not uninstall the system Python. Things will go horribly wrong if you do.
Second: why do you want Python 2.7.6 rather than 2.7.5 (the easiest option) or 2.7.9 (the latest)?
15:23
@ZeroPiraeus Is 2.7.5 default version?
@ZeroPiraeus because I have installed wxPython on 2.7.6 and is doesn't work on 2.7.5 and I don't have 2.7.9 installed i don't thinkl
user559633
alternatively, uninstall system python. i'm not your real dad. start daytime drinking
also the idle version I have runs 2.7.6
How did you install 2.7.6?
I think it is through the ubuntu software manager on idle
I'm the one who sent @crossboy007. Sorry about that. :-)
We're not Python experts there.
He has a local version of 2.7 installed (2.7.5), along with 2.7.6 (Ubuntu binary package).
user559633
15:28
This is starting to feel like work
I recommended he uninstall the 2.7.5, but I didn't know how he had done it. Perhaps pip?
user559633
Just leave it alone
user559633
It's a few megs at most
That's certainly one option.
@tristan Space isn't the issue. It tends to create confusion to have two such similar versions.
user559633
which is why i told him to read about paths
user559633
15:29
add in virtualenv
user559633
and we can all go back to talking about rabbits
Okay now I'm confused - surely it's the other way around? I'm also on Ubuntu 14.04 and the system Python is 2.7.5 - I can see no Ubuntu package for 2.7.6 anywhere.
@tristan rabbits?
@ZeroPiraeus Hmm, strange. One sec.
user559633
yes, rabbits. and possibly bunnies
2
Q: Can't import wx even after installing python-wxgtk2.8

crossboy007I am running Linux Ubuntu 14.04 LTS and am trying to install wxPython so I can develop GUIs on python. I have python 2.7 and 3 installed but 2.7 in default. I have installed wxPython as recommended on their website by doing: apt-get install python-wxgtk2.8 It said that it had installed ok, b...

in Unix and Linux on The Stack Exchange Network Chat, 40 mins ago, by crossboy007
kiancross@whb:~$ dpkg -l | grep python2.
ii idle-python2.7 2.7.6-8 all IDE for Python (v2.7) using Tkinter
ii libpython2.7:amd64 2.7.6-8 amd64 Shared Python runtime library (version 2.7)
ii libpython2.7-dev:amd64 2.7.6-8 amd64 Header files and a static library for Python (v2.7)
@ZeroPiraeus ^^
user559633
15:31
virtualenvs.
I see no bunnies.
When I hear bunnies I think of Watership Down.
user559633
i don't know what that is
No doubt an earlier generation would have thought of Peter Rabbit.
user559633
is that some sort of blanket for a water bed?
15:33
@tristan you don't know what what is?
user559633
waterbed downblanket
@tristan funny
Ok, ignore me, I'm an idiot. I trusted the 'python' virtual package to have a sensible version number :-/
@ZeroPiraeus Oh, yes, Debian can be wacky like that.
 
2 hours later…
17:22
Not spam ... Just lol
17:45
buh, people who are bad with computers don't understand you can google anything
user559633
18:33
en.wikipedia.org/wiki/List_of_short_place_names the worst part of validating user input is that even "bad user input" can be "valid user input"
user559633
hah, yeah, i'm going with a range of 2-50
Things with Native American names round these parts can have really long names
user559633
when my startup gets to the point in which customers are clamoring that i don't probably support the edge cases, i'll probably be in a place to hire people
19:22
I want to name the Stack Exchange wrapper I'm writing "SE Shanty" but I'm not clever enough to come up with an appropriate shanty to go in the readme.
yo ho ho and a barrel of cabbage
hey @AmarjitChandhial
(also, hello everybody :) )
20:19
cbg all
this is kind of an interesting question. Trying to use a typechecking decorator inside a class, so the class isn't defined yet when the decorator tries to bind to the function
class Foo(object):

    @accepts(Foo, float)
    def __init__(self, num):
        ...
@davidism have you tried Py-StackExchange? Seems to work pretty well for everything I've thrown at it, and it's being actively updated...
it doesn't support the write api, among other minor issues I have with it
and ChatExchange only supports py2
so I'm writing a single library to do both the api and chat in py3 (and probably py2)
is it spammy if me and @AmarjitChandhial troubleshoot an issue with Spyder installation here?
if it's just you two, why not make a separate room?
20:34
oh, I didn't realize write wasn't supported - most of my testing so far has been trying to figure out a way to replicate this in Python...
It's not private but @davidism, will do! Thanks! :)
It also doesn't support getting access tokens, only using them. ChatExchange supports user/pass login (it has to for chat), and I can use that to also automate authorizing an app, but I need py3 support.
@Roberto it doesn't matter that it's private, it matters if it's just going to be a long back and forth between only two people about fixing stuff, especially installing something versus actually using it
@Roberto also, @AmarjitChandhial can't chat, they don't have the rep yet
Thanks for trying to help, but there was no need to show me how to do division. Also I do believe there would be some loss of accuracy, never heard of a floating point division without rounding errors. But that point is moot, the accuracy will still be more than sufficient for private aviation where traditional instruments have margins of at least 5%. It doesn't alter the fact that I hate wasting cpu cycles - NMEA delivers the speed to gpsd in knots (on most receivers, surely on mine), why should it get converted to km/h then back to knots? Sheer waste I call that. Likewise for altitude. — Karlchen9 5 hours ago
@Ffisegydd what do you think ;)
20:43
@AnttiHaapala why not go all the way and use the fractions module?
is there any branch of physics where the precision of double or even precision of 32-bit float is limiting?
Possibly, yeah.
Quantum mechanics deals with numbers that can be as low as 10**-50
of course, if he cares about speed...
20:45
Don't remember what level float precision is, but frankly when that's the case you change the units from SI to Planck units so numbers are all around 1
float has exponent 127-(-128)
binary, so it would be not enough for 10**-50 directly...
yeah, but double anyway :d
0
A: Allowing a python decorator to take a class as a parameter when used inside the class being passed

Zero PiraeusThe sort answer is No, you can't refer to your class like that before you've finished defining it. Type-checking is a subject under active discussion among the Python development team at the moment, and to the extent that there's a consensus, it's that function annotations are the way forward: P...

@ZeroPiraeus SQLAlchemy and Marshmallow do something similar, you can pass 'self' or the name of a class to avoid circular/self-referential imports
and then the name is resolved as late as possible
upper = lambda c : c.upper() What is it's use?
Yeah, last time I did anything with Django it did the same thing.
21:03
@BhargavRao upper(some_string) is then synonymous with some_string.upper()
which is unnecessary since you can already to str.upper('test')
saves you 4 characters!
I guess it technically saves you a lookup too, although you could do upper = str.upper to avoid that.
OK, so I've got a little problem. I'm trying to replicate the network reputation graph (see mine here, for example) in Python, using Pandas/matplotlib/numpy/stuff so I can do some data analysis. Unfortunately, that page uses Highcharts for the graphing, and the source data is embedded in the page as JavaScript (not even straight JSON)...
Maybe the codebase is using a number of objects with upper methods and wants a function to handle all of them for some ill-conceived reason.
21:07
yeah, just thought of that too
So, how do I access that data? Obviously, I can get the contents of that particular <script> tag with bs4, but then I need to somehow parse the JS to get the values I want, and parsers are not my strong suit...
Get that full rep history into a pandas dataframe and then get a cumulative sum of the rep change.
You could also then produce other statistics by grouping by specific events, for example accepts or downvotes.
don't scrape that page, use the api
of course, that particular method requires an access token, and py-stackexchange doesn't support them
(I was wrong earlier, it only supports app keys, not user tokens)
the format of that data is completely not what I want... it looks like this:

{
"reputation_history_type": "post_upvoted",
"reputation_change": 10,
"post_id": 18071378,
"creation_date": 1423427936,
"user_id": 1426065
},

and I just want a simple list showing that on this day, my total rep was X.
I think there's another method that less fine-grained
although you could do the math with that data...
21:13
@Ffisegydd I'm trying to avoid doing that every day...
rhubarb for now, a little boy wants to play games with Daddy. BBL...
@MattDMO Do it once, and save the file as json. Then everyday you can load your json, look for the latest date, and retrive the new data via API.
Then you just incrementally update a hardcopy on your machine.
Pandas should be able to aggregate those reputation changes by day.
I think. I've never used it.
Yeah you'll be able to groupby each day.
Bleh need a request_key to use access_token
@Ffisegydd been playing around with chatexchange to figure out how it does authentication
figured out I can combine it with the api oauth stuff to allow authorizing an app with username and password
which feels really dirty since now you can ask for a username and password and gain a no_expiry token without the user seeing what they've approved
@AdamSmith Was referring to this ... stackoverflow.com/questions/28399212/…
21:22
@davidism what words I understood make it sound interesting.
it means I'm close to writing stuff for rabbit and kesh
Oh awesome :P
I've had to slow down with Nidaba recently due to time issues, but hopefully after this month I should be able to get on it properly.
yeah, this weekend was the first time in a while that I've been able to work on sopython stuff
need to finish implementing the site wiki at some point too
@davidism about the "chat room spam" question, yes of course, I didn't leave out of rudeness, I just left to try other chat options :)
byes :)
no worries, I didn't think you did
22:11
Python 3.5 Alpha 1 is out.
7
with typing?
omg pep 475 :d
about time ...
now that is yet another reason to switch to 3
haha :D
just realized that [email protected] will be valid python 3.5 :D
or def sendit(mailto: [email protected]): :D
Ask question on the new things in 3.5 ... Ninja will answer ... Get heavy upvotes .. Get Badge
Mission accomplished
"Zero Piraeus" <[email protected]> ...
Pity about needing the ellipsis or similar, but still entertaining.
22:27
cbg all, I'm back. Had to beat my 9 year-old twice in Operation and twice in chess :)
user559633
so no dinner for him tonight?
user559633
"bread's for winners"
no, he just has to make dinner for me
23:14
@ZeroPiraeus built and installed :)
@MattDMo Marvel at the glory of being able to do b"%d.%d.%d %a %d" % sys.version_info :-)
Now I'm going to need to update Python Improved with the new syntax...
@ZeroPiraeus why is it glorious?
It's not especially ;-)
23:31
Can anyone else confirm this works as displayed?
https://gist.github.com/joranbeasley/b9df429cf3cc292e11a3
this splits every character in the string and fills with "00" for me. And ive tryed everything i could think of, or find with a google search.
23:43
ooh, this looks nice:

*Although it is not formally part of the API, it is worth noting for porting purposes (ie: fixing tests) that error messages that were previously of the form “‘sometype’ does not support the buffer protocol” are now of the form “a bytes-like object is required, not ‘sometype’”.*
WTF. Formatting isn't working for me...
https://gist.github.com/DeathDealer33/f7141013eb2e44e341a9
this explains my situation better.

« first day (1576 days earlier)      last day (3596 days later) »