<commit_before>module ConnectHelper
  # Build ad content by content type.
  def ad_content(content_type, zone_uuid, ad_target_url, ad_id, ad_file_name, ad_width, ad_height)
      content = ""
    if content_type.include?('image')
      content += "var target_url = document.createElement('a');\n"
      content += "target_url.href = '#{CONFIG["redirect_out_url"]}#{ad_id}';\n"
      content += "var ad_content = document.createElement('img');\n"
      content += "ad_content.setAttribute('class', 'ad');\n"
      content += "ad_content.src = '#{CONFIG["ad_contents_url"]}#{partitionize(ad_id)}/#{ad_file_name}';\n"
      content += "ad_content.border = '0';\n"
      content += "target_url.appendChild(ad_content);\n"
      content += "var src = document.getElementById('#{zone_uuid}');\n"
      content += "src.parentNode.insertBefore(target_url, src);\n"
    elsif content_type.include?('application')
      content += "var ad_content = document.createElement('object');\n"
      content += "ad_content.setAttribute('type', 'application/x-shockwave-flash');\n"
      content += "ad_content.setAttribute('width', '" + ad_width + "');\n"
      content += "ad_content.setAttribute('height', '" + ad_height + "');\n"
      content += "ad_content.setAttribute('classid', 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000');\n"
      content += "ad_content.setAttribute('data', '#{CONFIG["ad_contents_url"]}#{partitionize(ad_id)}/#{ad_file_name}');\n"
      content += "var param1 = document.createElement('param');\n"
      content += "param1.setAttribute('name', 'movie');\n"
      content += "param1.setAttribute('value', '#{CONFIG["ad_contents_url"]}#{partitionize(ad_id)}/#{ad_file_name}');\n"
      content += "ad_content.appendChild(param1);\n"
      content += "var src = document.getElementById('#{zone_uuid}');\n"
      content += "src.parentNode.insertBefore(ad_content, src);\n"
    else
      content += ""
    end
    return content
  end

  # Create url of content.
  def partitionize id
    ("%09d" % id).scan(/\d{3}/).join("/")
  end
end
<commit_msg>value/data flash embed<commit_after>module ConnectHelper
  # Build ad content by content type.
  def ad_content(content_type, zone_uuid, ad_target_url, ad_id, ad_file_name, ad_width, ad_height)
      content = ""
    if content_type.include?('image')
      content += "var target_url = document.createElement('a');\n"
      content += "target_url.href = '#{CONFIG["redirect_out_url"]}#{ad_id}';\n"
      content += "var ad_content = document.createElement('img');\n"
      content += "ad_content.setAttribute('class', 'ad');\n"
      content += "ad_content.src = '#{CONFIG["ad_contents_url"]}#{partitionize(ad_id)}/#{ad_file_name}';\n"
      content += "ad_content.border = '0';\n"
      content += "target_url.appendChild(ad_content);\n"
      content += "var src = document.getElementById('#{zone_uuid}');\n"
      content += "src.parentNode.insertBefore(target_url, src);\n"
    elsif content_type.include?('application')
      content += "var ad_content = document.createElement('object');\n"
      content += "ad_content.setAttribute('type', 'application/x-shockwave-flash');\n"
      content += "ad_content.setAttribute('width', '" + ad_width + "');\n"
      content += "ad_content.setAttribute('height', '" + ad_height + "');\n"
      content += "ad_content.setAttribute('value', '#{CONFIG["ad_contents_url"]}#{partitionize(ad_id)}/#{ad_file_name}');\n"
      content += "ad_content.setAttribute('data', '#{CONFIG["ad_contents_url"]}#{partitionize(ad_id)}/#{ad_file_name}');\n"
      content += "var param1 = document.createElement('param');\n"
      content += "param1.setAttribute('name', 'movie');\n"
      content += "param1.setAttribute('value', '#{CONFIG["ad_contents_url"]}#{partitionize(ad_id)}/#{ad_file_name}');\n"
      content += "ad_content.appendChild(param1);\n"
      content += "var src = document.getElementById('#{zone_uuid}');\n"
      content += "src.parentNode.insertBefore(ad_content, src);\n"
    else
      content += ""
    end
    return content
  end

  # Create url of content.
  def partitionize id
    ("%09d" % id).scan(/\d{3}/).join("/")
  end
end

{'fraction_non_alphanumeric': 0.19010856453558503, 'fraction_numerical': 0.008926417370325694, 'mean_word_length': 4.322207958921695, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '790175', 'n_tokens_mistral': 1374, 'n_tokens_neox': 1373, 'n_words': 216}