text:
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';

import { AppComponent } from './app.component';

import {VerySimpleComponent} from './very-simple.component';

import { routing } from "./app.routing";

@NgModule({
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    //InMemoryWebApiModule.forRoot(InMemoryDataService),
    routing
  ],
  declarations: [
    AppComponent,
    VerySimpleComponent
  ],
  providers: [
  ],
  bootstrap: [AppComponent]
})

export class AppModule {
}


text:
@extends('admin.layouts.dashboard')

@section('template_title')
  Welcome {{ $user->name }}
@endsection

@section('template_fastload_css')

@endsection

@section('content')

        NY Speaks - Menu Edit  {{ Lang::get('pages.dashboard-access-level',['access' => $access] ) }}

      {!! Breadcrumbs::render() !!}

<button class="btn btn-info" data-title="Create" data-toggle="modal" data-target="#create" >Top Menu</button>

                              <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>

Create Your Detail

                             {!! Form::open(['url' => 'menu_create']) !!}

Top Menu Label

                                <input class="form-control" name="menu_top_label" type="text">

Top Menu Link

                               <input class="form-control" name="menu_top_link" type="text">

                              <input type="submit" class="btn btn-warning btn-lg" style="width: 100%;" value="Create">

                           {!! Form::close() !!}

                            No
                            Top Menu Label
                            Top Menu Link
                            Edit
                            Delete

                            @foreach($menu_tops as $index => $menu_top)

                              {{$index+1}}
                              {{$menu_top->menu_top_label}}
                              {{$menu_top->menu_top_link}}

<button class="btn btn-primary btn-xs" data-title="Edit" data-toggle="modal" data-target="#edit{{$menu_top->menu_top_id}}" ></button>

<button class="btn btn-danger btn-xs" data-title="Delete" data-toggle="modal" data-target="#delete{{$menu_top->menu_top_id}}" ></button>

menu_top_id}}" tabindex="-1" role="dialog" aria-labelledby="edit" aria-hidden="true">

                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>

Edit Your Detail

                                   {!! Form::open(['url' => 'menu_update']) !!}

Menu Label

                                      <input type="hidden" name="menu_top_id" id="menu_top_id" value="{{$menu_top->menu_top_id}}">
                                      <input class="form-control" name="menu_top_label" type="text" value ="{{$menu_top->menu_top_label}}">

Menu Link

                                     <input class="form-control" name="menu_top_link" type="text" value ="{{$menu_top->menu_top_link}}">

                                    <input type="submit" class="btn btn-warning btn-lg" style="width: 100%;" value="Update">

                                 {!! Form::close() !!}

menu_top_id}}" tabindex="-1" role="dialog" aria-labelledby="edit" aria-hidden="true">

                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>

Edit Your Detail

                                   {!! Form::open(['url' => 'menu_delete']) !!}

Are you sure you want to delete ?

                                     <input type="hidden" name="menu_top_id" id="menu_top_id" value="{{$menu_top->menu_top_id}}">

                                    <input type="submit" class="btn btn-warning btn-lg" style="width: 100%;" value="Delete">

                                 {!! Form::close() !!}

                            @endforeach

<button class="btn btn-info" data-title="Create" data-toggle="modal" data-target="#create_main" >Main Menu</button>

                              <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>

Create Your Detail

                             {!! Form::open(['url' => 'main_menu_create']) !!}

Main Menu Label

                                <input class="form-control" name="menu_main_label" type="text">

Main Menu Link

                               <input class="form-control" name="menu_main_link" type="text">

                              <input type="submit" class="btn btn-warning btn-lg" style="width: 100%;" value="Create">

                           {!! Form::close() !!}

                            No
                            Top Menu Label
                            Top Menu Link
                            Edit
                            Delete

                            @foreach($menu_mains as $index => $menu_main)

                              {{$index+1}}
                              {{$menu_main->menu_main_label}}
                              {{$menu_main->menu_main_link}}

<button class="btn btn-primary btn-xs" data-title="Edit" data-toggle="modal" data-target="#edit_main{{$menu_main->menu_main_id}}" ></button>

<button class="btn btn-danger btn-xs" data-title="Delete" data-toggle="modal" data-target="#delete_main{{$menu_main->menu_main_id}}" ></button>

menu_main_id}}" tabindex="-1" role="dialog" aria-labelledby="edit" aria-hidden="true">

                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>

Edit Your Detail

                                   {!! Form::open(['url' => 'main_menu_update']) !!}

Menu Label

                                      <input type="hidden" name="menu_main_id" id="menu_main_id" value="{{$menu_main->menu_main_id}}">
                                      <input class="form-control" name="menu_main_label" type="text" value ="{{$menu_main->menu_main_label}}">

Menu Link

                                     <input class="form-control" name="menu_main_link" type="text" value ="{{$menu_main->menu_main_link}}">

                                    <input type="submit" class="btn btn-warning btn-lg" style="width: 100%;" value="Update">

                                 {!! Form::close() !!}

menu_main_id}}" tabindex="-1" role="dialog" aria-labelledby="edit" aria-hidden="true">

                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>

Edit Your Detail

                                   {!! Form::open(['url' => 'main_menu_delete']) !!}

Are you sure you want to delete ?

                                     <input type="hidden" name="menu_main_id" id="menu_main_id" value="{{$menu_main->menu_main_id}}">

                                    <input type="submit" class="btn btn-warning btn-lg" style="width: 100%;" value="Delete">

                                 {!! Form::close() !!}

                            @endforeach

<button class="btn btn-info" data-title="Create" data-toggle="modal" data-target="#create_left" >Left Menu</button>

                              <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>

Create Your Detail

                             {!! Form::open(['url' => 'left_menu_create']) !!}

Main Menu Label

                                <input class="form-control" name="menu_left_label" type="text">

Main Menu Link

                               <input class="form-control" name="menu_left_link" type="text">

                              <input type="submit" class="btn btn-warning btn-lg" style="width: 100%;" value="Create">

                           {!! Form::close() !!}

                            No
                            Top Menu Label
                            Top Menu Link
                            Edit
                            Delete

                            @foreach($menu_lefts as $index =>  $menu_left)

                              {{$index+1}}
                              {{$menu_left->menu_left_label}}
                              {{$menu_left->menu_left_link}}

<button class="btn btn-primary btn-xs" data-title="Edit" data-toggle="modal" data-target="#edit_left{{$menu_left->menu_left_id}}" ></button>

<button class="btn btn-danger btn-xs" data-title="Delete" data-toggle="modal" data-target="#delete_left{{$menu_left->menu_left_id}}" ></button>

menu_left_id}}" tabindex="-1" role="dialog" aria-labelledby="edit" aria-hidden="true">

                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>

Edit Your Detail

                                   {!! Form::open(['url' => 'left_menu_update']) !!}

Menu Label

                                      <input type="hidden" name="menu_left_id" id="menu_left_id" value="{{$menu_left->menu_left_id}}">
                                      <input class="form-control" name="menu_left_label" type="text" value ="{{$menu_left->menu_left_label}}">

Menu Link

                                     <input class="form-control" name="menu_left_link" type="text" value ="{{$menu_left->menu_left_link}}">

                                    <input type="submit" class="btn btn-warning btn-lg" style="width: 100%;" value="Update">

                                 {!! Form::close() !!}

menu_left_id}}" tabindex="-1" role="dialog" aria-labelledby="edit" aria-hidden="true">

                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>

Edit Your Detail

                                   {!! Form::open(['url' => 'left_menu_delete']) !!}

Are you sure you want to delete ?

                                     <input type="hidden" name="menu_left_id" id="menu_left_id" value="{{$menu_left->menu_left_id}}">

                                    <input type="submit" class="btn btn-warning btn-lg" style="width: 100%;" value="Delete">

                                 {!! Form::close() !!}

                            @endforeach

@endsection

@section('template_scripts')

    @include('admin.structure.dashboard-scripts')

@endsection

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Diagnostics.CodeAnalysis;
using GSoft.Dynamite.Globalization;
using GSoft.Dynamite.Logging;
using GSoft.Dynamite.Utils;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities;

namespace GSoft.Dynamite.Lists
{
    /// <summary>
    /// Utility to find lists
    /// </summary>
    public class ListLocator
    {
        private IResourceLocator _resources;
        private ILogger _logger;

        /// <summary>
        /// Creates a list finder
        /// </summary>
        /// <param name="resources">The resource locator</param>
        public ListLocator(IResourceLocator resources, ILogger logger)
        {
            this._resources = resources;
            this._logger = logger;
        }

        /// <summary>
        /// Find a list by its web-relative url
        /// </summary>
        /// <param name="web">The context's web</param>
        /// <param name="listUrl">The web-relative path to the list</param>
        /// <returns>The list</returns>
        [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Statics to be avoided in favor consistency with use of constructor injection for class collaborators.")]
        [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", MessageId = "1#", Justification = "List urls are available as strings through the ListUrls utility.")]
        public SPList GetByUrl(SPWeb web, string listUrl)
        {
            SPList list = null;

            try
            {
                list = web.GetList(SPUtility.ConcatUrls(web.ServerRelativeUrl, listUrl));
            }
            catch (ArgumentException)
            {
                this._logger.Warn("Failed to find list " + listUrl + " in web " + web.ServerRelativeUrl);
            }

            return list;
        }

        /// <summary>
        /// Find a list by its name's resource key
        /// </summary>
        /// <param name="web">The context's web</param>
        /// <param name="listNameResourceKey">The web-relative path to the list</param>
        /// <returns>The list</returns>
        public SPList GetByNameResourceKey(SPWeb web, string listNameResourceKey)
        {
            SPList list = null;
            string listName = string.Empty;

            try
            {
                listName = this._resources.Find(listNameResourceKey, (int)web.Language);

                if (!string.IsNullOrEmpty(listName))
                {
                    list = web.Lists[listName];
                }
            }
            catch (ArgumentException)
            {
                this._logger.Warn("Failed to find list from resource key " + listNameResourceKey + " in web " + web.ServerRelativeUrl);
            }

            return list;
        }
    }
}


text:
import { Autowired, Bean } from "../../context/context";
import { AgGridComponentFunctionInput, AgGridRegisteredComponentInput } from "./userComponentRegistry";
import { IComponent } from "../../interfaces/iComponent";
import { ComponentMetadata, ComponentMetadataProvider } from "./componentMetadataProvider";
import { ComponentClassDef, ComponentSource } from "./userComponentFactory";
import { ICellRendererComp, ICellRendererParams } from "../../rendering/cellRenderers/iCellRenderer";
import { BeanStub } from "../../context/beanStub";
import { loadTemplate } from "../../utils/dom";

@Bean("agComponentUtils")
export class AgComponentUtils extends BeanStub {

    @Autowired("componentMetadataProvider")
    private componentMetadataProvider: ComponentMetadataProvider;

    public adaptFunction<A extends IComponent<any> & B, B, TParams>(
        propertyName: string,
        hardcodedJsFunction: AgGridComponentFunctionInput,
        componentFromFramework: boolean,
        source: ComponentSource
    ): ComponentClassDef<A, B, TParams> | null {
        if (hardcodedJsFunction == null) {
            return {
                component: null,
                componentFromFramework: componentFromFramework,
                source: source,
                paramsFromSelector: null
            };
        }

        const metadata: ComponentMetadata = this.componentMetadataProvider.retrieve(propertyName);
        if (metadata && metadata.functionAdapter) {
            return {
                componentFromFramework: componentFromFramework,
                component: metadata.functionAdapter(hardcodedJsFunction) as { new(): A; },
                source: source,
                paramsFromSelector: null
            };
        }
        return null;
    }

    public adaptCellRendererFunction(callback: AgGridComponentFunctionInput): { new(): IComponent<ICellRendererParams>; } {
        class Adapter implements ICellRendererComp {
            private params: ICellRendererParams;

            refresh(params: ICellRendererParams): boolean {
                return false;
            }

            getGui(): HTMLElement {
                const callbackResult: string | HTMLElement = callback(this.params);
                const type = typeof callbackResult;
                if (type === 'string' || type === 'number' || type === 'boolean') {
                    return loadTemplate('<span>' + callbackResult + '</span>');
                }
                return callbackResult as HTMLElement;
            }

            init?(params: ICellRendererParams): void {
                this.params = params;
            }
        }

        return Adapter;
    }

    public doesImplementIComponent(candidate: AgGridRegisteredComponentInput<IComponent<any>>): boolean {
        if (!candidate) { return false; }
        return (candidate as any).prototype && 'getGui' in (candidate as any).prototype;
    }
}


text:
title:         SIGPLAN Conf Template Quickstart
thanks:        Thanks the wonderful `pandoc` project.
subtitle:      A Brief Introduction
author:
- name:        HANWEN WU
  affiliation: Boston University
  email:       hwwu@bu.edu
documentclass: sigplanconf
category:
- cr: D.3.1
  sub: Programming Languages
  third: Formal Definitions and Theory
- cr: F.3.2
  sub: Semantics of Programming Languages
  third: Process Models
bibliography: ../src/library
colorlinks: true
abstract:
    This report is a guide for using `pandoc` template
    for _SIGPLAN Conf_ submission. It comes with
    necessary `makefile`, templates, etc.
keywords:
    - pandoc
    - latex
acks:
    Thanks
---

# Introduction

This is a template for _SIGPLAN Conference_ using `pandoc` and a simple `makefile`.

## Template Variables

* `classoption`: a list of options
    - `preprint`
* `documentclass`: default to `sigplanconf`
* `keywords`: a list of keywords
* `terms`: a list of terms
* `thanks`
* PDF metadata
    * `short-title`: a short title for PDF meta
    * `short-authors`: a short description of all authors
* color links
    * `colorlinks`: boolean, default to `false`
    * `linkcolor`: default to `red`
    * `citecolor`: default to `green`
    * `urlcolor`: default to `cyan`
* `copyright`: an object of the following fields
    - `year`: e.g. `20yy`
    - `data`: e.g. `978-1-nnnn-nnnn-n/yy/mm`
    - `doi`: e.g. `nnnnnnn.nnnnnnn`
* `confinfo`: an object of the following fields
    - `short`: e.g. `CONF 'yy`
    - `detail`: e.g. `Month d--d, 20yy, City, ST, Country`
* `category`: a list of objects
    - `cr`: e.g. `D.3.1`
    - `sub`: e.g. `Programming Languages`
    - `third`: e.g. `Formal Definitions and Theory`
* `abstract`
* `acks`
* `biblio-style`: default to `abbrvnat`

## Bibliography Embedding

The `make pdfbib` command will embed all `bibitem` into the \LaTeX\ file, making it suitable for submission.

## Test Subsection

beaufin humility bitten epidemiography domination supersecret firelike Benzedrine bushveld bulldogged lunkhead Krzysztof unprecedentedness Monascidiae unmourned acyanoblepsia Trachomedusae cocorico talwar betafite celtuce indefensive clochette trinality

## Test References

[@Lucas:2001fz]

## Test Code Highlighting

``` {.c .numberLines startFrom="100"}
int foo (int a, int b) = a + b;
int foo (int a, int b) = a + b;

int foo (int a, int b) = a + b;
int foo (int a, int b) = a + b;
int foo (int a, int b) = a + b;
int foo (int a, int b) = a + b;
int foo (int a, int b) = a + b;
```

## Test `Proof` Environment

<!-- \begin{proof}
    Use $K_\lambda$ and $S_\lambda$ to...
\end{proof} -->


text:
<?php namespace Completionist\Tests\Units;

require_once $_SERVER["DOCUMENT_ROOT"]."\lib\Dao\Users.php";

use Completionist\Tests\Functions as Tests;
use Completionist\Dao\Users as Users;

/***********************************************
* Adding users
***********************************************/
Users::insert("test1", "", "testhash");
Users::insert("test2", "", "testhash");

/**********************************************/

/***********************************************
* Tests on Users->role select/update
***********************************************/
$list = array();

$result = Users::setRole(1, "admin");
$list[] = array(
    "Users->role: 1 row affected",
    1,
    $result->rowCount
);

$result = Users::setRole(2, "poweruser");
$list[] = array(
    "Users->role: 1 row affected",
    1,
    $result->rowCount
);

$result = Users::getRole(1);
$list[] = array(
    "Users->role: check value userid=1",
    "admin",
    $result
);
/**********************************************/

Tests::run("Users->role", $list);


text:
import * as React from 'react';
import { shallow } from 'enzyme';
import { Donation } from './';

test('should render Donation component properly', () => {
  const total = 1345;
  const goal = 5000;
  const component = shallow(
    <Donation total={total} goal={goal}/>
  );
  expect(component).toMatchSnapshot();
});


text:
function multiformset( options ) {

    // Create some defaults, extending them with any options that were provided
    var settings = $.extend( {
        'template_selector' : '.form_template',
        'add_form_selector' : '#multiformset-add_form',
        'form_chooser_selector' : '#multiformset-form_chooser',
        'new_form_parent' : '#multiformset-new_forms',
        'template_value_attr': 'data-form-class',
        'template_text_attr': 'data-multiformset-title',
        'add_form_callback': null

    }, options);

    var $chooser = $(settings.form_chooser_selector);
    $(settings.template_selector).each(function(idx, el) {
        var $el = $(el);
        $chooser.append($("<option></option>")
            .attr("value", $el.attr(settings.template_value_attr))
            .text($el.attr(settings.template_text_attr)));
    });
    $(settings.add_form_selector).click(function(evt) {
        // don't submit if this input happens to be within the form
        evt.preventDefault();

        // update total form count
        var form_name = $chooser.val();
        var $total_forms = $("#id_" + form_name + "-TOTAL_FORMS");
        var qty = parseInt($total_forms.val());
        $total_forms.val(qty + 1);

        // copy the template and replace prefixes with the correct index
        var html = $("#" + form_name + "-form_template").clone().html().replace(/__prefix__/g, qty);
        $(settings.new_form_parent).append(html);

        if (settings.add_form_callback) {
            settings.add_form_callback(html);
        }
    });

}


text:
package com.ogaclejapan.qiitanium.presentation.viewmodel;

import com.ogaclejapan.qiitanium.domain.model.Tag;
import com.ogaclejapan.rx.binding.RxReadOnlyProperty;

public class TagViewModel extends AppViewModel {

  private final Tag tag;

  protected TagViewModel(Tag tag) {
    this.tag = tag;
  }

  public static TagViewModel create(final Tag tag) {
    return new TagViewModel(tag);
  }

  public String id() {
    return tag.id;
  }

  public RxReadOnlyProperty<String> name() {
    return tag.name;
  }

  public static class Mapper extends AppModelMapper<Tag, TagViewModel> {

    @Override
    public TagViewModel call(final Tag model) {
      return create(model);
    }

  }
}


text:
// Copyright (C) 2014 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 12.2.5
description: >
    to name, accessor side effects 3
includes: [compareArray.js]
---*/
var counter = 0;
var key1 = {
  toString: function() {
    assert.sameValue(counter++, 0, "The result of `counter++` is `0`");
    return 'b';
  }
};
var key2 = {
  toString: function() {
    assert.sameValue(counter++, 1, "The result of `counter++` is `1`");
    return 'd';
  }
};
class C {
  a() { return 'A'; }
  [key1]() { return 'B'; }
  c() { return 'C'; }
  [key2]() { return 'D'; }
}
assert.sameValue(counter, 2, "The value of `counter` is `2`");
assert.sameValue(new C().a(), 'A', "`new C().a()` returns `'A'`. Defined as `a() { return 'A'; }`");
assert.sameValue(new C().b(), 'B', "`new C().b()` returns `'B'`. Defined as `[key1]() { return 'B'; }`");
assert.sameValue(new C().c(), 'C', "`new C().c()` returns `'C'`. Defined as `c() { return 'C'; }`");
assert.sameValue(new C().d(), 'D', "`new C().d()` returns `'D'`. Defined as `[key2]() { return 'D'; }`");
assert(
  compareArray(Object.keys(C.prototype), []),
  "`compareArray(Object.keys(C.prototype), [])` returns `true`"
);
assert(
  compareArray(Object.getOwnPropertyNames(C.prototype), ['constructor', 'a', 'b', 'c', 'd']),
  "`compareArray(Object.getOwnPropertyNames(C.prototype), ['constructor', 'a', 'b', 'c', 'd'])` returns `true`"
);


text:
namespace policy {

namespace {

// Custom request context implementation that allows to override the user agent,
// amongst others. Wraps a baseline request context from which we reuse the
// networking components.
class DeviceManagementRequestContext : public net::URLRequestContext {
 public:
  explicit DeviceManagementRequestContext(net::URLRequestContext* base_context);
  virtual ~DeviceManagementRequestContext();

 private:
  // Overridden from net::URLRequestContext:
  virtual const std::string& GetUserAgent(const GURL& url) const;
};

DeviceManagementRequestContext::DeviceManagementRequestContext(
    net::URLRequestContext* base_context) {
  // Share resolver, proxy service and ssl bits with the baseline context. This
  // is important so we don't make redundant requests (e.g. when resolving proxy
  // auto configuration).
  set_net_log(base_context->net_log());
  set_host_resolver(base_context->host_resolver());
  set_proxy_service(base_context->proxy_service());
  set_ssl_config_service(base_context->ssl_config_service());

  // Share the http session.
  set_http_transaction_factory(
      new net::HttpNetworkLayer(
          base_context->http_transaction_factory()->GetSession()));

  // No cookies, please.
  set_cookie_store(new net::CookieMonster(NULL, NULL));

  // Initialize these to sane values for our purposes.
  set_accept_language("*");
  set_accept_charset("*");
}

DeviceManagementRequestContext::~DeviceManagementRequestContext() {
  delete http_transaction_factory();
}

const std::string& DeviceManagementRequestContext::GetUserAgent(
    const GURL& url) const {
  return webkit_glue::GetUserAgent(url);
}

// Request context holder.
class DeviceManagementRequestContextGetter
    : public net::URLRequestContextGetter {
 public:
  DeviceManagementRequestContextGetter(
      net::URLRequestContextGetter* base_context_getter)
      : base_context_getter_(base_context_getter) {}

  // Overridden from net::URLRequestContextGetter:
  virtual net::URLRequestContext* GetURLRequestContext();
  virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const;

 private:
  scoped_refptr<net::URLRequestContext> context_;
  scoped_refptr<net::URLRequestContextGetter> base_context_getter_;
};

net::URLRequestContext*
DeviceManagementRequestContextGetter::GetURLRequestContext() {
  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
  if (!context_) {
    context_ = new DeviceManagementRequestContext(
        base_context_getter_->GetURLRequestContext());
  }

  return context_.get();
}

scoped_refptr<base::MessageLoopProxy>
DeviceManagementRequestContextGetter::GetIOMessageLoopProxy() const {
  return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
}

}  // namespace

DeviceManagementService::~DeviceManagementService() {
  // All running jobs should have been canceled by now. If not, there are
  // backend objects still around, which is an error.
  DCHECK(pending_jobs_.empty());
  DCHECK(queued_jobs_.empty());
}

DeviceManagementBackend* DeviceManagementService::CreateBackend() {
  return new DeviceManagementBackendImpl(this);
}

void DeviceManagementService::Initialize(
    net::URLRequestContextGetter* request_context_getter) {
  DCHECK(!request_context_getter_);
  request_context_getter_ =
      new DeviceManagementRequestContextGetter(request_context_getter);
  while (!queued_jobs_.empty()) {
    StartJob(queued_jobs_.front());
    queued_jobs_.pop_front();
  }
}

void DeviceManagementService::Shutdown() {
  for (JobFetcherMap::iterator job(pending_jobs_.begin());
       job != pending_jobs_.end();
       ++job) {
    delete job->first;
    queued_jobs_.push_back(job->second);
  }
  pending_jobs_.clear();
}

DeviceManagementService::DeviceManagementService(
    const std::string& server_url)
    : server_url_(server_url) {
}

void DeviceManagementService::AddJob(DeviceManagementJob* job) {
  if (request_context_getter_.get())
    StartJob(job);
  else
    queued_jobs_.push_back(job);
}

void DeviceManagementService::RemoveJob(DeviceManagementJob* job) {
  for (JobFetcherMap::iterator entry(pending_jobs_.begin());
       entry != pending_jobs_.end();
       ++entry) {
    if (entry->second == job) {
      delete entry->first;
      pending_jobs_.erase(entry);
      return;
    }
  }

  const JobQueue::iterator elem =
      std::find(queued_jobs_.begin(), queued_jobs_.end(), job);
  if (elem != queued_jobs_.end())
    queued_jobs_.erase(elem);
}

void DeviceManagementService::StartJob(DeviceManagementJob* job) {
  URLFetcher* fetcher = URLFetcher::Create(0, job->GetURL(server_url_),
                                           URLFetcher::POST, this);
  fetcher->set_load_flags(net::LOAD_DO_NOT_SEND_COOKIES |
                          net::LOAD_DO_NOT_SAVE_COOKIES |
                          net::LOAD_DISABLE_CACHE);
  fetcher->set_request_context(request_context_getter_.get());
  job->ConfigureRequest(fetcher);
  pending_jobs_[fetcher] = job;
  fetcher->Start();
}

void DeviceManagementService::OnURLFetchComplete(
    const URLFetcher* source,
    const GURL& url,
    const net::URLRequestStatus& status,
    int response_code,
    const ResponseCookies& cookies,
    const std::string& data) {
  JobFetcherMap::iterator entry(pending_jobs_.find(source));
  if (entry != pending_jobs_.end()) {
    DeviceManagementJob* job = entry->second;
    pending_jobs_.erase(entry);
    job->HandleResponse(status, response_code, cookies, data);
  } else {
    NOTREACHED() << "Callback from foreign URL fetcher";
  }
  delete source;
}

}  // namespace policy


text:
"use strict";

const EventTarget = require("./generated/EventTarget");

function XMLHttpRequestEventTarget() {
  if (!new.target) {
    throw new TypeError("DOM object constructor cannot be called as a function.");
  }
  EventTarget.setup(this);
  this.onabort = null;
  this.onerror = null;
  this.onload = null;
  this.onloadend = null;
  this.onloadstart = null;
  this.onprogress = null;
  this.ontimeout = null;
}

XMLHttpRequestEventTarget.prototype = Object.create(EventTarget.interface.prototype);
Object.defineProperty(XMLHttpRequestEventTarget.prototype, Symbol.toStringTag, {
  value: "XMLHttpRequestEventTarget",
  writable: false,
  enumerable: false,
  configurable: true
});

module.exports = function (core) {
  core.XMLHttpRequestEventTarget = XMLHttpRequestEventTarget;
};


text:
import sublime
import sublime_plugin
from collections import defaultdict
from common import get_setting

ERRORS = {}
WARNINGS = {}

ERROR = "error"
WARNING = "warning"
clang_view = None

class ClangNext(sublime_plugin.TextCommand):
    def run(self, edit):
        v = self.view
        fn = v.file_name().encode("utf-8")
        line, column = v.rowcol(v.sel()[0].a)
        gotoline = -1
        if fn in ERRORS:
            for errLine in ERRORS[fn]:
                if errLine > line:
                    gotoline = errLine
                    break
        if fn in WARNINGS:
            for warnLine in WARNINGS[fn]:
                if warnLine > line:
                    if gotoline == -1 or warnLine < gotoline:
                        gotoline = warnLine
                    break
        if gotoline != -1:
            v.window().open_file("%s:%d" % (fn, gotoline + 1), sublime.ENCODED_POSITION)
        else:
            sublime.status_message("No more errors or warnings!")

class ClangPrevious(sublime_plugin.TextCommand):
    def run(self, edit):
        v = self.view
        fn = v.file_name().encode("utf-8")
        line, column = v.rowcol(v.sel()[0].a)
        gotoline = -1
        if fn in ERRORS:
            for errLine in ERRORS[fn]:
                if errLine < line:
                    gotoline = errLine
        if fn in WARNINGS:
            for warnLine in WARNINGS[fn]:
                if warnLine < line:
                    if gotoline == -1 or warnLine > gotoline:
                        gotoline = warnLine
        if gotoline != -1:
            v.window().open_file("%s:%d" % (fn, gotoline + 1), sublime.ENCODED_POSITION)
        else:
            sublime.status_message("No more errors or warnings!")

class ClangErrorPanel(object):
    def __init__(self):
        self.view = None
        self.data = ""

    def set_data(self, data):
        self.data = data.decode("utf-8")
        if get_setting("update_output_panel", True) and self.is_visible():
            self.flush()

    def get_view(self):
        return self.view

    def is_visible(self, window=None):
        ret = self.view != None and self.view.window() != None
        if ret and window:
            ret = self.view.window().id() == window.id()
        return ret

    def set_view(self, view):
        self.view = view

    def flush(self):
        self.view.set_read_only(False)
        self.view.set_scratch(True)
        e = self.view.begin_edit()
        self.view.erase(e, sublime.Region(0, self.view.size()))
        self.view.insert(e, 0, self.data)
        self.view.end_edit(e)
        self.view.set_read_only(True)

    def open(self, window=None):
        if window == None:
            window = sublime.active_window()
        if not self.is_visible(window):
            self.view = window.get_output_panel("clang")
            self.view.settings().set("result_file_regex", "^(.+):([0-9]+),([0-9]+)")
            if get_setting("output_panel_use_syntax_file", False):
                fileName = get_setting("output_panel_syntax_file", None)
                if fileName is not None:
                    self.view.set_syntax_file(fileName)
        self.flush()

        window.run_command("show_panel", {"panel": "output.clang"})

    def close(self):
        sublime.active_window().run_command("hide_panel", {"panel": "output.clang"})

    def highlight_panel_row(self):
        if self.view is None:
            return
        view = sublime.active_window().active_view()
        row, col = view.rowcol(view.sel()[0].a)
        str = "%s:%d" % (view.file_name(), (row + 1))
        r = self.view.find(str.replace('\\','\\\\'), 0)
        panel_marker = get_setting("marker_output_panel_scope", "invalid")
        if r == None:
            self.view.erase_regions('highlightText')
        else:
            regions = [self.view.full_line(r)]
            self.view.add_regions('highlightText', regions, panel_marker, 'dot', sublime.DRAW_OUTLINED)

clang_error_panel = ClangErrorPanel()

def clear_error_marks():
    global ERRORS, WARNINGS

    listdict = lambda: defaultdict(list)
    ERRORS = defaultdict(listdict)
    WARNINGS = defaultdict(listdict)

def add_error_mark(severity, filename, line, message):
    if severity.lower() == ERROR:
        ERRORS[filename][line].append(message)
    else:
        WARNINGS[filename][line].append(message)

def show_error_marks(view):
    '''Adds error marks to view.'''
    erase_error_marks(view)
    if not get_setting("show_visual_error_marks", True):
        return
    fill_outlines = False
    gutter_mark = 'dot'
    outlines = {'warning': [], 'illegal': []}
    fn = view.file_name().encode("utf-8")
    markers = {'warning':  get_setting("marker_warning_scope", "comment"),
                'illegal': get_setting("marker_error_scope", "invalid")
                }

    for line in ERRORS[fn].keys():
        outlines['illegal'].append(view.full_line(view.text_point(line, 0)))
    for line in WARNINGS[fn].keys():
        outlines['warning'].append(view.full_line(view.text_point(line, 0)))

    for lint_type in outlines:
        if outlines[lint_type]:
            args = [
                'sublimeclang-outlines-{0}'.format(lint_type),
                outlines[lint_type],
                markers[lint_type],
                gutter_mark
            ]
            if not fill_outlines:
                args.append(sublime.DRAW_OUTLINED)
            view.add_regions(*args)

def erase_error_marks(view):
    '''erase all error marks from view'''
    view.erase_regions('sublimeclang-outlines-illegal')
    view.erase_regions('sublimeclang-outlines-warning')

def last_selected_lineno(view):
    return view.rowcol(view.sel()[0].end())[0]

def update_statusbar(view):
    fn = view.file_name()
    if fn is not None:
        fn = fn.encode("utf-8")
    lineno = last_selected_lineno(view)

    if fn in ERRORS and lineno in ERRORS[fn]:
        view.set_status('SublimeClang_line', "Error: %s" % '; '.join(ERRORS[fn][lineno]))
    elif fn in WARNINGS and lineno in WARNINGS[fn]:
        view.set_status('SublimeClang_line', "Warning: %s" % '; '.join(WARNINGS[fn][lineno]))
    else:
        view.erase_status('SublimeClang_line')

class SublimeClangStatusbarUpdater(sublime_plugin.EventListener):
    ''' This EventListener will show the error messages for the current
    line in the statusbar when the current line changes.
    '''

    def __init__(self):
        super(SublimeClangStatusbarUpdater, self).__init__()
        self.lastSelectedLineNo = -1

    def is_enabled(self):
        return True

    def on_selection_modified(self, view):
        if view.is_scratch():
            return

        # We only display errors in the status bar for the last line in the current selection.
        # If that line number has not changed, there is no point in updating the status bar.
        lastSelectedLineNo = last_selected_lineno(view)

        if lastSelectedLineNo != self.lastSelectedLineNo:
            self.lastSelectedLineNo = lastSelectedLineNo
            update_statusbar(view)
            clang_error_panel.highlight_panel_row()

    def has_errors(self, view):
        fn = view.file_name()
        if fn is None:
            return False
        return fn.encode("utf-8") in ERRORS or fn in WARNINGS

    def show_errors(self, view):
        if self.has_errors(view) and not get_setting("error_marks_on_panel_only", False, view):
            show_error_marks(view)

    def on_activated(self, view):
        self.show_errors(view)

    def on_load(self, view):
        self.show_errors(view)


text:
layout: post
title:  "20tab: nuovo Partner del PGDay.iT"
date:   2017-09-07 04:00:00
isStaticPost: false
permalink: /it/blog/20tab
lang: it
ref: 20tab
redirect-from:
 - /blog/20tab
---

Nuovo Partner del PGDay.IT ma non nuovo a PostgreSQL: un caldo benvenuto a 20tab.

Abbiamo chiesto a [Gabriele Giaccari](https://www.linkedin.com/in/gabriele-giaccari-1502a837/), co-fondatore di [20tab](http://www.20tab.com/) insieme a [Roberto De Ioris](https://www.linkedin.com/in/roberto-de-ioris-a1311013/) e [Raffaele Colace](https://www.linkedin.com/in/raffaele-colace-9217771b/), perché ha ritenuto opportuno per [20tab](http://www.20tab.com/) s.r.l.
essere Partner del PGDay.IT edizione 2017.

Questo è ciò che ci ha detto:

_"20tab utilizza Postgres per tutti i propri progetti fin dalla fondazione, nel 2012, per clienti privati, pubblica amministrazione e progetti interni._

_Questa scelta ci ha sempre dato grandi soddisfazioni e cerchiamo di utilizzare lo strumento nelle sue forme più avanzate, come le recenti implementazioni per la ricerca full-text._

_Da sempre cerchiamo anche di dare il nostro contributo alla community a livello economico e proponendo talk."_

Grazie per essere parte del del PGDay.IT!

**Chi è 20tab?**

Il team [20tab](http://www.20tab.com/) si occupa di sviluppo software principalmente in python per grandi Aziende o Organizzazioni internazionali.

Ideale proseguimento del percorso intrapreso dalla società 'madre' Unbit con prodotti quali uWSGI e UnrealEnginePython, è molto attiva anche a livello di formazione e nel settore del gaming e della simulazione 3D.


text:
package cn.momia.common.deal.gateway.alipay;

import cn.momia.common.deal.gateway.PrepayResult;

public class AlipayPrepayResult extends PrepayResult {
    public static class Field {
        public static final String SERVICE = "service";
        public static final String PARTNER = "partner";
        public static final String INPUT_CHARSET = "_input_charset";
        public static final String SIGN_TYPE = "sign_type";
        public static final String SIGN = "sign";
        public static final String NOTIFY_URL = "notify_url";
        public static final String OUT_TRADE_NO = "out_trade_no";
        public static final String SUBJECT = "subject";
        public static final String PAYMENT_TYPE = "payment_type";
        public static final String SELLER_ID = "seller_id";
        public static final String TOTAL_FEE = "total_fee";
        public static final String BODY = "body";
        public static final String IT_B_PAY = "it_b_pay";
        public static final String SHOW_URL = "show_url";
        public static final String RETURN_URL = "return_url";
    }

    public String getService() {
        return get(Field.SERVICE);
    }

    public String getPartner() {
        return get(Field.PARTNER);
    }

    public String get_input_charset() {
        return get(Field.INPUT_CHARSET);
    }

    public String getSign_type() {
        return get(Field.SIGN_TYPE);
    }

    public String getSign() {
        return get(Field.SIGN);
    }

    public String getNotify_url() {
        return get(Field.NOTIFY_URL);
    }

    public String getOut_trade_no() {
        return get(Field.OUT_TRADE_NO);
    }

    public String getSubject() {
        return get(Field.SUBJECT);
    }

    public String getPayment_type() {
        return get(Field.PAYMENT_TYPE);
    }

    public String getSeller_id() {
        return get(Field.SELLER_ID);
    }

    public String getTotal_fee() {
        return get(Field.TOTAL_FEE);
    }

    public String getBody() {
        return get(Field.BODY);
    }

    public String getIt_b_pay() {
        return get(Field.IT_B_PAY);
    }

    public String getShow_url() {
        return get(Field.SHOW_URL);
    }

    public String getReturn_url() {
        return get(Field.RETURN_URL);
    }
}


text:
package org.ddt.moniker;

import org.ddt.ByteArrayUtils;
import org.apache.poi.hpsf.ClassID;
import org.apache.poi.poifs.filesystem.DocumentInputStream;
import org.apache.poi.util.LittleEndianByteArrayInputStream;
import org.junit.*;
import static org.junit.Assert.*;

/**
 *
 * @author Niklas Rehfeld
 */
public class MonikerFactoryTest
{

    private static byte[] validUrlMoniker ;
    private static byte[] validFileMoniker;
    private static byte[] validCompositeMoniker;

    public MonikerFactoryTest()
    {
    }
/*
    @BeforeClass
    public static void setUpClass() throws Exception
    {
        String s  = "http://bla.com/foo";
        int length = s.length() + 24;
        validUrlMoniker = new byte[0];
        validUrlMoniker = ByteArrayUtils.addInt(validUrlMoniker, length);
        validUrlMoniker = ByteArrayUtils.addString(validUrlMoniker, s, false);
        validUrlMoniker = ByteArrayUtils.addBytes(validUrlMoniker, MonikerFactory.MONIKER_TYPE_URL);
        validUrlMoniker = ByteArrayUtils.addInt(validUrlMoniker, 0);
        validUrlMoniker = ByteArrayUtils.addInt(validUrlMoniker, 0); //no flags, not really realistic.

        s = "some/path/of/sorts";
        validFileMoniker = new byte[0];
        validFileMoniker = ByteArrayUtils.addShort(validFileMoniker, (short)1);
        validFileMoniker = ByteArrayUtils.addShort(validFileMoniker, (short) s.length());
        validFileMoniker = ByteArrayUtils.addString(validFileMoniker, s, false);
        validFileMoniker = ByteArrayUtils.addShort(validFileMoniker, (short)0xffff);//not a UNC path
        validFileMoniker = ByteArrayUtils.addShort(validFileMoniker, (short)0xDEAD); //version
        validFileMoniker = ByteArrayUtils.addLong(validFileMoniker, 0); //20 bytes of reserved
        validFileMoniker = ByteArrayUtils.addLong(validFileMoniker, 0);
        validFileMoniker = ByteArrayUtils.addInt(validFileMoniker, 0);
        validFileMoniker = ByteArrayUtils.addLong(validFileMoniker, 0); //no unicode.

    }
*/
    @AfterClass
    public static void tearDownClass() throws Exception
    {
    }

    @Before
    public void setUp()
    {
        System.out.println("MonikerFactory Unit tests not implemented.");
    }

    @After
    public void tearDown()
    {
    }

    /**
     * Test of getMoniker method, of class MonikerFactory.
     */
    @Test
    public void testGetURLMoniker() throws Exception
    {
//        Moniker m = MonikerFactory.getMoniker(MonikerFactory.URL_MONIKER_ID, new LittleEndianByteArrayInputStream(validUrlMoniker));

    }

    @Test
    public void testGetFileMoniker() throws Exception
    {
    }

    @Test
    public void testGetCompositeMoniker() throws Exception
    {
    }
}


text:
<?php

namespace Deniaz\Test\Terrific\Twig\TokenParser;

use Deniaz\Terrific\Provider\ContextProviderInterface;
use Deniaz\Terrific\Twig\TokenParser\ComponentTokenParser;

/**
 * Class ComponentTokenParser.
 *
 * @TODO Maybe implement test for the Parser.
 */
class ComponentTokenParserTest extends \PHPUnit_Framework_TestCase
{
    public function testGetTag()
    {
        $stub = $this->getMockBuilder(ContextProviderInterface::class)->getMock();
        $parser = new ComponentTokenParser($stub);
        $this->assertEquals('component', $parser->getTag());
    }

//    public function testParse()
//    {
//        $tokenParser = new ComponentTokenParser();
//        $parser = $this->getMockBuilder('Twig_Parser')->getMock();
//        $token = $this->getMockBuilder('Twig_Token')->getMock();
//
//        $tokenParser->setParser($parser);
//        $this->assertInstanceOf(ComponentNode::class, $tokenParser->parse($token));
//    }
}


text:
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copies of the Software, and to permit persons to whom the Software is furnished
#to do so, subject to the following conditions:

#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
#INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
#PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
#HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
#OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
#SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

import math
import sys,string,os
sys.path.insert(1, os.path.join(sys.path[0], '..')) ### import parent dir dependencies
import os.path
import unique

def filepath(filename):
    fn = unique.filepath(filename)
    return fn

def read_directory(sub_dir):
    dir_list = unique.read_directory(sub_dir); dir_list2 = []
    for entry in dir_list:
        if entry[-4:] == ".txt" or entry[-4:] == ".csv":
            dir_list2.append(entry)
    return dir_list2

def eliminate_redundant_dict_values(database):
    db1={}
    for key in database:
        list = unique.unique(database[key])
        list.sort()
        db1[key] = list
    return db1

def parse_affymetrix_annotations(filename):
    temp_affy_db = {}
    x=0
    fn=filepath(filename)
    for line in open(fn,'rU').xreadlines():
        probeset_data,null = string.split(line,'\n')  #remove endline
        affy_data = string.split(probeset_data[1:-1],'","')  #remove endline
        if x==0:
            if probeset_data[0] == '#':
                continue
            x +=1
            affy_headers = affy_data
        else:
            x +=1
            probesets = affy_data[0]
            temp_affy_db[probesets] = affy_data[1:]
    for header in affy_headers:
        x = 0; eg = ''; gs = ''
        while x < len(affy_headers):
            if 'rocess' in affy_headers[x]: gb = x - 1
            if 'omponent' in affy_headers[x]: gc = x - 1
            if 'olecular' in affy_headers[x]: gm = x - 1
            if 'athway' in affy_headers[x]: gp = x - 1
            if 'Gene Symbol' in affy_headers[x]: gs = x - 1
            if 'Ensembl' in affy_headers[x]: eg = x - 1
            x += 1
        ###Below code used if human exon array parsed
        global analyze_human_exon_data
        analyze_human_exon_data = 'no'
        if eg == '':
            x = 0
            while x < len(affy_headers):
                if 'mrna_assignment' in affy_headers[x]:
                    eg = x - 1
                    analyze_human_exon_data = 'yes'
                x+=1
    for probeset in temp_affy_db:
        affy_data = temp_affy_db[probeset]
        try:
            go_bio = affy_data[gb]
        except IndexError:
            ###Occurs due to a new line error
            continue
        go_com = affy_data[gc]
        go_mol = affy_data[gm]
        genmapp = affy_data[gp]
        if gs == '': symbol = ''
        else: symbol = affy_data[gs]
        if analyze_human_exon_data == 'no':
            ensembl = affy_data[eg]
        else:
            ensembl_data = affy_data[eg]
            ensembl=''
            try:
                if 'gene:ENSMUSG' in ensembl_data:
                    ensembl_data = string.split(ensembl_data,'gene:ENSMUSG')
                    ensembl_data = string.split(ensembl_data[1],' ')
                    ensembl = 'ENSMUSG'+ ensembl_data[0]
                if 'gene:ENSG' in ensembl_data:
                    ensembl_data = string.split(ensembl_data,'gene:ENSG')
                    ensembl_data = string.split(ensembl_data[1],' ')
                    ensembl = 'ENSG'+ ensembl_data[0]
            except IndexError:
                continue
        goa=[]

        goa = merge_go_annoations(go_bio,goa)
        goa = merge_go_annoations(go_com,goa)
        goa = merge_go_annoations(go_mol,goa)
        goa = merge_go_annoations(genmapp,goa)

        goa=unique.unique(goa); goa.sort();
        goa = string.join(goa,'')
        try:
            ensembl = string.split(ensembl,' /// ')
        except ValueError:
            ensembl = [ensembl]
        for ensembl_id in ensembl:
            if len(goa)>10:
                go_annotations[ensembl_id] = goa, symbol

def merge_go_annoations(go_category,goa):
    dd = ' // '
    td = ' /// '
    if td in go_category:
        go_split = string.split(go_category,td)
        for entry in go_split:
          if analyze_human_exon_data == 'no':
            try:
                a,b,null = string.split(entry,dd )
                entry = b+dd
                goa.append(entry)
            except ValueError:
                ###occurs with GenMAPP entries
                a,null = string.split(entry,dd )
                entry = a+dd
                goa.append(entry)
          else:
            try:
                f,a,b,null = string.split(entry,dd )
                entry = b+dd
                goa.append(entry)
            except ValueError:
                ###occurs with GenMAPP entries
                f,null,a = string.split(entry,dd )
                entry = a+dd
                goa.append(entry)
    else:
        if go_category != '---':
            if dd in go_category:
              if analyze_human_exon_data == 'no':
                try:
                    a,null = string.split(go_category,dd)
                    entry = a+dd
                except ValueError:
                    a,b,null = string.split(go_category,dd )
                    entry = b+dd
                goa.append(entry)
              else:
                try:
                    f,null,a = string.split(go_category,dd)
                    entry = a+dd
                except ValueError:
                    f,a,b,null = string.split(go_category,dd )
                    entry = b+dd
                goa.append(entry)
            else:
                goa.append(go_category)
    return goa

def getDirectoryFiles(dir,species):
    dir_list = read_directory('/AltDatabase/'+species+'/exon')  #send a sub_directory to a function to identify all files in a directory
    for data in dir_list:    #loop through each file in the directory to output results
        affy_data_dir = dir[1:]+'/'+data
        if 'MoEx-1_0-st-transcript-annot.csv' in affy_data_dir and species == 'Mm':
            transcript_annotation_file = affy_data_dir
        elif 'HuEx-1_0-st-transcript-annot.csv' in affy_data_dir and species == 'Hs':
            transcript_annotation_file = affy_data_dir
        elif 'annot.hg' in affy_data_dir:
            probeset_transcript_file = affy_data_dir
    return transcript_annotation_file

def parseAffyGO(use_exon_data,get_splicing_factors,species):
    print "Parsing out Affymetrix GO annotations"
    global go_annotations; go_annotations={}
    import_dir = '/AltDatabase/affymetrix/'+species+'/'
    dir_list = read_directory(import_dir)  #send a sub_directory to a function to identify all files in a directory
    for affy_data in dir_list:    #loop through each file in the directory to output results
        affy_data_dir = import_dir[1:]+affy_data
        if use_exon_data == 'yes':
            affy_data_dir = getDirectoryFiles('/AltDatabase/'+species+'/exon',species)
        try: parse_affymetrix_annotations(affy_data_dir)
        except Exception: null=[]
    print len(go_annotations),"Ensembl gene annotations parsed"
    if get_splicing_factors == 'yes':
        go = go_annotations; mRNA_processing_ensembl=[]
        for entry in go_annotations:
            if 'splicing' in go[entry][0] or ('mRNA' in go[entry][0] and 'processing' in go[entry][0]):
                mRNA_processing_ensembl.append(entry)
        print len(mRNA_processing_ensembl),"mRNA processing/splicing regulators identified"
        return mRNA_processing_ensembl
    else:
        return go_annotations

if __name__ == '__main__':
    go = parseAffyGO('yes','no','Hs')


text:
package com.opengamma.sdk.margin;

import org.joda.beans.ImmutableBean;

/**
 * A detailed breakdown of the margin calculation.
 */
public abstract class MarginDetail implements ImmutableBean {
  // this implements ImmutableBean so that the Joda-Beans deserialization code kicks in
  // and uses MarginDetailDeserializer to select the correct subtype

  // restrict construction to this package
  MarginDetail() {
  }

  /**
   * Gets the CCP.
   *
   * @return the CCP
   */
  public abstract Ccp getCcp();

}


text:
// ### Brief IAT
//
// You can find the images used for this task [here](https://github.com/minnojs/minno-time/tree/gh-pages/images)
// and the templates [here](https://github.com/minnojs/minno-time/tree/gh-pages/resources/BIAT).
//
// ** This example is intended for educational purposes only. If you want to actually use this type of task, please see the [extensions page](https://app-prod-03.implicit.harvard.edu/implicit/common/all/js/pip/piscripts/ydocs/dist/index.html). **
define(['pipAPI','pipScorer'], function(APIConstructor,Scorer) {

    var API = new APIConstructor();
    var scorer = new Scorer();

    // Preset the attribute and category names
    var attribute1 = 'Pleasant';
    var attribute2 = 'Unpleasant';
    var category1 = 'Black People';
    var category2 = 'White People';
    var practiceCategory1 = 'Birds';
    var practiceCategory2= 'Mammals';

    // Canvas settings
    API.addSettings('canvas',{
        maxWidth: 1000,
        proportions : 0.8,
        background: 'white',
        canvasBackground: 'green',
        borderWidth: 5,
        borderColor: 'black'
    });

    // Set URLs for images and templates
    API.addSettings('base_url',{
        image : '/minno-time/images',
        template : '/minno-time/resources/BIAT'
    });

    // Logging URL
    API.addSettings('logger',{
        pulse: 20,
        url : '/implicit/PiPlayerApplet'
    });

    // ### Default Trial
    // This trial defines the basic rules that describe the generic trial in this task.
    // Note that it is lacking a `layout` property and `stimuli` property, these are both defined further on in the specific trial section.
    API.addTrialSets('Default',{
        // By default each trial is correct, this is modified in case of an error
        data: {score:0},

        // Set the **interface** ('e' for left, 'i' for right, 'enter' to skip block).
        // Note that throughout this task we support touch.
        input: [
            {handle:'enter',on:'enter'},
            {handle:'out',on:'keypressed',key:'e'},
            {handle:'in',on:'keypressed',key:'i'},
            {handle:'out',on:'leftTouch',touch:true},
            {handle:'in',on:'rightTouch',touch:true}
        ],

        // User **interactions**
        interactions: [
            // Begin trial : display stimulus immediately
            {
                conditions: [{type:'begin'}],
                actions: [{type:'showStim',handle:'targetStim'}]
            },

            // Correct response handler
            {
                conditions: [{type:'inputEqualsStim',property:'side'}], // check if the input handle is equal to the "side" attribute of stimulus.data
                actions: [
                    {type:'removeInput',handle:['in','out']}, // don't allow any further input
                    {type:'hideStim', handle: 'All'}, // hide everything
                    {type:'log'}, // log this trial
                    {type:'trigger',handle:'end',duration:250} // Wait for the ITI then trigger the end trial action.
                ]
            },

            // Error response handler
            {
                conditions: [
                    {type:'inputEqualsStim',property:'side',negate:true}, // this is an error
                    {type:'inputEquals',value:['in','out']} // this is an in/out event (and not any timeout or something)
                ],
                actions: [
                    {type:'showStim',handle:'error'}, // show error stimulus
                    {type:'setTrialAttr', setter:{score:1}} // set the score to 1
                ]
            },

            // End trial (this is called after the ITI)
            {
                conditions: [{type:'inputEquals',value:'end'}],
                actions: [
                    {type:'endTrial'}
                ]
            },

            // Skip block
            {
                conditions: [{type:'inputEquals',value:'enter'}],
                actions: [
                    {type:'goto', destination: 'nextWhere', properties: {blockStart:true}},
                    {type:'endTrial'}
                ]
            }
        ]
    });

    // ### Create specific trials for each block
    // These trials all inherit the Default trial and change only the `stimuli` and the canvas `layout`.
    API.addTrialSets({
        // category1/attribute1 trial
        category1attribute1:{
            inherit: 'Default',
            data: {condition: category1 + '+' + attribute1,parcel:'first'},
            layout: [
                {inherit:{type:'byData',set:'layout',data:'out'}},
                {inherit:{type:'byData',set:'layout',data:'in'}},
                {inherit:{type:'byData',set:'layout',data:'top'},media:category1},
                {inherit:{type:'byData',set:'layout',data:'separator'}},
                {inherit:{type:'byData',set:'layout',data:'bottom'},media:attribute1}
            ],
            stimuli: [
                {inherit:{type:'exRandom',set:'category1_attribute1'}},
                {inherit:{type:'random',set:'feedback'}}
            ]
        },

        // category1/attribute1 practice trial
        category1attribute1Practice:[{
            inherit: 'Default',
            data: {condition: category1 + '+' + attribute1},
            layout: [
                {inherit:{type:'byData',set:'layout',data:'out'}},
                {inherit:{type:'byData',set:'layout',data:'in'}},
                {inherit:{type:'byData',set:'layout',data:'top'},media:category1},
                {inherit:{type:'byData',set:'layout',data:'separator'}},
                {inherit:{type:'byData',set:'layout',data:'bottom'},media:attribute1}
            ],
            stimuli: [
                {inherit:{type:'exRandom',set:'practice_category1'}},
                {inherit:{type:'random',set:'feedback'}}
            ]
        }],

        // category2/attribute1 trial
        category2attribute1:[{
            data: {condition: category2 + '+' + attribute1,parcel:'first'},
            layout: [
                {inherit:{type:'byData',set:'layout',data:'out'}},
                {inherit:{type:'byData',set:'layout',data:'in'}},
                {inherit:{type:'byData',set:'layout',data:'top'},media:category2},
                {inherit:{type:'byData',set:'layout',data:'separator'}},
                {inherit:{type:'byData',set:'layout',data:'bottom'},media:attribute1}
            ],
            inherit: 'Default',													// inherit the default trial
            stimuli: [
                {inherit:{type:'exRandom',set:'category2_attribute1'}},
                {inherit:{type:'random',set:'feedback'}}
            ]
        }],

        // category2/attribute1 practice trial
        category2attribute1Practice:[{
            inherit: 'Default',
            data: {condition: category2 + '+' + attribute1},
            layout: [
                {inherit:{type:'byData',set:'layout',data:'out'}},
                {inherit:{type:'byData',set:'layout',data:'in'}},
                {inherit:{type:'byData',set:'layout',data:'top'},media:category2},
                {inherit:{type:'byData',set:'layout',data:'separator'}},
                {inherit:{type:'byData',set:'layout',data:'bottom'},media:attribute1}
            ],
            stimuli: [
                {inherit:{type:'exRandom',set:'practice_category2'}},
                {inherit:{type:'random',set:'feedback'}}
            ]
        }],

        // practice block
        practiceBlock:[{
            inherit: 'Default',
            data: {condition: 'example'},
            layout: [
                {inherit:{type:'byData',set:'layout',data:'out'}},
                {inherit:{type:'byData',set:'layout',data:'in'}},
                {inherit:{type:'byData',set:'layout',data:'top'},media:practiceCategory1},
                {inherit:{type:'byData',set:'layout',data:'separator'}},
                {inherit:{type:'byData',set:'layout',data:'bottom'},media:attribute1}
            ],
            stimuli: [
                {inherit:{type:'exRandom',set:'example'}},
                {inherit:{type:'random',set:'feedback'}}
            ]
        }]
    });

    // ### Default Introduction trial
    // This trial holds the basic structure for all instruction trials. It will be extended (by inheritance) within the sequence.
    API.addTrialSets("introduction", {
        // Generic introduction trial, to be inherited by all other introduction trials.
        data: {block: 'generic'},

        // Create user interface (just click space to move on...)
        input: [
            {handle:'space',on:'space'},
            {handle:'enter',on:'enter'},
            {handle:'space',on:'bottomTouch',touch:true}
        ],

        // Display fixed layout
        layout:[
            {inherit:{type:'byData',set:'layout',data:'out'}},
            {inherit:{type:'byData',set:'layout',data:'in'}}
        ],

        interactions: [
            // Display instructions
            {
                conditions: [{type:'begin'}],
                actions: [{type:'showStim',handle:'All'}]
            },

            // End trial
            {
                conditions: [{type:'inputEquals',value:'space'}],
                actions: [{type:'endTrial'}]
            },

            // Skip block
            {
                conditions: [{type:'inputEquals',value:'enter'}],
                actions: [
                    {type:'goto', destination: 'nextWhere', properties: {blockStart:true}},
                    {type:'endTrial'}
                ]
            }
        ]
    });

    // ### Stimulus Sets
    API.addStimulusSets({
        // This Default stimulus is inherited by the other stimuli so that we can have a consistent look and change it from one place.
    Default: [
        {css:{color:'white','font-size':'2em'}}
    ],

    // This is the default look for the instructions.
    Instructions: [
        {css:{'font-size':'1.3em',color:'black', lineHeight:1.2}}
    ],

    // The trial stimuli.
    // There are two types of trials: trials where category1 is focal, and trials where category2 is focal.
    category1_attribute1 : [
        // The `data` property is especially important here. `data.side` lets the player know what the correct categorization is for this trial.
        // `data.handle` allows us to focus actions (i.e. show/hide) at this specific stimulus.
        {data:{side:'in', handle:'targetStim', alias:attribute1}, inherit:'Default', media: {inherit:{type:'exRandom',set:'attribute1'}}},
        {data:{side:'out', handle:'targetStim', alias:attribute2}, inherit:'Default', media: {inherit:{type:'exRandom',set:'attribute2'}}},
        {data:{side:'in', handle:'targetStim', alias:category1}, inherit:'Default', media: {inherit:{type:'exRandom',set:'category1'}}},
        {data:{side:'out', handle:'targetStim', alias:category2}, inherit:'Default', media: {inherit:{type:'exRandom',set:'category2'}}}
    ],
    category2_attribute1 : [
        {data:{side:'in', handle:'targetStim', alias:attribute1}, inherit:'Default', media: {inherit:{type:'exRandom',set:'attribute1'}}},
        {data:{side:'out', handle:'targetStim', alias:attribute2}, inherit:'Default', media: {inherit:{type:'exRandom',set:'attribute2'}}},
        {data:{side:'out', handle:'targetStim', alias:category1}, inherit:'Default', media: {inherit:{type:'exRandom',set:'category1'}}},
        {data:{side:'in', handle:'targetStim', alias:category2}, inherit:'Default', media: {inherit:{type:'exRandom',set:'category2'}}}
    ],

    // The first block uses examples (practiceCategory1/2) instead of the regular categories.
    example: [
        {data:{side:'in', handle:'targetStim', alias:attribute1}, inherit:'Default', media: {inherit:{type:'exRandom',set:'attribute1'}}},
        {data:{side:'out', handle:'targetStim', alias:attribute2}, inherit:'Default', media: {inherit:{type:'exRandom',set:'attribute2'}}},
        {data:{side:'in', handle:'targetStim', alias:practiceCategory1}, inherit:'Default', media: {inherit:{type:'exRandom',set:'practiceCategory1'}}},
        {data:{side:'out', handle:'targetStim', alias:practiceCategory2}, inherit:'Default', media: {inherit:{type:'exRandom',set:'practiceCategory2'}}}
    ],

    // For the first four trials in each block - we use only categories.
    practice_category1: [
        {data:{side:'in', handle:'targetStim', alias:category1}, inherit:'Default', media: {inherit:{type:'exRandom',set:'category1'}}},
        {data:{side:'out', handle:'targetStim', alias:category2}, inherit:'Default', media: {inherit:{type:'exRandom',set:'category2'}}}
    ],
    practice_category2: [
        {data:{side:'out', handle:'targetStim', alias:category1}, inherit:'Default', media: {inherit:{type:'exRandom',set:'category1'}}},
        {data:{side:'in', handle:'targetStim', alias:category2}, inherit:'Default', media: {inherit:{type:'exRandom',set:'category2'}}}
    ],

    // This stimulus set is used for giving feedback, in this case only the error notification.
    feedback : [
        {handle:'error', location: {top: 80}, css:{color:'red','font-size':'4em'}, media: {word:'X'}, nolog:true}
    ],

    // One central place to define all layout components.
    // Note that top/bottom do not have a media property. They hold the category/attribute, and their media is set individually within the trials.
    layout: [
        {data:{handle:'out'},location:{left:5,top:3},media:{word:'out: e'}, css:{color:'black','font-size':'1em'}},
        {data:{handle:'in'},location:{right:5,top:3},media:{word:'in: i'}, css:{color:'black','font-size':'1em'}},
        {data:{handle:'top'}, location:{top:6}, css:{color:'black','font-size':'2em'}},
        {data:{handle:'separator'},location:{top:14}, css:{color:'black','font-size':'2em'}, media:'or'},
        {data:{handle:'bottom'},location:{top:22}, css:{color:'black','font-size':'2em'}}

    ]
    });

    // ### Media Sets
    API.addMediaSets({
        // Pleasant
        attribute1 : [
            {word: 'Nice'},
            {word: 'Heaven'},
            {word: 'Happy'},
            {word: 'Pleasure'}
        ],
        // Unpleasant
        attribute2: [
            {word: 'Nasty'},
            {word: 'Hell'},
            {word: 'Horrible'},
            {word: 'Rotten'}
        ],
        // Black people
        category1: [
            {image: 'bf14_nc.jpg'},
            {image: 'bf23_nc.jpg'},
            {image: 'bf56_nc.jpg'},
            {image: 'bm14_nc.jpg'}
        ],
        // White people
        category2: [
            {image: 'wf2_nc.jpg'},
            {image: 'wf3_nc.jpg'},
            {image: 'wf6_nc.jpg'},
            {image: 'wm1_nc.jpg'}
        ],
        // Birds
        practiceCategory1: [
            {image: 'ctsduck.jpg'},
            {image: 'ctsparrot.jpg'},
            {image: 'ctsrobin.jpg'},
            {image: 'ctssparrow.jpg'}
        ],
        // Mammals
        practiceCategory2: [
            {image: 'ctsbison.jpg'},
            {image: 'ctsgiraffe.jpg'},
            {image: 'ctshippo.jpg'},
            {image: 'ctsrhino.jpg'}
        ]
    });

    // ### Creating the sequence
    // We create two different sequences for the BIAT so that we can randomly choose Which category comes first.

    // #### 'category1' as the first focal category
    var BIAT1 = [
        // ##### The practice trials
        // The instructions
        {
            data: {block:0,blockStart:true},
            inherit: {set:'introduction', type:'byData', data: {block:'generic'}},
            stimuli: [{
                inherit:'Instructions',
                media:{template:'inst1.jst'}
            }]
        },
        // Repeat the practice Block trial 16 times.
        {
            mixer: 'repeat',
            times: 16,
            data : [
                {inherit: 'practiceBlock',data:{block:0}}
            ]
        },

        // ##### Block 1
        // The instructions
        {
            data: {block:1,blockStart:true},
            inherit: {set:'introduction', type:'byData', data: {block:'generic'}},
            stimuli: [{
                inherit:'Instructions',
                media:{template:'inst2.jst'}
            }]
        },
        // The presentation trials
        {
            mixer: 'repeat',
            times: 4,
            data : [
                {inherit: 'category1attribute1Practice',data:{block:1}}
            ]
        },
        // Run the trial 16 times.
        {
            mixer: 'repeat',
            times: 16,
            data : [
                {inherit: 'category1attribute1',data:{block:1}}
            ]
        },

        // ##### Block 2
        // The instructions
        {
            data: {block:2,blockStart:true},
            inherit: {set:'introduction', type:'byData', data: {block:'generic'}},
            stimuli: [{
                inherit:'Instructions',
                media:{template:'inst3.jst'}
            }]
        },
        // The presentation trials
        {
            mixer: 'repeat',
            times: 4,
            data : [
                {inherit: 'category2attribute1Practice',data:{block:2}}
            ]
        },
        // Run the trial 16 times.
        {
            mixer: 'repeat',
            times: 16,
            data : [
                {inherit: 'category2attribute1',data:{block:2}}
            ]
        },

        // ##### Blocks 3
        // The instructions
        {
            data: {block:3,blockStart:true},
            inherit: {set:'introduction', type:'byData', data: {block:'generic'}},
            stimuli: {
                inherit:'Instructions',
                media:{template:'inst2.jst'}
            }
        },
        // The presentation trials
        {
            mixer: 'repeat',
            times: 4,
            data : [
                {inherit: 'category1attribute1Practice',data:{block:3}}
            ]
        },
        // Run the trial 16 times.
        {
            mixer: 'repeat',
            times: 16,
            data : [
                {inherit: 'category1attribute1',data:{block:3,parcel:'second'}}
            ]
        },

        // ##### Blocks 4
        // The instructions
        {
            data: {block:4,blockStart:true},
            inherit: {set:'introduction', type:'byData', data: {block:'generic'}},			// inhertit the generic instruction block
            stimuli: {
                inherit:'Instructions',
                media:{template:'inst3.jst'}
            }
        },
        // The presentation trials
        {
            mixer: 'repeat',
            times: 4,
            data : [
                {inherit: 'category2attribute1Practice',data:{block:4}}
            ]
        },
        // Run the trial 16 times.
        {
            mixer: 'repeat',
            times: 16,
            data : [
                {inherit: 'category2attribute1',data:{block:4,parcel:'second'}}
            ]
        },

        // ##### block 5
        // The instructions
        {
            data: {block:5,blockStart:true},
            inherit: {set:'introduction', type:'byData', data: {block:'generic'}},			// inhertit the generic instruction block
            stimuli: [{
                inherit:'Instructions',
                media:{template:'inst2.jst'}
            }]
        },
        // The presentation trials
        {
            mixer: 'repeat',
            times: 4,
            data : [
                {inherit: 'category1attribute1Practice',data:{block:5}}
            ]
        },
        // Run the trial 16 times.
        {
            mixer: 'repeat',
            times: 16,
            data : [
                {inherit: 'category1attribute1',data:{block:5,parcel:'third'}}
            ]
        },

        // ##### block 6
        // The instructions
        {
            data: {block:6,blockStart:true},
            inherit: {set:'introduction', type:'byData', data: {block:'generic'}},			// inhertit the generic instruction block
            stimuli: [{
                inherit:'Instructions',
                media:{template:'inst3.jst'}
            }]
        },
        // The presentation trials
        {
            mixer: 'repeat',
            times: 4,
            data : [
                {inherit: 'category2attribute1Practice',data:{block:6}}
            ]
        },
        // Run the trial 16 times.
        {
            mixer: 'repeat',
            times: 16,
            data : [
                {inherit: 'category2attribute1',data:{block:6,parcel:'third'}}
            ]
        },

        // ##### blocks 7
        // The instructions
        {
            data: {block:7,blockStart:true},
            inherit: {set:'introduction', type:'byData', data: {block:'generic'}},			// inhertit the generic instruction block
            stimuli: [{
                inherit:'Instructions',
                media:{template:'inst2.jst'}
            }]
        },
        // The presentation trials
        {
            mixer: 'repeat',
            times: 4,
            data : [
                {inherit: 'category1attribute1Practice',data:{block:7}}
            ]
        },
        // Run the trial 16 times.
        {
            mixer: 'repeat',
            times: 16,
            data : [
                {inherit: 'category1attribute1',data:{block:7,parcel:'fourth'}}
            ]
        },

        // ##### blocks 8
        // The instructions
        {
            data: {block:8,blockStart:true},
            inherit: {set:'introduction', type:'byData', data: {block:'generic'}},			// inhertit the generic instruction block
            stimuli: {
                inherit:'Instructions',
                media:{template:'inst3.jst'}
            }
        },
        // The presentation trials
        {
            mixer: 'repeat',
            times: 4,
            data : [
                {inherit: 'category2attribute1Practice',data:{block:8}}
            ]
        },
        // Run the trial 16 times.
        {
            mixer: 'repeat',
            times: 16,
            data : [
                {inherit: 'category2attribute1',data:{block:8,parcel:'fourth'}}
            ]
        }
    ]; // The end of BIAT1

    // #### 'category2' as the first focal category
    var BIAT2 = [
        // ##### The presentation trials
        // The instructions
        {
            data: {block:0,blockStart:true},
            inherit: {set:'introduction', type:'byData', data: {block:'generic'}},
            stimuli: [{
                inherit:'Instructions',
                media:{template:'inst1.jst'}
            }]
        },
        // Repeat the practice Block trial 16 times.
        {
            mixer: 'repeat',
            times: 16,
            data : [
                {inherit: 'practiceBlock',data:{block:0}}
            ]
        },

        // ##### Block 1
        // The instructions
        {
            data: {block:1,blockStart:true},
            inherit: {set:'introduction', type:'byData', data: {block:'generic'}},
            stimuli: [{
                inherit:'Instructions',
                media:{template:'inst3.jst'}
            }]
        },
        // The practice trials
        {
            mixer: 'repeat',
            times: 4,
            data : [
                {inherit: 'category2attribute1Practice',data:{block:1}}
            ]
        },
        // Run the trial 16 times.
        {
            mixer: 'repeat',
            times: 16,
            data : [
                {inherit: 'category2attribute1',data:{block:1}}
            ]
        },

        // ##### Block 2
        // The instructions
        {
            data: {block:2,blockStart:true},
            inherit: {set:'introduction', type:'byData', data: {block:'generic'}},
            stimuli: [{
                inherit:'Instructions',
                media:{template:'inst2.jst'}
            }]
        },
        // The presentation trials
        {
            mixer: 'repeat',
            times: 4,
            data : [
                {inherit: 'category1attribute1Practice',data:{block:2}}
            ]
        },
        // Run the trial 16 times.
        {
            mixer: 'repeat',
            times: 16,
            data : [
                {inherit: 'category1attribute1',data:{block:2}}
            ]
        },

        // ##### Blocks 3
        // The instructions
        {
            data: {block:3,blockStart:true},
            inherit: {set:'introduction', type:'byData', data: {block:'generic'}},
            stimuli: {
                inherit:'Instructions',
                media:{template:'inst3.jst'}
            }
        },
        // The presentation trials
        {
            mixer: 'repeat',
            times: 4,
            data : [
                {inherit: 'category2attribute1Practice',data:{block:3}}
            ]
        },
        // Run the trial 16 times.
        {
            mixer: 'repeat',
            times: 16,
            data : [
                {inherit: 'category2attribute1',data:{block:3,parcel:'second'}}
            ]
        },

        // ##### Blocks 4
        // The instructions
        {
            data: {block:4,blockStart:true},
            inherit: {set:'introduction', type:'byData', data: {block:'generic'}},			// inhertit the generic instruction block
            stimuli: {
                inherit:'Instructions',
                media:{template:'inst2.jst'}
            }
        },
        // The presentation trials
        {
            mixer: 'repeat',
            times: 4,
            data : [
                {inherit: 'category1attribute1Practice',data:{block:4}}
            ]
        },
        // Run the trial 16 times.
        {
            mixer: 'repeat',
            times: 16,
            data : [
                {inherit: 'category1attribute1',data:{block:4,parcel:'second'}}
            ]
        },

        // ##### block 5
        // The instructions
        {
            data: {block:5,blockStart:true},
            inherit: {set:'introduction', type:'byData', data: {block:'generic'}},			// inhertit the generic instruction block
            stimuli: [{
                inherit:'Instructions',
                media:{template:'inst3.jst'}
            }]
        },
        // The presentation trials
        {
            mixer: 'repeat',
            times: 4,
            data : [
                {inherit: 'category2attribute1Practice',data:{block:5}}
            ]
        },
        // Run the trial 16 times.
        {
            mixer: 'repeat',
            times: 16,
            data : [
                {inherit: 'category2attribute1',data:{block:5,parcel:'third'}}
            ]
        },

        // ##### block 6
        // The instructions
        {
            data: {block:6,blockStart:true},
            inherit: {set:'introduction', type:'byData', data: {block:'generic'}},			// inhertit the generic instruction block
            stimuli: [{
                inherit:'Instructions',
                media:{template:'inst2.jst'}
            }]
        },
        // The presentation trials
        {
            mixer: 'repeat',
            times: 4,
            data : [
                {inherit: 'category1attribute1Practice',data:{block:6}}
            ]
        },
        // Run the trial 16 times.
        {
            mixer: 'repeat',
            times: 16,
            data : [
                {inherit: 'category1attribute1',data:{block:6,parcel:'third'}}
            ]
        },

        // ##### blocks 7
        // The instructions
        {
            data: {block:7,blockStart:true},
            inherit: {set:'introduction', type:'byData', data: {block:'generic'}},			// inhertit the generic instruction block
            stimuli: [{
                inherit:'Instructions',
                media:{template:'inst3.jst'}
            }]
        },
        // The presentation trials
        {
            mixer: 'repeat',
            times: 4,
            data : [
                {inherit: 'category2attribute1Practice',data:{block:7}}
            ]
        },
        // Run the trial 16 times.
        {
            mixer: 'repeat',
            times: 16,
            data : [
                {inherit: 'category2attribute1',data:{block:7,parcel:'fourth'}}
            ]
        },

        // ##### blocks 8
        // The instructions
        {
            data: {block:8,blockStart:true},
            inherit: {set:'introduction', type:'byData', data: {block:'generic'}},			// inhertit the generic instruction block
            stimuli: {
                inherit:'Instructions',
                media:{template:'inst2.jst'}
            }
        },
        // The presentation trials
        {
            mixer: 'repeat',
            times: 4,
            data : [
                {inherit: 'category1attribute1Practice',data:{block:8}}
            ]
        },
        // Run the trial 16 times.
        {
            mixer: 'repeat',
            times: 16,
            data : [
                {inherit: 'category1attribute1',data:{block:8,parcel:'fourth'}}
            ]
        }
    ]; // The end of BIAT2

    // ### Create the task Sequence itself
    API.addSequence([
        // Randomly choose one of the sequences that we created
        {
            mixer: 'choose',
            data: [
                {mixer:'wrapper',data:BIAT1},
                {mixer:'wrapper',data:BIAT2}
            ]
        },

        // Create user feedback. We activate the computeD function here.
        {
            data: {blockStart:true},
            inherit: {set:'introduction', type:'byData', data: {block:'generic'}},
            stimuli: [],
            customize: function(){
                var DScoreObj, FBMsg, DScore;
                var trial = this;

                //////First call to score//////
                scorer.addSettings('compute',{
                    parcelValue : ['first']
                });
                DScoreObj = scorer.computeD();
                var DScore1 = DScoreObj.DScore;

                //////Second call to score//////
                scorer.addSettings('compute',{
                    parcelValue : ['second']
                });
                DScoreObj = scorer.computeD();
                var DScore2 = DScoreObj.DScore;

                //////Third call to score//////
                scorer.addSettings('compute',{
                    parcelValue : ['third']
                });
                DScoreObj = scorer.computeD();
                var DScore3 = DScoreObj.DScore;

                //////Fourth call to score//////
                scorer.addSettings('compute',{
                    parcelValue : ['fourth']
                });
                DScoreObj = scorer.computeD();
                var DScore4 = DScoreObj.DScore;

                // If all scores are numbers
                if ((DScore1 !== '') && (DScore2 !== '') && (DScore3 !== '') && (DScore4 !== '')){
                    //Average the 4 scores
                    DScore = (parseFloat(DScore1) + parseFloat(DScore2) + parseFloat(DScore3) + parseFloat(DScore4))/4;
                    FBMsg = scorer.getFBMsg(DScore);
                } else {
                    DScore = '';
                    FBMsg = 'An error has occurred';
                }

                var media = {css:{color:'black'},media:{html:'<div><p style="font-size:28px"><color="#FFFAFA"> '+FBMsg+'<br>The Score is:'+DScore+'</p></div>'}};
                trial.stimuli.push(media);
                scorer.dynamicPost({
                    score: DScoreObj.DScore,
                    feedback: DScoreObj.FBMsg
                });

            }
        },

        // Instructions trial, the end of the task, instruction what to do next.
        {
            data: {blockStart:true},
            inherit: {set:'introduction', type:'byData', data: {block:'generic'}},
            stimuli: [
                {
                    // The instructions stimulus
                    data : {'handle':'instStim'},
                    css: {color:'black'},
                    media:{html:'<div><p style="font-size:28px"><color="#FFFAFA">You have completed the study<br/><br/>Thank you very much for your participation.<br/><br/> Press "space" for continue to next task.</p></div>'}
                }
            ]
        }
    ]);

    // Settings for the scorer that computes the user feedback.
    scorer.addSettings('compute',{
        ErrorVar:'score',
        condVar:"condition",
        //condition 1
        cond1VarValues: [
            category1 + '+' + attribute1
        ],
        //condition 2
        cond2VarValues: [
            category2 + '+' + attribute1
        ],
        parcelVar : "parcel",
        parcelValue : ['first'],
        fastRT : 150, //Below this reaction time, the latency is considered extremely fast.
        maxFastTrialsRate : 0.1, //Above this % of extremely fast responses within a condition, the participant is considered too fast.
        minRT : 400, //Below this latency
        maxRT : 1000, //above this
        errorLatency : {use:"latency", penalty:600, useForSTD:true},
        postSettings : {score:"score",msg:"feedback",url:"/implicit/scorer"}
        /**NEED TO ADD*/
        //Recode latencies faster than 400ms to 400, and latencies slower than 2000ms to 2000 (perhaps not supported by Ben's computeD function; need to ask him to update the function to support that).
        //Ignore tasks with more than 40% error trials in one of the blocks Yoav: (let me know if not supported by Ben's function because we can use an alternative rule here).

    });

    scorer.addSettings('message',{
        MessageDef: [
            { cut:'-0.65', message:'Your data suggest a strong implicit preference for Black People compared to White People' },
            { cut:'-0.35', message:'Your data suggest a moderate implicit preference for Black People compared to White People.' },
            { cut:'-0.15', message:'Your data suggest a slight implicit preference for Black People compared to White People.' },
            { cut:'0.15', message:'Your data suggest little to no difference in implicit preference between Black People and White People.' },
            { cut:'0.35', message:'Your data suggest a slight implicit preference for White People compared to Black People' },
            { cut:'0.65', message:'Your data suggest a moderate implicit preference for White People compared to Black People' },
            { cut:'3', message:'Your data suggest a strong implicit preference for White People compared to Black People' }
        ]
    });

    return API.script;
});


text:
export default class WebStoreServices {
	constructor(client) {
		this.client = client;
		this.resourceUrl = '/services';
	}

	list(filter) {
		return this.client.get(this.resourceUrl, filter);
	}

	retrieve(id) {
		return this.client.get(`${this.resourceUrl}/${id}`);
	}

	enable(id) {
		return this.client.post(`${this.resourceUrl}/${id}/enable`);
	}

	disable(id) {
		return this.client.post(`${this.resourceUrl}/${id}/disable`);
	}
}


text:
// Copyright 2021 The NATS Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package io.nats.client.api;

import java.time.ZonedDateTime;

import static io.nats.client.support.JsonUtils.objectString;

/**
 * The BucketInfo class contains information about a Key Value Bucket.
 */
public class BucketInfo {

    private final StreamInfo streamInfo;
    private final BucketConfiguration config;

    public BucketInfo(StreamInfo si) {
        streamInfo = si;
        config = new BucketConfiguration(streamInfo.getConfiguration());
    }

    /**
     * Gets the stream configuration.
     * @return the stream configuration.
     */
    public BucketConfiguration getConfiguration() {
        return config;
    }

    public long getRecordCount() {
        return streamInfo.getStreamState().getMsgCount();
    }

    public long getByteCount() {
        return streamInfo.getStreamState().getByteCount();
    }

    public long getLastSequence() {
        return streamInfo.getStreamState().getLastSequence();
    }

    /**
     * Gets the creation time of the stream.
     * @return the creation date and time.
     */
    public ZonedDateTime getCreateTime() {
        return streamInfo.getCreateTime();
    }

    @Override
    public String toString() {
        return "BucketInfo{" +
                "created=" + getCreateTime() +
                "recordCount=" + getRecordCount() +
                "byteCount=" + getByteCount() +
                "lastSequence=" + getLastSequence() +
                ", " + objectString("config", config) +
                '}';
    }
}


text:
namespace pdalboost {
namespace intrusive {
namespace detail {

template <class T>
inline T* to_raw_pointer(T* p)
{  return p; }

template <class Pointer>
inline typename pdalboost::intrusive::pointer_element<Pointer>::type*
to_raw_pointer(const Pointer &p)
{  return pdalboost::intrusive::detail::to_raw_pointer(p.operator->());  }

} //namespace detail
} //namespace intrusive
} //namespace pdalboost

#include <boost/intrusive/detail/config_end.hpp>

#endif //BOOST_INTRUSIVE_DETAIL_UTILITIES_HPP