text:
package eu.h2020.symbiote.security.functional;

import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.RpcClient;
import eu.h2020.symbiote.security.AbstractAAMAMQPTestSuite;
import eu.h2020.symbiote.security.commons.enums.AccountStatus;
import eu.h2020.symbiote.security.commons.enums.OperationType;
import eu.h2020.symbiote.security.commons.enums.UserRole;
import eu.h2020.symbiote.security.communication.payloads.Credentials;
import eu.h2020.symbiote.security.communication.payloads.ErrorResponseContainer;
import eu.h2020.symbiote.security.communication.payloads.UserDetailsResponse;
import eu.h2020.symbiote.security.communication.payloads.UserManagementRequest;
import eu.h2020.symbiote.security.repositories.entities.User;
import org.junit.Before;
import org.junit.Test;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageProperties;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.test.context.TestPropertySource;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

import static org.junit.Assert.*;

@TestPropertySource("/core.properties")
public class GetUserDetailsFunctionalTests extends AbstractAAMAMQPTestSuite {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    private Connection connection;

    private RpcClient getUserDetailsClient;

    @Override
    @Before
    public void setUp() throws
            Exception {
        super.setUp();
        getUserDetailsClient = new RpcClient(getConnection().createChannel(), "", getUserDetailsQueue, 5000);
    }

    public Connection getConnection() throws IOException, TimeoutException {
        if (connection == null) {
            ConnectionFactory factory = new ConnectionFactory();
            factory.setHost(rabbitTemplate.getConnectionFactory().getHost());
            factory.setUsername(rabbitTemplate.getConnectionFactory().getUsername());
            factory.setPassword("guest");
            this.connection = factory.newConnection();
        }
        return this.connection;
    }

    @Test
    public void getUserDetailsUsingRPCClientOverAMQPSuccess() throws
            IOException,
            TimeoutException {
        //  Registering user in database
        User User = createUser(username, password, recoveryMail, UserRole.USER, AccountStatus.ACTIVE);
        userRepository.save(User);
        assertTrue(userRepository.exists(username));

        byte[] response = getUserDetailsClient.primitiveCall(mapper.writeValueAsBytes(new
                UserManagementRequest(new
                Credentials(AAMOwnerUsername, AAMOwnerPassword), new Credentials(username, password),
                null, OperationType.READ
        )));

        UserDetailsResponse userDetails = mapper.readValue(response,
                UserDetailsResponse.class);

        assertEquals(username, userDetails.getUserDetails().getCredentials().getUsername());
        assertEquals(recoveryMail, userDetails.getUserDetails().getRecoveryMail());
        assertEquals(UserRole.USER, userDetails.getUserDetails().getRole());
        assertTrue(userDetails.getUserDetails().getCredentials().getPassword().isEmpty());
        assertEquals(HttpStatus.OK, userDetails.getHttpStatus());
    }

    @Test
    public void getUserDetailsOverAMQPForbiddenForInactiveAccount() throws
            IOException {
        //  Registering user in database
        User User = createUser(username, password, recoveryMail, UserRole.USER, AccountStatus.NEW);
        userRepository.save(User);
        assertTrue(userRepository.exists(username));

        byte[] response = rabbitTemplate.sendAndReceive(getUserDetailsQueue, new Message(mapper.writeValueAsBytes(new
                UserManagementRequest(new
                Credentials(AAMOwnerUsername, AAMOwnerPassword), new Credentials(username, password),
                null, OperationType.READ
        )), new MessageProperties())).getBody();
        UserDetailsResponse userDetails = mapper.readValue(response,
                UserDetailsResponse.class);

        assertEquals(UserRole.USER, userDetails.getUserDetails().getRole());
        assertTrue(userDetails.getUserDetails().getCredentials().getPassword().isEmpty());
        assertEquals(AccountStatus.NEW, userDetails.getUserDetails().getStatus());
        assertEquals(HttpStatus.FORBIDDEN, userDetails.getHttpStatus());
    }

    @Test
    public void getUserDetailsOverAMQPSuccessForActiveAccount() throws
            IOException {
        //  Registering user in database
        User User = createUser(username, password, recoveryMail, UserRole.USER, AccountStatus.ACTIVE);
        userRepository.save(User);
        assertTrue(userRepository.exists(username));

        byte[] response = rabbitTemplate.sendAndReceive(getUserDetailsQueue, new Message(mapper.writeValueAsBytes(new
                UserManagementRequest(new
                Credentials(AAMOwnerUsername, AAMOwnerPassword), new Credentials(username, password),
                null, OperationType.READ
        )), new MessageProperties())).getBody();
        UserDetailsResponse userDetails = mapper.readValue(response,
                UserDetailsResponse.class);

        assertEquals(username, userDetails.getUserDetails().getCredentials().getUsername());
        assertEquals(recoveryMail, userDetails.getUserDetails().getRecoveryMail());
        assertEquals(UserRole.USER, userDetails.getUserDetails().getRole());
        assertTrue(userDetails.getUserDetails().getCredentials().getPassword().isEmpty());
        assertEquals(HttpStatus.OK, userDetails.getHttpStatus());
    }

    @Test
    public void getUserDetailsOverAMQAsAdminPSuccess() throws
            IOException {
        //  Registering user in database
        User User = createUser(username, password, recoveryMail, UserRole.USER, AccountStatus.NEW);
        userRepository.save(User);
        assertTrue(userRepository.exists(username));

        byte[] response = rabbitTemplate.sendAndReceive(getUserDetailsQueue, new Message(mapper.writeValueAsBytes(new
                UserManagementRequest(new
                Credentials(AAMOwnerUsername, AAMOwnerPassword), new Credentials(username, "irrelevant"),
                null, OperationType.FORCE_READ
        )), new MessageProperties())).getBody();
        UserDetailsResponse userDetails = mapper.readValue(response,
                UserDetailsResponse.class);

        assertEquals(username, userDetails.getUserDetails().getCredentials().getUsername());
        assertEquals(recoveryMail, userDetails.getUserDetails().getRecoveryMail());
        assertEquals(UserRole.USER, userDetails.getUserDetails().getRole());
        assertTrue(userDetails.getUserDetails().getCredentials().getPassword().isEmpty());
        assertEquals(HttpStatus.OK, userDetails.getHttpStatus());
    }

    @Test
    public void getUserDetailsOverAMQPFailNotExistingUser() throws
            IOException {
        assertFalse(userRepository.exists(username));
        //ask for not existing user
        byte[] response = rabbitTemplate.sendAndReceive(getUserDetailsQueue, new Message(mapper.writeValueAsBytes(new
                UserManagementRequest(new
                Credentials(AAMOwnerUsername, AAMOwnerPassword), new Credentials(username, password),
                null, null
        )), new MessageProperties())).getBody();

        UserDetailsResponse userDetails = mapper.readValue(response,
                UserDetailsResponse.class);

        assertEquals(HttpStatus.BAD_REQUEST, userDetails.getHttpStatus());
    }

    @Test
    public void getUserDetailsOverAMQPFailWrongPassword() throws
            IOException {
        //  Registering user in database
        User User = createUser(username, password, recoveryMail, UserRole.USER, AccountStatus.NEW);
        userRepository.save(User);
        assertTrue(userRepository.exists(username));

        byte[] response = rabbitTemplate.sendAndReceive(getUserDetailsQueue, new Message(mapper.writeValueAsBytes(new
                UserManagementRequest(new
                Credentials(AAMOwnerUsername, AAMOwnerPassword), new Credentials(username, wrongPassword),
                null, OperationType.READ
        )), new MessageProperties())).getBody();

        UserDetailsResponse userDetails = mapper.readValue(response,
                UserDetailsResponse.class);

        assertEquals(HttpStatus.UNAUTHORIZED, userDetails.getHttpStatus());
        assertTrue(userDetails.getUserDetails().getRecoveryMail().isEmpty());
        assertEquals(UserRole.NULL, userDetails.getUserDetails().getRole());
        assertTrue(userDetails.getUserDetails().getCredentials().getUsername().isEmpty());
        assertTrue(userDetails.getUserDetails().getCredentials().getPassword().isEmpty());
    }

    @Test
    public void getUserDetailsOverAMQPFailRequestWithoutUserCredentials() throws
            IOException {
        //  Registering user in database
        User User = createUser(username, password, recoveryMail, UserRole.USER, AccountStatus.NEW);
        userRepository.save(User);
        assertTrue(userRepository.exists(username));

        byte[] response = rabbitTemplate.sendAndReceive(getUserDetailsQueue, new Message(mapper.writeValueAsString(new
                UserManagementRequest(new
                Credentials(AAMOwnerUsername, AAMOwnerPassword), null,
                null, null
        )).getBytes(), new MessageProperties())).getBody();

        UserDetailsResponse userDetails = mapper.readValue(response,
                UserDetailsResponse.class);
        assertEquals(HttpStatus.UNAUTHORIZED, userDetails.getHttpStatus());
    }

    @Test
    public void getUserDetailsOverAMQPFailIncorrectAdminCredentials() throws
            IOException {
        // wrong Admin password
        byte[] response = rabbitTemplate.sendAndReceive(getUserDetailsQueue, new Message(mapper.writeValueAsString(new
                UserManagementRequest(new
                Credentials(AAMOwnerUsername, wrongPassword), new Credentials(username, password),
                null, null
        )).getBytes(), new MessageProperties())).getBody();

        UserDetailsResponse userDetails = mapper.readValue(response,
                UserDetailsResponse.class);
        assertEquals(HttpStatus.FORBIDDEN, userDetails.getHttpStatus());

        //wrong Admin username
        response = rabbitTemplate.sendAndReceive(getUserDetailsQueue, new Message(mapper.writeValueAsString(new
                UserManagementRequest(new
                Credentials(username, AAMOwnerPassword), new Credentials(username, password),
                null, null
        )).getBytes(), new MessageProperties())).getBody();

        userDetails = mapper.readValue(response,
                UserDetailsResponse.class);
        assertEquals(HttpStatus.FORBIDDEN, userDetails.getHttpStatus());
    }

    @Test
    public void sendMessageOverAMQPFailWrongMessage() throws
            IOException {
        String wrongmessage = "{wrong message json}";
        // send incorrect message over AMQP
        byte[] response = rabbitTemplate.sendAndReceive(getUserDetailsQueue, new Message(mapper.writeValueAsBytes
                (wrongmessage), new MessageProperties())).getBody();
        ErrorResponseContainer sspRegistrationOverAMQPResponse = mapper.readValue(response,
                ErrorResponseContainer.class);
        assertEquals(HttpStatus.BAD_REQUEST.value(), sspRegistrationOverAMQPResponse.getErrorCode());
    }
}


text:
/* global Notes */

export default () => {
  const dataEl = document.querySelector('.js-notes-data');
  const {
    notesUrl,
    notesIds,
    now,
    diffView,
    autocomplete,
  } = JSON.parse(dataEl.innerHTML);

  window.notes = new Notes(notesUrl, notesIds, now, diffView, autocomplete);
};

redpajama_set_name: RedPajamaGithub


text:
package consumption

// Copyright (c) Microsoft and contributors.  All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

import (
	"context"
	"github.com/Azure/go-autorest/autorest"
	"github.com/Azure/go-autorest/autorest/azure"
	"net/http"
)

// CostTagsClient is the consumption management client provides access to consumption resources for Azure Enterprise
// Subscriptions.
type CostTagsClient struct {
	BaseClient
}

// NewCostTagsClient creates an instance of the CostTagsClient client.
func NewCostTagsClient(subscriptionID string) CostTagsClient {
	return NewCostTagsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}

// NewCostTagsClientWithBaseURI creates an instance of the CostTagsClient client.
func NewCostTagsClientWithBaseURI(baseURI string, subscriptionID string) CostTagsClient {
	return CostTagsClient{NewWithBaseURI(baseURI, subscriptionID)}
}

// CreateOrUpdate the operation to create or update cost tags assiciated with a billing account. Update operation
// requires latest eTag to be set in the request mandatorily. You may obtain the latest eTag by performing a get
// operation. Create operation does not require eTag.
// Parameters:
// billingAccountID - billingAccount ID
// parameters - parameters supplied to the Create cost tags operation.
func (client CostTagsClient) CreateOrUpdate(ctx context.Context, billingAccountID string, parameters CostTag) (result CostTag, err error) {
	req, err := client.CreateOrUpdatePreparer(ctx, billingAccountID, parameters)
	if err != nil {
		err = autorest.NewErrorWithError(err, "consumption.CostTagsClient", "CreateOrUpdate", nil, "Failure preparing request")
		return
	}

	resp, err := client.CreateOrUpdateSender(req)
	if err != nil {
		result.Response = autorest.Response{Response: resp}
		err = autorest.NewErrorWithError(err, "consumption.CostTagsClient", "CreateOrUpdate", resp, "Failure sending request")
		return
	}

	result, err = client.CreateOrUpdateResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "consumption.CostTagsClient", "CreateOrUpdate", resp, "Failure responding to request")
	}

	return
}

// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client CostTagsClient) CreateOrUpdatePreparer(ctx context.Context, billingAccountID string, parameters CostTag) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"billingAccountId": autorest.Encode("path", billingAccountID),
	}

	const APIVersion = "2018-06-30"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}

	preparer := autorest.CreatePreparer(
		autorest.AsContentType("application/json; charset=utf-8"),
		autorest.AsPut(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/costTags", pathParameters),
		autorest.WithJSON(parameters),
		autorest.WithQueryParameters(queryParameters))
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client CostTagsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
	return autorest.SendWithSender(client, req,
		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
}

// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
func (client CostTagsClient) CreateOrUpdateResponder(resp *http.Response) (result CostTag, err error) {
	err = autorest.Respond(
		resp,
		client.ByInspecting(),
		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
		autorest.ByUnmarshallingJSON(&result),
		autorest.ByClosing())
	result.Response = autorest.Response{Response: resp}
	return
}

// Get get cost tags for a billing account.
// Parameters:
// billingAccountID - billingAccount ID
func (client CostTagsClient) Get(ctx context.Context, billingAccountID string) (result CostTag, err error) {
	req, err := client.GetPreparer(ctx, billingAccountID)
	if err != nil {
		err = autorest.NewErrorWithError(err, "consumption.CostTagsClient", "Get", nil, "Failure preparing request")
		return
	}

	resp, err := client.GetSender(req)
	if err != nil {
		result.Response = autorest.Response{Response: resp}
		err = autorest.NewErrorWithError(err, "consumption.CostTagsClient", "Get", resp, "Failure sending request")
		return
	}

	result, err = client.GetResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "consumption.CostTagsClient", "Get", resp, "Failure responding to request")
	}

	return
}

// GetPreparer prepares the Get request.
func (client CostTagsClient) GetPreparer(ctx context.Context, billingAccountID string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"billingAccountId": autorest.Encode("path", billingAccountID),
	}

	const APIVersion = "2018-06-30"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}

	preparer := autorest.CreatePreparer(
		autorest.AsGet(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/costTags", pathParameters),
		autorest.WithQueryParameters(queryParameters))
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client CostTagsClient) GetSender(req *http.Request) (*http.Response, error) {
	return autorest.SendWithSender(client, req,
		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
}

// GetResponder handles the response to the Get request. The method always
// closes the http.Response Body.
func (client CostTagsClient) GetResponder(resp *http.Response) (result CostTag, err error) {
	err = autorest.Respond(
		resp,
		client.ByInspecting(),
		azure.WithErrorUnlessStatusCode(http.StatusOK),
		autorest.ByUnmarshallingJSON(&result),
		autorest.ByClosing())
	result.Response = autorest.Response{Response: resp}
	return
}


text:
<?php

namespace App\Tests\Services;

use App\Entity\CachedResource;
use App\Model\Source;
use Doctrine\ORM\EntityManagerInterface;

class TaskSourceContentsLoader
{
    private $entityManager;

    public function __construct(EntityManagerInterface $entityManager)
    {
        $this->entityManager = $entityManager;
    }

    /**
     * @param Source[] $sources
     *
     * @return string[]
     */
    public function load(array $sources): array
    {
        $contents = [];

        foreach ($sources as $source) {
            /* @var CachedResource $cachedResource */
            $cachedResource = $this->entityManager->find(CachedResource::class, $source->getValue());
            $contents[$source->getUrl()] = (string) stream_get_contents($cachedResource->getBody());
        }

        return $contents;
    }
}


text:
bork
====

Bork is a light weight puppet like library written in python.
install with:

```bash
sudo python setup.py install
```
example.py is what I use to setup a new desktop enviroment for myself.  Runs via:

```bash
sudo python example.py
```

Further Documentation and examples forthcoming.

Theme song:

http://www.youtube.com/watch?v=jXKUb5A1auM


text:
grunt-audiospritler
===================

Grunt plugin for the audiospritler npm module


text:
module MasterFileBuilder
  class BuildError < Exception; end
  Spec = Struct.new(:content, :original_filename, :content_type, :workflow, :file_size, :auth_header)

  def self.build(media_object, params)
    builder = if params.has_key?(:Filedata) and params.has_key?(:original)
      FileUpload
    elsif params.has_key?(:selected_files)
      DropboxUpload
    else
      nil
    end
    if builder.nil?
      { flash: { error: ["You must specify a file to upload"] }, master_files: [] }
    else
      from_specs(media_object, builder.build(params))
    end
  end

  def self.from_specs(media_object, specs)
    response = { flash: { error: [] }, master_files: [] }
    specs.each do |spec|
      unless spec.original_filename.valid_encoding? && spec.original_filename.ascii_only?
        raise BuildError, 'The file you have uploaded has non-ASCII characters in its name.'
      end

      master_file = MasterFile.new()
      master_file.setContent(spec.content, file_name: spec.original_filename, file_size: spec.file_size, auth_header: spec.auth_header, dropbox_dir: media_object.collection.dropbox_absolute_path)
      master_file.set_workflow(spec.workflow)

      if 'Unknown' == master_file.file_format
        response[:flash][:error] << "The file was not recognized as audio or video - %s (%s)" % [spec.original_filename, spec.content_type]
        master_file.destroy
        next
      else
        response[:flash][:notice] = create_upload_notice(master_file.file_format)
      end

      master_file.media_object = media_object
      if master_file.save
        media_object.save
        master_file.process
        response[:master_files] << master_file
      else
        response[:flash][:error] << "There was a problem storing the file"
      end
    end
    response[:flash][:error] = nil if response[:flash][:error].empty?
    response
  end

  def self.create_upload_notice(format)
    case format
    when /^Sound$/
     'The uploaded content appears to be audio';
    when /^Moving image$/
     'The uploaded content appears to be video';
    else
     'The uploaded content could not be identified';
    end
  end

  module FileUpload
    def self.build(params)
      params[:Filedata].collect do |file|
        if (file.size > MasterFile::MAXIMUM_UPLOAD_SIZE)
          raise BuildError, "The file you have uploaded is too large"
        end
        Spec.new(file, file.original_filename, file.content_type, params[:workflow])
      end
    end
  end

  module DropboxUpload
    def self.build(params)
      params.require(:selected_files).permit!.values.collect do |entry|
        uri = Addressable::URI.parse(entry[:url])
        path = entry["file_name"] || Addressable::URI.unencode(uri.path)
        Spec.new(uri, File.basename(path), Rack::Mime.mime_type(File.extname(path)), params[:workflow], entry["file_size"], entry["auth_header"]&.to_h)
      end
    end
  end
end


text:
/**
 * Created by 365920 on 8/23/2016.
 */

/**
 * Created by 365920 on 8/23/2016.
 */

process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';

//var config = require('../config.json');
var request = require('request');
var async = require('async');
var gistdb = require('../gistdb.js');
var configVals;

var loginAPICall = function (callback) {
    console.log('********Inside loginAPICall**********');
    var loginAPICallReqOptions = {
        url: configVals["url"],
        method: "POST",
        headers: {
            "Content-Type": configVals["contentType"],
            Accept:  configVals["contentType"],
            charset: configVals["charSet"],
            Authorization: configVals["authorization"]
        }
    };
    request(loginAPICallReqOptions, function (err, result) {
        if (err) {
            console.log('********Inside loginAPICall err**********' + err);
            callback(err);
        }
        else {
            console.log('********Inside loginAPICall response**********' + JSON.stringify(result));
            if (result.statusCode && result.statusCode == 200) {
                console.log('********Inside loginAPICall IF**********'+result.body);
                //deleteAppFinalCallback(null, 'bearer ' + JSON.parse(result.body).access_token);
                callback(null, JSON.parse(result.body));
            }
            else {
                callback(JSON.parse(result.body).description);
            }
        }
    });
};

exports.pushApp = function (options, callback) {

    var endpoint = options["endpoint"];
    var Apps = new (require("cf-nodejs-client")).Apps(endpoint);
    var Routes = new (require("cf-nodejs-client")).Routes(endpoint);
    var ServiceInstances = new (require("cf-nodejs-client")).ServiceInstances(endpoint);
    var ServiceBindings = new (require("cf-nodejs-client")).ServiceBindings(endpoint);
    var simpleGit = require('simple-git')(process.cwd());
    var path = process.cwd();
    var currentDir = process.cwd();
    var appGuid;
    configVals = options;

    var push = function (app, callback) {

        var configJSON = {};
        configJSON["config"] = options.environment_json;
        configJSON["apiKey"] = options.apiKey;
        configJSON["secretKey"] = options.secretKey;

        var appOptions = {
            "name": options.appname,
            "space_guid": config["space_guid"],
            "environment_json": configJSON
        };

        var token = app;//options.token;
        console.log('*** Started Pushing the app options***'+JSON.stringify(options));
        console.log('*** Started Pushing the app token ***'+JSON.stringify(token));
        Apps.setToken(token);
        Apps.add(appOptions).then(function (result) {
            appGuid = result.metadata.guid;

            var routeOptions = {
                "domain_guid": options["domain_guid"],
                "space_guid": options["space_guid"],
                "host": options.appname
            };
            Routes.setToken(token);

            return Routes.add(routeOptions);
        }).then(function (result) {

            Apps.setToken(token);
            return Apps.associateRoute(appGuid, result.metadata.guid);
        }).then(function (result) {
            Apps.setToken(token);
            return Apps.upload(appGuid, options["zippedPath"], false);
        }).then(function (result) {
            console.log('In start');
            Apps.setToken(token);
            return Apps.start(appGuid);
        }).then(function (result) {
            console.log('In final result');
            return callback(null, result);
        }).catch(function (reason) {
            console.log("Error in pushing the app : " + reason);
            return callback(reason);

        });
    };

    async.waterfall([loginAPICall, push], function (err, result) {
        if (err) {
            console.log("Error in push app tasks : " + err);
            return callback(err);
        }
        else {
            result.appGuid = appGuid;
            return callback(null, result);
        }
    });
};

exports.deleteApp = function (options, callback) {
    console.log('********Inside deleteApp**********' + JSON.stringify(options));

    var finalAppGUID;
    var resultObj;

    var getData = function (loginResult, deleteAppFinalCallback) {
        console.log('********Inside getData**********' + loginResult);
        var getDatacallback = function (err, result) {
            if (err) {
                deleteAppFinalCallback(err);
            }
            else {
                var filesData = JSON.parse(result.body).files[config.oAuthJson].content;
                var contentArray = JSON.parse(filesData);
                var index = contentArray.findIndex(x => x.instance_id == options.instance_id);
                if (index == -1) {
                    deleteAppFinalCallback('Kindly provide the correct instanceid');
                }
                else {
                    resultObj = contentArray[index];
                    resultObj.accessToken = 'bearer ' + loginResult.access_token;//loginResult;
                    deleteAppFinalCallback(null, resultObj);
                }
            }
        };
        gistdb.getData(getDatacallback)
    };

    //get the app in particular space using appname
    var getAppDetails = function (getDataResultObj, deleteAppFinalCallback) {
        console.log('********Inside getAppDetails**********' + JSON.stringify(getDataResultObj));
        if (getDataResultObj) {
            var getAppDetailsReqOptions = {
                url: getDataResultObj.endpoint + "/v2/spaces/" + getDataResultObj.space_guid + "/apps?q=name:" + getDataResultObj.appname + "&inline-relations-depth=1",
                method: "GET",
                headers: {
                    Authorization: getDataResultObj.accessToken,
                    Accept: config.contentType,
                    "Content-Type": config.contentType
                }
            };
            console.log('********Inside getAppDetails Auth**********' + JSON.stringify(getAppDetailsReqOptions.url) + "***" + JSON.stringify(getAppDetailsReqOptions.Authorization));
            request(getAppDetailsReqOptions, function (err, result) {
                if (err) {
                    console.log('********Inside getAppDetails error **********' + err);
                    deleteAppFinalCallback(err);
                }
                else {
                    console.log('********Inside getAppDetails success**********' + JSON.stringify(result));
                    if (result.statusCode && result.statusCode == 200) {

                        var JSONObj = JSON.parse(result.body);
                        if (JSONObj.resources.length > 0) {
                            finalAppGUID = JSONObj.resources[0].metadata.guid;
                            deleteAppFinalCallback(null, {
                                routeGUID: JSONObj.resources[0].entity.routes[0].metadata.guid,
                                accessToken: getDataResultObj.accessToken
                            });
                        }
                        else {
                            callback(null, 'Success');
                        }
                    }
                    else {
                        deleteAppFinalCallback(JSON.parse(result.body).description);
                    }
                }
            });
        }
        else {
            deleteAppFinalCallback('Kindly provide the correct instanceid');
        }
    };

    var deleteRoute = function (routeGUIDObj, deleteAppFinalCallback) {
        console.log('********Inside deleteRoute**********' + JSON.stringify(routeGUIDObj));
        var deleteRouteReqOptions = {
            url: resultObj.endpoint + "/v2/routes/" + routeGUIDObj.routeGUID + "?async=true",
            method: "DELETE",
            headers: {
                Authorization: routeGUIDObj.accessToken,
                Accept: config.contentType,
                "Content-Type": config.contentType
            }
        };
        request(deleteRouteReqOptions, function (err, result) {
            if (err) {
                console.log('********Inside deleteRoute err**********' + err);
                deleteAppFinalCallback(err);
            }
            else {
                console.log('********Inside deleteRoute response**********' + JSON.stringify(result));
                if (result.statusCode && result.statusCode == 202) {
                    console.log('********Inside deleteRoute NExt Callback value**********' + JSON.parse(result.body).metadata.guid);
                    var JSONOBJ = JSON.parse(result.body);
                    deleteAppFinalCallback(null, {
                        jobGUID: JSONOBJ.metadata.guid,
                        accessToken: routeGUIDObj.accessToken
                    });
                }
                else {
                    deleteAppFinalCallback(JSON.parse(result.body).description);
                }
            }
        });
    };

    var getJOBS = function (jobGUIDObj, deleteAppFinalCallback) {
        console.log('********Inside getJOBS**********' + JSON.stringify(jobGUIDObj));
        var getJOBSReqOptions = {
            url: resultObj.endpoint + "/v2/jobs/" + jobGUIDObj.jobGUID,
            method: "GET",
            headers: {
                Authorization: jobGUIDObj.accessToken,
                Accept: config.contentType,
                "Content-Type": config.contentType
            }
        };
        request(getJOBSReqOptions, function (err, result) {
            if (err) {
                console.log('********Inside getJOBS err**********' + err);
                deleteAppFinalCallback(err);
            }
            else {
                console.log('********Inside getJOBS response**********' + JSON.stringify(result));
                if (result.statusCode && result.statusCode == 200) {
                    var JSONObj = JSON.parse(result.body);
                    if (JSONObj.entity.status && JSONObj.entity.status == 'queued') {
                        getJOBS(jobGUIDObj, deleteAppFinalCallback);
                    }
                    else {
                        deleteApp(jobGUIDObj.accessToken, deleteAppFinalCallback);
                    }
                }
                else {
                    deleteAppFinalCallback(JSON.parse(result.body).description);
                }
            }
        });
    };

    var deleteApp = function (accessToken, deleteAppFinalCallback) {
        console.log('********Inside deleteApp**********');
        var deleteAppReqOptions = {
            url: resultObj.endpoint + "/v2/apps/" + finalAppGUID + "?async=true&recursive=true",
            method: "DELETE",
            headers: {
                Authorization: accessToken,
                Accept: config.contentType,
                "Content-Type": config.contentType
            }
        };
        request(deleteAppReqOptions, function (err, result) {
            if (err) {
                console.log('********Inside deleteApp err**********' + err);
                deleteAppFinalCallback(err);
            }
            else {
                console.log('********Inside deleteApp response**********' + JSON.stringify(result));
                if (result.statusCode && result.statusCode == 204) {
                    deleteAppFinalCallback(null, result);
                }
                else {
                    deleteAppFinalCallback(JSON.parse(result.body).description);
                }
            }
        });
    };

    var deleteAppFinalCallback = function (err, result) {
        if (err) {
            console.log('ERROR: ' + JSON.stringify(err));
            callback(err);
        }
        else {
            console.log('result: ' + JSON.stringify(result));
            callback(null, result);
        }
    };

    async.waterfall([loginAPICall, getData, getAppDetails, deleteRoute, getJOBS], deleteAppFinalCallback);
};


text:
<?xml version="1.0" encoding="UTF-8" ?>
<class name="SphereShape" inherits="Shape" category="Core" version="3.0-alpha">
	<brief_description>
		Sphere shape for 3D collisions.
	</brief_description>
	<description>
		Sphere shape for 3D collisions, which can be set into a [PhysicsBody] or [Area]. This shape is useful for modeling sphere-like 3D objects.
	</description>
	<tutorials>
	</tutorials>
	<demos>
	</demos>
	<methods>
		<method name="get_radius" qualifiers="const">
			<return type="float">
			</return>
			<description>
			</description>
		</method>
		<method name="set_radius">
			<return type="void">
			</return>
			<argument index="0" name="radius" type="float">
			</argument>
			<description>
			</description>
		</method>
	</methods>
	<members>
		<member name="radius" type="float" setter="set_radius" getter="get_radius">
			The sphere's radius. The shape's diameter is double the radius.
		</member>
	</members>
	<constants>
	</constants>
</class>


text:
/**
 * MP4 Metadata Parser
 *
 * Thanks to 43081j for his work on the ID3 pendant
 * @preserve
 */

(function () {
    var mp4 = function (opts, cb) {
      var options = {
        type: 'uri',
      };
      if (typeof opts === 'string') {
        opts = {
          file: opts,
          type: 'uri'
        };
      } else if (typeof window !== 'undefined' && window.File && opts instanceof window.File) {
        opts = {
          file: opts,
          type: 'file'
        };
      }
      for (var k in opts) {
        options[k] = opts[k];
      }

      if (!options.file) {
        return cb('No file was set');
      }

      if (options.type === 'file') {
        if (typeof window === 'undefined' || !window.File || !window.FileReader || typeof ArrayBuffer === 'undefined') {
          return cb('Browser does not have support for the File API and/or ArrayBuffers');
        }
      } else if (options.type === 'local') {
        if (typeof require !== 'function') {
          return cb('Local paths may not be read within a browser');
        }
        var fs = require('fs');
      } else {}/* Buffer Utitlities */

var MP4Tag = {};

MP4Tag.parse = function(handle, callback) {
  function ab2b(ab) {
    var buffer = new Buffer(ab.byteLength),
      view = new Uint8Array(ab);

    for (var i = 0; i < buffer.length; i++) {
      buffer[i] = view[i];
    }

    return buffer;
  }

  function readString(ab, length, offset) {
    return ab2b(ab)
      .toString('utf8', offset, length + offset);
  }

  var containers = [
    "moov", "udta", "mdia", "meta", "ilst",
    "stbl", "minf", "moof", "traf", "trak",
    "stsd"
  ];

  var atom_data_types = {
    0: 'IMPLICIT', // for use with tags for which no type needs to be indicated because only one type is allowed
    1: 'UTF8', // without any count or null terminator
    2: 'UTF16', // also known as UTF-16BE
    3: 'SJIS', // deprecated unless it is needed for special Japanese characters
    6: 'HTML', // the HTML file header specifies which HTML version
    7: 'XML', // the XML header must identify the DTD or schemas
    8: 'UUID', // also known as GUID; stored as 16 bytes in binary (valid as an ID)
    9: 'ISRC', // stored as UTF-8 text (valid as an ID)
    10: 'MI3P', // stored as UTF-8 text (valid as an ID)
    12: 'GIF', // (deprecated) a GIF image
    13: 'JPEG', // a JPEG image
    14: 'PNG', // a PNG image
    15: 'URL', // absolute, in UTF-8 characters
    16: 'DURATION', // in milliseconds, 32-bit integer
    17: 'DATETIME', // in UTC, counting seconds since midnight, January 1, 1904; 32 or 64-bits
    18: 'GENRED', // a list of enumerated values
    21: 'INTEGER', // a signed big-endian integer with length one of { 1,2,3,4,8 } bytes
    24: 'RIAAPA', // RIAA parental advisory; { -1=no, 1=yes, 0=unspecified }, 8-bit ingteger
    25: 'UPC', // Universal Product Code, in text UTF-8 format (valid as an ID)
    27: 'BMP', // Windows bitmap image
    255: 'UNDEFINED' // undefined
  };

  var extractors = {
    readUInt: function readUInt(view, length) {
      return view.getUint32(0, false);
    },
    readText: function readText(view, length) {
      if (typeof Buffer === 'function') {
        return readString(view.buffer, length, 0);
      }
      else {
        return view.getString(length);
      }
    },
    readInt: function readInt(view, length) {
      return view.getInt32(0, false);
    },
    readByte: function readByte(view, length) {
      return view.getUint8(0, false);
    },
    readLongLong: function readLongLong(view, length) {
      return view.getUint32(0, false);
    },
    readBool: function readBool(view, length) {
      return view.byteLength ? view.buffer[0] != '\0' : false;
    },
    readIntPair: function readIntPair(view, length) {
      var a = new DataView(view.buffer.slice(2, 4)),
        b = new DataView(view.buffer.slice(4));

      return [a.getUint16(0, false), b.getUint16(0, false)];
    },
    readGenre: function readGenre(view, length) {
      var idx = view.getUint16(0, false);
      return Genres[idx];
    },
    readCover: function readCover(view, length, flags) {
      var buffer = new Buffer(view.byteLength),
        uview = new Uint8Array(view.buffer);

      for (var i = 0; i < buffer.length; i++) {
        buffer[i] = uview[i];
      }

      return {
        data: buffer,
        format: atom_data_types[flags]
      }
    }
  };

  var atom_name_mappings = {
    "title": "\251nam",
    "artist": "\251ART",
    "album": "\251alb",
    "comment": "\251cmt",
    "genre": "\251gen",
    "date": "\251day",
    "composer": "\251wrt",
    "grouping": "\251grp",
    "tracknumber": "trkn",
    "discnumber": "disk",
    "compilation": "cpil",
    "bpm": "tmpo",
    "copyright": "cprt",
    "lyrics": "\251lyr",
    "encodedby": "\251too",
    "albumsort": "soal",
    "albumartistsort": "soaa",
    "artistsort": "soar",
    "titlesort": "sonm",
    "composersort": "soco",
    "showsort": "sosn",
    "musicbrainz_trackid": "----:com.apple.iTunes:MusicBrainz Track Id",
    "musicbrainz_artistid": "----:com.apple.iTunes:MusicBrainz Artist Id",
    "musicbrainz_albumid": "----:com.apple.iTunes:MusicBrainz Album Id",
    "musicbrainz_albumartistid": "----:com.apple.iTunes:MusicBrainz Album Artist Id",
    "musicbrainz_releasegroupid": "----:com.apple.iTunes:MusicBrainz Release Group Id",
    "musicbrainz_workid": "----:com.apple.iTunes:MusicBrainz Work Id",
    "asin": "----:com.apple.iTunes:ASIN",
    "label": "----:com.apple.iTunes:LABEL",
    "lyricist": "----:com.apple.iTunes:LYRICIST",
    "conductor": "----:com.apple.iTunes:CONDUCTOR",
    "remixer": "----:com.apple.iTunes:REMIXER",
    "engineer": "----:com.apple.iTunes:ENGINEER",
    "producer": "----:com.apple.iTunes:PRODUCER",
    "djmixer": "----:com.apple.iTunes:DJMIXER",
    "mixer": "----:com.apple.iTunes:MIXER",
    "subtitle": "----:com.apple.iTunes:SUBTITLE",
    "discsubtitle": "----:com.apple.iTunes:DISCSUBTITLE",
    "mood": "----:com.apple.iTunes:MOOD",
    "isrc": "----:com.apple.iTunes:ISRC",
    "catalognumber": "----:com.apple.iTunes:CATALOGNUMBER",
    "barcode": "----:com.apple.iTunes:BARCODE",
    "script": "----:com.apple.iTunes:SCRIPT",
    "language": "----:com.apple.iTunes:LANGUAGE",
    "license": "----:com.apple.iTunes:LICENSE",
    "media": "----:com.apple.iTunes:MEDIA",

  };

  function translateToAtomName(human) {
    return atom_name_mappings[human];
  }

  function translateToHumanName(needle) {
    var match;
    for (var human in atom_name_mappings) {
      if (atom_name_mappings.hasOwnProperty(human)) {
        if (needle == atom_name_mappings[human]) {
          match = human;
          break;
        }
      }
    }
    return match;
  }

  /* Parsing */

  function parseDataBlock(view, offset, extractor, index) {
    var length = view.getUint32(offset, false),
      name = view.getString(4, offset + 4),
      flags = view.getUint32(offset + 8, false);
    var pad = (extractor.freeForm && index < 2) ? 12 : 16;
    var begin = offset + pad
    var end = begin + length - pad;
    var data = new DataView(view.buffer.slice(begin, end)),
      value = extractor(data, data.byteLength, flags),
      block = {};

    block.type = name;
    block.flags = flags;
    block.view = view;
    block.length = length;
    block.data = data;
    block.index = index;
    block.value = value;

    return block;
  }

  function parseDataBlocks(view, offset, extractor, index, blocks, end) {
    var block = parseDataBlock(view, offset, extractor, index);

    offset = offset + block.length;
    blocks.push(block);
    index++;
    if (offset < end) {
      return parseDataBlocks(view, offset, extractor, index, blocks, end);
    } else {
      return blocks;
    }
  }

  function extractorFor(atom) {
    var extractor;
    switch (atom.name) {
    case "tvsn":
    case "tves":
    case "cnID":

    case "sfID":
    case "atID":
    case "geID":
    case "cmID":
      extractor = extractors.readUInt;
      break;
    case "tmpo":
      extractor = extractors.readInt;
      break;
    case "stik":
    case "rtng":
    case "akID":
      extractor = extractors.readByte;
      break;
    case "plID":
      extractor = extractors.readLongLong;
      break;
    case "cpil":
    case "pgap":
    case "pcst":
    case "hdvd":
      extractor = extractors.readBool;
      break;
    case "trkn":
    case "disk":
      extractor = extractors.readIntPair;
      break;
    case "gnre":
      extractor = extractors.readGenre;
      break;
    case "covr":
      extractor = extractors.readCover;
      break;
    case "----":
      extractor = extractors.readText;
      extractor.freeForm = true;
      // Fallthru, no break to set default extractor here
    default:
      extractor = extractors.readText;
    }
    if (extractor.freeForm === undefined) {
      extractor.freeForm = false;
    }

    return extractor;
  }

  function extractBlocks(view, extractor) {
    var end = view.byteLength;

    return parseDataBlocks(view, 0, extractor, 0, [], end);
  }

  function readBlockData(atom, cb) {
    handle.read(atom.length - 8, atom.offset + 8, function (err, buffer) {
      if (err) {
        cb(err);
      } else {
        cb(null, buffer);
      }
    });
  }

  function readAllMetadata(atoms, props, meta, cb) {
    if (!cb) {
      cb = meta;
      meta = {};
    }

    var atom = atoms.shift();

    if (atom) {
      if (props.indexOf(atom.name) !== -1) {
        // read data from blocks
        readBlockData(atom, function (err, buffer) {
          if (err) {
            cb(err);
          } else {
            var blocks = extractBlocks(new DataView(buffer), extractorFor(atom));
            if (meta[atom.name]) {
              cb('duplicate atom,' + atom.name + ' aborting');
            } else {
              meta[atom.name] = blocks.length > 1 ? blocks : blocks[0];

              readAllMetadata(atoms, props, meta, cb);
            }
          }

        });
      } else {
        // ignore
        readAllMetadata(atoms, props, meta, cb);
      }
    } else {
      cb(null, meta);
    }

  }

  function readAtom(offset, cb) {
    handle.read(8, offset, function (err, buffer) {
      if (err) {
        cb(err);
      } else {
        if (buffer.byteLength < 8) {
          cb(null, {
            length: 0,
            offset: offset
          });
        }
        else {
          var dv = new DataView(buffer);
          var name = dv.getString(4, 4);

          var length = dv.getUint32(0, false);
          if (containers.indexOf(name) !== -1) {
            // parse child atoms
            if (name == 'meta') {
              offset += 4;
            } else if (name == 'stsd') {
              offset += 8;
            }

            readChildAtoms(offset + 8, offset + length, function (err, atoms) {
              if (err) {
                cb(err);
              } else {
                cb(null, {
                  name: name,
                  length: length,
                  offset: offset,
                  children: atoms
                });
              }
            })
          } else {
            cb(null, {
              name: name,
              length: length,
              offset: offset,
              children: []
            });
          }
        }
      }
    });
  }

  function readAtoms(offset, atoms, cb) {
    if (!cb) {
      cb = atoms;
      atoms = [];
    }

    readAtom(offset, function (err, atom) {
      if (err) {
        cb(err);
      } else {
        if (atom.length > 0) {
          atoms.push(atom);
          readAtoms(atom.offset + atom.length, atoms, cb);
        } else {
          cb(null, atoms);
        }
      }
    });

  }

  function readChildAtoms(offset, end, atoms, cb) {
    if (!cb) {
      cb = atoms;
      atoms = [];
    }

    readAtom(offset, function (err, atom) {
      if (err) {
        cb(err);
      } else {
        if (atom.length > 0 && offset < end) {
          atoms.push(atom);
          readChildAtoms(atom.offset + atom.length, end, atoms, cb);
        } else {
          cb(null, atoms);
        }
      }
    });
  }

  // lookup like this findAtom(atoms, ['moov','udta','meta'])

  function findAtom(atoms, keypath) {
    var level = keypath.shift();

    if (level) {
      var matches = atoms.filter(function (atom) {
        return (atom.name == level);
      });

      if (matches.length) {
        if (keypath.length > 0) {
          return findAtom(matches[0].children, keypath);
        } else {
          return matches[0];
        }
      } else {
        return;
      }
    } else {
      return;
    }
  }

  var field_names = [
    'title', 'date', 'artist', 'album', 'tracknumber', 'comment'
  ],
    atom_names = field_names.map(translateToAtomName);

  readAtoms(0, function (err, atoms) {
    if (!err) {
      var ilst = findAtom(atoms, ['moov', 'udta', 'meta', 'ilst']);
      if(!ilst){
    	  callback("ilist not found");
    	  return;
      }
      readAllMetadata(ilst.children, atom_names, function (err, datum) {
        if (!err) {
          var tags = {};

          field_names.forEach(function (field, index) {
            var atom_name = translateToAtomName(field),
              block = datum[atom_name];

            if (block) {
              tags[field] = block.value;
            }

          });
          // decorate M4A tags
          tags.year = (new Date(Date.parse(tags.date)))
            .getUTCFullYear()

          if(tags.tracknumber){
            tags.track = tags.tracknumber.join("/");
          }
          callback(null, tags);
        } else {
          callback(err);
        }

      });
    } else {
      callback(err);
    }
  });
}/*
 * Add some helper methods to the DataView object
 */

DataView.prototype.getString = function(length, offset) {
	offset = offset || 0;
	length = length || (this.byteLength - offset);
	if(length < 0) {
		length += this.byteLength;
	}
	var str = '';
	for(var i = offset; i < (offset + length); i++) {
		str += String.fromCharCode(this.getUint8(i));
	}
	return str;
};

DataView.prototype.getStringUtf16 = function(length, offset, bom) {
	offset = offset || 0;
	length = length || (this.byteLength - offset);
	var littleEndian = false,
		str = '';
	if(length < 0) {
		length += this.byteLength;
	}
	if(bom) {
		var bomInt = this.getUint16(offset);
		if(bomInt === 0xFFFE) {
			littleEndian = true;
		}
		offset += 2;
		length -= 2;
	}
	for(var i = offset; i < (offset + length); i += 2) {
		var ch = this.getUint16(i, littleEndian);
		if((ch >= 0 && ch <= 0xD7FF) || (ch >= 0xE000 && ch <= 0xFFFF)) {
			str += String.fromCharCode(ch);
		} else if(ch >= 0x10000 && ch <= 0x10FFFF) {
			ch -= 0x10000;
			str += String.fromCharCode(((0xFFC00 & ch) >> 10) + 0xD800) + String.fromCharCode((0x3FF & ch) + 0xDC00);
		}
	}
	return decodeURIComponent(escape(str));
};

DataView.prototype.getSynch = function(num) {
	var out = 0,
		mask = 0x7f000000;
	while(mask) {
		out >>= 1;
		out |= num & mask;
		mask >>= 8;
	}
	return out;
};

DataView.prototype.getUint32Synch = function(offset) {
	return this.getSynch(this.getUint32(offset));
};

DataView.prototype.getUint24 = function(offset) {
	return this.getUint8(offset + 2) + (this.getUint8(offset + 1) << 8) + (this.getUint8(offset) << 16);
};
var Genres = [
	'Blues',
	'Classic Rock',
	'Country',
	'Dance',
	'Disco',
	'Funk',
	'Grunge',
	'Hip-Hop',
	'Jazz',
	'Metal',
	'New Age',
	'Oldies',
	'Other',
	'Pop',
	'R&B',
	'Rap',
	'Reggae',
	'Rock',
	'Techno',
	'Industrial',
	'Alternative',
	'Ska',
	'Death Metal',
	'Pranks',
	'Soundtrack',
	'Euro-Techno',
	'Ambient',
	'Trip-Hop',
	'Vocal',
	'Jazz+Funk',
	'Fusion',
	'Trance',
	'Classical',
	'Instrumental',
	'Acid',
	'House',
	'Game',
	'Sound Clip',
	'Gospel',
	'Noise',
	'AlternRock',
	'Bass',
	'Soul',
	'Punk',
	'Space',
	'Meditative',
	'Instrumental Pop',
	'Instrumental Rock',
	'Ethnic',
	'Gothic',
	'Darkwave',
	'Techno-Industrial',
	'Electronic',
	'Pop-Folk',
	'Eurodance',
	'Dream',
	'Southern Rock',
	'Comedy',
	'Cult',
	'Gangsta Rap',
	'Top 40',
	'Christian Rap',
	'Pop / Funk',
	'Jungle',
	'Native American',
	'Cabaret',
	'New Wave',
	'Psychedelic',
	'Rave',
	'Showtunes',
	'Trailer',
	'Lo-Fi',
	'Tribal',
	'Acid Punk',
	'Acid Jazz',
	'Polka',
	'Retro',
	'Musical',
	'Rock & Roll',
	'Hard Rock',
	'Folk',
	'Folk-Rock',
	'National Folk',
	'Swing',
	'Fast  Fusion',
	'Bebob',
	'Latin',
	'Revival',
	'Celtic',
	'Bluegrass',
	'Avantgarde',
	'Gothic Rock',
	'Progressive Rock',
	'Psychedelic Rock',
	'Symphonic Rock',
	'Slow Rock',
	'Big Band',
	'Chorus',
	'Easy Listening',
	'Acoustic',
	'Humour',
	'Speech',
	'Chanson',
	'Opera',
	'Chamber Music',
	'Sonata',
	'Symphony',
	'Booty Bass',
	'Primus',
	'Porn Groove',
	'Satire',
	'Slow Jam',
	'Club',
	'Tango',
	'Samba',
	'Folklore',
	'Ballad',
	'Power Ballad',
	'Rhythmic Soul',
	'Freestyle',
	'Duet',
	'Punk Rock',
	'Drum Solo',
	'A Cappella',
	'Euro-House',
	'Dance Hall',
	'Goa',
	'Drum & Bass',
	'Club-House',
	'Hardcore',
	'Terror',
	'Indie',
	'BritPop',
	'Negerpunk',
	'Polsk Punk',
	'Beat',
	'Christian Gangsta Rap',
	'Heavy Metal',
	'Black Metal',
	'Crossover',
	'Contemporary Christian',
	'Christian Rock',
	'Merengue',
	'Salsa',
	'Thrash Metal',
	'Anime',
	'JPop',
	'Synthpop',
	'Rock/Pop'
];
/*
 * Reader to read in the bytes using ArrayBuffers
 */
var Reader = function(type) {
	this.type = type || 'uri';
	this.size = null;
	this.file = null;
};

Reader.prototype.open = function(file, callback) {
	this.file = file;
	var self = this;
	if(this.type === 'local') {
		fs.stat(this.file, function(err, stat) {
			if(err) {
				return callback(err);
			}
			self.size = stat.size;
			fs.open(self.file, 'r', function(err, fd) {
				if(err) {
					return callback(err);
				}
				self.fd = fd;
				callback();
			});
		});
	} else if(this.type === 'file') {
		this.size = this.file.size;
		callback();
	} else {
		this.ajax(
			{
				uri: this.file,
				type: 'HEAD',
			},
			function(err, resp, xhr) {
				if(err) {
					return callback(err);
				}
				self.size = parseInt(xhr.getResponseHeader('Content-Length'));
				callback();
			}
		);
	}
};

Reader.prototype.close = function() {
	if(this.type === 'local') {
		fs.close(this.fd);
	}
};

Reader.prototype.read = function(length, position, callback) {
	if(this.type === 'local') {
		this.readPath(length, position, callback);
	} else if(this.type === 'file') {
		this.readFile(length, position, callback);
	} else {
		this.readUri(length, position, callback);
	}
};

/*
 * Local reader
 */
Reader.prototype.readPath = function(length, position, callback) {
	var buffer = new Buffer(length);
	fs.read(this.fd, buffer, 0, length, position, function(err, bytesRead, buffer) {
		if(err) {
			return callback(err);
		}
		var ab = new ArrayBuffer(buffer.length),
			view = new Uint8Array(ab);
		for(var i = 0; i < buffer.length; i++) {
			view[i] = buffer[i];
		}
		callback(null, ab);
	});
};

/*
 * URL reader
 */
Reader.prototype.ajax = function(opts, callback) {
	var options = {
		type: 'GET',
		uri: null,
		responseType: 'text'
	};
	if(typeof opts === 'string') {
		opts = {uri: opts};
	}
	for(var k in opts) {
		options[k] = opts[k];
	}
	var xhr = new XMLHttpRequest();
	xhr.onreadystatechange = function() {
		if(xhr.readyState !== 4) return;
		if(xhr.status !== 200 && xhr.status !== 206) {
			return callback('Received non-200/206 response (' + xhr.status + ')');
		}
		callback(null, xhr.response, xhr);
	};
	xhr.responseType = options.responseType;
	xhr.open(options.type, options.uri, true);
	if(options.range) {
		options.range = [].concat(options.range);
		if(options.range.length === 2) {
			xhr.setRequestHeader('Range', 'bytes=' + options.range[0] + '-' + options.range[1]);
		} else {
			xhr.setRequestHeader('Range', 'bytes=' + options.range[0]);
		}
	}
	xhr.send();
};

Reader.prototype.readUri = function(length, position, callback) {
	this.ajax(
		{
			uri: this.file,
			type: 'GET',
			responseType: 'arraybuffer',
			range: [position, position+length-1]
		},
		function(err, buffer) {
			if(err) {
				return callback(err);
			}
			return callback(null, buffer);
		}
	);
};

/*
 * File API reader
 */
Reader.prototype.readFile = function(length, position, callback) {
	var slice = this.file.slice(position, position+length),
		fr = new FileReader();
	fr.onload = function(e) {
		callback(null, e.target.result);
	};
	fr.onerror = function(e) {
		callback('File read failed');
	};
	fr.readAsArrayBuffer(slice);
};
/*
 * Read the file
 */

  var handle = new Reader(options.type);

  handle.open(options.file, function (err) {
    if (err) {
      return cb('Could not open specified file');
    }
    MP4Tag.parse(handle, function (err, tags) {
      cb(err, tags);
    });
  });
  };
  if (typeof module !== 'undefined' && module.exports) {
    module.exports = mp4;
  } else {
    if (typeof define === 'function' && define.amd) {
      define('mp4', [], function () {
        return mp4;
      });
    } else {
      window.mp4 = mp4;
    }
  }
})();


text:
Work in progress...

You can play at http://partinez.github.io/JSgame/

If you like, it, fork it!


text:
package org.uct.cs.simplify.util;

public class NumberSummary
{
    private final OrderedArrayList<Double> data;

    public double min;
    public double p25;
    public double p50;
    public double p75;
    public double p90;
    public double max;
    public double mean;

    public int count;
    public double total;

    public NumberSummary(int initialCapacity)
    {
        data = new OrderedArrayList<>(initialCapacity);
    }

    public NumberSummary(int initialCapacity, double initialvalue)
    {
        this(initialCapacity);
        add(initialvalue);
    }

    public void add(double v)
    {
        data.put(v);
        count++;

        min = data.get(0);
        max = data.get(count - 1);
        total += v;
        mean = total / count;

        if (count % 2 == 1)
        {
            int middle = (count - 1) / 2;
            p50 = data.get(middle);
        }
        else
        {
            int middle = count / 2;
            p50 = (data.get(middle - 1) + data.get(middle)) / 2;
        }

        p25 = data.get((int) (count * 0.25));
        p75 = data.get((int) (count * 0.75));
        p90 = data.get((int) (count * 0.9));
    }

    public double calculateStdDev()
    {
        double total = 0;
        for (Double d : data)
        {
            total += Math.pow(Math.abs(d - mean), 2);
        }
        return Math.sqrt(total / data.size());
    }

}


text:
var gulp = require('gulp');
var shell = require('gulp-shell');

gulp.task('server',shell.task([
  'open http://localhost:3000/',
  'python -m SimpleHTTPServer 3000'
],{cwd:'./public'}));


text:
package com.autochime.autochimeapplication;

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

interface FakeButtonListener {
    void onFakeButtonPress();
}

/**
 * Created by Wilbur on 08/28/16.
 */
public class FakeButtonEvent {
    private static FakeButtonEvent mInstance = null;
    public static FakeButtonEvent instance() {
        if (mInstance == null)
            mInstance = new FakeButtonEvent();
        return mInstance;
    }
    FakeButtonEvent() {};

    private List<FakeButtonListener> mListeners = new ArrayList<FakeButtonListener>();
    public void addListener(FakeButtonListener listener) { mListeners.add(listener); }
    public void OnPress() { for (FakeButtonListener listener : mListeners) listener.onFakeButtonPress(); }
}


text:
![GeneralAssemb.ly](../../img/icons/FEWD_Logo.png)

#FEWD - Advanced CSS

Dr. Strangelove, or how I learned to love the box model and learn how to divvy things up.

---

##Agenda

*	Review
*	Box Model
*	Nested Selectors
*	Inline vs. block elements
*	Classes and IDs
*	Lab Time

---

##Box Model

Every element in web design is a box.

---

##Box Model

![](http://www.mandalatv.net/itp/drivebys/css/lib/img/box_model.gif)

---

##Box Model

###Width = width + padding-left + padding-right + border-left + border-right

###Height = height + padding-top + padding-bottom + border-top + border-bottom

---

##Box Model

When writing padding or margin rules in CSS, there are some shortcuts:

- ```margin: 10px;``` means that your box will have a margin of 10 pixels on all four sides.
- ```margin: 5px 10px;``` means that your box will have a margin of 5 pixels at the top and bottom, and 10 pixels on the right and left. (In this shortcut, the first number always applies to top and bottom, and the second number always applies to left and right.)
- ```margin: 5px 10px 6px 12px;``` means your box will have a margin of 5 pixels on top, 10 pixels on the right, 6 pixels on the bottom, and 12 pixels to the left.

---

##Nested Selectors

Think of the movie Inception: It's a selector within a selector. There can be different layers and sections to a single page, with tags within each section.

---

##Nested Selectors

For instance, you might have a ```<blockquote>``` on your page. Sometimes this blockquote has many paragraphs (```<p>``` tags) within it. You might have an overall style set for your p tags, but you want the p tags within your blockquote to look different than the other p tags. You do this by using nested selectors.

In HTML, your code might look like this:

```
<blockquote>
    <p>Some paragraph here.</p>
</blockquote>

```

---

##Nested Selectors

If you write a CSS rule for a nested selector, you list the outer tag first, then the second tag (the nested tag or selector) next. Like this:

```
blockquote p {
    color: #999999;
    font-style: italic;
    font-weight: bold;
    margin: 12px 40px;
}
```

---

##Divide and Conquer

There are many tags you can use to section off your content. We've talked about a few of these already, such as ```header```, ```footer```, ```section```, ```article```. There are two other tags that you'll use a lot, maybe even more than those HTML5 tags:

* div
* span

---

##Block and inline elements

Many tags are __block elements__ by default in HTML. Examples of these tags are: ```p```, ```ul```, ```div```, ```header```, ```footer```, ```article```, ```h1``` (and all the h tags).

Think of them as giant boxes. They are good containers. They also tend to occupy the entire width of your page by default (unless you tell it not to). This often means they sit on their own line and push everything else out of their way.

---

##Block and inline elements

__Inline elements__ play nice with other content. They tend to sit within block elements. As the name implies, they sit in line with whatever surrounds them. Examples of inline elements are these tags: ```a```, ```img```, ```span```.

---

##Div vs. Span

###Div

* Divs are block elements. Think of them as divas (div = diva, get it?).
* Like all good divas, divs like to be on their own line and push everything out of the way. They occupy the stage alone.

---

###Span

* Spans are inline elements. They're helpful for when you want make something look different within a div (or any block element, for that matter), but you don't want that styled thing to sit on its own line.

---

##Span example

Say you had an h1 tag that had a specific style attached to it (like it was bold and the color blue). But maybe you want one word in your h1 tag to be a different color.

If you used a div with a class attribute, it would force a line break in the word that was surrounded by the div tags. But using a span around that single word would keep it in line with all the other text while still allowing you to add a class attribute to it (and change the style of that single word).

---

##class & id

With classes and ids we can target specific elements on a page, so we can manipulate it uniquely.

Remember, you can add a class or an ID to any HTML tag. By doing this, you would "override" any CSS rules applied to that particular tag.

---

##class & id

![](../../img/unit_1/tags_attributes.png)

---

##class & id

###IDs are unique

Usually, you add an ID to something going to be used only once in your entire HTML page. (Note: This becomes pretty important in JavaScript and dynamic programming.)

###Classes are not unique

Re-use classes all you like. If you have a CSS rule you'd like to apply to many elements, regardless of what tag it's applied to, use a class.

---

##class & id

How to __select__ classes and ids in CSS

```
.className
#idName
```

---

![GeneralAssemb.ly](../../img/icons/exercise_icon_md.png)
##Fashion Blog


text:
package eu.atos.sla.datamodel;

import java.util.Date;

public interface IBreach {

	/*
	 * Internal generated ID
	 */
	Long getId();

	/**
	 * Date and time of the metric that has generated this breach.
	 *
	 * @return
	 */
	Date getDatetime();

	/**
	 * Name of the kpiName that has generated this breach.
	 */
	String getKpiName();

	String getValue();

	/**
	 * Value of the metric that has generated this breach.
	 *
	 * @return
	 */

	void setId(Long id);

	void setValue(String value);

	/**
	 * Date and time of the metric that has generated this breach.
	 *
	 * @return
	 */
	void setDatetime(Date date);

	/**
	 * Name of the metric that has generated this breach.
	 */
	void setKpiName(String metric);

	String getAgreementUuid();

	void setAgreementUuid(String agreementUuid);

}


text:
import $$ from './dollrs';

export default function prevAll(element, selector) {
  const siblings = $$(element.parentNode.children);

  let prev = siblings.slice(0, siblings.indexOf(element));

  if (selector) {
    prev = prev.filter((el) => el.matches(selector));
  }

  return prev;
}


text:
<resources>
    <string name="app_name">Projectile</string>
</resources>


text:
require 'test/unit'
require 'redis_pipeline'


text:
Dummy::Application.routes.draw do
  payr_routes callback_controller: "callbacks"
end


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=type.N18.html">

Redirecting to type.N18.html...


text:
from django.db import models, migrations
import django.db.models.deletion
from django.conf import settings

class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('libretto', '0017_migrate_types_de_parente'),
    ]

    operations = [

        migrations.AlterUniqueTogether(
            name='typedeparente',
            unique_together=None),
        migrations.RemoveField(
            model_name='typedeparente',
            name='owner'),
        migrations.RemoveField(
            model_name='typedeparente',
            name='polymorphic_ctype'),
        migrations.RemoveField(
            model_name='typedeparentedindividus',
            name='typedeparente_ptr'),
        migrations.RemoveField(
            model_name='typedeparentedoeuvres',
            name='typedeparente_ptr'),
        migrations.AlterField(
            'ParenteDIndividus', 'type',
            models.ForeignKey(
                'TypeDeParenteDIndividus2', related_name='parentes',
                verbose_name='type', on_delete=models.PROTECT)),
        migrations.AlterField(
            'ParenteDOeuvres', 'type',
            models.ForeignKey(
                'TypeDeParenteDOeuvres2', related_name='parentes',
                verbose_name='type', on_delete=models.PROTECT)),
        migrations.DeleteModel(name='TypeDeParenteDIndividus'),
        migrations.DeleteModel(name='TypeDeParenteDOeuvres'),
        migrations.DeleteModel(name='TypeDeParente'),
        migrations.RenameModel(old_name='TypeDeParenteDIndividus2',
                               new_name='TypeDeParenteDIndividus'),
        migrations.RenameModel(old_name='TypeDeParenteDOeuvres2',
                               new_name='TypeDeParenteDOeuvres'),

        #
        # Actualisation automatique
        #
        migrations.AlterField(
            model_name='typedeparentedindividus',
            name='owner',
            field=models.ForeignKey(related_name='typedeparentedindividus', on_delete=django.db.models.deletion.PROTECT, verbose_name='propri\xe9taire', blank=True, to=settings.AUTH_USER_MODEL, null=True),
            preserve_default=True,
        ),
        migrations.AlterField(
            model_name='typedeparentedoeuvres',
            name='owner',
            field=models.ForeignKey(related_name='typedeparentedoeuvres', on_delete=django.db.models.deletion.PROTECT, verbose_name='propri\xe9taire', blank=True, to=settings.AUTH_USER_MODEL, null=True),
            preserve_default=True,
        ),
        migrations.AlterUniqueTogether(
            name='typedeparentedindividus',
            unique_together=set([('nom', 'nom_relatif')]),
        ),
        migrations.AlterUniqueTogether(
            name='typedeparentedoeuvres',
            unique_together=set([('nom', 'nom_relatif')]),
        ),
    ]


text:
import React from 'react';
import ReactDOM from 'react-dom';
import StatelessWidget from './StatelessWidget';
import NumberInput from './NumberInput';
import ButtonMixed from './ButtonMixed';
import LabelMixed from './LabelMixed';

class App extends React.Component {
  constructor() {
    super();
    this.state = {
      txt: 'Component state text',
      red: 0,
      green: 0,
      blue: 0
    }
    this.updateColor = this.updateColor.bind(this)
    this.updateText = this.updateText.bind(this)
  }
  updateColor(e) {
    this.setState({
      red: ReactDOM.findDOMNode(this.refs.red.refs.ui_control).value,
      green: ReactDOM.findDOMNode(this.refs.green.refs.ui_control).value,
      blue: ReactDOM.findDOMNode(this.refs.blue.refs.ui_control).value
    })
  }
  updateText(e) {
    this.setState({
      txt: e.target.value
    })
  }
  render() {
    return (

{this.props.txt}

          <StatelessWidget txt={this.state.txt} update={this.updateText} />

          <NumberInput
            ref="red"
            min={0}
            max={255}
            step={1}
            val={+this.state.red}
            label="Red"
            update={this.updateColor} />

          <NumberInput
            ref="green"
            min={0}
            max={255}
            step={1}
            val={+this.state.green}
            label="Green"
            update={this.updateColor} />

          <NumberInput
            ref="blue"
            min={0}
            max={255}
            step={1}
            val={+this.state.blue}
            label="Blue"
            update={this.updateColor} />

          <ButtonMixed text='Clickable button' />
          <LabelMixed text='Mouseover label' />

    )
  }
}

App.propTypes = {
  txt: React.PropTypes.string,
  cat: React.PropTypes.number.isRequired
}

App.defaultProps = {
  txt: 'Default text value for property'
}

export default App


text:
<?php

namespace Drupal\ctools_block\Plugin\Deriver;

use Drupal\Core\Plugin\Context\ContextDefinition;
use Drupal\ctools\Plugin\Deriver\EntityDeriverBase;

/**
 * Provides entity field block definitions for every field.
 */
class EntityFieldDeriver extends EntityDeriverBase {

  /**
   * {@inheritdoc}
   */
  public function getDerivativeDefinitions($base_plugin_definition) {
    $entity_type_labels = $this->entityManager->getEntityTypeLabels();
    foreach ($this->entityManager->getFieldMap() as $entity_type_id => $entity_field_map) {
      foreach ($this->entityManager->getFieldStorageDefinitions($entity_type_id) as $field_storage_definition) {
        $field_name = $field_storage_definition->getName();

        // The blocks are based on fields. However, we are looping through field
        // storages for which no fields may exist. If that is the case, skip
        // this field storage.
        if (!isset($entity_field_map[$field_name])) {
          continue;
        }

        $field_info = $entity_field_map[$field_name];
        $derivative_id = $entity_type_id . ":" . $field_name;

        // Get the admin label for both base and configurable fields.
        if ($field_storage_definition->isBaseField()) {
          $admin_label = $field_storage_definition->getLabel();
        }
        else {
          // We take the field label used on the first bundle.
          $first_bundle = reset($field_info['bundles']);
          $bundle_field_definitions = $this->entityManager->getFieldDefinitions($entity_type_id, $first_bundle);

          // The field storage config may exist, but it's possible that no
          // fields are actually using it. If that's the case, skip to the next
          // field.
          if (empty($bundle_field_definitions[$field_name])) {
            continue;
          }
          $admin_label = $bundle_field_definitions[$field_name]->getLabel();
        }

        // Set plugin definition for derivative.
        $derivative = $base_plugin_definition;
        $derivative['category'] = $this->t('@entity', ['@entity' => $entity_type_labels[$entity_type_id]]);
        $derivative['admin_label'] = $admin_label;
        $derivative['context'] = [
          'entity' => new ContextDefinition('entity:' . $entity_type_id, $entity_type_labels[$entity_type_id], TRUE),
        ];

        $this->derivatives[$derivative_id] = $derivative;

      }
    }
    return $this->derivatives;
  }

}


text:
import io
import os

import setuptools

# Package metadata.

name = "google-cloud-bigquery"
description = "Google BigQuery API client library"
version = "1.21.0"
# Should be one of:
# 'Development Status :: 3 - Alpha'
# 'Development Status :: 4 - Beta'
# 'Development Status :: 5 - Production/Stable'
release_status = "Development Status :: 5 - Production/Stable"
dependencies = [
    'enum34; python_version < "3.4"',
    "google-cloud-core >= 1.0.3, < 2.0dev",
    "google-resumable-media >= 0.3.1, != 0.4.0, < 0.6.0dev",
    "protobuf >= 3.6.0",
]
extras = {
    "bqstorage": [
        "google-cloud-bigquery-storage >= 0.6.0, <2.0.0dev",
        # Bad Linux release for 0.14.0.
        # https://issues.apache.org/jira/browse/ARROW-5868
        "pyarrow>=0.13.0, != 0.14.0",
    ],
    "pandas": ["pandas>=0.17.1"],
    # Exclude PyArrow dependency from Windows Python 2.7.
    'pyarrow: platform_system != "Windows" or python_version >= "3.4"': [
        # Bad Linux release for 0.14.0.
        # https://issues.apache.org/jira/browse/ARROW-5868
        "pyarrow>=0.4.1, != 0.14.0"
    ],
    "tqdm": ["tqdm >= 4.0.0, <5.0.0dev"],
    "fastparquet": ["fastparquet", "python-snappy"],
}

all_extras = []

for extra in extras:
    if extra == "fastparquet":
        # Skip fastparquet from "all" because it is redundant with pyarrow and
        # creates a dependency on pre-release versions of numpy. See:
        # https://github.com/googleapis/google-cloud-python/issues/8549
        continue
    all_extras.extend(extras[extra])

extras["all"] = all_extras

# Setup boilerplate below this line.

package_root = os.path.abspath(os.path.dirname(__file__))

readme_filename = os.path.join(package_root, "README.rst")
with io.open(readme_filename, encoding="utf-8") as readme_file:
    readme = readme_file.read()

# Only include packages under the 'google' namespace. Do not include tests,
# benchmarks, etc.
packages = [
    package for package in setuptools.find_packages() if package.startswith("google")
]

# Determine which namespaces are needed.
namespaces = ["google"]
if "google.cloud" in packages:
    namespaces.append("google.cloud")

setuptools.setup(
    name=name,
    version=version,
    description=description,
    long_description=readme,
    author="Google LLC",
    author_email="googleapis-packages@google.com",
    license="Apache 2.0",
    url="https://github.com/GoogleCloudPlatform/google-cloud-python",
    classifiers=[
        release_status,
        "Intended Audience :: Developers",
        "License :: OSI Approved :: Apache Software License",
        "Programming Language :: Python",
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.5",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
        "Operating System :: OS Independent",
        "Topic :: Internet",
    ],
    platforms="Posix; MacOS X; Windows",
    packages=packages,
    namespace_packages=namespaces,
    install_requires=dependencies,
    extras_require=extras,
    python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*",
    include_package_data=True,
    zip_safe=False,
)


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

<meta http-equiv="content-type" content="text/html; charset=utf-8" >
<title>Silicon Valley 2015
 - program</title>
<meta name="author" content="" >

<link rel="alternate" type="application/rss+xml" title="devopsdays RSS Feed" href="http://www.devopsdays.org/feed/" >

<link rel="stylesheet" href="/css/devops.min.css" type="text/css" media="screen, projection">
<link rel="stylesheet" href="/css/blueprint/print.css" type="text/css" media="print">

      Home

      Contact

      Events

      Presentations

      Blog

Silicon Valley 2015
 - program

Gold sponsors

welcome
location
program
register
scholarship
sponsor
contact
conduct

If you are new to the Open Space concept you may want to read some more details.

November 6, 2015

08:15-09:15

Registration, Beverages, and Sponsor Booths Open

09:15-9:30

Opening Welcome/Agenda

09:30-9:40

John Willis

State of the Devops

09:40-10:15

Elizabeth A. Nichols

Anomaly Detection 101

10:15-10:50

Gregory Poirier

Not Everybody is Kelsey Hightower

10:50-11:10

Break

11:10-11:45

Jamesha Fisher

Securing the Heart of Automated Infrastructure

11:45-12:45

Lunch

12:55-13:30

Ignites

13:30-14:00

Open Space (Open Space)
 Open Space Opening

14:00-14:45

Open Space (Open Space)
 Open Space #1

15:00-15:30

Open Space (Open Space)
 Open Space #2

15:30-16:00

Break

16:00-16:45

Open Space (Open Space)
 Open Space #3

16:45-17:00

Closing Remarks and Logistics

18:00-20:00

Evening Event - TBA

November 7, 2015

08:15-09:15

Registration, Beverages, and Sponsor Booths Open, Lean Coffee

09:15-9:20

Opening

09:20-9:55

Kirsten Hunter

Caching Versioned MetaData with Git

09:55-10:30

Jason Hand

Flaming Poo and the Human Response

10:30-10:45

Break

10:45-11:20

Jonathan Disher

DevOps Army of One - How to Survive When You're the SPoF

11:20-11:55

Sasha Rosenbaum

Single Point of Failure... Expert

11:55-12:55

Lunch

12:55-13:30

Ignites

13:30-14:00

Open Space (Open Space)
 Open Space Opening

14:00-14:45

Open Space (Open Space)
 Open Space #4

15:00-15:30

Open Space (Open Space)
 Open Space #5

15:30-16:00

Break

16:00-16:45

Open Space (Open Space)
 Open Space #6

16:45-17:30

Giveaways, Closing Remarks,  and Farewell

Talk descriptions and Speaker bios

State of the Devops Union by John Willis

  John Willis is a Director of Ecosystem Development for Docker, which he joined after the company he co-founded (SocketPlane, which focused on SDN for containers) was acquired by Docker in March 2015.  Previous to founding SocketPlane in Fall 2014, John was VP of Customer Enablement at Stateless Networks, and prior to that John was Chief DevOps Evangelist at Dell, which he joined following the Enstratius acquisition in May 2013. He has also held past executive roles at Opscode/Chef and Gulf Breeze Software.

Anomaly Detection 101 by Elizabeth A. Nichols

This presentation surveys a collection of techniques for detecting anomalies in a DevOps environment.  Each of the techniques has strengths and weaknesses that are illustrated via real-world (anonymized) customer data.  Techniques discussed include deterministic and statistical models as well as uni-variate and multi-variate analytics.  Examples are given that show concrete evidence where each can succeed and each can fail.
This presentation is about concepts and how to think about alternative anomaly detection techniques.  This presentation is not an academic discourse in math, statistics or probability theory.

Elizabeth A. Nichols (Betsy) is Chief Data Scientist at Netuitive, Inc. In this role she is responsible for leading the company's vision and technologies for analytics, modeling, and algorithms.

Betsy has applied mathematics and computer technologies to create systems for war gaming, space craft mission optimization, industrial process control, supply chain logistics, electronic trading, advertising networks, IT security and risk models, and network and systems management. She has co-founded three companies, all of which delivered analytics to commercial and government enterprises. Betsy graduated with an A.B. from Vassar College and a Ph.D. in Mathematics from Duke University. Check her out on LinkedIn (https://www.linkedin.com/in/elizabethanichols) for more information.

Not Everybody is Kelsey Hightower by Gregory Poirier

This is the tale of how we iterate on infrastructure, tooling, and product
continuously at $startup. It arose from a need for an infrastructure that would
allow us to continuously deliver applications; that would be appropriate for
distributed systems and a services-oriented architecture; and that facilitated
rapidly prototyping, building, and scaling new features. We went from a couple
of Ubuntu instances with services running in screen to continuous deployments
using Docker, CoreOS, Fleet, and custom tooling (soon to be open sourced). It
stars our intrepid heroine, $name, in zir first role as employee #1 at a
startup and the entire corpus of Kelsey Hightower's open source contributions
as zir trusty sidekick.

It's a tale of experimentation, failure, breaking things, rebuilding things,
and finally just running things (with scissors). It runs the gamut of emotions
in your typical buddy flick as our stars learn how to run software together.
You'll laugh as they try to run Kubernetes in production from day one. You'll
cry when they manually rebuild an etcd2 cluster because they have to learn how.
You'll be on the edge of your seat when they rebuild an entire AWS infrastructure
in 15 minutes. You'll smile when the complete development stack spins up in Docker
and no developer ever has to hit production databases again.

The moral of the story: you don't go from zero to Kelsey Hightower overnight.
Understand your needs, and use that understanding to describe the ideal
tool for the job. Evaluate multiple tools and find the tool or tools with the
closest resemblance that allow you to do the most by doing the least. Then
experiment until you get it right.

Greg Poirier is the Factotum, Chief Architect, and herder of engineering at Opsee.com. He has done research in network security and artificial intelligence and has extensive career history in systems engineering. When he's not in front of a computer, you can find him in front of a piano or singing.

Securing the Heart of Automated Infrastructure by Jamesha Fisher

Our configuration management tools are a key part of our automated infrastructure and keeping it running. So when caring for the heart of automation operations, it's important to make sure they aren't exposed to dangerous elements. How do we do that? And how does that work, especially on prepping with new installs/migrations? My aim is to answer those questions, exploring the setup of a configuration management system with a mind's eye into security and it's principles, including stories about CloudPassage's setup with Enterprise Chef Server and the hurdles faced.

Jamesha Fisher has worked in the Tech industry for over 10 years, with a special interest to security. Graduating with a degree in Information Assurance and Security Engineering, she's lent this experience to her career in Operations and Systems Engineering, including at companies like Google and her present company CloudPassage. In her spare time she's a maker of things musical, delicious, and objects that use binary numbers.

Caching Versioned MetaData with Git by Kirsten Hunter

When you have a slow system, getting meta-information about the contents can be quite frustrating. Whether the system is an API, database or source code management system, caching the information can help immensely with performance and the ability to do common tasks such as diff, logging and retrieving/finding data.

She has used git to create an easy-to-access cache, and tools to wrap the git functions to enable users to find what they want and easily see differences between different versions. While keeping information in two places can seem inefficient, it's frequently the case that metadata about "committed" items doesn't change, and when your SCM, API or database is slow your users can find it very frustrating to find the information they're looking for. Additionally, these systems aren't usually tuned for quick retrieval of and comparison of metadata.

She has also created a website for accessing this data, making it easy for users to see the information in a convenient form - and having the metadata easy to access means I can also run metrics and show how specific pieces of the metadata have changed over time.

Come discover how you can help your users find the information they need without frustration.

Kirsten Hunter is an unapologetic hacker and passionate advocate for the development community. Her technical interests range from graph databases to cloud services, and her experience supporting and evangelizing REST APIs has given her a unique perspective on developer success. In her copious free time she's a gamer, fantasy reader, and all around rabble-rouser. She is currently an API Evangelist at Akamai - best job ever!  Code samples, recipes, and philosophical musings can be found on her blog at http://www.princesspolymath.com

Flaming Poo and the Human Response by Jason Hand

Even the best designed systems can and will have outages.  No matter how well you've hardened your infrastructure and put in place failover or self-healing automation, something you didn't see coming will wreak havoc in your special snowflake of a system. In many cases a human is likely to be a contributing factor. In fact, Gartner has predicted that in 2015, 80% of outages will be caused by people and process issues.

Are you considering the Human element when revisiting incidents and outages with your infrastructure? If so, are you approaching it with a blameless mindset focused on removing the many forms of bias and searching for absolute truth. Do you believe that there is always a root cause to outages or is it more accurate to seek out additional aspects that may have contributed to the incident, especially with regard to the people and processes?

Regardless of your approach, the point of a postmortem is to accurately describe the "story" about what took place in as much detail as possible. The good, the bad, those involved, conversations had, actions taken, related timestamps, who was on-call, etc. You want to know absolutely everything that took place that was related in some degree so that you can review the data and learn from it.

How do we ensure that we are asking the right questions and seeking out relevant and important information that will help us understand what took place and ultimately how to become a better team, company, and product as a result?

The blameless culture (specifically blameless postmortems) is a topic of interest to many in the middle of a DevOps transformation within their organization. Jason will outline important best practices for conducting effective postmortems and demonstrate methods to measure benefits from adopting postmortems especially those of a "blameless" nature.

Jason Hand is a DevOps Evangelist at VictorOps, co-organizer of DevOpsDays - Rockies, author of ChatOps for Dummies, and co-host of Community Pulse a podcast on building community within tech.

Jason has spent the last year presenting and giving workshops on a number of DevOps topics such as Blameless Post-mortems, ChatOps, Alerting, and the value of context within incident management.

DevOps Army of One - How to Survive When You're the SPoF by Jonathan Disher

Despite the best of intentions, we sometimes find ourselves working on a team of size one. Groups shrink for many reasons: attrition, mergers and acquisitions, transfers, and financial distress. It's never comfortable being a Single Point of Failure, but how can you survive this state of non-redundancy? Are there any benefits to being a team of "me, myself, and I", or is it all a pit of despair? What kind of red flags should you be on the lookout for? And, most importantly, what compelling leverage can you try to use to encourage team growth back to a reasonable size?

In this talk, I will share a series of unfortunate events that led to my current status: the Human SPoF; I will also discuss some of the tactics I've used to survive. Automation, tools, and code-as-infrastructure are a force multiplier applied correctly, allowing one engineer to do the work of many. However, these wonders come with a price tag. I will also share strategies to grow a team, and ways to maintain sanity while keeping the lights blinking and the disks spinning in a 24x7 real-time environment with over 2000 servers.

Single Point of Failure... Expert by Sasha Rosenbaum

When you create or manage a complex system you tend to learn all the "gotchas", accumulate arcane knowledge and become the system wizard. The desire to become an expert is natural. However, monopolizing knowledge can be unhealthy for you and dangerous for your employer.
In this talk, Sasha will help you learn how to recognize the early signs and stop yourself and your peers from becoming a single point of failure.

Sasha Rosenbaum is a senior consultant at 10th Magnitude, a Chicago based cloud consulting company. Sasha specializes in Azure and is particularly passionate about the DevOps movement. She devotes time to the community and helps companies build a culture of collaboration with their software delivery teams. Sasha is also co-organizer of the DevOps Days Chicago conference and the Chicago Azure meetup.

Ignites

Ignites to be announced shortly!

Silver sponsors

Become a Silver Sponsor!

Bronze sponsors

Become a Bronze Sponsor!

Media sponsors

Become a Media Sponsor!


text:
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

namespace mod_forum\event;

defined('MOODLE_INTERNAL') || die();

/**
 * The mod_forum discussion moved event class.
 *
 * @property-read array $other {
 *      Extra information about the event.
 *
 *      - int fromforumid: The id of the forum the discussion is being moved from.
 *      - int toforumid: The id of the forum the discussion is being moved to.
 * }
 *
 * @package    mod_forum
 * @since      Moodle 2.7
 * @copyright  2014 Dan Poltawski <dan@moodle.com>
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
class discussion_moved extends \core\event\base {
    /**
     * Init method.
     *
     * @return void
     */
    protected function init() {
        $this->data['crud'] = 'u';
        $this->data['edulevel'] = self::LEVEL_OTHER;
        $this->data['objecttable'] = 'forum_discussions';
    }

    /**
     * Returns description of what happened.
     *
     * @return string
     */
    public function get_description() {
        return "The user with id '$this->userid' has moved the discussion with id '$this->objectid' from the " .
            "forum with id '{$this->other['fromforumid']}' to the forum with id '{$this->other['toforumid']}'.";
    }

    /**
     * Return localised event name.
     *
     * @return string
     */
    public static function get_name() {
        return get_string('eventdiscussionmoved', 'mod_forum');
    }

    /**
     * Get URL related to the action
     *
     * @return \moodle_url
     */
    public function get_url() {
        return new \moodle_url('/mod/forum/discuss.php', array('d' => $this->objectid));
    }

    /**
     * Return the legacy event log data.
     *
     * @return array|null
     */
    protected function get_legacy_logdata() {
        return array($this->courseid, 'forum', 'move discussion', 'discuss.php?d=' . $this->objectid,
            $this->objectid, $this->contextinstanceid);
    }

    /**
     * Custom validation.
     *
     * @throws \coding_exception
     * @return void
     */
    protected function validate_data() {
        parent::validate_data();
        if (!isset($this->other['fromforumid'])) {
            throw new \coding_exception('The \'fromforumid\' value must be set in other.');
        }

        if (!isset($this->other['toforumid'])) {
            throw new \coding_exception('The \'toforumid\' value must be set in other.');
        }

        if ($this->contextlevel != CONTEXT_MODULE) {
            throw new \coding_exception('Context level must be CONTEXT_MODULE.');
        }
    }
}