« first day (1764 days earlier)      last day (3407 days later) » 

00:05
@AaronHall You mean my co-worker, or Cyphase's questioner? I get so confused...
your coworker!
Wes McKinney is really close to getting his gold Python badge. stackoverflow.com/users/776560/wes-mckinney?tab=topactivity
Hmmm... I thought Pandas was all Python... Shows how much I know.
And some C too.
00:32
He's already got the gold Pandas badge, 20 'pandas'-tagged questions ago.
Yep. I don't know how they're not tagged Python too. Here's a project for you: go find them and tag them properly (assuming it's apropos) so we can get Wes his gold badge.
@AaronHall The incident that prompted my conversation with the company owner was like this: At that point, they had a couple of junior programmers working for this guy. One of them was really good and was already using my stuff and working with it. But the guy decided we needed a "technology transfer" meeting where I described everything to them. All well and good...
I prepared for the meeting, and had a bunch of stuff ready that showed off the actual code that the product was based off of and that had been working well for 3 years. FWIW, this was a DOS-based TSR that could wire itself into high memory and have a minimal or non-existent low memory footprint. It created a DOS device driver, and played audio, and controlled laserdisc players, etc. The bulk of it was in Modula-2.
When I got there, the guy went into full-blown professor mode and lectured about how TSRs worked and demoed a toy TSR that he had written that didn't actually TSR. I never got to transfer any technology in that meeting, but that's OK, because the next day they had an expert on staff anyway.
Hey, look at the requirements for one of the later versions of that stuff...
01:10
@AaronHall re-tagging bumps - be wary
and I doubt that he's seriously interested in having shiny gold things rather than helping out
01:28
TSR, man it's been a while since I've read that acronym.
And maybe longer since I've written it...
01:51
Hey guys, I'm trying to put together a GUI using matplotlib, and the user response time is a very noticeable 260ms due to the plt.show() function. Any ideas to optimize the GUI for speed? Or how can I manually refresh different artists without running into the CGContextRef is NULL error as discussed here github.com/matplotlib/matplotlib/issues/166
 
1 hour later…
03:13
I should have one of those dog avatars, I guess, because I just made a big mess on the carpet. I made an answer to this by copying and updating the questioner's code in his own first answer. But in retrospect, that's an exact dupe of this. Should I rework and move my answer or what?
Hey, Martijn, whaddaya think ^
 
3 hours later…
06:42
cbg
@PatrickMaupin just close as dupe...
@PatrickMaupin also you're probably not self-depreciating enough
07:12
Hey up all
08:04
Not as many Python questions today it seems
It's 8am (UTC) on a Saturday morning :P
Ah, true. Not a lot of people asking questions about work projects.
Because of saturday.. Regex tag also have this problem on saturday and sunday..
 
3 hours later…
11:01
You mean the comment by Jens?
 
1 hour later…
12:28
@AnttiHaapala No, I'm not deprecating enough :) Give me 6 months and $6 million and I'll do anything.
But nobody did that for pdfrw doc :(
Cabbage
stackoverflow.com/q/32024460/4014959 damn wild goose chase... :)
[[cv-pls]] stackoverflow.com/questions/31712386/… Also, I'm biased, but if you guys agree that either that or the dupe target would benefit from a [[pdfrw]] tag, that would be awesome as well. Thnx.
@AnttiHaapala Dang. 3 days and I already forgot how to make a tag. You're right, Antti -- I suck.
FWIW, you need to do [tag:cv-pls]
[tag:this-is-my-tag-there-are-many-like-it-but-this-is-mine]
12:39
@PatrickMaupin I'm not familiar with ReportLab, or even matplotlib. But I guess I can trust your judgement. :)
@PM2Ring Actually, if you have matplotlib and PIL installed, and just install pdfrw (which is python only), you don't need to trust my judgment. That one example is a runnable program that embeds a PNG using native reportlab stuff, and embeds a PDF using pdfrw. One of those images looks great and the other doesn't...
I should mark it 2.7, though. Didn't check/modify it for 3.x -- hmmm, maybe that's a good thing to do today.
@PatrickMaupin I dunno about adding to either of those questions, since the OPs didn't specifically ask about PDF stuff.
That's why I didn't make the request directly. But the top-rated (by far) answer in the dupe target uses it, so it's a judgement call, and I'm both too new and too biased to make that one.
Although I've never used matplotlib, you don't have to convince me of the superiority of vector-based drawing for stuff like that. :)
Actually, the entire genesis of pdfrw was that there weren't any good vector-based solutions for rst2pdf (there were some svg-to-reportlab ones, but they were woefully incomplete), so I wrote one that would accept preexisting PDFs. It just happens to also be usable as a standalone library.
12:48
@PatrickMaupin Tags are about the question, not the answers. Sure a PDFRW-based answer may be the very best way to tackle those questions, but that's a property of the answers, not of the questions themselves. But I Am Not A Tag Lawyer. :)
@PM2Ring This says that tags could be about answers in some specific cases, especially if there is an accepted answer. Unfortunately, there is no accepted answer in this case, even if there is one with 16 up-votes (which, considering the fairly esoteric field, seems pretty high).
Thinking about it more, though, I don't think the tag would be a good idea, because pdfrw really isn't part of either question.
Yeah. I'd be more inclined to add it if the OP was already using PDFRW but having problems making it work, so they need someone with PDFRW expertise to guide them. OTOH, not know you need PDFRW is a PDFRW problem. Sort of. :)
FWIW, If I put ReportLab matplotlib pdf into Google the top search result is stackoverflow.com/questions/4690585/… so it probably doesn't need the tag anyway. :)
I guess I should look into PDFRW myself. I usually do vector stuff using PostScript & then use GhostScript to generate a PDF for ease of printing on other systems, but generating PDF directly would be kinda nice.
13:10
pdfrw won't actually generate vectors for you -- it just keeps them from getting lost...
So, for example, you could save a PDF out of inkscape, and incorporate it into another PDF.
Whereas most other solutions either rasterize the PDF, or have gaping holes in what they can convert.
@PatrickMaupin Can it handle PostScript input? I'm comfortable with generating PostScript, but it'd be nice to have something that simplifies the process of combining multiple separate things drawn with PostScript.
For a start, I would use inkscape in headless mode to generate PDFs for each image.
Then, if the job is simple enough, you can use rst2pdf (which uses pdfrw under the hood) to combine them. Note that rst2pdf is still 2.7 only, though, and you'll need to back up to reportlab 2.7 as well.
If you want to draw in reportlab directly (which is more complicated), then the answer I made is completely on-point.
@PatrickMaupin What advantage does inkscape have over using GhostScript?
Not sure. Maybe none for this task.
Mind you, I'm not saying that Ghostscripts CLI is fun to use, but I'm familiar with it, if somewhat rusty; I don't do as much PostScript programing these days as I used to.
13:24
That answer shows that using inkscape from the CLI is easy-peasy.
Anyway the final way to combine preexisting PDFs with pdfrw is with a newish pagemerge module inside it. It's not really documented either :) but if you're starting with rectangular PDFs you generated from elsewhere, it's really easy to place and combine them and create a multi-page PDF.
Speaking of vector graphics, I was playing around with SVG again a few hours ago. I still can't decide whether it's sheer inspired brilliance or bat-shit insane. :)
Yeah, that's one of the reasons most of the converters (and certainly all of the pure Python ones) suck. Too many edge cases.
But pdfrw doesn't actually do any graphics conversion -- it uses a feature of the PDF container format to say "this is essentially another PDF page -- take this rectangle off of it and place it here"
@PatrickMaupin Sounds good. Eg, a wrote a tartan pattern generator a while back. It puts one tartan per page. But it'd be nice to easily make a grid of them.
Here's a really simple 4-up example. Generalizing that is on my to-do list...
@PatrickMaupin Still, that's easier than what I usually do - use GhostScript to convert the components to EPS, stuff them into a PostScript file, & then manually edit the PostScript so that the components have the right scale & position.
13:30
The best documentation so far for that pagemerge capability is in a stackoverflow answer I posted.
Yeah, this replaces the manual edit step, and if Ghostscript outputs vector-based PDFs instead of EPS, then it's a huge simplification.
@PatrickMaupin Nice.
The main goofy thing about that pagemerge is that it's based on a couple of different Adobe standards. If you're choosing rectangles off a page (not a big deal if you're taking the entire source every time), the origin is the upper left. But for output, the origin is the lower left...
cbg all
@PatrickMaupin Weird. The OP said it was awesome & gave you a tick but was too stingy to up-vote. At first I assumed it a 1 rep newbie...
13:38
Maybe he thought it looked good but didn't actually try it yet. Who knows?
Anyway, I did hijack a question about a competing library. All part of my world-domination push. Now all I need is documentation.
@PatrickMaupin Or maybe he just forgot.
Could be. Anyway, I'm making slow but relentless progress.
$ vanity pdfrw
              pdfrw-0.1.tar.gz    2012-09-18        87355
              pdfrw-0.2.tar.gz    2015-06-21         1242
pdfrw-0.2-py2.py3-none-any.whl    2015-06-21        15364
---------------------------------------------------------
pdfrw has been downloaded 103961 times!
@PatrickMaupin It can be hard to get motivated to write documentation.
Especially when there's coding to be done.
Ideally, you write the docs first, then the tests, and finally you write the code.
13:42
At some level that's true. OTOH premature feature definition can make the code just as brittle as premature optimization.
Especially if you're writing stuff for a client. Getting agreement on the docs before you write a line of code is a great way of stopping the client from moving the goalposts in the middle of development, but it's not 100% foolproof..
Extreme Programming without an experienced guide considered harmful.
The first time I tried it, I wound with a metric shit-ton of useless tests.
@PatrickMaupin Fair point. You do need to be a fairly competent designer to operate that way, so that you know the feature definition is sensible and won't lead to horrible coding problems. But the advantage is that it involves the client heavily in creating the design so they feel part of the process, and they can't turn around and complain that the software doesn't do what they want.
The thing is I was already a very experienced designer, but was trying to apply the paradigm as written, not (obviously) as used in practice.
DNC
DNC
People who know about Python mostly also knows about PHP, how come?
13:47
And it didn't lead to coding problems per se (for me), just that when I figured out a better way to do some things, all the (internal, unit) tests became completely useless.
@DNC Really? I know nothing of PHP.
Other than it starts with P and has at least one H in it.
@PatrickMaupin Understood. Note that my comment above started with the word "Ideally". :) I haven't done any collaborative coding for a long while, & when writing stuff for personal use I'm pretty slack in applying proper design principles. But I do comment my code adequately, so I can look at stuff I wrote a decade or more ago & it's (mostly) comprehensible. :)
I'm pretty sure Extreme Programming means that you shouldn't add comments until you need them.
@DNC Some people who get sick of PHP learn Python, but I doubt that a majority of Python programmers know much about PHP. FWIW, I spent about a month learning PHP about 5 years ago, and haven't touched it since, so I've forgotten almost everything I learned about it.
I used to see way too many comments like inc ax ; Add one to the accumulator
Well, there is a tendency to comment heavily in assembler. But that sort of commenting is silly. As I said the other night, comments should describe what the code is doing, not how it's doing it. The exception is educational code that needs to explain the syntax to newbies. Unfortunately, the newbie can then get the impression that those how comments are a good commenting style.
But even the what comments should be kept to a minimum & mostly used to provide an overview of a section of code. Individual lines rarely need commenting if you're using sensible variable & function names. One notable exception is when you're doing something that requires a tricky algorithm that's not immediately obvious to a competent reader - by all means comment that sort of thing so the reader doesn't have to do half a page of algebra to figure out what your code's doing. :)
14:02
Agree completely. But when I practice Xtreme Commenting (when I have to reverse-engineer my own stuff 4 years later and make a comment to make that easier in the future) the main thing I find myself commenting is the contents of data structures. This helps me to understand part of where explicit typing weenies are coming from; OTOH the number of such comments is so few it would be burdensome and distracting to explicitly define every structure.
@Patrick retro-actively doing stuff like that (in my experience) is harder work than just having done it in the first place
Don't disagree. I do do some commenting up front, but some things seem so obvious, and in retrospect that's right 99% of the time. You're right; the other 1% is a bit of a bitch, but Python's so easy I have to keep my debugging skills sharp somehow, right? :)
And if you do it correctly, you can have a lot of docs and expected behaviour in the tests themselves instead of (over) extensively documenting the main code
Atlhough - if I'm doing something that I "know" is going to be less than 100 lines and not too cryptic that just looking at the stdlib reference wouldn't be be clear, then I don't write tests or even comments
Yeah, tests done right are a good communication tool.
mind you... someone out there is still using something I wrote where I couldn't think of a name and happened to be eating a tuna sandwich for lunch so there's some code in the world that's unsigned int tuna_sandwich(FILE* fobj, char* delimiters) /* TODO: rename */"
3
14:11
Naming's tough, and if you have a complicated algorithm in your head, you might want to get it down before you waste time on nomenclature. OTOH, you might want to follow up on that , as well.
(Just practicing to make sure I'll remember how to do tags.)
@PatrickMaupin I left that company 15 years ago - bit late now to worry about it :p
"There are only two hard things in Computer Science: cache invalidation, naming things, and off-by-one errors." – Phil Karlton & Leon Bambrick
And there's always tension. One of the things I do is boards, and some of the schematic capture guys like to name every single net because then when they're doing layout they see a name and not just $N00391348. That's all well and good, but when essentially the same signal passes through 3 resistors and two capacitors, they run out of good short names, and it sucks to read the schematic.
@PM2Ring "There are two kinds of people: those who can extrapolate from incomplete data."
It takes a long time to learn the art of naming, and I guess it's not easy to teach. I think the best influence on me in improving my naming ability has been using large libraries (eg GUI libraries) that have good naming schemes.
14:30
Hi, @JRichardSnape. I don't know if I've posted this one before, but I think you'll like it. The Susan Tedeschi band playing John Prine's Angel From Montgomery (with a little bit of Sugaree), featuring some very tasty violin work by Jason Crosby.
14:54
Hi @PM2Ring. I'll check it out, your recommendations have a good track record :)
15:31
83
A: What is the difference between a variable, object and a reference?

Jon Skeet(Just to be clear, the explanation I'm giving here is specific to Java and C#. Don't assume it applies to other languages, although bits of it may.) I like to use an analogy of telling someone where I live. I might write my address on a piece of paper: A variable is like a piece of paper. It h...

I thought we no longer allow questions like this
But Jon Skeet reached 800k :-)
False Alarm
He is yet to reach. Round off... Sigh
You have to think of rep as logarithmic. The 830 points he gets for doing that would only be the same as 90 points for you or one edit for m.... waitaminute, I can't even get two points by doing an edit anymore! I'm in the donut hole.
15:57
rhubarb
rbrb @PM2Ring
rbrb PM2Ring
16:11
Hi everyone, I was hoping to have a discussion on how I could do something
to be clear I am trying to write a python program
that calls another python program as if I was calling it in the terminal
Here is exactly what I mean
actually never mind this is going to be a pain to explain through text I will try to find another means hugs and kisses
89
Q: Run a python script from another python script, passing in args

Gern BlanstonI want to run a python script from another python script. I want to pass variables like I would using the command line. For example, I would run my first script that would iterate through a list of values (0,1,2,3) and pass those to the 2nd script "script2.py 0" then "script2.py 1", etc. I fou...

16:30
Cbg all
@VigneshKalai cbg
@PatrickMaupin who are you doing :)
My wife, normally.
SOrry typo :p
But one of the hilarious reply
Co-workers occasionally, but they don't enjoy it as much.
16:34
:D laughing out loud mate you made my day
So what's the plan?
AT this time would be to take a nap it is 10 pm here :)
surely 10pm is more "sleeping" time than "napping" time?
And what about you what is your plan
0
Q: How to ignore single quotes which extracting file names in python

LinocompI have a file(main.cpp) containing list of other files. The format is as below: FILE: 'addition.cpp' FILE: 'matrix.cpp' FILE: 'rate_of_interest.cpp' My code is as below: lines=mainfile.read().splitlines() for i, line in enumerate(lines): line = line.strip() if "FILE:" in line: ...

6.
6 answers.
16:36
@bereal did you just go all "count" from Sesame Street there? :p
One of it is mine @bereal :P
I was considering a nap as well, but mine is more of the mid-day variety.
The best thing Sesame Street offers programmers is the debugging song.
I didn't watch Sesame Street :(
by the time it reached Russia, I grew up.
Just get it right the first time - then you don't need to debug :p
16:55
I guessed, I guessed.
great, need to use it during job interviews.
oh, there are many of those.
now, I'm stuck watching them all, thanks.
there has to be quite a few parodies, I guess youtube.com/watch?v=Zg7gxAG8YS4
@bereal Sorry :) I have to confess I don't get that one parody -- missing some background, I suppose.
Neither do I, I think, we're not supposed to, and that's the point.
I thought maybe, since he was writing things and not working with blue chips, he couldn't afford a computer, but your explanation makes just as much sense.
You're obviously moving in different circles groans at self sorry
True dat!
17:16
@JonClements Dunno 'bout you, but they make me debug other people's stuff sometimes...
There is that I guess sigh
18:08
did anyone else watch @PatrickMaupin linked "the debugging song" and think the right-bottom one is the different one (has thicker borders while others are same image with different size attributes)?
19:04
Which week do Saturday/Sunday apply toward in the week rankings?
You would probably get more help asking in one of the meta chatrooms.
Rather than a Python chatroom.
Why do people create demos with from lib import *?
19:32
Writing docs: if you can't explain what a function does, maybe it shouldn't be doing it that way. Or maybe it shouldn't even exist.
19:48
cabbage
Hello.
what is the topic?
What topic?
topic
you guys are talking about here
Nothing, at the moment.
19:51
ah ok
today I took the day off, not a single minute thinking about code
feels good but makes me more motivated
I took today off because it's Saturday :D
normally, i code also saturdays, not for company but for myself
just doing crazy stuff here and there
20:33
/me is 13 rep away from wielding The Sword of No-Review-Edits.
3*
20:49
Okay, Net Neutrality problem is not over yet in India :'(
21:13
RAAAAARR!!
 
1 hour later…
22:38
hello kitties
as a bird wouldn't you avoid kitties?

« first day (1764 days earlier)      last day (3407 days later) »