<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Hi, this is Ganesh Gunasegaran, a software craftsman from INDIA. This site is for my personal ramblings.</description><title>It's GG</title><generator>Tumblr (3.0; @itsgg)</generator><link>http://itsgg.com/</link><item><title>My office setup….</title><description>&lt;img src="http://27.media.tumblr.com/tumblr_kxcs5vIH551qzkjzco1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;My office setup….&lt;/p&gt;</description><link>http://itsgg.com/post/371828248</link><guid>http://itsgg.com/post/371828248</guid><pubDate>Fri, 05 Feb 2010 10:49:41 +0530</pubDate></item><item><title>New proc syntax in 1.9</title><description>&lt;pre&gt;BEGIN {
  puts "Ruby Version : #{RUBY_VERSION}"
}

succ = -&gt;(x=0) { x + 1 }
p succ.call
p succ.call(2)

successor = Proc.new {|x=0| x + 1}
p successor.call
p successor.call(10)
&lt;/pre&gt;
&lt;p&gt;Output&lt;/p&gt;
&lt;pre&gt;Ruby Version : 1.9.1
1
3
1
11
&lt;/pre&gt;
&lt;p&gt;But thanks, I will stick with the old syntax!&lt;/p&gt;</description><link>http://itsgg.com/post/316542902</link><guid>http://itsgg.com/post/316542902</guid><pubDate>Mon, 04 Jan 2010 22:37:36 +0530</pubDate><category>ruby</category><category>snippet</category></item><item><title>Fibers in Ruby 1.9</title><description>&lt;pre&gt;class Fib
  include Enumerable
  
  def initialize(stop_at)
    @count = 0
    @stop_at = stop_at
    @first, @second = 0, 1
    @fiber = Fiber.new do
      loop do
        @first, @second = @second, @first + @second
        @count += 1
        Fiber.yield @first
      end
    end
  end
  
  def next
    @fiber.resume
  end
  
  def rewind
    @first, @second = 0, 1
  end
  
  def each
    loop do
      @count == @stop_at ? break : yield(self.next)
    end
  end
end

# Print the first 20 fibonacci numbers
Fib.new(20).each do |elem|
  puts elem
end
&lt;/pre&gt;
&lt;p&gt;Output&lt;/p&gt;
&lt;pre&gt;1
1
2
3
5
8
13
21
34
55
89
144
233
377
610
987
1597
2584
4181
6765
&lt;/pre&gt;</description><link>http://itsgg.com/post/314837512</link><guid>http://itsgg.com/post/314837512</guid><pubDate>Sun, 03 Jan 2010 22:44:59 +0530</pubDate><category>ruby</category><category>snippet</category></item><item><title>tap method in Ruby 1.9</title><description>&lt;pre&gt;str = "Hello GG"

str.tap {|x| puts "str : #{x}"}
  .each_char.tap {|x| puts "each_char : #{x}"}
  .sort.tap {|x| puts "sort : #{x}"}
&lt;/pre&gt;
&lt;p&gt;Output&lt;/p&gt;
&lt;pre&gt;str : Hello GG
each_char : #
sort : [" ", "G", "G", "H", "e", "l", "l", "o"]
&lt;/pre&gt;</description><link>http://itsgg.com/post/309725798</link><guid>http://itsgg.com/post/309725798</guid><pubDate>Thu, 31 Dec 2009 19:23:00 +0530</pubDate><category>ruby</category><category>snippets</category></item><item><title>Photo</title><description>&lt;img src="http://26.media.tumblr.com/tumblr_kvh4nwApgZ1qzkjzco1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://itsgg.com/post/308113037</link><guid>http://itsgg.com/post/308113037</guid><pubDate>Wed, 30 Dec 2009 22:03:32 +0530</pubDate></item><item><title>It is never too early to walk!</title><description>&lt;img src="http://28.media.tumblr.com/tumblr_kvh480JFtL1qzkjzco1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;It is never too early to walk!&lt;/p&gt;</description><link>http://itsgg.com/post/308101575</link><guid>http://itsgg.com/post/308101575</guid><pubDate>Wed, 30 Dec 2009 21:54:00 +0530</pubDate></item><item><title>Photo</title><description>&lt;img src="http://26.media.tumblr.com/tumblr_krygiv9Xn31qzkjzco1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://itsgg.com/post/220726369</link><guid>http://itsgg.com/post/220726369</guid><pubDate>Fri, 23 Oct 2009 12:24:11 +0530</pubDate></item><item><title>Photo</title><description>&lt;img src="http://28.media.tumblr.com/tumblr_kr4yqwdRdN1qzkjzco1_400.png"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://itsgg.com/post/206565357</link><guid>http://itsgg.com/post/206565357</guid><pubDate>Wed, 07 Oct 2009 14:10:08 +0530</pubDate></item><item><title>Homebase</title><description>&lt;img src="http://26.media.tumblr.com/tumblr_kqimyfKUv11qzkjzco1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Homebase&lt;/p&gt;</description><link>http://itsgg.com/post/196452390</link><guid>http://itsgg.com/post/196452390</guid><pubDate>Fri, 25 Sep 2009 12:48:06 +0530</pubDate></item><item><title>Hello Dad!!</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_kqdj7xxszo1qzkjzco1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Hello Dad!!&lt;/p&gt;</description><link>http://itsgg.com/post/194136921</link><guid>http://itsgg.com/post/194136921</guid><pubDate>Tue, 22 Sep 2009 18:39:15 +0530</pubDate></item><item><title>Poor man's website downloader</title><description>&lt;p&gt;&lt;pre&gt;alias wgetr="wget -rSNpk -np --execute 
  robots=off -U \"Mozilla/5.001 (windows; U; NT4.0; en-us) 
  Gecko/25250101\" $@"
&lt;/pre&gt;&lt;/p&gt;</description><link>http://itsgg.com/post/176348127</link><guid>http://itsgg.com/post/176348127</guid><pubDate>Mon, 31 Aug 2009 22:06:00 +0530</pubDate><category>snippets</category></item><item><title>Mixins in Scheme</title><description>&lt;p&gt;&lt;pre&gt;#lang scheme

(define person% (class object% 
		       (init name)
		       (super-new)
		       (define current-name name)
		       (define/public (set-name name)
			 (set! current-name name))
		       (define/public (get-name)
			 current-name)))

(define (talkable-person %)
  (class % (super-new) 
	 (define/public (talk)
	   "blah blah")))

(define talking-person% (talkable-person person%))

(define gg (new talking-person% (name "GG")))
(send gg get-name)
(send gg talk)

bash-3.2$ mzscheme mixin.ss 
"GG"
"blah blah"
&lt;/pre&gt;&lt;/p&gt;</description><link>http://itsgg.com/post/176072276</link><guid>http://itsgg.com/post/176072276</guid><pubDate>Mon, 31 Aug 2009 11:14:27 +0530</pubDate><category>scheme</category></item><item><title>Interfaces in Scheme</title><description>&lt;p&gt;&lt;pre&gt;#lang scheme

(define person-interface (interface() get-name set-name))

(define person% (class* object% (person-interface)
			(init name)
			(define current-name name)
			(super-new)
			(define/public (get-name)
			  current-name)
			(define/public (set-name name)
			  (set! current-name name))
			))

(define gg (new person% [name "GG"]))
(send gg get-name)
(send gg set-name "Ganesh Gunasegaran")
(send gg get-name)

(is-a? gg person-interface)
(is-a? gg person%)


bash-3.2$ mzscheme oops.ss
"GG"
"Ganesh Gunasegaran"
#t
#t
&lt;/pre&gt;&lt;/p&gt;</description><link>http://itsgg.com/post/176063139</link><guid>http://itsgg.com/post/176063139</guid><pubDate>Mon, 31 Aug 2009 10:59:00 +0530</pubDate><category>scheme</category></item><item><title>Wanna fight?</title><description>&lt;img src="http://26.media.tumblr.com/tumblr_kozvjmMnJ61qzkjzco1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Wanna fight?&lt;/p&gt;</description><link>http://itsgg.com/post/172252824</link><guid>http://itsgg.com/post/172252824</guid><pubDate>Wed, 26 Aug 2009 23:05:46 +0530</pubDate><category>Akshita</category></item><item><title>while hungry 
       ping mom
end</title><description>&lt;img src="http://28.media.tumblr.com/tumblr_kozv7tZvLL1qzkjzco1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;while hungry &lt;br/&gt;
       ping mom&lt;br/&gt;
end&lt;/p&gt;</description><link>http://itsgg.com/post/172248689</link><guid>http://itsgg.com/post/172248689</guid><pubDate>Wed, 26 Aug 2009 22:58:00 +0530</pubDate><category>Akshita</category></item><item><title>This is odd, github showing dev trace?</title><description>&lt;img src="http://28.media.tumblr.com/tumblr_komz5zOmim1qzkjzco1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;This is odd, github showing dev trace?&lt;/p&gt;</description><link>http://itsgg.com/post/166666589</link><guid>http://itsgg.com/post/166666589</guid><pubDate>Wed, 19 Aug 2009 23:55:11 +0530</pubDate><category>oops</category></item><item><title>Announcing baby girl GA release :P</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_komvx1sseX1qzkjzco1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Announcing baby girl GA release :P&lt;/p&gt;</description><link>http://itsgg.com/post/166623715</link><guid>http://itsgg.com/post/166623715</guid><pubDate>Wed, 19 Aug 2009 22:45:01 +0530</pubDate></item><item><title>Easy comment/uncomment selection in emacs</title><description>&lt;p&gt;Add this to .emacs&lt;/p&gt;
&lt;pre&gt;;; Comment/Uncomment region
(global-set-key (kbd "s-/") 'comment-dwim)
&lt;/pre&gt;
&lt;p&gt;Toggle comment of the selected region by pressing Apple + /&lt;/p&gt;</description><link>http://itsgg.com/post/164205455</link><guid>http://itsgg.com/post/164205455</guid><pubDate>Sun, 16 Aug 2009 21:12:54 +0530</pubDate><category>emacs</category></item><item><title>OOP in Scheme</title><description>&lt;p&gt;&lt;pre&gt;#lang scheme

(define student% (class object%
                  (init name age)
                  
                  (define this-name name)
                  (define this-age age)                  
                  
                  (super-new)
                  
                  (define/public (get-name)
                    this-name)
                  
                  (define/public (set-name name)
                    (set! this-name name))
                  
                  (define/public (get-age)
                    this-age)
                  
                  (define/public (set-age age)
                    (set! this-age age))
                  ))
&lt;/pre&gt;
&lt;pre&gt;&gt; (define gg (new student% [name "Ganesh"] [age 28]))
&gt; (send gg get-name)
"Ganesh"
&gt; (send gg get-age)
28
&gt; (send gg set-name "GG")
&gt; (send gg get-name)
"GG"
&lt;/pre&gt;&lt;/p&gt;</description><link>http://itsgg.com/post/163486828</link><guid>http://itsgg.com/post/163486828</guid><pubDate>Sat, 15 Aug 2009 17:38:11 +0530</pubDate><category>scheme</category></item><item><title>parameterized procedures in Scheme</title><description>&lt;p&gt;&lt;pre&gt;(define fav-color (make-parameter 'blue))

(define whats-ur-fav-color? 
  (lambda ()
    (fav-color)))
&gt; (whats-ur-fav-color?)
blue
&gt; (parameterize ((fav-color 'red))
             (whats-ur-fav-color?))
red
&lt;/pre&gt;&lt;/p&gt;</description><link>http://itsgg.com/post/162907848</link><guid>http://itsgg.com/post/162907848</guid><pubDate>Fri, 14 Aug 2009 22:29:00 +0530</pubDate><category>scheme</category></item></channel></rss>
