« first day (1843 days earlier)      last day (3119 days later) » 
00:00 - 17:0017:00 - 00:00

5:00 PM
A favourite of my dad's (a former copywriter) is "Nothing is better than X"...so use nothing?
 
It's in a class all its own, which is best in classes.
 
@jonrsharpe brilliant :p
 
need the right meta ordering to interpret it
 
I do love Budweiser's slogan "This is beer". Congratulations on meeting the minimum requirements for calling your drink beer.
 
@jonrsharpe one "snippet" I heard them read out of "News Quiz" was something like: "Looking for [something, something, something]... come to our conference and you can expose yourself to over 6,000 potential clients" :p
 
user559633
5:02 PM
brb naming my company "nothing"
 
That'd be a heck of a cock-up
 
user559633
going to make the prosecco of beers
 
@jonrsharpe unintended?
 
"The best a man can get" seems like a set-up for an ironic prophecy fulfillment a la Macbeth or Tolkien's Eowyn.
 
@jonrsharpe Someone fixed "Cesar algorithm" guy's indentation. I was just about to berate them for it, but then the OP said the indentation was now correct. Grrr.
 
5:06 PM
@FaheemMitha no, pun
@PM2Ring well then that can be closed as cannot recreate, as the code definitely prints stuff.
 
@jonrsharpe Oh. Not sure I get it.
 
@jonrsharpe "unindented honesty" ? :)
I think we can blame "Cesar algorithm" guy for that one. :)
 
Ack, damnit
 
user559633
@jonrsharpe shortest, most to the point Cathy comic ever
 
user559633
5:10 PM
wow "ruby/python/javascript xml file?"
 
I can typing computering code now please?
"I tried opening this file with my internet browsers and now I'm not sure where to go from here" - good grief.
 
user559633
Okay Charlie Brown
 
Home. You should just go home.
 
user559633
halp, someone replaced jsharpe with the sunday comics
 
user559633
Title: Salty and getting fresh phrasing
 
5:12 PM
I was just about to get into how little I like Mondays and my enjoyment of baked Italian cuisine.
 
user559633
Please do the needful and continue
 
@jonrsharpe you'll probably love stackoverflow.com/questions/33476550/… (10k+ only)
 
user559633
10k+ only as in actually 10k+ or like 18+ on websites?
 
@JonClements wow! That one comment is just perfect.
 
user559633
garfieldminusgarfield.net/page/4 garfield minus garfield is awesome
 
user559633
 
Loving the screenshots of the printed exercises. Slow clap.
 
user559633
 
user559633
never mind, too real
 
realfield's pretty good too
 
There's also Garfeel, the comic where Garfield is an eel.
 
5:19 PM
stackoverflow.com/questions/33483233/… their errors... are too-broad
 
I was astonished by a recent actual Garfield comic, which made reference to Jon's profession as a cartoonist. A fact which I've seen nowhere else other than the very first comic from '78.
 
user559633
We give them a little time before CVing please @idjaw
 
The strip in question also had background objects, which seems remarkably high-effort for Garfield.
 
@tristan yeah..wasn't too fair to jump that quickly.
 
user559633
that said, i aint your real dad, but we've tended away from having a cv-pls stream in here for many reasons, herd of close votes within the first minutes being one of them
 
5:24 PM
Keep in mind that we don't need to close everything ourselves. Post things from specific tags. We already know that the main tag is bad.
 
noted. Thanks.
 
user559633
Why is that pinned
 
not me
 
Because a bunch of newer people have been cv-pls-ing lately, and it's started to get a little overwhelming
 
yeah sorry for that. I think I'm the main culprit of that.
 
5:30 PM
@idjaw editing other people's questions, ing, what are we going to do with you?
 
With that said, I'm about to cv-pls something. I hope you are all on the edges of your seats with anticipation.
 
user559633
Oh okay, just seems a little out of context for a pinned
 
user559633
I'm going to vote to re-open because I'm feeling salty today
 
@jonrsharpe I'm thinking of a suitable punishment. Code in an <unlikeable_language> for a week perhaps.
 
I duped the same question but they deleted it, so this time it's just getting closed.
 
5:36 PM
I'm imagining a lone coder standing in the corridor into a stadium, a dull noise, roar of a crowd, slowly resolves as they get closer to the door into a repeated triple beat... thud thud thud... thud thud thud... The doors swing open to reveal a single terminal in the centre of the stadium and we can now hear the chant for what it is... "PHP, PHP, PHP"
#programminghorrorstories
 
shiver
 
@jonrsharpe: for future reference: you had plenty of grounds to flag one of your posts; that puppy does indeed look like it latched on for all the wrong reasons.
 
@MartijnPieters I did, the flag is still outstanding
 
@jonrsharpe I'm working in PHP right now. :(
 
Ah, I've been a bit busy lately, so I haven't been handling as many flags.
It's been piling up a bit, sorry about that.
 
5:38 PM
Not to worry, I have plenty of rep left!
 
Found the flag already :-)
 
So you have - thanks!
 
No idea when a CM will handle it, they've been very busy with more automated goodies for us mods.
 
@MorganThrapp I've never actually used it, just relying on the trope
 
Gotta run, another class soon. Currently in California at FB headquarters.
 
5:40 PM
@jonrsharpe The trope is not wrong.
 
Hard life, eh?
 
rhubarb all!
 
@MartijnPieters I still think that was a quiche :p
 
#Download source files #Nunavit output_path = 'C:/Data/Projects/Tenements/CAN/NU' url = 'ftp2.cits.nrcan.gc.ca/pub/aandc-aadnc/Mineral_Tenure.zip'; filehandle, _ = urllib.urlretrieve(url) with zipfile.ZipFile(filehandle, 'r') as z: z.extractall(output_path) #Extract data from manually downloaded zip files #SK with zipfile.ZipFile('C:/Data/Projects/Tenements/CAN/SK/SK_DISPOSITIONS.zip', "r") as z: z.extractall("C:/Data/Projects/Tenements/CAN/SK") #NWT — Dean Visser 10 mins ago
hang on...this is not displaying like I want it to — Dean Visser 10 mins ago
Masterful understatement
Oh, and now they've just taken information out of the question. Helpful!
 
6:21 PM
Last week I read an article indicating that elevated levels of CO2 can have negative effects, even at concentrations well below what would be considered "dangerous".
I have a theory that the three people that I share an office with are hogging all the O2. I wish to test this by opening the window to see if it makes me more productive.
But it's cold outside so I think this would annoy them.
I wonder if security would object to me bringing in a compressed canister of oxygen.
 
Kill one of them and see if your productivity rises.
Just make sure you kill him outside your room or his decomposing carcass could emit gases and throw off the science.
 
I could, but that doesn't distinguish between the two leading theories "oxygen deprivation makes me unproductive" and "the mere presence of my coworkers makes me unproductive"
 
Ah touche. Hmm.
 
assuming the latter effect only occurs when they're alive.
 
Well, if you kill one of them and your productivity goes down, then you can rule out the second one.
 
6:26 PM
Well, no, even then it wouldn't distinguish between them, if I dragged them out of line of sight.
(in reply to my own message)
 
I mean, if you want to do this right we need to get some rats and expose them to high concentrations of coworkers over time.
I'm skeptical about the mere presence theory, but who knows, some of them might have a diet high in Kryptonium or something.
 
Possible mechanism of mere presence phenomenon: by being aware that someone is in the room with me, I have to spend additional brainpower ensuring that I'm not doing something socially unacceptable.
 
this is true
 
Maybe they're throwing off your Feng Shui? Have you considered orienting them differently?
 
If my meat shell wishes to make funny faces or sing show tunes while I work out a math problem, it's fine with me as long as nobody sees.
 
6:32 PM
cbg
 
hey Adam
 
This is true actually. I spent a good 4-ish years working from home, and the thing I miss the most is singing.
... and naps.
 
Here's a distinguishing test. The coworkers are in the room, but I am not aware of it. If CO2 concentration is the mechanism, I'll be unproductive. If self-consciousness is the mechanism, I'll be productive.
I just need to convince them to hide under their desk for five days out of the next ten, for a proper randomized trial.
 
Or just have them leave and then pump the room full of CO2.
 
Or CH4. Whatever mood you're in
 
6:35 PM
cbg
 
Getting CH4 might be easier with the coworkers in the room.
 
I've always been a fan of HF.
 
good point...it can be used to CLEAR the room
 
IKR.
 
oddly, I just realized how non-Pythonic my code is. I try to give the implementer many options and be liberal about what I accept.
 
6:36 PM
never be liberal about what you accept
therein lies madness
 
My code is forever unpythonic because I prefer to look before I leap.
 
@tzaman I write primarily JS, all is madness
So, I'm a decent coder - how hard would it be for me to take a (simple) C library and add Python bindings?
 
Easy
 
One time I attempted to do just that but gave up after ten minutes, as is my way.
I ended up just making an executable for each function in the C library, then used subprocess.call to run whichever one I needed.
 
There isn't much to do.
1) Do the rote crap involved in making Python bindings
2) Get your types right.
Not much to it conceptually.
 
6:41 PM
@SomeKittens depends on which level you want to do the integration
 
If you want to get fancy you can unlock the GIL for some calls too I guess, but again it's easy.
 
if you just need to call some functions, write a wrapper using the ctypes.
 
This sounds like an "easy... If you already know how to do it" kind of task
 
@AnttiHaapala baaasically just that
 
"1) do the rote crap" is only rote if you know what rote crap to do
 
6:42 PM
ctypes?
 
I did not, ergo I cheated with subprocess.
Amusingly, that's the highest voted answer for Executing a C script in python?. There are many lazymen like me.
 
I have a custom websocket protocol thinger (stupid simple, really) but I thought I'd have some fun, write it once in C, then add bindings to the many languages that need to communicate with this server
 
It's kind of like learning to make a box in OpenGL. You have to do a "here's the boring stuff" tutorial, which is pretty standard.

It would be complicated but... the internet.
Oh, you have to manage references too.
 
@Kevin is 2010 old for Python?
 
@SomeKittens Here's an example I wrote a year ago which uses ctypes to access the OpenSSL library via Python: stackoverflow.com/a/26878137/4014959
 
6:46 PM
I wonder if there's C++ code to kind of automate the tedium involved with python objects. I get why the API's in C, but it would be a lot easier taking advantage of C++.
 
@PM2Ring thanks!
 
>>> import ctypes
>>> libc = ctypes.cdll.LoadLibrary("libc.so.6")
>>> libc.printf(b'hello world\n')
hello world
12
 
have an upvote
 
Thanks!
 
b'' for python 3 ;)
 
6:48 PM
Python 2 shop
 
Antti's 'hello world\n' example shows how easy it can be to do simple stuff. But if you need to pass C structs it's not so bad, as my code shows.
 
which, as a JS'er blows my mind
though our approach has its own issues
 
@SomeKittens I am sorry.
 
@AnttiHaapala I don't write any of the Pythons
up until now
 
so double so :D
it is as if you never programmed javascript and now started doing javascript 1.0 ;)
 
6:52 PM
the horror
closest thing I've done is use Ansible (requires Python 2)
 
Hey, Python 2's not that bad. :)
... but I admit that it's Unicode handling's not so hot.
 
lots of the small stuff
@PM2Ring I found 1 thing that I miss from Python 2.
that you can use filter to filter characters in a string
 
Really? Ok. Why doesn't that work in Python 3?
 
because filter is lazy and returns an iterable
 
Ah. Of course.
 
6:55 PM
so ''.join(filter(....))
or with bytes bytes(filter(...))
but otoh you can filter using byte values ;)
 
I guess the bytes version is better, since .join has to make two passes over its argument. Which means it has to create a list if you pass it an iterator. But you know that. :)
 
former is for str, latter is for bytes
you should install Python 3.5 already :D
 
rhubarb
 
7:20 PM
Python question. If I take a bag of baby carrots to work, do I need to refrigerate them during the 4.5 hours before lunch?
Ok, it's not actually a Python question, but I thought it would get more attention this way.
 
Damn that actually worked...
And no you don't need to refrigerate them, though if they warm up they may not be as crunchy as you'd like.
 
@Kevin Speaking of carrots, I found a 50lb bag of carrots in my apartment's dumpster this morning.
 
DSM
@Ffisegydd: do you have the equivalent of the five-second rule over across the pond?
 
reducing crunchiness may be desirable anyway, since I don't want my coworkers to murder me out of frustration.
 
@DSM yes.
@Kevin might be away to get them to leave for your hypothesis testing #bringingitbackaround.
 
7:22 PM
It's the "Five Kilosecond Parliamentary Resolution".
 
DSM
@Kevin: especially because the noise makes it ostentatiously obvious that you're eating healthy and they're probably not..
 
@MorganThrapp What will you do? Carrot cake bake sale?
 
@Kevin Leave them there because they're rotting.
 
Large quantities of uneaten food are depressing to me.
I also feel sorry for this lamp.
 
Yeah. I was mostly just confused, because all the people in my building are broke college students.
Why do they have 50lbs of carrots?
 
7:24 PM
Snowman army.
 
apartment complex demographic: 99% college students, 1% 8 foot tall rabbit.
 
Pfft. 98% college students, 1% 8ft tall rabbit, 1% sopython regular.
 
That's impressive considering there's only 10 people in my building and I'm not in college.
 
You're 10% sopython regular, 10% 8ft tall rabbit, and 80% college student.
 
Well that explains a lot.
I've always wondered why I was so full of hops. I'd always blamed the beer, but being an 8ft tall rabbit makes far more sense.
 
7:38 PM
@Ffisegydd I dread to think what my "percentages" are :p
 
@Jon 100% human.
 
my dread is confirmed
@MorganThrapp depends if you call yourself "Harvey" and no one else can see you
 
7:51 PM
For me: 53% 0x35502B, 29% 0xFFFFFF, 18% other
 
DSM
Every time I return to xml parsing after stepping away for a while I forget all the right idioms. :-/
 
Obvious solution: spend the rest of your life parsing xml.
 
Never don't parse XML.
 
Alternative solution: Walk away from XML parsing and never come back.
 
Always never parse XML.
Tangentially related:
 
7:56 PM
Base case: Don't parse XML.
Inductive step: Don't start parsing XML.
 
assert all(event.is_parsing_xml for event in life) or not any(event.is_parsing_xml for event in life)
 
You could store the idioms in a document for later reference.

Maybe use some kind of machine/human readable data format so you can read it but still parse it.
 
You mean JSON?
Or YAML?
Or .ini?
 
Those formats lack some kind of... X factor.
 
Oh, you mean XHTML.
 
8:02 PM
hypertext? I'm not really into star trek.
 
@idjaw I'm so excited. :D
 
I wonder what the budget will be like...should be interesting. :)
 
Unfortunately, I only really have watched TNG, so even if they nail that authentic Star Trek feel, there's only a 1/5 chance I'll like it.
 
Original serious was great for all the wrong reasons.
Like the episode where teleporter was splitting up people's good and evil halves. So they teleported a puppy and the "Evil" dog was just the same dog with horns tied around its head.
 
DSM
8:13 PM
This seems to reduce the chances my Star Trek series will get to air in the near future. :-/
 
Plus, tribbles.
 
That reminds me. Who's doing National Novel Writing Month?
I would, if I could pay attention to the same thing for more than thirty minutes.
Let's see... 1786 words a day, and I type at 40-ish WPM...
44 minutes a day. That would really cut into my reddit-and-webcomics time...
Also I would need an idea and an understanding of narrative structure etc
 
DSM
I can honestly say I considered quitting earlier this year to devote myself full-time to writing. Didn't go through with it, obviously-- my accountant (or, more honestly, the account-y part of my mind) had some strong objections.
 
Time to apply for a Macarthur fellowship, then :-)
reads Wiki article further. Or rather, time to be selected through shadowy means.
If anyone you know looks like they might be on some kind of anonymous panel, try to present your best side to them.
 
8:29 PM
How can I reuse the value of random.choice inside a lambda? Where the list I'm choosing from is a parameter to the lambda.
 
cbg
 
@MorganThrapp You can't
 
Hmmm, alright. :(
 
Use a double lambda.
 
i bet it should be possible
 
8:30 PM
oh god that's terrible
 
cbg!
 
put a lambda in your lambda so you can lambda while you lambda.
 
just write a def
 
It's for golf, so I don't care if it's readable/good.
 
oh in that case
 
8:31 PM
>>> import random
>>> f = lambda seq: (lambda x: x+x)(random.choice(seq))
>>> f(range(10))
10
 
@MorganThrapp link pls
 
Where x+x is whatever your actual expression needs to be
 
@CSᵠ It's quicksort.
I have this right now, but I'm trying to make it into a lambda to save bytes.
 
Hmm, it costs you the length of the word "lambda" plus some parens, but gains you the length of two returns...
Seems like it's worth doing.
 
DSM
as r + r.choice?
 
8:34 PM
@MorganThrapp from random import choice
 
@CSᵠ It's longer.
 
meh..
 
Something like q=lambda s:(lambda p: s if len(s)<2 else q([d for d in s if d<=p])+q([d for d in s if d>p]))(random.choice(s))
Yeah, looks a hair longer
 
@Kevin It's one byte more. :(
 
Python devs, please integrate "λ" as a keyword, thanks in advance
3
 
8:36 PM
Why not do median instead?
 
APL might be my favorite new language to look at. I don't understand it at all, but just look at this {1≥⍴⍵:⍵⋄p←⍵[?⍴⍵]⋄(∇(⍵<p)/⍵),p,(∇(⍵>p)/⍵)}.
That's code.
 
:D my favorite fun fact about APL is that it needed a special keyboard
but any one liner that uses both ⍴ and p is terrifying
 
@MorganThrapp your algo hits recursion limit with quite a few elems
 
@CSᵠ Oh yeah, I'm sure.
 
I wonder if they could've added a w too, to confuse with the ⍵
 
8:41 PM
@CSᵠ Yeah, well, not even the python devs could make a bug-free sort :-)
 
hmm
 
Alt text: StackSort connects to StackOverflow, searches for 'sort a list', and downloads and runs code snippets until the list is sorted.
 
DSM
I just had a bug in C++ due to non-explicit this. :-)
 
More like StackSort connects to StackOverflow, runs no searches, and asks questions until search algorithm codez are provided.
 
8:50 PM
@Kevin I wonder if anyone's figured out that the right place for gimme teh codez is to ask on golf :D
 
Personal favorite is sleep sort. stackoverflow.com/questions/6474318/…
 
DSM
@tzaman: that is a crazy brilliant idea, esp. given the tradition of posting the ungolfed version too!
 
Quantum Bogosort is best, but much like the Feynman algorithm, requires some specialized hardware.
 
@Kevin ∫λ dλ = ?
 
I know some of those letters.
 
8:55 PM
It looks like calculus.
 
you asked the devs to integrate lambdas, so ..
 
DSM
(rimshot)
 
I get it.
 
Hurr hurr maths jokes!
 
9:25 PM
There should be an filter in submitted questions where any string of the form "Hi I'm new to programming." is just removed
 
hi everyone
 
hello
 
so I have a question: in Django, does anyone know how I can test that two models saved on different dates appear chronologically in the httpresponse?
 
make a request and test for it?
 
heh, well my question is: how do I test for it?
what kind of assert would I use?
 
user559633
9:32 PM
fetch the result and use the datetime module and/or regex when ordering your response?
 
user559633
search stackoverflow for comparing dates with python and order it that way
 
I don't suppose you can do assertGreater on datetime objects, right?
 
are you expecting HTML or JSON back?
sure you can
 
just HTML really
 
You can use bs4 to parse it and use assertGreater or assertLess for the two dates
 
DSM
9:37 PM
Knowing exactly zero about assertGreater, I'd still be surprised if you couldn't-- datetime objects return the right booleans when compared.
 
I have to say those 'little' things are so cool about Python
if that's true
 
user559633
@Flobin search stackoverflow for comparing dates with python
 
user559633
or read the official documentation
 
yeah I guess it's not the comparing dates that's the problem
 
@DSM all the unittest.TestCase.assert* methods are just wrappers around an assert x OPERATOR y
 
user559633
9:39 PM
it is comparing and ordering the dates
 
user559633
other answer is the thing i'll then copy and paste to you
 
user559633
you can test by comparing. and then looking.
 
DSM
@AdamSmith: makes sense.
 
no I mean, the real question is: I want to test that they're displayed correctly in the response, so the newer one is displayed first, but I'm not sure how I do that part
as in, how do I check the newer one is first in the HTML
 
user559633
@Flobin order your response
 
9:40 PM
grumble
 
user559633
@Flobin by putting it first and then looking
 
use BeautifulSoup to parse the HTML
then look for which one is first
 
user559633
ugh
 
sorry I'm a Django newbie, doing my first project that's not a tutorial
 
DSM
We were all newbies once. :-)
 
user559633
9:41 PM
not me! i started off as intermediate and that's about my potential!
 
@AdamSmith meh, I wouldn't even do that, it's overkill for unit tests imo
test1: does my model method return things in the right order?
test2: does my html render correctly?
that's all you really need
 
user559633
also lxml's html is way better than beautifulsoup :)
 
thanks @AdamSmith, that beautifulsoup looks useful
 
user559633
whenever i see beautifulsoup suggested, i feel like it would be a surgeon about to use a scalpel and someone says "whoa, whoa, you shouldn't use the tool that's available, go to the hardware store and get yourself some dull shears"
 
@tristan I like beautifulsoup :(
but that might be because it's a wrapper around lxml and I don't know how to use lxml
 
user559633
9:43 PM
@AdamSmith yep, that's why people use it
 
Honest question: do you feel the same way about requests vs urllib.request?
 
user559633
here's an example of parsing html with lxml's html: github.com/tristanfisher/yams/blob/master/yams_api/plugins/dev/…
 
To be fair, lxml is super complex if you have no idea how to even begin parsing XML/HTML, where BS is much simpler to plug and play.
 
user559633
nah, requests is kind of clumsy and does some dumb shit (like keeping its own store of ssl certs instead of properly checking the OS), but it's... whatever for one off scripting
 
user559633
lxml is great for threshing html into x-pathable/otherwise-then-more-sane structures
 
user559633
9:46 PM
that said, i think the python 3 http client is totally fine and i can't imagine i'll use requests for anything serious again
 
one-off scripting is, by and large, most of what I do :P
 
oh, another question: what code editor / IDE do you all use? :)
 
PyCharm.
 
+1
 
vim
 
DSM
9:48 PM
@Flobin: we have a page on the ones many people here like.
 
or sublime/atom
 
user559633
i scream commands at an intern
 
ah, cool, thanks
 
user559633
he is flogged for every indentation and syntax error and i have to say, he's getting better
 
sounds sexy
 
user559633
9:51 PM
it's not.
 
That's just management, right?
I mean, at some point, the intern is going to become sentient.
and can write its own code.
 
user559633
(i don't actually have an intern)
 
DSM
Didn't I see a question like that "sorting dependency" one earlier?
Ah, I did. This one. Has the same misspelling of "interdependent". And the same unusual use of "reflected".
 
DSM
10:27 PM
Early Monday rhubarb for all!
 
cheers
 
I use Notepad++ and a cmd/Powershell console.
 
10:46 PM
any of you watch blindspot?
you see in the last episode a 17 y/o hacker scolds the fbi hacker for using perl instead of python :P
 
11:10 PM
I saw a youtube clip of that
never seen the show, but it was funny
 
Air
11:40 PM
stackoverflow.com/q/33487084/2359271 Somebody's tried to salvage this turd but while their heart is in the right place, the result is less than appealing
 
I went to Safeway to buy their leftover candy corn, only to find that they sold out on the 31st. :(
 
Air
♪♬ if I had a hammer... ♪
 
Call of the hammer: answered.
 
Air
You're earning that avatar in spades (er, in hammers)
 
00:00 - 17:0017:00 - 00:00

« first day (1843 days earlier)      last day (3119 days later) »