Pages

Sunday, November 13, 2011

Steve Jobs steamed well

Being technology hypothetical and haunting web, I could see people honoring and paying tribute to some one who is no longer alive, to happy the conservatory ones(Remember Swiss bank) who tried to meta retweet, meta liked posts in facebook to let it know that it can relevantly push some Apple store Ads and halted at one point thinking no longer these buffaloes can be milked, as hands started paining. But if you think whom I am honoring here, i am delegating that to decide at your discretion.

Steve Jobs, founder and CEO of Apple, who died recently pioneered the personal computer, though microsoft took over business in PC era. Quite dissatisfied by the Apple board directors, where his products intended to create for educational sectors didn't went well, forced Jobs to quite and start his new company Next. His new founded company developed a wide range of software and hardware. Company uprooted when Jobs could succeed by developing object oriented OS 'NextStep', that uses a hybrid kernel(monolithic of XNU and microkernel of Mach) and using Objective C, which took BSD(a Unix variant), modified at architecture level.

This made Apple to realize and call back Jobs by acquiring his company 'Next'. Jobs return made Apple to raise its eyebrows by his stunning leadership qualities, where he is good at driving ideas and innovation, could figure out exactly what people needed and see implementation. One cannot forget the man behind iPod, iPhone, iPad(what next would be? iP*****;)) that took company to heights, revealing his product creativity genius. Jobs suffered from a rare form of pancreatic cancer, a terrible disease but he could sustain and extend his life span bit more due to latest medical innovations happening in that stream.

One of his greatest strength - leadership being hostile to his employees by stripping down many unwanted products and conflicting ideas, which might have taken a stroll on Apples growth. Despite large insignificant number of mentions in social media streams to my dismay, his coveted, elite products went well with channeled marketing strategy. His notable incident include when ipod design was first rejected, not appealing his sensations when employee took the prototype to him. When employees remained unclear about the rejection, he put it on a water tank and notified them of water bubbles that occupied empty space, reaching bottom.

On large, Dennis Ritchie was the man indirectly behind his(and many other) success, who created C language and Unix OS(which Steve Jobs took off the base for MacOS), where he also passed away following Jobs to super world, without knowing why he got less number of mentions. Without him, we would have not seen Windows, Linux, Minix, Mac and C++, C# and other languages. Hmm, you might say that's what applicative business mind is all about!.

Jobs being identified on his own strength, nothing makes me to flirt, one - MacOS requiring extensive, expensive Hardware to run due to the inappropriate design, second - Objective C being informal OO language and irritating, clumsy development, third - not strategizing MacRuby and pioneering it as a mainstream Apple language, fourth - most important Apple could make products only for hi-fi business magnets who will be ready to spend money lavish, not for common ones. Though Jobs at small corner thumping minimal at my heart, I am deeply saddened by the death of Dennis Ritchie and how come can we forget G.D.Naidu and his contributions?

P.S - It is also to be noted MacOS being greatly affected by virus more than windows, though systems lesser in number

Wednesday, August 17, 2011

Ruby GUI and FXRuby Installation

Why about GUI and FXRuby all of a sudden?

Its a tremendous movement we made from desktop to web 2.0 apps and again back to native desktop apps(iphone/ipad) Seesmic/Tweetdeck apps broadly classifying as RIA.

Hence my long time dream, has been pondering about throwing the silver cup of Java swing and bringing platinum Ruby stones in GUI front, finding space in replacing existing legacy Java swing applications with a neat Ruby GUI like TK-Ruby.

To my horror, nothing has been honored in Ruby world apart from Rails and geeks see Ruby as a Web DSL and where as rails has made routes.rb itself a DSL.

I forayed to figure out any Ruby GUI library in par with AIR/Silverlight, but my search collaboration with mountain view only ended up in disparity.

Finally ended up in installing FXRuby to see fortune in it, written a small GUI ruby program as below,


require 'rubygems'
require 'fox16'
include Fox


application = FXApp.new("CompositeGUI", "CompositeGUI")
main_window = FXMainWindow.new(application, "Composite",nil, nil, DECOR_ALL)
main_window.width = 400
main_window.height = 200


#Vertical Frame
super_frame = FXVerticalFrame.new(main_window,LAYOUT_FILL_X|LAYOUT_FILL_Y)
FXLabel.new(super_frame, "Text Editor Application")


#Horizontal Frame
text_editor = FXHorizontalFrame.new(super_frame,LAYOUT_FILL_X|LAYOUT_FILL_Y)
text = FXText.new(text_editor, nil, 0,TEXT_READONLY|TEXT_WORDWRAP|LAYOUT_FILL_X|LAYOUT_FILL_Y)
text.text = "This is some text."


# Button bar along the bottom
button_frame = FXVerticalFrame.new(text_editor,LAYOUT_SIDE_RIGHT|LAYOUT_FILL_Y)
FXButton.new(button_frame, "Cut")
FXButton.new(button_frame, "Copy")
FXButton.new(button_frame, "Paste")


#create FX application and run
application.create
main_window.show(PLACEMENT_SCREEN)
application.run 


and when I ran, landed with the below error message,

LoadError: no such file to load -- fox16.so from line no 2 require 'fox16'
I installed fxruby-1.6.20-x86-linux.gem and wondering any fox library kit need to be installed in my system and searched in my ubuntu for fox library dependency but left with no clue.
Then I uninstalled and downloaded fxruby-1.6.20.gem and installed. Native extensions were built, then I could ran my fxruby program with ease,



Though not appealing, enough qualified to place it beside AIR or Silverlight GUI, this could be the half brother of Java Swing.

For enterprise Java swing applications and migrating it ruby I saw this article, 
Don't know practically how far this works








Tuesday, June 21, 2011

Ruby Modules: A perfect name space resolver?

Coming from java background, I was looking for package equivalent in Ruby and read in Programming Ruby 1.9 book that Ruby Module serves two purposes, 1) Namespace conflict resolver 2) Mixin Though, mixin is applauded one, now the one that bothers me is Namespace conflict resolver. lemme idealize it in to a simple example
module A

def test
  puts "I am in module A"
end

end

module B

def test
  puts "I am in module B"
end

end

Class Payment

include A
include B

end

p = Payment.new

p.test #prints - I am in module A

Now how to invoke test method in module B? But the same if I rewrite the those module methods as a class level methods, this works
module A

def self.test
  puts "I am in module A"
end

end

module B

def self.test
  puts "I am in module B"
end

end

Class Payment

include A
include B

def test_modules
  A.test
  B.test
end

end

p = Payment.new

p.test_modules #prints fine - I am in module A, I am in module B

when I do,
p.A.test #bangs - `
': undefined method `A' for # (NoMethodError)
What is this actually? I couldn't understand the concept, Is someone who could help me on this? Is Ruby a perfect namespace conflict resolver?

P.S - I got to know clear about this by watching this video MetaProgramming for Fun by Dave Thomas

Wednesday, March 2, 2011

Ruby Floating floats like a Dead Fish

I was so serious in attempting to solve a problem that Thoughtworks usually gives to its new recruits to test their Object Orientation skills. In that there is a Sales Tax problem which involves lot of math library, floating point calculations rather than using our brain memory in it.

While when I do the rounding of a sales tax calculation to the nearest 0.05, I faced the problem in my ruby
                                               
Though I agree that this is my first time where I am doing intense floating point calculations and round off, could someone explain me why this inconsistency happens with ruby?

I need at least two decimal places right in my calculations, rather than implementing a work around to round off a 8 decimal float number .


Also it should be noted that round(n) as written in Float class in ruby, which rounds to 'n' decimal places doesn't work with Jruby. Any clue on this???