태그 : ruby 요약보기전체보기목록닫기

1 2

Minesweeper 1 dimension version.

In last post, I used 2 dimension array. Below is 1 dimension version. class Board   def initialize(rows, cols)     @rows, @cols = rows, cols     @blocks = [...

Find mines!!

Actually this quiz came from 'minesweeper' of programming challenges. It's not difficult code, so skip explanation. And I have another idea that can reduce amount of memory usage when input data ...

We've got the first place in the grand prix of Fukuoka Ruby Award 2009!!

We did it!! Our CLIK won the competition!! Thanks to our Climate Application Team(CAT in APCC21) - Dr. Saji, Kyong-Hee An, Young-Mi Min. They are pretty brilliant people, so I'm honored that I can w...

Simple type safe enum in Ruby

module Kernel   def enum(*syms)     new_class = Class.new do       def initialize(name)      &...

Ruby/Rails program for my family #3

OK. Time to play with server side. I'll show all building step of building server side expect install rails and deploy it. You can find some nice documents on the internet. :-) At first, I need ...

Ruby/Rails program for my family #2

Here is the montoring program. It is run by cron at every 5 minutes. It call target site's target page with specific query url (because, it is searching result page). Then it parse html through hpri...

Ruby/Rails program for my family #1

Since our son was born (8/2007), we often bought second hand toys for our son on the Internet. Sometimes we could get some items very easy with reasonable price. But sometimes it's so difficult, bec...

play with Symbol#to_proc

If you are reasonable rails developer, you are so familiar with " &:symbol ". Have you thought how it work?Start with '&' operator. If you pass something with '&' to method, ruby think t...

Coding Dojo - Four Boxes by Ruby (Improved)

Four Boxes (I translated this quest from http://xper.org/wiki/seminar/FourBoxes) Quest There are four rectangles in plan and all their base of four rectangles are in parallel with the horizontal ...

Coding Dojo - Amicable_Pair by Ruby

def sum_of_divisors(num)   divisors = [1]   (2..Math::sqrt(num)).each do |e|     if num % e == 0       divisors << e    &n...
1 2


구글애드센스