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

8:00 PM
On the whole I regard this as a positive outcome.
 
@Ffisegydd Apparently there's no gif of this that I can quickly google, but I wanted to respond with a clip of David Mitchell ranting on an episode of QI about eating bread and milk being "Demonstrably FINE"
 
I live in a neighborhood with a ton of kids, I'm half considering handing out shooters to the parents. If only I were rich. :/
 
Morgan you'd be the neighbourhood hero
 
it's one of the clips from youtube.com/watch?v=-6vLp07ZePY
 
This was referenced in the office today, such a good skit.
 
8:02 PM
@idjaw The only issue is it's like $2 a pop if I want to get something non-terrible.
 
no one will complain about free jello shooters
 
Plus, I have to stop myself from drinking them.
Oh I was thinking more like these.
Are those not called shooters? That's what I've always heard them called.
 
A salad shooter is some kind of made-for-tv device that they sell at 3 AM.
Handing them out would be expensive, since each one is three easy payments of 19.99
 
I was always under the impression that a shooter was always some kind of juice with alcohol that you shoot...and a shot is the straight alcohol.
@MorganThrapp internet to the rescue
 
8:06 PM
Huh, I stand corrected.
Also, I really wish this were a syntax error instead of silently breaking everything.
foo = [
    'bar'
    'baz',
    'bat'
]
 
Second Hedberg reference in the last 48 hours. It's been a good week.
 
Who?
 
See Morgan's message at chat.stackoverflow.com/transcript/message/26597602#26597602 for more information
 
DSM
@MorganThrapp: I'm torn, because string literal concatenation comes in handy. But I've made that mistake too. :-/
 
@DSM I dunno, I've never actually used it.
Intentionally that is.
 
8:09 PM
foo = """
bar
baz
bat
""".strip().split("\n")
Sometimes I will do this because I can't be bothered to place quote marks on every line and have commas etc etc
even though the total amount of quote marks is six either way, in this particular example. The savings are better for longer strings.
 
I'd even be happy with PyCharm having an inspection for it.
 
DSM
That's a good idea.
 
@DSM I think the compiler used not be smart enough to optimize 'abc' + 'def' to a constant. But it is now, so the other way should die in a fire.
 
Hi ppl.
 
cbg, Belle.
 
8:12 PM
Hello.
 
potato :)
 
Potatoes. Now there's a fun Halloween treat. Apples are so passe'.
Potatoes are like zombie apples that rise from the grave. The french word(s) for potato translates literally to "apple of the earth".
 
I would actually be totally okay with that. I like raw potatoes.
 
DSM
Potato sandwiches are unexpectedly tasty.
 
@Belle Banana. Potato?
 
8:16 PM
@DSM Do tell. That sounds delicious.
 
Harvest is a holiday made by Big Potato to fool the masses.
 
Bean :(
 
Sprouts.
 
Laurel
 
8:16 PM
wat
 
That man shouldn't be so rough with that limbless headless cow. Its life is hard enough.
 
It's Big Potato.
 
big potato is big
 
DSM
That is true.
 
Thank you, tautology man.
 
8:17 PM
I see we're getting closer to spherical cows though, which will be quite useful for physics demonstrations.
 
Are potatoes really that big?
 
@Kevin Yeah, it would float off if he didn't have his foot on it.
 
Maybe it's an optical illusion. Like when people pretend to hold up the leaning tower of Pisa.
 
I think he's a leprechaun.
 
Vegetables that large don't have as much flavor, I'm fairly certain. There are 2000lb pumpkins but they are mostly made of water
 
8:19 PM
yeah or photoshopped..
 
DSM
Ugly bags of mostly water.
 
True @Programmer...hard to chop and cook too
 
@DSM does that matter when mine is bigger than yours?
 
(not as gross as the title suggests)
 
My girlfriend's college is doing a staged adaptation of that in a month or so. I'm... curious.
 
8:21 PM
@Kevin isn't there a video for that too?
 
Quite possibly. Wouldn't be too hard to act out, given that it's just dialogue.
 
yes.. I knew that looked familiar
 
Bit weird to have actors made of meat playing the characters, but w/e. Oh hey, it's the cash cab guy.
 
They save money that way. The non-meat-made actors charge too much.
 
DSM
If ever there was a role for computer animation, you'd think that would be it.
 
8:26 PM
This video is doing a good job of demonstrating the inherent grossness of physical existence.
 
stackoverflow.com/questions/33444393/… too broad - the codeseses...gives it to ussss
 
I have done poorly with my cheese and crackers. I have four pieces of cheese left, but merely one cracker. I am shamed.
 
DSM
Let the public mockery begin!
@idjaw: that.. does not demonstrate research effort.
 
ha
he literally took screenshots of his assignment
 
8:28 PM
my palm cannot face any harder
 
@DSM @tzaman I think that is THE post that needs to stay "pinned" for examples on meta when this topic keeps coming up
 
@AdamSmith Wait, that's an issue? You have too much cheese? That's a thing?
 
DSM
@tzaman: one of my all-time favourites was a guy who took pictures of his exam with his phone and asked a question during it. But before he sent the pictures he signed his name to the exam sheet. I gently suggested to him in the comments that he might not be suited to a life of crime.
 
wow
 
gold
 
8:30 PM
Also, new band I just found that I'm really enjoying. airplanemo.de/music
 
26
A: Speed up bitstring/bit operations in Python?

casevhThere are a couple of small optimizations for your version. By reversing the roles of True and False, you can change "if flags[i] is False:" to "if flags[i]:". And the starting value for the second range statement can be i*i instead of i*3. Your original version takes 0.166 seconds on my system. ...

 
Slightly industrial with a hint of techno.
 
@DSM I'm a...what's the opposite of soft-spoken? I'm one of those. I was once told by a teacher in high school that if he were going on a covert operation, he would not invite me along.
 
awesome answer
 
Remind me a lot of Porcupine Tree if anyone knows them.
 
8:31 PM
cool story bro. – Phillip Ellis 13 secs ago
hahahahahaha
 
hahaha
@AdamSmith you might be able to make some coin here.
 
He needs coin to buy some more crackers.
 
well that was fun while it lasted.
 
haha
 
Let's undelete the question so we can mock them some more!
3
 
8:34 PM
On second thought
according to his SO profile he's going for an Associate's in Comp Sci
We'll see how that works out for him.
 
I have a question. Suppose I have two different functions for a given class and I use the output list (say list A) of the first function as the input list to the second function whose output is list B. Then how should I use the list A I got in second function? I got an Attribute error for using the list A in function2 . It says the class has no object 'list A'
 
DSM
"write a program that asks the user to enter five test scores" has lots of hits on google.
 
@Belle call func1 inside func2
hey he got a badge though! "Peer Pressure"
 
@AdamSmith will try that :)
 
8:37 PM
Delete own post with score of -3 or less
 
I want that badge, but I don't have any posts with a low enough score. #HighRepProblems.
 
I got Peer Pressure recently.
I totally misread a question...it was late
I got bombarded
zerg rush
 
@MorganThrapp Post an obviously wrong answer. Like @idjaw here!
 
learn from me! I'm good at being wrong
I can hold tutorials on Wednesdays
 
proud owner a freshly minted badge
 
8:41 PM
can anyone help me regarding perl script?
 
probably not since this is Python not Perl
but maybe?
 
not able to find perl group
:(
 
No, we can't.
 
@user3287223 Not to be overly snarky, but have you looked at the room title?
 
This is the Python room.
 
8:42 PM
i am new to scripting
 
then you should switch to Python!
 
That's all well and good, but that doesn't make it on-topic for the Python room.
 
and heard that perl is basic and python is advanced
 
@user3287223 That's great. We still can't help with perl.
 
you are being utterly off-topic here, maybe even a bit insulting
 
8:42 PM
whoever told you that is umm
 
eeek I don't know who told you that
 
reallllly wrong
 
But don't listen to anything they say about programming ever again
 
oohhhh
then
 
Yeah, that's exactly that opposite of what I would say.
 
8:42 PM
whats d difference?
 
python is infinity times easier than perl
 
Perl is old and Python is new...*er!*
 
@user3287223 They're different languages.
 
srsly?
 
I'd suggest starting with a tutorial
 
8:43 PM
i will learn python also then
 
we really can't teach you Python here in chat
 
So which is valued more? Python or Perl
 
but by any cance u guys can help me with me not able to run perl script?
 
@user3287223 No.
 
8:44 PM
asking coz ppl keep saying learn both
 
@Belle Python has far more industry adoption these days
 
Oh..
 
most modern shops don't use perl at all anymore
 
looks like noone is gonna help me here
:(
:)
 
@user3287223 not with Perl, no we're not.
 
8:44 PM
@user3287223 yeah, cuz this is the python room
 
@user3287223 try the perl room
 
And honestly it's starting to get a bit trolling now, so please don't ask again.
 
what about javascript then?
 
js is useful if you're doing browser-y stuff, but it's still off-topic for this room
 
What about random.choice(set(ALL_LANGUAGES) - set(Python))?
 
DSM
8:47 PM
Heh.
 
I'm a good devlopper.
 
Wow. Such noob.
 
Way to make my comment irrelevant.
 
@PatrickMaupin Something something comments are ephemeral.
 
Don't worry, those of us here that saw the Great Python Set Morgan Mistake Of 2015 will remember...always...
We will congregate every year, on the anniversary of the this day, to mock Morgan Thrapp with a 364 day mocking festival.
 
8:50 PM
At least this is the only time. I can live with once a year.
 
And also anyone who looks at the edit history of that message because they had to step away for a second
cough
 
Can non-ROs see Edit History?
 
Yes
If only because I'm not an RO and I can see edit history
might be a reputation privilege?
 
Nah, you can always see it.
Grrr, one of these 13 tables uses a different naming scheme. Now I can't generate the names easily.
 
Perl, as I wrote the other day, is a legacy language
 
8:56 PM
It's deleted posts that can't be viewed by non-RO actually.
 
@MorganThrapp sure you can, just make a 1:1 conversion
 
@JoranBeasley Pester me all you like, I'm old and can't remember a yamming thing
 
Anyways, rbrb all. Time to go home and eat pizza and get drunk. :D
 
9:03 PM
cheers Morgan
 
@holdenweb cbg
 
alright....time to go sacrifice some pumpkins....rbrb all
 
@idjaw is it actually sacrificing or just plain mutilating?
 
Depends on how much fight the pumpkin gives :@
 
9:22 PM
class Sop(object):

def __init__(self, my_input):
self.my_input = my_input

def Set_of_subsets(self):
self.SOS = [i.split(".") for i in self.my_input.split("+")]
return self.SOS

def reduceS(self):
self.aSubset = [x for x in self.SOS if not any("~"+x in self.SOS)]
return self.aSubset TypeError: cannot concatenate 'str' and 'list' objects
did I call the function wrongly?
 
@Belle 1. You should indent your code properly and format it as text by editing it and pressing Ctrl+K
 
sorry
 
2. As the error message (pretty clearly) states, you're trying to concatenate a string and a list.
 
that whole line makes no sense
 
I suspect in "~" + x
 
9:25 PM
perhaps you meant self.aSubset = [x for x in self.SOS if '~{}'.format(x) not in self.SOS]
but then you still have the problem that self.SOS apparently contains some lists instead of strings
 
i want to compare [[a,~a], [b,c], [d,~d,e]] and reduce to [[b,c]]
 
@davidism Which it always will because of the i.split(".")...
 
are you talking about strings, or the negation operator?
 
Are they strings then?
 
def main():
    user_input = raw_input("Enter B.E in SOP form:   ")
    print user_input
    my_sop = Sop(user_input)
    print(my_sop.Set_of_subsets())
    print(my_sop.reduceS())
i am just getting a string from the user and splitting wherever '.' and '+' occurs. Hence it becomes a list, now if [[~x,x,y],[b,c]] is there, it should become [[b,c]]
 
9:31 PM
what happened to the y?
maybe it would be better to give an example of user input and desired output, or define exactly what the rules are, it's not clear from your code
 
oh if variable and ~variable are there in the same sublist, it becomes an empty list and I remove it
user input = a.b+b.~c+y.~y.z+d.~d
Desired output = [[a,b],[b,~c]]
 
You should use regex
 
lol
 
However my input variables can be joe or david also, not just a or b
 
That's not really an issue, the actual logic is wrong.
You're trying to add a string to a list (which makes no sense)
 
DSM
9:37 PM
Maybe it would be easier to see the problem with your logic if you weren't trying to cram everything into one line. Try something like for sublist in self.SOS: if (condition) do stuff, and think about what the condition should be.
(Okay, I know it looks like I crammed everything into one line there, but that was just how the paragraph went. :-)
 
:) i would gladly do that, if ppl didnt insist me on list comprehensions
 
who's telling you to do that?
 
my staff..?
 
Your staff?
 
yeah
 
DSM
9:39 PM
Once you've got condition right, converting the loop into a listcomp (although it's entirely unnecessary) is straightforward.
 
Are you confusing the word "staff"?
 
dude, it works the other way around, you give the orders to your staff
 
staff is a teacher right
 
Not in this context, not really.
 
DSM
Ahh, I see the problem. :-)
 
9:40 PM
I am more confused that I was by your code.
 
oops
 
A teacher may be a member of the "staff", but you saying that they're your "staff" implies that you are their boss.
 
is that so? i told my staff meaning my teacher...
 
DSM
End of week rhubarb for all!
 
have I been taught english wrongly??
 
9:43 PM
yes
also, I don't feel comfortable answering your homework for you
why not ask your teacher if you're having trouble?
do what DSM suggests: get the output right first, without worrying about if it's a list comprehension, then reduce to a comp
 
i'll try
 
@Belle Does SOP mean "sum of products"? Is this an Electrical Engineering course?
 
yeah
 
10:03 PM
cbg, @JonClements - distracted by requirements for Haloween party printing
 
Ahh fair enough... have messaged you various ways :)
 
Can anybody help me with opencv2 python?
please
 
@JibinMathew see da rules
> 1. You do not need to ask if it’s okay to ask a question.
 
@Belle I think sets help in this. E.g.:
>>> my_sop = 'a.b+b.~c+y.~y.z+d.~d'
>>> my_sop = [set(i.split(".")) for i in my_sop.split("+")]
>>> my_sop = [x for x in my_sop if not x & set(i[1] for i in x if i[0] == '~')]
>>> my_sop
[{'b', 'a'}, {'b', '~c'}]
 
@PatrickMaupin why are you doing this person's homework for them?
 
10:11 PM
@davidism I don't think this is HS homework and I think this is a fairly small piece of the puzzle. Could be wrong on either count.
 
How do i invert a black and white image such that all black becomes white and all white becomes black in opencv2 python
 
user559633
What have you tried
 
@PatrickMaupin Did you read the context? They literally say their teacher told them to do it.
 
I understand (she?) has homework. How many high-schoolers work on sum-of-products?
 
yeah I don't see anything wrong with helping someone with their homework =/
in (off-topic) news -- I wrote an md5 hasher in golang. Hooray!
by which I mean I learned how to use some of golang's stdlib and glued together some expressions
but still hooray!
 
10:16 PM
As I said, I could be wrong, but this looks like the first baby step for an ongoing series of optimizations.
 
OK, I'll say this plainly: if you want to guide, like DSM did, that's fine. If you're just going to write people's homework for them, that's not ok.
 
And I'll say this plainly: She needed to be guided to be using sets. If this is an electrical engineering course, it's probably not actually about the Python. The best way to show using sets is to actually use them in a relevant way. If she turns out to be a help vampire, it will turn out that I'm wrong and I won't go any farther.
Also, I'm still on drugs so I'm not fully responsible for my behavior.
(aka codeine cough medicine)
 
@davidism you are right. I just wanted guidance. I can't get anywhere, if I don't even ask doubts right? and @PatrickMaupin thank you, and yes you are right, I still have 3-4 steps to do
 
agreed with @PatrickMaupin in this case and in general. People begging for help above and beyond is a pain, but someone providing that help shouldn't be discouraged. "Write my code" this was not.
 
@Belle What is the description of the course this is for?
 
10:24 PM
@Belle if you need help with homework, you should talk to your teachers. Getting code written for you by other people is doing yourself a disservice.
 
user559633
I definitely see where davidism was concerned here, give context. I think the above code sample is cool and I'm very happy that Patrick said he'd taper off the help if it turned into a garlic fest.
 
user559633
Given context. What a week.
 
user559633
Combining skip lists and sliding windows is amazing for processing sorted data.
 
@tristan Yeah, the thing about Python is you can correctly implement fast data structures much more quickly than in many supposedly faster languages.
 
user559633
@PatrickMaupin Yeah -- I'm using a shallow skiplist, but it's still amazing to say "on a batch of 0->xx,xxx rows, process o(n), then take that skiplist for all next lookups, then get xx,xxx+1->xxx,xxx batch and use the previous skiplist"
 
10:36 PM
@PatrickMaupin thanks but I'm sticking with lists here. I figured out using lists...:) and its based on algorithms
 
user559633
i'm working against a nosql "database" that barfs when > ~50k rows are fetched and i need to process the lot for dupes
 
user559633
almost done and it ended up being way more fun than i imagined
 
@Belle Glad you got it working! Obviously, you can make it work with lists, but when you get more proficient, you will find that this sort of thing is often better done with sets, both from a performance standpoint, and -- perhaps even more importantly -- from the standpoint of reasoning about what is going on.
 
@davidism In the first place, I didn't ask for code to be written for me, just how to fix the errors! You misunderstood me I guess.
 
@Belle At the end of the day he thought I was providing too much help. Anyway, it's all good -- let's just drop it for now. :-)
 
10:40 PM
So @PatrickMaupin is sets faster than lists? Yeah, python has many different ways of doing the same action.
 
user559633
@Belle for some things yes, others no
 
@Belle "faster" is relative. Sets have O(1) lookups, which make some things (like intersections or many many lookups) much faster to do with sets than with lists
 
user559633
sets are faster for membership lookups, slower for iteration (and insert, iirc)
 
Sets also take longer to build than lists do, so often if you're just doing if element in some_group_of_only_a_couple_things it's faster to just use a list
unless you're doing that many times
 
Why is list comprehension called pythonic?
 
10:42 PM
'cuz it's pretty and it's clean
[x**2 for x in range(10)] is much nicer to read than
result = []
for x in range(10:
    result.append(x**2)
(holy jeebus I hit an autohotkey I forgot I hadn't turned off)
 
I thought its long and hard for someone other than the programmer to understand?
 
You can certainly overdo it.
 
True @AdamSmith
 
Anyway the other reason for sets I was discussing is the reasoning about them. For the given problem domain, with lists, you might be writing something like [i for i in x if i in y]. With sets, this becomes x & y
 
user559633
Have a good weekend everyone
 
10:46 PM
Which is much easier to read and reason about.
You, too Tristan -- sounds like you had a great week!
 
user559633
@PatrickMaupin Heh, yeah, 70-something hours of work
 
user559633
anyway, i hope you start feeling better soon and cheers :)
 
Thanks!
 
Rhubarb, @tristan
 
And for regex, suppose if we use re.compile() , how should we represent the stuff within (). I initially tried that and it was full of r(?.* '%s''%w')etc etc...someone told me it was based on foo?? and bar??
 
10:54 PM
should probably go find a regular expression tutorial :) That's outside the scope of what you can learn in a chatroom with a quippy message.
 
The weather has been a bit unusual today.
 
11:14 PM
Never has there been a more relevant xkcd
 
oh yes, that was posted on our slack at work. Good one.
 
complaint! Golang has better (though slightly weirder) argument parsing than Python
and weirder only because of pointers
 
Any good books for beginner/intermediate networking in Python?
 
@AdamSmith Speaking of which...I was looking for a dupe target, and I ran cross one of your answers where you answered a Python question in Golang. It was pretty funny
 
ha I remember doing that. It was something like "Yeah this is going to be closed anyway so here's how to do it in this language I'm learning"
I think?
 
11:27 PM
"Since the question asker doesn't seem to want to clarify, I'll answer in Golang since I'm practicing it lately!"
solid
OP thanked you though. which is even funnier
 
really? I think I missed that! Link me (to myself)
 
-1
A: Why do I get Memory Limit Exceeded?

Adam SmithSince the question asker doesn't seem to want to clarify, I'll answer in Golang since I'm practicing it lately! package main import ( "fmt" "math" ) func isPrime(n int) bool { if n == 2 { return true } else if n%2 == 0 || n <= 1 { return false } else { ...

 
@AdamSmith That's illegal in 37 states.
 
yeah I definitely missed their comment. That's hilarious.
@PatrickMaupin why, are you a snitch?
 
psssst...Patrick...it's a trick...say no.
 
11:32 PM
Hey, if you want to link to yourself in the privacy of your own home, that's one thing...
(If you're going to do it in public, you might as well film it and see if you can make some extra money that way.)
 
<a href="localhost:8080/" target="_self">Ooh baby yeah</a>
Oh god who's upvoting my answer? It's not even in the right language!
 
ping localhost
ping localhost
haha...must have been someone here
wasn't me....*looks at Patrick*
 
That answer is one of a dozen of my 800-some answers that rates negative
It's earned its place
 
Was it worth the -1 rep?
 
very much so
 
11:37 PM
it's -1 on the outside...but on the inside it's worth a million.
 
15 thousand more of those answers and I'll start worrying
 
file a bug report
He needs that million rep
 
That'd almost put me past Martijn
 
Martijn?
 
@AdamSmith hahah wow, I am going to use that for the tutorial I am giving next Monday
seriously perfectly timed.
 
11:40 PM
@WilliamWisdom Martijn Pieters
our resident modninja
 
He's a human Konami Code for Python
 
Note the starred message on the right:
 
12.9 million people reached
 
> The only way to beat Martijn to something is to do it before he was born :p - oct 28 at 4:32 by Jon Clements
 
How much time must he spend here?
 
11:45 PM
he's a wizardninja
time is irrelevant
he always arrives exactly when he means to
 
Why on earth does this always loop?
call print_fizz
call _test
call print_buzz
 
he owns time
 
Did he get it as a perk at facebook?
 
fb was just a pebble on his road
 
He has literally never asked a question he didn't immediately answer
 
11:55 PM
alrighty quittin' time
rhubarb all -- have a safe and happy Halloween
 

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