<commit_before>class PagesController < ApplicationController
  caches_page :homepage

  def homepage
    @body_classes = %w(homepg)
    @homepage = true
    @examples = ['Bridgeport, CT', '90210', 'Miami, FL', 'Los Angeles, CA']

    @toxins_factoid = Factoid.find(2)
    @most_toxins = @toxins_factoid.factoid_results.find(:all,
							:include => :city,
							:group => :city_id,
                                                        :conditions => 'count1 IS NOT NULL',
                                                        :order => 'count1 DESC',
                                                        :limit => 5)
    @least_toxins = @toxins_factoid.factoid_results.find(:all,
							:include => :city,
                                                        :group => :city_id,
                                                        :conditions => 'count1 IS NOT NULL AND count1 > 0',
                                                         :order => 'count1 ASC',
                                                         :limit => 5)

    @cancer_factoid = Factoid.find(17)
    @most_cancer = @cancer_factoid.factoid_results.find(:all,
                                                        :conditions => 'count1 IS NOT NULL AND count1 > 0',
							:joins => 'inner join cities on city_id = cities.id',
							:group => 'city_id,cities.admin2_code',
                                                        :order => 'count1 DESC',
                                                        :limit => 5)
    @nomad_factoid = Factoid.find(15)
    @most_nomadic = @nomad_factoid.factoid_results.find(:all,
							:include => :city,
							:group => :city_id,
                                                        :conditions => 'count1 IS NOT NULL AND count1 > 0',
                                                        :order => 'count1 DESC',
                                                        :limit => 5)

    @unemployment_factoid = Factoid.find(11)
    @lowest_unemployment = @unemployment_factoid.factoid_results.find(:all,
                                                       :conditions => 'count3 IS NOT NULL AND count3 > 0',
						       :joins => 'inner join cities on city_id = cities.id',
						       :group => 'city_id,cities.admin2_code',
                                                       :order => 'count3 ASC',
                                                       :limit => 5)<commit_msg>moving to per-square mile values<commit_after>class PagesController < ApplicationController
  caches_page :homepage

  def homepage
    @body_classes = %w(homepg)
    @homepage = true
    @examples = ['Bridgeport, CT', '90210', 'Miami, FL', 'Los Angeles, CA']

    @toxins_factoid = Factoid.find(2)
    @most_toxins = @toxins_factoid.factoid_results.find(:all,
							:include => :city,
							:group => :city_id,
                                                        :conditions => 'count3 IS NOT NULL',
                                                        :order => 'count3 DESC',
                                                        :limit => 5)
    @least_toxins = @toxins_factoid.factoid_results.find(:all,
							:include => :city,
                                                        :group => :city_id,
                                                        :conditions => 'count3 IS NOT NULL AND count3 > 0',
                                                         :order => 'count3 ASC',
                                                         :limit => 5)

    @cancer_factoid = Factoid.find(17)
    @most_cancer = @cancer_factoid.factoid_results.find(:all,
                                                        :conditions => 'count1 IS NOT NULL AND count1 > 0',
							:joins => 'inner join cities on city_id = cities.id',
							:group => 'city_id,cities.admin2_code',
                                                        :order => 'count1 DESC',
                                                        :limit => 5)
    @nomad_factoid = Factoid.find(15)
    @most_nomadic = @nomad_factoid.factoid_results.find(:all,
							:include => :city,
							:group => :city_id,
                                                        :conditions => 'count1 IS NOT NULL AND count1 > 0',
                                                        :order => 'count1 DESC',
                                                        :limit => 5)

    @unemployment_factoid = Factoid.find(11)
    @lowest_unemployment = @unemployment_factoid.factoid_results.find(:all,
                                                       :conditions => 'count3 IS NOT NULL AND count3 > 0',
						       :joins => 'inner join cities on city_id = cities.id',
						       :group => 'city_id,cities.admin2_code',
                                                       :order => 'count3 ASC',
                                                       :limit => 5)
{'fraction_non_alphanumeric': 0.09670823962379882, 'fraction_numerical': 0.015129830300552035, 'mean_word_length': 1.0049180327868852, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 64, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1990402', 'n_tokens_mistral': 1272, 'n_tokens_neox': 1067, 'n_words': 263}