UPDATE a fork of this gist has been used as a starting point for a community-maintained "awesome" list: machine-learning-with-ruby Please look here for the most up-to-date info!
- liblinear-ruby: Ruby interface to LIBLINEAR using SWIG
| import android.util.SparseArray; | |
| import android.widget.AbsListView; | |
| /** | |
| * Helper class for calculating relative scroll offsets in a ListView or GridView by tracking the | |
| * position of child views. | |
| */ | |
| public class ListViewScrollTracker { | |
| private AbsListView mListView; | |
| private SparseArray<Integer> mPositions; |
Though slightly more complex, using a CDN is the most performant option for serving static assets. See the [CDN asset host](cdn-asset-host-rails31) article for more details.
Ruby on Rails applications should use Rack::Cache to efficiently serve assets on the Cedar stack. Proper Rack::Cache usage improves response time, decreases load and is important when serving static assets through your application.
This article will summarize the concepts of caching assets using Rack::Cache and walk you through the appropriate configuration of a Rails 3.1 application and the asset pipeline.
Sample code for this article's [reference application](https://github.com/heroku/rack-cache-demo) is available on
| # == Schema Information | |
| # you need to add a flag to the model to indicate his processing status | |
| # it defaults to true: | |
| # | |
| # attachment_processing :boolean(1) default(TRUE) | |
| # ... | |
| # | |
| #---------------------------------------------------------------------- | |
| class Thing < ActiveRecord::Base |
| # app/models/my_model.rb | |
| module MyApp | |
| module Model | |
| def self.included(base) | |
| base.send :include, Mongoid::Document | |
| base.send :include, Mongoid::Timestamps | |
| base.send :include, ActiveAdmin::Mongoid::Patches | |
| end | |
| end |