text:
$(document).ready(function(){
/* ========= General use functions ============ */

// Replace content with status message - loading, fetching, etc.
// input -> element id, message, status
// output -> none, DOM manipulation

function status_generator(id,message,status){
	var in_class='alert ';
	var icon='fa ';
	if(status=="blue"){
		in_class+='alert-info';
		icon+='fa-info-circle'
	}
	else if(status=="loading"){
		in_class+='alert-loading';
		icon+='fa-spin fa-spinner';
	}
	else if(status=="green"){
		in_class+='alert-success';
		icon+='fa-check-circle';
	}
	else if(status=="red"){
		in_class+='alert-danger';
		icon+='fa-exclamation-circle';
	}

	var out_message='
  '+message+'
';
	$('#'+id).html(out_message);
	return true;
}

// Returns a list of errors in

// Input -> error JSON object
// Output ->

 holding each error as a

function error_list(error_data){
	var error_li = '';
	// loop through error JSON object
	$.each(error_data,function(i, item){
		error_li += "
"+error_data[i]+"
";
	});

	var error_ul = '
'+error_li+'
';

	return error_ul;
}

// Registration form field adder - general function
// element -> element to insert after
// input -> content to replicate
function field_replacer(element, classname, placeholder){
	var input = '<input type="text" class="form-control '+classname+'" name="'+element+ '[]" placeholder="'+placeholder+'">';
	$('#'+element+'-inline-block').append(input);

}

/* ============ End of general functions ==============   */

/* ============ Registration page - register.php ============ */

// If "Add another" is clicked
$('.add-reg-current-condition').click(function(event){
	field_replacer('reg-current-condition','additional-inputs','Current condition');
	event.preventDefault();
});
$('.add-reg-current-medication').click(function(event){
	field_replacer('reg-current-medication','additional-inputs','Current medication');
	event.preventDefault();
});
$('.add-reg-past-condition').click(function(event){
	field_replacer('reg-past-condition','additional-inputs','Past condition');
	event.preventDefault();
});

// on registration form submit
$('#registration-form').submit(function(event){
	event.preventDefault();

	// Used to repopulate buttons on form failure
	var old_html = $('#registration-button').html();

  	function reg_form_validate(){
  		// email validation & password validation
  		var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
  		var email = $('#reg-email').val();
  		var pass = $('#reg-password').val();
  		var pass_repeat = $('#reg-password-repeat').val();
  		if((regex.test(email) && ( pass == pass_repeat ))){
  			return true;
  		}
  		else{
  			if(!regex.test(email)){
  				status_generator('registration-button','Invalid email specified','red');
  				setTimeout(function(){
  					$('#registration-button').html(old_html);
  				},3000);
  				return false;
  			}
  			else{
  				status_generator('registration-button','Passwords don\'t match!','red');
  				setTimeout(function(){
  					$('#registration-button').html(old_html);
  				},3000);
  				return false;
  			}
  		}
  	}//end of reg_form_validate()

  	// if form fields valid, then
  	if(reg_form_validate()){
  		var data = $(this).serializeJSON();
  		status_generator('registration-button','Working ....','loading');

		$.ajax({
		    type: 'post',
		    url: 'api.php?action=register',
		    // convert data to string and replace - with _ in that string
		    data: {"data":JSON.stringify(data).replace(/-/g, '_')},
		    success: function (return_data) {
		      var return_data = jQuery.parseJSON(return_data);
		      if(return_data.success == "yes"){
		          status_generator('registration-button','Registration successful. You will be redirected momentarily.','green');
				      setTimeout(function(){
				      	  window.location.href="/index.php";
				      },3000);
		      }
		      else{
		      	var error_ul = error_list(return_data.errors);
		      	status_generator('registration-button', 'Registration failed with the following errors:'+error_ul,'red');
		      	setTimeout(function(){
  					$('#registration-button').html(old_html);
  				},5000);
		      }

		    },
		    failure: function(return_data){
		    	console.log(return_data);
		    	status_generator('registration-button','Registration failed. Could not complete the AJAX request','red');
		    	setTimeout(function(){
  					$('#registration-button').html(old_html);
  				},5000);
		    }
		});	//end of AJAX
  	} //end of if(reg_form_validate())
}); // end of $registration_form.submit()

/* ===================== End of registration.php ============================= */

/* ===================== index.php =================== */
$('#login-form').submit(function(event){
	event.preventDefault();
	var old_html = $('#login-button').html();

	var data = $(this).serializeJSON();
	status_generator('login-button','Logging in....','loading');

	$.ajax({
	    type: 'post',
	    url: 'api.php?action=login',
	    // convert data to string and replace - with _ in that string
	    data: {"data":JSON.stringify(data).replace(/-/g, '_')},
	    success: function (return_data) {
	      var return_data = jQuery.parseJSON(return_data);
	      if(return_data.success == "yes"){
	          status_generator('login-button','Login successful. You will be redirected momentarily.','green');
		      setTimeout(function(){
		      	  window.location.href="/entry.php";
		      },2000);
	      }
	      else{
	      	var error_ul = error_list(return_data.errors);
	      	status_generator('login-button', 'Login failed with the following errors:'+error_ul,'red');
	      	setTimeout(function(){
					$('#login-button').html(old_html);
				},5000);
	      }
	    },
	    failure: function(return_data){
	    	console.log(return_data);
	    	status_generator('login-button','Login failed. Could not complete the AJAX request','red');
	    	setTimeout(function(){
				$('#login-button').html(old_html);
			},5000);
	    }
	});// end of AJAX
}); // end of login_form submit

/* ========= end of index.php ========== */

/* ========= entry.php ========== */

// datetimepicker

$('.entry-date-picker').datetimepicker({
	pickTime: false
});

$('.entry-time-picker').datetimepicker({
	pickDate: false,
});

// general add another fields function
function add_entry_fields(el_id){
	$('#add-'+el_id).click(function(event){
		var old_html = $('#'+el_id+'-inline-single-block').html();
		$('#'+el_id+'-inline-block').append(old_html);
		event.preventDefault();
	});
}

// add another fields
add_entry_fields('entry-time');
add_entry_fields('entry-food');
add_entry_fields('entry-alcohol');
add_entry_fields('entry-drugs');

// generic slider function
function slider_init_outval(el_id){
	$('#'+el_id+'-slider').slider();
	$('#'+el_id+'-slider').on('slide',function(slideEvt){
		$('#'+el_id+'-slider-val').text(slideEvt.value);
	});
}

//sliders
slider_init_outval('entry-intensity');
slider_init_outval('entry-stress-physical');
slider_init_outval('entry-stress-mental');
slider_init_outval('entry-alcohol-level');

//Weather button pressed
$('#entry-weather-button').click(function(event){
	event.preventDefault();
	var woeid = $('#entry-weather-button').data('woeid');
	var old_html = $('#entry-weather-btn-wrapper').html();
	$.simpleWeather({
		woeid: woeid,
		unit: 'c',
		success: function(weather){
			var max_temp = weather.high;
			var min_temp = weather.low;
			var heat_index = weather.heatindex;
			var humidity = weather.humidity;
			var condition = weather.text;

			$('#entry-weather-max').val(max_temp);
			$('#entry-weather-min').val(min_temp);
			$('#entry-weather-heatindex').val(heat_index);
			$('#entry-weather-humidity').val(humidity);
			$('#entry-weather-condition').val(condition);

			status_generator('entry-weather-btn-wrapper','Data successfully fetched and entered','green');
		},
		error: function(error){
			status_generator('entry-weather-btn-wrapper',error['message'],'red');
	    	setTimeout(function(){
				$('#entry-weather-btn-wrapper').html(old_html);
			},5000);
		}
	});
});

//Entry form submit
$('#entry-form').submit(function(event){
	event.preventDefault();
	var old_html = $('#entry-button').html();

	var data = $(this).serializeJSON();
	status_generator('entry-button','Storing the entry....','loading');

	$.ajax({
	    type: 'post',
	    url: 'api.php?action=entry',
	    // convert data to string and replace - with _ in that string
	    data: {"data":JSON.stringify(data).replace(/-/g, '_')},
	    success: function (return_data) {
	      var return_data = jQuery.parseJSON(return_data);
	      if(return_data.success == "yes"){
	          status_generator('entry-button','Entry successfully stored in the Database. You will be redirected momentarily to the Reports page.','green');
		      setTimeout(function(){
		      	  window.location.href="/report.php";
		      },2000);
	      }
	      else{
	      	var error_ul = error_list(return_data.errors);
	      	status_generator('entry-button', 'Storing the entry failed with the following errors:'+error_ul,'red');
	      	setTimeout(function(){
					$('#entry-button').html(old_html);
				},5000);
	      }
	    },
	    failure: function(return_data){
	    	console.log(return_data);
	    	status_generator('entry-button','Storing the entry failed. Could not complete the AJAX request','red');
	    	setTimeout(function(){
				$('#entry-button').html(old_html);
			},5000);
	    }
	});// end of AJAX
}); // end of entry_form submit
/* ========= end of entry.php ========== */

/* ========= report.php ===========*/

$('.report-date-picker').datetimepicker({
	pickTime: false
});

$('#tab-header a').click(function(e){
	e.preventDefault();
	$(this).tab('show');
});
$('#tab-header a').tab('show');

function table_parse(data){
	$('#table-dump-header-row').html("");

	var thead = data.header;
	$.each(thead, function(key, value){
		var temp_th = ''+value+'	';
		$(temp_th).appendTo('#table-dump-header-row');
	});
	var tbody = data.tbody;
	$.each(tbody, function(i, doc){
		var rowspan = doc.times_length;
		$('
').appendTo('#table-dump-body');
		$.each(doc, function(key, value){
			if(key != "start_time" && key != "end_time" && key != "duration" && key != "times_length"){
				if(value == "" || !value){
					value = "none";
				}
				var temp_td = ''+value+'	';
				$(temp_td).appendTo('.row-'+i);
			}
			if(key == "start_time" || key == "end_time" || key == "duration"){
				var temp_td = ''+value+'	';
				$(temp_td).appendTo('.row-'+i);
			}
		});
		$('
').appendTo('#table-dump-body');
	});
}

function freq_table_parse(data, selector_id){
	var html_string;
	$.each(data, function(k,v){
		html_string += "
"+k.replace(/_/g, ' ')+"	"+v+"
";
	});
	$('#'+selector_id).html(html_string);
}

function date_table_parse(data, date_array, total_entries, selector_id){
	var html_string;
	var i=0;
	while(i < total_entries){
		if(typeof data[i] == 'undefined'){ data[i] = 0;}
		html_string += "
"+date_array[i]+"	"+data[i]+"
";
		i++;
	}
	$('#'+selector_id).html(html_string);
}

function stats_parse(data){
	var stats = data.stats;
	var total_entries = data.stats.total_entries;
	var date_array = data.stats.dates
	$.each(stats, function(k,v){
		if(k == "start_date"){
			$('#template-start-date').text(v);
		}
		if(k == "end_date"){
			$('#template-end-date').text(v);
		}
		if(k == "total_entries"){
			$('#template-total-entries').text(v);
		}
		if(k == "freqtable_start_time"){
			freq_table_parse(v,'tbody-top-hours');
		}
		if(k == "top_hours"){
			$('#template-top-hours').text(v);
		}
		if(k == "avg_pain_duration"){
			$('#template-avg-pain-duration').text(v);
		}
		if(k == "top_pains"){
			$('#template-top-pains').text(v);
		}
		if(k == "freqtable_pain"){
			freq_table_parse(v,'tbody-top-pains');
		}
		if(k == "avg_pain_level"){
			$('#template-avg-pain-level').text(v);
		}
		if(k == "datetable_pain_level"){
			date_table_parse(v, date_array, total_entries, 'tbody-date-pain-level');
		}
		if(k == "top_symptoms_before"){
			$('#template-top-symptoms-before').text(v);
		}
		if(k == "freqtable_symptoms_before"){
			freq_table_parse(v, 'tbody-top-symptoms-before');
		}
		if(k == "top_symptoms_during"){
			$('#template-top-symptoms-during').text(v);
		}
		if(k == "freqtable_symptoms_during"){
			freq_table_parse(v, 'tbody-top-symptoms-during');
		}
		if(k == "top_symptoms_after"){
			$('#template-top-symptoms-after').text(v);
		}
		if(k == "freqtable_symptoms_after"){
			freq_table_parse(v, 'tbody-top-symptoms-after');
		}
		if(k == "top_food"){
			$('#template-top-food').text(v);
		}
		if(k == "freqtable_food"){
			freq_table_parse(v, 'tbody-top-food');
		}
		if(k == "avg_water_glasses"){
			$('#template-avg-water-glasses').text(v);
		}
		if(k == "water_chilled_pcnt"){
			$('#template-avg-water-chilled').text(v);
		}
		if(k == "datetable_water_glasses"){
			date_table_parse(v, date_array, total_entries, 'tbody-top-date-water-glasses');
		}
		if(k == "yesno_water_chilled"){
			freq_table_parse(v, 'tbody-water-chilled');
		}
		if(k == "avg_sleep_hours"){
			$('#template-avg-sleep-hours').text(v);
		}
		if(k == "avg_screen_hours"){
			$('#template-avg-screen-hours').text(v);
		}
		if(k == "datetable_sleep_hours"){
			date_table_parse(v, date_array, total_entries, 'tbody-date-sleep-hours');
		}
		if(k == "datetable_screen_hours"){
			date_table_parse(v, date_array, total_entries, 'tbody-date-screen-hours');
		}
		if(k == "avg_stress_physical"){
			$('#template-avg-stress-physical').text(v);
		}
		if(k == "avg_stress_mental"){
			$('#template-avg-stress-mental').text(v);
		}
		if(k == "datetable_stress_physical"){
			date_table_parse(v, date_array, total_entries, 'tbody-date-stress-physical');
		}
		if(k == "datetable_stress_mental"){
			date_table_parse(v, date_array, total_entries, 'tbody-date-stress-mental');
		}
		if(k == "avg_weather_max"){
			$('#template-avg-weather-max').text(v);
		}
		if(k == "avg_weather_min"){
			$('#template-avg-weather-min').text(v);
		}
		if(k == "avg_weather_humidity_pcnt"){
			$('#template-avg-weather-humidity-pcnt').text(v);
		}
		if(k == "avg_weather_heatindex"){
			$('#template-avg-weather-heatindex').text(v);
		}
		if(k == "weather_condition"){
			$('#template-top-weather-condition').text(v);
		}
		if(k == "datetable_weather"){
			var j = 0;
			var html_string;
			$.each(stats[k], function(i, item){
				html_string += "
"+date_array[j]+"	";
				$.each(item, function(x, xval){
					html_string += ""+xval+"	"
				})
				html_string += "
";
				j++;
			});
			$('#tbody-date-weather').html(html_string);
		}
		if(k == "top_alcohol_drinks"){
			$('#template-top-alcoholic-drinks').text(v);
		}
		if(k == "avg_alcohol_drunklevel"){
			$('#template-avg-alcohol-drunklevel').text(v);
		}
		if(k == "freqtable_alcohol_drinks"){
			freq_table_parse(v, 'tbody-alcohol-drinks');
		}
		if(k == "datetable_alcohol_drunklevel"){
			date_table_parse(v, date_array, total_entries, 'tbody-alcohol-drunklevel');
		}
		if(k == "avg_smoke_count"){
			$('#template-avg-smoke-count').text(v);
		}
		if(k == "datetable_smoke_count"){
			date_table_parse(v, date_array, total_entries, 'tbody-smoke-count');
		}
		if(k == "top_drugs"){
			$('#template-top-drugs').text(v);
		}
		if(k == "freqtable_drugs"){
			freq_table_parse(v, 'tbody-drugs');
		}
		if(k == "menstruation_pcnt"){
			$('#template-menstruation').text(v);
		}
		if(k == "yesno_menstruation"){
			freq_table_parse(v, 'tbody-menstruation');
		}
	});
	$('.date-table').tablesorter({sortList: [[0,0]], dateFormat: 'yyyymmdd'});
	$('table.highchart').highchartTable();

}

// Report dates form submission
$('#report-form').submit(function(event){
	event.preventDefault();
	var old_html = $('#report-button').html();

	var data = $(this).serializeJSON();
	status_generator('report-button','Generating report....','loading');

	$.ajax({
	    type: 'post',
	    url: 'api.php?action=report',
	    // convert data to string and replace - with _ in that string
	    data: {"data":JSON.stringify(data).replace(/-/g, '_')},
	    success: function (return_data) {
	      var return_data = jQuery.parseJSON(return_data);
	      if(return_data.success == "yes"){
	          $('#report-button').html(old_html);

	          table_parse(return_data);
	          stats_parse(return_data);
	      }
	      else{
	      	var error_ul = error_list(return_data.errors);
	      	status_generator('report-button', 'Report generation failed with the following errors:'+error_ul,'red');
	      	setTimeout(function(){
					$('#report-button').html(old_html);
				},5000);
	      }
	    },
	    failure: function(return_data){
	    	console.log(return_data);
	    	status_generator('report-button','Report generation failed. Could not complete the AJAX request','red');
	    	setTimeout(function(){
				$('#report-button').html(old_html);
			},5000);
	    }
	});// end of AJAX
}); // end of entry_form submit

/* ========= end of report.php ========== */
/* ========= settings.php ========== */
$('#settings-password-form').submit(function(event){
	event.preventDefault();
	var old_html = $('#settings-password-form-button').html();
	var new_pwd = $('#new-pwd').val();
	var repeat_pwd = $('#repeat-pwd').val();
	if(new_pwd != repeat_pwd){
		status_generator('settings-password-form-button', 'New password and repeated password don\'t match','red');
      	setTimeout(function(){
				$('#settings-password-form-button').html(old_html);
		},5000);
	}
	var data = $(this).serializeJSON();
	status_generator('settings-password-form-button','Updating password....','loading');
	$.ajax({
	    type: 'post',
	    url: 'api.php?action=settings',
	    // convert data to string and replace - with _ in that string
	    data: {"data":JSON.stringify(data).replace(/-/g, '_')},
	    success: function (return_data) {
	      var return_data = jQuery.parseJSON(return_data);
	      if(return_data.success == "yes"){
	          status_generator('settings-password-form-button','Password updated.','green');
		      setTimeout(function(){
		      	  $('#settings-password-form-button').html(old_html);
		      },3000);
	      }
	      else{
	      	var error_ul = error_list(return_data.errors);
	      	status_generator('settings-password-form-button', 'Password update failed with the following errors:'+error_ul,'red');
	      	setTimeout(function(){
					$('#settings-password-form-button').html(old_html);
				},5000);
	      }
	    },
	    failure: function(return_data){
	    	console.log(return_data);
	    	status_generator('settings-password-form-button','Password update failed. Could not complete the AJAX request','red');
	    	setTimeout(function(){
					$('#settings-password-form-button').html(old_html);
				},5000);
	    }
	});	//end of AJAX

}); // end of #settings-password-form-button.submit()

/* =========== end of settings.php ============ */
});


text:
@**
* Yobi, Project Hosting SW
*
* Copyright 2013 NAVER Corp.
* http://yobi.io
*
* @Author Jihan Kim
*
* 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.
**@
@(project:Project)

@import utils.TemplateHelper._
@import scala.collection.mutable._

<link rel="stylesheet" href="@routes.IssueLabelApp.labelStyles(project.owner, project.name)" type="text/css" />

@IssueLabel.findByProject(project).groupBy(_.category).map {
    case (category, labels) => {

@category

            @labels.map { label =>

                        label.id.toString))">

                            @label.name

                        @countOpenIssuesBy(project, Map("labelIds"->label.id.toString))

            }

    }
}

redpajama_set_name: RedPajamaGithub


text:
package Model;
// Generated Jan 14, 2011 3:39:55 PM by Hibernate Tools 3.2.1.GA

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * EmpSubdivisionHistory generated by hbm2java
 */
@Entity
@Table(name="emp_subdivision_history"
    ,catalog="ashrm"
)
public class EmpSubdivisionHistory  implements java.io.Serializable {

     private Integer id;
     private Employee employee;
     private String code;
     private String name;
     private Date startDate;
     private Date endDate;

    public EmpSubdivisionHistory() {
    }

    public EmpSubdivisionHistory(Employee employee, String code) {
        this.employee = employee;
        this.code = code;
    }
    public EmpSubdivisionHistory(Employee employee, String code, String name, Date startDate, Date endDate) {
       this.employee = employee;
       this.code = code;
       this.name = name;
       this.startDate = startDate;
       this.endDate = endDate;
    }

     @Id @GeneratedValue(strategy=IDENTITY)

    @Column(name="id", unique=true, nullable=false)
    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="emp_number", nullable=false)
    public Employee getEmployee() {
        return this.employee;
    }

    public void setEmployee(Employee employee) {
        this.employee = employee;
    }

    @Column(name="code", nullable=false, length=15)
    public String getCode() {
        return this.code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Column(name="name", length=250)
    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="start_date", length=19)
    public Date getStartDate() {
        return this.startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="end_date", length=19)
    public Date getEndDate() {
        return this.endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

}


text:
package com.gilt.thehand

/**
 * The base trait to implement when defining new types of rules.
 */
trait Rule {
  /**
   * Implement this to determine whether a context matches a rule. Under the hood, this will likely match on various
   * context types, since matching can differ based on context, and a given rule might successfully match in more than
   * one context. The Option return type is leveraged by the 'extractor' pattern and as such implementers should return
   * None when rules do not match the context.
   *
   * @param context The context on which we are attempting to match the rule; can be any type of context.
   * @return None for no match; Some(context) if the rule matches the context.
   */
  def unapply(context: AbstractContext): Option[AbstractContext]

  /**
   * A convenience method to be used to see if a rule matches a context.
   * @param context The context in which the rule attempts to match or not match.
   * @return Boolean: true if the rule matches the context; false if not.
   */
  def matches(context: AbstractContext): Boolean = unapply(context).isDefined
}


text:
const fs = require('fs');
const path = require('path');

exports.plugin = {};
exports.plugin.register = async function (server, options) {
	server.path(__dirname);

	server.route({
		path: '/',
		method: '*',
		handler: function (request, reply) {
			return reply.redirect('/public');
		}
	});

	server.route({
		path: '/public/{path*}',
		method: 'GET',
		config: {
			handler: {
				directory: { path: './clusterpost-public/build', listing: false, index: true }
			},
			description: 'This route serves the static website of clusterpost.'
		}
	});

};

exports.plugin.pkg = require('./package.json');


text:
<?xml version='1.0' encoding='utf-8'?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 <modelVersion>4.0.0</modelVersion>

 <groupId>com.github.drinkjava2</groupId>
 <artifactId>jdialects</artifactId>
 <version>5.0.13.jre8</version>
 <packaging>jar</packaging>

 <name>jdialects</name>
 <description>jDialects is a pagination and DDL tool support ~80 databases, run on JDK8 or above</description>
 <url>https://github.com/drinkjava2/jDialects</url>

 <issueManagement>
    <system>Github Issue</system>
    <url>https://github.com/drinkjava2/jDialects/issues</url>
 </issueManagement>

 <licenses>
   <license>
     <name>The Apache Software License, Version 2.0</name>
     <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
   </license>
 </licenses>

 <developers>
   <developer>
     <name>Yong Zhu</name>
     <email>yong9981@gmail.com</email>
     <url>https://github.com/drinkjava2/</url>
   </developer>
 </developers>

 <scm>
   <connection>scm:git@github.com:drinkjava2/jDialects.git</connection>
   <developerConnection>scm:git@github.com:drinkjava2/jDialects.git</developerConnection>
   <url>git@github.com:drinkjava2/jDialects.git</url>
 </scm>

    <properties>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.encoding>UTF-8</maven.compiler.encoding>
	<!-- Release on JDK1.8 -->
        <version.java>1.8</version.java>
        <version.javadoc>8</version.javadoc>
        <version.compiler-plugin>3.3</version.compiler-plugin>
        <version.war-plugin>2.6</version.war-plugin>
        <version.clean-plugin>3.0.0</version.clean-plugin>
        <version.resources-plugin>2.7</version.resources-plugin>
        <version.surefire-plugin>2.19</version.surefire-plugin>
        <version.jar-plugin>2.6</version.jar-plugin>
        <version.source-plugin>2.4</version.source-plugin>
        <version.javadoc-plugin>2.10.3</version.javadoc-plugin>
        <version.gpg-plugin>1.6</version.gpg-plugin>
    </properties>

 <dependencies>

    <!-- jDialects has no any 3rd party dependency -->

    <!-- ============================================================================= -->
    <!-- Below dependencies are for unit test only, scope set to "test"                -->
    <!-- ============================================================================= -->

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.1</version>
      <scope>test</scope>
    </dependency>

   <!-- HikariCP is a dataSource pool quicker than c3p0 -->
    <!--dependency>
        <groupId>com.zaxxer</groupId>
        <artifactId>HikariCP-java6</artifactId>
        <version>2.3.13</version>
	<scope>test</scope>
    </dependency-->

    <!-- H2Database memory database for unit test -->
    <!--dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <version>1.3.176</version>
      <scope>test</scope>
    </dependency-->

    <!-- MySql Database driver for unit test -->
    <!--dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>8.0.16</version>
        <scope>test</scope>
    </dependency-->

    <!-- MS-SQLServer JDBC driver for unit test -->
    <!--dependency>
      <groupId>com.microsoft.sqlserver</groupId>
      <artifactId>mssql-jdbc</artifactId>
      <version>6.2.2.jre7</version>
      <scope>test</scope>
    </dependency-->

</dependencies>

 <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${version.compiler-plugin}</version>
                <configuration>
                    <source>${version.java}</source>
                    <target>${version.java}</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${version.jar-plugin}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>${version.war-plugin}</version>
                <configuration>
                 <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>${version.clean-plugin}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${version.resources-plugin}</version>
            </plugin>
			<!-- Surefire is a plugin for unit test-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${version.surefire-plugin}</version>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${version.source-plugin}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <attach>true</attach>
                            <encoding>UTF-8</encoding>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${version.javadoc-plugin}</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <links>
                                <link>http://docs.oracle.com/javase/${version.javadoc}/docs/api</link>
                            </links>
                                        <!-- Close doc check, for Java6 only -->
					<!--properties>
						<javadoc.opts>-Xdoclint:none</javadoc.opts>
					</properties-->

                                       <!-- Close doc check, for Java8 only -->
                                       <additionalparam>-Xdoclint:none</additionalparam>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${version.gpg-plugin}</version>
                        <executions>
                            <execution>
                                <phase>install</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <distributionManagement>
			   <!-- Release, if is offical verison, will release to centre lib, if is "-SNAPSHOT" version,
			        will release to sanpshot site, but they use same command:
					"mvn clean deploy -P release -Dgpg.passphrase=yourGPGpwd"
			   -->
              <snapshotRepository>
                 <id>oss</id>
                 <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
              </snapshotRepository>
              <repository>
                 <id>oss</id>
                 <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
              </repository>
           </distributionManagement>
        </profile>
    </profiles>

</project>


text:
import Gaffer
import GafferScene

class SceneContextVariables( Gaffer.ContextVariablesComputeNode ) :

	def __init__( self, name = "SceneContextVariables" ) :

		Gaffer.ContextVariablesComputeNode.__init__( self, name )
		self.setup( GafferScene.ScenePlug() )

GafferScene.SceneContextVariables = SceneContextVariables

class DeleteSceneContextVariables( Gaffer.DeleteContextVariablesComputeNode ) :

	def __init__( self, name = "DeleteSceneContextVariables" ) :

		Gaffer.DeleteContextVariablesComputeNode.__init__( self, name )
		self.setup( GafferScene.ScenePlug() )

GafferScene.DeleteSceneContextVariables = DeleteSceneContextVariables

class SceneTimeWarp( Gaffer.TimeWarpComputeNode ) :

	def __init__( self, name = "SceneTimeWarp" ) :

		Gaffer.TimeWarpComputeNode.__init__( self, name )
		self.setup( GafferScene.ScenePlug() )

GafferScene.SceneTimeWarp = SceneTimeWarp


text:
import React, { PropTypes, Component } from 'react'

import spinnerImage from './spinner.gif'

import {} from './Spinner.scss'

class Spinner extends Component {
  render () {
    return (

         {this.props.text}

    )
  }
}

Spinner.propTypes = {
  text: PropTypes.string
}

export default Spinner


text:
/**
 * Created by Administrator on 2016/3/14.
 */
'use strict';
let html = require('./html.coffee')
require('./css/grid.css')
import BaseModule from '../BaseModule'
class GridTree extends BaseModule {
    constructor(element={},creator,key){
        super();
        [this.element,this.creator,this.key] = [element,creator,key];
        this.configs = html.config
    }
    edit() {
        var $dom_edit = $(html.base);
        var obj = this;
        obj.title = "grid-tree";
        obj.$dom = $dom_edit;
        return obj;
    }
    //element 名字不能变
    view() {

        var [element,creator,key] = [this.element,this.creator,this.key];

        var obj = this.edit();
        obj.menu = false;
        obj.isView = true;

        creator.done(undefined,{
            key,element,self:this
        });
        return obj;
    }
}
module.exports = GridTree


text:
#include "third_party/blink/renderer/core/dom/text_link_colors.h"

#include "third_party/blink/renderer/core/css/css_color_value.h"
#include "third_party/blink/renderer/core/css/css_identifier_value.h"
#include "third_party/blink/renderer/core/css/css_light_dark_value_pair.h"
#include "third_party/blink/renderer/core/css/style_color.h"
#include "third_party/blink/renderer/core/layout/layout_theme.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"

namespace blink {

TextLinkColors::TextLinkColors() : text_color_(Color::kBlack) {
  ResetLinkColor();
  ResetVisitedLinkColor();
  ResetActiveLinkColor();
}

void TextLinkColors::ResetLinkColor() {
  link_color_ = Color(0, 0, 238);
}

void TextLinkColors::ResetVisitedLinkColor() {
  visited_link_color_ = Color(85, 26, 139);
}

void TextLinkColors::ResetActiveLinkColor() {
  active_link_color_ = Color(255, 0, 0);
}

Color TextLinkColors::ColorFromCSSValue(const CSSValue& value,
                                        Color current_color,
                                        WebColorScheme color_scheme,
                                        bool for_visited_link) const {
  if (auto* color_value = DynamicTo<cssvalue::CSSColorValue>(value))
    return color_value->Value();

  if (auto* pair = DynamicTo<CSSLightDarkValuePair>(value)) {
    const CSSValue& color_value =
        color_scheme == WebColorScheme::kLight ? pair->First() : pair->Second();
    return ColorFromCSSValue(color_value, current_color, color_scheme,
                             for_visited_link);
  }

  CSSValueID value_id = To<CSSIdentifierValue>(value).GetValueID();
  switch (value_id) {
    case CSSValueID::kInvalid:
      NOTREACHED();
      return Color();
    case CSSValueID::kInternalQuirkInherit:
      return TextColor();
    case CSSValueID::kWebkitLink:
      return for_visited_link ? VisitedLinkColor() : LinkColor();
    case CSSValueID::kWebkitActivelink:
      return ActiveLinkColor();
    case CSSValueID::kWebkitFocusRingColor:
      return LayoutTheme::GetTheme().FocusRingColor();
    case CSSValueID::kCurrentcolor:
      return current_color;
    default:
      return StyleColor::ColorFromKeyword(value_id, color_scheme);
  }
}

}  // namespace blink


text:
namespace PlayFOnline
{
    public partial class frmMain
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        public System.Windows.Forms.FlowLayoutPanel flowMenu;
        public System.Windows.Forms.Button btnInstall;
        public System.Windows.Forms.CheckBox chkShowOffline;
        public BrightIdeasSoftware.ObjectListView lstGames;
        public BrightIdeasSoftware.OLVColumn olvName;
        public BrightIdeasSoftware.OLVColumn olvPlayers;
        public BrightIdeasSoftware.OLVColumn olvColumn2;
        public BrightIdeasSoftware.OLVColumn olvColumn3;
        public BrightIdeasSoftware.OLVColumn olvColumn4;
        public BrightIdeasSoftware.OLVColumn olvColumn5;
        public BrightIdeasSoftware.OLVColumn olvInstallPath;
        public BrightIdeasSoftware.OLVColumn olvPing;
        public System.Windows.Forms.StatusStrip statusBar;
        public System.Windows.Forms.Button btnRefresh;
        public System.Windows.Forms.ToolStripStatusLabel statusBarLabel;
        public System.Windows.Forms.LinkLabel linkFoDev;
        public System.Windows.Forms.BindingSource frmMainBindingSource;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.flowMenu = new System.Windows.Forms.FlowLayoutPanel();
            this.btnInstall = new System.Windows.Forms.Button();
            this.chkShowOffline = new System.Windows.Forms.CheckBox();
            this.lstGames = new BrightIdeasSoftware.ObjectListView();
            this.olvName = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
            this.olvPlayers = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
            this.olvColumn2 = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
            this.olvColumn3 = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
            this.olvColumn4 = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
            this.olvPing = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
            this.olvInstallPath = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
            this.olvColumn5 = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
            this.statusBar = new System.Windows.Forms.StatusStrip();
            this.statusBarLabel = new System.Windows.Forms.ToolStripStatusLabel();
            this.btnRefresh = new System.Windows.Forms.Button();
            this.linkFoDev = new System.Windows.Forms.LinkLabel();
            this.chkPing = new System.Windows.Forms.CheckBox();
            this.frmMainBindingSource = new System.Windows.Forms.BindingSource(this.components);
            this.flowMenu.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.lstGames)).BeginInit();
            this.statusBar.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.frmMainBindingSource)).BeginInit();
            this.SuspendLayout();
            //
            // flowMenu
            //
            this.flowMenu.Controls.Add(this.btnInstall);
            this.flowMenu.Location = new System.Drawing.Point(5, 12);
            this.flowMenu.Name = "flowMenu";
            this.flowMenu.Size = new System.Drawing.Size(119, 389);
            this.flowMenu.TabIndex = 6;
            //
            // btnInstall
            //
            this.btnInstall.Enabled = false;
            this.btnInstall.Location = new System.Drawing.Point(3, 3);
            this.btnInstall.Name = "btnInstall";
            this.btnInstall.Size = new System.Drawing.Size(103, 28);
            this.btnInstall.TabIndex = 8;
            this.btnInstall.Text = "Install/Add";
            this.btnInstall.UseVisualStyleBackColor = true;
            //
            // chkShowOffline
            //
            this.chkShowOffline.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.chkShowOffline.AutoSize = true;
            this.chkShowOffline.Location = new System.Drawing.Point(715, 97);
            this.chkShowOffline.Name = "chkShowOffline";
            this.chkShowOffline.Size = new System.Drawing.Size(125, 17);
            this.chkShowOffline.TabIndex = 8;
            this.chkShowOffline.Text = "Show Offline Servers";
            this.chkShowOffline.UseVisualStyleBackColor = true;
            //
            // lstGames
            //
            this.lstGames.AllColumns.Add(this.olvName);
            this.lstGames.AllColumns.Add(this.olvPlayers);
            this.lstGames.AllColumns.Add(this.olvColumn2);
            this.lstGames.AllColumns.Add(this.olvColumn3);
            this.lstGames.AllColumns.Add(this.olvColumn4);
            this.lstGames.AllColumns.Add(this.olvPing);
            this.lstGames.AllColumns.Add(this.olvInstallPath);
            this.lstGames.AllColumns.Add(this.olvColumn5);
            this.lstGames.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.lstGames.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
            this.olvName,
            this.olvPlayers,
            this.olvColumn2,
            this.olvColumn3,
            this.olvColumn4,
            this.olvPing,
            this.olvInstallPath,
            this.olvColumn5});
            this.lstGames.Cursor = System.Windows.Forms.Cursors.Default;
            this.lstGames.FullRowSelect = true;
            this.lstGames.HasCollapsibleGroups = false;
            this.lstGames.Location = new System.Drawing.Point(130, 12);
            this.lstGames.Name = "lstGames";
            this.lstGames.ShowGroups = false;
            this.lstGames.Size = new System.Drawing.Size(579, 389);
            this.lstGames.TabIndex = 7;
            this.lstGames.UseCompatibleStateImageBehavior = false;
            this.lstGames.UseHyperlinks = true;
            this.lstGames.View = System.Windows.Forms.View.Details;
            //
            // olvName
            //
            this.olvName.AspectName = "Name";
            this.olvName.Text = "Name";
            this.olvName.Width = 100;
            //
            // olvPlayers
            //
            this.olvPlayers.AspectName = "Status";
            this.olvPlayers.Text = "Players";
            //
            // olvColumn2
            //
            this.olvColumn2.AspectName = "Website";
            this.olvColumn2.Hyperlink = true;
            this.olvColumn2.Text = "Website";
            this.olvColumn2.Width = 120;
            //
            // olvColumn3
            //
            this.olvColumn3.AspectName = "Host";
            this.olvColumn3.Text = "Host";
            this.olvColumn3.Width = 120;
            //
            // olvColumn4
            //
            this.olvColumn4.AspectName = "Port";
            this.olvColumn4.Text = "Port";
            //
            // olvPing
            //
            this.olvPing.AspectName = "Status.Latency";
            this.olvPing.Text = "Ping";
            //
            // olvInstallPath
            //
            this.olvInstallPath.AspectName = "InstallPath";
            this.olvInstallPath.Text = "Install Path";
            //
            // olvColumn5
            //
            this.olvColumn5.AspectName = "Source";
            this.olvColumn5.Hyperlink = true;
            this.olvColumn5.Text = "Source Code";
            //
            // statusBar
            //
            this.statusBar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.statusBarLabel});
            this.statusBar.Location = new System.Drawing.Point(0, 404);
            this.statusBar.Name = "statusBar";
            this.statusBar.Size = new System.Drawing.Size(836, 22);
            this.statusBar.TabIndex = 9;
            this.statusBar.Text = "statusStrip1";
            //
            // statusBarLabel
            //
            this.statusBarLabel.Name = "statusBarLabel";
            this.statusBarLabel.Size = new System.Drawing.Size(0, 17);
            //
            // btnRefresh
            //
            this.btnRefresh.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnRefresh.Location = new System.Drawing.Point(715, 35);
            this.btnRefresh.Name = "btnRefresh";
            this.btnRefresh.Size = new System.Drawing.Size(116, 33);
            this.btnRefresh.TabIndex = 10;
            this.btnRefresh.Text = "Update list";
            this.btnRefresh.UseVisualStyleBackColor = true;
            //
            // linkFoDev
            //
            this.linkFoDev.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.linkFoDev.AutoSize = true;
            this.linkFoDev.Location = new System.Drawing.Point(715, 12);
            this.linkFoDev.Name = "linkFoDev";
            this.linkFoDev.Size = new System.Drawing.Size(83, 13);
            this.linkFoDev.TabIndex = 14;
            this.linkFoDev.TabStop = true;
            this.linkFoDev.Text = "http://fodev.net";
            //
            // chkPing
            //
            this.chkPing.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.chkPing.AutoSize = true;
            this.chkPing.Location = new System.Drawing.Point(715, 74);
            this.chkPing.Name = "chkPing";
            this.chkPing.Size = new System.Drawing.Size(86, 17);
            this.chkPing.TabIndex = 15;
            this.chkPing.Text = "Ping Servers";
            this.chkPing.UseVisualStyleBackColor = true;
            //
            // frmMainBindingSource
            //
            this.frmMainBindingSource.DataSource = typeof(PlayFOnline.frmMain);
            //
            // frmMain
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(836, 426);
            this.Controls.Add(this.chkPing);
            this.Controls.Add(this.linkFoDev);
            this.Controls.Add(this.btnRefresh);
            this.Controls.Add(this.statusBar);
            this.Controls.Add(this.chkShowOffline);
            this.Controls.Add(this.lstGames);
            this.Controls.Add(this.flowMenu);
            this.MinimumSize = new System.Drawing.Size(460, 250);
            this.Name = "frmMain";
            this.Text = "Play FOnline [Version]";
            this.flowMenu.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.lstGames)).EndInit();
            this.statusBar.ResumeLayout(false);
            this.statusBar.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.frmMainBindingSource)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        public System.Windows.Forms.CheckBox chkPing;

    }
}


text:
using System.Collections.Generic;

namespace p06___BookLibraryModification
{
    public class Library
    {
        public string Name { get; set; }

        public List<Books> Books { get; set; }

    }
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
using System.Security;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Win32.SafeHandles;

namespace Microsoft.Identity.Client.Platforms.net45
{
    [SecurityCritical]
    internal sealed class SafeCertContextHandle : SafeHandleZeroOrMinusOneIsInvalid
    {
        private SafeCertContextHandle()
            : base(true)
        {
        }

        [DllImport("crypt32.dll")]
        [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
        [SuppressUnmanagedCodeSecurity]
        [return: MarshalAs(UnmanagedType.Bool)]
        private static extern bool CertFreeCertificateContext(IntPtr pCertContext);

        protected override bool ReleaseHandle()
        {
            return CertFreeCertificateContext(handle);
        }
    }
}


text:
Single Source Shortest Path
===========================

You can run ```make``` to create executables for each program or use the following commands below

The first argument to the executable specifies whether you want to read the graph from a file (1), or generate a synthetic one internally (0).

**Input Graph from a File**

To run with P number of threads
  ```./sssp 1 P <input_file>```

  It will then ask for the input file, enter:
  sample.txt
  OR any other file such as road networks from the SNAP datasets (e.g. roadNet-CA)
  https://snap.stanford.edu/data/#road

**Generate and Input using the Synthetic Graph Generator**

To run with P number of threads, N vertices, and DEG edges per vertex
  ```./sssp 0 P N DEG```

**Notes**

This version of sssp parallelizes the O(V^2) version of Dijkstra's Algorithm, given by Yen's Optimization.
Paper: J.Y.Yen, "An algorithm for finding shortest routes from all source nodes to a given destination in general networks", Quarterly of Applied Mathematics 01/1970.

SSSP has a parameter P_max that is specified by ```cuberoot(N)*3```, which represents the number of iterations for the outer loop.

The executable then outputs the time in seconds that the program took to run.

```sssp_outer.cc``` implemented a conventional parallelization of the bellman-ford algorithm. This is an iterative algorithm generally used in GPU implementations. ```sssp_outer_atomic.cc``` just replaces pthread_barriers with atomic barriers.


text:
#include "ComponentManager.hpp"

using namespace Module;

/**
 * Registers a component to a given extension.
 * @param ext The Extension to register the component to
 * @param componentType The type name of the component to register (i.e. PhysicsComponent, etc.)
 */
void ComponentManager::registerComponent(Extension* ext, const char* componentType)
{
	componentMap[hash(componentType)] = ext;
}

/**
 * Registers a new Extension. Automatically called by the Extension constructor
 * @param ext The new Extension to register.
 */
void ComponentManager::registerExtension(Extension* ext)
{
	extensions.push_back(ext);
}

/**
 * Initializes all of the extensions added to the game. This will call each extension's
 * component registration, callback attachment and thread spawning methods.
 */
void ComponentManager::initializeExtensions()
{
	for (eastl::vector<Extension*>::size_type i = 0; i < extensions.size(); i++)
	{
		// For now, the methods are simply called sequentially and thus are only seperated for readability.
		// In the future, the seperation of these methods could be taken utilized for new features.
		Extension* curExtension = extensions[i];
		curExtension -> registerComponents();
		curExtension -> attachGraphicsCallbacks();
		curExtension -> attachInputCallbacks();
		curExtension -> attachAudioCallbacks();
		curExtension -> spawnThreads();
	}
}

/**
 * djb2 hash function, used because hash_maps do not hash c strings.
 * @param str The null terminated string to hash
 * @return The djb2 hash of the given string
 */
unsigned long ComponentManager::hash(const char* str)
{
	unsigned long hash = 5381;
	int c;

	while ((c = *str++) != 0)
		hash = ((hash << 5) + hash) + c; /* hash * 33 + c */

	return hash;
}


text:
using System;

namespace PowerArgs
{
    /// <summary>
    /// An interface that serves as an abstraction layer for a console implementation.
    /// </summary>
    public interface IConsoleProvider
    {
        /// <summary>
        /// Gets or sets the foreground color
        /// </summary>
        ConsoleColor ForegroundColor { get; set; }
        /// <summary>
        /// Gets or sets the backgrund color
        /// </summary>
        ConsoleColor BackgroundColor { get; set; }

        /// <summary>
        /// Gets or sets the left position of the console cursor
        /// </summary>
        int CursorLeft { get; set; }

        /// <summary>
        /// Gets or sets the top position of the console cursor
        /// </summary>
        int CursorTop { get; set; }

        /// <summary>
        /// Gets the buffer width of the console
        /// </summary>
        int BufferWidth { get; }

        /// <summary>
        /// Write's the string representation of the given object to the console
        /// </summary>
        void Write(object output);

        /// <summary>
        /// Write's the string representation of the given object to the console, followed by a newline.
        /// </summary>
        void WriteLine(object output);

        /// <summary>
        /// Writes the given console string to the console, preserving formatting
        /// </summary>
        /// <param name="consoleString">The string to write</param>
        void Write(ConsoleString consoleString);

        /// <summary>
        /// Writes the given character to the console, preserving formatting
        /// </summary>
        /// <param name="consoleCharacter">The character to write</param>
        void Write(ConsoleCharacter consoleCharacter);

        /// <summary>
        /// Writes the given console string to the console, followed by a newline, preserving formatting.
        /// </summary>
        /// <param name="consoleString">The string to write</param>
        void WriteLine(ConsoleString consoleString);

        /// <summary>
        /// Writes a newline to the console
        /// </summary>
        void WriteLine();

        /// <summary>
        /// Clears the console window
        /// </summary>
        void Clear();

        /// <summary>
        /// Reads the next character of input from the console
        /// </summary>
        /// <returns>the char or -1 if there is no more input</returns>
        int Read();

        /// <summary>
        /// Reads a key from the console
        /// </summary>
        /// <param name="intercept">if true, intercept the key before it is shown on the console</param>
        /// <returns>info about the key that was pressed</returns>
        ConsoleKeyInfo ReadKey(bool intercept);

        /// <summary>
        /// Reads a key from the console
        /// </summary>
        ConsoleKeyInfo ReadKey();

        /// <summary>
        /// Reads a line of text from the console
        /// </summary>
        /// <returns>a line of text that was read from the console</returns>
        string ReadLine();
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>The GNU Fortran Compiler: IPARITY</title>

<meta name="description" content="The GNU Fortran Compiler: IPARITY">
<meta name="keywords" content="The GNU Fortran Compiler: IPARITY">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Intrinsic-Procedures.html#Intrinsic-Procedures" rel="up" title="Intrinsic Procedures">
<link href="IRAND.html#IRAND" rel="next" title="IRAND">
<link href="IOR.html#IOR" rel="prev" title="IOR">

Next: IRAND, Previous: IOR, Up: Intrinsic Procedures   [Contents][Index]

8.130 IPARITY — Bitwise XOR of array elements

Description:

Reduces with bitwise XOR (exclusive or) the elements of <var>ARRAY</var> along
dimension <var>DIM</var> if the corresponding element in <var>MASK</var> is TRUE.

Standard:

Fortran 2008 and later

Class:

Transformational function

Syntax:

RESULT = IPARITY(ARRAY[, MASK])

RESULT = IPARITY(ARRAY, DIM[, MASK])

Arguments:

<var>ARRAY</var>	Shall be an array of type INTEGER

<var>DIM</var>	(Optional) shall be a scalar of type
INTEGER with a value in the range from 1 to n, where n
equals the rank of <var>ARRAY</var>.

<var>MASK</var>	(Optional) shall be of type LOGICAL
and either be a scalar or an array of the same shape as <var>ARRAY</var>.

Return value:

The result is of the same type as <var>ARRAY</var>.

If <var>DIM</var> is absent, a scalar with the bitwise XOR of all elements in
<var>ARRAY</var> is returned. Otherwise, an array of rank n-1, where n equals
the rank of <var>ARRAY</var>, and a shape similar to that of <var>ARRAY</var> with
dimension <var>DIM</var> dropped is returned.

Example:

PROGRAM test_iparity
  INTEGER(1) :: a(2)

  a(1) = b'00100100'
  a(2) = b'01101010'

  ! prints 01001110
  PRINT '(b8.8)', IPARITY(a)
END PROGRAM

See also:

IANY, IALL, IEOR, PARITY


text:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="bc.css">

MergedViews and Exporting to a Single DWG

My colleagues Stefan Dobre and Miroslav Schonauer shared some insight on the use of
the MergedViews property provided
by the DGN, DWG and DWG export options classes and other ideas to export multiple views into a single DWG file:

Question: I want to combine and export multiple views into one single DWG file.

I set the option MergedViews, but the code still generates multiple DWG files for the views.

Is there any other way?

Answer: The MergedViews option is used only when we export a sheet.

Let's suppose that we have two views on a sheet.

When MergedViews is false and we export the sheet, it will result in three files. Two DWGs showing the views exactly as they appear on the sheet and another DWG representing the sheet. This DWG contains two Xrefs that point to the views.

When MergedViews is true and we export the sheet, the result is only one file. The generated model contains both views (not as Xref).

So, if you want to export multiple views in the same DWG file, you should create a sheet, place all desired views on it, and export the sheet. If you want to export them as Xref files you should use set MergedView to false, otherwise you should set it to true.

Here is a picture showing where the MergedViews option is presented in the UI:

Another option may be to export individual DWGs using the Revit API and follow up with the AutoCAD I/O API – using either standalone AcCoreConsole, or, in the cloud, the Forge AutoCAD Design Automation API – to import all the created DWGs as BlockReference entities (and create BlockRefInstance entities too, if required) into a master DWG.

Thank you very much, Stefan and Miro, for the illuminating advice.


text:
package org.apache.camel.impl;

import java.util.Map;

import org.apache.camel.Consumer;
import org.apache.camel.ContextTestSupport;
import org.apache.camel.Endpoint;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
import org.junit.Test;

public class ProducerCacheNonSingletonTest extends ContextTestSupport {

    @Override
    public boolean isUseRouteBuilder() {
        return false;
    }

    @Test
    public void testNonSingleton() throws Exception {
        context.addComponent("dummy", new MyDummyComponent());

        ProducerCache cache = new ProducerCache(this, context);
        cache.start();

        Endpoint endpoint = context.getEndpoint("dummy:foo");
        DefaultProducer producer = (DefaultProducer) cache.acquireProducer(endpoint);
        assertNotNull(producer);
        assertTrue("Should be started", producer.getStatus().isStarted());

        Object found = context.hasService(MyDummyProducer.class);
        assertNull("Should not store producer on CamelContext", found);

        cache.releaseProducer(endpoint, producer);
        assertTrue("Should be stopped", producer.getStatus().isStopped());

        cache.stop();
    }

    public class MyDummyComponent extends DefaultComponent {

        @Override
        protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
            return new MyDummyEndpoint();
        }
    }

    public class MyDummyEndpoint extends DefaultEndpoint {

        @Override
        public Producer createProducer() throws Exception {
            return new MyDummyProducer(this);
        }

        @Override
        public Consumer createConsumer(Processor processor) throws Exception {
            return null;
        }

        @Override
        public boolean isSingleton() {
            return false;
        }

        @Override
        protected String createEndpointUri() {
            return "dummy://foo";
        }
    }

    private class MyDummyProducer extends DefaultProducer {

        public MyDummyProducer(Endpoint endpoint) {
            super(endpoint);
        }

        @Override
        public void process(Exchange exchange) throws Exception {
            // noop
        }
    }
}


text:
"""
Contains template tags used in the admin home page.
"""
from django import template

from wagtailplus.wagtailaddresses.models import Address
from wagtailplus.wagtailcontacts.models import Contact
from wagtailplus.wagtailevents.models import BaseEvent
from wagtailplus.wagtaillinks.models import Link

register = template.Library()

@register.assignment_tag
def total_addresses():
    """
    Returns total number of address instances.

    :rtype: int.
    """
    return Address.objects.count()

@register.assignment_tag
def total_contacts():
    """
    Returns total number of link instances.

    :rtype: int.
    """
    return Contact.objects.count()

@register.assignment_tag
def total_events():
    """
    Returns total number of event instances.

    :rtype: int.
    """
    return BaseEvent.objects.count()

@register.assignment_tag
def total_links():
    """
    Returns total number of link instances.

    :rtype: int.
    """
    return Link.objects.count()


text:
hsepred_email_data
==================

Get hsepred predictions of protein properties from server, then download everything from gmail, then parse into matlab

Each of the scripts here is meant to run separately.

The order to run things:

- sequence_list.txt # this is the list of ssequences we want HSE data for
- python hsepred_auto.py  # this sends the protein seqs to hsepred server, 1 every 10 minutes
- python get_from_email.py # hsepred sends emails, read the emails from gmail and write them to files
- matlab parse_email_messages.m # parse the text files output in previous step, output mat file of data
- matlab find_missing_seqs.m # if hsepred_auto.py fails for some reason, figure out which sequences still need to be run