« first day (2025 days earlier)      last day (2916 days later) » 
01:00 - 16:0016:00 - 00:00

1:18 AM
Out of curiosity do you folks think its easier to hash a long file path or a two element np.array, when using a dictionary?
 
 
2 hours later…
DSM
3:02 AM
#wethenorth
 
 
1 hour later…
4:18 AM
just found out that there is a change antti = 1j * antti
 
4:34 AM
Cabbage :-)
 
5:07 AM
@thefourtheye greeting imaginary friends
hmm
must... resist... urge... to... comment... in... vietnamese... to... a... vietnamese... op....... gnnnnnnh
that's a special case of tourette
 
 
3 hours later…
8:03 AM
cabbage folks!
 
8:19 AM
cbg all
 
yo
 
8:31 AM
Mornin
 
8:48 AM
Evenin
 
hi all
 
I just did a rollback on a newbie's question. They'd deleted the code from their question after it'd been answered. I also removed their snarky comment about being downvoted. I suspect they'll try to revert my rollback. True, the question is on hold for being too broad, but still... stackoverflow.com/questions/36966224/…
 
9:46 AM
How can one thread without arguments?
I have this function called openMic(self) which takes no args, so is there any ways without
*any way to thread without args?
note that openMic() returns a string
 
Hi
my freind has been stuck with this for a while
can you help please
1
Q: How to use python-social-auth with google only?

cinochI'm trying to add google authentication to my project I installed it: pip install python-social-auth and added it in settings.py: SOCIAL_AUTH_USER_MODEL = 'accounts.CustomUser'## SOUTH_MIGRATION_MODULES = { 'default': 'social.apps.django_app.default.south_migrations' } AUTHENTICATI...

 
10:45 AM
It's really hard to decipher code with recursive function within generators -_-
(recur(x) for x in class.__bases__)
 
11:17 AM
Hey guys, I hope i meet you well.
I'm trying to calculate an influence score on scale 0 - 10.
Of posts in a group of posts.
Each posts has like, comments and shares.
I have the total weighted score as (0.5 * share_count ) + (0.15 * like_count) + (0.35 * comment_count)
and the total score as share_count + like_count + comment_count
This is for one post.
Now I do the same for all the posts in a group to get both the group weighted total score and group total score. Now my question is: with all these parameters, how do I find the influence of a post in the group?
 
@Dom That "giant" spider was probably some species of huntsman. Your friend's colleagues were just teasing: there's no law against killing any spider species in Australia, AFAIK. I can understand your friend being alarmed by such a large spider, but as the Wikipedia article explains huntsmen are mostly harmless and their behaviour towards humans is not aggressive. They rarely bite people, and only in defence, and the bites are fairly mild.
Most (non-arachnophobic) Aussies aren't bothered if a huntsman comes into the house since they attack cockroaches and other pests. I must admit I'm not totally happy if one decides to set up camp in my bedroom, but they're fairly easy to catch in a container so you can chuck them outside.
 
12:13 PM
>>> '{0}'.format(object.__reduce__)
TypeError: Type method_descriptor doesn't define __format__
Is this a bug in Python?
 
12:27 PM
It works in Python 2.6.6:
>>> '{0}'.format(object.__reduce__)
"<method '__reduce__' of 'object' objects>"
 
DSM
And in 3.5.1.
Morning cabbage.
 
@PM2Ring not in 2.7
and in 3.3 it works as well
 
How about:
>>> object.__reduce__
<method '__reduce__' of 'object' objects>
 
Works in 3.4.1
 
>>> '{!s}'.format(object.__reduce__)
"<method '__reduce__' of 'object' objects>"
works
however.. this clearly is a bug
 
12:31 PM
@PM2Ring in 3.3 object.__reduce__
works
 
We're assuming you're doing this in a fresh REPL and you haven't inadvertently redefined object. :)
 
DSM
It fails for me in 2.7.10 as well.
 
I'm sure my REPL doesn't shadow object
It's a bug
 
@direprobs it is a bug
however it won't be fixed in 2.7
2.7 is dead.
it is an implementation detail now
 
@direprobs What does dir(object) print?
Here's mine in 2.6.6
>>> dir(object)
['__class__', '__delattr__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']
 
12:34 PM
@PM2Ring no, dir(object.__reduce__)
 
>>> dir(object)
['__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']
3.3
 
@direprobs not that.
 
@AnttiHaapala Good point. But at least it proves object isn't being shadowed. :)
 
Funnily in Python 2.7
>>> object.__reduce__.__format__('')
"<method '__reduce__' of 'object' objects>"
 
2.7.8
>>> '{0}'.format(object.__reduce__)
"<method '__reduce__' of 'object' objects>"
 
12:36 PM
@AnttiHaapala LOL
The consequences of trusting Python 2.X
 
@snakecharmerb nice
2.7.9 on debian breaks.
 
I'm using Python 2.7.11 though
 
DSM
It fails for me in my 2.7.10 virtualenv, but works if I use IPython and not bare python in the same venv, using the very same python binary.
 
But how did this problem gone unnoticed?
 
I suspect:
the __format__ is b0rken.
however someone f*cked up the code that should revert to repr
hmmm or Idk
@direprobs how did you come across that?
 
12:43 PM
Guess what? I just exit from the session and opened the REPL again and it worked!
>>> '{0}'.format(object.__reduce__)
"<method '__reduce__' of 'object' objects>"
Running 3.3
 
DSM
Did anyone ever say it didn't work in 3?
 
>>> '{0}'.format(object.__reduce__)
"<method '__reduce__' of 'object' objects>"
Running 2.7.11 !!
 
2.7.10, 2.7.9 b0rken
Python 2.7.11+ (default, Apr 17 2016, 14:00:29)
[GCC 5.3.1 20160413] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> '{0}'.format(object.__reduce__)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Type method_descriptor doesn't define __format__
@direprobs check your python versio nagain
or perhaps it is undefined behaviour
 
@AnttiHaapala Or at least buggy pointer handling code, since that's a common culprit of intermittent bugs. But you know that. :)
 
@direprobs can you paste the version information from your python
it might be important
who knows, if this is an aliasing bug...
or something :P
@direprobs ..... ..........
 
12:56 PM
Yea sure
'2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:40:30) [MSC v.1500 64 bit (AMD64)]'
 
yeah...
thanks :d
@direprobs is this standard windows installation?
or anaconda?
 
standard, straight from Microsoft.
 
microsoft?
windows now has python?
 
@direprobs Antti means "Is this a standard Python installation for Windows?"
 
@PM2Ring ah :D
didn't notice that it was ambiguous :D
 
12:58 PM
Yes it is, I thought you're asking about my OS
 
hmhm tricky
 
I examine Python's internals the whole week, so basically I see lots of these hahah
But this one is really tricky as you said
 
morning everyone
 
ehhehe ehhehe :d
:P
 
hah haha hahahaha!
 
1:01 PM
Python 2.7.10 (default, Oct 14 2015, 16:09:02)
[GCC 5.2.1 20151010] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> format(object.__reduce__, '')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Type method_descriptor doesn't define __format__
>>> format(object.__reduce__, '')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Type method_descriptor doesn't define __format__
>>> format(object.__reduce__.__format__)
LOLLERSKATES
 
Does anyone know of a good deployment SaaS that supports Postgres with PostGIS?
 
@corvid you mean: PaaS
 
Yeah that's what I mean
 
@AnttiHaapala though, Mark Lutz mentioned in his book this is a bug in 3.3, I mean his 5th edition, but when I tested it today, it works!
 
Morning cabbage.
 
1:07 PM
Morning
 
Morning. Today I am starting 50 hours of not-entirely-mandatory security training.
 
DSM
What was the nickname of post-BigCorp?
 
HugeCo.
I have a choice between this and self-studying for a three hour test, and also the test costs a hundred dollars.
 
DSM
HugeCo is training you for 6-7 work days just on security? What kinds of thing are you learning?
 
1:12 PM
@AnttiHaapala let's see the result.
 
the heisenbugs are the worst kind of bugs
they usually mean that something is really broken
 
The first 24 hours is "certified ethical hacking". It purports to teach about sql injection etc.
 
@Kevin nice
@Kevin and you're paid for attending it
 
Oh right, so it's not just about security.
 
It might actually be interesting because the intro seems to imply that we'll be learning how to execute attacks, not just defend against them
 
1:13 PM
That sounds pretty awesome.
 
I thought you meant you were going to have 50 hours of training on "Don't leave your desktop unlocked when you go to get coffee. Don't talk in public places. Don't accept sweets from strangers."
 
so far I've never spent 50 hours in training in total in my entire professional work life.
 
DSM
HugeCo trains 8.5% of the black hat hackers on the east coast. Won't you join us?
 
I assume you mean white hat hackers.
Unless you're making some accusations.
 
DSM
I do not, and I am.
@AnttiHaapala: me neither, and that includes academe.
 
1:15 PM
Fair cop.
 
DSM
At first I was wondering if they'd be liable if their students went rogue, but then I decided probably not. At which point I realized they had a great opportunity here, with some creative planning.
 
The presenter thinks of himself as a "gray hat". Getting permission from a system owner to perform actual real attacks on the system rather than just passively probing for weaknesses
 
@Kevin so was your surname Mitnick?
 
:-P
 
DSM
Maybe that's the M!!
 
Are you going into pentesting then? Or just learning about it to avoid making mistakes?
 
@DSM yeah, Kevin D. M., that matches.
 
This is just so we can shore up the defenses of our existing projects, I expect
 
Sounds like you need a cyber security consultancy. I happen to know a place.
 
so sloppy
that's been online since yesterday
 
1:20 PM
Haha... just seen a job in the sidebar (in Finland) - I wonder if Gandalf's are the new trend instead of "Ninja" - "Python Backend Gandalf Requried"
 
@Ffisegydd I'll alert the management. I estimate they'll get back to you by 2019.
 
@JonClements so why didn't I see that?
because falsk
 
DSM
@JonClements: I'll know it's real when you change your avatar to a puppy in a wizard hat, and not before.
 
Oh... and in the description they say: "seeking a passionate and fun-loving Python Jedi " - talk about mixing stuff up :)
 
@JonClements that's almost like the 1 ad in Oulu, that @IljaEverilä described as basically saying: "while we cannot pay you in money, we will compensate that by giving loads of worthless promises"
@JonClements use the force Harry!
 
1:23 PM
Indeed :)
 
which one
 
@AnttiHaapala I've probably done about 120 in my time. A couple of trips to Germany for training weeks, a Learning Tree course once.
There's budget sometimes; just gotta ask at the right time :)
 
I've been so lazy for the past few days. Its time to up the antii. ;)
 
Nice.
 
1:33 PM
no mcve stackoverflow.com/questions/36982077/… Please close this before it gets more inane answers by people who can't read.
We're upping our Antti, so up yours.
 
data modeling question: say interacting with an API returns some JSON that is expected to be saved. Is it bad to save this embedded in another document, or should it be saved in its own collection?
 
Not enough info.
But don't worry about whether it comes from an api or not; just about where it belongs according your application's view of the data
 
Okay as an example, you have orders. Orders are charged via Stripe which returns a JSON response. Is it better to save it in its own collection, or directly on the order?
 
Presumably we're talking about Mongo here?
 
Yeah, or I guess any other type of NoSQL shenanigans
In postgres would you save it in a json field or something?
 
1:37 PM
@corvid do you want to easily find transactions inside an order, or operate over groups of them? You can even store it in both places if you need to.
 
Are orders immutable?
Not sure saving them in multiple places is the best idea, especially if they can be modified.
But yeah it depends on what you need to do with them.
 
Nah, but they are only changed on the server, and they're usually changed on some event. So for example, if I am using EasyPost, it will send data events to an endpoint which update the order
 
I'd say that orders should be kept in their own collection with a foreign key that links to whatever.
 
Foreign key? Not very mongo :)
(Unless I misunderstand things)
 
I wish mongo had some guides on how you are supposed to model data
 
1:40 PM
@RobertGrant Those foreign keys are taking all the native key's jobs!
 
Presumably, your JSON-handling tools can handle JSON files and JSON in string form with equal ease. And JSON strings are well-behaved, so it's reasonable to save them as a string field, especially if they aren't ginormous.
 
Haha yeah I was thinking about that
 
OTOH, if you want to save JSON as a field inside an XML document then you probably shouldn't do that. :)
 
In postgres I'd probably actually model the Stripe data in a table, as it's the sort of thing I'd want to query later.
Rather than shove it in a JSON field
 
@RobertGrant Eh. You can have foreign keys in mongo.
They may not be as advanced as foreign keys in other dbs of course.
 
1:42 PM
Oh, okay. I misunderstand things.
 
But they're a valid design pattern.
35
A: Foreign keys in mongo?

Gates VP How to design table like this in mongodb? First, to clarify some naming conventions. MongoDB uses collections instead of tables. I think there are no foreign keys! Take the following model: student { _id: ObjectId(...), name: 'Jane', courses: [ { course: 'bio101', mark: 85 ...

 
Good point, RobertGrant. Corvid, If you just want the JSON as single entity it's reasonable to store it a string field. But if you want to be able to access the contents of the JSON then you should extract it into your native format.
 
@Ffisegydd I think the main problem with them is that when you have to observe a collection, it's far less overhead to watch a single document rather than multiple joined ones
 
Ah yeah touche.
Depends on your specific use cases then.
 
Yeah, I think the main concern comes in on many-to-many, one-to-many and one-to-one are easy enough to implement
 
DSM
Ehh, I don't like your proposed solution..
 
Yeah tree structures and many-to-many don't do well
 
DSM
Am I crazy, or is everyone suggesting bad ideas on the Q which PM2R linked? I'm out of practice on the syntax, but isn't the whole use-string-interpolation a bad idea for injection-related reasons? Isn't the real problem just that the args should be a tuple of one element, not a string?
 
@DSM Ask @Kevin, he should know after his training.
 
DSM
Barbaro can't wait that long!!
 
2:08 PM
@DSM Sorry, I was just treating it as a typo / Python syntax error. I was ignoring the whole SQL injection aspect.
 
I'm probably only going to do an hour a day, so ask again in June-ish.
 
I assume when you do the proper method, it won't allow you to do crazy stuff like null;DROP TABLES DSMFanFiction;
 
DSM
@PM2Ring: right now I think the OP is trying to do the right thing and got mixed up about the parameters. Your comment takes him down the wrong path, I think..
 
Does the top answer do parameterisation correctly?
 
@DSM Ok. I'll delete it. My excuse: I don't really know SQL / mysql.
 
2:11 PM
You're supposed to use placeholders.
The answer by julivico looks right to me.
 
You should create every possible permutation of the query and store them in a dict for looking up. Only way to be safe.
 
Hello.
 
cabbage
 
2:37 PM
I am trying to psych myself up to go to the Philly Dev Night this Thursday. But what if I'm not good enough :<
 
You'll be mocked and shunned? :p
 
Yeah pretty much
Everyone will be polishing off their zombie survival FPSes with custom crafting systems and procedurally generated worlds with working ecologies and I'll be in the corner trying to get Tkinter to position the cards evenly in my Memory game.
 
DSM
I play Free Flow and various kanji recognition games more than anything else on my phone. Sometimes simple is good.
 
@Kevin dude. gifs.
Just drop the most psychedelic ones you've got.
 
I imagine the creative types will be circling the room looking for programming talent. "So how many hundreds of hours have you worked with Unity?" they ask. "Um, about zero. zero hundred hours." I say.
@Ffisegydd Yeah I'll probably lead with that.
 
2:45 PM
And follow up with it.
 
"Tetris in a CLI. How... quaint" "Yeah, but it's written in pure sed"
 
And use it in an encore.
And for your 2nd talk.
And then they'll probably escort you out because you keep on trying to show gifs to people after 5 hours straight.
 
I'll just show them one gif and say "be sure to watch until the end"
 
Then pick their pockets.
 
"When you finally see the bottom level of the Koch snowflake, it's like looking into the face of God."
 
2:47 PM
I'm visiting an Open Data "unconference" in mid May which should be interesting. I'm slightly worried it's going to be a bit hippieish.
As it's an "unconference" there's no set agenda, you just all turn up and rock out/give talks on the fly.
 
I'm sure it will all turn out OK.
 
Just gonna show gifs.
I'll tell people they're gifs made from open pixels, and they'll go wild for it.
 
My licensing fees are very reasonable.
 
Sure. Licensing.
 
@Kevin: I don't think you were here the other day when I linked to the site of mathematical graphics master Jos Leys
 
2:52 PM
Looks neat.
 
One of his most famous projects is Dimensions. I learned about Jos years ago because he uses POV-Ray for some of his work.
 
3:33 PM
Ctrl+Shift+I is my new favorite PyCharm shortcut. Peek at the definition of a function wherever I am. Yes please!
 
That is an awesome shortcut :D thanks for showing this
 
@MorganThrapp Ctrl+P inside a function call will show the arguments, but it stopped working for me in the 2016.1 release. Does it work for you?
 
@davidism It does not.
I usually just do Ctrl + Q to get the signature.
 
The argument popup was so nice. I think there's a bug report but who knows when they'll fix it.
 
Yeah, it was really nice.
 
3:47 PM
everyone go vote for that issue so they'll fix it
vote for this one too while you're at it: youtrack.jetbrains.com/issue/PY-17810
 
Oh yeah, that second one drives me insane.
I also sometimes get a similar issue where all my variables are duplicated in the automatic popup. It seems to happen when I'm working in a class and start typing the name of a property without prepending self..
 
01:00 - 16:0016:00 - 00:00

« first day (2025 days earlier)      last day (2916 days later) »