text:
/* jshint node: true */
var path = require('path');
var docsFolderMount = function folderMount(connect, point) {
    return connect.static(path.resolve(point+'/_gh_pages/'));
};

module.exports = function(grunt) {
  "use strict";

  var modules = {
      self: this,
      grunt: grunt
  };

  modules.livereload = require('./docs-assets/js/grunts/livereload')(modules);

  RegExp.quote = require('regexp-quote')

  // Project configuration.
  grunt.initConfig({

    // Metadata.
    pkg: grunt.file.readJSON('package.json'),
    banner: '/**\n' +
              '* Sass Bootstrap v<%= pkg.version %> by <%= pkg.author %>\n' +
              '* Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
              '* Licensed under <%= _.pluck(pkg.licenses, "url").join(", ") %>.\n' +
              '*\n' +
              '* Designed and built with all the love in the world by @alademann, @mdo and @fat.\n' +
              '*/\n',
    jqueryCheck: 'if (typeof jQuery === "undefined") { throw new Error(\"Sass Bootstrap requires jQuery\") }\n\n',

    // Task configuration.
    clean: {
      dist: ['dist', '_gh_pages', '<%= pkg.name %>-dist.zip']
    },

    jshint: {
      plugins: {
        options: {
          jshintrc: 'js/.jshintrc'
        },
        src: ['js/*.js']
      },
      docs: {
        options: {
          jshintrc: 'js/.jshintrc'
        },
        src: ['docs-assets/js/application.js']
      },
      test: {
        options: {
          jshintrc: 'js/.jshintrc'
        },
        src: ['js/tests/unit/*.js']
      }
    },

    concat: {
      options: {
        banner: '<%= banner %><%= jqueryCheck %>',
        stripBanners: false
      },
      bootstrap: {
        src: [
          'js/transition.js',
          'js/alert.js',
          'js/button.js',
          'js/carousel.js',
          'js/collapse.js',
          'js/dropdown.js',
          'js/modal.js',
          'js/tooltip.js',
          'js/popover.js',
          'js/scrollspy.js',
          'js/tab.js',
          'js/affix.js'
        ],
        dest: 'dist/js/<%= pkg.name %>.js'
      }
    },

    uglify: {
      options: {
        banner: '<%= banner %>',
        report: 'min'
      },
      bootstrap: {
        src: ['<%= concat.bootstrap.dest %>'],
        dest: 'dist/js/<%= pkg.name %>.min.js'
      }
    },

    cssmin: {
      bootstrap: {
        expand : true,
        cwd    : 'dist/css/',
        src    : [
          '<%= pkg.name %>.css'
        ],
        dest : 'dist/css/',
        ext  : '.min.css',
        options : {
          banner : '' +
            '/*!\n' +
            '* <%= pkg.name %> v<%= pkg.version %>\n' +
            '*\n' +
            '* Copyright <%= grunt.template.today("yyyy") %> Twitter, Inc\n' +
            '* Licensed under the Apache License v2.0\n' +
            '* http://www.apache.org/licenses/LICENSE-2.0\n' +
            '*\n' +
            '* Designed and built with all the love in the world by @mdo and @fat.\n' +
            '* Sass -ified by Aaron Lademann @alademann\n' +
            '*/\n'
        }
      }
    },

    compass: {
      bootstrap: {
        options: {
          config: 'config.rb',
          environment: 'development',
          force: grunt.option('force') || false
        }
      }
    },

    compress: {
      dist: {
        options: {
          archive: '<%= pkg.name %>-dist.zip'
        },
        files: [
          {expand:true, cwd: 'dist/', dest: 'sass-bootstrap/', src: ['**']}
        ]
      }
    },

    copy: {
      fonts: {
        expand: true,
        src: ["fonts/*"],
        dest: 'dist/'
      }
    },

    qunit: {
      options: {
        inject: 'js/tests/unit/phantom.js'
      },
      files: ['js/tests/*.html']
    },

    connect: {
      test: {
        options: {
          port: 3000,
          base: '.'
        }
      },
      // docs server
      docs: {
        options: {
          port: 9001,
          hostname: '0.0.0.0',
          middleware: function(connect, options) {
            return [docsFolderMount(connect, options.base)];
          }
        }
      }
    },

    jekyll: {
      docs: {}
    },

    validation: {
      options: {
        reset: true,
        maxTry: 1,
        relaxerror: [
            "Bad value X-UA-Compatible for attribute http-equiv on element meta.",
            "Element img is missing required attribute src.",
        ]
      },
      files: {
        src: ["_gh_pages/**/*.html"]
      }
    },

    watch: {
      plugins: {
        files: '<%= jshint.plugins.src %>',
        tasks: ['jshint:plugins', 'qunit'],
        options: {
          livereload: true
        }
      },
      docsjs: {
        files: '<%= jshint.docs.src %>',
        tasks: ['jshint:docs'],
        options: {
          livereload: true
        }
      },
      test: {
        files: '<%= jshint.test.src %>',
        tasks: ['jshint:test', 'qunit'],
        options: {
          livereload: true
        }
      },
      scss: {
        files: ['sass/*.scss', 'sass/*/*.scss'],
        tasks: ['compass:bootstrap'],
        options: {
          // no need for this because the compile that occurs in compass
          // will update the css files that are being watched by the watch:html task
          livereload: false
        }
      },
      docshtml: {
        files: ['docs-assets/**/*'],
        tasks: ['jekyll:docs'],
        options: {
          livereload: true
        }
      },
      html: {
        files: [
          // must watch here to trigger jekyll when compass finishes compiling
          'dist/**/*.css',
          'fonts/**/*',
          'js/**/*',
          '**/*.html',
          '!_gh_pages/**/*',
          '!submodules/**/*'
        ],
        tasks: ['jekyll:docs'],
        options: {
          livereload: true
        }
      }
    },

    sed: {
      versionNumber: {
        pattern: (function () {
          var old = grunt.option('oldver')
          return old ? RegExp.quote(old) : old
        })(),
        replacement: grunt.option('newver'),
        recursive: true
      }
    }
  });

  // These plugins provide necessary tasks.
  // grunt.loadNpmTasks('browserstack-runner');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-compress');
  grunt.loadNpmTasks('grunt-css');
  grunt.loadNpmTasks('grunt-contrib-cssmin');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-qunit');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-html-validation');
  grunt.loadNpmTasks('grunt-jekyll');
  grunt.loadNpmTasks('grunt-contrib-compass');
  grunt.loadNpmTasks('grunt-sed');

  grunt.registerTask('lr', modules.livereload);

  // Docs HTML validation task
  grunt.registerTask('validate-html', ['clean', 'jekyll', 'validation']);

  // Test task.
  var testSubtasks = ['dist-css', 'jshint', 'qunit', 'validate-html'];
  var testSubtasksNoHTMLValidation = ['dist-css', 'jshint', 'qunit'];
  // Only run BrowserStack tests under Travis
  // if (process.env.TRAVIS) {
  //   // Only run BrowserStack tests if this is a mainline commit in twbs/bootstrap, or you have your own BrowserStack key
  //   if ((process.env.TRAVIS_REPO_SLUG === 'alademann/sass-bootstrap' && process.env.TRAVIS_PULL_REQUEST === 'false') || process.env.ALADEMANN_HAVE_OWN_BROWSERSTACK_KEY) {
  //     testSubtasks.push('browserstack_runner');
  //   }
  // }
  grunt.registerTask('test', testSubtasks);
  grunt.registerTask('test-no-html', testSubtasksNoHTMLValidation);

  // JS distribution task.
  grunt.registerTask('dist-js', ['concat', 'uglify']);

  // CSS distribution task.
  grunt.registerTask('dist-css', ['compass:bootstrap', 'cssmin:bootstrap']);

  // Fonts distribution task.
  grunt.registerTask('dist-fonts', ['copy:fonts']);

  // Full distribution task.
  grunt.registerTask('dist', ['clean', 'dist-fonts', 'dist-css', 'dist-js', 'compress:dist']);

  // Default task.
  grunt.registerTask('default', ['test-no-html', 'dist']);

  // Dev 'default' task that runs jekyll server, delivers uncompressed css and watch capabilities
  grunt.registerTask('dev',
    [
      'lr',
      'connect:docs',
      'default',
      'watch'
    ]
  );

  // Version numbering task.
  // grunt change-version-number --oldver=A.B.C --newver=X.Y.Z
  // This can be overzealous, so its changes should always be manually reviewed!
  grunt.registerTask('change-version-number', ['sed']);

};


text:
import { Component, Input, Output, EventEmitter } from '@angular/core';

import { Item } from './item.model';

@Component({
	selector: 'item',
	templateUrl: './item.component.html'
})
export class ItemComponent {

	@Input()
	private item: Item;

	@Output()
	private remove = new EventEmitter<any>();

	fireRemove() {
		this.remove.emit();
	}
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0"?>

<CREOLE-DIRECTORY>
   <!-- Processing Resources -->
  <CREOLE>

    <RESOURCE>
      <NAME>Stemmer PR</NAME>
      <JAR>stemmer.jar</JAR>
      <CLASS>stemmer.SnowballStemmer</CLASS>
      <COMMENT>Wrapper for the Snowball stemmer.</COMMENT>
      <HELPURL>http://gate.ac.uk/userguide/sec:parsers:stemmer</HELPURL>
 <PARAMETER
        NAME="document"
        RUNTIME="true"
        COMMENT="The document to be processed">gate.Document</PARAMETER>
 <PARAMETER
       NAME="annotationSetName"
       RUNTIME="true"
       DEFAULT=""
       OPTIONAL="true"
       COMMENT="The annotation set to be used for the generated annotations" >java.lang.String</PARAMETER>
 <PARAMETER
        NAME="annotationType"
        RUNTIME="true"
        DEFAULT="Token"
        COMMENT="Annotation type to be processed" >java.lang.String</PARAMETER>
   <PARAMETER
        NAME="annotationFeature"
        RUNTIME="true"
        DEFAULT="string"
        COMMENT="Feature containging a string of the word to be stemmed" >java.lang.String</PARAMETER>
  <PARAMETER
        NAME="language"
        DEFAULT="english"
        COMMENT="stemmer language" >java.lang.String</PARAMETER>
   </RESOURCE>

  </CREOLE>
</CREOLE-DIRECTORY>


text:
from distutils.core import setup

setup(
    name='shemutils',
    version='0.2',
    packages=['shemutils'],
    package_dir={"shemutils": "src"},
    package_data={"shemutils": ["src/*"]},
    url='http://github.com/0x00-0x00/shemutils',
    license='MIT',
    author='shemhazai',
    author_email='andre.marques@fatec.sp.gov.br',
    description='More information on github README.md'
)


text:
package com.thinkbiganalytics.nifi.provenance;

import com.thinkbiganalytics.nifi.provenance.jms.ProvenanceEventActiveMqWriter;
import com.thinkbiganalytics.nifi.provenance.model.ProvenanceEventRecordDTO;
import com.thinkbiganalytics.nifi.provenance.model.stats.AggregatedFeedProcessorStatisticsHolder;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Calculate Statistics pertaining to each Feed and Processor and send them off to JMS
 */

public class ProvenanceStatsCalculator {

    private static final Logger log = LoggerFactory.getLogger(ProvenanceStatsCalculator.class);

    /**
     * Object to hold onto the {@link com.thinkbiganalytics.nifi.provenance.model.stats.AggregatedProcessorStatistics} for each feed and send them onto Kylo via JMS ({@link this#sendStats()}
     */
    private AggregatedFeedProcessorStatisticsHolder statsHolder;

    /**
     * Helper class to send the data off to JMS
     */
    @Autowired
    private ProvenanceEventActiveMqWriter provenanceEventActiveMqWriter;

    public ProvenanceStatsCalculator() {
        statsHolder = new AggregatedFeedProcessorStatisticsHolder();
    }

    /**
     * Send the stats to JMS
     */
    public void sendStats() {
        if (statsHolder != null) {
            if (provenanceEventActiveMqWriter != null) {
                provenanceEventActiveMqWriter.writeStats(statsHolder);
                //reset the statsHolder to get new Statistics
                statsHolder = new AggregatedFeedProcessorStatisticsHolder();
            }
        }
    }

    /**
     * Group the incoming provenance event and gather statistics from it.
     *
     * @param event a ProvenanceEvent to be processed for statistics
     */
    public void calculateStats(ProvenanceEventRecordDTO event) {
        String feedName = event.getFeedName();
        if (feedName != null) {
            try {
                statsHolder.addStat(event);
            } catch (Exception e) {
                log.error("Unable to add Statistics for Event {}.  Exception: {} ", event, e.getMessage(), e);
            }
        } else {
            log.error("Unable to add Statistics for Event {}.  Unable to find feed for event ", event);
        }
    }

}


text:
ACCEPTED

#### According to
GRIN Taxonomy for Plants

#### Published in
Mém. Inst. Sci. Madagascar, Sér. B, Biol. Vég. 6:108. 1955

#### Original name
null

### Remarks
null


text:
import { Injectable } from '@angular/core';
import {Http, Headers, RequestOptions} from "@angular/http";
import {GlobalService} from "../global.service";
import {Observable} from "rxjs";

@Injectable()
export abstract class ApiService {

  constructor(protected http: Http, protected globalService : GlobalService) {}

  baseUrl = 'http://localhost:8080/webresources/';
  defaultOptions = new RequestOptions({ headers: new Headers({'Content-Type': 'application/json'})});

  handleError(error: any) {
    // Observable.throw(error.json().error || 'Server error');
    // Observable.throw('Server error');
  }

}


text:
<?php

namespace App\Http\Controllers\Forum;

use App\Models\Forum\Thread;
use Illuminate\Http\Request;
use App\Models\Forum\Channel;
use App\Filters\ThreadFilters;
use App\Http\Controllers\Controller;

class ThreadController extends Controller
{
    /**
     * ThreadsController constructor.
     */
    public function __construct()
    {
        $this->middleware('auth')->except(['index', 'show']);
    }

    /**
     * Display a listing of the resource.
     *
     * @param  Channel      $channel
     * @param ThreadFilters $filters
     * @return \Illuminate\Http\Response
     */
    public function index(Channel $channel, ThreadFilters $filters)
    {
        $threads = $this->getThreads($channel, $filters);
        if (request()->wantsJson()) {
            return $threads;
        }

        return view('forum.index', compact('threads'));
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        return view('forum.create');
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        $this->validate($request, [
            'title' => 'required',
            'body' => 'required',
            'channel_id' => 'required|exists:channels,id',
        ]);

        $thread = Thread::create([
            'user_id' => auth()->id(),
            'channel_id' => request('channel_id'),
            'title' => request('title'),
            'body' => request('body'),
        ]);

        return redirect($thread->path())
            ->with('flash', 'Your thread has been published!');
    }

    /**
     * Display the specified resource.
     *
     * @param  int     $channel
     * @param  \App\Thread $thread
     * @return \Illuminate\Http\Response
     */
    public function show($channel, Thread $thread)
    {
        return view('forum.show', [
            'thread' => $thread,
            'replies' => $thread->replies()->paginate(20),
        ]);
    }

    /**
     * Delete the given thread.
     *
     * @param        $channel
     * @param Thread $thread
     * @return mixed
     */
    public function destroy($channel, Thread $thread)
    {
        $this->authorize('update', $thread);
        $thread->delete();
        if (request()->wantsJson()) {
            return response([], 204);
        }

        return redirect('/forum/threads');
    }

    /**
     * Fetch all relevant threads.
     *
     * @param Channel       $channel
     * @param ThreadFilters $filters
     * @return mixed
     */
    protected function getThreads(Channel $channel, ThreadFilters $filters)
    {
        $threads = Thread::latest()->filter($filters);
        if ($channel->exists) {
            $threads->where('channel_id', $channel->id);
        }

        return $threads->get();
    }
}


text:
		<title>PxDistanceJointFlag Struct Reference</title>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
		<LINK HREF="NVIDIA.css" REL="stylesheet" TYPE="text/css">

				Main Page
				Class Hierarchy
				Compound List
				Compound Members

Public Types |
List of all members

PxDistanceJointFlag Struct Reference
Extensions

flags for configuring the drive of a PxDistanceJoint
 More...

#include <PxDistanceJoint.h>

Public Types

enum  	Enum {

  eMAX_DISTANCE_ENABLED = 1<<1,

  eMIN_DISTANCE_ENABLED = 1<<2,

  eSPRING_ENABLED = 1<<3

 }

Detailed Description

flags for configuring the drive of a PxDistanceJoint

See Also

PxDistanceJoint

Member Enumeration Documentation

          enum PxDistanceJointFlag::Enum

Enumerator

eMAX_DISTANCE_ENABLED

eMIN_DISTANCE_ENABLED

eSPRING_ENABLED

The documentation for this struct was generated from the following file:

PxDistanceJoint.h

Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com


text:
<?php

namespace live\Request\V20161101;

class ForbidLiveStreamRequest extends \RpcAcsRequest
{
	function  __construct()
	{
		parent::__construct("live", "2016-11-01", "ForbidLiveStream", "live", "openAPI");
		$this->setMethod("POST");
	}

	private  $resumeTime;

	private  $appName;

	private  $securityToken;

	private  $liveStreamType;

	private  $domainName;

	private  $ownerId;

	private  $streamName;

	public function getResumeTime() {
		return $this->resumeTime;
	}

	public function setResumeTime($resumeTime) {
		$this->resumeTime = $resumeTime;
		$this->queryParameters["ResumeTime"]=$resumeTime;
	}

	public function getAppName() {
		return $this->appName;
	}

	public function setAppName($appName) {
		$this->appName = $appName;
		$this->queryParameters["AppName"]=$appName;
	}

	public function getSecurityToken() {
		return $this->securityToken;
	}

	public function setSecurityToken($securityToken) {
		$this->securityToken = $securityToken;
		$this->queryParameters["SecurityToken"]=$securityToken;
	}

	public function getLiveStreamType() {
		return $this->liveStreamType;
	}

	public function setLiveStreamType($liveStreamType) {
		$this->liveStreamType = $liveStreamType;
		$this->queryParameters["LiveStreamType"]=$liveStreamType;
	}

	public function getDomainName() {
		return $this->domainName;
	}

	public function setDomainName($domainName) {
		$this->domainName = $domainName;
		$this->queryParameters["DomainName"]=$domainName;
	}

	public function getOwnerId() {
		return $this->ownerId;
	}

	public function setOwnerId($ownerId) {
		$this->ownerId = $ownerId;
		$this->queryParameters["OwnerId"]=$ownerId;
	}

	public function getStreamName() {
		return $this->streamName;
	}

	public function setStreamName($streamName) {
		$this->streamName = $streamName;
		$this->queryParameters["StreamName"]=$streamName;
	}

}


text:
module Citrus
  module Web
    class Streamer

      takes :configuration, :subscriptions_repository, :encoder, :zmq_context

      def run
        Thread.new do
          eager_load_sockets
          poller = ZMQ::Poller.new
          [event_socket, build_console_socket].each { |socket| poller.register_readable(socket) }
          loop do
            poller.poll
            poller.readables.each { |socket| process(socket) }
          end
        end
      end

      protected

      def process(socket)
        socket.recv_string(message = '')
        subject, payload = message.split(' ', 2)
        client_ids = subscriptions_repository.find_all_by_subject(subject).map { |subscription| subscription.client_id }
        deliver(client_ids, encoder.(payload)) unless client_ids.empty?
      end

      def deliver(client_ids, payload)
        mongrel_socket.send_string("#{configuration.mongrel_uuid} #{TNetstring.dump([*client_ids].join(' '))} #{payload}")
      end

      def event_socket
        @event_socket ||= zmq_context.socket(ZMQ::SUB).tap do |socket|
          socket.connect(configuration.event_pubsub_address)
          socket.setsockopt(ZMQ::SUBSCRIBE, 'events')
        end
      end

      def build_console_socket
        @build_console_socket ||= zmq_context.socket(ZMQ::SUB).tap do |socket|
          socket.connect(configuration.build_console_pubsub_address)
          socket.setsockopt(ZMQ::SUBSCRIBE, '')
        end
      end

      def mongrel_socket
        @mongrel_socket ||= zmq_context.socket(ZMQ::PUB).tap do |socket|
          socket.connect(configuration.mongrel_send_address)
        end
      end

      def eager_load_sockets
        event_socket
        build_console_socket
        mongrel_socket
      end

    end
  end
end


text:
using System;

namespace Exceptionless.Core.Models {
    public class Event : IData {
        public Event() {
            Tags = new TagSet();
            Data = new DataDictionary();
        }

        /// <summary>
        /// The event type (ie. error, log message, feature usage). Check <see cref="KnownTypes">Event.KnownTypes</see> for standard event types.
        /// </summary>
        public string Type { get; set; }

        /// <summary>
        /// The event source (ie. machine name, log name).
        /// </summary>
        public string Source { get; set; }

        /// <summary>
        /// The date that the event occurred on.
        /// </summary>
        public DateTimeOffset Date { get; set; }

        /// <summary>
        /// A list of tags used to categorize this event.
        /// </summary>
        public TagSet Tags { get; set; }

        /// <summary>
        /// The event message.
        /// </summary>
        public string Message { get; set; }

        /// <summary>
        /// The geo coordinates where the event happened.
        /// </summary>
        public string Geo { get; set; }

        /// <summary>
        /// The value of the event if any.
        /// </summary>
        public decimal? Value { get; set; }

        /// <summary>
        /// Optional data entries that contain additional information about this event.
        /// </summary>
        public DataDictionary Data { get; set; }

        /// <summary>
        /// An optional identifier to be used for referencing this event instance at a later time.
        /// </summary>
        public string ReferenceId { get; set; }

        public static class KnownTypes {
            public const string Error = "error";
            public const string FeatureUsage = "usage";
            public const string Log = "log";
            public const string NotFound = "404";
            public const string Session = "session";
            public const string SessionEnd = "sessionend";
            public const string SessionHeartbeat = "heartbeat";
        }

        public static class KnownTags {
            public const string Critical = "Critical";
            public const string Internal = "Internal";
        }

        public static class KnownDataKeys {
            public const string Error = "@error";
            public const string SimpleError = "@simple_error";
            public const string RequestInfo = "@request";
            public const string TraceLog = "@trace";
            public const string EnvironmentInfo = "@environment";
            public const string UserInfo = "@user";
            public const string UserDescription = "@user_description";
            public const string Version = "@version";
            public const string Level = "@level";
            public const string Location = "@location";
            public const string SubmissionMethod = "@submission_method";
            public const string SessionEnd = "sessionend";
            public const string SessionHasError = "haserror";
            public const string ManualStackingKey = "@stack";
        }
    }
}


text:
require 'singleton'

module DSCConnect
  module Action
    class Error < StandardError; end

    class Base
      include Singleton
      include LoggingHelper

      attr_accessor :config

      def config
        @config ||= {}
      end

      private

      def source_event
        Thread.current.thread_variable_get(:event)
      end
    end
  end
end


text:
<resources>
    <!-- Default screen margins, per the Android Design guidelines. -->
    <dimen name="activity_horizontal_margin">16dp</dimen>
    <dimen name="activity_vertical_margin">16dp</dimen>

    <dimen name="toolbar_height">56dp</dimen>
    <dimen name="gank_header_height">224dp</dimen>
    <dimen name="about_header_height">230dp</dimen>
    <dimen name="text_size_gank_title">14sp</dimen>

    <dimen name="padding_gank_item">16dp</dimen>
    <dimen name="padding_vertical_gank_item">8dp</dimen>

    <dimen name="text_size_gank_category">18sp</dimen>
    <dimen name="avatar_size">38dp</dimen>
    <dimen name="open_source_lis_text_size">13sp</dimen>
    <dimen name="about_card_margin">8dp</dimen>

    <dimen name="fab_margin_right">0dp</dimen>
    <dimen name="fab_margin_bottom">0dp</dimen>

    <dimen name="material_button_height">34dp</dimen>
    <dimen name="material_button_text_size">13dp</dimen>
</resources>


text:
namespace google {
namespace protobuf {
namespace compiler {
namespace objectivec {

namespace {
void SetCommonFieldVariables(const FieldDescriptor* descriptor,
                             map<string, string>* variables) {
  string camel_case_name = FieldName(descriptor);
  string raw_field_name;
  if (descriptor->type() == FieldDescriptor::TYPE_GROUP) {
    raw_field_name = descriptor->message_type()->name();
  } else {
    raw_field_name = descriptor->name();
  }
  // The logic here has to match -[GGPBFieldDescriptor textFormatName].
  const string un_camel_case_name(
      UnCamelCaseFieldName(camel_case_name, descriptor));
  const bool needs_custom_name = (raw_field_name != un_camel_case_name);

  SourceLocation location;
  if (descriptor->GetSourceLocation(&location)) {
    (*variables)["comments"] = BuildCommentsString(location);
  } else {
    (*variables)["comments"] = "\n";
  }
  const string& classname = ClassName(descriptor->containing_type());
  (*variables)["classname"] = classname;
  (*variables)["name"] = camel_case_name;
  const string& capitalized_name = FieldNameCapitalized(descriptor);
  (*variables)["capitalized_name"] = capitalized_name;
  (*variables)["raw_field_name"] = raw_field_name;
  (*variables)["field_number_name"] =
      classname + "_FieldNumber_" + capitalized_name;
  (*variables)["field_number"] = SimpleItoa(descriptor->number());
  (*variables)["has_index"] = SimpleItoa(descriptor->index());
  (*variables)["field_type"] = GetCapitalizedType(descriptor);
  std::vector<string> field_flags;
  if (descriptor->is_repeated()) field_flags.push_back("GPBFieldRepeated");
  if (descriptor->is_required()) field_flags.push_back("GPBFieldRequired");
  if (descriptor->is_optional()) field_flags.push_back("GPBFieldOptional");
  if (descriptor->is_packed()) field_flags.push_back("GPBFieldPacked");

  // ObjC custom flags.
  if (descriptor->has_default_value())
    field_flags.push_back("GPBFieldHasDefaultValue");
  if (needs_custom_name) field_flags.push_back("GPBFieldTextFormatNameCustom");
  if (descriptor->type() == FieldDescriptor::TYPE_ENUM) {
    field_flags.push_back("GPBFieldHasEnumDescriptor");
  }

  (*variables)["fieldflags"] = BuildFlagsString(field_flags);

  (*variables)["default"] = DefaultValue(descriptor);
  (*variables)["default_name"] = GPBGenericValueFieldName(descriptor);

  (*variables)["dataTypeSpecific_name"] = "className";
  (*variables)["dataTypeSpecific_value"] = "NULL";

  string field_options = descriptor->options().SerializeAsString();
  // Must convert to a standard byte order for packing length into
  // a cstring.
  uint32 length = ghtonl(field_options.length());
  if (length > 0) {
    string bytes((const char*)&length, sizeof(length));
    bytes.append(field_options);
    string options_str = "\"" + CEscape(bytes) + "\"";
    (*variables)["fieldoptions"] = "\"" + CEscape(bytes) + "\"";
  } else {
    (*variables)["fieldoptions"] = "";
  }

  // Clear some common things so they can be set just when needed.
  (*variables)["storage_attribute"] = "";
}

}  // namespace

FieldGenerator* FieldGenerator::Make(const FieldDescriptor* field) {
  FieldGenerator* result = NULL;
  if (field->is_repeated()) {
    switch (GetObjectiveCType(field)) {
      case OBJECTIVECTYPE_MESSAGE: {
        if (field->is_map()) {
          result = new MapFieldGenerator(field);
        } else {
          result = new RepeatedMessageFieldGenerator(field);
        }
        break;
      }
      case OBJECTIVECTYPE_ENUM:
        result = new RepeatedEnumFieldGenerator(field);
        break;
      default:
        result = new RepeatedPrimitiveFieldGenerator(field);
        break;
    }
  } else {
    switch (GetObjectiveCType(field)) {
      case OBJECTIVECTYPE_MESSAGE: {
        result = new MessageFieldGenerator(field);
        break;
      }
      case OBJECTIVECTYPE_ENUM:
        result = new EnumFieldGenerator(field);
        break;
      default:
        if (IsReferenceType(field)) {
          result = new PrimitiveObjFieldGenerator(field);
        } else {
          result = new PrimitiveFieldGenerator(field);
        }
        break;
    }
  }
  result->FinishInitialization();
  return result;
}

FieldGenerator::FieldGenerator(const FieldDescriptor* descriptor)
    : descriptor_(descriptor) {
  SetCommonFieldVariables(descriptor, &variables_);
}

FieldGenerator::~FieldGenerator() {}

void FieldGenerator::GenerateFieldNumberConstant(io::Printer* printer) const {
  printer->Print(
      variables_,
      "$field_number_name$ = $field_number$,\n");
}

void FieldGenerator::GenerateCFunctionDeclarations(
    io::Printer* printer) const {
  // Nothing
}

void FieldGenerator::GenerateCFunctionImplementations(
    io::Printer* printer) const {
  // Nothing
}

void FieldGenerator::DetermineForwardDeclarations(
    set<string>* fwd_decls) const {
  // Nothing
}

void FieldGenerator::GenerateFieldDescription(
    io::Printer* printer) const {
  printer->Print(
      variables_,
      "{\n"
      "  .name = \"$name$\",\n"
      "  .number = $field_number_name$,\n"
      "  .hasIndex = $has_index$,\n"
      "  .flags = $fieldflags$,\n"
      "  .dataType = GPBDataType$field_type$,\n"
      "  .offset = offsetof($classname$__storage_, $name$),\n"
      "  .defaultValue.$default_name$ = $default$,\n");

  // TODO(thomasvl): It might be useful to add a CPP wrapper to support
  // compiling away the EnumDescriptors.  To do that, we'd need a #if here
  // to control setting the descriptor vs. the validator, and above in
  // SetCommonFieldVariables() we'd want to wrap how we add
  // GPBFieldHasDefaultValue to the flags.

  // "  .dataTypeSpecific.value* = [something],"
  GenerateFieldDescriptionTypeSpecific(printer);

  const string& field_options(variables_.find("fieldoptions")->second);
  if (field_options.empty()) {
    printer->Print("  .fieldOptions = NULL,\n");
  } else {
    // Can't use PrintRaw() here to get the #if/#else/#endif lines completely
    // outdented because the need for indent captured on the previous
    // printing of a \n and there is no way to get the current indent level
    // to call the right number of Outdent()/Indents() to maintain state.
    printer->Print(
        variables_,
        "#if GPBOBJC_INCLUDE_FIELD_OPTIONS\n"
        "  .fieldOptions = $fieldoptions$,\n"
        "#else\n"
        "  .fieldOptions = NULL,\n"
        "#endif  // GPBOBJC_INCLUDE_FIELD_OPTIONS\n");
  }

  printer->Print("},\n");
}

void FieldGenerator::GenerateFieldDescriptionTypeSpecific(
    io::Printer* printer) const {
  printer->Print(
      variables_,
      "  .dataTypeSpecific.$dataTypeSpecific_name$ = $dataTypeSpecific_value$,\n");
}

void FieldGenerator::SetOneofIndexBase(int index_base) {
  if (descriptor_->containing_oneof() != NULL) {
    int index = descriptor_->containing_oneof()->index() + index_base;
    // Flip the sign to mark it as a oneof.
    variables_["has_index"] = SimpleItoa(-index);
  }
}

void FieldGenerator::FinishInitialization(void) {
  // If "property_type" wasn't set, make it "storage_type".
  if ((variables_.find("property_type") == variables_.end()) &&
      (variables_.find("storage_type") != variables_.end())) {
    variables_["property_type"] = variable("storage_type");
  }
}

SingleFieldGenerator::SingleFieldGenerator(
    const FieldDescriptor* descriptor)
    : FieldGenerator(descriptor) {
  // Nothing
}

SingleFieldGenerator::~SingleFieldGenerator() {}

void SingleFieldGenerator::GenerateFieldStorageDeclaration(
    io::Printer* printer) const {
  printer->Print(variables_, "$storage_type$ $name$;\n");
}

void SingleFieldGenerator::GeneratePropertyDeclaration(
    io::Printer* printer) const {
  printer->Print(variables_, "$comments$");
  if (WantsHasProperty()) {
    printer->Print(
        variables_,
        "@property(nonatomic, readwrite) BOOL has$capitalized_name$;\n");
  }
  printer->Print(
      variables_,
      "@property(nonatomic, readwrite) $property_type$ $name$;\n"
      "\n");
}

void SingleFieldGenerator::GeneratePropertyImplementation(
    io::Printer* printer) const {
  if (WantsHasProperty()) {
    printer->Print(variables_, "@dynamic has$capitalized_name$, $name$;\n");
  } else {
    printer->Print(variables_, "@dynamic $name$;\n");
  }
}

bool SingleFieldGenerator::WantsHasProperty(void) const {
  if (descriptor_->containing_oneof() != NULL) {
    // If in a oneof, it uses the oneofcase instead of a has bit.
    return false;
  }
  if (HasFieldPresence(descriptor_->file())) {
    // In proto1/proto2, every field has a has_$name$() method.
    return true;
  }
  return false;
}

ObjCObjFieldGenerator::ObjCObjFieldGenerator(
    const FieldDescriptor* descriptor)
    : SingleFieldGenerator(descriptor) {
  variables_["property_storage_attribute"] = "strong";
  if (IsRetainedName(variables_["name"])) {
    variables_["storage_attribute"] = " NS_RETURNS_NOT_RETAINED";
  }
}

ObjCObjFieldGenerator::~ObjCObjFieldGenerator() {}

void ObjCObjFieldGenerator::GenerateFieldStorageDeclaration(
    io::Printer* printer) const {
  printer->Print(variables_, "$storage_type$ *$name$;\n");
}

void ObjCObjFieldGenerator::GeneratePropertyDeclaration(
    io::Printer* printer) const {

  // Differs from SingleFieldGenerator::GeneratePropertyDeclaration() in that
  // it uses pointers and deals with Objective C's rules around storage name
  // conventions (init*, new*, etc.)

  printer->Print(variables_, "$comments$");
  if (WantsHasProperty()) {
    printer->Print(
        variables_,
        "@property(nonatomic, readwrite) BOOL has$capitalized_name$;\n");
  }
  printer->Print(
      variables_,
      "@property(nonatomic, readwrite, $property_storage_attribute$, null_resettable) $property_type$ *$name$$storage_attribute$;\n");
  if (IsInitName(variables_.find("name")->second)) {
    // If property name starts with init we need to annotate it to get past ARC.
    // http://stackoverflow.com/questions/18723226/how-do-i-annotate-an-objective-c-property-with-an-objc-method-family/18723227#18723227
    printer->Print(variables_,
                   "- ($property_type$ *)$name$ GPB_METHOD_FAMILY_NONE;\n");
  }
  printer->Print("\n");
}

RepeatedFieldGenerator::RepeatedFieldGenerator(
    const FieldDescriptor* descriptor)
    : ObjCObjFieldGenerator(descriptor) {
  // Repeated fields don't use the has index.
  variables_["has_index"] = "GPBNoHasBit";
}

RepeatedFieldGenerator::~RepeatedFieldGenerator() {}

void RepeatedFieldGenerator::FinishInitialization(void) {
  FieldGenerator::FinishInitialization();
  variables_["array_comment"] =
      "// |" + variables_["name"] + "| contains |" + variables_["storage_type"] + "|\n";
}

void RepeatedFieldGenerator::GenerateFieldStorageDeclaration(
    io::Printer* printer) const {
  printer->Print(variables_, "$array_storage_type$ *$name$;\n");
}

void RepeatedFieldGenerator::GeneratePropertyImplementation(
    io::Printer* printer) const {
  printer->Print(variables_, "@dynamic $name$, $name$_Count;\n");
}

void RepeatedFieldGenerator::GeneratePropertyDeclaration(
    io::Printer* printer) const {

  // Repeated fields don't need the has* properties, but they do expose a
  // *Count (to check without autocreation).  So for the field property we need
  // the same logic as ObjCObjFieldGenerator::GeneratePropertyDeclaration() for
  // dealing with needing Objective C's rules around storage name conventions
  // (init*, new*, etc.)

  printer->Print(
      variables_,
      "$comments$"
      "$array_comment$"
      "@property(nonatomic, readwrite, strong, null_resettable) $array_storage_type$ *$name$$storage_attribute$;\n"
      "@property(nonatomic, readonly) NSUInteger $name$_Count;\n");
  if (IsInitName(variables_.find("name")->second)) {
    // If property name starts with init we need to annotate it to get past ARC.
    // http://stackoverflow.com/questions/18723226/how-do-i-annotate-an-objective-c-property-with-an-objc-method-family/18723227#18723227
    printer->Print(variables_,
                   "- ($array_storage_type$ *)$name$ GPB_METHOD_FAMILY_NONE;\n");
  }
  printer->Print("\n");
}

bool RepeatedFieldGenerator::WantsHasProperty(void) const {
  // Consumer check the array size/existance rather than a has bit.
  return false;
}

FieldGeneratorMap::FieldGeneratorMap(const Descriptor* descriptor)
    : descriptor_(descriptor),
      field_generators_(
          new scoped_ptr<FieldGenerator>[descriptor->field_count()]),
      extension_generators_(
          new scoped_ptr<FieldGenerator>[descriptor->extension_count()]) {
  // Construct all the FieldGenerators.
  for (int i = 0; i < descriptor->field_count(); i++) {
    field_generators_[i].reset(FieldGenerator::Make(descriptor->field(i)));
  }
  for (int i = 0; i < descriptor->extension_count(); i++) {
    extension_generators_[i].reset(FieldGenerator::Make(descriptor->extension(i)));
  }
}

FieldGeneratorMap::~FieldGeneratorMap() {}

const FieldGenerator& FieldGeneratorMap::get(
    const FieldDescriptor* field) const {
  GOOGLE_CHECK_EQ(field->containing_type(), descriptor_);
  return *field_generators_[field->index()];
}

const FieldGenerator& FieldGeneratorMap::get_extension(int index) const {
  return *extension_generators_[index];
}

void FieldGeneratorMap::SetOneofIndexBase(int index_base) {
  for (int i = 0; i < descriptor_->field_count(); i++) {
    field_generators_[i]->SetOneofIndexBase(index_base);
  }
}

}  // namespace objectivec
}  // namespace compiler
}  // namespace protobuf
}  // namespace google


text:
# angularbknd — The seed for Backand AngularJS apps

This project is an application skeleton for a typical [AngularJS](http://angularjs.org/) web app for the Backand back office.
You can use it to quickly Bootstrap your Backand Angular webapp projects and dev environment for these
projects.

It is based on the [angular-seed](https://github.com/angular/angular-seed) application.

## Themes

We have a collection of [Bootstrap](https://www.backand.com/bootstrap-theme) themes that offer a pre-built set of views.

All the themes are fully responsive Admin template. Based on the **Bootstrap 3** framework. Highly customizable and easy to use, it fits many screen resolutions from small mobile devices to large desktops.

## Getting Started

To get started you can simply clone the angularbknd repository and install the dependencies:

### Prerequisites

You need git to clone the angularbknd repository. You can get Git from
[http://git-scm.com/](http://git-scm.com/).

We also use a number of node.js tools to initialize and test angularbknd. You must have node.js and its package manager (npm) installed.  You can donwload node.js from [http://nodejs.org/download//](http://nodejs.org/download/).

### Clone angularbknd

Clone the angularbknd repository using [git][git]:

```
git clone https://github.com/backand/angularbknd
cd angularbknd
```

### Install Dependencies

We have two kinds of dependencies in this project: tools and Angular framework code. The tools help us manage and test the application.

* We get the tools we depend upon via `npm`, the [node package manager][npm].
* We get the Angular code via `bower`, a [client-side code package manager][bower].

We have preconfigured `npm` to automatically run `bower` so we can simply do:

```
npm install
```

Behind the scenes this will also call `bower install`.  You should find that you have two new folders in your project.

* `node_modules` - contains the npm packages for the tools we need
* `app/bower_components` - contains the angular framework files

*-In Windows you need to manually create `C:\Users\<user name>\AppData\Roaming\npm` folder.*

*-Note that the `bower_components` folder would normally be installed in the root folder but angularbknd changes this location through the `.bowerrc` file.  Putting it in the app folder makes it easier to serve the files by a webserver.

*-On a Mac or Linux, you may have to use `sudu` as:
```
sudo npm install
```

### Run the Application

We have preconfigured the project with a simple development web server.  The simplest way to start this server is:

```
npm start
```

Now browse to the app at `http://localhost:8000/app/index.html`.

*-Note: on Mac or Linux, you may have to use `sudo`, as:

```
sudo npm start
```

### Select the Bootstrap Template

The default template is LTE at `http://localhost:8000/app/index-lte.html`.
You can select other template like Devopps by browse to `http://localhost:8000/app/index-devoops.html`.

## Updating Angular

To update Backand code we recommend that you merge in changes to your own fork of the project.
```
git pull https://github.com/backand/angularbknd
```
You can update the tool dependencies by running:

```
npm update
```

This will find the latest versions that match the version ranges specified in the `package.json` file.

You can update the Angular dependencies by running:

```
bower update
```

This will find the latest versions that match the version ranges specified in the `bower.json` file.

### Running the App in Production

Backand Service provide hosting not just the backend but also to the AngularJS code.
- Login to Backand Console to update the Github reposiroty
- The production URL will be at: yourapp.backand.net

## Contact

For more information on Backand please check out https://www.backand.com

[git]: http://git-scm.com/
[bower]: http://bower.io
[npm]: https://www.npmjs.org/
[node]: http://nodejs.org


text: module.exports = require('./node-loaders');


text:
<mdl-fab>add</mdl-fab>
<mdl-fab ripple>close</mdl-fab>
<mdl-fab colored disabled="false">class</mdl-fab>
<mdl-fab colored disabled="true" mdl-badge-overlap="♥">class</mdl-fab>
<mdl-fab colored="primary" mdl-badge-overlap="5">code</mdl-fab>
<mdl-fab colored="accent" mdl-badge="2">copyright</mdl-fab>
<br>
<mdl-fab mini>add</mdl-fab>
<mdl-fab mini ripple>close</mdl-fab>
<mdl-fab mini colored disabled="false">class</mdl-fab>
<mdl-fab mini colored disabled="true">class</mdl-fab>
<mdl-fab mini colored="primary">code</mdl-fab>
<mdl-fab mini colored="accent">copyright</mdl-fab>


text:
/**
 * Calculates the radius of the Hill Sphere,
 * for a body with mass `m1`
 * @param  {Number} m1 Mass of the lighter body
 * @param  {Number} m2 Mass of the heavier body
 * @param  {Number} a  Semi-major axis
 * @param  {Number} e  Eccentricity
 * @return {Number}    Hill Sphere radius
 */
function hillSphere( m1, m2, a, e ) {
  return a * ( 1 - e ) * Math.pow(
    ( m1 / ( 3 * m2 ) ), 1/3
  )
}

module.exports = hillSphere


text:
package com.cloudera.sparkts

import breeze.linalg._

/**
 * Models time dependent effects in a time series.
 */
trait TimeSeriesModel {
  /**
   * Takes a time series that is assumed to have this model's characteristics and returns a time
   * series with time-dependent effects of this model removed.
   *
   * This is the inverse of [[TimeSeriesModel#addTimeDependentEffects]].
   *
   * @param ts Time series of observations with this model's characteristics.
   * @param dest Array to put the filtered series, can be the same as ts.
   * @return The dest series, for convenience.
   */
  def removeTimeDependentEffects(ts: Vector[Double], dest: Vector[Double] = null): Vector[Double]

  /**
   * Takes a series of i.i.d. observations and returns a time series based on it with the
   * time-dependent effects of this model added.
   *
   * @param ts Time series of i.i.d. observations.
   * @param dest Array to put the filtered series, can be the same as ts.
   * @return The dest series, for convenience.
   */
  def addTimeDependentEffects(ts: Vector[Double], dest: Vector[Double] = null): Vector[Double]
}


text:
'use strict';

var execFile = require('child_process').execFile;
var fs = require('fs');
var opn = require('opn');
var path = require('path');

function getChromeAppName() {
  switch (process.platform) {
  case 'darwin':
    return 'google chrome';
  case 'win32':
    return 'chrome';
  default:
    return 'google-chrome';
  }
}

module.exports = function(options, isDebuggerConnected) {
  return function(req, res, next) {
    if (req.url === '/debugger-ui') {
      var debuggerPath = path.join(__dirname, '..', 'util', 'debugger.html');
      res.writeHead(200, {'Content-Type': 'text/html'});
      fs.createReadStream(debuggerPath).pipe(res);
    } else if (req.url === '/debuggerWorker.js') {
      var workerPath = path.join(__dirname, '..', 'util', 'debuggerWorker.js');
      res.writeHead(200, {'Content-Type': 'application/javascript'});
      fs.createReadStream(workerPath).pipe(res);
    } else if (req.url === '/launch-safari-devtools') {
      // TODO: remove `console.log` and dev tools binary
      console.log(
        'We removed support for Safari dev-tools. ' +
        'If you still need this, please let us know.'
      );
    } else if (req.url === '/launch-chrome-devtools') {
      if (isDebuggerConnected()) {
        // Dev tools are already open; no need to open another session
        res.end('OK');
        return;
      }
      var debuggerURL = 'http://localhost:' + options.port + '/debugger-ui';
      console.log('Launching Dev Tools...');
      opn(debuggerURL, {app: [getChromeAppName()]}, function(err) {
        if (err) {
          console.error('Google Chrome exited with error:', err);
        }
      });
      res.end('OK');
    } else {
      next();
    }
  };
};


text:
package org.springframework.messaging.simp;

import java.util.Map;

import org.springframework.lang.Nullable;
import org.springframework.messaging.MessagingException;
import org.springframework.messaging.core.MessagePostProcessor;
import org.springframework.messaging.core.MessageSendingOperations;

/**
 * A specialization of {@link MessageSendingOperations} with methods for use with
 * the Spring Framework support for Simple Messaging Protocols (like STOMP).
 *
 *
For more on user destinations see
 * {@link org.springframework.messaging.simp.user.UserDestinationResolver
 * UserDestinationResolver}.
 *
 *
Generally it is expected the user is the one authenticated with the
 * WebSocket session (or by extension the user authenticated with the
 * handshake request that started the session). However if the session is
 * not authenticated, it is also possible to pass the session id (if known)
 * in place of the user name. Keep in mind though that in that scenario,
 * you must use one of the overloaded methods that accept headers making sure the
 * {@link org.springframework.messaging.simp.SimpMessageHeaderAccessor#setSessionId
 * sessionId} header has been set accordingly.
 *
 * @author Rossen Stoyanchev
 * @since 4.0
 */
public interface SimpMessageSendingOperations extends MessageSendingOperations<String> {

	/**
	 * Send a message to the given user.
	 * @param user the user that should receive the message.
	 * @param destination the destination to send the message to.
	 * @param payload the payload to send
	 */
	void convertAndSendToUser(String user, String destination, Object payload) throws MessagingException;

	/**
	 * Send a message to the given user.
	 *
By default headers are interpreted as native headers (e.g. STOMP) and
	 * are saved under a special key in the resulting Spring
	 * {@link org.springframework.messaging.Message Message}. In effect when the
	 * message leaves the application, the provided headers are included with it
	 * and delivered to the destination (e.g. the STOMP client or broker).
	 *
If the map already contains the key
	 * {@link org.springframework.messaging.support.NativeMessageHeaderAccessor#NATIVE_HEADERS "nativeHeaders"}
	 * or was prepared with
	 * {@link org.springframework.messaging.simp.SimpMessageHeaderAccessor SimpMessageHeaderAccessor}
	 * then the headers are used directly. A common expected case is providing a
	 * content type (to influence the message conversion) and native headers.
	 * This may be done as follows:
	 *

	 * SimpMessageHeaderAccessor accessor = SimpMessageHeaderAccessor.create();
	 * accessor.setContentType(MimeTypeUtils.TEXT_PLAIN);
	 * accessor.setNativeHeader("foo", "bar");
	 * accessor.setLeaveMutable(true);
	 * MessageHeaders headers = accessor.getMessageHeaders();
	 * messagingTemplate.convertAndSendToUser(user, destination, payload, headers);
	 *

	 *
Note: if the {@code MessageHeaders} are mutable as in
	 * the above example, implementations of this interface should take notice and
	 * update the headers in the same instance (rather than copy or re-create it)
	 * and then set it immutable before sending the final message.
	 * @param user the user that should receive the message (must not be {@code null})
	 * @param destination the destination to send the message to (must not be {@code null})
	 * @param payload the payload to send (may be {@code null})
	 * @param headers the message headers (may be {@code null})
	 */
	void convertAndSendToUser(String user, String destination, Object payload, Map<String, Object> headers)
			throws MessagingException;

	/**
	 * Send a message to the given user.
	 * @param user the user that should receive the message (must not be {@code null})
	 * @param destination the destination to send the message to (must not be {@code null})
	 * @param payload the payload to send (may be {@code null})
	 * @param postProcessor a postProcessor to post-process or modify the created message
	 */
	void convertAndSendToUser(String user, String destination, Object payload, MessagePostProcessor postProcessor)
			throws MessagingException;

	/**
	 * Send a message to the given user.
	 *
See {@link #convertAndSend(Object, Object, java.util.Map)} for important
	 * notes regarding the input headers.
	 * @param user the user that should receive the message
	 * @param destination the destination to send the message to
	 * @param payload the payload to send
	 * @param headers the message headers
	 * @param postProcessor a postProcessor to post-process or modify the created message
	 */
	void convertAndSendToUser(String user, String destination, Object payload, @Nullable Map<String, Object> headers,
			@Nullable MessagePostProcessor postProcessor) throws MessagingException;

}


text:
package parquet.hadoop;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;

import parquet.Log;
import parquet.column.ColumnDescriptor;
import parquet.column.page.PageReadStore;
import parquet.filter.UnboundRecordFilter;
import parquet.filter2.compat.FilterCompat;
import parquet.filter2.compat.FilterCompat.Filter;
import parquet.hadoop.api.ReadSupport;
import parquet.hadoop.metadata.BlockMetaData;
import parquet.hadoop.util.counters.BenchmarkCounter;
import parquet.io.ColumnIOFactory;
import parquet.io.MessageColumnIO;
import parquet.io.ParquetDecodingException;
import parquet.io.api.RecordMaterializer;
import parquet.schema.GroupType;
import parquet.schema.MessageType;
import parquet.schema.Type;

import static java.lang.String.format;
import static parquet.Log.DEBUG;
import static parquet.Preconditions.checkNotNull;
import static parquet.hadoop.ParquetInputFormat.STRICT_TYPE_CHECKING;

class InternalParquetRecordReader<T> {
  private static final Log LOG = Log.getLog(InternalParquetRecordReader.class);

  private final ColumnIOFactory columnIOFactory = new ColumnIOFactory();
  private final Filter filter;

  private MessageType requestedSchema;
  private MessageType fileSchema;
  private int columnCount;
  private final ReadSupport<T> readSupport;

  private RecordMaterializer<T> recordConverter;

  private T currentValue;
  private long total;
  private long current = 0;
  private int currentBlock = -1;
  private ParquetFileReader reader;
  private parquet.io.RecordReader<T> recordReader;
  private boolean strictTypeChecking;

  private long totalTimeSpentReadingBytes;
  private long totalTimeSpentProcessingRecords;
  private long startedAssemblingCurrentBlockAt;

  private long totalCountLoadedSoFar = 0;

  private Path file;

  /**
   * @param readSupport Object which helps reads files of the given type, e.g. Thrift, Avro.
   * @param filter for filtering individual records
   */
  public InternalParquetRecordReader(ReadSupport<T> readSupport, Filter filter) {
    this.readSupport = readSupport;
    this.filter = checkNotNull(filter, "filter");
  }

  /**
   * @param readSupport Object which helps reads files of the given type, e.g. Thrift, Avro.
   */
  public InternalParquetRecordReader(ReadSupport<T> readSupport) {
    this(readSupport, FilterCompat.NOOP);
  }

  /**
   * @param readSupport Object which helps reads files of the given type, e.g. Thrift, Avro.
   * @param filter Optional filter for only returning matching records.
   * @deprecated use {@link #InternalParquetRecordReader(ReadSupport, Filter)}
   */
  @Deprecated
  public InternalParquetRecordReader(ReadSupport<T> readSupport, UnboundRecordFilter filter) {
    this(readSupport, FilterCompat.get(filter));
  }

  private void checkRead() throws IOException {
    if (current == totalCountLoadedSoFar) {
      if (current != 0) {
        long timeAssembling = System.currentTimeMillis() - startedAssemblingCurrentBlockAt;
        totalTimeSpentProcessingRecords += timeAssembling;
        LOG.info("Assembled and processed " + totalCountLoadedSoFar + " records from " + columnCount + " columns in " + totalTimeSpentProcessingRecords + " ms: "+((float)totalCountLoadedSoFar / totalTimeSpentProcessingRecords) + " rec/ms, " + ((float)totalCountLoadedSoFar * columnCount / totalTimeSpentProcessingRecords) + " cell/ms");
        long totalTime = totalTimeSpentProcessingRecords + totalTimeSpentReadingBytes;
        long percentReading = 100 * totalTimeSpentReadingBytes / totalTime;
        long percentProcessing = 100 * totalTimeSpentProcessingRecords / totalTime;
        LOG.info("time spent so far " + percentReading + "% reading ("+totalTimeSpentReadingBytes+" ms) and " + percentProcessing + "% processing ("+totalTimeSpentProcessingRecords+" ms)");
      }

      LOG.info("at row " + current + ". reading next block");
      long t0 = System.currentTimeMillis();
      PageReadStore pages = reader.readNextRowGroup();
      if (pages == null) {
        throw new IOException("expecting more rows but reached last block. Read " + current + " out of " + total);
      }
      long timeSpentReading = System.currentTimeMillis() - t0;
      totalTimeSpentReadingBytes += timeSpentReading;
      BenchmarkCounter.incrementTime(timeSpentReading);
      LOG.info("block read in memory in " + timeSpentReading + " ms. row count = " + pages.getRowCount());
      if (Log.DEBUG) LOG.debug("initializing Record assembly with requested schema " + requestedSchema);
      MessageColumnIO columnIO = columnIOFactory.getColumnIO(requestedSchema, fileSchema, strictTypeChecking);
      recordReader = columnIO.getRecordReader(pages, recordConverter, filter);
      startedAssemblingCurrentBlockAt = System.currentTimeMillis();
      totalCountLoadedSoFar += pages.getRowCount();
      ++ currentBlock;
    }
  }

  public void close() throws IOException {
    reader.close();
  }

  public Void getCurrentKey() throws IOException, InterruptedException {
    return null;
  }

  public T getCurrentValue() throws IOException,
  InterruptedException {
    return currentValue;
  }

  public float getProgress() throws IOException, InterruptedException {
    return (float) current / total;
  }

  public void initialize(MessageType requestedSchema, MessageType fileSchema,
      Map<String, String> extraMetadata, Map<String, String> readSupportMetadata,
      Path file, List<BlockMetaData> blocks, Configuration configuration)
      throws IOException {
    this.requestedSchema = requestedSchema;
    this.fileSchema = fileSchema;
    this.file = file;
    this.columnCount = this.requestedSchema.getPaths().size();
    this.recordConverter = readSupport.prepareForRead(
        configuration, extraMetadata, fileSchema,
        new ReadSupport.ReadContext(requestedSchema, readSupportMetadata));
    this.strictTypeChecking = configuration.getBoolean(STRICT_TYPE_CHECKING, true);
    List<ColumnDescriptor> columns = requestedSchema.getColumns();
    reader = new ParquetFileReader(configuration, file, blocks, columns);
    for (BlockMetaData block : blocks) {
      total += block.getRowCount();
    }
    LOG.info("RecordReader initialized will read a total of " + total + " records.");
  }

  private boolean contains(GroupType group, String[] path, int index) {
    if (index == path.length) {
      return false;
    }
    if (group.containsField(path[index])) {
      Type type = group.getType(path[index]);
      if (type.isPrimitive()) {
        return index + 1 == path.length;
      } else {
        return contains(type.asGroupType(), path, index + 1);
      }
    }
    return false;
  }

  public boolean nextKeyValue() throws IOException, InterruptedException {
    boolean recordFound = false;

    while (!recordFound) {
      // no more records left
      if (current >= total) { return false; }

      try {
        checkRead();
        currentValue = recordReader.read();
        current ++;
        if (recordReader.shouldSkipCurrentRecord()) {
          // this record is being filtered via the filter2 package
          if (DEBUG) LOG.debug("skipping record");
          continue;
        }

        if (currentValue == null) {
          // only happens with FilteredRecordReader at end of block
          current = totalCountLoadedSoFar;
          if (DEBUG) LOG.debug("filtered record reader reached end of block");
          continue;
        }

        recordFound = true;

        if (DEBUG) LOG.debug("read value: " + currentValue);
      } catch (RuntimeException e) {
        throw new ParquetDecodingException(format("Can not read value at %d in block %d in file %s", current, currentBlock, file), e);
      }
    }
    return true;
  }
}


text:
import { PolymerElement, html } from '@polymer/polymer/polymer-element.js';

class PPDivider extends PolymerElement {
  static get template() {
    return html`
      <style>
        :host {
          display: block;
          height: 1px;
          min-height: 1px;
          max-height: 1px;
          background-color: var(--pp-divider-color, #000);
          opacity: 0.7;
          @apply --pp-divider;
        }
      </style>
    `;
  }
}

window.customElements.define('pp-divider', PPDivider);


text:
@interface ICGThumbView : UIView

@property (strong, nonatomic) UIColor *color;

- (instancetype)initWithFrame:(CGRect)frame color:(UIColor *)color right:(BOOL)flag;

- (instancetype)initWithFrame:(CGRect)frame thumbImage:(UIImage *)image;

@end


text:
var moment = require('moment')
  , locations = require('../config/locations.json')
  , identities = require('../config/identities.json')
  , md5 = require('crypto');

// WPA event notification enum lifted from hostapd driver source
// typedef enum {
//   WPA_AUTH, WPA_ASSOC, WPA_DISASSOC, WPA_DEAUTH, WPA_REAUTH,
//   WPA_REAUTH_EAPOL, WPA_ASSOC_FT
// } wpa_event;
var wpaAuth = /event 0 notification/gi;
var wpaAssoc = /event 1 notification/gi;
var wpaDisassoc = /event 2 notification/gi;
var wpaDeauth = /event 3 notification/gi;
var wpaReauth = /event 4 notification/gi;
var wpaReauthEapol = /event 5 notification/gi;
var wpaAssocFt = /event 6 notification/gi;

var EVENTS = {
  connection: [wpaAuth, wpaAssoc, wpaReauth, wpaReauthEapol],
  disconnection: [wpaDisassoc, wpaDeauth],
  authentication: [/STA identity/gi]
}

var MAC_ADDRESS_MATCHER = /(([0-9a-f]{2}:){5}[0-9a-f]{2})/gi;
var IP_ADDRESS_MATCHER = /(\d{1,3}\.){3}\d{1,3}/gi;

function HostAPDMessage(data){
  var eventTimestamp = Date.now();

  this.isAuthentication = function() {
    return eventMatch(EVENTS.authentication, data);
  }

  this.isAssociation = function() {
    return eventMatch(EVENTS.connection, data)
  };

  this.isDisassociation = function() {
    return eventMatch(EVENTS.disconnection, data)
  };

  this.isInteresting = function() {
    return this.isDisassociation() || this.isAssociation() || this.isAuthentication();
  };

  function eventMatch(events, entry) {
    return events.some(function match(expression) { return !!entry.match(expression) });
  };

  if (this.isAssociation()) {
    this.json = associationEvent();
  } else if (this.isDisassociation()) {
    this.json = disassociationEvent();
  } else if (this.isAuthentication()) {
    this.json = authenticationEvent();
  }

  function cleanUsername(name){
    if(identities[name]) return identities[name];

    return name.toString()
                .replace(/host\/|'|\\|@uswitch\.com|uswitch/gi, '')
                .replace(/\./g, ' ');
  };

  function gravatarUrl(userName) {
    var email = userName.replace(' ', '.') + '@uswitch.com';
    return 'http://www.gravatar.com/avatar/' + md5.createHash('md5').update(email).digest('hex');
  };

  function associationEvent() {
    var locationIpAddress = data.match(IP_ADDRESS_MATCHER);
    var location = locations[locationIpAddress];
    var macAddress = data.match(MAC_ADDRESS_MATCHER)[0];

    return {
      macAddress: macAddress,
      locationName: location['name'],
      locationIpAddress: locationIpAddress,
      locationId: location['id'],
      connectedAt: eventTimestamp,
      connected: true
    };
  }

  function authenticationEvent() {
    var locationIpAddress = data.match(IP_ADDRESS_MATCHER);
    var location = locations[locationIpAddress];
    var userName = cleanUsername(data.match(/'(.*)'/i)[1]);
    var avatarUrl = gravatarUrl(userName);
    var macAddress = data.match(MAC_ADDRESS_MATCHER)[0];

    return {
      macAddress: macAddress,
      locationName: location['name'],
      locationIpAddress: locationIpAddress,
      locationId: location['id'],
      connectedAt: eventTimestamp,
      username: userName,
      avatarUrl: avatarUrl
    };
  };

  function disassociationEvent() {
    var disconnectedDate = moment().format('ddd Do MMM');
    var disconnectedTime = moment().format('h:mm:ss a');
    var macAddress = data.match(MAC_ADDRESS_MATCHER)[0];

    return {
      macAddress: macAddress,
      disconnectedDate: disconnectedDate,
      disconnectedTime: disconnectedTime,
      disconnectedAt: eventTimestamp,
      connected: false
    };
  };
}

module.exports = HostAPDMessage;


text:
/*
 * This is called from sys/select.h and sys/time.h for the common prototype
 * of select().  Setting _DARWIN_C_SOURCE or _DARWIN_UNLIMITED_SELECT uses
 * the version of select() that does not place a limit on the first argument
 * (nfds).  In the UNIX conformance case, values of nfds greater than
 * FD_SETSIZE will return an error of EINVAL.
 */
#ifndef _SYS__SELECT_H_
#define _SYS__SELECT_H_

int      select(int, fd_set * __restrict, fd_set * __restrict,
    fd_set * __restrict, struct timeval * __restrict)
#if defined(_DARWIN_C_SOURCE) || defined(_DARWIN_UNLIMITED_SELECT)
__DARWIN_EXTSN_C(select)
#else /* !_DARWIN_C_SOURCE && !_DARWIN_UNLIMITED_SELECT */
#  if defined(__LP64__) && !__DARWIN_NON_CANCELABLE
__DARWIN_1050(select)
#  else /* !__LP64__ || __DARWIN_NON_CANCELABLE */
__DARWIN_ALIAS_C(select)
#  endif /* __LP64__ && !__DARWIN_NON_CANCELABLE */
#endif /* _DARWIN_C_SOURCE || _DARWIN_UNLIMITED_SELECT */
;

#endif /* !_SYS__SELECT_H_ */


text:
class CreateMemberships < ActiveRecord::Migration[5.2]
  def change
    create_table :memberships do |t|
      t.belongs_to :user, foreign_key: true
      t.belongs_to :group, foreign_key: true
      t.string :status

      t.timestamps
    end
  end
end


text:
module Words
  module Frequencies
    class Ngram
      include Sampling
      attr_reader :order
      attr_accessor :gram_counts, :probabilities
      MAX_CHAIN_ORDER = 4

      def initialize(markov_order=2)
	raise "Ngram markov order too deep" unless markov_order <= MAX_CHAIN_ORDER
	@order = markov_order
	@gram_counts = {}
	@probabilities = {}

	@raw_counts = []
      end

      def gram_counts
	@gram_counts ||= {}
      end

      def aggregate_counts!(counts)
	# puts "--- aggregating counts"
	@gram_counts = counts.reduce({}) do |hsh,(k,v)|
	  hsh[k] ||= 0
	  hsh[k] = hsh[k] + v
	  hsh
	end
      end

      def process_groups(sentences)
	# puts "=== process text: #{sentences}"
	progress = ProgressBar.create(:title => "Process Text", :total => sentences.count)
	@raw_counts = Parallel.map(sentences, :in_processes => 32, :finish => lambda { |it,i,res| progress.increment }) do |line|
	  counts = []
	  words = line.is_a?(Array) ? line : line.split
	  words.each_cons(@order) { |v| counts << [v,1] }
	  counts
	end.flatten(1)

        process_counts(@raw_counts)
      end

      def process_counts(counts)
	raise 'no data to process' unless counts && !counts.empty?
	aggregate_counts!(counts)
	normalize!
	gram_counts.sort_by { |k,_| k[0...-1] }
      end

      def merge(other_ngram)
	gram_counts.merge!(other_ngram.gram_counts) { |k, v1, v2| v1 + v2 }
      end

      def counts_for_series(series)
	return [] unless @sequences_attested.include?(series)
	@counts_for_series ||={}
        @counts_for_series[series] ||= @gram_counts.select { |k,_| k[0...-1] == series }
      end

      def select_for_series(arr, series)
	Hash[ arr.select { |k,_| k[0...-1] == series } ]
      end

      def probabilities_for_series(series)
	@probabilities_for_series ||= {}
	@probabilities_for_series[series] ||= select_for_series(@probabilities, series).map { |k,v| k = k.last; [k,v] }
      end

      def get_options_for_series(series)
	@options_for_series ||= {}
	@options_for_series[series] ||= counts_for_series(series).keys.map(&:last)
      end

      def get_options_and_probabilities(series)
	Hash[
	  probabilities_for_series(series).map do |k,v|
	    [k.is_a?(Array) ? k.last : k, v]
	  end
	]
      end

      def sequences_attested
	raise 'no counts yet!' if @gram_counts.empty?
	@sequences_attested ||= @gram_counts.keys.map { |s| s[0...-1] }.sort.uniq
      end

      def normalize!
	progress = ProgressBar.create(:title => "Normalize", :total => sequences_attested.count)
	raw_probabilities = Parallel.map(sequences_attested, :in_processes => 32, :finish => lambda { |item, i, result| progress.increment }) do |series|
	  normalize_frequencies(counts_for_series(series))
	end

	# Parallel.each(raw_probabilities) { |k,v|
	#   @probabilities[k] ||= 0
	# }
	puts "--- done normalizing!"
	@probabilities = raw_probabilities.reduce(&:merge)
      end
    end
  end
end


text:
The Full taxon details visualisation (vis4)

    This visualisation is a fast way to explore the taxonomic
    knowledge-base for any given species. It displays
    all information including character state values, images and text
    files side-by-side for a species selected from a drop-down list.

    To use the visualisation, just select a taxon from taxon selection control (see below)
    and all information in the knowledge base for this taxon will
    be displayed on the right, including the character state values, images (if any referenced) and any
    other information in referenced HTML files. An example is shown below.

    You can  tailor the display to exclude any of these three types of information
    (character state values, images or text) by unchecking the relevant check-boxes
    (also visible in the image below).

Context menu

    The context menu for this tool has a single option - Get URL for full details view.
    Selecting this menu item builds a URL that can be used to reproduce the
    page as you have configured it. For example displaying the selected taxon
    and image. The context menu,  can be invoked by right-clicking the mouse with the
    cursor anywhere in this visualisation.


text:
CREATE TABLE priority_list (
	resource_id INTEGER CONSTRAINT priority_list_resource_id_nn NOT NULL,
	CONSTRAINT priority_list_pk PRIMARY KEY (resource_id),
	CONSTRAINT priority_list_resource_fk FOREIGN KEY (resource_id) REFERENCES "resource" (id)
);

CREATE TABLE member_priority (
	priority_list_id INTEGER CONSTRAINT member_priority_pl_id_nn NOT NULL,
	member_id INTEGER CONSTRAINT member_priority_member_id_nn NOT NULL,
	priority INTEGER CONSTRAINT member_priority_priority_nn NOT NULL,
	creation_date DATE CONSTRAINT member_priority_cr_date_nn NOT NULL,
	CONSTRAINT member_priority_member_fk FOREIGN KEY (member_id) REFERENCES host_cluster_member (host_id) ON DELETE CASCADE,
	CONSTRAINT member_priority_pk PRIMARY KEY (priority_list_id, member_id),
	CONSTRAINT member_priority_pl_fk FOREIGN KEY (priority_list_id) REFERENCES priority_list (resource_id) ON DELETE CASCADE
);

CREATE INDEX member_priority_member_idx ON member_priority (member_id);

QUIT;


text:
#import <Foundation/Foundation.h>
#import "ASPObject.h"

/**
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen
 * Do not edit the class manually.
 */

#import "ASPLink.h"
#import "ASPLinkElement.h"

@protocol ASPComments
@end

@interface ASPComments : ASPObject

@property(nonatomic) NSArray<ASPLinkElement>* commentList;

@property(nonatomic) ASPLink* link;

@end


text:
module Conject
  class ClassFinder
    def find_class(name)
      cname = Utilities.camelize(name.to_s)
      cname_components = cname.split("::")
      dig_for_class Object, cname_components
    end

    def get_module_path(klass)
      cname = klass.name
      return nil unless cname =~ /::/
      cname_components = cname.split("::")
      cname_components.pop
      Utilities.underscore(cname_components.join("::"))
    end

    private

    def dig_for_class(within, steps)
      a = steps.shift
      const = get_constant(within, a)
      if steps.nil? or steps.empty?
        const
      else
        dig_for_class(const, steps)
      end
    end

    def get_constant(within, name)
      if within.const_defined?(name, false)
        within.const_get(name, false)
      else
        raise "Could not find class or module named #{name} within #{within}"
      end
    end

  end
end


text: fix #Issue number


text:
import Test.Framework (defaultMain, testGroup)
import Test.Framework.Providers.HUnit
import Test.HUnit
import MarkdownParser
import ParseUtil
import Html
main :: IO ()
main = defaultMain tests

tests = [
  testGroup "Parse links" [
      testCase "parseLinkTest" parseLinkTest
      ],
  testGroup "Parse headers" [
      testCase "parseHeaderTest" parseHeaderTest,
      testCase "parseCorrectHeaderOrdinal" parseCorrectHeaderOrdinalTest
      ],
  testGroup "Parse Images" [
      testCase "parseImageTest" parseImageTest
      ],
  testGroup "Parse unordered lists" [
      testCase "parseUnorderedListTest" parseUnorderedListTest
      ],
  testGroup "Parse paragraphs" [
      testCase "parseParagraphTest" parseParagraphTest,
      testCase "parseParagraphWithBreakTest" parseParagraphWithBreakTest
      ],
  testGroup "Parse block elements with inline elements inside" [
      testCase "parseHeaderWithLinkTest" parseHeaderWithLinkTest,
      testCase "parseUnorderedListWithLinksTest" parseUnorderedListWithLinksTest,
      testCase "parseParagraphWithLinkTest" parseParagraphWithLinkTest
      ]
  ]

parseLinkTest = ( assertEqual "Parse valid link"
                  ( "
Google
" )
                  ( parseAndRenderHtml parseMarkdown "[Google](https://google.com)" ))

parseHeaderTest = ( assertEqual "Parse valid header"
                    ( "
header
" )
                    ( parseAndRenderHtml parseHeader "# header" ))

parseCorrectHeaderOrdinalTest = ( assertEqual "Parse correct header ordinal"
                                  ( "
header
" )
                                  ( parseAndRenderHtml parseHeader "### header" ))

parseImageTest = ( assertEqual "Parse image"
                   ( "")
                   ( parseAndRenderHtml parseImage "![image](https://my.image.com)" ))

parseUnorderedListTest = ( assertEqual "Parse unordered list"
                           ( "

First

Second

")
                           ( parseAndRenderHtml parseUnorderedList
                             "* First\n* Second"))

parseParagraphTest = ( assertEqual "Parse paragraph"
                       ("
This is some great content
")
                       ( parseAndRenderHtml parseParagraph
                         "This is some great content"))

parseParagraphWithBreakTest = ( assertEqual "Parse paragraph with break"
                                ("
Some stuff
and more stuff
")
                                (parseAndRenderHtml parseParagraph
                                 "Some stuff\nand more stuff"))

parseHeaderWithLinkTest = ( assertEqual "Parse Header with link"
                            ( "
Google
")
                            ( parseAndRenderHtml parseMarkdown
                              "# [Google](https://google.com)"))

parseUnorderedListWithLinksTest = ( assertEqual "Parse unordered list with links"
                                    ( "

Google

Other content

")
                                    ( parseAndRenderHtml parseMarkdown
                                      "* [Google](https://clample.com)\n* Other content"))

parseParagraphWithLinkTest = ( assertEqual "Parse paragraph with link"
                               ("
Check out the website Google and click
")
                               ( parseAndRenderHtml parseMarkdown
                                 "Check out the website [Google](https://google.com) and click"))


text:
With this package I am testing scikit-learn for text classification.

I am using a toy problem: tryng to predict JUFO rank based on journal title.

JUFO ranking data is taken from here http://www.tsv.fi/julkaisufoorumi/english.html .


text:
require 'bundler/setup'
Bundler.require :default

require './lib/helpers'
require './lib/core_ext'
require './lib/facebook'

DatabaseAuth = YAML::load(File.read(File.join(File.dirname(__FILE__), '..', 'config', 'database.yml')))

ActiveRecord::Base.configurations = DatabaseAuth
ActiveRecord::Base.logger = Logger.new(File.join('log', 'database.log'))
ActiveRecord::Base.establish_connection ENV['RACK_ENV']

require './lib/wars/wars'


text:
/**
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.deephacks.westty.internal.core;

import com.google.common.base.Stopwatch;
import com.google.common.base.Strings;
import org.deephacks.confit.ConfigContext;
import org.deephacks.westty.application.ApplicationShutdownEvent;
import org.deephacks.westty.application.ApplicationStartupEvent;
import org.deephacks.westty.config.ServerConfig;
import org.deephacks.westty.server.ServerName;
import org.deephacks.westty.spi.ProviderShutdownEvent;
import org.deephacks.westty.spi.ProviderStartupEvent;
import org.jboss.weld.environment.se.Weld;
import org.jboss.weld.environment.se.WeldContainer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.enterprise.event.Event;
import javax.enterprise.inject.Produces;
import javax.inject.Inject;
import javax.inject.Singleton;
import java.io.File;

/**
 * Main class for starting and stopping Westty.
 */
public class WesttyCore {
    public static final String APPLICATION_CONF_PROP = "application.conf";
    public static final String APPLICATION_CONF = System.getProperty(APPLICATION_CONF_PROP);
    private static final Logger log = LoggerFactory.getLogger(WesttyCore.class);
    private WeldContainer container;
    private Weld weld;
    private WesttyEngine engine;
    private static ServerName SERVER_NAME = new ServerName(ServerConfig.DEFAULT_SERVER_NAME);

    public void startup() {
        log.info("Westty startup.");
        try {
            Stopwatch time = new Stopwatch().start();
            if (!Strings.isNullOrEmpty(APPLICATION_CONF)) {
                File conf = new File(APPLICATION_CONF);
                if (conf.exists()) {
                    System.setProperty(APPLICATION_CONF_PROP, conf.getAbsolutePath());
                }
            }
            weld = new Weld();
            container = weld.initialize();
            log.info("Weld started.");

            engine = container.instance().select(WesttyEngine.class).get();
            engine.start();
            ShutdownHook.install(new Thread("WesttyShutdownHook") {
                @Override
                public void run() {
                    shutdown();
                }
            });
            log.info("Westty started in {} ms.", time.elapsedMillis());
        } catch (Exception e) {
            log.error("Exception during startup", e);
            shutdown();
            throw new RuntimeException(e);
        }
    }

    public void setServerName(String name){
        SERVER_NAME = new ServerName(name);
    }

    @Produces
    @Singleton
    public ServerName produceServerName(){
        return SERVER_NAME;
    }

    public void shutdown() {
        if (engine != null) {
            engine.shutdown();
        }
        log.info("Westty shutdown.");
    }

    public Object getInstance(Class<?> cls) {
        return container.instance().select(cls).get();
    }

    @Singleton
    private static class WesttyEngine {
        @Inject
        private ConfigContext config;

        @Inject
        private Event<ApplicationStartupEvent> applicationStartupEvent;

        @Inject
        private Event<ApplicationShutdownEvent> applicationShutdownEvent;

        @Inject
        private Event<ProviderStartupEvent> providerStartupEvent;

        @Inject
        private Event<ProviderShutdownEvent> providerShutdownEvent;

        public void start() {
            providerStartupEvent.fire(new ProviderStartupEvent());
            applicationStartupEvent.fire(new ApplicationStartupEvent());
        }

        public void shutdown() {
            applicationShutdownEvent.fire(new ApplicationShutdownEvent());
            providerShutdownEvent.fire(new ProviderShutdownEvent());
        }
    }
}