Displaying 20 results from an estimated 900 matches similar to: "Active Record Question"
2009 Apr 07
4
/lib daemon folder: how do i add a module into the daemon?
I am using the daemons plugin.
I have just one problem how do i add modules from the /lib folder to
the /lib/daemons/daemon.rb file
eg. /lib/basic_functions.rb
this is the file i want to load in daemon.rb
contents daemon.rb:
#!/usr/bin/env ruby
# You might want to change this
ENV["RAILS_ENV"] ||= "production"
require File.dirname(__FILE__) +
2012 Apr 12
6
beginning_of_month problem
Rails 2.3.2, Ruby 1.9.3
I want to get all records for one month from charges table.
recs = Charge.where(["date >= ? and date < ?", t.beginning_of_month,
t.next_month.beginning_of_month])
and this transforms into this query on PostgreSQL
SELECT "charges".* FROM "charges" WHERE (date >= ''2012-03-31
22:00:00.000000'' and date <
2004 Jan 05
7
Are messages censored on this board?
I've submitted a message twice this evening and it has not appeared. Are
messages censored on this board?
regards
john
---------------------------------------------------------
John A Coll, Director, Connection Software
391 City Road, LONDON, EC1V 1NE, UK
Tel: 020 7713 8000 From outside UK Tel: +44 20 7713 8000
Fax: 020 7713 8001 Fax: +44 20 7713 8001
Email:
2006 May 31
7
How to render from with <%%> ?
I have a loop that I iterate through in my view.
<%
coll.each do |itm|
puts(itm.value)
end
%>
How do I render the itm.value without using a <%= %> tag? Should puts
not work?
Joerg
P.S. There is a good enough reason for me wanting to do this :-)
--
Posted via http://www.ruby-forum.com/.
2010 Apr 28
2
Size limitations for model.matrix?
Hello,
I am running:
R version 2.10.0 (2009-10-26)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
on a RedHat Linux box with 48Gb of memory.
I am trying to create a model.matrix for a big model on a moderately large
data set. It seems there is a size limitation to this model.matrix.
> dim(coll.train)
[1] 677236 128
> coll.1st.model.mat <-
2011 Jun 03
1
VLOOKUP in R - tried everything.
I am attempting to emulate the VLOOKUP function from Excel in R.
I want to compare one column (coll.minus.release) with another
(release.days) to get the number of parasitoid released at that time
(TotalParasitoids).
for example:
coll.minus.release release.days ParasitoidTotal
-12 -266 1700
8 -259 1000
8
2008 Jul 10
6
Uppercase all row columns
Hi.
I have to convert the contents of all columns to uppercase before
creating a row. Is there an easy way to accomplish this so I don''t
have to go one column at a time and upcase! it?
Thanks.
Pepe
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group,
2012 Aug 12
2
"Masked by GlobalEnv"
hello everyone,
i am getting problems in graph plotting. When i attach file after adding
color attributes in my data set. i got problem of "GlobalEnv" and masked
the followings. Like this
>attach(machm)
The following object(s) are masked _by_ '.GlobalEnv':
coll, sp
The following object(s) are masked from 'mach':
angle, area, dis, plot, sp
2004 Jan 04
3
Newbie - MWI
Sorry for the partial post a moment ago
With help I got two phones communicating - PCMA/PCMU was the problem.
Next stpe is to try voicemail. VM works fine, I can leave a mesage and then
retrieve it - but no MWI on the phone and no stutter dialtone.
I promise I've spent the requisite 4 hours + on google etc. but have really
no further ideas.
The setup is 2 Grandstream phones (latest
2004 Jan 05
8
This newbie gives up for now - sadly
This newbie has been trying out Asterisk. It has been both a) surprisingly
painful and b) impressive in terms of helpful support from other users.
Having got two phones to communicate and then got voicemail MWI going
(neither painlessly) I decided the next step was to implement call transfer
as per nearly all commercial PBX systems i.e.
hold call
consult another extension
either exit and let
2008 Jul 04
4
Routing and Parameters
Greetings. I have a route something like this:
map.calendar ''/tasks/:year/:month'',
:controller => ''tasks'',
:action => ''calendar'',
:year => /\d{4}/,
:month => /\d{2}/
(Ignore the obvious problems of invalid data.)
I''m trying to create a form that will allow my users to navigate from
one month/year to the next.
2011 May 09
2
[LLVMdev] <badref> showed up when duplicating a list of dependent instructions
I collected a sequence of LLVM instructions, want to make a copy of each
and insert them into a PREVIOUS location inside the same function (all
globals and locals are properly declared before the PREVIOUS location).
Here is the list of instructions I want to duplicate and insert:
0 %90 = load i32* @strstart, align 4
1 %91 = add i32 %90, 2
2 %88 = load i32* @ins_h, align 4
3 %92 =
2010 Jul 20
1
Random Forest - Strata
Hi all,
Had struggled in getting "Strata" in randomForest to work on this.
Can I get randomForest for each of its TREE, to get ALL sample from some
strata to build tree, while leaving some strata TOTALLY untouched as oob?
e.g. in below, how I can tell RF to,
- for tree 1 in the forest, to use only Site A and B to build the tree,
while using the WHOLE Site C data for the oob error
2009 Aug 24
8
overriding .blank? method
Hi,
Does anyone know a way to override .blank? method that rails provides.
I want to add additional custom checks (specific to my application) to
this method.
Thanks,
Pratik
2008 Jan 11
1
Possible bug in R 2.6.1 (PR#10565)
Colleagues,
=20
In using the paste command I have to spell out the collapse option:
=20
> paste(1:3,coll=3D"a")
[1] "1 a" "2 a" "3 a"
> paste(1:3,collapse=3D"a")
[1] "1a2a3"
=20
My understanding is that the abbreviation coll should be adequate.
Actually, even collaps isn't enough:
=20
2011 Jul 01
1
how to apply several math/logic operations on columns/rows of a matrix
Dear R-Fans,
The more I work with matrices (e.g., data.frames) the more I think it
would be helpful to have functions to apply (several!) mathematical
and/or logical operators column- or row-wise in a matrix.
I know the function apply() and all its derivates (e.g., lapply) but I
think this does not help for solving (e.g.) the following task:
assume there is a 3x3 matrix:
1 2 4
4
2010 Jul 09
6
deployment question: has anyone deployed w. sqlite?
Hi,
I''d like to make a demo version of my app available, but I''m not ready
to get into database stuff, yet. Has anyone ever deployed with sqlite
(what I used to develop my app)? If so, what hosting service(s) would
you recommend?
Thanks,
Lille
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this
2011 Mar 02
3
haml to erb - does it work with new html5 tags?
Hi,
I wanted to covert all my erb over to haml, but I use HTML5 tags like
nav, section, article, etc. Any idea if this is supported by haml?
Checked out their site, nothing mentioned there or did I miss
something. Sorry noob here.
--
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
2011 May 09
0
[LLVMdev] <badref> showed up when duplicating a list of dependent instructions
Hi Chuck,
> std::vector<Instruction *>::iterator p;
> Instruction * pi = PREVIOUS_POSITION;
> BasicBlock * pb = PREVIOUS_POSITION->getParent();
>
> for(p = coll.begin(); p != coll.end(); ++p){
> Instruction * CurI = * p;
> Instruction * CloneI = CurI->clone();
clone doesn't know have any magical way of knowing that it should update the
instruction's
2008 Dec 09
7
subclassing vs mixins, which one should be used?
Hey all,
I have two models in my rails project that share a lot of traits. They
each have the same 4 properties, and now I need to add 2-3 methods to
each one that will be the same. In the spirit of DRY I am looking for
a solution to write these methods only once.
Both of these models already inherit from ActiveRecord . . . and I
didn''t know if it was safe to just "whip up" a