SRT Solutions

Blogs

Browse by Tags

  • euler problem #5

    What is the smallest number that is evenly divisible by all of the numbers from 1 to 20? ---- To solve this problem easily, we need to remember that the smallest number that is evenly divisible by two numbers is their least common multiple. Armed with this knowledge (and the fact that ruby already has...
    Posted to Lazy Evaluation (Weblog) by mfedner on Thu, May 1 2008
  • Euler Problem 4

    Find the largest palindrome made from the product of two 3-digit numbers. ----- First, I defined a palindrome recursively: a number is one if its first and last digits are the same, and if the inside is also a palindrome. def palindrome?(digitArr) if digitArr.empty? true elsif digitArr.length == 1 true...
    Posted to Lazy Evaluation (Weblog) by mfedner on Tue, Apr 8 2008
  • Euler Problem 3

    What is the largest prime factor of the number 600851475143 ? ----- I wrote this piece of disgusting, un-Rubylike Ruby to get the answer by creating a list of a number's prime factors: def factor(composite) i=1 flag=false primefactors =[] while (i < composite) i=i+1 primefactors.each{|p| flag...
    Posted to Lazy Evaluation (Weblog) by mfedner on Tue, Apr 8 2008
  • SRT Polyglotting Euler Problems

    I was first introduced to the term polyglot when I was in high school. Our French class did a presentation at a Foreign Language Day. I have this vague recollection that the theme of the day was "Polyglots Have More Fun". I've always liked the word, so I was thrilled to see Neal Ford using...
    Posted to SRT Insights (Weblog) by dmarsh on Tue, Apr 8 2008
  • Project Euler: Problem 2

    The problem: Find the sum of all the even-valued terms in the [Fibonacci] sequence which do not exceed four million. Here's my fibonacci function: def fib(limit =nil) f1 = 0 f2 = 1 while (not limit or f2 <= limit) yield f2 f1,f2 = f2, f1+f2 end end And here's how I use it to get the answer...
    Posted to Lazy Evaluation (Weblog) by mfedner on Sun, Apr 6 2008
  • Project Euler in Ruby

    I'm taking Bill Wagner up on his Project Euler challenge , but in Ruby. I've secretly wanted to learn Ruby for a long time, and this looks like the perfect chance. So if my code makes your eyes bleed, it's cause I'm a total n00b. Without further ado (because the excitement was becoming...
    Posted to Lazy Evaluation (Weblog) by mfedner on Sun, Apr 6 2008
  • Correction: AACS speaker canceled. Lightning talks tonight

    If you're in town, feel free to show up for lightning talks. Pizza is still expected. I hope that we're able to rescheule Joe O'Brien for sometime soon. I was really looking forward to his talk.
    Posted to Dianne Marsh (Weblog) by dmarsh on Wed, Feb 6 2008
  • AACS meeting tonight: still on

    Joe O'Brien is braving the weather, en route from Columbus up to Ann Arbor for tonight's Ann Arbor Computer Society meeting. Ann Arbor is getting some ice, but evidently the rest of the area seems to be getting snow. If you're already in Ann Arbor, definitely stop by. I'm, sadly, not...
    Posted to Dianne Marsh (Weblog) by dmarsh on Wed, Feb 6 2008
  • Joe O'Brien at AACS on Wednesday

    Joe O'Brien, of the Columbus Ruby Brigade and EdgeCase, will be in Ann Arbor this week. He's presenting a talk at the Ann Arbor Computer Society - "Domain Specific Languages: Molding Ruby". A summary appears below. "Ever wondered what all the fuss is about when it comes to DSL's...
    Posted to Dianne Marsh (Weblog) by dmarsh on Sat, Feb 2 2008
  • Ann Arbor Area User Group Listing

    Ann Arbor Area User Groups SRT Solutions strongly supports the local user groups. We believe that enabling developers to connect with one another and be exposed to different technologies provides a navigable path through a field where technology changes very quickly. This is good for our employees as...
    Posted to SRT Insights (Weblog) by dmarsh on Thu, Nov 15 2007

Ann Arbor Give Camp started with Jennifer Marsman , of Microsoft, wanting to organize an event to pull together the developer community in the Ann Arbor...