text:
<?php
/**
 * Hi, I'm your main template file.
 *
 * I am the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * I'm used to display a page when nothing more specific matches a query.
 * E.g., I put together the home page when no home.php file exists.
 * Learn more! -> http://codex.wordpress.org/Template_Hierarchy
 *
 * @package cc2
 * @since 2.0
 *
 */
$content_class = array('main-content-inner');

get_header(); ?>

                <?php do_action( 'cc_first_inside_main_content'); ?>

				<?php if( cc2_display_sidebar( 'left' ) ) : ?>
					<?php get_sidebar( 'left' ); ?>
				<?php endif; ?>

                <div id="content" class="<?php echo apply_filters( 'cc2_content_class', $content_class ); ?>">

                    <?php do_action( 'cc_first_inside_main_content_inner'); ?>

                    <?php

                    /* This is a Loop Designer Ready Theme:
                     * before we enter the loop we should check if TK Loop Designer is activated
                     * and if another Loop Template is chosen than the default one (named "blog style").
                     */
                    if( function_exists( 'tk_loop_designer_the_loop' ) && 'blog-style' !== get_theme_mod( 'cc_list_post_style' ) ) {

                        // If we got this far, the Loop Designer is active and we call the TK Loop Designer Loop.
                        // Let's do it.
                        tk_loop_designer_the_loop( get_theme_mod( 'cc_list_post_style' ), 'index', 'show' );

                    } else {

                        /* If we landed here, the Loop Designer is not active
                         * or we wan to display the blog style loop anyway. Here it goes..
                         */
                        if ( have_posts() ) : ?>

                                        <?php /* Start the loop */ ?>
                                        <?php while ( have_posts() ) : the_post(); ?>

                                            <?php
                                                /* Include the post-format-specific template for the content.
                                                 * If you want to overload this in a child theme then include a file
                                                 * called content-___.php (where ___ is the Post Format name) and that will be used instead.
                                                 */
                                                get_template_part( 'content', get_post_format() );
                                            ?>

                                        <?php endwhile; ?>

									<?php // Get the page navigation for older and newer posts
									do_action('cc2_have_posts_after_loop' );
									?>

                        <?php else : ?>

                            <?php // If we ended up here, we got no posts to show. ?>
                            <?php get_template_part( 'no-results', 'index' ); ?>

                        <?php endif; ?>

                    <?php } // we're through! that was the whole loop thing! let's move on to the sidebar.. ?>

                    <?php do_action('tk_sidebars_index'); ?>

				<?php if( cc2_display_sidebar( 'right' ) ) : ?>
					<?php get_sidebar( 'right' ); ?>
				<?php endif; ?>

<?php get_footer(); ?>


text:
import vtk.vtkNativeLibrary;
import vtk.vtkActor;
import vtk.vtkRenderWindowInteractor;
import vtk.vtkSphereSource;
import vtk.vtkNamedColors;
import vtk.vtkPolyDataMapper;
import vtk.vtkCompassRepresentation;
import vtk.vtkCompassWidget;
import vtk.vtkRenderWindow;
import vtk.vtkRenderer;

public class CompassWidget  {
  // private static final long serialVersionUID = 1L;

  // -----------------------------------------------------------------
  // Load VTK library and print which library was not properly loaded
  static {
    if (!vtkNativeLibrary.LoadAllNativeLibraries()) {
      for (vtkNativeLibrary lib : vtkNativeLibrary.values()) {
        if (!lib.IsLoaded()) {
          System.out.println(lib.GetLibraryName() + " not loaded");
        }
      }
    }
    vtkNativeLibrary.DisableOutputWindow(null);
  }
  // -----------------------------------------------------------------

  public static void main(String s[]) {

    vtkNamedColors Color = new vtkNamedColors();

    //For Renderer Background Color
    double BgColor[] = new double[4];
    //Change Color Name to Use your own Color for Renderer Background
    Color.GetColor("Black",BgColor);

    //Create a Sphere
    vtkSphereSource Sphere = new vtkSphereSource();
    Sphere.SetCenter(0.0,0.0,0.0);
    Sphere.SetRadius(4.0);
    Sphere.Update();

    //Create a Mapper and Actor
    vtkPolyDataMapper Mapper = new vtkPolyDataMapper();
    Mapper.SetInputConnection(Sphere.GetOutputPort());

    vtkActor Actor = new vtkActor();
    Actor.SetMapper(Mapper);

    // An interactor
    vtkRenderWindowInteractor iren = new vtkRenderWindowInteractor();

    vtkCompassRepresentation CompassRepresentation = new vtkCompassRepresentation();
    vtkCompassWidget CompassWidget = new vtkCompassWidget();
    CompassWidget.SetRepresentation(CompassRepresentation);
    CompassWidget.EnabledOn();
    CompassWidget.SetInteractor(iren);

    // Create the renderer, render window and interactor.
    vtkRenderer ren = new vtkRenderer();
    vtkRenderWindow renWin = new vtkRenderWindow();
    renWin.AddRenderer(ren);
    renWin.SetInteractor(iren);
    iren.SetRenderWindow(renWin);

    // Visualise the arrow
    ren.AddActor(Actor);
    ren.SetBackground(BgColor);
    ren.ResetCamera();

    CompassWidget.EnabledOn();

    renWin.SetSize(300, 300);
    renWin.Render();

    iren.Start();
    iren.Initialize();

  }
}

redpajama_set_name: RedPajamaGithub


text:
package snapshot

import (
	"bytes"
	"encoding/json"
	"fmt"

	"github.com/GoogleContainerTools/kaniko/pkg/timing"
	"github.com/GoogleContainerTools/kaniko/pkg/util"
)

type LayeredMap struct {
	adds    []map[string]string   // All layers with added files.
	deletes []map[string]struct{} // All layers with deleted files.

	currentImage        map[string]string // All files and hashes in the current image (up to the last layer).
	isCurrentImageValid bool              // If the currentImage is not out-of-date.

	layerHashCache map[string]string
	hasher         func(string) (string, error)
}

// NewLayeredMap creates a new layered map which keeps track of adds and deletes.
func NewLayeredMap(h func(string) (string, error)) *LayeredMap {
	l := LayeredMap{
		hasher: h,
	}

	l.currentImage = map[string]string{}
	l.layerHashCache = map[string]string{}
	return &l
}

// Snapshot creates a new layer.
func (l *LayeredMap) Snapshot() {

	// Save current state of image
	l.updateCurrentImage()

	l.adds = append(l.adds, map[string]string{})
	l.deletes = append(l.deletes, map[string]struct{}{})
	l.layerHashCache = map[string]string{} // Erase the hash cache for this new layer.
}

// Key returns a hash for added and delted files.
func (l *LayeredMap) Key() (string, error) {

	var adds map[string]string
	var deletes map[string]struct{}

	if len(l.adds) != 0 {
		adds = l.adds[len(l.adds)-1]
		deletes = l.deletes[len(l.deletes)-1]
	}

	c := bytes.NewBuffer([]byte{})
	enc := json.NewEncoder(c)
	err := enc.Encode(adds)
	if err != nil {
		return "", err
	}
	err = enc.Encode(deletes)
	if err != nil {
		return "", err
	}
	return util.SHA256(c)
}

// getCurrentImage returns the current image by merging the latest
// adds and deletes on to the current image (if its not yet valid.)
func (l *LayeredMap) getCurrentImage() map[string]string {
	if l.isCurrentImageValid || len(l.adds) == 0 {
		// No layers yet or current image is valid.
		return l.currentImage
	}

	current := map[string]string{}

	// Copy current image paths/hashes.
	for p, h := range l.currentImage {
		current[p] = h
	}

	// Add the last layer on top.
	addedFiles := l.adds[len(l.adds)-1]
	deletedFiles := l.deletes[len(l.deletes)-1]

	for add, hash := range addedFiles {
		current[add] = hash
	}

	for del := range deletedFiles {
		delete(current, del)
	}

	return current
}

// updateCurrentImage update the internal current image by merging the
// top adds and deletes onto the current image.
func (l *LayeredMap) updateCurrentImage() {
	if l.isCurrentImageValid {
		return
	}

	l.currentImage = l.getCurrentImage()
	l.isCurrentImageValid = true
}

// get returns the current hash in the current image `l.currentImage`.
func (l *LayeredMap) get(s string) (string, bool) {
	h, ok := l.currentImage[s]
	return h, ok
}

// GetCurrentPaths returns all existing paths in the actual current image
// cached by FlattenLayers.
func (l *LayeredMap) GetCurrentPaths() map[string]struct{} {
	current := l.getCurrentImage()

	paths := map[string]struct{}{}
	for f := range current {
		paths[f] = struct{}{}
	}
	return paths
}

// AddDelete will delete the specific files in the current layer.
func (l *LayeredMap) AddDelete(s string) error {
	l.isCurrentImageValid = false

	l.deletes[len(l.deletes)-1][s] = struct{}{}
	return nil
}

// Add will add the specified file s to the current layer.
func (l *LayeredMap) Add(s string) error {
	l.isCurrentImageValid = false

	// Use hash function and add to layers
	newV, err := func(s string) (string, error) {
		if v, ok := l.layerHashCache[s]; ok {
			return v, nil
		}
		return l.hasher(s)
	}(s)

	if err != nil {
		return fmt.Errorf("Error creating hash for %s: %w", s, err)
	}

	l.adds[len(l.adds)-1][s] = newV
	return nil
}

// CheckFileChange checks whether a given file (needs to exist) changed
// from the current layered map by its hashing function.
// If the file does not exist, an error is returned.
// Returns true if the file is changed.
func (l *LayeredMap) CheckFileChange(s string) (bool, error) {
	t := timing.Start("Hashing files")
	defer timing.DefaultRun.Stop(t)

	newV, err := l.hasher(s)
	if err != nil {
		return false, err
	}

	// Save hash to not recompute it when
	// adding the file.
	l.layerHashCache[s] = newV

	oldV, ok := l.get(s)
	if ok && newV == oldV {
		// File hash did not change => Unchanged.
		return false, nil
	}

	// File does not exist in current image,
	// or it did change => Changed.
	return true, nil
}


text:
/*  Copyright (c) 2009 Facebook
 *
 *  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.
 */

/**
 * Helper javascript functions for XHProf report tooltips.
 *
 * @author Kannan Muthukkaruppan
 */

// Take a string which is actually a number in comma separated format
// and return a string representing the absolute value of the number.
function dateToString (date) {
    var min = date.getMinutes();
    if ( min > 55 ) {
        diff = 60-min ;
        var new_timestamp = date.getTime() + diff * 60 * 1000;
        date = new Date( new_timestamp);
        min = date.getMinutes();
    }
    if ( min > 25 && min < 35) {
        diff = 30-min;
        var new_timestamp = date.getTime() + diff * 1000;
        date = new Date( new_timestamp);
        min = date.getMinutes();
    }
    var month = date.getMonth() +1;
    var day = date.getDate();
    var year = date.getFullYear();
    var hour = date.getHours();
    var nxt_hour = date.getHours();
    var nxt_min = date.getMinutes();
    if ( min > 0 ) {
        nxt_hour += 1;
        nxt_min = "00";
    }
    else {
        min = "0"+min;
        nxt_min = "30";
    }
    return ( month + "/" + day +"/" + year +"    "+hour+":"+min+" - "+nxt_hour+":"+nxt_min);
}
function convertToDate(timeslot) {
	var timeslot = timeslot * 1000;
	var d = new Date();
	var g = -d.getTimezoneOffset();
	g = g * 60;
	timeslot = timeslot+g;
	var date = new Date(timeslot);
	return date;
}
function getArrayIdName() {
	/*
	 $.getJSON("?array="+ $('#ArrayListPopup option:selected').val(),
          { game: $('#GameListPopup option:selected').val(), timestamp: timeStamp2 },
          function(json){
                new_win.location.href =url;
                }
        );
	*/
}
function newUrlFunction(new_url) {
	var  loc = document.location.toString();
	var new_loc ="";
        if ( loc.search('index.php') >= 0) {
			new_loc = loc.replace('index.php',new_url);
        }
        else {
			new_loc = loc.replace('?',new_url+'?');
        }
	return new_loc;
}
function changeUrlfn(new_url) {
	var  loc = document.location.toString();
	if ( loc.search('index.php') >= 0) {
		new_loc = loc.replace('index.php',new_url);
		new_loc =new_loc.replace('&symbol=',"&func=");
		document.location.href = new_loc ;
	}
	else {
		new_loc = loc.replace('?',new_url+'?');
		new_loc =new_loc.replace('&symbol=',"&func=");
		document.location.href = new_loc ;
	}
}

function changeUrl(new_url) {
	var  loc = document.location.toString();
	if ( loc.search('index.php') >= 0) {
		new_loc = loc.replace('index.php',new_url);
		document.location.href = new_loc ;
	}
	else {
		new_loc = loc.replace('?',new_url+'?');
		document.location.href = new_loc ;
	}
}
function myCustomInitialSort(a,b){
	var url = document.location.toString();
	var param = (url.substring(url.indexOf("?")+1));
	var row = "wt";
	var type = "desc";
	if ( param.indexOf("sort_row") > 0 ) {
		row = param.substring(param.indexOf("sort_row")+9);
		if ( row.indexOf("&") > 0 )
			row = row.substring(0,row.indexOf("&"));
	}
	if ( param.indexOf("sort_type") > 0 ) {
		type = param.substring(param.indexOf("sort_type") + 10);
		if ( type.indexOf("&")>0 )
			type = type.substring(0,type.indexOf("&"));
	}
	if ( type == "desc" ) {
		if ( a[row] > b[row] )
			return -1;
		else
			return 1;
	}
	else if ( type == "asc" ) {
		if ( a[row] > b[row] )
			return 1;
		else
			return -1;
	}
};

var host= document.location.host;
function stringAbs(x) {
	return x.replace("-", "");
}
// TODO replace it
function searchfield_focus() {
	if ( $('#fn-input').val() == 'Function Search')
		$('#fn-input').val('');
}

	// Takes a number in comma-separated string format, and
	// returns a boolean to indicate if the number is negative
	// or not.
function isNegative(x) {
	return (x.indexOf("-") == 0);
}

function addCommas(nStr)
{
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}
	return x1 + x2;
}

// Mouseover tips for parent rows in parent/child report..
function ParentRowToolTip(cell, metric)
{
	var metric_val;
	var parent_metric_val;
	var parent_metric_pct_val;
	var col_index;
	var diff_text;
	row = cell.parentNode;
	tds = row.getElementsByTagName("td");

	parent_func    = tds[0].innerHTML;  // name

	if (diff_mode) {
		diff_text = " diff ";
	} else {
		diff_text = "";
	}

	s = '';

	if (metric == "ct") {
		parent_ct      = tds[1].innerHTML;  // calls
		parent_ct_pct  = tds[2].innerHTML;

		func_ct = addCommas(func_ct);

		if (diff_mode) {
		  s += 'There are ' + stringAbs(parent_ct) +
			(isNegative(parent_ct) ? ' fewer ' : ' more ') +
			' calls to ' + func_name + ' from ' + parent_func + '
';

		  text = " of diff in calls ";
		}  else {
		  text = " of calls ";
		}

		s += parent_ct_pct + text + '(' + parent_ct + '/' + func_ct + ') to '
		  + func_name + ' are from ' + parent_func + '
';
	}
	else {

		// help for other metrics such as wall time, user cpu time, memory usage
		col_index = metrics_col[metric];
		parent_metric_val     = tds[col_index].innerHTML;
		parent_metric_pct_val = tds[col_index+1].innerHTML;

		metric_val = addCommas(func_metrics[metric]);

		s += parent_metric_pct_val + '(' + parent_metric_val + '/' + metric_val
		  + ') of ' + metrics_desc[metric] +
		  (diff_mode ? ((isNegative(parent_metric_val) ?
						" decrease" : " increase")) : "") +
		  ' in ' + func_name + ' is due to calls from ' + parent_func + '
';
	  }

	s += '';
	return s;
}

// Mouseover tips for child rows in parent/child report..
function ChildRowToolTip(cell, metric)
{
  var metric_val;
  var child_metric_val;
  var child_metric_pct_val;
  var col_index;
  var diff_text;

  row = cell.parentNode;
  tds = row.getElementsByTagName("td");

  child_func   = tds[0].innerHTML;  // name

  if (diff_mode) {
	diff_text = " diff ";
  } else {
	diff_text = "";
  }

  s = '';

  if (metric == "ct") {

	child_ct     = tds[1].innerHTML;  // calls
	child_ct_pct = tds[2].innerHTML;

	s += func_name + ' called ' + child_func + ' ' + stringAbs(child_ct) +
	  (diff_mode ? (isNegative(child_ct) ? " fewer" : " more") : "" )
		+ ' times.
';
	s += 'This accounts for ' + child_ct_pct + ' (' + child_ct
		+ '/' + total_child_ct
		+ ') of function calls made by '  + func_name + '.';

  } else {

	// help for other metrics such as wall time, user cpu time, memory usage
	col_index = metrics_col[metric];
	child_metric_val     = tds[col_index].innerHTML;
	child_metric_pct_val = tds[col_index+1].innerHTML;

	metric_val = addCommas(func_metrics[metric]);

	if (child_func.indexOf("Exclusive Metrics") != -1) {
	  s += 'The exclusive ' + metrics_desc[metric] + diff_text
		+ ' for ' + func_name
		+ ' is ' + child_metric_val + "
";

	  s += "which is " + child_metric_pct_val + " of the inclusive "
		+ metrics_desc[metric]
		+ diff_text + " for " + func_name + " (" + metric_val + ").";

	} else {

	  s += child_func + ' when called from ' + func_name
		+ ' takes ' + stringAbs(child_metric_val)
		+ (diff_mode ? (isNegative(child_metric_val) ? " less" : " more") : "")
		+ " of " + metrics_desc[metric] + "
";

	  s += "which is " + child_metric_pct_val + " of the inclusive "
		+ metrics_desc[metric]
		+ diff_text + " for " + func_name + " (" + metric_val + ").";
	}
  }

  s += '';

  return s;
}

/* Edited from xhprof js file
 *
 *
 *
*/

var zperfmon = window.zperfmon ||  {};   //namespace
var xhprof ;
zperfmon.xhprof = (function() {
	// saves the value of yahoo 2 in a temp variable to be used by datatable
	var YAHOO;
	var sumx ={};
	var sum_main = {};
	var sum_child = {};
	var sum_parent = {};
	var symbol ;
	return {
		init: function(){
			var url = document.location.toString();
			var param = (url.substring(url.indexOf("?")+1));
			symbol = param.substring(param.indexOf("symbol")+7);
			if(symbol.indexOf("&")>0)
				symbol = symbol.substring(0,symbol.indexOf("&"))

			YUI().use('autocomplete','yui2-dragdrop', 'autocomplete-filters', 'autocomplete-highlighters','yui2-cookie','yui2-paginator', 'yui2-datasource', 'yui2-datatable', 'yui2-logger', function(Y)
			{
				YAHOO = Y.YUI2;
			});
		},

		/*
		 * sets yui cookie
		*/
		set_cookie: function (value){
			YAHOO.util.Cookie.setSub("zperfmon_xhprof","rows",value);
		},
		/*
		 * Read yui cookie
		*/
		get_cookie: function (){
			return YAHOO.util.Cookie.getSub("zperfmon_xhprof","rows");
		},

		custom_field_sortFunction : function(a, b, desc, field) {
			var custom_sort_field = "type";
			if(!YAHOO.lang.isValue(a)) {
				return (!YAHOO.lang.isValue(b)) ? 0 : 1;
			} else if(!YAHOO.lang.isValue(b)) {
				return -1;
			}

			// First compare by Column2
			var comp = YAHOO.util.Sort.compare;
			var compState = comp(a.getData(custom_sort_field), b.getData(custom_sort_field), desc);
			if(a.getData(custom_sort_field) == 'Current Function' && b.getData(custom_sort_field) == 'Current Function'){
				if(a.getData(field) == 'Exclusive Metrics for Current function'){
					return 1;
				}
			}
			if(a.getData(custom_sort_field) == 'Current Function'){
				return -1;
			}
			if(b.getData(custom_sort_field) == 'Current Function'){
				return 1;
			}
			if(a.getData(custom_sort_field) == 'child' && b.getData(custom_sort_field)=='parent'){
				return -1;
			}

			// If values are equal, then compare by Column1
			return (compState !== 0) ? compState : comp(a.getData(field), b.getData(field), desc);
		},
		myPerSortFunction : function(a, b, desc, field) {
			// Deal with empty values
			if(!YAHOO.lang.isValue(a)) {
				return (!YAHOO.lang.isValue(b)) ? 0 : 1;
			} else if(!YAHOO.lang.isValue(b)) {
				return -1;
			}

			// First compare by Column2
			var comp = YAHOO.util.Sort.compare;
			var compState = comp(a.getData("type"), b.getData("type"), desc);
			if(a.getData("type") == 'Current Function' && b.getData("type") == 'Current Function')
			{
				if(a.getData(field) == 'Exclusive Metrics for Current function')
						return 1;
			}
			if(a.getData("type") == 'Current Function')
				return -1;
			if(b.getData("type") == 'Current Function')
				return 1;
			if(a.getData("type") == 'child' && b.getData("type")=='parent')
				return -1
			var key = field.slice(0,field.length-4);
			// If values are equal, then compare by Column1
			return (compState !== 0) ? compState : comp(a.getData(key), b.getData(key), desc);
		},
		percentage : function(elLiner, oRecord, oColumn, oData,field) {
			var key = oColumn.key.slice(0,oColumn.key.length-4);
			var value = oRecord.getData(key);
			var sum =0;
			if(oRecord.getData('type') == 'child')
			{
				sum = sum_parent[key] ;
				if(oColumn.key =='ct_per')
					 sum = sum_child[key];
			}
			else if( oRecord.getData('type') =='parent')
			{
				sum = sum_parent[key];
			}
			else if( oRecord.getData('fn') != 'Exclusive Metrics for Current function')
			{
				sum = sum_main[key];
			}
			else
			{
				sum = sum_parent[key];
			}
			var percentage = ((value / sum)*100).toFixed(1);
			 if ( isNaN(percentage) || percentage == null)
				elLiner.innerHTML = "0.0%";
			else
				elLiner.innerHTML = percentage+"%";
			if( oRecord.getData('type') == 'Current Function')
			{
				if(oColumn.key == 'ct_per')
				{
					 elLiner.innerHTML ="";
				}
			}
			$(elLiner).addClass('right');
		},
		double_number : function (elLiner, oRecord, oColumn, oData,field){
			if ( isNaN(oData) || oData == null)
				elLiner.innerHTML = "0";
			else
				elLiner.innerHTML = addCommas(oData.toFixed(4));
			$(elLiner).addClass('right');
			if(oRecord.getData('fn') == 'Exclusive Metrics for Current function')
			{
				if(oColumn.key == 'ct')
				{
					elLiner.innerHTML ="";
				}
			}
		},

		function_formatter : function (elLiner, oRecord, oColumn, oData,field){
			if(oRecord.getData("fn"))
			{
				var tmp = "";
				var replace_str = "&symbol="+symbol;
				var new_location = document.location.toString();
				new_location = new_location.replace(replace_str,"")+'&symbol='+oData;
				elLiner.innerHTML = ''+oData+tmp+'';
				if(oData == "Exclusive Metrics for Current function")
				{
					elLiner.innerHTML = oData;
				}
			}
		},
		sortPts: function(a, b){
			if(a.type == "parent")
				return 1;
			else if(b.type =="parent")
				return -1;
			else if(a.type =="child")
				return 1;
			else if(b.type =="child")
				return -1;

		},
		percentage_main : function(elLiner, oRecord, oColumn, oData)
		{
			var key = oColumn.key.slice(0,oColumn.key.length-4);
			var value = oRecord.getData(key);
			var percentage = ((value / sumx[key])*100).toFixed(1);
			if ( isNaN(percentage) || percentage == null)
				elLiner.innerHTML = "0.0%";
			else
				elLiner.innerHTML = percentage+"%";
			YAHOO.util.Dom.addClass(elLiner,'right');
		},
		display_paginator :function(){
			var new_oConfigs =
			{
				paginator : null
			};
			var myColumnDefs =
			[
				{label:"Function Name",resizeable:true,key:"fn",width:150, sortable:true,label:"Function Name",formatter:this.function_formatter}
			];
			fields = [];
			for (var j  in myData.posts[0])
			{
				if ( j != 'fn')
					fields.push(j);
			}
			for (var i in myData.posts[0])
			{
				if ( myData.posts[0].hasOwnProperty(i))
				{
					if(!isNaN(myData.posts[0][i]))
					{
						if(i.substring(0,4)=="excl")
						{
							sumx[i]= Math.abs(myData['totals'][i.substring(5)]);
						}
						else
						{
							sumx[i]=Math.abs(myData['totals'][i]);
						}
					}
				}
			}

			for(var i in fields)
			{
				if ( fields.hasOwnProperty(i))
				{
					$("#"+fields[i]).attr('checked','checked');
					$("#"+fields[i]+'_per').attr('checked','checked');
					var obj = {sortable:true, resizeable:true,formatter:this.double_number,sortOptions: { defaultDir: YAHOO.widget.DataTable.CLASS_DESC }};
					obj['key'] = fields[i];
					obj['label'] = fn_header[obj['key']];
					myColumnDefs.push(obj);
					var obj_per = {sortable:true, resizeable:true,formatter:this.percentage_main,sortOptions: { defaultDir: YAHOO.widget.DataTable.CLASS_DESC }};
					obj_per['key'] = fields[i]+'_per';
					obj_per['label'] = fn_header[obj_per['key']];
					obj_per['sortOptions']['field'] = obj['key'];
					myColumnDefs.push(obj_per);
				}
			}
			new_myDataTable = new YAHOO.widget.DataTable("basic",
		   myColumnDefs, myDataTable._oDataSource, new_oConfigs);
			if (self != top )
			{
				 parent.set_page_size($("#basic").children('table').width(),$("#basic").children('table').height()+500);
			}

		},
		select_column: function(){
			var selected_options = "";
			var checkbox_container = document.getElementById("checkbox_container");
			var children = checkbox_container.childNodes;
			var myColumnDefs = [
				{ label:"Function Name",sortable:"true",key:"fn", resizeable:true,formatter:"myCustom",width:150}
			];
			for (var i = 0; i < children.length; i++)
			{
				if(children[i].nodeName=="DIV")
				{
					var obj = {resizeable:true,sortable:true,sortOptions: { defaultDir: YAHOO.widget.DataTable.CLASS_DESC }};
					var obj_per = {resizeable:true,sortable:true,sortOptions: { defaultDir: YAHOO.widget.DataTable.CLASS_DESC }};
					if(children[i].childNodes[0].checked)
					{
						obj['key']=children[i].childNodes[0].id;
						obj['label'] = fn_header[obj['key']];
						selected_options += children[i].childNodes[0].id+" ";
						if(children[i].childNodes[0].id.substring(children[i].childNodes[0].id.length-3) == "per")
						{
							obj['formatter'] = "percentage";
							obj['sortOptions']['field'] = obj['key'].slice(0,obj['key'].length-4);
						}
						else
						{
							obj['formatter'] = "double_number";
						}
						myColumnDefs.push(obj);
					}
				}
			};
			YAHOO.util.Cookie.setSub("zperfmon_xhprof","rows", selected_options);
			myDataTable.setColumns(myColumnDefs);
			if (self != top )
			{
				parent.set_page_size($("#basic").children('table').width(),$("body").height());
			}
			myDataTable.render();
		},
		back: function(){
			window.history.back();
		},
		home: function(){
			var url = document.location.toString();
			// TODO replace symbol with null
			//replace symbol with any invalid iteralal
			url = url.replace('symbol=','xnv=');
			document.location.href = url;
		},
		display_function: function(){
			var th = this;
			var client = new XMLHttpRequest();
			var url = document.location.toString();
//				url = url.replace('index.php','index_json.php');
			url = newUrlFunction('index_json.php');
			client.open("GET", url, true);
			client.onreadystatechange = function()
			{
				if ( client.readyState == 4)
				{
					myData = JSON.parse(client.responseText);
					var data =[];
					var data_parent =[];
					var data_child =[];
					var fields = [];//'fn','type'];
					var i;
					for( i in myData)
					{
					}
					for (var j  in myData[i])
					{
						fields.push(j);
						sum_main[j] = 0;
					}
					for ( i in myData )
					{
						obj = {};
						var fn_child = i.substring(0,i.indexOf("==>"))
						var fn_parent = i.substring(i.indexOf("==>")+3)
						if ( i == "main()")
						{
							for ( var param in myData[i])
							{
								sum_main[param]=myData[i][param];
							}
						}
						for (var j  in myData[i])
						{
							obj[j] = myData[i][j];
						}
						if ( fn_parent == symbol )
						{
							obj['fn'] = fn_child;
							obj['type'] = 'parent';
							data_parent.push(obj);
						}
						else if ( fn_child == symbol)
						{
							obj['fn'] = fn_parent;
							obj['type'] = 'child';
							data_child.push(obj);
						}
					}
					for(i in data_child)
					{
						for(j in data_child[i])
						{
							if(j != 'type' && j != 'fn')
							{
								if(sum_child[j] == undefined)
									sum_child[j]=data_child[i][j];
								else
									sum_child[j]+=data_child[i][j];
							}
						}
					}
					for(i in data_parent)
					{
						for(j in data_parent[i])
						{
							if(j != 'type' && j != 'fn')
							{
								if(sum_parent[j] == undefined)
								{
									sum_parent[j]=data_parent[i][j];
								}
								else
								{
									sum_parent[j]+=data_parent[i][j];
								}
							}
						}
					}

					data = data_parent.concat(data_child);
					var current_fn ={};
					current_fn['fn']=symbol;
					current_fn['type'] = 'Current Function';
					if ( symbol == 'main()' )
					{
						for(var  i in fields)
						{
							current_fn[fields[i]]=sum_main[fields[i]];
							sum_parent[fields[i]]=sum_main[fields[i]];
						}
					}
					else
					{
						for(var  i in fields)
						{
							current_fn[fields[i]]=sum_parent[fields[i]];
						}
					}

					data.push(current_fn);
					var current_fn ={};
					current_fn['fn']="Exclusive Metrics for Current function";
					current_fn['type'] = 'Current Function';
					for(var  i in fields)
					{
						current_fn[fields[i]]=sum_parent[fields[i]]-sum_child[fields[i]];
					}
					data.push(current_fn);
					var  myColumnDefs = [
						{ key: "fn", formatter: th.function_formatter,width:150,label: "Function Name", sortable: true, resizeable: true, sortOptions: { sortFunction: th.custom_field_sortFunction }}//,
					];
					for( i in fields)
					{
						var obj={sortable: true, resizeable: true, sortOptions: { sortFunction: th.custom_field_sortFunction }};
						obj['key']=fields[i];
						obj['label'] = fn_header[obj['key']];
						obj['formatter'] = th.double_number;
						myColumnDefs.push(obj);
						var obj_per = {sortable: true, resizeable: true,formatter:th.percentage,sortOptions: { sortFunction: th.myPerSortFunction }};
						obj_per['key']=obj['key']+'_per';
						obj_per['label'] = fn_header[obj_per['key']];
						myColumnDefs.push(obj_per);
					}
					var fields_all = ['fn','type'];
					fields_all = fields_all.concat(fields);

					var myDataSource = new window.YAHOO.util.DataSource(data); // See data.js
					myDataSource.responseType = window.YAHOO.util.DataSource.TYPE_JSARRAY;
					myDataSource.responseSchema = {
						fields: fields_all
					};
					myDataSource.doBeforeCallback = function (oRequest, oFullResponse, oParsedResponse, oCallback) {
						oParsedResponse.results.sort(th.sortPts);
						return oParsedResponse;
					};
					var myDataTable = new window.YAHOO.widget.GroupedDataTable("function_table",
					myColumnDefs, myDataSource,
					{
						groupBy: "type"//,
					});
					if (self != top )
					{
						parent.set_page_size($("#function_table").children('table').width(),$("#function_table").children('table').height()+500);
					}
					if($("#fn-summary").length > 0)
					{
						for( i in fields)
						{
							if ( fields[i] =='ct')
							{
								$('#fn-summary tr:first').after('
Number of Function Calls	'+sum_parent[fields[i]].toFixed(4)+"
");
							}
							else
							{
								var excl_value = (parseInt(sum_parent[fields[i]])-parseInt(sum_child[fields[i]])).toFixed(4);
								if(isNaN(excl_value)) {
									excl_value=0;
								}
								$('#fn-summary tr').eq(1).after('
'+fn_header_wt_newline["excl_"+fields[i]]+'	'+excl_value+"
");
								$('#fn-summary tr').eq(1).after('
'+fn_header_wt_newline[fields[i]]+'	'+sum_parent[fields[i]].toFixed(4)+"
");
							}
						}
					}
					var showTimer,hideTimer;
					var tt = new window.YAHOO.widget.Tooltip("myTooltip");
					myDataTable.on('cellMouseoverEvent', function (oArgs) {
						if (showTimer) {
							window.clearTimeout(showTimer);
							showTimer = 0;
						}
						var target = oArgs.target;
						var column = this.getColumn(target);
						if (column.key != 'fn') {
							var record = this.getRecord(target);
							var description = 'no further descriptio1n';
							if( record.getData('type') == 'child')
							{
								var key = column.key;
								if( key.indexOf("_per")>0)
									key = key.substring(0,key.indexOf("_per"));
								var per = (record.getData(key)/sum_parent[key])*100;
								per =per.toFixed(2);
								var sum = sum_parent[key].toFixed(4);
								if ( key == 'ct')
									sum = sum_child[key].toFixed(4);
								var value = record.getData(key).toFixed(4);
								if ( key == 'ct')
								{
									sum = sum_child[key].toFixed(4);
									per = (record.getData(key)/sum_child[key])*100;
									per =per.toFixed(2);
								}
								description = record.getData('fn')+" when called from "+symbol+" takes "+value+" of "+fn_header_wt_newline[key]+"
 which is "+per+"% of the "+fn_header_wt_newline[key]+" for "+symbol+" ("+sum+")";

							}
							else if (record.getData('type') == 'parent')
							{
								var key = column.key;
								if( key.indexOf("_per")>0)
										key = key.substring(0,key.indexOf("_per"));
								var per = (record.getData(key)/sum_parent[key])*100;
								per =per.toFixed(2);
								var sum = sum_parent[key].toFixed(4);
								var value = record.getData(key).toFixed(4);
								description = per + "% of "+fn_header_wt_newline[key]+" ("+value+"/"+sum+") to "+symbol+" are from "+record.getData('fn');
							}
							else if( record.getData('fn') != symbol )
							{
								var key = column.key;
								if( key.indexOf("_per")>0)
								   key = key.substring(0,key.indexOf("_per"));
								var per = (record.getData(key)/sum_parent[key])*100;
								per =per.toFixed(2);
								var sum = sum_parent[key].toFixed(4);
								var value = record.getData(key).toFixed(4);
								description = "The exclusive metric "+" for "+symbol+" is "+value+"
which is "+per+"% of the"+fn_header_wt_newline[key]+" for "+symbol+" ("+sum+")";
							}
							var xy = [parseInt(oArgs.event.clientX,10) + 10 ,parseInt(oArgs.event.clientY,10) + 10 ];

							showTimer = window.setTimeout(function() {
								tt.setBody(description);
								tt.cfg.setProperty('xy',xy);
								tt.show();
								hideTimer = window.setTimeout(function() {
									tt.hide();
								},5000);
							},500);
						}
					});
					myDataTable.on('cellMouseoutEvent', function (oArgs) {
						if (showTimer) {
							window.clearTimeout(showTimer);
							showTimer = 0;
						}
						if (hideTimer) {
							window.clearTimeout(hideTimer);
							hideTimer = 0;
						}
						tt.hide();
					});
				}
				$("#loading_image").addClass("hide");
			}
			client.send();
		}
	}
});

$(document).ready(function()
{
	if($('#time').length > 0)
	{
		var date = convertToDate($('#time').text());
		$("#time").text(dateToString(date));
	}
	if($('#time1').length > 0)
	{
		var date = convertToDate($('#time1').text());
		$("#time1").text(dateToString(date));
	}
	if($('#time2').length > 0)
	{
		var date = convertToDate($('#time2').text());
		$("#time2").text(dateToString(date));
	}

	xhprof = new zperfmon.xhprof();
	xhprof.init();
	if( $("#function_table").length > 0)
	{
		$("#callgraph_button_fn").button();
	}
	if ( $('#basic').length > 0 )
	{
		$('#checkbox_container').click(function(){
			xhprof.select_column();
		});
		$('#display_all').click(function(){
			xhprof.display_paginator();
		});

		checkbox_container
		$dialog = $('#checkbox_container')//compareOverlay')
			.dialog({
				autoOpen: false,
				title: 'Select Column',
				width: 300,
				height: "auto",
				hide: "explode",
				position: 'top',
				open:function(event, ui) {
					$('.ui-dialog').css('left','630px');
					$('.ui-dialog').css('top','100px');
					$('#select_column').attr("disabled", true);
					$('#select_column').css('background-color','#AAA');
					$('#select_column').css('background-image','url()');
					$('.ui-dialog-titlebar').css('background','#D8D8DA url(http://yui.yahooapis.com/2.9.0/build/assets/skins/sam/sprite.png) repeat-x 0 0');
				},
				close:function(event, ui) {
					$('#select_column').attr("disabled",false);
					$('#select_column').css('background-image','url(http://hotlink.jquery.com/jqueryui/themes/base/images/ui-bg_glass_75_dadada_1x400.png)');
				}
			});
		$('#select_column').click(function() {
			$dialog.dialog('open');
		});
	}
	if ( $('#function_table').length > 0){
		$('#back_button').button();
		$('#home_button').button();
		xhprof.display_function();
	}
	$('#back_button').click(function(event){
		xhprof.back();
	});
	$('#home_button').click(function(event){
		xhprof.home();
	});

	if ( $('#fn_not_found').length > 0){
		$("#loading_image").addClass("hide");
	}
	if ( $('#diff_page').length > 0){
		$('#callgraph_button').css("display","none");
		$('#piechart').css("display","none");
		fn_header =
		{
			"ct":"Calls Diff",
			"ct_per":"Calls
Diff%",
			"wt":"Incl. Wall
Diff
(microsec)",
			"wt_per":"IWall
 Diff%",
			"excl_wt":"Excl. Wall
Diff
(microsec)",
			"excl_wt_per":"EWall
Diff%",
			"ut":"Incl. User Diff
(microsec)",
			"ut_per":"IUser
Diff%",
			"excl_ut":"Excl. User
Diff
(microsec)",
			"excl_ut_per":"EUser
Diff%",
			"cpu":"Incl. CPU Diff
(microsec)",
			"cpu_per":"ICpu
Diff%",
			"excl_cpu":"Excl. CPU
Diff
(microsec)",
			"excl_cpu_per":"ECpu
Diff%",
			"st":"Incl. Sys Diff
(microsec)",
			"st_per":"ISys
Diff%",
			"excl_st":"Excl. Sys Diff
(microsec)",
			"excl_st_per":"ESys
Diff%",
			"mu":"Incl.
MemUse
Diff
(bytes)",
			"mu_per":"IMemUse
Diff%",
			"excl_mu":"Excl.
MemUse
Diff
(bytes)",
			"excl_mu_per":"EMemUse
Diff%",
			"pmu":"Incl.
 PeakMemUse
Diff
(bytes)",
			"pmu_per":"IPeakMemUse
Diff%",
			"excl_pmu":"Excl.
PeakMemUse
Diff
(bytes)",
			"excl_pmu_per":"EPeakMemUse
Diff%",
			"samples":"Incl. Samples Diff",
			"samples_per":"ISamples Diff%",
			"excl_samples":"Excl. Samples Diff",
			"excl_samples_per":"ESamples Diff%"
		};
		fn_header_wt_newline =
		{
			"ct":"Calls Diff",
			"ct_per":"CallsDiff%",
			"wt":"Incl. WallDiff(microsec)",
			"wt_per":"IWall Diff%",
			"excl_wt":"Excl. WallDiff(microsec)",
			"excl_wt_per":"EWallDiff%",
			"ut":"Incl. User Diff(microsec)",
			"ut_per":"IUserDiff%",
			"excl_ut":"Excl. UserDiff(microsec)",
			"excl_ut_per":"EUserDiff%",
			"cpu":"Incl. CPU Diff(microsec)",
			"cpu_per":"ICpuDiff%",
			"excl_cpu":"Excl. CPUDiff(microsec)",
			"excl_cpu_per":"ECpuDiff%",
			"st":"Incl. Sys Diff(microsec)",
			"st_per":"ISysDiff%",
			"excl_st":"Excl. Sys Diff(microsec)",
			"excl_st_per":"ESysDiff%",
			"mu":"Incl.MemUseDiff(bytes)",
			"mu_per":"IMemUseDiff%",
			"excl_mu":"Excl.MemUseDiff(bytes)",
			"excl_mu_per":"EMemUseDiff%",
			"pmu":"Incl. PeakMemUseDiff(bytes)",
			"pmu_per":"IPeakMemUseDiff%",
			"excl_pmu":"Excl.PeakMemUseDiff(bytes)",
			"excl_pmu_per":"EPeakMemUseDiff%",
			"samples":"Incl. Samples Diff",
			"samples_per":"ISamples Diff%",
			"excl_samples":"Excl. Samples Diff",
			"excl_samples_per":"ESamples Diff%"
		};
	}
});

// Display the search results when enter key is pressed
function display_page(event)
{
	if(event.keyCode == 13){
		document.location = document.location+'&symbol='+$("#fn-input").val();
	}
	return false;
}
var myDatatable;
var fields = [];
var myData;
var sumx={};
var fn_header_wt_newline =
{
"fn":"Function Name",
"ct": "Calls",
"ct_per":"Calls%",
"wt":"Incl. Wall Time (microsec)",
"wt_per":"IWall%",
"excl_wt":"Excl. Wall Time (microsec)",
"excl_wt_per":"EWall%",
"ut":"Incl. User (microsecs)",
"ut_per":"IUser%",
"excl_ut":"Excl. User (microsec)",
"excl_ut_per":"EUser%",
"st":"Incl. Sys  (microsec)",
"st_per":"ISys%",
"excl_st":"Excl. Sys  (microsec)",
"excl_st_per":"ESys%",
"cpu":"Incl. CPU (microsecs)",
"cpu_per":"ICpu%",
"excl_cpu":"Excl. CPU (microsec)",
"excl_cpu_per":"ECPU%",
"mu":"Incl. MemUse (bytes)",
"mu_per":"IMemUse%",
"excl_mu":"Excl. MemUse (bytes)",
"excl_mu_per":"EMemUse%",
"pmu":"Incl.  PeakMemUse (bytes)",
"pmu_per":"IPeakMemUse%",
"excl_pmu":"Excl. PeakMemUse (bytes)",
"excl_pmu_per":"EPeakMemUse%",
"samples":"Incl. Samples",
"samples_per":"ISamples%",
"excl_samples":"Excl. Samples",
"excl_samples_per":"ESamples%"
};

var fn_header =
{
"fn":"Function Name",
"ct": "Calls",
"ct_per":"Calls%",
"wt":"Incl. Wall Time
(microsec)",
"wt_per":"IWall%",
"excl_wt":"Excl. Wall Time
(microsec)",
"excl_wt_per":"EWall%",
"ut":"Incl. User
(microsecs)",
"ut_per":"IUser%",
"excl_ut":"Excl. User
(microsec)",
"excl_ut_per":"EUser%",
"st":"Incl. Sys
(microsec)",
"st_per":"ISys%",
"excl_st":"Excl. Sys
(microsec)",
"excl_st_per":"ESys%",
"cpu":"Incl. CPU
(microsecs)",
"cpu_per":"ICpu%",
"excl_cpu":"Excl. CPU
(microsec)",
"excl_cpu_per":"ECPU%",
"mu":"Incl.
MemUse
(bytes)",
"mu_per":"IMemUse%",
"excl_mu":"Excl.
MemUse
(bytes)",
"excl_mu_per":"EMemUse%",
"pmu":"Incl.
 PeakMemUse
(bytes)",
"pmu_per":"IPeakMemUse%",
"excl_pmu":"Excl.
PeakMemUse
(bytes)",
"excl_pmu_per":"EPeakMemUse%",
"samples":"Incl. Samples",
"samples_per":"ISamples%",
"excl_samples":"Excl. Samples",
"excl_samples_per":"ESamples%"
};
//check if array has all the value of second array
function check_subset ( array1, array2)
{
	var i ;
	var j ;
	var match = 0 ;
	for ( i in array1 )
	{
		if ( array1[i] == "" )
			match++;
	}
	for ( i in array1 )
	{
		for ( j in array2)
		{
			if( array1[i] == array2[j])
			{
				match++;
			}
		}
	}
	if ( array1.length == match )
	{
		return (true);
	}
	else
	{
		return (false);
	}
}

$(document).ready(function()
{
	if ( $('#function_table').length >0 && self!=top )
	{
		$("body").width('80%');
	}
	if ( $('#diff_page').length <= 0 && self==top )
	{
		$("body").prepend('
  zPerfmon/Profile Page

');
	}
	if ( $('#top_data').length > 0 )
	{
	var topDatatable;
	var fields;
	var client_top = new XMLHttpRequest();
	var url = document.location.toString();
	url = newUrlFunction('index_json.php');
	url = url+"&count=100";
	client_top.open("GET",url, true);
	client_top.onreadystatechange = function()
	{
		if(client_top.readyState == 4)
		{
			var topData = JSON.parse(client_top.responseText);
			var sum = [];
			var fields = [];
			var fields_all = [];
			var fields_per = [];
			for (var i in topData.posts[0])
			{
				if ( topData.posts[0].hasOwnProperty(i))
				{
					fields_all.push(i);
					if(!isNaN(topData.posts[0][i]))
					{
						var temp = 0;
						var max = 0;
						for( var j in topData.posts)
						{
							if ( topData.posts.hasOwnProperty(j))
							{
								temp+=topData.posts[j][i];
								if (  topData.posts[j][i] > max )
								{
									max = topData.posts[j][i];
								}
							}
						}
						if ( i == "ct" || i.substring(0,4)=="excl" )
						{
							sum[i] = temp;
						}
						else
						{
							sum[i] = max;
						}
						if(i.substring(0,4)=="excl")
							sumx[i]= Math.abs(topData['totals'][i.substring(5)]);
						else if ( i !='fn')
						{
							sumx[i]=Math.abs(topData['totals'][i]);
						}
						fields.push(i);
						fields_per.push(i+"_per");
					}
				}
			}
			YUI().use('yui2-dragdrop','autocomplete', 'autocomplete-filters', 'autocomplete-highlighters','yui2-cookie','yui2-paginator', 'yui2-datasource', 'yui2-datatable', 'yui2-logger', function(Y)
			{
				var YAHOO = Y.YUI2;
				var states =[];
				for( var fn_name in topData.posts)
				{
					if ( topData.posts.hasOwnProperty(fn_name))
					{
						states.push(topData.posts[fn_name]['fn']);
					}
				}
				this.myCustomDoubleFormatter = function(elLiner, oRecord, oColumn, oData)
				{
					elLiner.innerHTML = addCommas(oData.toFixed(4));
					YAHOO.util.Dom.addClass(elLiner,'right');
				};
				this.myCustomFormatter = function(elLiner, oRecord, oColumn, oData)
				{
					if(oRecord.getData("fn"))
					{
						var tmp = "";
				//		if(oData.length >20)
				//			tmp="...";
						elLiner.innerHTML = ''+oData+tmp+'';
					}
				};
				this.myCustomPercentageFormatter = function(elLiner, oRecord, oColumn, oData)
				{
					var key = oColumn.key.slice(0,oColumn.key.length-4);
					var value = oRecord.getData(key);
					var percentage = ((value / sumx[key])*100).toFixed(1);
					if ( isNaN(percentage) || percentage == null)
						elLiner.innerHTML = "0.0%";
					else
						elLiner.innerHTML = percentage+"%";
					YAHOO.util.Dom.addClass(elLiner,'right');
				};
				YAHOO.widget.DataTable.Formatter.myCustom = this.myCustomFormatter;
				YAHOO.widget.DataTable.Formatter.percentage = this.myCustomPercentageFormatter;
				YAHOO.widget.DataTable.Formatter.double_number = this.myCustomDoubleFormatter;
				YAHOO.widget.DataTable.prototype.setPaginator = function (oConfigs)
				{
					if(oConfigs !== undefined && oConfigs !== null)
					{
						this._initConfigs(oConfigs); // Update ColumnSet
						this._initTheadEl(); // Update the thead
					}
				};

				YAHOO.widget.DataTable.prototype.setColumns = function (colDef)
				{
					if(colDef !== undefined && colDef !== null)
					{
						this._initColumnSet(colDef); // Update ColumnSet
						this._initTheadEl(); // Update the thead
					}
				};
				YAHOO.example.Basic = function()
				{
					var myColumnDefs =
					[
						{label:"Function Name",key:"fn", sortable:true, resizeable:true,formatter:"myCustom",width:150}
					];
					var currentValue = YAHOO.util.Cookie.getSub("zperfmon_xhprof","rows");
					if( currentValue || currentValue == "")
					{
						var true_values = currentValue.split(" ");
						if ( check_subset ( true_values, fields.concat(fields_per)))
						{
							for ( var i in true_values)
							{
								if ( true_values.hasOwnProperty(i))
								{
									var obj = {resizeable:true,sortable:true,sortOptions: { defaultDir: YAHOO.widget.DataTable.CLASS_DESC }};
									if(true_values[i])
									{
										obj['key'] = true_values[i];
										obj['label'] = fn_header[obj['key']];
										if(true_values[i].substring(true_values[i].length-3) == "per")
										{
											obj['formatter'] = "percentage";
											obj['sortOptions']['field'] = true_values[i].slice(0,true_values[i].length-4);
										}
										else
										{
											obj['formatter'] = "double_number";
										}
										myColumnDefs.push(obj);
										$("#"+true_values[i]).attr('checked','checked');
									}
								}
							}
						}
						else
						{
							for(var i in fields)
							{
								$("#"+fields[i]).attr('checked','checked');
								$("#"+fields[i]+'_per').attr('checked','checked');
								if ( fields.hasOwnProperty(i))
								{
									var obj = {sortable:true, resizeable:true,formatter:"double_number",sortOptions: { defaultDir: YAHOO.widget.DataTable.CLASS_DESC }};
									obj['key'] = fields[i];
									obj['label'] = fn_header[obj['key']];
									myColumnDefs.push(obj);
									var obj_per = {sortable:false, resizeable:true,formatter:"percentage",sortOptions: { defaultDir: YAHOO.widget.DataTable.CLASS_DESC }};
									obj_per['key'] = fields[i]+'_per';
									obj_per['label'] = fn_header[obj_per['key']];
									obj_per['sortOptions']['field'] = obj['key'];
									myColumnDefs.push(obj_per);
								}
							}
						}
					}
					else
					{
						var myColumnDefs =
						[
							{label:"Function Name",key:"fn", sortable:true,label:"Function Name", resizeable:true,formatter:"myCustom",width:150}
						];
						for(var i in fields)
						{
							if ( fields.hasOwnProperty(i)&& ( fields[i].indexOf('excl')>-1 ||  fields[i].indexOf('ct') > -1))

							{
								$("#"+fields[i]).attr('checked','checked');
								$("#"+fields[i]+'_per').attr('checked','checked');
								var obj = {sortable:true, resizeable:true,formatter:"double_number",sortOptions: { defaultDir: YAHOO.widget.DataTable.CLASS_DESC }};
								obj['key'] = fields[i];
								obj['label'] = fn_header[obj['key']];
								myColumnDefs.push(obj);
								var obj_per = {sortable:true, resizeable:true,formatter:"percentage",sortOptions: { defaultDir: YAHOO.widget.DataTable.CLASS_DESC }};
								obj_per['key'] = fields[i]+'_per';
								obj_per['label'] = fn_header[obj_per['key']];
								obj_per['sortOptions']['field'] = obj['key'];
								myColumnDefs.push(obj_per);

							}
						}
					}
					var topDataSource = new YAHOO.util.DataSource(topData.posts);
					topDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
					topDataSource.responseSchema =
					{
						fields: fields_all
					};
					var oConfigs =
					{
						paginator: new YAHOO.widget.Paginator({
							rowsPerPage: 100,
							totalRecords : 100,
							template : ""
						})//,
					};
					topDataTable = new YAHOO.widget.DataTable("basic",myColumnDefs, topDataSource, oConfigs);
						if (self != top )
						{
							parent.set_page_size($("#basic").children('table').width(),$("body").height());
						}

					$("#loading_image").addClass("hide");
					return {
						oDS: topDataSource,
						oDT: topDataTable
					};
				}();
			});
		}
	}
	client_top.send();

}

	if ( $('#basic').length > 0 )
	{

	$("#searchFunction div").click(function(event){
		event.stopPropagation();
	});

	$('#callgraph_button').button();
	$('#piechart').button();
	$('#select_column').button();
	$('#display_all').button();
	$('#select_column').click(function(event){
		event.stopPropagation();
	});

	var myDatatable;
	//var fields;
	var sumx={};
	var client = new XMLHttpRequest();
	var url = document.location.toString();
			//url = url.replace('index.php','index_json.php');
	url = newUrlFunction('index_json.php');

	client.open("GET", url, true);
	client.onreadystatechange = function()
	{
		if(client.readyState == 4)
		{
			myData = JSON.parse(client.responseText);
			var sum = [];
			fields = [];
			fields_all = [];
			fields_per = [];
			for (var i in myData.posts[0])
			{
				if ( myData.posts[0].hasOwnProperty(i))
				{
					fields_all.push(i);
					if(!isNaN(myData.posts[0][i]))
					{
						var temp = 0;
						var max = 0;
						for( var j in myData.posts)
						{
							if ( myData.posts.hasOwnProperty(j))
							{
								temp+=myData.posts[j][i];
								if (  myData.posts[j][i] > max )
								{
									max = myData.posts[j][i];
								}
							}
						}
						if(i.substring(0,4)=="excl")
						{
							sumx[i]= Math.abs(myData['totals'][i.substring(5)]);
						}
						else
						{
							sumx[i]=Math.abs(myData['totals'][i]);
						}
						fields.push(i);
						fields_per.push(i+"_per");
						var selectbox_html = '
<input type="checkbox" name="fields" value="'+i+'" id="'+i+'" >'+fn_header_wt_newline[i]+'
';
						$('#checkbox_container').append(selectbox_html);
						var selectbox_html = '
<input type="checkbox" name="fields" value="'+i+'_per'+'" id="'+i+'_per'+'">'+fn_header_wt_newline[i+'_per']+'
';
						$('#checkbox_container').append(selectbox_html);
						$('#checkbox_loading').addClass("hide");
					}
				}
			}
			YUI().use('yui2-dragdrop','autocomplete', 'autocomplete-filters', 'autocomplete-highlighters','yui2-cookie','yui2-paginator', 'yui2-datasource', 'yui2-datatable', 'yui2-logger', function(Y)
			{
				var YAHOO = Y.YUI2;
				var states =[];
				for( var fn_name in myData.posts)
				{
					if ( myData.posts.hasOwnProperty(fn_name))
					{
						states.push(myData.posts[fn_name]['fn']);
					}
				}
				$('#fn-input').autocomplete({
					source : states
				});
				this.myCustomDoubleFormatter = function(elLiner, oRecord, oColumn, oData)
				{
					elLiner.innerHTML = oData.toFixed(4);
										YAHOO.util.Dom.addClass(elLiner,'right');
				};
				this.myCustomFormatter = function(elLiner, oRecord, oColumn, oData)
				{
					if(oRecord.getData("fn"))
					{
						var tmp = "";
//							if(oData.length >20)
//								tmp="...";
						elLiner.innerHTML = ''+oData+tmp+'';
					}
				};
				this.myCustomPercentageFormatter = function(elLiner, oRecord, oColumn, oData)
				{
					var key = oColumn.key.slice(0,oColumn.key.length-4);
					var value = oRecord.getData(key);
					var percentage = ((value / sumx[key])*100).toFixed(1);
					if ( isNaN(percentage) || percentage == null)
						elLiner.innerHTML = "0.0%";
					else
						elLiner.innerHTML = percentage+"%";
					YAHOO.util.Dom.addClass(elLiner,'right');
				};
				YAHOO.widget.DataTable.Formatter.myCustom = this.myCustomFormatter;
				YAHOO.widget.DataTable.Formatter.percentage = this.myCustomPercentageFormatter;
				YAHOO.widget.DataTable.Formatter.initialSort = this.myCustomInitialSort;
				YAHOO.widget.DataTable.Formatter.double_number = this.myCustomDoubleFormatter;
				YAHOO.widget.DataTable.prototype.setColumns = function (colDef)
				{
					if(colDef !== undefined && colDef !== null)
					{
						this._initColumnSet(colDef); // Update ColumnSet
						this._initTheadEl(); // Update the thead
					}
				};
				YAHOO.example.Basic = function()
				{
					var myColumnDefs =
					[
						{label:"Function Name",key:"fn", sortable:true, resizeable:true,formatter:"myCustom",width:150}
					];
					var currentValue = YAHOO.util.Cookie.getSub("zperfmon_xhprof","rows");
					if( currentValue || currentValue == "")
					{
						var true_values = currentValue.split(" ");
						if ( check_subset ( true_values, fields.concat(fields_per)))
						{
							for ( var i in true_values)
							{
								if ( true_values.hasOwnProperty(i))
								{
									var obj = {resizeable:true,sortable:true,sortOptions: { defaultDir: YAHOO.widget.DataTable.CLASS_DESC }};
									if(true_values[i])
									{
										obj['key'] = true_values[i];
										obj['label'] = fn_header[obj['key']];
										if(true_values[i].substring(true_values[i].length-3) == "per")
										{
											obj['formatter'] = "percentage";
											obj['sortOptions']['field'] = true_values[i].slice(0,true_values[i].length-4);
										}
										else
										{
											obj['formatter'] = "double_number";
										}
										myColumnDefs.push(obj);
										$("#"+true_values[i]).attr('checked','checked');
									}
								}
							}
						}
						else
						{
							for(var i in fields)
							{
								$("#"+fields[i]).attr('checked','checked');
								$("#"+fields[i]+'_per').attr('checked','checked');
								if ( fields.hasOwnProperty(i))
								{
									var obj = {sortable:true, resizeable:true,formatter:"double_number",sortOptions: { defaultDir: YAHOO.widget.DataTable.CLASS_DESC }};
									obj['key'] = fields[i];
									obj['label'] = fn_header[obj['key']];
									myColumnDefs.push(obj);
									var obj_per = {sortable:false, resizeable:true,formatter:"percentage",sortOptions: { defaultDir: YAHOO.widget.DataTable.CLASS_DESC }};
									obj_per['key'] = fields[i]+'_per';
									obj_per['label'] = fn_header[obj_per['key']];
									obj_per['sortOptions']['field'] = obj['key'];
									myColumnDefs.push(obj_per);
								}
							}
						}
					}
					else
					{
						myColumnDefs =
						[
							{label:"Function Name",key:"fn",width:150, sortable:true,label:"Function Name", resizeable:true,formatter:"myCustom"}
						];
						for(var i in fields)
						{
							if ( fields.hasOwnProperty(i) && ( fields[i].indexOf('excl')>-1 ||  fields[i].indexOf('ct') > -1))
							{

								$("#"+fields[i]).attr('checked','checked');
								$("#"+fields[i]+'_per').attr('checked','checked');
								var obj = {sortable:true, resizeable:true,formatter:"double_number",sortOptions: { defaultDir: YAHOO.widget.DataTable.CLASS_DESC }};
								obj['key'] = fields[i];
								obj['label'] = fn_header[obj['key']];
								myColumnDefs.push(obj);
								var obj_per = {sortable:true, resizeable:true,formatter:"percentage",sortOptions: { defaultDir: YAHOO.widget.DataTable.CLASS_DESC }};
								obj_per['key'] = fields[i]+'_per';
								obj_per['label'] = fn_header[obj_per['key']];
								obj_per['sortOptions']['field'] = obj['key'];
								myColumnDefs.push(obj_per);

							}
						}
					}
					var myDataSource = new YAHOO.util.DataSource(myData.posts);
					myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
					myDataSource.doBeforeCallback = function (oRequest, oFullResponse, oParsedResponse, oCallback) {
						oParsedResponse.results.sort(myCustomInitialSort);
						return oParsedResponse;
					},
					myDataSource.responseSchema =
					{
						fields: fields_all
					};
					var oConfigs =
					{
						paginator: new YAHOO.widget.Paginator({
							rowsPerPage:100,
							totalRecords : 100,
							template : ""
						})//,
					};
					myDataTable = new YAHOO.widget.DataTable("basic",myColumnDefs, myDataSource, oConfigs);
					myDataTable.doBeforeSortColumn  = function ( oColumn , sSortDir ) {
						var url = document.location.toString();
						var new_url;
						if(url.indexOf("sort_row")>0)
						{
							var temp = url.indexOf("sort_row")+9;
							var key = oColumn.key;
							if( key.indexOf("_per")>0)
								key = key.substring(0,key.indexOf("_per"));
							var start = url.substring(0,temp);
							var end ="";
							if(url.substring(temp).indexOf('&') > 0)
								end =url.substring(temp).substring(url.substring(temp).indexOf('&'));
							url = start + key + end ;
						}
						else
						{
							var key = oColumn.key;
							if( key.indexOf("_per")>0)
									key = key.substring(0,key.indexOf("_per"));
							url = url+"&sort_row="+key;
						}
					   if(url.indexOf("sort_type")>0)
						{
							var temp = url.indexOf("sort_type")+10;
							var start = url.substring(0,temp);
							var type = "desc";
							if(sSortDir == "yui-dt-asc")
								type = "asc";
							var end ="";
							if(url.substring(temp).indexOf('&') > 0)
								end =url.substring(temp).substring(url.substring(temp).indexOf('&'));
							url = start +type+ end ;
						}
						else
						{
							var type = "desc";
							if(sSortDir == "yui-dt-asc")
							   type = "asc";
							url = url+"&sort_type="+type;
						}
						$('#link_address_anchor').attr('href',url);
						return true;
					}
					$("#loading_image").addClass("hide");
					$("#top_data").addClass("hide");
					if (self != top )
					{
						parent.set_page_size($("#basic").children('table').width(),$("body").height());
					}
					return {
						oDS: myDataSource,
						oDT: myDataTable
					};

				}();
			});
		}
	}
	client.send();
	}
	var cur_params = {} ;
	$.each(location.search.replace('?','').split('&'), function(i, x)
	{
		var y = x.split('='); cur_params[y[0]] = y[1];
	});
	$('input.function_typeahead')
		.autocomplete('typeahead.php', { extraParams : cur_params })
		.result(function(event, item) {
		cur_params['symbol'] = item;
		location.search = '?' + jQuery.param(cur_params);
	});
});


text:
{% load staticfiles %}

<!DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>
    Ability Foundation</title>
   <link rel="stylesheet" type="text/css" href="{%static "foundation.css"%}">
   <link rel="stylesheet" type="text/css" href="{%static "app.css"%}">

   <link rel="stylesheet" href= "{%static "stylelogin.css"%}" >

About Us

Job Application

Contact Us

Login

Personal Information

Qualification & Skills

Disabilities

Your comfort zones

                  <form  method="post" action=""> {% csrf_token %}

                            Do you agree to work in night shifts ?

                             <input id="element_2_1" name="night_shift" class="element radio" type="radio" value="1" />
Yes
<input id="element_2_2" name="night_shift" class="element radio" type="radio" value="2" />
No

                          Are you comfortable with any possible relocation
                            <input id="element_3_1" name="relocated" class="element radio" type="radio" value="1" />
Yes
<input id="element_3_2" name="relocated" class="element radio" type="radio" value="2" />
No

                          Do you require any special assistance ?
                            <input id="element_4_1" name="element_4" class="element radio" type="radio" value="1" />
Yes
<input id="element_4_2" name="element_4" class="element radio" type="radio" id="noreq" value="2" />
No</tds>

                  <input type="text" style="width:100x;display:none;" id="showreq" placeholder="Specify"/>

    <input style="float:right;" class="button" type="submit" value="Submit"/>
    </form>

                Copyright@teamno13.codeforgoodchallenge  | JP Morgan Mumbai.

    X

Login to Web App

      <form method="post" action="Application.htm">

<input type="text" name="login" value="" placeholder="Username or Email"  style="width:150px">

<input type="password" name="password" value="" placeholder="Password" style="width:150px">

            <input type="checkbox" name="remember_me" id="remember_me">
            Remember me on this computer

<input type="submit" name="commit" value="Login">

      </form>


text:
CONTIKI_PROJECT = node
all: $(CONTIKI_PROJECT)

TARGET ?= jn516x

CONTIKI=../../../..

CONTIKI_WITH_IPV6 = 1

PROJECTDIRS += .. ../tools
PROJECT_SOURCEFILES += rpl-tools.c
CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\"

include $(CONTIKI)/Makefile.include


text:
transcript_list=$1
stemmer=$2

for transcript in $transcript_list; do
	python keyphrase/audio_features/cscore.py $transcript $stemmer
done


text:
#ifndef _Hydrax_Help_H_
#define _Hydrax_Help_H_

#include "Prerequisites.h"

namespace Hydrax
{
    /** Struct wich contains an especific width and height value
    */
    struct DllExport Size
    {
        /// Width value
        int Width;
        /// Height value
        int Height;

        /** Default constructor
        */
        Size()
        {
            Width  = 0;
            Height = 0;
        }

        /** Constructor
        	@param size The width and height values
        */
        Size(const int &size)
        {
            Width  = size;
            Height = size;
        }

        /** Constructor
        	@param width Width value
        	@param height Height value
        */
        Size(const int &width, const int &height)
        {
            Width  = width;
            Height = height;
        }

        /** Destructor
        */
        ~Size()
        {
        }

        /** Sets the same width and height value
        	@param size The width and height values
        */
        void setSize(const int &size)
        {
            Width  = size;
            Height = size;
        }

        /** Sets the especified values
        	@param width Width value
        	@param height Height value
        */
        void setSize(const int &width, const int &height)
        {
            Width  = width;
            Height = height;
        }
    };

	/** Math class with some help funtions
	 */
	class Math
	{
	public:
		/** Constructor
		 */
		Math(){};
		/** Destructor
		 */
		~Math(){};

		/** Find the intersection point of two lines
		    @param a First line origin
			@param b First line final
			@param c First line origin
			@param d First line final
			@return Ogre::Vector2::ZERO if there isn't intersection, intersection point
		 */
		static Ogre::Vector2 intersectionOfTwoLines(const Ogre::Vector2 &a, const Ogre::Vector2 &b,
			                                        const Ogre::Vector2 &c, const Ogre::Vector2 &d);
	};
}

#endif


text:
package org.craft.utils.io;

import java.nio.FloatBuffer;

public interface IBufferWritable
{

	public void write(FloatBuffer buffer);

	public int getSize();
}


text:
<?php

namespace Zimbra\Admin\Struct;

use Zimbra\Struct\Base;

/**
 * DeviceId struct class
 *
 * @package    Zimbra
 * @subpackage Admin
 * @category   Struct
 * @author     Nguyen Van Nguyen - nguyennv1981@gmail.com
 * @copyright  Copyright © 2013 by Nguyen Van Nguyen.
 */
class DeviceId extends Base
{
    /**
     * Constructor method for DeviceId
     * @param  string $id Device ID
     * @return self
     */
    public function __construct($id)
    {
        parent::__construct();
        $this->setProperty('id', trim($id));
    }

    /**
     * Gets device ID
     *
     * @return string
     */
    public function getId()
    {
        return $this->getProperty('id');
    }

    /**
     * Sets device ID
     *
     * @param  string $id
     * @return self
     */
    public function setId($id)
    {
        return $this->setProperty('id', trim($id));
    }

    /**
     * Returns the array representation of this class
     *
     * @param  string $name
     * @return array
     */
    public function toArray($name = 'device')
    {
        return parent::toArray($name);
    }

    /**
     * Method returning the xml representation of this class
     *
     * @param  string $name
     * @return SimpleXML
     */
    public function toXml($name = 'device')
    {
        return parent::toXml($name);
    }
}


text:
"""
Restores from from an existing file on S3.

Example::\n
python daemon_database_restore.py mongo_dump_next-test1.discovery.wisc.edu_2015-04-21_04:50:38.tar.gz

"""

import sys
sys.path.append("/next_backend")

import subprocess
import next.constants as constants
import next.database.database_lib as db_lib
import os

AWS_BUCKET_NAME = os.environ['AWS_BUCKET_NAME']

try:
	dump_filename = sys.argv[1]
except:
	"Must provide a filename from the 'next-database-backups' bucket.\n    python daemon_database_restore.py mongo_dump_next-test1.discovery.wisc.edu_2015-04-21_04:50:38.tar.gz"

from boto.s3.connection import S3Connection
from boto.s3.key import Key
import boto
# boto.set_stream_logger('boto')

conn = S3Connection(constants.AWS_ACCESS_ID,constants.AWS_SECRET_ACCESS_KEY)
b = conn.get_bucket(AWS_BUCKET_NAME)

k = Key(b)
k.key = dump_filename #'mongo_dump_next-test1.discovery.wisc.edu_2015-04-21_04:50:38.tar.gz'
filename = 'mongo_dump.tar.gz'
k.get_contents_to_filename(filename)

db_lib.restore_mongodump(filename)
subprocess.call('rm '+filename,shell=True)


text:
package edu.columbia.cuit.pageServer.maintenance;

import java.util.Calendar;
import java.util.Date;
import java.util.TimerTask;

import org.apache.log4j.Logger;

import edu.columbia.cuit.pageServer.MaintenanceTask;
import edu.columbia.cuit.pageServer.PersistenceLayer;

public class ExpireCache implements MaintenanceTask {

	private static final Logger log = Logger.getLogger("edu.columbia.cuit.PageServer");
	private static final long serialVersionUID = 1l;

	private	final PersistenceLayer persist;
	private Date lastRun;
	private boolean pending;

	public ExpireCache(PersistenceLayer persist){
		this.persist = persist;
		this.lastRun = null;
		this.pending = false;
	}

	public Date getNextScheduledRun() {

		// Only schedule once per actual run
		if (pending){
			return null;
		}

		// Only run if there are more than N items cached
		if (persist.affilCache.size() < 2048l){
			return null;
		}

		// When needed, schedule a run for 4am
		final Calendar cal = Calendar.getInstance();
		cal.set(Calendar.HOUR_OF_DAY, 4);
		if ( cal.before(Calendar.getInstance()) ){
			cal.add(Calendar.DATE, 1);
		}
		return cal.getTime();
	}

	public Date getPreviousRun() {
		return this.lastRun;
	}

	public boolean isRecurring() {
		return false;
	}

	public long getRecurrenceInterval() {
		return 0;
	}

	public boolean isReloadable() {
		return !pending;
	}

	public TimerTask getTimerTask() {

		pending = true;

		return new TimerTask() {

			public void run() {
				// pending and lastRun are scoped from the instantiating
				// class and provide a pathway to pass state information
				// back to the instantiating class

				lastRun = Calendar.getInstance().getTime();
				persist.affilCache.cleanCache(86400000l);
				log.debug("Cleared cache entries not accessed within the last day");
				pending = false;
			}

		};

	}

}


text:
namespace SleepyDiscord {
	typedef std::shared_ptr<GenericWebsocketConnection> WebsocketConnection;
}


text:
<?php

namespace zaporylie\Vipps\Resource\RecurringPayment;

use zaporylie\Vipps\Model\RecurringPayment\RequestCreateCharge;
use zaporylie\Vipps\Model\RecurringPayment\ResponseCreateCharge;
use zaporylie\Vipps\Resource\HttpMethod;
use zaporylie\Vipps\Resource\IdempotencyKeyFactory;
use zaporylie\Vipps\Resource\RequestIdFactory;
use zaporylie\Vipps\VippsInterface;

/**
 * Class CreateCharge
 *
 * @package Vipps\Resource\RecurringPayment
 */
class CreateCharge extends RecurringPaymentResourceBase
{

    /**
     * @var \zaporylie\Vipps\Resource\HttpMethod
     */
    protected $method = HttpMethod::POST;

    /**
     * @var string
     */
    protected $path = '/recurring/v2/agreements/{id}/charges';

    /**
     * InitiatePayment constructor.
     *
     * @param \zaporylie\Vipps\VippsInterface $vipps
     * @param string $subscription_key
     * @param string $agreementId
     * @param \zaporylie\Vipps\Model\RecurringPayment\RequestCreateCharge $requestObject
     */
    public function __construct(
        VippsInterface $vipps,
        $subscription_key,
        $agreementId,
        RequestCreateCharge $requestObject
    ) {
        $this->id = $agreementId;
        // By default RequestID is different for each Resource object.
        $this->headers['Idempotency-Key'] = IdempotencyKeyFactory::generate();
        parent::__construct($vipps, $subscription_key);
        $this->body = $this
            ->getSerializer()
            ->serialize(
                $requestObject,
                'json'
            );
    }

    /**
     * @return \zaporylie\Vipps\Model\RecurringPayment\ResponseCreateCharge
     */
    public function call()
    {
        $response = $this->makeCall();
        $body = $response->getBody()->getContents();
        /** @var \zaporylie\Vipps\Model\RecurringPayment\ResponseCreateCharge $responseObject */
        $responseObject = $this
            ->getSerializer()
            ->deserialize(
                $body,
                ResponseCreateCharge::class,
                'json'
            );

        return $responseObject;
    }
}


text:
package settings

import (
	"golang.org/x/image/colornames"
	"gomatcha.io/matcha/application"
	"gomatcha.io/matcha/layout/constraint"
	"gomatcha.io/matcha/layout/table"
	"gomatcha.io/matcha/paint"
	"gomatcha.io/matcha/pointer"
	"gomatcha.io/matcha/view"
	"gomatcha.io/matcha/view/android"
	"gomatcha.io/matcha/view/ios"
)

type WifiView struct {
	view.Embed
	app *App
}

func NewWifiView(app *App) *WifiView {
	return &WifiView{
		Embed: view.NewEmbed(app),
		app:   app,
	}
}

func (v *WifiView) Lifecycle(from, to view.Stage) {
	if view.EntersStage(from, to, view.StageMounted) {
		v.Subscribe(v.app.Wifi)
	} else if view.ExitsStage(from, to, view.StageMounted) {
		v.Unsubscribe(v.app.Wifi)
	}
}

func (v *WifiView) Build(ctx view.Context) view.Model {
	l := &table.Layouter{}
	{
		group := []view.View{}

		spacer := NewSpacer()
		l.Add(spacer, nil)

		switchView := view.NewSwitch()
		switchView.Value = v.app.Wifi.Enabled()
		switchView.OnSubmit = func(value bool) {
			v.app.Wifi.SetEnabled(!v.app.Wifi.Enabled())
		}

		cell1 := NewBasicCell()
		cell1.Title = "Wi-Fi"
		cell1.AccessoryView = switchView
		group = append(group, cell1)

		if v.app.Wifi.CurrentSSID() != "" && v.app.Wifi.Enabled() {
			cell2 := NewBasicCell()
			cell2.Title = v.app.Wifi.CurrentSSID()
			group = append(group, cell2)
		}

		for _, i := range AddSeparators(group, 60) {
			l.Add(i, nil)
		}
	}

	if v.app.Wifi.Enabled() {
		{
			group := []view.View{}

			spacer := NewSpacerHeader()
			spacer.Title = "Choose a Network..."
			l.Add(spacer, nil)

			for _, i := range v.app.Wifi.Networks() {
				network := i
				ssid := network.SSID()

				// Don't show the current network in this list.
				if ssid == v.app.Wifi.CurrentSSID() {
					continue
				}

				info := NewInfoButton()
				info.OnPress = func() {
					v.app.Stack.Push(NewWifiNetworkView(v.app, network))
				}

				cell := NewBasicCell()
				cell.Title = ssid
				cell.AccessoryView = info
				cell.OnTap = func() {
					v.app.Wifi.SetCurrentSSID(ssid)
				}
				group = append(group, cell)
			}

			cell1 := NewBasicCell()
			cell1.Title = "Other..."
			group = append(group, cell1)

			for _, i := range AddSeparators(group, 60) {
				l.Add(i, nil)
			}
		}
		{

			spacer := NewSpacer()
			l.Add(spacer, nil)

			switchView := view.NewSwitch()
			switchView.Value = v.app.Wifi.AskToJoin()
			switchView.OnSubmit = func(a bool) {
				v.app.Wifi.SetAskToJoin(a)
			}
			cell1 := NewBasicCell()
			cell1.Title = "Ask to Join Networks"
			cell1.AccessoryView = switchView

			for _, i := range AddSeparators([]view.View{cell1}, 60) {
				l.Add(i, nil)
			}
		}
		{
			spacer := NewSpacerDescription()
			spacer.Description = "Known networks will be joined automatically. If no known networks are available, you will have to manually join a network."
			l.Add(spacer, nil)
		}
	}

	scrollView := view.NewScrollView()
	scrollView.ContentChildren = l.Views()
	scrollView.ContentLayouter = l

	return view.Model{
		Children: []view.View{scrollView},
		Painter:  &paint.Style{BackgroundColor: backgroundColor},
		Options: []view.Option{
			&ios.StackBar{Title: "Wifi"},
			&android.StackBar{Title: "Wifi"},
		},
	}
}

type WifiNetworkView struct {
	view.Embed
	app     *App
	network *WifiNetwork
}

type a struct {
	app     *App
	network *WifiNetwork
}

func NewWifiNetworkView(app *App, network *WifiNetwork) *WifiNetworkView {
	return &WifiNetworkView{
		Embed:   view.NewEmbed(a{app: app, network: network}),
		app:     app,
		network: network,
	}
}

func (v *WifiNetworkView) Lifecycle(from, to view.Stage) {
	if view.EntersStage(from, to, view.StageMounted) {
		v.Subscribe(v.network)
	} else if view.ExitsStage(from, to, view.StageMounted) {
		v.Unsubscribe(v.network)
	}
}

func (v *WifiNetworkView) Build(ctx view.Context) view.Model {
	props := v.network.Properties()

	l := &table.Layouter{}
	{

		spacer := NewSpacer()
		l.Add(spacer, nil)

		cell1 := NewBasicCell()
		cell1.Title = "Forget This Network"
		cell1.OnTap = func() {
			view.Alert("Forget Wi-Fi Network?", "Your iPhone will no longer join this Wi-Fi network.",
				&view.AlertButton{
					Title: "Cancel",
				},
				&view.AlertButton{
					Title: "Forget",
					OnPress: func() {
						v.app.Stack.Pop()
					},
				},
			)
		}

		for _, i := range AddSeparators([]view.View{cell1}, 60) {
			l.Add(i, nil)
		}
	}
	{

		spacer := NewSpacerHeader()
		spacer.Title = "IP Address"
		l.Add(spacer, nil)

		cell0 := NewSegmentCell()
		cell0.Titles = []string{"DHCP", "BootP", "Static"}
		cell0.Value = props.Kind
		cell0.OnValueChange = func(a int) {
			props := v.network.Properties()
			props.Kind = a
			v.network.SetProperties(props)
		}

		cell1 := NewBasicCell()
		cell1.Title = "IP Address"
		cell1.Subtitle = props.IPAddress

		cell2 := NewBasicCell()
		cell2.Title = "Subnet Mask"
		cell2.Subtitle = props.SubnetMask

		cell3 := NewBasicCell()
		cell3.Title = "Router"
		cell3.Subtitle = props.Router

		cell4 := NewBasicCell()
		cell4.Title = "DNS"
		cell4.Subtitle = props.DNS

		cell5 := NewBasicCell()
		cell5.Title = "Client ID"
		cell5.Subtitle = props.ClientID

		for _, i := range AddSeparators([]view.View{cell0, cell1, cell2, cell3, cell4, cell5}, 60) {
			l.Add(i, nil)
		}
	}
	{

		spacer := NewSpacer()
		l.Add(spacer, nil)

		cell1 := NewBasicCell()
		cell1.Title = "Renew Lease"
		cell1.OnTap = func() {
			view.Alert("Renewing Lease...", "")
		}

		for _, i := range AddSeparators([]view.View{cell1}, 60) {
			l.Add(i, nil)
		}
	}
	{

		spacer := NewSpacerHeader()
		spacer.Title = "HTTP Proxy"
		l.Add(spacer, nil)

		cell1 := NewSegmentCell()
		cell1.Titles = []string{"Off", "Manual", "Auto"}
		cell1.Value = props.Proxy
		cell1.OnValueChange = func(a int) {
			props := v.network.Properties()
			props.Proxy = a
			v.network.SetProperties(props)
		}

		for _, i := range AddSeparators([]view.View{cell1}, 60) {
			l.Add(i, nil)
		}
	}
	{

		spacer := NewSpacer()
		l.Add(spacer, nil)

		cell1 := NewBasicCell()
		cell1.Title = "Manage This Network"

		for _, i := range AddSeparators([]view.View{cell1}, 60) {
			l.Add(i, nil)
		}
	}
	spacer := NewSpacer()
	l.Add(spacer, nil)

	scrollView := view.NewScrollView()
	scrollView.ContentChildren = l.Views()
	scrollView.ContentLayouter = l

	return view.Model{
		Children: []view.View{scrollView},
		Painter:  &paint.Style{BackgroundColor: backgroundColor},
		Options: []view.Option{
			&ios.StackBar{Title: v.network.SSID()},
			&android.StackBar{Title: v.network.SSID()},
		},
	}
}

type SegmentCell struct {
	view.Embed
	Titles        []string
	Value         int
	OnValueChange func(value int)
}

func NewSegmentCell() *SegmentCell {
	return &SegmentCell{}
}

func (v *SegmentCell) Build(ctx view.Context) view.Model {
	l := &constraint.Layouter{}
	l.Solve(func(s *constraint.Solver) {
		s.Height(44)
		s.WidthEqual(l.MinGuide().Width())
	})

	segment := ios.NewSegmentView()
	segment.Titles = v.Titles
	segment.Value = v.Value
	segment.OnChange = func(a int) {
		if v.OnValueChange != nil {
			v.OnValueChange(a)
		}
	}
	l.Add(segment, func(s *constraint.Solver) {
		s.HeightLess(l.Height())
		s.RightEqual(l.Right().Add(-15))
		s.LeftEqual(l.Left().Add(15))
	})

	return view.Model{
		Children: l.Views(),
		Layouter: l,
		Painter:  &paint.Style{BackgroundColor: colornames.White},
	}
}

type InfoButton struct {
	view.Embed
	OnPress    func()
	PaintStyle *paint.Style
}

func NewInfoButton() *InfoButton {
	return &InfoButton{}
}

func (v *InfoButton) Build(ctx view.Context) view.Model {
	l := &constraint.Layouter{}
	l.Solve(func(s *constraint.Solver) {
		s.Width(44)
		s.Height(44)
	})

	img := view.NewImageView()
	img.Image = application.MustLoadImage("info")
	l.Add(img, func(s *constraint.Solver) {
		s.Width(22)
		s.Height(22)
		s.RightEqual(l.Right())
	})

	button := &pointer.ButtonGesture{
		OnEvent: func(e *pointer.ButtonEvent) {
			if e.Kind == pointer.EventKindRecognized && v.OnPress != nil {
				v.OnPress()
			}
		},
	}

	return view.Model{
		Children: l.Views(),
		Layouter: l,
		Painter:  v.PaintStyle,
		Options: []view.Option{
			pointer.GestureList{button},
		},
	}
}


text:
package com.amazonaws.services.robomaker.model.transform;

import java.util.Map;
import java.util.List;
import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.robomaker.model.*;

import com.amazonaws.util.IdempotentUtils;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * CreateDeploymentJobRequestMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class CreateDeploymentJobRequestMarshaller {

    private static final MarshallingInfo<StructuredPojo> DEPLOYMENTCONFIG_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("deploymentConfig").build();
    private static final MarshallingInfo<String> CLIENTREQUESTTOKEN_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("clientRequestToken")
            .defaultValueSupplier(com.amazonaws.util.IdempotentUtils.getGenerator()).build();
    private static final MarshallingInfo<String> FLEET_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("fleet").build();
    private static final MarshallingInfo<List> DEPLOYMENTAPPLICATIONCONFIGS_BINDING = MarshallingInfo.builder(MarshallingType.LIST)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("deploymentApplicationConfigs").build();
    private static final MarshallingInfo<Map> TAGS_BINDING = MarshallingInfo.builder(MarshallingType.MAP).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("tags").build();

    private static final CreateDeploymentJobRequestMarshaller instance = new CreateDeploymentJobRequestMarshaller();

    public static CreateDeploymentJobRequestMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(CreateDeploymentJobRequest createDeploymentJobRequest, ProtocolMarshaller protocolMarshaller) {

        if (createDeploymentJobRequest == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(createDeploymentJobRequest.getDeploymentConfig(), DEPLOYMENTCONFIG_BINDING);
            protocolMarshaller.marshall(createDeploymentJobRequest.getClientRequestToken(), CLIENTREQUESTTOKEN_BINDING);
            protocolMarshaller.marshall(createDeploymentJobRequest.getFleet(), FLEET_BINDING);
            protocolMarshaller.marshall(createDeploymentJobRequest.getDeploymentApplicationConfigs(), DEPLOYMENTAPPLICATIONCONFIGS_BINDING);
            protocolMarshaller.marshall(createDeploymentJobRequest.getTags(), TAGS_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
"""
Session Handling for SQLAlchemy backend
"""

import eventlet.patcher
eventlet.patcher.monkey_patch()

import eventlet.db_pool
import sqlalchemy.orm
import sqlalchemy.pool

import nova.exception
import nova.flags
import nova.log

FLAGS = nova.flags.FLAGS
LOG = nova.log.getLogger("nova.db.sqlalchemy")

try:
    import MySQLdb
except ImportError:
    MySQLdb = None

_ENGINE = None
_MAKER = None

def get_session(autocommit=True, expire_on_commit=False):
    """Return a SQLAlchemy session."""
    global _ENGINE, _MAKER

    if _MAKER is None or _ENGINE is None:
        _ENGINE = get_engine()
        _MAKER = get_maker(_ENGINE, autocommit, expire_on_commit)

    session = _MAKER()
    session.query = nova.exception.wrap_db_error(session.query)
    session.flush = nova.exception.wrap_db_error(session.flush)
    return session

def get_engine():
    """Return a SQLAlchemy engine."""
    connection_dict = sqlalchemy.engine.url.make_url(FLAGS.sql_connection)

    engine_args = {
        "pool_recycle": FLAGS.sql_idle_timeout,
        "echo": False,
    }

    if "sqlite" in connection_dict.drivername:
        engine_args["poolclass"] = sqlalchemy.pool.NullPool

    elif MySQLdb and "mysql" in connection_dict.drivername:
        LOG.info(_("Using mysql/eventlet db_pool."))
        # MySQLdb won't accept 'None' in the password field
        password = connection_dict.password or ''
        pool_args = {
            "db": connection_dict.database,
            "passwd": password,
            "host": connection_dict.host,
            "user": connection_dict.username,
            "min_size": FLAGS.sql_min_pool_size,
            "max_size": FLAGS.sql_max_pool_size,
            "max_idle": FLAGS.sql_idle_timeout,
        }
        creator = eventlet.db_pool.ConnectionPool(MySQLdb, **pool_args)
        engine_args["pool_size"] = FLAGS.sql_max_pool_size
        engine_args["pool_timeout"] = FLAGS.sql_pool_timeout
        engine_args["creator"] = creator.create

    return sqlalchemy.create_engine(FLAGS.sql_connection, **engine_args)

def get_maker(engine, autocommit=True, expire_on_commit=False):
    """Return a SQLAlchemy sessionmaker using the given engine."""
    return sqlalchemy.orm.sessionmaker(bind=engine,
                                       autocommit=autocommit,
                                       expire_on_commit=expire_on_commit)


text:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">

    <group android:checkableBehavior="single">

        <item
            android:id="@+id/nav_home"
            android:icon="@drawable/ic_home_white_24dp"
            android:title="@string/title_activity_home" />

        <item
            android:id="@+id/nav_search"
            android:icon="@drawable/ic_search_white_24dp"
            android:title="@string/title_activity_student_search" />

        <item
            android:id="@+id/nav_mess_menu"
            android:icon="@drawable/ic_local_dining_black_24dp"
            android:title="@string/mess_menu" />
        <!--

        <item
            android:id="@+id/nav_calendar"
            android:icon="@drawable/ic_event_note_black_24dp"
            android:title="@string/title_activity_calendar" />
            -->

        <item
            android:id="@+id/nav_acadsactivity"
            android:icon="@drawable/ic_school_black_24dp"
            android:title="@string/title_activity_acadsactivity" />

        <item
            android:id="@+id/nav_contacts"
            android:icon="@drawable/ic_contacts_white_24dp"
            android:title="@string/title_activity_imp_contacts" />

        <item
            android:id="@+id/nav_complaint_box"
            android:icon="@drawable/ic_forum_black_24dp"
            android:title="@string/title_activity_complaint_box" />
        <item
            android:id="@+id/nav_complaint_mess"
            android:icon="@drawable/ic_local_dining_black_24dp"
            android:title="@string/title_activity_complaint_mess_fac"
            android:visible="false" />
        <item
            android:id="@+id/nav_complaint_hostel"
            android:icon="@drawable/ic_home_black_24dp"
            android:title="@string/title_activity_complaint_hostel"
            android:visible="false" />

        <item
            android:id="@+id/nav_complaint_general"
            android:icon="@drawable/ic_account_balance_black_24dp"
            android:title="@string/title_activity_complaint_general"
            android:visible="false" />

    </group>

    <item android:title="Options">
        <menu>

            <item
                android:id="@+id/nav_profile"
                android:icon="@drawable/ic_perm_identity_black_24dp"
                android:title="@string/title_activity_profile" />

            <!--<item-->
                <!--android:id="@+id/nav_subscriptions"-->
                <!--android:icon="@drawable/ic_event_note_black_24dp"-->
                <!--android:title="@string/subscriptions" />-->

            <item
                android:id="@+id/nav_about"
                android:icon="@drawable/ic_info_outline_black_24dp"
                android:title="@string/title_activity_about_us" />
            <item
                android:id="@+id/nav_log_out"
                android:icon="@drawable/ic_exit_to_app_black_24dp"
                android:title="Log out" />
        </menu>
    </item>

</menu>


text:
package com.twitter.finagle.stats

import com.twitter.app.GlobalFlag

object format
    extends GlobalFlag[String](
      "commonsmetrics",
      "Format style for metric names (ostrich|commonsmetrics|commonsstats)"
    ) {
  private[stats] val Ostrich = "ostrich"
  private[stats] val CommonsMetrics = "commonsmetrics"
  private[stats] val CommonsStats = "commonsstats"
}

private[twitter] object HistogramFormatter {
  def default: HistogramFormatter =
    format() match {
      case format.Ostrich => Ostrich
      case format.CommonsMetrics => CommonsMetrics
      case format.CommonsStats => CommonsStats
    }

  /**
   * The default behavior for formatting as done by Commons Metrics.
   *
   * See Commons Metrics' `Metrics.sample()`.
   */
  object CommonsMetrics extends HistogramFormatter {
    def labelPercentile(p: Double): String = {
      // this has a strange quirk that p999 gets formatted as p9990
      // Round for precision issues; e.g. 0.9998999... converts to "p9998" with a direct int cast.
      val gname: String = "p" + (p * 10000).round
      if (3 < gname.length && ("00" == gname.substring(3))) {
        gname.substring(0, 3)
      } else {
        gname
      }
    }

    override def labelMin: String = "min"

    override def labelMax: String = "max"

    override def labelAverage: String = "avg"
  }

  /**
   * Replicates the behavior for formatting Ostrich stats.
   *
   * See Ostrich's `Distribution.toMap`.
   */
  object Ostrich extends HistogramFormatter {
    def labelPercentile(p: Double): String = {
      p match {
        case 0.5d => "p50"
        case 0.9d => "p90"
        case 0.95d => "p95"
        case 0.99d => "p99"
        case 0.999d => "p999"
        case 0.9999d => "p9999"
        case _ =>
          val padded = (p * 10000).toInt
          s"p$padded"
      }
    }

    override def labelMin: String = "minimum"

    override def labelMax: String = "maximum"

    override def labelAverage: String = "average"
  }

  /**
   * Replicates the behavior for formatting Commons Stats stats.
   *
   * See Commons Stats' `Stats.getVariables()`.
   */
  object CommonsStats extends HistogramFormatter {
    def labelPercentile(p: Double): String =
      s"${p * 100}_percentile".replace(".", "_")

    override def labelMin: String = "min"

    override def labelMax: String = "max"

    override def labelAverage: String = "avg"
  }
}

sealed trait HistogramFormatter {
  def labelPercentile(p: Double): String

  def labelMin: String = "min"

  def labelMax: String = "max"

  def labelAverage: String = "avg"

  def labelCount: String = "count"

  def labelSum: String = "sum"

}


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2012 The Android Open Source Project

  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.
-->

<resources>

    <dimen name="image_thumbnail_size">135dp</dimen>
    <dimen name="image_thumbnail_height">291dp</dimen>
    <dimen name="backdrop_thumbnail_width">260dp</dimen>
    <dimen name="image_thumbnail_spacing">1dp</dimen>
    <dimen name="actor_details_width">340dp</dimen>
    <dimen name="actor_details_height">500dp</dimen>
    <dimen name="details_text_size">22sp</dimen>
    <dimen name="large_text_headline_details">48sp</dimen>
    <dimen name="large_text_headline_details_tv">@dimen/large_text_headline_details</dimen>
    <dimen name="movie_details_padding">16dp</dimen>
    <dimen name="large_padding">60dp</dimen>
    <dimen name="spinner_title_size">22sp</dimen>
    <dimen name="spinner_subtitle_size">16sp</dimen>

</resources>


text:
require 'spec_helper'

module Gauguin
  describe ImageRecolorer do
    describe "#recolor" do
      let(:image) do
        fake = FakeImage.new

        fake.pixels = pixels
        fake.rows = pixels.count
        fake.columns = pixels.first.count
        fake.colors_to_pixels = {
          white.to_s => white_pixel,
          red.to_s => red_pixel,
          black.to_s => black_pixel
        }

        fake
      end
      let(:pixels) do
        [
          [black_pixel, white_pixel, white_pixel],
          [black_pixel, black_pixel, white_pixel],
          [black_pixel, black_pixel, black_pixel]
        ]
      end
      let(:image_recolorer) { ImageRecolorer.new(image) }
      let(:white_pixel) do
        double('white', to_rgb: [255, 255, 255], transparent?: false)
      end
      let(:black_pixel) do
        double('black', to_rgb: [0, 0, 0], transparent?: false)
      end
      let(:red_pixel) do
        double('red', to_rgb: [255, 0, 0], transparent?: false)
      end
      let(:white) { Color.new(255, 255, 255) }
      let(:black) { Color.new(0, 0, 0) }
      let(:red) { Color.new(255, 0, 0) }
      let(:new_colors) do
        {
          black => white,
          white => black
        }
      end

      subject { image_recolorer.recolor(new_colors) }

      before do
        allow(Image).to receive(:blank).and_return(image)
      end

      it "recolors image based on new_colors" do
        expect(subject.pixels).to eq([
          [white_pixel, black_pixel, black_pixel],
          [white_pixel, white_pixel, black_pixel],
          [white_pixel, white_pixel, white_pixel]
        ])
      end

      context "transparent pixel" do
        let(:black_pixel) do
          double('black', to_rgb: [0, 0, 0], transparent?: true)
        end

        it "stays the same" do
          expect(subject.pixels).to eq([
            [black_pixel, black_pixel, black_pixel],
            [black_pixel, black_pixel, black_pixel],
            [black_pixel, black_pixel, black_pixel]
          ])
        end
      end

      context "color not present in new_colors" do
        let(:pixels) do
          [
            [red_pixel, white_pixel, white_pixel],
            [red_pixel, red_pixel, white_pixel],
            [red_pixel, red_pixel, red_pixel]
          ]
        end

        it "stays the same" do
          expect(subject.pixels).to eq([
            [red_pixel, black_pixel, black_pixel],
            [red_pixel, red_pixel, black_pixel],
            [red_pixel, red_pixel, red_pixel]
          ])
        end
      end
    end
  end
end


text:
(function($) {
  "use strict"; // Start of use strict

  // jQuery for page scrolling feature - requires jQuery Easing plugin
  $('a.page-scroll').bind('click', function(event) {
    var $anchor = $(this);
    $('html, body').stop().animate({
      scrollTop: ($($anchor.attr('href')).offset().top - 50)
    }, 1250, 'easeInOutExpo');
    event.preventDefault();
  });

  // Highlight the top nav as scrolling occurs
  $('body').scrollspy({
    target: '.navbar-fixed-top',
    offset: 51
  });

  // Closes the Responsive Menu on Menu Item Click
  $('.navbar-collapse ul li a').click(function() {
    $('.navbar-toggle:visible').click();
  });

  // Offset for Main Navigation
  $('#mainNav').affix({
    offset: {
      top: 100
    }
  });

  // Initialize and Configure Scroll Reveal Animation
  window.sr = ScrollReveal();
  sr.reveal('.sr-icons', {
    duration: 600,
    scale: 0.3,
    distance: '0px'
  }, 200);
  sr.reveal('.sr-button', {
    duration: 1000,
    delay: 200
  });
  sr.reveal('.sr-contact', {
    duration: 600,
    scale: 0.3,
    distance: '0px'
  }, 300);

  // Initialize and Configure Magnific Popup Lightbox Plugin
  // $('.popup-gallery').magnificPopup({
  //   delegate: 'a',
  //   type: 'image',
  //   tLoading: 'Loading image #%curr%...',
  //   mainClass: 'mfp-img-mobile',
  //   gallery: {
  //     enabled: true,
  //     navigateByImgClick: true,
  //     preload: [0, 1] // Will preload 0 - before current, and 1 after the current image
  //   },
  //   image: {
  //     tError: 'The image #%curr% could not be loaded.'
  //   }
  // });

})(jQuery); // End of use strict