CARVIEW |
Topics: ruby
Feed Subscription
Email Subscription

Please sign in or register to post.

Please sign in or register to post.
-
Parsing fixed-width fields in Ruby/Rails
Asked by simonstl : 06 November 2009 - 11:54 AM
Answered by kyle.burton: Nov 10 2009 10:00 AM
If the goal is just to externalize the configuration, there are several implementation strategies (yaml, arguments to a function, additional parameters if it's a rails controller etc). This is an... full answer >
-
How to remove duplicate lines with regular expressions
By StevenLevithan: 30 October 2009 - 08:35 AM
There is a variety of software (including the Unix command-line utility uniq and Windows PowerShell cmdlet Get-Unique) that can help you remove duplicate lines in a file or ...
-
How to compute distances based on zip codes
By mike-loukides: 26 October 2009 - 12:20 PM
If you're writing a web application, and you want to find places (restaurants, theaters) within a certain distance from your user, you'll probably need to work with zip codes. Here's a go...
-
How to package a Ruby on Rails application for Java EE
By mike-loukides: 26 October 2009 - 11:44 AM
Use the Warbler gem. From the JRuby Cookbook: Use Warbler to package your Rails application as a WAR file. Start by installing the gem: $ jruby –S gem install warbler This gem adds the warb...
-
How to Match IPv4 Addresses with Regular Expressions
By Jan Goyvaerts: 30 September 2009 - 01:11 PM
If you want to check whether a certain string represents a valid IPv4 address in 255.255.255.255 notation, try one of these examples from Regular Expressions Cookbook: Simple regex to check fo...
-
Bit fields in Ruby
Asked by mike-loukides : 29 September 2009 - 02:03 PM
Answered by codemonky: Nov 04 2009 11:33 AM
Ruby does not allow you to control the size of the objects you create. There are currently no gems that abstract out the particular problem you've described. Sad to say, but shifts as masks on int... full answer >
-
How to validate traditional date formats with regular expressions
By Jan Goyvaerts: 18 September 2009 - 12:45 PM
If you want to validate dates in the traditional formats mm/dd/yy, mm/dd/yyyy, dd/mm/yy, and dd/mm/yyyy, using a simple regex that simply checks whether the input looks ...
-
How to create regular expression objects
By Jan Goyvaerts: 18 September 2009 - 10:51 AM
If you want to instantiate a regular expression object or otherwise compile a regular expression so you can use it efficiently throughout your application, try one of t...
-
How to search line by line with a regular expression
By Jan Goyvaerts: 18 September 2009 - 10:22 AM
Traditional grep tools apply your regular expression to one line of text at a time, and display the lines matched (or not matched) by the regular expression. If you hav...
-
How to replace all matches in a regular expression
By Jan Goyvaerts: 18 September 2009 - 09:56 AM
If you want to replace all matches of the regular expression before with the replacement text after, try one of the following examples:C#You can use the static call when you process on...
![]() ©2009, O'Reilly Media, Inc. (707) 827-7000 / (800) 998-9938 All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners. |
About O'Reilly Academic Solutions Authors Contacts Customer Service Jobs Newsletters O'Reilly Labs Press Room Privacy Policy RSS Feeds Terms of Service User Groups Writing for O'Reilly |
Content Archive Business Technology Computer Technology Microsoft Mobile Network Operating System Digital Photography Programming Software Web Web Design |
More O'Reilly Sites O'Reilly Radar Ignite Tools of Change for Publishing Digital Media Inside iPhone makezine.com craftzine.com hackszine.com perl.com xml.com Partner Sites InsideRIA java.net O'Reilly Insights on Forbes.com |