« first day (1408 days earlier)      last day (3543 days later) » 

4:13 AM
Will not spoil until we reach a consensus that it's okay to do so, but ... that was awesome :-D
I am going to enjoy the thirteenth :-)
s/thirteenth/twelfth/ ... goddamn messed-up timey-wimey continuity :-/
 
 
2 hours later…
6:34 AM
cbg
 
6:48 AM
cbg()
 
7:03 AM
Huh
-1
Q: Python: different implementation of constructor

Pranav RajThe normal way of defining multiple constructors in python is like following: class MyClass: def __init__(self, arg1): ... def __init__(self, arg1, arg2): ... def __init__(self, arg1, arg2, arg3): ... Another way to do the same is like following: class MyClass: ...

 
7:13 AM
:-) God and I. others use 4 :-) — mat.viguier 34 mins ago
(about spaces in indentation)
 
 
3 hours later…
10:35 AM
 
 
2 hours later…
12:11 PM
cbg
 
Dad
12:38 PM
chabbage
is there something bad in use ajax for up down voting system?
I cannot use websocket thats why I ask
 
ajax and websockets are unrelated
 
Dad
1:03 PM
@ThiefMaster do you even know what I'm talking about? ajax can be used to send a request without the page refreshing .. the same can be done by a websocket connection
 
True, but they are still pretty different things...
 
Dad
ok you're right just checking if ajax was still the way in 2014 ;)
 
2:06 PM
How does python store dictionaries internally? How does it relate the key to the value
 
3:02 PM
@Johnston do you know how a hash-table works?
 
3:13 PM
Python prints exceptions to stderr, right?
 
3:48 PM
ajax does nto mean anything
ajax means "asynchronous javascript and xml" and that is what no-one is doing anyways :D
 
ajax is a wrong term
 
cbg
hmm
@Dad you should say: XHR vs websocket
 
Dad
@AnttiHaapala yeah right :) I'm evaluating the most efficient way to update a vote (up & down) counter
methinks I chose the wrong term to describe it
as vaultah said
basically:
Up/down vote button click => Javascript immediate value registration => XHR request | /updatecounter/<postid> | => pubsub chan <update vote> => subscriber <update vote> => Javascript.innerHTML vote val update from <update vote>
 
4:03 PM
there are realyl only 2 things
if you use subscriber publisher then you are basically using persistent connections whihc eats resources and with xhr then you'll be using long polling too...
otoh
if youre not needing that then just forget it...
a page could poll more effectively every 10 seconds resource wise as it would be to keep a connection open ... (maybe)
 
Dad
yep that's my concern
I've been thinking about using Server Side Events
 
the problem is the number of connections,
also,
maybe you'd want to use some localstorage trick to consolidate requests from multiple pages or so...
in any case the simple way of using a websocket or longpolling might kill your server :D
if the site is popular
but 99.9 % sites then are never so popular that you need to worry about anything
 
Dad
got it :/ well I've benchmarked the server and it can hold at least 2k req/s without any problem, but then I also built a chat which puts even more load on the server ..
from a UX perspective would it matter if I polled say every 30/60 seconds the server instead of 5/10 seconds to check if the vote count is updated?
as per the popularity it surely won't be in a month if it ever will .. if it is I'd imagine I already have earned a lot of bucks from sponsors and other services from the site
so another server isn't going to kill the thing I think :D
 
4:24 PM
There's no way to answer that. Do whatever is appropriate for the use case of your application.
Try actually writing the system (just pick a technique) and see if it works for you. Otherwise we're just throwing opinions around.
 
Dad
@davidism I'm actually writing that but stopped for a moment to wonder if there was a better way to do it
 
4:59 PM
Yo yo yo
 
stop wondering, see what happens :D
the problem with many servers is that they use a thread per open connection
on python side, there are things like tornado and twisted,
but any traditional wsgi impl will screw you up if you have 10k conns
and it means 10k conns without anything happening for them really
@Dad you want to write your code so that it is mostly agnostic to the actual channel used
so you can upgrade it to use websocket everywhere or some conns, or whatever
 
Do you guys think this would be a good proposal for Python Ideas?
 
5:33 PM
I am not sure what you mean :D
 
How can I change a polymodel.PolyModel entity to be one of it's child models?
I want to go from parent (top-level) to child, which I assume is easier than moving between children, but I'm still unsure how..
i.e. I have something like User(polymodel.PolyModel) and PrivelegedUser(User), how can I programmatically 'promote' Users to PrivelegedUsers?
 
dont know if that is a good programming paradigm at all
 
How would you suggest?
I figured this was favourable over db.ReferenceProperty-ing between two different db.Models, which is what I was doing.
 
I dunno, I have never used GAE, just reading about that now, makes my head ache
in my opinion a privilegeduser is not a good class to have
 
# Don't do this:
u = User()
u.__class__ = PrivilegedUser
 
5:40 PM
a user is a user, maybe with privileges, thus I would construct the privileges with has-a instead of isa
 
well it's not called that, or quite like that, that was a convenient example
it's more like a different type of user than priveleged
 
Whatever you're doing, there's a better way to do it.
 
:p That's what I'm hoping for
 
95 % of time the ISA is wrong I'd say :P
 
Probably just write an explicit conver_to_privileged method.
 
5:42 PM
but it does not make any sense really
 
Yes - that's what I'm doing
 
I mean you have 1 user then you convert htat user to privileged user
 
But I'm asking what ` def conver_to_privileged()` looks like
 
it is like you kill "Antti Haapala" and then take another one with name Antti Haapala and say "you are the new one but with privileges now"
it is against all the OOP principles that I can think of
 
Hmm.
Yeah that's not ideal. What's a better way of doing what I'm doing then?
 
yeah
so now we wait for ppl start saying that they will stop using python if this happens
4
 
Dad
@AnttiHaapala haha I'm the person who wonders about anything really xD

anyway about the thread-per-connection stuff, I've been thinking to use Gevent http://www.gevent.org/ which starts Greenlets, that are like threads but lighter
put the darn thing together and the benchmark shows 3000 stable connections per second with Siege and real user (load) simulation
notifications ready and chat too, but I'm afraid to benchmark the latter
I'll see what Gevent does right now ...
 
6:32 PM
@vaultah you're on a roll - first a well-received meta post, and now Guido likes a proposal of yours. What next?
btw, cbg all
 
@PeterVaro somewhat. Does that answer my question?
 
6:50 PM
Howdy
 
@MattDMo who knows :)
 
hey vaultah
 
7:06 PM
cabbage @JVarhol :)
 
Cbg to you too
 
7:24 PM
What are you all doing today?
 
writing a book
 
nice
what abouts
 
7:42 PM
@Johnston is it about python?
 
8:08 PM
cbg
 
cbg @Antti
 
8:40 PM
@JVarhol No.
 
8:55 PM
@MattDMo why does PythonImproved highlights PORT like this?
Same for
 
9:21 PM
@vaultah the scope variable.other.django.settings includes all the settings from here, and Neon highlights them with one of the Django green colors.
 
Ah, cool. Sorry.
 
Cabbage all. Any of you happen to down vote a question of mine recently? (stackoverflow.com/questions/25473779/…). Would appreciate a reason at least.
 
9:37 PM
google-app-engine is one of my Ignored Tags. I didn't see your question.
 
9:48 PM
No worries - I don't mind it being ignored, but I was surprised at the downvote. It seems to be a genuine issue that is contrary to the documentation. I asked here (chat) about it a while ago, Jon C agreed it didn't sound right but didn't know/have time or whatever - more searching and fiddling hasn't helped so I asked the question.
 
10:29 PM
It wasn't me!
 
11:25 PM
@OllieFord There are some very literal-minded people on SO who believe that unless the question body contains the character ?, it's not a question. Maybe one of them saw your question ... other than that, I can't see any reason for a downvote.
One regular in (but not this room) in particular has the charming habit of adding the comment "... and what is your question?" or similar to questions that offend him in this way.
 
I believe pedantic is the word.
 
11:46 PM
Ugh. On the contrary, I have a dislike of (mainly just my own - wouldn't edit/comment) question marks in titles
Although actually, I used one in the title there.. heh.
 

« first day (1408 days earlier)      last day (3543 days later) »