similar to: time-based counter design

Displaying 20 results from an estimated 20000 matches similar to: "time-based counter design"

2005 Dec 19
1
New rails site. Beta testers need.
Hi Rails List, I need some beta testers for my new site: http://www.smarkets.net. This list is literally the first group to see it, so be gentle. Smarkets is a prediction market for Amazon products. It takes Amazon products and turns them into a stock. The price of these "stocks" move based on the movement of its Amazon sales rank. If the sales rank goes up 10%, the price of the stock
2006 Apr 02
0
Re: updating the dom - Solution
Easy solution. I am using the behaviour.js package. Using this, the solution was to apply a Behaviour.apply(); command when the XMLHttpRequest() is complete. So my solution was to use the form_remote_tag properties to help me call this like such: link_to_remote("questions", :url => { :action => ''curator_questions'', :uid => curator.id, :tid =>
2005 Dec 26
2
resorting a dataset
Quick question to see how I might re-sort an Activerecord data set. Let''s say I have this table: tablename: testscores | id | student | score | avg_for_year 1, steve, 85, 82 2, tom, 84, 92, 3, jim, 92, 95 In my controller, I have something like: t= Testscores.find(:all, :order => "score DESC", :limit => 2) ...where it would return the records for Jim and Steve.... My
2005 Dec 22
3
help with unless
Hi, I need a fresh set of eyes to look at this bit of controller code and tell me why I might be getting an error message: lookup = Profit.find(:all, :conditions => [ "user_id = ? AND product_id = ?", uid, pid]) unless lookup.empty? if (lookup.updated_on > 360.minutes.ago) return end end If lookup is empty, then I
2006 Apr 02
3
updating the dom
Hi list, Say I''ve got a page that lists the students names and grades. Grades are clickable using a form_remote_tag that then renders a new partial on the right hand side of the page that then lists the individual test scores for the particularly student. So far so good. And lets say in the newly rendered right-hand section, I have another form_remote_tag that will allow me to input a
2006 Mar 24
4
validate if different?
Hi, I seem to remember seeing the equivalent of saving only if all attributes are different. I can''t seem to find that now in the API or the agile book. I''m using the acts_as_versioned and only want to save if the input is different. Thanks, Steve http://www.smarkets.net -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 Mar 31
4
javascript help
Hi list, I have a list of tags. I want to be able to click on a tag and have that tag name populate an input field. I think delicious used to allow you to click on existing links to tag your bookmark similar to this (moving instead to auto_complete). My guess is the code looks something like this.... <form> <input type="text" name="all" id="discover"
2006 May 29
4
Time-based cache fragment expiration
Hello, I''m trying to figure out how I could implement fragment caching that expires every x amount of time. I thought of writing a runner script that would expire the cache and set it as a cron job, but that doesn''t really work because runner scripts act on models and not controllers. Does anybody have any ideas? Regards, -carl
2006 May 02
4
ordering after a inject
Hi, My results are getting out of order after I do the following command: count = result.inject({}) { |hsh, row| hsh[row[''name'']] = row[''count''].to_i; hsh } Why? Here are more specifics: My complete method is this (based off of acts_as_taggable code - not'' DHHs, but the original one): def self.sql_to_count_plays(lookback) sql =
2006 Apr 16
2
conditional updated_on update
Hi list, I''ve got some counter_caches in a model. When these get incremented - say on a page view - my updated_on column also gets updated. How can I conditionally not update updated_on if just these counter_cache columns change? The problem with that is that I am using acts_as_versioned which clones the record each time updated_on changes. I am successfully ignoring the counter_cache
2006 Mar 15
7
Populating text_tag with serialized data
I am using a serialized attribute in one of my models The serialized data is in the form of an array. I want to have a text_tag for each element contained in my serialized attribute. How would I construct the text_tag? My model name is ''questions''. The serialized attribute is "answers" So I might have: <% form tag %> <% text_tag ''question'',
2005 Dec 21
7
use of SET command in find_by_sql
Hi, I''m trying to execute something like this method in a model: def self.sql_for_rankings() sql = "SET @counter:=0;" sql << " SET @counter:=0; SELECT *, @counter:=@counter+1 AS rank FROM testscores. " find_by_sql(sql) end Where the new rank column is a kind of autoincrementer inside of
2006 Apr 17
3
help debugging an error
Hi, I''ve started getting an error I can''t debug. The error doesn''t generate anything in my development log. A breakpoint set right at the beggining of the controller method does not get triggered. It happens on a form submission. I can make changes to the object model from with the console, but not on this form submission. I thought maybe it was routing, because I have
2006 Feb 10
3
robots.txt best practices
I''d been ignoring this error message in my log for a while: ActionController::RoutingError (Recognition failed for "/robots.txt"): I had never touched robots.txt. So I decided to make it a proper robots.txtfile I found this great article... http://www.ilovejackdaniels.com/seo/robots-txt-file/ ...where Dave explains the ins and outs of the file. Before I changed mine, I
1999 Mar 26
0
anova problem:
Hi! I'm running an anova on a lm and I get the message Error: invalid dimnames given for data frame Any idea where it comes from? Many thanks. Here is the fit and the attempted anova: > fit Call: lm(formula = as.formula(paste(chemical, "a~", cmd, sep = "")), singular.ok = TRUE) Coefficients: (Intercept) Odom Displace Weight
2006 Feb 09
6
troubleshooting an observe_field
Hi, I''ve got a live_search field in a partial that is on several different pages. On all pages, except 1, it works fine. On the page it doesn''t work on, it seems it never executes it action. Here''s my observe_field code inside the partial: <h1><label for="searchtext">Live Search:</label></h1> <%= text_field_tag :searchtext
2006 Apr 02
5
adding primary_key to join table using migrations
Hi list, My tag_question_user join table is not currently a full-blown model. It doesn''t have a primary key - just tag_id, question_id, and user_id. I now want to add a primary key to this model (because I want to add a "description" column as well so users can describe the tag. I''m not sure how to add this using migrations. Here is what I have: class AddNotesToTags
2006 Jan 12
3
what about Austin railers?
If Tuscon has some rail users, I know there must be some other Austin railers out there. Have I missed some meetings that I didn''t know about? Steve http://www.smarkets.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060112/c2723541/attachment.html
2010 Nov 26
5
simple website hit counter
Googling for this finds me a ton of stuff that doesn't actually do what I'm looking for. I want a simple hit counter cgi script of some kind that will increment a counter on every page load but I want to access the counter from a different page. In other words, I don't want to have a visible hit counter on the webpage itself. I want to have a different webpage that will show me the
2009 Aug 18
5
Increment counter on download
i am offering my site visitors a download of zip file. when someone downloads it, i want to increment a counter and update db. how do i do that? -- Posted via http://www.ruby-forum.com/.