text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("@angular/core");
var file_upload_module_1 = require("./service/transfer/file-upload/file-upload.module");
var Storage_service_1 = require("../service/Storage.service");
var StorageWindows_1 = require("./service/storage/StorageWindows");
var TransFileWindows_1 = require("./service/transfer/TransFileWindows");
var LoggerWindows_service_1 = require("../wechat/service/logger/LoggerWindows.service");
var Logger_service_1 = require("../service/Logger.service");
var TransFile_service_1 = require("../service/TransFile.service");
exports.windowsPlatformProvides = [
    { provide: Storage_service_1.StorageService, useClass: StorageWindows_1.StorageWindows },
    { provide: TransFile_service_1.TransFileService, useClass: TransFileWindows_1.TransFilePc },
    { provide: Logger_service_1.LoggerService, useClass: LoggerWindows_service_1.LoggerPcService }
];
var WindowsPlatformModule = (function () {
    function WindowsPlatformModule() {
    }
    return WindowsPlatformModule;
}());
WindowsPlatformModule.decorators = [
    { type: core_1.NgModule, args: [{
                imports: [
                    file_upload_module_1.FileUploadModule
                ],
                exports: [file_upload_module_1.FileUploadModule],
                providers: [
                    exports.windowsPlatformProvides
                ]
            },] },
];
/** @nocollapse */
WindowsPlatformModule.ctorParameters = function () { return []; };
exports.WindowsPlatformModule = WindowsPlatformModule;


text:
<?php

class Delivery_Categories extends WP_Widget {

	/**
	 * Sets up the widgets.
	 *
	 * @since 1.0.0
	 */
	function __construct() {

		// Set up the widget options.
		$widget_options = array(
			'classname'   => 'delivery-categories',
			'description' => __( 'Display category list in a custom view.', 'delivery' )
		);

		// Create the widget.
		parent::__construct(
			'delivery-categories',                          // $this->id_base
			__( '→ Delivery Categories', 'delivery' ), // $this->name
			$widget_options                                 // $this->widget_options
		);
	}

	/**
	 * Outputs the widget based on the arguments input through the widget controls.
	 *
	 * @since 1.0.0
	 */
	function widget( $args, $instance ) {
		extract( $args );

		// Output the theme's $before_widget wrapper.
		echo $before_widget;

			// Display the category list.
			echo '<ul>';
				wp_list_categories( array( 'title_li' => '' ) );
			echo '</ul>';

		// Close the theme's widget wrapper.
		echo $after_widget;

	}

}

/**
 * Register the widget.
 *
 * @since  1.0.0
 */
function delivery_register_widgets() {
	register_widget( 'Delivery_Categories' );
}
add_action( 'widgets_init', 'delivery_register_widgets' );

redpajama_set_name: RedPajamaGithub


text: from .tempfile import TempFile


text:
The GTFS-ride defines a common formation for public transportation ridership data and associated information.

## How to start?

1. Read overview below
2. Take a look at examples
3. Create own
4. Test using validation tools
5. Publish

## Overview of Open Ridership Data

A GTFS-ride dataset consists of a series of text files collected in a ZIP file. Each file contains a particular aspect of ridership data. The details of each file are defined in the GTFS-ride reference. An example dataset can be found in GTFS-ride examples. A transit agency can produce a GTFS-ride dataset to share their ridership data with developers, coordinating agencies, funders, and government organizations.


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <groupId>org.apache.qpid</groupId>
  <artifactId>qpid-jms-spring-boot-parent</artifactId>
  <version>0.1.0-SNAPSHOT</version>
  <packaging>pom</packaging>

  <name>QpidJMS Spring Boot Starter and AutoConfiguration Tooling</name>
  <description>QpidJMS Spring Boot Starter and AutoConfiguration Tooling</description>
  <url>https://github.com/tabish121/solace-jms-spring-boot</url>

  <licenses>
    <license>
      <name>The Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <scm>
    <url>https://github.com/tabish121/qpid-jms-spring-boot.git</url>
    <connection>scm:git:git://github.com/tabish121/qpid-jms-spring-boot.git</connection>
    <developerConnection>scm:git:git@github.com:tabish121/qpid-jms-spring-boot.git</developerConnection>
    <tag>HEAD</tag>
  </scm>

  <properties>
    <qpid-jms-version>0.23.0</qpid-jms-version>

    <apache-rat-version>0.13-SNAPSHOT</apache-rat-version>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
  </properties>

  <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.4.RELEASE</version>
  </parent>

  <repositories>
    <repository>
      <id>spring-milestones</id>
      <name>Spring Milestones</name>
      <url>https://repo.spring.io/milestone</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>spring-milestones</id>
      <name>Spring Milestones</name>
      <url>https://repo.spring.io/milestone</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>

  <modules>
    <module>qpid-jms-spring-boot-autoconfigure</module>
    <module>qpid-jms-spring-boot-starter</module>
    <module>qpid-jms-spring-boot-examples</module>
  </modules>

  <build>
    <defaultGoal>install</defaultGoal>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <configuration>
            <runOrder>${surefire.runOrder}</runOrder>
            <redirectTestOutputToFile>${maven.test.redirectTestOutputToFile}</redirectTestOutputToFile>
            <forkCount>1</forkCount>
            <reuseForks>true</reuseForks>
            <systemPropertyVariables>
                <java.awt.headless>true</java.awt.headless>
            </systemPropertyVariables>
            <failIfNoTests>false</failIfNoTests>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-eclipse-plugin</artifactId>
          <version>${maven-eclipse-plugin-version}</version>
          <configuration>
            <downloadSources>true</downloadSources>
            <downloadJavadocs>true</downloadJavadocs>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-idea-plugin</artifactId>
          <version>${maven-idea-plugin-version}</version>
          <configuration>
            <downloadSources>true</downloadSources>
            <downloadJavadocs>true</downloadJavadocs>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <configuration>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <tagNameFormat>@{project.version}</tagNameFormat>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <version>${apache-rat-version}</version>
        <configuration>
          <excludes>
            <exclude>appveyor.yml</exclude>
            <exclude>.travis.yml</exclude>
            <exclude>**/*.md</exclude>
            <exclude>**/*.txt</exclude>
            <exclude>etc/org.eclipse.*</exclude>
            <exclude>**/target/</exclude>
            <exclude>**/data/</exclude>
            <exclude>**/*.lock</exclude>
            <exclude>**/META-INF/services/*</exclude>
            <exclude>**/*.iml</exclude>
            <exclude>**/*.keystore</exclude>
            <exclude>**/*.truststore</exclude>
            <exclude>**/*.crt</exclude>
            <exclude>**/*.csr</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>


text:
package org.apereo.portal.portlet.om;

/** Identifier type for portlet definitions. */
public interface IPortletDefinitionId extends IObjectId {
    /** @return the numeric version of the id */
    long getLongId();
}


text:
@interface AuthRequestBuilder : NSObject <AuthRequestBuilderProtocol>

- (NSMutableURLRequest *)requestForSocketID:(NSString *)socketID channel:(PusherChannel *)channel;
- (NSURLRequest *)requestForSocketID:(NSString *)socketID channelName:(NSString *)channelName;

@end

@implementation AuthRequestBuilder

- (NSMutableURLRequest *)requestForSocketID:(NSString *)socketID channel:(PusherChannel *)channel {
    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL: [[NSURL alloc] initWithString:@"http://localhost:9292/pusher/auth"]];
    NSString *dataStr = [NSString stringWithFormat: @"socket_id=%@&channel_name=%@", socketID, [channel name]];
    NSData *data = [dataStr dataUsingEncoding:NSUTF8StringEncoding];
    request.HTTPBody = data;
    request.HTTPMethod = @"POST";
    return request;
}

- (NSURLRequest *)requestForSocketID:(NSString *)socketID channelName:(NSString *)channelName {
    NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[[NSURL alloc] initWithString:@"http://localhost:9292/pusher/auth"]];
    NSMutableURLRequest *mutableRequest = [[NSMutableURLRequest alloc] initWithURL: [[NSURL alloc] initWithString:@"http://localhost:9292/pusher/auth"]];

    NSString *dataStr = [NSString stringWithFormat: @"socket_id=%@&channel_name=%@", socketID, channelName];
    NSData *data = [dataStr dataUsingEncoding:NSUTF8StringEncoding];
    mutableRequest.HTTPBody = data;
    mutableRequest.HTTPMethod = @"POST";

    request = [mutableRequest copy];

    return request;
}

@end

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    OCAuthMethod *authMethod = [[OCAuthMethod alloc] initWithSecret:@"YOUR_APP_SECRET"];
    PusherClientOptions *options = [[PusherClientOptions alloc] initWithAuthMethod:authMethod];

    // Use this if you want to try out your auth Endpoint
//    OCAuthMethod *endpointAuthMethod = [[OCAuthMethod alloc] initWithAuthRequestBuilder:[[AuthRequestBuilder alloc] init]];
//    PusherClientOptions *optionsWithEndpoint = [[PusherClientOptions alloc] initWithAuthMethod:endpointAuthMethod];

    self.client = [[Pusher alloc] initWithAppKey:@"YOUR_APP_KEY" options:options];
    self.client.connection.delegate = self;

    self.client.connection.userDataFetcher = ^PusherPresenceChannelMember* () {
        NSString *uuid = [[NSUUID UUID] UUIDString];
        return [[PusherPresenceChannelMember alloc] initWithUserId:uuid userInfo:nil];
    };

    // bind to all events globally
    [self.client bindWithEventCallback:^void (PusherEvent *event) {
        NSString *message = [NSString stringWithFormat: @"Event received '%@'", event.eventName];

        if (event.channelName) {
            message = [message stringByAppendingFormat: @" on channel '%@'", event.channelName];
        }
        if (event.userId) {
            message = [message stringByAppendingFormat: @" from user '%@'", event.userId];
        }
        if (event.data) {
            message = [message stringByAppendingFormat: @" with data '%@'", event.data];
        }

        NSLog(@"%@", message);
    }];

    [self.client connect];

    // subscribe to a public channel
    PusherChannel *myChannel = [self.client subscribeWithChannelName:@"my-channel"];

    // bind a callback to an event on that channel
    [myChannel bindWithEventName:@"my-event" eventCallback:^void (PusherEvent *event) {
        NSString *dataString = event.data;
        // convert string to data for decoding
        NSData *data = [dataString dataUsingEncoding:NSUTF8StringEncoding];

        NSError *error;
        // parse data as json
        NSDictionary *jsonObject = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];

        NSString *name = jsonObject[@"name"];
        NSString *message = jsonObject[@"message"];

        NSLog(@"%@ says %@", name, message);
    }];

    // callback for member added event
    void (^onMemberAdded)(PusherPresenceChannelMember*) = ^void (PusherPresenceChannelMember *member) {
        NSLog(@"member added: %@", member);
    };

    // callback for member removed event
    void (^onMemberRemoved)(PusherPresenceChannelMember*) = ^void (PusherPresenceChannelMember *member) {
        NSLog(@"member removed: %@", member);
    };

    // subscribe to a presence channel
    PusherPresenceChannel *presChanExplicit = [self.client subscribeToPresenceChannelWithChannelName:@"presence-explicit" onMemberAdded:onMemberAdded onMemberRemoved:onMemberRemoved];

    // bind a callback on the presence channel
    [presChanExplicit bindWithEventName:@"testing" eventCallback: ^void (PusherEvent *event) {
        NSLog(@"Data: %@", event.data);
    }];

    // trigger a client event
    [presChanExplicit triggerWithEventName:@"client-testing" data:@{ @"developers" : @"developers developers developers" }];
}

- (void)changedConnectionStateFrom:(enum ConnectionState)old to:(enum ConnectionState)new_ {
    NSLog(@"Old connection: %d, new connection: %d", (int)old, (int)new_);
}

- (void)debugLogWithMessage:(NSString *)message {
    NSLog(@"%@", message);
}

- (void)subscribedToChannelWithName:(NSString *)name {
    NSLog(@"Subscribed to channel %@", name);

    if ([name isEqual: @"presence-test"]) {
        NSLog(@"%@", [(PusherPresenceChannel *)[self.client.connection.channels findWithName:@"presence-test"] members]);
    }
}

- (void)failedToSubscribeToChannelWithName:(NSString *)name response:(NSURLResponse *)response data:(NSString *)data error:(NSError *)error {
    NSLog(@"Failed to subscribe to channel %@", name);
}

- (void)receivedError:(PusherError *)error {
    NSNumber *code = error.codeOC;
    if(code) {
        NSLog(@"Received error: (%ld) %@", [code longValue], error.message);
    } else {
        NSLog(@"Received error: %@", error.message);
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end


text:
import * as React from 'react';
import { Activity, Attachment, AttachmentLayout } from 'botframework-directlinejs';
import { AttachmentView } from './Attachment';
import { Carousel } from './Carousel';
import { FormattedText } from './FormattedText';
import { FormatState, SizeState } from './Store';

const Attachments = (props: {
    attachments: Attachment[],
    attachmentLayout: AttachmentLayout,
    format: FormatState,
    size: SizeState,
    onCardAction: (type: string, value: string) => void,
    onImageLoad: () => void
}) => {
    const { attachments, attachmentLayout, ... otherProps } = props;
    if (!attachments || attachments.length === 0)
        return null;
    return attachmentLayout === 'carousel' ?
        <Carousel
            attachments={ attachments }
            { ... otherProps }
        />
    :

            { attachments.map((attachment, index) =>
                <AttachmentView
                    key={ index }
                    attachment={ attachment }
                    { ... otherProps }
                />
            ) }

}

export interface ActivityViewProps {
    format: FormatState,
    size: SizeState,
    activity: Activity,
    onCardAction: (type: string, value: string) => void,
    onImageLoad: () => void
}

export class ActivityView extends React.Component<ActivityViewProps, {}> {
    constructor(props: ActivityViewProps) {
        super(props)
    }

    shouldComponentUpdate(nextProps: ActivityViewProps) {
        // if the activity changed, re-render
        return this.props.activity !== nextProps.activity
        // if the format changed, re-render
            || this.props.format !== nextProps.format
        // if it's a carousel and the size changed, re-render
            || (this.props.activity.type === 'message'
                && this.props.activity.attachmentLayout === 'carousel'
                && this.props.size !== nextProps.size);
    }

    render() {
        const { activity, ... otherProps } = this.props;
        switch (activity.type) {
            case 'message':
                return (

                        <FormattedText
                            text={ activity.text }
                            format={ activity.textFormat }
                            onImageLoad={ otherProps.onImageLoad }
                        />
                        <Attachments
                            attachments={ activity.attachments }
                            attachmentLayout={ activity.attachmentLayout }
                            { ... otherProps }
                        />

                );

            case 'typing':
                return
;
        }
    }
}


text:
namespace pdalboost {} namespace boost = pdalboost; namespace pdalboost { namespace archive {

// explicitly instantiate all required templates

// template class basic_binary_iarchive<mpi::packed_skeleton_iarchive> ;
template class detail::archive_serializer_map<mpi::packed_skeleton_iarchive> ;
template class detail::archive_serializer_map<
  mpi::detail::forward_skeleton_iarchive<
    pdalboost::mpi::packed_skeleton_iarchive, pdalboost::mpi::packed_iarchive> > ;

} } // end namespace pdalboost::archive


text:
layout: post
title: "Beddy-Bye"
excerpt: "Personal"
categories: personal
comments: false
share: true
---

![](http://d28hgpri8am2if.cloudfront.net/book_images/cvr9781416980483_9781416980483_hr.jpg)

I don't get it. I simply do not get it.

Whenever I read a profile, either on-line or on some sort of dating app or whatever, almost everyone describes themselves as 'outdoorsy', 'active', and 'likes to go out and have fun'. And as you can imagine, these types of things are usually done on the weekend.

Say what?

See, this just baffles my brain. I mean you have all of this free time on the weekend to NOT do things like hike, kayak, bike, swim, etc. Why not simply stay in bed and relax?

All of those activities sound so exhausting. I mean to get out of your bed and approach the day always sounds immediately like you are putting yourself into a sub-optimal situation that you were in before (comfy bed > not comfy bed). But to them actually go out and expend energy, voluntarily I may add, by doing....things....sounds awful. It just makes so much more sense to invest more time in your previously comfortable situation, lay in bed in a state of torpor for as long as you can, until you either have to pee or get something to eat.

But nooooooooooooo. These people aren't maximizing the comfort level life at all; instead of enjoying as is, they are selfishly leaving a great warm-bed situation to do things like pick juneberries, climb mountain tops, or whatever people 'do' when they are out of bed.

I used to think that I was the one wasting my day by sleeping in, eating, and watching tv in bed. After reading all of those profiles and seeing how so many people identify themselves in such a different way, I felt like I was in the wrong. So I tried being 'active'. Once. It sucked. It was tiring and I received no reward. I then learned my lesson; it was not me would is in the wrong....it is everyone else in the world.

So my message to all those people who like to 'do things', 'live life', and 'accomplish things' on their weekend.....You are definitely missing out!!


text:
app.controller('MainCtrl', ['$scope', 'ngNotify', 'projectUtils', '$uibModal', 'deleteModal', '$templateCache', '$http', '$timeout',
function($scope, ngNotify, projectUtils, $uibModal, deleteModal, $templateCache, $http, $timeout) {

    $scope.project = {
        loaded: false,
        content: {
            title: null,
            figures: [],
            groups: []
        }
    };

    function exportSomething(type, data) {
        var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream,
            popup = null,
            template = $templateCache.get('dollar_one_cpp.html'),
            filename = 'export';

        if( iOS )
            popup = window.open('/iosadvise', '_blank', null, true);

        if( type === 'figure' )
            filename = slug(data.title, {lower: true}) + '.cpp';
        else if( type === 'group' )
            filename = slug('grupo '+data.id, {lower: true}) + '.cpp';
        else if( type === 'project' )
            filename = slug(data.title, {lower: true}) + '.cpp';
        else if( type === 'project_save' ) {
            filename = $scope.project.content.title + '.json';
            template = null;
        }

        $http({
            url: '/exports',
            method: "POST",
            data: {
                data: data,
                type: type,
                template: template,
                filename: filename
            }
        }).then(function(response) {
            if( !iOS ) {
                angular.element("#downloadFrame").attr({
                    'src': '/download?tmp=' + encodeURI(response.data.filename) + '&filename=' + encodeURI(filename)
                });
            }else {
                $timeout(function() {
                    popup.location.href = '/download?tmp=' + encodeURI(response.data.filename) + '&filename=' + encodeURI(filename);
                }, 3500);
            }

            ngNotify.set('Exportación correcta.');
        }, function(response) {
            ngNotify.set('No se ha podido exportar la selección.', {type: 'error'});
        });
    }

    function loadBgImage(files, scope) {
        if( files.length === 0 || !files[0].type.match('image.*') )
            ngNotify.set('Debes seleccionar una imagen.', {type: 'error'});
        else {
            var file = files[0],
                reader = new FileReader();

            reader.readAsDataURL(file);

            reader.onload = function(evt) {
                scope.backgroundImage = evt.target.result;
                $timeout(function() {
                    scope.backgroundImage = evt.target.result;
                }, 200);
            };
            reader.onerror = function() {
                ngNotify.set('Debes seleccionar una imagen.', {type: 'error'});
            };
        }
    }

    $scope.closeProject = function() {
        $scope.project.loaded = false;
        $scope.project.content = null;
        projectUtils.closeProject();

        document.location.reload();
    };

    $scope.newProject = function() {
        $scope.project.content.title = '';
        $scope.project.content.groups.push({ id: 0, figures: [] });
        $scope.project.loaded = true;
    };

    $scope.hasFigures = function(group) {
        if( !!group )
            return group.figures.length > 0;
        else
            return $scope.project.content.figures.length > 0;
    };

    $scope.hasTitle = function() {
        return $scope.project.content.title.trim() !== '';
    };

	$scope.loadProject = function(files) {
        if( files.length === 0 )
            ngNotify.set('Fichero de proyecto incorrecto.', {type: 'error'});
        else {
            var file = files[0],
                reader = new FileReader();

            reader.readAsText(file, 'UTF-8');

            reader.onload = function(evt) {
                var content = evt.target.result;

                try {
                    projectUtils.loadProject(content);
                    $scope.project.content = projectUtils.returnProjectByGroups();

                    $scope.project.loaded = true;
                    $scope.$apply();
                }catch(ex) {
                    ngNotify.set('Fichero de proyecto incorrecto.', {type: 'error'});
                }
            };
            reader.onerror = function() {
                ngNotify.set('Fichero de proyecto incorrecto.', {type: 'error'});
            };
        }
    };

    $scope.testFigure = function(figure) {
        $uibModal.open({
            templateUrl: 'test_figure.html',
            controller: ['$scope', '$uibModalInstance', function($scope, $uibModalInstance) {
                $scope.cancel = function() {
                    $uibModalInstance.dismiss('cancel');
                };
                $scope.recognitionScore = 0;
                $scope.figure = figure;
            }]
        });
    };

    $scope.editFigure = function(figure) {
        var mainScope = $scope;
        $uibModal.open({
            templateUrl: 'edit_figure.html',
            controller: ['$scope', '$uibModalInstance', function($scope, $uibModalInstance) {
                function initEdition() {
                    $scope.rawPath = null;
                    $scope.drawPath = null;
                    $scope.blockDraw = false;
                    $scope.okEnabled = false;
                    $scope.resetEnabled = false;
                }
                $scope.backgroundImage = null;
                $scope.backgroundSize = 'cover';
                $scope.backgroundColor = 'white';
                $scope.setBackgroundSizeCover = function() {
                    $scope.backgroundSize = 'cover';
                };
                $scope.setBackgroundSizeContain = function() {
                    $scope.backgroundSize = 'contain';
                };
                $scope.setBackgroundColor = function(color) {
                    $scope.backgroundColor = color;
                };
                $scope.loadBgImage = function(files) {
                    loadBgImage(files, $scope);
                };
                $scope.cancel = function() {
                    $uibModalInstance.dismiss('cancel');
                };
                $scope.reset = function() {
                    $scope.drawPath.remove();
                    initEdition();
                };
                $scope.ok = function() {
                    var editedProject = projectUtils.replaceFigureDotsById(figure.id, $scope.rawPath, mainScope.project.content);
                    mainScope.project.loaded = false;
                    mainScope.project.content.groups.length = 0;
                    mainScope.project.content.figures.length = 0;

                    $timeout(function() {
                        angular.forEach(editedProject.groups, function(group) {
                            mainScope.project.content.groups.push(group);
                            angular.forEach(group.figures, function(figure) {
                                mainScope.project.content.figures.push(figure);
                            });
                        });
                        mainScope.project.loaded = true;
                        ngNotify.set('Figura editada correctamente.');
                    }, 100);

                    $uibModalInstance.dismiss('cancel');
                };
                $scope.figure = figure;
                initEdition();
            }]
        });
    };

    $scope.newFigure = function(group) {
        group = group || null;
        var mainScope = $scope;
        $uibModal.open({
            templateUrl: 'new_figure.html',
            controller: ['$scope', '$uibModalInstance', function($scope, $uibModalInstance) {
                if( group === null )
                    $scope.modalTitle = 'en el proyecto';
                else
                    $scope.modalTitle = 'en el grupo #'+group.id;

                var groups = [],
                    lastId = 0;
                angular.forEach(mainScope.project.content.groups, function(group) {
                    groups.push({ id: group.id, name: 'Grupo #'+group.id });
                    lastId = group.id;
                });
                groups.push({ id: lastId + 1, name: 'Nuevo grupo' });

                $scope.selectedGroup = group == null ? null : group.id;
                $scope.title = null;
                $scope.group = {
                    model: group === null ? '0' : group.id,
                    availableOptions: groups
                };

                function initEdition() {
                    $scope.rawPath = null;
                    $scope.drawPath = null;
                    $scope.blockDraw = false;
                    $scope.okEnabled = false;
                    $scope.resetEnabled = false;
                    $scope.titleEnabled = false;
                }
                $scope.backgroundImage = null;
                $scope.backgroundSize = 'cover';
                $scope.backgroundColor = 'white';
                $scope.setBackgroundSizeCover = function() {
                    $scope.backgroundSize = 'cover';
                };
                $scope.setBackgroundSizeContain = function() {
                    $scope.backgroundSize = 'contain';
                };
                $scope.setBackgroundColor = function(color) {
                    $scope.backgroundColor = color;
                };
                $scope.loadBgImage = function(files) {
                    loadBgImage(files, $scope);
                };
                $scope.buttonsEnabled = function() {
                    return $scope.okEnabled && $scope.titleEnabled;
                };
                $scope.titleChange = function() {
                    this.title = this.title === null ? '' : this.title;
                    var title = this.title.trim();
                    $scope.titleEnabled = title !== '';
                };
                $scope.cancel = function() {
                    $uibModalInstance.dismiss('cancel');
                };
                $scope.reset = function() {
                    $scope.drawPath.remove();
                    initEdition();
                    $scope.titleChange();
                };
                $scope.ok = function() {
                    projectUtils.addFigure($scope.title, $scope.rawPath, $scope.group.model, mainScope.project.content);
                    ngNotify.set('Figura creada correctamente.');

                    $uibModalInstance.dismiss('cancel');
                };
                initEdition();
            }]
        });
    };

    $scope.testMultiple = function(type, data) {
        var group = null;
        if( type === 'group' )
            group = data.id;
        else {
            data = $scope.project.content;
        }
        $uibModal.open({
            templateUrl: 'test_multiple.html',
            controller: ['$scope', '$uibModalInstance', function($scope, $uibModalInstance) {
                $scope.cancel = function() {
                    $uibModalInstance.dismiss('cancel');
                };
                if( group === null )
                    $scope.title = 'proyecto';
                else
                    $scope.title = 'grupo #'+group;

                $scope.group = group;
                $scope.recognitionScore = 0;
                $scope.recognitionTitle = 0;
                $scope.figures = data.figures;
            }]
        });
    };

    $scope.deleteFigure = function(figure) {
        deleteModal.show({}, function() {
            var ixToDelete = null;
            angular.forEach($scope.project.content.figures, function(fig, ix) {
                if( fig.id === figure.id ) {
                    ixToDelete = ix;
                    return false;
                }
            });
            if( ixToDelete !== null )
                $scope.project.content.figures.splice(ixToDelete, 1);
            angular.forEach($scope.project.content.groups, function(group, groupix) {
                ixToDelete = null;
                angular.forEach(group.figures, function(fig, ix) {
                    if( fig.id === figure.id ) {
                        ixToDelete = ix;
                        return false;
                    }
                });
                if( ixToDelete !== null )
                    group.figures.splice(ixToDelete, 1);
                if( group.figures.length === 0 )
                    $scope.project.content.groups.splice(groupix, 1);
            });
        });
    };

    $scope.exportFigure = function(figure) {
        exportSomething('figure', figure);
    };

    $scope.exportGroup = function(group) {
        exportSomething('group', group);
    };

    $scope.exportProject = function() {
        exportSomething('project', $scope.project.content);
    };

    $scope.saveProject = function() {
        exportSomething('project_save', projectUtils.saveProject($scope.project.content));
    };

}]);


text:
package org.bouncycastle.asn1.cms.ecc;

import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1OctetString;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.ASN1TaggedObject;
import org.bouncycastle.asn1.DERSequence;
import org.bouncycastle.asn1.DERTaggedObject;
import org.bouncycastle.asn1.cms.OriginatorPublicKey;

public class MQVuserKeyingMaterial
    extends ASN1Object
{
    private OriginatorPublicKey ephemeralPublicKey;
    private ASN1OctetString addedukm;

    public MQVuserKeyingMaterial(
        OriginatorPublicKey ephemeralPublicKey,
        ASN1OctetString addedukm)
    {
        // TODO Check ephemeralPublicKey not null

        this.ephemeralPublicKey = ephemeralPublicKey;
        this.addedukm = addedukm;
    }

    private MQVuserKeyingMaterial(
        ASN1Sequence seq)
    {
        // TODO Check seq has either 1 or 2 elements

        this.ephemeralPublicKey = OriginatorPublicKey.getInstance(
            seq.getObjectAt(0));

        if (seq.size() > 1)
        {
            this.addedukm = ASN1OctetString.getInstance(
                (ASN1TaggedObject)seq.getObjectAt(1), true);
        }
    }

    /**
     * return an MQVuserKeyingMaterial object from a tagged object.
     *
     * @param obj      the tagged object holding the object we want.
     * @param explicit true if the object is meant to be explicitly
     *                 tagged false otherwise.
     * @throws IllegalArgumentException if the object held by the
     *                                  tagged object cannot be converted.
     */
    public static MQVuserKeyingMaterial getInstance(
        ASN1TaggedObject obj,
        boolean explicit)
    {
        return getInstance(ASN1Sequence.getInstance(obj, explicit));
    }

    /**
     * return an MQVuserKeyingMaterial object from the given object.
     *
     * @param obj the object we want converted.
     * @throws IllegalArgumentException if the object cannot be converted.
     */
    public static MQVuserKeyingMaterial getInstance(
        Object obj)
    {
        if (obj == null || obj instanceof MQVuserKeyingMaterial)
        {
            return (MQVuserKeyingMaterial)obj;
        }

        if (obj instanceof ASN1Sequence)
        {
            return new MQVuserKeyingMaterial((ASN1Sequence)obj);
        }

        throw new IllegalArgumentException("Invalid MQVuserKeyingMaterial: " + obj.getClass().getName());
    }

    public OriginatorPublicKey getEphemeralPublicKey()
    {
        return ephemeralPublicKey;
    }

    public ASN1OctetString getAddedukm()
    {
        return addedukm;
    }

    /**
     * Produce an object suitable for an ASN1OutputStream.
     * <pre>
     * MQVuserKeyingMaterial ::= SEQUENCE {
     *   ephemeralPublicKey OriginatorPublicKey,
     *   addedukm [0] EXPLICIT UserKeyingMaterial OPTIONAL  }
     * </pre>
     */
    public ASN1Primitive toASN1Primitive()
    {
        ASN1EncodableVector v = new ASN1EncodableVector();
        v.add(ephemeralPublicKey);

        if (addedukm != null)
        {
            v.add(new DERTaggedObject(true, 0, addedukm));
        }

        return new DERSequence(v);
    }
}


text:
'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated by a tool.
'
'     Changes to this file may cause incorrect behavior and will be lost if
'     the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Option Strict On
Option Explicit On

Partial Public Class DatePickerTest

    '''
    '''form1 control.
    '''
    '''<remarks>
    '''Auto-generated field.
    '''To modify move field declaration from designer file to code-behind file.
    '''</remarks>
    Protected WithEvents form1 As Global.System.Web.UI.HtmlControls.HtmlForm

    '''
    '''DatePicker1 control.
    '''
    '''<remarks>
    '''Auto-generated field.
    '''To modify move field declaration from designer file to code-behind file.
    '''</remarks>
    Protected WithEvents DatePicker1 As Global.JqueryUIControls.DatePicker

    '''
    '''Literal1 control.
    '''
    '''<remarks>
    '''Auto-generated field.
    '''To modify move field declaration from designer file to code-behind file.
    '''</remarks>
    Protected WithEvents Literal1 As Global.System.Web.UI.WebControls.Literal

    '''
    '''Button1 control.
    '''
    '''<remarks>
    '''Auto-generated field.
    '''To modify move field declaration from designer file to code-behind file.
    '''</remarks>
    Protected WithEvents Button1 As Global.System.Web.UI.WebControls.Button
End Class


text:
cask 'unity-linux-support-for-editor' do
  version '2019.1.4f1,ffa3a7a2dd7d'
  sha256 'd96bc4a4c1a0eae4b360e35bd6514768e302b99e47336afe4125d665ce32689e'

  url "https://netstorage.unity3d.com/unity/#{version.after_comma}/MacEditorTargetInstaller/UnitySetup-Linux-Support-for-Editor-#{version.before_comma}.pkg"
  appcast 'https://public-cdn.cloud.unity3d.com/hub/prod/releases-darwin.json'
  name 'Unity Linux Build Support'
  homepage 'https://unity3d.com/unity/'

  depends_on cask: 'unity'

  pkg "UnitySetup-Linux-Support-for-Editor-#{version.before_comma}.pkg"

  uninstall pkgutil: 'com.unity3d.LinuxStandaloneSupport'
end


text:
/* Connected Voice Front End Webserver */

"use strict";

import Restify from 'restify';
import Config from '../config.json';
import Logger from './libs/logger.js';
import Verify from './libs/verify_twilio.js';
import {voiceCallHandler, smsCallHandler} from './libs/route_handlers';

let isDebug = process.env['HOME'] === '/Users/roy' ? true : false;

Logger.WebServerLogger.addSerializers({res: Restify.bunyan.serializers.res});
let log = Logger.WebServerLogger;

let server = Restify.createServer({
	name: 'Front End Webserver',
	log: log
});

server.use(Restify.queryParser());
server.use(Restify.gzipResponse());
server.use(Restify.bodyParser());

server.pre(function (request, reply, next) {
	request.log.info({req: request}, 'IncomingRequest');
	return next();
});

server.on('after', function (request, respose, route) {
	request.log.info({res: respose}, 'OutgoingResponse');
});

/*
* Middleware to verify Twilio message signature
* If successul pass the request to the handlers, if failure return a 403 error
*/
server.use(function(req, reply, next) {
	if (isDebug) {
		log.info('BYPASSING TWILIO SIGNATURE CHECK');
		return next();
	}

	Verify.isValidSignature(req)
	.then(function(isValid) {
		if (isValid) return next();
	})
	.catch(function(err) {
		reply.send(403, 'Failed to verify twilio signature');
		reply.end();
	});
});

server.post('/actions/v0/:id/voice.xml', voiceCallHandler);
server.post('/actions/v0/:id/status', voiceCallHandler);
server.post('/actions/v0/:id/action', voiceCallHandler);
server.post('/actions/v0/:id/action/:index', voiceCallHandler);
server.post('/actions/v0/:id/dequeue', voiceCallHandler);
server.post('/actions/v0/:id/wait/:index', voiceCallHandler);

server.post('/actions/v0/:id/sms.xml', smsCallHandler);

server.listen(9000, function() {
	log.info('ConnectedVoice FrontEnd Server Started');
});


text:
- Original: [Release electron v13.0.0-beta.20 - electron/electron](https://github.com/electron/electron/releases/tag/v13.0.0-beta.20)

Note: This is a beta release. Please file new issues for any bugs you find in it.

This release is published to npm under the beta tag and can be installed via `npm install electron@beta`, or `npm install electron@13.0.0-beta.20`.

> Note: これはベータ リリースです。なにかバグを見つけた場合は issue 報告してください。
>
> 本リリースは `beta` タグの [npm](https://www.npmjs.com/package/electron) として公開しており `npm install electron@beta` または `npm i electron@13.0.0-beta.20` でインストールできます。

リリース ページは存在しているが変更点の言及はなし。欠番と思われる。


text:
/**
 * Cookie related cli commands.
 */
package org.apache.bookkeeper.tools.cli.commands.cookie;


text:
import threading
import datetime
import pytz
import time
import copy
import re
from ibapi.wrapper import EWrapper
from ibapi.client import EClient
from ibapi import contract
from StockValues_Google import StockValues_Google

'''
Created on 11th November 2017

@author: rob dobson
'''

class MarketDataWrapper(EWrapper):
    """
    The wrapper deals with the action coming back from the IB gateway or TWS instance
    We override methods in EWrapper that will get called when this action happens
    """

    def __init__(self):
        pass

class MarketDataClient(EClient):
    """
    The client method
    We don't override native methods, but instead call them from our own wrappers
    """
    def __init__(self, wrapper):
        ## Set up with a wrapper inside
        EClient.__init__(self, wrapper)

class PriceGetter(MarketDataWrapper, MarketDataClient):
    _REQ_ID_PRICE_BASE = 10000000
    _REQ_ID_DETAILS_BASE = 200000
    _nextReqId = 1
    _mapPriceReqIdToStockInfo = {}
    _mapSymbolToPriceReqId = {}
    _mapDetailsReqIdToPriceReqId = {}
    _IB_SymbolMappings = {
        "INDEXSP:.INX": { "symbol": "SPX", "exchange": "CBOE", "currency":"USD", "secType":"IND" },
        "INDEXDJX:.DJI": {"symbol": "INDU", "exchange": "NYSE", "currency": "USD", "secType": "IND"},
        # "INDEXFTSE:UKX": {"symbol": "TICK-LSE", "exchange": "LSE", "currency": "GBP", "secType": "IND"},
        "AV-B.L": {"symbol": "AV.B", "exchange": "LSE", "currency": "GBP", "secType": "STK"},
    }

    def __init__(self, ipaddress, portid, clientid, symbolChangedCallback):
        self._symbolChangedCallback = symbolChangedCallback
        # Initialise both base classes
        MarketDataWrapper.__init__(self)
        MarketDataClient.__init__(self, wrapper=self)
        # Connect using the passed params
        self.connect(ipaddress, portid, clientid)
        # Start a thread which runs the run() function inside EClient in the IB API
        self.getterThread = threading.Thread(target = self.run)
        self.getterThread.start()
        setattr(self, "_thread", self.getterThread)
        # A thread for adding the market requests
        self.requestAddStockList = []
        self.requestRemoveStockList = []
        self.requestStockListChanged = False
        self.requestListLock = threading.Lock()
        self.requestThreadRunning = True
        self.requestThread = threading.Thread(target = self.requestMarketData)
        self.requestThread.start()
        # A lock for the dictionary used to access symbol values
        self.mapsLock = threading.Lock()
        # Start the google getter too
        self._stockValuesFromGoogle = StockValues_Google(self.symbolChangedCallback)

    def error(self, reqId:int, errorCode:int, errorString:str):
        if errorCode == 200 or errorCode == 504: # security not found OR not connected
            with self.mapsLock:
                if reqId in self._mapPriceReqIdToStockInfo:
                    sym = self._mapPriceReqIdToStockInfo[reqId]["ySymbol"]
                    print("StockValues: Symbol not matched", sym, "errorMsg", errorString)
                    self._mapPriceReqIdToStockInfo.pop(reqId)
                    if sym in self._mapSymbolToPriceReqId:
                        self._mapSymbolToPriceReqId.pop(sym)
                    # Add to list of symbols to get from google
                    self._stockValuesFromGoogle.addStock(sym)
                else:
                    print("StockValues: Unknown symbol not found")
        else:
            if reqId == -1:
                print("StockValues: IB INFO msgCode", errorCode, "msgStr", errorString)
            else:
                print("StockValues: IB INFO reqId", reqId, "msgCode", errorCode, "msgStr", errorString)

    def stop(self):
        # Setting this flag avoids calling disconnect() twice (which throws an error)
        self._stockValuesFromGoogle.stop()
        self.done = True
        self.requestThreadRunning = False

    def setStocks(self, stockList):
        # Send full list to google getter (for slow rate updates - e.g. when market closed)
        self._stockValuesFromGoogle.setAllStocks(stockList)
        # Record list to be got
        with self.requestListLock:
            self.requestAddStockList = []
            with self.mapsLock:
                for sym in stockList:
                    if sym not in self._mapSymbolToPriceReqId:
                        self.requestAddStockList.append(sym)
                for sym, reqId in self._mapSymbolToPriceReqId.items():
                    if sym not in stockList:
                        self.requestRemoveStockList.append(sym)
            if len(self.requestAddStockList) > 0 or len(self.requestRemoveStockList) > 0:
                self.requestStockListChanged = True

    def clear(self):
        # Stop getting each symbol from the market data feed
        for reqId, stockItem in self._mapPriceReqIdToStockInfo.items():
            self.cancelMktData(reqId)
        # Lock here as we're changing the mappings
        self.mapsLock.acquire()
        # Clear maps
        self._mapSymbolToPriceReqId.clear()
        self._mapPriceReqIdToStockInfo.clear()
        self._mapDetailsReqIdToPriceReqId.clear()
        # Release lock
        self.mapsLock.release()
        # Set reqId back
        self._nextReqId = 1

    def addYSymbol(self, ySymbol):
        # Check if this stock is already being acquired
        if ySymbol in self._mapSymbolToPriceReqId:
            return
        # Get the contract (stockInfo) in the form needed for interactiveBrokers API
        stockInfo = self.makeStockInfo(ySymbol)
        # Ticker Id is used to communicate with the API - called reqId in the API
        curPriceReqId = self._REQ_ID_PRICE_BASE + self._nextReqId
        stockInfo["priceReqId"] = curPriceReqId
        # Info used by the IB API
        contractInfo = self.getContractInfo(stockInfo)
        stockInfo["contractInfo"] = contractInfo
        # Add to the lookups for the symbol and tickId
        self.mapsLock.acquire()
        self._mapSymbolToPriceReqId[ySymbol] = curPriceReqId
        self._mapPriceReqIdToStockInfo[curPriceReqId] = stockInfo
        self.mapsLock.release()
        # Start the API getting this symbol
        self.reqMktData(curPriceReqId, contractInfo, "", False, False, [])
        # No reuse of tickIds currently
        self._nextReqId += 1

    def removeSymbol(self, ySymbol):
        # Check we have the symbol
        if ySymbol in self._mapSymbolToPriceReqId:
            # Remove from maps
            tickId = self._mapSymbolToPriceReqId[ySymbol]
            self.mapsLock.acquire()
            self._mapSymbolToPriceReqId.pop(ySymbol, None)
            self._mapPriceReqIdToStockInfo.pop(tickId, None)
            self.mapsLock.release()
            # Stop the API getting this symbol
            self.cancelMktData(tickId)

    def makeStockInfo(self, ySymbol):
        nowInUk = datetime.datetime.now(pytz.timezone('GB'))
        # Base record
        stkInfo = {"ySymbol": ySymbol, "symbol": ySymbol, "name": "", "exchange": "SMART",
                    "currency": "USD", "secType": "STK", "includeExpired": False,
                    "failCount": 0, "time": nowInUk}
        if ySymbol in self._IB_SymbolMappings:
            for key, val in self._IB_SymbolMappings[ySymbol].items():
                stkInfo[key] = val
        else:
            # Split YSymbol apart to find underlying exchange and symbol
            # Attempt to handle Yahoo style ticker symbols
            dotPos = ySymbol.rfind(".")
            if dotPos > 0:
                if ySymbol[dotPos+1:] == "L":
                    stkInfo["exchange"] = "LSE"
                    stkInfo["currency"] = "GBP"
                    symb = ySymbol[:dotPos]
                    if len(symb) == 2:
                        symb += "."
                    stkInfo["symbol"] = symb
            else:
                atPos = ySymbol.rfind("@")
                if atPos > 0:
                    stkInfo["primaryExchange"] = ySymbol[atPos+1:]
                    symb = ySymbol[:atPos]
                    if len(symb) == 2:
                        symb += "."
                    stkInfo["symbol"] = symb
        return stkInfo

    def getContractInfo(self, stockInfo):
        c = contract.Contract()
        c.conId = 0
        c.symbol = stockInfo["symbol"]
        c.exchange = stockInfo["exchange"]
        c.currency = stockInfo["currency"]
        c.secType = stockInfo["secType"]
        if "primaryExchange" in stockInfo:
            c.primaryExchange = stockInfo["primaryExchange"]
        c.includeExpired = stockInfo["includeExpired"]
        return c

    def requestMarketData(self):
        while self.requestThreadRunning:
            # Check if there is new data
            if self.requestStockListChanged:
                self.requestStockListChanged = False
                # Add new stocks
                stockList = []
                with self.requestListLock:
                    for stk in self.requestAddStockList:
                        stockList.append(stk)
                # Go through adding stocks
                for stk in stockList:
                    self.addYSymbol(stk)
                # Remove unwanted stocks
                stockList = []
                with self.requestListLock:
                    for stk in self.requestRemoveStockList:
                        stockList.append(stk)
                # Go through adding stocks
                for stk in stockList:
                    self.removeSymbol(stk)
            time.sleep(1)

    def marketDataCallback(self, reqId, tickType, price, attrib):
        pass

    def setValInStockDict(self, sym, elemName, val, stockDict):
        if elemName not in stockDict or stockDict[elemName] is None or stockDict[elemName] != val:
            stockDict[elemName] = val
            return sym
        return None

    def setChangeInStockDict(self, sym, stockDict):
        if "close" in stockDict and stockDict["close"] is not None and "price" in stockDict and stockDict["price"] is not None:
            last = stockDict["price"]
            stockDict["change"] = priceChange = last - stockDict["close"]
            if last != 0:
                stockDict["chg_percent"] = 100 * (priceChange) / last

    def tickPrice(self, reqId, tickType:int, price:float, attrib):
        # Acquire lock on maps
        symbolDataChanged = None
        with self.mapsLock:
            if reqId in self._mapPriceReqIdToStockInfo:
                stockInfo = self._mapPriceReqIdToStockInfo[reqId]
                sym = stockInfo["ySymbol"]
                if tickType == 1:  # bid_price
                    # Not this does not set symbolDataChanged
                    self.setValInStockDict(sym, "bid_price", price, stockInfo)
                elif tickType == 2:  # ask_price
                    # Not this does not set symbolDataChanged
                    self.setValInStockDict(sym, "ask_price", price, stockInfo)
                elif tickType == 4: # last
                    symbolDataChanged = self.setValInStockDict(sym, "price", price, stockInfo)
                    if symbolDataChanged:
                        self.setChangeInStockDict(sym, stockInfo)
                elif tickType == 6:  # high
                    symbolDataChanged = self.setValInStockDict(sym, "high", price, stockInfo)
                elif tickType == 7:  # low
                    symbolDataChanged = self.setValInStockDict(sym, "low", price, stockInfo)
                elif tickType == 9: # close
                    symbolDataChanged = self.setValInStockDict(sym, "close", price, stockInfo)
                    if "price" not in stockInfo or stockInfo["price"] is None:
                        self.setValInStockDict(sym, "price", price, stockInfo)
                    if symbolDataChanged:
                        self.setChangeInStockDict(sym, stockInfo)
                elif tickType == 14:  # open
                    symbolDataChanged = self.setValInStockDict(sym, "open", price, stockInfo)
                    if "price" not in stockInfo or stockInfo["price"] is None:
                        self.setValInStockDict(sym, "price", price, stockInfo)
                else:
                    print("StockValues: Unhandled tickPrice", tickType, "price", price)
                if symbolDataChanged:
                    nowInUk = datetime.datetime.now(pytz.timezone('GB'))
                    stockInfo["time"] = nowInUk
                # Check if detailed info (long name of stock etc) already requested
                if "detailsReqId" not in stockInfo:
                    # Request contract details for this symbol
                    detailsReqId = self._REQ_ID_DETAILS_BASE + self._nextReqId
                    self.reqContractDetails(detailsReqId, stockInfo["contractInfo"])
                    self._mapDetailsReqIdToPriceReqId[detailsReqId] = stockInfo["priceReqId"]
                    stockInfo["detailsReqId"] = detailsReqId
                    self._nextReqId += 1
        # Callback if data has changed
        if symbolDataChanged is not None:
            self._symbolChangedCallback(symbolDataChanged)

    def tickSize(self, reqId:int, tickType:int, size:int):
        # Acquire lock on maps
        symbolDataChanged = None
        with self.mapsLock:
            if reqId in self._mapPriceReqIdToStockInfo:
                stockInfo = self._mapPriceReqIdToStockInfo[reqId]
                sym = stockInfo["ySymbol"]
                if tickType == 0:  # bid_size
                    self.setValInStockDict(sym, "bid_size", size, stockInfo)
                elif tickType == 3:  # ask_size
                    self.setValInStockDict(sym, "ask_size", size, stockInfo)
                elif tickType == 5:  # last_size
                    self.setValInStockDict(sym, "last_size", size, stockInfo)
                elif tickType == 8:  # volume
                    symbolDataChanged = self.setValInStockDict(sym, "volume", size, stockInfo)
                else:
                    print("StockValues: Unhandled tickSize", tickType, "size", size)
                if symbolDataChanged:
                    nowInUk = datetime.datetime.now(pytz.timezone('GB'))
                    stockInfo["time"] = nowInUk
        # Callback if data has changed
        if symbolDataChanged is not None:
            self._symbolChangedCallback(symbolDataChanged)

    def tickString(self, reqId:int, tickType:int, value:str):
        if tickType == 32: # ask_exch
            pass
        elif tickType == 33: # bid_exch
            pass
        elif tickType == 45: # last_timestamp
            pass
        elif tickType == 84: # last_exch
            pass
        else:
            print("StockValues: Unhandled tickString", tickType, "str", value)

    def tickGeneric(self, reqId:int, tickType:int, value:float):
        print("StockValues: Unhandled tickGeneric", tickType, "float", value)

    def tickEFP(self, reqId:int, tickType:int, basisPoints:float,
                formattedBasisPoints:str, totalDividends:float,
                holdDays:int, futureLastTradeDate:str, dividendImpact:float,
                dividendsToLastTradeDate:float):
        print("StockValues: Unhandled tickEFP", tickType, "basisPoints", basisPoints,
                "formattedBasisPoints", formattedBasisPoints, "totalDividends", totalDividends,
                "holdDays", holdDays, "futureLastTradeDate", futureLastTradeDate,
                "dividendImpact", dividendImpact, "dividendsToLastTradeDate", dividendsToLastTradeDate)

    def tickSnapshotEnd(self, reqId:int):
        print("StockValues: Unhandled tickSnapshotEnd", reqId)

    def contractDetails(self, reqId:int, contractDetails):
        self.mapsLock.acquire()
        if reqId in self._mapDetailsReqIdToPriceReqId:
            priceReqId = self._mapDetailsReqIdToPriceReqId[reqId]
            if priceReqId in self._mapPriceReqIdToStockInfo:
                stockInfo = self._mapPriceReqIdToStockInfo[priceReqId]
                stockInfo["name"] = contractDetails.longName
                self._symbolChangedCallback(stockInfo["ySymbol"])
        self.mapsLock.release()

    def contractDetailsEnd(self, reqId:int):
        pass

    def getStockInfoData(self, ySymbol):
        if ySymbol not in self._mapSymbolToPriceReqId:
            return self._stockValuesFromGoogle.getStockInfoData(ySymbol)
        stockInfo = self._stockValuesFromGoogle.getStockInfoData(ySymbol)
        if stockInfo is None:
            stockInfo = {}
        reqId = self._mapSymbolToPriceReqId[ySymbol]
        with self.mapsLock:
            for k,v in self._mapPriceReqIdToStockInfo[reqId].items():
                if k != "price" or v != 0:
                    stockInfo[k] = v
        return stockInfo

    def symbolChangedCallback(self, symbol):
        self._symbolChangedCallback(symbol)

class StockValues_InteractiveBrokers:
    bOnlyUpdateWhileMarketOpen = False

    def __init__(self):
        self.openhour = 8
        self.openmin = 0
        self.closehour = 16
        self.closemin = 30
        self.tradingdow = 0, 1, 2, 3, 4
        self._priceGetter = PriceGetter("127.0.0.1", 4001, 10, self.symbolDataChanged)
        self._dictOfStocksChangedSinceUIUpdate = {}
        self._lockOnStockChangeList = threading.Lock()

    def setStocks(self, stockList):
        # Set list of symbols got by the API
        self._priceGetter.setStocks(stockList)

    def symbolDataChanged(self, symbol):
        with self._lockOnStockChangeList:
            self._dictOfStocksChangedSinceUIUpdate[symbol] = True
            # print("UpdateTo", symbol, "len", len(self._dictOfStocksChangedSinceUIUpdate))

    def getMapOfStocksChangedSinceUIUpdated(self):
        changedStockDict = {}
        with self._lockOnStockChangeList:
            changedStockDict = copy.copy(self._dictOfStocksChangedSinceUIUpdate)
            self._dictOfStocksChangedSinceUIUpdate = {}
        return changedStockDict

    def getStockData(self, sym):
        return self._priceGetter.getStockInfoData(sym)

    def setOnlyUpdateWhenMarketOpen(self, onlyWhenOpen):
        self.bOnlyUpdateWhileMarketOpen = onlyWhenOpen

    def run(self):
        pass

    def stop(self):
        self._priceGetter.stop()

    def getMarketOpenStatus(self):
        nowInUk = datetime.datetime.now(pytz.timezone('GB'))
        open_time = nowInUk.replace( hour=self.openhour, minute=self.openmin, second=0 )
        close_time = nowInUk.replace( hour=self.closehour, minute=self.closemin, second=0 )
        open_day = False
        for day in self.tradingdow:
            if ( day == nowInUk.weekday() ):
                open_day = True
        marketOpen = (nowInUk > open_time) and (nowInUk < close_time) and open_day
        return "Market Open" if marketOpen else "Market Closed"


text:
include_recipe "apache2"
include_recipe "mysql::server"
include_recipe "php"
include_recipe "php::module_mysql"
include_recipe "apache2::mod_php5"

if node.has_key?("ec2")
  server_fqdn = node['ec2']['public_hostname']
else
  server_fqdn = node['fqdn']
end

node.set['wordpress']['db']['password'] = secure_password
node.set['wordpress']['keys']['auth'] = secure_password
node.set['wordpress']['keys']['secure_auth'] = secure_password
node.set['wordpress']['keys']['logged_in'] = secure_password
node.set['wordpress']['keys']['nonce'] = secure_password

remote_file "#{Chef::Config[:file_cache_path]}/wordpress-#{node['wordpress']['version']}.tar.gz" do
  checksum node['wordpress']['checksum']
  source "http://wordpress.org/wordpress-#{node['wordpress']['version']}.tar.gz"
  mode "0644"
end

directory "#{node['wordpress']['dir']}" do
  owner "root"
  group "root"
  mode "0755"
  action :create
  recursive true
end

execute "untar-wordpress" do
  cwd node['wordpress']['dir']
  command "tar --strip-components 1 -xzf #{Chef::Config[:file_cache_path]}/wordpress-#{node['wordpress']['version']}.tar.gz"
  creates "#{node['wordpress']['dir']}/wp-settings.php"
end

execute "mysql-install-wp-privileges" do
  command "/usr/bin/mysql -u root -p\"#{node['mysql']['server_root_password']}\" < #{node['mysql']['conf_dir']}/wp-grants.sql"
  action :nothing
end

template "#{node['mysql']['conf_dir']}/wp-grants.sql" do
  source "grants.sql.erb"
  owner "root"
  group "root"
  mode "0600"
  variables(
    :user     => node['wordpress']['db']['user'],
    :password => node['wordpress']['db']['password'],
    :database => node['wordpress']['db']['database']
  )
  notifies :run, "execute[mysql-install-wp-privileges]", :immediately
end

execute "create #{node['wordpress']['db']['database']} database" do
  command "/usr/bin/mysqladmin -u root -p\"#{node['mysql']['server_root_password']}\" create #{node['wordpress']['db']['database']}"
  not_if do
    require 'mysql'
    m = Mysql.new("localhost", "root", node['mysql']['server_root_password'])
    m.list_dbs.include?(node['wordpress']['db']['database'])
  end
  notifies :create, "ruby_block[save node data]", :immediately unless Chef::Config[:solo]
end

# save node data after writing the MYSQL root password, so that a failed chef-client run that gets this far doesn't cause an unknown password to get applied to the box without being saved in the node data.
unless Chef::Config[:solo]
  ruby_block "save node data" do
    block do
      node.save
    end
    action :create
  end
end

log "Navigate to 'http://#{server_fqdn}/wp-admin/install.php' to complete wordpress installation" do
  action :nothing
end

template "#{node['wordpress']['dir']}/wp-config.php" do
  source "wp-config.php.erb"
  owner "root"
  group "root"
  mode "0644"
  variables(
    :database        => node['wordpress']['db']['database'],
    :user            => node['wordpress']['db']['user'],
    :password        => node['wordpress']['db']['password'],
    :auth_key        => node['wordpress']['keys']['auth'],
    :secure_auth_key => node['wordpress']['keys']['secure_auth'],
    :logged_in_key   => node['wordpress']['keys']['logged_in'],
    :nonce_key       => node['wordpress']['keys']['nonce']
  )
  notifies :write, "log[Navigate to 'http://#{server_fqdn}/wp-admin/install.php' to complete wordpress installation]"
end

apache_site "000-default" do
  enable false
end

web_app "wordpress" do
  template "wordpress.conf.erb"
  docroot "#{node['wordpress']['dir']}"
  server_name server_fqdn
  server_aliases node['wordpress']['server_aliases']
end


text:
@implementation YBookUpdateModel

+ (NSArray *)modelPropertyBlacklist {
    return @[@"updated"];
}

- (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic {
    NSString *time = dic[@"updated"];
    if (![time isKindOfClass:[NSString class]]) return NO;
    _updated = [[YDateModel shareDateModel] dateWithCustomDateFormat:time];
    return YES;
}

@end


text:
'@echo off'
call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
call SysLoadFuncs

/* Prepare the parameters for later use */
parse arg argv
mode = ''
args = ''
opts = ''
cp = ''
lcp = ''

do i = 1 to words(argv)
  param = word(argv, i)
  select
    when param='-lcp' then mode = 'l'
    when param='-cp' | param='-classpath' then mode = 'c'
    when abbrev('-opts', param, 4) then mode = 'o'
    when abbrev('-args', param, 4) then mode = 'a'
  otherwise
    select
      when mode = 'a' then args = space(args param, 1)
      when mode = 'c' then cp = space(cp param, 1)
      when mode = 'l' then lcp = space(lcp param, 1)
      when mode = 'o' then opts = space(opts param, 1)
    otherwise
      say 'Option' param 'ignored'
    end
  end
end

env="OS2ENVIRONMENT"
antconf = _getenv_('antconf' 'antconf.cmd')
runrc = _getenv_('runrc')
interpret 'call "' || runrc || '"' '"' || antconf || '"' 'ETC'
ANT_HOME = value('ANT_HOME',,env)
JAVA_HOME = value('JAVA_HOME',,env)
classpath = value('CLASSPATH',,env)
classes = stream(JAVA_HOME || "\lib\classes.zip", "C", "QUERY EXISTS")
if classes \= '' then classpath = prepend(classpath classes)
classes = stream(JAVA_HOME || "\lib\tools.jar", "C", "QUERY EXISTS")
if classes \= '' then classpath = prepend(classpath classes)

classpath = prepend(classpath ANT_HOME || '\lib\ant-launcher.jar')
'SET CLASSPATH=' || classpath

/* Setting classpathes, options and arguments */
envset = _getenv_('envset')
if cp\=''   then interpret 'call "' || envset || '"' '"; CLASSPATH"' '"' || cp || '"'
if lcp\=''  then interpret 'call "' || envset || '"' '"; LOCALCLASSPATH"' '"' || lcp || '"'
if opts\='' then interpret 'call "' || envset || '"' '"-D ANT_OPTS"' '"' || opts || '"'
if args\='' then interpret 'call "' || envset || '"' '"ANT_ARGS"' '"' || args || '"'

exit 0

addpath: procedure
parse arg path elem
if elem = '' then do
  if path\='' & right(path, 1)\=';' then path = path || ';'
  return path
end
if substr(path, length(path)) = ';' then glue = ''
else glue = ';'
if pos(translate(elem), translate(path)) = 0 then path = path || glue || elem || ';'
return path

prepend: procedure
parse arg path elem
if elem = '' then do
  if path\='' & right(path, 1)\=';' then path = path || ';'
  return path
end
if pos(translate(elem), translate(path)) = 0 then path = elem || ';' || path
return path

_getenv_: procedure expose env
parse arg envar default
if default = '' then default = envar
var = value(translate(envar),,env)
if var = '' then var = default
return var