« first day (2440 days earlier)      last day (2507 days later) » 
00:00 - 16:0016:00 - 00:00

12:22 AM
well but of course
but I am not sure if you can inherit from non-type
exactly because I think they need to be PyTypes on the C side
 
1:01 AM
hello all
I'm just getting into python for machine learning, and i'm confused on syntax, anyone here have any experience with anaconda?
 
I don't think there is any syntax that is anaconda-specific, anaconda is more of a distribution package and package manager. Are the conda commands giving you trouble, or is your question about generic Python syntax?
 
1:16 AM
evening cbg
 
what's the story tonight
 
Just finished listening to this week's podcastinit
 
never gave this a listen
you recommend?
 
Interviewing a PyCon presenter who talked about using Python in factory automation, my first career lo these many years ago
I tripped over it in one of my periodic google searches for references to pyparsing - they had 2 speakers a week apart talking about their application based on pyparsing.
Now heading over to the PyCon talks to listen to the talk on automation, the demo sounds fun (the guy brought a bar code scanner, a conveyor belt, and a robot(?) and showed them working under control of some Python code he had written. The podcast was interesting to hear him talk about some of the automation challenges, many of which are not specific to Python at all.
The other talks were about Yelp!'s UnDebt project, and Coconut function syntax add-on to Python
The podcasts run for about an hour, so they get more in-depth with the interviewee than you would hear at a PyCon talk
But I could definitely relate to this particular interviewee (Jonas Neubert).
And his experiences with doing software in factories.
 
1:24 AM
cool. I'll probably try to give a couple of these a listen
 
The site also supports the speed-up audio option, so you can listen to a 60 minute podcast in 40 minutes or less
I usually listen to most YouTube Python presentations at 1.25 or 1.5X, much easier to allocate the time this way
Here is a link to a page I wrote eons ago, describing some factory automation in drilling circuit boards, using optimal drill path (Traveling Salesman drills a bunch of holes in epoxy laminate): ptmcg.com/geo/drill/index.html
 
 
4 hours later…
5:52 AM
cbg
 
6:03 AM
Cbg
 
7:17 AM
I've started reading LPTHW to find out why everyone dislikes it, and so far it's a lot like uni. It brings up important topics that you should know about, but it doesn't actually teach you anything... "You'll notice I didn't explain what these operators do. Try to find out!"
 
@Rawing Have you had a look at sopython.com/wiki/LPTHW_Complaints ?
 
I have, but I still want to read the book. Establish my own opinion. I'm not a parrot.
 
Squawk
Had a look once and did not get far before at least that version had really tried to change my mind on using Python 3.
So did not venture further.
 
7:35 AM
Yeah, the author really has a strong opinion about (but no strong arguments for) using python 2. "When all programs on your PC use python 3, that's when I'll consider learning it." That's the kind of mentality that keeps trash like Microsoft alive just because they're the top dog
 
@AnttiHaapala hey Antti. Do you like my first try with zope.component based db session? gist.github.com/khajvahmac/a1010bee0dc88d0fe9c992873cd48d6c
 
cbg
I am trying to run the following example: https://cloud.google.com/python/django/appengine
Can anybody help?
 
7:50 AM
Help with what?
 
I followed the steps. When I did python manage.py runserver, I got the following error:
django.db.utils.OperationalError: (1045, "Access denied for user 'gdtroot'@'localhost' (using password: YES)")
I specified a different password
Why is it using "YES"?
 
it says you have to provide a password
also are you running on google cloud?
 
It's been self-censored since because "lol you guys can't take joke"
 
@AndrasDeak I already read that, so now whenever he mentions python 3 in the book I just skim that section... no point reading that rubbish...
 
8:05 AM
cbg
 
Did you also see the original?
 
Don't think I have, no
 
It's a real treat
 
@khajvah No I am running on local machine
 
For instance, "python 3 is not Turing complete because python3 can't run python 2 code"
 
8:07 AM
did not sound like a joke the article ...
 
I got as far as "Python 3 Is Not Turing Complete". I don't think I can read further than that.
 
@AndrasDeak what? he changed it?
@MeetTaraviya check your settings
 
8:22 AM
What settings? I have set usernae and passwords accordinglu, and also connection instance name
 
@khajvah sure he did. Cognitive and economical dissonance with his py3 tutorial
@Rawing gestures like that are what make me content to reject LPTHW without further investigation
Then again I'm one of them python 3 apologists :P
 
Well, just because Zed's opinions are objectively wrong doesn't necessarily mean he's bad at teaching complete beginners, so I'm still gonna take a look at his book ;p
 
8:40 AM
@Rawing he is teaching Python 2 and even then, his book gets too much criticism. That means he is bad at teaching
 
@khajvah well, the ZCA is not that useful with static interfaces like in your case
@khajvah suggest you look into this: github.com/mmerickel/pyramid_services
but I have an even nicer pattern with tet.services but it is not that well documented
@khajvah the thing is, the adapters are what is useful - when for example you need to adapt x, which happens to be a Foo object into a Bar, and you don't actually need to know how to do it, but the ZCA will find you the best adapter.
 
@AnttiHaapala oh I think I have that use case. I have a class, UserDataAccess, which needs Session
am I getting this right?
 
@khajvah I'm not going to judge LPTHW based on other people's criticism. That would be shallow. If it's really as bad as people say then I want to hate it with sincerity and from the bottom of my heart, not because I'm parroting what I've been told.
 
@Rawing I thought you were a beginner which would limit your ability to judge. But yeah, go ahead. I think you will hate it.
 
@Rawing so go read it
 
8:51 AM
I will, I will. Don't rush me, I'm currently preoccupied.
7
 
9:09 AM
cabbageee
"file_path = os.path.abspath(os.getcwd())+ '\tain.db' " The '\t' part doesnt work ,
Anyone knows how to retain the "/t" in the file name? My DB is called 'test.db' doest seem to work..
 
hey! Can I use PyErr_Print to put the error string into a buffer (I need to pass it to a C++ stream)?
 
but it works if i use any other character
 
@Anarach '\\tain.db'
 
@BartekBanachewicz oh... thanks
 
@BartekBanachewicz check PyErr_Fetch
From doc:
void PyErr_Fetch(PyObject **ptype, PyObject **pvalue, PyObject **ptraceback)
Retrieve the error indicator into three variables whose addresses are passed. If the error indicator is not set, set all three variables to NULL. If it is set, it will be cleared and you own a reference to each object retrieved. The value and traceback object may be NULL even when the type object is not.
 
9:18 AM
@Rawing Dude , This is awesome!!!!
 
It gets pretty difficult ._.
 
I noticed LOL
but addictive!
 
I've reached the point where I'm just aimlessly rearranging the functions
 
Right!!
Which stage are you on?
 
3.2
 
9:33 AM
@Anarach ...
 
@Rawing I am in 1.4
 
Hi everyone
 
@MeetTaraviya yeah, but that doesn't help me to get it to string
 
is there anyone online who can master Pillow and Image decoders?
 
@Rawing um, why 2nd is map (reject (yellow))? This doesn't make sense, map should preserve the original count in my book.
 
9:40 AM
@BartekBanachewicz Yea, I agree the functions aren't named particularly well
 
The guy is german , probably lost in translation.. Or example of german way of complicating simple things..
I am not at a point where I cannot figure out how I solved some of them. Cant repeat it.
 
@BartekBanachewicz Try stackoverflow.com/questions/9896032/… on the objects received
 
I'm not convinced that 3.2 can be solved...
 
@Rawing Solved it in 1 minutes lol
Beginners luck I guess
Absolutely No idea how I did it
 
I solved it with a brute force approach... not proud of that one
 
9:52 AM
Ha ha.. 4.1 Is going to be pain..
 
@Rawing oh I see it now, a column is one element
it makes more sense then
 
hah! 4.1 is easy with the right approach
 
@Rawing Howw??
 
the first column has value 0, and you add 1 to it. the 2nd column has value 1, and you add 2 to it. the 3rd column has value 2 and you add 3 to it. etc...
simple math operations
got a bit lucky on the last two puzzles
this guy is taking micro-optimizations to a whole new level... his timing tests indicate he's wasting his time, so he questions the results
 
10:17 AM
Cabbage!
 
cbg
 
10:29 AM
And in the continuing saga of misunderstanding what JSON is, I give you this:
-1
Q: Modify default separators in json.dump in python 2.7.1

Samudranil RoyIn a json.dump method (python 2.7.1) the output has the default separator as (', ', ': '). I want to remove the comma and the colon, so that my outputs are simply separated by white space. I also want to remove the opening and closing braces. Is there any particular attribute of separator that al...

"I want to produce CSV data with the JSON module"...
 
any human-readable plain text format is JSON to these people :l
 
10:49 AM
recbg
 
I check out the C++ chat room and what do I see? People speaking a foreign language. I mean, that's pretty much what I expected, but I thought it'd be a foreign programming language.
 
11:04 AM
Fellow pythonitas! In the market for a new (coding) keyboard - any recommendations?
 
Just make sure that it does not have braces so that you don't have to code in other languages
 
@IntrepidBrit anything with mechanical switches, US layout and blank keycaps?
 
Please have a look at my question above if anybody has time
 
@MeetTaraviya Dedicated, I like it
@BartekBanachewicz Smells like a trap to me
 
get one with backlights - damn useful in coding at night
 
11:13 AM
Was looking at some of the crazy ergonomic ones, but not sure I could justify the hundreds of £$s
 
I have never owned/used one, but I've heard good things about Das Keyboard
 
Ladies and gentlemen, dear @Andras, I present to you, the hammer warning:
0
Q: Close hammer warning

pokePower users may have experienced this situation before: They see a question that’s clearly a duplicate, so they hunt down the duplicate target and close the question. It’s only then that they realize that the question was improperly tagged, so they cannot hammer it, although they expected it to w...

 
wow I love that cube composer
 
Ta Marcus, I'll check them out
 
Why are you optimizing for python 2.7? Python 2.7 is dead and Python 3.6 has countless optimizations that will render all of these results void. — Antti Haapala 9 secs ago
@Rawing ^
 
11:38 AM
Good job on that script @poke. Too bad I'm not part of the target audience (no gold badges :( ).
 
You will get there eventually ;)
 
Don't you usually search for a dupe before clicking "close" though?
 
@IntrepidBrit why?
@MeetTaraviya Why? When I code at night, I turn my lamp on. Also if you don't look at your keyboard while typing, you don't need it to be visible.
 
I'm so glad we don't have these variable = (function(){ /* 50 lines of code */ })(); constructs in python
 
11:51 AM
Hello there, has anyone worked with Python PDFKit and experienced issues with large HTML (near 5k lines) conversions? ("Cannot open file" in Adobe Reader)
 
Hello
I have just gained the ability to use the chat so I came to see what it was like and how useful it is.
 
@Rawing This isn’t about preventing you from searching for it. This is about preventing you from attempting to hammer when you can’t. So you realize before pressing the button (before wasting your close vote on a non-hammer), and get someone to add the tag you need first
 
@BartekBanachewicz I'm British. I don't want some stinky US keymapping ;)
 
Does anyone in here know about Tkinter?
 
E.g. I tried to hammer py3 questions so often before just to realize afterwards that the question didn’t have the py tag as well. If I realized that before, I could have asked anyone on here to add the tag and then hammer it myself. But instead, I wasted my hammer vote on a normal close vote and had to gather 4 more people to close vote it (or another one with a hammer)
 
11:57 AM
@Jake lmake sure to read the room rules
 
KK
 
@poke I see, I get it now. Thanks for explaining
 
Oh so should I just say what I wanted help with?
 
@poke installed
 
:))
 
12:02 PM
 
@Jake so what's wrong with that code?
 
So basically can you see the bit that says
self.update()
When you run the program it should put a clock at the top
It works
But
It doesn't update
But the bit the that does the update bit doesn't seem to work I think
 
well, of course. The update function has its own local timecall variable. That's the only thing it updates.
Add self.clock.config(text=timecall) and it'll do a countdown show the current time.
You need to actually update the user interface if you want it to change, y'know :)
 
Cool thanks man I will try that now
I cant do it now sorry I need to go I will try it when I get home tonight
Thanks Everyone
 
12:18 PM
I'm almost sure an OP was trolling me or being stubborn with a provided answer. They kept getting an error clearly indicating they were shadowing list, but kept claiming no.
 
12:29 PM
Does someone have a dupe target for stackoverflow.com/questions/44675918/…
 
@IljaEverilä you're the one who still lacks 10k, you should answer them
 
Yeah. Don't worry we won't judge you for doing that....publicly
 
12:51 PM
morning everyone
 
afternoon
 
I keep getting this error
Reverse for 'password_reset_done' not found. 'password_reset_done' is not a valid view function or pattern name.
i am trying to use the default view from
from django.contrib.auth.views
from django.conf.urls import url
from accounts import views
from django.contrib.auth.views import (login,
logout,
password_reset,
password_reset_done,
password_reset_confirm,
)


urlpatterns =[
url(r'^$', views.cover, name='cover'),
url(r'^home/$', views.home, name = 'home'),
url(r'^login/$', login, {'template_name':'accounts/login.html'}, name ="login"),
url(r'^logout/$', logout, {'template_name':'accounts/logout.html'}, name = "logout"), # views define a link to connecct this to views then to template
 
Wrong tab.
 
Got me tabs arranged wrong this morning, y'all usually command-3
 
@KevinMGranger Just the memes.
 
1:26 PM
hey any one at online.
 
1:41 PM
How / why do people have their phones switched off during scheduled interviews?!
</end_of_rant>
 
So it doesn't ring during their interview, I expect.
 
But why schedule it in the first place?
Plus, you can always say no and then ignore. Switched off is disrespectful IMO, if it's intentional.
@Rawing nice difficulty levels!
 
You mean like, you have a phone interview and you call in and the phone immediately jumps to voicemail?
 
@mkingsbu similar but not exact. India lacks the concept of voicemail for majority of it's phonebase.
And I am the interviewer here, it's next level of unprofessionalism if it's the other way round.
I think I missed the starting tag <start_rant>, so the ending tag didn't count :-p
 
oh lol Yeah, may as well not show up if you're the interviewee
 
1:58 PM
@AshishNitinPatil thanks, but it's not my game. I merely discovered it looking through old starred messages. This makes the 2nd time that game got starred in this room.
 
@Rawing oh, I easily misinterpreted that. Nice find though!
 
@Rawing - wow, "It's already compressed, don't show me how to compress and then decompress. I just need to know how to decompress."
 
clearly a homework assignment that'll be due soon... that's the 2nd zlib question today where the OP actually has a hex dump of compressed data
 
Was just about to say, I suspect that the posted "text" is not really the actual compressed data.
 
2:11 PM
Makes this relevant again eh?
yesterday, by Rawing
With each passing day questions on SO sound more like "help, I can't ****ing google" to me
 
2.5 months of WebFaction left, should probably start migrating everything to Linode.
 
that's always relevant.
 
But that is so closely related to this -
yesterday, by Rawing
google indexes SO in real time, and SO manually indexes google through volunteer labour
haha
Btw, that interviewee did finally pick up the phone after I redialled 22 minutes after scheduled time. So, from hindsight, casual carelessness from him :/
And from some experience (~80-90 telephonic interviews), it usually is the case (casual carelessness).
 
2:26 PM
If I've ever missed a phone interview call it's always been due to either suddenly busy (e.g. poopy baby diaper) or in one case my phone literally did not ring. I was expecting the call, but it didn't ring at all - though I checked my phone and called back in 5 minutes
 
@WayneWerner I would definitely judge married people (specially with kids) differently :)
 
I haven't missed a phone interview call yet because I fret about it for the four hours leading up to the event
 
ah, classic
 
there is that
 
2:44 PM
I'm irritated that sopython.com/canon/13/flattening-a-nested-sequence doesn't have a good target for flattening arbitrarily deeply nested lists.
The first three links only work on lists of depth 2, and the last link is "here is an algorithm that flattens lists. Explain to me how it works" which is not a perfect dupe target for questions like "How can I write an algorithm that flattens lists?"
 
the best test ever...
def test_authenticate(self):
    pass
@Kevin that's why you always schedule them as early as possible :)
@AshishNitinPatil I really miss the minimal effort required close reason for questions like that one
 
Ah, the old days when "needs more effort" was a valid close reason. We were as gods, then.
 
turns out the other question about decompressing zlib data was from the same guy
and he had another one before that
 
@Dware I find that hard to believe - google.com/… - the first result is nearly exactly the same answer that anatol posted... — enderland 1 min ago
 
3:00 PM
something very funny I just caught that I didn't realize about globals
I always thought using the global statement indicated you need to have already declared that variable in your global scope
I didn't realize that using global foo and then foo = 3 for example inside a function, after executing the function, you are also declaring that foo in the global scope.
in short....i didn't realize that global could be used for declaring!
 
global statements are also interesting in that they behave the same no matter where in the scope you put them.
 
those fundamentals that you forget or never caught on to
 
x = 23
def f():
    x = 42
    global x
f()
print(x)
#result: 42
Well, ok, I tell a half-truth. It also emits a SyntaxWarning telling you that you shouldn't be doing this.
 
global comes with a SyntaxWarning now? Neat! ;)
 
Sadly it only appears if you display a lack of judgment well above and beyond the baseline lack of judgment that makes using globals at all seem like a good idea
 
3:08 PM
Yeah this is all pointing to just staying away from global all together
 
hey guys, i have a txt file with the numbers: 2846. When i want to grab those numbers from this file:
with open('pin.txt') as f:
pin = [int(x) for x in next(f).split()
it places [] next to the ints like this: [2846] does anyone know how to remove those bracets
 
How bout pin = pin[0]
[2846] is a list containing one element. If you want just that one element, you can easily extract with with ordinary indexing
 
ffs. its so frustrating how the fix is so easy
thanks tho
 
You could also just not make a list in the first place.
with open('pin.txt') as f:
    pin = int(f.read())
Assuming the file contains "2846" and nothing else
 
well thanks for that that makes it more easy
 
3:24 PM
ffs....don't know what final fantasy has to do with this...but OK.
 
3:35 PM
An RPG is really just a very fancy visualization of a spreadsheet.
 
wim
^ emacs ftw !!
 
I'm trying to finally end this discussion on deprecating Flask request.json github.com/pallets/flask/issues/1421#issuecomment-310117304
I still can't figure out why it was deprecated in the first place.
 
wim
TL;DR - what's wrong with request.json ?!
 
The only real issue brought up was that relatively small JSON payloads can cause recursion or memory errors, but that's a problem with get_json too.
For example, json.loads('[' * 800 + ']' * 800) causes a RecursionError.
@FluffyMe please read our room rules, use a paste service for large blocks of code
 
paste service?
 
wim
3:42 PM
so the property (presuming it's a property) can except that if it wants and do whatever ..
 
how can i do it then? @davidism
 
Yeah, if that's a concern the developer would need to override get_json and use ijson to iteratively parse the data.
@FluffyMe dpaste.com, which is linked in the rules I asked you to read
 
well then, this is my code: dpaste.com/0R61MJD at the bottum you can see that there are getpin() funtions trying to be triggered but the first getpin (the one above the while tag does work) but the second one in the while tag doesnt
 
@FluffyMe did you type the URL?
 
please explain what you mean by it doesn't work.
what indicates to you that it does not work. Are you getting an unexpected output? are you getting an error?
please provide a mcve
 
3:50 PM
pretty sure you have an infinite loop in counter
 
@idjaw too bad that syntax does not work :-(
 
def counter():
    count = 60
    while count != 0:
        count = count - 1
        # some code
        if count == 0:
            count = 60
 
@Code-Apprentice yeah...I know....I decided to try it out thinking that maybe I would be surprised...but no
 
no thats not the problem, at the buttom you see this at the bottum: getpin()
counter()

while True:
    counter()
    getpin()
    time.sleep(60) This is trying to loop the getpin function to place the new random numbers in the txt file. but it will put them in at the first getPin() but the one in the while loop doesn't work
it just doesnt do anything
 
It's spelled "bottom".
You keep opening the file for writing, open it for appending ('a').
 
3:54 PM
Because counter never exits, because it's an infinite loop.
 
you need to have a condition to break your loop too
don't just open an infinite loop and then wonder why things are not happening.
and yes, as mentioned, make sure you understand the different file modes. If you are writing to the file more than once, you want append (a) mode.
 
I recommend revisiting this code after a quick little nap :)
 
@Enderland, I visited that link, I did not understand it. Thanks for your contribution. — Dware 3 mins ago
(╯°□°)╯︵ ┻━┻
 
@enderland At least he's being nice. Could be worse.
 
00:00 - 16:0016:00 - 00:00

« first day (2440 days earlier)      last day (2507 days later) »