search for: some_string

Displaying 12 results from an estimated 12 matches for "some_string".

2006 Nov 01
0
Re: YAML.load(some_string) doesn't return hash?
Oleg Kh wrote: > A small problem here. As per documentation on > http://corelib.rubyonrails.org/classes/YAML.html YAML.load(string) > should just return a hash. However on my windows machine it returns > something like this: > > #<YAML::Syck::DomainType:0x36d5038 > @domain="yaml.org,2002", > @type_id="map:HashWithIndifferentAccess", >
2004 Feb 17
0
VFS module programmieren
...If NOT leave them as they are. (e.g. this could be the variable for the private debug class.) If YES pack all this data into a struct. You can use handle->data to point to such a struct on a per connection basis. e.g. if you have such a struct: struct example_privates { char *some_string; int db_connection; }; first way of doing it: static int example_connect(vfs_handle_struct *handle, connection_struct *conn, const char *service, const char* user) { struct example_privates *data = NULL; /* alloc our private data */ data = (struct example_privates *)talloc_zero(conn->...
2006 Feb 01
4
Custom view helpers
Hi all, I would like to write some custom helpers like the ones available as form helpers text_field, text_area and the like. My first try was this: custom_helper(obj, meth) ''some_string'' + obj.send(meth) + ''some_other_string'' end Object and method are being passed as symbols like this: custom_helper(:person, :name) and Ruby rightfully complains that the symbol person does not have a method named name. Second try was this. @person is an instance va...
2005 Feb 02
0
Re: VFS calls after disconnect
...ack to the share and map it to a network drive. Is there some way that this data can be preserved irrespective of the number of times that an already connected client tries a reconnection? Any help is highly appreciated! Thanks, Chetana static int connectCnt = 0; struct example_privates { char *some_string; int db_connection; }; static int example_connect(vfs_handle_struct *handle, connection_struct *conn, const char *service, const char* user) { struct example_privates *data = NULL; if ( connectCnt > 0 ) { DEBUG(0,("connection to client already exists\n")); SMB_VFS_HANDLE_GET...
2007 Aug 03
0
StandardTokenizer Doesn''t Support token_stream method
...rret/Analysis/Analyzer.html http://ferret.davebalmain.com/api/classes/Ferret/Analysis/StandardTokenizer.html I ought to be able to construct a StandardTokenizer like this: t = StandardTokenizer.new( true) # true to downcase tokens and then later: stream = token_stream( ignored_field_name, some_string) To create a new TokenStream from some_string. This approach would be valuable for my application since I am analyzing many short strings -- so I''m thinking that building my 5-deep analyzer chain for each small string will be a nice savings. Unfortunately, StandardTokenizer#initialize do...
2011 Jan 23
1
Force UTF-8 encoding
I''m writing an upload script for contact management, but having encoding issues: #=> Encoding::UndefinedConversionError: "\xFA" from ASCII-8BIT to UTF-8 I will not always know the encoding supplied, and this is the result of `some_string.encode("UTF-8")` I have also tried .force_encoding("UTF-8") to no avail. For now I''m simply trying to bypass invalid characters by replacing them with ? or removing them completely so Postgres doesn''t blow up on insert. Any help or advice would be apprecia...
2006 May 22
15
collection_select default selected value
Hiall, Unfortunately I just can''t find out how to setup a default selected value when using collection_select. My call is like so: <%= collection_select(:consultant, :lastname, @consultants, :id, :lastname, { :selected => @current_consultant.id } ) %> which is not working, I debugged so far that I know that @current_consultant.id contains the correct value. Any tips? cheers
2009 Jan 16
12
running a ruby expression stored in a database
Is this even possible? I''ve got a ruby expression stored in a database, it''s the code to run a plugin since I was having trouble passing variables stored in the database. When I try to call the code, it either outputs it as text, or doesn''t display it at all. It''s supposed to generate an image and display it. right now the code is stored in the database as:
2010 Dec 15
3
Spreadsheet gem character encoding
...8) in which I use the Spreadsheet gem to generate Excel files (.xls in my case). I ran into some issues when trying to write foreign characters to the generated Excel-File. The solution I found so far is to use Iconv like this: Iconv.conv(''ISO-8859-9'', ''utf-8'', some_string) This works fine with for example turkish or spanish special characters. However I cant figure out how to deal with japanese characters. My question is how do I have to use Iconv to encode the japanese characters so they will be correctly inserted into the Excel file. Also I would be interested...
2007 Apr 30
0
Proposal for UTF8 vs performance tip.
...void UTF8 processing if you don't need it and have extra speed Many often used utilities are much slower with UTF-8 processing. If you want extra speed and do not need UTF-8 processing, disable it using export LANG=C export LC_ALL=C (not needed if LC_ALL was not set) compare time grep -i -c some_string some_large files with LANG=en_US.UTF-8 and same with LANG=C On modern CPU grepping like this a 100MB files take some 2 seconds with UTF8 (Celeron 3GHz) and is about hundred times faster (0.02s) with LANG=C Even more spectacular speedup is for sort -f
2006 Apr 13
4
equivilent to PHP''s nl2br?
Hey all, this is a pretty simple question but I can''t seem to find anything on the wikki or google... Is there a Ruby/Rails equivilent to PHP''s nl2br function? -- Posted via http://www.ruby-forum.com/.
2007 Sep 27
2
Problem getting "extract" from RDig
...:content_tag_selector => ''body'' 9. ) 10. ) 11. 12. end I have created the index file using the code 1. rdig -c config/rdig_config.rb Now in my controller I have written a code for testing the functionality 1. search_results = RDig.searcher.search("some_string") 2. @results = search_results[:list] 3. @hitcount = search_results[:hitcount] My @result[:extract]is returning me the same initial view code that is common to the application that is my menus and sub menus.. I am not getting the extract on the basis of which I had searched....