Firefox 3 in the Guinness Book of records and 2008 - the year of enterprise adoption of Ruby and Ruby on Rails

June 17th, 2008


Download Day 2008I have downloaded and will be installing Firefox 3 in a while after writing this (because I am blogging from Firefox itself!). The goal is to make my machine up-to-date with the latest incarnation of the world’s best browser. This is significant for several reasons:

World Record marketing

The number of downloads counted today will probably make Firefox go into the Guinness Book of Records. That’s a genius marketing coup.

Reliability and loyalty

I first downloaded Firefox in an early version years ago when it was still “Firebird” and when Microsoft’s Internet Explorer failed me atrociously and I have not regretted it ever since. That experience marked Internet Explorer as a security hazard in my mind ever since. Even during the slowdowns experienced because of memory use in version 2, I still used it exclusively.

It is Open-Source software

As a passionate advocate of open-source, and a participant of Linux User Groups where I have spent years explaining and analyzing the benefits of open-source, this is the proof in the pudding.

As a Software Engineer, my own perspective is that the open-source solution is, in the long run, the better engineered one. This is because of Eric S. Raymond’s insight that after a threshold of open-source contributors, “all bugs are shallow”. If there is a bug in the software, then there is no policy of security by obscurity as some commercial companies practice. Therefore, someone, somewhere must be an expert in that particular field where the bug lies. There is no agenda to delay fixing a bug since the resource is a willing volunteer. Therefore, the bug is fixed, brilliantly and speedily.

The software is necessary and is built, enhanced by the people and for the people, an example of the ideal of freedom and sharing. It is open-source, and therefore it is freely available, freely modifiable, multi-platform, stable and secure, richly extensible and supports open-standards which prevents any vendor-locking and allows me to access the fantastic resources online.

In any case, if ever you have a doubt about the absolute superiority of open-source software for business, just think about how Google is built on open-source technology, including Linux and Python.

Other Open-Source advancements I am especially fond of in addition to Mozilla’s excellent Thunderbird email software are:

1. Ubuntu Linux

Thanks here go to Linus Torvalds, Richard Stallman for all those GNU goodies stemming from his particular vision, Mark Shuttleworth and a slew of other contributors.

My version of Ubuntu is a 64-bit operating system which leverages both 64-bit AMD Turion processors of my machine. I got my two latest upgrades - without reinstalls - through the Internet while still using my system and for free.

At the first upgrade I couldn’t use the fancy effects for my desktop, putting in on a 3D cube and so on because my ATI graphics card was not supported. 2 hours later, the community had delivered new code onto repositories around the world for free to do just that. It ran slow. 1 more hour after reading the free forums, I had configured Compiz Fusion and saw it running beautifully.

I have the latest upgrade configured with a Mac OS X look and feel, just for fun, and it’s true that Apple has great design.

This upgrade plays all my audio CDs and DVDs. Compare this to the latest SP3 upgrade of the Windows XP Media Center Edition O.S. which came with my machine: anytime I insert an audio CD, I get a blue screen of death and nothing I do or have done has fixed the issue. The only solution seems to be a reinstall. Contrast, in turn to Vista, which has not kept its promise, possibly a instance of why a company should stick to its core business and not stray too far from it - in other words, after all these years, I would have expected Microsoft to have built an excellent Operating System. This was not the case, and in the meantime, Microsoft has diverted its attention into hardware, gaming consoles, and what not.

2. OpenOffice

This free and open-source office or productivity suite has improved leaps and bounds. The greatest advancement for me was when some of the Excel worksheets I had devised for Personal Finance could be loaded and all the dynamic charts could be updated within OpenOffice. To date, OpenOffice is still being regularly updated. It is a power-house of a suite.

3. Ruby and Ruby on Rails

Ruby is my favourite language and has been for a few years too. It is truly object-oriented, makes you feel your intelligence is treasured, puts immense power into your hands because of meta-programming, and is therefore a fantastic tool for prototyping. It has Japanese elegance, together with extreme beauty. Who would have thought one could say this of a programming language? Thanks go to Yukihiro Matsumoto San, alias Matz!

Ruby on Rails, in turn, is the absolute best framework for Rapid Web Applications building. Credits here go to David Heinemeier Hansson.

2008 is the year that the vendors in the Industry have rallied to bring their commercial endeavours for Ruby and Rails to fruition:

  • Microsoft with IronRuby thanks to John Lam and contributors around the world. Yes, Microsoft opted for making this project open-source and I contributed a fix for string concatenation. Who would have thought an open source advocate would have been fixing Microsoft’s code, eh? The thing is, they made it easy, and John is a fabulous guy. Microsoft Open-Source? This sounded like an impossible marriage just a year and a half ago.

    This is why, to me, the Open-Source advocacy has subdued into quiescence. This war has already been won.

  • Sun with JRuby as they hired two key people in the project, namely Charles Nutter and Thomas Enebo. If you already have Java in your environment, this language is dead like a dead dodo in a few more years. JRuby will interface with your existing Java infrastructure. Use it and JRuby on Rails for web applications. Use NetBeans too, it’s the best development tool I have seen yet - a shout out to Tor Norbye if he’s reading this and also to Arun Gupta whom I saw advocating JMaki and Glassfish here in Montreal.
  • IBM has been a supporter of Rails also. There have been articles about Ruby and Rails on their websites.
  • Oracle has rebuilt one of their key websites totally with Ruby on Rails.
  • This comes a few years after the thought leaders who have understood and adopted Ruby and Ruby on Rails. A few more years and mass adoption will be a reality because 2008 is the year the vendors of the industry are proposing their solutions. Many companies, however, lag behind.

    Back to our subject at hand: thanks to Mozilla and the whole team of contributors worldwide for making this a possibility.

    I am now going to exit this 2.0.0.14 version and launch Firefox 3 with all the speed enhancements of the new Gecko rendering engine. As usual, I will be blinding fast. See if you can catch up!


    Sphere: Related Content

    Related or similar posts

  • Firefox 3 alpha v5
  • Firefox - The World’s Best Browser
  • 10 essential Firefox shortcuts
  • Nine Inch Nails releases yet another album for free.

    May 5th, 2008


    The Slip
    I am in awe.

    Trent Reznor and his band Nine Inch Nails just released a brand new album in various DRM-free digital formats, including higher than CD quality for free. You get all the digital formats including a pdf with all the artwork.

    Sensibly, the largest file formats are being distributed through bittorrent.

    This release follows the free release of the quadruple instrumental album Ghosts just a few weeks ago.

    Reznor continues to be a trailblazer by connecting directly to his fans and making this release available just to express gratitude with the continuing support of his fanbase.

    The Slip, their latest album can be remixed freely, and just as with Year Zero, will probably be available for free as well. It is as the site says:

    licensed under a creative commons attribution non-commercial share alike license.

    Well done, Trent. Very generous. And thanks for the stems.

    we encourage you to
    remix it
    share it with your friends,
    post it on your blog,
    play it on your podcast,
    give it to strangers,
    etc.

    - Nine Inch Nails


    Sphere: Related Content

    Related or similar posts

  • Masters at Work - Mike Garson
  • New Depeche Mode album released - Playing the Angel
  • Happy birthday, Capricorn artists!
  • Earth Day - a Prayer for Gaïa.

    April 22nd, 2008


    GaïaI like James Lovelock’s Gaïa Hypothesis - Earth is a type of living superorganism.

    Gaïa is my Mother, giving me the soil to stand and rest and the food resources, just like Sol is my Father, beaming me with rays of light and warmth.

    Both cradled the potential of my carnal existence for millions of years by preparing co-evolving organisms and resources so that one day, my biological father mated with my biological mother and created the incarnate me through Gonads, Gametes and Genetics.

    Even today, my spirits are raised by mountains, damp forests and the natural life therein, replenishing my tired mind and soul pained by humans who forget to be humane.

    The internet links minds into Gaïa’s embryonic brain. Thus, she becomes a sentient entity.

    Gnothi Seauton inscribed on the Temple of Greek God Apollo. Know thyself and you will know the world.

    I count my blessings. Using the internet, I learn about fellow human beings through an unprecedented way of connecting to other parts of the world, and therefore, of knowing myself as a human.

    Using the internet, therefore, is an exercise in self-discovery.

    Today, I have great concerns. Gaïa is plundered for artificial monetary gains time and time again. The evidence shows growing pollution and waste, and man-made global warming, with potentially dire consequences.

    The rising price of oil will contribute to the growth of biofuels. This will sap the world’s grain reserves and starve fathers. A global food crisis is at hand.

    Already my fellow human beings are angry, hungry and clamoring. Rioting.

    The seeds of war have been sown.

    The flames of war continue to be fanned by “well-meaning” people bent on showing you how appearance and image should be well taken care of and that you are somebody only if you have an abundance of belongings.

    What are your values?

    How about praising natural environmental consciousness and acting it for a change instead of going all dazed about somebody’s material possessions?

    Fortunately, clean alternate energy sources like eSolar are being funded, thanks to Google.

    The future is Green.

    Remember, that your true wealth is in your true nature, and should be indexed on humane or Godlike values, not on metals nor on paper and even less on fiat paper.

    I Love You, Mother, in this Grandly Architected order of the World.


    Sphere: Related Content

    Related or similar posts

  • Three wishes
  • Steve Jobs and Bill Gates joint Interview at D
  • BarCampMontreal2 Report - Part 4
  • America’s collapsing economy and finance woes - Part 2: Of minds and men

    March 23rd, 2008


    Mises crest

    Tu ne cede malis sed contra audentior ito

    - Virgil’s Aeneid, Book VI. “do not give in to evil but proceed ever more boldly against it”. The Von Mises family crest.

    Flashback

    Vincent’s patio was sun-filled. His friend, a hedge-fund manager was seated in front of him, with me in the middle.

    “Why should I believe you?” he said. “We have Ph.D’s in our team.”

    In a perfect world, I would have replied: “Have you heard of Long Term Capital Management? They had two Nobel Prize winners on board. Where are they now?”

    Instead, both my reply and the software I had developed stayed unexpressed.

    How did I know this would happen?

    In one sentence, this can be summarized by “I do not watch TV”. Instead, the internet is my privileged window on the world. I get to connect worldwide, to choose my channel after exercising critical thinking on the quality of the sources available.

    And so, with a mind untouched by the vastly manipulated and distorted torrents of mass-media, I have been reading and thinking.

    In the news this week - Bear Stearns

    JP Morgan Chase bought Bear Stearns for $2 a share, less than a tenth of the market value of the company.

    This is symptomatic of the ongoing crisis. The market right now is panicking, fear-driven. But on top of that, the market does not have a clue about the real extent of the mess, the insiders do to some extent.

    Charles Hugh Smith wrote an excellent short piece on his views back then in November 2007 - read “Empire of Debt - The unraveling begins“.

    If their bad bets were marked to market, Citicorp and Merrill Lynch would be declared insolvent. Why? Because they are insolvent–right now. The meaning of insolvency is straightforward: their losses exceed their capital. Recall that these firms list assets of $100 billion (or whatever) but their actual net capital is on the order of 2.5% - 5% –a mere sliver of their stated assets. In other words: a 5% loss of their stated assets wipes them out.

    And once those leviathans fall, what other dominoes will they strike down?

    - Charles Hugh Smith

    Maybe that’s what happened to Bear Stearns. And we’re talking about a top 5 institution here.

    Sometimes, the lone blogger wields more power with the truth in his pen than armies of news teams worldwide.

    Peter D. Schiff - Dr. Doom

    Peter Schiff’s column on the Euro-Pacific Capital website is a great read, as is his book “Crash Proof - How to profit from the coming economic collapse.”, for you see, Peter Schiff also predicted this:

    …why America’s persistent and growing imbalance of imports over exports - its trade deficit - would cause drastically lower standard of living and years of painful sacrifice and reconstruction. Seven chapters would show the various ways the world’s greatest creditor nation ahd become, in the incredibly short space of some 20 years, the world’s largest debtor nation while the public’s attention was focused on some other things.

    The cognitive dissonance for many must have been much too great to withstand as when Schiff spoke about his predictions, he was mocked:

    Prior to my last appearance on CNBC in October 2007, I had made more than 50 appearances on the network over the prior two years. In those segments, I repeatedly exposed the superficiality of our prosperity, described the American economy as a “house of cards”, pointed out that borrowing and spending were a ticking time bomb rather than a viable plan for long term economic health, and explained how investors could prepare for the tough times ahead. At the time, those forecasts were met with ridicule and led to my being nicknamed “Dr. Doom”. Now that these predictions have come to pass, most on CNBC now claim that no one saw it coming!

    In my 2006 and 2007 on-air appearances, to a chorus of sneers and laughter, I predicted the bursting of the housing bubble, the collapse of the subprime mortgage market, the credit crisis, tightening lending standards, waves of defaults, bankruptcies and foreclosures, weakness in financials, retailers and homebuilders, stagflation, surging gold, oil and other commodity prices, soaring federal budget deficits and a collapse in the value of the U.S. dollar. You would have thought that some of the reasons I gave for making those predictions would now be given some credence. They have not.

    Peter Schiff’s Economic and market commentary archives are accessible here.

    Nouriel Roubini

    Professor Nouriel Roubini of the Stern School of Business at New York University offers great insight into the mechanics of the crisis and his predictions are a fantastic read as well. I subscribe to RGEmonitor and read his Global Ecomonitor.

    John Robson & Andrew Selsby on MoneyWeek have a summary of his seminal The Rising Risk of a Systemic Meltdown - The 12 steps to a financial disaster.

    1. The worst housing recession in US history. House prices will, he says, fall by 20 to 30 percent from their peak, wiping out between $4,000bn and $6,000bn in household wealth.

    2. Further losses, beyond the $250bn-$300bn now estimated for subprime mortgages because he says about 60% of all mortgages originating between 2005 and 2007 had “reckless or toxic features”.

    3. Big losses on unsecured consumer debt, credit cards, auto loans, student loans, etc.

    4. The downgrading of monoline insurers – [we would comment that recently the market was cheered by the apparent return to safety for the two biggest monoline insurers, Ambac and MBIA, whose AAA status now seems more secure, although that presupposes further deterioration in the US economy won’t re-ignite their problems.]

    5. The meltdown of the commercial property market.

    6. Bankruptcy of a large regional or national bank.

    7. Losses on reckless leveraged buy-outs. [A point made very forcibly this week by Jon Moulton, head of the private equity firm Alchemy Partners. He said that there will be large private equity failures this year. Absolutely guaranteed.]

    8. Wave of corporate defaults. [Recent widening of credit spreads gives rise to genuine concern that this could be the next key issue.]

    9. Meltdown of the shadow financial system. [In other words, some hedge funds could be in distress.]

    10. Further collapse of stock markets.

    11. Drying up of liquidity of financial markets.

    12. Vicious circle of losses, capital reduction, credit contraction, forced liquidation and fire sales of assets at below fundamental prices.

    What does the future hold according to Professor Roubini? This:

    A near global economic recession will ensue as the financial and credit losses and the credit crunch spread around the world. Panic, fire sales, cascading fall in asset prices will exacerbate the financial and real economic distress as a number of large and systemically important financial institutions go bankrupt. A 1987 style stock market crash could occur leading to further panic and severe financial and economic distress. Monetary and fiscal easing will not be able to prevent a systemic financial meltdown as credit and insolvency problems trump illiquidity problems. The lack of trust in counterparties – driven by the opacity and lack of transparency in financial markets, and uncertainty about the size of the losses and who is holding the toxic waste securities – will add to the impotence of monetary policy and lead to massive hoarding of liquidity that will exacerbates the liquidity and credit crunch.

    In this meltdown scenario US and global financial markets will experience their most severe crisis in the last quarter of a century.

    And….:

    We are facing now the risk of the mother of all financial crises and meltdowns.


    Sphere: Related Content

    Related or similar posts

  • America’s collapsing economy and finance woes - Part 1
  • Earth Day - a Prayer for Gaïa.
  • Smokin’ Yahoo Pipes! And Internal Startups!
  • America’s collapsing economy and finance woes - Part 1

    March 5th, 2008


    C for yourselfThe Finance industry is being torn asunder and the US economy is in recession or has been for a little while already, with the dollar crashing.

    I predicted all this.

    Last year, I spoke about this to American and other friends who would listen, to colleagues at work (I work in Finance, and these views reflect my own, not those of my employer) where I was pondering how investors would react in an environment where the risks of inflation and recession for the US were growing.

    I predicted the risk of recession in the US for 2008 before Goldman and Sachs, before Merrill Lynch, and before Warren Buffett’s take on it. Prior to that, I said: “The Federal Reserve will have to reduce their rates, the Dollar will crash and the US will face inflation”. I also told my American friends that Americans were losing their homes and lands into a new type of serfdom (servitude?) and expressed my views about the 2008 US elections.

    Still reeling from the effects of the Subprime crisis, namely the Credit Crunch and other correlations, Bank stocks are plummeting, together with the US Dollar. Americans, dazed and confused, stand to lose not only their homes but their country and the very structure of society that makes their land their own or used to.

    It is nothing less than the total collapse of an economy called the “world’s greatest economy” that has become possible. How great can an economy be if it is based on debt and not on wealth is a good question to ask. This is the measure of the issue. It’s the Big One and it’s because this time the risk is systemic not isolated.

    How did I predict this? Is there something fundamentally wrong with American politics and finance? How much does this contaminate the global economy? In addition, is there a solution to all these crises and if so, what is it?

    This is precisely what I am going to describe in the next posts here on YashLabs.

    Warren BuffettIn the meantime, do read (again if you hadn’t) the Oracle of Omaha’s seminal analysis and metaphor of Thriftville vs Squanderville and America’s growing Trade Deficit, which appeared in a 2003 Fortune magazine.


    Sphere: Related Content

    Related or similar posts

  • America’s collapsing economy and finance woes - Part 2: Of minds and men
  • Earth Day - a Prayer for Gaïa.
  • One-hour Ruby - Part 1: Variables
  • Happy birthday, Capricorn artists!

    January 6th, 2008


    December or January, what is it that unites and inspires us, Saturnians? Solitude? Love? Rebirth, Godhead? A Soulmate?

    Thank you for the music.

    1. Ricky Martin - 24th of December

    Nobody wants to be lonely

    2. John Legend - 28th of December

    Heaven


    3. Annie Lennox - 25th of December

    Love is a Stranger

    4. Françoise Hardy - 17th of January

    “Oui, mais moi, je vais seule dans les rues, l’âme en peine. Oui mais moi, je vais seule, car personne ne m’aime.”

    5. David Bowie - 8th of January

    With Nine Inch Nails and Brian Eno.

    “I will be King. And you. You’ll be my Queen”.

    6. Pascal Obispo - 8th of January


    Où est l'élue - Pascal Obispo
    Uploaded by MllElea

    “Où est l’élue, l’âme soeur universelle ?”

    ” Le temps…c’est de l’amour.”

    7. Elvis Presley - 8th of January



    8. Aaliyah - 16th of January

    “Passion. Instant”

    “Dust yourself up and try again”

    9. Janis Joplin - 19th of January

    10. Etienne Daho - 14th of January

    “Il n’est pas de hasards, il est des rendez-vous…pas de coïncidences.”

    11. My own:
    Nuit Câline

    “Quel est ton nom et d’où ces yeux viennent-ils ?”

    12. Rowan Atkinson - 6th of January
    :)

    “Thinking is so important, Baldrick. What do *you* think?”

    “What? Macbeth?”


    Sphere: Related Content

    Related or similar posts

  • 25th Festival International des Films sur l’Art.
  • Watch Nova Online.
  • DemoCampCUSEC1 Montreal, January 18th
  • Masters at Work - Mike Garson

    November 12th, 2007


    Mike GarsonAn artist, a mentor, a spiritual being at the top of his art to the point that the music is an expression of his being.

    Mike Garson’s sonic and rhythmic palettes and mastery of the piano are the fabric of legend.

    He has been playing with David Bowie for approximately 35 years ever since Aladdin Sane, and although you may not know his name, you must have heard his performance countless times on Bowie’s tracks. A good album to hear Mike Garson’s distinctive piano style is the immensely underrated 1. Outside produced by Brian Eno. The album’s version of “Strangers when we meet” is but one example of Mike’s fantastic solo playing.

    It is pointless to talk about his ability as a pianist. He is exceptional. However, there are very, very few musicians, let alone pianists, who naturally understand the movement and free thinking necessary to hurl themselves into experimental or traditional areas of music, sometimes, ironically, at the same time. Mike does this with such enthusiasm that it makes my heart glad just to be in the same room with him.

    - David Bowie

    I want to play how I feel in every moment

    - Mike Garson

    Mike Garson’s Myspace page is regularly updated with songs from the Bowie repertoire and other songs free for download graciously offered by Mike himself. The site is an avenue to reach his audience directly and is also and opportunity to partake in the philosophy of an accomplished musician whose generosity is second to none.

    Mike Garson has also collaborated with Nine Inch Nails and the Smashing Pumpkins.


    Sphere: Related Content

    Related or similar posts

  • Masters at work - Ryuichi Sakamoto
  • Masters at Work - Imogen Heap - Just for now (live)
  • Ray Kurzweil back at Kurzweil Music Systems
  • Congratulations to Al Gore on winning the Nobel Peace Prize

    October 12th, 2007


    I was hoping for this, and Al Gore deserves the Nobel Peace Price for his excellent work on making people more aware of Global Warming.

    In turn I was hoping that this award, which follows the Oscar, would give more visibility to “An Inconvenient Truth“, the documentary which shows most of Gore’s presentation.

    I covered the documentary in a previous post on eye-opening movies and if you haven’t seen it yet, now is a good time to do so.

    In life, sometimes one door closes, but floodgates open instead.

    Congratulations Mr. Gore.


    Sphere: Related Content

    Related or similar posts

  • Al Gore nominated for Nobel Peace Prize.
  • “An Inconvenient Truth” wins Best Documentary Feature…
  • New Depeche Mode album released - Playing the Angel
  • TechnoMontreal launches its blog.

    September 10th, 2007


    TM Logo small It’s a fantastic Monday, as I’m very pleased that Lyne Bouchard and Eric Kucharsky of TechnoMontreal have launched a blog this morning. It will be a collective blog about the ICT industry of the Greater Montreal area.

    There’s more information at the Montreal Tech League.

    I am looking forward to its growth.

    Well done, TechnoMontreal team!


    Sphere: Related Content

    Related or similar posts

  • YULbiz de Mai 2007
  • BarCampMontreal2 Report - Part 1
  • Blog starters
  • Extending the e Text Editor for Ruby Programming

    September 3rd, 2007


    e Logo
    At DemoCampMontreal4, I showed the results of time spent programming Ruby and RubyOnRails within the excellent e Text Editor for Windows. You can read about the presentation in my DemoCampMontreal4 report here at YashLabs, MTW and Marc-André Cournoyer’s blog.

    e Text Editor and the extensible Bundle system

    e is compatible with (the Mac OS X-only) TextMate bundles and can load in its snippets for faster Ruby and Rails programming. However, I also wanted to have quick access to all the methods associated to the common Ruby data structures:

  • String
  • Array
  • Hash
  • Fixnum
  • The Design

  • A keyboard shortcut for launching the menu
  • A menu displaying all methods is displayed
  • From the menu, the user can scroll and select the method or jump to it with a keypress for the first letter of the method
  • On selection, the menu disappears and the appropriate method name is inserted at the current cursor position
  • Ruby’s reflection capabilities

    Ruby logoRuby is a great object-oriented language. In Ruby, everything is an object and hence all the object-oriented principles I learnt are implemented in Ruby quite well and simply, which is more than can be said for C++ and Java. For instance, in Ruby, you can do this:

    10.times

    or

    “Hello”.length

    Ruby is great for introspection as it has good reflection capacities - an object can provide information about its internals. The inbuilt .methods method gives all the methods associated with a data structure. e.g.

    puts Array.methods.sort.inspect

    gives

    [“< “, “<=”, “<=>”, “==”, “===”, “=~”, “>”, “>=”, “[]”, “__id__”, “__send__”, “allocate”, “ancestors”, “autoload”, “autoload?”, “class”, “class_eval”, “class_variable_defined?”, “class_variables”, “clone”, “const_defined?”, “const_get”, “const_missing”, “const_set”, “constants”, “display”, “dup”, “eql?”, “equal?”, “extend”, “freeze”, “frozen?”, “hash”, “id”, “include?”, “included_modules”, “inspect”, “instance_eval”, “instance_method”, “instance_methods”, “instance_of?”, “instance_variable_defined?”, “instance_variable_get”, “instance_variable_set”, “instance_variables”, “is_a?”, “kind_of?”, “method”, “method_defined?”, “methods”, “module_eval”, “name”, “new”, “nil?”, “object_id”, “private_class_method”, “private_instance_methods”, “private_method_defined?”, “private_methods”, “protected_instance_methods”, “protected_method_defined?”, “protected_methods”, “public_class_method”, “public_instance_methods”, “public_method_defined?”, “public_methods”, “respond_to?”, “send”, “singleton_methods”, “superclass”, “taint”, “tainted?”, “to_a”, “to_s”, “type”, “untaint”]

    However, [].methods.sort contains additional methods not contained within Array as shown by:

    res= [].methods - Array.methods
    puts res.inspect

    This gives the additional methods of []:

    [“select”, “[]=”, “transpose”, “< <”, “&”, “indexes”, “partition”, “map!”, “uniq”, “empty?”, “fetch”, “values_at”, “*”, “grep”, “+”, “shift”, “clear”, “-”, “reject”, “insert”, “reverse!”, “indices”, “delete”, “first”, “concat”, “member?”, “flatten!”, “|”, “find”, “join”, “delete_at”, “each_with_index”, “nitems”, “unshift”, “index”, “collect”, “fill”, “all?”, “uniq!”, “slice”, “length”, “entries”, “compact”, “last”, “detect”, “delete_if”, “zip”, “each_index”, “map”, “sort!”, “assoc”, “rindex”, “any?”, “to_ary”, “size”, “sort”, “min”, “push”, “find_all”, “each”, “slice!”, “pack”, “reverse_each”, “replace”, “inject”, “collect!”, “rassoc”, “at”, “reverse”, “compact!”, “sort_by”, “max”, “reject!”, “flatten”, “pop”]

    Therefore, instead of Array.methods, I’d rather get [].methods.

    Cygwin

    Cygwin logoCygwin’s great UNIX-like programming environment is used by e for the bundle system. This is interesting because from there you can run Ruby code within the e Bundle system and communicate with Cygwin through to the Operating System.

    There’s a great post by Ben Kittrell describing how he made a great Mac-like environment for Rails development on Windows using Cygwin.

    wxCocoaDialog

    wxWidgets logoCocoaDialog is a lightweight Objective-C application for Mac OS X to provide easy access to common GUI widgets and is particularly suitable for object-oriented scripting languages.

    Fortunately, some kind soul ported CocoaDialog to use the cross-platform and open-source wxWidgets toolkit. Actually, it is e Text Editor and its TextMate-compatible bundle system that gave rise to wxCocoaDialog.

    And in this wxCocoaDialog port, we have three additional runmode items not present in CocoaDialog on Mac OS X, including…menu!

    Putting it all together

    Provided you have e installed (wxCocoaDialog comes with it) as well as Cygwin and Ruby for Cygwin, here is how to proceed.

    1. In e, press CTRL-SHIFT-B to open the Bundle Editor
    2. On the left tree-view pane, select Ruby
    3. Click on the big + button lower down and choose New Command
    4. Name the command RubyMethodsString (or anything suitable for you)
    5. Paste in the following code I wrote which connects Ruby, Cygwin, wxCocoaDialog and e. Be careful when pasting as currently the code formatting plugin does weird things with quotes - all the quotes are straight except after index= - the outermost ones really are backticks to access the system
    6. #!/usr/bin/env ruby

      #Access Ruby Methods for strings
      #August 2007 - Josh Nursing - josh.nursing AT gmail.com

      SUPPORT = ENV[‘TM_SUPPORT_PATH’]
      DIALOG = SUPPORT + ‘/bin/CocoaDialog.exe’
      sel = ENV[‘TM_CURRENT_WORD’]
      x = “–xpos #{ENV[’TM_CARET_XPOS’]} “
      y = “–ypos #{ENV[’TM_CARET_YPOS’]} “

      am=“”.methods.sort

      menu=[]

      #Populate menu with formatted entries
      am.each do |w|
          menu.push “‘” + w.to_s + “‘ “
      end

      #CocoaDialog menu
      index =`“#{DIALOG}” menu –items #{menu} #{x} #{y}`.to_i - 1

      #Insert the selected method text at caret position
      print ‘.’ + am[index]

    7. In the upper right corner, as Environment, select Cygwin
    8. Lower down, select as Input: Selected Text or Word
    9. As Output, select Insert as Text
    10. As Activation, select Key Trigger and press a key combination. I used CTRL-SHIFT-Y
    11. Close the bundle editor and in your Ruby file within e, after a string variable name or string, press the key shortcut
    12. e menu extension for Ruby Programming

    13. Navigate the menu either with the Up or Down Arrows or jump straight to a method by pressing its first letter
    14. e menu extension for Ruby Programming 2

    The selected method including the dot is inserted within your code in e.

    From here you can derive the very similar codes for the other data structures and add them with new shortcuts. My shortcuts are in a row on the keyboard (CTRL-SHIFT-Y, -U, -I, -O).

    This menu extension can be accessed when you’re developing a Ruby on Rails application as well.

    This shows how e can be usefully extended to work better with your favorite programming language.


    Sphere: Related Content

    Related or similar posts

  • Google Mashup Editor
  • DemoCampMontreal4
  • One-hour Ruby - Part 1: Variables

  • Close
    E-mail It