text:
package com.ovoenergy.orchestration.scheduling.dynamo

import java.time.{Clock, DateTimeException, Instant}
import java.util.{UUID, Map => JMap}

import scala.concurrent.duration._

import cats.effect.Async
import com.amazonaws.services.dynamodbv2.{AmazonDynamoDB, AmazonDynamoDBAsync}
import com.amazonaws.services.dynamodbv2.model.{AttributeValue, QueryRequest}
import com.gu.scanamo._
import com.gu.scanamo.error.{ConditionNotMet, DynamoReadError, TypeCoercionError}
import com.gu.scanamo.query.{AndCondition, Condition}
import com.gu.scanamo.syntax._
import com.ovoenergy.comms.model._
import com.ovoenergy.orchestration.aws.AwsProvider.DbClients
import com.ovoenergy.orchestration.logging.LoggingWithMDC
import com.ovoenergy.orchestration.processes.Orchestrator.ErrorDetails
import com.ovoenergy.orchestration.scheduling.Persistence.{
  AlreadyBeingOrchestrated,
  Failed,
  SetAsOrchestratingResult,
  Successful
}
import com.ovoenergy.orchestration.scheduling.dynamo.DynamoPersistence.Context
import com.ovoenergy.orchestration.scheduling.{Change, ScheduleStatus, _}
import io.circe.generic.semiauto._
import io.circe.parser._
import io.circe.{Decoder, Encoder, Error}
import org.slf4j.LoggerFactory

import scala.annotation.tailrec
import scala.collection.JavaConverters._
import scala.concurrent.ExecutionContext

object DynamoPersistence extends DynamoFormats with LoggingWithMDC {

  def generateScheduleId(): ScheduleId = {
    UUID.randomUUID().toString
  }

  case class Context(db: AmazonDynamoDBAsync, tableName: String) {
    val table = Table[Schedule](tableName)
  }
}

class DynamoPersistence(orchestrationExpiry: FiniteDuration, context: Context, clock: Clock = Clock.systemUTC())(
    implicit ec: ExecutionContext)
    extends Persistence.Orchestration
    with Persistence.Listing {

  import DynamoPersistence._

  private val log = LoggerFactory.getLogger("Persistence")

  def attemptSetScheduleAsOrchestrating(scheduleId: ScheduleId): SetAsOrchestratingResult = {
    val now = Instant.now(clock)
    val operation = context.table
      .given(
        Condition('status         -> "Pending")
          or AndCondition('status -> "Orchestrating", 'orchestrationExpiry < now.toEpochMilli)
      )
      .update(
        'scheduleId -> scheduleId,
        set('status -> (ScheduleStatus.Orchestrating: ScheduleStatus))
          and set('orchestrationExpiry, now.plusSeconds(orchestrationExpiry.toSeconds).toEpochMilli)
          and append('history, Change(now, "Start orchestrating"))
      )
    Scanamo.exec(context.db)(operation) match {
      case Left(ConditionNotMet(e)) => AlreadyBeingOrchestrated
      case Left(error) =>
        log.warn(s"Problem marking schedule as orchestrating: $scheduleId", error)
        Failed
      case Right(schedule) => Successful(schedule)
    }
  }

  def setScheduleAsFailed(scheduleId: ScheduleId, reason: String): Unit = {
    val now = Instant.now(clock)
    val result = Scanamo.exec(context.db)(
      context.table.update('scheduleId -> scheduleId,
                           set('status -> (ScheduleStatus.Failed: ScheduleStatus))
                             and append('history, Change(now, s"Failed - $reason"))))
    result match {
      case Left(error) => log.warn(s"Error marking schedule as Failed $error")
      case Right(_)    => ()
    }
  }

  def setScheduleAsComplete(scheduleId: ScheduleId): Unit = {
    val now = Instant.now(clock)
    val result = Scanamo.exec(context.db)(
      context.table.update('scheduleId -> scheduleId,
                           set('status -> (ScheduleStatus.Complete: ScheduleStatus))
                             and append('history, Change(now, "Orchestration complete"))))
    result match {
      case Left(error) => log.warn(s"Error marking schedule as Complete $error")
      case Right(_)    => ()
    }
  }

  def listPendingSchedules(): List[Schedule] = {
    val pending = Scanamo.exec(context.db)(
      context.table
        .index("status-orchestrationExpiry-index")
        .query('status -> (ScheduleStatus.Pending: ScheduleStatus)))

    pending flatMap {
      case Right(schedule) => Some(schedule)
      case Left(e) =>
        log.warn("Problem retrieving pending schedule", e)
        None
    }
  }

  def listExpiredSchedules(): List[Schedule] = {
    val now = Instant.now(clock).toEpochMilli
    val expired = Scanamo.exec(context.db)(
      context.table
        .index("status-orchestrationExpiry-index")
        .query('status -> (ScheduleStatus.Orchestrating: ScheduleStatus) and 'orchestrationExpiry < now))

    expired flatMap {
      case Right(schedule) => Some(schedule)
      case Left(e) =>
        log.warn("Problem retrieving expired schedule", e)
        None
    }
  }
}


text:
/*************************************************************************/
/*                            Sprite.cpp                                 */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           Xenro Engine                                */
/*             https://github.com/Jmiller7023/Xenro-Engine               */
/*************************************************************************/
/*                 Copyright  11-3-2017 Joseph Miller.                   */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/

#include "Sprite.h"
#include "Vertex.h"
#include <cstddef>
#include "ResourceManager.h"

namespace Xenro{

Sprite::Sprite(const glm::vec4& destRect, const glm::vec4& uvRect, GLuint Texture, float Depth, const ColorRGBA& color)
	:texture(Texture), depth(Depth)
{

	topLeft.color = color;
	topLeft.setPosition(destRect.x, destRect.y + destRect.w);
	topLeft.setUV(uvRect.x, uvRect.y + uvRect.w);

	topRight.color = color;
	topRight.setPosition(destRect.x + destRect.z, destRect.y + destRect.w);
	topRight.setUV(uvRect.x + uvRect.z, uvRect.y + uvRect.w);

	bottomLeft.color = color;
	bottomLeft.setPosition(destRect.x, destRect.y);
	bottomLeft.setUV(uvRect.x, uvRect.y);

	bottomRight.color = color;
	bottomRight.setPosition(destRect.x + destRect.z, destRect.y);
	bottomRight.setUV(uvRect.x + uvRect.z, uvRect.y);
}

Sprite::Sprite(const glm::vec4& destRect, const glm::vec4& uvRect, GLuint Texture, float Depth, const ColorRGBA& color, float angle)
	:texture(Texture), depth(Depth)
{

	glm::vec2 halfDims(destRect.z / 2.0f, destRect.w / 2.0f);

	//center points at origin.
	glm::vec2 tl(-halfDims.x, halfDims.y);
	glm::vec2 bl(-halfDims.x, -halfDims.y);
	glm::vec2 br(halfDims.x, -halfDims.y);
	glm::vec2 tr(halfDims.x, halfDims.y);

	//Rotate the points.
	tl = rotatePoint(tl, angle) + halfDims;
	bl = rotatePoint(bl, angle) + halfDims;
	br = rotatePoint(br, angle) + halfDims;
	tr = rotatePoint(tr, angle) + halfDims;

	topLeft.color = color;
	topLeft.setPosition(destRect.x + tl.x, destRect.y + tl.y);
	topLeft.setUV(uvRect.x, uvRect.y + uvRect.w);

	topRight.color = color;
	topRight.setPosition(destRect.x + tr.x, destRect.y + tr.y);
	topRight.setUV(uvRect.x + uvRect.z, uvRect.y + uvRect.w);

	bottomLeft.color = color;
	bottomLeft.setPosition(destRect.x + bl.x, destRect.y + bl.y);
	bottomLeft.setUV(uvRect.x, uvRect.y);

	bottomRight.color = color;
	bottomRight.setPosition(destRect.x + br.x, destRect.y + br.y);
	bottomRight.setUV(uvRect.x + uvRect.z, uvRect.y);
}

glm::vec2 Sprite::rotatePoint(glm::vec2 pos, float angle) {

	glm::vec2 newpos;

	newpos.x = pos.x * cos(angle) - pos.y * sin(angle);
	newpos.y = pos.x * sin(angle) + pos.y * cos(angle);

	return newpos;
}
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using GrainInterfaces;

namespace Webapp.Identity
{
    public class ApplicationUser
    {
        public string UserId { get; set; }
        public string UserName { get; set; }
        public string NormalizedUserName { get; set; }
        public string Email { get; set; }
        public string NormalizedEmail { get; set; }
        public bool EmailConfirmed { get; set; }
        public string PhoneNumber { get; set; }
        public bool PhoneNumberConfirmed { get; set; }
        public string PasswordHash { get; set; }
        public string SecurityStamp { get; set; }
        public DateTimeOffset? Registered { get; set; }
        public bool LockoutEnabled { get; set; }
        public DateTimeOffset? LockoutEnd { get; set; }
        public int AccessFailedCount { get; set; }
        public bool TwoFactorEnabled { get; set; }
        public int InvitesAvailable { get; set; }
        public List<string> Roles { get; set; } = new List<string>();
        public List<ExternalLoginState> ExternalLogins { get; set; } = new List<ExternalLoginState>();
        public List<AuthTokenState> AuthenticationTokens { get; set; } = new List<AuthTokenState>();
        public string ConcurrencyStamp { get; set; }
        public PersonalState PersonalData { get; set; }

        public override string ToString() => this.UserId;

        public ApplicationUser()
        {
        }

        public ApplicationUser(string userId, IdentityState identityData)
        {
            UserId = userId;
            UserName = identityData.UserName;
            NormalizedUserName = identityData.NormalizedUserName;
            Email = identityData.Email;
            NormalizedEmail = identityData.NormalizedEmail;
            EmailConfirmed = identityData.EmailConfirmed;
            PhoneNumber = identityData.PhoneNumber;
            PhoneNumberConfirmed = identityData.PhoneNumberConfirmed;
            PasswordHash = identityData.PasswordHash;
            SecurityStamp = identityData.SecurityStamp;
            Registered = identityData.Registered;
            LockoutEnabled = identityData.LockoutEnabled;
            LockoutEnd = identityData.LockoutEnd;
            AccessFailedCount = identityData.AccessFailedCount;
            TwoFactorEnabled = identityData.TwoFactorEnabled;
            Roles = identityData.Roles;
            ExternalLogins = identityData.ExternalLogins;
            AuthenticationTokens = identityData.AuthenticationTokens;
            ConcurrencyStamp = identityData.ConcurrencyStamp;
        }
    }

    public class ApplicationUserLogin
    {
        public string LoginProvider { get; set; }
        public string ProviderDisplayName { get; set; }
        public string ProviderKey { get; set; }
        public string UserId { get; set; }
    }

    public class ApplicationToken
    {
        public string Id { get; set; }
        public string Name { get; set; }
        public string LoginProvider { get; set; }
    }

    public class UserRole
    {
        public string Role { get; set; }
    }
}


text:
package org.eclipse.rdf4j.federated.endpoint.provider;

import org.eclipse.rdf4j.federated.endpoint.Endpoint;
import org.eclipse.rdf4j.federated.exception.FedXException;

/**
 * Generic interface to create {@link Endpoint}s from a repository information.
 *
 * @author Andreas Schwarte
 *
 */
public interface EndpointProvider<T extends RepositoryInformation> {

	Endpoint loadEndpoint(T repoInfo) throws FedXException;

}


text:
package com.intellij.openapi.vcs.changes.shelf;

import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vcs.FilePath;
import com.intellij.openapi.vcs.VcsBundle;
import com.intellij.openapi.vcs.VcsException;
import org.jetbrains.annotations.NotNull;

import java.io.File;
import java.io.IOException;

public class ShelvedBinaryContentRevision extends SimpleBinaryContentRevision {
  private final String myShelvedContentPath;

  public ShelvedBinaryContentRevision(FilePath path, final String shelvedContentPath) {
    super(path, VcsBundle.message("shelved.version.name"));
    myShelvedContentPath = shelvedContentPath;
  }

  @Override
  public byte @NotNull [] getBinaryContent() throws VcsException {
    try {
      return FileUtil.loadFileBytes(new File(myShelvedContentPath));
    }
    catch (IOException e) {
      throw new VcsException(e);
    }
  }
}


text:
package org.springframework.data.solr.core.mapping;

import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor;
import java.util.Arrays;
import java.util.Collection;

import org.apache.solr.client.solrj.beans.Field;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.springframework.data.mapping.model.Property;
import org.springframework.data.mapping.model.SimpleTypeHolder;
import org.springframework.data.util.ClassTypeInformation;
import org.springframework.data.util.TypeInformation;

/**
 * @author Christoph Strobl
 * @author Mark Paluch
 */
@RunWith(Parameterized.class)
public class SimpleSolrPersitentPropertyFieldNameTests {

	@SuppressWarnings("rawtypes") //
	private TypeInformation typeInformation;

	private SimpleSolrPersistentEntity<BeanWithSolrFieldAnnotation> persistentEntity;

	private final String propertyName;
	private final String expectedFieldname;

	public SimpleSolrPersitentPropertyFieldNameTests(String propertyName, String expectedFieldname) {
		this.propertyName = propertyName;
		this.expectedFieldname = expectedFieldname;
	}

	@SuppressWarnings("unchecked")
	@Before
	public void setUp() {

		typeInformation = ClassTypeInformation.from(BeanWithSolrFieldAnnotation.class);
		persistentEntity = new SimpleSolrPersistentEntity<>(typeInformation);
	}

	@Parameters
	public static Collection<Object[]> data() {
		Object[][] data = new Object[][] { { "fieldWithSolrjFieldAnnotation", "fieldWithSolrjFieldAnnotation" },
				{ "fieldWithSolrjFieldAnnotationAndValue", "solrj" },
				{ "fieldWithIndexedAnnotation", "fieldWithIndexedAnnotation" },
				{ "fieldWithIndexedAnnotationAndValue", "indexed" }, { "fieldWithBothAnnotations", "solrj" } };
		return Arrays.asList(data);
	}

	@Test
	public void testGetFieldnameReturnsProperNameForAnnotationsIndexedAndField() throws IntrospectionException {
		Assert.assertEquals(this.expectedFieldname,
				getPersistentProperty(BeanWithSolrFieldAnnotation.class, this.propertyName).getFieldName());
	}

	private SimpleSolrPersistentProperty getPersistentProperty(Class<?> clazz, String propertyName)
			throws IntrospectionException {
		PropertyDescriptor descriptor = new PropertyDescriptor(propertyName, clazz);
		java.lang.reflect.Field field = org.springframework.util.ReflectionUtils.findField(clazz, propertyName);

		return new SimpleSolrPersistentProperty(Property.of(ClassTypeInformation.from(clazz), field, descriptor),
				persistentEntity, SimpleTypeHolder.DEFAULT);
	}

	static class BeanWithSolrFieldAnnotation {

		@Field //
		private String fieldWithSolrjFieldAnnotation;

		@Field("solrj") //
		private String fieldWithSolrjFieldAnnotationAndValue;

		@Indexed //
		private String fieldWithIndexedAnnotation;

		@Indexed("indexed") //
		private String fieldWithIndexedAnnotationAndValue;

		@Field("solrj") //
		@Indexed("indexed") //
		private String fieldWithBothAnnotations;

		public String getFieldWithSolrjFieldAnnotation() {
			return fieldWithSolrjFieldAnnotation;
		}

		public void setFieldWithSolrjFieldAnnotation(String fieldWithSolrjFieldAnnotation) {
			this.fieldWithSolrjFieldAnnotation = fieldWithSolrjFieldAnnotation;
		}

		public String getFieldWithSolrjFieldAnnotationAndValue() {
			return fieldWithSolrjFieldAnnotationAndValue;
		}

		public void setFieldWithSolrjFieldAnnotationAndValue(String fieldWithSolrjFieldAnnotationAndValue) {
			this.fieldWithSolrjFieldAnnotationAndValue = fieldWithSolrjFieldAnnotationAndValue;
		}

		public String getFieldWithIndexedAnnotation() {
			return fieldWithIndexedAnnotation;
		}

		public void setFieldWithIndexedAnnotation(String fieldWithIndexedAnnotation) {
			this.fieldWithIndexedAnnotation = fieldWithIndexedAnnotation;
		}

		public String getFieldWithIndexedAnnotationAndValue() {
			return fieldWithIndexedAnnotationAndValue;
		}

		public void setFieldWithIndexedAnnotationAndValue(String fieldWithIndexedAnnotationAndValue) {
			this.fieldWithIndexedAnnotationAndValue = fieldWithIndexedAnnotationAndValue;
		}

		public String getFieldWithBothAnnotations() {
			return fieldWithBothAnnotations;
		}

		public void setFieldWithBothAnnotations(String fieldWithBothAnnotations) {
			this.fieldWithBothAnnotations = fieldWithBothAnnotations;
		}

	}

}


text:
var fse = require("fs-extra");
var path = require("path");
var local = path.join.bind(path, __dirname);
var exec = require('../utils/execPromise');

var NodeGit = require('..');

var workdirPath = local("repos/workdir");
var constWorkdirPath = local("repos/constworkdir");

const testRepos = [
  "repos/bare",
  "repos/blameRepo",
  "repos/cherrypick",
  "repos/clone",
  "repos/constworkdir",
  "repos/convenientLineTest",
  "repos/empty",
  "repos/index",
  "repos/index",
  "repos/merge",
  "repos/merge-head",
  "repos/new",
  "repos/newrepo",
  "repos/nonrepo",
  "repos/rebase",
  "repos/renamedFileRepo",
  "repos/revertRepo",
  "repos/stagingRepo",
  "repos/submodule",
  "repos/submodule/nodegittest/",
  "repos/tree/",
  "repos/workdir",
];

before(function() {
  this.timeout(350000);

  var testUrl = "https://github.com/nodegit/test";
  var constTestUrl = "https://github.com/nodegit/test-frozen";
  return fse.remove(local("repos"))
    .then(function() {
      fse.remove(local("home"))
    })
    .then(function() {
      fse.mkdir(local("repos"));
    })
    .then(function() {
      return exec("git init " + local("repos", "empty"));
    })
    .then(function() {
      return exec("git clone " + constTestUrl + " " + constWorkdirPath);
    })
    .then(function() {
      return exec("git clone " + testUrl + " " + workdirPath);
    })
    .then(function() {
      //to checkout the longpaths-checkout branch
      if(process.platform === "win32") {
        return exec("git config core.longpaths true", {cwd: workdirPath});
      }
      return Promise.resolve();
    })
    .then(function() {
      return exec("git checkout rev-walk", {cwd: workdirPath});
    })
    .then(function() {
      return exec("git checkout checkout-test", {cwd: workdirPath});
    })
    .then(function() {
      return exec("git checkout longpaths-checkout", {cwd: workdirPath});
    })
    .then(function() {
      return exec("git checkout master", {cwd: workdirPath});
    })
    .then(function() {
      return fse.mkdir(local("repos", "nonrepo"));
    })
    .then(function() {
      return fse.writeFile(local("repos", "nonrepo", "file.txt"),
        "This is a bogus file");
    })
    .then(function() {
      return fse.mkdir(local("home"));
    })
    .then(function() {
      return fse.writeFile(local("home", ".gitconfig"),
        "[user]\n  name = John Doe\n  email = johndoe@example.com");
    })
    .then( async function() {
      //mark all test repos as safe
      for(let repo of testRepos) {
        await exec(`git config --global --add safe.directory ${local(repo)}`);
      }
    })
});

beforeEach(function() {
  this.timeout(4000);
  return exec("git clean -xdf", {cwd: workdirPath})
  .then(function() {
    return exec("git checkout master", {cwd: workdirPath});
  })
  .then(function() {
    return exec("git reset --hard", {cwd: workdirPath});
  });
});

afterEach(function(done) {
  process.nextTick(function() {
    if (global.gc) {
      global.gc();
    }
    done();
  });
});


text:
var mapModule = (function(window,$){

    var _vars = {
	    "map": null,
		"sql": null,
		"selectedType": null,
		"layers": null,
		"marker": null,
		"mainControl": null
	};

	/*
	 *
	 *	HINT
	 *  Edit the configuration below to use data from your latest cartoDB tables
	 *  layers.schools contains the table names to elementary-, middle- and highschools
	 *  while addresses.address_lookup_table contains the table name to the address lookup table
	 *
	 */

	var _config = {
	    "cartouser": "your-carto-username-comes-here",
	    "layers": {
		    "schools":{
			    "high": "school_high_area",
				"middle": "school_middle_area",
				"elementary": "scenario_a_territories_082416",
				"school_locations": "schools_wentzville"
			},
			"addresses": {
			    "address_lookup_table": "address_points"
			}
		}
	};

	/*
	 *	----------------------------------------- DO NOT EDIT BELOW THIS LINE!	-----------------------------------------
	 */

    function _init(){
		_vars.sql = cartodb.SQL({ user: _config['cartouser'] });
		_vars.selectedType = "elementary";
		_vars.layers = {
			"schools": []
		};
		_vars.map = new google.maps.Map(document.getElementById("map-canvas"), {
		    center: new google.maps.LatLng(38.829954,-90.869979),
			mapTypeId: google.maps.MapTypeId.ROADMAP,
			mapTypeControl: true,
            mapTypeControlOptions: {
			    position: google.maps.ControlPosition.BOTTOM_CENTER
            },
		    zoom:11
		});
		_vars.marker = new google.maps.Marker({"icon": "img/star.png", "title": "Your address"});

		_loadAreas();
		_plotSchools();

		_vars.mainControl = $($("#map_menu_control").html());
		_vars.map.controls[google.maps.ControlPosition.TOP_CENTER].push(_vars.mainControl.get(0));

		google.maps.event.addListenerOnce(_vars.map, 'idle', function() {
		    _doOnIdle();
		});
	}

	function _returnSchoolTypeTableName(type){
		switch(_vars.selectedType){
		    case "elementary":
			    return _config.layers.schools.elementary;
			break;
			case "middle":
			    return _config.layers.schools.middle;
			break;
			case "high":
			    return _config.layers.schools.high;
			break;
		}
	}

	function _loadAreas(){
	    $(".loading").show();

	    _vars.sql.execute("SELECT ST_AsGeoJson(the_geom) AS geom, color, school_nam, school_dis FROM " + _returnSchoolTypeTableName(_vars.selectedType) +" WHERE school_dis='Wentzville'").done(function(data) {
			_removeAllAreas();

			var ftrCollection = {"type": "FeatureCollection", "features": []};
			if(data.rows.length>0){
				for(i=0;i<data.rows.length;i++){
					ftrCollection.features.push({"type": "Feature", "properties": {"color": data.rows[i]["color"], "name": data.rows[i]["school_nam"], "district": data.rows[i]["school_dis"]}, "geometry": JSON.parse(data.rows[i]["geom"])});
				}
			}

			_vars.map.data.addGeoJson(ftrCollection);

		    _vars.map.data.setStyle(function(feature){
			    if(typeof feature.getProperty("color") != undefined){
			        return ({"fillColor": feature.getProperty("color"),"strokeColor": "#000000", "fillOpacity": 0.5, "strokeOpacity": 1,"strokeWeight": 0.5});
			    }
		    });

		    $(".loading").hide();
		});
    }

	function _plotSchools(){
        $(".loading").show();
		_vars.sql.execute("SELECT address, city, name, principal, schemail, state, teachers, type, ST_X(the_geom) AS lng, ST_Y(the_geom) AS lat FROM " + _config.layers.schools.school_locations + " WHERE type ILIKE '%" + _vars.selectedType + "%'").done(function(data) {

			while(_vars.layers["schools"][0]){
			    _vars.layers["schools"].pop().setMap(null);
			}
			_vars.layers["schools"].length = 0;

		    if(data.rows.length>0){
			    for(i=0;i<data.rows.length;i++){
				    var schoolMarker = new google.maps.Marker({
						"map": _vars.map,
						"icon": "img/school.png",
                        "title": data.rows[i]["name"],
						"position": new google.maps.LatLng(parseFloat(data.rows[i]["lat"]), parseFloat(data.rows[i]["lng"])),
						"properties": {"lat": data.rows[i]["lat"], "lng": data.rows[i]["lng"], "address": data.rows[i]["address"], "city": data.rows[i]["city"], "name": data.rows[i]["name"], "principal": data.rows[i]["properties"], "email": data.rows[i]["schemail"], "state": data.rows[i]["state"], "teacherscount": data.rows[i]["teachers"], "schooltype": data.rows[i]["type"]}
					});
					_createCallout(schoolMarker);
					_vars.layers["schools"].push(schoolMarker);
				}
				$(".loading").hide();
			}
			else
			{
			    $(".loading").hide();
			}
		});
	}

    function _plotMarker(id){
		_vars.sql.execute("select ST_X(the_geom) AS lng, ST_Y(the_geom) AS lat FROM " + _config.layers.addresses.address_lookup_table + " WHERE objectid = '" + id + "'").done(function(data) {
		    if(data.rows.length>0){
			    console.log(data.rows);
				_vars.marker.setMap(_vars.map);
				_vars.marker.setPosition(new google.maps.LatLng(parseFloat(data.rows[0]["lat"]), parseFloat(data.rows[0]["lng"])));
				_vars.map.setCenter(_vars.marker.getPosition());
				_vars.map.setZoom(14);

				//Perform point in polygon db search
                _detectSchool(_vars.marker.getPosition());
		    }
		});
	}

	function _detectSchool(latlng){
		_vars.sql.execute("SELECT color, school_nam, school_dis, type, ST_AsGeoJson(the_geom) AS geom FROM " + _returnSchoolTypeTableName(_vars.selectedType) + " WHERE school_dis='Wentzville' AND ST_Intersects(the_geom, ST_SetSRID(ST_MakePoint(" + latlng.lng() + "," + latlng.lat() + "),4326))").done(function(data) {
			_removeAllAreas();

			var ftrCollection = {"type": "FeatureCollection", "features": []};

			if(data.rows.length>0){
				var msg = $("#msg-dismissible").html();
				$("#msg-container").html(Mustache.render(msg, {"type": _vars.selectedType, "school": data.rows[0]["school_nam"]})).fadeIn();
				$("#msg-container").find(".alert").on("close.bs.alert", function(){
					$("#msg-container").fadeOut();
					_vars.marker.setMap(null);
					_loadAreas();
					_plotSchools();
				});

				for(i=0;i<data.rows.length;i++){
					ftrCollection.features.push({"type": "Feature", "properties": {"color": data.rows[i]["color"], "name": data.rows[i]["school_nam"], "district": data.rows[i]["school_dis"]}, "geometry": JSON.parse(data.rows[i]["geom"])});
				}

				_vars.map.data.addGeoJson(ftrCollection);

				_vars.map.data.setStyle(function(feature){
					if(typeof feature.getProperty("color") != undefined){
						return ({"fillColor": feature.getProperty("color"),"strokeColor": "#000000", "fillOpacity": 0.5, "strokeOpacity": 1,"strokeWeight": 0.5});
					}
				});

				_filterSchools(data.rows[0]["school_nam"]);
			}
			else
			{
				var msg = $("#msg-error-dismissible").html();
				$("#msg-container").html(Mustache.render(msg, {"address": $("#inp_address").val()})).fadeIn();
				$("#msg-container").find(".alert").on("close.bs.alert", function(){
					$("#msg-container").fadeOut();
					_vars.marker.setMap(null);
					_loadAreas();
				});
			}
	    });
    }

	function _filterSchools(schoolName){
        for(i=0;i<_vars.layers["schools"].length;i++){
		    if(_vars.layers["schools"][i]["properties"]["name"].toLowerCase().indexOf(schoolName.toLowerCase()) > -1){
			    _vars.layers["schools"][i].setMap(_vars.map);
			}
		    else
		    {
			    _vars.layers["schools"][i].setMap(null);
		    }
		}
	}

	function _removeAllAreas(){
	    //Clear all areas displayed on the data layer
		_vars.map.data.forEach(function(feature) {
            _vars.map.data.remove(feature);
        });
		//Detaching all events that was attached earlier to the data layer
		google.maps.event.clearListeners(_vars.map.data, 'click');
	}

	function _createCallout(markerObj){
	    google.maps.event.addListener(markerObj, "click", function(){
		    var content = Mustache.render($("#school_callout").html(), markerObj.properties);
			$('#messageModal').html(content);
			$('#messageModal').modal({"show": true});
			$('#messageModal').on("shown.bs.modal", function(){

			});
		});
	}

	function _doOnIdle(){
		$('#messageModal').html($("#explanation_screen").html());
		$('#messageModal').modal({"show": true});

		$('#inp_address').on('keypress', function(e) {
			if ($(e.target).val().length > 2) {
				$(".btn-load-indicator").show();
				_vars.sql.execute("select str_add,objectid FROM " + _config.layers.addresses.address_lookup_table + " WHERE str_add ILIKE '%" + $(e.target).val() + "%' LIMIT 10").done(function(data) {
					if(data.rows.length>0){
						$("#suggestresults").html("");
						for(i=0;i<data.rows.length;i++){
							var item = $('
' + data.rows[i]["str_add"] + '
');
							item.on("click", function(e){
								$("#inp_address").val($(this).html());
								$("#suggestresults").hide();
								_plotMarker($(this).data("id"));
							});
							$("#suggestresults").append(item);
						}
						$(".btn-load-indicator").hide();
						$("#suggestresults").show();
					}
				});
			}
		});
		$('#inp_address').on("click", function(){
			$(this).val("");
		});

		$("#btn_help").on("click", function(){
			$('#messageModal').html($("#explanation_screen").html());
		    $('#messageModal').modal({"show": true});
		});

		//Switch type selector on and off
        $("#btn-typeselector-toggle").on("click", function(){
			if($(".mapmenu-typeselector-container").is(":visible")){
			    $(".mapmenu-typeselector-container").fadeOut();
				$("#btn-typeselector-toggle > i").toggleClass("fa-times");
				$("#btn-typeselector-toggle > i").toggleClass("fa-bars");
			}
			else
			{
			    $(".mapmenu-typeselector-container").fadeIn();
				$("#btn-typeselector-toggle > i").toggleClass("fa-bars");
				$("#btn-typeselector-toggle > i").toggleClass("fa-times");
			}
		});

		var selectorButtons = [$("#btn-opt-elem"), $("#btn-opt-middle"), $("#btn-opt-high")];

		$.each(selectorButtons, function(index, elem){
			elem.on("click", function(){
				//Remove active class from all elements
				$.each(selectorButtons, function(i, e){
					e.removeClass("active");
				});
				elem.toggleClass("active");
				_vars.selectedType = elem.data("name");

				//Display areas and schools based on user selection
				//Query cartoDB and append results to google map's data layer
                _loadAreas();
				_plotSchools();

				//If the marker has an address, then do...
				if(_vars.marker.getMap() == _vars.map){
					_detectSchool(_vars.marker.getPosition());
				}
				else
				{
				    _loadAreas();
				}

			});
		});
	}

	return {
		init: _init
	};

})(window,jQuery);


text:
package io.datarouter.clustersetting;

import java.util.ArrayList;
import java.util.List;

import org.testng.Assert;
import org.testng.annotations.Test;

import io.datarouter.clustersetting.storage.clustersetting.ClusterSetting;
import io.datarouter.storage.servertype.ServerType;

public class ClusterSettingComparatorTests{

	@Test
	public void testClusterSettingComparator(){
		List<ClusterSetting> settings = new ArrayList<>();
		var defaultScopedSetting = new ClusterSetting(
				"defaultScopedSetting",
				ClusterSettingScope.DEFAULT_SCOPE,
				ServerType.UNKNOWN.getPersistentString(),
				"",
				"");
		settings.add(defaultScopedSetting);
		var serverTypeScopedSetting = new ClusterSetting(
				"serverTypeScopedSetting",
				ClusterSettingScope.SERVER_TYPE,
				ServerType.DEV.getPersistentString(),
				"",
				"");
		settings.add(serverTypeScopedSetting);
		Assert.assertEquals(ClusterSettingComparisonTool.getMostSpecificSetting(settings).orElse(null),
				serverTypeScopedSetting);
		var serverNameScopedSetting = new ClusterSetting(
				"serverNameScopedSetting",
				ClusterSettingScope.SERVER_NAME,
				ServerType.UNKNOWN.getPersistentString(),
				"mySevrer",
				"");
		settings.add(serverNameScopedSetting);
		Assert.assertEquals(ClusterSettingComparisonTool.getMostSpecificSetting(settings).orElse(null),
				serverNameScopedSetting);
	}

}


text:
const Renderable = require('./renderable')

/**
 * Represents a in-game object in 2D. Has a x,y width and height
 * @public
 * @constructor {GameObject} GameObject
 * @class {GameObject} GameObject
 */
class GameObject extends Renderable {

    /**
     * @func constructor
     * @param {integer} id - The unique identifier of this GameObject
     * @param {integer} x - The initial X object coordinate position
     * @param {integer} y - The initial X object coordinate position
     * @param {integer} width - The width of the object
     * @param {integer} height - The height of the object
     * @param {integer} radius - The radius of the object
     */
  constructor (id = 0, x = 0, y = 0, width = 0, height = 0, radius = 0) {
    super()
    this.id = id
    this.x = x
    this.y = y
    this.width = width
    this.height = height
    this.radius = radius
    this.center = {
      x: this.x + this.width / 2,
      y: this.y + this.height / 2
    }

        // Initial speed at 0
    this.vx = 0
    this.vy = 0
  }

    /**
     * Set the position of the object in the world
     * @public
     * @param {integer} x - The new X coordinate
     * @param {integer} y - The new Y coordinate
     * @return {GameObject} - Return self instance for chaining
     */
  setPosition (x, y) {
    this.x = x
    this.y = y
    return this
  }

    /**
     * Set the speed of the object in the world
     * @public
     * @param {double} sx - Speed X value
     * @param {double} sy - Speed Y value
     * @return {GameObject} - Return self instance for chaining
     */
  setSpeed (sx, sy) {
    this.vx = sx
    this.vy = sy
    return this
  }

    /**
     * Get the current position of the object in the world
     * @public
     * @return {PlainObject} - A plain object with x and y keys identifying the object position
     */
  getPosition () {
    return {x: this.x, y: this.y}
  }

    /**
     * Set the width of this object
     * @public
     * @param {integer} width - The new width of the object
     * @return {GameObject} - Return self instance for chaining
     */
  setWidth (width) {
    this.width = width
    this.center.x = this.x + this.width / 2
    return this
  }

    /**
     * Set the height of this object
     * @public
     * @param {integer} height - The new height of the object
     * @return {GameObject} - Return self instance for chaining
     */
  setHeight (height) {
    this.height = height
    this.center.y = this.y + this.width / 2
    return this
  }

    /**
     * @public
     * @return {PlainObject} - Return a plain object with x and y keys identifying the GameObject center coordinates
     */
  getCenter () {
    return this.center
  }

    /**
     * @public
     * @return {integer} - Returns the self radius. This number will be > 0. If, means this GameObject is not propertly initialized
     */
  getRadius () {
    return this.radius
  }

    /**
     * Check if this object collides with another
     * @public
     * @param {GameObject} object - The GameObject to check if this collide with it
     * @return {boolean} - Return true if this GameObject collides with object, else return false
     */
  collidesWith (object) {
        // Just check the circular collision
    let center = this.getCenter()
    let oCenter = object.getCenter()

        // Calc Manhattan distance: Check at google
    let distX = Math.abs(center.x - oCenter.x)
    let distY = Math.abs(center.y - oCenter.y)

    let radiusSum = this.getRadius() + object.getRadius()

    return (radiusSum >= distX || radiusSum >= distY)
  }

    /**
     * A method that each GameObject must be implemented for self rendering in the GameWorld.
     * @public
     * @return {GameObject} - Return self instance for chaining
     */
  render () {

    return this
  }
}

module.exports = GameObject


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package main;

/**
 *
 * @author elect
 */
public class Timer {

}


text:
import {empty, addClass, hasClass} from './../helpers/dom/element';
import {equalsIgnoreCase} from './../helpers/string';
import {EventManager} from './../eventManager';
import {getRenderer, registerRenderer} from './../renderers';
import {KEY_CODES} from './../helpers/unicode';
import {stopPropagation, stopImmediatePropagation, isImmediatePropagationStopped} from './../helpers/dom/event';

const isListeningKeyDownEvent = new WeakMap();
const isCheckboxListenerAdded = new WeakMap();
const BAD_VALUE_CLASS = 'htBadValue';

/**
 * Checkbox renderer
 *
 * @private
 * @param {Object} instance Handsontable instance
 * @param {Element} TD Table cell where to render
 * @param {Number} row
 * @param {Number} col
 * @param {String|Number} prop Row object property name
 * @param value Value to render (remember to escape unsafe HTML before inserting to DOM!)
 * @param {Object} cellProperties Cell properties (shared by cell renderer and editor)
 */
function checkboxRenderer(instance, TD, row, col, prop, value, cellProperties) {
  getRenderer('base').apply(this, arguments);

  const eventManager = new EventManager(instance);
  let input = createInput();
  const labelOptions = cellProperties.label;
  let badValue = false;

  if (typeof cellProperties.checkedTemplate === 'undefined') {
    cellProperties.checkedTemplate = true;
  }
  if (typeof cellProperties.uncheckedTemplate === 'undefined') {
    cellProperties.uncheckedTemplate = false;
  }

  empty(TD); // TODO identify under what circumstances this line can be removed

  if (value === cellProperties.checkedTemplate || equalsIgnoreCase(value, cellProperties.checkedTemplate)) {
    input.checked = true;

  } else if (value === cellProperties.uncheckedTemplate || equalsIgnoreCase(value, cellProperties.uncheckedTemplate)) {
    input.checked = false;

  } else if (value === null) { // default value
    addClass(input, 'noValue');

  } else {
    input.style.display = 'none';
    addClass(input, BAD_VALUE_CLASS);
    badValue = true;
  }

  input.setAttribute('data-row', row);
  input.setAttribute('data-col', col);

  if (!badValue && labelOptions) {
    let labelText = '';

    if (labelOptions.value) {
      labelText = typeof labelOptions.value === 'function' ? labelOptions.value.call(this, row, col, prop, value) : labelOptions.value;

    } else if (labelOptions.property) {
      labelText = instance.getDataAtRowProp(row, labelOptions.property);
    }
    const label = createLabel(labelText);

    if (labelOptions.position === 'before') {
      label.appendChild(input);
    } else {
      label.insertBefore(input, label.firstChild);
    }
    input = label;
  }

  TD.appendChild(input);

  if (badValue) {
    TD.appendChild(document.createTextNode('#bad-value#'));
  }

  if (!isCheckboxListenerAdded.has(instance)) {
    if (cellProperties.readOnly) {
      eventManager.addEventListener(instance.rootElement, 'click', preventDefault);
    } else {
      eventManager.addEventListener(instance.rootElement, 'mouseup', (event) => onMouseUp(event, instance));
      eventManager.addEventListener(instance.rootElement, 'change', (event) => onChange(event, instance));

    }

    isCheckboxListenerAdded.set(instance, true);
  }

  if (!isListeningKeyDownEvent.has(instance)) {
    isListeningKeyDownEvent.set(instance, true);
    instance.addHook('beforeKeyDown', onBeforeKeyDown);
  }

  /**
   * On before key down DOM listener.
   *
   * @private
   * @param {Event} event
   */
  function onBeforeKeyDown(event) {
    const allowedKeys = [
      KEY_CODES.SPACE,
      KEY_CODES.ENTER,
      KEY_CODES.DELETE,
      KEY_CODES.BACKSPACE,
    ];

    if (allowedKeys.indexOf(event.keyCode) !== -1 && !isImmediatePropagationStopped(event)) {
      eachSelectedCheckboxCell(function() {
        stopImmediatePropagation(event);
        event.preventDefault();
      });
    }
    if (event.keyCode === KEY_CODES.SPACE || event.keyCode === KEY_CODES.ENTER) {
      toggleSelected();
    }
    if (event.keyCode === KEY_CODES.DELETE || event.keyCode === KEY_CODES.BACKSPACE) {
      toggleSelected(false);
    }
  }

  /**
   * Toggle checkbox checked property
   *
   * @private
   * @param {Boolean} [checked=null]
   */
  function toggleSelected(checked = null) {
    eachSelectedCheckboxCell(function(checkboxes) {
      for (let i = 0, len = checkboxes.length; i < len; i++) {
        // Block changing checked property on toggle keys (SPACE and ENTER)
        if (hasClass(checkboxes[i], BAD_VALUE_CLASS) && checked === null) {
          return;
        }
        toggleCheckbox(checkboxes[i], checked);
      }
    });
  }

  /**
   * Toggle checkbox element.
   *
   * @private
   * @param {HTMLInputElement} checkbox
   * @param {Boolean} [checked=null]
   */
  function toggleCheckbox(checkbox, checked = null) {
    if (checked === null) {
      checkbox.checked = !checkbox.checked;
    } else {
      checkbox.checked = checked;
    }
    eventManager.fireEvent(checkbox, 'change');
  }

  /**
   * Call callback for each found selected cell with checkbox type.
   *
   * @private
   * @param {Function} callback
   */
  function eachSelectedCheckboxCell(callback) {
    const selRange = instance.getSelectedRange();

    if (!selRange) {
      return;
    }
    const topLeft = selRange.getTopLeftCorner();
    const bottomRight = selRange.getBottomRightCorner();

    for (let row = topLeft.row; row <= bottomRight.row; row++) {
      for (let col = topLeft.col; col <= bottomRight.col; col++) {
        let cell = instance.getCell(row, col);
        let cellProperties = instance.getCellMeta(row, col);
        let checkboxes = cell.querySelectorAll('input[type=checkbox]');

        if (checkboxes.length > 0 && !cellProperties.readOnly) {
          callback(checkboxes);
        }
      }
    }
  }
}

/**
 * Create input element.
 *
 * @returns {Node}
 */
function createInput() {
  let input = document.createElement('input');

  input.className = 'htCheckboxRendererInput';
  input.type = 'checkbox';
  input.setAttribute('autocomplete', 'off');
  input.setAttribute('tabindex', '-1');

  return input.cloneNode(false);
}

/**
 * Create label element.
 *
 * @returns {Node}
 */
function createLabel(text) {
  let label = document.createElement('label');

  label.className = 'htCheckboxRendererLabel';
  label.appendChild(document.createTextNode(text));

  return label.cloneNode(true);
}

/**
 * If the event target matches the checkbox selector, prevent the default event action.
 *
 * @private
 * @param event
 */
function preventDefault(event) {
  if (isCheckboxInput(event.target)) {
    event.preventDefault();
  }
}

/**
 * `mouseup` callback.
 *
 * @private
 * @param {Event} event `mouseup` event.
 * @param {Object} instance Handsontable instance.
 */
function onMouseUp(event, instance) {
  if (isCheckboxInput(event.target)) {
    setTimeout(instance.listen, 10);
  }
}

/**
 * `change` callback.
 *
 * @param {Event} event `change` event.
 * @param {Object} instance Handsontable instance.
 * @param {Object} cellProperties Reference to cell properties.
 * @returns {Boolean}
 */
function onChange(event, instance) {
  if (!isCheckboxInput(event.target)) {
    return false;
  }

  let row = parseInt(event.target.getAttribute('data-row'), 10);
  let col = parseInt(event.target.getAttribute('data-col'), 10);
  let cellProperties = instance.getCellMeta(row, col);

  instance.setDataAtCell(row, col, event.target.checked ? (cellProperties.checkedTemplate || true) : (cellProperties.uncheckedTemplate || false));
}

/**
 * Check if the provided element is the checkbox input.
 *
 * @private
 * @param {HTMLElement} element The element in question.
 * @returns {Boolean}
 */
function isCheckboxInput(element) {
  return element.tagName === 'INPUT' && element.getAttribute('type') === 'checkbox';
}

export {checkboxRenderer};
registerRenderer('checkbox', checkboxRenderer);


text:
sudo -v

while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &

###################################################################
# UI/UX                                                           #
###################################################################

# Dark dock and menu bar
# defaults write /Library/Preferences/.GlobalPreferences AppleInterfaceTheme Dark

# Disable the sound effects on boot
sudo nvram SystemAudioVolume=" "

# Play feedback when volume is changed
defaults write -g 'com.apple.sound.beep.feedback' -bool true

# Use AirDrop over every interface. srsly this should be a default.
defaults write com.apple.NetworkBrowser BrowseAllInterfaces 1

# Disable the "Are you sure you want to open this application?" dialog
defaults write com.apple.LaunchServices LSQuarantine -bool false

# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true

# Expand print panel by default
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true

# Automatically quit printer app once the print jobs complete
defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true

###################################################################
# Finder                                                          #
###################################################################

# Finder: allow quitting via ⌘ + Q; doing so will also hide desktop icons
defaults write com.apple.finder QuitMenuItem -bool true

# Finder: show hidden files by default
defaults write com.apple.finder AppleShowAllFiles -bool true

# Finder: show all filename extensions
defaults write NSGlobalDomain AppleShowAllExtensions -bool true

# Show the ~/Library folder.
chflags nohidden ~/Library

# Always open everything in Finder's list view. This is important.
defaults write com.apple.Finder FXPreferredViewStyle Nlsv

# Display full POSIX path as Finder window title
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true

# Set the Finder prefs for showing a few different volumes on the Desktop.
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true

# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false

# Expand the following File Info panes:
# "General", "Open with", and "Sharing & Permissions"
defaults write com.apple.finder FXInfoPanesExpanded -dict \
  General -bool true \
  OpenWith -bool true \
  Privileges -bool true

# Save screenshots to ~/Pictures/Screenshots
mkdir -p "${HOME}/Pictures/Screenshots"
defaults write com.apple.screencapture location -string "${HOME}/Pictures/Screenshots"

# Disable shadow in screenshots
# defaults write com.apple.screencapture disable-shadow -bool true

###################################################################
# Keyboard                                                        #
###################################################################

# Enable full keyboard access for all controls
# (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3

# Disable press-and-hold for keys in favor of key repeat.
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a really fast key repeat.
# defaults write -g NSGlobalDomain KeyRepeat -int 0
defaults write -g InitialKeyRepeat -int 15 # normal minimum is 15 (225 ms)
defaults write -g KeyRepeat -int 2 # normal minimum is 2 (30 ms)

###################################################################
# Google Chrome                                                   #
###################################################################

# Allow installing user scripts via GitHub Gist or Userscripts.org
defaults write com.google.Chrome ExtensionInstallSources -array "https://gist.githubusercontent.com/" "http://userscripts.org/*"
defaults write com.google.Chrome.canary ExtensionInstallSources -array "https://gist.githubusercontent.com/" "http://userscripts.org/*"

# Disable the all too sensitive backswipe on trackpads
defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool false
defaults write com.google.Chrome.canary AppleEnableSwipeNavigateWithScrolls -bool false

# Disable the all too sensitive backswipe on Magic Mouse
defaults write com.google.Chrome AppleEnableMouseSwipeNavigateWithScrolls -bool false
defaults write com.google.Chrome.canary AppleEnableMouseSwipeNavigateWithScrolls -bool false

# Use the system-native print preview dialog
defaults write com.google.Chrome DisablePrintPreview -bool true
defaults write com.google.Chrome.canary DisablePrintPreview -bool true

# Expand the print dialog by default
defaults write com.google.Chrome PMPrintingExpandedStateForPrint2 -bool true
defaults write com.google.Chrome.canary PMPrintingExpandedStateForPrint2 -bool true

###################################################################
# Dock, desktop                                                   #
###################################################################

# Disable Dashboard
defaults write com.apple.dashboard mcx-disabled -bool true

# Don't show Dashboard as a Space
defaults write com.apple.dock dashboard-in-overlay -bool true

# Don't automatically rearrange Spaces based on most recent use
defaults write com.apple.dock mru-spaces -bool false

# Automatically hide and show the Dock
defaults write com.apple.dock autohide -bool true

# Set the icon size of Dock items to 36 pixels
defaults write com.apple.dock tilesize -int 57

###################################################################
# Safari                                                          #
###################################################################

# Hide Safari's bookmark bar.
defaults write com.apple.Safari ShowFavoritesBar -bool false

# Set up Safari for development.
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
defaults write com.apple.Safari IncludeDevelopMenu -bool true
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
defaults write com.apple.Safari "com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled" -bool true
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true

###################################################################
# Messages                                                        #
###################################################################

# Disable continuous spell checking
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "continuousSpellCheckingEnabled" -bool false

###################################################################
# Kill apps                                                       #
###################################################################

for app in \
  "Activity Monitor" \
  "Address Book" \
  "Calendar" \
  "Contacts" \
  "cfprefsd" \
  "Dock" \
  "Finder" \
  "Google Chrome" \
  "Messages" \
  "Photos" \
  "SystemUIServer" \
  "Terminal"; do
  killall "${app}" &> /dev/null
done


text:
// Copyright 2022, University of Colorado Boulder

/**
 * Function that returns its input. This was added as an alternative to _.identity because WebStorm did
 * not provide as good navigation for _.identity.
 *
 * @author Sam Reid (PhET Interactive Simulations)
 */

import phetCore from './phetCore.js';

export default function identity<T>( t: T ): T {
  return t;
}

phetCore.register( 'identity', identity );


text:
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace SymMngr.PE
{
    internal class SectionHeader
    {
        internal SectionHeader(IntPtr at, ref int offset)
        {
        }

      //  BYTE Name[IMAGE_SIZEOF_SHORT_NAME];
      //  union {
      //  DWORD PhysicalAddress;
      //      DWORD VirtualSize;
      //  } Misc;
      //  DWORD VirtualAddress;
      //  DWORD SizeOfRawData;
      //  DWORD PointerToRawData;
      //  DWORD PointerToRelocations;
      //  DWORD PointerToLinenumbers;
      //  WORD NumberOfRelocations;
      //  WORD NumberOfLinenumbers;
      //  DWORD Characteristics;
    }
}


text:
PasswordsNavigationObserver::PasswordsNavigationObserver(
    content::WebContents* web_contents)
    : content::WebContentsObserver(web_contents) {}
PasswordsNavigationObserver::~PasswordsNavigationObserver() = default;

void PasswordsNavigationObserver::DidFinishNavigation(
    content::NavigationHandle* navigation_handle) {
  if (!navigation_handle->HasCommitted())
    return;

  if (quit_on_entry_committed_)
    run_loop_.Quit();
}

void PasswordsNavigationObserver::DidFinishLoad(
    content::RenderFrameHost* render_frame_host,
    const GURL& validated_url) {
  render_frame_host_ = render_frame_host;
  if (!wait_for_path_.empty()) {
    if (validated_url.path() == wait_for_path_)
      run_loop_.Quit();
  } else if (!render_frame_host->GetParent()) {
    run_loop_.Quit();
  }
}

void PasswordsNavigationObserver::Wait() {
  run_loop_.Run();
}


text:
<header class="banner" <?= header_background(); ?>>

          <a href="tel:<?php the_field('phone','options'); ?>">Call <?php the_field('phone','options'); ?>

        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#primary_navigation">MENU
          Toggle navigation

        </button>
        <a class="navbar-brand" href="<?= home_url(); ?>" title="<?php bloginfo('name'); ?>">
          <img class="logo" src="<?= get_field('site_logo','options'); ?>" alt="<?php bloginfo('name'); ?>">

          <?php
              wp_nav_menu(array(
                  'menu'              => 'primary_navigation',
                  'theme_location'    => 'primary_navigation',
                  'depth'             => 4,
                  'container'         => 'div',
                  'container_class'   => 'collapse navbar-collapse',
                  'container_id'      => 'primary_navigation',
                  'menu_class'        => 'nav navbar-nav',
                  'fallback_cb'       => 'wp_bootstrap_navwalker::fallback',
                  'walker'            => new wp_bootstrap_navwalker()
                  ));
          ?>

<?php
if(is_front_page()){
  front_page_slider();
  front_page_cards();
} else {
  page_header_area();
}
?>

<?php
  breadcrumbs_and_search();
?>


text:
(function() {
    var Ext = window.Ext4 || window.Ext;

    /**
     * Portfolio Hierarchy App
     * View and rearrange PIs and their user stories
     */
    Ext.define('Rally.apps.portfoliohierarchy.PortfolioHierarchyApp', {
        extend: 'Rally.app.App',
        requires: [
            'Rally.data.util.PortfolioItemHelper',
            'Rally.ui.notify.Notifier',
            'Rally.data.wsapi.Filter',
            'Rally.util.Help',
            'Rally.util.Test'
        ],

        layout: 'auto',

        items:[
            {
                xtype:'container',
                itemId:'header',
                cls:'header'
            },
            {
                xtype:'container',
                itemId:'bodyContainer'
            }
        ],

        appName: 'Portfolio Hierarchy',

        cls: 'portfolio-hierarchy-app',

        launch: function() {

            if(Rally.environment.getContext().getSubscription().isModuleEnabled('Rally Portfolio Manager')) {
                Rally.data.util.PortfolioItemHelper.loadTypeOrDefault({
                    typeRef: this.getSetting('type'),
                    context: this.getContext().getDataContext(),
                    defaultToLowest: false,
                    success: this.addTreeForType,
                    scope: this
                });
            } else {
                this.down('#bodyContainer').add({
                    xtype: 'container',
                    html: '
You do not have RPM enabled for your subscription
'
                });

                if (Rally.BrowserTest) {
                    Rally.BrowserTest.publishComponentReady(this);
                }
            }

            this.tooltip = Ext.create('Rally.ui.tooltip.StateToolTip', {
                target: this.getEl(),
                listeners: {
                    beforeshow: function(tooltip) {
                        var triggerEl = Ext.get(tooltip.triggerElement);
                        var stateValue = triggerEl.getAttribute('state-data');
                        if (stateValue) {
                            tooltip.update(stateValue);
                        }
                    },
                    scope: this
                }
            });

        },

        onDestroy: function() {
            this.tooltip.destroy();
            this.callParent(arguments);
        },

        _drawHeader: function(){
            var header = this.down('#header');
            header.add(this._buildHelpComponent());
            header.add(this._buildFilterInfo());
        },

        addTreeForType: function(record){

            this.typePath = record.get('Name');
            this._drawHeader();

            var tree = this.buildTreeForType(record);
            this.down('#bodyContainer').add(tree);

            tree.on('initialload', function(){
                if (Rally.BrowserTest) {
                    Rally.BrowserTest.publishComponentReady(this);
                }
            }, this);

        },

        buildTreeForType: function(typeRecord){
            var me = this;

            var filters = [];
            if (this.getSetting('query')) {
                try {
                  filters.push(Rally.data.QueryFilter.fromQueryString(this.getSetting('query')));
                } catch (e) {
                    Rally.ui.notify.Notifier.showError({
                        message: e.message
                    });
                }
            }

            return Ext.create('Rally.ui.tree.PortfolioTree', {
                stateful: true,
                stateId: this.getAppId() + 'rallyportfoliotree',
                workspace: this.getContext().getWorkspace(),
                topLevelModel: typeRecord.get('TypePath'),
                topLevelStoreConfig: {
                    filters: filters,
                    context: this.getContext().getDataContext()
                },
                childItemsStoreConfigForParentRecordFn: function(){
                    return {
                        context: {
                            project: undefined,
                            workspace: me.getContext().getDataContext().workspace
                        },
                        fetch: this._getChildLevelFetchFields()
                    };
                },
                emptyText: '
No portfolio items of this type found.
' +
                           '
Click the gear to set your project to match the location of your portfolio items or to filter further by type.
'
            });
        },

        _buildHelpComponent:function () {
            return Ext.create('Ext.Component', {
                cls:Rally.util.Test.toBrowserTestCssClass('portfolio-hierarchy-help-container'),
                renderTpl: Rally.util.Help.getIcon({
                    id: 268
                })
            });
        },

        _buildFilterInfo: function(){
            return Ext.create('Rally.ui.tooltip.FilterInfo', {
                projectName: this.getSetting('project') && this.getContext().get('project').Name || 'Following Global Project Setting',
                typePath: this.typePath,
                scopeUp: this.getSetting('projectScopeUp'),
                scopeDown: this.getSetting('projectScopeDown'),
                query: this.getSetting('query')
            });
        }

    });
})();


text:
New features
------------

* `FieldsWrapper` now implements the `__array__()` method. This speeds up accessing fields with functions that expect an `__array__()` method, like `np.asarray()`.

Deprecations
------------

* <news item>

Exposing HDF5 functions
-----------------------

* <news item>

Bug fixes
---------

* <news item>

Building h5py
-------------

* <news item>

Development
-----------

* <news item>


text:
package be.cytomine.client.abst;

import be.cytomine.client.*;
import java.util.*;
import org.json.simple.*;

import be.cytomine.client.SecRole;
import be.cytomine.client.Server;
import org.json.simple.JSONObject;

/**
 * A user role on the full app (user, admin, guest,...)
 *
 * @author ClientBuilder (Loïc Rollus)
 * @version 0.1
 *
 * DO NOT EDIT THIS FILE. THIS IS CODE IS BUILD AUTOMATICALY. ALL CHANGE WILL BE LOST AFTER NEXT GENERATION.
 *
 * IF YOU WANT TO EDIT A DOMAIN FILE (change method, add property,...), JUST EDIT THE CHILD FILE "YourDomain.java" instead of this file "AbstractYourDomain.java". I WON'T BE CLEAR IF IT ALREADY EXIST.
 *
 */
public abstract class AbstractSecRole
    extends AbstractDomain
{

    /**
     * The role name
     *
     */
    protected String authority;

    /**
     *
     * @return
     *     The role name
     */
    public String getAuthority()
        throws Exception
    {
        return authority;
    }

    /**
     *
     * @param authority
     *     The role name
     */
    public void setAuthority(String authority)
        throws Exception
    {
        this.authority = authority;
    }

    public void build(String authority)
        throws Exception
    {

		this.authority=authority;

    }

    public void build(JSONObject json)
        throws Exception
    {

		this.authority =JSONUtils.extractJSONString(json.get("authority"));

    }

    public JSONObject toJSON()
        throws Exception
    {

		JSONObject json=new JSONObject();
		json.put("authority",JSONUtils.formatJSON(this.authority));

		return json;

    }

    public static SecRole get(Server server, Long id)
        throws Exception
    {

		String path = "/api/role/{id}.json?";
		path = path.replace("{id}",id+"");

		JSONObject json = server.doGET(path);
		SecRole domain = new SecRole();
		domain.build(json);
		return domain;

    }

    public static SecRole list(Server server, Integer max, Integer offset)
        throws Exception
    {

		throw new Exception("Not yet implemented");

    }

}


text:
- This app will show a live departure board for any bus stop in London.
- There's a map, which lets you find any stop in London. (Using Google Maps API)
- A user can select a specific stop, and see its imminent departures.

## Prerequisites

### Node.js

- Download and install [Node.js][node-download-url].
- Install the tool dependencies (`npm install`).

### Installing dependencies

The application needs some dependencies, such as Bower, Bootstrap, Angular files, etc.  You can install these by running:

```
npm install
```

### Running the app

- Run `npm start`
- Navigate your browser to `http://localhost:8000/app` to see the app running in your browser.

[node-download-url]: https://nodejs.org/en/download/


text:
<?php

namespace OpsWay\TocatUserTest\Entity;

use OpsWay\TocatUser\Entity\Permission as Entity;
use OpsWay\TocatUser\Entity\Role;

class PermissionTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var Entity
     */
    protected $permission;

    public function setUp()
    {
        $permission = new Entity();
        $this->permission = $permission;
    }

    public function testSetGetId()
    {
        $this->assertEquals($this->permission, $this->permission->setId(1));
        $this->assertEquals(1, $this->permission->getId());
    }

    public function testSetGetResource()
    {
        $this->assertEquals($this->permission, $this->permission->setResource('test'));
        $this->assertEquals('test', $this->permission->getResource());
    }

    public function testSetGetPrivileges()
    {
        $this->assertEquals($this->permission, $this->permission->setPrivileges('test desc'));
        $this->assertEquals('test desc', $this->permission->getPrivileges());
    }

    public function testSetGetType()
    {
        $this->assertEquals($this->permission, $this->permission->setType('test'));
        $this->assertEquals('test', $this->permission->getType());
    }

    public function testSetGetRole()
    {
        $this->assertEquals($this->permission, $this->permission->setRole(new Role()));
        $this->assertNotEquals((new Role())->setId(2), $this->permission->getRole());
        $this->assertEquals(new Role(), $this->permission->getRole());
    }
}


text:
Input Lokasi

Klik pada Peta untuk mendapatkan Longitude dan Latitude

Lattitude:

Longitude:

Lat Lng:

					            <form role="form">

					                  Latitude
					                  <input type="text" class="form-control" id="Lattitudeclicked" placeholder="Enter Latitude">

					                  Longitude
					                  <input type="text" class="form-control" id="Longitudeclicked" placeholder="Enter Longitude">

					                <button type="submit" class="btn btn-primary">Submit</button>

					            </form>


text:
package com.cloudTop.starshare.ui.main.activity;

import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.cloudTop.starshare.base.BaseActivity;
import com.cloudTop.starshare.widget.NormalTitleBar;
import com.cloudTop.starshare.R;
import com.cloudTop.starshare.been.MoneyDetailListBean;
import com.cloudTop.starshare.greendao.GreenDaoManager;
import com.cloudTop.starshare.greendao.StarInfo;
import com.cloudTop.starshare.ui.view.RoundImageView;
import com.cloudTop.starshare.utils.BuyHandleStatuUtils;
import com.cloudTop.starshare.utils.ImageLoaderUtils;
import com.cloudTop.starshare.utils.LogUtils;

import java.util.List;

import butterknife.Bind;

/**
 * Created by sll on 2017/5/25.
 */

public class BillingDetailsActivity extends BaseActivity {
    @Bind(R.id.nt_title)
    NormalTitleBar ntTitle;
    @Bind(R.id.headImage)
    RoundImageView headImage;
    @Bind(R.id.tv_billing_detail_money)
    TextView tvBillingDetailMoney;
    @Bind(R.id.tv_service_recharge)
    TextView tvServiceRecharge;
    @Bind(R.id.ll_service_recharge)
    LinearLayout llServiceRecharge;
    @Bind(R.id.tv_detail_bank_info)
    TextView tvDetailBankInfo;
    @Bind(R.id.ll_bank_info)
    LinearLayout llBankInfo;
    @Bind(R.id.tv_detail_setup_time)
    TextView tvDetailSetupTime;
    @Bind(R.id.ll_setup_time)
    LinearLayout llSetupTime;
    @Bind(R.id.tv_billing_bank_info)
    TextView billingBankInfo;
    @Bind(R.id.tv_petname)
    TextView petname;
    @Bind(R.id.tv_status)
    TextView status;

    @Override
    public int getLayoutId() {
        return R.layout.activity_billing_details;
    }

    @Override
    public void initPresenter() {
    }

    @Override
    public void initView() {
        ntTitle.setTitleText(getResources().getString(R.string.money_billing_detail));
        initData();
    }

    private void initData() {
        Bundle bundle = getIntent().getExtras();
        MoneyDetailListBean bean = bundle.getParcelable("dealDetail");
        if (bean != null) {
            LogUtils.logd("获取到信息---");
            String plus_minus;
            if (bean.getRecharge_type() == 0) {
                plus_minus = "+";
                petname.setText(BuyHandleStatuUtils.getRechargeType(bean.getDepositType()));
                headImage.setImageResource(BuyHandleStatuUtils.getRechargeImg(bean.getDepositType()));
                status.setText(BuyHandleStatuUtils.getRechargeStatus(bean.getStatus()));
                billingBankInfo.setText(getString(R.string.recharge_info));
                tvDetailBankInfo.setText(BuyHandleStatuUtils.getRechargeType(bean.getDepositType()));
            } else {
                plus_minus = "-";
                billingBankInfo.setText(getString(R.string.money_issuer_info));
                List<StarInfo> starInfos = GreenDaoManager.getInstance().queryLove(bean.getTransaction_id());
                if (starInfos.size() != 0) {
                    StarInfo starInfo = starInfos.get(0);
                    petname.setText(starInfo.getName());
                    ImageLoaderUtils.display(this, headImage, starInfo.getPic_url());
                    tvDetailBankInfo.setText(String.format(mContext.getString(R.string.name_code), starInfo.getName(), bean.getTransaction_id()));
                }
                if (bean.getRecharge_type() == 1) {  //约见记录
                    status.setText("约见");
                } else if (bean.getRecharge_type() == 2) {  //聊天记录
                    status.setText("星聊");
                }
            }
            tvBillingDetailMoney.setText(plus_minus + bean.getAmount() + "");
            tvServiceRecharge.setText("");   //临时设置
            tvDetailSetupTime.setText(bean.getDepositTime());
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;

namespace XProxy.Core
{
    public class RequestAnalysisEngine
    {
        private readonly int _maxQueueSize;

        private readonly AutoInvokerV2<Queue<RequestContext>> _worker;
        private readonly IList<IRequestAnalyser> _analysers;

        internal RequestAnalysisEngine(int maxQueueSize = 500)
        {
            _maxQueueSize = maxQueueSize;
            _worker = new AutoInvokerV2<Queue<RequestContext>>(Execute, new Queue<RequestContext>(), s => s.Count > 0);
            _analysers = new List<IRequestAnalyser>();
        }

        public IDisposable Pause()
        {
            return _worker.Pause();
        }

        public IEnumerable<IRequestAnalyser> Analysers { get { return _analysers; } }

        public void Register(IRequestAnalyser analyser)
        {
            _analysers.Add(analyser);
        }

        public Task EnqueueRequest(RequestContext requestContext)
        {
            lock (_worker)
            {
                _worker.State.Enqueue(requestContext);

                if (_worker.State.Count > _maxQueueSize)
                {
                    Console.WriteLine("Queue size exceeded");

                    _worker.Run();
                }
                else
                {
                    _worker.Trigger();
                }
            }

            return Task.FromResult(true);
        }

        private void Execute(Queue<RequestContext> queue)
        {
            RequestContext next;

            if (queue.Count > 0)
            {
                lock (queue) next = queue.Dequeue();

                Stream data = null;

                foreach (var analyser in _analysers)
                {
                    Console.WriteLine("Anaylsing {0} ({1})", next.OriginUrl, analyser);

                    try
                    {
                        var runTask = analyser.Run(next);

                        data = runTask.Result;

                        next = next.Chain(data);
                    }
                    catch (Exception ex)
                    {
                        Console.Write(ex);
                        break;
                    }
                }

                next.Dispose();
            }

            if (queue.Count > 0)
            {
                _worker.Trigger();

                Console.WriteLine("Queue size = {0}", queue.Count);
            }
        }
    }
}


text:
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
from scipy import linalg

def getSortedEigen(T):
    eigenvals, eigenvectors = linalg.eig(T, left=True, right=False)
    sortedIndices = np.argsort(eigenvals)[::-1]
    return eigenvals[sortedIndices], eigenvectors[:, sortedIndices]

def getStationaryDistr(lowestEigenvector):
    absStationary = np.abs(lowestEigenvector)
    return absStationary / absStationary.sum()


text:
<?php

require_once('../../config.php');

//////////////////////////////////////////////////////////////////
// Verify Session or Key
//////////////////////////////////////////////////////////////////

checkSession();

?>
<form onsubmit="return false;">
<?php

switch($_GET['action']){

    //////////////////////////////////////////////////////////////////
    // Confirm Close Unsaved File
    //////////////////////////////////////////////////////////////////
    case 'confirm':
    $path = $_GET['path'];
    ?>
    Close Unsaved File?

<?php echo($path); ?>

    <button class="btn-left" onclick="save_and_close('<?php echo($path); ?>'); return false;">Save & Close</button><button class="btn-mid" onclick="close_without_save('<?php echo($path); ?>'); return false;">Discard Changes</button><button class="btn-right" onclick="codiad.modal.unload(); return false;">Cancel</button>
    <?php
    break;

}

?>
</form>


text:
/// <reference path="jquery-1.10.2.min.js" />

//http://stackoverflow.com/questions/22795074/why-should-i-reference-jquery-in-a-self-contained-function

(function ShowHideFooter($, undefined) {
    //alert($(window).height());
    //alert($(document).height());
    $('body').height($(window).height());

    //var footer = $('.footer');
    //var start = $(footer).offset().top;
    //$.event.add(window, "scroll", function () {
    //    var p = $(window).scrollTop();
    //    alert(p);
    //    $(footer).css('position', ((p) > start) ? 'fixed' : 'static');
    //    $(footer).css('top', ((p) > start) ? '0px' : '');
    //});
    $('i.entypo-cancel').hide();

    $('.contact-header').on('click', function () {
        var isOpen = $('i.entypo-cancel').is(':visible');
        if (isOpen) {
            $('i.entypo-down-open-big').show();
            $('i.entypo-cancel').hide();
            $('.contact-header-sub').css('background-position-y', '-5em');
            $('.contact-header-subsub').css('background-position-y', '0em');
            $('.contact-list').css('background-color', '#060606');
            $('.contact-list').css('opacity', '0.75');
            $("#footer").animate({
                "margin-top": "+=140",
            }, 500, function () {});
        } else {
            $('i.entypo-down-open-big').hide();
            $('i.entypo-cancel').show();
            $('.contact-header-sub').css('background-position-y', '-15em');
            $('.contact-header-subsub').css('background-position-y', '-10em');
            $('.contact-list').css('background-color', '#444');
            $('.contact-list').css('opacity', '1');
            $("#footer").animate({
                "margin-top": "-=140",
            }, 500, function () {});
        }
    });
})(jQuery);

(function($, undefined) {
    var navbar = $('.navbar');
    var start = $(navbar).offset().top - 50;
    $.event.add(window, "scroll", function () {
        var left = $(navbar).offset().left;
        var p = $(window).scrollTop();
        $(navbar).css('position', ((p) > start) ? 'fixed' : 'static');
        if (p > start) {
            $('.navbar-title').fadeIn(300)
            navbar.css('left', left);
        } else {
            $('.navbar-title').hide();
        }
        $(navbar).css('top', ((p) > start) ? '0px' : '');
    });
})(jQuery);

(function () {
    $(".meter > span").each(function () {
        $(this)
            .data("origWidth", $(this).width())
            .width(0)
            .animate({
                width: $(this).data("origWidth")
            }, 1200);
    });
})(jQuery);

(function () {
    //// similar behavior as an HTTP redirect
    //window.location.replace("http://stackoverflow.com");

    //// similar behavior as clicking on a link
    //window.location.href = "http://stackoverflow.com";
    $(document).on("change", "select#categoryFilter", function (e) {
        var option = $(this).find('option:selected');
        window.location.replace("/Category/ProductList/" + option.attr('id'));
    });
})(jQuery);