« first day (1429 days earlier)      last day (3505 days later) » 
00:00 - 19:0019:00 - 22:00

 
2 hours later…
2:05 AM
Hello
Is there a good way to compare two pairs of values in Python quickly?
I need to compare two X's to two Y's, and then if the X1 is > than X2, AND/OR Y1 > Y2, perform certain action.
Problem being that I've got some long if statements right now
 
2:23 AM
Nevermind, I've sort of resolved it.
 
 
3 hours later…
 
1 hour later…
6:09 AM
Cbg()
 
cbg @Ffisegydd :-)
 
Buh it's too early to be up on a Sunday morning
 
s/early/late/, but yes :-)
 
What time is it there? Midnight?
Midnight on a Saturday is a lot more normal than 7am on a Sunday :p
 
@Ffisegydd I was thinking about that pinned item of mine over there ... DW seems to be the only current ongoing thing people care about spoilers for in this room, but d'you reckon we should have a Spoiler Policy? (I am now spoilerproof for the episode in question, btw). Also: 03:17.
7am on a Sunday can be quite pleasant if you're on your way home from somewhere and able to pick up the makings of breakfast, but otherwise, yeah :-)
Ooh, pretty blue (presumably false colour) rocks!
 
6:50 AM
... and now I think I might actually be tired enough to go to bed. Hasta la etc...
 
 
3 hours later…
10:17 AM
cbg4all
@Ffisegydd I've finished what I wanted
(which was originally scheduled for mid-august, but at least I'm done with it now)
the next week will be about cleaning up my flat -- and relaxing -- but at the end of the week, I will take a look at the sopy site
even if I'm not going to code it, I will create a few mockups, as a base
 
10:38 AM
@Peter awesome. I think Matt is looking at it also so you may want to compare notes. I'll be home in a bit (waiting for a bus) anyway
 
11:21 AM
cbg
 
@Jon BRIIIIIIIIIIAN!
 
@Ffisegydd STEWIE!!!!!!!!! When did I change my name?
 
You did, momentarily you became Korean.
 
It was... umm... quite a moment for me...
So curiosity gets the better of me, waiting for a bus on a Sunday? Who/what/why/where/when :)
 
Are people not allowed to catch buses on Sundays in Jonville?
 
11:30 AM
No.
 
11:46 AM
Hello
What is the common style that programmers use in python to comment a method?
In java it's for exmaple
/**
* ...
* @return ...
*/
What people use in python?
 
Hmm the examples show the blocks inside the methods
shouldn't comments be above the method ?
 
No
 
@Ben it was a design choice by the core devs... there's no reason it should be "above" or "be in"
 
Some Python software (such as IPython) will expect the docstrings to be the first thing inside the method
 
11:56 AM
"being in" means it becomes an attribute of the function and accessible by external/internal tools for use, instead of relying on other tools to work out that a comment is associated with what function
 
I have to make my own website for class. Hrmph.
 
@corvid just tell 'em you did sopython.com :)
then bribe David to agree
 
"but this code is readable and logical... there's no way you did this corvid"
 
I won't go along with your lies! (I totally would, I'm totally open to bribery)
 
@Ffisegydd thinking about sopython.com - when are we updating the chatroom rules as per suggestions?
 
12:00 PM
I've been busy this weekend and so not had chance to do it.
 
no worries - may I be so bold as to make a suggestion re: updating the transcripts?
 
We need a better method than the wiki I think but at the same time I don't think it warrants its own part of the website
But please make your suggestion :P
 
do you guys need any other PRs? I have spare time this semester, tutor 20 hours a week and people are only there ~2 hours
 
you almost read my mind... I was contemplating it being separate, but yes, for its size, barely warranted... however, I was thinking they'd be better as separate entries... not just lumped together in one
 
@corvid go for whatever you're interested in, or if you have any other ideas then let us know
 
12:04 PM
@corvid have a read through the trello stuff - there's a couple of "like to haves" that I don't think are too difficult
I don't know if trello.com/c/9RuviBdU/… is being dealt with
 
I feel like part of the problem is I am not sure what is necessarily worked on or connected to other tickets.
To Do on sopython-site
So "Edited by xxxxxxx on September etc"
 
If people have added their names to it then they're working on it
 
wasn't that part of the logging/database traceback kind of stuff?
 
@corvid the site and nidaba are separate (mostly) projects
 
okay, I'ma take that ticket then
 
12:22 PM
The following returns a set of text , how do i get the total length?
w = 'http://schemas.openxmlformats.org/wordprocessingml/2006/main'
for p in tree.findall('.//{' + w + '}p'):
    print len(''.join(t.text for t in p.findall('.//{' + w + '}t')))
12
32
24
0
0
10
21
That gives me the length for each line.
 
Convert them to ints and sum them?
 
I'm trying various stuffs.. To get word count i did len(t.text.split()) but that wouldn't go with join statement
 
So you're after word count - not character count?
 
Yeah , word count would be better , but character count would also do..
this is what my text is
INTRODUCTION
This is a test document for xml.
Lets see how this works.


Conclusion
It should hopefully..
t.text fetches the above
a suitable question for SO ??
 
Maybe just
def get_words(source, schema='http://schemas.openxmlformats.org/wordprocessingml/2006/main'):
    for p in source.findall('.//{' + schema + '}p'):
        yield ''.join(t.text for t in p.findall('.//{' + schema + '}t'))

print sum(map(len, get_words(tree)))
 
12:36 PM
yeah that worked :D
what did map do?
ohk got it
len for each output.
 
@JonClements In any case yeah splitting them up might be an idea. I need a better way of constructing the markdown rather than "Copy and paste it then manually format line by line"
 
@Ffisegydd on a side note - DSM was asking if there was an easier way to get a transcript dump from the room
I wasn't sure if you'd worked on some scraping tool for that... or...?
 
@Jon Yeah I saw the ping. No I haven't gotten anyway written to scrape the room. It's something I thought about but I don't know anything about websockets so I'd probably have to do it via scraping.
 
I was contemplating asking balpha/meta for functionality that enabled some form of downloading (like the data SE dumps are available - but include the chat stuff)
but I vaguely recall something similar being asked, and haven't gone any further trying to find the post on MSO/MSE
 
12:47 PM
Yeah an API would be awesome
 
I asked about a chat API two years ago... we've just got some attention now on chat changes... so while the momentum's on, these things are the time to ask :)
 
Yeah, shall I ask or do you want to?
16
Q: Provide a streaming chat API

TheLQAs people try and make IRC and XMPP bindings for chat, they all seem to be using the same inefficient and undocumented AJAX based system to communicate to the chat server by simply reverse engineering chat with Firebug. All current implementations are messy, unreliable, and incomplete. And new pe...

 
Well... we've already addressed streaming with RABBIT
And it's a separate process instead of "in browser"
So, I think it's a different question entirely (but yes, that was the post I was trying to recall)
@Ffisegydd can can collab on a Q if you want? Or otherwise, you just ask...
 
1:04 PM
Let's collab as you probably know more of what we would need
 
Okay, I'll draft something as a wiki, then we go from there
@Ffisegydd ugh... got this far: sopython.com/wiki/15
not quite sure how to address it
 
It'd be nice if we could have an actual official api but I doubt it'd happen
 
Umm.. might have found either a bug or a text error on the site: This page is in draft mode. Only editors or any logged in users with the link may view it.
I opened an incognito window - copied the link it - and can see it
 
Can you check the contents page while incognito?
nvm checked it myself. So you can access it if you have the url
 
ahhh okay... so it's not listed - that's fine - and expected
 
1:16 PM
But you can't see it in the contents page
 
so it's just the text that's misleading when you do have a link to it
"Only users with a direct link to this page may view it."?
It has naff all to do with being logged in or being in the editor group for sure :)
 
Yes it does
Cos if I'm linked in I can see it in the contents
I'm putting together a rough transcript scraper for now.
 
suggestions on to how to improve the entry are welcome anyway :)
 
1:33 PM
Hmmm...requests isn't installing on Python 3 :/
 
1:44 PM
0
Q: Adding chat transcripts as an available data dump

Jon ClementsSince the chat system has received a bit more love recently (thank you @balpha), it would appear now is the time to make any suggestions regarding additional functionality. Chat is still an important part of the system (albeit it secondary) and has an emphasis that's it public, so should be avai...

 
Nice puppy
Upvoted.
 
ty
we'll see what happens - I hope I worded it well enough
 
Trying to work out the best way to iterate over messages
 
1:59 PM
wow... f*ing lucky I had my shoes on
 
@JonClements Gotta admit I'm uneasy about that ... I know this is a public space, but to me it's a public space in the same way as a pub ... you can expect to be overheard, but can be reasonably confident that what you said after the fourth pint won't be stored in an easily searchable database for all time.
 
It already is easily searchable though
 
Well, not really. Go grab me everything I ever said here, right now ...
 
2:01 PM
guys the harvest is upon us. Isn't this awesome? (Weird things people from country towns get excited about)
 
anyway... I ignored some banging noise from downstairs
turns out the washing machine had decided to "walk" 3 odd feet forwards
ripping the wall socket off the wall and managed to leave a dangling live wire into the pool of water I walked in to
 
But that's my point. You can easily get what I said in the last couple of days, and if you have a search term, you can see what if anything I said about that. And, of course, with some effort, the whole transcript is available. My point is that I don't want it to be easy to grab everything I've said here and then analyse it for faux pas.
I'm in favour of intermediate levels of privacy ... so I can't expect that anything I say here is secret, but I can expect that it isn't wrapped up in a bow and presented on a plate to any nosy HR department.
Anyway, gotta pop out for a few minutes ... rbrb
 
I have to humbly disagree unfortunately. The fact is that every single thing said in this room is public. And saying "oh it's difficult to find" doesn't make it private. I'm currently writing a scraping script as a small experiment, in 12 lines I've gotten the whole transcript for all time in html. In a few extra lines I should be able to parse out individual messages and save them to a database. This in 20 or so lines.
I'd rather think "Everything I say here is public" because, frankly, it is.
 
I can see Zero's concerns in some sense... but I do disagree with them... we have other ways of communication necessary if what we say is meant to be private
I think most users realise that what you say here is public and always will be
 
I suppose my argument is "The illusion of privacy is dangerous"
 
2:10 PM
make any post on the net and it'll end up in some archive/some mirror/somewhere at some point
There's still stuff I can find of me posted in 1996 or something
 
It's a nuanced thing, I know that ... obviously I know that everything here can be got (and for a competent programmer is easily got). I do feel there's a difference between that and packaging it up - that's an explicit invitation to use it.
Anyway, not gonna downvote or post an anti answer/comment - will limit myself to an expression of vague unease here ;-)
 
:P
 
Sorry for the unease :(
I'm somewhat discouraged that the comment I have from my post is from SK
 
2:28 PM
Hi guy! I got a crazy idea: Build something like AngularJS but in Python :D
 
I've got a better idea.
 
why would you need/want that in python? ;)
 
@Ffisegydd does this "better idea" involve going to the pub?
 
...amongst other things.
 
@ThiefMaster you're alive!? :)
 
2:30 PM
of course :p
 
hehe
if you know angularJS, it's the best framework to build web apps in javascript
I like to build web with python
with the power of angularjs
or...
is there any better thing in Python?
 
@ThiefMaster It was an ironic statement implying I hadn't seen you in a while... while SE is fantastic, I don't doubt it hasn't introduced beyond the grave communication yet :p
 
i think it has - the stupidity of a certain troll must have surely killed him so far but he still manages to talk here ;)
 
If they did have beyond-the-grave they wouldn't add it to chat grumble :P
 
@ThiefMaster persistence is a good trait - generally trying to hit a nail in the wall by using your head is not one I'd use
 
2:46 PM
watches the tumbleweed blow by
Guess it's a take away tonight... since I can't cook as I've turned off the downstairs circuit so I don't end up killing myself... sighs
oh great... and now beep beep beep from some things just to tell me they have no mains power
going to be an interesting evening
 
Get some candles, make an event of it :-)
 
3:01 PM
@Zero indeed... I shall sit downstairs in darkness, surrounded by candles and chant greats things to the Cabbage
I shall call it "oh to have a plumber and electrician do what they've been paid for properly"
I'll record it and it'll be a huge youtube sensation and make it into the UK charts... thus profit from the could have killed myself or the dog, can't cook anything moment
Life's great in Jonville... come join - it's nothing but excitement and intrigue :)
although this beep beep beep every minute might drive me insane, if I wasn't already :)
 
Remember to chant to the rhythm of the beeping ... it'll make it easier to remix.
 
3:35 PM
Bloody beautiful soup...
I've come across the same problem I had a few weeks ago >.<
 
3:47 PM
@Ffisegydd anything I can help with?
 
I think I asked you a few weeks ago and not sure if you had the answer then :P
I'm parsing the html and trying to get it into sensible format, but if I just use message.text then it removes any code blocks inside it (such as <pre class = '...'>jfog</pre>)
 
So what I've done is simply done str(message) and then strip'd some divs from the edges to keep the html there.
 
@Ffisegydd ah yes, I remember now
 
d['message'] = str(message.find(attrs={'class':'content'}))
d['message'] = d['message'].strip("'<div class="content">\n").strip("\n</div>")
d['message'] = d['message'].strip()
 
3:51 PM
Not quite sure how he got those slippers... bought those for a charity drive
 
That doesn't work though :/
 
wore those, and a skirt and bra and dressing gown, had a girlfriend do make-up and then had to go shopping for at least an hour in aid of Marie Curie
surprised I wasn't escorted out the shopping mall
 
@Ffisegydd str.strip() removes every character in the string, not the string itself:
>>> "<a><b>foo</b></a>".strip("<a>")
'b>foo</b></'
 
@Zero yeah just realised that.
 
@Ffisegydd you newb :)
 
3:55 PM
The div will always be there so I can slice to only take the stuff inside
 
It may well be possible to just adjust the logger.py that's already on github and provide it different l=
 
Yeah this was more of a script that could be run to get it up to date
 
That way you get JSON responses
 
It takes all days from the start to yesterday and adds the messages
 
You're thinking a one-off bulk load process, then go from there?
 
3:58 PM
Yeah to get the history, then have a logger keep it going in real time.
Shame the history doesn't have timestamps.
 
@Ffisegydd got some code you can put in a gist so I can look at it?
 
Gimme a sec to put this string slicing in
Then yes
For the moment it just makes a list of dicts for each day and does nothing with it.
 
@Ffisegydd are you working on this by any chance?
Features on sopython-site
Give it a start and end permalink from the transcript, it returns all the messages between the given points. Select which messages to extract into an official transcript.
 
@davidism kind of. Not officially as I don't have any idea how to do the front-end side of it. But I was thinking about the back-end.
 
Yeah, even just the backend will be good, produce a list of messages and we can do the frontend later.
 
4:06 PM
Yeah that was my thought. Not sure what database to store it in.
Probably postgresql as the rest of it is stored in that.
We have id, user_id, user_name, message, date as columns
 
Yeah, just add a new model like that.
 
Where id is a unique message id which is unique across SO (possibly SE)
 
I just leaned over to pick something up and my back has spasmed
 
One thing I forgot to think about is the user_id isn't the same across sites (so and chat seem to match, but meta doesn't). Need to figure out how to match them if we use more than one site eventually.
 
@davidism there's an account ID - that's unique across all SE
 
4:10 PM
@Jon lean backwards to balance out the damage
Yep, didn't notice account_id in addition to user_id before.
 
I'm trying to think of a reason we didn't use that before...
 
Because there's no way to search it or get users by it, now that I look
The api does everything by user_id
 
I'm not quite sure how to handle the messages as some of them have html such as '<pre class="full">What I mean is, if\r\n`\r\n class A:\r\n @staticmethod\r\n def m():\r\n pass\r\n`</pre>'
 
I'd say store it as is. We can use Pandoc to convert HTML to Markdown later.
 
Yeah that's what I thought (a problem avoided is a problem solved)
 
4:16 PM
@davidism I'll have to check, but an account id is an available look up on the api
 
It is yeah, but it's not used anywhere else publicly
 
yeah, show me where, that would be nice. right now it seems impossible to get a user's account on another site
 
Then I believe you can get user_ids for the associated accounts
 
yep /users/{id}/associated
 
I have a feeling that that's why we didn't bother with it in the first place... since we just wanted to do SO accounts for the first case
 
4:21 PM
yeah, but I'd rather have the most general data and use it to get the so data
 
Until we had the now awesome @davidism to lead the site, we just adhoc'd
Oh - apparently we've got 53 registered users on sopython
 
Hmmm need to pop to the shop soon to get some noms. Looking at the database stuff I don't really have any experience in making a new model for the db or doing migrations stuff, I'll get the script finished anyway and get what data I can from the scraping.
Not sure if the websockets have time data but the transcript doesn't, meaning we won't be able to do a "retrieve me the transcript from this timeframe" like the Trello card originally suggested.
 
if you're scraping, you can look at the start message id and end message id, that's what I meant on the card
if you want a rough timestamp you can just keep track of the last monologue with a timestamp attached
@Ffisegydd get on slack later and I can walk you through creating a model and migration
 
Ok cool.
 
@davidism @Ffisegydd is it okay to join that discussion?
 
4:33 PM
sure
 
if I'm not too drugged up on pain killers that is :)
it might be possible to amend the wonderfully badly indented and written in about 10 minutes in a rush code from github.com/sopython/rabbit/blob/master/login_and_log.py
 
5:08 PM
arhghghg.... only getting near dial-up speed at the moment
s'pose to have 24mb/s
ahh there we go, 21mb down, 1mb up
tempted to phone the provider and ask what happened, but it'd most likely be completely pointless an exercise
 
hrmph... angular has some weird problems.
 
hi @JakubSzymion
@corvid well - it's the best of the worst :)
 
indeed, it's not terrible but it is still... javascript
 
had to choose a UI thingy, I chose for much dislike angular over dust
 
yeah, at least angular is pretty fast. Just a pain to write
 
5:15 PM
picked up a client that had pretty much everything written in JS and had the client's browser do all the work
and not surprisingly - it broke quite quickly
 
have you used angular's animation system at all?
 
@corvid I generally just avoid front end stuff
I just know enough to be able to fix/tweak/debug things
certainly not the guy to come to if you need some JS or related framework from scratch
 
oh it's up. My goal is to make front end extremely minimal, to be quite honest
I feel like there's some kind of pitfall to focusing on front end too much, at least in my experience
 
I know a few people that can make JS fly, do wonderful stuff natively or with frameworks... and wow... do they look awesome
I just tend to know enough about it to address issues, and focus on the nitty gritty of the stuff that works "behind the scenes"
which actually, due to work of mouth and reputation (so doesn't really apply to me), makes it very hard to find new job roles... as if all you do is something you can't disclose or show...
@Ffisegydd STEWIE!!!!!!!!!!!!!!!
trying to decide if I want indian/chinese or a kebab
or just run an extension cable from upstairs so I can power the microwave and shove in some lasagne I made last week
 
5:35 PM
@Jon BRIIIIIIIIAN!
 
ah balls - just thought... how long will food stuff last in your fridge or your freezer without it being turned on
 
Had a nice Indian last night. Some of the best vegetable samosas I've ever had.
@Jon if you don't turn it on? Days.
 
Seeing far too much "Discard" for my liking
 
Yeah I personally would not follow that advice.
"No more than 4 hours" pssh.
 
I'm going for 10am tomorrow will be fine
woo hoo... another text message about the accident I didn't have that I can claim for
 
5:48 PM
I didn't own a fridge for five years ... can pretty safely say a lot of that "discard" advice is rubbish.
 
@Zero kinda my thoughts... the kitchen's generally about 10c anyway
(if that)
no heating is on, so a door on the fridge or freezer should be "sealed" - should be okay for a lot longer than 4 hours
 
If something ends up partially defrosted I'd avoid refreezing it, but in Bolivia a lot of the people selling meat don't keep it in the fridge, and they don't all drop dead.
Same would have been true in the UK not all that long ago.
 
@Zero my grandmother had a "cold store"
 
Yeah, mine too! :-)
 
then you use to take stuff from there to the "larder"
and when it got dark, one used to use "lanterns"
then someone came up with the crazy idea of electricity in a house
 
5:56 PM
Hmm, I could have explained CPU cache, main memory and HD storage to my grandma in terms of kitchen, larder, cold store ... that would have been quite cool :-)
@JonClements "... and none of that television ... if you wanted entertainment, you tormented the slow lad down the street ..."
 
ah... there was always some family that had enough money to buy a TV that you all joined in to go and watch
 
That's a little before my time, but I do remember having a black & white TV.
 
in those days, you had enough entertainment from running to bomb shelters and hoping you had a house to go back to
 
I never really get how to manage checking user roles and stuff in angular.js
 
@Zero do you remember Radio Rentals?
 
6:02 PM
Ha! Yes :-)
In fact I remeber going in with my dad to move up to a teletext TV :-)
 
ahh... good old teletext and ceefax and just having 3/4 channels :)
 
Me and my little sister were very excited that we got to see Channel 4 being switched on ... and thus began a long addiction to Countdown.
 
I remember as a kid watching Blockbusters in B&W 'cos mother and father couldn't afford a colour television
 
Countdown is amazing.
 
@Ffisegydd as soon as Richard passed... I stopped watching
 
6:05 PM
Yeah it's not the same since.
 
Am now quite out of touch - saw a couple with Des (he's gone now, right?)
 
I was never very good at the words, quite good at numbers though.
 
I remember watching that episode - my mind was just... wow omg
 
One of my very first programs that was my idea (rather than an exercise from a book) was the numbers game.
 
I couldn't have done that in 30 seconds, probably could have worked it out in 2/3 minutes... but...
Wow - got my first Guru badge
 
6:13 PM
gratz :-)
 
on MSO though
Since I only remember the meta answers, don't remember answering the other stuff... not bad going
1792 answers... wow
small fry to the ninja... but wow
 
I'm getting close enough to 10K now that I've already discounted the sense of achievement, and am instead looking with awe at just how far away I still am from a gold python badge.
 
@Zero best perk at 10k is being able to see deleted posts and access the review queue histories and such
 
I wants it...
 
Am I right in thinking you can't choose to un-see deleted posts?
 
6:22 PM
that would be correct
they go down to the bottom anyway
 
I'm looking forward to the sense of privilege, don't get me wrong, but SO must look a lot more like an ocean of dreck with the deleted stuff included.
 
@Zero actually, it's quite amusing - people self delete answers (that are either stupid or a duplicate of another one posted a few seconds before)
 
I've only rarely self-deleted - IIRC only when something was Just Plain Wrong and there was already a correct answer.
 
at 10k you also get delete/undelete votes and access to a different queue
 
That looks quite handy.
 
@Zero same kinda stuff for delete votes ^^^
at 15k you get to "protect" questions
imho the most worthless ability ever
 
tag wiki? :P
That's pretty awful.
 
It doesn't seem to get used much, anyway ... mainly for offtopic+historical.
 
tag edits you can do anytime
but it's only at 20k that you can do an edit without it being reviewed
also, what I find amusing is that a 10k user has to wait 48 hours for a question to cast a delete vote
while a 20k user can cast an immediate delete vote on anything -3
and 20k users can cast a delete on any answer that's not positively scored
you can vote to re-open but not un-delete a mod's action... if a mod deletes a post for instance, you can't even vote to undelete it, that's it - it's final...
puppy wants food :(
 
00:00 - 19:0019:00 - 22:00

« first day (1429 days earlier)      last day (3505 days later) »