text:
/**
 http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/css.html#CSS-CSSStyleSheet

 interface CSSStyleSheet : stylesheets::StyleSheet {
 readonly attribute CSSRule          ownerRule;
 readonly attribute CSSRuleList      cssRules;
 unsigned long      insertRule(in DOMString rule,
 in unsigned long index)
 raises(DOMException);
 void               deleteRule(in unsigned long index)
 raises(DOMException);
 */
#import <Foundation/Foundation.h>

#import "CSSRule.h"
#import "CSSRuleList.h"

@interface CSSStyleSheet : NSObject

@property(nonatomic,strong) CSSRule* ownerRule;
@property(nonatomic,strong) CSSRuleList* cssRules;

-(long) insertRule:(NSString*) rule index:(unsigned long) index;
-(void) deleteRule:(unsigned long) index;

#pragma mark - methods needed for ObjectiveC implementation

- (id)initWithString:(NSString*) styleSheetBody;

@end


text:
<!DOCTYPE HTML>

    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <title> - Net Telescope Lab</title>
    <meta name="keywords" content="network, impossible trinity, exception of state">

    <meta property="og:title" content="">
    <meta property="og:site_name" content="Net Telescope Lab">
    <meta property="og:image" content="/img/author.jpg">
    <meta name="title" content=" - Net Telescope Lab" />
    <meta name="description" content="blog | Network Telescope | Architect ">
    <link rel="alternate" href="https://net-telescope.github.io/tags/index.xml" title="Net Telescope Lab" type="application/rss+xml" />
    <link rel="shortcut icon" href="https://net-telescope.github.io/img/favicon.ico" />
    <link rel="apple-touch-icon" href="https://net-telescope.github.io/img/apple-touch-icon.png" />
    <link rel="apple-touch-icon-precomposed" href="https://net-telescope.github.io/img/apple-touch-icon.png" />
    <link href="https://net-telescope.github.io/js/vendor/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

    <link href="https://net-telescope.github.io/css/main.css" rel="stylesheet" type="text/css" />

      Net Telescope Lab

網路動態分析實驗室

<gcse:search></gcse:search>

  <button>

  </button>

Home

Our People

Research

Publication

Resource

Archive

all about tags

this is content

            Total 0 tags

Yen-Hung Chen (陳彥宏)

        Principal Investigator

        0
        Blogs

        0
        Categories

        0
        Tags

    RSS

            Personal

            Lab

    ©
   - 2017

  Net Telescope Lab

  Powered by - Hugo

  Theme by -  NexT

redpajama_set_name: RedPajamaGithub


text:
news

//Routes
.config(function($routeProvider) {
  $routeProvider
    .when('/logout', {
        controller:'LogoutController',
        templateUrl:'partials/login.html'
    })
    .when('/login', {
        controller:'LoginController',
        templateUrl:'partials/login.html'
    })
    .when('/search/:q?', {
        controller:'SearchController',
        templateUrl:'partials/search.html',
        reloadOnSearch: false
    })
    .when('/feeds', {
        controller:'FeedsController',
        templateUrl:'partials/feeds.html',
        reloadOnSearch: false
    })
    .when('/:feed', {
        controller:'FeedController',
        templateUrl:'partials/feed.html',
        reloadOnSearch: false
    })
    .otherwise({
        redirectTo:'/'
    });
});


text:
import * as angular from 'angular';

export class Author implements angular.IComponentController {
  private id: number;
  removeFn: (obj: {id: number}) => void;
  constructor(private $location: angular.ILocationService) {}

  remove() {
    this.removeFn({id: this.id});
  }
  navigate() {
    this.$location.path(`/edit/${this.id}`);
  }
}
Author.$inject = ['$location'];

const component: angular.IComponentOptions = {
  template: `

Name:

{{::$ctrl.name}}

Birth Year:

{{::$ctrl.birthYear}}

Controls:

  `,
  controller: Author,
  bindings: {
    name: '=authorName',
    birthYear: '=authorBirthYear',
    id: '=',
    removeFn: '&'
  }
};

export default component;
export const name = 'myAuthor';


text:
module KMyCLI
  class Settings
    attr_accessor :inifile, :settings

    def initialize(file)
      self.inifile = IniFile.load(file)
      self.settings = {
      }.merge(inifile['global'])
    end

    def merge!(options)
      self.settings.merge!(options.reject { |k, v| v.nil? })
    end

    def all
      settings
    end

    def set(key, val)
      inifile['global'][key] = val
      inifile.write
    end

    def method_missing(key, *args)
      key = key.to_s
      if key.end_with? "="
        settings[key.chomp("=")] = args[0]
      else
        settings[key]
      end
    end
  end
end


text:
package org.jets3t.apps.utils;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.Provider;
import java.security.Security;
import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.InvalidKeySpecException;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

import javax.crypto.Cipher;
import javax.crypto.CipherInputStream;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.PBEParameterSpec;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

/**
 * A rudimentary GUI and utility for encrypting and decrypting files in a way
 * that is compatible with JetS3t's cryptographic features.
 *
 * @author James Murty
 */
public class FileCryptoTool {

    private String algorithm = "PBEWithMD5AndDES";
    private SecretKey key = null;
    private AlgorithmParameterSpec algParamSpec = null;

    private int iterationCount = 5000;
    private byte[] salt = {
        (byte)0xA4, (byte)0x0B, (byte)0xC8, (byte)0x34,
        (byte)0xD6, (byte)0x95, (byte)0xF3, (byte)0x13
    };

    static {
        try {
            Class bouncyCastleProviderClass =
                Class.forName("org.bouncycastle.jce.provider.BouncyCastleProvider");
            if (bouncyCastleProviderClass != null) {
                Provider bouncyCastleProvider = (Provider) bouncyCastleProviderClass
                    .getConstructor(new Class[] {}).newInstance(new Object[] {});
                Security.addProvider(bouncyCastleProvider);
            }
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
            System.err.println("Unable to load security provider BouncyCastleProvider");
        }
    }

    public FileCryptoTool() {
    }

    public void init(String password, String algorithm, byte[] salt, int interationCount)
        throws NoSuchAlgorithmException, InvalidKeySpecException
    {
        this.algorithm = algorithm;
        this.salt = salt;
        this.iterationCount = interationCount;
        PBEKeySpec keyspec = new PBEKeySpec(password.toCharArray(), this.salt, this.iterationCount, 32);
        SecretKeyFactory skf = SecretKeyFactory.getInstance(algorithm);
        this.key = skf.generateSecret(keyspec);
        this.algParamSpec = new PBEParameterSpec(this.salt, this.iterationCount);
    }

    public void init(String password, String algorithm)
        throws NoSuchAlgorithmException, InvalidKeySpecException
    {
        init(password, algorithm, this.salt, this.iterationCount);
    }

    public void decryptFile(File inputFile, File outputFile) throws NoSuchAlgorithmException,
        NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException,
        IOException
    {
        Cipher cipher = Cipher.getInstance(this.algorithm);
        cipher.init(Cipher.DECRYPT_MODE, this.key, this.algParamSpec);
        transferFileData(inputFile, outputFile, cipher);
    }

    public void encryptFile(File inputFile, File outputFile) throws NoSuchAlgorithmException,
        NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException,
        IOException
    {
        Cipher cipher = Cipher.getInstance(this.algorithm);
        cipher.init(Cipher.ENCRYPT_MODE, this.key, this.algParamSpec);
        transferFileData(inputFile, outputFile, cipher);
    }

    protected void transferFileData(File inputFile, File outputFile, Cipher cipher) throws IOException {
        InputStream is = null;
        OutputStream os = null;
        try {
            os = new BufferedOutputStream(new FileOutputStream(outputFile));
            is = new CipherInputStream(new BufferedInputStream(new FileInputStream(inputFile)), cipher);
            byte[] buffer = new byte[16384];
            int read = -1;
            while ((read = is.read(buffer)) != -1) {
                os.write(buffer, 0, read);
            }
        } finally {
            if (os != null)
                os.close();
            if (is != null)
                is.close();
        }
    }

    protected void initGui(final JFrame frame) {
        final FileCryptoTool self = this;
        final File[] filesArray = new File[2];

        JLabel inputFileLabel = new JLabel("Input file:");
        final JTextField inputFileTextField = new JTextField();
        JButton inputFileBrowseButton = new JButton("Browse");
        inputFileBrowseButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                filesArray[0] = fileChooser("Input File", frame, false);
                if (filesArray[0] != null) {
                    inputFileTextField.setText(filesArray[0].getAbsolutePath());
                } else {
                    inputFileTextField.setText("");
                }
            }
        });

        JLabel outputDirectoryLabel = new JLabel("Output directory:");
        final JTextField outputDirectoryTextField = new JTextField();
        JButton outputDirectoryBrowseButton = new JButton("Browse");
        outputDirectoryBrowseButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                filesArray[1] = fileChooser("Output Directory", frame, true);
                if (filesArray[1] != null) {
                    outputDirectoryTextField.setText(filesArray[1].getAbsolutePath());
                } else {
                    outputDirectoryTextField.setText("");
                }
            }
        });

        JLabel passwordLabel = new JLabel("Password:");
        final JPasswordField passwordField = new JPasswordField();
        JLabel passwordConfirmLabel = new JLabel("Password (confirm):");
        final JPasswordField password2Field = new JPasswordField();

        JLabel algorithmLabel = new JLabel("Algorithm:");
        final JComboBox algorithmComboBox = new JComboBox(listAvailablePbeCiphers());
        algorithmComboBox.setSelectedItem(this.algorithm.toUpperCase());
        algorithmComboBox.addActionListener(new ActionListener() {
           public void actionPerformed(ActionEvent arg0) {
               self.algorithm = (String) algorithmComboBox.getSelectedItem();
           }
        });

        final JButton encryptButton = new JButton("Encrypt File");
        final JButton decryptButton = new JButton("Decrypt File");

        ActionListener buttonListener = new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                try {
                    if (inputFileTextField.getText().trim().length() == 0) {
                        JOptionPane.showMessageDialog(frame, "Choose an input file");
                    }
                    else if (outputDirectoryTextField.getText().trim().length() == 0) {
                        JOptionPane.showMessageDialog(frame, "Choose an output directory");
                    }
                    else if (passwordField.getPassword().length == 0
                        || password2Field.getPassword().length == 0)
                    {
                        JOptionPane.showMessageDialog(frame, "Enter your password twice");
                    }
                    else if (!new String(passwordField.getPassword()).equals(new String(password2Field.getPassword())))
                    {
                        JOptionPane.showMessageDialog(frame, "Password and confirmation password do not match");
                    }
                    else {
                        File inputFile = new File(inputFileTextField.getText().trim());
                        File outputDirectory = new File(outputDirectoryTextField.getText().trim());
                        File outputFile = new File(outputDirectory, inputFile.getName());
                        if (!outputDirectory.isDirectory()) {
                            JOptionPane.showMessageDialog(frame, "The output directory is not valid");
                        }
                        else if (inputFile.equals(outputFile)) {
                            JOptionPane.showMessageDialog(frame,
                                "Choose a different output directory from the one that contains the input file");
                        }
                        else {
                            boolean encrypting = event.getSource().equals(encryptButton);
                            init(new String(passwordField.getPassword()), self.algorithm);
                            if (encrypting) {
                                encryptFile(inputFile, outputFile);
                            } else {
                                decryptFile(inputFile, outputFile);
                            }
                            JOptionPane.showMessageDialog(frame,
                                "'" + inputFile.getName() + "' "
                                + (encrypting ? "encrypted" : "decrypted")
                                + " to: \n'" + outputFile.getAbsolutePath() + "'");
                        }
                    }
                } catch (RuntimeException e) {
                    throw e;
                } catch (Exception e) {
                    JOptionPane.showMessageDialog(frame, "ERROR: " + e.getMessage());
                }
            }
        };

        encryptButton.addActionListener(buttonListener);
        decryptButton.addActionListener(buttonListener);

        Insets insetsDefault = new Insets(2, 3, 2, 3);

        JPanel inputsPanel = new JPanel(new GridBagLayout());
        inputsPanel.add(inputFileLabel, new GridBagConstraints(0, 0,
            1, 1, 0, 1, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0));
        inputsPanel.add(inputFileTextField, new GridBagConstraints(1, 0,
            1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
        inputsPanel.add(inputFileBrowseButton, new GridBagConstraints(2, 0,
            1, 1, 0, 1, GridBagConstraints.CENTER, GridBagConstraints.NONE, insetsDefault, 0, 0));
        inputsPanel.add(outputDirectoryLabel, new GridBagConstraints(0, 1,
            1, 1, 0, 1, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0));
        inputsPanel.add(outputDirectoryTextField, new GridBagConstraints(1, 1,
            1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
        inputsPanel.add(outputDirectoryBrowseButton, new GridBagConstraints(2, 1,
            1, 1, 0, 1, GridBagConstraints.CENTER, GridBagConstraints.NONE, insetsDefault, 0, 0));
        inputsPanel.add(passwordLabel, new GridBagConstraints(0, 2,
            1, 1, 0, 1, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0));
        inputsPanel.add(passwordField, new GridBagConstraints(1, 2,
            1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
        inputsPanel.add(passwordConfirmLabel, new GridBagConstraints(0, 3,
            1, 1, 0, 1, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0));
        inputsPanel.add(password2Field, new GridBagConstraints(1, 3,
            1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
        inputsPanel.add(algorithmLabel, new GridBagConstraints(0, 4,
            1, 1, 0, 1, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0));
        inputsPanel.add(algorithmComboBox, new GridBagConstraints(1, 4,
            1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));

        JPanel buttonsPanel = new JPanel(new GridBagLayout());
        buttonsPanel.add(encryptButton, new GridBagConstraints(0, 0,
            1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0));
        buttonsPanel.add(decryptButton, new GridBagConstraints(1, 0,
            1, 1, 1, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0));

        frame.getContentPane().setLayout(new GridBagLayout());
        frame.getContentPane().add(inputsPanel, new GridBagConstraints(0, 0,
            1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsDefault, 0, 0));
        frame.getContentPane().add(buttonsPanel, new GridBagConstraints(0, 1,
            1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.NONE, insetsDefault, 0, 0));

        frame.pack();
        frame.setVisible(true);
    }

    private File fileChooser(String title, JFrame frame, boolean dirOnly) {
        // Prompt user to choose their Cockpit home directory.
        JFileChooser fileChooser = new JFileChooser();
        fileChooser.setAcceptAllFileFilterUsed(true);
        fileChooser.setDialogTitle(title);
        fileChooser.setFileSelectionMode(
            (dirOnly ? JFileChooser.DIRECTORIES_ONLY : JFileChooser.FILES_ONLY));
        fileChooser.setApproveButtonText("Select " +
            (dirOnly ? "Directory" : "File"));

        int returnVal = fileChooser.showOpenDialog(frame);
        if (returnVal != JFileChooser.APPROVE_OPTION) {
            return null;
        } else {
            return fileChooser.getSelectedFile();
        }
    }

    private static String[] listAvailablePbeCiphers() {
        Set ciphers = Security.getAlgorithms("Cipher");
        Set pbeCiphers = new HashSet();
        for (Iterator iter = ciphers.iterator(); iter.hasNext(); ) {
            String cipher = (String) iter.next();
            if (cipher.toLowerCase().startsWith("pbe")) {
                pbeCiphers.add(cipher);
            }
        }
        return (String[]) pbeCiphers.toArray(new String[pbeCiphers.size()]);
    }

    public static void main(String[] args) throws Exception {
        FileCryptoTool fct = new FileCryptoTool();
        JFrame frame = new JFrame("File Crypto Tool");
        fct.initGui(frame);
    }

}


text:
<?php
/**
 * Created by PhpStorm.
 * User: sasha
 * Date: 31.8.16
 * Time: 16.51
 */

namespace AppBundle\Controller;

use AppBundle\Entity\News;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class NewsController extends Controller
{
    /**
     * @Route ("/news",
     *          name = "allNewspage")
     * @Security("has_role('ROLE_USER')")
     *
     */

    public function allNewsAction(Request $request)
    {
        $news = $this->getDoctrine()
            ->getRepository('AppBundle:News')
            ->findAll();
        return new Response('all news page');
    }

    /**
     * @Route ("/news/{id}",
     *          name = "fullNewspage",
     *          requirements = {"id" = "\d+"}
     *          )
     * @Security("has_role('ROLE_USER')")
     */
    public function fullNewsAction($id)
    {
        $news = $this->getDoctrine()
            ->getRepository('AppBundle:News')
            ->find($id);
        return new Response('full news page ' . $id);
    }
}


text:
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { MockBackend, MockConnection } from '@angular/http/testing';

import { Http, BaseRequestOptions } from '@angular/http';

import { UserMockServerProvider } from '../../users.mockserver';
import { NavbarComponent } from './navbar.component';
import { AuthService } from '../../services/auth-service/auth.service'

import {UsersApi} from '../../services/api-service/users-api/users-api.mock';
import {User} from '../../models/user-models/User';
import {Injectable} from '@angular/core';
import { HttpModule } from '@angular/http';

import { ApiService } from '../../services/api-service/api.service';
import { AppConfig } from '../../app.config';
import { ObservablesMock } from '../../mocks/observables.mock';

describe('NavbarComponent', () => {
  let component: NavbarComponent;
  let fixture: ComponentFixture<NavbarComponent>;

  beforeEach(async(() => {
    let observables = new ObservablesMock();

    let mockAuthService = {
      getCurrentLoggedInUser: observables.ResolveObservable({ username: 'testuser123' })
    }

    TestBed.configureTestingModule({
      imports: [RouterTestingModule,HttpModule],
      declarations: [ NavbarComponent ],
      providers: [
        { provide: AuthService, useValue: mockAuthService },
        { provide: Http, useValue: UserMockServerProvider },
        MockBackend,
        BaseRequestOptions,
        ApiService,
        AppConfig
      ]
    })
    .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(NavbarComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should be created', () => {
    expect(component).toBeTruthy();
  });
});


text:
body {
    padding: 0;
    margin: 0;
    background: #eee;
    font-family: "Times New Roman", Georgia, Serif;
}

td {
    font-size: 12px;
}

#document {
    margin: 0em auto;
    border: 4px solid #ccc;
    padding: 1em;
    background: white;
}

.navigation ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #333;
    font-size: 1.5em;
}

.navigation ul li {
    float: left;
}

.navigation ul li a {
    display: block;
    color: white;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
}

.navigation ul li a:hover {
    background-color: #111;
}

.navigation ul li:last-child {
    float: right;
    border-right: none;
}

ul.pagination li input {
    float: left;
    margin: 0 0.25em;
    padding: 5px 16px;
    padding: inherit 16px;
    text-align: center;
}


text:
DISABLE_COMPILER_WARNINGS
#include "ui_mainwindow.h"
RESTORE_COMPILER_WARNINGS

MainWindow::MainWindow(QWidget *parent) :
	QMainWindow(parent),
	ui(new Ui::MainWindow)
{
	ui->setupUi(this);

	ui->fractalWidget->setFractal<CMandelbrotSet>();
}

MainWindow::~MainWindow()
{
	delete ui;
}


text:
 * Dancing guy animation.
 * Game kit integration for networked multiplayer.


text:
{% for competition in competitions %}

        {{ competition }}

            {% if competition.seasons.count %}

                    {% for season in competition.seasons.all %}

                                {{ season }}

                    {% endfor %}

            {% endif %}

{% endfor %}


text:
if(DEFINED POLLY_ANDROID_NDK_R10E_API_8_ARMEABI_V7A_CMAKE_)
  return()
else()
  set(POLLY_ANDROID_NDK_R10E_API_8_ARMEABI_V7A_CMAKE_ 1)
endif()

include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_clear_environment_variables.cmake")

include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake")

set(ANDROID_NDK_VERSION "r10e")
set(CMAKE_SYSTEM_VERSION "8")
set(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a")
set(CMAKE_ANDROID_ARM_NEON FALSE)
set(CMAKE_ANDROID_ARM_MODE TRUE) # 32-bit ARM

polly_init(
    "Android NDK ${ANDROID_NDK_VERSION} / \
API ${CMAKE_SYSTEM_VERSION} / ${CMAKE_ANDROID_ARCH_ABI} / \
32-bit ARM / c++11 support"
    "Unix Makefiles"
)

include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake")

include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake") # before toolchain!

include("${CMAKE_CURRENT_LIST_DIR}/os/android.cmake")


text:
<?php

/**
 * Get number of fields in result
 *
 * @phpstub
 *
 * @param resource $result
 *
 * @return int Returns the number of fields, as an integer.
 */
function fbsql_num_fields($result)
{
}


text:
package com.avairebot.requests.service;

public class RandomDogService {

    private String status;
    private String message;

    public String getStatus() {
        return status;
    }

    public String getMessage() {
        return message;
    }
}


text:
namespace Lib.Cosmos.Scenes.ViewControllers
{
    using System;
    using System.Threading.Tasks;
    using System.Windows;
    using System.Windows.Media.Animation;
    using System.Windows.Media.Media3D;
    using HelixToolkit.Wpf;

    public static class ArrowMoveExtensions
    {
        public static Task<ArrowVisual3D> PointTo(this ArrowVisual3D arrow, Point3D point)
        {
            return arrow.PointTo(point, TimeSpan.FromSeconds(1));
        }

        public static Task<ArrowVisual3D> PointTo(this ArrowVisual3D arrow, Point3D point, TimeSpan timeSpan)
        {
            var startPoint = arrow.Point2;

            var pointAnimation = new Point3DAnimation(startPoint, point, new Duration(timeSpan))
            {
                AccelerationRatio = 0.3,
                DecelerationRatio = 0.5,
                FillBehavior = FillBehavior.HoldEnd,
                AutoReverse = false
            };

            var tcs = new TaskCompletionSource<ArrowVisual3D>();
            pointAnimation.Completed += (s, e) => tcs.SetResult(arrow);
            arrow.BeginAnimation(ArrowVisual3D.Point2Property, pointAnimation);

            return tcs.Task;
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
    <data xmlns="http://www.netbeans.org/ns/make-project-private/1">
        <activeConfTypeElem>1</activeConfTypeElem>
        <activeConfIndexElem>0</activeConfIndexElem>
    </data>
    <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
    <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
        <group>
            <file>file:/home/jujulejaffa/NetBeansProjects/ArcEnCiel/src/ArcEnCiel.h</file>
            <file>file:/home/jujulejaffa/NetBeansProjects/ArcEnCiel/src/ArcEnCiel.cpp</file>
            <file>file:/home/jujulejaffa/NetBeansProjects/ArcEnCiel/src/main.cpp</file>
            <file>file:/home/jujulejaffa/NetBeansProjects/ArcEnCiel/src/Contexte.cpp</file>
            <file>file:/home/jujulejaffa/NetBeansProjects/ArcEnCiel/src/Contexte.h</file>
        </group>
    </open-files>
</project-private>


text:
require File.dirname(__FILE__) + '/../../spec_helper'
require 'matrix'

describe "Matrix.included" do
  it "needs to be reviewed for spec completeness" do
  end
end


text:
package org.apache.bookkeeper.client;

import static org.apache.bookkeeper.common.concurrent.FutureUtils.result;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import java.util.concurrent.CompletableFuture;
import org.apache.bookkeeper.client.api.WriteAdvHandle;
import org.apache.bookkeeper.client.api.WriteFlag;
import org.apache.bookkeeper.client.api.WriteHandle;
import org.apache.bookkeeper.net.BookieSocketAddress;
import org.junit.Test;

/**
 * Client side tests on deferred sync write flag.
 */
public class DeferredSyncTest extends MockBookKeeperTestCase {

    static final byte[] PASSWORD = "password".getBytes();
    static final ByteBuf DATA = Unpooled.wrappedBuffer("foobar".getBytes());
    static final int NUM_ENTRIES = 100;

    @Test
    public void testAddEntryLastAddConfirmedDoesNotAdvance() throws Exception {
        try (WriteHandle wh = result(newCreateLedgerOp()
                .withEnsembleSize(3)
                .withWriteQuorumSize(3)
                .withAckQuorumSize(2)
                .withPassword(PASSWORD)
                .withWriteFlags(WriteFlag.DEFERRED_SYNC)
                .execute())) {
            for (int i = 0; i < NUM_ENTRIES - 1; i++) {
                result(wh.appendAsync(DATA));
            }
            long lastEntryID = result(wh.appendAsync(DATA));
            assertEquals(NUM_ENTRIES - 1, lastEntryID);
            assertEquals(NUM_ENTRIES - 1, wh.getLastAddPushed());
            assertEquals(-1, wh.getLastAddConfirmed());
        }
    }

    @Test
    public void testAddEntryLastAddConfirmedAdvanceWithForce() throws Exception {
        try (WriteHandle wh = result(newCreateLedgerOp()
                .withEnsembleSize(3)
                .withWriteQuorumSize(3)
                .withAckQuorumSize(2)
                .withPassword(PASSWORD)
                .withWriteFlags(WriteFlag.DEFERRED_SYNC)
                .execute())) {
            for (int i = 0; i < NUM_ENTRIES - 1; i++) {
                result(wh.appendAsync(DATA));
            }
            long lastEntryID = result(wh.appendAsync(DATA));
            assertEquals(NUM_ENTRIES - 1, lastEntryID);
            assertEquals(NUM_ENTRIES - 1, wh.getLastAddPushed());
            assertEquals(-1, wh.getLastAddConfirmed());
            result(wh.force());
            assertEquals(NUM_ENTRIES - 1, wh.getLastAddConfirmed());
        }
    }

    @Test
    public void testForceOnWriteAdvHandle() throws Exception {
        try (WriteAdvHandle wh = result(newCreateLedgerOp()
                .withEnsembleSize(3)
                .withWriteQuorumSize(3)
                .withAckQuorumSize(2)
                .withPassword(PASSWORD)
                .withWriteFlags(WriteFlag.DEFERRED_SYNC)
                .makeAdv()
                .execute())) {
            CompletableFuture<Long> w0 = wh.writeAsync(0, DATA);
            CompletableFuture<Long> w2 = wh.writeAsync(2, DATA);
            CompletableFuture<Long> w3 = wh.writeAsync(3, DATA);
            result(w0);
            result(wh.force());
            assertEquals(0, wh.getLastAddConfirmed());
            CompletableFuture<Long> w1 = wh.writeAsync(1, DATA);
            result(w3);
            assertTrue(w1.isDone());
            assertTrue(w2.isDone());
            CompletableFuture<Long> w5 = wh.writeAsync(5, DATA);
            result(wh.force());
            assertEquals(3, wh.getLastAddConfirmed());
            wh.writeAsync(4, DATA);
            result(w5);
            result(wh.force());
            assertEquals(5, wh.getLastAddConfirmed());
        }
    }

    @Test
    public void testForceRequiresFullEnsemble() throws Exception {
        try (WriteHandle wh = result(newCreateLedgerOp()
                .withEnsembleSize(3)
                .withWriteQuorumSize(2)
                .withAckQuorumSize(2)
                .withPassword(PASSWORD)
                .withWriteFlags(WriteFlag.DEFERRED_SYNC)
                .execute())) {
            for (int i = 0; i < NUM_ENTRIES - 1; i++) {
                result(wh.appendAsync(DATA));
            }
            long lastEntryID = result(wh.appendAsync(DATA));
            assertEquals(NUM_ENTRIES - 1, lastEntryID);
            assertEquals(NUM_ENTRIES - 1, wh.getLastAddPushed());
            assertEquals(-1, wh.getLastAddConfirmed());

            BookieSocketAddress bookieAddress = wh.getLedgerMetadata().getEnsembleAt(wh.getLastAddPushed()).get(0);
            killBookie(bookieAddress);

            // write should succeed (we still have 2 bookies out of 3)
            result(wh.appendAsync(DATA));

            // force cannot go, it must be acknowledged by all of the bookies in the ensamble
            try {
                result(wh.force());
            } catch (BKException.BKBookieException failed) {
            }
            // bookie comes up again, force must succeed
            startKilledBookie(bookieAddress);
            result(wh.force());
        }
    }

    @Test
    public void testForceWillAdvanceLacOnlyUpToLastAcknoledgedWrite() throws Exception {
        try (WriteHandle wh = result(newCreateLedgerOp()
                .withEnsembleSize(3)
                .withWriteQuorumSize(3)
                .withAckQuorumSize(3)
                .withPassword(PASSWORD)
                .withWriteFlags(WriteFlag.DEFERRED_SYNC)
                .execute())) {
            for (int i = 0; i < NUM_ENTRIES - 1; i++) {
                result(wh.appendAsync(DATA));
            }
            long lastEntryIdBeforeSuspend = result(wh.appendAsync(DATA));
            assertEquals(NUM_ENTRIES - 1, lastEntryIdBeforeSuspend);
            assertEquals(-1, wh.getLastAddConfirmed());

            // one bookie will stop sending acks for forceLedger
            BookieSocketAddress bookieAddress = wh.getLedgerMetadata().getEnsembleAt(wh.getLastAddPushed()).get(0);
            suspendBookieForceLedgerAcks(bookieAddress);

            // start and complete a force, lastAddConfirmed cannot be "lastAddPushedAfterSuspendedWrite"
            // because the write has not yet been acknowledged by AckQuorumSize Bookies
            CompletableFuture<?> forceResult = wh.force();
            assertEquals(-1, wh.getLastAddConfirmed());

            // send an entry and receive ack
            long lastEntry = wh.append(DATA);

            // receive the ack for forceLedger
            resumeBookieWriteAcks(bookieAddress);
            result(forceResult);

            // now LastAddConfirmed will be equals to the last confirmed entry
            // before force() started
            assertEquals(lastEntryIdBeforeSuspend, wh.getLastAddConfirmed());

            result(wh.force());
            assertEquals(lastEntry, wh.getLastAddConfirmed());
        }
    }

    @Test
    public void testForbiddenEnsembleChange() throws Exception {
        try (WriteHandle wh = result(newCreateLedgerOp()
                .withEnsembleSize(1)
                .withWriteQuorumSize(1)
                .withAckQuorumSize(1)
                .withPassword(PASSWORD)
                .withWriteFlags(WriteFlag.DEFERRED_SYNC)
                .execute())) {
            for (int i = 0; i < NUM_ENTRIES - 1; i++) {
                wh.append(DATA);
            }

            assertEquals(1, availableBookies.size());
            // kill the only bookie in the ensamble
            killBookie(wh.getLedgerMetadata().getEnsembleAt(wh.getLastAddPushed()).get(0));
            assertEquals(0, availableBookies.size());
            startNewBookie();
            assertEquals(1, availableBookies.size());

            try {
                // we cannot switch to the new bookie with DEFERRED_SYNC
                wh.append(DATA);
                fail("since ensemble change is disable we cannot be able to write any more");
            } catch (BKException.BKWriteException ex) {
                // expected
            }
            LedgerHandle lh = (LedgerHandle) wh;
            assertTrue(lh.getDelayedWriteFailedBookies().isEmpty());
        }
    }

    @Test(expected = BKException.BKLedgerClosedException.class)
    public void testCannotIssueForceOnClosedLedgerHandle() throws Exception {
        WriteHandle wh = result(newCreateLedgerOp()
                .withEnsembleSize(1)
                .withWriteQuorumSize(1)
                .withAckQuorumSize(1)
                .withPassword(PASSWORD)
                .withWriteFlags(WriteFlag.DEFERRED_SYNC)
                .execute());
        wh.close();
        result(wh.force());
    }

}


text:
#include "main.hh"

using namespace std ;
namespace fs = boost::filesystem;

void nice_dump(path_t outputFile, vector<Experience> & Xp)
{
  // open/create and output file
  ofstream dumpStream ;
  dumpStream.open(outputFile.c_str(),ofstream::out);
  // save the important values extracted from the experiment
  vector<string> names ;
  names.push_back("ExperienceName "            );
  names.push_back("WalkedDistance(m) "         );
  names.push_back("has fallen? "               );
  names.push_back("MaxTrackingError(rad)"      );
  names.push_back("DurationOfTheExperiment(s) ");
  names.push_back("EnergyOfMotors(J.m-1.s-1) " );
  names.push_back("EnergyOfWalking(J.m-1.s-1) ");
  names.push_back("CostOfTransport "           );
  names.push_back("MechaCostOfTransport "      );
  names.push_back("FroudeNumber "              );
  int maxwidth=names[0].size() ;
  for (unsigned i=0 ; i<Xp.size() ; ++i)
  {maxwidth = max<int>(maxwidth,Xp[i].name().size());}
  maxwidth += 2 ;

  dumpStream << std::left
             << std::setw(maxwidth)
             << std::setfill(' ')
             << names[0] ;
  for (unsigned i=1 ; i<names.size() ; ++i)
  {
    dumpStream << std::left
               << std::setw(names[i].size())
               << std::setfill(' ')
               << names[i] ;
  }
  dumpStream << endl ;

  for (unsigned int i = 0 ; i < Xp.size() ; ++i)
  {
    unsigned index=0;
    dumpStream
        << std::left << std::setw(maxwidth)
        << std::setfill(' ') << Xp[i].name();
    ++index ;
    dumpStream
        << std::left << std::setw(names[index].size())
        << std::setfill(' ') << Xp[i].walkedDistanced();
    ++index ;
    dumpStream
        << std::left << std::setw(names[index].size())
        << std::setfill(' ') << Xp[i].hasFallen();
    ++index ;
    dumpStream
        << std::left << std::setw(names[index].size())
        << std::setfill(' ') << Xp[i].maxTrackingError();
    ++index ;
    dumpStream
        << std::left << std::setw(names[index].size())
        << std::setfill(' ') << Xp[i].TimeTravelled();
    ++index ;
    dumpStream
        << std::left << std::setw(names[index].size())
        << std::setfill(' ') << Xp[i].EnergyOfMotor();
    ++index ;
    dumpStream
        << std::left << std::setw(names[index].size())
        << std::setfill(' ') << Xp[i].EnergyOfWalking();
    ++index ;
    dumpStream
        << std::left << std::setw(names[index].size())
        << std::setfill(' ') << Xp[i].CostOfTransport();
    ++index ;
    dumpStream
        << std::left << std::setw(names[index].size())
        << std::setfill(' ') << Xp[i].MechaCostOfTransport();
    ++index ;
    dumpStream
        << std::left << std::setw(names[index].size())
        << std::setfill(' ') << Xp[i].FroudeNumber();
    ++index ;
    dumpStream
        << endl ;
  }
  dumpStream.close();
  cout << "results dumped in " << outputFile.c_str() << endl;
  return ;
}

int main(int argc, char *argv[])
{
  path_t dataRootPath("");
  path_t robotRootPath("");
  path_t outputFile("");
  path_t robotUrdfPath("");
#ifdef PINOCCHIO
  getOptions(argc,argv,dataRootPath,robotRootPath,robotUrdfPath,outputFile);
#else
  getOptions(argc,argv,dataRootPath,robotRootPath/*,robotUrdfPath*/,outputFile);
#endif

#ifdef PINOCCHIO
  // create a Pinocchio model
  se3::Model robotModel ;
  se3::urdf::buildModel(
        robotUrdfPath.string(),
        se3::JointModelFreeFlyer(),
        robotModel);
#endif

  // create a motor model
  Motors HRP2motors (robotRootPath) ;

  // explore the folder architecture and find all files inside
  ExploreFolder explore ;
  explore.findLogInFolder(dataRootPath);

  // get all the files name
  vector<result_set_t> * files = explore.files() ;

  // create the set of experiments
  vector<Experience> Xp ;

  // iterate over all the file "*_astate.log" and "*_rstate.log"
  result_set_t::iterator it_file_astate = (*files)[0].begin();
  result_set_t::iterator it_file_ref = (*files)[1].begin();
  for (unsigned int i = 0 ; i < (*files)[0].size() ;
       ++i, ++it_file_astate, ++it_file_ref)
  {
    // print the file currently analyzed
    cout << "file " << i <<  " " << endl ;
    // create an "Experience" object for each log
    Experience tmp_Xp = Experience (&HRP2motors,
#ifdef PINOCCHIO
                                    &robotModel,
#endif
                                    *it_file_astate,
                                    *it_file_ref,
                                    dataRootPath);
    // treat the data log
    if (tmp_Xp.handleData()==-1)
    {
      std::cout<< "wrong computation of data, log ignored" << std::endl;
      continue;
    }
    // save the object in the "Xp" vector
    Xp.push_back(tmp_Xp);
    //break;
  }
  nice_dump(outputFile, Xp);
  return 0 ;
}


text:
namespace Microsoft.Azure.Management.StorageSync.Models
{

    /// <summary>
    /// Defines values for ServerEndpointSyncHealthState.
    /// </summary>
    public static class ServerEndpointSyncHealthState
    {
        public const string Healthy = "Healthy";
        public const string Error = "Error";
        public const string SyncBlockedForRestore = "SyncBlockedForRestore";
        public const string SyncBlockedForChangeDetectionPostRestore = "SyncBlockedForChangeDetectionPostRestore";
        public const string NoActivity = "NoActivity";
    }
}


text:
package com.opengamma.engine.view.execution;

/**
 * Provides an infinite sequence of view cycle execution options.
 */
public class InfiniteViewCycleExecutionSequence extends MergingViewCycleExecutionSequence {

  @Override
  public ViewCycleExecutionOptions poll(ViewCycleExecutionOptions defaultExecutionOptions) {
    return merge(new ViewCycleExecutionOptions(), defaultExecutionOptions);
  }

  @Override
  public int hashCode() {
    return 1;
  }

  @Override
  public boolean equals(Object other) {
    if (other == null) {
      return false;
    }
    return (other instanceof InfiniteViewCycleExecutionSequence);
  }

  @Override
  public boolean isEmpty() {
    return false;
  }

  @Override
  public int estimateRemaining() {
    return Integer.MAX_VALUE;
  }

  @Override
  public InfiniteViewCycleExecutionSequence copy() {
    return this;
  }

}


text:
#ifndef __CASS_LATENCY_AWARE_POLICY_HPP_INCLUDED__
#define __CASS_LATENCY_AWARE_POLICY_HPP_INCLUDED__

#include "atomic.hpp"
#include "load_balancing.hpp"
#include "macros.hpp"
#include "periodic_task.hpp"
#include "scoped_ptr.hpp"

namespace cass {

class LatencyAwarePolicy : public ChainedLoadBalancingPolicy {
public:
  struct Settings {
    Settings()
      : exclusion_threshold(2.0)
      , scale_ns(100LL * 1000LL * 1000LL)
      , retry_period_ns(10LL * 1000LL * 1000LL * 1000LL)
      , update_rate_ms(100LL)
      , min_measured(50LL) {}

    double exclusion_threshold;
    uint64_t scale_ns;
    uint64_t retry_period_ns;
    uint64_t update_rate_ms;
    uint64_t min_measured;
  };

  LatencyAwarePolicy(LoadBalancingPolicy* child_policy, const Settings& settings)
    : ChainedLoadBalancingPolicy(child_policy)
    , min_average_(-1)
    , calculate_min_average_task_(NULL)
    , settings_(settings)
    , hosts_(new HostVec) {}

  virtual ~LatencyAwarePolicy() {}

  virtual void init(const SharedRefPtr<Host>& connected_host, const HostMap& hosts);

  virtual void register_handles(uv_loop_t* loop);
  virtual void close_handles();

  virtual QueryPlan* new_query_plan(const std::string& connected_keyspace,
                                    const Request* request,
                                    const TokenMap& token_map,
                                    Request::EncodingCache* cache);

  virtual LoadBalancingPolicy* new_instance() {
    return new LatencyAwarePolicy(child_policy_->new_instance(), settings_);
  }

  virtual void on_add(const SharedRefPtr<Host>& host);
  virtual void on_remove(const SharedRefPtr<Host>& host);
  virtual void on_up(const SharedRefPtr<Host>& host);
  virtual void on_down(const SharedRefPtr<Host>& host);

public:
  // Testing only
  int64_t min_average() const {
    return min_average_.load();
  }

private:
  class LatencyAwareQueryPlan : public QueryPlan {
  public:
    LatencyAwareQueryPlan(LatencyAwarePolicy* policy, QueryPlan* child_plan)
      : policy_(policy)
      , child_plan_(child_plan)
      , skipped_index_(0) {}

    SharedRefPtr<Host> compute_next();

  private:
    LatencyAwarePolicy* policy_;
    ScopedPtr<QueryPlan> child_plan_;

    HostVec skipped_;
    size_t skipped_index_;
  };

  static void on_work(PeriodicTask* task);
  static void on_after_work(PeriodicTask* task);

  Atomic<int64_t> min_average_;
  PeriodicTask* calculate_min_average_task_;
  Settings settings_;
  CopyOnWriteHostVec hosts_;

private:
  DISALLOW_COPY_AND_ASSIGN(LatencyAwarePolicy);
};

} // namespace cass

#endif


text:
var common = require('../common');
var assert = require('assert');

var Readable = require('../../lib/_stream_readable');
var Writable = require('../../lib/_stream_writable');
var util = require('util');

util.inherits(TestReadable, Readable);
function TestReadable(opt) {
  if (!(this instanceof TestReadable))
    return new TestReadable(opt);
  Readable.call(this, opt);
  this._ended = false;
}

TestReadable.prototype._read = function(n) {
  if (this._ended)
    this.emit('error', new Error('_read called twice'));
  this._ended = true;
  this.push(null);
};

util.inherits(TestWritable, Writable);
function TestWritable(opt) {
  if (!(this instanceof TestWritable))
    return new TestWritable(opt);
  Writable.call(this, opt);
  this._written = [];
}

TestWritable.prototype._write = function(chunk, encoding, cb) {
  this._written.push(chunk);
  cb();
};

// this one should not emit 'end' until we read() from it later.
var ender = new TestReadable();
var enderEnded = false;

// what happens when you pipe() a Readable that's already ended?
var piper = new TestReadable();
// pushes EOF null, and length=0, so this will trigger 'end'
piper.read();

setTimeout(function() {
  ender.on('end', function() {
    enderEnded = true;
  });
  assert(!enderEnded);
  var c = ender.read();
  assert.equal(c, null);

  var w = new TestWritable();
  var writableFinished = false;
  w.on('finish', function() {
    writableFinished = true;
  });
  piper.pipe(w);

  process.on('exit', function() {
    assert(enderEnded);
    assert(writableFinished);
    console.log('ok');
  });
});


text:
@interface NetverifyCameraFlashButton : UIButton <NetverifyAppearance>

- (void)setBackgroundColor:(UIColor *)backgroundColor forState:(UIControlState)state UI_APPEARANCE_SELECTOR;
- (UIColor *)backgroundColorForState:(UIControlState)state UI_APPEARANCE_SELECTOR;

@end


text:
PressableModel.Holding Event
============================

Occurs when a press gesture associated with the Kinect Toolkit input element is being held.

Syntax
======

<colgroup>
<col width="100%" />
</colgroup>

C++

public:
event TypedEventHandler<IPressableModel, KinectHoldingEventArgs>^ Holding {
         EventRegistrationToken add (TypedEventHandler<IPressableModel, KinectHoldingEventArgs>^ value);
         void remove (EventRegistrationToken token);
}

<colgroup>
<col width="100%" />
</colgroup>

C#

public event TypedEventHandler<IPressableModel, KinectHoldingEventArgs> Holding

<colgroup>
<col width="100%" />
</colgroup>

JavaScript

function onHolding(eventArgs) { /* Your code */ }

// addEventListener syntax
pressableModel.addEventListener("holding", onHolding);
pressableModel.removeEventListener("holding", onHolding);

- or -

pressableModel.onholding = onHolding;

Requirements
============

**Namespace:**Microsoft.Kinect.Toolkit.Input
**Assembly:** (in )

See also
========

#### Reference

[PressableModel Class](../../PressableModel_Class.md)
 [Microsoft.Kinect.Toolkit.Input Namespace](../../../Kinect.Toolkit.Input.md)


text:
@interface Span : HTMLElement

@end


text:
==========================
WSO2 Identity Server 5.2.0
==========================

---

|  Branch | Build Status |
| :------------ |:-------------
| master      | [![Build Status](https://wso2.org/jenkins/job/product-is/badge/icon)](https://wso2.org/jenkins/job/product-is) |

---

Welcome to the WSO2 Identity Server 5.2.0 release.

WSO2 Identity Server is an open source Identity and Entitlement management server. It supports a wide array of authentication
protocols such as SAML 2.0 Web SSO, OpenID, OAuth 2.0/1.0a, OpenID Connect and WS-Federation Passive.
It supports role based authorization and fined grained authorization with XACML 2.0/3.0 while inbound/outbound provisioning is
supported through SCIM and SPML.

This is based on the revolutionary WSO2 Carbon framework. All the major features have been developed as pluggable Carbon components.

New Features
============

*   Workflow support for Identity Server

        Engage workflows for any user/role operations carried out using WSO2 IS Management Console.
        For example, when a new user gets registered with WSO2 IS, a workflow will automatically be triggered and
        s/he will be assigned to a particular user role.

*   FIDO compliance

    Fast Identity Online (FIDO) is a specification developed to reduce the reliance on password for user
    authentication. The standard will enable any Web/cloud application to interface with a variety of FIDO-enabled
    security devices.

*   Link multiple user accounts

    In cases where users will have multiple entries in their respective user stores, to avoid requiring multiple
    logins to an application to obtain a fully privileged view for a single user's details, we now support merging
    of multiple user profiles.

*   PATCH operation support for SCIM 1.1

    PUT supports the replace operation but not the update operation. Since group is a heavy resource, the
    operation that alters without replacement (PATCH) needs to be implemented. If not each time a new user is
    added to the group, all the users should be sent in the PUT request.

*   SAML 2.0 Bearer Token Renewal

    In IS 5.0.0, STS feature supports renewing Bearer type SAML 1.1 tokens only;
    attempts to renew Bearer type SAML 2.0 Tokens get failed. With IS 5.2.0 product will
    facilitate renewing expired Bearer type SAML 2.0 Tokens.

*   OpenID Connect Core 1.0 Compliance

    The IS 5.0.0 had OpenID Support, however there were many points in the spec that were being violated.
    Now that the specification is finalized we have made IS 5.2.0 OpenID Connect support specification
    compliant. A major improvement this area is support for IDToken response type from the
    OpenID Connect authorization endpoint.

*   Ability to notify external endpoints when changes are made to Identities

    @product.name@ is now able to send invalidation notifications to external endpoints when there is a change in user
    roles, permissions or attributes as well as clear the internal cache when user roles, permissions or attributes
    been updated

Other Key Features
=============

*  Dynamically discovered federation
*  Identity Bridge - translation between heterogeneous Identity authentication protocols
*  SP Initiated and IDP Initiated SAML 2.0 Web Browser SSO provider

*  SAML2 Single Logout profile support
*  OpenID 2.0 Provider
*  OpenID Connect Authorization Server
*  Social login with Facebook, Google, Yahoo and Windows Live
*  XACML 3.0/2.0 based Entitlement Engine with WS-XACML support
*  OAuth 2.0/1.0a Authorization Server with OAuth 2.0/1.0a support
*  Inbound and Outbound Identity Provisioning with SCIM 1.1

*  Outbound Identiy Provisioning with SPML 2.0, Salesforce and GoogleApps
*  Integrated Windows Authentication and webSEAL authentication
*  Multi-option and multi-step (multi-factor) authentication
*  Claim based Security Token Service(STS) with SAML 2.0/1.1 support.
*  Support for various types of User Stores such as JDBC, Cassandra, LDAP, Active Directory in Read/Write mode.
*  Claim Management
*  User Profiles and Profile Management
*  Separable front-end and back-end - a single front-end server can be used to administer several back-endservers
*  Identity Bridge
*  Multi-option and multi-step authentication
*  Request Path Authenticators.
*  Social Login with Facebook / Google / Microsoft Windows Live.
*  Ability to plug-in custom developed authenticators.
*  Provisioning Bridge.
*  Just-in-time provisioning.

*  Ability to plug-in custom developed provisioning connectors.
*  User Dashboard.
*  SAML2 Web SSO profile Request / Response validator.
*  Remote User Store Management.
*  Custom permissions.
*  Encrypted SAML2 Assertions.
*  NTLM grant type for OAuth 2.0
*  Workflows for user management operations
*  2 factor authentication with FIDO
*  Linking 2 or more local/federated user accounts

System Requirements
===================

1. Minimum memory - 2 GB

2. Processor - Pentium 800MHz or equivalent at minimum

3. Java SE Development Kit 1.7 or higher

4. The Management Console requires full Javascript enablement of the Web browser.

5. To build WSO2 Identity Server from the Source distribution, it is also necessary that you have Maven 3 or later.

For more details see
   http://docs.wso2.org/wiki/display/IS510/Installation+Prerequisites

Project Resources
=================

* Home page          : http://wso2.com/products/identity-server
* Library            : http://wso2.org/library/identity
* Wiki               : http://docs.wso2.org/wiki/display/IS510/WSO2+Identity+Server+Documentation
* JIRA-Issue Tracker : https://wso2.org/jira/browse/IDENTITY
* Forums             : http://stackoverflow.com/questions/tagged/wso2/
* WSO2 Developer List: dev@wso2.org

Installation and Running
========================

1. Extract the downloaded zip file
2. Run the wso2server.sh or wso2server.bat file in the /bin directory
3. Once the server starts, point your Web browser to https://localhost:9443/carbon/
4. User dashboard is available at https://localhost:9443/dashboard
5. For more information, see the Installation Guide

WSO2 Identity Server Distribution Directory Structure
==============================================

            CARBON_HOME
            ├── bin
            ├── dbscripts
            ├── lib
            ├── repository
            │   ├── components
            │   ├── conf
            │   │   └── identity
            │   │       ├── identity-providers
            │   │       └── service-providers
            │   ├── database
            │   ├── deployment
            │   ├── logs
            │   ├── resources
            │   │   ├── identity
            │   │   └── security
            │   └── tenants
            └── tmp

    - bin
      Contains various scripts .sh & .bat scripts.

    - dbscripts
      Contains the database creation & seed data population SQL scripts for
      various supported databases.

    - lib
      Contains the basic set of libraries required to startup Carbon.

    - repository
      The repository where Carbon artifacts & Axis2 services and
      modules deployed in WSO2 Carbon are stored.
      In addition to this other custom deployers such as
      dataservices and axis1services are also stored.

    	- components
          Contains all OSGi related libraries and configurations.

        - conf
          Contains server configuration files. Ex: axis2.xml, carbon.xml

	        - identity
	          Contains all configurations related to identity.

	            - identity-providers
	              Identity providers configured using file

	            - service-providers
	              Service providers configured using file

        - database
          Contains the WSO2 Registry & User Manager database.

        - deployment
          Contains server side and client side Axis2 repositories.
	      All deployment artifacts should go into this directory.

        - logs
          Contains all log files created during execution.

        - resources
          Contains additional resources that may be required.

	- tenants
	  Directory will contain relevant tenant artifacts
	  in the case of a multitenant deployment.

    - tmp
      Used for storing temporary files, and is pointed to by the
      java.io.tmpdir System property.

    - LICENSE.txt
      Apache License 2.0 under which WSO2 Carbon is distributed.

    - README.txt
      This document.

    - release-notes.html
      Release information for WSO2 Carbon ${carbon.product.version}.

Secure sensitive information in carbon configuration files
----------------------------------------------------------

There are sensitive information such as passwords in the carbon configuration.
You can secure them by using secure vault. Please go through following steps to
secure them with default mode.

1. Configure secure vault with default configurations by running ciphertool
	script from bin directory.

> ciphertool.sh -Dconfigure   (in UNIX)

This script would do following configurations that you need to do by manually

(i) Replaces sensitive elements in configuration files,  that have been defined in
		 cipher-tool.properties, with alias token values.
(ii) Encrypts plain text password which is defined in cipher-text.properties file.
(iii) Updates secret-conf.properties file with default keystore and callback class.

cipher-tool.properties, cipher-text.properties and secret-conf.properties files
			can be found at repository/conf/security directory.

2. Start server by running wso2server script from bin directory

> wso2server.sh   (in UNIX)

By default mode, it would ask you to enter the master password
(By default, master password is the password of carbon keystore and private key)

3. Change any password by running ciphertool script from bin directory.

> ciphertool -Dchange  (in UNIX)

For more details see
http://docs.wso2.org/wiki/display/Carbon420/WSO2+Carbon+Secure+Vault

Support
=======
We are committed to ensuring that your enterprise middleware deployment is completely supported from
evaluation to production. Our unique approach ensures that all support leverages our open development
methodology and is provided by the very same engineers who build the technology.

For more details and to take advantage of this unique opportunity, visit http://wso2.com/support/.

For more information on WSO2 Carbon, visit the WSO2 Oxygen Tank (http://wso2.org)

For more information about WSO2 Identity Server please see http://wso2.org/projects/identity or visit the
WSO2 Oxygen Tank developer portal for addition resources.

For further details, see the WSO2 Carbon documentation at
http://docs.wso2.org/wiki/display/Carbon420/WSO2+Carbon+Documentation

---------------------------------------------------------------------------
(c) Copyright 2015 WSO2 Inc.


text:
class MetaBadge < AdHonorem::Badge
  attribute :slug,          'meta_badge'
  attribute :name,          'Meta badge'
  attribute :description,   'This is a meta badge'
  attribute :category,      'General'
  attribute :points,        10
  attribute :icon_locked,   Rails.root.join('public', 'badges', 'locked', 'meta.png')
  attribute :icon_unlocked, Rails.root.join('public', 'badges', 'unlocked', 'meta.png')
  attribute :legacy,        true

  hook :level_up, to: :level_up

  def initialize
    super

    add_sub_badge(:sub_badge_one)
    add_sub_badge(:sub_badge_two)
  end
end


text:
#include "realm.h"
#include "realm/id.h"
#include "realm/cmdline.h"

#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <cstring>
#include <csignal>
#include <cmath>

#include <time.h>

#include "osdep.h"

using namespace Realm;

Logger log_app("app");

// Task IDs, some IDs are reserved so start at first available number
enum {
  TOP_LEVEL_TASK = Processor::TASK_ID_FIRST_AVAILABLE+0,
  MEMSPEED_TASK,
  COPYPROF_TASK,
};

enum {
  FID_BASE = 44,
};

struct SpeedTestArgs {
  Memory mem;
  RegionInstance inst;
  size_t elements;
  int reps;
  Machine::AffinityDetails affinity;
};

struct CopyProfResult {
  long long *nanoseconds;
  UserEvent done;
};

void copy_profiling_task(const void *args, size_t arglen,
			 const void *userdata, size_t userlen, Processor p)
{
  ProfilingResponse resp(args, arglen);
  assert(resp.user_data_size() == sizeof(CopyProfResult));
  const CopyProfResult *result = static_cast<const CopyProfResult *>(resp.user_data());

  ProfilingMeasurements::OperationTimeline timeline;
  if(resp.get_measurement(timeline)) {
    *(result->nanoseconds) = timeline.complete_time - timeline.start_time;
    result->done.trigger();
  } else {
    log_app.fatal() << "no operation timeline in profiling response!";
    assert(0);
  }
}

namespace TestConfig {
  size_t buffer_size = 64 << 20; // should be bigger than any cache in system
  bool do_tasks = true;   // should tasks accessing memories be tested
  bool do_copies = true;  // should DMAs between memories be tested
  int copy_reps = 0;      // if nonzero, average over #reps copies
  int copy_fields = 1;    // number of distinct fields to copy
  size_t sparse_chunk = 0;  // if nonzero, test sparse copies with chunk size
  size_t sparse_gap = 16;   // gap between sparse chunks (if used)
  bool copy_aos = false;   // if true, use an AOS memory layout
  bool slow_mems = false;  // show slow memories be tested?
};

void memspeed_cpu_task(const void *args, size_t arglen,
		       const void *userdata, size_t userlen, Processor p)
{
  const SpeedTestArgs& cargs = *(const SpeedTestArgs *)args;

  AffineAccessor<void *, 1> ra(cargs.inst, 0);

  // sequential write test
  double seqwr_bw = 0;
  {
    long long t1 = Clock::current_time_in_nanoseconds();
    for(int j = 0; j < cargs.reps; j++)
      for(size_t i = 0; i < cargs.elements; i++)
	ra[i] = 0;
    long long t2 = Clock::current_time_in_nanoseconds();
    seqwr_bw = 1.0 * cargs.reps * cargs.elements * sizeof(void *) / (t2 - t1);
  }

  // sequential read test
  double seqrd_bw = 0;
  {
    long long t1 = Clock::current_time_in_nanoseconds();
    int errors = 0;
    for(int j = 0; j < cargs.reps; j++)
      for(size_t i = 0; i < cargs.elements; i++) {
	void *ptr = *(void * volatile *)&ra[i];
	if(ptr != 0) errors++;
      }
    long long t2 = Clock::current_time_in_nanoseconds();
    assert(errors == 0);
    seqrd_bw = 1.0 * cargs.reps * cargs.elements * sizeof(void *) / (t2 - t1);
  }

  // random write test
  double rndwr_bw = 0;
  std::vector<void *> last_ptrs;  // for checking latency test
  {
    // run on many fewer elements...
    size_t count = cargs.elements >> 8;
    // quadratic stepping via "acceleration" and "velocity"
    size_t a = 548191;
    size_t v = 24819;
    size_t p = 0;
    long long t1 = Clock::current_time_in_nanoseconds();
    for(int j = 0; j < cargs.reps; j++) {
      for(size_t i = 0; i < count; i++) {
	size_t prev = p;
	p = (p + v) % cargs.elements;
	v = (v + a) % cargs.elements;
	// wrapping would be bad
	assert(p != 0);
	ra[prev] = &ra[p];
      }
      last_ptrs.push_back(&ra[p]);
    }
    long long t2 = Clock::current_time_in_nanoseconds();
    rndwr_bw = 1.0 * cargs.reps * count * sizeof(void *) / (t2 - t1);
  }

  // random read test
  double rndrd_bw = 0;
  {
    // run on many fewer elements...
    size_t count = cargs.elements >> 8;
    // quadratic stepping via "acceleration" and "velocity"
    size_t a = 548191;
    size_t v = 24819;
    size_t p = 0;
    long long t1 = Clock::current_time_in_nanoseconds();
    int errors = 0;
    for(int j = 0; j < cargs.reps; j++)
      for(size_t i = 0; i < count; i++) {
	size_t prev = p;
	p = (p + v) % cargs.elements;
	v = (v + a) % cargs.elements;
	// wrapping would be bad
	assert(p != 0);
	void *exp = &ra[p];
	void *act = ra[prev];
	if(exp != act) {
	  //log_app.info() << "error: " << exp << " != " << act;
	  errors++;
	}
      }
    long long t2 = Clock::current_time_in_nanoseconds();
    if(errors > 0)
      log_app.warning() << errors << " errors during random read test";
    rndrd_bw = 1.0 * cargs.reps * count * sizeof(void *) / (t2 - t1);
  }

  // latency test
  double latency = 0;
  {
    // run on many fewer elements...
    size_t count = cargs.elements >> 8;
    // quadratic stepping via "acceleration" and "velocity"
    long long t1 = Clock::current_time_in_nanoseconds();
    int errors = 0;
    void **ptr = &ra[0];
    for(int j = 0; j < cargs.reps; j++) {
      for(size_t i = 0; i < count; i++)
	ptr = (void **)*ptr;
      assert(ptr == last_ptrs[j]);
    }
    long long t2 = Clock::current_time_in_nanoseconds();
    assert(errors == 0);
    latency = 1.0 * (t2 - t1) / (cargs.reps * count);
  }

  log_app.info() << " on proc " << p << " seqwr:" << seqwr_bw << " seqrd:" << seqrd_bw;
  log_app.info() << " on proc " << p << " rndwr:" << rndwr_bw << " rndrd:" << rndrd_bw;
  log_app.info() << " on proc " << p << " latency:" << latency;
}

#if defined(REALM_USE_CUDA) || defined(REALM_USE_HIP)
extern "C" {
  double gpu_seqwr_test(void *buffer, size_t reps, size_t elements);
  double gpu_seqrd_test(void *buffer, size_t reps, size_t elements);
  double gpu_rndwr_test(void *buffer, size_t reps, size_t elements);
  double gpu_rndrd_test(void *buffer, size_t reps, size_t elements);
  double gpu_latency_test(void *buffer, size_t reps, size_t elements);
}

void memspeed_gpu_task(const void *args, size_t arglen,
		       const void *userdata, size_t userlen, Processor p)
{
  const SpeedTestArgs& cargs = *(const SpeedTestArgs *)args;

  AffineAccessor<void *, 1> ra(cargs.inst, 0);
  assert(ra.strides[0] == sizeof(void *));

  // sequential write test
  double seqwr_bw = gpu_seqwr_test(&ra[0], cargs.reps, cargs.elements);

  // sequential read test
  double seqrd_bw = gpu_seqrd_test(&ra[0], cargs.reps, cargs.elements);

  // random write test
  double rndwr_bw = gpu_rndwr_test(&ra[0], cargs.reps, cargs.elements);

  // random read test
  double rndrd_bw = gpu_rndrd_test(&ra[0], cargs.reps, cargs.elements);

  // latency test
  double latency = gpu_latency_test(&ra[0], cargs.reps, cargs.elements);

  log_app.info() << " on proc " << p << " seqwr:" << seqwr_bw << " seqrd:" << seqrd_bw;
  log_app.info() << " on proc " << p << " rndwr:" << rndwr_bw << " rndrd:" << rndrd_bw;
  log_app.info() << " on proc " << p << " latency:" << latency;
}
#endif

std::set<Processor::Kind> supported_proc_kinds;

void top_level_task(const void *args, size_t arglen,
		    const void *userdata, size_t userlen, Processor p)
{
  log_app.print() << "Realm memory speed test";

  size_t elements = TestConfig::buffer_size / sizeof(void *);
  IndexSpace<1> d = Rect<1>(0, elements - 1);

  // build the list of memories that we want to test
  std::vector<Memory> memories;
  Machine machine = Machine::get_machine();
  for(Machine::MemoryQuery::iterator it = Machine::MemoryQuery(machine).begin(); it; ++it) {
    Memory m = *it;
    size_t capacity = m.capacity();
    // we need two instances if we're doing copy testing
    if(capacity < (TestConfig::buffer_size *
		   (TestConfig::do_copies ? 2*TestConfig::copy_fields : 1))) {
      log_app.info() << "skipping memory " << m << " (kind=" << m.kind() << ") - insufficient capacity";
      continue;
    }
    if((m.kind() == Memory::GLOBAL_MEM) && !TestConfig::slow_mems) {
      log_app.info() << "skipping memory " << m << " (kind=" << m.kind() << ") - slow global memory";
      continue;
    }
    if(ID(m).is_ib_memory()) {
      log_app.info() << "skipping memory " << m << " (kind=" << m.kind() << ") - intermediate buffer memory";
      continue;
    }

    log_app.print() << "Memory: " << m << " Kind:" << m.kind() << " Capacity: " << m.capacity();
    memories.push_back(m);
  }

  // iterate over memories, create an instance, and then let each processor beat on it
  if(TestConfig::do_tasks) {
    for(std::vector<Memory>::const_iterator it = memories.begin();
	it != memories.end();
	++it) {
      Memory m = *it;
      std::vector<size_t> field_sizes(1, sizeof(void *));
      RegionInstance inst;
      RegionInstance::create_instance(inst, m, d,
				      std::vector<size_t>(1, sizeof(void *)),
				      0 /*SOA*/,
				      ProfilingRequestSet()).wait();
      assert(inst.exists());

      // clear the instance first - this should also take care of faulting it in
      void *fill_value = 0;
      std::vector<CopySrcDstField> sdf(1);
      sdf[0].inst = inst;
      sdf[0].field_id = 0;
      sdf[0].size = sizeof(void *);
      d.fill(sdf, ProfilingRequestSet(), &fill_value, sizeof(fill_value)).wait();

      Machine::ProcessorQuery pq = Machine::ProcessorQuery(machine).has_affinity_to(m);
      for(Machine::ProcessorQuery::iterator it2 = pq.begin(); it2; ++it2) {
	Processor p = *it2;

	SpeedTestArgs cargs;
	cargs.mem = m;
	cargs.inst = inst;
	cargs.elements = elements;
	cargs.reps = 8;
	bool ok = machine.has_affinity(p, m, &cargs.affinity);
	assert(ok);

	log_app.info() << "  Affinity: " << p << "->" << m << " BW: " << cargs.affinity.bandwidth
		       << " Latency: " << cargs.affinity.latency;

	if(supported_proc_kinds.count(p.kind()) == 0) {
	  log_app.info() << "processor " << p << " is of unsupported kind " << p.kind() << " - skipping";
	  continue;
	}

	Event e = p.spawn(MEMSPEED_TASK, &cargs, sizeof(cargs));

	e.wait();
      }

      inst.destroy();
    }
  }

  if(TestConfig::do_copies) {
    std::map<FieldID, size_t> field_sizes;
    for(int i = 0; i < TestConfig::copy_fields; i++)
      field_sizes[FID_BASE + i] = sizeof(void *);

    // do we need a sparse index space?
    IndexSpace<1> d_sparse;
    size_t sparse_elements = 0;
    if(TestConfig::sparse_chunk > 0) {
      std::vector<Rect<1> > rects;
      for(size_t ofs = 0;
          ofs <= (elements - TestConfig::sparse_chunk);
          ofs += (TestConfig::sparse_chunk + TestConfig::sparse_gap)) {
        rects.push_back(Rect<1>(ofs, ofs + TestConfig::sparse_chunk - 1));
        sparse_elements += TestConfig::sparse_chunk;
      }
      d_sparse = IndexSpace<1>(rects);
    }

    for(std::vector<Memory>::const_iterator it = memories.begin();
	it != memories.end();
	++it) {
      Memory m1 = *it;

      RegionInstance inst1;
      RegionInstance::create_instance(inst1, m1, d, field_sizes,
				      (TestConfig::copy_aos ? 1 : 0),
				      ProfilingRequestSet()).wait();
      assert(inst1.exists());

      // clear the instance first - this should also take care of faulting it in
      {
        void *fill_value = 0;
        std::vector<CopySrcDstField> srcs(TestConfig::copy_fields);
        for(int i = 0; i < TestConfig::copy_fields; i++)
          srcs[i].set_fill(fill_value);
        std::vector<CopySrcDstField> dsts(TestConfig::copy_fields);
        for(int i = 0; i < TestConfig::copy_fields; i++)
          dsts[i].set_field(inst1, FID_BASE+i, sizeof(void *));

        d.copy(srcs, dsts, ProfilingRequestSet()).wait();
      }

      for(std::vector<Memory>::const_iterator it2 = memories.begin();
	it2 != memories.end();
	++it2) {
	Memory m2 = *it2;

	RegionInstance inst2;
	RegionInstance::create_instance(inst2, m2, d, field_sizes,
					(TestConfig::copy_aos ? 1 : 0),
					ProfilingRequestSet()).wait();
	assert(inst2.exists());

	// clear the instance first - this should also take care of faulting it in
        {
          void *fill_value = 0;
          std::vector<CopySrcDstField> srcs(TestConfig::copy_fields);
          for(int i = 0; i < TestConfig::copy_fields; i++)
            srcs[i].set_fill(fill_value);
          std::vector<CopySrcDstField> dsts(TestConfig::copy_fields);
          for(int i = 0; i < TestConfig::copy_fields; i++)
            dsts[i].set_field(inst2, FID_BASE+i, sizeof(void *));
          d.copy(srcs, dsts, ProfilingRequestSet()).wait();
        }

	long long total_full_copy_time = 0;
	long long total_short_copy_time = 0;
        long long total_sparse_copy_time = 0;

        std::vector<CopySrcDstField> srcs(TestConfig::copy_fields);
        for(int i = 0; i < TestConfig::copy_fields; i++)
          srcs[i].set_field(inst1, FID_BASE+i, sizeof(void *));
        std::vector<CopySrcDstField> dsts(TestConfig::copy_fields);
        for(int i = 0; i < TestConfig::copy_fields; i++)
          dsts[i].set_field(inst2, FID_BASE+i, sizeof(void *));

	for(int rep = 0; rep <= TestConfig::copy_reps; rep++) {
	  // now perform two instance-to-instance copies

	  // copy #1 - full copy
	  long long full_copy_time = -1;
	  UserEvent full_copy_done = UserEvent::create_user_event();
	  {
	    CopyProfResult result;
	    result.nanoseconds = &full_copy_time;
	    result.done = full_copy_done;
	    ProfilingRequestSet prs;
	    prs.add_request(p, COPYPROF_TASK, &result, sizeof(CopyProfResult))
	      .add_measurement<ProfilingMeasurements::OperationTimeline>();
	    d.copy(srcs, dsts, prs).wait();
	  }

	  // copy #2 - single-element copy
	  long long short_copy_time = -1;
	  UserEvent short_copy_done = UserEvent::create_user_event();
	  {
	    CopyProfResult result;
	    result.nanoseconds = &short_copy_time;
	    result.done = short_copy_done;
	    ProfilingRequestSet prs;
	    prs.add_request(p, COPYPROF_TASK, &result, sizeof(CopyProfResult))
	      .add_measurement<ProfilingMeasurements::OperationTimeline>();
	    Rect<1>(0, 0).copy(srcs, dsts, prs).wait();
	  }

	  // wait for both results
	  full_copy_done.wait();
	  short_copy_done.wait();

	  if((rep > 0) || (TestConfig::copy_reps == 0)) {
	    total_full_copy_time += full_copy_time;
	    total_short_copy_time += short_copy_time;
	  }

          // optional copy #3 - sparse copy
          if(TestConfig::sparse_chunk > 0) {
            long long sparse_copy_time = -1;
            UserEvent sparse_copy_done = UserEvent::create_user_event();
            {
              CopyProfResult result;
              result.nanoseconds = &sparse_copy_time;
              result.done = sparse_copy_done;
              ProfilingRequestSet prs;
              prs.add_request(p, COPYPROF_TASK, &result, sizeof(CopyProfResult))
                .add_measurement<ProfilingMeasurements::OperationTimeline>();
              d_sparse.copy(srcs, dsts, prs).wait();
            }

            sparse_copy_done.wait();

            if((rep > 0) || (TestConfig::copy_reps == 0))
              total_sparse_copy_time += sparse_copy_time;
          }
	}

	if(TestConfig::copy_reps > 1) {
	  total_full_copy_time /= TestConfig::copy_reps;
	  total_short_copy_time /= TestConfig::copy_reps;
          total_sparse_copy_time /= TestConfig::copy_reps;
	}

	// latency is estimated as time to perfom single copy
	double latency = total_short_copy_time;

	// bandwidth is estimated based on extra time taken by full copy
	double bw = (1.0 * elements * TestConfig::copy_fields * sizeof(void *) /
		     (total_full_copy_time - total_short_copy_time));

        if(TestConfig::sparse_chunk == 0) {
          log_app.info() << "copy " << m1 << " -> " << m2 << ": bw:" << bw << " lat:" << latency;
        } else {
          double sparse_bw = (1.0 * sparse_elements * TestConfig::copy_fields * sizeof(void *) /
                              (total_sparse_copy_time - total_short_copy_time));

          log_app.info() << "copy " << m1 << " -> " << m2 << ": bw:" << bw << " lat:" << latency << " sparse_bw:" << sparse_bw;
        }

	inst2.destroy();
      }

      inst1.destroy();
    }
  }

  // HACK: there's a shutdown race condition related to instance destruction
  usleep(100000);
}

int main(int argc, char **argv)
{
  Runtime rt;

  rt.init(&argc, &argv);

  CommandLineParser cp;
  cp.add_option_int_units("-b", TestConfig::buffer_size, 'M')
    .add_option_int("-tasks", TestConfig::do_tasks)
    .add_option_int("-copies", TestConfig::do_copies)
    .add_option_int("-reps", TestConfig::copy_reps)
    .add_option_int("-fields", TestConfig::copy_fields)
    .add_option_int("-sparse", TestConfig::sparse_chunk)
    .add_option_int("-gap", TestConfig::sparse_gap)
    .add_option_int("-aos", TestConfig::copy_aos)
    .add_option_int("-slowmem", TestConfig::slow_mems);
  bool ok = cp.parse_command_line(argc, const_cast<const char **>(argv));
  assert(ok);

  rt.register_task(TOP_LEVEL_TASK, top_level_task);

  Processor::register_task_by_kind(Processor::LOC_PROC, false /*!global*/,
				   MEMSPEED_TASK,
				   CodeDescriptor(memspeed_cpu_task),
				   ProfilingRequestSet(),
				   0, 0).wait();
  supported_proc_kinds.insert(Processor::LOC_PROC);

  Processor::register_task_by_kind(Processor::UTIL_PROC, false /*!global*/,
				   MEMSPEED_TASK,
				   CodeDescriptor(memspeed_cpu_task),
				   ProfilingRequestSet(),
				   0, 0).wait();
  supported_proc_kinds.insert(Processor::UTIL_PROC);

  Processor::register_task_by_kind(Processor::IO_PROC, false /*!global*/,
				   MEMSPEED_TASK,
				   CodeDescriptor(memspeed_cpu_task),
				   ProfilingRequestSet(),
				   0, 0).wait();
  supported_proc_kinds.insert(Processor::IO_PROC);

#if defined(REALM_USE_CUDA) || defined(REALM_USE_HIP)
  Processor::register_task_by_kind(Processor::TOC_PROC, false /*!global*/,
				   MEMSPEED_TASK,
				   CodeDescriptor(memspeed_gpu_task),
				   ProfilingRequestSet(),
				   0, 0).wait();
  supported_proc_kinds.insert(Processor::TOC_PROC);
#endif

  Processor::register_task_by_kind(Processor::LOC_PROC, false /*!global*/,
				   COPYPROF_TASK,
				   CodeDescriptor(copy_profiling_task),
				   ProfilingRequestSet(),
				   0, 0).wait();

  // select a processor to run the top level task on
  Processor p = Machine::ProcessorQuery(Machine::get_machine())
    .only_kind(Processor::LOC_PROC)
    .first();
  assert(p.exists());

  // collective launch of a single task - everybody gets the same finish event
  Event e = rt.collective_spawn(p, TOP_LEVEL_TASK, 0, 0);

  // request shutdown once that task is complete
  rt.shutdown(e);

  // now sleep this thread until that shutdown actually happens
  rt.wait_for_shutdown();

  return 0;
}


text:
package ciir.jfoley.chai.kinds;

import ciir.jfoley.chai.coders.data.ByteBuilder;
import ciir.jfoley.chai.coders.kinds.VarUInt;
import ciir.jfoley.chai.collections.list.IntList;
import org.junit.Test;

import java.io.InputStream;
import java.util.Random;

import static org.junit.Assert.*;

/**
 * @author jfoley
 */
public class VarUIntTest {

  @Test
  public void testNegative() {
    VarUInt coder = new VarUInt();
    try {
      assertEquals(-8, coder.read(coder.write(-8)).intValue());
      fail("Shouldn't even try to encode a negative number.");
    } catch (AssertionError e) {
      assertNotNull(e);
    }
  }

  @Test
  public void testImpl() throws Exception {
    VarUInt coder = new VarUInt();
    Random rand = new Random();
    for (int i = 0; i < 100000; i++) {
      int x = Math.abs(rand.nextInt());
      assertEquals(x, coder.read(coder.write(x)).intValue());
    }

    // Check edge-case values:
    assertEquals(0, coder.read(coder.write(0)).intValue());
    assertEquals(1, coder.read(coder.write(1)).intValue());
    assertEquals(2, coder.read(coder.write(2)).intValue());
    assertEquals(Integer.MAX_VALUE, coder.read(coder.write(Integer.MAX_VALUE)).intValue());
  }

  @Test
  public void testStreamImpl() throws Exception {
    VarUInt coder = new VarUInt();
    Random rand = new Random();
    int N = 10000;
    IntList data = new IntList(N+4);

    // Check edge-case values:
    data.add(0);
    data.add(1);
    data.add(2);
    data.add(Integer.MAX_VALUE);
    for (int i = 0; i < N; i++) {
      int x = Math.abs(rand.nextInt());
      data.add(x);
    }

    ByteBuilder builder = new ByteBuilder();
    for (int i = 0; i < data.size(); i++) {
      int val = data.getQuick(i);
      coder.writePrim(builder.asOutputStream(), val);
    }

    InputStream stream = builder.asInputStream();
    for(int i=0; i<data.size(); i++) {
      assertEquals(data.getQuick(i), coder.readPrim(stream));
    }
  }
}


text:
.Chubuk {
  display: -webkit-box;
  display: -moz-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-direction: normal;
  -moz-box-direction: normal;
  -webkit-box-orient: vertical;
  -moz-box-orient: vertical;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  position: relative;
  font-family: 'Roboto', sans-serif;
  line-height: 1em;
}
.Chubuk .selectedVizType {
  background-color: #D6DED3;
  color: black;
  box-shadow: 1px 1px 1px black;
  font-weight: 400;
}
.Chubuk > .configPanel {
  font-family: 'Roboto', sans-serif;
  display: block;
  position: absolute;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  left: 0px;
  bottom: -80px;
  z-index: 200;
  width: 100%;
  border-radius: 5px;
  border: solid 1px lightgray;
  margin: 0px;
  background-color: rgba(238, 238, 238, 0.5);
}
.Chubuk > .configPanel[active="false"] {
  border: solid 0px lightgray;
  margin: 1px;
}
.Chubuk > .configPanel[active="false"] > .selectVizType {
  display: none;
}
.Chubuk > .configPanel[active="false"] > .configGroup {
  display: none;
}
.Chubuk > .configPanel > .configVisiblityButton {
  position: absolute;
  right: 2px;
  bottom: 2px;
  cursor: pointer;
}
.Chubuk > .configPanel > .configVisiblityButton:hover {
  color: orangered;
}
.Chubuk > .configPanel > .selectVizType {
  padding: 2px;
  border-bottom: solid 1px lightgray;
  display: -webkit-box;
  display: -moz-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-direction: normal;
  -moz-box-direction: normal;
  -webkit-box-orient: horizontal;
  -moz-box-orient: horizontal;
  -webkit-flex-direction: row;
  -ms-flex-direction: row;
  flex-direction: row;
}
.Chubuk > .configPanel > .selectVizType > .selectVizType-Header {
  display: block;
  padding: 4px;
  font-weight: 300;
}
.Chubuk > .configPanel > .selectVizType > .vizType {
  -webkit-box-flex: 1;
  -moz-box-flex: 1;
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1;
  padding: 2px;
  border: solid 1px lightgray;
  font-weight: 300;
  border-radius: 10px;
  text-align: center;
  margin: 1px 5px;
  cursor: pointer;
  background-color: white;
  color: gray;
}
.Chubuk > .configPanel > .selectVizType > .vizType:hover {
  box-shadow: 1px 1px 1px black;
  font-weight: 400;
  color: #ff4500;
}
.Chubuk > .configPanel > .configGroup {
  border: solid 1px gray;
  border-radius: 8px;
  margin: 3px 0px 3px 3px;
  padding: 2px 2px 2px 3px;
  display: inline-block;
  background-color: #EEE;
}
.Chubuk > .configPanel > .configGroup > .configHeading {
  font-weight: 700;
  cursor: pointer;
  color: black;
}
.Chubuk > .configPanel > .configGroup > .configHeading:hover {
  color: orangered;
}
.Chubuk > .configPanel > .configGroup > .configOpt {
  display: inline-block;
  cursor: pointer;
  font-size: 0.8em;
  border: solid 1px lightgray;
  border-radius: 4px;
  padding: 0px 2px;
  background-color: white;
}
.Chubuk > .configPanel > .configGroup > .configOpt > .opt_label {
  margin-left: 2px;
  font-size: 0.9em;
}
.Chubuk > .configPanel > .configGroup > .configOpt:hover {
  color: orangered !important;
}
.Chubuk > .configPanel > .configGroup > .configOpt.dataDistr > input[type="radio"] {
  height: 12px;
  vertical-align: baseline;
  padding: 2px;
  margin: 0px;
}
.Chubuk > .configPanel > .configGroup > .configOpt.dataDistr > label {
  cursor: pointer;
}
.Chubuk > .configPanel > .configGroup > .configOpt.numItems .in_numItems {
  border-width: 0px;
  width: 35px;
}
.Chubuk > .configPanel > .configGroup > .configOpt.barHeightList {
  display: none;
}
.Chubuk > .configPanel > .configGroup > .configOpt.button_wrappedInverse {
  display: none;
}
.Chubuk > .configPanel > .configGroup > .configOpt.button_showColor {
  display: none;
}
.Chubuk > .configPanel > .configGroup > .configOpt.columnGap {
  display: none;
}
.Chubuk > .configPanel > .configGroup > .configOpt input:not([name="dist_mode"]) {
  border-width: 0px;
  width: 25px;
}
.Chubuk > .configPanel > .configGroup .refreshData {
  cursor: pointer;
}
.Chubuk > .configPanel > .configGroup .refreshData:hover {
  color: orangered;
}
.Chubuk > .configPanel > .configGroup[active="false"] > .configOpt {
  display: none !important;
}
.Chubuk > .configPanel > .configGroup[active="false"] > .configHeading {
  color: gray;
}
.Chubuk > .chartWrapper {
  position: relative;
  -webkit-box-flex: 1;
  -moz-box-flex: 1;
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1;
  display: -webkit-box;
  display: -moz-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-direction: normal;
  -moz-box-direction: normal;
  -webkit-box-orient: vertical;
  -moz-box-orient: vertical;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  z-index: 10;
  overflow: visible;
  overflow-x: hidden;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
.Chubuk > .chartWrapper * {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
.Chubuk > .chartWrapper > .recordGroup {
  position: relative;
  overflow: hidden;
  -webkit-box-flex: 1;
  -moz-box-flex: 1;
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1;
}
.Chubuk > .chartWrapper > .rowGroup {
  display: none;
}
.Chubuk > .chartWrapper > .rowGroup > .rowIndexLabel {
  text-align: right;
  position: absolute;
  right: 2px;
  font-weight: 100;
  font-size: 0.9em;
}
.Chubuk > .chartWrapper > .rowGroup > .rowIndexLabel:after {
  content: "#";
  color: gray;
  font-size: 0.6em;
  position: relative;
  top: -2px;
  margin-left: 1px;
}
.Chubuk .record {
  display: block;
  position: absolute;
  -webkit-transition: left 1200ms ease-in-out, width 1200ms ease-in-out, height 1200ms ease-in-out, top 1200ms ease-in-out;
  -moz-transition: left 1200ms ease-in-out, width 1200ms ease-in-out, height 1200ms ease-in-out, top 1200ms ease-in-out;
  -o-transition: left 1200ms ease-in-out, width 1200ms ease-in-out, height 1200ms ease-in-out, top 1200ms ease-in-out;
  transition: left 1200ms ease-in-out, width 1200ms ease-in-out, height 1200ms ease-in-out, top 1200ms ease-in-out;
}
.Chubuk .record > .block {
  display: block;
  position: absolute;
  left: 0px;
  top: 0px;
  width: 100%;
  height: 100%;
  -webkit-transition: all 250ms ease-in-out;
  -moz-transition: all 250ms ease-in-out;
  -o-transition: all 250ms ease-in-out;
  transition: all 250ms ease-in-out;
}
.Chubuk .record > .dot_tip {
  display: block;
  position: absolute;
  width: 10px;
  height: 10px;
  right: -5px;
  border-radius: 10px;
  border: solid 1px white;
  background-color: green;
  opacity: 0;
  box-shadow: 0px 0px 1px white;
  top: calc(50% - 5px);
  -webkit-transition: all 200ms ease-in-out;
  -moz-transition: all 200ms ease-in-out;
  -o-transition: all 200ms ease-in-out;
  transition: all 200ms ease-in-out;
  z-index: 100;
}
.Chubuk .record > .label {
  position: absolute;
  left: 0%;
  width: 100%;
  padding-left: 1px;
  padding-right: 1px;
  padding-top: 1px;
  font-size: 0.8em;
  font-weight: 400;
  text-shadow: 0px 0px 6px white, 0px 0px 2px white;
  z-index: 101;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.Chubuk .record:hover {
  z-index: 90 !important;
}
.Chubuk > .chartAxis {
  position: relative;
}
.Chubuk > .chartAxis > .scale {
  position: absolute;
}
.Chubuk > .chartAxis > .scale > .baseLine {
  border-bottom: solid 1px lightgray;
  position: absolute;
  top: 0px;
}
.Chubuk > .chartAxis > .scale > .tick {
  cursor: pointer;
  pointer-events: none;
  position: absolute;
  height: 10px;
}
.Chubuk > .chartAxis > .scale > .tick > .line {
  display: block;
  position: absolute;
  left: -1px;
  width: 0px;
  border-left: dotted 1px gray;
}
.Chubuk > .chartAxis > .scale > .tick[value="0"] > .line {
  border-left: solid 2px gray;
  left: -1px;
}
.Chubuk > .chartAxis > .scale > .tick[value="0"] > .text {
  font-weight: 500;
}
.Chubuk > .chartAxis > .scale > .tick[value="0"] > .text[textpos="upper"] {
  margin-top: -1px;
}
.Chubuk > .chartAxis > .scale > .tick > .text {
  display: block;
  position: relative;
  margin-top: 4px;
  cursor: pointer;
  left: -50%;
  text-align: center;
  font-weight: 100;
  font-size: 0.9em;
}
.Chubuk[chart_type="long_list"] .vizType.long_list {
  background-color: #D6DED3;
  color: black;
  box-shadow: 1px 1px 1px black;
  font-weight: 400;
}
.Chubuk[chart_type="long_list"] .record > .block {
  background-color: #92C5E2;
}
.Chubuk[chart_type="long_list"] .record > .label {
  overflow: visible;
  text-overflow: none;
}
.Chubuk[chart_type="long_list"] > .chartAxis[lowerNegative="true"] .text-lower:before {
  content: "-";
}
.Chubuk[chart_type="long_list"] > .chartAxis[upperNegative="true"] .text-upper:before {
  content: "-";
}
.Chubuk[chart_type="long_list"] > .chartWrapper {
  border-top: solid 1px lightgray;
  border-bottom: solid 1px lightgray;
  margin-top: -1px;
  margin-bottom: -1px;
}
.Chubuk[chart_type="long_list"] > .chartWrapper > .recordGroup {
    overflow-y: scroll !important;

}
.Chubuk[chart_type="long_list"] > .configPanel > .configGroup > .configOpt.barHeightList {
  display: inline-block;
}
.Chubuk[chart_type="long_list"] > .configPanel > .configGroup > .configOpt.numBands {
  display: none;
}
.Chubuk[chart_type="long_list"] > .configPanel > .configGroup > .configOpt.barPadding {
  display: none;
}
.Chubuk[chart_type="treemap"] .vizType.treemap {
  background-color: #D6DED3;
  color: black;
  box-shadow: 1px 1px 1px black;
  font-weight: 400;
}
.Chubuk[chart_type="treemap"] .record {
  border: solid 1px white;
}
.Chubuk[chart_type="treemap"] .record > .block {
  background-color: #92C5E2;
}
.Chubuk[chart_type="treemap"] .record > .block:after {
  text-align: center;
}
.Chubuk[chart_type="treemap"] .record > .label {
  text-align: center;
}
.Chubuk[chart_type="treemap"] > .chartAxis {
  display: none;
}
.Chubuk[chart_type="treemap"] > .chartWrapper {
  border-top: none;
  border-bottom: none;
}
.Chubuk[chart_type="treemap"] > .chartWrapper > .rowGroup > .rowIndexLabel {
  display: none;
}
.Chubuk[chart_type="treemap"] > .configPanel > .configGroup > .configOpt.numBands {
  display: none;
}
.Chubuk[chart_type="treemap"] > .configPanel > .configGroup > .configOpt.barPadding {
  display: none;
}
.Chubuk[chart_type="treemap"] > .configPanel > .configGroup > .configOpt.button_showTip {
  display: none;
}
.Chubuk[chart_type="treemap"] > .configPanel > .configGroup > .configOpt.button_showGridLines {
  display: none;
}
.Chubuk[chart_type="piled_bars"] .vizType.piled_bars {
  background-color: #D6DED3;
  color: black;
  box-shadow: 1px 1px 1px black;
  font-weight: 400;
}
.Chubuk[chart_type="piled_bars"] .record > .block {
  top: 0px;
  border-style: solid;
  border-width: 1px 0px;
}
.Chubuk[chart_type="piled_bars"] .record[isNegative="false"] {
  box-shadow: 4px 0px 5px 0px #ffffff;
}
.Chubuk[chart_type="piled_bars"] .record[isNegative="false"] > .label {
  text-align: right;
  left: auto;
  right: 0%;
}
.Chubuk[chart_type="piled_bars"] .record[isNegative="true"] {
  box-shadow: -4px 0px 5px 0px #ffffff;
  border-right: 0px;
}
.Chubuk[chart_type="piled_bars"] .record[isNegative="true"] .dot_tip {
  left: -7px;
  right: auto;
}
.Chubuk[chart_type="zvinca_plot"] .vizType.zvinca_plot {
  background-color: #D6DED3;
  color: black;
  box-shadow: 1px 1px 1px black;
  font-weight: 400;
}
.Chubuk[chart_type="zvinca_plot"] .record > .block {
  background-color: transparent !important;
}
.Chubuk[chart_type="zvinca_plot"] .record > .dot_tip {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  opacity: 1;
}
.Chubuk[chart_type="zvinca_plot"] .record[isNegative="false"] > .label {
  text-align: right;
  left: auto;
  right: 0%;
  padding-right: 5px;
}
.Chubuk[chart_type="zvinca_plot"] .record[isNegative="false"] > .dot_tip {
  background-color: #7DA7C7;
}
.Chubuk[chart_type="zvinca_plot"] .record[isNegative="true"] {
  border-right: 0px;
}
.Chubuk[chart_type="zvinca_plot"] .record[isNegative="true"] > .label {
  padding-left: 9px;
}
.Chubuk[chart_type="zvinca_plot"] .record[isNegative="true"] .dot_tip {
  background-color: #ef8a62;
  left: 0px;
  right: auto;
}
.Chubuk[chart_type="packed_bars"] .vizType.packed_bars {
  background-color: #D6DED3;
  color: black;
  box-shadow: 1px 1px 1px black;
  font-weight: 400;
}
.Chubuk[chart_type="packed_bars"] .record > .block {
  background-color: #9cc4df;
  border-right: 1px;
  border-color: #fff;
  border-right-style: solid;
}
.Chubuk[chart_type="packed_bars"] .record > .dot_tip {
  background-color: #9cc4df;
  height: calc(100% - 4px);
  top: 2px;
  right: 0px;
  opacity: 0;
}
.Chubuk[chart_type="packed_bars"] .record[isNegative="false"] > .label {
  text-align: right;
  left: auto;
  right: 0%;
}
.Chubuk[chart_type="packed_bars"] .record[isNegative="true"] {
  border-right: 0px;
}
.Chubuk[chart_type="packed_bars"] .record[isNegative="true"] .dot_tip {
  background-color: #ef8a62;
  left: 0px;
  right: auto;
}
.Chubuk[chart_type="wrapped_bars"] .vizType.wrapped_bars {
  background-color: #D6DED3;
  color: black;
  box-shadow: 1px 1px 1px black;
  font-weight: 400;
}
.Chubuk[chart_type="wrapped_bars"] .record > .block {
  background-color: #92C5E2;
}
.Chubuk[chart_type="wrapped_bars"] .record[isNegative="true"] > .label {
  position: absolute;
  right: 0%;
  width: 100%;
  padding-right: 2px;
  padding-left: 0px;
  padding-top: 2px;
  text-align: right;
}
.Chubuk[chart_type="wrapped_bars"] .record[isNegative="true"] > .dot_tip {
  left: -7px;
  right: auto;
}
.Chubuk[chart_type="wrapped_bars"] > .configPanel > .configGroup > .configOpt.button_wrappedInverse {
  display: inline-block;
}
.Chubuk[chart_type="wrapped_bars"] > .configPanel > .configGroup > .configOpt.columnGap {
  display: inline-block;
}
.Chubuk[showTip="true"]:not([chart_type="treemap"]) .dot_tip {
  opacity: 1;
}
.Chubuk[showTip="true"]:not([chart_type="treemap"]) .button_showTip > .fa:before {
  content: "\f06e";
}
.Chubuk[showTip="false"] .button_showTip {
  color: gray;
}
.Chubuk[showTip="false"] .button_showTip > .fa:before {
  content: "\f070";
}
.Chubuk[showLabel="true"] .label {
  display: block;
}
.Chubuk[showLabel="true"] .button_showLabel > .fa:before {
  content: "\f06e";
}
.Chubuk[showLabel="false"] .label {
  display: none;
}
.Chubuk[showLabel="false"] .button_showLabel {
  color: gray;
}
.Chubuk[showLabel="false"] .button_showLabel > .fa:before {
  content: "\f070";
}
.Chubuk[showColor="true"] .button_showColor {
  background-color: rgba(255, 69, 0, 0.5) !important;
  color: white;
}
.Chubuk[showColor="true"] .button_showColor > .fa:before {
  content: "\f058";
}
.Chubuk[showColor="true"] .record[isNegative="true"] > .block {
  background-color: #ef8a62;
}
.Chubuk[showColor="false"] .button_showColor {
  background-color: rgba(255, 69, 0, 0.13) !important;
  color: gray;
}
.Chubuk[showColor="false"] .button_showColor > .fa:before {
  content: "\f057";
}
.Chubuk[showTooltip="true"] .button_showTooltip > .fa:before {
  content: "\f06e";
}
.Chubuk[showTooltip="false"] .button_showTooltip {
  color: gray;
}
.Chubuk[showTooltip="false"] .button_showTooltip > .fa:before {
  content: "\f070";
}
.Chubuk[showGridLines="true"] .button_showGridLines > .fa:before {
  content: "\f058";
}
.Chubuk[showGridLines="false"] .button_showGridLines {
  color: gray;
}
.Chubuk[showGridLines="false"] .button_showGridLines > .fa:before {
  content: "\f057";
}
.Chubuk[showGridLines="false"] > .chartAxis > .scale > .tick > .text {
  display: none;
}
.Chubuk[showGridLines="false"] > .chartAxis > .scale > .tick:not([value="0"]) > .line {
  display: none;
}
.Chubuk[wrappedInverse="true"] .button_wrappedInverse > .fa:before {
  content: "\f058";
}
.Chubuk[wrappedInverse="false"] .button_wrappedInverse {
  color: gray;
}
.Chubuk[wrappedInverse="false"] .button_wrappedInverse > .fa:before {
  content: "\f057";
}
.Chubuk .negativeRatio {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.Chubuk[datanegative="true"] .config_datanegative > .fa:before {
  content: "\f058";
}
.Chubuk[datanegative="true"] .negativeRatio {
  display: inline-block;
  width: 50px;
  height: 10px;
}
.Chubuk[datanegative="true"] > .configPanel > .configGroup > .configOpt.button_showColor {
  display: inline-block;
}
.Chubuk[datanegative="false"] .config_datanegative {
  color: gray;
}
.Chubuk[datanegative="false"] .config_datanegative > .fa:before {
  content: "\f057";
}
.Chubuk[datanegative="false"] .negativeRatio {
  display: none;
}
.tipsy {
  font-family: 'Roboto', sans-serif;
  font-size: 10px;
  position: absolute;
  padding: 5px;
  z-index: 100000;
  pointer-events: none;
}
.tipsy .tipsy-inner {
  padding: 3px;
  font-size: 1.2em;
  background-color: #000;
  color: #FFF;
  max-width: 200px;
  text-align: center;
  font-weight: 300px;
  border-radius: 3px;
}
/* Uncomment for shadow */
/*.tipsy-inner { box-shadow: 0 0 5px #000000; -webkit-box-shadow: 0 0 5px #000000; -moz-box-shadow: 0 0 5px #000000; }*/
.tipsy-arrow {
  position: absolute;
  width: 0;
  height: 0;
  line-height: 0;
  border: 5px dashed #000;
}
.tipsy-n .tipsy-arrow {
  top: 0px;
  left: 50%;
  margin-left: -5px;
  border-bottom-style: solid;
  border-top: none;
  border-left-color: transparent !important;
  border-right-color: transparent !important;
}
.tipsy-nw .tipsy-arrow {
  top: 0;
  left: 10px;
  border-bottom-style: solid;
  border-top: none;
  border-left-color: transparent !important;
  border-right-color: transparent !important;
}
.tipsy-ne .tipsy-arrow {
  top: 0;
  right: 10px;
  border-bottom-style: solid;
  border-top: none;
  border-left-color: transparent !important;
  border-right-color: transparent !important;
}
.tipsy-s .tipsy-arrow {
  bottom: 0;
  left: 50%;
  margin-left: -5px;
  border-top-style: solid;
  border-bottom: none;
  border-left-color: transparent !important;
  border-right-color: transparent !important;
}
.tipsy-sw .tipsy-arrow {
  bottom: 0;
  left: 10px;
  border-top-style: solid;
  border-bottom: none;
  border-left-color: transparent !important;
  border-right-color: transparent !important;
}
.tipsy-se .tipsy-arrow {
  bottom: 0;
  right: 10px;
  border-top-style: solid;
  border-bottom: none;
  border-left-color: transparent !important;
  border-right-color: transparent !important;
}
.tipsy-e .tipsy-arrow {
  right: 0;
  top: 50%;
  margin-top: -5px;
  border-left-style: solid;
  border-right: none;
  border-top-color: transparent !important;
  border-bottom-color: transparent !important;
}
.tipsy-w .tipsy-arrow {
  left: 0;
  top: 50%;
  margin-top: -5px;
  border-right-style: solid;
  border-left: none;
  border-top-color: transparent !important;
  border-bottom-color: transparent !important;
}
/*::-webkit-scrollbar {
    width: 9px!important;
    height: 3px!important;
    background-color: #eee!important;
}*/