« first day (2021 days earlier)      last day (2932 days later) » 

12:00 AM
@Anna by papaya do u mean pawpaw?
 
i just picked a random fruit, seemed like fruits would oppose vegetables much like dinosaurs would oppose the porcine
anyway rhubarb sorry i accidentally a bean
yammit
 
Hahah
 
user559633
do you need me to call someone? do you smell toast?
 
1:12 AM
@PM2Ring Thanks for the comprehensive answer!
 
What's a good word for the replacement of culture by colonialism
 
@Natecat McDonalds?
 
??
 
I guess it would be a kind of assimilation, but assimilation usually implies that the minority is being assimilated
except if you're Borg
 
Yeah I was more looking for something along the lines of gentrification but applicable to colonalism instead of rich white folks
well I mean I guess they both involve rich white folks
 
1:21 AM
can't help you with that, my English is way too insufficient for subtleties like this
 
I think I'm gonna post on English Language & Usage
 
good luck
the most reasonable answer is cultural assimilation
though you might mean something else
 
Ooh I like cultural imperialism
 
sounds very...underground
 
user559633
1:38 AM
>___>
 
@tristan go to sleep:P
I am going, good night:)
 
user559633
Have a good one :)
 
1:54 AM
oh nevermind, you didn't actually say you were going to sleep, just away for a while
it's not even that late for you
(4 AM here soon)
 
Why does everyone here yell out vegetable names all the time
/ fruit
 
user559633
yeah, it's only 10pm here now. I think I have about 3 more hours of work in me before I call it quits for the night.
 
user559633
@Dominico909 silly optional language sopython.com/salad
 
user559633
you'll find that most people only use "cabbage/cbg" and "rbrb/rhubarb"
 
I started out like that too, at ~ 11 PM
too bad my progress asymptotically diminishes after 2AM:D
and with that, rhubarb
 
2:18 AM
that's funny
Yam!
 
user4268046
2:31 AM
Greetings, I'm trying to install the module xmpppy, however when I use it, it claims that I am still missing modules.
 
Does it just say no such module is found?
@BinaryBench
 
user4268046
It does indeed
 
Anything else in the error?
 
user4268046
Wain no, it says "no module named"
 
user4268046
" import simplexml,protocol,debug,auth,transports,roster,dispatcher,features,browser,filetransfer,commands
ImportError: No module named 'simplexml'"
 
user4268046
2:37 AM
I was able to fix this by doing pip install python-simplexml but then it just came up with another.
 
user4268046
@Dominico909 Indeed, however simplexml instead of debug
 
Wait so what happened after you did: pip install python-simplexml
 
user4268046
@Dominico909 same thing, but with protocol next
 
and then did you install that?
or attempt to install it manually?
 
user4268046
2:42 AM
@Dominico909 Well, I was hoping there would be a way that did not involve installing them all manually
 
Would you be willing to do that? Won't take too long
 
user4268046
 
user4268046
I mean I'm not sure which one to install
 
OOhh you get an error for all those?
 
user4268046
I'm not sure if I will, but so far I've gotten it for the first two
 
2:45 AM
try a few more and tell me what happens
and then ill try to install myself
 
user4268046
Well, which am I supposed to install for protocol?
 
user4268046
 
what install tutorial did you follow
 
user4268046
I'm just trying to get this to work atm:
 
user4268046
38
A: Send an xmpp message using a python library

Nadia AlramliThis is the simplest possible xmpp client. It will send a 'hello :)' message. I'm using xmpppy in the example. And connecting to gtalk server. I think the example is self-explanatory: import xmpp username = 'username' passwd = 'password' to='name@example.com' msg='hello :)' client = xmpp.Clie...

 
2:53 AM
so you're trying to send an email using xmpppy?
in python
 
user4268046
Well, to start I'm trying to send a pm with xmpppy
 
user4268046
I eventually want to write a bot for my livecoding.tv stream
 
Ahh gotcha, I don't know much about it so I can't help much. But you can try using sockets in python for stuff on your own network
and smtplib for mail
otherwise someone else will hopefully come and help ya
 
user4268046
wouldn't a xmpp lib be easier & faster
 
It should pull dependencies
try reinstalling xmpppy
 
user4268046
2:59 AM
@Natecat ok, I'll give it another go, but I've already tried
 
through pip?
 
user4268046
well, through pycharm, but all that does is exicute pip commands
 
Are you on linux?
 
install in cmd or terminal
 
user4268046
I'm on windows 10
 
user4268046
3:02 AM
and ok, I'll give it a go
 
user4268046
Same result.
 
in cmd? what did it say again?
 
user4268046
"Traceback (most recent call last):
File "D:/Projects/Python/cross-bot/xmppbot.py", line 1, in <module>
import xmpp
File "C:\Libraries\Python\Python35-32\lib\site-packages\xmpp\__init__.py", line 29, in <module>
import simplexml,protocol,debug,auth,transports,roster,dispatcher,features,browser,filetransfer,commands
ImportError: No module named 'simplexml'"
 
user4268046
3:23 AM
Any ideas?
 
Have you installed simplexml?
 
user4268046
Well, I tried but then it asked for protocol
 
@BinaryBench how did you install xmpp?
 
user4268046
pip install xmpppy
 
user559633
3:41 AM
 
3:55 AM
cbg
 
 
2 hours later…
5:44 AM
stackoverflow.com/questions/5899826/pyqt-how-to-remove-a-widget/… (pyqt question answered with C++ that wouldn't even help Bjarne Rossum and Guido Stroustrup.)
 
6:06 AM
CBG all.
 
APZ
6:55 AM
Hi all
I am new to Python and need some help
I am writing backend (REST API using Flask) for a Android app (Simple content posting app). I need advice in implementing a notification feed where a user can see all the activities related to their posts, for example: if some one commented on user's post it should show up on this feed. Also, there are some activities in this feed for which we need to show notification even if the user is not using the app (similar to push notification).
I am new to Python and understand that a part of this can be achieved by Push notifications(GCM) but what should be the logic for showing events in feed wh
 
7:10 AM
@APZ now that's kinda broad... especially if your notifications need to have links to these objects, and if the notifications need to be translateable
 
7:20 AM
Morning, pythons.
 
morning
 
7:38 AM
@JRichardSnape Morning beard-man.
 
APZ
@AnttiHaapala I am not really sure how to narrow it down, need some guidance here please
 
@APZ first just store in db the notifications as (timestamp, receiver, thetextofnotification)
 
APZ
Ok, my take on this: When ever user opens the app, I can grab all activities (with links) since the last time user hit that endpoint and do a count of them and show them to user in the app.
@AnttiHaapala ^^
 
@APZ it took me days to get it right myself and you really expect me to explain it in a chat in few lines...
 
APZ
Well, atleast you are trying to help a new comer out :)
 
8:11 AM
Cabbage!
 
8:31 AM
> Hi Patrick,
>
> I am a Developer Relations engineer at [redacted], we are working on improving developer recruitment. We have analyzed your open source contributions on Github and […]
I don’t think you have… because my public GitHub contributions are a bit sad.
 
"Developer Relations engineer"
At least capitalise the "engineer" in your made up title.
 
haha
 
Heh. Someone flagging the fact that their room has been frozen.
 
It’s a bit weird that a tech recruitment firm based in Spain is trying to recruit a German living in Germany… for a company in Germany.
 
United States of Europe!
 
8:48 AM
Mornin' cabbage
 
Cabbage
 
Hello.
 
9:04 AM
Anyone interested in developing a Python module for calling Mathematica?
 
@innisfree what's your budget?
 
We have very attractive consultancy prices.
 
95 € / hour here, VAT not included.
 
Lol 0$
 
As a special offer, if you're new to stackoverflow or Python, my rate is 125 € /hour
 
9:10 AM
Actually this probsbly does the job well
 
I'd take that offer, if I were you. I charge £200 / hour.
 
Hmm.. __author__="""\n""".join(['Benjamin Edwards (bedwards@cs.unm.edu)'])
 
@AnttiHaapala uh, what?
 
@MartijnPieters the first actual line from the code that @innisfree found
 
That’s a very flexible way to add new authors..
 
  .-'---`-.
,'          `.
|             \
|              \
\           _  \
,\  _    ,'-,/-)\
( * \ \,' ,' ,'-)
 `._,)     -',-')
   \/         ''/
    )        / /
   /       ,'-'
I saw.
 
Although I personally don’t think that pressing enter inside a string is any worse..
 
yeah, how about:
__author__ = """\
Benjamin Edwards (bedwards@cs.unm.edu)
"""
though actually I guess it shouldn't even have multiple authors in that
 
Yeah but that isn't a one liner and therefore is inferior.
 
@antii yeah that struck me as rather unusual
 
9:15 AM
@innisfree alas your spelling of my name strikes me as rather usual
 
@Ffisegydd __author__ = 'Benjamin Edwards (bedwards@cs.unm.edu)'
 
Oops!
I wrote my own interface via subprocess, but there is an API called mathlink that looks interesting
 
@AnttiHaapala but the join won't add even a single newline, so you'd have to put the closing """ on the same line.
 
Doing stuff by subprocess seems inefficient/a hack. I'd rather something more elegant, but it looks like mathlink was abandoned by Wolfram
 
@MartijnPieters yeah noticed that too late
@innisfree the code you found uses mathlink...
 
9:39 AM
Yeah, I might try it, but installing mathlink could be a pain as it hasnt been updated for about a decade. And even then, that Pythonika relies on converting things to strings. E.g. to pass a float 1E3, you convert it to string and then replace E with *10^ as that is the Mathematica format.
Feels like there should be something better than that
 
yeah, ditch mathematica :d
 
Lol nope. It's unbelievably powerful for some tasks
 
10:10 AM
Oh, there's my "you're on GitHub, here's a job" email
 
I'm on Github but I haven't gotten a job ;___;
 
They fear FizzyCorp, that's why.
 
They've heard what we do to poachers round here.
 
Put them in a weird little parchment bag and suspend them in boiling water?
 
We poach their figgins.
 
10:20 AM
Oh my
 
Cabbage!
 
@innisfree that's a paddlin'
 
11:09 AM
@RobertGrant what's a what?!
 
I have a list of Workshops, each having open_days (Monday, Tuesday etc.) and open_time and close_time (which will be same for each day). Now, Based on the current time, I need to find out next 7 days available slots. A slot is of 2 hour and is available if any of the workshop is open in that 2 hour time. The first slot of each day will start at the open_time (nearest to hour time for eg. if open_time is 09:23:54 then first slot start time will be 10:00:00) of workshop opens first on that day.
Can you please suggest a pythonic way to do this?
 
Not gonna lie Anuj, but that smells like a homework question
 
No, It's not. Can I post the corresponding stackoverflow link?
It's a problem I am facing in one of my project.
 
How old is the question?
 
11:24 AM
8 days old
 
Go for it
 
1
Q: Get time slots from db based on multiple stores

AnujI have a Workshop table which has off_days, open_at, close_at, name columns. There is another table which is WorkshopHolidays which has holiday_date, workshop_id. class Workshop(models.Model): DAY_CHOICES = ( (0,'Monday'), (1,'Tuesday'), (2,'Wednesday'), (3,'T...

I have solved it half way. But facing issues with it.
 
... why aren't you making more use of filter?
 
How?
 
workshops = Workshop.objects.all()
You just grab all the workshops. Start pruning things at a "database" level
 
11:35 AM
Hi guys is here place to ask question about technical issues?
 
No
 
So, case in point:
workshop_holidays = WorkshopHoliday.objects.filter(holiday_date__gte=datetime.now())
workshops = Workshop.objects.exclude(workshopholiday__in=workshop_holidays)
Disclaimer: not actually ran this code
This'll exclude all the workshops with up-coming holidays
 
agree I can do that
 
You can chain various criteria together using the above method
It's much clearer than having a dense bloc of code
 
Ok
Let me try to filter as much I can
 
11:39 AM
Also - give your foreign keys reverse names for sanity's sake.
 
Ok
But I don't need workshops as output
I need the time when they are available as output
 
You'll have the workshop as an output, from which you can very easily get the time
 
I don't understand
Can you give an example?
 
Okay, let's say we have a QuerySet output which has a list of all the valid workshops (excluded historical workshops, ones with up-coming holidays, etc)
 
If I ran this query for each day, don't you think it will be overloaded
Yes
 
11:45 AM
Let's call it valid_workshops
 
Ok
 
And we've also constrained it to get the next 7 days
 
Yes
 
valid_workshops.filter(open_at__gte=datetime.now()) -> eliminates ones that have past
 
ok
that will not work
 
11:50 AM
Oh. That's the opening time for the venue?
 
Yes
 
Imho - you need to redesign your models then
You've combined multiple different concepts into a model.
That's your problem
 
Because that's the data which will be available to me
 
Doesn't mean you can't structure it differently
 
for each workshop, I would only know it's open and close time and whether it will be open on that day or not
Could you please suggest a better way to do this?
 
11:53 AM
You know it's not a crime to generate your own meta data?
I'd suggest calling that model a 'Venue`, has opening times etc
And have a separate BookingSlot or WorkshopSlot model that is generated.
 
how will those two will be generated?
 
Venue would be closely based on your current Workshop model
 
Right
 
The BookingSlot would depend on how your system runs
 
will it be actual table
 
11:57 AM
Yeah
 
But one booking will have only 1 slot
 
So this isn't for an end user to book attendance at a workshop, it's for a workshop organiser to book a workshop at a venue?
Doesn't change things really.
What it would do is allow you to easily to determine if something is booked. You could have a model that has a BooleanField that indicates if it's booked or not
 
This is for end user to book a slot for his car repair at workshop
and all workshops are under one brand. So we will show all available slots
 
Right, that kind of workshop.
 
even if one workshop is open in any of slots, we will return that
this is to find out what slots are available (in any of workshop) in next seven days.
slots currently are of two hours but may change in future.
 
12:04 PM
So, do all workshops just have one "bay"?
Ie - only one car can be repaired at a time?
 
For now, we are assuming that each workshop has infinite bays
and if the workshop is open, that means it can take the car
 
That's a terrible assertion, because that means when you DO implement bays, you'll need to rejig your entire system anyway
 
Yes. But a bay availability will depend on multiple factors.
and those factors are still not clear to us
And we are a startup having very less booking at this time. So we are assuming that if workshop is open, then we can take a booking.
 
Why not just do it right the first time around?
It's not a lot of additional effort?
 
it is. But we don't know the average completion time of a car
 
12:09 PM
So if that changes, then your business logic is all tied up in the depths of your code.
 
Yes
I can make it configurable if possible
by adding that to a table.
 
Even if you just specified the number of bays in your Workshop model, you could do things like
 
It would be adding another parameter to logic (in query or code however i proceed)
 
12:25 PM
Okay, this is starting to eat up major room real estate
Moving it into a private room
 
12:56 PM
what's the link for canonical answers?
 
DSM
Morning cabbage.
@snakecharmerb: sopython.com/canon
 
@DSM cbg
 
@dsm thanks
I'm sure stackoverflow.com/questions/36915323/… is a dupe but can't seem to find a good dupe target
 
anyone here going to pycon us?
 
good morning you cats
 
DSM
1:05 PM
@GamesBrainiac: I think Martijn was. Can't remember about anybody else.
 
I think I'll be going. It'd be awesome to meet up with a bunch of you guys.
 
@MattDMo So tempted to reply "You may not. If you do, it is likely to cause irrevocable damage to your hardware"
 
yeah...
 
DSM
Maybe "copy" either wasn't the verb intended or wasn't the only verb intended, like the OP meant "copy" as "copy and then tell ST to use the version in the new location" or something.
 
1:11 PM
we could get into an argument about it in the comments
I'm pretty sure he wants his portable install to function the same way as his previous regular install. Copying the tree he indicated will do that. It's still a weird question....
 
I suspect it really means "Will sublime text work if I do X", but the phrasing...
 
I'm putting this on a tshirt:
> I'm not sure whether this operation.
 
DSM
Ehh, that doesn't seem that strange to me. Some programs I work with handle relocation nicely and some don't..
#benefitofdoubtThursday
 
Cabbage
@snakecharmerb It can be hard to find good dupe targets for stuff that basic.
 
@PM2Ring yeah I gave up :(
Cabbage!
 
1:17 PM
I think they've tried to install sublime to a portable memory stick
Or something?
 
@IntrepidBrit no idea. Sublime does ship a "portable" version for Windows that you can unzip anywhere and use.
 
Blini cat is my spirit animal
 
Hey @DSM. Remember that bipartition problem direprobs posted a day or so ago? acm.timus.ru/problem.aspx?space=1&num=1106 I tried to convert it into an Exact Cover problem, so I could just throw it at an Exact Cover solver, but I failed because I couldn't figure out a way to handle a person having multiple friends on the other team. :( So I ended up just doing a simple brute-force test on partitions.
 
DSM
@PM2Ring: it's only 9:30 AM here, my math brain isn't on yet. :-) I might have another look at that this afternoon to see if I can make my original idea work, but first I have to handle some career-y stuff: starting to schedule interviews, etc.
 
@DSM Not a problem!
 
1:30 PM
@DSM FizzyCorp has a Canada office...
 
FizzyCorp is ominpresent, it would seem.
 
@GamesBrainiac I need to convince FizzyCorp to pay for me to go to pycon uk.
 
Good luck @DSM
 
DSM
@JRichardSnape: just like fizzy! That's fizzy as in the adjective, not Fizzy, who we know is very localized.
 
1:33 PM
I've only used Exact Cover a little bit, and my brain still finds it hard to map problems into Exact Cover form when the mapping isn't straight-forward, like the usual examples of latin squares, polynomial tiling, or graph colouring. I guess I just need more practice...
 
Hmm Pycon UK, eh. That sounds like something I could potentially put against a researcher's travel budget...
 
@JRichardSnape Doooo it.
We could be brogrammers.
 
But in my research I stumbled across this rather nice Python3 Exact Cover class: garethrees.org/2015/11/09/exact-cover
 
Caerdydd as well. Been a while since I was in South Wales.
 
DSM
Gareth! I remember being astonished the first time I came across him in a Python context, I only knew him from rec.arts.int-fiction.
 
1:37 PM
Not sure whether I'd get a hotel or train in/out as it's only an hour by train.
 
@Ffisegydd I'm going to try and convince my company to do the same for me.
Its gonna be fun.
Going to pycons is always so damn awesome.
 
cabbage
(I think that's "hello" here?)
 
DSM
For us traditionalists, yes. ;-)
 
@enderland "Hello" is "Hello" here for us normal people.
 
and I think rhubarb is "goodbye" ?
 
1:39 PM
Again, "goodbye" is "goodbye". You don't have to use Salad if you do not wish to.
 
It looks like antti bumped up his rate while I was gone.
so anyone got any good topics that I can steal and claim as my own?
 
"Unittests: What are they good for? Absolutely nothing." will be my talk.
 
say it again
 
:D
 
@Ffisegydd not sure if serious or trolling. :P
 
1:48 PM
I'm making DNS queries. It works in ipython but not when I run as a script. WTF.
 
@Wally Kill your ipython kernel and re-run your code from start.
 
rand_txt = open('rand.txt', 'r')
url_list =  rand_txt.readlines()
cMurl = url_list[random.randrange(0, len(url_list))]
cMdns = dnsq.query_dns(str(cMurl), 'a')
It seems if I test it with a string instead of reading from file it works.
 
@Ffisegydd I agree that unittests are sorta pointless, but I really think regression tests are necessary, just to make sure there are no breaking changes to a web api for example.
 
print(dnsq.query_dns('google.com', 'a')) #Works
 
DSM
There are several things strange about that code. First, why are you calling str(cMurl)?
 
1:51 PM
Even without str() it was not working, so I assumed it was a string thing. Either way it doens't work.
 
@GamesBrainiac It's only a cheap train journey away for me so worst comes to the worst I'll go to the 2 most interesting days and pay for it myself.
 
DSM
@Wally: yeah, because calling str on a string doesn't do anything.
 
@Ffisegydd Yea, I think going to pycons is definitely worth it. You get to meet so many awesome people.
 
I'm mostly going for the stickers.
Need em. My Macbook is woefully under-stickered. I'm losing data cred.
 
DSM
Do you have one of those "bro do you even code" ones? I was very tempted yesterday.
 
1:53 PM
I don't...yet...
 
print(type(cMurl))
print(type('google.com'))
Both are str
<type 'str'>
<type 'str'>
 
mid afteernoon cbg all
 
@Wally yes they will be.
Because you read them from a file.
 
@Ffisegydd Oh... found a bunch of SO stickers in the drawer the other day I never got around to sending you :)
 
Does readlines include the \n?
@JonClements :O
 
DSM
1:54 PM
@Ffisegydd: yes, it will.
 
BAM.
 
DSM
In [22]: dnsq.query_dns('google.ca', 'a')
Out[22]: ['172.217.3.131']

In [23]: dnsq.query_dns('google.ca\n', 'a')
Out[23]: []
 
[cabbabe(puppy) for puppy in room.puppies]
 
DSM
cMurl = url_list[random.randrange(0, len(url_list))] is also a very verbose way to write cMurl = random.choice(url_list).
 
DSM
1:56 PM
You what? ;-) (Nobody saw nuthin'.)
 
Wow! I guess that is the problem. Ok. Thanks.
 
@Games \o/
 
DSM
fizzy += 1
 
random.choice() seems cool. I was always writing the lengthy range.
 
with the ArgumentParser, is it possible to store certain variables in a different name space? Eg:
 

« first day (2021 days earlier)      last day (2932 days later) »