« first day (2336 days earlier)      last day (2605 days later) » 

3:00 PM
has anyone here used flexmock?
I need to know if my hate for it is valid
I absolutely despise it
 
Never heard of it before. A quick google says that you're probably justified.
Seems to be another one of these libraries that get in the way of creating unit tests and TDD
 
@idjaw you're culturally inclined to hate only in the most extreme of cases (except hockey), so I'm sure it's called-for
 
wim
Justified. These kind of libraries are very hatable
 
@idjaw turns out it's for Ruby, so I totally get it
 
There is a flexmock for python
it is in a few projects here and I absolutely despise it
for example. Something that is making me hate everything right now
class Foo(Bar)
 
3:12 PM
sounds like destroying the system from inside
 
my_foo_mock = flexmock(Foo)
great!
good luck thinking you can test against whatever is in Bar
it's not mocked
anyway....I'm in a bit of a rage right now
 
Decision made. I'm not using flexmock. I'm protesting against this shit
ugh...now I'm getting the "node is so much nicer to use debate, and testing is so much more readable"
I put my headphones on...Not in the mood to get in to a hipster debate
 
Simple mocking is almost a language level feature in Python
 
it is a language feature
 
3:14 PM
pytest ftw
 
One additional Rython feature - it's fully Robject Oriented
 
RUH ROH
omfg.....I just found something atrocious
 
I sometimes wonder what comments I would get on my work... :P
 
@idjaw That's right, Rython exceptions are known as RUHROHs
RUHROH: TypeError
 
class BaseTest:
    def __init__(self):
        self.wtf = Haha()

class MyTest(BaseTest):
    def __init__(self):
        super().__init__()

    def some_test(self):
        self.wtf = AreYouKiddingMe()
Find the flip_the_table_problem
 
3:17 PM
@RobertGrant Which one?
I was basically editing two answers around the time of your comment ;-)
 
The multidict thing
Or dict with many keys that point to the same thing
 
Morning
 
Two!?
Martijn Pieters: the Multi-Threaded Fastest Gun In The West
 
Anyone have any positive experiences with Udemy/Coursera?
 
@MarcusS Me me!
-Both platforms- Coursera
 
3:22 PM
Me. Udemy more than coursera.
 
How so?
 
Almost finished with Coursera's Data Structures and Algorithms. Very happy with the programme. Good foundation for future programming efforts.
 
How to do a strikethrough?
 
Haha. I'll answer after I google it.
 
I've used Udemy for a few things - intros to new frameworks, or concpets that I was struggling with.
The course I'm currently doing on React and Redux is far better than most of the resources I've accessed on either to date.
@m3h0w Heh, I have that one on my list to do next. :)
 
3:27 PM
@AshishNitinPatil the help button has formatting instructions, in the bottom right.
 
@AshishNitinPatil I read Udacity at first glance. Done about 4-5 courses there.
@Programmer Thanks, almost didn't see that.
test
 
woosaaaa
woosaaaa

ok...I'm moving forward without flexmock. Look at that, things work beautifully without it.
 
I used coursera too for data structures 'Programming for everybody' @MarcusS I personally didn't love it but it definitely wasn't bad for like concepts and syntax
data structures, and 'Programming for everybody' *
 
IMO, Coursera (depending on the course) focuses on the details and leaves you out with the implementation.
 
@AshishNitinPatil there's also the sandbox for testing purposes
 
3:43 PM
@Withnail link please :)
 
wim
3:59 PM
@idjaw don't use __init__ in test classes, use setUp. Or, better yet, don't use test classes.
As for flexmock, the only thing worse than colleagues who use those kind of annoying libraries is having colleagues who roll their own annoying libraries to do the same silly things :(
 
4:14 PM
@wim :) You're preaching to the wrong choir brother. :)
@wim amen
 
4:33 PM
rb folsk
 
user6845426
4:43 PM
cbg o/
 
To anyone familiar with Django/Celery: Does it makes sense to use Celery for a potentially long-running login process (suppose my auth server is off-site and super slow)?
or, is it acceptable to let a Gunicorn worker handle the potentially long "login process"
 
Serious question - I don't get why we have a csv module? The boiler plate code is far, far more bloated than me jamming a bunch of strings together with commas and then storing them to a file?
 
presumably, the Gunicorn worker is anyway blocked on Django completing the authentication, but I'm wondering if offloading the actual login work (which currently runs in a view) to a Celery task would help any?
 
hey could anyone review my code? its a weather bot that sends an overview of the days weather
its one of my first projects prob like my 3rd or second
 
@DirtyPenguin but what would you present in case when you dont know yet if user provided correct credentials?
 
4:53 PM
github.com/Oso9817/weather_texts if anyone is interested
 
@IntrepidBrit Well you can't just do file.write(",".join(my_strings)) because things go wrong if any of your strings contain commas or quote marks or whatever
 
@marxin probably just a spinning icon
 
Properly escaping everything so it can be parsed unambiguously later is somewhat nontrivial
 
user6845426
Twilio looks useful
 
Fair enough - I've usually sanitised everything by the time it gets to output which is probably why I don't see many benefits to using it
 
4:56 PM
its really easy to use I was actually pretty suprised, im on the trial though so I'm limited but I would upgrade my acc if I wasn't saving for a car rn
 
@oso9817 Stylistically seems fine except perhaps twilioCli, which I would prefer to use lowercase_with_underlines rather than mixedCase
 
yeah youre right but I was looking straight from a tutorial and I dont mind since with sublime I can just tab to finish whatever im typing
 
Are you using a recent version of 3.X? You could cut down on the size of that big current_temp = ... line if you use literal string interpolation
 
(I struggled with some of the others as I don't have any appreciable background in JS)
 
4:59 PM
yeah 3.5 and could you elaborate? Not too familiar with that
 
s = f"abc {blah} def" instead of s = "abc {0} def".format(blah)
 
oh ok
ill try that out rq
 
@DirtyPenguin then maybe login with AJAX?
 
No, you need 3.6 for that
 
so like current_temp = f'\nThe weather in {location} @Kevin?
 
5:03 PM
@marxin yep, already doing that on the client side. I'm wondering more in terms of backend performance.
 
Why not test it and find out? I don't see anything wrong with it though.
Beyond the fact that a login process that requires its own background thread is weird to begin with.
 
@DirtyPenguin Oh, I see. Yeah, I guess getting response from celery task would be the problem, but you can workout something
 
I actually don't have a recent enough version of 3.x so i've never used f strings myself >_>
 
Well, they do what they say they do
 
5:07 PM
One way I see is to get uuid in view, pass down to celery task and return uuid, which you can use later to check login status via different url? which would give you None if its still working, token if logged in or False if failed
and then do a long polling, query each 5 seconds or so
 
user6845426
Has anyone used Theano to perform convolutions? I'm trying to figure out if its feasable to try and implement my own method to perform convolution instead of using the built in
 
DSM
5:23 PM
annoying_things.append("timezones")
 
rbrb, aste luego my guys
 
print(annoying_things['python'])
>>> ['bytes', 'datetimes']
 
(still) unclear/too broad? stackoverflow.com/q/42673253/344286
morning cabbage folks. I've almost been up for 12 hours today already, and it's only 11:33 AM!
 
cbg
 
Also, DFW has the humidity, blech
 
5:34 PM
why do you do that to yourself?
jet lag?
 
gotta get home... flight left at 6AM, so...
 
sounds like unfun
 
2 hour lead time at the airport, +1 hr travel time +15-30 minutes to finish packing up and getting out...
yeah, it was some good times :P
@RobertGrant shouldn't that be "The Gun FasMulti-Threaded test The In West"?
needless to say... I'm tiiiiired. And my flight doesn't leave here for another hour+0.5
 
Fair Skies though, hope you had a memorable trip :D
 
5:49 PM
Indeed. I think the best/most interesting part of the trip was the feeling of like... actually seeing the New York skyline
there's something entirely different about seeing it in person vs. pictures/online/movies
 
user6845426
ah id love to go to New York
 
There's something that seems emergent (at least to me) about having photons bouncing off of the actual thing and entering my eyeballs instead of proxied through a camera sensor
 
it's the 3d
just buy a VR;)
 
I walked the heck all over the place. Took a ferry over to the WTC, then walked down to battery park, then train up to Central Park...
And despite Law & Order having me believe otherwise, I stumbled across exactly zero dead bodies there.
 
Visit any good burger places?
 
5:55 PM
I actually had um...3? 4? burgers while I was there. Um...
the first night we ate at Il Bastardo. No burger there.
The next night was some... casa cafe restaurant thing - way north of time square. Like 86th st?
had a delicious burger up there
I can't help but feel that I'm missing a burger. Maybe I did just have two.
went to the Shake Burger...
it wasn't terribly amazing - I just got a single which was pretty small
 
the bun was really interesting - it felt/tasted like a hotdog bun more than anything
 
I'm sorry for your burger
 
It was fine, just not $9 fine ;)
 
heading to the burger bar this friday, personally -- excited :X
 
6:01 PM
This weekend I'm going to try to make quesadillas at home. I asked my most cooking-experienced IRL friend how to dice chicken and he was like, "??? just cut it into little squares???". I think this is an indication that I haven't shed my food-based learned helplessness.
 
Cook your chicken first
then stick it in a bowl - or directly into your un-folded quesadilla
 
Apparently you can cook first, or dice first. "Just do what the instructions say," says food friend.
 
right - I meant before you cook your quesadilla :D
 
Ok, that seems reasonable.
 
otherwise you will have salmonella quesadillas. That's not the same as just a fancy salmon quesadilla
 
6:04 PM
Alternatively, food friend has forgotten what it's like to be as dumb as I am right now, and neglected to mention that I need to cut off the grindel first or else I'll die of salmonella, because duh everyone knows that so it's not worth mentioning
 
@Kevin the what?
 
The grumbo. You know.
 
I'm assuming you don't mean mariowiki.com/Grindel
 
(I'm just making up words because I don't know of an actual part you have to cut off or else you die)
 
DSM
Not to be confused with Beowulf's Grendel.
 
6:05 PM
The fat? The grossness? I'm pretty sure you don't have to cut it off. Just cook it :P
 
or the Brundlefly. Make sure to cut that off your chicken first if present.
 
Use a paring knife on the mimsies if the raths look outgrabed, but ofc that's not likely when they're in season
 
@Kevin what matters is to have pieces of roughly the same size so they cook at the same time
what's grindel?
 
(I assume he's referring to gristle)
 
I'm not versed in the relationship of cartilage and salmonella
 
6:08 PM
Hey, may I ask a simple question here ? Or is this chat only dedicated to food & I'd rather create a question for it :)
 
here you just use proper heat treatment and not worry about salmonella
@PercevalFARAMAZ if it's python-related then sure, don't let the off-topic ramblings confuse you:)
this is very much the python room, welcome
 
Thx, here it is : does anyone know how to call a Python function in C code, but not from an external module/script file... instead from a script string ?
 
Sounds hard.
 
sometimes fun to visit cooking.stackexchange.com
 
~ eval a string in C containing a python script?
 
6:10 PM
@AndrasDeak not really, because I have to PyObject_GetAttrString to get a specific function and call it
Which is pretty easy if I have a file.py - except I don't :(
 
OK, I was trying to make sense of your question, but I'm lacking relevant domain knowledge. Cue supper time, rhubarb until then:)
 
Smells good, even from here :)
 
user6845426
Could someone breifly explain this to me: [param for layer in self.layers for param in layers.param]
 
recbg
 
@dipper nested loop in list comp
 
6:12 PM
I'm not 100% clear on what is being asked but perhaps python's -c command-line argument would be of use? Then as long as you have shell-executing powers, you can in principle execute Python expressions too.
 
@dipper read nested for loops left to right
 
for layer in self.layers:
    for param in layers.param:
        ...
 
@PercevalFARAMAZ Pretty sure that you'd have to embed python in your application, which is possible, but it's probably way easier to just make a system call to launch a python script.
 
C:\Windows\system32>python -c "print('Hello, World!')"
Hello, World!

C:\Windows\system32>
 
user6845426
Ah, thanks both. I like how Python simplify code, when I actually understand it o.O
 
6:12 PM
@WayneWerner I do actually embed it, or at least that's what I'm wishing to do
 
I think what Perceval means is the opposite of ctypes? Pytypes from C?
 
@AndrasDeak Thanks, I didn't know about it.
 
that's how I read it, but as I said I don't know any C py thingies
 
@PercevalFARAMAZ it is rather "easy" on Linux to execute Python code from C
 
@dipper that particular code doesn't really look like it makes sense to me...
 
6:14 PM
and same for MacOSX I guess..
windows... not so easy as it is hard to C on M$
 
I mean I can know what it's doing but it doesn't look like a sensible thing to do
 
so, which platform it is
 
machos
MacOSX*
 
@WayneWerner it flattens, doesn't it?
 
@PercevalFARAMAZ basically just that ^
 
6:15 PM
params = []
for param in layers.param:
    for layer in self.layers:
        params.append(param)
Pretty sure that's the equivalent to what the listcomp is doing
 
yup nope
oh, I see what you mean
 
90% of the time when I have a multiple-for list comp, it's for the sole purpose of flattening something
 
@WayneWerner you've got it wrong
 
I would expect maybe something like [param for param in layer.params for layer in self.layers]
 
now try to get how multiple ifs work there :D
 
6:16 PM
@WayneWerner see my rendition, for loop order is reversed
 
@Antti : Except... There I'd have to have a separate .py file, to PyImport_Import' it... I only have a string containing python code – basically, what I need is something akin to PyImport_Import, except it doesn't imports a module from a file, but from a string (that contains python code) instead
 
4 mins ago, by Andras Deak
for layer in self.layers:
    for param in layers.param:
        ...
it flattens ^
 
@PercevalFARAMAZ are you reading the same page as I am?
PyRun_SimpleString("from time import time,ctime\n"
                   "print('Today is', ctime(time()))\n");
 
How can I get a ref to a function contained in the string to call it ? And not the whole script
Cuz there Python executes the whole string
 
@AndrasDeak oh, it sure does:
In [1]: x = [[1,1,1], [2,2,2], [3,3,3]]

In [2]: [blarg for thing in x for blarg in thing]
Out[2]: [1, 1, 1, 2, 2, 2, 3, 3, 3]
 
6:18 PM
@AnttiHaapala Thanks tho
 
That explains why I always make genexps when I'm doing something like that
 
@PercevalFARAMAZ ok let's go back.
you need to get a function, from where?
 
from a string:P
 
Okay, I'll give some context
My app embeds python and has some of its features scriptable thru Python
 
context is always important - sometimes you have an x-y problem
 
6:22 PM
This script is not available as a .py file, just a string (I could very well write this string to a file and then pass it to PyImport_Import, but I prefer not to leave files everywhere)
 
@AnttiHaapala ow, that might help indeed
 
so, you'd create a new dictionary and pass it for both globals and locals, then you use that, then get the item by name from the dictionary.
 
@PercevalFARAMAZ you could always use tempfile ;)
 
"The Very High Level Layer" sounds nice
 
6:23 PM
@WayneWerner I could indeed, but that seems somewhat ugly to me
 
Yeah, I would agree with you
 
@AndrasDeak at first I read it as "The Very High Level Player" and it sounded even better
 
    mycode = '''
    def foofunc():
          print(42)
    '''

    globs = {}
    exec(mycode, globs, globs)
    func = globs['foofunc']
^that, except in C :P
 
@AnttiHaapal Okay, I'm going to try
 
and exec => PyRun_String
 
6:25 PM
so I wasn't really that far off
15 mins ago, by Andras Deak
~ eval a string in C containing a python script?
 
@AndrasDeak ahem
yes looks so
but to me eval meant eval it right now without being able to call a specific function.. sorry then
 
it was more like a ballpark thing:)
anyway, what matters is that you have it sorted out, or getting there
 
Flight time, wheee!
 
have a safe trip
 
WELL. Everything seems right so far, at least regarding PyRun_String
Regarding PyObject_GetAttrString, I tells me to fuck off trying to do things with Python with a nice EXC_BAD_ACCESS :(
Perhaps it has something to do with threading, as I'm not running in the main thread... should I try to use the GIL ?
The GIL seems to do no good...
 
6:45 PM
anyone know if there is a "subset" of stack overflow for relatively complex algorithms?
 
Sometimes the Computer Science site would have posts about algorithms or data structures or something that were so abstract that I didn't even know what they were talking about
 
well, not THAT advanced... in this case, it's just making an efficient animated gaussian blur
 
Yeah, if the question is about the algo in itself & not its implementation, perhaps ComputerScience is better
 
I'm always slightly worried when I read CS papers and have no idea what they're talking about, or in not nearly enough detail to know how they actually expect to implement anything.
 
So if your relatively complex algorithm is about solving 3-SAT in exactly o(log(n!)) time using only letters reachable on the left half of the keyboard, you'll be right at home
 
6:47 PM
@corvid TBH, that's advanced for me.
 
I can make an animated gaussian blur but it is super slow, want something a bit more efficient
 
I imagine this is the same feeling for Theoretical vs Applied science, at least if Saturday Morning Breakfast Cereal is a reliable source.
 
Well if you figure it out, let me know, because I too could use a good animated blurring algorithm.
 
@Kevin O(log(n!)) ~= O(log(n^n)) = O(n log n)
 
@corvid what are you currently doing ?
 
6:49 PM
@paul23 Oops
 
Just to simplify the statement (didn't read anythign else)
 
I'm pretty sure if you can solve 3-SAT that efficiently, you prove that P is in NP and people show up at your front door with a big novelty check
Possibly having arrived there by flying car, an invention now made practical thanks to your discovery
 
@AnttiHaapala @AndrasDeak Good fucking lord it works
@Kevin ping me when you're done building it, I could make us of one :)
 
@corvid How fast is edge detection? - You could simplify gaussian blur by blurring only edges - as blurring is only really visible around edges anyways. Though I guess edge detection won't be much faster than blurring.
@Kevin youtube.com/watch?v=-FseeVy7uvU solved already.
 
@paul23 n log n - n +O(log n) to be more precise
 
6:54 PM
>>> "P" in "NP"
True
:-O
 
DSM
@PercevalFARAMAZ: let's try to keep the language a little less blue.
 
@DSM okay
 
7:13 PM
Once again I have been bamboozled by Rad Bradbury into thinking that he tells wholesome stories of quaint Americana right up until the point where the secondary protagonist straight up kills a dude just because she can
 
Isn't that what America is like?
 
Usually there's some kind of incentive, though
 
Maybe the dude had a kitkat and she was hungry.
I'm just saying, I've killed for less.
 
Well she did it from five hundred miles away using astral projection so it would be challenging to get the kitkat from there. Doubly so since the victim ends up at the bottom of a tar pit
 
I want a kitkat now.
 
7:18 PM
Check at the bottoms of tar pits, as there surely must be at least one there, given the information available to us.
 
DSM
I approve of this routine.
 
user6845426
I think PyCharm is fooling me. My console is telling me i'm only supplying 2 parameters to a 3 parameter method. net = Network(Convolution(image_shape=(mini_batch_size, 1, 28, 28), filter_shape=(20, 1, 5, 5), poolsize=(2, 2))) am I missing something
 
Yes
 
Looks like three parameters to me.
Usually when parameter counts look funny, method binding is somehow to blame
@dipper What line does it complain about if you do this?
x = Convolution(image_shape=(mini_batch_size, 1, 28, 28), filter_shape=(20, 1, 5, 5), poolsize=(2, 2))
net = Network(x)
That may or may not narrow it down
 
user6845426
I'll give that a go now
 
user6845426
7:25 PM
TypeError: __init__() takes exactly 3 arguments (2 given)
 
user6845426
wurrrt
 
Which line? The net = line?
 
DSM
Are we positive that the parentheses are in the right place?
 
That's a pretty plausible explanation
I would investigate the docs but I can't be bothered to figure out what library Convolution and Network come from
 
user6845426
Yes @Kevin the net = line
 
7:28 PM
I wonder if this would work:
x = Convolution(image_shape=(mini_batch_size, 1, 28, 28), filter_shape=(20, 1, 5, 5))
net = Network(x, poolsize=(2, 2))
 
DSM
poolsize does sound more like a network parameter than a convolution one.
 
user6845426
Hm, I think this is a problem for tomorrow lol. Thanks though guys!
 
I'm gonna go ahead and assume we solved it. Another job well done.
 
DSM
Celebratory milkshakes for all!
 
convolution.... what a whimsical word... thanks for exposing me to a new word :D
 
user6845426
7:32 PM
And i'm going to close PyCharm and assume its solved. Out of sight out of mind
 
Are you using "network3"?
 
I could go for a banana or coffee milkshake right now.
 
banana, definitely banana
have one for me too
 
user6845426
coffee milkshake?!
 
user6845426
@MarcusS network3 yes. I've been trying to follow that as a guide anyway
 
7:37 PM
class Network(object):

    def __init__(self, layers, mini_batch_size):
        """Takes a list of `layers`, describing the network architecture, and
        a value for the `mini_batch_size` to be used during training
        by stochastic gradient descent.
 
I finally leave matplotlib to do purty 3d plots, google a problem -> still Joe Kington:D
 
DSM
He is, indeed, the man.
 
if running a executable file be consider "opening the file". For example if someone ran foo.exe, did OP 'open' foo.exe? Or would opening foo.exe be basically looking at the 'code' of foo.exe
 
so maybe net = Network([x], mini_batch_size)
(assuming Convolution() counts as a single "layer")
 
definitely one of The Men
I have to say SO is full of The Men
 
user6845426
7:39 PM
Ah @MarcusS that fixed it, thanks xD my bad. Have you read the online book also?
 
it would give me crippling impostor syndrome if I weren't a physicist
 
user6845426
Ah fair enough. I think i'm out of my depth trying to implement a cnn
 
Ok, so DSM and I were in the right neighborhood in suggesting that one of the parameters was being passed to the wrong initializer. I just suggested moving the wrong one.
If only I had been less passive aggressive in asking what library was being used, we could have solved this five minutes faster :'-(
 
more time to enjoy the milkshake
 
user6845426
7:42 PM
Still tick it off as solved @Kevin
 
I drink your milkshake! I drink it up!
For once I didn't get Kevin'd
 
In the future I must remember to word it as "What library are you using?" or "tell me what library you are using" instead of "I could figure this out if I knew what library you were using" because the first two are more obviously actionable
Imperative or interrogative, not declarative.
 
it might also depend on the amount of feces you give
I was torn between feces and procreation
 
In fairness I did say "I can't be bothered" which might indicate to the reader that I wouldn't have the energy to investigate even if I did get handed the needful info.
 
assuming universally intelligent and informed readers etc ;)
 
7:47 PM
It's almost 3 already... day flew by. I blame black holes somehow.
 
gist: 98ae4871ae21821c21cb9f2aecbb9c39, 2017-03-09 18:32:57Z
Python 2.7.10 (default, Oct 23 2015, 19:19:21)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import string
>>> string.letters
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
>>> help(string)

>>> string.letters
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
 
can reproduce on 2.7.13
doesn't work in 3.6:P
 
Can't replicate on 2.7.11
 
hmm, not even with ascii_letters
 
I always have a hard time messing around in the terminal because I always forget the shortcut keys
Between all these IDEs and browsers and terminals and operating systems, I have no idea how people keep it all straight
@KevinMGranger Can replicate it, FWIW (2.7.10)
 
7:52 PM
letters = lowercase + uppercase
^ This is how it's defined in the strings.py module. No potential for rearranging here, AFAICT
 
bizarre
 
I'd be interested in viewing the history of the file but I only know how to do that on github and I only know how to find the 3.X source on github
 
Yeah.
 
so what does help() do exactly?
 
7:56 PM
Still looks the same to me with respect to how letters is used
 
Hmm, the last commit before October 23 2015 doesn't even define letters.
 
@Kevin (btw if you go to github.com/python/cpython/ you can click the "branch:" dropdown at the top left)
 

« first day (2336 days earlier)      last day (2605 days later) »