« first day (2203 days earlier)      last day (2745 days later) » 

12:41 AM
Hoping the new display doesn't need a new mortgage. But it probably will.
 
Hoping they have an escape key just so tech "journalists" have to find something real to write about.
 
1:21 AM
@AndrasDeak if you disabled f.lux it would probably help get rid of the "tired and lazy" feeling since that is what it is intended for.
 
2:10 AM
Yo, @idjaw, you should go see bandsintown.com/event/… so I can live vicariously through you. :P
 
2:21 AM
@MorganThrapp hmm...let me check them out. Never heard them.
 
I just found them on spotify like an hour ago.
 
awesome. I queued it up. So should be playing on my list
 
Cool.
 
what are you up to tonight
 
I really like how they have this mix of smooth R&B type stuff, but then some more hip-hop electronica sounds as well.
Playing WoW and cleaning. Got a friend coming over on Friday.
You?
 
2:33 AM
Just got back from a room escape with some friends.
 
Oh, nice! I want to do one of those, they seem like a ton of fun.
 
they really are.
especially with the right group of people
 
Oooo, the NY one is Zombie themed.
 
COOL!
 
What was the one you did?
 
2:37 AM
tonight was this mayan-type temple. You had to try to make your way in to the main room and figure out how to get the shrine
 
That sounds fantastic.
 
what was neat was that the room was really dark, and there was a flash light hidden around
 
Sounds a little like Legends of the Hidden Temple, the old nick game show.
 
I wouldn't be surprised if a lot of these room escapes borrowed a lot of old ideas
 
Makes sense.
 
2:38 AM
one of the ones I did was a murder themed one where you are playing an FBI agent investigating the home of a serial killer
and you get locked in and a timer goes off
and have to find and diffuse the bomb they set up
 
That sounds great, too.
 
that was really really fun
 
Ever since that one Brooklyn Nine Nine episode, I've wanted to do one.
 
oh! do you watch New Girl?
 
I watched the first season or two. They did a crossover, right?
 
2:40 AM
YEAH!!!
I had no idea
 
I saw the B99 half. It was... Not good.
 
I was just catching up, and BAM! there they were
 
It felt super pointless. Like, Jess didn't actually add anything to the episode.
 
oh, neither did this one
it just happened
 
 
3 hours later…
5:20 AM
morning cbg
You'd think finns had learned to drive in winter conditions during the years, but nope
It's Mad Max out there in the highway when a slight snow falls
 
5:41 AM
Hi to all, I have a question.
In the past I have given an answer to a question. After some time I have now found a different answer to the same question.
The second answer doesn't make the first answer obsolete; it is another approach to the same task.
So the question is: is it OK to post the second answer as a separate answer?
Thank you.
 
Edit the 2nd approach as an alternative in to the answer you've given?
 
6:01 AM
so, Ilja, you suggest to append the new answer, to the first one?
Is this definitely the better / more accepted option?
(instead of writing a separate answer)
 
I suggest a new answer
And you can edit the first answer to tell that there is a new answer
 
Yes, Statham, I would prefer to do as you suggest. I wanted to check if this is ok with the community.
 
6:47 AM
cbg
 
7:43 AM
cbg
 
global variable
python
a question
can i ask
 
shoot
 
i am declaring global variable in one module and my fucntion is updating it but when i call that global variable into other function i get the old value not the updated one
 
some code would be great ...
 
7:59 AM
its first module i declare range data in that file and updating it
 
please read the room rules about formatting your code ... sopython.com/chatroom
 
its my first module and i am updating in it now i want to get the updated value in other module
 
Sohabid, please stop pasting screeds of code into this chat. "Only paste code directly into chat if it is not very long" room rules. Thanks
 
sorry sir
my bad
i will remove that now
 
In general terms, when things don't get updated as you expect it's a good idea to ask what is getting updated that shouldn't, as well as what isn't getting updated that should. You are updating something, after all, right?
Rather than have a function update a global variable it's often better to have the function return the update value and then have the calling code bind that returned value to some name.
 
8:18 AM
so i will make a new function and put that updated value in it and then call that function in other
 
Cabbage
 
@SohaibAsif In future, please do not link your fresh questions here. See the room rules for details.
 
sorry members i did not read the rules i will not post that
em sorry sir
 
8:22 AM
Perhaps I should add "do not address the resident Finns as sir" to the room rules
:D
 
@SohaibAsif: It's best to avoid using global variables, especially globals that you want to modify. Also, Python globals aren't like C globals, they're really only global to the module they're defined in.
 
more like "not like the php globals" :D
 
did it
absolute happiness is when your code runs
 
@SohaibAsif One reason that your question hasn't received much attention is because it originally just had pasted images of your code with no code as actual text. Please see Why may I not upload images of code on SO when asking a question?
I see that you've now added the code in text form, but you might as well get rid of those images since they don't really give any additional information & just add clutter to your question.
 
Cabbage
 
8:29 AM
@SohaibAsif In that case, I guess we can forget about that question. :)
 
i am new to stackoverflow so i am learning
so would i remove that question now i have solved it
 
@SohaibAsif while there is no answers to the question (and as this is not a very high quality question), if you consider your question answered, you can still delete the q
 
thanks everyone for guiding me
 
if it gets answered, and there are upvotes to the answer, you cannot delete it easily any more even if it gets downvotes
 
Also, it's not a good idea to get into the habit of deleting questions as that can lead to a question ban. OTOH, it's better to get rid of useless questions than to leave them hanging around.
 
8:32 AM
@SohaibAsif however, if you have a good question, and you yourself later find an answer to it, then you can and should always self-answer it, you can even accept your own answer as the solution
 
i deleted that ;(
i would have answered on my own
 
@SohaibAsif because it fell under the OTOH part :D
 
alot to learn
 
@SohaibAsif you can still undelete your question if you have the link
folks with 10k reputation will see your question too, if they've got the link, we can edit it and vote to undelete it.
but the biggest problem with that question is that it didn't have a MCVE. The PySerial stuff is completely unrelated to the problem of updating globals
you should always trim the excess fat, by testing if you can achieve something smaller that still reproduces your bug
like:
# module1
range_data = 10
def set_new_range():
global range_data
range_data = 20

# module2
from module1 import range_data, set_new_range
set_new_range()
print(range_data) # still prints 10
dunno why indentation didn't work there for a code block :D
hmm
grr, I guess I had a non-breaking space on some of those lines
 
8:53 AM
But the code was relatively small :)
 
Hi
PM2 process manager for node restarts the server automatically after occurrence of any error. My team is using uWSGI application container for Django and Python.
What shall we use to restart the server after any error or stuff
like PM2 etc. does for node
 
Nice example, BTW, Antti, and neatly illustrates how importing a global really just binds the name in the importing module (so later changes of binding in the imported module don't affect the importing namespace).
 
@holdenweb yeah it was, but it still wasn't minimal really, as in if there was another error, I couldn't repeat it without installing pyserial and whatnot,
@GandalftheWhite you wouldn't really need it?
@GandalftheWhite ah you mean if the whole process crashes?
supervisor is a general process manager that was written in python, could use for node too
or if you're on linux, just use systemd
 
We deployed it on AWS (Linux machine)
systemd or supervisor
thanks
I will do my research now
thanks
 
depends.
 
8:58 AM
The search results weren't helping my cause that is why I barged in here
 
if you have systemd and are comfortable with it, I'd go with it.
supervisord works for systems that do not have systemd..
 
I don't handle the devops tbh
 
googled around, some people said they use supervisord instead of pm2 for node stuff too
"because pm2 sucks"
> I am not happy with the stability of PM2 so I will use Supervisor, as advised by a CTO, friend of mine.
in comments
I am using supervisord for my servers, but, it is because my stuff existed even pre-systemd era, now I would really consider researching systemd instead.
less moving parts.
 
Thanks for the info Antti
I personally have used Google's app engine more
so that was never an issue for me
but now I am managing things on my own
therefore...
 
yeah, I've never used GAE myself.
I don't think I'd be happy with it :D
 
9:07 AM
Why?
 
especially becuase of Python 2.7
 
it is good for beginners and inexpensive like AWS pre handled stuff
unlike*
 
9:54 AM
started learning linkedin scrapping and i just want to advise use lxml library and don't waste your time on Beautifulsoup on linkedin you will not get any div data
just sharing my thoughts:)
 
LinkedIn has a public API as far as I know
 
good publicity for a Finnish company again... Iran is using Finnish-manufactured high-quality cranes for executions.
 
LinkedIn does not allow any search api so there api has some restrictions
so its better to write your own scrapper
 
yeah, scrapper that is...
@SohaibAsif linkedin used to have an api, then they offloaded the support to stack overflow
... that was a great success...
 
yeah:)
 
10:04 AM
135
Q: Reach out to LinkedIn about outsourcing their developer support to Stack Overflow

FfisegyddLinkedIn recently closed their support and began directing their users to use Stack Overflow. This has seen an upsurge in questions within linkedin. This has been previously brought up on Meta here where it was closed as a duplicate. Unfortunately, the majority of these questions are off topic o...

 
what is nginx?
 
a googleable term
 
@vaultah lmao
 
10:19 AM
@vaultah (2)
quoting what he said
 
 
1 hour later…
11:29 AM
cbg
 
12:09 PM
Cbg
 
12:20 PM
cabbage!
 
cabbage
 
Good morning. I did a self Q&A yesterday that wasn't greeted by a slew of incompetents (like last time). Surprised no one from here commented on it either. Anyone notice? I welcome feedback. Perhaps the word "private" should be changed to something else?
 
12:35 PM
I didn't notice anything. Is this something that happened in chat?
 
no, but you guys do watch the new python Q's, right?
 
Would you like a slew of incompetents? I'm free in a few hours.
 
Yeah I don't know if I'd call dunder methods "private" because I usually mentally reserve that term specifically for names that undergo name mangling. That only happens for names with "at least two leading underscores, at most one trailing underscore", so dunders are out
 
I've experimented with feeds in chat. I have determined them to be too obtrusive for me to allow the inline feeds. I don't mind the drop-down ones though.
 
That's only my personal preference however
 
12:38 PM
I just never use name mangling and I think critically of the rare cases where I see it in my code base at work.
 
@AaronHall there are so many things, like,
>>> ''.__iter__
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'str' object has no attribute '__iter__'
>>> iter('')
<iterator object at 0x7fa8823a1350>
(python 2, comes to mind)
 
I do agree that one ought to avoid directly invoking dunder methods where possible. Prefer str() over .__str__() etc
 
iter doesn't "just call" __iter__
 
fallback behavior? I knew I'd left one out.
or more
 
python3 strings have __iter__
but in Python 2 that's the old sequence protocol at play
 
12:40 PM
@AaronHall I saw it, and didn't downvote either the question or answer. ;) I also disagree that dunder methods are private. Sure, they're special, and you should generally not call them directly (apart from in the circumstances you describe), but that doesn't equate to private in my book.
 
>>> class Foo:
...     def __getitem__(self, idx):
...         if idx > 5:
...             raise IndexError
...         return idx * 2
...
>>> for i in Foo():
...     print(i)
 
Why no __index__ :)
 
PM and Kevin - which word should we use for names that users aren't intended to use?
 
@AaronHall not part of the public interface
 
(do I need to define "user"?)
 
12:44 PM
If the theory in the paper linked by holdenweb in this post is correct, this guy is probably not going to be a programmer.
 
Yes, exactly, not part of the public interface
 
@AaronHall that was your answer
 
Not public therefore is _____? hopes we can fill in the blank
 
is not public
 
"keep your dirty hands off"-ish
 
12:45 PM
private?
 
this might be my incompetence talking, but I think you're going in circles
 
that which is not good is ____ ?
 
less good?
goodless?
OH OH!!! !good
 
I'm not convinced that dunders aren't public, really. Even though we've established that users shouldn't play with them carelessly
 
@PM2Ring sounds like the same paper that Jeff wrote about
 
12:47 PM
to me public/private implies that the language treats them in different ways, but it's not the language that's imposing restrictions on their use, it's the community.
 
well, I think the semantics of the word "private" in my answer are correct, but in other languages private means that you are not allowed to even know they exist.
 
@AndrasDeak Yep. I'm pretty sure I first read about it in that codinghorror article.
 
right?
 
@AaronHall if you're adamant that private is good in this context, why did you ask about it in the first place?:)
 
because others said that it is not good :d
 
12:49 PM
5 mins ago, by Antti Haapala
@AaronHall not part of the public interface
 
^^^ kinda started to re-make-up my mind.
 
I'm going to stick with my original viewpoint: "private" doesn't have a single well-defined meaning in the context of Python, so it isn't "wrong" to call dunders private. It's only a difference of opinion.
I doubt you can find a term that will make everyone happy, because the community doesn't yet have something everyone can agree on
 
As an incompetent non-professional, I associate privateness to a very strict lack of accessibility of entities from outside the class. Which is missing from python altogether. The whole "consenting adults" picture replaces hard privateness.
 
(or at least, that most people can agree on, and we can shun everyone that doesn't)
 
12:51 PM
@AnttiHaapala Hey, I'm not contrary to be contrary, I genuinely want to improve my answer.
@AndrasDeak It's no longer "consenting adults" but rather "responsible users" github.com/kennethreitz/python-guide/issues/525
 
the whats now?
 
Less a question of semantics and more connotation... :)
 
yikes
 
I think it's a good move. It's hard to speak to an audience that can contain teenagers or children and call them "consenting adults"
 
This seems like a weirdly unflexible interpretation of the word "adult". Teenagers get called young adults all the time, should we stop doing that too?
 
12:55 PM
Anyways, I'm going to use Antti's verbiage if he doesn't mind.
 
the only teenager programmers I see on SO and are serious are much more mature than most of the adults here
but I'm not going down this social rabbit hole
 
I'm missing the context of teenagers, children and adults.
what's this about now?
 
a quick question
just want to know the syntax
 
There's also the sexual connotation of "consenting adults" outside the context.
 
(which it isn't)
outside the context, that is
 
12:57 PM
I hear you.
 
But I can see that this jovial remark from the old days of python should (by some people's measure) be revisited in a golden new age where more people use python
 
if we have a div and in it there is another div how can we call
 
@SohaibAsif what is the value of div in in your code?:P
 
@idjaw See Aaron's link. A (the?) Python guide used to contain the phrase "we're all consenting adults here" in the context of explaining why it's possible to modify the "private" attributes of a class if you're sufficiently determined. Someone thought that this was unwelcoming to programmers that aren't legal adults and/or had inappropriate sexual connotations, so they removed it.
 
(sorry, go on)
 
12:58 PM
suppose doc.cssselect('div.some class ')
i know this
what if there is another div
int div A
how can we do this
sorry to ask here actually lxml website is not opening
 
Monty Python's Flying Circus occasionally had crude / violent / sexual humor, please sign my petition to remove all references to it from the Python language, including the name
We have to be welcoming after all
 
:D
and we should stop calling the lead designer a Dictator for Life, doesn't have the right connotations
 
doc.cssselect('div.A div.B') is that the right syntax
or should i put comma or space
 
@SohaibAsif I'm not familiar with what you're using, but isn't this something you can just try for yourself?
 
@SohaibAsif What happened when you tried this yourself against whatever chunk of text you are trying to parse?
 
1:01 PM
lxml python library for scraping i found example of only one div i want to insert more divs
so i cant find
if i know syntax i can do it
thats why i ask here to guide me
 
use beautifulsoup
bs4
 
linkedin dont allow
beautiful soup to scrap
 
Here's my guidance: don't be afraid to experiment. If you're pretty sure one of two ways will work but you don't know which, try both. It will probably be faster than asking the truculent users of the Python room.
 
i guess
there data is render from javascript so beautiful soup wont work i tried it myself
 
hello there...am quite new to python...while going thru numpy docs, I am just guessing why [numpy.dtype page](https://docs.scipy.org/doc/numpy/reference/generated/numpy.dtype.html) does not contain any information/pointer/reference about [numpy.dtype.byteorder](https://docs.scipy.org/doc/numpy/reference/generated/numpy.dtype.byteorder.html)

Isnt that obvious/intuitive to show numpy.dtype.byteorder as a property of numpy.dtype on its docs page?
 
1:05 PM
It's not so much "linkedin doesn't allow beautifulsoup" as it is "beautifulsoup can't parse linkedin because the page renders with javascript"
That's like saying "the tree doesn't let me cut it down with this garden hose"
 
how truculent of you
 
How do I go about reformating a 3D matrix in ZYX order to be in YXZ order in python? .reshape() did not do what I had hoped it would.
 
@Peter .transpose(1,2,0) probably
 
anyone? just trying to understand how python online docs are organized?
 
what is the most efficient library for scraping
 
1:08 PM
To be clear, the numpy documentation isn't the python online documentation. numpy is a third party library.
 
lets discuss
 
@AndrasDeak thank you very much Andras
 
I know that bro
 
@Peter no worries:)
 
e.g numpy vs beautifulsoup vs lxml vs scrapy etc etc
vs selenium
 
1:09 PM
I don't think numpy and lxml are web scraping libraries.
 
I'm sure numpy isn't.
 
docs.scipy.org down? or is it just me?
 
I'm not interested in efficiency, anyway. If I wanted fast code I wouldn't be using Python. Heyoooo!
 
@Peter doesn't load for me neither
 
ooooooh sick burn
 
1:10 PM
okay whats fastest
 
@AndrasDeak :(
 
now can anyone tell if it is a mistake of not including byteorder as property of dtype on its doc page, or am missing something? My primary feeling is that I am missing something as mostly this doc is autogenerated using some tool...so its something that made that tool not to include byteorder as property of dtype on its doc page. Now can I know whats that?
 
what the byteorder is?
 
basically some more info about datatype
 
1:11 PM
@Mahesha999 The page is loading extremely slowly for me but I have a feeling that dtype is an attribute of the parent class of that class, so it would be on the parent class' documentation page and not on dtype's page. I have no idea if this is true or not because the "base" link won't load, but that's my suspicion.
 
do I have any sqlite3 friends here? Wondering if it's worth it to keep SQLite3 or just use Postgres everywhere
 
@Mahesha999 you can look at help(numpy.dtype) in python and get more info from the docstring
 
@AaronHall The reason I don't like to use the term "private" with respect to dunder methods is not because they aren't private: it's because they're more than merely private. Anyone can create a single-underscore private attribute, and the convention is that such things should not be accessed or modified directly outside the class in which they're defined.
However, dunder methods are special: normal coders must not define their own dunder methods, and if they do they may get clobbered if a later version of Python decides to implement a dunder method with that name. So dunder names are essentially reserved names, although they aren't (quite) in the same category of reserved words as the actual language keywords.
 
Ok, the page loaded. Apparently numpy.dtype.base just has no documentation at all, so I guess I'm wrong.
 
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  alignment
 |      The required alignment (bytes) of this data-type according to the compiler.
 |
 |      More information is available in the C-API section of the manual.
 |
 |  base
 |
 |  byteorder
 |      A character indicating the byte-order of this data-type object.
 |
 |      One of:
 ...
 
1:13 PM
@AndrasDeak do you know why it is that pydicom decided to implement a different vector order for dose matrix than what is already in the dicom standard?
 
@Peter sorry, but I don't even remotely understand your question:)
 
@Mahesha999 Ok, now I'm inclined to agree with you that it's a quirk of the autogenerated documentation. Wild guess: maybe dtype isn't a "formal" attribute in the sense that it lives in the object's __dict__. Maybe it's something that's dynamically created during setattr/getattr calls.
Sorry, by "dtype" in my previous message I mean "byteorder".
I've used numpy for an accumulated 30 minutes over the course of my lifetime so I'm only going by what I can see on these pages
 
you should use it, it will increase your performance
 
numpy will increase my network and string processing performance? Awesome!
 
in a non-adult-connotation way, probably
 
1:18 PM
heyooo
 
yo
 
@Kevin good u pointed out that.....now I have to check whats dict is. Seems that its somewhat complex stuff: stackoverflow.com/a/4877655/1317018
 
dict is simple
__dict__.__dict__ is not:P
 
ohhh yeah may be
 
well actually, the latter doesn't exist, that might qualify as simple too
 
1:32 PM
I barely remember what __dict__ is most of the time, so take solace that you can live a rich fulfilling life like me even if you never grasp the concept
 
I think it's a dictionary but I'm not entirely sure.
 
I just pretend that __slots__ doesn't exist, incidentally. Makes my life simpler, except when it doesn't.
 
@Kevin I ask you, how rich and fulfilling can it be without numpy?
 
It's not proper proselytizing unless you're handing out pamphlets on a street corner.
 
Something something tempted by a snake
 
1:36 PM
"let the light of numpy into your life", says the title. The illustration is of a matrix tastefully lit with crepuscular rays.
 
@PM2Ring weird then that we're not forbidden from defining them by the language
And cbg
 
@Kevin It is encrusted with superior quality diamonds. All craftsdwarfship is of the highest quality.
 
@RobertGrant I guess actually forbidding them would make it a little trickier to implement them, or at least it'd add extra bulk to the interpreter with little benefit. Similarly, nothing stops you shadowing names of built-in types and functions, or other names defined in the standard library.
 
I'm still hurt that I can't do True,False = False,True anymore
 
@tzaman Haha, we're on the same wavelength. After I wrote that message I thought "this sounds like a dwarf fortress item"
 
1:45 PM
man, I haven't played in ages. Should do another one sometime.
 
I never quite got out of the "learning all the buttons" stage of the game.
 
brb, printing pamphlets
 
yeah the UI is ridiculously bad
 
I got as far as the lava river, and then everyone died to a lava elemental, because I didn't know how to arrange a military.
 
Is that a dwarfy Dungeon Keeper?
 
1:47 PM
I haven't played Dungeon Keeper but I would guess they're similar.
 
micromanagement of minions and expanding your dungeon by mining stuff
 
Yep, DF's got that.
 
Oh that's easy, you just have to mine the ore then smelt it into metal then craft it into armor and weapons, then stockpile them in designated bins and also designate dwarves as part of your military, then assign them to squads and assign the squads equipment levels so they go and arm themselves, then station them where the lava is and then they'll still all die because you don't mess with lava elementals...
 
but I haven't really played much of DK, these farming kind of games were never my cuppa tea
 
Dungeon Keeper is WAY simpler than DF but it's a similar theme
 
1:49 PM
I would have done all that except every dwarf was threatening to mutiny because I hadn't figured out how to make beer yet. I think I was trying to set up a lava forge for just that purpose...?
Or maybe not. As previously indicated, I didn't know what I was doing.
 
:D yeah the part I skipped was "and do all of the above while making sure your dwarves are fed and clothed and have places to sleep and ..."
I seem to recall there was one particular mushroom or something that was easy to grow and you could turn it into both bread and beer, which is how I survived the year or two that I did
 
I did have a farm of some sort. I just fed the plants to them raw.
 
there's a simpler source of frustration along these lines, a flash game called multitask :P
 
but civ6 is out and by all accounts it's nowhere near as terrible at launch as 5 was
so I may end up dumping all my free time there instead
 

« first day (2203 days earlier)      last day (2745 days later) »