아! 박경완!
전 골수 SK 팬은 아니지만, 그래도 2차 연고(-서울에서 나고 유년기를 보냈지만, 인생의 절반 이상은 인천에서 산 관계로)에 따라 SK를 응원하기는 합니다. 어찌되었건... 어제는 술 약속 때문에 경기를 못 봤는데 주전 포수 박경완 선수가 큰 부상을 당하셨더군요. 사실상 시즌 아웃이라는데 정말 안타깝습니다. 전력의 반이라 평가받고있는데 말이죠. ㅠㅠ 한참 두산과 박빙의 1,2위 싸움을 벌이고 있는데 전력에 큰 공백이 생겼으니 앞으로 어떻게 될지 염려스럽네요. 박경완 선수의 빠르 쾌차를 기원하며 내년에 다시 좋은 모습 보여주시리라 믿습니다. 흑...
by 허진영 | 2009/06/25 13:50 | 트랙백 | 덧글(0)
RailsConf 2009 in Las Vegas, May 4-9
This is too late posting - about 1 month -.. Sorry!! :-)

Happening May 4-7, 2009 at the Las Vegas Hilton, RailsConf is the official event for the Ruby on Rails community. And it is the largest official conference dedicated to everything Rails. As you know, Ruby and Ruby on Rails is the heart of CLIK system, so the conference was also important to us. The conference is consist of 1 tutorial day and 3 session days. As most other IT conferences, they have multi-track sessions, it is only one bad thing of the conference to me (in this respect, I like RubyFringe). :-)

In first day, I attended two tutorials. One was "Running the Show: Configuration Management with Chef" and another one was "Testing, Design, and Refactoring". Chef is a system configuration management tool like Puppet. It is the latest development in open source systems integration, a powerful Ruby-based framework for managing servers in a way that integrates tightly with applications and infrastructure. If you want change, modify existing systems or set new machine, just access to Chef and run its command once. It will benefit only Rails systems, but also general UNIX systems. APCC has several Unix/Linux systems include CLIK, so if we use Chef to our systems, it should be helpful to reduce system management cost - time, money, man power, mistake, and so on. I hope our team has a opportunity to use it later. Testing (especially automated testing) and Refactoring are recent day’s big issues for software developers. Most developers wish to be a guru of them, but it's easy to get. So the second tutorial was very popular and interesting. However, the tutorial aimed to introduce Testing and Refactoring to common developers and motivate them to do it. So it couldn’t dig to deep side – advance topic – of Testing and Refactoring.

In session days, I attended many sessions as possible as I can. They organized 5 sessions in one time and 4 or 5 times in a day. A lot of various topics were talked and discussed in each session. Scaling, performance, architectural design, user interface design, testing, code quality, patterns and so on. I couldn’t attend all of them, so I chose sessions about performance and code quality. In Ruby and Ruby on Rails community, the performance is still important issues. Because a ability of handling heavy load environment – we call it ‘enterprise’ – is important barometer of that Ruby and Ruby on Rails can be major programming language or not. Many developers and companies showed how to they improved performance and solved their problems. Code quality is also important issue for every IT project. Because bad quality codes can lead to unexpected errors, hard maintenance, increasing cost in various fields. Sometimes it can be a reason of project failure. Nowadays, developers are trying to improve code quality with automated code quality checker. Of course, they can not guarantee high quality by only use them but it’s so helpful to figure out which codes are duplicated, bad style, etc. Metirc_fu is one of the automated code quality checking frameworks. Most significant feature of it, it uses several other frameworks for making code quality reporting. So the result is more helpful than using single framework and can reduce human effort to use several each framework. After came back Korea, I tested Metric_fu and I was very surprised how CLIK has many points which potentially be a problem in future. We’ve been improving CLIK source quality based on the result report and we’re going to use Metric_fu continuously.

Most impressive session, technically it’s not a session – it was a keynote – was Robert C. Martin (we call him Uncle Bob)’s presentation “What Killed Smalltalk Could Kill Ruby Too”. Smalltalk is pretty elegant and powerful Object-Oriented programming language and it was so popular from end if 1970’s, through 1980’s, to mid of 1990’s. Many good practices and patterns came from Smalltalk community, for instance, Refactoring, Test Driven Development, object oriented software design and so on. And Ruby and Python have been influenced by Smalltalk. However, recent days, comparing to Java/C and C++/C#, not many developers use it to their project even Smalltalk is so powerful. Anyway, by the really exciting key note, he gave us – Ruby and Ruby on Rails developers – several topics that we should think about. Although there many pros and cons on the internet about his key note, it was a valuable time to me and other Ruby on Rails developers, I think.

For days are not long times to talk about deep side of one thing, however, I was influenced many other developer’s knowledge and passion and I can get some useful ideas how we work with our CLIK system better. I hope I can have other opportunity to attend RailsConf again.


by 허진영 | 2009/06/17 16:11 | English Posting | 트랙백 | 덧글(1)
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 = []
  end
 
  def add(block)
    @blocks[index(block.x, block.y)] = block
    block.board = self
    block
  end
 
  def get_block(x,y)
    @blocks[index(x,y)] if inside_board?(x,y)
  end
 
  def to_s
    str = ""
    @blocks.each_with_index do |block, index|
      str += "\n" if (index > 0 and (index+1) % @cols == 0)
      str += block.to_s    
    end
    str
  end
 
  def friends_of(block)
    candidates = []
    (block.x-1).upto(block.x+1) do |target_x|
      (block.y-1).upto(block.y) do |target_y|
        candidates << get_block(target_x, target_y)
      end
    end
    candidates.compact
  end
 
  #sometimes, minus index of Ruby array leads extra work. :-<
  def inside_board?(x,y)
    (x >= 0 and x < @cols and y >= 0 and y < @rows)
  end
 
  def index(x, y)
    @cols * y + x
  end
end
by 허진영 | 2009/06/16 17:17 | English Posting | 트랙백 | 덧글(0)
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 is huge size (for instance, 405060 X 405060). But I don't have enough space to write it :-). Anyway below code has only one if and one case statement. It's so cool, isn't it? :-)

class Board
  def initialize(rows, cols)
    @rows, @cols = rows, cols
    @blocks = []
    rows.times { @blocks << [] }
  end
 
  def add(block)
    @blocks[block.y][block.x] = block
    block.board = self
    block
  end
 
  def get_block(x,y)
    @blocks[y][x] if inside_board?(x,y)
  end
 
  def to_s
    @blocks.map{ |line| line.map(&:to_s).join }.join("\n")
  end
 
  def friends_of(block)
    candidates = []
    (block.x-1).upto(block.x+1) do |target_x|
      (block.y-1).upto(block.y) do |target_y|
        candidates << get_block(target_x, target_y)
      end
    end
    candidates.compact
  end
 
  #sometimes, minus index of Ruby array leads extra work. :-<
  def inside_board?(x,y)
    (x >= 0 and x < @cols and y >= 0 and y < @rows)
  end
end

class Block
  attr_accessor :board, :x, :y, :around_mine_number
 
  def self.make(type, x, y)
    case type
    when '*' then MineBlock.new(x, y)
    when '.' then NormalBlock.new(x, y)
    end
  end
 
  def initialize(x, y)
    @x, @y = x, y
    @around_mine_number = 0
  end
 
  def update_with_around_blocks
    @board.friends_of(self).each do |f|
      f.update_mine_status(self)
      self.update_mine_status(f)
    end
  end
end

class MineBlock < Block
  def to_s; '*'; end
 
  def update_mine_status(other)
    other.around_mine_number += 1
  end
end

class NormalBlock < Block
  def to_s; @around_mine_number; end
 
  def update_mine_status(other); end
end

inputs = "5 3  *..  *..  ... .*. ...".split(' ')

num_of_rows, num_of_cols = inputs.slice!(0..1).map(&:to_i)
board = Board.new(num_of_rows, num_of_cols)
num_of_rows.times do |row|
  marks = inputs.slice!(0).split('')
  num_of_cols.times do |col|
    assigned_block = board.add(Block.make(marks[col], col, row))
    assigned_block.update_with_around_blocks
  end
end

puts board

PS. Egloos is not good for code posing.
by 허진영 | 2009/06/16 15:51 | English Posting | 트랙백(1) | 핑백(1) | 덧글(5)
Don't merge seperated Google analytics javascript.
I was a idiot. Yeah.. I thought if I merge two Google analytics javasciprt section to one, it would be helpful to reduce our CLIK loading time like below:

Original:
<script type="text/javascript">
        //google analytics enabling code
        var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
        document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
        try {
          var pageTracker = _gat._getTracker("UA-XXXXXXX-1");
          pageTracker._trackPageview();
        } catch(err) {}
</script>

My mistake:
<script type="text/javascript">
        //google analytics enabling code
        var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
        document.write(unescape("%3Cscript src='" + gaJsHost +"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

        try {
          var pageTracker = _gat._getTracker("UA-XXXXXXX-1");
          pageTracker._trackPageview();
        } catch(err) {}
</script>

Since I did it (May 24), our access statistics in Google analytics shows wrong result. During the period CLIK never had serviced anything to user according to the alaytics. But our team accessed CLIK and some our user also use CLIK during the period. (May 25 ~ June 2)
I re-changed it in June 3, then it works correclty. :-)
by 허진영 | 2009/06/05 11:16 | English Posting | 트랙백 | 덧글(2)


<< 이전 페이지 | 다음 페이지 >>


누구냐, 너?

훌륭한 소프트웨어는 머리가 아니라 마음으로 만드는 것이다.
by 허진영
Candle



태그
이글루 파인더
카테고리
최근 등록된 덧글
최근 등록된 트랙백
싸부 ~ 받아유~~ ㅋㅋ
by is 윤군!
MediaWiki 설치 하기
by With Sol &amp; Jinny...
피터가 말했습니다. 2008.12.31
by dazzilove
피터가 말한 23쪽.
by [HelolS] 꼬라지 하고는.. ;;
피터가 말했습니다.
by 정의의소의 블로그
피터가 말했습니다.
by The note of Legendre
종부세 기준 내년부터 6억원→..
by 정책공감 - 소통하는 정부대표..
용우의 생각
by mixed's me2DAY
용우의 생각
by mixed's me2DAY
눈뜨고는 볼 수 없는 일
by nooegoch
이전 블로그
라이프 로그
포토로그
rss

skin by 이글루스