« first day (2315 days earlier)      last day (2631 days later) » 
00:00 - 19:0019:00 - 00:00

12:33 AM
Wat
 
1:29 AM
cbg
 
mocab
 
2:04 AM
Hello from 270m above Kirkwood.
 
:O
that's awesome!
 
2:17 AM
Wow. Beautiful.
 
And here's the frozen meadow behind the house.
 
What are those houses in the distance?
 
Just peoples' houses. Ours is behind in this pic, it's literally across the street from the lifts.
 
you must be having a blast
 
Houses as in tourists hangout or people live there?
 
2:31 AM
Live there. A bit sore, but yeah. It was only my third time skiing but I got some good practice in.
Going to sign off and help with dinner. Rhubarb.
And by "help" I mean "drink and give advice".
 
rbrb! 😀
enjoy @davidism
 
3:03 AM
does anyone have any experience with arch or any form of linux? I am trying to set up LAMP stack with python
but can only make php work.
 
OP is about to change the question :P
 
3:29 AM
anyone able to take a look at this q? stackoverflow.com/questions/42261467/…
the accepted answer is wrong and upvoted - django shouldn't serve static in prod
 
wim
3:42 AM
ugh, I hate when guys accept some lazy and wrong answer
downvoted !
 
Thanks @wim!
The answer was at 2+ when I noticed, didn't want it to get any more momentum
 
wim
"thats only for heroku" ...
guy is an idiot
 
ugh now he's defending his solution
oh well, hopefully OP comes back and reads my answer in the future
> The one you selected is garbage
savage
 
wim
4:17 AM
I think the way the whitenoise docs have commented out the django middleware has misled OP
probably they shouldn't have wrote the example like that
 
yeah or maybe the phrase "... above all other middleware apart from Django’s SecurityMiddleware:"
 
4:35 AM
 
5:31 AM
cbg
 
 
1 hour later…
6:54 AM
Is it a good idea to define __init__ in child if it just calls the parent class? For example:
>>> class p:
...     def __init__(self):
...         print("Parent")

>>> class c(p):
...     def __init__(self):
...         super().__init__()
...
I know we may skip redeclaring the __init__ in child. But I think it provides readability. Any opinions?
 
@BhargavRao suomi mainittu, torilla tavataan (alt) :P
 
7:07 AM
cbg
 
7:19 AM
CBG
 
@MoinuddinQuadri yeah, it may provide readability. Also, who knows, you may want to actually add something to your __init__ in the future, it will be there for you
 
What's this CBG thing anyway?
 
ah, ok
 
7:35 AM
Cabbage!
@AnttiHaapala Lol, Yeah. Finland looks huge there :D
 
Comparing population of Indian states to that of other countries.
 
8:10 AM
Cabbage
 
Cabbage \o
 
@AnttiHaapala Here's a modified version from the xkcd forum thread that shows the time zones: dl.dropboxusercontent.com/u/91011134/…
 
[In]: BeautifulSoup("<t1><t2>blah<t3>blah2")
[Out]: <html><body><t1><t2>blah<t3>blah2</t3></t2></t1></body></html>
It is closing t2 after t3. How can I get this:
<html><body><t1><t2>blah</t2><t3>blah2</t3></t1></body></html>
 
@PM2Ring :P
 
@MoinuddinQuadri My opinion: don't define that redundant __init__ method. It just adds clutter. Anyone reading the code ought to know that the class inherits methods from its parent(s) if they aren't redefined. IMHO, explicitly defining an __init__ that merely calls the parent __init__ makes the code harder to read because I have to read it & figure out that it's redundant. Also, it's less efficient because it adds an extra layer of method call.
 
8:22 AM
@MYGz you can't
@MYGz because beautifulsoup uses html parser, and gives the correct result, yours would be incorrect. close them explicitly.
thus: pebkac error
 
8:56 AM
Will have to do with re then
 
@PM2Ring I saw this as the part of code-review which I am doing right now. I personally didn't liked the idea of doing this. I needed enough reasons to support me before I comment. You gave me enough ;)
 
@MoinuddinQuadri Excellent. :)
 
A review of review.
Which calls for code.rereview.com :P
 
9:16 AM
cbg
 
Cabbage :-)
 
a round up help
 
Martijn just used the phrase Pokemon Exception Handling. I've never heard it called that before.
 
@PM2Ring I think it was mentioned in Jeff's blog some years ago.
 
Ah.
 
9:29 AM
Cabbage!
 
Cbg
 
So… I’m getting random notifications from proposed changes on SOD. What can I do!?
Interestingly it’s just a single topic.
Oh, found a “unwatch” button.
 
Oh, Thanks for that!
I've contributed to only 2 pieces of docs, but I get 5 notifs everyday :/
 
@MYGz When you edit a question, please try to fix all the obvious problems, like i instead of I, and don't forget to improve the title if you can. Of course, you don't want to change it so much that it conflicts with the author's intentions, but do the best you can to make it look more professional.
 
Related read for that ----^ stackoverflow.com/help/editing
 
9:37 AM
cbg, all
 
Cabbage @holden \o
 
Didn't notice, the bad indentation was popping out :D
I do try to fix what I see erroneous, but sometimes in a jiffy I skip few things.
 
No worries. We all miss stuff.
 
> The product design team then did a design sprint. Each designer created their own design of the top nav and then converged to critique and identify the strongest ideas. The team then combined the best parts of their ideas into one design.
If that’s how the SO team works, then I’m no longer surprised we ended up with SOD.
“You all build whatever you want, and then we combine all these ideas into one thing” – And here I was thinking you would start with some kind of requirements engineering…
 
@PM2Ring But reminders are good, I'll scan more next time :)
 
9:43 AM
@poke The Frankenstein-Committee approach to design.
 
heh
 
@PM2Ring Perhaps a better title in context to what OP was asking.
 
@MYGz It is, but you've changed its meaning a little. Originally it was asking about one-lining try...except, but that was ultimately an XY problem. You have improved it, but I'd be cautious about doing stuff like that. But don't change it again, it's fine as it is, and it's certainly more likely to help future readers this way.
 
9:59 AM
Implementing try except block in 1 line would make more sense, but then it should have a positive or negative answer to that, since it doesn't and its closed, it's no point inviting future readers there.
 
10:22 AM
cbg
 
cbg again
need some help
i want to round up and round down the values
when i use math.ceil()
for example math.ceil 26.6457209816456 round to 27 okay its correct but when the value is 13.157306650486458 it round to 14 instead of 13
i want 13.5 round to 14 and 13.4 round to 13
 
ceil will give u only higher value
use floor function
math.floor(x)
 
math.floor(26.6457209816456) converted this to 26.0
instead of converting it to 27
 
use a conditon statment
 
Just use round(number)
 
10:33 AM
thanks @MYGz it works
 
.5 and above will be ceiled, less than that will be floored.
 
math.ceil and math.floor did not work
thanks again
 
cbg
 
o/ cbg
 
10:44 AM
anyone having experience of deployment of apps in pythonanywhere.com?
 
@SohaibAsif I disagree: they work perfectly, they just don't do what you want them to ;-)
 
actually they work but they dint work in terms of Sohaib's Condition:)
@JRichardSnape are you the the great Professor Snape
 
@SohaibAsif For certain definitions of great.
Morning all
 
Morning Prof
 
like in harry potter
 
10:58 AM
its eveng here
 
@JRichardSnape morn, severus
 
Ohhhhhh, Harry Potter, I was wondering....
;)
 
How are you @antti?
 
11:05 AM
That very image is the one I use in my first lecture to any new class :)
With my furry face morphing onto it, of course.
 
severus snape morphs into hagrid :P
 
'zackly
 
lol
I want to see that
 
It's a new plot twist
@poke I'll dig out the slide and make it into a gif. Just for you :)
 
yay
 
11:14 AM
cbg o/
 
hey @manuzi1
 
11:56 AM
cbg guys
is it possible in python to achieve something like this:
def get_class(name):
    class NewClass(object):
        name = name

    return NewClass

get_class('test')
?
 
have you tried?
 
guess?
 
it is
 
how?
 
@marxin I’m guessing you haven’t tried to do it.
 
11:59 AM
yes I tried
 
…and?
 
NameError: name 'name' is not defined
 
I was wrong
 
And what does that tell you?
 
I guess name is in different scope
but the question is how to make name available in inner scope
 
12:00 PM
In a expression name = name, what do you think would happen?
 
__dict__['name'] = name
or NewClass.name = name
 
class NewClass(object):
    name = name
name can only refer to one thing here.
And that one thing is the class member.
Which is not defined yet
 
it is defined in outer scope
 
So if you want to refer to the name outside of the class definition, then you will have to give it another name.
@marxin A name cannot reference two different things at the same time though. By making an assignment to name, the name "name" is being bound to the class definition scope.
def get_class(name_value):
    class NewClass(object):
        name = name_value
    return NewClass
 
yeah I suppose so
I don't like it but this is how it is
 
12:13 PM
 
at some point even SO is not a solution
 
@MartijnPieters XY problem
 
@poke While that is true for class namespaces, there are other similar cases where it's not.
For example, inside a method the code self.name += 1 can result in the creation of an instance variable initialised from a class variable of the same name ...
... so misunderstandings like this aren't unusual, I'd say. There are some differences between class scoping and function scoping, and they aren't really well-described or even that well-known
 
TIL that there's a newer series of Hellsing (the anime). Guess I should rewatch the original and watch the newer ones
cbg
 
for me name = smth in class creation feels more like parameter which is gonna be used in class creation, similarly like you can call function func(test=test)
but maybe thats just me
 
12:28 PM
@marxin that happens quite often. I feel like I can't ask questions any more. When I am having trouble, I am unable to MCVE.
 
i watched naruto
 
Guys, could please someone help me with this answer: http://stackoverflow.com/a/42246860/1379826
In `mask`, how do I assign multiple criteria? For instance `df.xs('b',axis=1,level=1) < 0` OR `df.xs('b',axis=1,level=1).isnull`?
 
i was thinking of watching hellsing
 
It is unrelated with the question, and I think it is probably too easy to post another question :(
 
or fullmetal alchemist
 
12:30 PM
@SohaibAsif please watch fullmetal alchemist, it is really very nice!
 
FMA is great
 
it was one of the animes I loved the most
 
there's two of them
 
cbg
 
Do FMA have tragic moments
coz i prefer these kind of anmies
 
12:35 PM
@marxin Yes, except that smth was the same name as you assigned to in your case.
 
@SohaibAsif you'll love it
 
@SohaibAsif Watch Kanon (the 2006 version)
 
@poke I know what happened but Im just saying that I dont like it
 
@SohaibAsif yes, FMA has tragedy
it's one of those animes that gets to your heart
and given that it's not so big (well, compare to Naruto), you'll think it's great for the size
do give it a try!
 
have anyone watched grave of fireflies
i have in my laptop but i dint get the time i am thinking of watching today
 
12:50 PM
I did too, it's so sad
 
1:29 PM
(I too received a slew of messages informing me about irrelevant updates to a page of interest, and so cancelled all updates)
 
1:44 PM
@marxin Apart from the name issue, that code is a bit weird. You create a class in the local scope, giving it a single class attribute, return the class object, then throw it away. There are legitimate uses for class factories, eg making namedtuples, but this doesn't look like you need a class factory here. I think you have an XY problem. What are you really trying to do?
@holdenweb I don't do SOD, but that comment seems fair enough to me.
 
Yeah, well, I'm trying to improve it from the outside ... I'm not particularly interested in getting more involved than that.
 
Morning
 
@WayneWerner Cabbage
 
It was below freezing last night. It's supposed to get to 70ºF today
wheeeeeee!
22 hours ago, by Wayne Werner
This is probably the first projection in cartographic history that can be criticized for its disproportionate focus on Finland, Mongolia, and the Democratic Republic of the Congo.
Apparently timing is everything :D
 
I saw that too
then again I also linked to the meta post present in PM's pinned message:P
 
1:56 PM
Damn. That would have made my flights to Iceland so much cheaper ...
 
@WayneWerner Did you see the modified version with the timezone lines?
 
@PM2Ring No, I haven't. That would probably actually improve the map ;)
 
I linked it in reply to Antti's post. I'm on my phone so it's a bit painful to relink it.
 
Now it just needs captions ;)
Then I'd print it out and post it on my wall... in theory anyway
 
And the straight bits that intersect political/timezone boundaries to follow the border, if we're really picking nits ...
 
2:10 PM
Randall must enjoy creating unusual maps. One of the posts in the forum said it's his 78th, IIRC.
 
wow. That's impressive
 
It needs to be an anim, to show daylight saving changes ; I think someone on the forum may be working on that.
 
\o cbg
 
they'll have to shift Arizona
 
This guy obviously hasn't heard of Bobby Tables stackoverflow.com/questions/42275971/…
SQL injection doesn't get much more blatant than that.
 
2:26 PM
Maybe not, but that isn't a parameterizable SQl query
In fact, it's a bit like the SQL equivalent of creating dynamic variables in Python ...
 
Ah, OK.
To be honest, I don't know a lot about SQL, but it looked dangerous to me.
 
Clearly the OP should use one table where what is currently a table name becomes a key field. but the OP is probably struggling to use a bad database design ...
Any SQL query that unhesitatingly incorporates user data is a potential problem
Unfortunately SQL doesn't allow table names to be parameters of the query (doing so would negate the point of query preparation, which is to allow re-use of previously-computed execution plans).
That, of course, entirely leaves alone questions like "why do you iterate over the input to create a list that your function then iterates over?"
 
TIL the continent is called Oceania (?)
and some hipster time zones there
Australia even kills time :|
 
That feeling when you find an OP where all his question is based on Django and pretty much most, if not all, is covered in the django tutorial/docs ....
 
I blame kangaroos
 
2:38 PM
I remember reading a Reddit thread about people living on the border of 2 timezones... was rather interesting to see people "travel back in time". I wonder how badly that messes with you....
 
umm...not at all
They don't actually travel back in time, you're aware of that, right? :|
 
yes... I know...
 
I imagine people in that condition pretty soon become habituated
 
Anyone who flies Eastward and lands before they take off is pretty aware that time is an illusion
 
but it seems weird that you can wake up at say 8 am (home's time zone), go to work only to arrive at work at 8 am (work's time zone) for a over simplify example.
 
2:40 PM
they might have the worst case of DST lag on the planet, but otherwise it shouldn't be that hard to get used to
@MooingRawr but you leave work at 4 and it's already 6 when you get home
 
exactly.... which is so loopy...
 
okay
 
I would rather wake up and leave at 7 am, get to work at 9, go home at 5 and arrive home at 5.... trick myself into having more time to do things
 
That would, however, also mean that you could leave at 6pm and get home at 8pm, so it might be worse ...
Than again, working long days always sucks
 
IDK man... time zones aren't my thing :( I know what it is but I don't usually have to deal with time zones ... /jokingly
 
2:43 PM
How about Unicode?
Without time zones and Unicode problems can be much easier to "solve"
 
sometimes unicode is confusing, but then I remember I should just use Python 3 instead of 2.
10
 
...which is a good thing to remember
Cabbage.
 
\o cbg Byte, how goes it
 
Tired from university, but still enough stuff to do.
 
2:50 PM
@MooingRawr you can use Python 2, just don't tell anybody else
 
@khajvah but I couldn't live with myself knowing that I'm using Python 2 over 3 ... The only time 2 is acceptable to be used, is legacy code that your boss would not upgrade; and the solution to that is to find a new job...
 
@PM2Ring this code was only a snippet, real code returns fully functional class
 
3:06 PM
Is it acceptable to answer a question using a function from another question as part of the answer, of course sourcing the link and copy and pasting the function from the other question?
For example I want to answer a question, but there's a function that would help me answer the question easier, (the function doesn't directly answer the original question, it just aids in answering). Is it acceptable for me to source that function and copy and paste it in my answer ?
 
@MooingRawr Sure, but you must give attribution and you should link to the original.
 
Of course.
 
And of course if the new question can be closed as a dupe you should do that instead.
 
the new question is asking why it's not working, giving some effort. I want to explain why using the function of another answer. That function of another answer is a trace function.
 
I also leave a comment on the original to let the author know.
 
3:10 PM
k
 
Although there's the danger that the original author will write a better answer than yours. :) That happened to me a few weeks ago.
 
I'm fine with that. I've deleted some answer cause better ones came along. I don't mind that
What I do mind is when people downvote me and don't tell me why. I don't mind the neg reps but I want to improve so feedback....
 
@WayneWerner that led me here, intresting
 
3:28 PM
@AndrasDeak also conveniently enough there's pip install bcrypt
which is as hard to use as this
 
cabbage roomies
 
import bcrypt
hashed_pw = bcrypt.hashpw('Password11'.encode(), bcrypt.gensalt())
 
Nice, I don't want to change my password every 3 months. bcrypt ftw, 12 years is fine :D
the shittiest password I ever saw was: "123456" (my isp guy keeps it for new accounts) and many people don't change :D
What is the biggest number that can be expressed in three figures?
If you are googling shame on you! Don't!
 
3:49 PM
cbg
 
\o cbg antti
 
None gives a damn. I'll self answer then :P
 
@MYGz 9↑9
 
@MooingRawr Got it! You get 10 bucks. 9^9^9 is the answer :P
 
4:05 PM
z↑ᶻz (Knuth up-arrow notation, base 36)
Which is ... quite large.
 
What's funny is the number of sites that allow Password123 as the password but x*42j81 is out, because there's no capital letter
 
@ZeroPiraeus Ah! Whats z?
 
wim
@AlexL +1 good boy scout
 
The largest digit in base 36. Equivalent to 35 in decimal.
 
4:13 PM
cbg
 
cabbage party
 
that can be expressed in three figures and any number of notation?
 
I got the stone for the soup \o/
 
I say 999 (in base googolplex)
 
Just spent three hours rubber duck debugging and now I am ready to look at funny cat pictures for the remainder of the day
 
4:14 PM
@AnttiHaapala I took it as 3 characters including notation
@Kevin what's rubber duck debugging ?
 
@MooingRawr google
 
google elgoog...el goog. El Goog!
 
Oh it is a term... I thought it was a Kevin term, didn't bother to look it up.
 
@MooingRawr You explain what your code does to a rubber duck (or similar object) until you see yourself what's wrong.
 
It's explaining one's problem in precise detail to a silent audience in the hopes that organizing your thoughts clearly enough to express to another human will give you insight into the problem itself
 
4:16 PM
I got it from wiki, I should bring in something to rubber duck....
 
ℵ₉₉₉
 
I usually use an imaginary duck because my desk space is at a premium.
 
wim
@MoinuddinQuadri disagree. it is pointless, less efficient, and degrades readability
 
In this case, I used the C# room, who contributed only nominally
I successfully ended up replacing one dirty hack with a less dirty hack.
 
Hi @ZeroPiraeus, Long time no see. How have ya been?
 
4:19 PM
Demoting it from full WTF to faint code smell
 
Muddling along.
 
:o it's a Zero
 
haleyjoelosment.jpg
 
4:36 PM
is fatter than Bruce Willis, but approximately as bald
 
#lmao Zero
 
4:55 PM
I've discovered how painful stateful parsing is, and now I'm wondering if I should just replace it it all with a regex
This was as clean as I managed to get it
 
so many homework dump questions today...
 
5:20 PM
@AndrasDeak And that led me to codahale.com/foss-and-male-privilege which is kind of depressing
 
cbg
 
cabbage @khajvah
 
cbg
 
5:39 PM
#rhubarb, all
 
@holdenweb Rhubarb
 
rhubarb holdenweb
 
6:02 PM
from bs5 import BeautifulSleep

sleep = BeautifulSleep(self, parser=['pillows', 'bed', 'blanket'])
while not morning:
    try:
        sleep.find('sweet_sleep')
    except (BadDreamError, RollingError, ThirstyThroatError) as e:
        dealwithit(e)
Rhubarb
 
After all this time I still can't use classes
 
why @Orange
 
Keyboard is missing the C key.
 
@marxin i've never used them, nor "init" , self etc..
 
hehe, you can always remap L to C
 
6:06 PM
So reading some examples is a little tricky
 
But if you map L to C then when you write "class" it will write "ccass" instead
 
ok, so A to C
 
This is like trying to push the bubble of air out of a piece of wallpaper.
 
if someone would be more future looking, should remap D to C
@Orange dont worry, if you dont need classes then its fine I guess ;)
 
Classes are basically just dictionaries with more convenient value access.
 
6:12 PM
Would probably make what i'm doing a lot easier..
 
Why write d["foo"] when you can write x.foo?
 
Oh!
I've used it once by mistake, REALLY easy to use when all i did was hold some vars in it
I think i'm making it more complex than it actually is
 
Classes are pretty a la carte in the sense that you only need to include the parts you're actually going to use.
Yes, you can create classes which you can hash and serialize and compare to other types using < or > or ==, but you can also not do any of those things.
 
I used it to hold some information about a connection and then shoved the location of the class into a dictionary
Don't tell me i'm doing it wrong because it works for now ;)
 
Nothing wrong with using classes just to hold plain old data.
 
6:18 PM
POPOs (Plain Old Python Objects)
 
rb
 
lol
 
6:41 PM
@AndrasDeak thoughts:
salmiaki came up and then I thought of this
and I remember you had spoken about it with Antti
 
droooool
 
pretty good licorice there
 
My SO works at a candy store and I have tried that stuff several times. I can't possibly enjoy it.
 
wim
licorice is disgusting, end of story
black jellybeans should be deported
 
6:58 PM
I remember using licorice (the long red ones with a hole in the middle) as a straw for my juice, and what not, when I was little...
I also remember nomming on them while watching baseball... so I think licorice is alright...
 
00:00 - 19:0019:00 - 00:00

« first day (2315 days earlier)      last day (2631 days later) »