similar to: Getting distinct years from a date column the Rails way

Displaying 20 results from an estimated 700 matches similar to: "Getting distinct years from a date column the Rails way"

2006 Apr 03
1
Why no call to Model.new on find?
I created a model with some internal state derived from a combination of database and non-database data. Since I wanted to calculate these values once rather than every time they''re requested by the view, I calculated them in the initialize method and set some instance variables. However, I soon noticed that these values weren''t getting set when I retrieved data using the
2005 Feb 13
5
Select Enumerated Values with FormOptionsHelper
Hey, I''m new, so apologies if I''ve overlooked obvious resources or violated any etiquette rules for this list. Since rails does not support the MySQL enum data type, I''m following David''s advice of using a varchar and storing the valid values in the application: http://one.textdrive.com/pipermail/rails/2005-January/001536.html So here''s my
2002 Feb 05
2
Wine always tries to connect to ":0.0"
Wine always give errors when it tries to start on xser ver ":1" because it always tries to connect to ":0.0". I know that DISPLAY is set correctly: Xlib: connection to ":0.0" refused by server Xlib: Client is not authorized to connect to Server
2006 Aug 17
8
Creating queries..
Hi, I am trying to implement a few queries now. What are good ways to do this? Right now, I have a list page that does sorting and can carry out a generic pagination request. @user_result_pages, @user_results = paginate(:user_results, :per_page => 20, :conditions => @condition, :order_by => @sort_order) I create @sort_order earlier in the list function. The problem I am having is
2010 Dec 16
1
Is there a join() function in R ? OR: simulating "Combining ggplot2 and Google Maps" by David Kahle
Hi everybody Im on R version 2.11.1 on Mac OS X I am working through David Kahle's example of using ggplot2 with Rgooglemaps (found here: https://github.com/hadley/ggplot2/wiki/Crime-in-Downtown-Houston,-Texas-:-Combining-ggplot2-and-Google-Maps). Excellent page by the way. I have downloaded the data and the code and want to learn how to do this by first simulating David's results and
2006 Mar 31
10
ruby help / if (cond or cond)
Why this code doesn''t work as expected? It raises exceptions everytime. Tried with || operator, too. validates_each :x, :y do |record, attr| record.errors.add (attr, ''between 1 and 100'') if (attr.to_i>100 or attr.to_i<0) end -- They say money can''t buy happiness? Look at the smile on my face... ear to ear, baby!
2006 Apr 25
2
Re: Internet Explorer Installation
Stephen Bauman wrote: > I'm trying to install MS IE 6 SP1. I'm using Fedora Core 5 and the Wine > that comes with wine.0.9.11-1.fc5.rpm from the distribution. > > "Setup was unable to download the required components. Please make sure > you are connected to the Internet or try to run Setup again later." > > I'm definitely connected. Are there any settings
2008 Aug 01
1
how to include an explicit list of files
I want to rsync files between two machines, but only a subset of the files on the server. I want to specify the subset explicitly via a list of files to the rsync daemon. I've tried: filter = + */ \ + foo/bar/file1 \ + foo/bar/file2 \ + bar/baz/file3 \ - * but this doesn't work - I end up with stuff like foo.obsolete/file4 when rsyncing. I
2010 Jan 23
3
How to implement a "select distinct x, count(distinct y) ... group by x" for a data frame
... Being an R newbie, I can only think of extracting distinct x values with unique, looping over them, extracting matching rows from the original data frame, applying table, and recording the size of table's output alongside the x value being checked. Is there a more elegant way? Thank you. -- View this message in context:
2006 Jul 19
0
Find, .map and Distinct
@rate_types = PerformerCategoryRate.find( :all, :conditions => [ "performer_category_id = ?", @calc_sheet_performer_line.performer_category.id ], :select => "DISTINCT rate_type_id, min(id)", :group => "rate_type_id" ).map { |pc|
2010 Apr 13
0
dbFD computing distinct species wrong?
Hi everyone, I am working with the dbFD function of the FD package, and there's something funny happening with the value of sing.sp in the output. Basically, I have a species-function matrix and a community matrix. One site in particular has 6 species, 4 of which have identical functional coding. I thus expect nbsp = 6 and sing.sp = 2 for this site. However, nbsp = sing.sp = 6. This
2012 Apr 21
1
[regid23@yahoo.com: Bug#669667: faq.html: missing separator between two distinct shell command s]
I received the attached bug report from a Debian user; it applies to http://www.openssh.com/faq.html (I ship a copy of the FAQ in the Debian package). Could somebody make this adjustment on the OpenSSH web site? Thanks, -- Colin Watson [cjwatson at debian.org] -------------- next part -------------- An embedded message was scrubbed... From: Regid Ichira
2005 Nov 15
1
distinct search
Hello, I have done a search for this issue, but I didnt really see an answer. if i want to store things in a hierarchy, but i want items to be in multiple categories at any level. i'd like to be able to search for an item and only show it once, but maybe (not required) show what categories the results are in. but if i look in a category (search on that category) then i want to see that
2009 Aug 29
0
[LLVMdev] A create-distinct-item function with no (other) side effects
On Fri, Aug 28, 2009 at 5:56 PM, Kenneth Uildriks<kennethuil at gmail.com> wrote: > It would also > help optimize away calls to "random" in some cases. If you're talking about the Unix random(), it does has visible side effects, specifically related to the guarantee that an srandom call followed by N random() calls will always produce the same sequence of N numbers.
2006 Apr 04
0
Dial(L(x...)) distinct to SET TIMEOUT(absolute)
I have been experimenting with setting call time limits, and modifying those limits on the fly. My application is a case where a user has a time limit on their call, determined by the user's credit. The time limit may be extended by the provision of more credit. It is desirable to use the L flag of the Dial() application, as it gives the user audible feedback. I was hoping to be able to
2008 Apr 23
0
poly() can exceed degree k - 1 for k distinct points (PR#11251)
The poly() function can create more variables than can be fitted when there are replicated values. In the example below, 'x' has only 5 distinct values, but I can apparently fit a 12th-degree polynomial with no error messages or even nonzero coefficients: R> x = rep(1:5,3) R> y = rnorm(15) R> lm(y ~ poly(x, 12)) Call: lm(formula = y ~ poly(x, 12)) Coefficients:
2005 Mar 17
4
beginner question: how to sort out distinct values from a vector
there is a vector, like: 1, 1, 1, 2, 2, 3, 3, 4, 5, 5, I'd like a function that gives me only 1, 2, 3, 4, 5 thank you
2008 May 06
2
Concatenate a vector into a string, only using distinct component
I'm trying to use combine c('a','b','c','a','c') into 'a, b, c', the order does not matter. paste(c('a','b','c','a','c'), collapse=', ') yields 'a, b, c, a, c'. Any idea? -- Regards, Anh Tran [[alternative HTML version deleted]]
2009 Aug 27
1
distinct elements of a vector
Hello, I have the vector (a,b,a,c) and I trying to obtain it's distinct elements in another vector. Is there a function that can do this? Thanks, Bogdan -- View this message in context: http://www.nabble.com/distinct-elements-of-a-vector-tp25168032p25168032.html Sent from the R help mailing list archive at Nabble.com.
2010 Feb 02
2
Retrieve distinct values within a whole data frame
Hello everyone, I am trying to retrieve the list of distinct values within a whole data frame. I tried to use unique() function but it retrieves the distinct values within each column or row, I want it for the entire data frame, any idea? ----- Anna Lippel -- View this message in context: http://n4.nabble.com/Retrieve-distinct-values-within-a-whole-data-frame-tp1460205p1460205.html Sent from