text:
<?php

return array (
    'apiVersion' => '2012-11-05',
    'endpointPrefix' => 'sqs',
    'serviceFullName' => 'Amazon Simple Queue Service',
    'serviceAbbreviation' => 'Amazon SQS',
    'serviceType' => 'query',
    'resultWrapped' => true,
    'signatureVersion' => 'v4',
    'namespace' => 'Sqs',
    'regions' => array(
        'us-east-1' => array(
            'http' => true,
            'https' => true,
            'hostname' => 'sqs.us-east-1.amazonaws.com',
        ),
        'us-west-1' => array(
            'http' => true,
            'https' => true,
            'hostname' => 'sqs.us-west-1.amazonaws.com',
        ),
        'us-west-2' => array(
            'http' => true,
            'https' => true,
            'hostname' => 'sqs.us-west-2.amazonaws.com',
        ),
        'eu-west-1' => array(
            'http' => true,
            'https' => true,
            'hostname' => 'sqs.eu-west-1.amazonaws.com',
        ),
        'ap-northeast-1' => array(
            'http' => true,
            'https' => true,
            'hostname' => 'sqs.ap-northeast-1.amazonaws.com',
        ),
        'ap-southeast-1' => array(
            'http' => true,
            'https' => true,
            'hostname' => 'sqs.ap-southeast-1.amazonaws.com',
        ),
        'ap-southeast-2' => array(
            'http' => true,
            'https' => true,
            'hostname' => 'sqs.ap-southeast-2.amazonaws.com',
        ),
        'sa-east-1' => array(
            'http' => true,
            'https' => true,
            'hostname' => 'sqs.sa-east-1.amazonaws.com',
        ),
        'cn-north-1' => array(
            'http' => true,
            'https' => true,
            'hostname' => 'sqs.cn-north-1.amazonaws.com.cn',
        ),
        'us-gov-west-1' => array(
            'http' => true,
            'https' => true,
            'hostname' => 'sqs.us-gov-west-1.amazonaws.com',
        ),
    ),
    'operations' => array(
        'AddPermission' => array(
            'httpMethod' => 'POST',
            'uri' => '/',
            'class' => 'Aws\\Common\\Command\\QueryCommand',
            'responseClass' => 'EmptyOutput',
            'responseType' => 'model',
            'parameters' => array(
                'Action' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => 'AddPermission',
                ),
                'Version' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => '2012-11-05',
                ),
                'QueueUrl' => array(
                    'required' => true,
                    'type' => 'string',
                    'location' => 'aws.query',
                ),
                'Label' => array(
                    'required' => true,
                    'type' => 'string',
                    'location' => 'aws.query',
                ),
                'AWSAccountIds' => array(
                    'required' => true,
                    'type' => 'array',
                    'location' => 'aws.query',
                    'sentAs' => 'AWSAccountId',
                    'items' => array(
                        'name' => 'AWSAccountId',
                        'type' => 'string',
                    ),
                ),
                'Actions' => array(
                    'required' => true,
                    'type' => 'array',
                    'location' => 'aws.query',
                    'sentAs' => 'ActionName',
                    'items' => array(
                        'name' => 'ActionName',
                        'type' => 'string',
                    ),
                ),
            ),
            'errorResponses' => array(
                array(
                    'reason' => 'The operation that you requested would violate a limit. For example, ReceiveMessage returns this error if the maximum number of messages inflight has already been reached. AddPermission returns this error if the maximum number of permissions for the queue has already been reached.',
                    'class' => 'OverLimitException',
                ),
            ),
        ),
        'ChangeMessageVisibility' => array(
            'httpMethod' => 'POST',
            'uri' => '/',
            'class' => 'Aws\\Common\\Command\\QueryCommand',
            'responseClass' => 'EmptyOutput',
            'responseType' => 'model',
            'parameters' => array(
                'Action' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => 'ChangeMessageVisibility',
                ),
                'Version' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => '2012-11-05',
                ),
                'QueueUrl' => array(
                    'required' => true,
                    'type' => 'string',
                    'location' => 'aws.query',
                ),
                'ReceiptHandle' => array(
                    'required' => true,
                    'type' => 'string',
                    'location' => 'aws.query',
                ),
                'VisibilityTimeout' => array(
                    'required' => true,
                    'type' => 'numeric',
                    'location' => 'aws.query',
                ),
            ),
            'errorResponses' => array(
                array(
                    'reason' => 'The message referred to is not in flight.',
                    'class' => 'MessageNotInflightException',
                ),
                array(
                    'reason' => 'The receipt handle provided is not valid.',
                    'class' => 'ReceiptHandleIsInvalidException',
                ),
            ),
        ),
        'ChangeMessageVisibilityBatch' => array(
            'httpMethod' => 'POST',
            'uri' => '/',
            'class' => 'Aws\\Common\\Command\\QueryCommand',
            'responseClass' => 'ChangeMessageVisibilityBatchResult',
            'responseType' => 'model',
            'parameters' => array(
                'Action' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => 'ChangeMessageVisibilityBatch',
                ),
                'Version' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => '2012-11-05',
                ),
                'QueueUrl' => array(
                    'required' => true,
                    'type' => 'string',
                    'location' => 'aws.query',
                ),
                'Entries' => array(
                    'required' => true,
                    'type' => 'array',
                    'location' => 'aws.query',
                    'sentAs' => 'ChangeMessageVisibilityBatchRequestEntry',
                    'items' => array(
                        'name' => 'ChangeMessageVisibilityBatchRequestEntry',
                        'type' => 'object',
                        'properties' => array(
                            'Id' => array(
                                'required' => true,
                                'type' => 'string',
                            ),
                            'ReceiptHandle' => array(
                                'required' => true,
                                'type' => 'string',
                            ),
                            'VisibilityTimeout' => array(
                                'type' => 'numeric',
                            ),
                        ),
                    ),
                ),
            ),
            'errorResponses' => array(
                array(
                    'reason' => 'Batch request contains more number of entries than permissible.',
                    'class' => 'TooManyEntriesInBatchRequestException',
                ),
                array(
                    'reason' => 'Batch request does not contain an entry.',
                    'class' => 'EmptyBatchRequestException',
                ),
                array(
                    'reason' => 'Two or more batch entries have the same Id in the request.',
                    'class' => 'BatchEntryIdsNotDistinctException',
                ),
                array(
                    'reason' => 'The Id of a batch entry in a batch request does not abide by the specification.',
                    'class' => 'InvalidBatchEntryIdException',
                ),
            ),
        ),
        'CreateQueue' => array(
            'httpMethod' => 'POST',
            'uri' => '/',
            'class' => 'Aws\\Common\\Command\\QueryCommand',
            'responseClass' => 'CreateQueueResult',
            'responseType' => 'model',
            'parameters' => array(
                'Action' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => 'CreateQueue',
                ),
                'Version' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => '2012-11-05',
                ),
                'QueueName' => array(
                    'required' => true,
                    'type' => 'string',
                    'location' => 'aws.query',
                ),
                'Attributes' => array(
                    'type' => 'object',
                    'location' => 'aws.query',
                    'sentAs' => 'Attribute',
                    'data' => array(
                        'keyName' => 'Name',
                        'valueName' => 'Value',
                    ),
                    'additionalProperties' => array(
                        'type' => 'string',
                        'data' => array(
                            'shape_name' => 'QueueAttributeName',
                        ),
                    ),
                ),
            ),
            'errorResponses' => array(
                array(
                    'reason' => 'You must wait 60 seconds after deleting a queue before you can create another with the same name.',
                    'class' => 'QueueDeletedRecentlyException',
                ),
                array(
                    'reason' => 'A queue already exists with this name. SQS returns this error only if the request includes attributes whose values differ from those of the existing queue.',
                    'class' => 'QueueNameExistsException',
                ),
            ),
        ),
        'DeleteMessage' => array(
            'httpMethod' => 'POST',
            'uri' => '/',
            'class' => 'Aws\\Common\\Command\\QueryCommand',
            'responseClass' => 'EmptyOutput',
            'responseType' => 'model',
            'parameters' => array(
                'Action' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => 'DeleteMessage',
                ),
                'Version' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => '2012-11-05',
                ),
                'QueueUrl' => array(
                    'required' => true,
                    'type' => 'string',
                    'location' => 'aws.query',
                ),
                'ReceiptHandle' => array(
                    'required' => true,
                    'type' => 'string',
                    'location' => 'aws.query',
                ),
            ),
            'errorResponses' => array(
                array(
                    'reason' => 'The receipt handle is not valid for the current version.',
                    'class' => 'InvalidIdFormatException',
                ),
                array(
                    'reason' => 'The receipt handle provided is not valid.',
                    'class' => 'ReceiptHandleIsInvalidException',
                ),
            ),
        ),
        'DeleteMessageBatch' => array(
            'httpMethod' => 'POST',
            'uri' => '/',
            'class' => 'Aws\\Common\\Command\\QueryCommand',
            'responseClass' => 'DeleteMessageBatchResult',
            'responseType' => 'model',
            'parameters' => array(
                'Action' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => 'DeleteMessageBatch',
                ),
                'Version' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => '2012-11-05',
                ),
                'QueueUrl' => array(
                    'required' => true,
                    'type' => 'string',
                    'location' => 'aws.query',
                ),
                'Entries' => array(
                    'required' => true,
                    'type' => 'array',
                    'location' => 'aws.query',
                    'sentAs' => 'DeleteMessageBatchRequestEntry',
                    'items' => array(
                        'name' => 'DeleteMessageBatchRequestEntry',
                        'type' => 'object',
                        'properties' => array(
                            'Id' => array(
                                'required' => true,
                                'type' => 'string',
                            ),
                            'ReceiptHandle' => array(
                                'required' => true,
                                'type' => 'string',
                            ),
                        ),
                    ),
                ),
            ),
            'errorResponses' => array(
                array(
                    'reason' => 'Batch request contains more number of entries than permissible.',
                    'class' => 'TooManyEntriesInBatchRequestException',
                ),
                array(
                    'reason' => 'Batch request does not contain an entry.',
                    'class' => 'EmptyBatchRequestException',
                ),
                array(
                    'reason' => 'Two or more batch entries have the same Id in the request.',
                    'class' => 'BatchEntryIdsNotDistinctException',
                ),
                array(
                    'reason' => 'The Id of a batch entry in a batch request does not abide by the specification.',
                    'class' => 'InvalidBatchEntryIdException',
                ),
            ),
        ),
        'DeleteQueue' => array(
            'httpMethod' => 'POST',
            'uri' => '/',
            'class' => 'Aws\\Common\\Command\\QueryCommand',
            'responseClass' => 'EmptyOutput',
            'responseType' => 'model',
            'parameters' => array(
                'Action' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => 'DeleteQueue',
                ),
                'Version' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => '2012-11-05',
                ),
                'QueueUrl' => array(
                    'required' => true,
                    'type' => 'string',
                    'location' => 'aws.query',
                ),
            ),
        ),
        'GetQueueAttributes' => array(
            'httpMethod' => 'POST',
            'uri' => '/',
            'class' => 'Aws\\Common\\Command\\QueryCommand',
            'responseClass' => 'GetQueueAttributesResult',
            'responseType' => 'model',
            'parameters' => array(
                'Action' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => 'GetQueueAttributes',
                ),
                'Version' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => '2012-11-05',
                ),
                'QueueUrl' => array(
                    'required' => true,
                    'type' => 'string',
                    'location' => 'aws.query',
                ),
                'AttributeNames' => array(
                    'type' => 'array',
                    'location' => 'aws.query',
                    'sentAs' => 'AttributeName',
                    'items' => array(
                        'name' => 'AttributeName',
                        'type' => 'string',
                    ),
                ),
            ),
            'errorResponses' => array(
                array(
                    'reason' => 'The attribute referred to does not exist.',
                    'class' => 'InvalidAttributeNameException',
                ),
            ),
        ),
        'GetQueueUrl' => array(
            'httpMethod' => 'POST',
            'uri' => '/',
            'class' => 'Aws\\Common\\Command\\QueryCommand',
            'responseClass' => 'GetQueueUrlResult',
            'responseType' => 'model',
            'parameters' => array(
                'Action' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => 'GetQueueUrl',
                ),
                'Version' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => '2012-11-05',
                ),
                'QueueName' => array(
                    'required' => true,
                    'type' => 'string',
                    'location' => 'aws.query',
                ),
                'QueueOwnerAWSAccountId' => array(
                    'type' => 'string',
                    'location' => 'aws.query',
                ),
            ),
            'errorResponses' => array(
                array(
                    'reason' => 'The queue referred to does not exist.',
                    'class' => 'QueueDoesNotExistException',
                ),
            ),
        ),
        'ListQueues' => array(
            'httpMethod' => 'POST',
            'uri' => '/',
            'class' => 'Aws\\Common\\Command\\QueryCommand',
            'responseClass' => 'ListQueuesResult',
            'responseType' => 'model',
            'parameters' => array(
                'Action' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => 'ListQueues',
                ),
                'Version' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => '2012-11-05',
                ),
                'QueueNamePrefix' => array(
                    'type' => 'string',
                    'location' => 'aws.query',
                ),
            ),
        ),
        'ReceiveMessage' => array(
            'httpMethod' => 'POST',
            'uri' => '/',
            'class' => 'Aws\\Common\\Command\\QueryCommand',
            'responseClass' => 'ReceiveMessageResult',
            'responseType' => 'model',
            'parameters' => array(
                'Action' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => 'ReceiveMessage',
                ),
                'Version' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => '2012-11-05',
                ),
                'QueueUrl' => array(
                    'required' => true,
                    'type' => 'string',
                    'location' => 'aws.query',
                ),
                'AttributeNames' => array(
                    'type' => 'array',
                    'location' => 'aws.query',
                    'sentAs' => 'AttributeName',
                    'items' => array(
                        'name' => 'AttributeName',
                        'type' => 'string',
                    ),
                ),
                'MaxNumberOfMessages' => array(
                    'type' => 'numeric',
                    'location' => 'aws.query',
                ),
                'VisibilityTimeout' => array(
                    'type' => 'numeric',
                    'location' => 'aws.query',
                ),
                'WaitTimeSeconds' => array(
                    'type' => 'numeric',
                    'location' => 'aws.query',
                ),
            ),
            'errorResponses' => array(
                array(
                    'reason' => 'The operation that you requested would violate a limit. For example, ReceiveMessage returns this error if the maximum number of messages inflight has already been reached. AddPermission returns this error if the maximum number of permissions for the queue has already been reached.',
                    'class' => 'OverLimitException',
                ),
            ),
        ),
        'RemovePermission' => array(
            'httpMethod' => 'POST',
            'uri' => '/',
            'class' => 'Aws\\Common\\Command\\QueryCommand',
            'responseClass' => 'EmptyOutput',
            'responseType' => 'model',
            'parameters' => array(
                'Action' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => 'RemovePermission',
                ),
                'Version' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => '2012-11-05',
                ),
                'QueueUrl' => array(
                    'required' => true,
                    'type' => 'string',
                    'location' => 'aws.query',
                ),
                'Label' => array(
                    'required' => true,
                    'type' => 'string',
                    'location' => 'aws.query',
                ),
            ),
        ),
        'SendMessage' => array(
            'httpMethod' => 'POST',
            'uri' => '/',
            'class' => 'Aws\\Common\\Command\\QueryCommand',
            'responseClass' => 'SendMessageResult',
            'responseType' => 'model',
            'parameters' => array(
                'Action' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => 'SendMessage',
                ),
                'Version' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => '2012-11-05',
                ),
                'QueueUrl' => array(
                    'required' => true,
                    'type' => 'string',
                    'location' => 'aws.query',
                ),
                'MessageBody' => array(
                    'required' => true,
                    'type' => 'string',
                    'location' => 'aws.query',
                ),
                'DelaySeconds' => array(
                    'type' => 'numeric',
                    'location' => 'aws.query',
                ),
            ),
            'errorResponses' => array(
                array(
                    'reason' => 'The message contains characters outside the allowed set.',
                    'class' => 'InvalidMessageContentsException',
                ),
            ),
        ),
        'SendMessageBatch' => array(
            'httpMethod' => 'POST',
            'uri' => '/',
            'class' => 'Aws\\Common\\Command\\QueryCommand',
            'responseClass' => 'SendMessageBatchResult',
            'responseType' => 'model',
            'parameters' => array(
                'Action' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => 'SendMessageBatch',
                ),
                'Version' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => '2012-11-05',
                ),
                'QueueUrl' => array(
                    'required' => true,
                    'type' => 'string',
                    'location' => 'aws.query',
                ),
                'Entries' => array(
                    'required' => true,
                    'type' => 'array',
                    'location' => 'aws.query',
                    'sentAs' => 'SendMessageBatchRequestEntry',
                    'items' => array(
                        'name' => 'SendMessageBatchRequestEntry',
                        'type' => 'object',
                        'properties' => array(
                            'Id' => array(
                                'required' => true,
                                'type' => 'string',
                            ),
                            'MessageBody' => array(
                                'required' => true,
                                'type' => 'string',
                            ),
                            'DelaySeconds' => array(
                                'type' => 'numeric',
                            ),
                        ),
                    ),
                ),
            ),
            'errorResponses' => array(
                array(
                    'reason' => 'Batch request contains more number of entries than permissible.',
                    'class' => 'TooManyEntriesInBatchRequestException',
                ),
                array(
                    'reason' => 'Batch request does not contain an entry.',
                    'class' => 'EmptyBatchRequestException',
                ),
                array(
                    'reason' => 'Two or more batch entries have the same Id in the request.',
                    'class' => 'BatchEntryIdsNotDistinctException',
                ),
                array(
                    'reason' => 'The length of all the messages put together is more than the limit.',
                    'class' => 'BatchRequestTooLongException',
                ),
                array(
                    'reason' => 'The Id of a batch entry in a batch request does not abide by the specification.',
                    'class' => 'InvalidBatchEntryIdException',
                ),
            ),
        ),
        'SetQueueAttributes' => array(
            'httpMethod' => 'POST',
            'uri' => '/',
            'class' => 'Aws\\Common\\Command\\QueryCommand',
            'responseClass' => 'EmptyOutput',
            'responseType' => 'model',
            'parameters' => array(
                'Action' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => 'SetQueueAttributes',
                ),
                'Version' => array(
                    'static' => true,
                    'location' => 'aws.query',
                    'default' => '2012-11-05',
                ),
                'QueueUrl' => array(
                    'required' => true,
                    'type' => 'string',
                    'location' => 'aws.query',
                ),
                'Attributes' => array(
                    'required' => true,
                    'type' => 'object',
                    'location' => 'aws.query',
                    'sentAs' => 'Attribute',
                    'data' => array(
                        'keyName' => 'Name',
                        'valueName' => 'Value',
                    ),
                    'additionalProperties' => array(
                        'type' => 'string',
                        'data' => array(
                            'shape_name' => 'QueueAttributeName',
                        ),
                    ),
                ),
            ),
            'errorResponses' => array(
                array(
                    'reason' => 'The attribute referred to does not exist.',
                    'class' => 'InvalidAttributeNameException',
                ),
            ),
        ),
    ),
    'models' => array(
        'EmptyOutput' => array(
            'type' => 'object',
            'additionalProperties' => true,
        ),
        'ChangeMessageVisibilityBatchResult' => array(
            'type' => 'object',
            'additionalProperties' => true,
            'properties' => array(
                'Successful' => array(
                    'type' => 'array',
                    'location' => 'xml',
                    'sentAs' => 'ChangeMessageVisibilityBatchResultEntry',
                    'data' => array(
                        'xmlFlattened' => true,
                    ),
                    'items' => array(
                        'name' => 'ChangeMessageVisibilityBatchResultEntry',
                        'type' => 'object',
                        'sentAs' => 'ChangeMessageVisibilityBatchResultEntry',
                        'properties' => array(
                            'Id' => array(
                                'type' => 'string',
                            ),
                        ),
                    ),
                ),
                'Failed' => array(
                    'type' => 'array',
                    'location' => 'xml',
                    'sentAs' => 'BatchResultErrorEntry',
                    'data' => array(
                        'xmlFlattened' => true,
                    ),
                    'items' => array(
                        'name' => 'BatchResultErrorEntry',
                        'type' => 'object',
                        'sentAs' => 'BatchResultErrorEntry',
                        'properties' => array(
                            'Id' => array(
                                'type' => 'string',
                            ),
                            'SenderFault' => array(
                                'type' => 'boolean',
                            ),
                            'Code' => array(
                                'type' => 'string',
                            ),
                            'Message' => array(
                                'type' => 'string',
                            ),
                        ),
                    ),
                ),
            ),
        ),
        'CreateQueueResult' => array(
            'type' => 'object',
            'additionalProperties' => true,
            'properties' => array(
                'QueueUrl' => array(
                    'type' => 'string',
                    'location' => 'xml',
                ),
            ),
        ),
        'DeleteMessageBatchResult' => array(
            'type' => 'object',
            'additionalProperties' => true,
            'properties' => array(
                'Successful' => array(
                    'type' => 'array',
                    'location' => 'xml',
                    'sentAs' => 'DeleteMessageBatchResultEntry',
                    'data' => array(
                        'xmlFlattened' => true,
                    ),
                    'items' => array(
                        'name' => 'DeleteMessageBatchResultEntry',
                        'type' => 'object',
                        'sentAs' => 'DeleteMessageBatchResultEntry',
                        'properties' => array(
                            'Id' => array(
                                'type' => 'string',
                            ),
                        ),
                    ),
                ),
                'Failed' => array(
                    'type' => 'array',
                    'location' => 'xml',
                    'sentAs' => 'BatchResultErrorEntry',
                    'data' => array(
                        'xmlFlattened' => true,
                    ),
                    'items' => array(
                        'name' => 'BatchResultErrorEntry',
                        'type' => 'object',
                        'sentAs' => 'BatchResultErrorEntry',
                        'properties' => array(
                            'Id' => array(
                                'type' => 'string',
                            ),
                            'SenderFault' => array(
                                'type' => 'boolean',
                            ),
                            'Code' => array(
                                'type' => 'string',
                            ),
                            'Message' => array(
                                'type' => 'string',
                            ),
                        ),
                    ),
                ),
            ),
        ),
        'GetQueueAttributesResult' => array(
            'type' => 'object',
            'additionalProperties' => true,
            'properties' => array(
                'Attributes' => array(
                    'type' => 'array',
                    'location' => 'xml',
                    'sentAs' => 'Attribute',
                    'data' => array(
                        'xmlFlattened' => true,
                        'xmlMap' => array(
                            'Policy',
                            'VisibilityTimeout',
                            'MaximumMessageSize',
                            'MessageRetentionPeriod',
                            'ApproximateNumberOfMessages',
                            'ApproximateNumberOfMessagesNotVisible',
                            'CreatedTimestamp',
                            'LastModifiedTimestamp',
                            'QueueArn',
                            'ApproximateNumberOfMessagesDelayed',
                            'DelaySeconds',
                            'ReceiveMessageWaitTimeSeconds',
                        ),
                    ),
                    'filters' => array(
                        array(
                            'method' => 'Aws\\Common\\Command\\XmlResponseLocationVisitor::xmlMap',
                            'args' => array(
                                '@value',
                                'Attribute',
                                'Name',
                                'Value',
                            ),
                        ),
                    ),
                    'items' => array(
                        'name' => 'Attribute',
                        'type' => 'object',
                        'sentAs' => 'Attribute',
                        'additionalProperties' => true,
                        'properties' => array(
                            'Name' => array(
                                'type' => 'string',
                            ),
                            'Value' => array(
                                'type' => 'string',
                            ),
                        ),
                    ),
                    'additionalProperties' => false,
                ),
            ),
        ),
        'GetQueueUrlResult' => array(
            'type' => 'object',
            'additionalProperties' => true,
            'properties' => array(
                'QueueUrl' => array(
                    'type' => 'string',
                    'location' => 'xml',
                ),
            ),
        ),
        'ListQueuesResult' => array(
            'type' => 'object',
            'additionalProperties' => true,
            'properties' => array(
                'QueueUrls' => array(
                    'type' => 'array',
                    'location' => 'xml',
                    'sentAs' => 'QueueUrl',
                    'data' => array(
                        'xmlFlattened' => true,
                    ),
                    'items' => array(
                        'name' => 'QueueUrl',
                        'type' => 'string',
                        'sentAs' => 'QueueUrl',
                    ),
                ),
            ),
        ),
        'ReceiveMessageResult' => array(
            'type' => 'object',
            'additionalProperties' => true,
            'properties' => array(
                'Messages' => array(
                    'type' => 'array',
                    'location' => 'xml',
                    'sentAs' => 'Message',
                    'data' => array(
                        'xmlFlattened' => true,
                    ),
                    'items' => array(
                        'name' => 'Message',
                        'type' => 'object',
                        'sentAs' => 'Message',
                        'properties' => array(
                            'MessageId' => array(
                                'type' => 'string',
                            ),
                            'ReceiptHandle' => array(
                                'type' => 'string',
                            ),
                            'MD5OfBody' => array(
                                'type' => 'string',
                            ),
                            'Body' => array(
                                'type' => 'string',
                            ),
                            'Attributes' => array(
                                'type' => 'array',
                                'sentAs' => 'Attribute',
                                'data' => array(
                                    'xmlFlattened' => true,
                                    'xmlMap' => array(
                                        'Policy',
                                        'VisibilityTimeout',
                                        'MaximumMessageSize',
                                        'MessageRetentionPeriod',
                                        'ApproximateNumberOfMessages',
                                        'ApproximateNumberOfMessagesNotVisible',
                                        'CreatedTimestamp',
                                        'LastModifiedTimestamp',
                                        'QueueArn',
                                        'ApproximateNumberOfMessagesDelayed',
                                        'DelaySeconds',
                                        'ReceiveMessageWaitTimeSeconds',
                                    ),
                                ),
                                'filters' => array(
                                    array(
                                        'method' => 'Aws\\Common\\Command\\XmlResponseLocationVisitor::xmlMap',
                                        'args' => array(
                                            '@value',
                                            'Attribute',
                                            'Name',
                                            'Value',
                                        ),
                                    ),
                                ),
                                'items' => array(
                                    'name' => 'Attribute',
                                    'type' => 'object',
                                    'sentAs' => 'Attribute',
                                    'additionalProperties' => true,
                                    'properties' => array(
                                        'Name' => array(
                                            'type' => 'string',
                                        ),
                                        'Value' => array(
                                            'type' => 'string',
                                        ),
                                    ),
                                ),
                                'additionalProperties' => false,
                            ),
                        ),
                    ),
                ),
            ),
        ),
        'SendMessageResult' => array(
            'type' => 'object',
            'additionalProperties' => true,
            'properties' => array(
                'MD5OfMessageBody' => array(
                    'type' => 'string',
                    'location' => 'xml',
                ),
                'MessageId' => array(
                    'type' => 'string',
                    'location' => 'xml',
                ),
            ),
        ),
        'SendMessageBatchResult' => array(
            'type' => 'object',
            'additionalProperties' => true,
            'properties' => array(
                'Successful' => array(
                    'type' => 'array',
                    'location' => 'xml',
                    'sentAs' => 'SendMessageBatchResultEntry',
                    'data' => array(
                        'xmlFlattened' => true,
                    ),
                    'items' => array(
                        'name' => 'SendMessageBatchResultEntry',
                        'type' => 'object',
                        'sentAs' => 'SendMessageBatchResultEntry',
                        'properties' => array(
                            'Id' => array(
                                'type' => 'string',
                            ),
                            'MessageId' => array(
                                'type' => 'string',
                            ),
                            'MD5OfMessageBody' => array(
                                'type' => 'string',
                            ),
                        ),
                    ),
                ),
                'Failed' => array(
                    'type' => 'array',
                    'location' => 'xml',
                    'sentAs' => 'BatchResultErrorEntry',
                    'data' => array(
                        'xmlFlattened' => true,
                    ),
                    'items' => array(
                        'name' => 'BatchResultErrorEntry',
                        'type' => 'object',
                        'sentAs' => 'BatchResultErrorEntry',
                        'properties' => array(
                            'Id' => array(
                                'type' => 'string',
                            ),
                            'SenderFault' => array(
                                'type' => 'boolean',
                            ),
                            'Code' => array(
                                'type' => 'string',
                            ),
                            'Message' => array(
                                'type' => 'string',
                            ),
                        ),
                    ),
                ),
            ),
        ),
    ),
    'iterators' => array(
        'operations' => array(
            'ListQueues' => array(
                'result_key' => 'QueueUrls',
            ),
        ),
    ),
);


text:
<?php

namespace backend\modules\score\controllers;

use backend\controllers\DefaultController as GolfLeagueController;
use common\models\Competition;
use common\models\Registration;
use common\models\search\ScorecardSearch;
use common\models\Scorecard;

use Yii;
use yii\data\ActiveDataProvider;
use yii\data\ArrayDataProvider;
use yii\filters\VerbFilter;
use yii\helpers\Url;
use yii\web\NotFoundHttpException;
use yii\helpers\VarDumper;

/**
 * ReportController implements the score entry actions for Registration model.
 */
class ScorecardController extends GolfLeagueController
{

    /**
     * Lists all Registration models.
     * @return mixed
     */
    public function actionIndex()
    {
        $searchModel = new ScorecardSearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
		$dataProvider->query->andWhere(['not', ['registration_id' => null]]);

        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }

    /**
     * Displays and/or update Score models for a competition.
     * @return mixed
     */
    public function actionCompetition($id)
    {
		$competition = $this->findCompetition($id);

		if($scorecards = Yii::$app->request->post('Scorecard')) {
	        $models = Scorecard::find()->andWhere(['id' => array_keys($scorecards)])->indexBy('id')->all();
	        if (! Scorecard::loadMultiple($models, Yii::$app->request->post()) || ! Scorecard::validateMultiple($models)) {
				$errors = [];
				foreach($models as $model) {
					$errors += $model->errors;
				}
				if(count($errors)>0)
					Yii::$app->session->setFlash('danger', Yii::t('golf', 'Error(s): {0}', [VarDumper::dumpAsString($errors, 4, true)]));
			} else {
				foreach ($models as $model) {
					$model->save();
				}
				Yii::$app->session->setFlash('success', Yii::t('golf', 'Scores updated.'));
			}
		} else { //@todo do not loop on getScorecards twice...
			$scorecards = [];
			foreach($competition->getRegistrations()
								->andWhere(['registration.status' => array_merge([Registration::STATUS_CONFIRMED], Registration::getRegistrationStatusesFor(Registration::SC_POST_COMPETITION))])
								->each() as $registration) {
				$scorecards[] = $registration->getScorecard(); // this will create a scorecard if none exists
			}
		}

        return $this->render('competition', [
			'competition' => $competition,
            'dataProvider' => new ActiveDataProvider([
				'query' => $competition->getScorecards()
			]),
        ]);

    }

    /**
     * Lists all Registration models.
     * @return mixed
     */
    public function actionStatus($id)
    {
        if (($competition = Competition::findOne($id)) === null) {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
        $searchModel = new ScorecardSearch();
        $dataProvider = new ActiveDataProvider([
			'query' => $competition->getScorecards(),
		]);

        return $this->render('status', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
			'competition' => $competition,
        ]);
    }

    /**
     * Displays and/or update Score models for a competition.
     * @return mixed
     */
    public function actionPublish($id)
    {
		$competition = $this->findCompetition($id);

		if($competition->getScorecards()->andWhere(['status' => Scorecard::STATUS_OPEN])->exists() ) {
			Yii::$app->session->setFlash('danger', Yii::t('golf', 'There are missing scorecards.'));
	        return $this->redirect(Url::to(['scorecard/competition', 'id' => $competition->id]));
		} else {
			$competition->status = Competition::STATUS_COMPLETED;
			if($competition->save()) {
				Yii::$app->session->setFlash('success', Yii::t('golf', 'Scorecards published.'));
		        return $this->redirect(Url::to(['competition/rule', 'id' => $competition->id]));
			} else {
				Yii::$app->session->setFlash('danger', Yii::t('golf', 'Could not save competition status.'));
		        return $this->redirect(Url::to(['scorecard/competition', 'id' => $competition->id]));
			}
		}
    }

    /**
     * Finds the Score model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $id
     * @return Score the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findCompetition($id)
    {
        if (($model = Competition::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }

	public function actionComputeNet($id) {
		$competition = $this->findCompetition($id);
		foreach($competition->getScorecards()->each() as $scorecard) {
			$scorecard->compute(Scorecard::COMPUTE_GROSS_TO_NET);
		}
        return $this->redirect(Url::to(['competition', 'id' => $competition->id]));
	}

	/**
	 * Bulk update status or delete for PJAXed gridview.
	 */
    public function actionBulkStatus()
    {
		$ids = (array)Yii::$app->request->post('ids'); // Array or selected records primary keys
		$status = Yii::$app->request->post('status');

	    if (!$ids) // Preventing extra unnecessary query
	        return;

		foreach(Scorecard::find()->andWhere(['id' => $ids])->each() as $r) {
			$r->status = $status;
			$r->save();
        }
    }

}

redpajama_set_name: RedPajamaGithub


text:
"""
Deep MNIST for Experts
Reseau a architecture profonde utilisation de CNN
CNN : Convulution Neural Network
Convulution Neural Network avec 2 couche)
https://www.tensorflow.org/get_started/mnist/pros
"""

from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
import tensorflow as tf

sess = tf.InteractiveSession()

#Nous commencons a construire le graphique de calcul en creant des noeuds pour les images d'entree et les classes de sortie cible.
x = tf.placeholder("float", shape=[None, 784])
y_ = tf.placeholder("float", shape=[None, 10])

#variable initialisation d'un tenseur avec des 0
W = tf.Variable(tf.zeros([784,10]))
b = tf.Variable(tf.zeros([10]))
sess.run(tf.global_variables_initializer())

#Classe de prediction et fonction de perte
print("-- Similaire partie 1 ---")
y = tf.nn.softmax(tf.matmul(x,W) + b)
cross_entropy = -tf.reduce_sum(y_*tf.log(y))
train_step = tf.train.GradientDescentOptimizer(0.01).minimize(cross_entropy)
correct_prediction = tf.equal(tf.argmax(y,1), tf.argmax(y_,1))
accuracy = tf.reduce_mean(tf.cast(correct_prediction, "float"))
for i in range(1000):
  batch = mnist.train.next_batch(50)
  if i%100 == 0:
    train_accuracy = accuracy.eval(feed_dict={x:batch[0], y_: batch[1]})
    print("step %d, training accuracy %g"%(i, train_accuracy))
  train_step.run(feed_dict={x: batch[0], y_: batch[1]})

#nous pouvons evaluer notre precision sur les donnees de test. (92% correct)
print("test accuracy %g"%accuracy.eval(feed_dict={x: mnist.test.images,y_: mnist.test.labels}))

########################################################
##### Creation d'un reseau convolutif multicouches
##### Pour avoir 99% de precision
########################################################
def weight_variable(shape):
  initial = tf.truncated_normal(shape, stddev=0.1)
  return tf.Variable(initial)

def bias_variable(shape):
  initial = tf.constant(0.1, shape=shape)
  return tf.Variable(initial)

# Convolution et Pooling
def conv2d(x, W):
  #Calcule une convolution 2-D avec des tensions d'entree et de filtrage 4-D.
  h_conv0 = tf.nn.conv2d(x, W, strides=[1, 1, 1, 1], padding='SAME')
  return h_conv0

#Creation d'un regroupement maximal, Pooling layer downsamples by 2X.
def max_pool_2x2(x):
  return tf.nn.max_pool(x, ksize=[1, 2, 2, 1],strides=[1, 2, 2, 1], padding='SAME')

#---- I Premiere couche convolutionnelle ----
#Convolution suivie d'un max pooling
#La convolution calculera 32 fonctionnalites pour chaque piece de 5x5. Son tenseur de poids aura une forme de [5, 5, 1, 32]
W_conv1 = weight_variable([5, 5, 1, 32]) #Les deux premieres dimensions sont la taille du patch, voici le nombre de canaux d'entree et le dernier est le nombre de canaux de sortie
b_conv1 = bias_variable([32]) #Biais un composant pour chaque canal de sortie.

#Pour appliquer la couche, nous remodelons d'abord x a un tenseur 4d
#La deuxieme et troisieme dimensions correspondant a la largeur et a la hauteur de l'image, et la dimension finale correspondant au nombre de canaux de couleur.
x_image = tf.reshape(x, [-1,28,28,1]) #-1 = la taille de cette dimension est calculee de sorte que la taille totale reste constante

#Nous transformons ensuite x_image avec le tensor du poids, ajoutons le biais, appliquons la fonction ReLU et max_pool_2x2
h_conv1 = tf.nn.relu(conv2d(x_image, W_conv1) + b_conv1)
#La methode max_pool_2x2 reduira la taille de l'image a 14x14.
h_pool1 = max_pool_2x2(h_conv1) #The pooling ops sweep a rectangular window over the input tensor, computing a reduction operation for each window
#---------------------------------------

#---- II Deuxieme couche convolutionnelle ----
W_conv2 = weight_variable([5, 5, 32, 64])
b_conv2 = bias_variable([64])

h_conv2 = tf.nn.relu(conv2d(h_pool1, W_conv2) + b_conv2)
h_pool2 = max_pool_2x2(h_conv2)
#---------------------------------------

#---- III Couche a connexion dense ----
W_fc1 = weight_variable([7 * 7 * 64, 1024])
b_fc1 = bias_variable([1024])

h_pool2_flat = tf.reshape(h_pool2, [-1, 7*7*64])
h_fc1 = tf.nn.relu(tf.matmul(h_pool2_flat, W_fc1) + b_fc1)

#Pour reduire la surutilisation (overfitting), nous appliquons dropout avant la couche de lecture
keep_prob = tf.placeholder("float") #Placeholder Pour la probabilite que la sortie d'un neurone soit conservee pendant le dropout.
h_fc1_drop = tf.nn.dropout(h_fc1, keep_prob) #Gere automatiquement les sorties de neurones de mise a l'echelle en plus de les masquer, de sorte que le dropout fonctionne juste sans aucune mise a l'echelle supplementaire.

#Couche de lecture
W_fc2 = weight_variable([1024, 10])
b_fc2 = bias_variable([10])

y_conv = tf.nn.softmax(tf.matmul(h_fc1_drop, W_fc2) + b_fc2)

#Apprentissage et Evaluation du model (prend 3 min sur un i7 a 3.2ghz)
#On utilise le parametre supplementaire keep_prob dans feed_dict pour controler le taux dropout
print("-- Amelioration de la precision ---")
cross_entropy = -tf.reduce_sum(y_*tf.log(y_conv))
#Utilisation de l'optimisation ADAM
train_step = tf.train.AdamOptimizer(1e-4).minimize(cross_entropy)
correct_prediction = tf.equal(tf.argmax(y_conv,1), tf.argmax(y_,1))
accuracy = tf.reduce_mean(tf.cast(correct_prediction, "float"))
sess.run(tf.global_variables_initializer())
for i in range(1000):
  batch = mnist.train.next_batch(50)
  if i%100 == 0:
    train_accuracy = accuracy.eval(feed_dict={x:batch[0], y_: batch[1], keep_prob: 1.0})
    print("step %d, training accuracy %g"%(i, train_accuracy))
  train_step.run(feed_dict={x: batch[0], y_: batch[1], keep_prob: 0.5})

print("train accuracy %g"%train_accuracy)
#seg fault
#print("test accuracy %g"%accuracy.eval(feed_dict={x: mnist.test.images, y_: mnist.test.labels, keep_prob: 1.0}))
#print("Precision:", accuracy.eval({x: mnist.test.images, y: mnist.test.labels}))

print("-- mnist.test ---")
for i in range(1000):
  batch = mnist.test.next_batch(200)
  if i%100 == 0:
    test_accuracy = accuracy.eval(feed_dict={x:batch[0], y_: batch[1], keep_prob: 1.0})
    print("step %d, test accuracy %g"%(i, test_accuracy))

print("-- mnist.validation ---")
for i in range(1000):
  batch = mnist.validation.next_batch(200)
  if i%100 == 0:
    test_accuracy = accuracy.eval(feed_dict={x:batch[0], y_: batch[1], keep_prob: 1.0})
    print("step %d, validation accuracy %g"%(i, test_accuracy))


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Acanthocystis petalodes var. macrospora

### Remarks
null


text:
<?php

use Shopavel\Products\Product;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * Create products table migration.
 *
 * @author Laurence Roberts <lsjroberts@outlook.com>
 */
class CreateProductsTable extends Migration {

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create((new Product)->getTable(), function(Blueprint $table)
        {
            $table->increments('id');
            $table->string('name');
            $table->string('slug');
            $table->string('sku');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop((new Product)->getTable());
    }

}


text:
public class Rook extends Piece {
    public Rook(Location location, int color) {
        super(location, color);
    }

    @Override
    boolean move(Location targetLocation, ChessBoard chessBoard) {
        return isMoveAvailable(targetLocation, chessBoard) && super.move(targetLocation, chessBoard);
    }

    @Override
    boolean isMoveAvailable(Location targetLocation, ChessBoard chessBoard) {
        // only horizontal and vertical
        int differenceX = targetLocation.getPositionX() - location.getPositionX();
        int differenceY = targetLocation.getPositionY() - location.getPositionY();
        boolean isMoveHorizontal = differenceY == 0
                && targetLocation.getPositionX() != location.getPositionX();
        boolean isMoveVertical = differenceX == 0
                && targetLocation.getPositionY() != location.getPositionY();
        return super.isMoveAvailable(targetLocation, chessBoard) && (isMoveHorizontal || isMoveVertical);
    }

    @Override
    void print() {
        System.out.print("R");
    }
}


text:
package org.apache.kylin.cache.fs;

public class OnlyForTestCacheFileSystem  extends AbstractCacheFileSystem {

    /**
     * Check whether needs to cache data on the current executor
     */
    @Override
    public boolean isUseLocalCacheForTargetExecs() {
        return true;
    }
}


text:
title: "Documentary: "Come to the Fountain: Homelessness in Macon, Ga.""
excerpt: "For a city with a modest population of around 100,000"
date: 2012-03-31
tags:
  - "MULTIMEDIA"
permalink: /portfolio/MercerCluster.com/
header:
  teaser: /portfolio/fountain.png
sidebar:
  - title: "Role"
    image: /images/portfolio/fountain.png
    image_alt: "logo"
    text: "Designer, Front-End Developer"
  - title: "Responsibilities"
    text: "Reuters try PR stupid commenters should isn't a business model"
gallery:
  - url:
    image_path:
    alt:
  - url:
    image_path:
    alt:
  - url:
    image_path:
    alt:
---

<iframe src="https://player.vimeo.com/video/28446395" width="640" height="472" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>

For a city with a modest population of around 100,000, Macon, Ga. has a stunning 500 to 800 homeless people living on its streets. While numerous aid organizations in the city offer free meals, places to sleep and assistance in the job search, Macon's homeless population lacks a safe and comfortable place to go during the day, leading many of them to congregate at a downtown fountain. This 2011 short-form documentary by Carl V. Lewis and Rachel Finley focuses on the effort to bring a day-shelter to Macon, which would provide the homeless with a roof over their heads and protect them from the the searing southern heat.

{% include gallery caption="" %}


text:
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';

DROP TABLE IF EXISTS `sp_config`;
CREATE TABLE `sp_config` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `key` varchar(128) NOT NULL,
  `value` text NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `sp_log`;
CREATE TABLE `sp_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(16) NOT NULL,
  `msg` text NOT NULL,
  `created_time` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ss_invite_code`;
CREATE TABLE `ss_invite_code` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(128) NOT NULL,
  `user_id` int(11) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--alter table ss_node add column pay_status varchar(127) not null default '0';
DROP TABLE IF EXISTS `ss_node`;
CREATE TABLE `ss_node` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(128) NOT NULL,
  `type` int(3) NOT NULL,
  `server` varchar(128) NOT NULL,
  `method` varchar(64) NOT NULL,
  `custom_method` tinyint(1) NOT NULL DEFAULT '0',
  `traffic_rate` float NOT NULL DEFAULT '1',
  `info` varchar(128) NOT NULL,
  `status` varchar(128) NOT NULL,
  `offset` int(11) NOT NULL DEFAULT '0',
  `sort` int(3) NOT NULL,
  `pay_status` varchar(127) NOT NULL DEFAULT '0',--表示为哪类用户服务
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ss_node_info_log`;
CREATE TABLE `ss_node_info_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `node_id` int(11) NOT NULL,
  `uptime` float NOT NULL,
  `load` varchar(32) NOT NULL,
  `log_time` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- 词表暂时不用 使用下面的表
DROP TABLE IF EXISTS `ss_node_online_log`;
CREATE TABLE `ss_node_online_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `node_id` int(11) NOT NULL,
  `online_user` int(11) NOT NULL,
  `log_time` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- 因为ss-manyuser写这个表的时候需要'存在更新,不存在插入', 所以用node_id做键值. @chenjianglong
DROP TABLE IF EXISTS `ss_node_online_log_noid`;
CREATE TABLE `ss_node_online_log_noid` (
  `node_id` int(11) NOT NULL,
  `server` varchar(128) NOT NULL,
  `online_user` int(11) NOT NULL,
  `log_time` timestamp(14) NOT NULL DEFAULT NOW(),
  PRIMARY KEY (`node_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- 记录(port,node)对儿在线状态. 10000个port*50台机器 = 500000条记录
-- 一个用户也许可也持有多个port的. 所以这里记录只是(node,port)对儿为键值
DROP TABLE IF EXISTS `ss_user_node_online_log_noid`;
CREATE TABLE `ss_user_node_online_log_noid` (
  `port` int(11) NOT NULL,
  `node_id` int(11) NOT NULL,
  `server` varchar(128) NOT NULL,
  `online_status` tinyint(1) NOT NULL,
  `log_time` timestamp(14) NOT NULL DEFAULT NOW(),
  PRIMARY KEY (`port`,`node_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ss_password_reset`;
CREATE TABLE `ss_password_reset` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `email` varchar(32) NOT NULL,
  `token` varchar(128) NOT NULL,
  `init_time` int(11) NOT NULL,
  `expire_time` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--alter table user add column pay_status varchar(3) not null default '0';
--alter table user add column service_deadline timestamp not null default '1987-09-06 11:00:00';
--alter table user add column next_service_deadline timestamp not null default '1987-09-06 11:00:00';
--alter table user add column purchase_time timestamp not null default '2036-09-06 11:00:00';
--alter table user add column reward tinyint(4) not null default '0';
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_name` varchar(128) CHARACTER SET utf8 NOT NULL,
  `email` varchar(32) NOT NULL,
  `pass` varchar(64) NOT NULL,
  `passwd` varchar(16) NOT NULL,
  `t` int(11) NOT NULL DEFAULT '0',
  `u` bigint(20) NOT NULL,
  `d` bigint(20) NOT NULL,
  `transfer_enable` bigint(20) NOT NULL,
  `port` int(11) NOT NULL,
  `switch` tinyint(4) NOT NULL DEFAULT '1',
  `enable` tinyint(4) NOT NULL DEFAULT '1',
  `type` tinyint(4) NOT NULL DEFAULT '1',
  `last_get_gift_time` int(11) NOT NULL DEFAULT '0',
  `last_check_in_time` int(11) NOT NULL DEFAULT '0',
  `last_rest_pass_time` int(11) NOT NULL DEFAULT '0',
  `reg_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `invite_num` int(8) NOT NULL DEFAULT '0',
  `is_admin` int(2) NOT NULL DEFAULT '0',
  `ref_by` int(11) NOT NULL DEFAULT '0',
  `expire_time` int(11) NOT NULL DEFAULT '0',
  `method` varchar(64) NOT NULL DEFAULT 'rc4-md5',
  `is_email_verify` tinyint(4) NOT NULL DEFAULT '0',
  `reg_ip` varchar(128) NOT NULL DEFAULT '127.0.0.1',
  `qq` varchar(31) NOT NULL DEFAULT '',
  `pay_status` varchar(3) NOT NULL DEFAULT '0', --0:从未购买过 1:购买过且在有效期内 2:购买过但是已过期
  `service_deadline` timestamp NOT NULL DEFAULT '1987-09-06 11:00:00', --服务截止时间
  `next_service_deadline` timestamp NOT NULL DEFAULT '1987-09-06 11:00:00', --本月服务截止时间
  `purchase_time` timestamp NOT NULL DEFAULT '2036-09-06 11:00:00', --服务购买时间
  `reward` tinyint(4) NOT NULL DEFAULT '0', --表示该用户的推荐者能否获得奖励, 0:不可以 1:可以
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`),
  UNIQUE KEY `port` (`port`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `user_token`;
CREATE TABLE `user_token` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `token` varchar(256) NOT NULL,
  `user_id` int(11) NOT NULL,
  `create_time` int(11) NOT NULL,
  `expire_time` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `user_traffic_log`;
CREATE TABLE `user_traffic_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `u` bigint(20) NOT NULL,
  `d` bigint(20) NOT NULL,
  `node_id` int(11) NOT NULL,
  `rate` float NOT NULL,
  `traffic` varchar(32) NOT NULL,
  `log_time` timestamp(14) NOT NULL DEFAULT NOW(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- node_load 记载node的累积流量
DROP TABLE IF EXISTS `node_load`;
CREATE TABLE `node_load` (
  `node_id` int(11) NOT NULL,
  `server` varchar(128) NOT NULL,
  `load` bigint(20) NOT NULL,
  `log_time` timestamp(14) NOT NULL DEFAULT NOW(),
  PRIMARY KEY (`node_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- donation 记录用户的捐赠
-- insert into donation (user_name, email, amount, donation_time, pay_way) values ('陈江龙', 'ambjlon@163.com', 30, '2016-07-22 11:00:01','支付宝');
-- 注意 执行上面的插入语句时先执行set names utf8, 这是设置mysql的命令行客户端编码. 否则, 页面的展示中中文会乱码. 同样的, select user表的时候也要set names utf8显示出来的中文才不乱吗.
DROP TABLE IF EXISTS `donation`;
CREATE TABLE `donation` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_name` varchar(128) CHARACTER SET utf8 NOT NULL,
  `email` varchar(32) NOT NULL,
  `amount` float(6,2) NOT NULL,
  `donation_time` timestamp(14) NOT NULL DEFAULT '1987-09-06 11:00:01',
  `pay_way` varchar(32) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--cardnum_passwd 存放代金卡使用情况 涉及交易非常重要.
DROP TABLE IF EXISTS `cardnum_passwd`;
CREATE TABLE `cardnum_passwd` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cardnum` varchar(15)  CHARACTER SET utf8 NOT NULL,
  `passwd` varchar(31)  CHARACTER SET utf8 NOT NULL,
  `amount` float(6,2) NOT NULL,
  `is_consumed` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`cardnum`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- pay_log 存放用户的购买记录
-- insert into pay_log (user_id, pay_time, amount, pay_type, pay_way) values( , , , , );
-- alter table pay_log modify pay_time timestamp(14) NOT NULL DEFAULT '1987-09-06 11:01:00';
DROP TABLE IF EXISTS `pay_log`;
CREATE TABLE `pay_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `pay_time` timestamp(14) NOT NULL DEFAULT '1987-09-06 11:00:01',
  `amount` float(6,2) NOT NULL,
  `pay_type` varchar(31)  CHARACTER SET utf8 NOT NULL, -- A套餐/月付 B套餐/年付等等
  `pay_way` varchar(32) NOT NULL, -- 微信扫码/支付宝扫码(扫码)/代金卡
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


text:
package jsonbroker.library.common.jsonml;

import java.util.Stack;

import jsonbroker.library.common.json.JsonDocumentHandler;
import jsonbroker.library.common.log.Log;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

public class SaxHandler extends DefaultHandler {

	private static final Log log = Log.getLog( SaxHandler.class );

	////////////////////////////////////////////////////////////////////////////
	//
	int _currentIndex;

	////////////////////////////////////////////////////////////////////////////
	//
	StringBuffer _elementText;

	////////////////////////////////////////////////////////////////////////////
	//
	boolean _ignoreEmptyStrings = true;

	////////////////////////////////////////////////////////////////////////////
	//
	Stack<Integer> _indices;

	////////////////////////////////////////////////////////////////////////////
	//
	JsonDocumentHandler _jsonHandler;

	////////////////////////////////////////////////////////////////////////////
	//
	boolean _trim = true;

	public SaxHandler( JsonDocumentHandler jsonHandler ) {
		_elementText = new StringBuffer();
		_indices = new Stack<Integer>();
		_jsonHandler = jsonHandler;
	}

	@Override
	public void characters(char[] ch, int start, int length)
			throws SAXException {

		_elementText.append( ch, start, length);

	}

	private final void flushElementText() {

		if( 0 == _elementText.length() ) {
			return; // no-op
		}

		String string = _elementText.toString();
		_elementText.setLength( 0 ); // http://stackoverflow.com/questions/5192512/how-to-clear-empty-java-stringbuilder

		if( _trim ) {
			string = string.trim();
		}

		if( 0 == string.length() && _ignoreEmptyStrings ) {
			return;
		}

		log.debug( string, "string");

		_jsonHandler.onString( _currentIndex, string );
		_currentIndex++;

	}

	@Override
	public void endElement(String uri, String localName, String qName)
			throws SAXException {

		flushElementText();

		if( 0 == _indices.size() ) {
			_jsonHandler.onArrayDocumentEnd();
		} else {
			_currentIndex = _indices.pop(); // 'pop'
			_jsonHandler.onArrayEnd( _currentIndex );
		}

	}

	@Override
	public void startElement(String uri, String localName, String qName,
			Attributes atts) throws SAXException {

		// root element ?
		if( 0 == _indices.size() ) {

			_jsonHandler.onArrayDocumentStart();

		} else {

			flushElementText();
			_jsonHandler.onArrayStart( _currentIndex );

		}

		// 'push'
		{
			_indices.push( _currentIndex );
			_currentIndex = 0;
		}

		log.debug( qName, "qName" );

		_jsonHandler.onString( _currentIndex, qName );

		_currentIndex = 1;

		int count = atts.getLength();
		if( 0 < count ) {

			_jsonHandler.onObjectStart( _currentIndex );

			for( int i = 0; i < count; i++ ) {
				String attQName = atts.getQName( i );
				String attValue = atts.getValue( i );
				_jsonHandler.onString( attQName, attValue );
			}
			_jsonHandler.onObjectEnd( _currentIndex );
			_currentIndex = 2;
		}
	}

}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

/*============================================================================
**
** Source:  test3.c
**
** Purpose: Tests swscanf with bracketed set strings
**
**
**==========================================================================*/

#include <palsuite.h>
#include "../swscanf.h"

int __cdecl main(int argc, char *argv[])
{
    if (PAL_Initialize(argc, argv))
    {
        return FAIL;
    }

    DoWStrTest(convert("bar1"), convert("%[a-z]"), convert("bar"));
    DoWStrTest(convert("bar1"), convert("%[z-a]"), convert("bar"));
    DoWStrTest(convert("bar1"), convert("%[ab]"), convert("ba"));
    DoWStrTest(convert("bar1"), convert("%[ar1b]"), convert("bar1"));
    DoWStrTest(convert("bar1"), convert("%[^4]"), convert("bar1"));
    DoWStrTest(convert("bar1"), convert("%[^4a]"), convert("b"));

    PAL_Terminate();
    return PASS;
}


text:
var t = require('thunkify');
var _ = require('lodash');
var xml2js = require('xml2js');
var parserFormat = xml2js.Parser({explicitArray: false, normalizeTags: true});
var parsing = t(parserFormat.parseString);
var request = require('koa-request');
var apiKey = '9EF1D1E7D28FDA0B';

module.exports.getSeriesId = function *(uriRequest) {
  	var resultRequest = yield request(uriRequest);
	var resultParser = yield parsing(resultRequest.body);
	if(!resultParser.data.series){
		return this.throw(404, { message: input.showName + ' was not found.' });
	}
	var seriesId = resultParser.data.series.seriesid || resultParser.data.series[0].seriesid;
    return seriesId;
  };

module.exports.getSeriesEpisode =  function *(seriesId) {
  	var uriComplete = 'http://thetvdb.com/api/' + apiKey + '/series/' + seriesId + '/all/en.xml';
  	var resultComplete = yield request(uriComplete);
	var resultParserComplete = yield parsing(resultComplete.body);
	var series = resultParserComplete.data.series;
    var episodes = resultParserComplete.data.episode;

          	var showT = {
				seriesId: series.id,
	            name: series.seriesname,
	            airsDayOfWeek: series.airs_dayofweek,
	            airsTime: series.airs_time,
	            firstAired: series.firstaired,
	            genre: series.genre.split('|').filter(Boolean),
	            network: series.network,
	            overview: series.overview,
	            rating: series.rating,
	            ratingCount: series.ratingcount,
	            runtime: series.runtime,
	            status: series.status,
	            poster: series.poster,
	            episodes: []
          	};
          	_.each(episodes, function(episode) {
            showT.episodes.push({
              season: episode.seasonnumber,
              episodeNumber: episode.episodenumber,
              episodeName: episode.episodename,
              firstAired: episode.firstaired,
              overview: episode.overview
            });
          });
    return showT;
  };


text:
"""
Define utility classes/functions here.
"""

__author__ = 'kensk8er'

class Name2Proba(dict):
    """Data Structure for storing mapping from name to gender probability."""

    def __init__(self):
        super(Name2Proba, self).__init__()
        self._fixed_keys = set()
        self._key2count = dict()

    def __setitem__(self, *args, **kwargs):
        """Override dict.__setitem__()."""
        key = args[0]
        val = args[1]
        assert not kwargs, 'Invalid argument kwargs={}'.format(kwargs)
        assert isinstance(key, str), 'Invalid type for key={}'.format(key)
        assert isinstance(val, float), 'Invalid type for val={}'.format(val)

        if not self.__contains__(key):
            self._key2count[key] = 1
            super(Name2Proba, self).__setitem__(key, val)
        else:
            self._key2count[key] += 1
            if key not in self._fixed_keys:
                # take incremental average
                cur_val = self.__getitem__(key)
                new_val = cur_val + (val - cur_val) / self._key2count[key]
                super(Name2Proba, self).__setitem__(key, new_val)

    def set_fix_item(self, key, val):
        """Set item without taking incremental average and fix the value."""
        super(Name2Proba, self).__setitem__(key, val)
        if key in self._key2count:
            self._key2count[key] += 1
        else:
            self._key2count[key] = 1
        self._fixed_keys.add(key)


text:
package com.github.rahulrvp.android_utils;

import android.text.TextUtils;
import android.util.Log;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Locale;

/**
 * Collection of date and time related util method that we use in day to day programming.
 *
 * @author Rahul Raveendran V P
 *         Created on 30/10/16 @ 3:34 PM
 *         https://github.com/rahulrvp
 */

public class DateTimeUtils {

    private static final String LOG_TAG = "DateTimeUtils";

    /**
     * Provides the difference of 2 calendar objects at specified field, appended with the text given.
     * Ex: if fieldName is Calendar.DAY and fieldString is "Day" and the date difference is 2, then the
     * result of this method would look like this, "2 Days"
     *
     * @param now         Recent Calendar object
     * @param then        Old Calendar object
     * @param fieldInt    Field to compare
     * @param fieldString String to append at the end of diff.
     * @return String with difference appended with fieldString(s)
     */
    @SuppressWarnings("WeakerAccess")
    public static String getDiffString(Calendar now, Calendar then, int fieldInt, String fieldString) {
        String result = "";

        int diff = getDiffInt(now, then, fieldInt);

        if (diff > 0) {
            result = result + diff + " " + ((diff == 1) ? fieldString : fieldString + "s");
        }

        return result;
    }

    /**
     * Compares 2 calendar objects at a given field. Returns the integer value of the difference.
     *
     * @param now      Recent Calendar object
     * @param then     Old Calendar object
     * @param fieldInt Field to compare
     * @return returns the difference between now n then at given field. 0 by default.
     */
    @SuppressWarnings("WeakerAccess")
    public static int getDiffInt(Calendar now, Calendar then, int fieldInt) {
        int result = 0;

        if (now != null && then != null) {
            result = now.get(fieldInt) - then.get(fieldInt);
        }

        return result;
    }

    /**
     * Compares the current time with passed in time in millis and constructs a string with time
     * difference. The result would look like this,
     *

     * a Years, b Months, c Weeks, d Days, e Hours, f Minutes, g Seconds ago
     *
     * @param millis the datetime to compare with current datetime
     * @return TimeAgoString that would looks like,
     * a Years, b Months, c Weeks, d Days, e Hours, f Minutes, g Seconds ago
     */
    public static String getTimeAgoString(long millis) {
        String result = "";

        Calendar now = Calendar.getInstance();

        Calendar then = Calendar.getInstance();
        then.setTimeInMillis(millis);

        if (now.getTimeInMillis() > then.getTimeInMillis()) {

            String yearDiffString = getDiffString(now, then, Calendar.YEAR, "Year");

            if (!TextUtils.isEmpty(yearDiffString)) {
                result += yearDiffString;
            }

            String monthDiffString = getDiffString(now, then, Calendar.MONTH, "Month");

            if (!TextUtils.isEmpty(yearDiffString)) {
                result += " ";
            }

            result += monthDiffString;

            String weekDiffString = getDiffString(now, then, Calendar.WEEK_OF_MONTH, "Week");
            if (!TextUtils.isEmpty(monthDiffString)) {
                result += " ";
            }

            result += weekDiffString;

            String dayDiffString = getDiffString(now, then, Calendar.DAY_OF_MONTH, "Day");
            if (!TextUtils.isEmpty(weekDiffString)) {
                result += " ";
            }

            result += dayDiffString;

            String hourDiffString = getDiffString(now, then, Calendar.HOUR_OF_DAY, "Hour");
            if (!TextUtils.isEmpty(dayDiffString)) {
                result += " ";
            }

            result += hourDiffString;

            String minDiffString = getDiffString(now, then, Calendar.MINUTE, "Minute");
            if (!TextUtils.isEmpty(hourDiffString)) {
                result += " ";
            }

            result += minDiffString;

            String secDiffString = getDiffString(now, then, Calendar.SECOND, "Second");
            if (!TextUtils.isEmpty(minDiffString)) {
                result += " ";
            }

            result += secDiffString;

            if (!TextUtils.isEmpty(result)) {
                result += " ago";
            }
        } else {
            Log.e(LOG_TAG, "Given time is in future.");
        }

        return result;
    }

    /**
     * Provides time ago string based on the date difference.
     *

     * If both timestamp lies in same date, we provide the ago string value in either time or as just "Today"
     * If the date difference is 1, we provide "Yesterday" (Year diff is also taken care of)
     * For all other cases the given timestamp is formatted using the given dateFormat string.
     * If dateFormat is empty or null we will use the format as dd/MM/yyyy hh:mm aa
     *

     * Example outputs:
     * 10 minutes ago
     * An hour ago
     * 2 hours ago
     * Today
     * Yesterday
     * 18/10/2015
     *
     * @param oldTimestampMillis old timestamp (in millis) to compare with current timestamp
     * @param dateFormat         date-format string for formatting old date.
     * @param shouldShowToday    flag to choose between text "Today" or time diff strings.(Ex: 10 minutes ago)
     * @return formatted string tells the difference between given timestamp and current timestamp
     */
    public static String getTimeAgoString(long oldTimestampMillis, String dateFormat, boolean shouldShowToday) {
        return getTimeAgoString(System.currentTimeMillis(), oldTimestampMillis, dateFormat, shouldShowToday);
    }

    /**
     * Provides time ago string based on the date difference.
     *

     * If both timestamp lies in same date, we provide the ago string value in either time or as just "Today"
     * If the date difference is 1, we provide "Yesterday" (Year diff is also taken care of)
     * For all other cases the given timestamp is formatted using the given dateFormat string.
     * If dateFormat is empty or null we will use the format as dd/MM/yyyy hh:mm aa
     *

     * Example outputs:
     * 10 minutes ago
     * An hour ago
     * 2 hours ago
     * Today
     * Yesterday
     * 18/10/2015
     *
     * @param newTimestampMillis new timestamp (in millis) to compare
     * @param oldTimeStampMillis old timestamp (in millis) to compare
     * @param dateFormat         date-format string for formatting old date.
     * @param shouldShowToday    flag to choose between text "Today" or time diff strings.(Ex: 10 minutes ago)
     * @return formatted string tells the difference between given timestamp and current timestamp
     */
    @SuppressWarnings("WeakerAccess")
    public static String getTimeAgoString(long newTimestampMillis, long oldTimeStampMillis, String dateFormat, boolean shouldShowToday) {
        String result = null;

        Calendar today = Calendar.getInstance();
        today.setTimeInMillis(newTimestampMillis);

        Calendar thatDay = Calendar.getInstance();
        thatDay.setTimeInMillis(oldTimeStampMillis);

        if (getDiffInt(today, thatDay, Calendar.YEAR) == 0 && getDiffInt(today, thatDay, Calendar.MONTH) == 0) {
            int dayDiff = getDiffInt(today, thatDay, Calendar.DAY_OF_YEAR);

            // check if it is today
            if (dayDiff == 0) {
                if (shouldShowToday) {
                    result = "Today";
                } else {
                    int hours = getDiffInt(today, thatDay, Calendar.HOUR_OF_DAY);
                    if (hours < 24 && hours > 0) {
                        if (hours == 1) {
                            result = "An hour ago";
                        } else {
                            result = (hours + " hours ago");
                        }
                    } else {
                        int minutes = getDiffInt(today, thatDay, Calendar.MINUTE);
                        if (minutes < 60) {
                            if (minutes == 0) {
                                result = "Just Now";
                            } else {
                                result = (minutes + " minutes ago");
                            }
                        }
                    }
                }
            } else if (dayDiff == 1) {
                // normal yesterday
                result = "Yesterday";
            } else {
                result = formatDate(oldTimeStampMillis, dateFormat, Locale.getDefault());
            }
        } else if (getDiffInt(today, thatDay, Calendar.YEAR) == 1) {
            // new year's yesterday
            int thisMonth = today.get(Calendar.MONTH);
            int thisDate = today.get(Calendar.DAY_OF_MONTH);
            int thatMonth = thatDay.get(Calendar.MONTH);
            int thatDate = thatDay.get(Calendar.DAY_OF_MONTH);

            if (thisMonth == Calendar.JANUARY
                    && thatMonth == Calendar.DECEMBER
                    && thisDate == 1
                    && thatDate == 31) {

                result = "Yesterday";
            } else {
                result = formatDate(oldTimeStampMillis, dateFormat, Locale.getDefault());
            }
        } else {
            result = formatDate(oldTimeStampMillis, dateFormat, Locale.getDefault());
        }

        return result;
    }

    @SuppressWarnings("WeakerAccess")
    public static String formatDate(long timeInMillis, String format, Locale locale) {
        SimpleDateFormat sdf = null;

        if (locale == null) {
            locale = Locale.getDefault();
        }

        if (!TextUtils.isEmpty(format)) {
            try {
                sdf = new SimpleDateFormat(format, locale);
            } catch (Exception e) {
                Log.e(LOG_TAG, e.getMessage());
            }
        }

        if (sdf == null) {
            sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm aa", locale);
        }

        return sdf.format(timeInMillis);
    }
}


text:
//! BiharmonicNormalClusteringCommand definition.
/*!
  \file     BiharmonicNormalClusteringCommand.h
  \author   Tody
  \date     2015/12/22
*/

#ifndef BIHARMONICNORMALCLUSTERINGCOMMAND_H
#define BIHARMONICNORMALCLUSTERINGCOMMAND_H

#include "BaseCommand.h"

//! BiharmonicNormalClusteringCommand implementation.
class BiharmonicNormalClusteringCommand: public BaseCommand
{
public :
    //! Constructor.
    BiharmonicNormalClusteringCommand ( Scene* scene )
        :  BaseCommand ( "Biharmonic Normal Clustering", scene ),
           _showSmoothColor ( "showSmoothColor", true )
    {
        //_params.addBool ( &_showSmoothColor );
    }

    //! Destructor.
    virtual ~BiharmonicNormalClusteringCommand() {}

    void setupImp();
    void doImp ();

private:
    void computeWeightConstraint ( Eigen::SparseMatrix<double>& A, Eigen::MatrixXd& b );

private:
    Eigen::SparseMatrix<double> _M;

    BoolParameter _showSmoothColor;
};

#endif


text:
Avinash Gupta
Avinash Gupta
Avinash Gupta
Back to my Home Page


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

    <title>Scarab: Frequently Asked Questions</title>

    <META NAME="DC.Title" CONTENT="Scarab: Frequently Asked Questions">
    <META NAME="DC.Creator" CONTENT="The Casbah Project">
    <META NAME="DC.Creator.Address" CONTENT="devel@casbah.org">
    <META NAME="DC.Subject" CONTENT="open source communications framework, distributed computing, distributed objects, remote, rpc, xml, scripting, linux, unix, casbah, free, frequently asked questions, faq, corba, xml-rpc, dcom">
    <META NAME="DC.Publisher" CONTENT="The Casbah Project">
    <META NAME="DC.Type" CONTENT="Text.Homepage.Organizational">
    <META NAME="DC.Format" CONTENT="text/html">
    <META NAME="DC.Identifier" CONTENT="http://casbah.org/">

    <link rel="stylesheet" href="http://casbah.org/new_casbah.css" type="text/css" media="screen">

	   Scarab: Frequently Asked Questions

1) General Questions about Scarab

1.1) What is Scarab?

Scarab is a modular set of specifications describing protocols,
 formats, and interfaces for writing distributed applications, with an
 emphasis on low-end and lightweight implementations.  Users can
 combine Scarab module implementations to build a messaging system to
 fit their needs, scaling from very simple messaging or data transfer
 all the way up to where CORBA can take over.  Scarab specifications
 include support for such areas as distributed objects, remote
 procedure calls, XML messages, TCP transport, and HTTP transport.

1.2) Why was Scarab developed?  Why not just use CORBA?

The Casbah Project started developing Scarab to serve as the
communications component of the Casbah application server. The
decision was made to develop Scarab, in favor of using CORBA, because, at
the time, CORBA wasn't generally available in the dynamic, high-level
languages or on some of the platforms that The Casbah Project was
targetting. In addition, because Casbah is an Open Source project, it
needed an Open Source CORBA implementation, while an Open Source CORBA
was hard to come by at the time.

Alternatives were evaluated but none combined enough of the
features that were required for Casbah.

1.3) What languages does Scarab support?

Scarab has features that allow it to support features specific to
individual languages while still able to communicate to others.
Scarab currently has implementations in Java, Python, Perl, and C.
But Scarab can be implemented, and would be helpful, in any number of
other languages like Smalltalk, TCL, Objective C, C++, Common Lisp,
Scheme, Erlang, EcmaScript, PHP, etc.

1.4) Why is Scarab continuing to be developed?

The state of CORBA, particularly Open Source implementations, has
changed since Scarab development was begun.  There are now more
language bindings, more platforms with CORBA support, and even some
support of dynamic languages within CORBA, but CORBA continues to be
out of the reach of many people for many of the same reasons we
initially started Scarab.  Scarab has turned out to be a fairly simple
protocol to implement while at the same time providing a lot of
flexibility and room to scale.

1.5) Is Scarab difficult to use?

No.  In most cases Scarab is as simple to use as the objects or
procedures in the languages you already use.  With Scarab, you create
an object or open a connection to a server and from then on you treat
that object just as you would any other object.  Keep in mind that
network errors can and do happen and that your code has to be able to
handle those errors.

1.6) Is Scarab difficult to implement?

No.  Creating basic clients or servers can often be done anywhere
from an afternoon to a few days depending on how many Scarab features
you wish to use.  Creating richer implementations can take a few
weeks.  We want to develop guides that will help implementors design
their code and provide a development path that allows the developer to
add additional features as they need them.

1.7) What are the protocol layers in Scarab?

A complete Scarab implementation has all the layers below.  Scarab can
also be implemented in stages, see the next question.  In each layer,
some of the implementations are listed, implementations marked with an
asterisk (*) are planned.

    Application       (your application here!)
    Connection        Connection
    Request encoding  LDO-REO, SOAP*, XML-RPC*
    Marshaling        LDO-Marshal, SOAP*
    Serialization     LDO-XML, LDO-Binary, SOAP*, XML-RPC*, WDDX*
    Transport         TCP/IP, HTTP*, SMTP*

2) How does Scarab differ from ...

2.1) CORBA?

Scarab is much simpler to implement

CORBA has a very strict data model that language bindings must
  conform to; Scarab has a loose data model that requires programs to be
  more aware of the types of data being passed

Components of Scarab can be reused in other protocols or
  frameworks

2.2) DCOM?

NEED TEXT HERE

2.3) HTTP-NG?

Scarab is intended to fulfill many of the same goals stated for
HTTP-NG.  HTTP-NG is very similar to CORBA.  Scarab intends to borrows
several features from HTTP-NG, such as distributed garbage collection
and multiplexing protocol.

2.4) Java RMI, Python's PyRPC, Perl's RPC::pServer and
RPC::pClient, and other language-specific protocols?

These protocols are tied very closely to their respective
languages, Scarab is not tied to any particular language.  Scarab was
inspired by Apple's (nee NeXT's) Portable Distributed Objects (PDO)
and Python's pickle.py.

2.5) SOAP and XML-RPC?

SOAP and XML-RPC are protocols.  Scarab supports SOAP and XML-RPC.
Scarab extends SOAP and XML-RPC to support multiple transports,
multiple messages per session, and other features.

3) Scarab Components

3.1) Don't LDO-XML and LDO-Binary serialization need more data
types?

Scarab's XML and binary reference serializations were designed with
the assumption that we don't know what datatypes you really need.
Rather than define a small set of datatypes that may or may not fit
your needs, we've used some of the most basic data types available and
then supported a ``type'' attribute that lets you declare a specific
type.  LDO-Types defines common values for type attributes supported
by Scarab applications.  If it's your application that is used for
both client and server you can also define your own data types.
Scarab can also use other serialization formats that provide more
specific data types.

3.2) What is an ``atom''?  Why did you pick ``atom''?

An atom is a simple, basic data type like a number, a string, or a
date, in contrast to a complex, compound, or aggregate data type like
a list, dictionary, record, or structure.

``atom'' or ``atomic'' is the term most commonly used by designers
if and when they refer to a value or object that is not composed of or
an aggregate of other values or objects.  Many descriptions of
computer languages, protocols, or formats don't distinguish between
simple or complex objects or don't provide a specific term for
non-aggregate types (they simply call them ``objects'', for example).
The term ``scalar'' is a close second to ``atom'' in terms of common
usage.

Alternatives included ``value'', ``data'', ``datum'', ``scalar'',
and ``primitive''.  ``value'', ``data'', and ``datum'' all seemed
wrong because lists and dicts are also values, data, or datum.
``scalar'' seems too closely tied to numeric or quantity values.
``primitive'' is often associated with implementation in a lower-level
language (like C or assembler).


text:
package net.minidev.json.test;

import junit.framework.TestCase;
import net.minidev.json.JSONArray;
import net.minidev.json.JSONObject;
import net.minidev.json.JSONValue;

public class TestMisc extends TestCase {

	public void testIssue23() throws Exception {
		String s = JSONValue.toJSONString(new int[] { 1, 2, 50, 1234, 10000 });
		assertEquals("[1,2,50,1234,10000]", s);
	}

	public void testEmptyStrict() throws Exception {
		String s = "{\"key1\":\"v1\", \"key2\":{}, \"key3\":[]}";
		JSONObject o = (JSONObject) JSONValue.parseStrict(s);

		assertEquals(o.get("key1"), "v1");
		assertEquals(((JSONObject) o.get("key2")).size(), 0);
		assertEquals(((JSONArray) o.get("key3")).size(), 0);
	}

	public void testBool() throws Exception {
		String s = "{\"key1\":\"v1\", \"key2\":{}, \"key3\":[]}";
		JSONObject o = (JSONObject) JSONValue.parseWithException(s);

		assertEquals(o.get("key1"), "v1");
		assertEquals(((JSONObject) o.get("key2")).size(), 0);
		assertEquals(((JSONArray) o.get("key3")).size(), 0);
	}

	public void testInt() throws Exception {
		String s = "123";
		Object o = JSONValue.parseWithException(s);
		assertEquals(o, 123);
	}

	public void testIntOffset() throws Exception {
		String s = "AA 123";
		Object o = JSONValue.parseWithException(s.getBytes(), 3, s.length());
		assertEquals(o, 123);
	}

	public void testFloat() throws Exception {
		String s = "123.5";
		Object o = JSONValue.parseWithException(s);
		assertEquals(o, Double.valueOf(123.5));
	}

	public void testFloat2() throws Exception {
		String s = "123.5E1";
		Object o = JSONValue.parseWithException(s);
		assertEquals(o, Double.valueOf(1235));
	}

	public void testFloat3() throws Exception {
		String s = "123..5";
		Object o = JSONValue.parseWithException(s);
		assertEquals(o, "123..5");
	}

	public void testFloat4() throws Exception {
		String s = "123é.5";
		Object o = JSONValue.parseWithException(s);
		assertEquals(o, 123);
	}

}


text:
$(function () {
  'use strict';

  window.List = window.List || {};

  List.setData = function (widget, data) {
    var list = widget.find('.list-nostyle');
    list.empty();
    $.each(data, function (key, value) {
      var li = $('<li/>').appendTo(list);
      $('<span>' + key + '</span><span/>').addClass('label').appendTo(li);
      $('<span>' + value + '<span/>').addClass('value').appendTo(li);
    });

    widget.find('.updated-at').html('Last updated at ' + new Date().toLocaleTimeString());
  };
});


text:
/* http://james.padolsey.com/javascript/special-scroll-events-for-jquery/ */

(function(){

    var special = jQuery.event.special,
        uid1 = 'D' + (+new Date()),
        uid2 = 'D' + (+new Date() + 1);

    special.scrollstart = {
        setup: function() {

            var timer,
                handler =  function(evt) {

                    var _self = this,
                        _args = arguments;

                    if (timer) {
                        clearTimeout(timer);
                    } else {
                        evt.type = 'scrollstart';
                        jQuery.event.handle.apply(_self, _args);
                    }

                    timer = setTimeout( function(){
                        timer = null;
                    }, special.scrollstop.latency);

                };

            jQuery(this).bind('scroll', handler).data(uid1, handler);

        },
        teardown: function(){
            jQuery(this).unbind( 'scroll', jQuery(this).data(uid1) );
        }
    };

    special.scrollstop = {
        latency: 300,
        setup: function() {

            var timer,
                    handler = function(evt) {

                    var _self = this,
                        _args = arguments;

                    if (timer) {
                        clearTimeout(timer);
                    }

                    timer = setTimeout( function(){

                        timer = null;
                        evt.type = 'scrollstop';
                        jQuery.event.handle.apply(_self, _args);

                    }, special.scrollstop.latency);

                };

            jQuery(this).bind('scroll', handler).data(uid2, handler);

        },
        teardown: function() {
            jQuery(this).unbind( 'scroll', jQuery(this).data(uid2) );
        }
    };

})();


text:
========
Packages
========

.. note:: It is planned to distribute `acme` and plugins separately as
  described in `#358`_. For the time being those packages are bundled
  together into a single repo, and single documentation.

.. _`#358`: https://github.com/letsencrypt/letsencrypt/issues/358

.. toctree::
   :glob:

   pkgs/**


text:
package org.conqat.lib.cqddl.parser;

import java.util.HashMap;
import java.util.Map;

import org.conqat.lib.cqddl.function.ICQDDLFunction;

import org.conqat.lib.commons.assertion.CCSMPre;

/**
 * Parameter object for storing all relevant option needed for parsing a CQDDL
 * term. This includes key abbreviations and registered functions.
 *
 * @author hummelb
 * @author $Author: deissenb $
 * @version $Rev: 34252 $
 * @levd.rating YELLOW Hash: B41886DD4739EFA1C11D66E153ADF3BB
 */
public class CQDDLParsingParameters {

	/** Registered functions. */
	/* package */final Map<String, ICQDDLFunction> functions = new HashMap<String, ICQDDLFunction>();

	/** Abbreviations used for keys. */
	/* package */final Map<String, String> keyAbbreviations = new HashMap<String, String>();

	/**
	 * Registers a function with the parser. The function name may not have been
	 * already used.
	 */
	public void registerFunction(String name, ICQDDLFunction function) {
		CCSMPre.isNotNull(function);
		CCSMPre.isTrue(!functions.containsKey(name), "Name " + name
				+ " alread in use!");
		functions.put(name, function);
	}

	/** Adds a key abbreviation. */
	public void addKeyAbbreviation(String shortName, String longName) {
		CCSMPre.isNotNull(shortName);
		CCSMPre.isNotNull(longName);
		CCSMPre.isTrue(!keyAbbreviations.containsKey(shortName),
				"Abbreviation for " + shortName + " alread in use!");
		keyAbbreviations.put(shortName, longName);
	}

}