Displaying 20 results from an estimated 20000 matches similar to: "parsing tags"
2007 Dec 06
3
number_to_currency
I am using the number to currency function because i live in the uk and
the company want me to only show values of the pound of course.I have
created all my application using ruby script/generate
scaffold_resource.... I have come across with a problem... this code is
in my applcation:
def number_to_currency(number, options = {})
options = options.stringify_keys
precision, unit, separator,
2005 Apr 27
1
Data() and CSV files
Hello,
For reasons I don't understand, data() imports CSV (Comma-Separated
Values) as if they were delimited by semicolons instead of commas. (Are
semicolon-separated Comma-Separated-Value files common somewhere?) Given
that this is the case, if I choose to put comma-delimited CSV files in
my data directory, what is the preferred method of loading these into
memory?
2011 Nov 18
0
Setting nagios hostgroups based on included classes
I''m trying to generate (and manage) nagios configuration based on what classes have been included by nodes. I''ve seen the example at http://docs.puppetlabs.com/guides/exported_resources.html, and I''m doing that now. However, it has some problems:
- puppet runs are very slow on the nagios node
- when I want to change the service configuration in nagios, I have to wait
2011 Jul 14
1
SQldf with sqlite and H2
SQldf with sqlite and H2
I have a large csv file (about 2GB) and wanted to import the file into R and do some filtering and analysis. Came across sqldf ( a great idea and product) and was trying to play around to see what would be the best method of doing this. csv file is comma delimited with some columns having comma inside the quoation like this "John, Doe".
I tried this first
2006 Aug 10
2
search acts_as_taggable for multiple tags
Hey...I''m trying to search a Model that uses acts_as_taggable for multiple tags. I''d like to pass in a search string containing a space delimited tags names (i.e. "tag1 tag2") and return the objects that have been tagged by either one of those. Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2011 Sep 17
0
joining and array with a table in ActiveRecord
Hey
I am pretty new to Ruby on Rails and I have no idea how to solve the
following:
I have a join query on a table like this:
def mytags
Taggable.joins("JOIN taggables as filter ON taggables.tag_id =
filter.tag_id WHERE filter.taggable_type = ''User'' AND filter.taggable_id
= 1").all
end
this works perfectly fine.
then I want to join the result on another
2010 Feb 11
1
Loss of precision when importing data into R
Hi Listers,
I can't seem to figure out why I loose precision when I try to import a
comma delimited file using read.csv or read.table.
The fields of interest are rounded to one decimal place.
DataTimeStamp TerminalID Hours Minutes Latitude Longitude
Status Temperature Battery BootTimes Current Google
1 2/11/2010 12:22:21 PM 4894551 12 0 45.0 -66.5
0 30
2009 Dec 12
1
read.csv to read output of system()?
Dear list,
I have a file that is comma delimited but contains some erroneous
non-delimiter commas. I would like to replace these commas with
semicolons and then read the correct file into R as a data frame.
I want to do this from within R, without changing the original data
file.
My current idea of how to do this would be to use system("sed ...")
and feed the result to read.csv(), but
2004 Feb 26
1
writing polygons/segments to shapefiles (.shp) or other A rcGIS compatible file
The main limitation of the shapefiles package that I put together is that it
does not create shapefiles from R objects - rather it only writes shapefiles
that have been read into R and manipulated within the constraints of the
existing file structure. By this I mean that for example you can change the
coordinates of points and write them back out. Or you can add a bunch of
blank columns in the
2010 Oct 20
2
preferred x-delimited data format for R?
Dear all
What is the preferred spreadsheet-like x-delimited data format for use
with R? Should I prefer tab-, comma-, space- or
some_other_delimitor-seprated data?
I'm asking this because I've been once bitten by CSV data containing `
' ' (apostrophe) symbols that R couldn't easily digest. Probably no
the best approach, I've eventually inspected the document and removed
2007 May 03
2
Parsing data with an uneven number of delimiters
I have a list of data that is delimited by a / and, as long as there is an equal number of delimiters, I can parse the data and put it into a data frame:
> t1<-c("a/a/a","b/bb/bbb","ccc/cc/c")
> t2<-strsplit(t1,"/")
> t3<-data.frame(t2)
> t3
c..a....a....a.. c..b....bb....bbb.. c..ccc....cc....c..
1 a
2004 Feb 16
1
xls2csv.pl: Script to translate Excel files into CSV
I've created a Perl script that translates Microsoft Excel (.xls) files into
comma-delimited text files (.csv) using the Perl Spreadsheet::ParseExcel
module.
Usage
-----
perl xls2csv.pl <excel file> [<output file>] [<worksheet number>]
Translate the Microsoft Excel spreadsheet file contained in
<excel file> into comma separated value format (CSV) and store
in
2012 May 12
5
Help with writing data to csv
I am trying to write data to csv but I am having issues with the separations.
Basically I have some results that I get with R that I copied and pasted
into word and then saved as .txt
I want to write the results to csv because it's easier to make tables in
word (all I would have to do is copy and paste into a table, instead of
typing everything out).
I am able to write the data to the
2009 Aug 19
4
Basic question: Reading in multiple choice question responses to a single column in data frame
I'm using read.delim to successfully read in tab delimited data, but some
columns' values are comma seperated, reflecting the fact that user chose a
few answers on a multi-select question. I understand that each answer is
its own category and so could be represented as a seperate column in the
data set, but I'd like the option of reading in the data column, and
converting it to a
2009 Jun 27
1
Call Parking timeout fails
Hello, all. I'm having a nasty problem with call parking in Asterisk
1.6.1.1 that smells like a bug. When the call returns, it seems to be
returning to a "|" delimited extension and failing. Here is the output
from the console:
[Jun 26 22:20:42] NOTICE[7168]: chan_sip.c:18160 handle_request_invite: Call from 'tkeeley' to extension '56' rejected because extension
2006 Jul 13
1
From the Agile book, page 144 regarding a div tag helper
Hi. in the Rails Agile book here''s what was happening:
>>>
module StoreHelper
def hidden_div_if(condition, attributes = {})
if condition
attributes["style" ] = "display: none"
end
attrs = tag_options(attributes.stringify_keys)
"<div #{attrs}>"
end
# format_price method ...
end
Note that we cheated slightly here. We copied code from the Rails
2006 Feb 28
0
Exporting/Importing selected columns of a database?
Hi, I would like to be able to select one or more columns via the
list.rhtml or similar view file an export those tables to one of the
following formats:
a) excel
b) csv or txt comma delimited
c) txt tab delimited
d) dBase
e) pdf
f) flash paper (optional)
Finally, I would like to be able to import (a) - (d) and associate
them to the appropriate column in the database before importing the
data.
2008 Sep 05
1
reading and parsing gzipped files
Hi all,I have large compressed text tab delimited files,
I am trying to write efficient function to read them,
I am using gzfile() and readLines()
zz <- gzfile("exampl.txt.gz", "r") # compressed file
system.time(temp1<-readLines(zz ))
close(zz)
which work fast, and create vector of strings.
The problem is to parse the result, if I use strsplit it takes longer
2009 Aug 26
1
Applying do.call to a data.frame using function arguments
I'm trying to convert a data.frame to a series of strings (row-wise). There
was a very good discussion awhile back (2002) entitled "[R] string
concatenate across rows of a matrix??" where Tony Plate recommended the
following two alternatives (x2 is an R object of type data frame -- a matrix
also works for solution #1):
1) apply(format(x2), 1, paste, collapse=" ");
2007 Oct 01
3
stringify_keys!
I have seen this numerious times and still have no idea what it means:
undefined method `stringify_keys!'' for "blah22":String
I am tring to change a password. My code looks like:
def change_password
@user = User.find_by_emailaddr( params[:email] )
if @user.nil? # user profile not created
flash[:notice] = "<b style = \"color:red\">No such