<commit_before>app = require 'app'
BrowserWindow = require 'browser-window'
path = require 'path-extra'
fs = require 'fs-extra'

# Environment
global.POI_VERSION = app.getVersion()
global.ROOT = __dirname
global.EXECROOT = path.join(process.execPath, '..')
global.APPDATA_PATH = path.join(app.getPath('appData'), 'poi')
if process.platform == 'darwin'
  global.EXROOT = global.APPDATA_PATH
else
  global.EXROOT = global.EXECROOT
if process.env.DEBUG?
  global.SERVER_HOSTNAME = '127.0.0.1:17027'
else
  global.SERVER_HOSTNAME = 'poi.0u0.moe'

CONST = require './lib/constant'
config = require './lib/config'
proxy = require './lib/proxy'
proxy.setMaxListeners 30
update = require './lib/update'
shortcut = require './lib/shortcut'
{log, warn, error} = require './lib/utils'

global.mainWindow = mainWindow = null

# Debug setting
app.commandLine.appendSwitch 'enable-logging'

# Disable HA
disableHA = config.get 'poi.disableHA', false
if disableHA
  app.commandLine.appendSwitch 'disable-gpu'

# Proxy setting
listenPort = config.get 'poi.port', 12450
app.commandLine.appendSwitch 'proxy-server', "127.0.0.1:#{listenPort}"
app.commandLine.appendSwitch 'ignore-certificate-errors'
app.commandLine.appendSwitch 'ssl-version-fallback-min', "tls1"

# Pepper Flash
if process.platform == 'linux'
  try
    fs.accessSync path.join(EXECROOT, 'PepperFlash', 'linux', 'libpepflashplayer.so')
    app.commandLine.appendSwitch 'ppapi-flash-path', path.join(EXECROOT, 'PepperFlash', 'linux', 'libpepflashplayer.so')
    app.commandLine.appendSwitch 'ppapi-flash-version', '172.16.58.3'
  catch e
    app.commandLine.appendSwitch 'ppapi-flash-path', path.join(ROOT, 'PepperFlash', 'linux', 'libpepflashplayer.so')
    app.commandLine.appendSwitch 'ppapi-flash-version', '172.16.58.3'
else if process.platform == 'win32'
  try
    fs.accessSync path.join(EXECROOT, 'PepperFlash', 'win32', 'pepflashplayer32.dll')
    app.commandLine.appendSwitch 'ppapi-flash-path', path.join(EXECROOT, 'PepperFlash', 'win32', 'pepflashplayer32.dll')
    app.commandLine.appendSwitch 'ppapi-flash-version', '172.16.58.3'
  catch e
    app.commandLine.appendSwitch 'ppapi-flash-path', path.join(ROOT, 'PepperFlash', 'win32', 'pepflashplayer32.dll')
    app.commandLine.appendSwitch 'ppapi-flash-version', '172.16.58.3'
else if process.platform == 'darwin'
  try
    fs.accessSync path.join(EXECROOT, 'PepperFlash', 'darwin', 'PepperFlashPlayer.plugin')<commit_msg>Default to 64bit flash player now<commit_after>app = require 'app'
BrowserWindow = require 'browser-window'
path = require 'path-extra'
fs = require 'fs-extra'

# Environment
global.POI_VERSION = app.getVersion()
global.ROOT = __dirname
global.EXECROOT = path.join(process.execPath, '..')
global.APPDATA_PATH = path.join(app.getPath('appData'), 'poi')
if process.platform == 'darwin'
  global.EXROOT = global.APPDATA_PATH
else
  global.EXROOT = global.EXECROOT
if process.env.DEBUG?
  global.SERVER_HOSTNAME = '127.0.0.1:17027'
else
  global.SERVER_HOSTNAME = 'poi.0u0.moe'

CONST = require './lib/constant'
config = require './lib/config'
proxy = require './lib/proxy'
proxy.setMaxListeners 30
update = require './lib/update'
shortcut = require './lib/shortcut'
{log, warn, error} = require './lib/utils'

global.mainWindow = mainWindow = null

# Debug setting
app.commandLine.appendSwitch 'enable-logging'

# Disable HA
disableHA = config.get 'poi.disableHA', false
if disableHA
  app.commandLine.appendSwitch 'disable-gpu'

# Proxy setting
listenPort = config.get 'poi.port', 12450
app.commandLine.appendSwitch 'proxy-server', "127.0.0.1:#{listenPort}"
app.commandLine.appendSwitch 'ignore-certificate-errors'
app.commandLine.appendSwitch 'ssl-version-fallback-min', "tls1"

# Pepper Flash
if process.platform == 'linux'
  try
    fs.accessSync path.join(EXECROOT, 'PepperFlash', 'linux', 'libpepflashplayer.so')
    app.commandLine.appendSwitch 'ppapi-flash-path', path.join(EXECROOT, 'PepperFlash', 'linux', 'libpepflashplayer.so')
    app.commandLine.appendSwitch 'ppapi-flash-version', '172.16.58.3'
  catch e
    app.commandLine.appendSwitch 'ppapi-flash-path', path.join(ROOT, 'PepperFlash', 'linux', 'libpepflashplayer.so')
    app.commandLine.appendSwitch 'ppapi-flash-version', '172.16.58.3'
else if process.platform == 'win32'
  try
    fs.accessSync path.join(EXECROOT, 'PepperFlash', 'win32', 'pepflashplayer.dll')
    app.commandLine.appendSwitch 'ppapi-flash-path', path.join(EXECROOT, 'PepperFlash', 'win32', 'pepflashplayer.dll')
    app.commandLine.appendSwitch 'ppapi-flash-version', '172.16.58.3'
  catch e
    app.commandLine.appendSwitch 'ppapi-flash-path', path.join(ROOT, 'PepperFlash', 'win32', 'pepflashplayer.dll')
    app.commandLine.appendSwitch 'ppapi-flash-version', '172.16.58.3'
else if process.platform == 'darwin'
  try
    fs.accessSync path.join(EXECROOT, 'PepperFlash', 'darwin', 'PepperFlashPlayer.plugin')
{'fraction_non_alphanumeric': 0.14918032786885246, 'fraction_numerical': 0.029098360655737704, 'mean_word_length': 5.055831265508685, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 12, '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': '3036821', 'n_tokens_mistral': 1759, 'n_tokens_neox': 1697, 'n_words': 326}