text:
require 'open-uri'

# driver or module for importing events from ical feeds
module Ical
  # nuber of months in the future that we generate unbound repating events for
  MONTHS_ADVANCE_FOR_REPATING = 12

  class << self
    attr_accessor :log
    # returns an array of unsaved Event objects
    def get_events
      events = []
      @log ||= Rails.logger
      Appsterdam::Application.ical_subscriptions.each do |options|
        @log.info "getting events from #{options[:url]}"
        components = parse_ical(options[:url])
        events.concat(extract_events(components.first))
      end
      @log.info "done importing iCal events."

      events
    end

    private

    # takes a RiCal::Component::Calendar and extracts an array of native Event objects from it
    def extract_events(calendar)
      events = []
      rep_until = Date.today >> MONTHS_ADVANCE_FOR_REPATING

      calendar.events.each do |event_entry|
        # for performance reasons, create event once and then clone per occurrence
        event      = Event.build_from(Adapter.new(event_entry))
        occurences = event_entry.occurrences(:before => rep_until)
        # again, for performance and api limit reasons, get geo coordinates for repeating
        # events only once
        event.get_geo_coordinates #if occurences.size > 1

        occurences.each do |ical_event|
          adapter = Adapter.new(ical_event)
          occurrence = event.clone
          occurrence.starts_at = adapter.starts_at
          occurrence.ends_at   = adapter.ends_at
          events << occurrence
        end
      end

      @log.info "got #{events.size} events"
      events
    end

    def parse_ical(url)
      RiCal.parse get_ical_io(url)
    end

    def get_ical_io(url)
      open url
    rescue URI::InvalidURIError
      @log.fatal "invalid ical url: #{url}"
    rescue OpenURI::HTTPError
      @log.fatal "unable to retreive ical data (http error) from url #{url}"
    end
  end

  class Adapter
    def initialize(ri_cal_event)
      @event = ri_cal_event
    end

    # Mapping from our Event model's attributes to RiCal Properties.
    # Extra mappings can be defined here. For more complex ones, you can define
    # an instance method
    ATTR_MAPPING = {
      :name             => :summary,
      :description      => :description,
      :starts_at        => :dtstart,
      :ends_at          => :dtend,
      :url              => :url
    }

    ATTR_MAPPING.each do |native, ri_cal|
      define_method native do
        @event.send(ri_cal)
      end
    end

    def location
      @event.location.to_s.strip if  @event.location
    end
  end
end


text:
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>

<link href="doc-style.css" type="text/css" rel="StyleSheet">

Managed Object Types	Data Object Types	All Properties	All Methods

Managed Object -
						HostLocalAuthentication

Extends

HostAuthenticationStore

Since

vSphere API 4.1

Managed Object Description

         The HostLocalAuthentication managed object represents
  local authentication for user accounts on an ESX host.

Properties

	          Name

	          Type

	          Description

None

						Properties inherited from HostAuthenticationStore

info

Methods

				          Methods defined in this Managed Object

							None

            Methods inherited from HostAuthenticationStore

None

Top of page

Managed Object Types	Data Object Types	All Properties	All Methods

redpajama_set_name: RedPajamaGithub


text:
title: 'Variety: Netflix, Alan Yang Developing Min Jin Lee's 'Free Food for Millionaires'
  for TV'
date: 2021-01-27T00:50:11-05:00
link_to_original: https://variety.com/2021/tv/news/min-jin-lee-free-food-millionaires-alan-yang-netflix-1234892665/
images: []
tags: []
categories: []
description: ''

---
> "'Tigertail' filmmaker and 'Master of None' co-creator [Alan Yang](https://variety.com/t/alan-yang/) is teaming up with author Min Jin Lee to adapt her critically acclaimed 2007 novel '[Free Food for Millionaires](https://variety.com/t/free-food-for-millionaires/)' as a television series, _Variety_ has learned exclusively. Lee is penning the screen adaptation, with Yang serving as non-writing executive producer."


text:
module ActiveModelSerializers
  module Adapter
    class Json < Base
      def serializable_hash(options = nil)
        options ||= {}
        serialized_hash = { root => Attributes.new(serializer, instance_options).serializable_hash(options) }
        self.class.transform_key_casing!(serialized_hash, options)
      end
    end
  end
end


text:
const Sequelize = require('sequelize');
const db = new Sequelize(
  process.env.DATABASE_URL || 'postgres://localhost:5432/escapehatch', {
    logging: false
  }
);
module.exports = db;


text: The jobs must run on time.


text:
/*
 * container.js: Rackspace Object Storage Container
 *
 * (C) 2013 Rackspace, Ken Perkins
 * MIT LICENSE
 *
 */

var util = require('util'),
    base = require('../../openstack/storage/container'),
    _ = require('underscore');

var Container = exports.Container = function Container(client, details) {
  base.Container.call(this, client, details);
};

util.inherits(Container, base.Container);

Container.prototype.refreshCdnDetails = function (callback) {
  var self = this;

  this.client._getCdnContainerDetails(this, function (err, details) {
    if (err) {
      return callback(err);
    }

    self._setProperties(details);

    return callback(err, self);
  });
};

Container.prototype.enableCdn = function (callback) {
  this.client.setCdnEnabled(this, callback);
};

Container.prototype.disableCdn = function (callback) {
  this.client.setCdnEnabled(this, false, callback);
};

Container.prototype.updateCdn = function (options, callback) {
  this.client.updateCdnContainer(this, options, callback);
};

Container.prototype.setStaticWebsite = function (options, callback) {
  this.client.setStaticWebsite(this, options, callback);
};

Container.prototype.removeStaticWebsite = function (callback) {
  this.client.removeStaticWebsite(this, callback);
};

Container.prototype._setProperties = function (details) {
  this.cdnEnabled = details.cdnEnabled || this.cdnEnabled || false;
  this.cdnUri = details.cdnUri || this.cdnUri;
  this.cdnSslUri = details.cdnSslUri || this.cdnSslUri;
  this.cdnStreamingUri = details.cdnStreamingUri || this.cdnStreamingUri;
  this.cdniOSUri = details.cdniOSUri || this.cdniOSUri;
  Container.super_.prototype._setProperties.call(this, details);
};

Container.prototype.toJSON = function () {
  return _.pick(this, ['name', 'ttl', 'logRetention', 'count',
    'bytes', 'cdnEnabled', 'cdnUri', 'cdnSslUri', 'cdnStreamingUri',
    'cdniOSUri', 'metadata']);
};


text:
{% extends "admin/base_site.html" %}
{% load i18n admin_urls static %}

{% block extrahead %}
    {{ block.super }}
    {{ media }}

{% endblock %}

{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} delete-confirmation{% endblock %}

{% block breadcrumbs %}

{% translate 'Home' %}
› {{ opts.app_config.verbose_name }}
› {{ opts.verbose_name_plural|capfirst }}
› {{ object|truncatewords:"18" }}
› {% translate 'Delete' %}

{% endblock %}

{% block content %}
{% if perms_lacking %}

{% blocktranslate with escaped_object=object %}Deleting the {{ object_name }} '{{ escaped_object }}' would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:{% endblocktranslate %}

    {% for obj in perms_lacking %}

{{ obj }}

    {% endfor %}

{% elif protected %}

{% blocktranslate with escaped_object=object %}Deleting the {{ object_name }} '{{ escaped_object }}' would require deleting the following protected related objects:{% endblocktranslate %}

    {% for obj in protected %}

{{ obj }}

    {% endfor %}

{% else %}

{% blocktranslate with escaped_object=object %}Are you sure you want to delete the {{ object_name }} "{{ escaped_object }}"? All of the following related items will be deleted:{% endblocktranslate %}

    {% include "admin/includes/object_delete_summary.html" %}

{% translate "Objects" %}

{{ deleted_objects|unordered_list }}

    <form method="post">{% csrf_token %}

    <input type="hidden" name="post" value="yes">
    {% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1">{% endif %}
    {% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}">{% endif %}
    <input type="submit" value="{% translate 'Yes, I'm sure' %}">
    {% translate "No, take me back" %}

    </form>
{% endif %}
{% endblock %}


text:
require "spec_helper"
require "vetting"

describe "#contains_price?" do

  it "should work" do
    expect(Vetting.contains_price?("only £ 12.04 today")).to_not be_nil
    expect(Vetting.contains_price?("£ 13")).to_not be_nil
    expect(Vetting.contains_price?("£12.04")).to_not be_nil
    expect(Vetting.contains_price?("price: £12")).to_not be_nil
    expect(Vetting.contains_price?("foobar")).to be_nil
  end
end


text:
[![Build Status](https://img.shields.io/travis/phansible/phansible/master.svg?style=flat-square)](https://travis-ci.com/phansible/phansible)
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/phansible/phansible/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/phansible/phansible/?branch=master)
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/phansible/phansible/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/phansible/phansible/?branch=master)
[![License](https://img.shields.io/github/license/phansible/phansible.svg?style=flat-square)](https://github.com/phansible/phansible)

[Phansible](http://phansible.com) is a simple generator for Vagrant projects, targeting PHP development environments, using Ansible as Provisioner.

It was inspired by [PuPHPet](http://puphpet.com).

The project is built on top of [Silex](http://silex.sensiolabs.org/), using [Flint](http://flint.readthedocs.org/).

## Contributions

Contributions are always welcome, please have a look at our issues to see if there's something you could help with.
You can also join us on [gitter](https://gitter.im/phansible/phansible).

## TO DO

- Deprecate 1.0 branch and put master into production
- CI our generated roles (@naxhh is working on this)
- API for generating roles outside the Web (@erikaheidi is working on this)
- New technologies (request for your favourite ones!)
- More documentation on how to customize things
- Take a look at our [issues](https://github.com/phansible/phansible/issues).

## Setup

- Clone the repo: ```git clone https://github.com/Phansible/phansible.git```
- Go into the phansible folder ```cd phansible/```
- Install the dependencies with [composer](https://getcomposer.org/): ```php composer install```
- Run the php built in server: ```php -S 0.0.0.0:8080 -t public/```
- You can now go on [http://localhost:8080](http://localhost:8080) to see your modification.

As an alternative, you can also use the included Vagrant setup (requires Ansible).

## Tests
To run the tests just do:
```
 ./vendor/bin/phpunit
```

## Code style
To check the code style just do:
```
 ./vendor/bin/phpcs --standard=psr2 ./src
 ./vendor/bin/phpmd src/ text codesize,controversial,design,naming,unusedcode
```

When no errors appear you are ready to push your commits!


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.

-->

<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
    <comment>Views</comment>
    <entry key="user_search">
 CREATE VIEW user_search AS

 SELECT u.id as user_id, u.* FROM SyncopeUser u
    </entry>
    <entry key="user_search_attr">
CREATE VIEW user_search_attr AS

SELECT ua.owner_id AS user_id,
ua.schema_name AS schema_name,
uav.booleanvalue AS booleanvalue,
uav.datevalue AS datevalue,
uav.doublevalue AS doublevalue,
uav.longvalue AS longvalue,
uav.stringvalue AS stringvalue
FROM UAttrUniqueValue uav, UAttr ua
WHERE uav.attribute_id = ua.id

UNION ALL

SELECT ua.owner_id AS user_id,
ua.schema_name AS schema_name,
uav.booleanvalue AS booleanvalue,
uav.datevalue AS datevalue,
uav.doublevalue AS doublevalue,
uav.longvalue AS longvalue,
uav.stringvalue AS stringvalue
FROM UAttrValue uav, UAttr ua
WHERE uav.attribute_id = ua.id

UNION ALL

SELECT u.id AS user_id,
USchema.name AS schema_name,
NULL AS booleanvalue,
NULL AS datevalue,
NULL AS doublevalue,
NULL AS longvalue,
NULL AS stringvalue
FROM SyncopeUser u CROSS JOIN USchema
LEFT OUTER JOIN UAttr ua ON (USchema.name = ua.schema_name AND ua.owner_id = u.id)
WHERE ua.id IS NULL
    </entry>
    <entry key="user_search_membership">
CREATE VIEW user_search_membership AS

SELECT m.syncopeuser_id AS user_id, r.id AS role_id, r.name AS role_name
FROM Membership m, SyncopeRole r
WHERE m.syncoperole_id = r.id
    </entry>
    <entry key="user_search_resource">
CREATE VIEW user_search_resource AS

SELECT st.user_id AS user_id, st.resource_name AS resource_name
FROM SyncopeUser_ExternalResource st

UNION ALL

SELECT m.syncopeuser_id AS user_id, st.resource_name AS resource_name
FROM Membership m, SyncopeRole r, SyncopeRole_ExternalResource st
WHERE m.syncoperole_id = r.id AND st.role_id = r.id
    </entry>
</properties>


text:
package cc.lijingbo.zhihudemo.model;

import cc.lijingbo.zhihudemo.model.api.ZhiHApi;

public interface IZhiHRequest {

  ZhiHApi getZhiHNews();

}


text:
/*
    Document   : sidebar
    Created on : Jan 24, 2013, 11:25:02 AM
    Author     : ofer
    Description:
        Purpose of the stylesheet is to style the sidebar (with the cloud tags etc.)
*/

.sidebar .section { margin-bottom: 20px; }
.sidebar h3 { line-height: 1.2em; font-size: 20px; margin-bottom: 10px; font-weight: normal; background: #eee; padding: 5px;  }
.sidebar p { line-height: 1.5em; margin-bottom: 20px; }
.sidebar ul { list-style: none }
.sidebar ul li { line-height: 1.5em }
.sidebar .small { font-size: 12px; }
.sidebar .comment p { margin-bottom: 5px; }
.sidebar .comment { margin-bottom: 10px; padding-bottom: 10px; }
.sidebar .tags { font-weight: bold; }
.sidebar .tags span { color: #000; font-size: 12px; }
.sidebar .tags .weight-1 { font-size: 12px; }
.sidebar .tags .weight-2 { font-size: 15px; }
.sidebar .tags .weight-3 { font-size: 18px; }
.sidebar .tags .weight-4 { font-size: 21px; }
.sidebar .tags .weight-5 { font-size: 24px; }


text:
<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Http\Requests\Api\UserLogin;
use App\Http\Requests\Api\UserRegistrationModel;
use App\User;
use Illuminate\Http\Request;
use Tymon\JWTAuth\Exceptions\JWTException;
use Tymon\JWTAuth\Facades\JWTAuth;

class AuthController extends Controller
{
    /**
     * Authenticate the user and create a token.
     *
     * @param $request
     *
     * @return \Illuminate\Http\JsonResponse
     */
    public function auth(UserLogin $request)
    {
        $credentials = $request->only('email', 'password');

        if (!$token = JWTAuth::attempt($credentials)) {
            return response()->json(['error' => 'invalid_credentials'], 401);
        }

        return response()->json(compact('token'));
    }

    /**
     * Return the current authenticated user.
     *
     * @param \Illuminate\Http\Request $request
     *
     * @return \Illuminate\Http\JsonResponse
     */
    public function me(Request $request)
    {
        $user = auth()->user();

        return response()->json($user);
    }

    /**
     * Refresh the JWT token.
     *
     * @return \Illuminate\Http\JsonResponse
     */
    public function refresh()
    {
        try {
            $token = JWTAuth::getToken();
            $newToken = JWTAuth::refresh($token);

            return response()->json(compact('newToken'));
        } catch (JWTException $exception) {
            return response()->json(['error' => 'token_blacklisted'], $exception->getStatusCode());
        }
    }

    public function logout()
    {
        JWTAuth::invalidate(JWTAuth::getToken());
    }

    /**
     * Register a new User.
     *
     * @param \App\Http\Requests\Api\UserRegistrationModel $request
     *
     * @return mixed
     */
    public function register(UserRegistrationModel $request)
    {
        $user = User::create([
            'name'     => $request->name,
            'email'    => $request->email,
            'password' => bcrypt($request->password),
        ]);

        $token = JWTAuth::fromUser($user);

        return response()->json(compact('token'));
    }
}


text:
require 'spec_helper'
require 'eight_corner'
include EightCorner

describe Base do
  let(:subject) {Base.new(10,10)}

  describe "next_point" do
    it "should work" do
      expect(
        subject.next_point(Point.new(3,3), 45, 2.8)
      ).to eq (Point.new(5,1))
    end
  end

  describe "angle" do
    it 'should always return an integer'
    # D, [2014-08-09T16:09:53.857347 #12486] DEBUG -- : ["current", #<EightCorner::Point:0x007fcfd427d7f0 @x=10, @y=78>]
    # D, [2014-08-09T16:09:53.857372 #12486] DEBUG -- : ["angle_to_next", 180.9]
    # D, [2014-08-09T16:09:53.857394 #12486] DEBUG -- : ["distance_to_boundary", nil]
  end

  describe "distance_to_boundary" do

    describe "for 0 degrees" do
      it "should return x" do
        expect(
          subject.distance_to_boundary(Point.new(5,6), 0)
        ).to eq(5)
      end
    end

    describe "between 1 and 89 degrees" do
      it "should return distance to top boundary when that is closest" do
        expect(
          subject.distance_to_boundary(Point.new(2,2), 45).round(4)
        ).to eq(2.8284)
      end
      it "should return distance to right boundary when that is closest" do
        expect(
          subject.distance_to_boundary(Point.new(9,5), 45).round(4)
        ).to eq(1.4142)
      end
      it "should return a value when hitting upper-right corner" do
        expect(
          subject.distance_to_boundary(Point.new(5,5), 45).round(4)
        ).to eq(7.0711)
      end
    end

    describe "for 90 degrees" do
      it "should return distance to right boundary" do
        expect(
          subject.distance_to_boundary(Point.new(1,1), 90)
        ).to eq(9)
      end
    end

    describe "for 91 to 179 degrees" do
      it "should return distance to right boundary when that is closest" do
        expect(
          subject.distance_to_boundary(Point.new(9,7), 135).round(4)
        ).to eq(1.4142)
      end
      it "should return distance to bottom boundary when that is closest" do
        expect(
          subject.distance_to_boundary(Point.new(3,8), 135).round(4)
        ).to eq(2.8284)
      end
      it "should return a value when hitting lower-right corner" do
        expect(
          subject.distance_to_boundary(Point.new(5,5), 135).round(4)
        ).to eq(7.0711)
      end
    end

    describe "for 180 degrees" do
      it "should return distance to bottom boundary" do
        expect(
          subject.distance_to_boundary(Point.new(5,7), 180)
        ).to eq(3)
      end
    end

    describe "for 181 to 269 degrees" do
      it "should return distance to bottom boundary when that is closest" do
        expect(
          subject.distance_to_boundary(Point.new(5,8), 225).round(4)
        ).to eq(2.8284)
      end
      it "should return distance to left boundary when that is closest" do
        expect(
          subject.distance_to_boundary(Point.new(2,5), 225).round(4)
        ).to eq(2.8284)
      end
      it "should return a value when hitting lower-left corner" do
        expect(
          subject.distance_to_boundary(Point.new(5,5), 225).round(4)
        ).to eq(7.0711)
      end
    end

    describe "for 270 degrees" do
      it "should return distance to left boundary" do
        expect(
          subject.distance_to_boundary(Point.new(3,7), 270)
        ).to eq(3)
      end
    end

    describe "for 271 to 359 degrees" do
      it "should return distance to left boundary when that is closest" do
        expect(
          subject.distance_to_boundary(Point.new(2,5), 315).round(4)
        ).to eq(2.8284)
      end
      it "should return distance to top boundary when that is closest" do
        expect(
          subject.distance_to_boundary(Point.new(5,2), 315).round(4)
        ).to eq(2.8284)
      end
      it "should return a value when hitting upper-left corner" do
        expect(
          subject.distance_to_boundary(Point.new(5,5), 315).round(4)
        ).to eq(7.0711)
      end
    end

  end

end


text:
#ifndef FREE_PDPT_H
#define FREE_PDPT_H

#include <pdpt_t.h>
#include <types.h>

#ifdef __cplusplus
extern "C"
{
#endif

    /**
     * <!-- description -->
     *   @brief Given a pdpt_t, this function will free any previously allocated
     *     tables.
     *
     * <!-- inputs/outputs -->
     *   @param pmut_pdpt the pdpt_t to free
     */
    void free_pdpt(struct pdpt_t *const pmut_pdpt) NOEXCEPT;

#ifdef __cplusplus
}
#endif

#endif


text:
<!DOCTYPE html>
<html lang="en-us">
<head>
	<meta charset="utf-8">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
	<title>UserA</title>

	<script src="../../scripts/jquery.min.js"></script>

	<script type="text/javascript" src="../../scripts/js.ext.js"></script>

	<script type="text/javascript" src="../../engine/Module.js"></script>
	<script async type="text/javascript" src="../../engine/WacomInkEngine.js"></script>

	<script type="text/javascript">
		var script = document.createElement("script");
		script.type = "text/javascript";
		script.src = parent.window.location.pathname.substring(parent.window.location.pathname.lastIndexOf("/")+1).replace("html", "js");

		document.head.appendChild(script);
	</script>

	<style type="text/css">
		body {position: relative; overflow: hidden; margin: 0; padding: 0; background-color: #252525; color: white;}
		canvas {border: 0px none;}
	</style>
</head>
<body>
	<canvas id="canvas" oncontextmenu="WILL.clear(); event.preventDefault();"></canvas>
</body>
</html>


text: extern crate log;


text:
class AddUrlnameIndexToPages < ActiveRecord::Migration
  def self.up
    add_index :pages, :urlname
  end

  def self.down
    remove_index :pages, :urlname
  end
end


text:
a.cox-ui-form-radio{
    position: relative;
    display: inline-block;
}

a.cox-ui-form-radio .text{
    display: inline-block;
    padding: 0 5px;
    line-height: 25px;
    text-align: center;
    border:1px solid #A0A0A0;
    min-width: 30px;
    cursor: pointer;
    margin: 1px;
}

a.cox-ui-form-radio-checked .text,
a.cox-ui-form-radio:hover .text{
    border:2px solid #c30008;
    margin: 0px;
}

a.cox-ui-form-radio-checked .state{
    background:url(images/radio-checked.png) no-repeat 0 0;
    position:absolute;
    width:12px;
    height:12px;
    right:0;
    bottom:0;
}

a.cox-ui-form-radio input{
    display: none;

}
div.cox-ui-form-amount-increase{
    position: relative;
    display: inline-block;
    width:85px;
    background:#A0A0A0;
    overflow: hidden;
    vertical-align: middle;
    *display: inline;
    zoom:1;
}
div.cox-ui-form-amount-increase input{
    width:66px;
    text-indent: 5px;
    height:24px;
    border: none;
    border:1px solid #A0A0A0;
    padding: 0;
    margin: 0;
    display: inline-block;
    *margin-left:-5px;
    *margin-top:-1px;
    line-height: 24px\9;
    vertical-align: middle;
}
div.cox-ui-form-amount-increase button{
    top:1px;
    position: absolute;
    width:14px;
    height:11px;
    padding: 0;
    margin: 0;
    font-size:0;
    border:none;
    outline: none;
    right:1px;
    background: url(images/amount-increase-btns.png) no-repeat 0 0;
    cursor: pointer;
}
div.cox-ui-form-amount-increase button.decrease{
    top:14px;
    background-position: 0 -12px;
}


text:
def filterKeys(d, allowedKeys):
  return dict((k,d[k]) for k in d if k in allowedKeys)

def invertMap(map):
  return dict((v,k) for k, v in map.iteritems())

def getterWithDefault(D, defaultKey, defaultValue = None):
  if defaultKey not in D and not defaultValue:
    raise KeyError(str(defaultKey) + " not in D and no defaultValue provided!")
  if defaultKey in D and not defaultValue:
    defaultValue = D[defaultKey]
  def mapper(x):
   if x in D:
     return D[x]
   else:
     return defaultValue
  return mapper

  # return lambda x: (   ((x in D) and D[x])
  #                   or defaultValue
  #                   or (defaultKey in D and D[defaultKey])
  #                   or None )

def getCommitInfo():
  import os, subprocess
  """Get latest commit info for the current directory"""
  GIT_CMD = "git rev-parse HEAD"
  BZR_COMMAND = "bzr version-info"
  try:
    git_result = subprocess.check_call(GIT_CMD, stderr=None, shell=True)
    return git_result
  except:
    pass
  #git_result = os.popen(GIT_CMD).read()
  bzr_result = os.popen(BZR_COMMAND).read()
  if bzr_result[:10] != "bzr: ERROR":
    return bzr_result


text:
Contributing
============

I love pull requests from everyone!

Getting Started
---------------

### Install Go

First you'll need to make sure you have go version 1.7 or later. golang.org has some [good instructions on installing Go](https://golang.org/doc/install).

### Getting the source

If you will be contributing, then you'll want to [fork the repository](https://help.github.com/articles/fork-a-repo/).

Once you've forked it, then you can clone the source:

    git clone git@github.com:<your-username>/<repository-name>.git

Fetch the required dependencies:

    script/bootstrap

Before you do any changes, make sure the tests pass:

    script/test
    script/lint

Make your change. Add tests for your change. Make the tests pass:

    script/test
    script/lint

Push to your fork and [submit a pull request](https://help.github.com/articles/creating-a-pull-request/).

At this point you're waiting on me. I try to be responsive to pull requests, but you know life can get in the way. I may suggest some changes or improvements or alternatives.

Some things that will increase the chance that your pull request is accepted:

-   Write tests.
-   Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).


text:
package net.adamcin.oakpal.api;

import org.apache.jackrabbit.vault.packaging.PackageId;
import org.jetbrains.annotations.Nullable;

import javax.json.JsonObject;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.ResourceBundle;

import static net.adamcin.oakpal.api.JavaxJson.mapArrayOfStrings;
import static net.adamcin.oakpal.api.JavaxJson.optArray;

/**
 * Simple implementation of a {@link Violation}.
 */
public final class SimpleViolation implements Violation {
    private final Severity severity;
    private final String description;
    private final List<PackageId> packages;

    /**
     * Constructor.
     *
     * @param severity    the severity
     * @param description the description
     * @param packages    the package ids
     */
    public SimpleViolation(final Severity severity, final String description, final PackageId... packages) {
        this(severity, description, packages != null ? Arrays.asList(packages) : null);
    }

    /**
     * Constructor.
     *
     * @param severity    the severity
     * @param description the description
     * @param packages    the package ids
     */
    public SimpleViolation(final Severity severity, final String description, final List<PackageId> packages) {
        this.severity = severity != null ? severity : Severity.MAJOR;
        this.description = description;
        this.packages = packages == null || packages.isEmpty()
                ? Collections.emptyList()
                : Collections.unmodifiableList(new ArrayList<>(packages));
    }

    /**
     * Use this builder method to more easily construct a violation with MessageFormat arguments.
     *
     * @return a new SimpleViolation Builder
     */
    public static Builder builder() {
        return new Builder(null);
    }

    /**
     * Use this builder method to more easily construct a violation with MessageFormat arguments.
     *
     * @param resourceBundle a ResourceBundle to lookup a localized message format string if available
     * @return a new SimpleViolation Builder
     */
    public static Builder builder(final ResourceBundle resourceBundle) {
        return new Builder(resourceBundle);
    }

    public static final class Builder {
        @Nullable
        private final ResourceBundle resourceBundle;
        private Severity severity;
        private String description;
        private List<Object> arguments = new ArrayList<>();
        private List<PackageId> packages = new ArrayList<>();

        private Builder(@Nullable final ResourceBundle resourceBundle) {
            this.resourceBundle = resourceBundle;
        }

        /**
         * Set severity.
         *
         * @param severity severity value
         * @return this builder
         */
        public Builder withSeverity(final Severity severity) {
            this.severity = severity;
            return this;
        }

        /**
         * Set description.
         *
         * @param description description
         * @return this builder
         */
        public Builder withDescription(final String description) {
            this.description = description;
            return this;
        }

        /**
         * Set arguments.
         *
         * @param arguments arguments
         * @return this builder
         */
        public Builder withArguments(final List<Object> arguments) {
            this.arguments = arguments != null ? new ArrayList<>(arguments) : new ArrayList<>();
            return this;
        }

        /**
         * Add one or more arguments.
         *
         * @param argument vararg argument values
         * @return this builder
         */
        public Builder withArgument(final Object... argument) {
            if (argument != null) {
                this.arguments.addAll(Arrays.asList(argument));
            }
            return this;
        }

        /**
         * Set package ids.
         *
         * @param packages package ids
         * @return this builder
         */
        public Builder withPackages(final List<PackageId> packages) {
            this.packages = packages != null ? new ArrayList<>(packages) : new ArrayList<>();
            return this;
        }

        /**
         * Add one or more packageIds.
         *
         * @param packageId vararg packageId values
         * @return this builder
         */
        public Builder withPackage(final PackageId... packageId) {
            if (packageId != null) {
                this.packages.addAll(Arrays.asList(packageId));
            }
            return this;
        }

        /**
         * Build a simple violation.
         *
         * @return a new violation
         */
        public SimpleViolation build() {
            final String localDescription =
                    description != null && resourceBundle != null && resourceBundle.containsKey(description)
                            ? resourceBundle.getString(description)
                            : description;
            if (localDescription == null || arguments == null || arguments.isEmpty()) {
                return new SimpleViolation(severity, localDescription, packages);
            } else {
                return new SimpleViolation(severity, MessageFormat.format(localDescription,
                        arguments.toArray(new Object[arguments.size()])), packages);
            }
        }
    }

    @Override
    public Severity getSeverity() {
        return severity;
    }

    @Override
    public Collection<PackageId> getPackages() {
        return packages;
    }

    @Override
    public String getDescription() {
        return description;
    }

    public static SimpleViolation fromReported(final Violation violation) {
        Severity severity = violation.getSeverity();
        String description = violation.getDescription();
        List<PackageId> packages = new ArrayList<>(violation.getPackages());
        return new SimpleViolation(severity, description, packages);
    }

    public static SimpleViolation fromJson(final JsonObject jsonViolation) {
        String vSeverity = jsonViolation.getString(ApiConstants.violationKeys().severity(), Severity.MINOR.name());
        Severity severity = Severity.valueOf(vSeverity);
        String description = jsonViolation.getString(ApiConstants.violationKeys().description(), "");
        List<PackageId> packages = optArray(jsonViolation, ApiConstants.violationKeys().packages())
                .map(array -> mapArrayOfStrings(array, PackageId::fromString, true))
                .orElseGet(Collections::emptyList);

        return new SimpleViolation(severity, description, packages);
    }

    @Override
    public String toString() {
        return "SimpleViolation{" +
                "severity=" + severity +
                ", description='" + description + '\'' +
                ", packages=" + packages +
                '}';
    }

    @Override
    public boolean equals(final Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SimpleViolation that = (SimpleViolation) o;
        return severity == that.severity &&
                Objects.equals(description, that.description) &&
                packages.equals(that.packages);
    }

    @Override
    public int hashCode() {
        return Objects.hash(severity, description, packages);
    }
}


text:
$SchemaContainerDN="CN=Schema,CN=Configuration,$((Get-ADDomain).distinguishedname)"

#All attributes and object will be taken from Exchnage install iso

<#
.Synopsis
   Parse the changes in LDF format and convert them to the Array of the PS objects.
.DESCRIPTION
   Converting the Lightweight directory information string (LDF) to array of Powershell objects for further processing.
.EXAMPLE
   PS C:\> $Schema0=(Get-Content .\schema0.ldf)
   PS C:\> $Schema0 = $Schema0 | where {$_ -ne ""}
   PS C:\> Convert-LDFToPSObject -LDFString $Schema0

dn                            :  CN=ms-Exch-Access-Control-Map,<SchemaContainerDN>
changetype                    :  ntdsSchemaAdd
adminDescription              :  ms-Exch-Access-Control-Map
adminDisplayName              :  ms-Exch-Access-Control-Map
attributeID                   :  1.2.840.113556.1.4.7000.102.64
attributeSyntax               :  2.5.5.12
isMemberOfPartialAttributeSet :  FALSE
isSingleValued                :  TRUE
lDAPDisplayName               :  msExchAccessControlMap
name                          :  ms-Exch-Access-Control-Map
oMSyntax                      :  64
objectCategory                :  CN=Attribute-Schema,<SchemaContainerDN>
objectClass                   :  attributeSchema
schemaIdGuid                  :  ZET1j5Ow0hGqBgDAT47t2A==
searchFlags                   :  0

dn                            :  CN=ms-Exch-Activation-Schedule,<SchemaContainerDN>
changetype                    :  ntdsSchemaAdd
adminDescription              :  ms-Exch-Activation-Schedule
adminDisplayName              :  ms-Exch-Activation-Schedule
attributeID                   :  1.2.840.113556.1.2.213
attributeSyntax               :  2.5.5.10
isMemberOfPartialAttributeSet :  FALSE
isSingleValued                :  TRUE
lDAPDisplayName               :  activationSchedule
mapiId                        :  32837
name                          :  ms-Exch-Activation-Schedule
oMSyntax                      :  4
objectCategory                :  CN=Attribute-Schema,<SchemaContainerDN>
objectClass                   :  attributeSchema
rangeLower                    :  84
rangeUpper                    :  84
schemaIdGuid                  :  FnmWv+YN0BGihQCqADBJ4g==
searchFlags                   :  0

dn                            :  CN=ms-Exch-Activation-Style,<SchemaContainerDN>
changetype                    :  ntdsSchemaAdd
adminDescription              :  ms-Exch-Activation-Style
adminDisplayName              :  ms-Exch-Activation-Style
attributeID                   :  1.2.840.113556.1.2.73
attributeSyntax               :  2.5.5.9
isMemberOfPartialAttributeSet :  FALSE
isSingleValued                :  TRUE
lDAPDisplayName               :  activationStyle
mapiId                        :  32838
name                          :  ms-Exch-Activation-Style
oMSyntax                      :  2
objectCategory                :  CN=Attribute-Schema,<SchemaContainerDN>
objectClass                   :  attributeSchema
rangeLower                    :  0
rangeUpper                    :  3
schemaIdGuid                  :  F3mWv+YN0BGihQCqADBJ4g==
searchFlags                   :  0

.INPUTS
    Sring with AD Schema changes in Lightweight Directory Information file format(LDF).
.OUTPUTS
    Array of PSObjects with all of properties and values from LDF string.
.NOTES
   Author - Andy Svintsitsky (@andysvints) & Taras Fedus
   Email - andy.svintsitsky@gmail.com & taras.fedus@ukr.net

#>
function Convert-LDFToPSObject
{
    [CmdletBinding(
                  SupportsShouldProcess=$true,
                  PositionalBinding=$false,
                  ConfirmImpact='Medium')]
    [Alias()]
    Param
    (
        # AD Schema changes in Lightweight Directory Information file format(LDF).
        [Parameter(Mandatory=$true,
                   ValueFromPipeline=$true,
                   ValueFromPipelineByPropertyName=$true,
                   Position=0)]
        [Alias("ldf")]
        [string[]]$LDFString
    )

    Begin
    {
    }
    Process
    {
        if ($pscmdlet.ShouldProcess("input LDF string."))
        {
            $LDFRowNumber=@()
            for($i=0;$i -le $LDFString.Count;$i++){
                if($LDFString[$i] -like "dn:*"){
                    $LDFRowNumber+=$i

                }
            }

            $LDFObject=@()
            for($index=0;$index -lt $LDFRowNumber.Count;$index++){
                $Object=New-Object -TypeName PSObject
                for($i=$LDFRowNumber[$index];$i -lt $LDFRowNumber[$index+1];$i++){
                    $Row=$LDFString[$i].Split(':')
                    $Object | Add-Member -NotePropertyName $($Row[0]) -NotePropertyValue $($Row[-1])

                }
                $LDFObject+=$Object
            }

        }
        return $LDFObject
    }
    End
    {
    }
}


text:
obj-$(CONFIG_IRCOMM) += ircomm.o ircomm-tty.o

ircomm-y := ircomm_core.o ircomm_event.o ircomm_lmp.o ircomm_ttp.o
ircomm-tty-y := ircomm_tty.o ircomm_tty_attach.o ircomm_tty_ioctl.o ircomm_param.o


text:
/************************************************************************************
 *
 *   Copyright (C) 2016 Gregory Nutt. All rights reserved.
 *   Author: Gregory Nutt <gnutt@nuttx.org>
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 * 3. Neither the name NuttX nor the names of its contributors may be
 *    used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 ************************************************************************************/

/************************************************************************************
 * Included Files
 ************************************************************************************/

#include <tinyara/config.h>
#include <tinyara/fs/mtd.h>
#include <debug.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/mount.h>

#include <tinyara/fs/mksmartfs.h>
#include <tinyara/board.h>
#include <arch/board/board.h>
#include "esp32_gpio.h"
#include "esp32_core.h"
#include "esp32_i2c.h"
#include <tinyara/gpio.h>
#ifdef CONFIG_SPIRAM_USE_CAPS_ALLOC
#include <esp_heap_caps.h>
#endif

#if defined(CONFIG_ADC)
#include "esp32_adc.h"
#include <tinyara/analog/adc.h>
#endif
/************************************************************************************
 * Pre-processor Definitions
 ************************************************************************************/

/************************************************************************************
 * Private Functions
 ************************************************************************************/

/************************************************************************************
 * Public Functions
 ************************************************************************************/

/************************************************************************************
 * Name: esp32_board_initialize
 *
 * Description:
 *   All STM32 architectures must provide the following entry point.  This entry point
 *   is called early in the initialization -- after all memory has been configured
 *   and mapped but before any devices have been initialized.
 *
 ************************************************************************************/
extern int board_ledc_setup(void);

#if defined(CONFIG_ESP32_FLASH_PART) && (CONFIG_ESP32_FLASH_PART == 1)
void esp32_devKit_config_partions(void)
{
	int partno;
	int partoffset;
	const char *parts = CONFIG_ESP32_FLASH_PART_LIST;
	const char *types = CONFIG_ESP32_FLASH_PART_TYPE;
	const char *names = CONFIG_ESP32_FLASH_PART_NAME;
	FAR struct mtd_dev_s *mtd;
	FAR struct mtd_geometry_s geo;

	mtd = progmem_initialize();
	if (!mtd) {
		lldbg("ERROR: progmem_initialize failed\n");
		return;
	}

	if (mtd->ioctl(mtd, MTDIOC_GEOMETRY, (unsigned long)&geo) < 0) {
		lldbg("ERROR: mtd->ioctl failed\n");
		return;
	}

	partno = 0;
	partoffset = CONFIG_ESP_FLASH_BASE / geo.blocksize;

	while (*parts) {
		FAR struct mtd_dev_s *mtd_part;
		int partsize;

		partsize = strtoul(parts, NULL, 0) << 10;

		if (partsize < geo.erasesize) {
			lldbg("ERROR: Partition size is lesser than erasesize\n");
			return;
		}

		if (partsize % geo.erasesize != 0) {
			lldbg("ERROR: Partition size is not multiple of erasesize\n");
			return;
		}

		mtd_part = mtd_partition(mtd, partoffset, partsize / geo.blocksize, partno);
		partoffset += partsize / geo.blocksize;

		if (!mtd_part) {
			lldbg("ERROR: failed to create partition.\n");
			return;
		}
#if defined(CONFIG_MTD_FTL)
		if (!strncmp(types, "ftl,", 4)) {
			if (ftl_initialize(partno, mtd_part)) {
				lldbg("ERROR: failed to initialise mtd ftl errno :%d\n", errno);
			}
		} else
#endif
#if defined(CONFIG_MTD_CONFIG)
			if (!strncmp(types, "config,", 7)) {
				mtdconfig_register(mtd_part);
			} else
#endif
#if defined(CONFIG_MTD_SMART) && defined(CONFIG_FS_SMARTFS)
				if (!strncmp(types, "smartfs,", 8)) {
					char partref[4];
					snprintf(partref, sizeof(partref), "p%d", partno);
					smart_initialize(CONFIG_ESP32_FLASH_MINOR, mtd_part, partref);
				} else
#endif
				{
				}

#if defined(CONFIG_MTD_PARTITION_NAMES)
		if (strcmp(names, "")) {
			mtd_setpartitionname(mtd_part, names);
		}

		while (*names != ',' && *names) {
			names++;
		}
		if (*names == ',') {
			names++;
		}
#endif

		while (*parts != ',' && *parts) {
			parts++;
		}
		if (*parts == ',') {
			parts++;
		}

		while (*types != ',' && *types) {
			types++;
		}
		if (*types == ',') {
			types++;
		}

		partno++;
	}
}

void esp32_devKit_mount_partions(void)
{
	int ret;
	/* Initialize and mount user partition (if we have) */
	ret = mksmartfs(CONFIG_ESP32_AUTOMOUNT_USERFS_DEVNAME, false);
	if (ret != OK) {
		lldbg("ERROR: mksmartfs on %s failed", CONFIG_ESP32_AUTOMOUNT_USERFS_DEVNAME);
	} else {
		ret = mount(CONFIG_ESP32_AUTOMOUNT_USERFS_DEVNAME, CONFIG_ESP32_AUTOMOUNT_USERFS_MOUNTPOINT, "smartfs", 0, NULL);
		if (ret != OK) {
			lldbg("ERROR: mounting '%s' failed\n", CONFIG_ESP32_AUTOMOUNT_USERFS_DEVNAME);
		}
	}

#ifdef CONFIG_FS_PROCFS
	/* Mount the procfs file system */
	ret = mount(NULL, CONFIG_ESP32_PROCFS_MOUNTPOINT, "procfs", 0, NULL);
	if (ret < 0) {
		lldbg("Failed to mount procfs at %s: %d\n", CONFIG_ESP32_PROCFS_MOUNTPOINT, ret);
	}
#endif

}
#endif

void esp32_board_initialize(void)
{
}

static void board_gpio_initialize(void)
{
#ifdef CONFIG_GPIO
	int i;
	struct gpio_lowerhalf_s *lower;

	struct {
		uint8_t minor;
		uint16_t pincfg;
	} pins[] = {
		{
			5, INPUT_PULLDOWN
		}, {
			15, INPUT_PULLDOWN
		}, {
			18, INPUT_PULLDOWN
		}, {
			19, INPUT_PULLDOWN
		}, {
			21, INPUT_PULLDOWN
		},
	};

	for (i = 0; i < sizeof(pins) / sizeof(*pins); i++) {
		lower = esp32_gpio_lowerhalf(pins[i].minor, pins[i].pincfg);
		gpio_register(pins[i].minor, lower);
	}
#endif
}

static void board_i2c_initialize(void)
{
#if defined(CONFIG_I2C)
#if defined(CONFIG_ESP32_I2C0) && (1 == CONFIG_ESP32_I2C0)
	esp32_i2c_register(0);
#endif

#if defined(CONFIG_ESP32_I2C1) && (1 == CONFIG_ESP32_I2C1)
	esp32_i2c_register(1);
#endif
#endif
}

#if defined(CONFIG_ADC)
static void board_adc_initialize(void)
{
	static bool adc_initialized;
	struct adc_dev_s *adc;
	const adc_channel_t chanlist[] = {
		ADC_CHANNEL_4,
		ADC_CHANNEL_5,
		ADC_CHANNEL_6,
		ADC_CHANNEL_7
	};

	/* Have we already initialized? */
	if (!adc_initialized) {
		adc = esp32_adc_initialize(chanlist, sizeof(chanlist) / sizeof(adc_channel_t));
		if (NULL != adc) {
			lldbg("ERROR: Failed to get the ESP32 ADC driver\n");
		} else {
			lldbg("ERROR: up_spiinitialize failed\n");
		}

		/* Register the ADC driver at "/dev/adc0" */
		int ret = adc_register("/dev/adc0", adc);
		if (ret < 0) {
			return;
		}

		/* Now we are initialized */
		adc_initialized = true;
	}
}
#endif

/****************************************************************************
 * Name: board_initialize
 *
 * Description:
 *   If CONFIG_BOARD_INITIALIZE is selected, then an additional
 *   initialization call will be performed in the boot-up sequence to a
 *   function called board_initialize().  board_initialize() will be
 *   called immediately after up_initialize() is called and just before the
 *   initial application is started.  This additional initialization phase
 *   may be used, for example, to initialize board-specific device drivers.
 *
 ****************************************************************************/

#ifdef CONFIG_BOARD_INITIALIZE
void board_initialize(void)
{
	/* Perform board-specific initialization */
	(void)esp32_bringup();
#if defined(CONFIG_ESP32_FLASH_PART) && (CONFIG_ESP32_FLASH_PART == 1)
	esp32_devKit_config_partions();
	esp32_devKit_mount_partions();
#endif
	board_gpio_initialize();
	board_i2c_initialize();
	board_ledc_setup();

#if defined(CONFIG_ADC)
	board_adc_initialize();
#endif

	/*Init SPI RAM*/
#ifdef CONFIG_SPIRAM_SUPPORT
	esp_spiram_init_cache();
	esp_spiram_init();
#endif

	/*no-os heap configure*/
#ifdef CONFIG_SPIRAM_USE_CAPS_ALLOC
	esp_spiram_add_to_heapalloc();
	//Assgin DMA memory for drivers*/
	uint8_t *dma_heap = (uint8_t *)malloc(CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL);
	if (!dma_heap) {
		return;
	}
	uint32_t caps[] = { MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL, 0, MALLOC_CAP_8BIT | MALLOC_CAP_32BIT };
	heap_caps_add_region_with_caps(caps, (intptr_t) dma_heap, (intptr_t) dma_heap + CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL - 1);

	/*enable heaps */
	heap_caps_enable_nonos_stack_heaps();
#endif
}
#endif


text:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.icss.hit.struts.action;

import java.util.Date;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.icss.hit.bean.MessageSaveBean;
import com.icss.hit.bean.interfaces.MessageDao;
import com.icss.hit.hibernate.vo.Message;
import com.icss.hit.hibernate.vo.ReceiverInfo;
import com.icss.hit.hibernate.vo.SysUser;
import com.icss.hit.struts.form.NewUserMessageForm;

/**
 * дÓû§µÄн¨ÐÅÏ¢
 * Creation date: 08-06-2009
 * @author ÕÔÓ±Éê
 * XDoclet definition:
 * @struts.action path="/newUserMessage" name="newUserMessageForm" input="/form/newUserMessage.jsp" scope="request" validate="true"
 */
public class NewUserMessageAction extends Action {
	/*
	 * Generated Methods
	 */

	/**
	 * Method execute
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 */
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		NewUserMessageForm newUserMessageForm = (NewUserMessageForm) form;// TODO Auto-generated method stub
		//¶ÁÈ¡Óû§µÄID
		long uid = 1;
		if( request.getSession().getAttribute("UserId") != null ){
			uid = Long.parseLong(request.getSession().getAttribute("UserId").toString());
		}else{
			return mapping.findForward("NullLogin");
		}

		long mesID = -2;
		long ReciverID = -2;
		Long result;
		String riBox = "0";
		SysUser user = new SysUser();
		user.setSuId(uid);
		Date date = new Date();
		// ÀàÐÍ
		String optype = newUserMessageForm.getType();
		// Óû§ID¼¯ºÏ
		String userIds = newUserMessageForm.getIdArray();
		// ±êÌâ
		String mesTitle = newUserMessageForm.getMessageTitle();
		// ÄÚÈÝ

		String mesContent = newUserMessageForm.getMessagecontent();
		String[] Users;
		Users = userIds.split(",");                        //·Ö³öÀ´µÄÓû§ID
		//ÉèÖÃÐÅÏ¢µÄ»ù±¾ÐÅÏ¢
		Message myMessage = new Message();
		myMessage.setMsTitle(mesTitle);
		myMessage.setMsContent(mesContent);
		myMessage.setMsSendtime(date);
		myMessage.setSysUser(user);
		myMessage.setMsDelete("0");
		MessageDao messageSave = new MessageSaveBean();
		//±êʾн¨ËùÊôÐÅÏ䣬1Ϊ·¢¼þÏ䣬2Ϊ²Ý¸åÏä,3ΪÊÕ¼þÏä
		if(optype.equals("send"))
		{
			//´¢´æÔÚ·¢¼þÏäÖУ¬µ±Óû§Ïë·¢ËÍÓ'þÊÇ£¬·ÅÈë·¢¼þÏ䣬עÒâµÄÊÇÓ'þµÄ·¢ËÍÈ˵ÄÓÊÏäдµÄÊÇ·¢¼þÏ䣬ËùÓнÓÊÕÈ˵ÄÓÊÏäдµÄÊÇÊÕ¼þÏä
			riBox = "3";
			myMessage.setMsBox("1");

		}
		else if(optype.equals("save"))
		{
			//´¢´æÔڲݸåÏ䣬µ±Óû§Ïë±£´æ²Ý¸åµÄʱºò£¬·ÅÈë²Ý¸åÏ䣬עÒâµÄÊÇÓ'þµÄ·¢ËÍÈ˵ÄÓÊÏäдµÄÊDzݸåÏ䣬ËùÓнÓÊÕÈ˵ÄÓÊÏäдµÄÊDzݸåÏä
			riBox = "2";
			myMessage.setMsBox("2");
		}
		mesID  = messageSave.saveReceiveMessage(myMessage); //±£´æÐÅÏ¢Óõģ¬×¢ÒâÁË°¡°¡°¡°¡£¡£¡£¡£¡
		if(mesID == -1)return mapping.findForward("newUserMessage.fail");
		//ÒÔÏÂÊÇÊäÈëÐÅÏ¢µÄÊÕ¼þÈË£¬ºÍÊÕ¼þÈ˵ÄËùÊôÓÊÏä
		for(int i = 0;i < Users.length; i++)
		{
			ReceiverInfo receiver = new ReceiverInfo();
			//ÉèÖÃÊÕ¼þÈËÐÅÏ¢ÀïÃæÏà¹ØÁªµÄÐÅÏ¢µÄIDºÅ
			Message message = new Message();
			message.setMsId(mesID);
			receiver.setMessage(message);
			//ÉèÖýÓÊÕÈ˵ÄÓÊÏä
			receiver.setRiBox(riBox);
			//ÉèÖÃδ¶Á
			receiver.setRiRead("0");
			//ÉèÖÃδɾ³ý
			receiver.setRiDelete("0");
			//ÉèÖÃÓû§µÄID
			SysUser sysUser = new SysUser();
			Long id;
			try
			{
				id = Long.parseLong(Users[i]);
			}
			catch(Exception ex)
			{
				ex.getStackTrace();
				return mapping.findForward("newUserMessage.fail");
			}
			sysUser.setSuId(id);
			receiver.setSysUser(sysUser);
			result = messageSave.saveReceiveUsers(receiver);
			if(result == -1)return mapping.findForward("newUserMessage.fail");
		}
		return mapping.findForward("newUserMessage.succeed");
	}
}


text:
(function() {

var checkVersion = Dagaz.Model.checkVersion;

Dagaz.Model.checkVersion = function(design, name, value) {
  if (name != "qmorris-extension") {
     checkVersion(design, name, value);
  }
}

var CheckInvariants = Dagaz.Model.CheckInvariants;

Dagaz.Model.CheckInvariants = function(board) {
  var design = Dagaz.Model.design;
  _.each(board.moves, function(move) {
      if (move.mode == 4) {
          var pos = move.actions[0][0][0];
          var piece = board.getPiece(pos);
          pos = design.navigate(board.player, pos, 8);
          if ((piece !== null) && (pos !== null)) {
              piece = piece.promote(+piece.type + Dagaz.Model.PIECE_CNT);
              move.actions[0][2] = [piece];
              move.dropPiece(pos, piece);
          }
      }
  });
  CheckInvariants(board);
}

})();


text:
var exproc = require('../../lib/expression-processor.js'),
assert = require('assert');

describe('Expression Processor', function(){
  describe('#eval()', function(){
    it('should evalute and process the expression', function(){
      var scope = {
        num: 100,
        two: 2,
        foo: 'bar',
        foos: ['bar','batz'],
        map: { attr: 'value' }
      };
      assert.equal(exproc.eval('1+1', scope), 2);
      assert.equal(exproc.eval('"abc"+"def"', scope), 'abcdef');
      assert.equal(exproc.eval('num+1', scope), 101);
      assert.equal(exproc.eval('num == 100', scope), true);
      assert.equal(exproc.eval('num+1 == 101', scope), true);
      assert.equal(exproc.eval('num+10 == 101', scope), false);
      assert.equal(exproc.eval('foo == "bar"', scope), true);
      assert.equal(exproc.eval('foo.length == 3', scope), true);
      assert.equal(exproc.eval('foo.toUpperCase()', scope), 'BAR');
      assert.equal(exproc.eval('foo.substr(1)', scope), 'ar');
      assert.equal(exproc.eval('foo.substring(1,two)', scope), 'a');
      assert.equal(exproc.eval('foos[0]', scope), 'bar');
      assert.equal(exproc.eval('map.attr == "value"', scope), true);
      assert.equal(exproc.eval('(num * two) + 3', scope), 203);
    });
  });
});


text:
<?php

namespace Ucsf\DuoOrmBundle\Command;

use IAM\DirectoryServicesBundle\Component\PrettyJsonResponse;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * Handle web requests related to expiring accounts
 */
class AvailableApiCommand extends ContainerAwareCommand
{
    protected function configure() {
        $this
            ->setName('duoorm:api')
            ->setDescription('List all available API calls from UcsfDuoOrmBundle');
    }

    /**
     * Get a list of the available DuoOrmBundle commands
     * @param InputInterface $input
     * @param OutputInterface $output
     */
    protected function execute(InputInterface $input, OutputInterface $output) {
        $em = $this->getContainer()->get('ucsf_duo_orm.entity_manager');
        $endpoints = $em->getEndpoints();
        $output->writeln('');
        foreach ($endpoints as $api => $calls) {
            foreach ($calls as $call => $config) {
                $output->writeln(str_pad($config['path'].' ', 48, '.').' <method>'.ucfirst($api).ucfirst($call).'()');
            }
        }
        $output->writeln("\nWhere <method> is one of 'get', 'post', etc.\n");
    }
}


text:
namespace content {
namespace {

void NullTask() {
}

TEST(DiscardableSharedMemoryHeapTest, Basic) {
  size_t block_size = base::GetPageSize();
  DiscardableSharedMemoryHeap heap(block_size);

  // Initial size should be 0.
  EXPECT_EQ(0u, heap.GetSize());

  // Initial size of free lists should be 0.
  EXPECT_EQ(0u, heap.GetSizeOfFreeLists());

  // Free lists are initially empty.
  EXPECT_FALSE(heap.SearchFreeLists(1, 0));

  const size_t kBlocks = 10;
  size_t memory_size = block_size * kBlocks;
  int next_discardable_shared_memory_id = 0;

  scoped_ptr<base::DiscardableSharedMemory> memory(
      new base::DiscardableSharedMemory);
  ASSERT_TRUE(memory->CreateAndMap(memory_size));

  // Create new span for memory.
  scoped_ptr<DiscardableSharedMemoryHeap::Span> new_span(
      heap.Grow(memory.Pass(), memory_size, next_discardable_shared_memory_id++,
                base::Bind(NullTask)));

  // Size should match |memory_size|.
  EXPECT_EQ(memory_size, heap.GetSize());

  // Size of free lists should still be 0.
  EXPECT_EQ(0u, heap.GetSizeOfFreeLists());

  // Free list should still be empty as |new_span| is currently in use.
  EXPECT_FALSE(heap.SearchFreeLists(1, 0));

  // Done using |new_span|. Merge it into the free lists.
  heap.MergeIntoFreeLists(new_span.Pass());

  // Size of free lists should now match |memory_size|.
  EXPECT_EQ(memory_size, heap.GetSizeOfFreeLists());

  // Free lists should not contain a span that is larger than kBlocks.
  EXPECT_FALSE(heap.SearchFreeLists(kBlocks + 1, 0));

  // Free lists should contain a span that satisfies the request for kBlocks.
  scoped_ptr<DiscardableSharedMemoryHeap::Span> span =
      heap.SearchFreeLists(kBlocks, 0);
  ASSERT_TRUE(span);

  // Free lists should be empty again.
  EXPECT_FALSE(heap.SearchFreeLists(1, 0));

  // Merge it into the free lists again.
  heap.MergeIntoFreeLists(span.Pass());
}

TEST(DiscardableSharedMemoryHeapTest, SplitAndMerge) {
  size_t block_size = base::GetPageSize();
  DiscardableSharedMemoryHeap heap(block_size);

  const size_t kBlocks = 6;
  size_t memory_size = block_size * kBlocks;
  int next_discardable_shared_memory_id = 0;

  scoped_ptr<base::DiscardableSharedMemory> memory(
      new base::DiscardableSharedMemory);
  ASSERT_TRUE(memory->CreateAndMap(memory_size));
  scoped_ptr<DiscardableSharedMemoryHeap::Span> new_span(
      heap.Grow(memory.Pass(), memory_size, next_discardable_shared_memory_id++,
                base::Bind(NullTask)));

  // Split span into two.
  scoped_ptr<DiscardableSharedMemoryHeap::Span> leftover =
      heap.Split(new_span.get(), 3);
  ASSERT_TRUE(leftover);

  // Merge |leftover| into free lists.
  heap.MergeIntoFreeLists(leftover.Pass());

  // Some of the memory is still in use.
  EXPECT_FALSE(heap.SearchFreeLists(kBlocks, 0));

  // Merge |span| into free lists.
  heap.MergeIntoFreeLists(new_span.Pass());

  // Remove a 2 page span from free lists.
  scoped_ptr<DiscardableSharedMemoryHeap::Span> span1 =
      heap.SearchFreeLists(2, kBlocks);
  ASSERT_TRUE(span1);

  // Remove another 2 page span from free lists.
  scoped_ptr<DiscardableSharedMemoryHeap::Span> span2 =
      heap.SearchFreeLists(2, kBlocks);
  ASSERT_TRUE(span2);

  // Merge |span1| back into free lists.
  heap.MergeIntoFreeLists(span1.Pass());

  // Some of the memory is still in use.
  EXPECT_FALSE(heap.SearchFreeLists(kBlocks, 0));

  // Merge |span2| back into free lists.
  heap.MergeIntoFreeLists(span2.Pass());

  // All memory has been returned to the free lists.
  scoped_ptr<DiscardableSharedMemoryHeap::Span> large_span =
      heap.SearchFreeLists(kBlocks, 0);
  ASSERT_TRUE(large_span);

  // Merge it into the free lists again.
  heap.MergeIntoFreeLists(large_span.Pass());
}

TEST(DiscardableSharedMemoryHeapTest, MergeSingleBlockSpan) {
  size_t block_size = base::GetPageSize();
  DiscardableSharedMemoryHeap heap(block_size);

  const size_t kBlocks = 6;
  size_t memory_size = block_size * kBlocks;
  int next_discardable_shared_memory_id = 0;

  scoped_ptr<base::DiscardableSharedMemory> memory(
      new base::DiscardableSharedMemory);
  ASSERT_TRUE(memory->CreateAndMap(memory_size));
  scoped_ptr<DiscardableSharedMemoryHeap::Span> new_span(
      heap.Grow(memory.Pass(), memory_size, next_discardable_shared_memory_id++,
                base::Bind(NullTask)));

  // Split span into two.
  scoped_ptr<DiscardableSharedMemoryHeap::Span> leftover =
      heap.Split(new_span.get(), 5);
  ASSERT_TRUE(leftover);

  // Merge |new_span| into free lists.
  heap.MergeIntoFreeLists(new_span.Pass());

  // Merge |leftover| into free lists.
  heap.MergeIntoFreeLists(leftover.Pass());
}

TEST(DiscardableSharedMemoryHeapTest, Grow) {
  size_t block_size = base::GetPageSize();
  DiscardableSharedMemoryHeap heap(block_size);
  int next_discardable_shared_memory_id = 0;

  scoped_ptr<base::DiscardableSharedMemory> memory1(
      new base::DiscardableSharedMemory);
  ASSERT_TRUE(memory1->CreateAndMap(block_size));
  heap.MergeIntoFreeLists(heap.Grow(memory1.Pass(), block_size,
                                    next_discardable_shared_memory_id++,
                                    base::Bind(NullTask)).Pass());

  // Remove a span from free lists.
  scoped_ptr<DiscardableSharedMemoryHeap::Span> span1 =
      heap.SearchFreeLists(1, 0);
  EXPECT_TRUE(span1);

  // No more memory available.
  EXPECT_FALSE(heap.SearchFreeLists(1, 0));

  // Grow free lists using new memory.
  scoped_ptr<base::DiscardableSharedMemory> memory2(
      new base::DiscardableSharedMemory);
  ASSERT_TRUE(memory2->CreateAndMap(block_size));
  heap.MergeIntoFreeLists(heap.Grow(memory2.Pass(), block_size,
                                    next_discardable_shared_memory_id++,
                                    base::Bind(NullTask)).Pass());

  // Memory should now be available.
  scoped_ptr<DiscardableSharedMemoryHeap::Span> span2 =
      heap.SearchFreeLists(1, 0);
  EXPECT_TRUE(span2);

  // Merge spans into the free lists again.
  heap.MergeIntoFreeLists(span1.Pass());
  heap.MergeIntoFreeLists(span2.Pass());
}

TEST(DiscardableSharedMemoryHeapTest, ReleaseFreeMemory) {
  size_t block_size = base::GetPageSize();
  DiscardableSharedMemoryHeap heap(block_size);
  int next_discardable_shared_memory_id = 0;

  scoped_ptr<base::DiscardableSharedMemory> memory(
      new base::DiscardableSharedMemory);
  ASSERT_TRUE(memory->CreateAndMap(block_size));
  scoped_ptr<DiscardableSharedMemoryHeap::Span> span =
      heap.Grow(memory.Pass(), block_size, next_discardable_shared_memory_id++,
                base::Bind(NullTask));

  // Free lists should be empty.
  EXPECT_EQ(0u, heap.GetSizeOfFreeLists());

  heap.ReleaseFreeMemory();

  // Size should still match |block_size|.
  EXPECT_EQ(block_size, heap.GetSize());

  heap.MergeIntoFreeLists(span.Pass());
  heap.ReleaseFreeMemory();

  // Memory should have been released.
  EXPECT_EQ(0u, heap.GetSize());
  EXPECT_EQ(0u, heap.GetSizeOfFreeLists());
}

TEST(DiscardableSharedMemoryHeapTest, ReleasePurgedMemory) {
  size_t block_size = base::GetPageSize();
  DiscardableSharedMemoryHeap heap(block_size);
  int next_discardable_shared_memory_id = 0;

  scoped_ptr<base::DiscardableSharedMemory> memory(
      new base::DiscardableSharedMemory);
  ASSERT_TRUE(memory->CreateAndMap(block_size));
  scoped_ptr<DiscardableSharedMemoryHeap::Span> span =
      heap.Grow(memory.Pass(), block_size, next_discardable_shared_memory_id++,
                base::Bind(NullTask));

  // Unlock memory so it can be purged.
  span->shared_memory()->Unlock(0, 0);

  // Purge and release shared memory.
  bool rv = span->shared_memory()->Purge(base::Time::Now());
  EXPECT_TRUE(rv);
  heap.ReleasePurgedMemory();

  // Shared memory backing for |span| should be gone.
  EXPECT_FALSE(span->shared_memory());

  // Size should be 0.
  EXPECT_EQ(0u, heap.GetSize());
}

TEST(DiscardableSharedMemoryHeapTest, Slack) {
  size_t block_size = base::GetPageSize();
  DiscardableSharedMemoryHeap heap(block_size);

  const size_t kBlocks = 6;
  size_t memory_size = block_size * kBlocks;
  int next_discardable_shared_memory_id = 0;

  scoped_ptr<base::DiscardableSharedMemory> memory(
      new base::DiscardableSharedMemory);
  ASSERT_TRUE(memory->CreateAndMap(memory_size));
  heap.MergeIntoFreeLists(heap.Grow(memory.Pass(), memory_size,
                                    next_discardable_shared_memory_id++,
                                    base::Bind(NullTask)).Pass());

  // No free span that is less or equal to 3 + 1.
  EXPECT_FALSE(heap.SearchFreeLists(3, 1));

  // No free span that is less or equal to 3 + 2.
  EXPECT_FALSE(heap.SearchFreeLists(3, 2));

  // No free span that is less or equal to 1 + 4.
  EXPECT_FALSE(heap.SearchFreeLists(1, 4));

  scoped_ptr<DiscardableSharedMemoryHeap::Span> span =
      heap.SearchFreeLists(1, 5);
  EXPECT_TRUE(span);

  heap.MergeIntoFreeLists(span.Pass());
}

void OnDeleted(bool* deleted) {
  *deleted = true;
}

TEST(DiscardableSharedMemoryHeapTest, DeletedCallback) {
  size_t block_size = base::GetPageSize();
  DiscardableSharedMemoryHeap heap(block_size);
  int next_discardable_shared_memory_id = 0;

  scoped_ptr<base::DiscardableSharedMemory> memory(
      new base::DiscardableSharedMemory);
  ASSERT_TRUE(memory->CreateAndMap(block_size));
  bool deleted = false;
  scoped_ptr<DiscardableSharedMemoryHeap::Span> span =
      heap.Grow(memory.Pass(), block_size, next_discardable_shared_memory_id++,
                base::Bind(OnDeleted, base::Unretained(&deleted)));

  heap.MergeIntoFreeLists(span.Pass());
  heap.ReleaseFreeMemory();

  EXPECT_TRUE(deleted);
}

TEST(DiscardableSharedMemoryHeapTest, CreateMemoryAllocatorDumpTest) {
  size_t block_size = base::GetPageSize();
  DiscardableSharedMemoryHeap heap(block_size);
  int next_discardable_shared_memory_id = 0;

  scoped_ptr<base::DiscardableSharedMemory> memory(
      new base::DiscardableSharedMemory);
  ASSERT_TRUE(memory->CreateAndMap(block_size));
  scoped_ptr<DiscardableSharedMemoryHeap::Span> span =
      heap.Grow(memory.Pass(), block_size, next_discardable_shared_memory_id++,
                base::Bind(NullTask));

  // Check if allocator dump is created when span exists.
  scoped_ptr<base::trace_event::ProcessMemoryDump> pmd(
      new base::trace_event::ProcessMemoryDump(nullptr));
  EXPECT_TRUE(heap.CreateMemoryAllocatorDump(span.get(), "discardable/test1",
                                             pmd.get()));

  // Unlock, Purge and release shared memory.
  span->shared_memory()->Unlock(0, 0);
  bool rv = span->shared_memory()->Purge(base::Time::Now());
  EXPECT_TRUE(rv);
  heap.ReleasePurgedMemory();

  // Check that allocator dump is created after memory is purged.
  EXPECT_TRUE(heap.CreateMemoryAllocatorDump(span.get(), "discardable/test2",
                                             pmd.get()));
}

}  // namespace
}  // namespace content


text:
require 'rubygems'
require 'memcache'

#---[ Naive benchmarks ]------------------------------------------------

n = 10000
db = MemCache.new('localhost:11211')

def elapsed(&block)
  timer = Time.now
  block.call
  return Time.now - timer
end

items = []
for i in 0...n
  items << { :id => i, :message => "omgkittens" }
end

db.flush_all
s = elapsed do
  for i in 0...n
    db[i.to_s] = items[i]
  end
end
puts "* %i inserts per second individually, for %i items over %0.2f seconds" % [n/s, n, s]

s = elapsed do
  for i in 0...n
    item = db[i.to_s]
    item[:id] == i or raise "Mismatch! Expected #{i}, got: #{item.inspect}"
  end
end
puts "* %i retrieves per second individually, for %i items over %0.2f seconds" % [n/s, n, s]

=begin
* 3293 inserts per second individually, for 10000 items over 3.04 seconds
* 1438 retrieves per second individually, for 10000 items over 6.95 seconds
=end


text:
const size_t num_eles = 1024 * 1024 * 1024;

using namespace fm;

int num_nodes = 1;
int nthreads = 8;

class rand_set: public type_set_vec_operate<long>
{
public:
	void set(long *arr, size_t num_eles, off_t start_idx) const {
		for (size_t i = 0; i < num_eles; i++)
			arr[i] = random();
	}
};

void test_sort()
{
	size_t len = (random() % num_eles) + num_eles;
	vector::ptr mem_vec = vector::create(len, get_scalar_type<long>(), -1, true,
			rand_set());
	detail::NUMA_vec_store::ptr numa_vec = detail::NUMA_vec_store::create(len,
			num_nodes, get_scalar_type<long>());
	numa_vec->copy_from(
			dynamic_cast<const detail::mem_vec_store &>(mem_vec->get_data()).get_raw_arr(),
			mem_vec->get_length() * sizeof(long));

	struct timeval start, end;
	gettimeofday(&start, NULL);
	numa_vec->sort();
	gettimeofday(&end, NULL);
	printf("sort %ld elements in NUMA vector takes %.3f\n", numa_vec->get_length(),
			time_diff(start, end));

	gettimeofday(&start, NULL);
	mem_vec->sort();
	gettimeofday(&end, NULL);
	printf("sort %ld elements in mem vector takes %.3f\n", numa_vec->get_length(),
			time_diff(start, end));
}

int main(int argc, char *argv[])
{
	if (argc >= 3) {
		num_nodes = atoi(argv[1]);
		nthreads = atoi(argv[2]);
	}

	matrix_conf.set_num_nodes(num_nodes);
	matrix_conf.set_num_DM_threads(nthreads);
	detail::mem_thread_pool::init_global_mem_threads(num_nodes,
			nthreads / num_nodes);
	test_sort();
}


text:
#ifndef QUICKSTEP_EXPRESSIONS_AGGREGATION_AGGREGATION_HANDLE_DISTINCT_HPP_
#define QUICKSTEP_EXPRESSIONS_AGGREGATION_AGGREGATION_HANDLE_DISTINCT_HPP_

#include <cstddef>
#include <memory>
#include <vector>

#include "catalog/CatalogTypedefs.hpp"
#include "expressions/aggregation/AggregationConcreteHandle.hpp"
#include "storage/HashTableBase.hpp"
#include "types/TypedValue.hpp"
#include "utility/Macros.hpp"

#include "glog/logging.h"

namespace quickstep {

class AggregationState;
class ColumnVector;
class StorageManager;
class Type;
class ValueAccessor;

/** \addtogroup Expressions
 *  @{
 */

class AggregationHandleDistinct : public AggregationConcreteHandle {
 public:
  /**
   * @brief Constructor.
   **/
  AggregationHandleDistinct() {}

  AggregationState* createInitialState() const override {
    LOG(FATAL)
        << "AggregationHandleDistinct does not support createInitialState().";
  }

  AggregationState* accumulateNullary(
      const std::size_t num_tuples) const override {
    LOG(FATAL)
        << "AggregationHandleDistinct does not support accumulateNullary().";
  }

  AggregationState* accumulateColumnVectors(
      const std::vector<std::unique_ptr<ColumnVector>> &column_vectors)
      const override {
    LOG(FATAL) << "AggregationHandleDistinct does not support "
                  "accumulateColumnVectors().";
  }

#ifdef QUICKSTEP_ENABLE_VECTOR_COPY_ELISION_SELECTION
  AggregationState* accumulateValueAccessor(
      ValueAccessor *accessor,
      const std::vector<attribute_id> &accessor_ids) const override {
    LOG(FATAL) << "AggregationHandleDistinct does not support "
                  "accumulateValueAccessor().";
  }
#endif

  void mergeStates(const AggregationState &source,
                   AggregationState *destination) const override {
    LOG(FATAL) << "AggregationHandleDistinct does not support mergeStates().";
  }

  TypedValue finalize(const AggregationState &state) const override {
    LOG(FATAL) << "AggregationHandleDistinct does not support finalize().";
  }

  AggregationState* aggregateOnDistinctifyHashTableForSingle(
      const AggregationStateHashTableBase &distinctify_hash_table)
      const override {
    LOG(FATAL) << "AggregationHandleDistinct does not support "
               << "aggregateOnDistinctifyHashTableForSingle().";
  }

  void aggregateOnDistinctifyHashTableForGroupBy(
      const AggregationStateHashTableBase &distinctify_hash_table,
      AggregationStateHashTableBase *groupby_hash_table,
      std::size_t index) const override {
    LOG(FATAL) << "AggregationHandleDistinct does not support "
               << "aggregateOnDistinctifyHashTableForGroupBy().";
  }

  AggregationStateHashTableBase* createGroupByHashTable(
      const HashTableImplType hash_table_impl,
      const std::vector<const Type *> &group_by_types,
      const std::size_t estimated_num_groups,
      StorageManager *storage_manager) const override;

  void aggregateValueAccessorIntoHashTable(
      ValueAccessor *accessor,
      const std::vector<attribute_id> &argument_ids,
      const std::vector<attribute_id> &group_by_key_ids,
      AggregationStateHashTableBase *hash_table) const override;

  ColumnVector* finalizeHashTable(
      const AggregationStateHashTableBase &hash_table,
      std::vector<std::vector<TypedValue>> *group_by_keys,
      int index) const override;

 private:
  DISALLOW_COPY_AND_ASSIGN(AggregationHandleDistinct);
};

/** @} */

}  // namespace quickstep

#endif  // QUICKSTEP_EXPRESSIONS_AGGREGATION_AGGREGATION_HANDLE_DISTINCT_HPP_


text:
<?php

namespace Laravel\Socialite\One;

use Illuminate\Http\Request;
use InvalidArgumentException;
use League\OAuth1\Client\Server\Server;
use Symfony\Component\HttpFoundation\RedirectResponse;

use \Laravel\Socialite\Contracts\ProviderInterface;

abstract class AbstractProvider implements ProviderInterface
{
    /**
     * The HTTP request instance.
     *
     * @var \Illuminate\Http\Request
     */
    protected $request;

    /**
     * The OAuth server implementation.
     *
     * @var \League\OAuth1\Client\Server\Server
     */
    protected $server;

    /**
     * Create a new provider instance.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \League\OAuth1\Client\Server\Server  $server
     * @return void
     */
    public function __construct(Request $request, Server $server)
    {
        $this->server = $server;
        $this->request = $request;
    }

    /**
     * Redirect the user to the authentication page for the provider.
     *
     * @return \Symfony\Component\HttpFoundation\RedirectResponse
     */

    public function redirect()
    {
        $temp_credentials = $this->server->getTemporaryCredentials();

        $this->request->session()->set(
            'oauth.temp',
            $temp_credentials
        );

        return new RedirectResponse(
            $this->server->getAuthorizationUrl($temp_credentials));
    }

    /**
     * Get the User instance for the authenticated user.
     *
     * @throws \InvalidArgumentException
     * @return \Laravel\Socialite\One\User
     */
    public function user()
    {
        if (! $this->hasNecessaryVerifier()) {
            throw new InvalidArgumentException('Invalid request. Missing OAuth verifier.');
        }

        $token = $this->getToken();
        $user = $this->server->getUserDetails($token);

        // TODO(nicolai): This code is broken. $user->extra isn't a thing.
        $instance = (new User)->setRaw($user->extra)
                ->setToken($token->getIdentifier(), $token->getSecret());

        return $instance->map([
            'id'       => $user->uid,
            'nickname' => $user->nickname,
            'name'     => $user->name,
            'email'    => $user->email,
            'avatar'   => $user->imageUrl,
        ]);
    }

    /**
     * Get the token credentials for the request.
     *
     * @return \League\OAuth1\Client\Credentials\TokenCredentials
     */
    protected function getToken()
    {
        $temp = $this->request->session()->get('oauth.temp');

        return $this->server->getTokenCredentials(
            $temp,
            $this->request->get('oauth_token'),
            $this->request->get('oauth_verifier')
        );
    }

    /**
     * Determine if the request has the necessary OAuth verifier.
     *
     * @return bool
     */
    protected function hasNecessaryVerifier()
    {
        return $this->request->has('oauth_token')
            && $this->request->has('oauth_verifier');
    }

    /**
     * Set the request instance.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return $this
     */
    public function setRequest(Request $request)
    {
        $this->request = $request;

        return $this;
    }
}


text:
  Châtres est
       un village
       situé dans le département de Seine-et-Marne en Île-de-France. Elle comptait 572 habitants en 2008.

La ville compte quelques  équipements sportifs, elle dispose, entre autres, de un centre d'équitation.

Si vous envisagez de emmenager à Châtres, vous pourrez facilement trouver une maison à acheter.

À Châtres, la valeur moyenne à l'achat d'un appartement se situe à 3 331 € du m² en vente. la valorisation moyenne d'une maison à l'achat se situe à 2 709 € du m². À la location la valeur moyenne se situe à 8,85 € du m² mensuel.

Le nombre d'habitations, à Châtres, se décomposait en 2011 en neuf appartements et 221 maisons soit
 un marché relativement équilibré.

À proximité de Châtres sont situées les communes de
Fontenay-Trésigny localisée à 4 km, 4 967 habitants,
Presles-en-Brie située à 4 km, 2 041 habitants,
Ozouer-le-Voulgis à 6 km, 1 644 habitants,
Chaumes-en-Brie située à 5 km, 2 958 habitants,
Liverdy-en-Brie à 2 km, 1 159 habitants,
Favières située à 6 km, 1 066 habitants,
 entre autres. De plus, Châtres est située à seulement 27 km de Créteil.


text:
'use strict';

angular.module('security.register.phekb', ['ngCookies'])

// The LoginFormController provides the behaviour behind a reusable form to allow users to authenticate.
// This controller and its template (login/form.tpl.html) are used in a modal dialog box by the security service.
.controller('RegisterController', ['$scope', 'security', '$http', '$rootScope', '$cookies',function($scope, security, $http, $rootScope, $cookies) {
  // The model for this form
  $scope.user = {};

  // Any error message from failing to login
  $scope.authError = null;

  // The reason that we are being asked to login - for instance because we tried to access something to which we are not authorized
  // We could do something diffent for each reason here but to keep it simple...
  /*$scope.authReason = null;
  if ( security.getLoginReason() ) {
    $scope.authReason = ( security.isAuthenticated() ) ?
      'You are not authorized to access this page' :
      'Please log in to continue';
  }
  */
  $scope.user.email = 'peter@gmail.com';
  $scope.user.password = 'peter'

  // Attempt to authenticate the user specified in the form's model
  this.register = function() {
    // Clear any previous security errors
    $scope.authError = null;

    // Try to Register. This sets the user
    var user_data = {email: $scope.user.email, password: $scope.user.password, firstName: $scope.user.firstName, lastName: $scope.user.lastName};
    var request = $http.post('/register', user_data);
    return request.then(function(response) {
    //security.register($scope.user.email, $scope.user.password).then(function(registration) {
     // console.log("in registration  callback ")
     // console.log(response);
      var data = response.data;
      if ( data.error ) {
        // If we get here then the login failed due to bad credentials
        console.log(response.error)
        $scope.authError = 'Registration Failed: ' + data.error + '. Please try again.';
        $scope.user.email = '';
        $scope.user.password = '';
        return null;
      }
      else
      {
        // all good
        $scope.authError = null;
        security.currentUser = data.user;
        security.closeRegister(true);
        $rootScope.$broadcast('user:updated', data.user);
        //console.log("Registered user ", $scope.user);
        return security.currentUser;
      }
    });
  };

  this.clearForm = function() {
    $scope.user = {};
  };

  this.cancel = function() {
    security.closeRegister(true);
  };
}]);


text:
package blobstores_test

import (
	"io/ioutil"
	"strings"
	"testing"

	"github.com/onsi/ginkgo"

	. "github.com/onsi/ginkgo"

	"github.com/onsi/gomega"

	. "github.com/onsi/gomega"
	"github.com/petergtz/bitsgo"
	inmemory "github.com/petergtz/bitsgo/blobstores/inmemory"
	"github.com/petergtz/bitsgo/blobstores/local"
	"github.com/petergtz/bitsgo/config"
	"os"
)

func TestInMemoryBlobstore(t *testing.T) {
	gomega.RegisterFailHandler(ginkgo.Fail)
	ginkgo.RunSpecs(t, "InMemory Blobstore")
}

var _ = Describe("Blobstore", func() {
	var blobstore bitsgo.Blobstore

	itCanBeModifiedByItsMethods := func() {
		It("can be modified by its methods", func() {
			Expect(blobstore.Exists("/some/path")).To(BeFalse())

			redirectLocation, e := blobstore.HeadOrRedirectAsGet("/some/path")
			Expect(redirectLocation).To(BeEmpty())
			Expect(e).To(BeAssignableToTypeOf(bitsgo.NewNotFoundError()))

			Expect(blobstore.Put("/some/path", strings.NewReader("some string"))).To(Succeed())

			Expect(blobstore.Exists("/some/path")).To(BeTrue())

			Expect(blobstore.HeadOrRedirectAsGet("/some/path")).To(BeEmpty())

			body, redirectLocation, e := blobstore.GetOrRedirect("/some/path")
			Expect(redirectLocation, e).To(BeEmpty())
			Expect(ioutil.ReadAll(body)).To(MatchRegexp("some string"))

			Expect(blobstore.Copy("/some/path", "/some/other/path")).To(Succeed())
			Expect(blobstore.Copy("/some/other/path", "/some/yet/other/path")).To(Succeed())
			Expect(blobstore.Copy("/some/other/path", "/yet/some/other/path")).To(Succeed())
			Expect(blobstore.Copy("/yet/some/other/path", "/yet/some/other/path")).To(Succeed())

			body, redirectLocation, e = blobstore.GetOrRedirect("/some/other/path")
			Expect(redirectLocation, e).To(BeEmpty())
			Expect(ioutil.ReadAll(body)).To(MatchRegexp("some string"))

			Expect(blobstore.Delete("/some/path")).To(Succeed())

			Expect(blobstore.Exists("/some/path")).To(BeFalse())

			Expect(blobstore.Exists("/some/other/path")).To(BeTrue())

			redirectLocation, e = blobstore.HeadOrRedirectAsGet("/some/path")
			Expect(redirectLocation).To(BeEmpty())
			Expect(e).To(BeAssignableToTypeOf(bitsgo.NewNotFoundError()))

			Expect(blobstore.DeleteDir("/some")).To(Succeed())
			Expect(blobstore.Exists("/some/other/path")).To(BeFalse())
			Expect(blobstore.Exists("/some/yet/other/path")).To(BeFalse())
			Expect(blobstore.Exists("/yet/some/other/path")).To(BeTrue())

			Expect(blobstore.DeleteDir("")).To(Succeed())
			Expect(blobstore.Exists("/yet/some/other/path")).To(BeFalse())
		})
	}

	Describe("Local", func() {
		var tempDirname string

		BeforeEach(func() {
			var e error
			tempDirname, e = ioutil.TempDir("", "bitsgo")
			Expect(e).NotTo(HaveOccurred())

			blobstore = local.NewBlobstore(config.LocalBlobstoreConfig{PathPrefix: tempDirname})
		})
		AfterEach(func() { os.RemoveAll(tempDirname) })

		itCanBeModifiedByItsMethods()
	})

	Describe("In-memory", func() {
		BeforeEach(func() { blobstore = inmemory.NewBlobstore() })

		itCanBeModifiedByItsMethods()
	})
})


text:
@interface AMApartmentMateFinderViewController ()

@end

@implementation AMApartmentMateFinderViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
}

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

@end


text:
extern "Java"
{
  namespace java
  {
    namespace awt
    {
      namespace event
      {
          class ActionEvent;
      }
    }
  }
  namespace javax
  {
    namespace swing
    {
      namespace plaf
      {
        namespace basic
        {
            class BasicDesktopPaneUI;
            class BasicDesktopPaneUI$MinimizeAction;
        }
      }
    }
  }
}

class javax::swing::plaf::basic::BasicDesktopPaneUI$MinimizeAction : public ::javax::swing::AbstractAction
{

public: // actually protected
  BasicDesktopPaneUI$MinimizeAction(::javax::swing::plaf::basic::BasicDesktopPaneUI *);
public:
  virtual void actionPerformed(::java::awt::event::ActionEvent *);
  virtual jboolean isEnabled();
public: // actually package-private
  ::javax::swing::plaf::basic::BasicDesktopPaneUI * __attribute__((aligned(__alignof__( ::javax::swing::AbstractAction)))) this$0;
public:
  static ::java::lang::Class class$;
};

#endif // __javax_swing_plaf_basic_BasicDesktopPaneUI$MinimizeAction__


text:
<?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer' . '/autoload_real.php';

return ComposerAutoloaderInitd9b5086e51028531c33c727aca3cb063::getLoader();


text:
@org.spongepowered.api.util.annotation.NonnullByDefault
package org.spongepowered.common.data.builder.util.weighted;


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

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Constant Field Values (ITK API 0.1-SNAPSHOT API)</title>
<meta name="date" content="2013-05-04">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Constant Field Values

Contents

uk.nhs.*

uk.nhs.*

uk.nhs.interoperability.capabilities.AuditService

Modifier and Type
Constant Field
Value

public static final String
MESSAGE_PROCESSING_FAILURE
"Message processing failed"

public static final String
MESSAGE_RECEIPT_EVENT
"Message received"

public static final String
MESSAGE_SENT_EVENT
"Message sent"

uk.nhs.interoperability.capabilities.ITKProfileManager

Modifier and Type
Constant Field
Value

public static final int
ACCEPTED
10

public static final int
DEPRECATED
30

public static final int
NOT_SUPPORTED
20

uk.nhs.interoperability.infrastructure.ITKAddress

Modifier and Type
Constant Field
Value

public static final String
DEFAULT_ADDRESS_TYPE
"2.16.840.1.113883.2.1.3.2.4.18.22"

uk.nhs.interoperability.infrastructure.ITKIdentity

Modifier and Type
Constant Field
Value

public static final String
DEFAULT_IDENTITY_TYPE
"2.16.840.1.113883.2.1.3.2.4.18.22"

uk.nhs.interoperability.infrastructure.ITKMessageProperties

Modifier and Type
Constant Field
Value

public static final String
BUSINESS_ACK_HANDLING_SPECIFICATION_KEY
"urn:nhs:itk:ns:201005:ackrequested"

public static final String
INTERACTION_HANDLING_SPECIFICATION_KEY
"urn:nhs-itk:ns:201005:interaction"

uk.nhs.interoperability.infrastructure.ITKMessagingException

Modifier and Type
Constant Field
Value

public static final int
ACCESS_DENIED_CODE
3000

public static final String
ACCESS_DENIED_TEXT
"Access Denied"

public static final String
DEFAULT_ERROR_CODESYSTEM_OID
"2.16.840.1.113883.2.1.3.2.4.17.268"

public static final int
INVALID_MESSAGE_CODE
1000

public static final String
INVALID_MESSAGE_TEXT
"Invalid Message - the message structure or content is unrecognised or incorrect"

public static final int
NO_ERROR_CODE
-1

public static final int
PROCESSING_ERROR_NOT_RETRYABLE_CODE
2200

public static final String
PROCESSING_ERROR_NOT_RETRYABLE_TEXT
"Processing Error (not retryable) - a non-recoverable processing error has been encountered"

public static final int
PROCESSING_ERROR_RETRYABLE_CODE
2100

public static final String
PROCESSING_ERROR_RETRYABLE_TEXT
"Processing Error (retryable) - a recoverable processing error has been encountered"

uk.nhs.interoperability.transport.ITKTransportRoute

Modifier and Type
Constant Field
Value

public static final String
DIRECT
"DIRECT"

public static final String
DISTRIBUTION_ENVELOPE
"DE"

public static final String
DTS
"DTS"

public static final String
HTTP_WS
"WS"

public static final String
NO_WRAPPER
"NONE"

public static final String
ROUTED
"ROUTED"

public static final String
SPINE_TMS
"TMS"

public static final String
UNKNOWN
"UN"

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

All content is available under the Open Government Licence, except where otherwise stated

                                  All example source code is available under Apache 2.0, except where otherwise stated


text:
package com.facebook.react.bridge;

import javax.annotation.Nullable;

import android.os.Bundle;

public class Arguments {

  /**
   * This method should be used when you need to stub out creating NativeArrays in unit tests.
   */
  public static WritableArray createArray() {
    return new WritableNativeArray();
  }

  /**
   * This method should be used when you need to stub out creating NativeMaps in unit tests.
   */
  public static WritableMap createMap() {
    return new WritableNativeMap();
  }

  public static WritableNativeArray fromJavaArgs(Object[] args) {
    WritableNativeArray arguments = new WritableNativeArray();
    for (int i = 0; i < args.length; i++) {
      Object argument = args[i];
      if (argument == null) {
        arguments.pushNull();
        continue;
      }

      Class argumentClass = argument.getClass();
      if (argumentClass == Boolean.class) {
        arguments.pushBoolean(((Boolean) argument).booleanValue());
      } else if (argumentClass == Integer.class) {
        arguments.pushDouble(((Integer) argument).doubleValue());
      } else if (argumentClass == Double.class) {
        arguments.pushDouble(((Double) argument).doubleValue());
      } else if (argumentClass == Float.class) {
        arguments.pushDouble(((Float) argument).doubleValue());
      } else if (argumentClass == String.class) {
        arguments.pushString(argument.toString());
      } else if (argumentClass == WritableNativeMap.class) {
        arguments.pushMap((WritableNativeMap) argument);
      } else if (argumentClass == WritableNativeArray.class) {
        arguments.pushArray((WritableNativeArray) argument);
      } else {
        throw new RuntimeException("Cannot convert argument of type " + argumentClass);
      }
    }
    return arguments;
  }

  /**
   * Convert an array to a {@link WritableArray}.
   *
   * @param array the array to convert. Supported types are: {@code String[]}, {@code Bundle[]},
   * {@code int[]}, {@code float[]}, {@code double[]}, {@code boolean[]}.
   *
   * @return the converted {@link WritableArray}
   * @throws IllegalArgumentException if the passed object is none of the above types
   */
  public static WritableArray fromArray(Object array) {
    WritableArray catalystArray = createArray();
    if (array instanceof String[]) {
      for (String v: (String[]) array) {
        catalystArray.pushString(v);
      }
    } else if (array instanceof Bundle[]) {
      for (Bundle v: (Bundle[]) array) {
        catalystArray.pushMap(fromBundle(v));
      }
    } else if (array instanceof int[]) {
      for (int v: (int[]) array) {
        catalystArray.pushInt(v);
      }
    } else if (array instanceof float[]) {
      for (float v: (float[]) array) {
        catalystArray.pushDouble(v);
      }
    } else if (array instanceof double[]) {
      for (double v: (double[]) array) {
        catalystArray.pushDouble(v);
      }
    } else if (array instanceof boolean[]) {
      for (boolean v: (boolean[]) array) {
        catalystArray.pushBoolean(v);
      }
    } else {
      throw new IllegalArgumentException("Unknown array type " + array.getClass());
    }
    return catalystArray;
  }

  /**
   * Convert a {@link Bundle} to a {@link WritableMap}. Supported key types in the bundle
   * are:
   *
   *

   *
primitive types: int, float, double, boolean

   *
arrays supported by {@link #fromArray(Object)}

   *
{@link Bundle} objects that are recursively converted to maps

   *

   *
   * @param bundle the {@link Bundle} to convert
   * @return the converted {@link WritableMap}
   * @throws IllegalArgumentException if there are keys of unsupported types
   */
  public static WritableMap fromBundle(Bundle bundle) {
    WritableMap map = createMap();
    for (String key: bundle.keySet()) {
      Object value = bundle.get(key);
      if (value == null) {
        map.putNull(key);
      } else if (value.getClass().isArray()) {
        map.putArray(key, fromArray(value));
      } else if (value instanceof String) {
        map.putString(key, (String) value);
      } else if (value instanceof Number) {
        if (value instanceof Integer) {
          map.putInt(key, (Integer) value);
        } else {
          map.putDouble(key, ((Number) value).doubleValue());
        }
      } else if (value instanceof Boolean) {
        map.putBoolean(key, (Boolean) value);
      } else if (value instanceof Bundle) {
        map.putMap(key, fromBundle((Bundle) value));
      } else {
        throw new IllegalArgumentException("Could not convert " + value.getClass());
      }
    }
    return map;
  }

  /**
   * Convert a {@link WritableMap} to a {@link Bundle}.
   * @param readableMap the {@link WritableMap} to convert.
   * @return the converted {@link Bundle}.
   */
  @Nullable
  public static Bundle toBundle(@Nullable ReadableMap readableMap) {
    if (readableMap == null) {
      return null;
    }

    ReadableMapKeySetIterator iterator = readableMap.keySetIterator();
    if (!iterator.hasNextKey()) {
      return null;
    }

    Bundle bundle = new Bundle();
    while (iterator.hasNextKey()) {
      String key = iterator.nextKey();
      ReadableType readableType = readableMap.getType(key);
      switch (readableType) {
        case Null:
          bundle.putString(key, null);
          break;
        case Boolean:
          bundle.putBoolean(key, readableMap.getBoolean(key));
          break;
        case Number:
          // Can be int or double.
          bundle.putDouble(key, readableMap.getDouble(key));
          break;
        case String:
          bundle.putString(key, readableMap.getString(key));
          break;
        case Map:
          bundle.putBundle(key, toBundle(readableMap.getMap(key)));
          break;
        case Array:
          // TODO t8873322
          throw new UnsupportedOperationException("Arrays aren't supported yet.");
        default:
          throw new IllegalArgumentException("Could not convert object with key: " + key + ".");
      }
    }

    return bundle;
  }
}