« first day (1469 days earlier)      last day (3473 days later) » 

8:00 PM
I think a lot of being able to solve questions on SO is down to experience and having done it yourself
I had to go through books or pray to god I could find something similar on a BBS if I needed help
 
When your keys are lost in your house, you don't think "I'll cut my house in half and perform a long-range scan to determine which half contains my keys". So it's not an entirely natural instinct.
 
DSM
"Unspoken Python: The Lessons No One Taught You"
 
Ironically, the one logarithmic complexity search that ordinary people are familiar with, has been made obsolete by computers: looking things up in a phone book or dictionary.
Open the book up in the middle. I'm in "M", so my search for Kevin Kevinson will be restricted to the pages to the left of the one I'm on.
 
DSM
Sometimes I wish we'd used another word than "dictionary".
 
Now I'm in "G", so my search will be restricted to the pages to the right of this one, and the left of my last page... etc
Maybe throw in a little heuristics to get better pivots. K is probably 10/26ths of the way through the alphabet, so I'll open the book there instead of the exact midddle.
 
8:09 PM
Also, got my school report. They didn't tell us our current grades -.-
 
DSM
...
 
And some of my subjects are missing entirely, like computer science.
 
Umm... not sure it's a completely valid CV, but stackoverflow.com/questions/26555458/…
 
Which is the only one I care about.
 
You'll just have to take those classes again.
@DSM Yeah, but "hash" and "map" are taken already.
"thing which associates things to other things" works, but is too long.
 
8:10 PM
@JonClements Valid CV?
Oh, closevote.
Never mind ;)
 
Looks like there's a new record for highest-altitude jump.
I always feel a little wistful for people that break records, who don't retain the title for long.
 
DSM
At least they were able to join the story, and to carry the torch, however briefly.
 
@Kevin wasn't it 1-2 years ago, when baumgartner jumped.. ?
and now they eventually broke that record? that was quick..
> 128,100 feet on Oct. 14, 2012.
 
DSM
"and plummeted toward the earth at a speeds that peaked at 822 miles per hour"
 
It's 135,890 feet now.
 
8:15 PM
amazing.
 
I would literally die, I think.
 
@DSM If it were me, I definitely wouldn't give up the title with dignity.
It's mine, you hear me! my precioussss...
 
DSM
Why do you think everyone's afraid to say anything too clever and compete with you for the title of starlord?
 
Aw, thanks for enabling my selfish behavior, guys :'-)
I was browsing questions related to "many memes of Meta" yesterday and I discovered that the Code Review chatroom is so star-happy, that users frequently hit their "star cap" for the day. This happens often enough that they have in-jokes regarding it.
I didn't even know there was a star cap.
23
A: What's a Zombie? And what are the many other memes of Code Review?

Mat's MugMeme: TS | RSA Originator: SimonAndréForsberg (TS), rolfl (RSA) Cultural Height: star-power Background: The 2nd Monitor is quite a star-happy chatroom. How many of you know that there's only a number of times you can "star" a chat post - a star cap (like the rep cap and the vote cap, a star ca...

 
DSM
It's weird to hear about other chat rooms.
"star cap" sounds like something Kevin would wear..
 
8:22 PM
It's like a night cap. So I can dream of interesting things to say the next day.
Some commenters on the HN link for that high-altitude jump article are discussing the decreasing supply of helium on Earth. I wonder if it would be hard to make more via nuclear fusion. Hydrogen is quite plentiful - just smoosh a bunch of that stuff together.
The Sun is a big dumb ball of idiot, and it fuses hydrogen all the time. Why can't we?
It's not like we're talking lead into gold here. Just one proton into two.
 
DSM
Or buttermilk into gold.
 
We use helium in our research. Ridiculously expensive.
3He is a few thousand dollars per litre IIRC
 
8:39 PM
nvm.. it was closed before I could type this message
 
ahh... not using a neural interface then?
 
Isn't something like an eighth of the helium on the planet used in US MRI machines alone?
*eight of the annual consumption of helium
**eighth
 
DSM
8:55 PM
Last guy at the office, so I get to turn off the lights. Have a rhubarb-filled weekend, everybody!
 
rbrb @DSM!
have a good one
 
cbg all
 
I'm too old for this
 
hi all
 
9:12 PM
cbg
how ya been @inspectorG4dget - how was your time in the lab the other day?
 
heya @JonClements. I compiled a list on facebook, of all the people I could get a hold of, and their whereabouts. That was not my most productive day
how've you been?
 
good thanks... everyone okay I hope?
 
yup! one military casualty. Nobody else injured, afaik
 
not sure "good to hear" is the right expression, but you know what I mean
 
/me nods
news coverage was surprisingly smooth
 
9:17 PM
yeah... world's going mad... been a shooting in a Seattle school today or something
 
I was effectively plugged into all social media, and the news; got my friends to help me track down some people. It was kinda cool... in a surreal, distopian sort o fway
oh no!
 
@inspectorG4dget kind of like having your own Intelligence HQ? :)
 
pretty much. It also felt good to be doing something helpful with immediately relevant outcomes
 
Weird coincidence - my old college had a shooting threat yesterday. Nothing came of it, but the campus was locked down for a few hours.
 
madness
 
9:24 PM
such anomalous events tend sometimes to follow a copy-cat profile
where/which college is this, @Jack?
 
I have a question, I want to remove names from a name list if the names are similar. I have done this:
uniqueNames = ['Adolfo','Adolph','Adrianna','Adrianne','Adrienne','Agatha','Jamaal','Jamal']
for i in sorted(uniqueNames):
    for j in sorted(uniqueNames):
        closeness = difflib.SequenceMatcher(None, i, j).ratio()
        if closeness > 0.7:
            uniqueNames.remove(j)
 
SUNY Canton in northern New York. Lockdown happened yesterday after threats were made late the night before, around 1am I think
 
but I am getting an error message ValueError: list.remove(x): x not in list
 
Try using uniqueNames.remove(uniqueNames.index(j)).
 
@CoKoder: don't delete from a list as you iterate over it. Collect the names in a separate list, and then remove them all, eventually
 
9:26 PM
Just a guess.
 
Maybe sorted still contains the names after removal?
So when you remove an item, it's not removed from the sorted collections you're iterating over, then you hit the second of the two similar items
 
@CoKoder what do you even expect the output to be?
How to pick any over any other?
 
uniqueNames = ['Adolfo','Adrianna','Agatha','Jamaal']
it will be expected output
 
[i for i in uniqueNames if not isSimilarToAny(i, uniqueNames)]
def isSimilarToAny(name, names):
for n in names:
if (difflib.SequenceMatcher(None, name, n).ratio() > 0.7)
return true
return false
 
What if you had "drianna" as the 2nd element?
 
9:32 PM
@JonClements, it should be removed,too.
@Jack, your code does not seem to work, i mean it does return an empty list.
def isSimilarToAny(name, names):
    for n in names:
        if difflib.SequenceMatcher(None, name, n).ratio() > 0.7:
            return True
    return False
print [i for i in uniqueNames if not isSimilarToAny(i, uniqueNames)]
@Jack, anything missing?
 
Hmm. I just wrote that off the top of my head as a possible approach, lemme actually fire up the editor
 
Umm...
from difflib import get_close_matches

uniqueNames = {'Adolfo','Adolph','Adrianna','Adrianne','Adrienne','Agatha','Jamaal','Jamal'}
result = set()
while uniqueNames:
    name = uniqueNames.pop()
    uniqueNames.difference_update(get_close_matches(name, uniqueNames, cutoff=0.7))
    result.add(name)

print result
# set(['Agatha', 'Adolfo', 'Jamal', 'Adolph', 'Adrienne'])
 
@JonClements, In the beginning i also thought the use that one, but it turns out that it does not detect some similarities for example Adolfo and Adolph
 
If you reduce cutoff to the default of 0.6, then you get set(['Adolfo', 'Jamal', 'Agatha', 'Adrienne'])
Well... if you're using 0.7 as the ratio match, they won't ever match anyway
 
@CoKoder Mine wasn't working because every element got compared against itself. Oops
 
9:41 PM
@JonClements, makes sense!
 
plus using the set and different update approach, you're wittling down the search space each time, rather than analysing effectively a cross product
 
Is there a way to tell a set to compare for equality with a function you give it?
 
@Jack nope - it only uses hashes...
 
Drat
 
9:43 PM
@Jack you can use a dict though to emulate that kind of thing
use the dict's key as the value you wish to be unique, then put its values back into a set
@Martijn can you think of a better way of doing what I've posted above?
 
cbg @MartijnPieters. How goes?
 
Little on the fried and tired side.
Did a 1h20mins mentoring session.
Only to discover that CM was still taking a 20% cut.. I feel I undercharged, lucky mentee!
Still, good session, 5 star review, so hopefully that carries forward.
 
but they're taking 20% of something you wouldn't have had otherwise - that's how I'd look at it :)
 
@JonClements Yup, but I could have used the hour and 20 to spend with my family.
 
9:52 PM
@JonClements Good idea. I just made a class that emulates a dictionary where when you construct it you give it a hash function and it uses that to determine if two keys are the same.
 
@MartijnPieters so use the monetary income to take the family somewhere when you get a day off :)
 
fa-mi... ly? :S
 
@Jack that's slightly over-engineering
 
I've made some decisions at what pricepoint it becomes worth my while to spend time mentoring (which I love) but when the value of that time drops below a level, e.g. I can't even take them out on a day off, then I may as well spend the time with them. :-)
 
@JonClements - Just a bit. It's nifty though.
I like being able to change behavior with plugin functions
 
9:55 PM
age_name = [
    ('A', 1),
    ('A', 2),
    ('B', 7),
    ('B', 23),
    ('C', 12)
]

unique = {el[0]: el for el in age_name}.values()
# [('A', 2), ('C', 12), ('B', 23)]
@Martijn well... not having any family... I just need to get the work/sleep balance sorted... I'll worry about the life/work balance later :p
Bah... that's meant to be "name_age"... but you get what I mean
(you will have to force the order of the input if you have any priority requirements for keys and such)
 
yes, I'm 1, and I am A years young
 
it's 11pm... gimme a break :p
 
but if you look at my ID, it'll say I'm Riker
(a little Star Trek humor :P)
@JonClements: isn't it friday night for you? Why aren't you knocking back with a bottle of suds?
 
lol
already had two cans... getting ready for bed
 
user559633
having a hard time googling this -- anyone know if there's a way with flask's forms to replace the label text?
 
10:01 PM
and a very nice chilli
 
do you mean wtf-forms?
 
This is my last day at my current job :D
(new job, not fired)
 
was just going to ask :)
 
Just clarifying :P
 
10:02 PM
congrats @Jack!
 
Thanks :) Can't wait to start the new one. I'm moving to san francisco for it
 
you surely seem to be on your way to becoming a @Jack of all trades
 
Oh definitel
definitely
Except not, apparently, a jack of all trades of the keyboard
 
#1 cause of syntax errors: my right pinky
 
10:05 PM
how come?
 
No clue, it just seems to be the one finger that misses keys the most.
And that's the finger I use for brackets and braces
So when it misses keys, bad things happen
 
user559633
oh. yes @JonClements
 
user559633
Like {{ form.some_formfield.label }} that will output <label for="some_formfield"></label> without the form.some_formfield.text inside
 
bah... sure it's doable - just don't know off the top of my head, and don't feel like reading documentation tonight :)
 
user559633
10:10 PM
ended up with <label for="{{ form.has_elevator.label.field_id }}"></label>
 
user559633
which is fine. not amazing, but whatever. done is done
 
user559633
the inside of Label is return widgets.HTMLString('<label %s>%s</label>' % (attributes, text or self.text)) so that settles it, i'd have to create a widget
 
user559633
@JonClements have a good weekend :)
 
What's the difference between declaring a class variable at the start of the class and declaring it within __init__
 
I'm working... anyway... I bid all rbrb... see most of you tomorrow I guess :)
 
10:19 PM
For example this:
class Eel(object):
electric = True
def wat(self):
print("yo")
and
this:
class Eel(object):
__init__(self):
slef.electric = True
def wat(self):
print("yo")
 
Is the class variable static?
Don't remember off the top of my head
 
I don't know what that means, so I'm going to Google it.
 
560
Q: Static class variables in Python

Andrew WalkerIs it possible to have static class variables or methods in python? What syntax is required to do this?

 
Thanks Jack. That kind of clears things up for me.
 
TL;DR: Putting the variable outside of init makes it static - all objects of that class share it.
instead of each object having their own
 
10:22 PM
Yep. I'm glad my mental model agrees with you! Back to hacking. Wheeee!
 
Good luck
 
user559633
putting it above the init puts it in the namespace of Eel
 
user559633
putting it under the initializer means that it's bound on initialization of Eel.
 
alright, I should get back to studying. Rbrb, all!
 
user559633
rb @inspectorG4dget
 
10:25 PM
cya @tristan!
 
user559633
@Seanny123
 
user559633
you likely want it bound on initialization, even if you expect that value to be static -- if nothing else, but for ease of access while using member functions
 
Thanks. I get it now.
 
user559633
np
 
In other news, the stars in this chat made me visit imgur, which derailed my beeminder. I just lost 5 dollars.
Godammit...
 
user559633
10:28 PM
beeminder?
 
I'm basically black-mailing myself to not get distracted.
It worked really well for a week.
 
user559633
your beeminder is to not imgur?
 
user559633
just install this selfcontrolapp.com
 
Not do anything that's part of my "distracting sites" list.
So imgur stuff, webcomics (that was the hardest, my fingers kept typing their urls) and blogs.
I (questionably) allowed myself Twitter, but in hindsight, I think I need to cut that out too.
 
user559633
 
10:31 PM
I have a Linux equivalent of that app.
My computer is basically a police state.
 
user559633
i hate when i spend all day on a css thing
 
user559633
and then end up with this shit
 
user559633
 
user559633
look at that beautiful checkbox
 
user559633
let's click on it a few times i.imgur.com/oj71foc.png ah shit
 
10:33 PM
...brilliant
 
user559633
the equivalent of this youtube.com/watch?v=_X6VoFBCE9k
 
user559633
f-ing hours to get it just right on cross browser. little tweaks here and there
 
user559633
and this
 
user559633
:(
 
What do you do when you end up stuck with a frustrating set of tools on a job that you can't do much about due to company culture/policies?
 
Welp, I half did that
 
user559633
started your own company? Congrats! oh
 
My boss was the kind of person who constructs his sql queries with strings and .replace("'", "''")
 
user559633
uhm what?
 
Yup
He will turn user data into strings, concatenate them with sql code in strings, then do a little replace to replace single quotes with two single quotes, then send that off to the database.
 
user559633
10:49 PM
"there's gotta be a better way"
 
That hurt to see
 
user559633
just...why
 
user559633
that's not even safe
 
No. No it is not.
 
user559633
'gummy bears''; SELECT * FROM USERS INTO OUTFILE /var/www/lel.txt
 
user559633
10:52 PM
gummy bears are amazing
 
far superior to gummy worms
 
user559633
based on that alone, i wish i had a new job to offer you.
 
I got one that I start in january. Today's my last day here
 
user559633
Congrats!
 
user559633
taking some time off for anything cool?
 
10:53 PM
Thank you ^.^
Yeah, flying out to visit some old friends and work on a few personal projects
 
user559633
well, good!
 
user559633
quitting my last job was the best employment decision i've made in a long time.
 
user559633
maybe of my career
 
In retrospect, I probably should have suspected something would be afoot with this job when, for the interview, they had me add something to the company website and then the main technical guy (who was/is my boss) didn't actually even look at my code, he just clicked around to see if it worked alright...
 
user559633
i did some consulting work, took 3 months off to hack on fun stuff, travelled a bit, and since then, really started focusing on doing stuff i want
 
10:56 PM
What sort of fun stuff?
 
user559633
yeah, i'm always weirded out by the "you want me to...live code something for your site?"
 
This was my first job so I had no idea what the red flags were
 
user559633
Did a network (peer to peer direct) filesystem, a to-do list that's based on a finite number of "spaces", some computer art, a network scanner/brute forcer, some assorted other stuff.
 
user559633
Yeah, you don't know until you do know, so I wouldn't kick yourself over it.
 
Luckily I had a lot of spare time to read up on the right way to do things, tests and code reviews and all that. Looking forward to working with other people who won't stare blankly when I mention them.
 
user559633
10:58 PM
some day you'll outgrow the next job too, and that's okay
 
Lots to learn and I can't wait to learn it :p
 
user559633
That's a good attitude.
 
user559633
The project that I have open in my IDE right now is the first company that I've started from a piece of paper.
 
user559633
And that's exactly how I feel.
 
That's awesome
 
user559633
11:01 PM
I oscillate between "oh god this is so much" and "holy wow, this is actually working"
 
What languages do you like? Other than python :p
 
user559633
C++, C. Haven't done too much with functional languages.
 
user559633
Yourself?
 
Racket, java/c#, and trace amounts of several others.
 
user559633
I haven't heard of Racket.
 
user559633
11:05 PM
You like Java?
 
It's a variant of Scheme, probably one of the biggest ones I think. Used to be called PLT Scheme
I wouldn't say I like java, I just know it pretty well
 
user559633
Oh, you asked which I like :P
 
Same goes for c#, though that's a bit more tolerable.
 
user559633
I know PHP, Ruby, JavaScript and others, but I wouldn't say I'm particularly fond.
 
Yeah, same for javascript. I know trace amounts of php/ruby but not enough where I could do much without googling a ton
There's a few I'd really like to learn, like Haskell and Smalltalk
Haven't taken the time to actually sit down and code much in either yet
 
user559633
11:08 PM
I'd love to have the time to be far more comfortable with assembly
 
user559633
You should during your break
 
Another good idea for my two months off :P
Racket has a lot of heavy support for crazy-macro-DSL stuff, so I might see if I can write a racket program that runs Smalltalk code. That'd be a fun project
 
user559633
I have this dream of running the backend of the project that I'm working on in C++ and assembly
 
user559633
Oh, that is a good project.
 
I don't think I could ever confidently write anything web-based in a memory-unsafe project, I'd be far, far too afraid of shooting myself in the foot and causing the next Heartbleed
*memory-unsafe language
Oh hey, you can actually edit chat messages so I don't need to correct myself constantly
 
user559633
11:11 PM
haha, if you monitor it, know what you're doing, and control what feed it, you can be pretty safe
 
user559633
Oh, yeah, you can press up.
 
user559633
backticks, control+k, or tab to syntax highlight/preformat code
 
I know myself well enough that I know I will screw it up at some point. I tend to prefer writing code that when I screw up will shriek at me upon tests/contracts failing
 
user559633
Eh. You can do tests/contracts with other languages too.
 
Yup, I just like being able to make writing them comfortable and easy. Racket has this idea of submodules, where you can write code in submodules of other code and it's loaded seperately
 
user559633
11:13 PM
One of my much-hated monitoring scripts at an old company would spin up a new instance and destroy a webserver if it didn't respond in time, so trust me that you can write contracts for things :D
 
So I can write test code next to a function but not have the test code automatically loaded and run whenever the library is required
 
user559633
i'm using C++ for my current project and it's fine -- i'm using the C api, but it totally still counts
 
Totally xD
 
user559633
(thanks :D)
 
Have you ever worked much with a lisp or scheme language?
 
user559633
11:18 PM
No, unfortunately.
 
It is a very worthwhile experience
 
user559633
definitely will check it out during my next good cashflow
 
One of the crazier things done in Racket was they made a typed version of the language using macros only - the type checker is a system of macros
Statically typed, I mean
 
he didnt understand fire
 
user559633
11:47 PM
design as a usability nightmare: html5readiness.com
 
user559633
take care all
 

« first day (1469 days earlier)      last day (3473 days later) »