« first day (2468 days earlier)      last day (2705 days later) » 

16:00
I can give 0.5 help.
The app context is for "app level" data, basically current_app, while the request context is for request data.
There are situations, such as CLI commands, where you'd have an app context but not a request context, which is why they're separate.
@davidism in docs they say that app context is useful to store db connection, so then is it shared between request? or new connection is created every time?
@FlorianMargaine Thanks
2 mins ago, by davidism
During normal operation, you'll only have one app and request context per request.
So no, it wouldn't be shared between requests, because the context would be torn down after the request.
im confused
docs say
Creating and closing database connections all the time is very inefficient, so you will need to keep it around for longer. Because database connections encapsulate a transaction, you will need to make sure that only one request at a time uses the connection. An elegant way to do this is by utilizing the application context.
16:03
I dont have knowledge about python as I am java developer. One of my friend created website in python and He is not able to deploy that site using bluehost. I have whole code of that site which is developed in Ubuntu Os. now I want to deploy that site from windows OS. Is there any way to do that deployment
@marxin that's why SQLAlchemy keeps a pool of connections in memory.
getting a connection from the pool is fast, but still needs to be unique per request
I see
what's the difference between app context and request context?
ok fair
just different kinds of data?
16:05
app context is something like request context but define some other data, app related
@FlorianMargaine I don't want to keep quoting myself, lol
like config in app context, headers in request context?
5 mins ago, by davidism
The app context is for "app level" data, basically current_app, while the request context is for request data.
ok
missed that one, sorry :)
:-| so many quotes. No worries.
16:08
also, cool, didn't know there was one of the flask maintainers here
I've used it in a couple of applications, it's fairly straightforward and doesn't get in the way, I really liked it
Just curious, I think it's a quite rare case where one would interact with a Flask app through command line, so what's the purpose of differentiating app context and request context?
@SunQingyao semantically it makes sense, it's weird to have e.g. config values in the HTTP request object
@SunQingyao there's the Click-powered CLI, which replaced the Flask-Script extension. run, shell, db upgrade, etc.
Another example is background tasks, they're not part of a request, but they still need to know about the app.
makes sense
Yes...
16:16
@davidism can you be in few different app contexts?
There's nothing preventing it, but I don't know why you would. During normal operation it doesn't happen.
Yeah that's not that confusing. Why did I just spent so much time trying to understand it :/
I do have an example of pushing another request context: stream_with_context pushes the same context a second time so it persists after the view function exits.
Im asking because django has its own setup() thing on module level and probably its not possible
probably its equivalent of app context in flask
with app.app_context():
with app.app_context():
with app.app_context():

maybe just like this?
16:19
Django uses globals in a very different way than Flask. There is only one Django app in a process, since the config is global. It's not the same as app contexts, where that just determines which app and its config is active.
yeah I know how, I was just wondering if they wont override any data
Because Flask uses context stack?
its not same but its kind of the same thing
I was worrying about the situation where one request is being processed when another request comes. I thought the existing app context might be cleared to make place for the new one. But now it seems that the WSGI server will put the new request in another process/thread?
@SunQingyao yes its correct
16:23
HAHAHAHA it feels so good!
my intuition was telling me that you want to share some data in app context, I was wrong :p
So we generally won't store stuff in request. We just read from it, and only store things in g, for semantic purpose?
as far I understand not really, just g might be available when request is not defined (outside request context)
@marxin maybe "app context" should be renamed to a better name :/
in request context you should be fine to use request object or whatever it is
Im not sure, im not heavy flask user
16:28
It seems that request is available even in before_request and after_request hooks...
Those hooks refer to "before/after Flask handles the request", not "before/after Flask sets up the request".
@davidism Understood. Is there any place where request isn't accessible while g is?
16:46
@BhargavRao sigh, stackoverflow.com/questions/45163086/… this question got also deleted when that user was removed.
I'll be back in a bit and check, running home now.
I'm starting the timer
the dupe actually doesn't answer the question, only tangentially.
cbg
@Kevin when you have a minute, would you mind checking out my PRs to rabbit? Since you're the main person who runs it, I want to make sure I don't break your workflow
Aw, that doesn't work. Sorry for the incoming ping, other-Kevin.
16:57
how many timelines did that ping reach?
is this considered crossing the streams?
Let me focus and use my reading steiner power
DSM
DSM
I feel like that's a reference I should get.
yup. Just as I thought
Ultimate Steiner Power
OP has clarified their question with sample output, and has added their own code attempt. stackoverflow.com/questions/45165413/…
@DSM does this mean anything to you
17:00
@marxin sort of
I want to ensure I am using the self.session for ALL my ops using requests, instead of random requests.get functions -- making sure they are self.session.get funcs
0.409031 glasses of beer on the circuit board?
DSM
DSM
@KevinMGranger: no, although from the art style I can tell what portion of the world it's from, which means it's probably a reference to some series I've never seen but whose names I've now remembered. :-)
@KevinMGranger At a glance they look OK. I'll try to sit down and give them a proper review later in the week.
DSM
DSM
I've seen none of the linked shows..
17:03
same
I highly recommend Steins;Gate, although it can feel a little slow to start
DSM
DSM
Why;the;semicolon?
Idk, it's how that studio stylizes all their work. Robotics;Notes and other stuff too
@davidism Please take a look at this line When would app_ctx.app != self.app? Even if there are multiple Flask apps, the last app context would have been torn down when this request is being processed...
Steins;Gate is interesting if for no other reason than the fact that they made CERN an integral part of the story
17:05
@KevinMGranger They look a lot like Pixie or Nixie tubes. I remember when they were state-of-the-art.
@KevinMGranger nixie tube! \o/
DSM
DSM
retro;tech!
I don't really picture CERN in real life as the kind of organization that would get embroiled in conflicts... I expect them to mostly email doge memes to one another and occasionally fire high energy particles at desk toys
Every other year they get invaded by the French. One day they'll actually notice.
17:08
Next Tuesday's scheduled experiment: which melts faster under a proton bombardment? Tux or Octocat?
you better live stream
If anyone interested has a spare half hour: reverse-engineered nixie tubes in the making
The webcam keeps melting, too
DSM
DSM
Both are too cute to melt. Experiment approval denied!
Anybody with tox and pytest experience can comment on this: stackoverflow.com/q/44929158/1718174 ?
17:09
way to go Kevin. Management axed your experiment
Go straight to update1 on the question
@AndrasDeak I can confirm that this video is worth watching for the kind of people that like watching this kind of thing.
Can you imagine the SCP foundation as a cutesy slice-of-life anime?
@TemporalWolf "Ping me if the stars align, I'll re-op as well." Small miracles sometimes happen. The OP has added example output and their own code attempt. So consider yourself pinged. :) Hopefully, it'll be reopened before you read this, but just in case, the question is here
@Vini.g.fer did you read this and play with the commands in your tox file to see if you can get it working?
17:11
@KevinMGranger According to the site mods, they have to constantly reject a whole lot of articles that, if accepted, would essentially turn the site into an apartment complex for quirky Mary Sues. Slice of Life is the entropic end state of SCP.
OMG OMG OMG. Just shared and sharing with you
SLACK DARK THEME!!!!
party hats everywhere
I might just use that, thanks
nocturnally optimal slack
umm...
I might not
umm.....YOUR LOSS
~o~
@Kevin I hear there's many arguments over the existence of Gamers Against Weed
17:17
@davidism continuing with my last message. When would there be an existing app context, anyway? Isn't the Flask app instance called in a new process when a request comes? Also, If in some cases, a new application context is not pushed, won't request contexts outnumber app contexts?
@idjaw {{office}} was just talking this morning about how much we wish this was a thing.
and belated cbg
@MorganThrapp Go forward with this gift.
I might try to reduce the contrast on that though
oh, like the "low contrast" version
now that looks nice
@KevinMGranger Not sure if I'm familiar with them. The last "love 'em or hate 'em" story element I remember was Are We Cool Yet?, the performance-artists/body-horror-terrorists
17:21
I do not trust their CSS not to steal any information
I'm a fan of AWCY but the core idea of Gamers Against Weed is "what if memes spread because they're cognitohazards and meme creators are anomalous". Or so I'm told, I haven't ead any of them
@idjaw It's almost perfect. The only complaint I have is that it doesn't work with emoji statuses. It has a weird white border around them.
Hi, does anyone have much experience with web scraping/xml please?
17:26
ask your question, and if anyone wants/knows how to answer, they will.
Also, please make sure you read the room rules! :) sopython.com/chatroom
Welcome.
(but +1 for spelling "scraping" correctly)
Let's see, here's their hub page...
"Gamers Against Weed originated as a splinter of Are We Cool Yet? in 2013"
Oh, not surprising that reception is mixed, then. Apple, tree, etc
"The group is composed primarily of dispossessed or otherwise marginalized individuals aged 15-30 in the Western hemisphere"
âš âš âš  Potential self-insert characters detected âš âš âš 
Yeah, nothing potential about it
Thanks for that. I am using the Scrapy library to get a response.body which I then write as a HTML file locally. I was wondering if it was possible to edit the response before writing it to file - for example replacing some text within the body?
@AnttiHaapala Interesting... On the topic of browsers doing scary things, there's some good recent discussion about service workers over at xkcd, starting here. They sound scary, but according to Xanthir (aka Tab Atkins Jr, a Google Chrome dev and a member of the CSS Working Group) they're quite safe and benign.
17:31
That slack theme doesn't work with multiple teams. :/
hmm
my work laptop only has work slack
I'll have to wait until I use my personal laptop
I restarted it twice. One time it only hit my work team, this time it hit both.
So I just have to never close slack.
@idjaw I have slack of both work/professional in both places...
@enderland For my work laptop I only have work. For my personal I have all slack teams I am involved in.
@PM2Ring reop vote added :D
17:41
@MorganThrapp strange. Asked a friend who is using multiple teams and so far no problems.
@idjaw There's a ticket open for it on the repo. Apparently it's an issue with switching teams either too early or too late in the load process.
ah ok
Something with the event handlers not binding/firing correctly.
yeah. That totally makes sense.
even when switching channels you see the "slowness" of the loading because of where it is injected and how it is "reading" the properties that will be modified
would be interesting to see a more optimized seamless update in the future
if it is even possible with this type of mod
I'm not sure how much more you can do with Electron.
Spotify is probably the best implementation of electron out there, but even that is... Odd.
17:47
@PM2Ring if the repo is hijacked for even a second, and I happen to switch channels in slack, they can possibly get all of my history there...
@TemporalWolf Thanks
@BhargavRao guess what, yet another shmat question from a newb: stackoverflow.com/questions/45197598/…
Haven't service workers been a thing for a while?
That post makes it sound like they're brand new.
@idjaw @idjaw That helped me figure out how to run a single test with py.test, but still can't get it working with tox
@davidism I guess they have, but I only learned about them from that thread.
17:53
@Antti I've deleted the other post
For example, if we ever got Rabbit developed, it's how I would implement group notifications: you go to a sopython page with your phone that sets up a service worker.
@BhargavRao deleted which other post?
ah undeleted
@BhargavRao the guy there says he's not the other guy
I wonder if they have a class on the use of shmat there :D
@Vini.g.fer You should be able to execute commands in tox easily. I don't see the difficulty in that?
@Antti I meant undeleted.. I've pinged another mod about this new one. Bit held up.
@BhargavRao clearly you need minions to do your bidding
18:05
yellow face, happy default mood...are you asking for a job?
What post about service workers?
@AndrasDeak lol
Shmat sounds like it's an old yiddish term for something. "Will you go out and get me a shmat of something good?"
or one of Antti's euphemisms
@idjaw Got it!
18:13
great
Seems the "-e py27" parameter I was using when calling tox was the issue
Maybe because I didn't had this enviroment set in tox.ini
Still sucks that tox drops the error silently. A message such as "no tests/tasks to run" would help a lot!
did you run it with --debug to get verbose logging?
@BhargavRao I guess the other mod decided to del
I get an error:
tox: error: unrecognized arguments: --debug
tox --debug -e py27 -- servicos/tests.py::FormatacaoDeCamposTestCase::test_formata_campos_para_estomato‌​logia
This is the command I used to run tox
I think it might be tox -v
however. This is a lesson now to run "tox --help" to see what commands are actually available to you
if --debug was not recognized as a command, check the help to see what commands are allowed
I never remember what is is, usually debug or verbose is almost the default for any app that supports it
but if it doesn't work, my go to is to check the help and see what I have to do
  -v                    increase verbosity of reporting output. -vv mode turns
                        off output redirection for package installation
My tag calculation is much higher on mobile app than desktop and the numbers never match.
18:41
cbg, persons. Does anyone know under which name sopython.com is registered over at stackapps?
Hey. It's registered over at stackapps?
news to me. Do you have a link?
I'm searching for things myself and I can't find anything. I found a manage my app, but obviously nothing under my name.
I made the assumption that it is, based on being able to login with SE account on sopython.com and api.stackexchange.com/docs/authentication says you need to be registered to do that
welp, recbg :D had an interesting conversation about strong vs weak type languages... The strong type people had very strong opinions.
18:46
@MooingRawr they usually do
even though "strong" and "weak" are so weakly defined when referring to types.
DSM
DSM
It doesn't help that half the time people mean "static" when they say "strong", and only the very strictest strong type supporters want to forbid 12.3 + 0..
All I said, was I enjoy my freedom on doing what I want to do with objects. :\
can anyone confirm the stackapps thing? I hope I'm not looking for something that doesn't exist
I find Haskell's type system very interesting. This is the first one that comes to mind when you mention "strong types" as well as "strong opinions".
18:50
@TimCastelijns Unfortunately, this is all very new to me. I have no idea what this is.
I don't want to ping all the other RO's here
I also find Python's looser type system useful for practical coding.
but for anyone that is here. Anyone have info on what is being asked/
Both have their strengths and weaknesses.
Who owns and maintains sopython.com?
Davidism
it is open source on github, don't know about the host
18:52
are we asking about the owner of the sopython.com domain?
yes, that was my question
I should have been more specific.
few minutes. I'm pinging people to get info.
I'm asking because I am looking to register an app there, but it specifically says to avoid naming the app any way that could imply association with SE. Was wondering about the "so" in sopython
well, I got to the coffee shop to get some work done. No headphones in my laptop bag. So either I work without my music or I go back home to get them...such tough decisions.
@MooingRawr Python's data model can mislead people into thinking it's weakly typed, when in fact it's quite strongly typed. And although it might appear to be dynamically typed, it really isn't. Try changing the type of a Python object, it's (kind of) possible, but not particularly easy, nor generally useful.
18:57
It doesn't help that people don't understand the difference between names and variables
If what I'm saying doesn't seem to make sense, remember that Other languages have "variables", Python has "names".
@PM2Ring which introduces even more terminology that is either poorly defined or poorly understood (or both).
^ that has never made any sense to me. I don't see the yam difference.
I have difficulty understanding the difference, too. I typically think of a "variable" as a "name associated with a value".
I had this conversation with Andras a few weeks ago. He brought up some good points that I can't recall off the top of my head right this moment.
and I am going get my headset. Need some music to rock to while I code.
In those other languages the type "belongs" to the variable, and that determines the kind of data the variable can hold. Whereas in Python, a name has no type information, the type information belongs to the object itself, and Python objects can be bound to multiple names, or to no name.
19:04
and in other languages, an object can be held by multiple variables or by none
@Code-Apprentice I like the graphics at that link (which is why I keep linking to it). In other languages, a variable is a box: a definite location in RAM for holding a particular type of data, if the language is weakly-typed you're allowed to change the type of data that the box can hold. In Python, we don't need no stinking boxes. :)
@Rawing everything in python is a "variable" though, even class definitions, so using "variable" is not really precise
@PM2Ring all I know is that my mental model of Python's types and values and related concepts works for me. I have not run into any serious problems that have caused any serious confusion (at least not that I can remember).
attention
cat sharing time
*here*
19:15
cats replacing soccer balls
:D
knowing cats, that should be sucker ball
@idjaw I guess that's better than kicking them
yes. I only share harmless cute ones
and dogs wearing shoes clomping around
those always get me
legit out loud laughing
a cat well deserving of the title Sir Meowington Clompsalot
19:22
speaking of classics, I've read this before but hearing it narrated makes it even more awesome:
Do we have a canonical for this? stackoverflow.com/questions/45199058/… I guess I could hammer it to the question I linked in the comments. Aaron's answer is good, but the earlier answers aren't so great.
@Code-Apprentice a pet deer? wat
I just watched a five minute video of pets in shoes
and I have tears running down my face
I find it so funny that this deer has adopted many dog-like behaviors. I saw them on TV where the deer runs around with its nose pointed towards the ground just like a dog.
@idjaw You can't just say that and not link the video.
heheh ok hold on
beware the deadly wet shake-off dog tail
@AndrasDeak yes other mammals shake themselves dry, too. Never seen a deer do it before, though.
man closures in python seem so weird
"Who u fren"
"Im prance frolick doggo"
"Doin me a great surprise"
I just discovered a wide swath of "boolean" columns in our database are varchars with either yes or no in them, so I need something to distract me.
12
@MorganThrapp write a script to convert them randomly to "YeS" and "YEs" and "yES" combinations
19:29
@MorganThrapp Any "hell yeah"?
@MorganThrapp also did that come from a MS access source by chance?
@enderland Nope, just some impressively terrible devs.
if I was using yesses and nos for bools, I would definitely have a hell yeah in there
@MorganThrapp oh. I know with access you can't have a binary value that is "null" basically so you had weird situations like that
I would fail the review for not having a hell yeah in there
Nah, this has always been in MSSQL.
It was pre-2008 so I can almost forgive the int columns being used as booleans.
Hey @idjaw Here's an interesting post related to the topic of your canonical, about shadowing a standard module name when you give your script the same name as the module: stackoverflow.com/questions/45199429/…
wow "Why is... those things" indeed.
I'm with that OP right now...
that's very odd.
but they didn't name anything themselves...unless they did? let me look again.
oh wait...their script name is time.py
time to hammer
self answering ftw
19:35
Should we tag it with python-internals?
but it is a dupe right?
they clearly are using a time.py they created
I was joking, I opened it since and it's a decent question
whether or not it's a dupe, I don't know
ooooh
hmm
let me remove my dupe then
@idjaw that's not the question though, it's why the different behavior
why? OK
19:36
yep
I removed it
inb4 Tigerhawk hammers it ;)
@idjaw I doubt it. They fully understand that shadowing is to be expected, they want to know why 3.4.6 behaves in the way we know so well, but 3.5.2 seems to not throw an error.
It's a bit wierd that OP is asking "this weird broken thing I'm doing works differently between versions". It's a but as if he was asking why a certain kind of demon lord can't be summonned with white goat heads, only black ones.
But I must admit that I'm not familiar with that pyenv stuff. I assume it lets them specify the actual version used.
@PM2Ring yeah
pyenv lets you switch between python versions nicely
19:39
@enderland Thanks
> Circular imports involving relative imports are now supported.
@vaultah Slap down some knowledge in there
I think he's writing an answer
I am not :D
well, you should be :P
19:41
@vaultah Yeah, please write a nice canonical, this is bound to come up again.
come down from that ivory tower of yours
@PM2Ring FWIW most relevant posts will need "don't shadow names" as an answer, right?
I'm not seeing the link between circular imports and their example
@AndrasDeak what's the fun in denying people the ability to spend lots of time debugging issues like htat?
@AndrasDeak Yes, but it also means that idjaw's canonical no longer fully addresses the situation.
@idjaw The 3.5.2 version isn't succesfully importing the standard time module, it's succesfully importing itself. I think. ;)
(I googled "python composition" and the first hit is lphtw)
19:45
@PM2Ring hmm...interesting...weird....I want someone to answer this with some nice fine details
@vaultah Come on, you've got an accept and at least 3 or 4 upvotes guaranteed waiting for you. :)
Unless Martijn appears out of nowhere & posts a 3 page answer. :)
If you don't I'll summon Martijn
LOL haha
I need to check whether my hypothesis is correct first, this will take some time
@PM2Ring nah, this works:
You're free to post the answer yourself :)
19:48
$python time.py
1500493648.366118
$cat time.py
from time import time
print(time())
$python --version
Python 3.6.0
Hey, so it does.
And so does this, so it's not just a relative import thing:
import time
print(time.time())
And when I go into the REPL in the same directory where I have that bogus time.py and do import time, I get the standard module, i.e., the bogus one's not importable.
oops, mispelled the abbreviation there...then again that shouldn't even be starred
20:15
@AndrasDeak Fixed
Do you want me to cancel the stars on the goat head one too?
star culture in this room is indecipherable to me, a mere peasant
@PM2Ring oh I didn't notice that one:D
I don't personally find that particularly funny but I don't object either
So I leave it to the powers that be to decide. Thanks for asking (and the destar)
I agree it's not that funny, and it has a typo, so I'll de-star it.
baaaah that too
thanks
my typo skills are wierdly acute today
One of the planned features for rabbit is de-starring unpopular starboard items after some amount of time
20:24
drop in the ocean :P
@Kevin (not Granger D:) got an awesome visualisation for you
I'm aware that this is not a really appropriate use for the expression, but meh
@Ffisegydd b'locks?
@idjaw thanks, let me know if you hear back from them. I am usually around.
That's amazeing
spanning trees are pretty
wonder where all those plants and corals know from how to do that
20:27
that's mesmerizing @Ffisegydd
Me, I taught them.
See also bost.ocks.org/mike/algorithms for anyone interested in cool visualisations
Ffisedruydd. Yet another facet on the sphere that is your being.
From the author of D3.js
tree that is your being?
Do trees have facets?
Let's facet: they don't.
20:29
Talking about facets
Anyone interested in ML/visualisation should look at research.googleblog.com/2017/07/… (cc. @DSM, might be useful in your work)
There's links to live demos somewhere, the Dive especially is really cool.
I'm annoyed how hard it is to find all the specific changes between two versions of python
The trick is to not use 2.
Then you don't have to worry.
@Ffisegydd I'm currently intrigued by that time question
@Ffisegydd machine learning and elaborate visualization are just two artificially generated subjects whipped up by Big Data
Big Data wants you to think that you need big pretty shiny figures
@idjaw sorry for ping, but I have to ask, would you also be the type where instead of is_field you would prefer to use field_eh?
20:38
no need to beat around the bush; "the type" is called "Canadian"
3
Would you like to cast into that type Andras? you would make a mighty fine moose riding snake :D
something tells me that I'd have vertigo on a moose
English feature request: "amount" should also mean "riding a mount", just like "atop"
It does
delightful; then please edit the wiktionary :P
I was going to say "I'd have vertigo amount a moose" but wiktionary stopped me
DSM
DSM
amount in that sense sounds really archaic, though.. like "abed"-level.
20:46
I'm OK with that
weird Hungaricisms or archaisms---not a huge difference :D
and JRRTolkien & GRRMartin have substantially shifted my language age
I keep wanting to break my fast and walk barefoot on the rushes in my sleeping chambers
one day I'll even look up what all those horses mean
@AndrasDeak were you confused by that, too...garron, palfrey, etc.?
@MooingRawr I reserve "eh" for unittests where they fail and I have an explanation
self.assertTrue(something, something_else, "looks like you messed up eh")
good god @FlorianMargaine It's almost the NEXT Halloween and you're still a zombie.
@Code-Apprentice not confused, and I have a vague idea of some of the subtleties, but I have a general lack of equine domain knowledge to begin with, and I didn't even try to learn what those exactly mean
Once I figured out that GRRMartin meant "horse", I just mentally did a s/garron/horse/ for example.
sometimes it's more than that; he's conveying that the animal is in a bad shape; or it's a smaller, leaner kind; or one of those big monsters that you can literally ride into battle
20:59
and even a verbal or written explanation of what type of horse a garron is doesn't really do it justice.

« first day (2468 days earlier)      last day (2705 days later) »