Displaying 20 results from an estimated 700 matches similar to: "Find not working"
2010 Feb 14
2
has_many :through eager loading only loading one record
Hello,
I''ve been using Rails for years, including has_many :through and eager
loading, but this one has me stumped.
The problem is that Active Record is only eager-loading the first of
many records. Here are the models (note set_table_name for a legacy
schema):
class Tag < ActiveRecord::Base
set_table_name ''tag''
end
class DishTag < Tag
has_many
2006 Nov 14
3
messed-up habtm relationship
Hi,
I have a many-to-many relationship between dishes and ingredients
class Dish < ActiveRecord::Base
has_and_belongs_to_many :ingredients
end
class Ingredient < ActiveRecord::Base
has_and_belongs_to_many :dishes
end
I have a join table dishes_ingredients
now when i access my_dish.ingredients, i get a list of what looks like
Ingredient objects, but the but they don''t have
2006 Feb 27
2
Multiple forms on a page
Hello all.
I have the following Code in a view:
<% @dishes.each do |dish| -%>
<tr>
<td><%= link_to dish.name, :controller => "restaurant", :action =>
"show_dish", :id =>"#{dish.id}" -%>
<% if dish.vegetarian? -%>
<%= image_tag("/images/vegetarian.gif", :class => "bevel", :size =>
"8x8")
2017 Nov 01
1
Correct subsetting in R
Hi all,
I have two data frames that one of them does not have the column ID:
> str(data)
'data.frame': 499 obs. of 608 variables:
$ ID : int 1 2 3 4 5 6 7 8 9 10 ...
$ alright : int 1 0 0 0 0 0 0 1 2 1 ...
$ bad : int 1 0 0 0 0 0 0 0 0 0 ...
$ boy : int 1 2 1 1 0 2 2 4 2 1 ...
$ cooki : int 1 2 2 1 0 1 1 4 2 3
2017 Nov 01
1
Correct subsetting in R
It's not what I want, the first data frame has 499 observations and the second data frame is a subset of the first one but with 375 observations. I want something that returns the ID for training data frame
On Wednesday, November 1, 2017 10:18 AM, Eric Berger <ericjberger at gmail.com> wrote:
matches <- merge(training,data,by=intersect(names(training),names(data)))
HTH,
Eric
2017 Nov 01
1
Correct subsetting in R
But they row.names() cannot give me the IDs
On Wednesday, November 1, 2017 9:45 AM, David Wolfskill <r at catwhisker.org> wrote:
On Wed, Nov 01, 2017 at 04:13:42PM +0000, Elahe chalabi via R-help wrote:
> Hi all,
> I have two data frames that one of them does not have the column ID:
>
> > str(data)
> 'data.frame': 499 obs. of 608 variables:
2006 Apr 26
10
ANN: svn_conf generator -- making "svn import" easy and fun
Rails make it easy to start a new application. At the same time, import
a new project into Subversion is not that simple -- there are quite few
files that should be ignored.
I used to manually remove added log files and tmp/cache, tmp/sessions,
tmp/sockets files after the import and then go through the painful
process of setting svn:ignore properties.
There is an easier way -- simply
2012 Mar 14
2
mount NFS share over specific nic?
I have a new server with multiple nics running Centos 6.2 and I'd like to force all NFS traffic over one nic.
We're using FreeNAS to dish out NFS shares and I have different IPs on my 2 nics but how can I get the server to mount the share over one particular nic?
Or is there a better way to do it?
Thanx,
Russell Smithies
2006 Nov 22
1
Probit analysis
Respected Sir/Madam,
I have a question regarding calculation of LD50 (Lethal Dose) and IC50 (50%
inhibitory concentration) of an antimicrobial experiment.
I have used a compound isolated from a plant and observed its effect on the
fungus *Fusarium oxysporum* by the food poisoning method. Solutions of the
compound at concentrations of 0, 50, 100, 150, 200 and 250µg/ ml were added
to
2015 Aug 21
2
samba shares does not exist or permission denied when connecting
Hi,
We have the following shares listed in smb.conf
users cannot access the samba share directly i.e.
\\sambaserver\rixilr
or
\\sambaserver\bridges
error messages
'/ibe/dusty/RIXILE Share/Bridges' does not exist or permission denied
when connecting to [bridges] Error was Permission denied
Aug 21 10:09:12 dish sambaserver[27859]: [2015/08/21 10:09:12.964101,
0]
2006 Feb 22
5
Moveable Type import question.
Hello RoRsters'',
I''ve just started my first project with ROR, and frankly it''s pretty
amazing, there are many things that still haven''t "clicked" for me yet
but essentially it''s all coming together.
My first project is a basic blog application to replace a current
Moveable Type based blog. I''ve managed to get the basic functionality
2015 Jan 08
2
Smbd dumps core while starting
Samba version : samba-4.1.12, AIX 6.1,
compilation(configure, make clean install) was ok. but smbd not starting.
gdb --dbx /opt/samba/sbin/smbd /root/core
Core was generated by `smbd'.
Program terminated with signal 4, Illegal instruction.
#0 0x0000000000000000 in ?? ()
(gdb) where
#0 0x0000000000000000 in ?? ()
#1 0x0900000008406760 in regdb_init () at
2007 Aug 30
3
Rails - depot application
I''m doing the depot example in the Agle Web development book. I''m
getting this error:
"undefined method `product'' for #<BigDecimal:331ce70,''0.21E1'',8(8)> "
"Extracted source (around line #9):
8: for item in @items
9: product = item.product
10: -%>
11: <tr>
12: <td><%= item.product%></td>"
2006 Jan 31
2
asigning values to atributies when source is nil
I want to use something similar to the following:
@total_price += { product.price <> nil ? product.price : 0.0 }
This fails in rails with a "nil can''t be coerced into Float" error.
What is the (most) correct way to do this?
On a related issue, what is the significance of the value 40
following "cart.rb" in the trace snippet below? The entire class
file
2007 Jan 05
4
How To Spec Controllers with Finders
Given this code (which renders rjs), I''m faced with the fixture-
driven way of spec-ing or mocking. How the heck to you mock this so
the code at line (2) and (4) work right? I''m still struggling with
mocks but it seems like this can be done. Forgive the naivety of this
question.
1. def change_quantity
2. @line_item = LineItem.find_by_id(params[:id])
3. unless
2004 Aug 06
1
reduction of noise due to high microphone gain
Hello,
With high microphone gain, I seem to have problem making the silence
detection work.
The speech detection works well for the rare dish sample, which has very
low noise amplitudes in silence regions. However, if the microphone
gain is set to really high, noise samples are taken as speech, as
indicated by the non-zero return value from speex_encode() calls.
I had VAD turned on.
2011 Mar 14
0
Non-constancy of variances in mixed model.
Hi, I've been doing an experiment, measuring the dead-zone-diameters of
bacteria, when they've been grown with paper diffusion disks of
antimicrobial. There are two groups, or treatments - one is bacteria
that have been cultured in said antimicrobial for the past year, the
other group is of the same species, but lab stock and has not gone had
any prior contact with the antimicrobial.
2006 Aug 15
3
update or alter cart
I want to modify and update the items in the Depot - "display_cart".
Since the cart is in a session, its a little hard to get at the data.
I just want to create a way to change quantities, prices and
recalculate.
Has someone done this, and could you point me to the right direction.
Thanks
Chas
--
Posted via http://www.ruby-forum.com/.
2006 Feb 15
5
Lighttpd now works for production. Development is broken?
I''ve finally gotten lighttpd working for my production instance (SUSE
10.0 with SSL).
(Had to install the fcgi dev toolkit, the SUSE 10 ruby-fcgi rpm, and
the fcgi gem. I''m not positive all 3 were required, but that is what
I did.)
Now the devel instance of my app is broken.
I''m not sure how to fix it.
Previously I was using WEBrick for both devel and production.
2015 Aug 24
2
samba shares does not exist or permission denied when connecting
On 24/08/15 10:49, Sundeep Singh Nanuwa wrote:
> Hi,
>
> Is there any issues using spaces in directories paths?
>
> On 21/08/15 11:06, Sunny wrote:
>> Hi,
>>
>> We have the following shares listed in smb.conf
>>
>> users cannot access the samba share directly i.e.
>>
>> \\sambaserver\rixilr
>> or
>> \\sambaserver\bridges
>>