« first day (1840 days earlier)      last day (3102 days later) » 

So, I was going through some of our old source code and found a file named {ClientName}F***You. It contains methods such as "NightmareOnParsingStreet".
And my personal favorite, a boolean called TharsAnAndThar.
 
That's just an extra piratey way of saying 1003. Weird that it's a bool.
 
DSM
Morrrrrnin' cabbage, mateys!
 
@Kevin It's a way of checking if the current section of string parsing is "and".
 
Take one tharsan' and thar paces, then dig down thar meters...
 
2:12 PM
cabbage @DSM :)
 
static int maxPageHeight = 2350;
Ok, this definitely isn't in inches or millimeters or pips or pixels. I don't even.
Pretty sure Past Kevin just picked random numbers until the output looked right.
 
That sounds like something I can imagine Kevin doing :p
 
Time constraints make me do bad things.
 
There's also a BodyCount variable, which worries me.
 
Umm... 23.5cm appears to be an envelope size of some sort...
 
2:15 PM
bodyCounts = [1, "something's got to give", 2, "something's got to give", 3]
 
Thanks for 'Giving Back' Wes by having my comment deleted which reflected your inane comment toward me...hypocrisy — user5507329 1 min ago
OP is making too many non-constructive comments. Already had a few comments flagged
 
Style question. I want to join a string on a variable and a tuple. What's the best way to slap them together?
a = 'Hello'
b = ('I', 'love', 'you')

' '.join((a,) + b)
?
Specifically I'm trying to join them like in the example.
 
I think it depends on the context - another option would be '{} {}'.format(a, ' '.join(b))
 
2:30 PM
f'{a} {" ".join(b)}'
Yay
 
Interview over! I asked the Python questions. His intuition for MRO is correct, but he didn't understand finally. I asked him about descriptors, and he said something about django objects, no mention of datamodel special methods. Was he on to something that I just wasn't aware of because me no django?
 
Only davidism knows for sure.
 
Never ever had I encounter an MRO-related problem in real life.
 
> You need to fully describe the problem, and daddy what you've done.
 
DSM
Me neither, to be honest.
 
2:35 PM
@corvid Which one?
 
@MorganThrapp and "daddy"? :p
 
Everyone here is just petty bullies.Keep deleting my truthful comments... — user5507329 16 secs ago
Small rollback war
 
facepalm
Am I being a bully?
 
@bereal No. They asked a bad question and got pissed off when we told them.
 
2:38 PM
@Kevin Normal?
 
truthful comments
Shame on us.
 
the truth is out there
 
Technically any comment is truthy. I don't think you can post any empty comment.
 
DSM
I didn't know that there was an IsADirectoryError. Have to give it points for explicitness.
 
@FaheemMitha 8.5 x 11 inches, the size most commonly used in US consumer-grade computer printers. To dissect the joke: I am playing the role of the stereotypical self-centered American that assumes that everything local to them is normal, and everything foreign is weird and wrong.
 
2:41 PM
@Kevin Yes, I thought it was probably meant satirically.
Or maybe ironically. I have difficulty distinguishing the shades.
 
I guess satire, if I had to pick one.
 
Fair enough.
 
I usually suffix my Dumb American posts with the "deal with it" emoticon "B-)" but I forgoed it this time.
Forgoed? Forewent? Foregone'd?
 
DSM
I think it's forewent.
 
Google agrees.
 
DSM
2:45 PM
Or, wait, forwent? We're saying forgo, not forego.
words are hard
 
@Kevin could just say "didn't" :p
 
DSM
Ah, the worldmind seem to think it should be "forwent" here.
 
Yeah, leaving out the E seems to be the "official" variant
 
Python only has about 20 keywords and 80 builtin functions/objects. Compared to English it's a piece of cake.
 
DSM
With the E I think it would be "In the past I went before something", not "In the past I did not do something I could have".
 
2:47 PM
Django does use descriptors and metaclasses a lot, although I'd have to know what he said to know if it's generally correct.
 
CHOICES!
 
DSM
> Hector: I am unarm’d; forgoe this vantage, Greek.
Achilles: Strike, fellows, strike; this is the man I seek.
 
Also: COLORS!
 
I got my first piece of Stack Overflow related hate fan mail.
 
ok I didn't ask him to elaborate because I wasn't prepared to go down that road with him, I'll just allow that he may have been on to something.
 
2:49 PM
@davidism to your personal email?
 
Not sure if we should take spelling advice from a play that spelled "unarmed" wrong
;-)
 
@DSM Oooo, iambic pentameter.
 
Yep, it was basically "I live in San Diego too, I know your name, I want to meet such "great" programmer, name the time and place". Kinda creepy!
 
=/ that's really not right...
 
DSM
The number of ways that story ends badly substantially outnumber the ones in which it ends well.
 
2:52 PM
@davidism and who's your fan?
 
user559633
@poke Connect all accounts and win a sadness prize!
 
@tristan My instant reaction was to close the tab again.
 
I briefly considered giving him the address of a police station. Only briefly.
 
(after taking a screenshot)
 
user559633
@davidism I want to smell your arms
 
2:55 PM
gross
 
user559633
Things can always be creepier is what I'm saying I guess
 
hopefully that's as far as it goes
 
Is that our truthful friend?
 
0
Q: How can I pass parameters to this Flask Jinja template function?

Stack Overflow sucks big timeThis works, but Id like to pass the parameter variable values to the section inside return render_template() so I can reuse test(), how can I do that? """ Test.html """ @app.route('/test') def test(): """Renders the careers page.""" return render_template( 'content/loader.html', ...

It was re: this question, where I rolled back an edit that changed his whole question, and told him he just misunderstood the answer and should look up decorators
 
user559633
@AaronHall Great, are we hiring him for the room?
 
2:58 PM
and now has changed their username to something quite interesting.
 
I guess it's a good thing you aren't taking him up on his offer.
 
@idjaw I wonder how you flag usernames as offensive...
 
Would that be appropriate to raise this on meta?
 
good question @PM2Ring I really don't know. Maybe a seasoned veteran here knows.
 
I don't see that meeting the bar for "offensive" usernames
Also they want their account deleted, so it will be back to user... before long
 
3:02 PM
I guess it could be worse. :) It's still annoying, though. Maybe we should just call him "sucks" for short...
 
nah, just add memory at the end of the name.
probably won't notice. :P
 
The advice on meta is "ignore the first stalker mail, if it continues then contact us"
Oh also, this answer is absolutely wrong, if anyone wants to help delv-pls it, needs one more dv first
 
@davidism DV'ed
 
@jonrsharpe I'd argue that in this particular case, including the context would have made this topic too broad for posting. — sleepycal 59 secs ago
Have I misunderstood what context and/or "too broad" mean?
 
3:11 PM
nice hammer @vaultah
also cbg all
 
cbg @tzaman :)
 
@jonrsharpe based on the answer, I get what they were trying to ask, but that question is really unclear
 
@jonrsharpe Yeah... hardly the worst ever name - and yeah... unless they cancel it, it'll be gone in ~15hrs
 
And now, because I wanted to know why they wanted it, I'm bikeshedding. Sigh. What's the point of a self-answered question if nobody else can ever find it?
 
rep-farming /cynic
 
3:22 PM
@tristan & rest of the room - I'm trying to help another group with their interviews, and drawing from your diverse experiences is of enormous value, and I am grateful for that and sincerely appreciate it.
 
rhubarb
 
I believe this is a proper dupe target for stackoverflow.com/questions/33437508/… What do you think?
 
Not to be a rep-baby about it...but sheeesh
 
Bah, shouldn't have reopened that
 
I wonder if someone asked "how do I print anything on the console in Python", how many answers would it receive?
 
3:36 PM
print("anything") +++++++ "checkmark" . profit. Take over world.
well hey...that comment answer got me the pundit badge. Ice cream!
 
Guys, how do you deal with a package your project relies on that is rarely ever updated? Just fork it and modify it yourself?
 
'repwhores', a nice way to put it
'how do I sit on a chair'
 
What are comment answers considered?
 
DSM
Unfortunate.
 
3:46 PM
are they seen just as bad as answers in situations like this?
 
@corvid yes, although you could consider an issue/PR to see if the maintainers want your updates
 
It was such a odd/easy question...I just comment answered it because I just was so surprised something like that came up. Is it best to leave those alone entirely and flag?
 
@jonrsharpe they never respond :| and I wrote all the code for them too
 
@idjaw I suspect they are, yes; fundamentally, the lazy idiot OP gets what they want and wombles off leaving the mess behind them (which is frustrating, because that's exactly the opposite of what Wombles are supposed to do).
 
DSM
@idjaw: this isn't a good answer because it would be bad if everyone behaved like this, but to be honest, I just walk away these days and leave the mess for others to handle. :-/
 
3:47 PM
@corvid then I guess you've done all you can! You may find users gravitating to your fork if it's better maintained than the original
 
-6
Q: Use find function in python with a comma

Alan99179Can someone explain to me what the "," after the h does to the find function. quote="hi how are you'" print(quote.find("h",3))

oh my, someone has upvoted it.
 
That's it, society's over (throws bin at window, gets bin back in face)
 
DSM
From previous discussions I think there are people who watch the new post queue and upvote most everything.
 
The net -7 is heartening, though
 
user559633
@AaronHall oh, so we're passing on him as a hire? :/
 
DSM
3:50 PM
> I am trying to find some examples but no luck. Does anyone know of some examples on the net? I would like to know what it returns when it can't find, and how to specify from start to end, which I guess is going to be 0, -1.
^ that is not a question worthy of +42.
 
user559633
 
user559633
when "what about .find()" got you +74
 
When men were men, and women were women, and spades were spades, and tautologies were meaningful
 
"Hey Guys! Can I ask questions on Stack Overflow?".... :p
 
DSM
3:54 PM
@tristan: I was going to suggest "type slower", which seems cheaper, but okay.
 
user559633
@DSM I decided to be amusing instead of a jerk
 
user559633
"type slower" is far more amusing fwiw
 
@MorganThrapp the download didn't work for me. What did I do wrong?
 
@idjaw ask at SO.
 
@idjaw Your GPU must be throttling your CMOS. You need to buy a new monitor.
 
user559633
3:56 PM
What's been happening on my screen has made me miserable this week and has made me seriously consider quitting my job. Which component do I need to replace?
 
Eyes?
 
If that doesn't work. I suggest using sheep instead of rams.
 
would llamas suffice?
 
Did he try downloading more RAM first?
 
@idjaw In a pinch, but you'll have to upgrade your Solid SSD Drive with more platters first so you can feed it.
 
3:58 PM
Oh, my bad. I didn't actually bother even reading the question when I saw the title. :)
 
I do like that they use proper timing specs for the RAM.
 
I just realized how stupid my comment about PyList_SET_ITEM was...
 
user559633
@MorganThrapp why are they selling tshirts?
 
user559633
@vaultah Yeah, knowing those python internals sure leads to stupid comments
 
user559633
[i think you may be being unnecessarily hard on yourself]
 
4:03 PM
Actually, it was correct but at the same time it was completely irrelevant
 
DSM
"I can't even", as the kids say.
"print(type(var)) give me <class 'tuple'><class 'tuple'>" <- what?!
 
@tristan depends on his competition, but we decided he's somewhere between Python intermediate and beginner, and I think they want more of a Python expert.
 
DSM
I think of myself as having intermediate Python skills, so I support the hiring of intermediate-level developers.
 
@DSM they say humility is an important trait in the elite.
 
4:17 PM
I think of myself as having indeterminate Python skills
 
I think of myself as a python.
 
I think of myself.
 
I think of you too
 
I just finished thinking of you. ;)
 
Yeah Morgan ruined it
 
user559633
4:24 PM
They say that trite statements are annoying.
 
I think therefore I use Python.
 
user559633
KEEP CALM AND USE PYTHO RIGHT
 
Is there a word for a word a subset of which is an anagram of another word? Because that's what indeterminate is to intermediate (it has one more 'n').
If not, bagsy "superanagram"
 
anagrams have to be real words?
 
4:35 PM
Hi, people can you please help me with this numpy array [[[460 144]] [[461 144]]] i want it to be arr[460][144] and arr[461][144] like a normal array as in c/c++, I dont know if this is a valid question i am new to numpy
 
arr[460][144] is an expression, not a representation of a data type, so it's not clear what you want it to "be"
Are you asking how to split an array up into two arrays? Does b = a[0]; c = a[1] do what you want?
 
my numpy array is in this format arr[[[460 144]] [[461 144]]] i want these values to be in the format arr[460][144] and arr[461][144] of a 2d array arr
 
>>> a = [[[460, 144]], [[461, 144]]]
>>> b = a[0]
>>> c = a[1]
>>> b
[[460, 144]]
>>> c
[[461, 144]]
arr[[[460 144]] [[461 144]]] is not a valid Python expression, so I don't know what it is supposed to mean
 
DSM
@JibinMathew: that doesn't make much sense, I'm afraid. Even in C, what would you want arr[460][144] to return? If we interpret 460 and 144 as indices in a 2D numpy array, that specifies a cell. What do you want that cell to contain?
 
>>> arr[[[460 144]] [[461 144]]]
  File "<stdin>", line 1
    arr[[[460 144]] [[461 144]]]
                ^
SyntaxError: invalid syntax
 
DSM
4:42 PM
@Kevin: my guess is the OP probably has a 3d numpy array of shape (1,2,2): actually, maybe (2,1,2) from the brackets.
 
So, suppose i have a numpy array say a which has value [[[460, 144]], [[461, 144]]], now i want that there is another array say arr such that arr[460][144] and arr[461][144]=1 then is there any efficient way to do that rather than iterating
@ds
 
What are the dimensions of the output arr?
 
say 1024,700
 
DSM
One way would be new = np.zeros((1024, 700)); new[arr.squeeze().tolist()] = 1, where the squeeze is necessary because of your weird shape.
 
@DSM I am opencv and this is the weird form of numpy array i am getting
 
DSM
4:53 PM
You might need to stick a .T in there after the squeeze to get it in the right direction. But something like that should work.
 
@Jibin I love how you managed to abbreviate @DSM's name there... 'cos 3 letters is demanding way too much - why not make it 2 <g>
 
the m is too far from the s, agreed on abbreviation.
:P
 
@JonClements i am sorry i am new to chat and i am not sure about the way all this works
 
haha don't be - just made me chuckle is all... :)
 
Hooray, my PDF is rendering at letter size instead of A4 size. New problem: everything is upside down.
 
@DSM The way i am working right now is x is my numpy array
for i in x:
(arr[i[0][0]][i[0][1]]) = 1

I am doing it the right way ?
 
@Kevin then flip it around after you print it. Problem solved
 
todays xkcd is so good
 
Rather, everything is rendering from the bottom up.
in my pdf. (3/3)
of how text is laid out (2/3)
This is an example (1/3)
@JoranBeasley It so accurately described how I use git, I did not recognize it was supposed to be funny.
 
5:02 PM
Okay, that's troublesome
 
DSM
@JibinMathew: that should work. You can do x = x.squeeze() to get rid of the dummy singleton dimension and then do for i,j in x: which may make it a little clearer, but whatever.
 
"Yes, of course you deleting everything is the correct course of action when something goes wrong. Where's the gag?"
 
DSM
Subcontinental rhubarb for all!
 
I just told a co-worker to do that (wrt git repo)
yesterday
hi DSM
 
5:06 PM
Past Kevin, why did you do y = pageHeight - y for every renderable element? -_-
 
@DSM thanx it works
 
5:28 PM
What's the easiest way to tell if a list is flat?
I tried something like:
for element in struct:
    if isinstance(element, list):
But I'm struggling to make it work for arbitrary nested levels.
Well, to make it more complete, I'm trying to just get the structure of a nested list. I don't care about the data.
def clear_list(struct, cleared=[]):
    for element in struct:
        if isinstance(element, list):
            if len(element) > 1:
                for sub_element in element:
                    if isinstance(sub_element, list):
                        return clear_list(sub_element)
                    else:
                        cleared.append([])
    return cleared
 
Obligatory "mutable default argument" warning
 
@Kevin Yeah, I always forget how to do recursion with a default mutable argument for the first run.
Should I just be doing cleared=None and checking for None?
 
Yeah
So what kind of output are you trying to get? What do you consider to be the structure of ["Hello, [2, [3, "foo"]], "goodbye"]?
 
@Kevin [[[]]]
Or for the case of ['Foo', ['bar', 'baz'], [1, 2]] I want [[],[]]
 
def structure(x):
    if isinstance(x, list):
        ret = []
        for item in x:
            child = structure(item)
            if child is not None:
                ret.append(child)
        return ret
    else:
        return None
examples = [
    ["Hello", [2, [3, "foo"]], "goodbye"],
    ['Foo', ['bar', 'baz'], [1, 2]]
]
for example in examples:
    print "\n", example, "\n", structure(example)
['Hello', [2, [3, 'foo']], 'goodbye']
[[[]]]

['Foo', ['bar', 'baz'], [1, 2]]
[[], []]
I bet there's a more concise way to do this.
 
5:39 PM
That works for me. :) Thanks!
 
def structure(x):
    return [structure(item) for item in x if isinstance(item, list)] if isinstance(x, list) else None
Scraping at the bottom of "acceptably maintainable" there though
 
If you want to get really concise:
def structure(x):
    return (None,[structure(item) for item in x if isinstance(item, list)])[isinstance(x, list)]
 
Ummm: interesting spam email: "A heart attack is one of the most easily preventable causes of death out there. EVEN if you are a fan of eating greasy foods, you can still drastically reduce your risk without quitting."
 
That won't accept values of x that aren't lists, if that matters.
If not, you can chop off a little more and do return [structure(item) for item in x if isinstance(item, list)]
 
@Kevin That's fine.
 
5:44 PM
And now we're back in "actually comprehensible" territory. More or less.
Was kind of hoping to fix this rendering bug before my afternoon torpor... I'm not going to have enough stack depth now.
I guess I can still try things at random. Let's see what happens when I replace convert(node.GetAttribute("Top")) with ((int)PageSize.LETTER.Rotate().Height) - (convert(node.GetAttribute("Top")) -convert(node.GetAttribute("Height")))
 
6:29 PM
@Kevin Because PDF origin is at bottom left?
 
Yeah probably. Now I've gotten it into a state where the first section renders perfectly, but bottom-up; or nothing renders at all except for a single line that usually appears on the third page.
Presumably in the latter case, everything is still being rendered, but at some coordinate that places it way off the screen
 
Your presumption is reality in my usual cases...
If I were you, I'd take the one that was rendering perfectly (but upside down), and stick a transformation matrix in front of it :-)
 
Debugging is made harder by the fact that my sample input has 5000 renderable elements or so, which makes it difficult to choose one and say "I will monitor this one's progress from start to finish". I also have a lot of global mutable state.
 
You can add the top of the page in the matrix, and use -1 for the Y transform.
I have a cheesy script (that doesn't work with a lot of fonts) that will deconstruct (some) PDFs if you care.
 
Can it determine the coordinates of a text element that got rendered way off screen?
 
6:40 PM
Not really. I have a script that can write to a reportlab canvas to recreate a PDF (again, doesn't work with all fonts, or images embedded in the stream for that matter), and I have a fake canvas for it that simply shows you all the reportlab commands that would have been issued.
So you'd have to do the math.
OTOH, it's seriously easy to put a matrix transform in front of your graphics to (a) shrink them down and (b) move them towards the center of the page.
 
6:52 PM
I hate reportlab
its the least bad option though
at least imho
(constructing pdf's)
 
It is the least bad option in many (most?) cases.
I don't begrudge them trying to make money from add-ons like pagecatcher, but OTOH, I'm not going to pay them for them, which is one of the reasons my library works with reportlab to allow you to reuse preexisting PDFs.
 
the inverted y axis really messes with me ... and I cant figure out how to make proper landscape documents
 
I'm now concerned I don't have the right page format for the pdf generators I have with reportlab...
 
IIRC their page size constants are X/Y tuples. You might just need to reverse the tuple for the size you want.
 
cbg, all
When reportlab was young I was their US agent for a few years. interesting ...
seriously good technology for its time, but imho never achieved the commercial potential it could have
 
Air
7:04 PM
kyeeeeeabbage.
 
Yoyo.
 
cbg .*
 
@holdenweb thats pretty cool ... now I know who to pester if im stuck with reportlab :P
 
stackoverflow.com/q/33443312 dupe, added python tag
 
7:24 PM
CBG
 
cbg Adam
 
I'm confused by the new navigation thingy
It acts like it KIND of works like the search bar
 
DSM
Back from interviewing C++ dev! Friday afternoons are fun.
 
@AdamSmith Yeah, I tried it, and I don't like it.
 
but I'll occasionally use search terms like [python-2.x] [python-3.x] -[python] to find questions that aren't tagged right and earn mountains of rep from them
and that doesn't work in the tabs
except if I make that search it shows up as a tab
and as long as I don't touch it, it will continue to work
the tab reads: not
but typing that in a new tab shows no results
bleh. Anyway, enough of complaining
how was the interview, @DSM ?
 
DSM
7:43 PM
@AdamSmith: not bad! I don't know how good I am at evaluating talent, though. Fortunately everyone we're interviewing this round has a much better work history than the last time we went through this process for a Java guy (plus our c++ is much better than our Java, so we know more about what we're doing. :-)
 
Hi
 
hiya @tuxtimo
@DSM good! I hope you find some good talent. I know less about C++ than I'd care to admit in mixed company. Once upon a time I decided I was going to learn "The Cs" but that didn't last.
Went back recently to try and relearn C# and didn't even make it through a tutorial before I got distracted by other things.
 
So, for some reason, when I run my code in debug mode with Pycharm, it runs about 5x slower.
Also, PyMSSQL doesn't properly respect TRY/CATCH blocks in T-SQL. Grrrrrr.
 
Pycharm. Meh.
 
So, have you guys made your offerings to the spirits for Samhain?
 
DSM
7:53 PM
Sunday is the Solemnity of All Saints, and I might light a candle. Is that close enough? ;-)
 
My daughter used the money we gave her to pay a fine at school to buy popcorn for Dia de los Muertos. Does that count?
 
DSM
@AdamSmith: hah, I beat you to the [alternative suggestion] / [is that a viable alternative] pattern!
 
I already thanked mr skeltal this year so I'm good
 
ha.
 
@Kevin Doot doot.
 
7:56 PM
Halloween is a holiday made by Big Candy to sell big...candy...
 
I am just drowning in good bones and calcium over here
@Ffisegydd Yeah but somehow I can't get properly outraged about it.
Usually when I'm manipulated by Big <Thing>, I end up with a service or good I didn't want and/or need. But when Big Candy does it, I end up with candy.
3
 

« first day (1840 days earlier)      last day (3102 days later) »