« first day (2089 days earlier)      last day (2859 days later) » 

12:03 AM
@MarkoMackic hey
I'm off to sleep
my postproc script is almost done though
I'll have to finish it during work hours tomorrow
 
Can someone give me a little bit of assistance. I'm trying to write a web browser (so original I know) and it keeps going in a loop of adding a page and displaying it. I'm using PyGtk3 paste.ubuntu.com/18479985
 
is that an idiomatic way of calling the __init__ of the parent class?
You usually use super(ChildB, self).__init__(), or just super().__init__() in python 3
umm...where ChildB is the subclass
 
12:23 AM
Wasn't aware of that. I was going by the coding instructions given in the PyGtk3 manual. GUI programming is new to me.
 
me too, and this might have nothing to do with your problem:)
but beyond that my lack of knowledge prevents me from making any observations
 
12:37 AM
@AndrasDeak almost done is great state :P
@KI4JGT are you building browser from the ground up?
Well obviously not :) but cool stuff :D
 
12:59 AM
@MarkoMackic Thanks. I'm using the WebKit rendering engine. I'm wanting to add security features (LEFT_CTRL minimizes window, profile login, etc), direct torrent downloads, and a few other goodies.
 
I always wanted to build my rendering engine, don't know why, it seem as interesting task
 
There was a course on udemy to do it but it was just an intro course (as they're very complicated). With all the HTML5 calls and dom tree structuring, I figured I might as well go with someone who had already accomplished what I needed. Once I get it off the ground, I'm making my project open source but that's going to be a while.
Not to mention making it compatible with previous versions of HTML.
 
1:21 AM
@KI4JGT just post it, maybe someone will help to develop it faster :D
 
@MarkoMackic What would be the fun in that? I want to challenge myself. Plus I want to browser to meet my own quality standards.
*my
 
I don't know :) You can specify your quality standards to be meet
I agree with challinging
@DSM sorry to ping you but this is lifetime question, what's the max number of chars on single line you use
 
1:41 AM
@MarkoMackic From the get-go I've promised myself that this browser will first have the features I desire. If someone else enjoys it, that's awesome but if not, I'm not going to bend over backwards to make it better for them. Since it'll be open source, they'll be free to remix it. I think of this project as only MY browser, no one else's. So to ask someone else to help me develop it is sacrilege to me. :)
 
Agreed
 
1:57 AM
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 2576
What does this mean :o
 
DSM
@MarkoMackic: not sure what a lifetime question is, but I think the 79 standard is much too tight. I typically aim for something in the 100-120 range.
 
This is the code im using:

linkFile = open("/Users/" + user +"/linkFile.txt" , "r")
fileString = linkFile.read()
 
what is your user variable like @Pigman168 :)
@DSM nice, I thought I was stretching it too much :)
 
@MarkoMackic the user variable is retrieved from getpass
the module
user = getpass.getuser()
@MarkoMackic i just tried this from terminal and it works fine
 
And where were you trying this from when it didn't work
 
2:06 AM
correct
its an app made using py2app
which also worked fine when run on a different mac
just not this one
 
what's correct
I need to go to sleep, that up was phrased as a question
good night, or good morning ? :D
lol
 
ah sorry
i misread
i tried this from my laptop
 
DSM
@Pigman168: probably you have the letter à encoded in something (say UTF-8) and you're trying to decode it as if it were ascii, and it's not. The system dependence is likely because the two environments have two different default encodings.
 
ah yea i tried to decode it as UTF8 but i didnt know where to write that argument
aaand
# encoding: utf-8
thats in the script too
 
DSM
Those lines set the encoding for reading the Python code, not the default encoding that Python will assume for files that it reads. Do you see the distinction?
 
2:11 AM
yet i get this error: File "encodings/ascii.pyc", line 26, in decode
ohhh i see
so how would i specify the decoding for reading files?
 
DSM
Are you using Python 2 or 3?
 
DSM
You could pass the encoding argument to open:
>>> with open("ahat.txt", encoding="ascii") as fp:
...     print(fp.read())
...
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128)
>>> with open("ahat.txt", encoding="utf-8") as fp:
...     print(fp.read())
...
Ã
 
could i apply that like this?

file = open("/Users/" + user +"/website.txt", encoding="UTF-8", "r")
@DSM
 
DSM
You should be using context managers like with open():, but yes.
 
2:17 AM
context managers are better way to handle disposable objects :) is that correctly written ? :D
 
what is a context manager :o
 
you read my friend
:D
 
hehe ok
 
3:09 AM
cbg!
 
 
2 hours later…
5:11 AM
Cbg
They sound like Yahoo though
 
I thought someone had bought Yahoo?
 
When tech companies stop innovating and die, they seem to wander the earth as zombielike media disrupters
 
Yeah... I'm still amazed that Yahoo is still going... I remember a search engine for "excite"...
 
It's because it invested heavily in Alibaba.com, and shares went through the roof
That's why MM was able to keep going for so long while doing things like adding an exclamation mark to the logo, or buying some teenager's news summarising technology for millions
Whoever the previous CEO was had invested wisely while sending Yahoo into the toilet :)
 
Ahhh...
 
5:30 AM
Although according to $some_dev_guys_blog remembering Yahoo from a decade or two ago, it always considered itself a media company, and that was always its problem
 
5:42 AM
What was the other big search engine... alta vista?
use to be yahoo, altavista, excite and another one...
 
AskJeeves?
 
don't think I've ever counted that as a search engine - more a way to have a laugh for a few minutes :)
 
Don't know what's funny about AskJeeves
 
Some of the results it presented :)
 
5:44 AM
Ahhh... "AltaVista (acquired by Yahoo! in 2003, shut down in 2013)"
 
How is that in any way laughable?
@JonClements boo
I like altavista before google came along
Lycos!
 
Yup - just found it - that's the other one :)
I remember the adverts with the dog :)
Lycos enjoyed several years of growth during the 1990s and became the most visited online destination in the world in 1999, with a global presence in more than 40 countries.[5][6]
 
Wow, pretty amazing
 
We should all move back to "gopher" :)
 
6:01 AM
Right... gonna make a bit of brekkie - bbiab
 
Cabbage :-)
 
7:07 AM
Cbg
 
cbg
 
cbg
 
7:58 AM
cbg
 
Cabbage
 
8:24 AM
i wish I could attend pycon
 
@Ffisegydd I like the sound of the digital humanities
It sounds so real and thing-like
 
Cardiff looks cute
 
@RobertGrant Don't be jelly just because they have cooler job title than you.
 
You ain't ready for this jelly
 
You're Bobbylicious.
 
8:40 AM
cbg python people
I have a piecewise-linear function fdefined with data points, and need to solve the inequality f(x) > a. As a bonus, would be nice to integrate the function over the solution interval. And this has to work fast. Is there any numpy/scipy magic for that?
 
@bereal got a small example?
 
@Ffisegydd Someone so needs to do a parody of that Destiny's Child song now :)
 
It's not even exactly a function, for example, x=[0, 2, 4, 4, 6, 8, 8]; y=[4, 6, 7, 0, 2, 8, 0] (so it may have instant drops), and need to find x intervals where the corresponding y > 5. So, that's 1 < x < 4, 7 < x < 8.
 
Ooof.
And, presumably, you've got a lot of data and so need it to be quick?
 
@JonClements It's a pity that the thousands separator in format isn't locale-aware. And I guess the format functions in the locale module are a bit arcane for new Python users who aren't used to %-style formatting.
 
8:53 AM
@Ffisegydd oh yeah
 
Is your x always contiguous (I think that's the correct word?)?
 
@PM2Ring ahh... you're referring to the kludge I posted :)
 
i.e., is the ith element always >= the i-1th?
 
@Ffisegydd yes.
I guess I'll try some optimisations on the python level, but was hoping there was something ready.
 
What format do you want the answer in?
 
8:56 AM
anything, just an array of border x will do.
 
x = np.array([0, 2, 4, 4, 6, 8, 8])
y = np.array([4, 6, 7, 0, 2, 8, 0])
z = 5

x[y > z]
# array([2, 4, 8])
Not sure what you can do with that?
 
I need 1, for example, because that's where it intersects with y=5.
i.e. not only looking among the defined points, but the interpolated intersections.
 
Ah yes.
Give me some time.
Those instant drop values are one of the pains.
If you do interpolation on those, would you expect the interpolated value for 4 to be 3.5?
i.e. (0+7)/2?
 
we can assume their x can be increased by epsilon.
though, that's already a loss of perfomance. d'oh.
 
What's epsilon in this case?
 
9:03 AM
something very small, so that x will be 0, 2, 4, 4.00001, 6, 8, 8
but actually, forget about it, I can split the function into few by those drop points.
ok, that makes it simpler
given that function is most likely also monotonic between the drops...
Ok, thanks, I think, I know what I shall do.
 
TIL: what a piecewise linear function is. Really annoyed at myself for not googling that before.
 
x = np.array([0, 2, 4, 4, 6, 8, 8])
y = np.array([4, 6, 7, 0, 2, 8, 0])

z = 5

x_max = x.max()

x_interp = np.arange(0,x_max+1,1)
y_interp = np.interp(x_interp, x, y)

x_interp[y_interp >= z]
# array([1, 2, 3, 7])
Bleh. Doesn't handle that instant drop.
# x_interp and y_interp in this case are:
[0 1 2 3 4 5 6 7 8]
[ 4.   5.   6.   6.5  0.   1.   2.   5.   0. ]
 
@Ffisegydd nevermind, I can just split the function into parts.
 
It takes the 2nd value by default, ignoring the first, so it says 4 is 0.
 
@Ffisegydd thanks, this really helps!
 
9:10 AM
No worries, give me a shout if you need anymore help. My numpy is rusty.
 
hm, but it interpolates only for integers, what if the intersection happens in between?
d'oh, that was close
 
It interpolates only for integers? Really?
@bereal that might be due to the np.arange part
You will need to decide on what you want your interpolated x to look like, but it will work with floats.
 
will take a look... afk for a while.
 
^ I skipped words and only read “I will look afk for a while”
 
Morning cbg
 
9:39 AM
cbg(withnail)
 
9:54 AM
@IntrepidBrit I looked it up on Wikipedia and am really annoyed at myself for doing that.
 
Because you have an irrational hatred for approximation?
 
10:06 AM
why?
 
10:39 AM
can we have:
 
Yes.
 
Better hope he doesn't ask for a pony now.
 
class Demo:
another_class_objecjt = DemoAnother()
def __init__(self):
self.a=a
self.b=b
def print(self):
another_obj.method_from_this_class()
 
You can have one of those too.
No that won't work, because 1) indentation (I assume chat just messed that up for you though), b) another_obj is not defined (I assume you had a typo there between another_class_object and another_obj), and iii) a and b are not defined either.
 
yaa
it it another_class_object
 
10:44 AM
Why wouldn't you be able to have that? Have you tried it?
 
Can I create object in class space
 
Have you tried?
 
no
 
Well.
 
Why not? :)
 
10:44 AM
Why don't you go try?
 
can I create object in class space
 
Go try.
 
not in class instance
 
And do some research on "python class variables"
 
11:05 AM
Hi all , I have developed a PyQt application , but I am facing issue of its saving and restoring , can anyone please guide me ?
 
@RishabhGupta please see sopython.com/chatroom
In particular, do not ask to ask or ask if anyone knows X. If you have a question, just ask.
 
I am trying to save qlistwidget , qtableview and a whole lot of other qt elements , how can I save all the states of the a stacked widget so as to retrieve from separate file ?
 
I did see this ans , but it only covered only 4 qt-elements stackoverflow.com/questions/23279125/…
 
Perhaps they just want someone who's smart enough to do that
 
11:10 AM
@Rob so they can compile the clothes, obviously.
Jeez.
 
Ha! I'm forwarding THAT one to the in-law.
 
@RishabhGupta FWIW, I don't think there are any regulars here who use PyQt. However, your question is fairly broad, and it may not require a PyQt-specific answer. There may be some component of Qt that can do what you want. OTOH, you can possibly save the state of your widget using Python's pickle module.
 
@PM2Ring I did not find any documentation to save an instance of class and load that , can you help me ?
 
@RobertGrant Because they have a knitting machine compiler. Which I guess compiles a garment spec into low-level knitting machine instructions. And I guess they need a compiler-writer because they want to continue to enhance their high-level garment spec language. Either that, or the current compiler has problems. :)
@RishabhGupta Have you studied the official documentation for the standard pickle module?
 
@PM2Ring I did see that , but I could not find any documentation for saving an instance of the class as a pickle file and retrieving that , also when I tried it with my pyqt class , it generated an error .
If you can guide me to the relevant documentation , please do , thanks .
 
11:18 AM
@RishabhGupta Really? You didn't find examples of saving objects to files using pickle?
(For anyone else reading, yes, yes it is)
 
@Ffisegydd if I have missed it , I apologize but they all resulted in errors with my PyQt4 classes .
 
@RishabhGupta Class instances can be tricky to pickle, which is why I said "you can possibly save the state of your widget using Python's pickle module". However, it's generally possible to modify a class to make it picklable, or to create a picklable subclass.
Please read Pickling Class Instances. Don't expect to understand it instantly, it's tricky stuff. Give yourself time to absorb it and do some experiments with simple classes.
 
@PM2Ring thanks for the link , as you said , it looks tricky but can anyone tell me a single example of it working with PyQt classes .
 
@RishabhGupta why not find an open source project that uses pyqt - something you can run and play with, then look at the code to get the bits you want...
 
@JonClements I did try that , but could not find anything that has such a functionality implemented , if you guys do know about anything similar ?
please let me know ?
 
11:28 AM
@RishabhGupta Sorry, I use GTK for my serious GUI stuff.
 
Oh, just saw your post from last night on ML, thanks very much @Ffisegydd!
 
@PM2Ring but have you implemented save and restore in that , if yes , please can you atleast post some gist of it ?
 
11:46 AM
Take a look at this answer. It doesn't use pickle, it uses QtCore.QDataStream.
 
@Ffisegydd *monotonous
monotonic?
 
It’s GDQ week, makes work so much more fun.
 
brief cabbage btw
 
12:02 PM
ahoy Andras.
 
I just stumbled across a possible pre-spam post: stackoverflow.com/questions/38202329/…
I've down-voted and flagged it. Should I bother close-voting with a custom reason?
 
@poke I wish I could watch at work.
 
@AndrasDeak Dats der bunny.
 
Hello cbg :)
 
12:19 PM
Andras, are there any Hungarian rental companies/websites you'd recommend finding an apartment through? Doing some research...
 
12:36 PM
@PM2Ring thanks a bunch , this sounds promising :)
 
@RishabhGupta Good luck!
 
@PM2Ring but I do have q query , do I need to individually save all the widgets , isn't there some way , I could iterate through all the qt elements of a qt class ?
 
@RishabhGupta Sorry, I can't help - I know next to nothing about Qt. As I said earlier, I use GTK.
 
ok , but how do you do it in GTK , can you tell me ,I believe that would be very helpful to me.
 
Suspect you'd be better off posting an actual question on the main site.
 
12:53 PM
@davidism do you know of a decent SE API Python library? There's a few out there, was just wondering if you had an opinion on them?
 
There's a decent one (or at least I liked it) on stackapps
 
There's a few though.
 
I seem to recall we didn't use it for the sopython-site as it was overkill for auth stuff...
hang on - let me look and see which one I liked - I tried two - one was a fairly thin wrapper - the other heavily wrapped everything and made some things easier and others a bit more annoying
 
Yeah. For this particular use case I want to be able to get old content on a batch cycle, say 100 posts at a time, rather than looking at new content.
So I was just going to go through the /posts endpoint with a defined page size and just increment the page size until I get new, then start again at 0.
 
hmm
anyone using cookiecutter? I am thinking about a tool that could reverse-transform working code to a template
anyone familiar with such?
 
1:02 PM
@Antti I use it, really like it.
Not aware of a tool to go the other way though.
 
@Ffisegydd that article was pretty interesting, my previous roommate was a singer in a metal band and a science major and he showed me some similar ones too
 
@RobertGrant All of our backend code is written in Python, from our Django-based websites, through to our knitting machine compiler.
 
Morning cabbage.
 
1:21 PM
@Ffisegydd you lost me
@Withnail not really, I don't have any experience with renting:S
 
No worries, just thought I'd ask. (Lucky you!)
 
indeed:)
 
Umm... need another cheapy travel laptop - is an a8 quad-core better or worse than an i3 dual core...
same disks, same ram...
 
@Ffisegydd yeah, I think I haven't read any of the city watch ones in English:S
I did read Night Watch, but that's different
 
1:27 PM
@JonClements Generally, I'd go with Intel unless you're doing a ton of gaming on the APU.
AMD is a little better with the APU, but Intel is better all around.
 
Would like it to be proficient at DB and analytics stuff... not fussed about gaming
 
Yeah, I'd go with the I3.
 
I can get another 20% off via my brother anyway
 
I generally don't love HP, but if you can get 20% off, it might be worth it.
 
that looks like a dell from this angle
 
1:32 PM
they're all pretty much the same thing just with different logos - like most things
 
I'd probably go with this one myself, but yeah, at the consumer level it doesn't matter a whole lot. amazon.com/Lenovo-G50-15-6-Inch-Laptop-Bluetooth/dp/…
 
@MorganThrapp very nice Moiré design there:D
 
This Python ML question stackoverflow.com/questions/32330481/frr-and-far-using-python was just flagged as a possible dupe by the author of the answer on the dupe target stackoverflow.com/questions/35811446/… I guess it looks ok, but I know nothing about the topic.
 
@MorganThrapp I've got a lenovo very similar to that but with a10 quad core processor. It works pretty well when I have one core working away on data while doing other stuff. @joncle
 
@JRichardSnape Yeah, if you're doing a bunch of parallelizable stuff or gaming, AMD is the way to go.
 
1:39 PM
They're a bit weighty for a "travel laptop" though, IMO
o/ Hola @tristan
 
user559633
I thought 8 gigglebytes was too small of memory for 2016
 
user559633
Hey JRS! How are you?
 
Well, thanks. Bit busy with work, hence not around much - this is a mid afternoon break before the final push for today.
How are you?
 
Can you be bothered with a custom one Jon? pcspecialist.co.uk/form-view/lafiteII/Lafite-i3 is small/light will take 8Gb Ram/i3.
Lafite I5 will take 16Gb iirc.
 
@tristan the jokes in this room are at least one terribyte
Whether that's "terrible byte" or "terrific byte" is left to the reader
 
1:44 PM
I found a cat outside of my office you guys, I think I have a new best friend
 
user559633
Can you share what the big release contains? I'm doing alright -- some really bad "IRL" things are going on and just working all the time (more with JS lately, which is making me appreciate the comforts of Python)
 
user559633
@corvid What have you named him/her? I propose "Steve" or "Steve"
 
Steve if it's a boy and Steve if it's a girl? Makes sense.
 
Meow the Unstoppable
 
After all, it's a cat.
Meowgrat Thatcher.
 
1:45 PM
I think "Gavin" is a great name for a cat.
 
MeowgRAT Catcher, no?
 
user559633
Chairman Meow. Meowsolini. Fidel Catstro.
 
"Spot" is a good cat name.
 
1:47 PM
Hermann Mousering.
 
@tristan Sorry to hear bad IRL things - I know that feeling unfortunately. Anyway - must get this report (yawn) and model (slightly less yawn) into some kind of state to show people.
Rbrb all
 
user559633
Take care JRS and thanks for saying that :)
 
@tristan Fun fact that I learned: Miaƍ means "cat", but the Mao in that guy's name (ironically) means "hair"
 
I'm trying to convince the GF to name our future cat Tyrion Meownister.
 
@Ffisegydd well, I was trying to write another one a while ago, but I'd just go with Py-StackExchange.
108
Q: Py-StackExchange: An API wrapper for Python

Lucas Jones UPDATE: 2.x support is now mainline! Please read the wiki page for important information about the update. A warm welcome to you, traveller. You have arrived at the home of Py-StackExchange, the library definitively proven† to be the best library for using the SE API from Python. If you are s...

You don't get any write functions, but I don't think you need that.
There's also ChatExchange for the chat "api".
 
1:52 PM
Yeah Py-StackExchange was the one I liked the look of,ta.
 
@PM2Ring the best ;)
 
@MorganThrapp has she since mentioned anything about how great you'd look in a tight fitting white jacket? (while backing away slowly) :p
 
@JonClements She said it was to help me. :/ Either that or that I needed help.
The lobotomy made it hard to remember.
 
@Morgan just make sure you get one of those awesome rooms where you can jump around and bounce off the walls - makes one feel like a kid again! :p
 
user559633
 
1:59 PM
only one more
 
user559633
also, i assume it has the "i upvote bad question so i can make a bad answer plz give me internet points"
 

« first day (2089 days earlier)      last day (2859 days later) »