text:
Param ($ParentDiskPath,$vmPath,$OSVHDX,$Unattendpath,$Assetspath)

$VMName = "CONTOSODC"

$ProgressPreference = "SilentlyContinue"

#Local Credential
$localCred = new-object -typename System.Management.Automation.PSCredential -argumentlist "Administrator", (ConvertTo-SecureString "Password01" -AsPlainText -Force)

#Create Virtual Machine
$date = Get-date
$msgtxt =  "$date : Creating ContosoDC VM Differencing Disks."
Write-Host $msgtxt -ForegroundColor Cyan
$msgtxt | Out-File ($LogFilePath + "VMDeployment.log")  -Append -Force
New-VHD -Differencing -ParentPath ($ParentDiskPath + $OSVHDX) -Path ($vmpath + $VMName + '\' + $VMName + '.vhdx') | Out-Null
New-VM -Name $VMName -VHDPath ($vmpath + $VMName + '\' + $VMName + '.vhdx') -Path ($vmpath + $VMName) -Generation 2 | Out-Null
Set-VMMemory -VMName $VMName -DynamicMemoryEnabled $true -StartupBytes 2GB -MaximumBytes 2GB -MinimumBytes 500MB | Out-Null
Remove-VMNetworkAdapter -VMName $VMName -Name "Network Adapter" | Out-Null
Add-VMNetworkAdapter -VMName $VMName -Name "Contoso" -SwitchName "vSwitch-Fabric" -DeviceNaming On | Out-Null
Set-VMProcessor -VMName $VMName -Count 2 | Out-Null
set-vm -Name $VMName -AutomaticStopAction TurnOff | Out-Null

#Inject Answer File
#MountVHDXFile
$date = Get-date
$msgtxt =  "$date : Mounting and Injecting Answer File into the $VMName VM."
Write-Host $msgtxt -ForegroundColor Cyan
$msgtxt | Out-File ($LogFilePath + "VMDeployment.log")  -Append -Force
New-Item -Path "C:\TempMount" -ItemType Directory | Out-Null
Mount-WindowsImage -Path "C:\TempMount" -Index 1 -ImagePath ($vmpath + $VMName + '\' + $VMName + '.vhdx') | Out-Null
Write-Host "Applying Unattend file to Disk Image..." -ForegroundColor Cyan
#Remove-Item -Path "C:\TempVMMMount\Windows\Panther\Unattend.xml"
New-Item -Path C:\TempMount\windows -ItemType Directory -Name Panther -Force | Out-Null
Copy-Item -Path $Unattendpath -Destination "C:\TempMount\Windows\Panther\Unattend.xml" | Out-Null
#Copy Backinfo
Copy-Item -Path $Assetspath\BACKINFO -Destination C:\TempMount -Recurse

$date = Get-date
$msgtxt =  "$date : Saving OS Customizations."
Write-Host $msgtxt -ForegroundColor Cyan
$msgtxt | Out-File ($LogFilePath + "VMDeployment.log")  -Append -Force
Dismount-WindowsImage -Path "C:\TempMount" -Save | Out-Null
Remove-Item "C:\TempMount"  | Out-Null

#Start Virtual Machine
$date = Get-date
$msgtxt =  "$date : Starting VM $VMName."
Write-Host $msgtxt -ForegroundColor Cyan
$msgtxt | Out-File ($LogFilePath + "VMDeployment.log")  -Append -Force
Start-VM -Name $VMName | Out-Null

while ((icm -VMName $VMName -Credential $localcred {"Test"} -ea SilentlyContinue) -ne "Test") {Sleep -Seconds 1}

#Wait until the VM is restarted

$date = Get-date
$msgtxt =  "$date : Configuring CONTOSODC VM and Installing Active Directory."
Write-Host $msgtxt -ForegroundColor Cyan
$msgtxt | Out-File ($LogFilePath + "VMDeployment.log")  -Append -Force

Invoke-Command -VMName $VMName -Credential $localCred -ScriptBlock {

$NIC = Get-NetAdapterAdvancedProperty -RegistryKeyWord "HyperVNetworkAdapterName" | where {$_.RegistryValue -eq "Contoso"}
Rename-NetAdapter -name $NIC.name -newname "Contoso" | Out-Null
New-NetIPAddress -InterfaceAlias "Contoso" –IPAddress 192.168.1.254 -PrefixLength 24 -DefaultGateway 192.168.1.1 | Out-Null
Set-DnsClientServerAddress -InterfaceAlias "Contoso" -ServerAddresses 192.168.1.254 | Out-Null
Install-WindowsFeature -name AD-Domain-Services –IncludeManagementTools | Out-Null
$SecureString = ConvertTo-SecureString "Password01" -AsPlainText -Force
Write-Host "`n`n`n`n`n`n`nInstalling Active Directory..." -ForegroundColor Yellow
Install-ADDSForest -DomainName "contoso.com" -DomainMode WinThreshold -DatabasePath "c:\Domain" -InstallDns `
-DomainNetbiosName "contoso" -SafeModeAdministratorPassword $secureString `
-Confirm -Force -NoRebootOnCompletion | Out-Null

#Install BackInfo
New-Item -Path 'C:\Program Files (x86)\Backinfo' -ItemType Directory -Force | Out-Null
Copy-Item -Path 'C:\BackInfo\Shortcut to BackInfo.exe.lnk' -Destination 'C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp' -Force
Copy-Item -Path 'C:\BackInfo\BackInfo.exe' -Destination 'C:\Program Files (x86)\Backinfo' -Force
Copy-Item -Path 'C:\BackInfo\BackInfo.ini'  -Destination 'C:\Program Files (x86)\Backinfo' -Force
}

Get-VM $VMName | Stop-VM
Get-VM $VMName | Start-VM

#Wait until DC is created and rebooted

$password = "Password01" | ConvertTo-SecureString -asPlainText -Force
$username = "contoso\administrator"
$credential = New-Object System.Management.Automation.PSCredential($username,$password)

while ((icm -VMName $VMName -Credential $credential {(Get-ADDomainController contosodc).enabled} -ea SilentlyContinue) -ne $true) {Sleep -Seconds 1}

$date = Get-date
$msgtxt =  "$date : Configuring Accounts in Active Directory."
Write-Host $msgtxt -ForegroundColor Cyan
$msgtxt | Out-File ($LogFilePath + "VMDeployment.log")  -Append -Force

Invoke-Command -VMName $VMName -Credential $credential -ScriptBlock {

Set-ADDefaultDomainPasswordPolicy -ComplexityEnabled $false -Identity contoso.com  -MinPasswordLength 0
New-ADUser -Name "NC Admin" -GivenName NC -Surname Admin -SamAccountName NCAdmin -UserPrincipalName NCAdmin@contoso.com -AccountPassword $SecureString -Enabled $True -ChangePasswordAtLogo $False
New-ADUser -Name "NC Client" -GivenName NC -Surname Client -SamAccountName NCClient -UserPrincipalName NCClient@contoso.com -AccountPassword $SecureString -Enabled $True -ChangePasswordAtLogo $False

NEW-ADGroup –name "NCAdmins" –groupscope Global
NEW-ADGroup –name "NCClients" –groupscope Global

add-ADGroupMember "Domain Admins" "NCAdmin"
add-ADGroupMember "NCAdmins" "NCAdmin"
add-ADGroupMember "NCClients" "NCClient"
add-ADGroupMember "NCClients" "Administrator"
add-ADGroupMember "NCAdmins" "Administrator"
}


text:
module Api
  module V1
    class BikeMfgQueriesController < ApplicationController
      before_filter :clear_flash
      skip_authorization_check
      unloadable
      include BikeMfg::Controllers::BikeMfgQueriesControllerMethods
    end
  end # v1
end #api

redpajama_set_name: RedPajamaGithub


text:
#ifndef HST_EVENT_H
#define HST_EVENT_H

#include <memory>
#include <ostream>
#include <set>
#include <string>

namespace hst {

//------------------------------------------------------------------------------
// Events

class Event {
  public:
    class Set;

    explicit Event(const std::string& name) : index_(find_or_create_event(name))
    {
    }

    static Event none() { return Event(0); }
    const std::string& name() const;

    bool operator==(const Event& other) const { return index_ == other.index_; }
    bool operator!=(const Event& other) const { return index_ != other.index_; }
    bool operator<(const Event& other) const { return index_ < other.index_; }
    bool operator<=(const Event& other) const { return index_ <= other.index_; }
    bool operator>(const Event& other) const { return index_ > other.index_; }
    bool operator>=(const Event& other) const { return index_ >= other.index_; }

    static Event tau()
    {
        static Event tau("τ");
        return tau;
    }

    static Event tick()
    {
        static Event tick("✔");
        return tick;
    }

  private:
    using Index = unsigned int;
    class Table;

    explicit Event(Index index) : index_(index) {}

    static Index find_or_create_event(const std::string& name);

    static std::unique_ptr<Table> table_;
    Index index_;
};

std::ostream& operator<<(std::ostream& out, const Event& event);

class Event::Set : public std::set<Event> {
  private:
    using Parent = std::set<Event>;

  public:
    using Parent::set;
    std::size_t hash() const;
};

std::ostream& operator<<(std::ostream& out, const Event::Set& events);

}  // namespace hst

namespace std {

template <>
struct hash<hst::Event>
{
    std::size_t operator()(const hst::Event& event) const
    {
        return std::hash<string>()(event.name());
    }
};

template <>
struct hash<hst::Event::Set>
{
    std::size_t operator()(const hst::Event::Set& set) const
    {
        return set.hash();
    }
};

}  // namespace std

#endif  // HST_EVENT_H


text:
<?php
/**
 * DfTable is class for work with db table
 *
 * DfTable class provide CRUD functions
 *
 * @author Nikita Fedoseev <agent.daitel@gmail.com>
 * @package system.data
 * @since 0.2.1
 */
class DfTable extends DfComponent
{
    /**
     * Component Name
     * @var string
     */
    public $componentName = 'Table';
    /**
     * Table Name
     * @var string
     */
    public $table = '';
    /**
     * Db Connection
     * @var DfDbConnection
     */
    public $db;

    /**
     * Create table work class
     * @param DfDbConnection $db
     * @param string $name
     */
    public function __construct($db, $name)
    {
        $this->db = $db;
        $this->componentName .= ucwords($name);
        $this->table = $name;
    }

    /**
     * Insert Record in table
     * @param array $data
     * @return bool
     */
    public function insert($data)
    {
        $placeholders = DfSql::makePlaceholders($data);
        $sqlKeys = $placeholders['keys'];
        $sqlValues = $placeholders['values'];
        $sqlData = $placeholders['data'];

        $sql = "INSERT INTO {$this->table} ({$sqlKeys}) VALUES ({$sqlValues})";

        return $this->db->queryWithRowOneCheck($sql, $sqlData);
    }

    /**
     * Delete Record
     * @param array $where
     * @param string $type
     * @param string $afterWhere
     * @return bool
     */
    public function delete($where = [], $type = 'AND', $afterWhere = '')
    {
        $sqlData = [];

        $sql = "DELETE FROM {$this->table}";

        if (!empty($where)) {
            $whereData = implode(" $type ", DfSql::makePlaceholders($where, false)['array']);
            $sqlData = DfSql::makePlaceholders($where, false)['data'];

            $sql .= " WHERE {$whereData}";
        }

        $sql .= (!empty($where) ? ' ' : ' WHERE ') . $afterWhere;

        return $this->db->queryWithRowOneCheck($sql, $sqlData);
    }

    /**
     * Select records
     * @param array|string $_key
     * @param array $where
     * @param string $type
     * @param string $beforeFrom
     * @param string $beforeWhere
     * @param string $afterWhere
     * @return array|mixed
     */
    public function selectRecords(
        $_key,
        $where = [],
        $type = 'AND',
        $beforeFrom = '',
        $beforeWhere = '',
        $afterWhere = ''
    ) {
        return $this->select(true, $_key, $where, $type, $beforeFrom, $beforeWhere, $afterWhere);
    }

    /**
     * Select request
     * @param bool $many
     * @param array|string $_key
     * @param array $where
     * @param string $type
     * @param string $beforeFrom
     * @param string $beforeWhere
     * @param string $afterWhere
     * @return array|mixed
     */
    private function select(
        $many,
        $_key,
        $where = [],
        $type = 'AND',
        $beforeFrom = '',
        $beforeWhere = '',
        $afterWhere = ''
    ) {
        $sqlData = [];

        $key = DfSql::prepareKeys($_key);

        $sql = "SELECT {$key} {$beforeFrom} FROM {$this->table} {$beforeWhere}";

        if (!empty($where)) {
            $whereData = implode(" $type ", DfSql::makePlaceholders($where, false)['array']);
            $sqlData = DfSql::makePlaceholders($where, false)['data'];

            $sql .= " WHERE {$whereData}";
        }

        $sql .= (!empty($where) ? ' ' : ' WHERE ') . $afterWhere;

        return ($many === true ?
            $this->db->getRecordsByQuery($sql, $sqlData) :
            $this->db->getRecordByQuery($sql, $sqlData)
        );
    }

    /**
     * Select Record by keys and where
     * @param array|string $_key
     * @param array $where
     * @param string $type
     * @param string $beforeFrom
     * @param string $beforeWhere
     * @param string $afterWhere
     * @return array|mixed
     */
    public function selectRecord(
        $_key,
        $where = [],
        $type = 'AND',
        $beforeFrom = '',
        $beforeWhere = '',
        $afterWhere = ''
    ) {
        return (is_array($_key) || $_key == '*' ?
            $this->select(false, $_key, $where, $type, $beforeFrom, $beforeWhere, $afterWhere) :
            $this->select(false, $_key, $where, $type, $beforeFrom, $beforeWhere, $afterWhere)[$_key]
        );
    }

    /**
     * Update Request
     * @param array $set
     * @param array $where
     * @return bool
     */
    public function update($set, $where = [])
    {
        $setData = implode(', ', DfSql::makePlaceholders($set, false)['array']);

        $sql = "UPDATE {$this->table} SET {$setData}";
        $sqlData = DfSql::makePlaceholders($set, false)['data'];

        if (!empty($where)) {
            $whereData = implode(', ', DfSql::makePlaceholders($where, false)['array']);
            $sqlData = array_merge($sqlData, DfSql::makePlaceholders($where, false)['data']);

            $sql .= " WHERE {$whereData}";
        }

        return $this->db->queryWithRowOneCheck($sql, $sqlData);
    }
}


text:
%%%%%%%%%%%%%%%%%%%%%%%%
%                      %
% Write SPM mat file   %
%                      %
%%%%%%%%%%%%%%%%%%%%%%%%
function M = GE_createSPMmat(im_hdr, scandir)
%
% Put the appropriate translations and rotations to the M matrix
% given the information in the image header and the direction of
% acquisition
%
% S. Inati
% Dartmouth College
% Apr. 2001
%

% The conversion from pixels to mm
Dims = diag( [im_hdr.pixsize_X, ...
	      im_hdr.pixsize_Y, ...
	      im_hdr.slthick + im_hdr.scanspacing ]);

% Compute the coordinate system in the image plane
tlhc = [ im_hdr.tlhc_R; im_hdr.tlhc_A; im_hdr.tlhc_S ]; % Top Left Hand Corner of Image
trhc = [ im_hdr.trhc_R; im_hdr.trhc_A; im_hdr.trhc_S ]; % Top Right Hand Corner of Image
brhc = [ im_hdr.brhc_R; im_hdr.brhc_A; im_hdr.brhc_S ]; % Bottom Right Hand Corner of Image

x = trhc - tlhc; x = x./sqrt(x'*x);   % xhat
y = trhc - brhc; y = y./sqrt(y'*y);   % yhat

% The normal to the plane
norm = [ im_hdr.norm_R; im_hdr.norm_A; im_hdr.norm_S ];
% The directional normal
z = scandir * norm;   % zhat

% Build the M matrix for SPM
% M takes a voxel from the image and gives it a coordinate in mm
% On the scanner the voxels start in the top left hand corner of the
% first image.  In SPM they start in the bottom left hand corner,
% so flip y and set the origin to tlhc.
% NB: The voxel (1,1,1) should have position tlhc
Rot = [x, -y, z];
M = eye(4);
M(1:3,1:3) = Rot  * Dims;
M(1:3,4) = tlhc - Rot*Dims*[1;1;1];

return


text:
package org.codehaus.httpcache4j.cache;

import org.codehaus.httpcache4j.util.CacheStatisticsMXBean;

import java.util.concurrent.atomic.AtomicLong;

/**
 * @author Erlend Hamnaberg
 * @version $Revision: $
 */
public class CacheStatistics implements CacheStatisticsMXBean {
    private final AtomicLong hits = new AtomicLong();
    private final AtomicLong misses = new AtomicLong();

    public long getHits() {
        return hits.get();
    }

    public void hit() {
        hits.getAndIncrement();
    }

    public void miss() {
        misses.getAndIncrement();
    }

    public long getMisses() {
        return misses.get();
    }

    public double getHitRatio() {
        return getMisses() / (double)(getMisses() + getHits());
    }

    public void clear() {
        hits.set(0L);
        misses.set(0L);
    }
}


text:
namespace SDammann.WebApi.Versioning.ErrorHandling {
    using System;
    using System.Net;
    using System.Net.Http;
    using System.Web.Http.ExceptionHandling;
    using Request;

    /// <summary>
    /// Represents a class that can handle exceptions thrown by the versioning system
    /// </summary>
    public class DefaultVersioningExceptionHandler : IVersioningExceptionHandler {
        /// <summary>
        /// Handles the specified exception by rethrowing it
        /// </summary>
        /// <param name="ex"></param>
        /// <param name="context"></param>
        public virtual HttpResponseMessage HandleException(ExceptionContext context, BaseApiException ex) {
            HttpResponseMessage result = null;

            result = result ?? HandleExceptionInternal(context, ex as ApiControllerNotFoundException);
            result = result ?? HandleExceptionInternal(context, ex as AmbigiousApiRequestException);
            result = result ?? HandleExceptionInternal(context, ex as ApiVersionFormatException);
            result = result ?? HandleExceptionInternal(context, ex as ApiVersionNotDeterminedException);

            return result;
        }

        private static HttpResponseMessage HandleExceptionInternal(ExceptionContext context, ApiVersionNotDeterminedException exception) {
            if (exception == null) {
                return null;
            }

            return context.Request.CreateResponse(HttpStatusCode.BadRequest, exception.Message);
        }

        private static HttpResponseMessage HandleExceptionInternal(ExceptionContext context, ApiVersionFormatException exception) {
            if (exception == null) {
                return null;
            }

            return context.Request.CreateErrorResponse(HttpStatusCode.BadRequest, ExceptionResources.CannotDetermineRequestVersion, exception);
        }

        private static HttpResponseMessage HandleExceptionInternal(ExceptionContext context, AmbigiousApiRequestException exception) {
            if (exception == null) {
                return null;
            }

            // multiple matching types
            return context.Request.CreateResponse(HttpStatusCode.InternalServerError, exception.Message);
        }

        private static HttpResponseMessage HandleExceptionInternal(ExceptionContext context, ApiControllerNotFoundException exception) {
            if (exception == null) {
                return null;
            }

            return context.Request.CreateResponse(HttpStatusCode.NotFound, String.Format(ExceptionResources.ApiDoesntExist, exception.ControllerIdentification));
        }
    }
}


text:
package org.openehealth.ipf.commons.ihe.xds.core.requests.query;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

/**
 * Base class for stored queries.
 * @author Jens Riemschneider
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "StoredQuery", propOrder = { "homeCommunityId" })
@EqualsAndHashCode(callSuper = true, doNotUseGetters = true)
public abstract class StoredQuery extends Query {
    private static final long serialVersionUID = -8296981156625412818L;

    @Getter @Setter private String homeCommunityId;

    /**
     * For JAXB serialization only.
     */
    public StoredQuery() {
    }

    /**
     * Constructs the query.
     * @param type
     *          the type of the query.
     */
    protected StoredQuery(QueryType type) {
        super(type);
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
    }
}


text:
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Clipping the Terrain</title>

Clipping the Terrain

      The terrain entity uses its triangle surfaces as clipping planes. No
additional clipping is required to allow characters to run on the terrain's
surface. As the initial terrain maps developed in house, we discovered that to
control and guide play flow, we needed to clip many of our mountain and canyon
slopes with vertical walls. Done right (as the slopes start becoming too steep
to climb), players don't notice (as much).

      Next, decide how far up in the sky you are willing to let your player's
fly. If the map is entirely open you might want to keep it that way. If you've
placed caulk barriers as described above, then the low point on the ridgeline
(or lower) will likely be your ceiling height.

Clipping Tips

· Make sure your "ceiling" clip
brushes extend all the way up the sky brush.

· Keep your clip brushes simple.

· Right angles are rarely found in
nature. Use the clipper tool to take the corners off your vertical clips.

Back - Table
of Contents - Mapping the Textures

-19-


text:
from flask import Flask, request, abort
import json
import os
import serial

s = None
#f = os.popen('ifconfig br-lan | grep "inet\ addr" | cut -d: -f2 | cut -d" " -f1') # AP model
f = os.popen('ifconfig apcli0 | grep "inet\ addr" | cut -d: -f2 | cut -d" " -f1') # Station model
inet_addr = f.read()
app = Flask(__name__)
enum_values = ['0', '1']

def setup():
    global s
    # open serial COM port to /dev/ttyS0, which maps to UART0(D0/D1)
    # the baudrate is set to 57600 and should be the same as the one
    # specified in the Arduino sketch uploaded to ATMega32U4.
    s = serial.Serial("/dev/ttyS0", 57600)

@app.route("/api/switchServo")
def servo():
    status = request.args.get("status")
    if not status:
        abort(404)
    status = status.encode("ascii")
    if status not in enum_values:
        abort(404)

    if (status == '1'):
        s.write("servo1")
    elif (status == '0'):
        s.write("servo0")
    return json.dumps({"status": 200, "message": s.readline().strip()})

@app.route("/api/switchRelay")
def relay():
    status = request.args.get("status")
    if not status:
        abort(404)
    status = status.encode("ascii")
    if status not in enum_values:
        abort(404)

    if (status == '1'):
        s.write("relay1")
    elif (status == '0'):
        s.write("relay0")
    return json.dumps({"status": 200, "message": s.readline().strip()})

@app.route("/api/getSensor")
def sensor():
    status = request.args.get("status")
    if not status:
        abort(404)
    status = status.encode("ascii")
    if status not in enum_values:
        abort(404)

    s.write("sensor")
    return json.dumps({"status": 200, "message": s.readline().strip()})

@app.route('/')
def main():
    return json.dumps({"status":200, "message": "OK"})

if __name__ == '__main__':
    setup()
    app.debug = True
    app.run(host = inet_addr, port=5000)


text:
define(["jquery","underscore","backbone","models","apputil","mapviews"],function($,_,Backbone,models,apputil,mapviews){

    window.app || (window.app = {});
    var app = window.app;
    if (! app.eventBus){
        app.eventBus = apputil.EventBus;
    }

    var ApplicationView = Backbone.View.extend({
        el :"#App",
        events:{
            "click #SaveGJBtn":"saveBtnClicked",
        },
        initialize:function(){

            this.pointGJModel = new models.PointGJModel();
            this.routeGJModel = new models.RouteGJModel();
            this.areaGJModel = new models.AreaGJModel();

            this.placeListView = new PlaceListView({collection:this.pointGJModel.get("features")});

            this.mapView = new mapviews.MapContainerView({
                pointCollection:this.pointGJModel.get("features"),
                routeCollection:this.routeGJModel.get("features"),
                areaCollection:this.areaGJModel.get("features")
                });
            $(window).on("resize",function(){
                app.eventBus.trigger(app.eventBus.WINDOW_RESIZED,{width:$(window).width(),height:$(window).height()});
            });

            this.pointGJModel.fetch({error:this.gJFailed});
            this.routeGJModel.fetch({error:this.gJFailed});
            this.areaGJModel.fetch({error:this.gJFailed});

            this.pointGJModel.on("saved",function(){this.oneSaved("point")},this);
            this.routeGJModel.on("saved",function(){this.oneSaved("route")},this);
            this.areaGJModel.on("saved",function(){this.oneSaved("area")},this);

        },
        gJFailed:function(model,response,options){
            console.log("gjFailed " + JSON.stringify(response));
        },
        saveBtnClicked:function(){
            this.saving = true;
            this.pointSaved = false;
            this.routeSaved = false;
            this.areaSaved = false;

            this.pointGJModel.saveAsGeoJSON();
            this.routeGJModel.saveAsGeoJSON();
            this.areaGJModel.saveAsGeoJSON();
        },
        oneSaved:function(type){
            if (type == "point"){
                this.pointSaved = true;
            }else if(type == "route"){
                this.routeSaved = true;
            }else if(type == "area"){
                this.areaSaved = true;
            }
            if (this.pointSaved && this.routeSaved && this.areaSaved){
                this.saving = false;
                alert("SAVED!");
            }
        }
    });

    var PlaceListView = Backbone.View.extend({
        el:"#PlaceList",
        initialize:function(){
            this.listenTo(this.collection,"reset",this.renderList,this);
            this.listenTo(this.collection,"add",this.addNewRow,this);
            this.listenTo(this.collection,"remove",this.renderList,this);

            this.updateToWindowSize();
            this.listenTo(app.eventBus,app.eventBus.WINDOW_RESIZED,this.updateToWindowSize,this);

        },
        renderList:function(){
            this.$("tbody").empty();
            this.collection.each(function(m){
                this.addNewRow(m);
            },this);

        },
        addNewRow:function(m){
            var rowView = new PlaceListRowView({model:m});
            this.$("tbody").append(rowView.render().el);
        },
        updateToWindowSize:function(size){
            if (!size){
                size = {width:$(window).width(),height:$(window).height()};
            }
            this.$el.parent().css({"height":size.height - 150});

        },

    });

    var PlaceListRowView = Backbone.View.extend({
        tagName:"tr",
        events:{
            "change input":"edited",
        },
        initialize:function(){

        },
        template:_.template($("#PlaceListRow-template").html()),
        render:function(){
            this.$el.html(this.template(this.model.toJSON()));
            return this;
        },
        edited:function(e){
            var $target = $(e.target);
            this.model.set($target.data("field"),$target.val());
        }
    });

   return {
       "ApplicationView":ApplicationView
   };
});


text:
"""TPU Distribution Strategy.

This is experimental.  It's not ready for general use.
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from tensorflow.contrib.distribute.python import cross_tower_ops as cross_tower_ops_lib
from tensorflow.contrib.distribute.python import one_device_strategy
from tensorflow.contrib.distribute.python import values
from tensorflow.contrib.tpu.python.ops import tpu_ops
from tensorflow.contrib.tpu.python.tpu import tpu
from tensorflow.contrib.tpu.python.tpu import tpu_system_metadata as tpu_system_metadata_lib
from tensorflow.contrib.tpu.python.tpu import training_loop
from tensorflow.python.eager import context
from tensorflow.python.eager import tape
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import variable_scope as vs
from tensorflow.python.ops import variables as variables_lib
from tensorflow.python.training import device_util
from tensorflow.python.training import distribute as distribute_lib
from tensorflow.python.util import nest

_TPU_INITIALIZE_SYSTEM_COLLECTION = "TPU_STRATEGY_INITIALIZE"

def get_tpu_system_metadata(tpu_cluster_resolver):
  """Retrieves TPU system metadata given a TPUClusterResolver."""
  master = tpu_cluster_resolver.master()

  # pylint: disable=protected-access
  cluster_spec = tpu_cluster_resolver.cluster_spec()
  cluster_def = cluster_spec.as_cluster_def() if cluster_spec else None
  tpu_system_metadata = (
      tpu_system_metadata_lib._query_tpu_system_metadata(
          master,
          cluster_def=cluster_def,
          query_topology=False))

  return tpu_system_metadata

# TODO(jhseu): Deduplicate with MirroredStrategy?
def _create_tpu_mirrored_variable(devices, real_mirrored_creator, *args,
                                  **kwargs):  # pylint: disable=g-missing-docstring
  # Figure out what collections this variable should be added to.
  # We'll add the TPUMirroredVariable to those collections instead.
  collections = kwargs.pop("collections", None)
  if collections is None:
    collections = [ops.GraphKeys.GLOBAL_VARIABLES]
  kwargs["collections"] = []

  # TODO(jhseu): Should we have different behavior for different
  # synchronization settings?

  # Get aggregation value
  # TODO(jhseu): Support aggregation in a tower context.
  aggregation = kwargs.pop("aggregation", vs.VariableAggregation.NONE)
  if aggregation not in [
      vs.VariableAggregation.NONE,
      vs.VariableAggregation.SUM,
      vs.VariableAggregation.MEAN,
      vs.VariableAggregation.ONLY_FIRST_TOWER,
  ]:
    raise ValueError("Invalid variable aggregation mode: {} for variable: {}"
                     .format(aggregation, kwargs["name"]))

  # Ignore user-specified caching device, not needed for mirrored variables.
  kwargs.pop("caching_device", None)

  # TODO(josh11b,apassos): It would be better if variable initialization
  # was never recorded on the tape instead of having to do this manually
  # here.
  with tape.stop_recording():
    index = real_mirrored_creator(devices, *args, **kwargs)
    result = values.TPUMirroredVariable(index, index[devices[0]], aggregation)

  if not context.executing_eagerly():
    g = ops.get_default_graph()
    # If "trainable" is True, next_creator() will add the member variables
    # to the TRAINABLE_VARIABLES collection, so we manually remove
    # them and replace with the MirroredVariable. We can't set
    # "trainable" to False for next_creator() since that causes functions
    # like implicit_gradients to skip those variables.
    if kwargs.get("trainable", True):
      collections.append(ops.GraphKeys.TRAINABLE_VARIABLES)
      l = g.get_collection_ref(ops.GraphKeys.TRAINABLE_VARIABLES)
      for v in index.values():
        l.remove(v)
    g.add_to_collections(collections, result)
  return result

# TODO(jhseu): Stop inheriting from OneDeviceStrategy.
class TPUStrategy(one_device_strategy.OneDeviceStrategy):
  """Experimental TPU distribution strategy implementation."""

  def __init__(self, tpu_cluster_resolver, steps_per_run, num_cores=None):
    """Initializes the TPUStrategy object.

    Args:
      tpu_cluster_resolver: A tf.contrib.cluster_resolver.TPUClusterResolver,
          which provides information about the TPU cluster.
      steps_per_run: Number of steps to run on device before returning to the
          host. Note that this can have side-effects on performance, hooks,
          metrics, summaries etc.
          This parameter is only used when Distribution Strategy is used with
          estimator or keras.
      num_cores: Number of cores to use on the TPU. If None specified, then
          auto-detect the cores and topology of the TPU system.
    """
    # TODO(sourabhbajaj): OneDeviceStrategy should be initialized with the
    # master node fetched from the cluster resolver.
    super(TPUStrategy, self).__init__("/device:CPU:0")

    self._tpu_cluster_resolver = tpu_cluster_resolver
    self._tpu_metadata = get_tpu_system_metadata(self._tpu_cluster_resolver)
    # TODO(sourabhbajaj): Change this from num_cores to metadata_override
    self._num_cores_override = num_cores

    # TODO(jhseu): Switch to DeviceAssignment to support pods and model
    # parallelism.
    device_map = {d.name: i for i, d in enumerate(self._tpu_metadata.devices)
                  if "device:TPU:" in d.name}
    self._device_index = values.PerDevice(device_map)
    self._tpu_devices = sorted(device_map.keys())
    # Only create variables for the number of towers we're running.
    self._tpu_devices = self._tpu_devices[:self.num_towers]

    # TODO(sourabhbajaj): Remove this once performance of running one step
    # at a time is comparable to multiple steps.
    self.steps_per_run = steps_per_run

    self._require_static_shapes = True

  def _get_enqueue_op_per_host(self, host_id, iterator, input_shapes,
                               iterations):
    """Create an enqueue op for a single host identified using host_id.

    The while_loop op returned will run `iterations` times and in each run
    enqueue batches for each shard.

    Args:
      host_id: integer, id of the host to run the enqueue ops on.
      iterator: `tf.data` iterator to read the input data.
      input_shapes: shape of inputs to be enqueue on the queue. This is same as
        the value of `nest.flatten(iterator.output_shapes)`.
      iterations: integer, number of iterations to be run; determines the
        number of batches to be enqueued.

    Returns:
      while_loop_op running `iterations` times; in each run we enqueue a batch
      on the infeed queue from the host with id `host_id` for each device shard.
    """
    host = self.get_host_cpu_device(host_id)

    def _infeed_enqueue_ops_fn():
      """Enqueue ops for one iteration."""
      control_deps = []
      sharded_inputs = []
      enqueue_ops = []

      with ops.device(host):
        for _ in range(self.num_towers_per_host):
          # Use control dependencies to ensure a deterministic ordering.
          with ops.control_dependencies(control_deps):
            inputs = nest.flatten(iterator.get_next())
            control_deps.extend(inputs)
            sharded_inputs.append(inputs)

      for core_id, shard_input in enumerate(sharded_inputs):
        enqueue_ops.append(
            tpu_ops.infeed_enqueue_tuple(
                inputs=shard_input,
                shapes=input_shapes,
                device_ordinal=core_id))
      return enqueue_ops

    def enqueue_ops_loop_body(i):
      """Callable for the loop body of the while_loop instantiated below."""
      with ops.control_dependencies(_infeed_enqueue_ops_fn()):
        return i + 1

    with ops.device(host):
      enqueue_op_per_host = control_flow_ops.while_loop(
          lambda i: i < iterations,
          enqueue_ops_loop_body,
          [constant_op.constant(0)],
          parallel_iterations=1)

    return enqueue_op_per_host

  def distribute_dataset(self, dataset_fn):
    # TODO(priyag): Perhaps distribute across cores here.
    return self._call_dataset_fn(dataset_fn)

  # TODO(priyag): Deal with OutOfRange errors once b/111349762 is fixed.
  # TODO(sourabhbajaj): Remove the initial_loop_values parameter when we have
  # a mechanism to infer the outputs of `fn`. Pending b/110550782.
  def _run_steps_on_dataset(self, fn, iterator, iterations,
                            initial_loop_values=None):

    shapes = nest.flatten(iterator.output_shapes)
    if any([not s.is_fully_defined() for s in shapes]):
      raise ValueError(
          'TPU currently requires fully defined shapes. Either use '
          'set_shape() on the input tensors or use '
          'dataset.batch(..., drop_remainder=True).')
    types = nest.flatten(iterator.output_types)

    enqueue_ops = [
        self._get_enqueue_op_per_host(host_id, iterator, shapes, iterations)
        for host_id in range(self.num_hosts)]

    def dequeue_fn():
      dequeued = tpu_ops.infeed_dequeue_tuple(dtypes=types, shapes=shapes)
      return nest.pack_sequence_as(iterator.output_shapes, dequeued)

    # Wrap `fn` for repeat.
    if initial_loop_values is None:
      initial_loop_values = {}
    initial_loop_values = nest.flatten(initial_loop_values)
    ctx = values.MultiStepContext()
    def run_fn(*args, **kwargs):
      """Single step on the TPU device."""
      del args, kwargs
      fn_inputs = dequeue_fn()
      if not isinstance(fn_inputs, tuple):
        fn_inputs = (fn_inputs,)
      fn_result = fn(ctx, *fn_inputs)
      flat_last_step_outputs = nest.flatten(ctx.last_step_outputs)
      if flat_last_step_outputs:
        with ops.control_dependencies([fn_result]):
          return [array_ops.identity(f) for f in flat_last_step_outputs]
      else:
        return fn_result

    # TODO(sourabhbajaj): The input to while loop should be based on the output
    # type of the step_fn
    def iterate_on_tpu():
      return training_loop.repeat(iterations, run_fn, initial_loop_values)

    # We capture the control_flow_context at this point, before we run `fn`
    # inside a while_loop and TPU replicate context. This is useful in cases
    # where we might need to exit these contexts and get back to the outer
    # context to do some things, for e.g. create an op which should be
    # evaluated only once at the end of the loop on the host. One such usage
    # is in creating metrics' value op.
    self._outer_control_flow_context = (
        ops.get_default_graph()._get_control_flow_context())  # pylint: disable=protected-access

    replicate_inputs = [[]] * self.num_towers
    replicate_outputs = tpu.replicate(iterate_on_tpu, replicate_inputs)
    del self._outer_control_flow_context
    ctx.run_op = control_flow_ops.group(replicate_outputs, enqueue_ops)

    # Filter out any ops from the outputs, typically this would be the case
    # when there were no tensor outputs.
    last_step_tensor_outputs = [x for x in replicate_outputs
                                if not isinstance(x, ops.Operation)]

    # Outputs are currently of the structure (grouped by device)
    # [[output0_device0, output1_device0, output2_device0],
    #  [output0_device1, output1_device1, output2_device1]]
    # Convert this to the following structure instead: (grouped by output)
    # [[output0_device0, output0_device1],
    #  [output1_device0, output1_device1],
    #  [output2_device0, output2_device1]]
    last_step_tensor_outputs = [list(x) for x in zip(*last_step_tensor_outputs)]

    # Convert replicate_outputs to the original dict structure of
    # last_step_outputs.
    last_step_tensor_outputs_dict = nest.pack_sequence_as(
        ctx.last_step_outputs, last_step_tensor_outputs)

    for (name, aggregation) in ctx._last_step_outputs_aggregations.items():  # pylint: disable=protected-access
      output = last_step_tensor_outputs_dict[name]
      # For outputs that have already been aggregated, take the first value
      # from the list as each value should be the same. Else return the full
      # list of values.
      # TODO(josh11b): If aggregation is NONE, we should return a PerDevice value.
      if aggregation is not variables_lib.VariableAggregation.NONE:
        # TODO(priyag): Should this return the element or a list with 1 element
        last_step_tensor_outputs_dict[name] = output[0]
    ctx._set_last_step_outputs(last_step_tensor_outputs_dict)  # pylint: disable=protected-access

    return ctx

  def _call_for_each_tower(self, fn, *args, **kwargs):
    # TODO(jhseu): Consider making it so call_for_each_tower implies that we're
    # in a tpu.rewrite(), and update TPUMirroredVariable accordingly.
    kwargs.pop('run_concurrently', None)
    with one_device_strategy._OneDeviceTowerContext(self):  # pylint: disable=protected-access
      return fn(*args, **kwargs)

  def initialize(self):
    if context.executing_eagerly():
      # TODO(priyag): Add appopriate call here when eager is supported for TPUs.
      raise NotImplementedError('Eager mode not supported in TPUStrategy.')
    else:
      # TODO(jhseu): We need this hack because DistributionStrategies must be
      # pickleable for copy.deepcopy(). Remove when initialize_system goes away.
      graph = ops.get_default_graph()
      tpu_init = graph.get_collection(_TPU_INITIALIZE_SYSTEM_COLLECTION)
      if tpu_init:
        return tpu_init
      graph.add_to_collection(_TPU_INITIALIZE_SYSTEM_COLLECTION,
                              tpu.initialize_system())
      return graph.get_collection(_TPU_INITIALIZE_SYSTEM_COLLECTION)

  def finalize(self):
    if context.executing_eagerly():
      # TODO(priyag): Add appopriate call here when eager is supported for TPUs.
      raise NotImplementedError('Eager mode not supported in TPUStrategy.')
    else:
      return [tpu.shutdown_system()]

  def _get_devices_from(self, colocate_with=None):
     # TODO(jhseu): Change this when we support model parallelism.
    return self._tpu_devices

  def _create_variable(self, next_creator, *args, **kwargs):
    """Create a TPUMirroredVariable. See `DistributionStrategy.scope`."""
    colocate_with = kwargs.pop("colocate_with", None)
    devices = self._get_devices_from(colocate_with)

    def _real_mirrored_creator(devices, *args, **kwargs):  # pylint: disable=g-missing-docstring
      index = {}
      for i, d in enumerate(devices):
        with ops.device(d):
          if i > 0:
            # Give replicas meaningful distinct names:
            var0name = index[devices[0]].name.split(":")[0]
            # We append a / to variable names created on towers with id > 0 to
            # ensure that we ignore the name scope and instead use the given
            # name as the absolute name of the variable.
            kwargs["name"] = "%s/replica_%d/" % (var0name, i)
            # Initialize replicas with the same value:
            if context.executing_eagerly():
              kwargs["initial_value"] = array_ops.identity(
                  index[devices[0]].value())
            else:
              def initial_value_fn(device=d):
                with ops.device(device):
                  return array_ops.identity(index[devices[0]].initial_value)
              kwargs["initial_value"] = initial_value_fn
          with context.context().device_policy(context.DEVICE_PLACEMENT_SILENT):
            v = next_creator(*args, **kwargs)
          assert not isinstance(v, values.TPUMirroredVariable)
          index[d] = v
      return index

    return _create_tpu_mirrored_variable(devices, _real_mirrored_creator, *args,
                                         **kwargs)

  def _reduce(self, aggregation, value, destinations):
    if values._enclosing_tpu_context() is not None:  # pylint: disable=protected-access
      if aggregation == vs.VariableAggregation.MEAN:
        # TODO(jhseu):  Revisit once we support model-parallelism.
        value *= (1. / self.num_towers)
      elif aggregation != vs.VariableAggregation.SUM:
        raise NotImplementedError(
            "Currently only support sum & mean in TPUStrategy.")
      return tpu_ops.cross_replica_sum(value)

    # Validate that the destination is same as the host device
    # Note we don't do this when in replicate context as the reduction is
    # performed on the TPU device itself.
    devices = cross_tower_ops_lib.get_devices_from(destinations)
    if len(devices) == 1:
      assert device_util.canonicalize(devices[0]) == device_util.canonicalize(
          self.get_host_cpu_device(0))
    else:
      raise ValueError('Multiple devices are not supported for TPUStrategy')

    if aggregation == vs.VariableAggregation.ONLY_FIRST_TOWER:
      return value[0]
    output = math_ops.add_n(value)
    if aggregation == vs.VariableAggregation.MEAN:
      return output * (1. / len(value))
    return output

  def _update(self, var, options, fn, *args, **kwargs):
    assert isinstance(var, values.TPUMirroredVariable)
    should_group = options.pop("grouped")
    assert not options  # Validate that we are processing all of the options.

    if values._enclosing_tpu_context() is not None:  # pylint: disable=protected-access
      if should_group:
        return fn(var, *args, **kwargs)
      else:
        return [fn(var, *args, **kwargs)]

    # Otherwise, we revert to MirroredStrategy behavior and update each variable
    # directly.
    updates = {}
    for d, v in var._index.items():  # pylint: disable=protected-access
      name = "update_%d" % self._device_index.get(d)
      with ops.device(d), distribute_lib.UpdateContext(d), ops.name_scope(name):
        # If args and kwargs are not mirrored, the value is returned as is.
        updates[d] = fn(v,
                        *values.select_device_mirrored(d, args),
                        **values.select_device_mirrored(d, kwargs))
    return values.update_regroup(self, updates, should_group)

  # TODO(josh11b): Need to implement _update_non_slot()!

  def read_var(self, var):
    assert isinstance(var, values.TPUMirroredVariable)
    return var.read_value()

  def _unwrap(self, val):
    if isinstance(val, values.DistributedValues):
      # Return in a deterministic order.
      return [val.get(device=d) for d in sorted(val.devices)]
    elif isinstance(val, list):
      # TODO(josh11b): We need to remove this case; per device values should
      # be represented using a PerDevice wrapper instead of a list with
      # one entry per device.
      return val
    return [val]

  @property
  def num_towers(self):
    return self._num_cores_override or self._tpu_metadata.num_cores

  @property
  def num_hosts(self):
    return self._tpu_metadata.num_hosts

  @property
  def num_towers_per_host(self):
    return self._tpu_metadata.num_of_cores_per_host

  @property
  def between_graph(self):
    return False

  @property
  def should_init(self):
    return True

  @property
  def should_checkpoint(self):
    return True

  @property
  def should_save_summary(self):
    return True

  @property
  def worker_devices(self):
    return self._tpu_devices

  @property
  def parameter_devices(self):
    return self._tpu_devices

  def get_host_cpu_device(self, host_id):
    if self._tpu_cluster_resolver.get_master() in ('', 'local'):
      return '/replica:0/task:0/device:CPU:0'
    job_name = self._tpu_cluster_resolver.get_job_name() or 'tpu_worker'
    return '/job:%s/task:%d/device:CPU:0' % (job_name, host_id)

  def configure(self,
                session_config=None,
                cluster_spec=None,
                task_type=None,
                task_id=None):
    del cluster_spec, task_type, task_id
    if session_config:
      session_config.isolate_session_state = True
      cluster_spec = self._tpu_cluster_resolver.cluster_spec()
      if cluster_spec:
        session_config.cluster_def.CopyFrom(cluster_spec.as_cluster_def())


text:
 #ifndef SIMPLEVECTOR_h
 #define SIMPLEVECTOR_h

 #include <stddef.h>

template<typename T> class simplevector {
  public:
    simplevector() : _size(0), capacity(0), data(0) {}; // Default constructor
    ~simplevector() { free(data); }; // Destructor
    simplevector(size_t startCapacity) : _size(0), capacity(startCapacity), data(0) {
        allocCap();
    }
    simplevector(simplevector const &other) : _size(other._size), capacity(other.capacity), data(0) { // Copy constuctor
        data = (T*)malloc(capacity*sizeof(T));
        memcpy(data, other.data, size*sizeof(T));
    }
    simplevector &operator=(simplevector const &other) { // Needed for memory management
        free(data);
        _size = other._size;
        capacity = other.capacity;
        data = (T*)malloc(capacity*sizeof(T));
        memcpy(data, other.data, _size*sizeof(T));
        return *this;
    }
    void push_back(T const &x) { // Adds new value. If needed, allocates more space
        if (capacity == _size){
            resize();
        }
        data[_size++] = x;
    }
    void erase(size_t position){
        memcpy(data+position,data+position+1,((_size--)-position-1)*sizeof(T));
    }
    void erase(T elem){
        for(int i =0; i< _size;i++){
            if(data[i]== elem){
                erase(i);
                return;
            }
        }
    }
    size_t size() const { return _size; } // Size getter
    T const &operator[](size_t i) const { return data[i]; } // Const getter
    T &operator[](size_t i) { return data[i]; } // Changeable getter
  private:
    size_t _size; // Stores no. of actually stored objects
    size_t capacity; // Stores allocated capacity
    T *data; // Stores data

    void resize() {// Allocates double the old space
        capacity = capacity ? capacity*2 : 1;
        allocCap();
    }
    void allocCap(){
        T *newdata = (T *)malloc(capacity*sizeof(T));
        memcpy(newdata, data, _size * sizeof(T));
        free(data);
        data = newdata;
    }
};

#endif


text:
from django.conf.urls import patterns
from tinyblog.feeds import LatestEntriesFeed

urlpatterns = patterns(
    '',
    (r'^$', 'tinyblog.views.index_view',
     {}, 'tinyblog_index'),
    (r'^(?P<year>\d{4})/$', 'tinyblog.views.year_view',
     {}, 'tinyblog_year'),
    (r'^(?P<year>\d{4})/(?P<month>\d{2})/$', 'tinyblog.views.month_view',
     {}, 'tinyblog_month'),
    (r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>([a-z0-9-]+))/$',
     'tinyblog.views.post',
     {}, 'tinyblog_post'),
    (r'^rss/$', LatestEntriesFeed(),
     {}, 'tinyblog_rss'),
    (r'^json/$', 'tinyblog.views.json.serialized_posts',
     {}, 'tinyblog_json'),
    (r'^subscribe/$', 'tinyblog.views.subscription.subscribe',
     {}, 'tinyblog_subscribe'),
    (r'^invite/$', 'tinyblog.views.subscription.invite',
     {}, 'tinyblog_invite'),
    (r'^subscribe/thanks/$',
     'tinyblog.views.subscription.acknowledge_subscription',
     {}, 'tinyblog_subscribe_thanks'),
    (r'^subscribe/confirm/(?P<uuid>([a-z0-9]+))/$',
     'tinyblog.views.subscription.subscribe_confirm',
     {}, 'tinyblog_subscribe_confirm'),
    (r'^unsubscribe/thanks/$',
     'tinyblog.views.subscription.unsubscribe_thanks',
     {}, 'tinyblog_unsubscribe_thanks'),
    (r'^unsubscribe/$',
     'tinyblog.views.subscription.unsubscribe',
     {}, 'tinyblog_unsubscribe'),
)


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <title>ConsumeJMS</title>
    <link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />

Summary

    This processor consumes messages from JMS compliant messaging system and converts them to a FlowFile to be routed to the next component in the flow.

    This processor does two things. It constructs FlowFile by extracting information from the consumed JMS message including body, standard
    JMS Headers and Properties.
    The message body is written to a FlowFile while standard JMS Headers and Properties are set as FlowFile attributes.

Configuration Details

    At the time of writing this document it only defines the essential configuration properties which are suitable for most cases.
    Other properties will be defined later as this component progresses.
    Configuring ConsumeJMS:

User Name - [OPTIONAL] User Name used for authentication and authorization when this processor obtains javax.jms.Connection
    from the pre-configured javax.jms.ConnectionFactory (see below).

Password - [OPTIONAL] Password used in conjunction with User Name.

Destination Name - [REQUIRED] the name of the javax.jms.Destination.
    Usually provided by administrator (e.g., 'topic://myTopic').

Destination Type - [REQUIRED] the type of the javax.jms.Destination. Could be one of 'QUEUE' or 'TOPIC'
    Usually provided by the administrator. Defaults to 'QUEUE'.

Connection Factory Configuration

There are multiple ways to configure the Connection Factory for the processor:

Connection Factory Service property - link to a pre-configured controller service (JndiJmsConnectionFactoryProvider or JMSConnectionFactoryProvider)

JNDI * properties - processor level configuration, the properties are the same as the properties of JndiJmsConnectionFactoryProvider controller service,
        the dynamic properties can also be used in this case

JMS * properties - processor level configuration, the properties are the same as the properties of JMSConnectionFactoryProvider controller service,
        the dynamic properties can also be used in this case

    The preferred way is to use the Connection Factory Service property and a pre-configured controller service. It is also the most convenient method, because it is enough
    to configure the controller service once and then it can be used in multiple processors.

    However, some JMS client libraries may not work with the controller services due to incompatible Java ClassLoader handling between the 3rd party JMS client library and NiFi.
    Should you encounter java.lang.ClassCastException errors when using the controller services, please try to configure the Connection Factory via the 'JNDI *' or
    the 'JMS *' and the dynamic properties of the processor.
    For more details on these properties, see the documentation of the corresponding controller service (JndiJmsConnectionFactoryProvider for 'JNDI *' and
    JMSConnectionFactoryProvider for 'JMS *').


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="5dp"
    android:orientation="vertical">

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@android:color/holo_blue_bright"
        android:padding="3dp">

        <ImageView
            android:id="@+id/Thumbnail"
            android:layout_width="80dp"
            android:layout_height="80dp"
            android:layout_alignParentStart="true"
            android:layout_centerVertical="true"
            android:layout_marginStart="6dp" />

        <TextView
            android:id="@+id/productName"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:layout_alignParentTop="true"
            android:layout_marginEnd="12dp"
            android:layout_marginTop="13dp"
            android:text="XXXXXXXXXX"
            android:textSize="15dp" />

        <TextView
            android:id="@+id/price"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignEnd="@+id/productName"
            android:layout_below="@+id/productName"
            android:layout_marginTop="17dp"
            android:text="9999999999"
            android:textSize="15dp" />

    </RelativeLayout>

</LinearLayout>


text:
<?php

namespace Kanboard\Controller;

/**
 * Project Overview Controller
 *
 * @package  Kanboard\Controller
 * @author   Frederic Guillot
 */
class ProjectOverviewController extends BaseController
{
    /**
     * Show project overview
     */
    public function show()
    {
        $project = $this->getProject();
        $this->projectModel->getColumnStats($project);

        $this->response->html($this->helper->layout->app('project_overview/show', array(
            'project' => $project,
            'title' => $project['name'],
            'description' => $this->helper->projectHeader->getDescription($project),
            'users' => $this->projectUserRoleModel->getAllUsersGroupedByRole($project['id']),
            'roles' => $this->role->getProjectRoles(),
            'events' => $this->helper->projectActivity->getProjectEvents($project['id'], 10),
            'images' => $this->projectFileModel->getAllImages($project['id']),
            'files' => $this->projectFileModel->getAllDocuments($project['id']),
        )));
    }
}


text:
layout: page
title: Novak Enterprises Trade Fair
date: 2016-05-24
author: Eugene Galvan
tags: weekly links, java
status: published
summary: Sed luctus malesuada diam, id convallis lectus mollis vestibulum.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 04/12/2016
  endDate: 04/15/2016
  ctyhocn: WELFLHX
  groupCode: NETF
published: true
---
Sed fringilla nibh lorem, ac vehicula lacus sollicitudin at. Aliquam facilisis sollicitudin ligula ut blandit. Etiam nec massa tortor. Nunc vitae congue orci. Suspendisse tincidunt eu diam ac sodales. Aenean eros justo, sagittis vel posuere vel, auctor in lacus. Vestibulum id leo vel dolor lacinia imperdiet. Donec at imperdiet est. Praesent id porta orci. Nam blandit imperdiet sollicitudin. Donec congue mauris a enim ultrices, a maximus augue feugiat. Donec ac lorem maximus nisl mattis accumsan. Phasellus vitae vulputate urna. Vestibulum vel auctor arcu. Sed eget quam non velit aliquam pellentesque non vel massa. Integer sit amet cursus urna.
Ut dictum tincidunt tellus, ac ornare felis laoreet eget. Ut rutrum turpis non tortor vulputate, at lacinia velit blandit. Cras neque quam, fringilla et cursus quis, lacinia quis sapien. Suspendisse lobortis dignissim risus nec molestie. Vivamus tincidunt consequat massa, sit amet ultricies dolor pellentesque in. Nullam congue orci id tortor vestibulum, at congue mauris imperdiet. Duis suscipit consequat mattis.

* Nunc at leo luctus, accumsan nunc sit amet, posuere justo
* Vivamus vel ante consequat, aliquam ex tempus, sollicitudin lacus
* Fusce faucibus sapien nec est malesuada, quis venenatis diam lobortis.

Cras viverra vitae sem sed ullamcorper. Praesent faucibus scelerisque nibh vel volutpat. Nulla ultrices tortor lectus, ut placerat risus placerat eu. Sed mattis erat at sem vulputate tempor. Interdum et malesuada fames ac ante ipsum primis in faucibus. Aenean fermentum tempor convallis. Duis et aliquam tellus, id mattis nunc.


text:
import Data.List
import Data.Char

data BookInfo = Book Int String [String]
                deriving (Show)

type CustomerID = Integer
type Address    = [String]

data Customer = Customer {
      customerID      :: CustomerID
    , customerName    :: String
    , customerAddress :: Address
    } deriving (Show)

myInfo = Book 9780135072455 "Algebra of Programming"
         ["Richard Bird", "Oege de Moor"]

myLength :: Num b => [a] -> b
myLength (_:xs) = 1 + myLength xs
myLength []     = 0

threeTwoList (3:2:xs) = True
threeTwoList _        = False

data List a = Cons a (List a)
            | Nil
              deriving (Show)

fromList (x:xs) = Cons x (fromList xs)
fromList []     = Nil

fromListCon (Cons x y)   = x : fromListCon y
fromListCon Nil = []

data Tree a = Node a (Tree a) (Tree a)
            | Empty
              deriving (Show)

data MaybeTree a = MBNode a (Maybe (MaybeTree a)) (Maybe (MaybeTree a))
                   deriving (Show)

treeHt Empty               = 0
treeHt (Node _ left right) = 1 + max (treeHt left) (treeHt right)

avgList xs = sum xs / fromIntegral (length xs)
avgListDiv xs = sum xs `div` length xs

palindromeList xs = xs ++ reverse xs

-- isPal :: Eq a => [a] -> Bool
-- isPal xs = take halfLength xs == reverse (drop halfLength xs)
--     where halfLength = length xs `div` 2

-- isPal :: Eq a => [a] -> Bool
isPal xs = xs == reverse xs

subSort xs = sortBy (compareLength) xs
    where compareLength xs ys = compare (length xs) (length ys)

strSumSort :: [String] -> [String]
strSumSort xs = sortBy (compareStrSum) xs
    where compareStrSum xs ys = compare (sumLength xs) (sumLength ys)
          sumLength xs = sum (map (ord) xs)

joinSimple [] sep = []
joinSimple xs sep = head xs ++ sep ++ (joinSimple (tail xs) sep)

printList []     = print "empty"
printList (x:xs) = print xs

join []     sep = []
join (x:[]) sep = x
join (x:xs) sep = x ++ sep ++ join xs sep

-- join2 xs sep
--     | length xs <= 1 = xs
--     | otherwise      = head xs ++ sep ++ (join2 (tail xs) sep)
--

cross :: [a] -> [b] -> [(a,b)]
cross xs ys = [ (x, y) | x <- xs, y <- ys ]


text:
<!DOCTYPE html>

	<meta name="theme-color" content="#1B5E20">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no" />
    <title>404 - Error</title>

	<link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png">
	<link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png">
	<link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png">
	<link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png">
	<link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png">
	<link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png">
	<link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png">
	<link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png">
	<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png">
	<link rel="icon" type="image/png" href="/favicon-192x192.png" sizes="192x192">
	<link rel="icon" type="image/png" href="/favicon-160x160.png" sizes="160x160">
	<link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96">
	<link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16">
	<link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">
	<meta name="msapplication-TileColor" content="#da532c">
	<meta name="msapplication-TileImage" content="/mstile-144x144.png">

    <link href="/css/materialize.min.css" type="text/css" rel="stylesheet" media="screen,projection" />
    <link href="/css/style.css" type="text/css" rel="stylesheet" media="screen,projection" />

				<object id="front-page-logo" type="image/png" data="/logo.png"></object>

Home

Play

About

FAQ

Contact

Sponsors

404 Error

This means that the resource you are looking for does not exist. Go away.

CAMS CTF

A Capture the Flag competition created by the California Academy of Mathematics and Science for middle and high school students.

Pages

Contact

FAQ

About

Sponsors

Connect

Github

Facebook

Email

CAMS CSC

			 	© CCTF 2015 | Made with MaterializeCSS
				MIT License


text:
import re

class Dotdefender():
    @staticmethod
    def Run(headers):
        _ = False
        try:
            for item in headers.items():
                _  = re.search(r'X-dotDefender-denied',item[0],re.I) is not None
                if _:
                    return "dotDefender Web Application Firewall (Applicure Technologies)"
                    break
        except Exception,ERROR:
            print ERROR


text:
package io.github.mrblobman.nbt;

/**
 * An exception raised when an error is encountered during serialization
 * from an object to a NBTBaseTag.
 */
public class NBTSerializationException extends NBTException {
    public NBTSerializationException() {
    }

    public NBTSerializationException(String message) {
        super(message);
    }

    public NBTSerializationException(String message, Throwable cause) {
        super(message, cause);
    }

    public NBTSerializationException(Throwable cause) {
        super(cause);
    }
}


text:
Configuration
=============

Available settings:

ACCOUNT_ADAPTER (="allauth.account.adapter.DefaultAccountAdapter")
  Specifies the adapter class to use, allowing you to alter certain
  default behaviour.

ACCOUNT_AUTHENTICATED_LOGIN_REDIRECTS (=True)
  The default behaviour is to redirect authenticated users to
  ``LOGIN_REDIRECT_URL`` when they try accessing login/signup pages.

  By changing this setting to ``False``, logged in users will not be redirected when
  they access login/signup pages.

ACCOUNT_AUTHENTICATION_METHOD (="username" | "email" | "username_email")
  Specifies the login method to use -- whether the user logs in by
  entering their username, e-mail address, or either one of both.
  Setting this to "email" requires ACCOUNT_EMAIL_REQUIRED=True

ACCOUNT_CONFIRM_EMAIL_ON_GET (=False)
  Determines whether or not an e-mail address is automatically confirmed by
  a GET request. `GET is not designed to modify the server state
  <http://programmers.stackexchange.com/questions/188860/>`_, though it is
  commonly used for email confirmation. To avoid requiring user interaction,
  consider using POST via Javascript in your email confirmation template as
  an alternative to setting this to True.

ACCOUNT_EMAIL_CONFIRMATION_ANONYMOUS_REDIRECT_URL (=settings.LOGIN_URL)
  The URL to redirect to after a successful e-mail confirmation, in case no
  user is logged in.

ACCOUNT_EMAIL_CONFIRMATION_AUTHENTICATED_REDIRECT_URL (=None)
  The URL to redirect to after a successful e-mail confirmation, in
  case of an authenticated user. Set to ``None`` to use
  ``settings.LOGIN_REDIRECT_URL``.

ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS (=3)
  Determines the expiration date of email confirmation mails (# of days).

ACCOUNT_EMAIL_CONFIRMATION_HMAC (=True)
  In order to verify an email address a key is mailed identifying the
  email address to be verified. In previous versions, a record was
  stored in the database for each ongoing email confirmation, keeping
  track of these keys. Current versions use HMAC based keys that do not
  require server side state.

ACCOUNT_EMAIL_REQUIRED (=False)
  The user is required to hand over an e-mail address when signing up.

ACCOUNT_EMAIL_VERIFICATION (="optional")
  Determines the e-mail verification method during signup -- choose
  one of ``"mandatory"``, ``"optional"``, or ``"none"``. When set to
  "mandatory" the user is blocked from logging in until the email
  address is verified. Choose "optional" or "none" to allow logins
  with an unverified e-mail address. In case of "optional", the e-mail
  verification mail is still sent, whereas in case of "none" no e-mail
  verification mails are sent.

ACCOUNT_EMAIL_SUBJECT_PREFIX (="[Site] ")
  Subject-line prefix to use for email messages sent. By default, the
  name of the current ``Site`` (``django.contrib.sites``) is used.

ACCOUNT_DEFAULT_HTTP_PROTOCOL (="http")
  The default protocol used for when generating URLs, e.g. for the
  password forgotten procedure. Note that this is a default only --
  see the section on HTTPS for more information.

ACCOUNT_EMAIL_CONFIRMATION_COOLDOWN (=180)
  The cooldown period (in seconds) after a confirmation email is sent,
  during which further emails are not sent.

ACCOUNT_FORMS (={})
  Used to override forms, for example:
  ``{'login': 'myapp.forms.LoginForm'}``

ACCOUNT_LOGIN_ATTEMPTS_LIMIT (=5)
  Number of failed login attempts. When this number is
  exceeded, the user is prohibited from logging in for the
  specified ``ACCOUNT_LOGIN_ATTEMPTS_TIMEOUT`` seconds. Set to ``None``
  to disable this functionality. Important: while this protects the
  allauth login view, it does not protect Django's admin login from
  being brute forced.

ACCOUNT_LOGIN_ATTEMPTS_TIMEOUT (=300)
  Time period, in seconds, from last unsuccessful login attempt, during
  which the user is prohibited from trying to log in.

ACCOUNT_LOGIN_ON_EMAIL_CONFIRMATION (=False)
  The default behaviour is not log users in and to redirect them to
  ``ACCOUNT_EMAIL_CONFIRMATION_ANONYMOUS_REDIRECT_URL``.

  By changing this setting to ``True``, users will automatically be logged in once
  they confirm their email address. Note however that this only works when
  confirming the email address **immediately after signing up**, assuming users
  didn't close their browser or used some sort of private browsing mode.

ACCOUNT_LOGOUT_ON_GET (=False)
  Determines whether or not the user is automatically logged out by a
  GET request. `GET is not designed to modify the server state <http://programmers.stackexchange.com/questions/188860/>`_,
  and in this case it can be dangerous. See `LogoutView in the
  documentation <http://django-allauth.readthedocs.io/en/latest/views.html#logout>`_
  for details.

ACCOUNT_LOGOUT_ON_PASSWORD_CHANGE (=False)
  Determines whether or not the user is automatically logged out after
  changing or setting their password. See documentation for
  `Django's session invalidation on password change <https://docs.djangoproject.com/en/1.8/topics/auth/default/#session-invalidation-on-password-change>`_.

ACCOUNT_LOGIN_ON_PASSWORD_RESET (=False)
  By changing this setting to ``True``, users will automatically be logged in
  once they have reset their password. By default they are redirected to the
  password reset done page.

ACCOUNT_LOGOUT_REDIRECT_URL (="/")
  The URL (or URL name) to return to after the user logs out. This is
  the counterpart to Django's ``LOGIN_REDIRECT_URL``.

ACCOUNT_PASSWORD_INPUT_RENDER_VALUE (=False)
  ``render_value`` parameter as passed to ``PasswordInput`` fields.

ACCOUNT_PRESERVE_USERNAME_CASING (=True)
  This setting determines whether the username is stored in lowercase
  (``False``) or whether its casing is to be preserved (``True``). Note that when
  casing is preserved, potentially expensive ``__iexact`` lookups are performed
  when filter on username. For now, the default is set to ``True`` to maintain
  backwards compatibility.

ACCOUNT_SESSION_REMEMBER (=None)
  Controls the life time of the session. Set to ``None`` to ask the user
  ("Remember me?"), ``False`` to not remember, and ``True`` to always
  remember.

ACCOUNT_SIGNUP_EMAIL_ENTER_TWICE (=False)
  When signing up, let the user type in their email address twice to avoid
  typo's.

ACCOUNT_SIGNUP_FORM_CLASS (=None)
  A string pointing to a custom form class
  (e.g. 'myapp.forms.SignupForm') that is used during signup to ask
  the user for additional input (e.g. newsletter signup, birth
  date). This class should implement a ``def signup(self, request, user)``
  method, where user represents the newly signed up user.

ACCOUNT_SIGNUP_PASSWORD_ENTER_TWICE (=True)
  When signing up, let the user type in their password twice to avoid typos.

ACCOUNT_TEMPLATE_EXTENSION (="html")
  A string defining the template extension to use, defaults to ``html``.

ACCOUNT_USERNAME_BLACKLIST (=[])
  A list of usernames that can't be used by user.

ACCOUNT_UNIQUE_EMAIL (=True)
  Enforce uniqueness of e-mail addresses. The ``emailaddress.email``
  model field is set to ``UNIQUE``. Forms prevent a user from registering
  with or adding an additional email address if that email address is
  in use by another account.

ACCOUNT_USER_DISPLAY (=a callable returning ``user.username``)
  A callable (or string of the form ``'some.module.callable_name'``)
  that takes a user as its only argument and returns the display name
  of the user. The default implementation returns ``user.username``.

ACCOUNT_USER_MODEL_EMAIL_FIELD (="email")
  The name of the field containing the ``email``, if any. See custom
  user models.

ACCOUNT_USER_MODEL_USERNAME_FIELD (="username")
  The name of the field containing the ``username``, if any. See custom
  user models.

ACCOUNT_USERNAME_MIN_LENGTH (=1)
  An integer specifying the minimum allowed length of a username.

ACCOUNT_USERNAME_REQUIRED (=True)
  The user is required to enter a username when signing up. Note that
  the user will be asked to do so even if
  ``ACCOUNT_AUTHENTICATION_METHOD`` is set to ``email``. Set to ``False``
  when you do not wish to prompt the user to enter a username.

ACCOUNT_USERNAME_VALIDATORS (=None)
  A path
  (``'some.module.validators.custom_username_validators'``) to a list of
  custom username validators. If left unset, the validators setup
  within the user model username field are used.

SOCIALACCOUNT_ADAPTER (="allauth.socialaccount.adapter.DefaultSocialAccountAdapter")
  Specifies the adapter class to use, allowing you to alter certain
  default behaviour.

SOCIALACCOUNT_AUTO_SIGNUP (=True)
  Attempt to bypass the signup form by using fields (e.g. username,
  email) retrieved from the social account provider. If a conflict
  arises due to a duplicate e-mail address the signup form will still
  kick in.

SOCIALACCOUNT_EMAIL_VERIFICATION (=ACCOUNT_EMAIL_VERIFICATION)
  As ``ACCOUNT_EMAIL_VERIFICATION``, but for social accounts.

SOCIALACCOUNT_EMAIL_REQUIRED (=ACCOUNT_EMAIL_REQUIRED)
  The user is required to hand over an e-mail address when signing up
  using a social account.

SOCIALACCOUNT_FORMS (={})
  Used to override forms, for example:
  ``{'signup': 'myapp.forms.SignupForm'}``

SOCIALACCOUNT_PROVIDERS (= dict)
  Dictionary containing provider specific settings.

SOCIALACCOUNT_QUERY_EMAIL (=ACCOUNT_EMAIL_REQUIRED)
  Request e-mail address from 3rd party account provider? E.g. using
  OpenID AX, or the Facebook "email" permission.

SOCIALACCOUNT_STORE_TOKENS (=True)
  Indicates whether or not the access tokens are stored in the database.


text:
using Abp.Security.Users;

namespace Taskever.Security.Users
{
    public class TaskeverUser : AbpUser
    {
        /// <summary>
        /// Profile image of the user.
        /// </summary>
        public virtual string ProfileImage { get; set; }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using Infrastructure.Tests.Data.Domain;
using Infrastructure.Tests.Data.Domain.Mapping;
using System.Data.Entity.Infrastructure;

namespace Infrastructure.Tests.Data.Lab
{
    public class MyDbContext : DbContext
    {
        public DbSet<Category> Categories { get; set; }
        public DbSet<Product> Products { get; set; }
        public DbSet<Order> Orders { get; set; }
        public DbSet<OrderLine> OrderLines { get; set; }
        public DbSet<Customer> Customers { get; set; }

        public MyDbContext(string connStringName) :
            base(connStringName)
        {
            this.Configuration.LazyLoadingEnabled = true;
            this.Configuration.ProxyCreationEnabled = false;
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);

            modelBuilder.Configurations.Add<Customer>(new CustomerMapping());
            modelBuilder.Configurations.Add<Product>(new ProductMapping());
            modelBuilder.Configurations.Add<Category>(new CategoryMapping());
            modelBuilder.Configurations.Add<Order>(new OrderMapping());
            modelBuilder.Configurations.Add<OrderLine>(new OrderLineMapping());
        }
    }
}


text:
local root = (...)

local textbox = {
	_VERSION = "0.0.0",
	InputContext = require(root .. ".InputContext")
}

return textbox


text:
#include "jni.h"
#include <sys/socket.h>

// Convert from sockaddr_storage to InetAddress and an optional int port.
jobject sockaddrToInetAddress(JNIEnv* env, const sockaddr_storage* ss, int* port);

// Convert from InetAddress to sockaddr_storage. An Inet4Address will be converted to
// an IPv4-mapped AF_INET6 sockaddr_in6. This is what you want if you're about to perform an
// operation on a socket, since all our sockets are AF_INET6.
bool inetAddressToSockaddr(JNIEnv* env, jobject inetAddress, int port, sockaddr_storage* ss);

// Convert from InetAddress to sockaddr_storage. An Inet6Address will be converted to
// a sockaddr_in6 while an Inet4Address will be converted to a sockaddr_in. This is
// probably only useful for getnameinfo(2), where we'll be presenting the result to
// the user and the user may actually care whether the original address was pure IPv4
// or an IPv4-mapped IPv6 address, and for the MCAST_JOIN_GROUP socket option.
bool inetAddressToSockaddrVerbatim(JNIEnv* env, jobject inetAddress, int port, sockaddr_storage* ss);

// Changes 'fd' to be blocking/non-blocking. Returns false and sets errno on failure.
// @Deprecated - use IoUtils.setBlocking
bool setBlocking(int fd, bool blocking);


text:
const { fetchAdviserSearchResults } = require('../../adviser/repos')
const { transformAdviserToOption } = require('../../adviser/transformers')

async function getAdviserOptionsHandler(req, res, next) {
  try {
    const params = {
      term: req.query.autocomplete,
      is_active: req.query.is_active,
    }
    const advisers = await fetchAdviserSearchResults(req, params)

    res.json(advisers.map(transformAdviserToOption))
  } catch (error) {
    next(error)
  }
}

module.exports = {
  getAdviserOptionsHandler,
}


text:
var assert      = require('assert');
var should      = require('should');
var req         = require('supertest');

describe('API', function () {
    var uri = 'http://localhost:3000';

    before(function () {
        entry_a = {
            thread_id: 999999999,
            plaintiff_id: 999999999,
            defendant_id: 999999999,
            status: 'open'
        };
    });

    describe('Scammer', function () {
        it('should not accept new record if thread ID found in database', function (done) {
            entry_a.thread_id = 4230107;

            req(uri).post('/scammers')
                .send(entry_a)
                .end(function (err, res) {
                    if (err)
                        throw err;

                    res.should.have.status(400);
                    done();
                });
        });

        it('should not accept new record if thread ID not given', function (done) {
            entry_a.thread_id = undefined; // This is in my test database

            req(uri).post('/scammers')
                .send(entry_a)
                .end(function (err, res) {
                    if (err)
                        throw err;

                    res.should.have.status(400);
                    done();
                });
        });

        it('should not accept new record if plaintiff ID not given', function (done) {
            entry_a.plaintiff_id = undefined; // This is in my test database

            req(uri).post('/scammers')
                .send(entry_a)
                .end(function (err, res) {
                    if (err)
                        throw err;

                    res.should.have.status(400);
                    done();
                });
        });

        it('should not accept new record if defendant ID not given', function (done) {
            entry_a.defendant_id = undefined; // This is in my test database

            req(uri).post('/scammers')
                .send(entry_a)
                .end(function (err, res) {
                    if (err)
                        throw err;

                    res.should.have.status(400);
                    done();
                });
        });

        it('should not accept status of anything other than open, resolved and closed', function (done) {
            entry_a.status = 'notvalid';

            req(uri).post('/scammers')
                .send(entry_a)
                .end(function (err, res) {
                    if (err)
                        throw err;

                    res.should.have.status(400);
                    done();
                });
        });

        it('should only accept dollar amounts with more than two decimal points', function (done) {
            entry_a.severity = 123.232;

            req(uri).post('/scammers')
                .send(entry_a)
                .end(function (err, res) {
                    if (err)
                        throw err;

                    res.should.have.status(400);
                    done();
                });
        });
    });
});


text:
set -e

DEST_DIR=test-data.generated
CONVERT=../../tools/conv-tool/data-converter.sh

touch ${DEST_DIR}/foo
rm    ${DEST_DIR}/*
${CONVERT} test-data.conf


text:
#ifndef NX_PHYSICS_NXFORCEFIELDSHAPEGROUP
#define NX_PHYSICS_NXFORCEFIELDSHAPEGROUP
/*----------------------------------------------------------------------------*\
|
|						Public Interface to Ageia PhysX Technology
|
|							     www.ageia.com
|
\*----------------------------------------------------------------------------*/
/** \addtogroup physics
  @{
*/

#include "Nxp.h"

class NxScene;
class NxForceField;
class NxForceFieldShape;
class NxForceFieldShapeDesc;
class NxForceFieldShapeGroupDesc;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

class NxForceFieldShapeGroup
	{
	protected:
	NX_INLINE					NxForceFieldShapeGroup() : userData(NULL)	{}
	virtual						~NxForceFieldShapeGroup()	{}

	public:

	/**
	\brief Creates a NxForceFieldShape and adds it to the group.

	The volume of activity of the force field is defined by the union of all of the force field's shapes' volumes created
	here without the NX_FFS_EXCLUDE flag set, minus the union of all of the force field's shapes with the NX_FFS_EXCLUDE flag set.

	The shapes are owned by the force field and released if the force field is released.

	Platform:
	\li PC SW: Yes
	\li PPU  : Yes [SW fallback]
	\li PS3  : Yes
	\li XB360: Yes

	@see releaseShape() NxForceFieldShapeDesc
	*/
	virtual NxForceFieldShape* createShape(const NxForceFieldShapeDesc &) = 0;

	/**
	\brief Releases the passed force field shape.

	The passed force field shape must previously have been created with this force field's createShape() call.

	Platform:
	\li PC SW: Yes
	\li PPU  : Yes [SW fallback]
	\li PS3  : Yes
	\li XB360: Yes

	@see createShape() NxForceFieldShapeDesc
	*/
	virtual void releaseShape(const NxForceFieldShape &) = 0;

	/**
	\brief Returns the number of shapes in the force field group.

	\return The number of shapes in this group.

	Platform:
	\li PC SW: Yes
	\li PPU  : Yes [SW fallback]
	\li PS3  : Yes
	\li XB360: Yes

	@see createShape() NxForceFieldShapeDesc
	*/
	virtual NxU32  getNbShapes() const = 0;

	/**
	\brief Restarts the shape iterator so that the next call to getNextShape() returns the first shape in the force field group.

	Platform:
	\li PC SW: Yes
	\li PPU  : Yes [SW fallback]
	\li PS3  : Yes
	\li XB360: Yes

	*/
	virtual void  resetShapesIterator() = 0;

	/**
	\brief Retrieves the next shape when iterating.

	\return NxForceFieldShape See #NxForceFieldShape

	Platform:
	\li PC SW: Yes
	\li PPU  : Yes [SW fallback]
	\li PS3  : Yes
	\li XB360: Yes

	*/
	virtual NxForceFieldShape*  getNextShape() = 0;

	/**
	\brief If this is an include group, getForceField() will return the force field of this group, else NULL will be returned.

	\return NxForceField See #NxForceField

	Platform:
	\li PC SW: Yes
	\li PPU  : Yes [SW fallback]
	\li PS3  : Yes
	\li XB360: Yes

	*/
	virtual NxForceField*	getForceField() const = 0;

	/**
	\brief Returns the force field shape group flags. @see NxForceFieldShapeGroupFlags

	\return NxForceFieldShapeGroupFlags See #NxForceFieldShapeGroupFlags

	Platform:
	\li PC SW: Yes
	\li PPU  : Yes [SW fallback]
	\li PS3  : Yes
	\li XB360: Yes

	*/
	virtual	NxU32			getFlags() const = 0;

	/**
	\brief Writes all of the shape groups's attributes to the description

	\param[out] desc The descriptor used to retrieve the state of the shape group.

	Platform:
	\li PC SW: Yes
	\li PPU  : Yes [SW fallback]
	\li PS3  : Yes
	\li XB360: Yes
	*/
	virtual void saveToDesc(NxForceFieldShapeGroupDesc &desc) = 0;

	/**
	\brief Retrieves the scene which this force field group belongs to.

	\return Owner Scene.

	Platform:
	\li PC SW: Yes
	\li PPU  : Yes [SW fallback]
	\li PS3  : Yes
	\li XB360: Yes

	@see NxScene
	*/
	virtual NxScene&	getScene()	const = 0;

	/**
	\brief Sets a name string for the object that can be retrieved with getName().

	This is for debugging and is not used by the SDK. The string is not copied by the SDK, only the pointer is stored.

	\param[in] name String to set the objects name to.

	Platform:
	\li PC SW: Yes
	\li PPU  : Yes [SW fallback]
	\li PS3  : Yes
	\li XB360: Yes

	@see getName()
	*/
	virtual void  setName (const char* name)= 0;

	/**
	\brief Retrieves the name string set with setName().

	\return The name string for this object.

	Platform:
	\li PC SW: Yes
	\li PPU  : Yes [SW fallback]
	\li PS3  : Yes
	\li XB360: Yes

	@see setName()
	*/
	virtual const char*  getName () const = 0;

	//public variables:
	void*			userData;	//!< user can assign this to whatever, usually to create a 1:1 relationship with a user object.

	};

/** @} */
#endif
//AGCOPYRIGHTBEGIN
///////////////////////////////////////////////////////////////////////////
// Copyright (c) 2007 AGEIA Technologies.
// All rights reserved. www.ageia.com
///////////////////////////////////////////////////////////////////////////
//AGCOPYRIGHTEND


text:
#ifndef CONFIGURATIONPAGE_HPP
#define CONFIGURATIONPAGE_HPP

#include <MPF/Pages/pageBase.hpp>
#include "ui_configurationPage.h"
#include <MPF/System/chroot.hpp>
#include <Pages/diskPage.hpp>

class configurationPage : public pageBase, private Ui::configurationPage

{
	Q_OBJECT

public:
	explicit configurationPage(QWidget *parent = 0);
	~configurationPage();
	int initAll();

public slots:
    int finishUp();

private slots:
	int checkRootPasswordStrength();
	int confirmRootPassword();

private :

	void changeEvent(QEvent* event);
	CHRoot croot;
	diskPage* dpage;
    //QList<Drive> drives;

	int configSystem();

	QString rootPath;

	QProcess mountRoot;
};

#endif // CONFIGURATIONPAGE_HPP


text:
    03/24/2017 04:00 PM
    03/25/2017 02:00 AM
    America/Los_Angeles
    Beyond Wonderland 2017
    Join Insomniac for the best electronic dance music experience in Southern California
    NOS Events Center
    Insomniac
    Organizer e-mail
    false
    MM/DD/YYYY


text:
project_path: /web/_project.yaml
book_path: /web/updates/_book.yaml
description: A round up of some of the latest editions to the Web Audio API in Chrome.

{# wf_updated_on: 2016-02-04 #}
{# wf_published_on: 2016-02-04 #}
{# wf_tags: webaudio,media,chrome49 #}
{# wf_featured_image: /web/updates/images/generic/audio.png #}

# Web Audio Updates in Chrome 49 {: .page-title }

{% include "web/_shared/contributors/chriswilson.html" %}

Chrome has been consistently and quietly improving its support for the [Web
Audio API](https://webaudio.github.io/web-audio-api/).  In Chrome 49 (Beta as of Feb 2016,
and expect to be Stable in March 2016) we've updated several features to track the
specification, and also added one new node.

### decodeAudioData() now returns a promise.

The
[decodeAudioData](https://webaudio.github.io/web-audio-api/#widl-BaseAudioContext-decodeAudioData-Promise-AudioBuffer--ArrayBuffer-audioData-DecodeSuccessCallback-successCallback-DecodeErrorCallback-errorCallback)()
method on `AudioContext` now returns a `Promise`, enabling Promise-based
asynchronous pattern handling.  The `decodeAudioData()` method has always taken
success and error callback functions as parameters:

    context.decodeAudioData( arraybufferData, onSuccess, onError);

But now you can use standard Promise method to handle the asynchronous nature of
decoding audio data instead:

    context.decodeAudioData( arraybufferData ).then(
         (buffer) => { /* store the buffer */ },
         (reason) => { console.log("decode failed! " + reason) });

Although in a single example this looks more verbose, Promises make asynchronous
programming easier and more consistent.  For compatibility, the Success and
Error callback functions are still supported, as per the specification.

### OfflineAudioContext now supports suspend() and resume()

At first glance, it might seem strange to have suspend() on an
[OfflineAudioContext](https://webaudio.github.io/web-audio-api/#OfflineAudioContext).
After all, `suspend()` was added to `AudioContext` to enable putting the audio
hardware into standby mode, which seems pointless in scenarios when you're
rendering to a buffer (which is what `OfflineAudioContext` is for, of course).
However, the point of this feature is to be able to construct only part of a
"score" at a time, to minimize the memory usage. You can create more nodes while
suspended in the middle of a render.

As an example, Beethoven's Moonlight Sonata [contains around 6,500
notes](https://answers.yahoo.com/question/index?qid=20110523115741AAXr23n).
Each "note" probably deconstructs to at least a couple of audio graph nodes
(e.g. an AudioBuffer and a Gain node).  If you wanted to render the entire
seven-and-a-half minutes into a buffer with `OfflineAudioContext`, you probably
don't want to create all those nodes at once.  Instead, you can create them in
chunks of time:

    var context = new OfflineAudioContext(2, length, sampleRate);
    scheduleNextBlock();
    context.startRendering().then( (buffer) => { /* store the buffer */ } );

    function scheduleNextBlock() {
        // create any notes for the next blockSize number of seconds here
        // ...

        // make sure to tell the context to suspend again after this block;
        context.suspend(context.currentTime + blockSize).then( scheduleNextBlock );

        context.resume();
    }

This will enable you to minimize the number of nodes that need to be pre-created
at the beginning of the rendering, and lessen memory demands.

### IIRFilterNode

The spec has added a node for audiophiles who want to create their own
precisely-specified
[infinite-impulse-response](https://en.wikipedia.org/wiki/Infinite_impulse_response):
the
[IIRFilterNode](https://webaudio.github.io/web-audio-api/#idl-def-IIRFilterNode).
 This filter complements the BiquadFilterNode, but allows complete specification
of the filter response parameters (rather than the `BiquadFilterNode`'s
easy-to-use `AudioParams` for type, frequency, Q, and the like).  The
`IIRFilterNode` allows precise specification of filters that couldn't be created
before, like single-order filters; however, using the IIRFilterNode requires
some deep knowledge of how IIR filters work, and they are also not schedulable
like BiquadFilterNodes.

### Previous changes

I also want to mention a couple of improvements that have gone in previously: in
Chrome 48, `BiquadFilter` node automation started running at audio rate.  The API
didn't change at all to do this, but this means your filter sweeps will sound
even smoother.  Also in Chrome 48, we added chaining to the `AudioNode.connect()`
method by returning the node we're connecting to. This makes it simpler to
create chains of nodes, as in this
[example](https://googlechrome.github.io/samples/webaudio-method-chaining/index.html):

      sourceNode.connect(gainNode).connect(filterNode).connect(context.destination);

That's all for now, and keep rocking!

{% include "comment-widget.html" %}