~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
nil.val / 5 months ago
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-

Ruby lets you do the strangest things.

  
  class NilClass
    def val
      @val||=0
      @val+=1
    end
  end
  
  Array.new(10).map{|x|x.val}   ## => [1,2,3,4,5,6,7,8,9,10]
  

$100 to anybody who can go to RubyConf and give a scheduled talk about hiding variables in nil under the pretense of security. $200 for talking for the entire designated time without getting thrown out.

--------------------
:::Comments:::

(New comment)
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Privacy Policy / 5 months ago
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-

I was recently required to choose between a handful of retirement-plan vendors, so I’ve had some information booklets lying around. One day on a stroke of pure reckless abandon, I decided to read a couple of the privacy policies, just to see what it said. Of the two I read, MetLife’s struck me as most interesting.

For instance, one of the reasons they list for why they might have to share information is to “help us prevent […] terrorism […] by verifying what we know about you.” Not to mention the all-inclusive reason: “Help us run our business”.

Then there’s “How We Get Information”. I may as well quote verbatim here:

What we know about you we get mostly from you. But we may also have to find out more from other sources to make sure that what we know is correct and complete. Those sources may include adult relatives, employers, consumer reporting agencies and others. Some sources may give us reports and may disclose what they know to others.

(emphasis mine)

As a software engineer, I’m particularly struck by the specificity of their method for protecting computer data: “We also take steps to make our computer data bases secure and to safeguard the information we have.” Good. I’m glad they’ve taken steps. The other privacy policy I read listed five specific techniques they use to protect computer data.

I didn’t choose MetLife.

This makes me want to start a Privacy-Wiki where people can read privacy policies and EULAs and create summaries for mass consumption. That’d make it harder for companies to hide things.

--------------------
:::Comments:::

(New comment)
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Very Prime Primes / 5 months ago
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-

I just finished the Math Book, which means I've done a lot of reading about various mathematical discoveries, which means I'm feeling terribly jealous that I couldn't have discovered any of them myself (since of course half of them look obvious in hindsight).

So to help myself cope I'm going to pretend I discovered something interesting. Here's how it goes:

Define a sequence of numbers called P1, which are simply the prime numbers (so P1(1) = 2, P1(2) = 3, P1(3) = 5, etc.). Then define a second sequence P2 which simply indexes P1 into itself, so

  • P2(1) = P1(P1(1)) = 3
  • P2(2) = P1(P1(2)) = 5
  • P2(3) = P1(P1(3)) = 11
These are the prime-primes - the primes whose indices are also prime (i.e., the 2nd prime, the 3rd prime, the 5th prime, the 7th prime, the 11th prime, etc.). Of course the next step is to do this again. And again. Which gives us the following infinite sequence of infinite sequences:

P1235711131719 ...
P235111731415967
P35113159127179277331
P41131127277709106317872221
P5311277091787538185271529919577
P61277095381152995271187803167449219613
P7709538152711167449648391112888922697333042161
P853815271164839122697339737333176248133713921350728129
...

Finally we define a new sequence by taking the sum of the top-right to bottom-left diagonals (which I striped colorfully for your convenience):

2, 6, 15, 40, 121, 484, 2589, 18896, 180243, 2176090, 32236017, 571516348

This sequence isn't in the Encyclopedia of Integer Sequences, so that must mean that I've discovered something interesting. Couldn't possibly mean anything else. I'm sure it's just been overlooked up till now.

Anyways, if you factor the numbers, it looks like it might be mildly interesting:

  • 2 = 2
  • 6 = 2·3
  • 15 = 3·5
  • 40 = 2·2·2·5
  • 121 = 11·11
  • 484 = 2·2·11·11
  • 2589 = 3·863
  • 18896 = 2·2·2·2·1181
  • 180243 = 3·3·7·2861
  • 2176090 = 2·5·7·7·4441
  • 32236017 = 3·11·976849
  • 571516348 = 2·2·13·89·123491
Oh who am I kidding? There's nothing interesting here.

Stupid math.

--------------------
:::Comments:::

(New comment)