similar to: Regular Expression Question

Displaying 20 results from an estimated 10000 matches similar to: "Regular Expression Question"

2006 Mar 09
15
regular expressions slay me
I am furiously trying to find what I am looking for in Pickaxe book and not finding it. I''m getting some values back from a posted form and I need to get the ''id'' number off the backend. The ''String'' will always come back to me as... Some_name\r\n123 where 123 is actually the id number which I need to execute the find. The reason they are coming back
2006 May 12
5
Is there a method for incrementing string names?!?
Hello, I have model which has a property named "name", I want to append a number to the end of the name when there is similar name in db. name, name1, name2... Is there a ready to use method in ruby and/or rails for doing so? Thanks in advance, - Dunnil
2006 Nov 13
3
(A bit offtopic): A good starting book for ruby programming?
Hi all Guess it''s time for me to dig a bit deeper into the ruby language. Can you recommend some good starting books on ruby programming? Thanks. -- Med venlig hilsen Juri Rischel Jensen Fab:IT ApS Vesterbrogade 50 DK-1620 København Tlf: 70 202 407 / Fax: 33 313 640 www.fab-it.dk / juri@fab-it.dk
2007 Aug 08
6
What ruby/rails componet do I need?
I stole a script from the archives which shows how to launch an https version of webrick. However I am getting an error that indicates that my ruby/rails isntallation is missing a component to support ssl as called from webrick. The script line in question is: 6 require ''webrick/https'' and the error stack generated is:
2006 Feb 26
28
A Follow up to my fedora question: Favorite Flavor Of Linux?
Than my question is this? Now that I have switchtowerized and migrate enabled my app I can start down a new path if need be on a different OS as the base of the system. We have already tried CentOS and found it to have more issues than those mentioned about fedora and through it away faster than one could shake a stick at. Here are our requirements for a stage/dev box and production:
2008 Jan 30
6
Schedule parser
Hi, I was trying to schedule a worker to run during the midnight hour like this: :schedules: :collector: :process_something: :trigger_args: 30 * 0 * * 2,3,4,5,6 When I try to start backgroundrb, the "collector" worker failed to start up and I find this in backgroundrb_server.log: /home/mengkuan/apps/testrailsapp/current/vendor/plugins/backgroundrb/
2008 Jan 18
2
NameError when using alias_method -- but method exists?
Hello Rubyists, I am a bit stumped here. I want to extend the ''load_file'' method in the YAML module. Following along with the PickAxe example of making old methods do new things, I try this in irb: >> module YAML >> alias_method :orig_load_f, :load_file >> def load_file(*args) >> contents = orig_load_f(*args) >>
2006 Jan 10
3
Getting a user from a model (sort of a noob) (resend sorry)
Sorry for the resend but I am not sure if the first one ever made the list. As mentioned in my previous posts I''m trying to create a dynamic directory for file_folumn. After finding out that I didn''t have the most recent version I installed the latest trunk and am able to get file_column to act as it should. However I have been racking my brain on how to implement
2006 May 02
4
ordering after a inject
Hi, My results are getting out of order after I do the following command: count = result.inject({}) { |hsh, row| hsh[row[''name'']] = row[''count''].to_i; hsh } Why? Here are more specifics: My complete method is this (based off of acts_as_taggable code - not'' DHHs, but the original one): def self.sql_to_count_plays(lookback) sql =
2006 Apr 15
6
view code regular expression
I''m lost on regular expressions to begin with... I''m trying to fix a value to one of 4 radio buttons as there will be value of either 1,2,3 or 4 in @roles_users... <TD><input type="radio" id="roles" name="case_managers[case_manager_name]" value="Case Manager Admin" <% if =~ @roles_users /1/ checked =
2009 Aug 24
2
[LLVMdev] Regular Expression lib support
On Aug 23, 2009, at 5:50 PM, OvermindDL1 wrote: > On Sun, Aug 23, 2009 at 6:32 PM, Daniel Dunbar<daniel at zuster.org> > wrote: >> This is too heavy, and we don't need the extra features, and regexec >> is well tested and much more standard. Unless there is an >> overwhelming > > 'regexec' I had never heard of, figured it was a library, turns
2009 Dec 07
3
Regular expression help
Hi there I have a string like this i want to extract 9831019 from this string i used a regular expresion \d+ by which i can only make it to see 7 and returns. This type of number(9831019) appears in any part of the string and is definitely more than 5 digits all the time and i want to give that as a condition UV7C11-F9-E1 MCS#9831019 MCS Lot #9512516" how do i go abt it Ramya -- View
2005 Feb 22
1
periodic/security/550.ipfwlimit
550.ipfwlimit check in /etc/periodic/security takes into account only global/default verbosity limit and does not account for a specific logging limit set for a particular rule e.g.: $ ipfw -a l | fgrep log 65000 *521* 41764 deny log logamount *1000* ip from any to any $ sysctl -n net.inet.ip.fw.verbose_limit *100* >From security run output: ipfw log limit reached: 65000 519
2006 Dec 21
10
versioning of win32 versus ruby gems
I know we already mentioned this before on the list but I couldn''t find it in the archives. Is there a way to differentiate the versions for ruby/mswin32 so that I could run a command like: # sudo gem install mongrel --source=http://mongrel.rubyforge.org/releases/ --include-dependencies --version 1.0 and have it not prompt me like this: Select which gem to install for your platform
2006 Feb 01
8
ruby equivalent of isset()
Hi, Is there a way to test if a certain (local) variable has been initialized? I''d like to do something like if isset(myvar) and myvar.true? #some code else #default behaviour end I have a lot of shared views that I call with params such as { show_pager => true Instead of having to explicitly say show_pager => false it should be possible to make false a default value, right?
2012 Nov 02
1
[Rails 3.2.8] issue in regex scan
running a scan in irb is fine : 1.9.3p194 :001 > request_url = "http://lvh.me::3000/en/backoffice/cms-admin/site/6/pages" => "http://lvh.me::3000/en/backoffice/cms-admin/site/6/pages" request_url.scan(/^([\S]+)(backoffice\/cms-admin\/site\/)(\d+)(\/pages)$/)[0][2] => "6" however running it in my controller doesn''t gives any result : (rdb:1)
2011 Mar 03
1
Does RSpec interfere with Pathname#dirname or Pathname#realpath ?
Hi, I starting a new project, and have run into behavior I cannot replicate in irb, (i.e. outside of using rspec) when the directory? returns true, so I thought I''d ask here, in case any one has seen this badhavior. ruby-1.9.2-p136 rspec (2.5.0) rspec-core (2.5.1) rspec-expectations (2.5.0) rspec-mocks (2.5.0) When I try to run this spec: require Pathname(__FILE__).ascend { |d|
2006 Dec 27
10
Mixing html tags and Ruby blocks
I''m trying to get the following idea to work: <%= @column_names.each { |t| <td> t.downcase </td> <td> @listing.send(t.downcase)</td> } %> Essentially I want to display a form that has a left and right TD, with the left TD being a column name and the right TD being the column data. If there''s a better way (the Rails way ?), I''m all ears
2006 Mar 22
14
currency conversion webservice in a rails app?
Hi, I''m interested in using a currency conversion web service in my rails app. Does anyone have a free service that they use and like? I found this one http://www.webservicex.net/WS/WSDetails.aspx?CATID=2&WSID=10 I''ve tried to make a simple, plain Ruby script to connect to this and get a conversion rate without success. How do I integrate a webservice into my rails app? I
2006 Jun 25
6
Understanding Common Views
Hi Everyone, I''m trying to formulate my thoughts on how views work in RoR and I understand the basic bits - 1. Every controller has its own view defined using rhtml files in the views/[controller_name] folder. 2. There is one "view" file (rhtml) for every in the controller and has the same name as the method. 3. For portions that are common, partials can be used - file