« first day (2022 days earlier)      last day (2920 days later) » 

7:00 PM
Our software is for municipal governments, and they're all still scared of the internet.
 
Oh, cool. Everyone has their thing I guess..Maybe down the road thats something i'll get into.
 
@tristan blimey okay...I hope you at least designed your own networking hardware.
 
user559633
@RobertGrant FUPM over TCP/IP actually.
 
Impressive.
I stick to only mentioning my skills verbally, as Fool's Stack Developer can look bad written down.
 
7:22 PM
Can someone please explain the concept of days to the postal service? This package was supposed to be delivered yesterday, and still says it will be delivered yesterday, but it's a state away and will be delivered tomorrow at the earliest.
 
DSM
Maybe they only report when things are or were supposed to have happened.
 
few weeks ago I ordered a nail grinder for my bitch, it told me it would arrive on the pre-determined day, at 8 PM...
I mean, the tracking system told me that
then it reverted to "on its way" and stayed that way for the rest of the two weeks:D
 
Sorry, a nail grinder for your what?
 
Ah :)
 
7:28 PM
she's a wire-haired dachshund
 
7:56 PM
Hello
 
cabbage @danidee
 
oh sorry cabbage! :)
i was just wondering what's the advantage of python3 converting the results of all divisions to floats
e.g 4/1 returns 4.0
 
4//1
 
caused me a lot of problems recently...i just saw a question that reminded me of it today
 
I guess it's so there's a consistent return type
 
8:01 PM
porting python2 ==> 3
 
Time to sleep guys, Rhubarb
 
@BhargavRao you're in the wrong timezone....it's time to wakeup!! :D
 
@danidee Going to bed 2 hrs early. Almost 2AM here :P
 
@RobertGrant never knew 1/2 returns 0 in python : o
Now that's really weird
and inconsistent
 
8:08 PM
Integer divison always floors results
Which is unitiuitive, probably why they changed it
 
What framework is everyone using for python?
 
@SeanParsons for what?
 
I should've specified, for web.
 
disregard inconsistent....i can't even remember that (integer divisions) about python2
 
I've used flask, django and pyramid. All three are used by people in this room
 
8:10 PM
i guess i've not really paid too much attention to python2
 
If you're starting with python then a good option is Django for a more full-fat framework, or Flask for a more DIY approach. Pyramid isn't for beginners (or not this one).
 
i thought it was for only 'perfect' divisions
 
I've enjoyed Django, it's great.
 
DSM
Let a thousand flowers bloom.
 
even though i don't have much experience with Flask. i kinda prefer it to Django to learn for beginners
Less 'Magic' to understand
which can be tough at times
 
 
1 hour later…
9:42 PM
aye
 
9:58 PM
Please don't tell people to start with django @RobertGrant.
Its too much for beginners to take in at once.
 
I took it in. Wasn't too much.
 
the routing, the orm, the settings file wasn't too much? Did you have previous experience with another web framework?
 
then that makes sense.
but for a first web framework (ever) its a terrible idea.
there's just way too much in there
 
Okay, but that wasn't the context
 
10:02 PM
@RobertGrant he isn't a noob?
 
Wasn't specified. I definitely wasn't answering the question, "What's a good framework to learn as your first ever one?"
The history is right there.
 
ahh, framework -> web framework -> django. No "first" framework. I see, my bad. Sorry.
But django sucks anyways. :P
 
No worries
 
Can't do tomorrow @Robert
 
Monday?
 
10:12 PM
Probably not mate, sorry. It's a bit too short notice for me with bank holiday plans for the kids. My bad - I know you mentioned some time around the end of April a while back and I never followed up.
 
Not to worry - it was very likely I'd have moved this weekend and at the last minute I did it last weekend instead
 
i just got attacked by a serial downvoter
someone was really upset with me : |
 
10:27 PM
@danidee With 23 downvotes in very quick succession, they'll almost certainly get auto-reverted.
Not sure how long that usually takes, scripts to detect it at SO end will probably run once per day or so. Did you insult someone about an hour ago?!
 
No....i didn't
i only made a comment on why an answer wouldn't work and downvoted
okay everyone
Good night!
 
Some (strange) people are strangely sensitive to such things. Don't worry about it - it'll probably be fixed automatically.
Good night!
 
hi all
anyone knows how to create an generator that polls a queue
my usecase is
for x in iter
where iter may have stuff added
later on
anyone knows ?
 
10:46 PM
Hard to know what you're asking
 
how do you iterate on stuff that you recieve via network
 
I wouldn't think you can do that with a generator
you have to store the stuff that comes in, don't you?
 
i have a handler that adds on to a queue
 
and if you do, just use a list
or a queue or something
 
yes but list/queue stop executing after it reaches last element
 
10:48 PM
but I'm admittedly unclear about network stuff
 
how to wait for next
 
So you could have a generator function that does queue.get() or whatever
 
so the issue is modifying the object you loop over?
 
for loop uses queue.get i think
how to modify that
 
But I think you probably should have a callback on data coming in rather than polling the queue all the time
 
10:50 PM
i agree but stuck with a library that needs an iterator
 
So maybe make a generator that does queue.get
 
Although what happens when the queue is empty but you're not ready to stop your program is up to you I guess
 
any example how to make generator from queue
 
Just look up a generator in general
 
10:51 PM
@RobertGrant do you think it would be possible/feasible to do something like a generator function, that mutates a list by appending each queue.get() result before yielding the "next" element of the list?
 
Can't it just yield the queue.get() directly?
 
(I'm asking as a curious python noob)
 
I mean I'm sure it could do that with the list if necessary - what would the list be for?
 
well if the queue.get() keeps becoming longer and longer (rather than returning individual chunks of the stream), I guess so, yeah
so I thought that having something like yield from queue.get() will call queue.get() for each iteration
is that right?
 
Yeah I think so - not so familiar with yield from but I believe that's how it works
 
10:55 PM
so, I assumed that queue.get() works like this: in a time t1, it returns, say, [data1, data2], and in a time t2(>t1) it returns [data3, data4]
in this case, I'd think that you should store each call to queue.get(), unless the generator syntax does something magical and remembers each output from each queue.get() call:)
 
Heyyoo ^_^
 
Does it need to remember the previous stuff?
 
Now, if queue.get() is such that in t2(>t1) it returns [data1,data2,data3,data4] instead, then it's surely fine to yield from that
@RobertGrant if you don't want to lose data2, then I'd think so, yes. Again, unless the generator takes care of this for you
where the "I'm a noob" card comes into play;)
 
Well I guess it depends what he wants to do, but I think the idea is he has a for loop hitting the generator and doing stuff with the data in turn
 
I guess I could just test this, but I'm answering a very important interview for a students' magazine at the moment:D
 
10:59 PM
It definitely won't keep the data by itself; that's mostly the point of a generator
I was just saying he could keep the data himself when he gets it out of the generator if he really wanted to
 
i need something like this then
def generator():
item = queue.get_nowait()
# print item
yield item

for item in generator():
print item
 
@user568109 you can press ctrl+k in chat to auto-indent your message, making it code-formatted
it will spare your whitespace
alternative is the "fixed font" button that appears if you enter multiline text
also: does queue.get_nowait() return a single item?
if so, then this should work fine, I think
 
def generator():
    while True:
        item = queue.get_nowait()
        # print item
        yield item

for item in generator():
    print item
this works
earlier one only returned once
i have a question though how often is generator returned
 
Yeah because you didn't have a loop in it
 
hmm
 
11:06 PM
It returns a value every time your for loop... loops
 
i mean it runs only when iterator asks for data right
Just checking if while true wont busy loop forever
 
No it won't
What happens when the queue is empty is anyone's guess
Or a few people's instant know
 
ok thanks for the help
thanks andras
 
Not sure what will actually end your for loop; you may have to try it
 
No problem, but I didn't do anything:P
if the loop keeps returning None, you might want to break out from it or something
nevermind, I really don't know what I'm talking about
and guesswork is not the best programming practice:)
 
11:18 PM
27 mins ago, by Robert Grant
Although what happens when the queue is empty but you're not ready to stop your program is up to you I guess
:)
 

« first day (2022 days earlier)      last day (2920 days later) »