« first day (1705 days earlier)      last day (3242 days later) » 

@MorganThrapp think of each bit as a column of T or F values, OR gives you T if either are T. XOR makes two T's a F.
 
DSM
@DSM: Actually looking at the repr output, it looks like the translate function never stops working. I'll post the last few lines of the before and after. — Garett 4 mins ago
Imagine my surprise..
 
@AaronHall Yeah, XOR is the only one that I'm still having issues with. That helps, though.
This is the part where I wish I'd majored in CompSci instead of theatre in college. :P
 
If you really want to thank me, review my work on SO and vote your conscience. :D
 
4:03 PM
I think the bitwise and binary stuff is going on the millions of things to eventually learn list
 
@AaronHall I'll see what I can do. ;)
 
What's the advantage of bitwise shifting? Is it faster?
Eg, why do 4>>1 instead of 4*2**1
 
What would one need binary and bitwise operations for in python anyway?
 
4:10 PM
Nice. I've lost all will to answer Qs lately.
 
that's the spirit!
 
Last Q I answered got "thanks, that solved it, but now <unrelated question>?" with zero points for my efforts
 
@Ffisegydd apparently they're thinking of some new 30k privileges
82
Q: What privilege should 30k users get?

Jon EricsonThe last time we lifted the level cap was in 2011. Last year, we added a unilateral close-as-duplicate power for gold tag badge holders, but no new reputation level. So we've been thinking about giving users more reasons to keep playing. (I've answered this question with some circumstantial evide...

69
Q: Help us identify micro-privileges for top users

Jon EricsonAre you familiar with tapas? These are little appetizers invented in Spain that people enjoy while talking and drinking in the cool of the evening. What makes them so great is that you get a wide variety of tastes without getting fed up. Not long ago, I asked for suggestions of a new 30k...

 
DSM
100k is within sight. I have a feeling my SO experience will change qualitatively at about that point.
 
It puts me in a bind because I can (and did) say "that's a separate question so you should ask it as a separate question" but when they say "oh, ok" and continue to withhold the accept, it's kind of skeevy to give the "if you feel my answer was helpful to you..." speech because clearly they didn't find it helpful enough.
 
4:14 PM
Man, I really get to get some more rep. You're all talking about new privileges at 30k, and I'm here at 30.
 
should have known OP would be trouble from the start. incomplete code with incorrect indentation, spelling errors, no mention of expected and actual output.
This is why I demand MCVEs for all but the simplest of problems. Filters out the users that know nothing of our ways and customs.
 
@DSM I am also excited about that ;-)
 
@davidism woo
 
cbg
 
DSM
I don't usually make close-vote requests, but this is an obscure tag and a terrible question, so: here.
 
4:21 PM
That's the most baddest question I've seen in a while.
 
string ironMaiden... idgi
 
BAM. Done. I use "derp" a lot as a variable name.
 
I have no humor while programming.
 
8 points from hammer!
 
In C++ you can throw up but in Python you raise hell.
11
 
DSM
4:23 PM
We have n-dimensional data objects in an in-house library called hypercubes. They can be split along an axis, so in C++ I often find myself writing auto parts = . For some reason I get a kick out of that every time.
 
I don't think I've ever used puns in my code... Maybe jokes and algorithms are mutually exclusive parts of my brain.
 
what is a "senior" engineer and why do I get emails for job openings as one?
 
At BigCorp, senior devs talk about SQL a lot and leave an hour early.
 
And shout at juniors :D
 
Only because they're so excited about SQL.
 
Can I be the PHP_CEO?
 
You can be his assistant: BIRD_BRAIN
 
PHP_CEO lives within all our hearts.
 
Cabbage, all . Bugrit
 
Well, that dupe got an answer: a new user linking to another answer
 
DSM
4:42 PM
Not so new, he's only a month younger than me. :-)
 
so, so new.
 
re-cabbage
 
Woo, first accepted answer! I'm (very) slightly less new to the site now!
 
I'm having a bit of difficulty understanding optional matching in regex. I would like to replace ["Classification", "Class", "Class.1", "Class.2"] with [Stays the same, "Classification", "Classification.1", "Classification.2"].
I'm trying some variation of re.sub(r'Class(\.[1-2])?$', r'Classification\1*', col_name) to no avail
 
So ["Classification", "Class", "Class.1", "Class.2"] is a string?
 
4:54 PM
Nah four different strings. Sorry wanted to write out all the different cases
 
So you just want to replace class with classification
 
Yep, and keep the ending if there is one. I get an invalid group reference when there isn't a suffix
 
[item.replace('Class', 'Classification') if 'Classification' not in item else item for item in my_list]
you don't need regex
 
Nah, What if Classified is one of the strings?
 
it's not
 
4:57 PM
@jsc123 Would you like to confirm on this?
 
Sorry, just left briefly. Classified is never the case.
 
so you don't need regex
 
If i wanted to do it with regex how would i though? i want to learn about optional matching.
 
the problem is that the first value doesn't have a matched group, so the sub fails
 
I guess it would be better to use a function there. But not sure if that is the only way
 
5:02 PM
Thanks for your help @davidism #@BhargavRao!
 
5:38 PM
If OP wanted special-casing for punctuation in his letter counting program, he should have provided a more discriminating example.
(for this question)
 
"?" and "!" are letters... For certain definitions of "letter"
 
I want to debug his program but there are too many problems in that
:(
 
len(re.sub("[^a-zA-Z0-9!@#$%^&*]","",my_text))
 
For every person whose sample input is a list of strings with the quote marks "helpfully" removed, I hope they step on a lego.
 
DSM
5:41 PM
Earlier today I told someone to post the exact output from a command. He edited the output, natch.
 
Anyone that omits the actual helpful half of the ValueError: invalid literal for float(): <value> error message should have to sit in the corner.
People that answer only one third of a comment that contains three questions, will be first against the wall when the revolution comes
 
I'm using an API where I want data for a given day so I do date=2015-05-25 and yet it gives me from every day in the last month. Why do you do this?
Do you want me to hate you API? Why do you make me strike you?
Normally I'd assume I was at fault, but their API is in beta and there is some doc errors so Kevin only knows.
 
shake shake... Outlook uncertain.
 
5:58 PM
I am not at a Board Meeting but thank you anyway. — Alex Ivanov 4 mins ago
Wut?
I remember him for his post on Martijn :D
 
I interpreted it as "I didn't ask for your opinion"
"If this were a board meeting, it would be natural to end a presentation by opening the floor to the commenters. But this isn't a board meeting, so keep quiet"
 
Yup. It is more like that itself
 
On second read, I'm interpreting it as, "I'm open to criticism about the technical content of my post, but not the tone. We're not marketers so I don't care about that"
 
Naw. The tone there was plain bad. Your 1st interpretation was correct acc to me :)
 
@BhargavRao I've noticed that Russians particularly tend to be very direct - almost like they came from Yorkshire.
It's taken me a lifetime to learn to suppress that instinct, to the point where now I'm successful about 50% of the time
 
6:06 PM
Actually I know that user coz of a comment reply to Martijn
Jun 10 at 21:37, by Martijn Pieters
AFAIK, "/n" is just a character. It doesn't produce any line. That's how terminal renders it. "In computing, a newline, also known as a line ending, end of line (EOL), or line break, is a special character signifying the end of a line of text." - en.wikipedia.org/wiki/NewlineAlex Ivanov 1 min ago
@vaultah I've met with a couple of Russians but they weren't :/
So can't generalize on that :D
 
Okay, never mind
 
To be fair I trust vaultah's opinion more than Bhargav's on this subject :P
 
konban wa
 
Opinions! They vary widely :D
 
Opinion is possibly the wrong word in this case, "experience" maybe fits better.
 
6:14 PM
Opinions are like assholes: everybody's got one
 
classic.
 
Experience is like education: some people learn from it, some people don't (though naturally there's a continuum)
 
I was going to say that, except that men's ones have hairs
 
@BhargavRao Oh, him
 
I'm struggling with Conway's Game of Life on codeeval
 
@RobertGrant why?
Not why struggling, why even attempting?
 
I need a delimiter character as | , @ and $ are all consumed Used &
 
Flagged one of those as "This answer and another one by the same user on this Q are misusing multiple answers in an attempt to conduct a conversation with OP", but if there's a diamond in the room right now who wants to just go nuke 'em ...
 
Remember not to modify the Game of Life cells while you're iterating over them.
 
6:17 PM
@holdenweb codeeval is a programming puzzle site; it's one of the puzzles
@Kevin yeah I make a copy
 
it's kind of hard to take an ad saying "we're looking for creative individuals" seriously when it comes from a company called "General Technology Solutions"
 
@RobertGrant I know. Can't find anything better to do with your time?
 
Oh hm I think I spotted the problem
Er
I...guess not
 
Umm, I dunno. Make sure you don't have any off-by-one errors when doing bounds checking. Don't mix up height and width for non-square fields. Remember to count diagonal neighbors too.
 
Yes! That's better.
I made a mistake; was setting dead cells to still dead when they had 3 live neighbours, instead of alive
Woop, yeah solved
 
6:25 PM
isnt there someway to use numpy strides to do conways game of life in like one line?
(not that you can use numpy on codeeval)
 
Dumb question, how do you convert a 2d array into a 1d array efficiently?
 
sum(seq, []) is most efficient programmer-time wise, but O(N^2) memory
 
Is asking someone what resource they're using to learn Python in a comment considered rude? I'm asking before I do it. :P
 
@Kevin that's actually very helpful to know, because I am far more CPU bound than memory bound
 
6:29 PM
@MorganThrapp Depends. For Eg if you tel "RTFM" then it is rude :D
 
@MorganThrapp Not really, some resources do some very odd things that might not be optimal
 
Not sure how it compares CPU-wise... I guess it depends on how long it takes to do len(seq) memory allocations.
 
And lmsotfy links are also rude.
 
This isn't just non-optimal. They're doing

stuff = print('more stuff')
more_stuff = stuff+stuff
 
@MorganThrapp I've tried before but I rarely get a straight answer.
Usually it's in the context of "the code you're copying from somewhere is awful, what's the name of the tutorial so I can boycott it?"
Even if I try to disguise my intentions
 
6:31 PM
Also, how do I have code and non-code in the same message?
Or, is that not possible?
 
Backticks Use Backticks.
 
Not possible on multiline.
 
I assume their problem is that print doesn't return anything?
@BhargavRao backticks don't work multiline. I wait for the day that ``` syntax is accepted
 
@corvid Yup.
Yeah, that's my issue. I want my message above to be

message
code
code.
But that doesn't seem to be possible.
 
It's definitely impossible.
 
6:33 PM
Curses. :(
 
Did someone mention curses?
You on linux? If yes curses. If no curses. — Bhargav Rao Jan 9 at 16:34
:D
 
Nice.
I went to upvote, but turns out my past self already did.
 
Did you see ur answer there?
 
Upon closer inspection, yes.
update: colorama is still pretty good
 
I started to hate curses after I discovered blessings
 
6:49 PM
Rbrb. Going out for a small drink :)
 
hm. I don't get asyncronous code sometimes
 
DSM
I always like the expression "a long drink of X".
 
Before I show how much of an idiot I am in a comment. :P You only need self to access class data if it's instance data, right? Not if it's class data?
 
DSM
I think you'll still need self, otherwise it'll think the reference is global, no?
Or I guess ClassName.variable_name would work too.
 
This is in an class method.
 
DSM
6:58 PM
Yeah, I think you'll still need (something).var_name.
 
@classmethod doesn't necessarily take self, does it? I thought it had something like cls
 
def MyClass():
    foo = 1
    def __init__():
        bar = 2
    def print_stuff(self):
        print(foo)
        print(self.bar)
That's wrong?
 
@corvid it's because we're used to synchronous stuff being the harder thing. E.g. swimming, dancing, watches.
 
I dance asyncronously. I just split into small parts and perform different parts of the dance.
 
@MorganThrapp Yeah
 
DSM
7:01 PM
@Morgan: yeah, I don't think that'll work. (Aside from the typos.)
 
@corvid just don't forget to await or you'll end up a bloody mess
 
Er, yeah, that should be class not def. :P
And this is why I consulted chat first. Thanks!
 
7:16 PM
cbg
 
underscore is great, underscore needs to be in every language
 
How can I send xml data from views in django
I mean it has to be in XML format
 
@corvid well, lodash :)
 
Yeah lodash is better. I like to mixin underscore, lodash, and underscore.string to _
 
DSM
Well-lo'dash sounds like a thing, somehow.
 
7:32 PM
@Kevin You stole my answer. :P Stupid co-workers interfering with my rep-farming. ;)
 
I need to start using map.. I know it's there, and I vaguely know what it does but I never use it
 
When is it better than array comprehensions?
 
It's good for easy conversions: int_list = map(int, string_list)
 
Yeah, applying a function that takes a single argument to a whole list is pretty much the only time I use it.
 
I don't know that I've ever actually used map.
 
7:35 PM
If you have to use a lambda, you may as well just use a list comp
 
I actually never noticed that what it does could be done with a list comp
As obvious as it might seem now
 
@DSM Sounds like something an orcish npc would say in WCIII
 
Cause I used to use loops for everything. On my next project I'm sure I'll be better
 
My life for Aiur!
 
In Haskell you often do map f xs ... where f x = ... - that is, use a local function definiton with it.
map would be great if Python had multiline lambdas
 
7:40 PM
People start saying parochial things like "What is this, Ruby?" when that sort of thing gets suggested :)
 
But... Ruby is great :-)
Nope. Strings are, but number are not.
 
@Dracunos easiest example is titleizing names in python. map(str.title, names)
 
multi-line function expressions is one of KevinScript's flagship features :-)
 
Nice!
 
[x.title() for x in names]?
 
7:46 PM
@Kevin I really want to try KevinScript. When's the open beta?
 
yeah @Dracunos, pretty much
 
See.. I know things.. Sometimes
 
@MorganThrapp May 21, 2014. github.com/kms70847/KevinScript
 
Do open source projects have closed betas and such normally?
 
7:49 PM
I think mapping and such tends to make much more sense in javascript, doesn't make much use in python
 
KS was once "closed" in the sense that you had to have physical access to my computer to use it.
 
Are you really making a programming language?
 
> this is a real programming language that has real code. You can download it and it really runs.
 
@corvid why shouldn't it have use in Python?
 
7:51 PM
because of list comprehensions
 
@Kevin cool
 
I modestly accept your praise.
 
Are you writing it like on top of python? Not that I'd understand any explanation of how to make a language :p
 
Short answer: yes.
Although the whole fun of it is implementing as much as possible using as little of Python as possible.
 
DSM
Self-hosting eventually, no doubt?
 
7:58 PM
I think KevScript might be a catchier name, just saying
 
If I don't make a mess of things, self-hosting would be straightforward (although slightly excruciating because the syntax isn't as concise as Python)
 
DSM
We can make a Python-to-KevinScript translator to help bootstrap things.
 
Oh how you tempt me.
@Dracunos I'm pretty sure I'll never be taken seriously as long as my name is in its name.
 
I have a really simple, quick question.
 
James, read the rules: sopython.com/chatroom
 
8:02 PM
Clements sounds familiar
 
@JamesClements welcome, please read our room rules: sopython.com/chatroom
In particular: just ask your question, don't ask to ask
 
I've once proposed we replace that stupid room description with some abbreviated rules.
 
If I have a function: def foo(a = None, b = None, c = None) how could I call use the default value for a & b and my own value for c. Something like foo(, , 'val')
 
@Dracunos are you really confused by the idea that two ore more people might share a last name?
 
And oops my bad
 
8:04 PM
foo(c="val")
 
sweet thanks
 
can also be used to reorder arguments
 
what if my local variable i
 
Abbreviated rules, once again: "Rules: 1) Be Nice. 2) Don't ask to ask. 3) Don't ask if anybody knows something. 4) Don't talk like you're lost in the produce section."
 
what if my local variable has the same name as the parameter
 
8:05 PM
I'd like to emphasize rule 4.
 
What's with that cabbage at the end?
@JamesClements I suggest you open an interpreter and try it out
 
I remember now. And no, my last name is Alexander, so I'm familiar with the concept
 
Someone star my rules so we don't lose it again.
 
I never met a Kevinson that wasn't related to me.
 
alright it worked in the interpreter. thanks
 
8:08 PM
@AaronHall We've pinned rules before and the result usually is, no one reads them
This is consistent with my understanding of the Internet. Nobody reads anything.
 
Like Pinocchio, all of my sock puppets have minds of their own...
 
Yeah, it just gets too crowded and then they don't read the actual rules at the link too. This way, there's exactly one place we point them to.
 
I feel like I've been taken advantage of somehow.
 
Are you kidding? You got 3 gold stars. You're a winner.
 
Like, 5% violated. Comparable to when you're in an elevator with someone and he's making eye contact with you the whole time.
(there are other people in the elevator too, so there's little actual danger)
 
8:18 PM
Just keep looking at your own shoes, it will all be over soon.
 
Well, if there's other people...
If there were 21 people in the elevator, and each one was staring at someone else, the total discomfort would be over 100%.
 
Hmm, as it's never actually happened to me, maybe I'm misunderestimating the severity of poor elevator conduct.
 
Ah, the Mexican elevator standoff. Tarantino was going to include one in his next film.
 
Max discomfort is reached at the ocular ailments conference when an outbreak of lazy eye causes each person to make eye contact with two other people
 
@davidism paypal had 15 year old bank details... I'll do an update and sort it out later mate
 
8:21 PM
@Jon nice, you obviously don't use PayPal a lot :-)
 
hrmph this is annoying. Filling a 2 dimensional array quickly
 
Did PayPal even exist 15 years ago?
 
It pains me when a message longer than 150 characters gets starred. Those accursed ellipses.
 
Yeah, but it cuts off in the perfect place.
It's actually funnier that way.
 
We need to finish our unofficial chat api and create our own chat interface. The only difference will be that the full starred message shows up.
 
8:23 PM
"Lost in the produce" sounds like some kind of zen state.
Our friend Godot is coming to finish our chat api. Let's wait for him here.
 
@davidism no idea... I only used it cos ebay was the "new" thing and paypal was the best way to pay...
 
so yeah - it was trying to draw from a "current account" I had 15 years ago
 
@Kevin How Lucky we are.
 
@davidism It did; founded in 1998.
 
8:27 PM
All you need to do is figure out how to get it to draw from a "current account" 15 years in the future, and you become a millionaire by self-fulfilling prophecy.
 
Didn't know Dan Hannan crossed the pond and pronounced in the WSJ
 
Okay, the company that became PayPal was founded in 1998; the service itself didn't start until 1999.
 
@MartijnPieters reminds me of the xkcd movie ages
Did anyone else notice that 2000 was 15 years ago?!
 
Time goes by faster and faster the older you get :( ask an old person about it if you want to get depressed
 
Cabbage
@AaronHall, you help to maintain pandas right?
 
8:41 PM
I don't know what the function is called that performs this operation...
 
Well can you look at my answer here? It's about removing an index from a Mutiindexed index in pandas.
http://stackoverflow.com/a/30899445/4131059

I think this might not be as good as I'm hoping it is...
 
@davidism Yeah... stop making me feel old :)
 
(cough) Trello (cough)
 
@JoranBeasley: please don't use snark. Yes, the str question is rather.. unreproducable, but no PEBCAK remarks please.
 
bah fine i figured :P
 
heh you clobbered it before i could go self censor :P oh well
 

« first day (1705 days earlier)      last day (3242 days later) »