5.30.2012
I can say it's awesome to be working at a company where so much information is shared with employees, and where we always try do the right thing. Not necessarily what's best for Google in the short term, but what's best for our users and for the internet. It's awesome to work at a company that has a sense of humor. It's awesome how much energy goes into improving the tools that Googlers use every day, which makes us happier and more productive. Some of those tools are also used by people outside of Google, and it's awesome that Google makes a lot of them open to the world. It's awesome to work on a product that's used by a zillion people every day. It's awesome to have people tell me they're die-hard fans of that other product, because it makes me feel like I'm a warrior in some sort of epic battle (even though I'm not).
I don't know what else to say right now. Ask me again in another six months.
3.24.2012
Polkadot ____
Our series begins when our main character Polkadot; a child who was not assigned a gender, is at an age when their gender identity is still forming and emerging. The first book in our series is entitled, "Polkadot Goes to Preschool." While Polkadot is the main character of the series, and therefore their gender identity is central, this series of books celebrate the beauty and validity of ALL gender identities.I won't pretend to know what it's like to be transgender, but I can imagine that reading this book, or better yet, growing up in a world where you're surrounded by people who have read this book, can only make it easier. To suggest to kids that the idea that maybe "I was born as a boy, therefore I'm a boy, it's that simple" might be wrong, it's a definite step in the right direction. So I threw the author a few dollars. Why not?
I also wrote up this blog post, which might bring in a few more for them, and it didn't even cost me anything! Now the trickier question. Should I try and get the word out to pro-LGBT people who might also contribute? Or should I instead get the word out to anti-LGBT groups, so that they can cause a big "controversy" over the fact that a book might teach children that people are different from each other, so that then even more pro-LGBT people will contribute, to spite the anti-LGBT people?
2.10.2012
Haskell adventure: Project Euler #191
Let's get to it. Already read the problem statement? Cool.
> import Control.Monad ( guard )> import Data.List ( groupBy> , isInfixOf> , sort > )One of the most obvious things you might want to do, especially since the problem statement used the word "string," would be to represent the O's, L's, and A's as Chars. But I think it's nicer to use a distinct type like this:
> data Day = O | L | A> deriving ( Eq, Show )As you'll see, it will also be helpful to have a list of the three possible "day" values:
> days :: [Day]> days = [O, L, A]Then we can represent a student's attendance record as a list of those values. (I'm calling it Record1 here because I'm later came up with a better representation, as you'll see.)
> type Record1 = [Day]How do we know whether a particular record is prize-winning or not? This is more or less just a translation of what the problem tells us.
> prize1 :: Record1 -> Bool> prize1 record = (not $ [A,A,A] `isInfixOf` record) && notLateTwice record>
> notLateTwice :: Record1 -> Bool> notLateTwice record = case filter (== L) record of> (L:L:_) -> False> _ -> True> prizes1 :: Int -> [Record1]> prizes1 0 = [[]]> prizes1 n = do> prevPrizeString <- prizes1 (n - 1)> nextDay <- days> let newString = nextDay:prevPrizeString> guard $ prize1 newString> return newString> checkRecord :: Record1 -> Bool> checkRecord (A:A:A:_) = False> checkRecord (L:ds) = L `notElem` ds> checkRecord _ = True> data Record2 = Record2 { consecutiveAbsences :: Int, lates :: Int }> deriving ( Eq, Ord, Show )> (#) :: Record2 -> Day -> Record2> r # O = r { consecutiveAbsences = 0 }> r # L = r { consecutiveAbsences = 0, lates = lates r + 1 }> r # A = r { consecutiveAbsences = consecutiveAbsences r + 1 }> prize2 :: Record2 -> Bool> prize2 r = consecutiveAbsences r < 3 && lates r < 2> prizes2 :: Int -> [Record2]> prizes2 0 = [Record2 0 0]> prizes2 n = do> r <- prizes2 (n - 1)> d <- days> let r' = r # d> guard (prize2 r')> return r'> prizes3 :: Int -> [(Record2, Integer)]> prizes3 0 = [(Record2 0 0, 1)]> prizes3 numDays = reduce $ do> (record, count) <- prizes3 (numDays - 1)> day <- days> let record' = record # day> guard (prize2 record')> return (record', count)> reduce :: [(Record2, Integer)] -> [(Record2, Integer)]> reduce = map f . group . sort where> group = groupBy (\(r,_) (s,_) -> r == s)> f list@((r,_):_) = (r, sum $ map snd list)
> prizeCount :: Int -> Integer> prizeCount = sum . map snd . prizes3> answer :: Integer> answer = prizeCount 302.07.2012
We win. Again.
But for those LGBT people who actually might like to get married, they're being told yet again, wait just a little bit longer. The lawyers have to talk this over just a bit more. Be patient, it'll happen eventually.
In short:
:-/
1.22.2012
If Programming Languages Were Types of Music
C++ would be Beethoven: To the untrained ear, it sounds just like Bach -- classical and easy to listen to. But once you start listening more closely, it's actually a lot more complicated than most people realize.
Java would be The Beatles: Familiar to almost everyone, simple and uncontroversial, though as time went on, they started adding more stuff to their act and getting a little weirder.
BASIC would be kids music: Everyone liked it when they were younger, but no one takes it seriously once they start listening to anything else.
JavaScript would be Lady Gaga: Everyone knows her hits and thinks they can play them even if they're not a musician, but few know how talented she really is.
Perl would be The Ugliest Piece of Music Ever Written: You're required to make fun of Perl when you write a post like this, right? (Skip to 7:45 if you just want to hear the song.)
Python would be OK Go: You watch them occasionally on YouTube, but you would never listen to a full album from them.
Haskell would be Radiohead: You've heard them a few times, but you've never really understood what they're singing about, or what their fans are talking about.
Ruby would be electronic music: It's not bad or anything, but fans of electronic music act like it's the best music in the world, and rarely listen to anything else. Most people don't see what the big deal is.
Edit: Thank you to commenter Mike for this one: Lisp would be Jazz: It was a big deal when it came out and supposedly it still has a big following, but you can't name a single person who likes it.
I apologize if I left out your favorite programming language. It's either because I'm not familiar with it, or I couldn't think of a good musical analogy. Leave a comment and let me know what type of music it would be.
8.04.2011
Prop 8 overturned one year ago
The complete text of Proposition 22:
This initiative measure adds a section to the Family Code; therefore, new provisions proposed to be added are printed in italic type to indicate that they are new.
SECTION 1. This act may be cited as the "California Defense of Marriage Act."
SECTION 2. Section 308.5 is added to the Family Code, to read:
308.5. Only marriage between a man and a woman is valid or recognized in California.
The complete text (pdf) of Proposition 8:
Prop 8 changes the Constitution, while Prop 22 only changed the Family Code. Much more importantly, Prop 8 has the word "thereto" in it. I think that means they hired more expensive lawyers in the intervening 8 years? Anyway, what was I saying? Right, so it's been a year since this court decision, but same-sex couples still can't actually get married here, because the Proposition 8 proponents are appealing the decision, so there's a stay on the decision. And, the court isn't actually considering their appeal yet because first they need to figure out whether the proponents even have standing to appeal. In other words: It's gonna be a while.This initiative measure expressly amends the California Constitution by adding a section thereto; therefore, new provisions proposed to be added are printed in italic type to indicate that they are new.
SECTION 1. Title
This measure shall be known and may be cited as the “California Marriage Protection Act.”SECTION 2. Section 7.5 is added to Article I of the California Constitution, to read:
SEC. 7.5. Only marriage between a man and a woman is valid or recognized in California.
11.26.2010
What I want for Christmas
- Nothing
- Make a Kiva loan. The best part about this one is, you probably get the money back eventually.
- Vote For Equality. Remember that gay marriage thing? Yeah, it turns out we still don't have it, and this is a great, volunteer-based organization that is really doing the work to make sure we win if this comes to a vote again.
- Speaking of which, you could also donate to the American Foundation for Equal Rights, who is fighting prop 8 in court right now.
- You've probably heard about The Trevor Project -- a hotline to help LGBT kids who are thinking about committing suicide.
- I think you've probably heard of Teach For America, which encourages college graduates to teach for a couple years, before or instead of getting a more typical job. Even though they didn't accept me, they're still great.
10.20.2010
Maggie Gallagher on gay teen suicides
Toward the end of that post, they say:
If Maggie Gallagher is actually concerned with queer youth as she says she is, perhaps she could donate to the Ali Forney Center to help some teens find a place to stay so that they don't have to get caught up in the violence that she knows so much about. Of course she won't, because she's a clown who doesn't really care about much other than advancing her agenda.So I posted this on NOM's blog:
Think she'll do it?Maggie, call this blogger's bluff!
http://www.bilerico.com/2010/10/who_cares_about_queer_youth_not_maggie_gallagher.php
Donate to the Ali Forney Center or the Trevor Project
, or even just publically state your support for anti-bullying laws.
As you say, "These kids need help, real help." So do something that will actually give them that support.