text:
package com.hp.hpl.jena.graph.query.regexptrees;

/**
    AnySingle - a pattern that matches any single character.
    @author kers
*/

public class AnySingle extends RegexpTree
    {
    @Override
    public int hashCode()
        { return 0; }

    @Override
    public boolean equals( Object x )
        { return x instanceof AnySingle; }

    @Override
    public String toString()
        { return "<AnySingle>"; }
    }

/*
    (c) Copyright 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP
    All rights reserved.

    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:

    1. Redistributions of source code must retain the above copyright
       notice, this list of conditions and the following disclaimer.

    2. Redistributions in binary form must reproduce the above copyright
       notice, this list of conditions and the following disclaimer in the
       documentation and/or other materials provided with the distribution.

    3. The name of the author may not be used to endorse or promote products
       derived from this software without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
    INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
    NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

redpajama_set_name: RedPajamaGithub


text:
class Integer
  WEIRD_ODD_UNKNOWN_THRESHOLD = 10 ** 18

  def weird?
    # Odd numbers less than 10**18 are not weird. (Bob Hearn, July 2005)
    return false if self & 1 == 1 && self < WEIRD_ODD_UNKNOWN_THRESHOLD

    # Weird numbers are abundant. To be abundant, the sum of the divisors
    # must be greater than twice this number. Equivalently, the sum of
    # the proper divisors (excluding the number itself) must be greater
    # than this number.
    divisors = self.divisors
    sum = divisors.inject { |sum, x| sum + x } - self
    return false unless sum > self

    # Weird numbers are not semiperfect. To be semiperfect, the sum of a
    # subset of the divisors must be equal to this number. Equivalently,
    # the sum of another subset (the complement set) of divisors must be
    # equal to the difference between this number and the sum of all its
    # divisors.
    excess = sum - self
    addends = divisors.reject { |x| x > excess }
    sum = addends.inject { |sum, x| sum + x }

    # Trivially semiperfect or non-semiperfect?
    return false if sum == excess || addends.include?(excess)
    return true if sum < excess

    # Default non-semiperfect test (with special case speed optimization)
    self < 222_952 ? 9_272 == self : !excess.sum_of_subset?(addends)
  end

  def divisors
    list = (2..Math.sqrt(self).floor).select { |i| (self % i).zero? }
    list += list.collect { |i| self / i }
    [1, *list].uniq
  end

  def sum_of_subset?(addends)
    first = addends.first
    return true if self == first
    return false unless addends.length > 1
    rest = addends[1..-1]
    (self - first).sum_of_subset?(rest) or self.sum_of_subset?(rest)
  end
end

input = ARGV.shift.to_i

70.upto(input - 1) do |number|
  puts number if number.weird?
end


text:
static NSString* const FUDurationNegativeMessage = @"Expected 'duration=%g' to be positive";

@interface FUTestTimedAction : FUTimedAction
@property (nonatomic) NSUInteger callCount;
@property (nonatomic) float lastNormalizedTime;
@end

SPEC_BEGIN(FUTimedAction)

describe(@"A timed action", ^{
	__block NSTimeInterval timeLeft;

	it(@"is an action", ^{
		expect([[FUTimedAction class] conformsToProtocol:@protocol(FUAction)]).to.beTruthy();
	});

	context(@"initializing with a negative duration", ^{
		it(@"throws an exception", ^{
			assertThrows([[FUTimedAction alloc] initWithDuration:-1.0], NSInvalidArgumentException, FUDurationNegativeMessage, -1.0f);
		});
	});

	context(@"initialized", ^{
		__block FUTestTimedAction* action;

		beforeEach(^{
			action = [FUTestTimedAction new];
		});

		it(@"has a duration of 0.0", ^{
			expect([action duration]).to.equal(0.0);
		});

		context(@"called consumeDeltaTime: with a 0.0 time", ^{
			beforeEach(^{
				timeLeft = [action consumeDeltaTime:0.0];
			});

			it(@"does not call update", ^{
				expect([action callCount]).to.equal(0);
			});

			it(@"returns all/no time", ^{
				expect(timeLeft).to.equal(0.0);
			});
		});

		context(@"called consumeDeltaTime: with a positive time", ^{
			beforeEach(^{
				timeLeft = [action consumeDeltaTime:1.0];
			});

			it(@"calls update with a normalized time of 1.0f", ^{
				expect([action callCount]).to.equal(1);
				expect([action lastNormalizedTime]).to.equal(1.0f);
			});

			it(@"returns all of the time", ^{
				expect(timeLeft).to.equal(1.0);
			});

			context(@"called consumeDeltaTime: again with a positive time", ^{
				beforeEach(^{
					timeLeft = [action consumeDeltaTime:2.0];
				});

				it(@"does not call update again", ^{
					expect([action callCount]).to.equal(1);
				});

				it(@"returns all of the time", ^{
					expect(timeLeft).to.equal(2.0);
				});
			});

			context(@"called consumeDeltaTime: again with a negative time", ^{
				beforeEach(^{
					timeLeft = [action consumeDeltaTime:-1.0];
				});

				it(@"calls update with a normalized time of 0.0f", ^{
					expect([action callCount]).to.equal(2);
					expect([action lastNormalizedTime]).to.equal(0.0f);
				});

				it(@"returns all of the time", ^{
					expect(timeLeft).to.equal(-1.0);
				});
			});
		});

		context(@"called consumeDeltaTime: with a negative time", ^{
			beforeEach(^{
				timeLeft = [action consumeDeltaTime:-1.0];
			});

			it(@"does not call update", ^{
				expect([action callCount]).to.equal(0);
			});

			it(@"returns all of the time", ^{
				expect(timeLeft).to.equal(-1.0);
			});

			context(@"called consumeDeltaTime: again with a negative time", ^{
				beforeEach(^{
					timeLeft = [action consumeDeltaTime:-2.0];
				});

				it(@"does not call update", ^{
					expect([action callCount]).to.equal(0);
				});

				it(@"returns all of the time", ^{
					expect(timeLeft).to.equal(-2.0);
				});
			});

			context(@"called consumeDeltaTime: again with a positive time", ^{
				beforeEach(^{
					timeLeft = [action consumeDeltaTime:1.0];
				});

				it(@"calls update with a normalized time of 1.0f", ^{
					expect([action callCount]).to.equal(1);
					expect([action lastNormalizedTime]).to.equal(1.0f);
				});

				it(@"returns all of the time", ^{
					expect(timeLeft).to.equal(1.0);
				});
			});
		});
	});

	context(@"initialized with a duration of 2.0", ^{
		__block FUTestTimedAction* action;

		beforeEach(^{
			action = [[FUTestTimedAction alloc] initWithDuration:2.0];
		});

		it(@"has a duration of 2.0", ^{
			expect([action duration]).to.equal(2.0);
		});

		context(@"called consumeDeltaTime: with 1.0 seconds", ^{
			beforeEach(^{
				timeLeft = [action consumeDeltaTime:1.0];
			});

			it(@"calls update with a normalized time of 0.5f", ^{
				expect([action callCount]).to.equal(1);
				expect([action lastNormalizedTime]).to.beCloseTo(0.5f);
			});

			it(@"returns no time left", ^{
				expect(timeLeft).to.equal(0.0);
			});

			context(@"called consumeDeltaTime: with 1.5 seconds", ^{
				beforeEach(^{
					timeLeft = [action consumeDeltaTime:1.5];
				});

				it(@"calls update with a normalized time of 1.0f", ^{
					expect([action callCount]).to.equal(2);
					expect([action lastNormalizedTime]).to.equal(1.0f);
				});

				it(@"returns 0.5 seconds left", ^{
					expect(timeLeft).to.beCloseTo(0.5);
				});

				context(@"called consumeDeltaTime: with -1.0 seconds", ^{
					beforeEach(^{
						timeLeft = [action consumeDeltaTime:-1.0];
					});

					it(@"calls update with a normalized time of 0.5f", ^{
						expect([action callCount]).to.equal(3);
						expect([action lastNormalizedTime]).to.equal(0.5f);
					});

					it(@"returns no time left", ^{
						expect(timeLeft).to.equal(0.0);
					});
				});

				context(@"created a copy", ^{
					__block FUTestTimedAction* actionCopy;

					beforeEach(^{
						actionCopy = [action copy];
					});

					it(@"is not the same instance", ^{
						expect(actionCopy).toNot.beIdenticalTo(action);
					});

					it(@"has a duration of 2.0", ^{
						expect([actionCopy duration]).to.equal(2.0);
					});

					context(@"called consumeDeltaTime: on the copy", ^{
						beforeEach(^{
							timeLeft = [actionCopy consumeDeltaTime:1.0];
						});

						it(@"does not call update", ^{
							expect([actionCopy callCount]).to.equal(0);
						});

						it(@"returns all the time left", ^{
							expect(timeLeft).to.beCloseTo(1.0);
						});
					});
				});
			});

			context(@"called consumeDeltaTime: with -1.5 seconds", ^{
				beforeEach(^{
					timeLeft = [action consumeDeltaTime:-1.5];
				});

				it(@"calls update with a normalized time of 0.0f", ^{
					expect([action callCount]).to.equal(2);
					expect([action lastNormalizedTime]).to.equal(0.0f);
				});

				it(@"returns -0.5 seconds left", ^{
					expect(timeLeft).to.beCloseTo(-0.5);
				});

				context(@"called consumeDeltaTime: with 1.0 seconds", ^{
					beforeEach(^{
						timeLeft = [action consumeDeltaTime:1.0];
					});

					it(@"calls update with a normalized time of 0.5f", ^{
						expect([action callCount]).to.equal(3);
						expect([action lastNormalizedTime]).to.equal(0.5f);
					});

					it(@"returns no time left", ^{
						expect(timeLeft).to.equal(0.0);
					});
				});
			});
		});
	});

	context(@"initialized via the function FUDelay", ^{
		__block FUTimedAction* delay;

		beforeEach(^{
			delay = FUDelay(3.0);
		});

		it(@"is a FUTimedAction", ^{
			expect(delay).to.beKindOf([FUTimedAction class]);
		});

		it(@"has the correct duration", ^{
			expect([delay duration]).to.equal(3.0);
		});
	});
});

SPEC_END

@implementation FUTestTimedAction

- (void)update
{
	[self setCallCount:[self callCount] + 1];
	[self setLastNormalizedTime:[self normalizedTime]];
}

@end


text:
<?php

defined('BASEPATH') OR exit('No direct script access allowed');

class Metodopago extends MY_Controller {

	public function __construct()
	{

		parent::__construct();

		$this->is_logged_in();

		$this->load->model('metodopago_model','metodopago');

	}

	public function index()
	{

		$this->load->helper('url');

		$data['view']='metodo_pago_view';

		$data['data']='';//aqui va la data que se le quiera pasar a la vista a travez de la master

		$this->load->view('master_view',$data);

	}

	public function ajax_dropdown()
	{
		$list = $this->metodopago->get_metodos();
		unset($list[7]);
		$data = array();

		foreach ($list as $metodo) {
			$row = array();
	//		print_r ($categoria);
			$row['id'] = $metodo->id;
			$row['nombre'] = $metodo->nombre;
			$data[] = $row;
		}
		$output = array(
			"metodos" => $data,
				);
		//output to json format
	   echo json_encode($output);
	}
}


text:
export HISTTIMEFORMAT='%Y-%m-%d %H:%M:%S - '
PROMPT_COMMAND='history -a'
HISTFILE=~/.zsh_history
HISTSIZE=50000
SAVEHIST=50000
HISTIGNORE="&:ls:[bf]g:exit:reset:clear:cd:cd ..:cd.."
setopt hist_ignore_all_dups hist_save_nodups share_history hist_ignore_space hist_reduce_blanks hist_verify inc_append_history

function history-all {
    history -E 1
}


text:
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import {
  MatButtonModule,
  MatCardModule,
  MatCheckboxModule,
  MatDialogModule,
  MatFormFieldModule,
  MatIconModule,
  MatInputModule,
  MatListModule,
  MatProgressSpinnerModule,
  MatSelectModule,
  MatSnackBarModule,
  MatTableModule,
  MatToolbarModule,
  MatTooltipModule,
} from '@angular/material';

const MaterialImports = [
  CommonModule,
  MatButtonModule,
  MatCardModule,
  MatFormFieldModule,
  MatIconModule,
  MatInputModule,
  MatListModule,
  MatProgressSpinnerModule,
  MatSnackBarModule,
  MatToolbarModule,
  MatTableModule,
  MatDialogModule,
  MatCheckboxModule,
  MatSelectModule,
  MatTooltipModule,
];

@NgModule({
  imports: MaterialImports,
  exports: MaterialImports,
})
export class MaterialModule { }


text:
'use strict';
'require view';
'require fs';
'require ui';
'require uci';
'require rpc';
'require form';

var callBlockDevices, callMountPoints, callBlockDetect;

callBlockDevices = rpc.declare({
	object: 'luci',
	method: 'getBlockDevices',
	expect: { '': {} }
});

callMountPoints = rpc.declare({
	object: 'luci',
	method: 'getMountPoints',
	expect: { result: [] }
});

callBlockDetect = rpc.declare({
	object: 'luci',
	method: 'setBlockDetect',
	expect: { result: false }
});

function device_textvalue(devices, section_id) {
	var v = (uci.get('fstab', section_id, 'uuid') || '').toLowerCase(),
	    e = Object.keys(devices).filter(function(dev) { return (devices[dev].uuid || '-').toLowerCase() == v })[0];

	if (v) {
		this.section.devices[section_id] = devices[e];

		if (e && devices[e].size)
			return E('span', 'UUID: %h (%s, %1024.2mB)'.format(v, devices[e].dev, devices[e].size));
		else if (e)
			return E('span', 'UUID: %h (%s)'.format(v, devices[e].dev));
		else
			return E('span', 'UUID: %h (%s)'.format(v, _('not present')));
	}

	v = uci.get('fstab', section_id, 'label');
	e = Object.keys(devices).filter(function(dev) { return devices[dev].label == v })[0];

	if (v) {
		this.section.devices[section_id] = this.section.devices[section_id] || devices[e];

		if (e && devices[e].size)
			return E('span', 'Label: %h (%s, %1024.2mB)'.format(v, devices[e].dev, devices[e].size));
		else if (e)
			return E('span', 'Label: %h (%s)'.format(v, devices[e].dev));
		else
			return E('span', 'Label: %h (%s)'.format(v, _('not present')));
	}

	v = uci.get('fstab', section_id, 'device');
	e = Object.keys(devices).filter(function(dev) { return devices[dev].dev == v })[0];

	if (v) {
		this.section.devices[section_id] = this.section.devices[section_id] || devices[e];

		if (e && devices[e].size)
			return E('span', '%h (%1024.2mB)'.format(v, devices[e].size));
		else if (e)
			return E('span', '%h'.format(v));
		else
			return E('span', '%h (%s)'.format(v, _('not present')));
	}
}

return view.extend({
	handleDetect: function(m, ev) {
		return callBlockDetect()
			.then(L.bind(uci.unload, uci, 'fstab'))
			.then(L.bind(m.render, m));
	},

	handleMountAll: function(m, ev) {
		return fs.exec('/sbin/block', ['mount'])
			.then(function(res) {
				if (res.code != 0)
					ui.addNotification(null, E('p', _('The block mount command failed with code %d').format(res.code)));
			})
			.then(L.bind(uci.unload, uci, 'fstab'))
			.then(L.bind(m.render, m));
	},

	handleUmount: function(m, path, ev) {
		return fs.exec('/bin/umount', [path])
			.then(L.bind(uci.unload, uci, 'fstab'))
			.then(L.bind(m.render, m))
			.catch(function(e) { ui.addNotification(null, E('p', e.message)) });
	},

	load: function() {
		return Promise.all([
			callBlockDevices(),
			fs.lines('/proc/filesystems'),
			fs.lines('/etc/filesystems'),
			L.resolveDefault(fs.stat('/usr/sbin/e2fsck'), null),
			L.resolveDefault(fs.stat('/usr/sbin/fsck.f2fs'), null),
			L.resolveDefault(fs.stat('/usr/sbin/fsck.fat'), null),
			L.resolveDefault(fs.stat('/usr/bin/btrfsck'), null),
			L.resolveDefault(fs.stat('/usr/bin/ntfsfix'), null),
			uci.load('fstab')
		]);
	},

	render: function(results) {
		var devices = results[0],
		    procfs = results[1],
		    etcfs = results[2],
		    triggers = {},
		    trigger, m, s, o;

		var fsck = {
			ext2: results[3],
			ext3: results[3],
			ext4: results[3],
			f2fs: results[4],
			vfat: results[5],
			btrfs: results[6],
			ntfs: results[7]
		};

		var filesystems = {};

		for (var i = 0; i < procfs.length; i++)
			if (procfs[i].match(/\S/) && !procfs[i].match(/^nodev\t/))
				filesystems[procfs[i].trim()] = true;

		for (var i = 0; i < etcfs.length; i++)
			if (etcfs[i].match(/\S/))
				filesystems[etcfs[i].trim()] = true;

		filesystems = Object.keys(filesystems).sort();

		if (!uci.sections('fstab', 'global').length)
			uci.add('fstab', 'global');

		m = new form.Map('fstab', _('Mount Points'));

		s = m.section(form.TypedSection, 'global', _('Global Settings'));
		s.addremove = false;
		s.anonymous = true;

		o = s.option(form.Button, '_detect', _('Generate Config'), _('Find all currently attached filesystems and swap and replace configuration with defaults based on what was detected'));
		o.onclick = this.handleDetect.bind(this, m);
		o.inputstyle = 'reload';

		o = s.option(form.Button, '_mountall', _('Mount attached devices'), _('Attempt to enable configured mount points for attached devices'));
		o.onclick = this.handleMountAll.bind(this, m);
		o.inputstyle = 'reload';

		o = s.option(form.Flag, 'anon_swap', _('Anonymous Swap'), _('Mount swap not specifically configured'));
		o.default = o.disabled;
		o.rmempty = false;

		o = s.option(form.Flag, 'anon_mount', _('Anonymous Mount'), _('Mount filesystems not specifically configured'));
		o.default = o.disabled;
		o.rmempty = false;

		o = s.option(form.Flag, 'auto_swap', _('Automount Swap'), _('Automatically mount swap on hotplug'));
		o.default = o.enabled;
		o.rmempty = false;

		o = s.option(form.Flag, 'auto_mount', _('Automount Filesystem'), _('Automatically mount filesystems on hotplug'));
		o.default = o.enabled;
		o.rmempty = false;

		o = s.option(form.Flag, 'check_fs', _('Check filesystems before mount'), _('Automatically check filesystem for errors before mounting'));
		o.default = o.disabled;
		o.rmempty = false;

		// Mount status table
		o = s.option(form.DummyValue, '_mtab');

		o.load = function(section_id) {
			return callMountPoints().then(L.bind(function(mounts) {
				this.mounts = mounts;
			}, this));
		};

		o.render = L.bind(function(view, section_id) {
			var table = E('div', { 'class': 'table' }, [
				E('div', { 'class': 'tr table-titles' }, [
					E('div', { 'class': 'th' }, _('Filesystem')),
					E('div', { 'class': 'th' }, _('Mount Point')),
					E('div', { 'class': 'th center' }, _('Available')),
					E('div', { 'class': 'th center' }, _('Used')),
					E('div', { 'class': 'th' }, _('Unmount'))
				])
			]);

			var rows = [];

			for (var i = 0; i < this.mounts.length; i++) {
				var used = this.mounts[i].size - this.mounts[i].free,
				    umount = true;

				if (/^\/(overlay|rom|tmp(?:\/.+)?|dev(?:\/.+)?|)$/.test(this.mounts[i].mount))
					umount = false;

				rows.push([
					this.mounts[i].device,
					this.mounts[i].mount,
					'%1024.2mB / %1024.2mB'.format(this.mounts[i].avail, this.mounts[i].size),
					'%.2f%% (%1024.2mB)'.format(100 / this.mounts[i].size * used, used),
					umount ? E('button', {
						'class': 'btn cbi-button-remove',
						'click': ui.createHandlerFn(view, 'handleUmount', m, this.mounts[i].mount),
						'disabled': this.map.readonly || null
					}, [ _('Unmount') ]) : '-'
				]);
			}

			cbi_update_table(table, rows, E('em', _('Unable to obtain mount information')));

			return E([], [ E('h3', _('Mounted file systems')), table ]);
		}, o, this);

		// Mounts
		s = m.section(form.GridSection, 'mount', _('Mount Points'), _('Mount Points define at which point a memory device will be attached to the filesystem'));
		s.modaltitle = _('Mount Points - Mount Entry');
		s.anonymous = true;
		s.addremove = true;
		s.sortable  = true;
		s.devices   = {};

		s.renderHeaderRows = function(/* ... */) {
			var trEls = form.GridSection.prototype.renderHeaderRows.apply(this, arguments);
			return trEls.childNodes[0];
		}

		s.tab('general', _('General Settings'));
		s.tab('advanced', _('Advanced Settings'));

		o = s.taboption('general', form.Flag, 'enabled', _('Enabled'));
		o.rmempty  = false;
		o.editable = true;

		o = s.taboption('general', form.DummyValue, '_device', _('Device'));
		o.rawhtml   = true;
		o.modalonly = false;
		o.write = function() {};
		o.remove = function() {};
		o.textvalue = device_textvalue.bind(o, devices);

		o = s.taboption('general', form.Value, 'uuid', _('UUID'), _('If specified, mount the device by its UUID instead of a fixed device node'));
		o.modalonly = true;
		o.value('', _('-- match by uuid --'));

		var devs = Object.keys(devices).sort();
		for (var i = 0; i < devs.length; i++) {
			var dev = devices[devs[i]];
			if (dev.uuid && dev.size)
				o.value(dev.uuid, '%s (%s, %1024.2mB)'.format(dev.uuid, dev.dev, dev.size));
			else if (dev.uuid)
				o.value(dev.uuid, '%s (%s)'.format(dev.uuid, dev.dev));
		}

		o = s.taboption('general', form.Value, 'label', _('Label'), _('If specified, mount the device by the partition label instead of a fixed device node'));
		o.modalonly = true;
		o.depends('uuid', '');
		o.value('', _('-- match by label --'));

		for (var i = 0; i < devs.length; i++) {
			var dev = devices[devs[i]];
			if (dev.label && dev.size)
				o.value(dev.label, '%s (%s, %1024.2mB)'.format(dev.label, dev.dev, dev.size));
			else if (dev.label)
				o.value(dev.label, '%s (%s)'.format(dev.label, dev.dev));
		}

		o = s.taboption('general', form.Value, 'device', _('Device'), _('The device file of the memory or partition (e.g. /dev/sda1)'));
		o.modalonly = true;
		o.depends({ uuid: '', label: '' });

		for (var i = 0; i < devs.length; i++) {
			var dev = devices[devs[i]];
			if (dev.size)
				o.value(dev.dev, '%s (%1024.2mB)'.format(dev.dev, dev.size));
			else
				o.value(dev.dev);
		}

		o = s.taboption('general', form.Value, 'target', _('Mount point'), _('Specifies the directory the device is attached to'));
		o.value('/', _('Use as root filesystem (/)'));
		o.value('/overlay', _('Use as external overlay (/overlay)'));
		o.rmempty = false;

		o = s.taboption('general', form.DummyValue, '__notice', _('Root preparation'));
		o.depends('target', '/');
		o.modalonly = true;
		o.rawhtml = true;
		o.default = '' +
			'
%s
'.format(_('Make sure to clone the root filesystem using something like the commands below:')) +
			'
' +
				'mkdir -p /tmp/introot\n' +
				'mkdir -p /tmp/extroot\n' +
				'mount --bind / /tmp/introot\n' +
				'mount /dev/sda1 /tmp/extroot\n' +
				'tar -C /tmp/introot -cvf - . | tar -C /tmp/extroot -xf -\n' +
				'umount /tmp/introot\n' +
				'umount /tmp/extroot\n' +
			'
'
		;

		o = s.taboption('advanced', form.ListValue, 'fstype', _('Filesystem'));

		o.textvalue = function(section_id) {
			var dev = this.section.devices[section_id],
			    text = this.cfgvalue(section_id) || 'auto';

			if (dev && dev.type && dev.type != text)
				text += ' (%s)'.format(dev.type);

			return text;
		};

		o.value('', 'auto');

		for (var i = 0; i < filesystems.length; i++)
			o.value(filesystems[i]);

		o = s.taboption('advanced', form.Value, 'options', _('Mount options'), _('See "mount" manpage for details'));
		o.textvalue = function(section_id) { return this.cfgvalue(section_id) || 'defaults' };
		o.placeholder = 'defaults';

		s.taboption('advanced', form.Flag, 'enabled_fsck', _('Run filesystem check'), _('Run a filesystem check before mounting the device'));

		// Swaps
		s = m.section(form.GridSection, 'swap', _('SWAP'), _('If your physical memory is insufficient unused data can be temporarily swapped to a swap-device resulting in a higher amount of usable RAM. Be aware that swapping data is a very slow process as the swap-device cannot be accessed with the high datarates of the RAM.'));
		s.modaltitle = _('Mount Points - Swap Entry');
		s.anonymous = true;
		s.addremove = true;
		s.sortable  = true;
		s.devices   = {};

		s.renderHeaderRows = function(/* ... */) {
			var trEls = form.GridSection.prototype.renderHeaderRows.apply(this, arguments);
			trEls.childNodes[0].childNodes[1].style.width = '90%';
			return trEls.childNodes[0];
		}

		o = s.option(form.Flag, 'enabled', _('Enabled'));
		o.rmempty  = false;
		o.editable = true;

		o = s.option(form.DummyValue, '_device', _('Device'));
		o.modalonly = false;
		o.textvalue = device_textvalue.bind(o, devices);

		o = s.option(form.Value, 'uuid', _('UUID'), _('If specified, mount the device by its UUID instead of a fixed device node'));
		o.modalonly = true;
		o.value('', _('-- match by uuid --'));

		var devs = Object.keys(devices).sort();
		for (var i = 0; i < devs.length; i++) {
			var dev = devices[devs[i]];
			if (dev.dev.match(/^\/dev\/(mtdblock|ubi|ubiblock)\d/))
				continue;

			if (dev.uuid && dev.size)
				o.value(dev.uuid, '%s (%s, %1024.2mB)'.format(dev.uuid, dev.dev, dev.size));
			else if (dev.uuid)
				o.value(dev.uuid, '%s (%s)'.format(dev.uuid, dev.dev));
		}

		o = s.option(form.Value, 'label', _('Label'), _('If specified, mount the device by the partition label instead of a fixed device node'));
		o.modalonly = true;
		o.depends('uuid', '');
		o.value('', _('-- match by label --'));

		for (var i = 0; i < devs.length; i++) {
			var dev = devices[devs[i]];
			if (dev.dev.match(/^\/dev\/(mtdblock|ubi|ubiblock)\d/))
				continue;

			if (dev.label && dev.size)
				o.value(dev.label, '%s (%s, %1024.2mB)'.format(dev.label, dev.dev, dev.size));
			else if (dev.label)
				o.value(dev.label, '%s (%s)'.format(dev.label, dev.dev));
		}

		o = s.option(form.Value, 'device', _('Device'), _('The device file of the memory or partition (e.g. /dev/sda1)'));
		o.modalonly = true;
		o.depends({ uuid: '', label: '' });

		for (var i = 0; i < devs.length; i++) {
			var dev = devices[devs[i]];
			if (dev.dev.match(/^\/dev\/(mtdblock|ubi|ubiblock)\d/))
				continue;

			if (dev.size)
				o.value(dev.dev, '%s (%1024.2mB)'.format(dev.dev, dev.size));
			else
				o.value(dev.dev);
		}

		return m.render();
	}
});


text:
package net.dougqh.jak;

import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;

public final class JavaInterfaceDescriptor {
	private static final Type[] EMPTY_INTERFACES = {};
	private static final TypeVariable<?>[] EMPTY_TYPE_VARS = {};

	private final int flags;
	private final String name;
	private Type[] interfaceTypes = EMPTY_INTERFACES;
	private TypeVariable<?>[] typeVars = EMPTY_TYPE_VARS;

	JavaInterfaceDescriptor(
		final JavaModifiers flagsBuilder,
		final String name )
	{
		this.flags = flagsBuilder.flags();
		this.name = name;
	}

	public JavaInterfaceDescriptor extends_( final Type... types ) {
		this.interfaceTypes = types.clone();
		return this;
	}

	public final JavaInterfaceDescriptor parameterize( final TypeVariable<?>... typeVars ) {
		if ( this.typeVars.length != 0 ) {
			throw new IllegalStateException( "Type variables already set" );
		}
		this.typeVars = typeVars.clone();

		return this;
	}

	public final TypeDescriptor typeDescriptor() {
		return new TypeDescriptor(
			this.flags,
			this.name,
			this.typeVars,
			Object.class,
			this.interfaceTypes );
	}
}


text:
<?php
/**
 * PHP Token Reflection
 *
 * Version 1.3.1
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this library in the file LICENSE.
 *
 * @author Ondřej Nešpor
 * @author Jaroslav Hanslík
 */

namespace TokenReflection;

use TokenReflection\Exception, TokenReflection\Stream\StreamBase as Stream;

/**
 * Basic class for reflection elements.
 *
 * Defines a variety of common methods. All reflections are descendants of this class.
 */
abstract class ReflectionElement extends ReflectionBase
{
	/**
	 * Docblock template start.
	 *
	 * @var string
	 */
	const DOCBLOCK_TEMPLATE_START = '/**#@+';

	/**
	 * Docblock template end.
	 *
	 * @var string
	 */
	const DOCBLOCK_TEMPLATE_END = '/**#@-*/';

	/**
	 * Class method cache.
	 *
	 * @var array
	 */
	private static $methodCache = array();

	/**
	 * Filename with reflection subject definition.
	 *
	 * @var string
	 */
	private $fileName;

	/**
	 * Start line in the file.
	 *
	 * @var integer
	 */
	private $startLine;

	/**
	 * End line in the file.
	 *
	 * @var integer
	 */
	private $endLine;

	/**
	 * Start position in the file token stream.
	 *
	 * @var integer
	 */
	protected $startPosition;

	/**
	 * End position in the file token stream.
	 *
	 * @var integer
	 */
	private $endPosition;

	/**
	 * Stack of actual docblock templates.
	 *
	 * @var array
	 */
	protected $docblockTemplates = array();

	/**
	 * Constructor.
	 *
	 * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
	 * @param \TokenReflection\Broker $broker Reflection broker
	 * @param \TokenReflection\IReflection $parent Parent reflection object
	 * @throws \TokenReflection\Exception\ParseException If an empty token stream was provided
	 */
	final public function __construct(Stream $tokenStream, Broker $broker, IReflection $parent = null)
	{
		if (0 === $tokenStream->count()) {
			throw new Exception\ParseException($this, $tokenStream, 'Reflection token stream must not be empty.', Exception\ParseException::INVALID_ARGUMENT);
		}

		parent::__construct($tokenStream, $broker, $parent);
	}

	/**
	 * Parses the token substream.
	 *
	 * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
	 * @param \TokenReflection\IReflection $parent Parent reflection object
	 */
	final protected function parseStream(Stream $tokenStream, IReflection $parent = null)
	{
		$this->fileName = $tokenStream->getFileName();

		$this
			->processParent($parent, $tokenStream)
			->parseStartLine($tokenStream)
			->parseDocComment($tokenStream, $parent)
			->parse($tokenStream, $parent)
			->parseChildren($tokenStream, $parent)
			->parseEndLine($tokenStream);
	}

	/**
	 * Returns the file name the reflection object is defined in.
	 *
	 * @return string
	 */
	public function getFileName()
	{
		return $this->fileName;
	}

	/**
	 * Returns a file reflection.
	 *
	 * @return \TokenReflection\ReflectionFile
	 * @throws \TokenReflection\Exception\RuntimeException If the file is not stored inside the broker
	 */
	public function getFileReflection()
	{
		return $this->getBroker()->getFile($this->fileName);
	}

	/**
	 * Returns the definition start line number in the file.
	 *
	 * @return integer
	 */
	public function getStartLine()
	{
		return $this->startLine;
	}

	/**
	 * Returns the definition end line number in the file.
	 *
	 * @return integer
	 */
	public function getEndLine()
	{
		return $this->endLine;
	}

	/**
	 * Returns the PHP extension reflection.
	 *
	 * Alwyas returns null - everything is user defined.
	 *
	 * @return null
	 */
	public function getExtension()
	{
		return null;
	}

	/**
	 * Returns the PHP extension name.
	 *
	 * Alwyas returns false - everything is user defined.
	 *
	 * @return boolean
	 */
	public function getExtensionName()
	{
		return false;
	}

	/**
	 * Returns the appropriate source code part.
	 *
	 * @return string
	 */
	public function getSource()
	{
		return $this->broker->getFileTokens($this->getFileName())->getSourcePart($this->startPosition, $this->endPosition);
	}

	/**
	 * Returns the start position in the file token stream.
	 *
	 * @return integer
	 */
	public function getStartPosition()
	{
		return $this->startPosition;
	}

	/**
	 * Returns the end position in the file token stream.
	 *
	 * @return integer
	 */
	public function getEndPosition()
	{
		return $this->endPosition;
	}

	/**
	 * Returns the stack of docblock templates.
	 *
	 * @return array
	 */
	protected function getDocblockTemplates()
	{
		return $this->docblockTemplates;
	}

	/**
	 * Processes the parent reflection object.
	 *
	 * @param \TokenReflection\Reflection $parent Parent reflection object
	 * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
	 * @return \TokenReflection\ReflectionElement
	 */
	protected function processParent(IReflection $parent, Stream $tokenStream)
	{
		// To be defined in child classes
		return $this;
	}

	/**
	 * Find the appropriate docblock.
	 *
	 * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
	 * @param \TokenReflection\IReflection $parent Parent reflection
	 * @return \TokenReflection\ReflectionElement
	 */
	protected function parseDocComment(Stream $tokenStream, IReflection $parent)
	{
		if ($this instanceof ReflectionParameter) {
			$this->docComment = new ReflectionAnnotation($this);
			return $this;
		}

		$position = $tokenStream->key();

		if ($tokenStream->is(T_DOC_COMMENT, $position - 1)) {
			$value = $tokenStream->getTokenValue($position - 1);
			if (self::DOCBLOCK_TEMPLATE_END !== $value) {
				$this->docComment = new ReflectionAnnotation($this, $value);
				$this->startPosition--;
			}
		} elseif ($tokenStream->is(T_DOC_COMMENT, $position - 2)) {
			$value = $tokenStream->getTokenValue($position - 2);
			if (self::DOCBLOCK_TEMPLATE_END !== $value) {
				$this->docComment = new ReflectionAnnotation($this, $value);
				$this->startPosition -= 2;
			}
		} elseif ($tokenStream->is(T_COMMENT, $position - 1) && preg_match('~^' . preg_quote(self::DOCBLOCK_TEMPLATE_START, '~') . '~', $tokenStream->getTokenValue($position - 1))) {
			$this->docComment = new ReflectionAnnotation($this, $tokenStream->getTokenValue($position - 1));
			$this->startPosition--;
		} elseif ($tokenStream->is(T_COMMENT, $position - 2) && preg_match('~^' . preg_quote(self::DOCBLOCK_TEMPLATE_START, '~') . '~', $tokenStream->getTokenValue($position - 2))) {
			$this->docComment = new ReflectionAnnotation($this, $tokenStream->getTokenValue($position - 2));
			$this->startPosition -= 2;
		}

		if (null === $this->docComment) {
			$this->docComment = new ReflectionAnnotation($this);
		}

		if ($parent instanceof ReflectionElement) {
			$this->docComment->setTemplates($parent->getDocblockTemplates());
		}

		return $this;
	}

	/**
	 * Saves the start line number.
	 *
	 * @param \TokenReflection\Stream\StreamBase $tokenStream Token susbtream
	 * @return \TokenReflection\ReflectionElement
	 */
	private final function parseStartLine(Stream $tokenStream)
	{
		$token = $tokenStream->current();
		$this->startLine = $token[2];

		$this->startPosition = $tokenStream->key();

		return $this;
	}

	/**
	 * Saves the end line number.
	 *
	 * @param \TokenReflection\Stream\StreamBase $tokenStream Token susbtream
	 * @return \TokenReflection\ReflectionElement
	 */
	private final function parseEndLine(Stream $tokenStream)
	{
		$token = $tokenStream->current();
		$this->endLine = $token[2];

		$this->endPosition = $tokenStream->key();

		return $this;
	}

	/**
	 * Parses reflected element metadata from the token stream.
	 *
	 * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
	 * @param \TokenReflection\IReflection $parent Parent reflection object
	 * @return \TokenReflection\ReflectionElement
	 */
	abstract protected function parse(Stream $tokenStream, IReflection $parent);

	/**
	 * Parses the reflection object name.
	 *
	 * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
	 * @return \TokenReflection\ReflectionElement
	 */
	abstract protected function parseName(Stream $tokenStream);

	/**
	 * Parses child reflection objects from the token stream.
	 *
	 * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
	 * @param \TokenReflection\Reflection $parent Parent reflection object
	 * @return \TokenReflection\ReflectionElement
	 */
	protected function parseChildren(Stream $tokenStream, IReflection $parent)
	{
		// To be defined in child classes
		return $this;
	}
}


text:
#region [R# naming]
// ReSharper disable ArrangeTypeModifiers
// ReSharper disable UnusedMember.Local
// ReSharper disable FieldCanBeMadeReadOnly.Local
// ReSharper disable ArrangeTypeMemberModifiers
// ReSharper disable InconsistentNaming
#endregion
using NSpectator.Domain;
using NUnit.Framework;
using FluentAssertions;

namespace NSpectator.Specs.Running.Exceptions
{
    [TestFixture]
    [Category("RunningSpecs")]
    public class When_after_contains_exception : When_running_specs
    {
        class SpecClass : Spec
        {
            void method_level_context()
            {
                After = () => { throw new AfterException(); };

                It["should fail this example because of after"] = () => "1".Should().Be("1");

                It["should also fail this example because of after"] = () => "1".Should().Be("1");

                It["overrides exception from same level it"] = () => { throw new ItException(); };

                Context["exception thrown by both after and nested before"] = () =>
                {
                    Before = () => { throw new BeforeException(); };

                    It["preserves exception from nested before"] = () => "1".Should().Be("1");
                };

                Context["exception thrown by both after and nested act"] = () =>
                {
                    Act = () => { throw new ActException(); };

                    It["preserves exception from nested act"] = () => "1".Should().Be("1");
                };

                Context["exception thrown by both after and nested it"] = () =>
                {
                    It["overrides exception from nested it"] = () => { throw new ItException(); };
                };

                Context["exception thrown by both after and nested after"] = () =>
                {
                    It["preserves exception from nested after"] = () => "1".Should().Be("1");

                    After = () => { throw new NestedAfterException(); };
                };
            }
        }

        [SetUp]
        public void Setup()
        {
            Run(typeof(SpecClass));
        }

        [Test]
        public void the_example_level_failure_should_indicate_a_context_failure()
        {
            TheExample("should fail this example because of after")
                .Exception.GetType().Should().Be(typeof(ExampleFailureException));
            TheExample("should also fail this example because of after")
                .Exception.GetType().Should().Be(typeof(ExampleFailureException));
            TheExample("overrides exception from same level it")
                .Exception.GetType().Should().Be(typeof(ExampleFailureException));
            TheExample("preserves exception from nested before")
                .Exception.GetType().Should().Be(typeof(ExampleFailureException));
            TheExample("preserves exception from nested act")
                .Exception.GetType().Should().Be(typeof(ExampleFailureException));
            TheExample("overrides exception from nested it")
                .Exception.GetType().Should().Be(typeof(ExampleFailureException));
            TheExample("preserves exception from nested after")
                .Exception.GetType().Should().Be(typeof(ExampleFailureException));
        }

        [Test]
        public void examples_with_only_after_failure_should_fail_because_of_after()
        {
            TheExample("should fail this example because of after")
                .Exception.InnerException.GetType().Should().Be(typeof(AfterException));
            TheExample("should also fail this example because of after")
                .Exception.InnerException.GetType().Should().Be(typeof(AfterException));
        }

        [Test]
        public void it_should_throw_exception_from_after_not_from_same_level_it()
        {
            TheExample("overrides exception from same level it")
                .Exception.InnerException.GetType().Should().Be(typeof(AfterException));
        }

        [Test]
        public void it_should_throw_exception_from_nested_before_not_from_after()
        {
            TheExample("preserves exception from nested before")
                .Exception.InnerException.GetType().Should().Be(typeof(BeforeException));
        }

        [Test]
        public void it_should_throw_exception_from_nested_act_not_from_after()
        {
            TheExample("preserves exception from nested act")
                .Exception.InnerException.GetType().Should().Be(typeof(ActException));
        }

        [Test]
        public void it_should_throw_exception_from_after_not_from_nested_it()
        {
            TheExample("overrides exception from nested it")
                .Exception.InnerException.GetType().Should().Be(typeof(AfterException));
        }

        [Test]
        public void it_should_throw_exception_from_nested_after_not_from_after()
        {
            TheExample("preserves exception from nested after")
                .Exception.InnerException.GetType().Should().Be(typeof(NestedAfterException));
        }
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="keywords" content="Naftal Timotheus / tnaffh"/>
    <meta name="description" content="Naftal Timotheus / tnaffh"/>
    <meta name="author" content="tnaffh.com"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
    <title>Naftal Timotheus / tnaffh </title>

    <link rel="shortcut icon" href="images/favicon.ico"/>

    <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css"/>

    <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,300italic,400italic,600italic,700,700italic,800,800italic'
          rel='stylesheet' type="text/css"/>
    <link href='https://fonts.googleapis.com/css?family=Raleway:400,100,100italic,200italic,200,300,300italic,400italic,500,500italic,600,600italic,700italic,900italic,900,800,700,800italic'
          rel='stylesheet' type="text/css"/>

    <link href="css/themify-icons.css" rel="stylesheet" type="text/css"/>

    <link href="css/font-awesome.min.css" rel="stylesheet" type="text/css"/>

    <link href="css/magnific-popup.css" rel="stylesheet" type="text/css"/>

    <link rel='stylesheet' href='css/jquery-ui.css'>

    <link href="css/style.css" rel="stylesheet" type="text/css"/>

    <link href="css/responsive.css" rel="stylesheet" type="text/css"/>

            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                Toggle navigation

            </button>

Home

About

contact

 Hello i'm  Naftal Timotheus

                            Download my CV

                        Know about me

About Me

                        About me

Name:

Naftal Timotheus

Email:

tnaffh@gmail.com

Mobile:

+264 81 4369 731

Date of birth:

09 October 1992

Address:

24 Robert Mugabe Ave Auspanplatz Windhoek P O Box 41220 Namibia

Nationality:

Namibia

I have more than 5 years of experience in the field of Software development and Designing.
                                    In PHP Applications and Mobile apps.
                                    Professional in Corporate branding, Graphic designing, Web Designing,
                                    visualization, GUI, graphics & animations for e-learning, illustrations, web icons,
                                    flash web banner, flash intro animations, logos, brochures, posters etc.

Creative Solution Provider as a Freelance Graphic Artist and a Dedicated, Team worker
                                    to Induce the Creative Juice among the colleagues with a View to deliver the Best
                                    and New in the business.

<


text:
More effects

There are lots of effects and animations.

They all have different options and configurations. You should read about them!

Effect documentation


text:
declare module 'react-copy-to-clipboard' {
  declare export type CopyToClipboardOptions = {
    debug: boolean,
    message: string
  };

  declare export type CopyToClipboardProps = {
    text: string,
    onCopy?: (text: string, result: boolean) => void,
    options?: CopyToClipboardOptions,
    children?: React$Node
  };

  declare export class CopyToClipboard extends React$Component<CopyToClipboardProps> {}
  declare export default class CopyToClipboard extends React$Component<CopyToClipboardProps> {}
}


text:
from base import *
from devices import *

class wifikit32_vmDevice(Board):

    @classmethod
    def match(cls,dev):
        tmplfile = fs.path(fs.dirname(__file__),cls.__name__[:-6]+".yml")
        try:
            if not hasattr(cls,"tmpl"):
                cls.tmpl = fs.get_yaml(tmplfile)
                cls.vids = cls.tmpl["device"]["vids"]
                cls.pids = cls.tmpl["device"]["pids"]
        except:
            cls.tmpl={}
            cls.vids = []
            cls.pids = []

        # add vids and pids to the device template to enable board discovery
        return dev["vid"] in cls.vids and dev["pid"] in cls.pids

    def reset(self):
        import time
        conn = ConnectionInfo()
        conn.set_serial(self.port,**self.connection)
        ch = Channel(conn)
        try:
            ch.open(timeout=2)
        except:
            fatal("Can't open serial:",self.port)
        esp32r0_delay=True
        ch.setDTR(False)  # IO0=HIGH
        ch.setRTS(True)   # EN=LOW, chip in reset
        time.sleep(0.1)
        if esp32r0_delay:
            # Some chips are more likely to trigger the esp32r0
            # watchdog reset silicon bug if they're held with EN=LOW
            # for a longer period
            time.sleep(1.2)
        #ch.setDTR(True)   # IO0=LOW
        ch.setRTS(False)  # EN=HIGH, chip out of reset
        if esp32r0_delay:
            # Sleep longer after reset.
            # This workaround only works on revision 0 ESP32 chips,
            # it exploits a silicon bug spurious watchdog reset.
            time.sleep(0.4)  # allow watchdog reset to occur
        time.sleep(0.05)
        ch.setDTR(False)  # IO0=HIGH, done
        ch.close()

    def burn_custom(self,bin,portbin,outfn=None):
        rom = bin[3]    #bootloader
        irom = bin[1]   #app
        brom = bin[2]   #partition
        vrom = bin[0]   #vstore
        romf = fs.get_tempfile(rom)
        iromf = fs.get_tempfile(irom)
        bromf = fs.get_tempfile(brom)
        vromf = fs.get_tempfile(vrom)
        cromf = fs.get_tempfile(portbin) #port.bin
        res,out,err = proc.runcmd("python",tools["esptool32"],
                "--chip", "esp32",
                "--port",self.port,
                "--baud","115200",
                "--before", "default_reset",
                "--after", "hard_reset",
                "write_flash",
                "-z","--flash_freq","40m",
                "--flash_mode","dio",
                "--flash_size","detect",
                "0x1000",romf,
                "0x10000",iromf,
                "0x8000", bromf,
                "0x390000",vromf,
                "0x392000",cromf,
                outfn=outfn)
        fs.del_tempfile(romf)
        fs.del_tempfile(iromf)
        fs.del_tempfile(bromf)
        fs.del_tempfile(vromf)
        fs.del_tempfile(cromf)
        if res:
            return False,out
        return True,out

    def erase(self,outfn=None):
        res,out,err = proc.runcmd("python",tools["esptool32"],
                "--chip", "esp32",
                "--port", self.port,
                "--baud", "115200",
                "erase_flash",
                outfn=outfn)
        if res:
            return False,out
        return True,out

    def custom_get_chipid(self,method=0,outfn=None):
        res,out,err = proc.runcmd("python",tools["esptool32"],"--chip", "esp32","--port",self.port,"--baud","115200","--before", "default_reset", "--after", "hard_reset","read_mac",outfn=outfn)

        if res:
            return None
        lines=out.split("\n")
        for line in lines:
            if line.startswith("MAC: "):
                smac = line[5:].split(":")
                mac = ""
                for m in smac:
                    mac = mac+m[1]+m[0]
                return mac
        return None

    def custom_burn_layout(self,layout,options={},outfn=None):
        args = []
        for chunk in layout.chunks():
            args.append(hex(chunk["loc"]) if not isinstance(chunk["loc"],str) else chunk["loc"])
            tfile = fs.get_tempfile(chunk["bin"])
            args.append(tfile)
        baud = str(options.get("baud",115200))
        res,out,err = proc.runcmd("python",tools["esptool32"],"--chip", "esp32","--port",self.port,"--baud",baud,"--before", "default_reset", "--after", "hard_reset","write_flash","-z","--flash_freq","40m","--flash_mode","dio","--flash_size","detect",*args,outfn=outfn)

        for arg in args:
            # cleanup
            if not arg.startswith("0x"):
                fs.rm_file(arg)

        if res:
            return False,out
        return True,out


text:
zuul-demo
=========

A demo for node's [zuul](/defunctzombie/zuul) test runner. Made for a javascript meetup presentation.

## 1: Local Testing

[`local-tests` branch](https://github.com/yanatan16/zuul-demo/tree/local-tests)

- [implementation](index.js)
- [tests](test/index.js)

```
mocha test/index.js
```

## 2: Browser Testing

[`browser-tests` branch](https://github.com/yanatan16/zuul-demo/tree/browser-tests)

[diff with `local-tests`](https://github.com/yanatan16/zuul-demo/compare/local-tests...browser-tests)

- [.zuul.yml](.zuul.yml)
- [test_server.js](test/test_server.js)

```
zuul --local 8123 -- test/index.js
```

## 3: Cloud Testing

[`cloud-tests` branch](https://github.com/yanatan16/zuul-demo/tree/cloud-tests)

[diff with `browser-tests`](https://github.com/yanatan16/zuul-demo/compare/browser-tests...cloud-tests)

- [.zuul.yml](.zuul.yml)

```
zuul -- test/index.js
```

## 4: Travis-CI

[`travis-test` branch](https://github.com/yanatan16/zuul-demo/tree/travis-test)

[diff with `cloud-tests`](https://github.com/yanatan16/zuul-demo/compare/cloud-tests...travis-test)

- [.travis.yml](.travis.yml)
- [package.json](package.json)
- [Travis CI](http://travis-ci.org)

```
git push
```

# Slides

[zuul-demo.slide](slides/zuul-demo.slide) were made with the [go-present](https://code.google.com/p/go.tools/present) tool.

```
go get code.google.com/p/go.tools/cmd/present
cd zuul-demo
$GOPATH/bin/present
```

And open to [http://127.0.0.1:3999/slides/zuul-demo.slide](http://127.0.0.1:3999/slides/zuul-demo.slide).


text:
'use strict';

angular.module('travelplanApp.version', [
  'travelplanApp.version.interpolate-filter',
  'travelplanApp.version.version-directive'
])

.value('version', '0.2');


text:
This code is described in the following section(s) of [`methods/methods_release1.md`](https://github.com/biocore/emp/blob/master/methods/methods_release1.md):

**3.11.2:**

* `summarize_otu_distributions.ipynb` (generate summary statistics for each sequence/OTU)
* `otu_entropy.ipynb` (determine which sequences have the most skewed environment distributions)
* `otu_trading_cards.ipynb` (generate LaTeX macros and charts for trading cards)
* `trading-card-latex` (render trading cards as PDFs)
* `trading-card-html` (render trading cards as web pages)

**3.11.3:**

* `otu_scatter_plots.ipynb` (plot the distribution of any Deblur sequence as a function of any metadata variable)
* `get_v4_region.py` (extract the V4 region of an input 16S sequence, specifying the desired length, e.g., to match 90-bp or 150-bp Deblur sequences)
* `verify_amplicon_type.py` (guess the amplicon type, e.g., 16S V4, using the first few basepairs of a multi-FASTA file)


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Users extends MY_Controller {

  public function __construct()
  {
    parent::__construct();
    $this->loadModel('User', 'users_model');
    $this->setTitle('Bookshelf - login');
  }

  public function login()
  {
    $this->load->helper('form');
    if($this->session->userdata('logged_in')) {
      redirect('/', 'refresh');
    } else {
      $this->view('users/login');
    }
  }

	public function auth()
	{
  	 $this->load->library('form_validation');

     $this->form_validation->set_rules('email', 'Email', 'trim|required');
     $this->form_validation->set_rules('password', 'Password', 'trim|required|callback_check_user_data');

     if($this->form_validation->run() == FALSE)
     {
       $this->setOutputData('invalid', TRUE);
       $this->view('users/login');
     }
     else
     {
       redirect('/', 'refresh');
     }
	}

	public function check_user_data($password)
  {
    $username = $this->input->post('email');
    $password = $password;
    $result = $this->users_model->login($username, $password);

	  if($result) {
      $sess_array = array();
      foreach($result as $row)
      {
        $sess_array = array(
          'id' => $row->id,
          'email' => $row->email
        );
        $this->session->set_userdata('logged_in', $sess_array);
      }
      return TRUE;
    } else {

        $this->form_validation->set_message('check_user_data', 'Invalid username or password');
        return FALSE;

    }
  }

  public function logout()
  {
    $this->session->unset_userdata('logged_in');
    $this->session->sess_destroy();
    redirect('/', 'refresh');
  }
}


text:
#ifndef _MM_HASH_H
#define _MM_HASH_H
#include "mm.h"

typedef void (*MM_HashDtor)(void *);

typedef struct _MM_Bucket {
	struct _MM_Bucket *next;
	char *key;
	int length;
	unsigned int hash;
	void *data;
} MM_Bucket;

#define MM_HASH_SIZE 1009
typedef struct _Hash {
	 MM_Bucket *buckets[ MM_HASH_SIZE ];
	 MM *mm;
	 MM_HashDtor dtor;
	 int nElements;
} MM_Hash;

MM_Hash *mm_hash_new(MM *, MM_HashDtor);
void mm_hash_free(MM_Hash *table);
void *mm_hash_find(MM_Hash *table, const void *key, int length);
void mm_hash_add(MM_Hash *table, char *key, int length, void *data);
void mm_hash_delete(MM_Hash *table, char *key, int length);
void mm_hash_update(MM_Hash *table, char *key, int length, void *data);
#endif

/*
Local variables:
tab-width: 4
c-basic-offset: 4
End:
vim600: noet sw=4 ts=4 fdm=marker
vim<600: noet sw=4 ts=4
*/


text:
(function($){
    $(document).on('click', '.showModalButton', function (e) {
        e.preventDefault();
        //check if the modal is open. if it's open just reload content not whole modal
        //also this allows you to nest buttons inside of modals to reload the content it is in
        //the if else are intentionally separated instead of put into a function to get the
        //button since it is using a class not an #id so there are many of them and we need
        //to ensure we get the right button and content.
        if ($('#modal').data('bs.modal').isShown) {
            $('#modal').find('#modalContent')
                    .load($(this).attr('href'));
            //dynamiclly set the header for the modal
            document.getElementById('modalHeaderTitle').innerHTML = '
' + $(this).attr('title') + '
';
        } else {
            //if modal isn't open; open it and load content
            $('#modal').modal('show')
                    .find('#modalContent')
                    .load($(this).attr('href'));
            //dynamiclly set the header for the modal
            document.getElementById('modalHeaderTitle').innerHTML = '
' + $(this).attr('title') + '
';
        }
    });

 })(jQuery);


text:
namespace Microsoft.Azure.Management.DevSpaces
{
    using Microsoft.Rest;
    using Microsoft.Rest.Azure;
    using Microsoft.Rest.Serialization;
    using Models;
    using Newtonsoft.Json;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using System.Net.Http;

    /// <summary>
    /// Dev Spaces Client
    /// </summary>
    public partial class DevSpacesManagementClient : ServiceClient<DevSpacesManagementClient>, IDevSpacesManagementClient, IAzureClient
    {
        /// <summary>
        /// The base URI of the service.
        /// </summary>
        public System.Uri BaseUri { get; set; }

        /// <summary>
        /// Gets or sets json serialization settings.
        /// </summary>
        public JsonSerializerSettings SerializationSettings { get; private set; }

        /// <summary>
        /// Gets or sets json deserialization settings.
        /// </summary>
        public JsonSerializerSettings DeserializationSettings { get; private set; }

        /// <summary>
        /// Credentials needed for the client to connect to Azure.
        /// </summary>
        public ServiceClientCredentials Credentials { get; private set; }

        /// <summary>
        /// Azure subscription ID.
        /// </summary>
        public string SubscriptionId { get; set; }

        /// <summary>
        /// Client API version.
        /// </summary>
        public string ApiVersion { get; private set; }

        /// <summary>
        /// The preferred language for the response.
        /// </summary>
        public string AcceptLanguage { get; set; }

        /// <summary>
        /// The retry timeout in seconds for Long Running Operations. Default value is
        /// 30.
        /// </summary>
        public int? LongRunningOperationRetryTimeout { get; set; }

        /// <summary>
        /// Whether a unique x-ms-client-request-id should be generated. When set to
        /// true a unique x-ms-client-request-id value is generated and included in
        /// each request. Default is true.
        /// </summary>
        public bool? GenerateClientRequestId { get; set; }

        /// <summary>
        /// Gets the IContainerHostMappingsOperations.
        /// </summary>
        public virtual IContainerHostMappingsOperations ContainerHostMappings { get; private set; }

        /// <summary>
        /// Gets the IOperations.
        /// </summary>
        public virtual IOperations Operations { get; private set; }

        /// <summary>
        /// Gets the IControllersOperations.
        /// </summary>
        public virtual IControllersOperations Controllers { get; private set; }

        /// <summary>
        /// Initializes a new instance of the DevSpacesManagementClient class.
        /// </summary>
        /// <param name='httpClient'>
        /// HttpClient to be used
        /// </param>
        /// <param name='disposeHttpClient'>
        /// True: will dispose the provided httpClient on calling DevSpacesManagementClient.Dispose(). False: will not dispose provided httpClient</param>
        protected DevSpacesManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient)
        {
            Initialize();
        }

        /// <summary>
        /// Initializes a new instance of the DevSpacesManagementClient class.
        /// </summary>
        /// <param name='handlers'>
        /// Optional. The delegating handlers to add to the http client pipeline.
        /// </param>
        protected DevSpacesManagementClient(params DelegatingHandler[] handlers) : base(handlers)
        {
            Initialize();
        }

        /// <summary>
        /// Initializes a new instance of the DevSpacesManagementClient class.
        /// </summary>
        /// <param name='rootHandler'>
        /// Optional. The http client handler used to handle http transport.
        /// </param>
        /// <param name='handlers'>
        /// Optional. The delegating handlers to add to the http client pipeline.
        /// </param>
        protected DevSpacesManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers)
        {
            Initialize();
        }

        /// <summary>
        /// Initializes a new instance of the DevSpacesManagementClient class.
        /// </summary>
        /// <param name='baseUri'>
        /// Optional. The base URI of the service.
        /// </param>
        /// <param name='handlers'>
        /// Optional. The delegating handlers to add to the http client pipeline.
        /// </param>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown when a required parameter is null
        /// </exception>
        protected DevSpacesManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers)
        {
            if (baseUri == null)
            {
                throw new System.ArgumentNullException("baseUri");
            }
            BaseUri = baseUri;
        }

        /// <summary>
        /// Initializes a new instance of the DevSpacesManagementClient class.
        /// </summary>
        /// <param name='baseUri'>
        /// Optional. The base URI of the service.
        /// </param>
        /// <param name='rootHandler'>
        /// Optional. The http client handler used to handle http transport.
        /// </param>
        /// <param name='handlers'>
        /// Optional. The delegating handlers to add to the http client pipeline.
        /// </param>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown when a required parameter is null
        /// </exception>
        protected DevSpacesManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
        {
            if (baseUri == null)
            {
                throw new System.ArgumentNullException("baseUri");
            }
            BaseUri = baseUri;
        }

        /// <summary>
        /// Initializes a new instance of the DevSpacesManagementClient class.
        /// </summary>
        /// <param name='credentials'>
        /// Required. Credentials needed for the client to connect to Azure.
        /// </param>
        /// <param name='handlers'>
        /// Optional. The delegating handlers to add to the http client pipeline.
        /// </param>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown when a required parameter is null
        /// </exception>
        public DevSpacesManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)
        {
            if (credentials == null)
            {
                throw new System.ArgumentNullException("credentials");
            }
            Credentials = credentials;
            if (Credentials != null)
            {
                Credentials.InitializeServiceClient(this);
            }
        }

        /// <summary>
        /// Initializes a new instance of the DevSpacesManagementClient class.
        /// </summary>
        /// <param name='credentials'>
        /// Required. Credentials needed for the client to connect to Azure.
        /// </param>
        /// <param name='httpClient'>
        /// HttpClient to be used
        /// </param>
        /// <param name='disposeHttpClient'>
        /// True: will dispose the provided httpClient on calling DevSpacesManagementClient.Dispose(). False: will not dispose provided httpClient</param>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown when a required parameter is null
        /// </exception>
        public DevSpacesManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient)
        {
            if (credentials == null)
            {
                throw new System.ArgumentNullException("credentials");
            }
            Credentials = credentials;
            if (Credentials != null)
            {
                Credentials.InitializeServiceClient(this);
            }
        }

        /// <summary>
        /// Initializes a new instance of the DevSpacesManagementClient class.
        /// </summary>
        /// <param name='credentials'>
        /// Required. Credentials needed for the client to connect to Azure.
        /// </param>
        /// <param name='rootHandler'>
        /// Optional. The http client handler used to handle http transport.
        /// </param>
        /// <param name='handlers'>
        /// Optional. The delegating handlers to add to the http client pipeline.
        /// </param>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown when a required parameter is null
        /// </exception>
        public DevSpacesManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
        {
            if (credentials == null)
            {
                throw new System.ArgumentNullException("credentials");
            }
            Credentials = credentials;
            if (Credentials != null)
            {
                Credentials.InitializeServiceClient(this);
            }
        }

        /// <summary>
        /// Initializes a new instance of the DevSpacesManagementClient class.
        /// </summary>
        /// <param name='baseUri'>
        /// Optional. The base URI of the service.
        /// </param>
        /// <param name='credentials'>
        /// Required. Credentials needed for the client to connect to Azure.
        /// </param>
        /// <param name='handlers'>
        /// Optional. The delegating handlers to add to the http client pipeline.
        /// </param>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown when a required parameter is null
        /// </exception>
        public DevSpacesManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)
        {
            if (baseUri == null)
            {
                throw new System.ArgumentNullException("baseUri");
            }
            if (credentials == null)
            {
                throw new System.ArgumentNullException("credentials");
            }
            BaseUri = baseUri;
            Credentials = credentials;
            if (Credentials != null)
            {
                Credentials.InitializeServiceClient(this);
            }
        }

        /// <summary>
        /// Initializes a new instance of the DevSpacesManagementClient class.
        /// </summary>
        /// <param name='baseUri'>
        /// Optional. The base URI of the service.
        /// </param>
        /// <param name='credentials'>
        /// Required. Credentials needed for the client to connect to Azure.
        /// </param>
        /// <param name='rootHandler'>
        /// Optional. The http client handler used to handle http transport.
        /// </param>
        /// <param name='handlers'>
        /// Optional. The delegating handlers to add to the http client pipeline.
        /// </param>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown when a required parameter is null
        /// </exception>
        public DevSpacesManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
        {
            if (baseUri == null)
            {
                throw new System.ArgumentNullException("baseUri");
            }
            if (credentials == null)
            {
                throw new System.ArgumentNullException("credentials");
            }
            BaseUri = baseUri;
            Credentials = credentials;
            if (Credentials != null)
            {
                Credentials.InitializeServiceClient(this);
            }
        }

        /// <summary>
        /// An optional partial-method to perform custom initialization.
        /// </summary>
        partial void CustomInitialize();
        /// <summary>
        /// Initializes client properties.
        /// </summary>
        private void Initialize()
        {
            ContainerHostMappings = new ContainerHostMappingsOperations(this);
            Operations = new Operations(this);
            Controllers = new ControllersOperations(this);
            BaseUri = new System.Uri("https://management.azure.com");
            ApiVersion = "2019-01-01-preview";
            AcceptLanguage = "en-US";
            LongRunningOperationRetryTimeout = 30;
            GenerateClientRequestId = true;
            SerializationSettings = new JsonSerializerSettings
            {
                Formatting = Newtonsoft.Json.Formatting.Indented,
                DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
                DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
                NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
                ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
                ContractResolver = new ReadOnlyJsonContractResolver(),
                Converters = new List<JsonConverter>
                    {
                        new Iso8601TimeSpanConverter()
                    }
            };
            SerializationSettings.Converters.Add(new TransformationJsonConverter());
            DeserializationSettings = new JsonSerializerSettings
            {
                DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
                DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
                NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
                ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
                ContractResolver = new ReadOnlyJsonContractResolver(),
                Converters = new List<JsonConverter>
                    {
                        new Iso8601TimeSpanConverter()
                    }
            };
            SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<OrchestratorSpecificConnectionDetails>("instanceType"));
            DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<OrchestratorSpecificConnectionDetails>("instanceType"));
            CustomInitialize();
            DeserializationSettings.Converters.Add(new TransformationJsonConverter());
            DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
        }
    }
}


text:
package mathcommands;
import operations.MathOperations;
import commands.*;

public class Difference extends MathCommand {

	public Difference(MathOperations equations, Command var1, Command var2) {
		super(equations, var2, var2);
		// TODO Auto-generated constructor stub
	}

	@Override
	public double execute() {
		// TODO Auto-generated method stub
		double result = this.myEquations.minus(this.myVar1.execute(),this.myVar2.execute());
		return result;
	}

}


text:
import unittest
from pymetrics.metric import Metric

class Nothing(Metric):
    def dump(self):
        pass

    def __init__(self):
        Metric.__init__(self, 'test')

class TestMetric(unittest.TestCase):
    def test_name_and_metric(self):
        metric = Nothing()
        self.assertEqual('nothing', metric.metric)
        self.assertEqual('test', metric.name)

###

if __name__ == '__main__':
    unittest.main()


text:
package org.apache.flink.formats.avro.utils;

import org.apache.flink.formats.avro.generated.Address;
import org.apache.flink.formats.avro.generated.Colors;
import org.apache.flink.formats.avro.generated.Fixed16;
import org.apache.flink.formats.avro.generated.Fixed2;
import org.apache.flink.formats.avro.generated.SimpleUser;
import org.apache.flink.formats.avro.generated.User;

import java.math.BigDecimal;
import java.nio.ByteBuffer;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Random;

/** Generator for random test data for the generated Avro User type. */
public class TestDataGenerator {

    public static User generateRandomUser(Random rnd) {
        return new User(
                generateRandomString(rnd, 50),
                rnd.nextBoolean() ? null : rnd.nextInt(),
                rnd.nextBoolean() ? null : generateRandomString(rnd, 6),
                rnd.nextBoolean() ? null : rnd.nextLong(),
                rnd.nextDouble(),
                null,
                rnd.nextBoolean(),
                generateRandomStringList(rnd, 20, 30),
                generateRandomBooleanList(rnd, 20),
                rnd.nextBoolean() ? null : generateRandomStringList(rnd, 20, 20),
                generateRandomColor(rnd),
                new HashMap<>(),
                generateRandomFixed16(rnd),
                generateRandomUnion(rnd),
                generateRandomAddress(rnd),
                generateRandomBytes(rnd),
                LocalDate.parse("2014-03-01"),
                LocalTime.parse("12:12:12"),
                LocalTime.ofSecondOfDay(0).plus(123456L, ChronoUnit.MICROS),
                Instant.parse("2014-03-01T12:12:12.321Z"),
                Instant.ofEpochSecond(0).plus(123456L, ChronoUnit.MICROS),
                ByteBuffer.wrap(BigDecimal.valueOf(2000, 2).unscaledValue().toByteArray()),
                new Fixed2(BigDecimal.valueOf(2000, 2).unscaledValue().toByteArray()));
    }

    public static SimpleUser generateRandomSimpleUser(Random rnd) {
        return new SimpleUser(
                generateRandomString(rnd, 50),
                rnd.nextBoolean() ? null : rnd.nextInt(),
                rnd.nextBoolean() ? null : generateRandomString(rnd, 6),
                rnd.nextBoolean() ? null : rnd.nextLong(),
                rnd.nextDouble(),
                null,
                rnd.nextBoolean(),
                generateRandomStringList(rnd, 20, 30),
                generateRandomBooleanList(rnd, 20),
                rnd.nextBoolean() ? null : generateRandomStringList(rnd, 20, 20),
                generateRandomColor(rnd),
                new HashMap<>(),
                generateRandomFixed16(rnd),
                generateRandomUnion(rnd),
                generateRandomAddress(rnd),
                generateRandomBytes(rnd));
    }

    public static Colors generateRandomColor(Random rnd) {
        return Colors.values()[rnd.nextInt(Colors.values().length)];
    }

    public static Fixed16 generateRandomFixed16(Random rnd) {
        if (rnd.nextBoolean()) {
            return new Fixed16();
        } else {
            byte[] bytes = new byte[16];
            rnd.nextBytes(bytes);
            return new Fixed16(bytes);
        }
    }

    public static Address generateRandomAddress(Random rnd) {
        return new Address(
                rnd.nextInt(),
                generateRandomString(rnd, 20),
                generateRandomString(rnd, 20),
                generateRandomString(rnd, 20),
                generateRandomString(rnd, 20));
    }

    public static ByteBuffer generateRandomBytes(Random rnd) {
        final byte[] bytes = new byte[10];
        rnd.nextBytes(bytes);
        return ByteBuffer.wrap(bytes);
    }

    private static List<Boolean> generateRandomBooleanList(Random rnd, int maxEntries) {
        final int num = rnd.nextInt(maxEntries + 1);
        ArrayList<Boolean> list = new ArrayList<>();
        for (int i = 0; i < num; i++) {
            list.add(rnd.nextBoolean());
        }
        return list;
    }

    private static List<CharSequence> generateRandomStringList(
            Random rnd, int maxEntries, int maxLen) {
        final int num = rnd.nextInt(maxEntries + 1);
        ArrayList<CharSequence> list = new ArrayList<>();
        for (int i = 0; i < num; i++) {
            list.add(generateRandomString(rnd, maxLen));
        }
        return list;
    }

    private static String generateRandomString(Random rnd, int maxLen) {
        char[] chars = new char[rnd.nextInt(maxLen + 1)];
        for (int i = 0; i < chars.length; i++) {
            chars[i] = (char) rnd.nextInt(Character.MIN_SURROGATE);
        }
        return new String(chars);
    }

    private static Object generateRandomUnion(Random rnd) {
        if (rnd.nextBoolean()) {
            if (rnd.nextBoolean()) {
                return null;
            } else {
                return rnd.nextBoolean();
            }
        } else {
            if (rnd.nextBoolean()) {
                return rnd.nextLong();
            } else {
                return rnd.nextDouble();
            }
        }
    }
}


text:
/* tslint:disable:only-arrow-functions */
import { Document, Package } from 'dgeni';
import { readTypeScriptModules } from './processors/readTypeScriptModules';
import { convertPrivateClassesToInterfaces } from './services/convertPrivateClassesToInterfaces';
import { modules } from './services/modules';
import { TsParser } from './services/TsParser';

const path = require('canonical-path');

// Define the dgeni package for generating the docs
module.exports = new Package('typescript', [require('../jsdoc')])

// Register the services and file readers
.factory(modules)
.factory('tsParser', function(log) { return new TsParser(log); })

.factory('convertPrivateClassesToInterfaces', function() { return convertPrivateClassesToInterfaces; })

.factory('EXPORT_DOC_TYPES', function() {
  return [
    'class',
    'interface',
    'function',
    'var',
    'const',
    'let',
    'enum',
    'type-alias',
    'value-module',
  ];
})

// use `ignoreTypeScriptNamespaces.push()` to inject your own regexes here.
// these namespaces will not be stripped if used for type parameters.
.factory('ignoreTypeScriptNamespaces', function() { return []; })

// Register the processors
.processor(readTypeScriptModules)

// Configure ids and paths
.config(function(computeIdsProcessor: any, computePathsProcessor: any, EXPORT_DOC_TYPES: string[]) {

  computeIdsProcessor.idTemplates.push({
    docTypes: ['member'],
    idTemplate: '${classDoc.id}.${name}',
    getAliases(doc: Document) {
      return doc.classDoc.aliases.map((alias: string) => alias + '.' + doc.name);
    },
  });

  computePathsProcessor.pathTemplates.push({
    docTypes: ['member'],
    pathTemplate: '${classDoc.path}#${name}',
    getOutputPath() {
      // These docs are not written to their own file, instead they are part of their class doc
    },
  });

  const MODULES_DOCS_PATH = 'partials/modules';

  computePathsProcessor.pathTemplates.push({
    docTypes: ['module'],
    outputPathTemplate: MODULES_DOCS_PATH + '/${id}/index.html',
    pathTemplate: '/${id}',
  });

  computePathsProcessor.pathTemplates.push({
    docTypes: EXPORT_DOC_TYPES,
    outputPathTemplate: MODULES_DOCS_PATH + '/${path}/index.html',
    pathTemplate: '${moduleDoc.path}/${name}',
  });
});


text:
A darksky API consumer UI.
Enable cross origin resource sharing in your browser to be able to access darksky from localhost.

# Installation

Use 'gulp connect' to start the application then go to http://localhost:8000

Use 'gulp default' to start the development environment go to http://localhost:8000

For the build use 'gulp build' then go to http://localhost:9000

# Documentation

gulp ngdocs

gulp connect

go to http://localhost:8000/docs

# Tests

Are run automatically when invoking 'gulp default' (for TDD) or run only once when invoking 'gulp build'

# License

MIT


text: <!DOCTYPE HTML>


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2006-2011 Regents of the University of Minnesota.
   For licensing terms, see the file LICENSE.-->
<LinearLayout
   xmlns:android="http://schemas.android.com/apk/res/android"
   android:orientation="vertical"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent">
   <RelativeLayout
      android:orientation="horizontal"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content">
      <TextView
         android:id="@+id/route_item_length"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:textColor="#00FFFF"
         android:textSize="18sp"
         android:paddingRight="10dip"
         android:layout_alignParentRight="true" />
      <TextView
         android:id="@+id/route_item_name"
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:paddingRight="10dip"
         android:textSize="18sp"
         android:layout_toLeftOf="@id/route_item_length" />
   </RelativeLayout>
   <TextView
      android:id="@+id/route_start_end"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:paddingLeft="10dp"
      android:textColor="#696969"
      android:textSize="14sp" />
</LinearLayout>


text:
E.g. make a horisontal nav with some < li > elements and draw a submenu <ul> within on of these < li >'s. Give the < li > containing the sub < ul > the variable name of: subNavTrigger

Then edit the sub < ul > that should reveal it self when hovering your trigger and fill it with the elements you need and set variable name to subNav. if you want it to reveal it self on top of everything else, set it to position Absolute.

Now add this script by pressing F8

// SUB NAV HOVER REVEAL

// Hide the subNav container initially
$subNav.css({
  'display' : 'none'
});

//Show subNav when subNavTrigger is hovered
$subNavTrigger.hover(function() {
	$subNav.slideDown();
}, function() {
	$subNav.slideUp('fast');
});

Example:

http://screencast.com/t/u0yAgHQGNmC

Structure in Macaw:

http://imgur.com/hRxm48m

Obviously many variations can be made from this simple script. Have fun :)

-----------------------

onclick:
@agentfarrell

There are different ways to do this. Using :visible could be one way:

$subNavTrigger.click( function() {
  // If nav is not visible, show it
  if (!$subNav.is(':visible')) {
    $subNav.slideDown();
  }
  // If nav is visible, hide it
  else {
    $subNav.slideUp('fast');
  }
});


text:
import { NgModule }      from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';

import { AutoGridEnable }  from './app.auto-grid-enable';
import { AutoGrid }  from './app.auto-grid';
import { GridPipe }  from './pipes/auto-grid.pipe';

@NgModule({
  imports: [ BrowserModule, FormsModule],
  declarations: [ AutoGrid, AutoGridEnable, GridPipe ],
  providers: [ ],
  bootstrap: [ ],
  exports: [ AutoGrid, AutoGridEnable, GridPipe ]
})
export class AutoGridModule { }


text:
require File.dirname(__FILE__) + '/spec_helper'
require RAILS_ROOT + '/vendor/rails/activeresource/lib/active_resource/http_mock'
require "http_mock_mod"

class TestResource < HyperactiveResource
  self.site = 'http://localhost:3000' #This should never get called
end

class AnotherResource < HyperactiveResource
  self.site = 'http://localhost:3000' #This should never get called
end

class Race < HyperactiveResource
  self.site = 'http://localhost:3000' #This should never get called
end

describe "An active resource that extends abstract resource" do
  before(:each) do
    @it = TestResource.new
  end

  def reset_class_vars
    @it.instance_eval do
      self.skip_to_xml_for = []
      self.has_manys = []
      self.columns = []
      self.belong_tos = []
      self.nested_resources = []
    end
  end

  def mock_xml(type = 'blah')
    {:id => 1, :name => type.to_s}.to_xml(:root => type.to_s)
  end

  def mock_post(url = '/test_resources.xml')
    ActiveResource::HttpMock.respond_to do |mock|
      mock.post url, {}, mock_xml, 200
    end
  end

  def mock_put(url = '/test_resources/1.xml')
    ActiveResource::HttpMock.respond_to do |mock|
      mock.put url, {}, mock_xml, 200
    end
  end

  it "should be able to find_by_something" do
    TestResource.should_receive(:find).with(:first, :params => { 'something' => 'SOMETHING' }).and_return("SOMETHING")
    TestResource.find_by_something('SOMETHING').should == "SOMETHING"
  end

  it "should be able to find_all_by_something" do
    TestResource.should_receive(:find).with(:all, :params => { 'something' => 'SOMETHING' }).and_return(["SOMETHING","ELSE"])
    TestResource.find_all_by_something('SOMETHING').should == ["SOMETHING","ELSE"]
  end

  it "should not have a nil site variable" do
    TestResource.site.should_not be_nil
  end

  it "should behave like active_record and have attributes= do an update rather than a replacement" do
    @it = TestResource.new( :a => 1 )
    @it.attributes = { 'b' => 2 } #Aah. it seems that you can't use a symbol when you do this
    @it.a.should == 1
    @it.b.should == 2
  end

  it "should have a save! method that behaves like active_record and raises as exception if validation fails remotely" do
    ActiveResource::HttpMock.respond_to do |mock|
      mock.post '/test_resources.xml', {}, "<errors><error>Field has invalid characters</error></errors>", 422
    end

    lambda { @it.save! }.should raise_error( RecordNotSaved )
  end

  it "should have a save! method that behaves like active_record and raises as exception if validation fails locally" do
    @it.instance_eval do
      def validate
        errors.add("field", "has invalid characters")
      end
    end

    lambda { @it.save! }.should raise_error( RecordNotSaved )
  end

  it "should do local validation before doing an http request" do
    reset_class_vars
    mock_post

    @it.should_receive(:validate).and_return(true)
    @it.save
  end

  it "'s to_xml should skip attributes that are in the skip list" do
    @it.instance_eval do
      self.skip_to_xml_for = [ :enrollments ]
      self.belong_tos = [] #Make sure gender isn't treated as a belong_tos for this spec
    end
    enrollment = mock(:enrollment)
    @it.enrollments = [ enrollment ]
    @it.gender = mock(:gender)

    enrollment.should_not_receive(:to_xml)
    @it.gender.should_receive(:to_xml).and_return( mock_xml(:gender) )

    @it.to_xml
  end

  it "'s to_xml should move id's from associated belong_to objects into blah_id" do
    @it.instance_eval do
      self.belong_tos = [ :gender ]
    end

    gender_id = '25'
    @it.gender = mock(:gender, :id => gender_id)

    @it.gender.should_not_receive(:to_xml)

    REXML::Document.new( @it.to_xml ).elements["//test-resource/gender-id"].text.should eql( gender_id )
  end

  #This is not ideal.. but that's the current spec due to errors serializing arrays of integers
  it "'s to_xml should ignore plural id fields (blah_ids) and assume that :blahs => [ :blah => { :id => will be populated" do
    @it.instance_eval do
      self.has_manys = [ :races ]
    end

    #race_1 = mock(:race, :id => 1)
    #race_2 = mock(:race, :id => 2)

    #@it.races = [race_1, race_2]
    #@it.race_ids = [race_1.id, race_2.id]
    @it.race_ids = [1, 2]

    @it.race_ids.should_not_receive(:to_xml)

    @it.to_xml
  end

  it "'s save should call before_save and after_save when save is called" do
    mock_post
    @it.should_receive(:before_save)
    @it.should_receive(:after_save)
    @it.save
  end

  it "'s save should call before_validate when validate is called" do
    mock_post
    @it.should_receive(:before_validate)
    @it.send(:validate)
  end

  it "'s valid? should clear errors and call validate" do
    @it.errors.should_receive(:clear)
    @it.should_receive(:validate)
    #@it.parent.should_receive(:valid?).and_return(:true) #It should call super
    @it.valid?.should be_true
  end

  it "'s save should save nested resources" do
    mock_post

    @it.instance_eval do
      self.skip_to_xml_for = [] #Make sure enrollments isn't skipped
      self.has_manys = [ :enrollments ]
      self.nested_resources = [ :enrollment ]
    end

    @it.enrollments = [ mock(:enrollment), mock(:enrollment) ]

    @it.enrollments.each do |enrollment|
      enrollment.should_receive(:to_xml).and_return( mock_xml(:enrollment) )
      enrollment.should_receive(:test_resource_id=).with(1) #An id of 1 will be assigned by the mock_post
      enrollment.should_receive(:save).and_return( true )
    end

    @it.save
  end

  it "'s update should update/save nested resources" do
    mock_put

    @it.instance_eval do
      self.skip_to_xml_for = [] #Make sure enrollments isn't skipped
      self.has_manys = [ :enrollments ]
      self.nested_resources = [ :enrollment ]
    end

    @it.id = 1
    @it.enrollments = [ mock(:enrollment, :id => 1), mock(:enrollment, :id => 2) ]

    @it.enrollments.each do |enrollment|
      enrollment.should_receive(:to_xml).and_return( mock_xml(:enrollment) )
      enrollment.should_receive(:test_resource_id=).with(1) #An id of 1 will be assigned by the mock_post
      enrollment.should_receive(:save).and_return( true )
    end

    @it.save
  end

  #TODO this doesn't work. It's not used either so it's commented out in both abstract_resource and it's spec
#  it "should let you define associations via belong_to :blah instead of belong_tos = [:blah]" do
#    @it.instance_eval do
#      self.belongs_to :bt1
#      self.belongs_to :bt2
#      self.has_many :hm1
#      self.has_many :hm2
#      self.has_one :ho1
#      self.has_one :ho2
#    end
#
#    @it.belong_tos.should eql([:bt1, :bt2])
#    @it.has_manys.should eql([:hm1, :hm2])
#    @it.has_ones.should eql([:ho1, :ho2])
#  end

  it "should store unique class inherited variables for nested_resource, belong_tos, etc for each class" do
    class_attributes = [:skip_to_xml_for, :has_manys, :belong_tos, :has_ones, :columns]
    test_values = [:something, :something_else]
    @it.instance_eval do
      class_attributes.each do |attribute|
        self.send("#{attribute}=", test_values)
      end
    end

    class_attributes.each do |attribute|
      @it.send(attribute).should eql( test_values )
    end

    @another = AnotherResource.new

    class_attributes.each do |attribute|
      @another.send(attribute).should be_empty
    end
  end

  it "should load an array of id values into a single comma delimeted string" do
    @it.instance_eval do
      self.has_manys = [ :races ]
    end

    @it = TestResource.new(:race_ids => [1,2,3,4])
    @it.race_ids.should eql("1,2,3,4")
  end

  it "should convert ids in a belongs_to into integers" do
    @it.instance_eval do
      self.belong_tos = [ :gender ]
    end

    @it = TestResource.new(:gender_id => "1")

    #TODO Should this work? It doesn't currently..
    #@it.gender_id = "1"
    @it.gender_id.should == 1
  end

  it "should not dup loaded attributes" do
    gender = mock(:gender)
    @it = TestResource.new(:gender => gender)
    @it.gender.should === gender
  end

  it "should let you set an attribute using a setter method if defined as a column" do
    @it.instance_eval do
      self.columns = [ :something ]
    end

    test_value = 'blah'
    @it.something = test_value
    @it.attributes['something'].should === test_value #It's not an indifferent hash so only strings work!! Stupid active_resource.
  end

  it "should return nil if a column getter is called rather than method_missing as in ActiveResource" do
    @it.instance_eval do
      self.columns = [ :something ]
    end

    @it.something.should be_nil
  end

  it "should return nil if a belong_to column's id getter is called rather than method_missing as in ActiveResource" do
    @it.instance_eval do
      self.columns = [] #You shouldn't need the column specified, it should infer from the belong_tos
      self.belong_tos = [ :something ]
    end

    @it.something_id.should be_nil
  end

  it "should return [] if a has_many's ids getter is called rather than method_missing as in ActiveResource" do
    @it.instance_eval do
      self.columns = [] #You shouldn't need the column specified, it should infer from the belong_tos
      self.has_manys = [ :somethings ]
    end

    @it.something_ids.should == []
  end

  it "'s has_many accessors should return [] when ids is set to an empty string or nil" do
    @it.instance_eval do
      self.columns = []
      self.has_manys = [ :somethings ]
    end

    @it.something_ids = ''
    @it.somethings.should == []

    @it.something_ids = nil
    @it.somethings.should == []
  end

  it "should find a belongs_to if given only an id" do
    @it.instance_eval do
      self.belong_tos = [ :gender ]
    end

    @it.gender_id = 1

    Object.const_set('Gender', Class.new)
    gender = mock(:gender)
    Gender.should_receive(:find).with(@it.gender_id).and_return(gender)

    @it.gender.should === gender
  end

  it "should not find a belongs_to if the id is empty" do
    @it.instance_eval do
      self.belong_tos = [ :gender ]
    end

    @it.gender_id = nil
    @it.gender.should be_nil

    @it.gender_id = ""
    @it.gender.should be_nil
  end

  it "should return the id for belongs_to if given only the object" do
    @it.instance_eval do
      self.belong_tos = [ :gender ]
    end

    gender = mock(:gender, :id => 3)

    @it.gender = gender
    @it.gender_id.should eql( gender.id )
  end

  it "should return ids for a has_many if given only the objects" do
    @it.instance_eval do
      self.has_manys = [ :races ]
    end

    race = mock(:race, :id => 1)

    @it.races = [race,race,race]
    @it.race_ids.should eql([race.id,race.id,race.id])
  end

  it "should return the objects for a has_many if given only the ids" do
    @it.instance_eval do
      self.has_manys = [ :races ]
    end

    race_ids = [1,2,3]
    @it.race_ids = race_ids

    race = mock(:race)

    race_ids.each { |race_id| Race.should_receive(:find).with(race_id).and_return(race) }

    @it.races.should eql([race,race,race])
  end

  it "should find the object for a has_one given only the id" do
    @it.instance_eval do
      self.has_ones = [ :dog ]
    end

    @it.id = 1

    Object.const_set('Dog', Class.new)
    dog = mock(:dog)
    Dog.should_receive(:find_by_test_resource_id).with(@it.id).and_return(dog)
    @it.dog.should === dog
  end

  it "should raise an exception if a bad class method is called" do
    #This is testing that our dynamic find_by_blah isn't wrecking anything
    lambda { TestResource.something_that_does_not_exist }.should raise_error
  end
end


text:
module Excavator

include("job.jl")
include("manager.jl")
include("node.jl")

end # module


text:
Serial
====

Serial is a Node.JS module to serially/sequentially run asynchronous functions.

It also includes a Parallel runner to simultaneously run asynchronous functions.

Usage
====

SerialRunner
------------
    var SerialRunner = require("serial").SerialRunner;
    var runner = new SerialRunner();

    runner.add(function1, param1).add(function2, param2);
    runner.add(function3, param3);

    runner.onError(function(err) {
        runner.stop(); // stop further queued function from being run
        console.log("There was an error");
    });

    runner.run(function() {
        console.log("done");
    });

    function function1(param, callback) {
        // do smthg

        if("something went wrong") {
            var err = new Error("something went wrong");
            callback(err);
        } else {
            callback();
        }
    }

Parallel Runner
---------------
    var ParallelRunner = require("serial").ParallelRunner;
    var runner = new ParallelRunner();

    runner.add(function1, param1).add(function2, param2);
    runner.add(function3, param3);

    runner.run(function() {
        console.log("done");
    });

    function function1(param, callback) {
        // do smthg
        callback();
    }

MIT License
===========
Copyright (c) 2012 Model N, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.