« first day (1859 days earlier)      last day (3093 days later) » 
00:00 - 18:0018:00 - 00:00

12:08 AM
@JonClements Also, for what it's worth, tuple([myDict[k] for k in ('a', 'c')]) is (or seems to be, from my tests) at least a few times faster than without the list-comprehensor in there, if you didn't already know. :v
 
@Augusta yeah... why'd you introduce one into the code I posted? :p
 
Should I not have?
Or rather, it was an offhand thing I kind of thoughtlessly mashed out here.
I hadn't meant to talk down on it, if that's how I came off.
 
Huh? Nah - nothing like that - was just curious why you mentioned it out of the blue is all
 
Aa, I see~
I have a strange but fairly common intellectual disorder that causes me to type things unnecessarily more often than is usual.
 
lol - fair 'nuff :)
 
12:17 AM
It is a real and legitimate thing and you do not need to ask a doctor if it actually exists.
>:I
 
does anybody know what <<= operator does
i have a feeling it has something to do with base conversion but i cant seem to search it up on google
 
My girlfriend is currently listening to a recording of her brother going to a psychic and I am desperately trying not to roll my eyes. How do people actually believe this stuff?
@RNar It's the same as i+=1, but with the left shift operator <<.
 
There's some very convincing dead people? :p
 
The capacity to believe something you wish to be true is large
 
@JonClements Nope, just vague statements.
"Did your father die at some point?" "Yes" "Do you have something of his? A medal, a coin, a hat, a shirt, a jacket" "Yes, I have a jacket".
C'mooooon.
 
12:22 AM
@RNar 0b001 << 1 == 0b010, so s = 0b001; s <<= 1; s == 0b010 # True
 
"Your father says he's very unhappy you stole his jacket and then locked him outside to freeze to death in the snow storm"... see - I'm convinced @Morgan!
 
"You had a friend or enemy or coworker or classmate at some point, named Ted or Tom or Todd or Tad?"
 
@JonClements Hahahaha.
 
@MorganThrapp I guess the real question was what is a left shift operator :P
 
"And they ate food near you at some point?"
 
12:23 AM
i got it now though, thanks
 
"Or drank a drink?"
 
@Augusta Do you mean Tim!? Wow - amazing I did....
 
"I had a friend in high school named Tim! He threw up on me on the bus once! INCREDIBLE."
 
It's like you're genuinely psychic or something :)
 
"You had a friend who died at some point? I think he was holding a flag other than the american flag?" "Yes".
 
12:24 AM
@JonClements Get out of my head. >:C
 
Which would be impressive, if her brother weren't such an obvious redneck.
 
"You had a child? Or a parent? And that child or parent was a human, right?"
"My mother was from Zrrgr Baltho IV-2 but my fathers were all human! How could you have known this, Terroid?!"
--NEXT WEEK, on 'Alien Scams'!
"Your fathers all died in a brood pit, is that right?"
"They died on a shuttle that -crashed into- a brood pit! HOW DID YOU KNOW?"
"I'm going to need another fifty Supreme Defense Council Requisition Funbux if you want to hear more."
 
@MorganThrapp It would have been more amusing had that sentence ended in "and alive"
 
@JonClements Hehe, yeah. No, she's said that basically all of his family is dead, when it's only two people.
 
12:40 AM
@Morgan two people that are dead - or does that mean your wife is also dead? I'm confused now :p
 
On a more positive note, I've been listening to this song on loop and I love it.
@JonClements No, two people of his extended family. She's lucky that she's really cute. :P
 
12:54 AM
Plus she bought really delicious beer today.
 
1:12 AM
I don't know if this question has a "real answer" or not but about how hot should a regular, midgrade, mass-market laptop get before you ought to do something? In tens of degrees centigrade.
Eight tens of degrees centigrade? Seven-ish?
 
when it hurts to put your hand by the vent
 
Anyone know of an xhtml parser with xpath support that will run on Python 3.5?
 
21
Q: Parse HTML via XPath

Tristan HavelickIn .Net, I found this great library, HtmlAgilityPack that allows you to easily parse non-well-formed HTML using XPath. I've used this for a couple years in my .Net sites, but I've had to settle for more painful libraries for my Python, Ruby and other projects. Is anyone aware of similar librar...

is that similar at all?
 
Similar but won't run on 3.5
I generally use lxml, which seems unsupported on 3.5
and BeautifulSoup will install but has no xpath support. The standard parsing libraries have only limited xpath support :(
 
> The latest release works with all CPython versions from 2.6 to 3.5
 
1:24 AM
@Firedrake969 Instantly or after a few moments? =_=;
 
probably near instantly
under a second
 
@Firedrake969 yeah I seem to be having trouble with the dependencies
 
what's the error?
 
needs two packages that don't seem to be in PyPi
guess I'll have to look around for binaries
 
what are the packages?
 
1:26 AM
libxml2 and libxslt
 
that sounds like apt-get type installs
 
yeah except I'm on a godforsaken windows machine
 
i suspect the top 2 links will be of interest
 
firedrake looks like he went one step further
 
 
3 hours later…
DSM
4:04 AM
I just used the new dictionary-merging syntax for the first time on a real task: pd.DataFrame([{**{"Name": k}, **v} for k,vv in d.items() for v in vv])
 
4:27 AM
Cool :p
 
4:50 AM
@DSM regarding the df1 df2 merge/add/concat.... the point is, I actually have two dataframes that are identical in columns, but rows may / may not be the same. I want to combine them, leaving some columns untouched (e.g. they are latitude / longitude which should not be 'summed') and others to be summed.
possibly the concat with a series of .pop().sum().. is the way to go?
 
5:37 AM
@thefourtheye happy that you are fine :). Yeah heard that it was very bad in sholliganallur ,velachery and those areas .It is said another storm is in the formation :(.
CBG all.
 
 
1 hour later…
6:43 AM
@DSM welcome to the Finnish language with its 14/15/16 noun cases. Meet -lla/-llä, the adessive case, with primary meaning of "on/by" (of location), and secondary meaning of "by/with" for tools. And i is the letter that you add because we're speaking Finnish, not Polish, and thus you need to have a vowel before the case suffix.
 
 
2 hours later…
8:42 AM
3
Q: Long roles have a Goldilocks problem

AirPictures being worth 1,000 words, here's a teams page as rendered by: Chrome (46.0.2490.86 m) Internet Explorer (11.0.9600.18015CO) For what it's worth, my idea of "just right" would be just adding a tooltip on hover to the former version. Too much dead space in the neighboring boxes of th...

Soo err yeah guys - that whale needs to join the team properly... he looks like a really cool chap to have hanging around :p
 
9:25 AM
@stackit err... that's a little rude?
 
@JonClements How come?
 
1) It can look a bit spammy rather than a genuine invite and 2) did you take time to read the room rules here?
 
ok so can we post rooms?
 
A room with just you in it I wouldn't really say is a room - and since you had a discussion at quite some length last Friday re: this subject - I'm not really sure what you're trying to achieve anyway?
 
@JonClements That was a different topic
 
9:31 AM
Okie dokies - well... thanks for the invite... I'm sure if anyone's interested they'll find ya!
 
 
1 hour later…
10:51 AM
I need re-write the "Code's compiling!" xkcd to read "Database is migrating!"
 
Then, when you're a pro - you can get an entire day off sword fighting with: "Code's compiling to migrate the database!"
 
11:17 AM
Road trip cabbage!
 
road trip - where what huh ?
 
Just got back from one.
 
DB query has been running for 30 minutes now ;___;
I wouldn't mind but it's about 10,000 rows, so not exactly Big Data(tm)
 
Not make a basic mistake like missing off a where from a join or something? :p
 
11:45 AM
No don't think so, <TECH-STACK> is quite good at syntax errors like that.
 
12:04 PM
Cabbage!
 
cbg!
 
In our open space office, there is some team that apparently has a meeting today. Unlike normal people, they didn’t get themselves a meeting room but do that out in the open.
What’s worse, they are having a lunch break now, and have placed sandwiches on various tables. I can smell them from my place…
 
cbg!
 
12:23 PM
cbg autobot
 
uh oh... does that mean we're expecting decepticons soon then @Sword?
 
I almost wish I had seen Decepticons on my road trip.
It would've been less awkward.
 
> - What have you tried so far?
> - IVE TRIED EVERYTHING
 
...THAT I COULD THINK OF IN TEN SECONDS, WITHOUT GOOGLING
 
the thing is i dont know where to start but i have tried looking on the internet — user3569752 2 mins ago
 
12:35 PM
@JonClements you could, i might need to do the needful in case nobody does it..
 
@vaultah that's amazing lol
 
Try harder… maybe? I mean, googling for “8 digit number random python” gives me this question and googling for “random color python” gives me this question. That should be something to start with, no? — poke 10 secs ago
There should be a course on googling somewhere.
 
But how would anyone who needs it find it?
 
@Ffisegydd Bing?
 
Make it mandatory in school
 
12:42 PM
@poke if it's an open meeting in an open office does that make their sandwiches open for you to eat?
 
@excaza Probably not, but maybe
Their excuse is btw. that they couldn’t get a meeting room for the whole day on short notice.
Because apparently, people plan meetings on the day they are happening…
… especially when external people are involved.
 
How do you plan a whole day meeting on short notice?
 
Exactly that I’ve been wondering.
@Jon Was that you? You spoilsport :(
 
Or maybe they had a meeting room, but the CEO in a "we only have cubicles, no offices" company was using it as an office without checking whether it was reserved?
 
IF YOU KNOW ANY CODE TO MAKE THIS PLEEEEEEASE HELP ME — user3569752 13 secs ago
HOLY SHIT
 
12:52 PM
This might be my favorite comment thread on SO
 
It's almost like SO has a reputation for being a "give codez" site. How very curious!
 
Cbg
 
1:07 PM
@vaultah So it’s your fault that I could submit my answer? :((
 
:o
 
Voting to reopen. Reason: So I can add an answer for rep!
 
Already closed the tab with the answer…
 
Reopen the tab and the answer draft should still be there, unless you discarded it.
 
@poke: look, somebody answered it! stackoverflow.com/a/33781036/2301450
 
1:12 PM
WHAT THE!?
I got a notification that I couldn’t reply any more?!
 
You shouldn't have refreshed the page :p
 
I didn’t refresh it
 
The window to submit answers to closed threads is 4 hours.
 
I was writing, and writing, and then that “derp, you’re too slow, the question is closed” bar appeared.
4 hours? For real?!
 
Yes
 
1:14 PM
I guess I’ll have to switch to airplane mode now whenever starting to write an answer.
 
20
Q: This answer was posted *after* the question was closed, how is that possible?

Tushar GuptaHow can somebody post an answer when the question is closed (marked as duplicate)? I see a question marked as duplicate 8 mins ago and someone posted an answer 5 min ago. This means the answer was posted 3 minutes after the question was closed.

 
I know that it’s possible, but I didn’t know it was so long.
 
ignores joke bait
 
1:30 PM
@poke "if your teacher is ill - you should get an extension then!" :p
 
This is a nice comment:
I love your optimism that simply naming a variable like the letter would make the computer magically know you meant that letter. This is not an insult, from a layman's point of view why shouldn't it work that way. It's kind of a nice window on how a new programmer would think. Anyway, well done for having a stab at it and coming for help with some code you've written, we often just get the assignment and "please do it for me" (Also +1 for naming your variable bacon - but please don't do this if you continue your programming career!) — Jamiec 3 mins ago
Also, that question shows the typical C# problem: One early, good answer, that is upvoted lots. And still people think they need to post another solution, and another, and another.
 
Today I want to reverse-engineer the 3D torus gif that Peter linked many days ago. Time to reinvent backface culling and occlusion culling.
 
@poke that's a very good comment indeed
 
The former is easy, if you can get the normal vector for each of your points; I don't know of a way to do the latter that isn't O(N^2).
 
C# looks like less convenient python
 
1:37 PM
Well, I could do Z-buffering, but then it's O(Nlog(N) * width_of_screen_in_pixels * height_of_screen_in_pixels), which might be worse
 
@Programmer based on exactly which observation?
 
I guess I was just looking at your answer. I hate defining types, so that would be the "less convenient"
 
Well, there are probably as many people who prefer static typing as people who prefer dynamic typing :)
I just do both.
 
What would be the best way of making this if statement loop only until all the "ifs" are met then move on to the "elses" so that my output is something like yes yes yes no no no
for k in d1:
    if k == yes:
        #print all the yes
    elif k == no:
        #print all the no
 
that example is not very useful
 
1:46 PM
since the keys in d1 are unordered
 
do you have literal 'yes' and 'no' strings?
you could just sort the list for example
 
In [3]: sorted(d1, key=lambda x: x != 'yes')
Out[3]: ['yes', 'yes', 'yes', 'no']
 
what if the list in not sort-able?
is *
 
Lists are sortable
 
I meant dictionary sorry
 
1:48 PM
create a list from it? (ok back to my corner now)
 
Okay @JeanP, what is d1?
 
d1 = {"Yes":239 "No":2, "No":233, "Yes":231, "Yes":5}
 
I'm not sure why that would prompt a question of "what if it's not sortable," because that's pretty sortable.
 
Dictionaries can't have duplicate keys...
 
You could definitely sort the dictionary that comes from that literal, though. :P
 
1:53 PM
Nope, because of the SyntaxError
That's an invalid dict literal
 
alright but humor me how could you "force" something to execute until all the entries are looped through before moving to the next condition? like if k == yes how could i make my for loop run until all the k == yes is done before moving on to k == no
 
True... ignoring the missing comma, then.
 
for x in thing:
    if x == yes:
        do_thing()
for x in thing:
    if x == no:
        do_other_thing()
There isn't really a way to do it with one loop. (if you don't sort)
 
Hmm okay ill work on using two loops. I thought i could try to do it with one loop
 
You can sort pretty much everything
 
1:57 PM
Apart from your life.
 
:d
 
wow that got dark
 
morning cbg fellow snakes
 
Morning
 
really? it's still quite bright outside hmm
 
2:08 PM
I think I need to template my greetings from now on to accommodate all our locations. %%LOCAL_TIME_GREETING%% cbg fellow snakes
 
@JeanP Your dictionary will still only contain two entries though - you realise that?
 
Made my gaming computer for only $250 hooray
 
2:31 PM
Is there a way to filter os.walk in the call? Or should I just do the filtering after the call?
 
Pretty sure you can use reduce/filter with a callback and a itertools.partial
 
Eh, it's a simple filter so I just did it as a list comp after the call.
 
I think people usually use glob if they want to iterate only specific filenames
I am too lazy to learn to use it myself though
 
stackoverflow.com/questions/33781659/… 1 more vote to put this one away.
 
Yeah, I've always meant to learn that.
 
2:35 PM
Bam, done.
 
:)
 
@MorganThrapp umm... thought os.walk took a callable as a filter
 
Heyo! Is there a magic method like __to_json__ to change the json output of an object/class? stackoverflow.com/questions/3768895/… seems to suggest there isn't one but that thread is quite old.
 
(although - these days - use pathlib if poss.)
 
@AwalGarg nope, I'm afraid there's not
Interesting, any idea why __self__ returns a new instance of the class? Seems like an odd result. — SuperBiasedMan 10 mins ago
Can anyone reproduce this? :/
 
2:39 PM
@vaultah Aww :( Thanks anyways!
 
@AwalGarg what would be serialized to json anyway?
 
@JonClements instances of a Token class representing tokens in an AST. I wish to store AST in a human readable form as json to a file.
 
a little vague
 
stackoverflow.com/questions/33780727/… dupe, but already voted before I found it
 
Done.
 
2:43 PM
@davidism don't say "dupe" - it just attracts that guy with the really cool avatar - must get the contact details of his designer cough :p
 
Hrmph. I have come to a difficult decision in programming... should I ditch a validation library for a better one, with the drawback that it does not provide automatic form generation?
 
is "dupe" not what the cool kids are using these days?
 
@corvid Which are you more annoyed by: having to do your own validation, or your own form generation?
 
@JonClements Ok. My lexer wraps lexemes from source as instances of the Token class containing the lexeme, meta data like position of the lexeme in source file etc. I want json.dumps(token) to convert token to "{"lexeme": "<lexeme val>", "position": [<line>, <col>]}" and discard everything else.
 
2:50 PM
@AwalGarg well, json.dumps will not do it for your object, unless you subclass from dict, or do a custom encoder/default.
2
Q: Method to serialize custom object to JSON in Python

fish_ballGenerally, we can define __str__ method to make str(obj) return what we want. But now I want to define my Model object to return a default JSON string when using json.dumps(obj). Is there any nice way for me to declare a method in the class to do this? class MyClass: ... def __json__(s...

 
@AnttiHaapala I'm thinking at this point - it's possible that @Awal should be looking at a base "I can JSON encode myself" baseclass, then use it as base for the nodes or whatever, but that's a wee bit lengthy for chat
 
@JonClements "I want json.dumps(token)...", and no you cannot make json.dumps(token) do that if not isinstance(token, dict) ;)
 
well, you could, and there's two solutions, neither nice
 
so what are the solutions :?
 
well 1) is obviously create a custom method, or 2) provide a default to json.dumps
(but as soon as you start storing not json types in json, you need meta-data and it gets nasty - we know that)
 
2:56 PM
@AnttiHaapala err, didn't look at subclassing from dict :/
 
@AwalGarg so at that point you cannot do json.dumps(x), you need to do at least json.dumps(x, default=func) ;)
 
Welp, this hammer needs to sleep after a 12-hour drive. Dupes are safe while I rhubarb... for now.
 
@AnttiHaapala ahh. I should look into that then. Thanks!
 
see the question above^
 
@AnttiHaapala and that default=func could even be default=x.to_json if needs be
 
3:33 PM
Welp my occlusion culling algorithm works but takes a full minute to execute. Not a fun time if I want to render a 50 frame gif.
 
You've gone 3d?
 
Orthographic 3d but yes
Or rather, I already did go 3d for spiral sphere but now I need much fancier features.
 
Conveniently orthogonal-to-the-z-plane orthographic?
I guess it doesn't matter if you aren't moving though.
 
Yeah the camera is permanently fixed at (0,0,0) and the viewport is permanently fixed at x_min=-1, x_max=1, y_min = -1, y_max = 1 and the viewing angle is permanently fixed at "parallel to the z axis"
None of which is much of a hindrance if I am careful to put my vertices somewhere viewable.
 
3:53 PM
I'm new to async programming and am building a scraper. If I take an http response that's been yielded and immediately parse it in memory, will my parser block the single thread that the i/o loop is using?
 
So, are you drawing something like a wireframe?
Sorry for probing so much, but a minute per frame is kind of high and 3d graphics are fun.
@AutomaticStatic I don't see why it would. Why not just do it and see if it works?
 
Well I know it'll "work", the question is whether it'll block the thread and impede the progress of the other http requests
If I parse within the same function that makes the request, that is
 
@QuestionC Not even a wireframe. Just points.
 
@AutomaticStatic If the parsing happens in the same thread as the http request loop, then they'll block each other. If not, then they shouldn't.
 
I don't have the benefit of a GPU or a low level language so natch on it being slow
 
4:00 PM
It's hard to say a lot about it without code though.
 
@QuestionC ok thanks. Still trying to figure out this particular io loop I'm working for the time being with but I'll try to segregate the parsing
 
DSM
Cabbage for all! Didn't expect to be using Python to debug a crash in C# code calling a C++ library I wrote this morning, but eh -- it's a Wednesday.
 
cbg, DSM
 
cbg all
 
@Kevin Are you basically using Z-buffering?
So in addition to the color for each pixel, you write its depth?
 
4:04 PM
No, I want the algorithm to run at the same speed irrespective of the rendering size, so I can't perform any calculations based on pixels
So occlusion culling is all done by projecting every polygon onto the viewing plane and then doing point-in-polygon checks on every point I want to render.
If the point is within the projected polygon, and if it lies behind the polygon on the z axis, I don't draw it.
 
speculation depth reached Sounds hard.
 
cbg
 
cbg!
 
Well, I'm rendering now. I'll share at 12:30 or so ;_;
The tragedy is that only a few points get culled, so the casual viewer wouldn't even notice the difference between the gif with culling and the gif without.
 
Missed the deadline again Kevin. What shall we do with you?
 
4:15 PM
But I'd know. I'd know.
 
4:35 PM
It's done! Oops, it's flickery and buggy. Into the trash it goes.
 
wtf "AttributeError: 'str' object has no attribute 'length'" "What's going on here?"
 
Here's the version without culling.
 
It looks like a very porous cheerio
 
the guy who answered comments on his own answer "pls accept if it solved your issue" gotta love it
 
That's pretty ordinary behavior if the OP comments "thanks this solved my issue" but doesn't accept
 
4:41 PM
Life's all about that SO rep hustle man.
 
You're a wizard Harry Kevin
 
I keep noticing new weird broken things about that donut.
 
Ugg getting a value of 3.26 when the required value is 3.38 :-(
 
add .12 magic
 
Lol, but the process is some prediction stuff... So need a better accuracy ;)
 
4:53 PM
Some of the dots appear to grow or something. That's all I notice if I really analyze it
 
Yeah that's intentional. Each dot's size is inversely proportional to its z coordinate.
Same trick I used in Spiral_Sphere to give the illusion of depth.
@QuestionC The only thing that really bothers me, and which occlusion culling was meant to fix, is the overlapping area where the back half of the ring meets the front half.
 
That's the thing I was noticing. Where you can see "through" the toroid.
Is the color saturation fading intentional though?
 
Those should not be visible.
The color fading is intentional because without it, the points pop rather abruptly out of existence when they turn around the edge.
 
Time for a virtually impossible to reuse isBehindFrontHalfOfTheToroid()?
 
Guys, one issue, I want to change something in the code of an installed module
how do I do that
case: I have pyparsing installed on a python3 environment
 
5:02 PM
Here it is without fading.
 
DSM
Does anyone else find their ribs hurt when they sneeze? Intercostal muscle strain? No? Just me? Okay.. #notasgoodasioncewas
 
The occlusion problem in the center is much more apparent, too
@DSM, yes, but only for medium-to-large sneezes.
 
but it uses file() to open the files I would like to change it to open() and then use it
 
Pff why oh why does blender/3d modelling software have no support for standard CAD software.
(and vice versa)
 
@Sudh, I don't suppose you could find the pyparsing.py file and modify it with notepad?
Or pyparsing.c or whatever language it's written in.
 
5:03 PM
I can and I have
but it doesnt reflect when I use it from outside
it's somehow using the same older unedited version
do I need ot do something specific so that the egg stuff is updated?
 
Hmm, I don't know.
 
@DSM Happens many times, especially during cold weather.
Wow got a better expected value, 3.36 when the accurate value is 3.53
 
time to add rib pain to the big list of things you wouldn't expect to be a common human experience, but are.
I'll put it right under "during road trips as a child, you imagined a little man running along side the car and jumping over obstacles, and/or sliding on top of power lines"
 
What about ducking when driving under a bridge?
 
How about holding your breath when you're watching a movie and the characters dive under water, to see if you would have died if you were in that situation?
 
5:17 PM
Once you're finished composing this list, we'll get Seinfeld to read it with an obligatory "What's the deal with" before each entry.
 
ECC
How to get absolute file path from an Windows Service in Python?
 
Rise of the planet of the apes => Dawn of the planet of the apes => morning of the planet of the apes => afternoon of the planet of the apes?
 
sys.path.abspath
 
ECC
Thanks @Kevin
I will try
 
@corvid You jest, but "Twilight of the Planet of the Apes" would be a pretty good premise.
 
5:28 PM
The __file__ variable almost always contains the absolute path @ECC
 
I assumed Twilight was coming when they used Dawn.
 
os.path.abspath(__file__), if you want to be careful
 
ECC
This code does not work with service windows, @vaul
And the file not works too...
 
Okay, I don't understand your question
 
ECC
I have an windows service in python.
And I need to read an certain file that is in directory of my service.
 
5:32 PM
I would help more, but I am on mac right now :\ pretty sure __file__ should be defined though, two underscores
 
ECC
ok, thanks @corvid. :)
 
That SO question just got an answer, so I guess our job is done.
 
stackoverflow.com/q/33786343/400617 unclear first question, too broad second
How the heck did the first one get four upvotes?! I'm suspicious.
 
00:00 - 18:0018:00 - 00:00

« first day (1859 days earlier)      last day (3093 days later) »