Approximity blog home
282 to 301 of 599 articles InfoSyndicate: full/short

Packet sniffing and replay   27 Mar 05
[print link all ]
I just came across this most useful ksnuffle. It will help us to automate some more work.

RubyScript2Exe 0.3.3 is released!   26 Mar 05
[print link all ]
RubyScript2Exe transforms your Ruby script into a standalone, compressed Windows, Linux or Max OS X (Darwin) executable. You can look at it as a "compiler". Not in the sense of a source-code-to-byte-code compiler, but as a "collector", for it collects all necessary files to run your script on an other machine: the Ruby script, the Ruby interpreter and the Ruby runtime library (stripped down for this script). Anyway, the result is the same: a standalone executable (application.exe). And that’s what we want!

gegroet, Erik V.

link

Rake 0.5.0 Released   26 Mar 05
[print link all ]
It has been a long time in coming, but we finally have a new version of Rake available.

Changes

  • Fixed bug where missing intermediate file dependencies could cause an abort with —trace or —dry-run. (Brian Chandler)
  • Recursive rules are now supported (Tilman Sauerbeck).
  • Added tar.gz and tar.bz2 support to package task (Tilman Sauerbeck).
  • Added warning option for the Test Task (requested by Eric Hodel).
  • The jamis rdoc template is only used if it exists.
  • Added fix for Ruby 1.8.2 test/unit and rails problem.
  • Added contributed rake man file. (Jani Monoses)
  • Fixed documentation that was lacking the Rake module name (Tilman Sauerbeck).

What is Rake

Rake is a build tool similar to the make program in many ways. But instead of cryptic make recipes, Rake uses standard Ruby code to declare tasks and dependencies. You have the full power of a modern scripting language built right into your build tool.

Availability

The easiest way to get and install rake is via RubyGems

  gem install rake    (you may need root/admin privileges)

Otherwise, you can get it from the more traditional places:

Home Page:rake.rubyforge.org/
Download:rubyforge.org/project/showfiles.php?group_id=50

Thanks

Lots of people provided input to this release. Thanks to Tilman Sauerbeck for numerous patches, documentation fixes and suggestions. And for also pushing me to get this release out. Also, thanks to Brian Chandler for the finding and fixing —trace/dry-run fix. That was an obscure bug. Also to Eric Hodel for some good suggestions.

— Jim Weirich

.. that sounds like real life   13 Mar 05
[print link all ]
I was once on a project where the customer realized only after 1.5 months that they want us to modify an application that does not even exist at that company. You really makes you wonder what goes on in big companies .. Great Dilbert comic

How to start a startup?   10 Mar 05
[print link all ]
Nice article by Paul Graham.

You need three things to create a successful startup: to start with good people, to make something customers actually want, and to spend as little money as possible. Most startups that fail do it because they fail at one of these. A startup that does all three will probably succeed.

And that’s kind of exciting, when you think about it, because all three are doable. Hard, but doable. And since a startup that succeeds ordinarily makes its founders rich, that implies getting rich is doable too. Hard, but doable.

If there is one message I’d like to get across about startups, that’s it. There is no magically difficult step that requires brilliance to solve.

A cool job announcement   07 Mar 05
[print link all ]
.. seen this in today’s ruby-talk
 #!/usr/bin/env ruby

 # Warning this is a job announcement!
 # Run it/Read it if you are interested.
 # Lack of comments and robust input handling are intentional.

 class Company
    attr_accessor :name, :location, :web_site, :description
    attr_accessor :available_jobs

    def initialize(name = nil, location = nil, web_site = nil)
      self.name = name
      self.location = location
      self.web_site = web_site
      self.available_jobs = Array.new
    end

    def ask_for_interview?(job_applicant)
      available_jobs.each do |ajob|
        return true if ajob.meets_requirements?(job_applicant)
      end
      false
    end

    def describe
      puts "Company  : #{name}"
      puts "Location : #{location}"
      puts "Web site : #{web_site}"
      puts "","Brief description :"
      puts description, ""
    end

    def announce_job_availability(good_match, not_so_good_match)
      return if available_jobs.empty?
      describe
      puts "Available jobs:"
      available_jobs.each_with_index do |job, idx|
        puts "", "#{idx + 1} ) #{job.name}", job.description, ""
      end

      job_applicant = ask_for_job_applicant_information
      return if job_applicant.nil?

      if ask_for_interview?( job_applicant )
        puts good_match
      else
        puts not_so_good_match
      end
    end

    def ask_for_job_applicant_information
      job_applicant = nil
      puts "Would you like to apply for a job? Y/N"
      res = gets.chomp
      if res =~ /Y/i
        msg = "Great!  Please follow the prompts to input your profile"
        msg<< " to see if there if a job matches."
        puts msg, ""
        job_applicant = JobApplicant.new_from_interactive_shell
      else
        puts "Well thanks for reading/running the program!  Good Bye!"
      end
      job_applicant
    end

 end

 class Job
    attr_accessor :name, :description, :requirements, :threshold
    def initialize(name = nil, description = nil,
                   threshold = 100, requirements = [] )
      self.name = name
      self.description = description
      self.requirements = requirements
      self.threshold = threshold
    end

    def meets_requirements?(job_applicant)
      points = 0
      requirements.each do |req|
        points += req.check_requirement(job_applicant)
      end
      points >= threshold
    end

 end

 class JobApplicant
    attr_accessor :name, :resume, :location
    attr_accessor :spoken_languages, :computer_languages_skills
    def initialize
      self.spoken_languages = Array.new
      self.computer_languages_skills = Array.new
    end

    def JobApplicant.new_from_interactive_shell
      applicant = JobApplicant.new
      puts "What is your name?"
       applicant.name = gets.chomp
      puts "Where do you live? (City, Country)"
      applicant.location = gets.chomp
      note = " [One entry per line.  Press CTRL-D to stop input] "
      puts "What languages do you speak?", note
      applicant.spoken_languages = readlines.map { |d| d.chomp }
      cq1 = "What computer languages are you proficient in?"
      cq2 = "And what other computer skills do you have?"
      puts cq1, cq2, note
      applicant.computer_languages_skills = readlines.map {|d| d.chomp }
      puts ""
      applicant
    end

 end

 class Requirement

    def initialize(points = 1, &proc)
      @points = points
      if proc
        @requirement_calc = proc
      else
        @requirement_calc = Proc.new { |x| true }
      end
    end

    def check_requirement(job_applicant)
      points = 0
      if @requirement_calc.call(job_applicant)
        points = @points
      end
      points
    end

 end

 ubit = Company.new("Ubit", "Tokyo, Japan", "http://ubit.com")
 ubit.description =<<EOF
 Ubit is a Japanese company focusing on mobile phone services and
 content aggregation both in Japan and abroad.
 EOF

 developer = Job.new("Software Developer")
 developer.description =<<EOF
 Become knowledgeable in the inner workings of our
 product platform and work as a team with other developers to implement
 new features and improve our current capabilities.  Ideally, you are
 willing to work under dynamic conditions and communicate well with
 others.
 EOF

 loose_find = lambda do |data, reg_match|
    data.find { |v| v =~ match }
 end

 reqs = Array.new
 reqs<< Requirement.new(25) do |ja|
   ja.spoken_languages.include?("English")
 end

 reqs<< Requirement.new(25) do |ja|
    ja.spoken_languages.include?("Japanese")
 end

 reqs<< Requirement.new(5) do |ja|
    sub = ["English", "Japanese"]
    (ja.spoken_languages - sub).size > 0
 end

 reqs<< Requirement.new(50) do |ja|
   ja.computer_languages_skills.include?("Ruby")
 end

 reqs<< Requirement.new(25) do |ja|
   ja.computer_languages_skills.include?("Databases")
 end

 reqs<< Requirement.new(10) do |ja|
   ja.computer_languages_skills.include?("Mobile Technologies")
 end

 reqs<< Requirement.new(5) do |ja|
   ja.computer_languages_skills.include?("*NIX")
 end

 reqs<< Requirement.new(5) do |ja|
   (ja.computer_languages_skills - ["Ruby", "Database"]).size > 0
 end

 reqs<< Requirement.new(25) do |ja|
   ja.location =~ /Japan/i
 end

 developer.requirements = reqs
 developer.threshold = 125

 ubit.available_jobs<< developer

 good_match =<<EOF
 Your profile looks promising!
 If you are interested in working with us,
 please send your resume to Zev Blut at rubyzbibd@ubit.com
 EOF

 nsgm =<<EOF
 Sorry, at the moment we are in need of people who meet our specific
 needs.  But if you feel that you can meet them then go ahead and send
 your resume to Zev Blut at rubyzbibd@ubit.com
 EOF

 ubit.announce_job_availability(good_match,nsgm)

 > Now that is just too cool :-)
 >
 > Cheers,
 > Tim

 Hi, I found a few ways to improve your program.

 --- tokyo_job.rb.orig   2005-03-07 12:41:23.457936200 -0500
 +++ tokyo_job.rb        2005-03-07 13:16:14.736811208 -0500
 @@ -101,11 +102,11 @@
       applicant.location = gets.chomp
       note = " [One entry per line.  Press CTRL-D to stop input] "
       puts "What languages do you speak?", note
 -    applicant.spoken_languages = readlines.map { |d| d.chomp }
 +    applicant.spoken_languages = readlines.map { |d| d.downcase.chomp }
       cq1 = "What computer languages are you proficient in?"
       cq2 = "And what other computer skills do you have?"
       puts cq1, cq2, note
 -    applicant.computer_languages_skills = readlines.map {|d| d.chomp }
 +    applicant.computer_languages_skills = readlines.map {|d|
 d.downcase.chomp }
       puts ""
       applicant
     end
 @@ -157,42 +158,55 @@

   reqs = Array.new
   reqs<< Requirement.new(25) do |ja|
 -  ja.spoken_languages.include?("English")
 +  ja.spoken_languages.include?("english")
   end

   reqs<< Requirement.new(25) do |ja|
 -  ja.spoken_languages.include?("Japanese")
 +  ja.spoken_languages.include?("japanese")
   end

   reqs<< Requirement.new(5) do |ja|
 -  sub = ["English", "Japanese"]
 +  sub = ["english", "japanese"]
     (ja.spoken_languages - sub).size > 0
   end

   reqs<< Requirement.new(50) do |ja|
 -  ja.computer_languages_skills.include?("Ruby")
 +  ja.computer_languages_skills.include?("ruby")
   end

   reqs<< Requirement.new(25) do |ja|
 -  ja.computer_languages_skills.include?("Databases")
 +  ja.computer_languages_skills.grep(/database/).size > 0 or
 +    ja.computer_languages_skills.grep(/\bdb\b/).size > 0
 +    ja.computer_languages_skills.grep(/sql/).size > 0
   end

   reqs<< Requirement.new(10) do |ja|
 -  ja.computer_languages_skills.include?("Mobile Technologies")
 +  ja.computer_languages_skills.include?("mobile technologies")
   end

   reqs<< Requirement.new(5) do |ja|
 -  ja.computer_languages_skills.include?("*NIX")
 +  ja.computer_languages_skills.grep(/linux|unix/).size > 0
   end

   reqs<< Requirement.new(5) do |ja|
 -  (ja.computer_languages_skills - ["Ruby", "Database"]).size > 0
 +  ja.computer_languages_skills.find_all do |lang|
 +    case lang
 +    when /ruby/, /database/, /\bdb\b/, /sql/
 +      false
 +    else
 +      true
 +    end
 +  end.size > 0
   end

   reqs<< Requirement.new(25) do |ja|
     ja.location =~ /Japan/i
   end

 +reqs<< Requirement.new(5) do |ja|
 +  ja.name =~ /Ben/i
 +end
 +
   developer.requirements = reqs
   developer.threshold = 125

 With these changes, it doesn't require '*NIX', but will accept "Linux"
 or "Unix", and it is a bit more accepting of various database keywords.
 (Oh yeah, and it assigns bonus points for cool names)

 Ben

 (P.S. !Japan, !Japanese, !"Mobile Technologies", and !currently_looking?
 but that was too much fun to pass up.  :)  )

ANN: IHelp 0.3.0   26 Feb 05
[print link all ]
Announcing the release of IHelp 0.3.0.

fhtr.org/projects/ihelp/ fhtr.org/projects/ihelp/doc/ fhtr.org/projects/ihelp/releases/ihelp-0.3.0.tar.gz

This release brings with it custom help renderers, which you can leverage to render help whenever you want, wherever you want and however you want.

Also included are a couple experimental renderers (no guarantees):

  • #rubydoc_org opens the corresponding ruby-doc.org class help file using the program defined in IHelp::WWW_BROWSER
  • #rubytoruby_src uses Ryan Davis’ RubyToRuby class to print out the source for the method.

blog.zenspider.com/archives/2005/02/rubytoruby.html for more info about RubyToRuby.

Ri bindings for interactive use from within Ruby. Does a bit of second-guessing (Instance method? Class method? Try both unless explicitly defined. Not found in this class? Try the ancestor classes.)

Goal is that help is given for all methods that have help.

Examples:

  require 'ihelp'

  a = "string"
  a.help
  a.help :reverse
  a.help :map
  String.help
  String.help :new
  String.help :reverse
  String.help :map
  String.instance_help :reverse
  String.instance_help :new # => No help found.
  a.help :new
  help "String#reverse"
  help "String.reverse"
  a.method(:reverse).help # gets help for Method
  help "Hash#map"

Custom help renderers: The help-method calls IHelp::Renderer’s method defined by IHelp.renderer with the RI info object. You can print help out the way you want by defining your own renderer method in IHelp::Renderer and setting IHelp.renderer to the name of the method.

 require 'ihelp'

 class IHelp::Renderer
   def print_name(info)
     puts info.full_name
   end
 end

 IHelp.renderer = :print_name
 [1,2,3].help:reject
 # Array#reject
 # => nil

Evolution of languages   25 Feb 05
[print link all ]
This pdf nicely shows what is wrong :-).

FreePop   20 Feb 05
[print link all ]
Do you remember the days around 1990 we used to play Populous for days?

FreePop is a computer game based on the classic Populous I and II games by Bullfrog Productions. It is currently in development and aspires to be a great improvement on the original games, being a fitting gift to the open source community, as well as a part of the open source community.

freepop.sourceforge.net

OK, So What’s Populous?

For those of you who were trapped in a small dark room during the late 1980’s and 1990’s, or otherwise similarly deprived, Populous is a series of games developed by Bullfrog Productions which created the god-sim genre. The premise is that you (the player) and your opponent (AI or human) are gods or equivalent deities, and you battle each other using your powers - such as the summoning of natural disasters and the ability to coax the will of your followers - in order to destroy the followers of the opponent. The winner is the god with remaining followers.

Some shots of Populous II:

freepop.sourceforge.net

Dilbert on Tech support and meetings   20 Feb 05
[print link all ]
I can’t say it often enough .. a day without Dilbert is a bad day!

The amazing thing is that it is soooo true :-).

Dilbert on meetings: link

.. transfering to couch tech support: link

glark   18 Feb 05
[print link all ]
A replacement for (or supplement to) the grep family, glark offers: Perl compatible regular expressions, highlighting of matches, context around matches, complex expressions (``and’’ and ``or’’), and automatic exclusion of non-text file

In default mode, glark highlights matches and file names. glark.sourceforge.net/index.htm

[XP] Re: Toyota concludes - no value in ISO-9000 (9001) registration   17 Feb 05
[print link all ]
some nice excerpts from the XP-List.

(Seen in ‘agileprojectmanagement’ post by "Bob Corrick" <bobcorrick@hotmail.com>…)

www.lean-service.com/6-news-11.asp#2

 "Toyota Japan rejects ISO 9000"
 "My thanks to Takaji Nishizawa, a leading industrial consultant in
 Japan, for this item:

 >>
 "The following was reported in Nikkei Business. Nikkei Business is
 published weekly and one of the most popular business journals in
 Japan.

 "In October of 1999 it featured a three-week series about ISO 9000
 problems in Japan. In the articles it said that Toyota decided not to
 get ISO9000 because it saw no value in terms of quality and thus saw
 no need to register.

 "The decision had been made after the Shimoyama factory, which is an
 engine plant, had registered to ISO9001. When introducing new things,
 Toyota's philosophy is to test actually before installation rather
 than discuss on the desk. The Shimoyama factory had been selected as
 a test plant.

 "And after the test, Toyota concluded there was no value in ISO9000
 registration."

 There was a newspaper reporter in Philadelphia (over 10 years ago) who
 reported the observation that a company that manufactures concrete life
 preservers could maintain their ISO-9000 certification so long as they
 followed a documented process for notifying the next of kin.

Ron Jeffries posted:

 My limited experience is that many companies who go ISO do so for
 one or both of these two reasons:

 1. They are a supplier to a company that requires it;
 2. They believe it will improve their ability to market their
 products or services.

 I am sure there are companies that go ISO in order to improve, but
 I've not personally encountered one. (I did once encounter a company
 whose CEO had promised the board to get to CMM 2 by some date, IIRC
 as a response to low quality from his software teams.)

Sturgeon's Law   17 Feb 05
[print link all ]
90% of everything is crud.

www.jargon.net/jargonfile/s/SturgeonsLaw.html

The Gates - Central Park, NY   13 Feb 05
[print link all ]
Christo put gates all over the Central Park :-). christojeanneclaude.net/

Estraier 1.2.26   06 Feb 05
[print link all ]
Estraier is a full-text search system for personal use. Its principal purpose is to realize a full-text search system for a Web site. It functions similarly to Google, but for a personal Web site or sites in an intranet. It has fast searching, conspicuous results, relational document search, the ability to handle Japanese text, and support for handling a large number of documents. Installation is easy.

Changes: A plug-in to show spelling alternation of the search phrase was added. A bug in the search server was fixed

estraier.sf.net

Preparation counts!   06 Feb 05
[print link all ]
I am sure you have heard about this lady’s sailing expedition.
 > http://www.teamellen.com/ellen-article-2380.html
 > Early this morning, one of the Sony VAIO laptops that power
 > the critical information systems onboard B&Q - including
 > routing and navigation software - suffered a meltdown. The
 > VAIO's have survived 70 days without a glitch, despite continual
 > pounding onboard B&Q but last night's storm was the last straw
 > for one of the two hard disks. At 0750 Charles Darbyshire,
 > Technology Manager, received a call to report the failure and
 > just seven minutes later, MacArthur had replaced the hard disk
 > with a pre-start mirrored backup unit, re-configured the software,
 > and was up and running again - preparation counts!

Building and distributing ruby applications   06 Feb 05
[print link all ]
Found this posting by Erik in the ruby-ml.

www.erikveen.dds.nl/distributingrubyapplications/index.html

This URL points to the place where I’ve dumped my thoughts about building, packing and distributing Ruby applications. Theory and practice. The ultimate goal is to be able to distribute just one executable which contains both the application and the Ruby interpreter.

That’s achieved by the combination of Tar2RubyScript [1] and RubyScript2Exe [2].

It’s definitely worth reading if you have to distribute your Ruby applications!

gegroet, Erik V.

 [1] http://www.erikveen.dds.nl/tar2rubyscript/index.html
 [2] http://www.erikveen.dds.nl/rubyscript2exe/index.html

It's Official, Struts is History!   04 Feb 05
[print link all ]
A big thanks to Sven C. Koehler who made my day by emailing me that info. :-)

www.manageability.org/blog/stuff/official-struts-demise

As announced in the Apache News Blog that there will be no further work to develop Struts 2.x.

[ANN] Ruby 2.0!   24 Jan 05
[print link all ]
Enjoy!
 From: Chris Pine <cpine@hellotree.com>
 Newsgroups: comp.lang.ruby
 Subject: [ANN] Ruby 2.0!
 Date: Mon, 24 Jan 2005 02:29:57 +0900

 Big news!

 Ruby 2 (a.k.a Ruby Secunda Kathrine Pine) was released January 22, 2005
 at 1:51:42 pm (PST) after a few hours of intense, last-minute debugging
 and deployment.  We've been working on this project for just over 9
 months and are quite pleased with the results!  (Well, my wife really
 did most of the work, though I *did* play a seminal role in the initial
 project conception phase.)

 <<< THE NAME >>>

 Ruby     -- named after our favorite language, of course!
 Secunda  -- our second child (after C), and the second Ruby
              (in the roman tradition of numbering your children,
                          e.g. "Quintus" and "Octavius")
 Kathrine -- named after the lead programmer on this project
             (a tradition in her ancestral development house)
             Pine     -- yes, our last name, but also Matz once told me that
                          "matz" is Japanese for "pine"!

 <<< FEATURES >>>
 * Powerful audio output (even on those little tweeters)
 * Net Wt. 9 pounds (or a little over 20k carats as Dave Thomas notes)
 * FIFO digestive queue
 * Ruby.length == 20 inches
 * UNBEATABLE copy protection
 * Dark brown hair
 * Just plain FUN!  (true to the Ruby lagacy)

 <<< KNOWN ISSUES >>>
 * FIFO queue occasionally behaves like a LIFO stack
 * Ruby.sleep(ALL_NIGHT) seems to resume unexpectedly
 * While C (her big brother) sends plenty of messages to Ruby,
   Ruby doesn't seem to respond to C calls.

 <<< SCREENSHOTS >>>
 Screenshots will soon be available here:
 http://pine.fm/FamilyPictures/?page=filter&year=2005&month=1

 Currently, though, we've only put up our pre-release screenshots (and
 around 4000 pictures of C).

  <<< DOWNLOADS >>>
  You wish!
  :)

  Chris

Honda accord advertisement   08 Jan 05
[print link all ]
Amazing ad :-).

link

Nice slogan, too .. "Isn’t it nice when things just work?".

 

Powered by Rublog