Displaying 20 results from an estimated 1100 matches similar to: "Better way to remove value from list??"
2008 Feb 22
12
DRY - in controller or model????
Hello.
I''m trying to make clean efficient code and would like to find out if
there is a "BEST" way to write code. I want this to run quickly and
efficiently for my app.
I''ve got a form that needs a select list created for new and edit
functions. Same list.
Do I do this in the controller and reference @list in the forms?
def new
@list = %w { apple orange banana }
2008 Jan 21
9
DRY act_as_authenticated functional testing
I''m using the acts_as_authenticated plug-in for my app. Now I need to
get my functional tests to work properly. I have not written functional
tests before so I''m unsure how to utilize setup so that all of my tests
can use the login. My tests pass if I put login_as :user inside of each
test, but that''s clearly not DRY. Can I add something to my
test_helper.rb file or
2008 Apr 25
5
Best way to pass ID variable to partials - global var??
I have several orders that are being updated in an internal data entry
app. I start by going from an order to pop-up form that allows a user
to select items to add to a field in the order. The pop-up form
contains 2 partials for drag and drop functionality from AWD. The user
starts by selecting a category in a drop down list. Then on select, the
first partial is filled with the list of
2008 Mar 14
2
Random image based verification for new user creation
Hi all,
I''m creating an email list managed by my CMS. I''m wondering if people
had any thoughts about securing it?
I''m just concerned that my application server might be overwhelmed by
requests to add to the list by a spider, etc.
Am I being overly concerned or is that a real possibility? I was
thinking of adding an image with a random sequence of numbers or
letters
2008 Apr 05
3
MySQL Unit Test Login Failure
I just recently started having issues running unit tests for my
application, but can''t figure out why. When I run rake test:units, I
get "Access denied for user ''root@localhost'' using password: NO".
My database.yml file is configured to use the ODBC login, but it''s not
being passed to my unit tests. Any ideas?
development:
adapter: mysql
2011 May 02
2
Re: Caution when deleting .wine ...
jjmckenzie wrote:
> On Mon, May 2, 2011 at 1:16 AM, topher.becca <wineforum-user at winehq.org> wrote:
>
> >
> > When I entered 'rm -rf ~/.wine' it says:
> > rm: /Users/christopherwelch/.wine/drive_c/Program Files/Inbox Toolbar: Permission denied
> > rm: /Users/christopherwelch/.wine/drive_c/Program Files: Directory not empty
> > rm:
2012 Feb 06
1
Callmanager 4 Asterisk Malformed/Missing URL
Hi,
?
I am currently trying to get a Cisco Callmanager 4.1 and an Asterisk server (1.6.2.21) to talk via a SIP trunk so I can use the Voicemail component of the Asterisk (all the phones are associated with the Callmanager).
The connection seem to be there. When I do a "sip show peers" on the Asterisk server?I see the Callmanager as Monitored and online however I can't get any calls
2011 Jun 12
1
Score Test Function
Greeting R Community,
I'm trying to learn Logistic Regression on my own and am using An Introduction to Logistic Regression Analysis and Reporting (Peng, C., Lee, K., & Ingersoll, G. ,2002). This article uses a Score Test Stat as a measure of overall fit for a logistic regression model. The author calculates this statistic using SAS. I am looking for an [R] function that can compute
2016 Feb 06
2
D16945: LLVM overhaul to avoid linking LLVM component libraries with libLLVM
Hans,
I have posted a complete patch for solving the linkage issues
with LLVM_LINK_LLVM_DYLIB on Phabricator at
http://reviews.llvm.org/D16945. The bulk of the fix the simple
changes of...
Index: cmake/modules/AddLLVM.cmake
===================================================================
--- cmake/modules/AddLLVM.cmake (revision 259743)
+++ cmake/modules/AddLLVM.cmake (working copy)
@@
2008 Jul 21
6
form_for and select ( => f.select)
Hi All
I''m trying to combine the from_for and select helpers
Right now I have
form_for :service, :url => ...... do |f|
select("abc", "xyz_id", @my_arr.collect {|item| [ item, "bla" ] },
{:prompt => "opt1"} )
....
end
What I want to do is something like
....
f.select("abc", "xyz_id", @my_arr.collect {|item|
2011 May 02
2
Re: Caution when deleting .wine ...
David Shaw wrote:
>
> At the risk of getting flamed, you yourself have often told people to
> 'rm -rf ~/.wine' :-)
>
> David Shaw
When I entered 'rm -rf ~/.wine' it says:
rm: /Users/christopherwelch/.wine/drive_c/Program Files/Inbox Toolbar: Permission denied
rm: /Users/christopherwelch/.wine/drive_c/Program Files: Directory not empty
rm:
2008 Oct 16
4
Removing values from a select (drop-down) box
Hello,
I am working on a project, and on one form we have a select (drop-
down) box where the user needs to be able to select from a list of
clients. The box is currently being populated with:
<%= collection_select(:client, :id, @account.clients, :id, :name) %>
The problem is that some of these clients may have already been
selected, and we need to remove them from the list. Is this
2008 Oct 07
6
Hpricot loop question to read table row values
Hi.
I''ve got a file that contains a table that looks like this:
<table>
<tr><td>column title a</td><td>column title b</td></tr>
<tr><td>row 1 a</td><td>row 1 b</td></tr>
<tr><td>row 2 a</td><td>row 2 b</td></tr>
<tr><td>row 3 a</td><td>row 3
2018 Feb 23
3
cmake + llvm : issue when embedding llvm
Hi everybody,
I'm trying to build my own project that use LLVM. I downloaded the
source code and the pre-compiled package on the official web site (last
version):
http://releases.llvm.org/download.html
I downloaded the following :
LLVM source code
Clang for Windows (64-bit)
FYI, I don't build LLVM... only want to use it !
I followed the instruction here (
2010 Mar 15
1
inner join sqldf
Hi,
I have two dataframes that have some common columns. I would like to join
them by the common columns prochi and prescribed_date as there are duplicate
prochis but they will be made unique by date. I tried doing an inner join
but that just duplicated the columns whereas I would like the information
from the test_sql_tsf to fill the NAs in the test_sql_psd common columns.
require(sqldf)
2011 May 28
4
Rais 3, nested attributes problem with paperclip
I have two models, one model girl and one girl_photos (a file upload
asset). The only code I have in models which describes the association
is:
For the girl => belongs_to :girl and has_attached_file :photo
For the model girl_photos => has_many :girl_photos and
accepts_nested_attributes_for :girl_photos
I''ve tried to save as a nested attribute the photo, it saves the
association
2007 Jun 27
1
how to use chi-square to test correlation question
Hi There,
There are 300 boy students and 100 girl students in a class. One interesting question is whether
boy is smarter than girl or not.
first given the exam with a difficulty level 1, the number of the student who got A is below
31 for boy, 10 for girl.
Then we increase the difficulty level of the exam to level 2, the number of the student who got A is below
32 for boy, 10 for girl.
We
2010 Aug 16
3
Load dummy data using Factory girl
Hello,
I wanted to know how to load dummy data in the application using Factory
girl.
I had done this using Fixtures.I had made a fixtures folder into the
test folder and run the command "rake test fixtures:load"
Currently i tried using factories in the spec which is working fine.
Wanted to know know regarding loading dummy data.
--
Posted via http://www.ruby-forum.com/.
2006 Mar 10
5
PDF::Writer Simpletable Iteration
Hello All:
I have been working with <a
href="http://ruby-pdf.rubyforge.org/pdf-writer/index.html">Austin
Ziegler''s PDF::Writer</a> as a means to produce PDF documents from my
Rails app. I am stumped on how to iterate through a collection of items
and output them in a table format. The way I have tried it so far only
returns the last item in the collection -
2010 Mar 12
7
sqldf not joining all the fields
Dear R users,
I have two data frames that were read from text files as follows:
x_data <- read.table("x.txt", header = TRUE, sep = "|", quote = "\"'",
dec = ".",as.is = TRUE,na.strings = "NA",colClasses = NA,
nrows = 3864284,
skip = 0, check.names = TRUE,fill=TRUE,
strip.white = TRUE,