Displaying 20 results from an estimated 4000 matches similar to: "How should I pick a random entry from the database?"
2016 Oct 11
2
iOS Parsing Error
Hi,
When compiling mumble-iphone from https://github.com/mumble-voip/mumble-iphoneos <https://github.com/mumble-voip/mumble-iphoneos> I had a parser error on the file CodeOutputStream.m (form https://github.com/booyah/protobuf-objc/tree/696b7b61cdd4e8d77c55ace98b3119194fa04b7f <https://github.com/booyah/protobuf-objc/tree/696b7b61cdd4e8d77c55ace98b3119194fa04b7f>).
I know that the
2006 May 12
8
switching from development to production?
I think I''m missing a step here, but they don''t seem to cover this in
the AWDWR book... does anybody know the various steps required to switch
from development to production mode in Rails? I''ve scoured the
application and changed everything that stands out, but the damn thing
is still running off the development database and won''t connect to the
production
2006 Apr 07
22
Find WHERE in Rails
I''d like to find all records that have a certain integer as their
"level" field in the database. I know how to find all the records:
allquestions = Question.find(:all)
...and I know how to find the one record that has a certain id:
allquestions = Question.find(params[:id])
...but how do you find all the records that share a certain value in one
of their fields? I tried
2005 Dec 14
2
console and webrick problems
Hi,
I''m having errors when running webrick or the console. webrik starts,
but give me an error when I try to load my controller. It give the same
error as the console:
#ruby script/console
Loading development environment.
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/console.rb:23:in
`exec'': No such file or directory - irb -r irb/completion -r
2006 Mar 18
9
How do I write this SQL the Rails way?
I''m trying to find all the unique bill_number, status records in Bills
table. I can do it with a find_by_sql statement like this:
@records = Bill.find_by_sql( "select distinct bill_number, status
from bills
group by bill_number, status;")
How would I rewrite it using ''find :all
2006 Jun 01
4
How do I get today''s date?
I know this is a simple question, but i just want to put the current
day, month, date and year on my website. I still can''t figure out how to
read the Rails API. Can anybody help me out? TIA
--
Posted via http://www.ruby-forum.com/.
2006 Jun 06
8
How do I wrap a <%= link to %> around an image?
I''ve got a bunch of dynamically generated link paths that I want to use
to link some dynamically-generated image paths. Specifically, I want to
link thumbnails in a gallery to the larger images.
But I''m stymied by Rails'' syntax. I can''t figure out how to do this.
I tried this:
<%= link_to(image_tag("../../images/photos/photo.photogroup/TN_
2005 Sep 19
4
indicator value in labdsv
Hi,
I'm trying to find out what threshold of indicator value in labadsv should be
used to accept a specie as an indicator one? So far I assumed that indval=0.5
is high enough to avoid any mistakes but it was based only in my intuition.
I'd be greatful for any advise
best regards
Agnieszka
2006 Jan 30
3
Arrays of objects as parameters to webservices
I think I am missing something terribly obvious. Is it possible to have
an :expects parameter for a webservice that is an array of objects? I
want to have a single webservice that expects all my line items (for an
order). Is this something that is possible?
--
Posted via http://www.ruby-forum.com/.
2006 Mar 31
2
Backslash Escaping in View
Ok, I''m hoping this won''t be a forehead slapper, but take a look at this code:
physician.name.sub(/''/, "\\''")
I''m trying to substitute a single quote with a backslash and a single
quote. This seems pretty simple right? Well, someone kick me and
tell me why it''s not :)
Here''s what I''m getting if the
2006 May 17
5
Today is "Rails Hates Me Day"
Has anybody had Rails just refuse to cooperate with anything?
I had an application working great in development mode, then switched it
over to production, tried to host it, but couldn''t. Some error that I
can''t figure out. So I decided to create a simpler application, host
THAT in little baby steps until something went wrong so I could tell
maybe where I was losing it.
2011 Apr 11
2
Plotting a quadratic line on top of an xy scatterplot
Dear Listserv,
Here is my latest in a series of simple-seeming questions that dog me.
Consider the following data:
x <- read.table(textConnection("temperature probability
0.11 9.4
0 2.3
0.38 8.7
0.43 9.2
0.6 15.6
0.47 8.7
0.09 12.8
0.11 9.4
0.01 7.7
0.83 8
0.65 9.3
0.05 7.4
0.34 10.1
0.02 4.8
0.07 9.1
0.6 15.6
0.01 8.4
0.9 9.6
0.83 8
0.12 8.4
0.01 8
0 5
0.11 9.7
0.41 7.4
0.05 9.4
0.09
2006 Jan 17
5
simple question
How do I pass parameters from one controller to another during
redirect_to command? I want to pass both model and non-model objects.
The solution I use is via session, but I rather pass it as parameters to
the redirect_to
Thanks.
--
Posted via http://www.ruby-forum.com/.
2006 Jul 24
7
RoR + MySQL + Unicode
hello! I have a problem when I want to display data in Unicode from
database. I read <a
href="http://ruphus.com/blog/2005/06/23/getting-unicode-mysql-and-rails-to-cooperate/">this
tutorial</a> but I still have problem with non-English characters. I
don''t have any other idea what I should do. Did you meet with similat
problem? Have you got any idea? Thanks in
2006 Mar 24
2
Return all rows, split then show uniques
I''m returning some rows from a tags database that look like this:
ID WORDS
1. apple banana pear
2. banana melon
3. apple peach lime
What I want to do with that data is use the .split method to divide them
into separate values in an array, then use the .uniq method to return a
unique list of the words like so:
apple, banana, pear, melon, peach, lime
So in my controller I
2006 Apr 20
1
fit testing, FitNesse
Hello,
this is a typical "how do you do it in Rails" question :) I would like
to incorporate fit testing into a RoR app and I''d like to hear your
recommendations on how to do it. In the ideal world I would like all the
table test definitions and implementations stored in svn together with
the app, ability to run the tests with a rake task + a hook to FitNesse,
so that
2006 Feb 23
1
HABTM testing - fixtures not loading?
Hi,
I have a strange problem with testing classes which have a HABTM
relation. It seems that while running my tests with rake the fixture for
the association table is not loaded - as a result I get a failure on a
test which simply checks the number of associated elements - it says
it''s 0 although there should be one. The weird thing is that when I run
the tests with rcov
2005 Aug 08
2
INDVAL and mvpart
Hi,
I'd like to perform Dufrene-Legendre Indicator Species Analysis for
a multivariate regression tree. However I have problems with arguments
of duleg(veg,class,numitr=1000)function. How to obtain a vector of
numeric class memberships for samples, or a classification object
returned from mvpart?
thanks in advance
--
Best regards,
Agnieszka Strzelczak
2006 Apr 06
2
making an integer from a float
Does anybody know how to turn a floating-point number (i.e. 60.345) into
an integer by cutting off or rounding the decimal portion? Either
method, or both, would be quite welcome. Thanks! This forum rocks!
--
Posted via http://www.ruby-forum.com/.
2006 Mar 30
2
How do I format text before saving it?
I tried to use a before_save and use simple_format, it returns and
undefined method error. Can I even use these methods within a model? I
tried to use auto_link and it failed too. What am I doing wrong?
Furthermore, would it be recommended I format text before saving it to
the database? Advantages or disadvantages?
--
Posted via http://www.ruby-forum.com/.