Displaying 20 results from an estimated 700 matches similar to: "ActiveRecord row-by-row processing"
2013 Mar 07
1
HELP:Custom function didn't work
hi,guys-
I have a mysql database which stores host informations,so I wrote a
function to get some values.
- Here is the function rb(this function should return the type I defined
in the database):
#hosttype.rb
require "mysql"
module Puppet::Parser::Functions
newfunction(:hosttype, :type => :rvalue, :doc => "Gets host type from
db.") do |args|
2006 May 23
8
ad-hoc query
How do you run an ad-hoc query that does not belong in any model? I
thought it was something like ActiveRecord::connection.find("my
query..."), but I can''t seem to find the documentation on it. I know
I''ve seen it somewhere before, though.
thanks,
Jeff
--
Posted via http://www.ruby-forum.com/.
2008 May 30
9
find_by_sql without a model? how to do this?
Hi,
I''d like to do a "find_by_sql" without a model (e.g. <model
name>.find_by_sql("...")) as the results I get back are a once off special,
and I''m happy to handle them as an array. How do I do this?
"ActiveRecord::Base.find_by_sql(...)" does not seem to work?
Background - At the moment I''m doing within a model <model_name>,
2010 Aug 13
6
Equality of Vectors
Hello,
Is there a way to get a single TRUE or FALSE statement from comparing two
vectors? For example,
c(1,2,3) == c(1,2,3)
produces
TRUE TRUE TRUE
where I would like it to produce only
TRUE
for use in an if statement.
Likewise, when two vectors are not exactly identical (in all elements) I
would like a single FALSE result, as opposed to
c(1,2,3) == c(1,2,5)
TRUE TRUE FALSE
Any ideas?
2005 Nov 03
9
[Idea] session-wide persistent variables
I was thinking about having instance variable stored and fetched from
session container automatically before calling an action and after the
action is finished. Using methodology of accessors it would look like:
class MyController < ActionController::Base
persistent_attr :person
def alfa
person = ''John Smith''
# render as usual view alfa.rhtml with anchor
2005 Aug 17
7
Need help with the rubyonrails wiki - instiki filters
I am trying to do a tutorial improvement on the wiki but I am having
some problems with the auto formatting. Using httdp.conf produces
http://httpd.conf when filtered. Using *.so produces .so and bold text
there after.
Is there any shorthand for the user for making text appear as it should
without the linking and re-writes? Or does the admin have to change the
filters in Instiki?
Tesla
2010 Jun 22
5
Displaying Iteration Count
Hello,
I'm running a very long for loop that usually takes hours. For my own piece
of mind, it would be nice if I could check periodically and see which
iteration the loop is on. A line of code that told R to print the iteration
number every 100 or 200 iterations would be perfect.
Does anyone know something like this? I've never known how to print
anything within a for loop before the
2009 Jul 27
13
[Bug 22956] New: nv50: kms, random screen blinkage
http://bugs.freedesktop.org/show_bug.cgi?id=22956
Summary: nv50: kms, random screen blinkage
Product: xorg
Version: git
Platform: Other
OS/Version: All
Status: NEW
Severity: normal
Priority: medium
Component: Driver/nouveau
AssignedTo: nouveau at lists.freedesktop.org
ReportedBy: kamilkss
2016 Aug 24
2
maildirsize not correct
Thanks, but this is most probably different issue. My maildirsize is
computed incorrectly even if I delete it completely and let dovead
recompute it so expunging is not in the game.
Is there any way how to track/debug the recomputation algorithm in dovecot?
On Wed, Aug 24, 2016 at 12:02 AM, WJCarpenter <bill-dovecot at carpenter.org>
wrote:
> A long shot, but here's how I
2009 Feb 16
17
[Bug 20130] New: GT200: nv50 chipset 0xa0 lockup
http://bugs.freedesktop.org/show_bug.cgi?id=20130
Summary: GT200: nv50 chipset 0xa0 lockup
Product: xorg
Version: git
Platform: x86-64 (AMD64)
OS/Version: Linux (All)
Status: NEW
Severity: normal
Priority: medium
Component: Driver/nouveau
AssignedTo: nouveau at lists.freedesktop.org
2004 Jan 27
2
rsync still hangs on cygwin 1.5.6-1 and 1.5.7
Hi,
Rsync is still hanging under cygwin for me. I'm using rsync 2.6.0 and i've tried cygwin-1.5.6-1 as well as a snapshot of 1.5.7.
I've noticed that some people are having success. I shouldn't have to do anything interesting in order to make this work, right?
***********************************************************************
This message is intended only for the use of
2010 Apr 19
2
ecdf
Hello,
I'd like to plot an empirical cumulative distribution function, except
instead of the fraction of values < x, I'd like the fraction of values > x.
I think this can be done using the ecdf function in {Hmisc}. I installed
the package and loaded it. However, when following the example given in the
documentation, I get an error:
x <- rnorm(100)
ecdf(x,what='1-F')
2008 Mar 05
6
Prototype Observe Links (Mouseover)
Hi all,
I''am new to Prototype and after a 2 hours of research I didn''t find a
solution for the following question:
I have the following list:
<ul id="navi">
<li><a href="/about/">Home</a></li>
<li><a href="/about/" class="dropdown"
onmouseover="showSubnavi(this)">About</a>
2011 Sep 23
4
'save' saved object names instead of objects
Hello,
I created an array to hold the results of a series of simulations I'm
running:
d.eta <- array(0,dim=c(3,3,200))
<simulation goes here and populates the array but it's not important>
Then I tried to save the results using this:
save(d.eta,file="D:/Simulation Results/sim 9-23-11 deta")
When I later tried to reload them using this:
d.eta <-
2016 Aug 23
2
maildirsize not correct
Hi,
One of my email accounts has 1,5gb of emails in INBOX, but maildirsize
shows only 528mb. 'du' also shows 1,5gb and there are 3809 files in cur
directory.
When I use mailbox status a can see correct values:
doveadm -f table mailbox status -u user at domain.sk "messages vsize" INBOX*
messages
vsize
INBOX 3809 1521049349
but when I check the quotas with doveadm:
2002 Oct 11
5
Changing video quality during encoding
I don't know how to change a video quality on the fly - I want to provide a slider with a preview window, so user could see the result immediately in this window. I tried to send ICM_COMPRESS_FRAMES_INFO to encoder or calling ICSetState() - with no success however. Am I doing something wrong ? How can I set 'lDataRate', 'dwRate', 'dwScale' parameters ? I tried every
2012 Dec 29
4
lda crash?
When I try to refilter some messages lda crash:
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: lda-log.txt
URL: <http://dovecot.org/pipermail/dovecot/attachments/20121229/b64bf43d/attachment-0004.txt>
-------------- next part --------------
doveconf -n output
-------------- next part --------------
A non-text attachment was scrubbed...
2011 Sep 23
1
Simple Association
Hello, I am new to rails and I need a little help getting started with
a simple association. Here is what I am trying to do.
I have a model, message, which has text and a user (do not need to
worry about associating users to messages right now). These messages
come in and I would like to create a response for each, which itself
is a message. Then I would like to create a transaction paring these
2011 May 17
2
Minimum value by ID
Hello,
I have a longitudinal dataset where each individual has a different number
of entries. Thus, it is of the following structure:
x <- runif(12)
id.var <- factor(c(rep("D1",4),rep("D2",2),rep("D3",3),rep("D4",3)))
dat <- as.data.frame(x)
dat$id.var <- id.var
dat
> dat
x id.var
1 0.9611269 D1
2 0.6738606 D1
3
2010 Mar 22
1
Error while trying to save summary() output as csv
Hi,
I need to save output of summary() procedure to a csv file. It's all
OK when it's applied to a 'factor' class variable, but when I try to
save a 'integer' class summary to csv it gives me :
> summary(rnorm(100, 10)) -> object
> write.csv2(object, file='name.csv')
Error in do.call("expand.grid", c(dimnames(x), stringsAsFactors =