Displaying 20 results from an estimated 800 matches similar to: "Some random rails, and maybe Ruby, questions.."
2018 Aug 22
4
[PATCH] generator: Do not claim copyright for future years
This change helps to make libguestfs package build reproducible.
See https://reproducible-builds.org/ for why this is good.
Without this patch, building today's libguestfs in 2033, claims
Copyright (C) 2009-2033 Red Hat Inc.
which cannot be correct.
This affected files like
/usr/include/guestfs-gobject.h
/usr/lib/perl5/vendor_perl/5.26.2/x86_64-linux-thread-multi/Sys/Guestfs.pm
2006 Jan 05
13
Date Validation
Hi,
How can I validate date in model class
Thanks.
Sainaba.
--
Posted via http://www.ruby-forum.com/.
2013 Feb 19
4
Float::INFINITY ranges in where() clause
This seems like such an obvious idea that I''m having trouble believing
I''m the first to think of it. Why not take ranges containing
Float::INFINITY and translate them to the appropriate greater than or
less than comparisons? Example:
class Person
scope :voters, -> { where(born_on: (-Float::INFINITY..18.years.ago)) }
end
This would generate something along the lines of
2008 Feb 28
2
change drop down list to radio buttons
In my RoR app I would like to change a drop down list, which dispays a
list of colors selected from the database. Instead I would like to
create a radio button for each color. The user is allowed to check one
color and this will be saved back into the database as the color for
this user.
I don''t know how to do this. Currently it looks like this:
<%= select(:user, :color_id,
2017 Sep 09
2
Avoid duplication in dplyr::summarise
Dear group,
Is there a way I could avoid the sort of duplication illustrated below?
i.e., I have the same dplyr::summarise function on different group_by
arguments. So I'd like to create a single summarise function that could be
applied to both. My attempt below fails.
df <- data.frame(matrix(rnorm(40), 10, 4),
f1 = gl(3, 10, labels = letters[1:3]),
f2 =
2008 Mar 11
6
saving an ActiveRecord without trigging the callbacks
Hello,
How can I save an ActiveRecord without trigger before_save,
after_save, etc?
Thanks for the help.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group,
2008 Feb 25
6
Event Calendar/Scheduler Implementation
Hi there.
I am a RoR newbie and come from the Java/C# perspective. After digging
into Rails I would like to convert an ASP.NET project -that served as
a protoype- to RoR.
The only thing that I haven´t got a good solution for is handling
calendar events. With that I specifically mean creating, moving an
event or a set of events as well as recurrence handling - similar to
Google Calendar if you
2017 Sep 09
0
Avoid duplication in dplyr::summarise
Hi Lars
I am not very sure what you really want. However, I am suggesting the
following code that enables (1) to obtain the full summary of your data and
(2) retrieve only mean of X values as function of factors f1 and f2.
library(tidyverse)
library(psych)
df <- data.frame(matrix(rnorm(40), 10, 4),
f1 = gl(3, 10, labels = letters[1:3]),
f2 = gl(3, 10, labels
2017 Sep 09
1
Avoid duplication in dplyr::summarise
Hi Lars,
Two comments:
1. You can achieve what you want with a slight modification of your
definition of s(), using the hint from the error message that you need an
argument '.':
s <- function(.) {
dplyr::summarise(., x1m = mean(X1),
x2m = mean(X2),
x3m = mean(X3),
x4m = mean(X4))
}
2. You have not given a great test case in
2019 May 20
2
Agrupar por suma y cuenta con dplyr
Hola,
Tengo un data set con información de transferencias monetarias por paciente
provincia y modalidad de atención. Necesito hacer en una misma operación
una suma de dinero por provincia y modalidad y a su vez una cuenta de
pacientes por provincia y modalidad.
Esto funciona bien:
transferencias<-becas_modalidades %>%
group_by(PROVINCIA,Modalidad) %>%
summarize(dinero =
2023 Nov 03
2
Sum data according to date in sequence
Hi,
I tried this:
# extract date from the time stamp
dt1 <- cbind(as.Date(dt$EndDate, format="%m/%d/%Y"), dt$EnergykWh)
head(dt1)
colnames(dt1) <- c("date", "EnergykWh")
and
my dt1 becomes these, the dates are replace by numbers.
dt1 <- cbind(as.Date(dt$EndDate, format="%m/%d/%Y"), dt$EnergykWh)
dput(head(dt1))
colnames(dt1) <-
2006 May 03
2
grouped output
hello,
Suppose I have a table that looks like this:
center name email
Health Jon jon@test.com
Health Bob bob@test.com
Admin Jane jan@test.com
Admin Jill jill@test.com
I would like the output to look like this:
Health
Jon jon@test.com
Bob bob@test.com
Admin
Jane jan@test.com
Jill jill@test.com
when i using cold fusion, this was easy via a tag called cfoutput.
when i was using java, this was
2018 Feb 10
2
Optimizar función
Buenas para tod en s, tengo una consulta para poder optimizar tiempos. Ejemplo
tengo el siguiente dataframe:
distrito<-c("A","A","A","B","B","B","C","C","C","A","A","B","B","C")
2019 Oct 05
5
should base R have a piping operator ?
Yes but this exageration precisely misses the point.
Concerning your examples:
* I love fread but I think it makes a lot of subjective choices that are
best associated with a package. I think it
changed a lot with time and can still change, and we have great developers
willing to maintain it and be reactive
regarding feature requests or bug reports
*.group_by() adds a class that works only (or
2008 Feb 20
1
text_field_tag - different parameter name
Hi, I have one problem with validation
I am creating e-shop and I have products. This view look like this:
<% for product in @category.products %>
<div class="produktyBox">
<%= product.title %><br />
Price: <br />
<div style="color:red; font-size:large; font-weight:bold; margin-
bottom:5px"><%=
2009 Mar 04
10
total per user
so I am trying to sum month over month the amount that a user has
posted. So for example:
User 1: Jan $3000 Feb $4000 March $1500, etc. I can get this to work
if I sum totals (aggregate of all users) but just not by user.
Here is my code in the controller:
def index
@users = User.find :all, :order => ''name ASC''
@deal_groups = Deal.find(:all).group_by {|t|
2013 Jan 24
12
group by + sum
Hi.. I need some support...
table:
week_id, user_id, project_id, hours
ex. =>
33, 2, 1, 10
34, 2,1,15
33, 2, 2, 20
35, 3, 1,20
etc.
Want to display a sum of hours per week_id per user_id
I have:
@hours = HourUser.includes(:user).group_by { |h| h.week_id }
@hours.keys.sort.each do |hour|
@hours[hour].collect(&:stunden).sum
Hours are summed up, but not sorted by user_id..
How to get
2020 Sep 13
3
CALCULAR SALDO DE CUENTA CORRIENTE
Pido ayuda para calcular el SALDO
*DATAFRAME:*
ASIENTO FECHA CUENTA CONCEPTO ARS_DEB ARS_HAB
SALDO
1 1 2020-01-01 40100006 Asiento de Apertura 0 199517.
-199517.
2 231 2020-01-13 40100006 15/01 CH53677071 GALICIA 14054. 0
14054.
3 231 2020-01-13 40100006 20/01 CH22406030 CREDICOO 9458. 0
23511.
4 231 2020-01-13
2008 Jan 14
15
How to get a Window handle from another app?
Hello,
I would like to get a window handle from another app outside of wxRuby
and convert it into a wxRuby Window handle so that I can use it as the
parent Window for several wxRuby child windows. Basically I want to use
the FRAME_FLOAT_ON_PARENT window style so that my wxRuby windows become
associated with the outside app kind of like toolbars, e.g., they don''t
show up in the
2006 Apr 09
6
Write/Display AR query as Grouped Results?
I''ve got a publications table that contains an author_id foreign key and
a pubrole_id foreign key. What I want to do is query the DB using AR so
that I can get a list of all publications that belong_to a particular
author, and group the results by the pubrole.role_name (Author, Joint
Author, Editor, etc.) so that the results look something like:
Author
book1 info
book2 info
etc.