Displaying 20 results from an estimated 2000 matches similar to: "anyone using ENCODE and DECODE in SQL in ActiveRecord?"
2006 Feb 03
4
(BUG in svn/trunk?) - superclass mismatch for any subclass of ApplicationController
I track svn/trunk of Rails using svn:externals
Some change to Rails committed in the last 1-2 days broke my subclass
of ApplicationController
The example, below, works with Rails 1.0, but in today''s svn, it dies
with the following error:
"superclass mismatch for class FooController"
class ApplicationController < ActionController::Base
end
class FooController <
2010 Jun 09
1
Subset columns by prefix
Hello R listserve,
I would appreciate someone's help with this problem. Consider the following toy dataset:
x <- read.table(textConnection("worldclim.1 worldclim.2 cru.1 cru.2
indv.1 7 8 32 658
indv.2 7 7 39 422"), header = TRUE)
How could I create a subset of the data based on the column prefix? For instance, let's say I wanted to subset only the columns with the
2006 Mar 08
1
MSSQL error - 80004005 & Rails
hey there folks, i have a bit of a sitch here and i would love some
help/input on it.
i''ve inherited a horrible asp/mssql app that i''m re-writting using
rails, but unfortunately i have to keep the asp version up and running.
in order to do so i''ve had to write some admin functions, which i''ve
done in rails. because the mssql schema wasn''t written
2009 Apr 03
1
[LLVMdev] build error on libLLVMSystem.a without any useful error message
Thanks Kenneth,
but it looks like the problem lies elsewhere :ar -cru
/Users/nraynaud/Desktop/geek/llvm-svn/build/Debug/lib/libLLVMSystem.a
/Users/nraynaud/Desktop/geek/llvm-svn/build/lib/System/Debug/Alarm.o
/Users/nraynaud/Desktop/geek/llvm-svn/build/lib/System/Debug/Disassembler.o
/Users/nraynaud/Desktop/geek/llvm-svn/build/lib/System/Debug/DynamicLibrary.o
2010 Oct 20
2
[PATCH] klibc: reproducible builds
From: Maciej ?enczykowski <maze at google.com>
This adds a new setting: KBUILD_REPRODUCIBLE
If it is non-empty, ar and ranlib will be called in such
a way that timestamps do not affect the build output.
This allows one to get perfectly reproducible builds.
Signed-off-by: Maciej ?enczykowski <maze at google.com>
---
scripts/Kbuild.klibc | 14 +++++++++-----
usr/klibc/Kbuild |
2009 Apr 03
0
[LLVMdev] build error on libLLVMSystem.a without any useful error message
Nicolas Raynaud wrote:
> Thanks for your reply,
>
> Perl is implied ???
>
> here is the version :
> nraynaud at macaron-2:~/Desktop/geek/fp$ perl --version
>
> This is perl, v5.8.8 built for darwin-thread-multi-2level
> (with 2 registered patches, see perl -V for more detail)
>
> the two patches are :
> Locally applied patches:
> fix for regcomp
2010 May 03
2
advice?
All-
Thank you in advance for any help you might be able to lend. Here is
my issue. I am trying to open a fairly large .dat file. The file
originally was downloaded as a GZ file but I unzipped it (with 7-zip) into
it's current 1.86 gig .dat format. I know that the data is "just a plain
ASCII file with 720 columns and 360 rows per time step (month). It should be
readable by
2006 Jun 30
0
find_by_sql not quoting properly (in acts_as_taggable plugin)
I have run into a very strange problem discovered through the use of
the acts_as_taggable plugin, but related to quoting/sanitizing the
interpolated list in a find_by_sql. Apologies for the length, but I
wanted to be complete. ;-)
The method from acts_as_taggable.rb is:
def find_tagged_with(list)
find_by_sql(["SELECT #{table_name}.* FROM #{table_name},
tags,
2010 May 07
1
undefined method 'find_by_sql'
Why would I get an undefined method `find_by_sql'' for #Example:
0x981a4e4> for error when trying to use the find_by_sql method in my
model?
def init_dictionaries
tables = find_by_sql( "SHOW TABLES FROM thesaurus" )
@@tables = tables.collect{ |t| t.Tables_in_thesaurus }
end
--
You received this message because you are subscribed to the Google Groups "Ruby
2006 Jan 26
1
Help constructing a find_by_sql command
Hello all. I am trying to do the equivalent of:
@componentlogs = Componentlog.find(:all,
:conditions => [ "cl_compname like ?", @criteria ],
:offset => offset,
:limit => items_per_page,
:order => "cl_spr DESC" )
in a find_by_sql statement. I cannot use the build in because the
adaptor isn''t quite right (OCI8)
When I use it I get the following error
2007 Jan 20
2
find_by_sql with named parameterized sql
I tried to use named parameters in my SQL query , using find_by_sql
Order.find_by_sql ([select * from orders where amount > ? and quantity >
?", [ @amount, @quantity ] works;..
but
Order.find_by_sql ([select * from orders where amount > :amount and
quantity > :quantity ", [ :amount => @amt, :quantity => @qty ] is not
working
a I wrong or should I use a plain select
2006 Jun 30
3
type casting
Hello,
I have a user table linked to the login code that was in the
"Agile" book. When someone signs in they are assigned to a group, such
as "adult" or "teenager". I would like to take this group string and
reference a table with "find_by_sql()" so that:
(group.capitalize).find_by_sql() would work (and, of course, in the
select request in the
2007 Oct 17
1
Fwd: Re: FLAC for "ARM little endian for glibc"
On Thursday 04 October 2007 04:27:47 you wrote:
> Sir, you need to provide more information. What kind of errors? What
> is not working? What exactly are you trying to do? What compiler are
> you using?
H IV0,
we are using a lot of different cross-compiler (mainly based on GCC 3.4.x)
When I tried to cross-compile FLAC for non-i386 platforms (such as ARM), I use
use
2006 Jan 10
0
find_by_sql + partials question
Ok now that I have find_by_sql love working for my "Top 10 List" I
want to make them a bit more DRY. Tis is what I have so far:
Model:
def self.topfish
find_by_sql["select species.name,
length,species.multiplier*length as score,caught_on from entries join
species on species_id = species.id where species_id = ? order by
score DESC LIMIT 10", species]
2007 Aug 14
1
find_by_sql vs connection.select_all
I was trying to do SUM based mySQL query simliar to the following:
SELECT SUM(updated_on - created_on) AS total from signups
If I were to run this command in the mySQL console I would get a
result. However, if I were to run it using the following command in
Rails:
Signup.find_by_sql("SELECT SUM(updated_on - created_on) AS total from
signups")
The query that is written to the log is:
2006 Sep 01
3
find_by_sql with :include?
When you use find, you can include related objects with include so that
both objects get instantiated in the results, e.g. Foo.find(:all,
:include => :bar).
But when you use find_by_sql, is there a way to do this? You could
definitely write the find_by_sql SQL to join Foo and Bar tables:
Foo.find_by_sql("SELECT foo.*, bar.* from foo, bar where foo.bar_id =
bar.id")
But is there a
2003 Nov 29
1
[PATCH] ash not make -j safe, make spotless updates
some files depend on nodes.h, but there is no dependency for that fact.
olaf@mandarine:~/klibc-0.87> grep -Er 'include.*nodes.h' ash/ | sed 's-^[^/]\+/\([^.]*\).*-\1.o-' | xargs echo OBJ_NODES =
OBJ_NODES = cd.o eval.o exec.o expand.o jobs.o main.o nodes.o options.o parser.o redir.o show.o trap.o var.o
make spotless doesnt work reliable, the patch adds a few more targets.
Is
2006 Dec 14
3
Problem with ActiveRecord and Associations
Hi,
I''m having what I believe to be a typecast problem with ActiveRecord and
Associations. In the code below, I need to flag a contact record for
deletion if the contact doesn''t have any addresses or books records:
sql = "select id, delete_flag from contacts where id = #{params[:id]}"
contact = Contact.find_by_sql(sql)
if (contact[0].addresses.count +
2006 Apr 21
5
Simple Question: How to merge SQL results?
Hopefully an easy one, how do I merge two or more SQL query results?
Example:
result1 = find_by_sql(x)
result2 = find_by_sql(y)
What is the best way to merge result1 and result2? I want to be able
to reference the objects as if they were obtained via one query.
Cheers,
Dan
2011 Aug 09
2
[LLVMdev] llvm-gcc with static libraries
Hello,
While linking programs against static libraries built using llvm-ar and
llvm-ranlib, I see an error message:
could not read symbols: Archive has no index; run ranlib to add one
collect2: ld returned 1 exit status
Using either /usr/bin/nm or llvm-nm (depending on the use of --emit-llvm
flag to llvm-gcc), one of them is able to list the symbols in the archive
file. However, the link step