« first day (1976 days earlier)      last day (2986 days later) » 

9:00 PM
@idjaw it's a pretty simple method, not really that complicated at all
 
@QuestionC It's a pretty crucial philosophy of MVC design. input goes in the (C)ontroller, everything else goes in Model and View.
 
I just wasn't sure what the best way to mock the requests.get method was
 
Not just MVC, pretty much every program can follow that separation. Keeping logic separate from input is just good modularity.
 
plus if you end up changing what type of data input you have... lots easier if it's not tightly coupled to the parsing code
 
And even for simple programs that don't require that level of design, it's better to separate input reading. Ex. Better to have a function def frob(x): than def frob(): x=input("enter value for x:")
 
DSM
9:02 PM
Among other reasons, it's hard to test code if there are inputs scattered throughout..
 
@tzaman This. Hate those fancy patterns. I think, every program needs to be organized differently
 
which is why it's always good practice to keep methods as small as possible
 
Yeah, I'm always appreciative of MCVEs that put all their input calls in one place so I can easily swap them out for literal values
 
lol
 
@DSM That has always been my rationale for it. Input code is so easy to get wrong, you need it to be testable in isolation.
I was just wondering if it's really an established principle of programming because I frequently tell people it is.
 
9:08 PM
it's a "make your life a million times easier" principle that happens to correlate with a lot of other good principles...
 
DSM
I don't know if there's a special name for it or it's just the IO & program logic case of separation of concerns/avoidance of tight coupling/ etc.
 
SRP pretty much nails it, for naming
 
The IOPLCSCTC principle. Has a nice ring to it.
 
rolls right off the tongue eh? :P
I'm never sure if I should be happy when I write a test and find a bug, or annoyed
 
happy. That means your TDD is working.
 
9:16 PM
Orthogonal Question: I'm in the market for the world's best futon(maybe couch) for a small studio apartment. Which is that?
 
oh my goodness, I did not expect this to happen at all. What a pleasant surprise
 
@idjaw yeah it's cool
 
Still, PC is better
 
@idjaw ehhh. not really TDD... XD
I should do more TDD though
 
god ultra excited when I saw a paper written by "Joslin & Clements" <- thought it was @JonClements. Turns out it was some totally other Clements by the name of David. Impostor!
 
9:17 PM
more like "I should write tests for all this code"
 
I like the expression BDD more
 
Although PS4 already cross-platforms some games with PC, I think this is better because it's the platform infrastructure supporting it, whereas I think PS+ cross-platform wasn't on the PS+ infra
 
hahah.....I got whipped in to the TDD world at my recent job. I'm a huge believer
 
@khajvah I don't like writing tests like that
 
it explains the concept of TDD better
 
9:17 PM
@idjaw oh I am too, I basically did that for designing my API earlier today
 
@khajvah for some reason that reminds me of Leela's flat number, 1BDI
 
@RobertGrant yes, I think you are correct. This is just a very interesting step to take considering how competitive the console market is
 
@enderland the word test is ambiguous. It's more like a behavior you are looking for. So, before implementing a function, you formulate the behavior and then implement the function itself
 
@idjaw I think that and lots of old games running on your current console are big steps forward
 
@RobertGrant had to google that :D
 
9:19 PM
I hope they design all future console to play old games in the console family, it makes you trust them more
 
@enderland @khajvah Yeah, the way I break it down, is when you are performing more BDD type tests, you are really trying to test the overall behaviour, so more concrete, using gherkin to list down the overall functionality (lettuce). Then your TDD approach will drill down more to the single methods you wrote to make all this happen. So using unittest/mocking..
@RobertGrant PS5 will include a Super Nintento Virtual Console? :P (wishful thinking)
 
@idjaw BDD tests are method level too
 
@khajvah really? I never really looked at it like that. I always took BDD at a much higher level.
I guess you take your method in a approach as: Given my method takes a <this>, Then I expect <that>? Something along those lines?
 
@idjaw I think you are talking about integration tests
 
Actually, I use BDD testing for system level testing.
for a particular application
we try to avoid integration tests for an application
 
9:26 PM
@idjaw Do you have QA team?
 
no
 
integration tests? we don't need no stinkin' integration tests! We celebrate the diversity of all our code
 
haha
:( I really want to continue this conversation. But I have to get going. The kids are waiting to go outside.
 
In a perfect world, where all your code has 100% perfect unit tests, you won't need integration tests
 
feel free to keep pinging me. I will answer when I get back
 
9:28 PM
:) have fun
 
@khajvah We try to avoid, but it's unavoidable and we do have integration tests. We just try to minimize throwing everything in as an integration test
I agree with you
(OK...going for real this time :))
 
well, perfect unit tests as well as perfect specs for everything
and perfect configuration
 
I'm an idiot...I answered without thinking....I realize that we have a QA team
we just never see them
and I have no idea what/how they test
 
enderland is on our QA team
 
we just occasionally get feedback from our PO about stuff we have to fix
 
9:30 PM
one of the main uses of integration testing is making sure everything talks correctly to everything else; unit tests can't expose that if one side has everything working properly (assuming protocol A) and the other side has everything working properly but they thought we went with protocol A'
 
@idjaw oh, your managers are smart to not let you guys meet each other :D
 
hahah
@tzaman precisely. This is what our system tests are for
 
"daddy daddy, we gotta go"
"not now, I have to talk about integration tests"
"sayWhaaaaaaaat?!"
 
:D
 
lol
 
9:31 PM
@inspectorG4dget +1 . ahaha yeah. I'm being a bad daddy
You guys started talking about something I really love
at the moment I had to leave
ok...I just realize I indirectly implied I love this as much as my kids
 
and just when you thought this room was devoid of euphemisms
 
and heaven forbid the protocol have any ambiguities in it :D
 
that means I REALLY need to go
I'm horrible...
 
alright, I need to go home and get some sleep
rhubarb, folks!
 
@khajvah it depends on what type of QA people you have, if it's "bang away on a keyboard" then yeah probably :P
 
9:37 PM
Do QA people write code to exploit you application?
 
What does a caller mean here. A line such as yield item produces a value that is received by the caller of next(…)
 
or those are security guys?
 
Electron is acting super bizarre
 
@AbhishekBhatia the function/whatever that is calling next()?
 
@corvid implicit val context
 
9:39 PM
@khajvah well, right now I'm basically writing a framework for comprehensive system integration tests
 
x in <iter_object>. Is x the caller ? Who is caller in say <iter_object>.next()?
 
also. python and it's duck typing. ;_;
 
@khajvah it's opening a browser window in my terminal, which doesn't even make sense...
 
@enderland in Python?
 
@khajvah yes
 
9:40 PM
I need to learn more about integration tests (assuming I know much about unit tests).
 
@AbhishekBhatia I would think that a loop/listcomp containing x in iterable will implicitly invoke the next() method of the iterable
 
@khajvah integration tests... there be dragons
 
@Andras Deak yeah I second that, but technically who would the caller be? Any references.
 
@enderland How deep do you go with those? Do you test "communication" between objects or just the communication between logical units?
 
@khajvah I am basically creating a mini-system that tests the full stack of our app's communication (effectively reproducing in a sandbox a miniprod network)
 
9:43 PM
@AbhishekBhatia I'm not sure about the terminology, but the value yielded by the generator will be assigned to x one at a time
 
it's pretty cool to be honest
 
it sounds fun
I am honestly losing control of the project at work with terrible and incomplete tests
 
I need to refactor some of my tests
 
but my manager is giving me tight deadlines
 
@Andras Deak Yeah I understand. I trying to comprehend what caller meant in a line I read in a book. "A line such as yield item produces a value that is received by the caller of next(…), and it also gives way, suspending the execution of the generator so that the caller may proceed until it’s ready to consume another value by invoking next() again."
 
9:46 PM
Hello...
 
@VermillionAzure Hello Cinch
 
@AbhishekBhatia OK
 
@khajvah Oh, you're here?
 
sometimes
@VermillionAzure How is the Lounge?
 
@khajvah eh.
 
9:47 PM
:D
 
:D
I used to hang out there
 
Tunisia?
 
10:12 PM
Tatooine.
 
Why is the output not main here? As main is the caller module? gist.github.com/abhigenie92/ef7c16deceef2f9fb9e1
 
@AbhishekBhatia you're not printing the caller's name, you're printing inspect.getouterframes(inspect.currentframe(), 2)
 
77
Q: Python: How to get the caller's method name in the called method?

zsongPython: How to get the caller's method name in the called method? Assume I have 2 methods: def method1(self): ... a = A.method2() def method2(self): ... If I don't want to do any change for method1, how to get the name of the caller (in this example, the name is method1) in metho...

 
@AnttiHaapala closed
 
is there someone who can run a function for me? i am trying to write an HSL to RGB function in another language and want to check if i am getting the same output. i want to see what hsl(300, 100, 25) is in rgb. docs.python.org/2/library/colorsys.html#module-colorsys (note the arguments are in a different order)
 
10:39 PM
A different order to what?
 
oh, the function is named hls instead of hsl :p
 
In [362]: colorsys.hls_to_rgb(300, 100, 25)
Out[362]: (-2375, 2575.0, 2575.0)
oh, s<->l should be reversed, right?
 
yeah, i can probably still use that though
 
In [363]: colorsys.hls_to_rgb(300, 25, 100)
Out[363]: (-2375, 2425.0, 2425.0)
 
huh. thats a strange output.
 
10:41 PM
it is:D
it accepts data in [0,1]
 
oh, its probably expecting the values to be between 0 and 1
 
> Coordinates in all of these color spaces are floating point values. In the YIQ space, the Y coordinate is between 0 and 1, but the I and Q coordinates can be positive or negative. In all other spaces, the coordinates are all between 0 and 1.
so what's h=300?
I always see them up to 255
 
360
 
and LS?
 
100
 
10:43 PM
both?
 
yeah
 
In [364]: colorsys.hls_to_rgb(300./360, 25./100, 100./100)
Out[364]: (0.5, 0.0, 0.4999999999999999)
magenta?
 
i think its purple
 
oh, right!
I'm male so I'm not supposed to recognize colours:P
 
ok, thanks a bunch. thats the same result i am getting, but its not the right result ><
 
10:44 PM
:( Happy to help
 
its supposed to be rgb(128, 0, 128). guess i am going to have to live with the precision error. thanks
 
no problem
@AbhishekBhatia the problem is probably that __main__ as caller is not a function
consider this:
 
Hi guys, someone could be kind enought to check this? (uwsgi, flask):
http://stackoverflow.com/questions/35973897/typeerror-module-object-is-not-callable-uwsgi-flask-python?noredirect=1#comment59602238_35973897
 
@cimmanon I'd still call that magenta
 
def tmpf1(): return tmpf2()
def tmpf2(): return inspect.getouterframes(inspect.currentframe(),2)
t=tmpf1()
 
10:48 PM
because it is exactly between red and blue.
 
then the names in t will be "tmpf1", "tmpf2", "<module>", respectively
@AnttiHaapala I've looked at some colourful images, and I agree
I stand by my earlier assessment of magenta
 
11:14 PM
@AnttiHaapala magenta is rgb(255, 0, 255)
 
this is dark magenta
original magenta dye was approximately sRGBB (r, g, b) (202, 31, 123)
 
:D
OK, I didn't realize the 0.5
I'm back with purple, @cimmanon
"lila", to be precise, whatever that is in English (purple? lilac? dark magenta? mauve?)
 
11:50 PM
Would anyone perchance know how to properly have Selenium access a VPS within a browser? Here's an example: oi63.tinypic.com/2j1s8zt.jpg Where I'd be using a VNC connection to view the VPS's terminal and it'd be through Firefox with Selenium.
I mean without using a macro, if possible.
I'm just curious if you guys know a better way, though if not don't worry about it.
 
cbg
 

« first day (1976 days earlier)      last day (2986 days later) »