similar to: Help on loop

Displaying 20 results from an estimated 2000 matches similar to: "Help on loop"

2007 Oct 24
4
RAILS_ROOT
Hey, I''m using the attachment_fu plugin to upload images on the file system. To retrieve them I''m using: image = "/home/rajeev/Desktop/logo/logo/public#{icon.public_filename}" which is the same as: "/home/rajeev/Desktop/logo/logo/public/icons/0000/0005/green_nature_on_white.jpg" Have can i do this in a shorter way by using RAILS_ROOT? I have tried this
2009 Dec 22
3
vector indexing problem in multilevel data: assigning a specific value to all group members
Dear List, I work with multilevel data from psychological group experiments and have frequently encountered a situation for which I haven't found an elegant solution: I need to assign the value of a specific group member to all members of the group. For example, I have a group leader (identified by a binary vector) and some attribute for all group members. I want to create a new
2010 Feb 24
5
gem install rmagick --local
Hi all i copied rmagic gem in my local system cd rmagick-2.12.2.gem bash: cd: rmagick-2.12.2.gem: Not a directory *[root@localhost shyam]# gem install rmagick --local* Building native extensions. This could take a while... ERROR: Error installing rmagick: ERROR: Failed to build gem native extension. /usr/bin/ruby extconf.rb checking for Ruby version >= 1.8.5... yes checking for gcc...
2011 Nov 21
1
Weird R's behaviour with a quoted name
Can someone explain why the following happens? --- :> quote(some.name) some.name :> bar <- structure(quote(some.name), class = "foo") :> quote(some.name) Error in print(some.name) : object 'some.name' not found :> bar <- quote(some.name) :> quote(some.name) Error in print(some.name) : object 'some.name' not found :> bar <-
2009 Aug 19
2
Create! Syntax
Hey All, Two questions. Firstly, what is the difference between create and create! I see that create is document in the api http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M002269 What is the difference between the two of these functions and where is the create! function defined. Also, What are the differences between these two calls? a) SomeModel.create!{ :property_a =>
2008 Mar 03
1
Rspec and plugins
I have a question regarding best practices around module and plugin testing for rails applications. In our application we have created several plugins that extend ActiveRecord::Base with class methods, that when invoked in a model add behavior to that model. For example ... class SomeModel < ActiveRecord::Base adds_some_cool_behavior adds_another_wicked_sweet_behavior end My
2006 Jul 20
3
sort_by with via a parent models child
I am having a problem with ruby''s sort_by function. I want to sort a list of parent model objects based on the children of the parent models. Normally you might say sortedList = modelList.sort_by { |model| model[''someAttribute''] } What I am tring to do is sortedList = modelList.sort_by{ |model| model.children.find(:first, order=>"price desc" ).price}
2006 Jan 11
2
How to execute an SQL statement in rails?
Hello, This is probably a silly question but looking at "api.rubyonrails.org", I can''t seem to figure out which method I should be using ... I want to execute an sql statement, like "truncate table BLAH" from within one of my rails app ... What''s the "right" way to do this? Thanks, /B -- Bruno Mattarollo <bruno.mattarollo@gmail.com>
2006 Jul 05
10
Scalable alternative to #find_all
Is there any scalable alternative to iterating all the records of a certain model? #find_all seems to load everything into memory. With 500.000 records it will be a swap storm. Pedro.
2006 Feb 07
4
Ruby, Rails & Inheritance
Hi! I am looking for a solution for the following problem: Some of my models share some attributes and also was in need for some extra features, so I created a class "RecordWithFeatures": ----------------------------------------------------------------- class RecordWithFeatures < ActiveRecord::Base # @Override def self.descends_from_active_record? superclass ==
2006 Jul 12
1
When to use Mutex::synchronize?
I have a simple question when to the synchronize method in the Mutex class. Now that backgroundrb has allow_concurrency = true there is no need to synchronize database calls in threads. The question I have is lets say I have a simple method in my worker as follows: def some_method SomeModel.find_all each do |obj| obj.some_count += 1 obj.save! end end It accesses the database, but
2008 Dec 27
2
Meetme - play the name
Hi, I have a requirement, whenever a user comes into the conference, it has to announce the user name to all the person who are all available in the conference. I have used Meetme(,di) where i is to announce the user leave/join with review. I user used I also, which is to announce the user leave/join with out review. In both the above cases, it is prompting the user to say their
2006 Jun 26
1
Separate Read and Write Database
Hello, I need to access an mirrored database with one read and one write cluster. Is there a way to tell a model to use two connections? So that all updates etc go to the write database and all read from the read one? This is a fixed set up I can not use MySQL 5.x stuff and additionally i get a token on write, which can be checked on read (and wait for replication) if new data is needed. I
2007 May 15
4
problem with Clam AV
I had updated clam antivirus recently (with YUM) and since then the following error is appear when my cron job runs The cron job and the output is list below: /usr/bin/freshclam --quiet -l /var/log/clam-update.log ERROR: Parse error at line 44: Option AllowSupplementaryGroups requires boolean argument. ERROR: Parse error at line 76: Option FixStaleSocket requires boolean argument.
2008 Jun 12
8
Urgent Help Required!!!!!!!!!!!
&nbsp; Hi All, &nbsp; I am Rajeev. I have download centOS 5.1 i386 files for installing Linux. I tried my ways but my DVD is not getting recognised while booting. I have windows XP SP2 32-bit. Let me know the files that need to be burned for installing centOS 5.1 i386. &nbsp; Queries : 1. Whether I need to burn the files in CD or DVD? 2. I have download&nbsp;9 iso files, 3 torrent
2007 Sep 23
5
Formatting a large disk
I need to install Centos on a machine with 3tb raid disk. (3 ware raid card) Could someone in the list suggest a utility for partition this disk. I would like to have the whole disk in 1 partition and format it for ext3. The default partitioning utility doesn't do this. The OS sits on another SATA disk and each time during the installation it doesn't format the full disk which is 3TB.
2007 May 23
8
ImageScience, Mini-Magick and RMagick
I''m going to be generating thumbnails from user uploaded images. I''m looking around at the libraries available to do this sort of thing and there are three that look promising. ImageScience -- http://seattlerb.rubyforge.org/ImageScience.html Mini-Magick -- http://rubyforge.org/projects/mini-magick/ RMagick -- http://rmagick.rubyforge.org/ It looks like a lot of people are
2006 Feb 16
10
Ruby class variables and access from view templates
I have an app that requires me to define a class variable (actually an array) in a controller and then access it from within a view. It seems that the class variables aren''t working right. Here is an example of what I''m trying to do. class DisplayController < ApplicationController @@thumbnail_array = Array.new ... def some_method @@thumbnail_array = SomeModel.find_all
2008 Jun 09
4
Copying files from specific date.
Dear all, Does anyone aware of any utility to copy files which are created or modify form a specific date ?. Thanks Rajeev R. Veedu -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20080609/ae761b2c/attachment-0002.html>
2009 Jul 24
1
Attachment_fu - watermark tmp file before saved to S3
Hi there, I''d like to use RMagick to watermark an image in the tmp directory before Attachment_fu saves it to Amazon S3. I took a look at the callbacks available in attachment_fu. There''s an ''after_attachment_saved'' method but this would be too late, and a ''before_thumbnail_saved'' but this is no good because it''s for thumbnails. I