« first day (2322 days earlier)      last day (2625 days later) » 

3:03 PM
I should learn to use virtual environments. [newspaper_cat.png]
 
I've never really run into the whole dependency issue
 
I'm more of a "invent your own wheel" guy, so it doesn't cause much trouble for me
Can't have a conflict between multiple installed versions of a library if you never install any libraries. [guy tapping his head to indicate a cunning plan dot png]
 
likewise (at my own peril, perhaps)
If I can replace an entire library / dependency with a few functions that accomplish what I need, I'll just do that instead
 
3:17 PM
Same here. I've only installed a handful of fairly mainstream packages, like Pillow, Numpy, requests and mpmath.
 
well, you 2 are biased.
or 3.
the dependency hell is very much a thing.
that it didn't matter to you probably suggests that you haven't done anything significantly complicated.
 
Agreed
My most esoteric package is probably geographiclib
 
every week I have a situation wherein I can choose between writing a library for 1 months or installing an existing one and writing code for it for 1 hour.
 
I'll cop to that. The vast majority of my projects clock in at under a thousand lines of code. If I ever write a centa-kilo-line monster, I'll be happy to put it in a sequestered environment all to itself.
 
yep, sounds about right
 
3:23 PM
and the author of that library that I installed also had to make the same decision which is why exactly this dependency hell happens.
what one needs to understand about python is that how bad python is at handling dependency conflicts.
 
@AnttiHaapala That's a consequence of python striving for "flat" instead of "nested" I think?
 
there are things like OSGi in Java and the node_modules sh*t in NodeJS that allow for every package to see its desired version of each module.
but python just installs everything in global sys.modules.
 
Sigh, yet another if-else in a for loop antipattern post. I'm getting increasingly tempted to write a canonical post for these so I can go on a hammering spree.
 
even if you do some hacks around it, someone is going to assume that sys.modules is a thing.
@Kevin for-case paradigm
ah no not even :D:
 
vast majority of my python use is for basic web stuff (selenium, mechanize, requests, beautifulsoup), number theory stuff (mpmath, numpy, scipy, sympy, etc), visualizations and simulations (matplotlib, PIL, etc) -- but despite all this I've never run into dependency hell
 
3:26 PM
@Kevin you mean you should use any or all?
 
@MarcusS that is simple.
 
@paul23 any and all would definitely appear prominently in my answer, yes.
 
I don't run into a dependency hell every month even (but I am using separate virtualenvs for each project), but it has happened.
 
I wouldn't venture as far as saying they're always the appropriate solution, but certainly they're fitting for the general case.
 
@Kevin how about range(len()) idiocy
 
3:28 PM
And I guess using virtual envs doesn't completely eliminate dependency hell, since you may want to use conflicting packages in the one project. But at least it lets you install multiple conflicting packages on the one system.
 
90 % of the range(len(shit)) should be for i in shit, and 9 % should use enumerate. And 1 % is some kind of array chunking code.
 
If you've got some monstrous conditional with side effects or something, it may be more maintainable to keep it as a loop and use a flag.
@AnttiHaapala Agreed.
 
To be fair: I think one should start "off" by looping manually if you are learning how to program. Since it better shows the inherent complexity of certain parts of code. any and the likes can hide this.
And considering python is many people's first step into programming it's hard to give a "one size fits all" answer there.
 
My hypothetical canonical answer would probably show how to do it "manually" with loops and flags, and then segue into "... But you can just use any"
solutions with any tend to include generator expressions, which many newbies regard as plain old magic.
Better to start them off with something language-agnostic.
 
and again, the question is about a regular language
so it could as well be answered wit ha regular expression :P
(even if this has a \1 backreference, it is still regular... :P)
 
3:31 PM
Yeah, I'm actually really "happy" I started off with c++ (before c++11) for those. As c++ learned me "why I really want generator expressions".
 
You don't even need backreferences if you detect double letters with if re.match("aa|bb|cc|dd|ee...") :-P
 
I think it's good to teach any() and all() early on -- they come up a lot and help prevent awkward code
 
@AnttiHaapala To be frank with numpy I can enumerate over any n-dimensional the array. But numpy's iterator interface is.... Kind of awkard to use, having to look up a lot of functions on "how to write the correct enumerator".
 
Not a fan of that recent edit to the answer though
 
I tend to use for loops when iterating numpy just to keep it simple.
 
3:34 PM
@paul23 wat?
iterating over numpy array is... you're doing it wr0ng
 
I posted my issue on the main stack overflow and it got downvoted I don't know what I did wrong.
Maybe I am like the soldier in the picture above me
 
@Tokencodingnewbie now you got another
 
When you argue that you should use enumerate instead of for i in range(len(x)) - I have many cases where i had to do this.
 
@paul23 I edited it :P
@Tokencodingnewbie specifically: did you ever read the "how to ask" and "what questions are appropriate"
 
@AnttiHaapala Is there a reason or are you just trolling me? I took a lot of thought and effort into trying to make a good post.
 
3:37 PM
@Tokencodingnewbie pastebin links are absolutely not ok.
 
Well I just did what I thought would be easier for the reader.
 
This is the question as I read it:
I have been working through code academy and I'm on the chapter of lists. At the end I have to make a battleship program. There is an extra credit assignment at the end that I knew I had to force myself to do as you only learn programming by practice. I have been working off and on it for about a week and I've come to about some wits end on it. I simply cannot get the ships represented properly on the gameboard (which is really just a bunch of nested lists)

I was told to write out exactly what I'm trying to achieve to do this and I did so below:
 
@Tokencodingnewbie I think the primary issue is where you wrote "I do not just want to receive an answer with code and barely any explenation. I want to be taught." Now, that's certainly an admirable attitude and I congratulate you for not just wanting to be handed ready-made code. But this puts an additional burden on answerers because there's no single objective answer that they can be certain will elicit a positive response.
 
I wasn't sure how to word that. I am not very good with words.
 
@Tokencodingnewbie I ask you, do you really consider that I am trolling, since:
see How to Ask. Don't post code as external links. — Jean-François Fabre 3 hours ago
3 hours ago you got exactly this comment...
I didn't even read that comment before I told you what's wrong with your post
 
3:39 PM
I did not know it's been years since I've posted to the main stack overflow
 
Also, that answer is awful. "I like coding, here's a code dump."
 
Stack Overflow excels at providing concrete answers to concrete questions, and tends to flounder when one ventures into more "teach me to <thing>" territory
 
and the questions are self-contained.
 
That last implementation of his is also really slow
 
one who is an expert of all things, must be able to answer the question without opening any single link.
the linking pretty much only exists for "here's a link to wikipedia detailing this concept / this is where these excerpts comes from" etc.
 
Ana
3:42 PM
sorry to get in the conversation i just wanted to ask...when i have a selectable list in python can i make it click each option every x seconds with threading?
 
Sure, you can do anything with programming.
 
Everybody learns differently and any prospective answerers don't know enough about you to be sure what kind of approach would be effective. I'm reminded of my own attempts earlier this month to explain De Morgan's Laws using an ASCII chart, which I thought would be a slam dunk, but some people needed a little more coaxing after that.
 
(Except build an orbital tea cannon, that requires some hardware as well.)
 
what if you simulate it?
 
@davidism I've yet been unsuccesful to program me a girlfiriend
 
3:44 PM
But I guess then it wouldn't be a very functional tea cannon
just a PoC tea cannon
so, yes....hardware required for real world tea cannon fun
...I should build a tea cannon
wait...is this a canon that shoots tea, or tea bags?
 
@Kevin De morgan's laws are most easy "understood" by just writing out the full truth tables?
 
@idjaw you'd have to as @JonClements, I think he made the original proposal.
 
good to know.
 
Nope, it was Kevin.
Sep 18 '13 at 13:25, by Kevin
Deploying Low Orbit Tea Cannon. Approaching geosynchronous lock.
 
oh. This is going to lead to great improvements in tea technology
 
3:46 PM
I want to see this ASCII chart
 
@Tokencodingnewbie also that pastebin sucks because it doesn't do syntax highlighting
 
Is it appropriate to delete it and rewrite it?
I'll add more of a question to the end and get rid of pastebin
 
You can do whatever you want with your question. You should probably review the help center first though, I doubt any form of that question will be on topic.
It's way too broad as it stands. Demonstrate a specific problem with an MCVE and single question.
 
cbj
need some help
 
To be fair, @Tokencodingnewbie was advised in this room to post a question on the main site. But we assumed that the question would conform to SO standards, like posting a mcve. I guess in this situation it would be OK to link to pastebin for the whole program, since it's rather large, and only include a mcve that focuses on a single problem in the question itself.
 
3:50 PM
@SohaibAsif Please revise the rules -> sopython.com/chatroom and just ask your question. If it is on-topic, interesting, or easily answerable, it might be given attention.
 
Alright, I'll try better. I just wanted to make my point that I want to learn and not be just thrown some code with a vague explanation. Maybe it was too much to ask? But I will redo it and repost it later.
 
pastebin.com/kgPRe7fH i am getting "is not JSON serializable"
 
OTOH, he was also told that there's a lot of repetition in that code, and it'd be a lot smaller and easier to read and debug if that repetition was eliminated in accordance with DRY principles.
 
That's just the data. Where is your code? What did you try to do @SohaibAsif
 
@SohaibAsif I can't reproduce your issue. json.dumps(your_data) works as expected.
I'm starting to smell a lot of garlic.
I think it's because I was cooking with garlic last night.
 
3:54 PM
what you make?
 
that's a lot of code. What part of that is giving the exact problem you are facing
 
You know, before people run that code help them by stating which line throws.
 
response=json.dumps(roi.values(), ensure_ascii=False) em getting error on this
 
Also, you almost certainly want to ensure ASCII when dumping JSON for the web.
 
3:59 PM
@paul23 That's how I most easily understand it, but different strokes for different folks.
 
Also, what does .values() return? Have you done any debugging?
 
i wrote .values to get all the values of the json
i debugged it now try to run on tornado server
my POST code is working fine
json is going to database
 
@SohaibAsif unfortunately, you're not describing your problem well. This is not the first time you've had issues with this. Please review stackoverflow.com/help/how-to-ask, stackoverflow.com/help/mcve, and skidmore.edu/~pdwyer/e/eoc/help_vampire.htm before continuing.
 
but i guess em getting error on GET method
 
"I'm cooking garlic tonight" is the ultimate death threat from davidism
brief mobile cbg
 
4:02 PM
@paul23 Yeah, but you have a bit of a track record of writing slightly odd code. ;) Your recent post about using Python loops on Numpy arrays is a case in point.
 
@AndrasDeak tried to Goolge Image Search "cabbage with legs" for an appropriate mobile cabbage, results were not what I expected.
 
sounds like creepypasta material
Today's hit of the day in someone else's code: [i for i in range(0,nmax)]. I python 2 even :|
 
Is putting cabbage on skin, like, an actual thing? Because there are a surprising number of pictures of that.
 
DSM
Morning cabbage for all.
 
@AndrasDeak Buffy davidism the vampire slayer. If the garlic doesn't get 'em, the roundhouse kicks will.
 
4:05 PM
@DSM cbg
 
DSM
Just tracked down a mysterious problem with someone's code to someone else's bug in that their database doesn't seem to accept strings with two periods together for some reason in one particular column. (?)
 
@davidism salad linguist groupies
 
@davidism, I caught the first episode of Chaika last night. Looks pretty interesting. I appreciate that they aren't afraid to present the viewer with an exotic setting without immediately explaining everything.
 
@DSM weird hidden regex?
 
DSM
Dunno, we're reporting upstream.
 
4:07 PM
Or parsing as a file path? :D
 
I shouldn't have started watching half an hour before bed. I had to go to sleep while ruminating over the end-of-episode cliffhanger.
 
Should've pooped first
 
DSM
...
 
<link to earlier discussion>
 
That's just good general life advice. Don't want to go on a long road trip with a full tank.
 
4:09 PM
:D
 
@davidism google cabbage lactation... or maybe not.
 
I'm at home
I can take this for the team
one minute
 
^
 
Thank you everyone for the help on my post. I know ignorance isn't an excuse so I'm sorry.
 
:D good guy idjaw lactating all the cabbages
 
4:11 PM
I appreciate everyone of you that comes in here to help people like me
 
preview of results
> Cabbage Leaves for Treatment and Prevention of Breast Engorgement
 
wonder if eduroam cares about nsfw content
 
w.r.t. breast feeding
 
I learn about things in the most bizarre ways.
 
Proxy voyeurism by idjaw
 
4:13 PM
"How do you know that?" "Oh, one time someone on a chat room talked about mobile cabbage."
 
I have great faith in you, @Tokencodingnewbie. Despite current difficulties, I sense that you have a conscientiousness that will keep you properly oriented during your journey of learning.
 
Kevin-sama speaks my thoughts
 
So, let it be known for today, if there are questionable NSFW items you need results on, let me know.
 
From last night: i.imgur.com/AvO1kdk.jpg
 
4:16 PM
the trolling potential, it is over 9000
 
Apple laptops = good heaters?
 
DSM
That reminds me. We need more pictures of cute animals in this room.
 
Awww, they're adorable, @Marcus :)
 
Heat is just one important quality of a resting space for cats. Lying on a laptop also has a high human annoyance quotient, which is equally vital.
 
 
4:17 PM
The kitty fan AI will be pleased
 
basket of kittens
 
bah
 
and DSM, if you are ever in need of cute cat goodness, there is always http.cat
 
what did I just came back too.... on one hand kitties, on another lactation cabbage? What ... don't know if I want to stay for this...
 
@Kevin that must be why cold decoy keyboards work
 
4:18 PM
LOL
 
haha
 
rhubarb
 
I'm so glad I took the time to do the major refactoring needed to be done for one of the apps I'm working on
Things are running so much smoother, and the tests introduced fixed so many uncaught bugs <- duh
 
hehe
 
4:30 PM
http.cat/303 It's not dead!
 
should be http.dog
disappointed it wasn't that
 
yeah, I thought it would be .dog too, but it apparently wasn’t :(
 
Reading error 418 I wonder how long till we actually can expect that..
With internet of things I expect really soon.
 
4:41 PM
Some nerd probably implemented a server that returns that code, fifteen minutes after the RFC describing it was first published.
 
Even TCP/IP by carrier pigeon has been deployed in real-world conditions, albeit more for the novelty than practical purposes.
 
@Kevin Wouldn’t that make it “TCP/carrier pigeon”?
Or is it actually using the IP protocol over carrier pigeons?
 
TCP/pigeon protocol me thinks
 
I think the specification describes it as actually using IP, but the implementation I remember seeing on Youtube just used them to courier flash drives full of files.
In computer networking, IP over Avian Carriers (IPoAC) is a humorously intended proposal to carry Internet Protocol (IP) traffic by birds such as homing pigeons. IP over Avian Carriers was initially described in RFC 1149, a Request for Comments (RFC) issued by the Internet Engineering Task Force (IETF) written by D. Waitzman and released on April 1, 1990. It is one of several April Fools' Day RFCs. Waitzman described an improvement of his protocol in RFC 2549, IP over Avian Carriers with Quality of Service (1 April 1999). Later, in RFC 6214 released on 1 April 2011, and 13 years after the i...
> Rafting photographers already use pigeons as a sneakernet to transport digital photos on flash media from the camera to the tour operator.[7] Over a 30-mile distance, a single pigeon may be able to carry tens of gigabytes of data in around an hour, which on an average bandwidth basis compares very favorably to current ADSL standards, even when accounting for lost drives.[8]
^This is the implementation I was thinking of.
But I see that there has also been a demonstration of actual use of IP, despite the ridiculous inefficiency
 
4:49 PM
@Kevin That’s pretty amazing
 
That packet loss example though.
 
5:06 PM
My avatar is broken at 32px!!!!!! Q_Q
 
^^ je suis the confused? What you talking about pokester?
 
Yeah it's loading fine for me.
 
DSM
5:24 PM
My colleague changed the input data and now I can't reproduce my failing case from before. ;-(
 
Icon is not loading here stackoverflow.com/posts/42421852/revisions (10k only)
 
do you still have the data that reproduced the error? @DSM
 
DSM
@idjaw: no, it wasn't saved or logged, and so I can't prove it even happened now.
 
ugh =/
 
DSM
@poke: I don't see what the problem is. You look perfectly dark-outer-square,lighter-inner-square to me..
 
5:27 PM
lol
 
cbg
 
^ So a local problem only?
 
I see an avatar with a picture of a human face on it.
Presumably your human face.
 
hmm, okay, that’s good
 
Do anyone know how can I use pynotify?
i tried pip install pynotify
 
5:29 PM
hmmm
@Freddy and?
 
I can even import pynotify
 
wtf indeed
 
but when I try pynotify.init("Test")
it shows error
 
DSM
So poke and I see a square but user2357112 sees a face. That's strange, whether interpreted as a dev quirk or a Rorschach test.
 
5:31 PM
@Freddy I am using package called inotify
@Freddy also, it only works on linux, and only >= 2.6.13
 
I also see a face, to round out this anecdata
 
thanks Kevin
I was hoping for your input to resolve this issue.
 
I see a face for you @poke
but mine is a gravatar
but only the small chat icon
 
@Antti Your sizes 16, 24, 32, 64, and 128 work fine for me
Guess we can account this to a general gravatar issue then
 
Yup gravatar is acting up randomly recently.
 
5:33 PM
16 doesn't work for me
 
 
6
Q: Some users' chat icons are sometimes displaying as default gravatar depending on size

Byte CommanderIn Ask Ubuntu chat, there are some users (e.g. cl-netbox and Thomas Ward) of which the user icon is recently displaying wrongly most of the time: cl-netbox' icon on all sites id a blue square with the white letters cl. It shows up this way in the user list on the right and even in the popup ...

 
@poke see my link, s/16/32/ and...
 
@AnttiHaapala will it work on Unix?
 
So your 16 doesn’t work for you, and my 32 doesn’t work for me. What a crazy world.
 
5:34 PM
@Freddy it works on Linux, and 2.6.13+, nowhere else.
 
Yeah, random users' icons of random size don't work. There seems to be no system behind it.
 
does this work for you?
 
nope
 
I can see your face there ...
:D
 
I also had different missing icons on different machines.
 
5:35 PM
so
some idiot broke the production and now they're all in the cache
@poke just add &foo at the end :P
 
We should make SO do that for all usages :P
 
@poke it might be just in your local cache
a sec
 
is there any library which works on win, linux and unix?
 
ah no it isn't
@Freddy for which exactly?
 
Chrome, Firefox, IE… :P
 
5:37 PM
@Freddy what are you planning to use inotify for?
 
^ Oh, the Irony…
 
ah sorry :d
@Freddy I seem to be confused :d
@Freddy ignore everything I've said over the last half an hour
 
@Freddy what do you mean?
can you be more specific?
 
@AnttiHaapala to notify about temperature of current location
 
@AnttiHaapala Well, you did lose your 16, so that’s to be expected!
 
5:39 PM
@poke yeah I just wget, and I got the same
so it is in their cdn :D
 
currently I am using `os.system("""
osascript -e 'display notification "{}" with title "{}"'
""".format(location, temprature))`
 
Yup.
Aaaanyway, I’m going home. Rhubarb :)
 
it works on mac but i don't think it will work on win
 
did you try it?
the osascript command probably not. Which has nothing to do with Python.
Doesn't osascript run AppleScript stuff?
I barely know anything about it
 
C:\Users\Kevin>osascript
'osascript' is not recognized as an internal or external command,
operable program or batch file.
I'm on Windows and it doesn't work for me.
 
5:41 PM
Thank you resident Window-Kevin
 
@idjaw yes my friend did and he told me it does not work
@idjaw yes
 
my job here is done -- wait, I just used that joke.
 
It's cool. Still relevant
@Freddy Your problem is not about Python. You are trying to execute that osascript command on Windows
 
DSM
Aww, the office slack cleaned up my Zalgo text. :-(
This day is full of :-(.. ;-(
 
@idjaw I know that...that's why I am asking is there a way by which I can make it work on any OS
 
5:43 PM
@DSM Dont worry, 2 more days till we can witness us beating the Habs.... :D
 
any magical python library
 
I'm guessing probably not
 
@Freddy You are trying to display system information? Did you try looking up these key words in google to see if there is anything you can use?
 
DSM
@MooingRawr: even balcony seats would be ~$200 against the Habs, so I think I'll watch us lose elsewhere.. :-/
 
Other than the obvious solution of "find a way to display notifications on Windows, and choose between that way and the one you already have, based on the system information available to you via the sys module"
 
5:46 PM
^^ that too
 
@DSM I hope we don't get swept this season :(. Please no, then it will truly be :-( time.
 
Then you can take that code and make your own library, and enrich the Python community by doing so :'^)
 
@idjaw I am not sure what you meant by "system information"
I saw people using pynotify but it is not working for me...so I guess it is only for linux
 
Then I have absolutely no idea what it is you are trying to do
I thought you were trying to get system information, e.g. temperature
So, please be specific as to what it is you are trying to do
 
I thought he was trying to display the temperature of the outside world, in a little window/text balloon/widget/whatever on the desktop.
 
wim
5:49 PM
 
@idjaw I made web crawler which gets temperature of your current location from google
now i want to display that in form of notification
@Kevin yes
 
@wim Shared it here earlier this morning. Interesting read.
 
I don't think pynotify is for creating notifications that pop up in your task bar or whatever. I think it's for "implementing Observer programming pattern. These tools include signals, conditions and variables", according to its webpage.
 
@Freddy Did you look this up at all? Like: google.ca/…
I'm tapping out
rbrb for now
 
The ambiguity here is in the double meaning of "notification", which can mean either an OS-level action that makes a text balloon appear, or a programming design pattern used to ferry information from one part of your project to another. The two have nothing to do with one another.
 
5:52 PM
Yeah. I'm done.
I dug too much and even searched.
 
So, you're correct that pynotify is not suitable for your needs
 
@idjaw I already have temperature...i need a way t display it
 
@Freddy how do you want to display it?
 
@WayneWerner in form of desktop notification
 
As a notification, presumably... Although this isn't super user-friendly design. IIRC the Windows design standard suggests that notifications only be used for "actionable" events, such as "click here to install important updates".
You don't want a situation that goes like:
User: <happily working along>
OS: Notification: it is 72 degrees outside.
User <irritated at the interruption>: ... Yes, and? What do you want me to do about it?
 
5:58 PM
So I don't think there is way I can do it in general for any OS
 
Indeed, I'm not sure how a temperature notification would work in practice. Do you send a notification every time the temperature changes? Do you send one every minute on the minute? Any way you do it seems hugely distracting
 
Or maybe what you're actually asking for is some kind of desktop widget that sits in a static place on your screen, continuously updating itself, rather than a text balloon that appears and gradually vanishes over the course of several seconds
 
it shows up every 5 mins
 
wow, that would be like, utterly annoying
 
5:59 PM
Yeah, I would not install software like that
 
@paul23 that's not a point
 
Such thing should be shown in a task/menu bar and update "constantly".
 

« first day (2322 days earlier)      last day (2625 days later) »