text:
layout: post
title: Best Wifi Router
categories: [tech]
tags: [wifi]
date: 2015-04-08 22:25:15-04:00

---

Refs:

* http://thewirecutter.com/reviews/best-wi-fi-router/

Looking to upgrade my house wifi after many years living on the [Linksys WRT54GL](http://www.amazon.com/Linksys-WRT54GL-Wireless-G-Broadband-Router/dp/B000BTL0OA/ref=sr_1_1?s=electronics&ie=UTF8&qid=1428546410&sr=1-1&keywords=WRT54GL).
About to take a look at this modest multi-antenna beast - The [TP-Link Archer C7](http://www.amazon.com/gp/product/B00BUSDVBQ?tag=thewire06-20&linkCode=as2&creative=374929&camp=211189)

I'll have to update with a review once I have it setup


text:
require 'thread'

class WorkerPool
  BUFFER_SIZE = 1

  def initialize(worker_count)
    @queue = SizedQueue.new(BUFFER_SIZE)
    @workers = (1..worker_count).map { |i| start_worker(i) }
  end

  def perform(tasks, timeout, &block)
    countdown, accumulator = CountdownLatch.new(tasks.size), Queue.new
    tasks.each { |args| enqueue(countdown, accumulator, args, block) }
    countdown.wait(timeout)
    queue_to_array(accumulator)
  end

  def shutdown
    @workers.each(&:kill)
  end

  private

  def enqueue(countdown, accumulator, args, block)
    @queue.push([ countdown, accumulator, args, block ])
  end

  def execute_task(countdown, accumulator, args, block)
    result =
      begin
        block.call(*args)
      rescue => ex
        WorkerError.new(ex)
      end
    accumulator.push(result)
  ensure
    countdown.decrement
  end

  def queue_to_array(queue)
    queue.length.times.map { queue.pop }
  end

  def start_worker(id)
    Thread.new do
      loop do
        task = @queue.pop rescue nil
        if Array === task
          execute_task(*task)
        end
      end
    end
  end
end

require 'worker_pool/countdown_latch'
require 'worker_pool/version'
require 'worker_pool/worker_error'

redpajama_set_name: RedPajamaGithub


text:
package de.fhws.tutorium.ss17.tut11;

/**
 * Created by Sebastian Kaim on 7/5/17.
 */
public class YYThread {

    public void execute()
    {
        Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
               PrintLoop("Yang");
            }
        });
        t.start();

        PrintLoop("Yin");
    }

    public void PrintLoop(String output)
    {
        while(true)
        {
            System.out.println(output);
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

    public static void main(String[] args) {
        YYThread yyt = new YYThread();
        yyt.execute();
    }

}


text:
"""This is the **MPI for Python** package.

The *Message Passing Interface* (MPI) is a standardized and portable
message-passing system designed to function on a wide variety of
parallel computers. The MPI standard defines the syntax and semantics
of library routines and allows users to write portable programs in the
main scientific programming languages (Fortran, C, or C++). Since its
release, the MPI specification has become the leading standard for
message-passing libraries for parallel computers.

*MPI for Python* provides MPI bindings for the Python programming
language, allowing any Python program to exploit multiple processors.
This package build on the MPI specification and provides an object
oriented interface which closely follows MPI-2 C++ bindings.

"""

__version__ = '4.0.0.dev0'
__author__ = 'Lisandro Dalcin'
__credits__ = 'MPI Forum, MPICH Team, Open MPI Team'

__all__ = ['MPI']

class Rc:
    """Runtime configuration options.

    Attributes
    ----------
    initialize : bool
        Automatic MPI initialization at import (default: True).
    threads : bool
        Request initialization with thread support (default: True).
    thread_level : {"multiple", "serialized", "funneled", "single"}
        Level of thread support to request (default: "multiple").
    finalize : None or bool
        Automatic MPI finalization at exit (default: None).
    fast_reduce : bool
        Use tree-based reductions for objects (default: True).
    recv_mprobe : bool
        Use matched probes to receive objects (default: True).
    errors : {"exception", "default", "abort", "fatal"}
        Error handling policy (default: "exception").

    """

    initialize = True
    threads = True
    thread_level = 'multiple'
    finalize = None
    fast_reduce = True
    recv_mprobe = True
    errors = 'exception'

    def __init__(self, **kwargs):
        self(**kwargs)

    def __setattr__(self, name, value):
        if not hasattr(self, name):
            raise TypeError(f"object has no attribute '{name}'")
        super().__setattr__(name, value)

    def __call__(self, **kwargs):
        for key in kwargs:
            if not hasattr(self, key):
                raise TypeError(f"unexpected argument '{key}'")
        for key, value in kwargs.items():
            setattr(self, key, value)

    def __repr__(self):
        return f'<{__name__}.rc>'

rc = Rc()
__import__('sys').modules[__name__ + '.rc'] = rc

def get_include():
    """Return the directory in the package that contains header files.

    Extension modules that need to compile against mpi4py should use
    this function to locate the appropriate include directory. Using
    Python distutils (or perhaps NumPy distutils)::

      import mpi4py
      Extension('extension_name', ...
                include_dirs=[..., mpi4py.get_include()])

    """
    # pylint: disable=import-outside-toplevel
    from os.path import join, dirname
    return join(dirname(__file__), 'include')

def get_config():
    """Return a dictionary with information about MPI."""
    # pylint: disable=import-outside-toplevel
    from os.path import join, dirname
    from configparser import ConfigParser
    config = join(dirname(__file__), 'mpi.cfg')
    parser = ConfigParser()
    parser.read(config, encoding='utf-8')
    return dict(parser.items('mpi'))

def profile(name, *, path=None):
    """Support for the MPI profiling interface.

    Parameters
    ----------
    name : str
       Name of the profiler library to load.
    path : `sequence` of str, optional
       Additional paths to search for the profiler.

    """
    # pylint: disable=import-outside-toplevel
    import os
    import sys
    import warnings

    try:
        from _ctypes import dlopen
        from os import RTLD_NOW, RTLD_GLOBAL
    except ImportError as exc:  # pragma: no cover
        warnings.warn(exc.args[0])
        return

    def find_library(name, path):
        pattern = [('', '')]
        if sys.platform == 'darwin':  # pragma: no cover
            pattern.append(('lib', '.dylib'))
        elif os.name == 'posix':  # pragma: no cover
            pattern.append(('lib', '.so'))
        for pth in path:
            for (lib, dso) in pattern:
                filename = os.path.join(pth, lib + name + dso)
                if os.path.isfile(filename):
                    return os.path.abspath(filename)
        return None

    if path is None:
        path = ['']
    elif isinstance(path, os.PathLike):
        path = [path]
    elif isinstance(path, str):
        path = path.split(os.pathsep)
    elif isinstance(path, bytes):
        path = path.split(os.fsencode(os.pathsep))

    name = os.fsdecode(name)
    path = list(map(os.fsdecode, path))
    filename = find_library(name, path)
    if filename is None:
        raise ValueError(f"profiler '{name}' not found")

    try:
        handle = dlopen(filename, RTLD_NOW | RTLD_GLOBAL)
    except OSError as exc:
        warnings.warn(exc.args[0])
    else:
        registry = vars(profile).setdefault('registry', [])
        registry.append((name, (handle, filename)))


text:
using Nwazet.Commerce.Models;
using Nwazet.Commerce.Permissions;
using Orchard.ContentManagement;
using Orchard.Environment.Extensions;
using Orchard.Security;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Nwazet.Commerce.Security {
    [OrchardFeature("Territories")]
    public class HierachiesAuthorizationEventHandler : IAuthorizationServiceEventHandler {
        public void Adjust(CheckAccessContext context) {
            if (!context.Granted &&
                context.Content.Is<TerritoryHierarchyPart>()) {

                var typeDefinition = context.Content.ContentItem.TypeDefinition;
                //replace permission if there is one specific for the content type
                if (typeDefinition.Parts.Any(ctpd => ctpd.PartDefinition.Name == TerritoryHierarchyPart.PartName) &&
                    context.Permission == TerritoriesPermissions.ManageTerritoryHierarchies) {
                    context.Adjusted = true;
                    context.Permission = TerritoriesPermissions.GetHierarchyPermission(typeDefinition);
                }
            }
        }

        #region not implemented IAuthorizationServiceEventHandler methods
        public void Checking(CheckAccessContext context) { }

        public void Complete(CheckAccessContext context) { }
        #endregion
    }
}


text:
import _ from 'lodash';

import DataUtil from '../../src/utils/DataUtil';
import AggregationUtil from '../../src/utils/AggregationUtil';
import { types as Types, generateGUID } from '../../data/types';
import { MGDL_UNITS, MGDL_PER_MMOLL } from '../../src/utils/constants';

/* eslint-disable max-len, no-underscore-dangle */

describe('AggregationUtil', () => {
  let aggregationUtil;

  const patientId = 'abc123';

  const useRawData = {
    raw: true,
  };

  const basal = new Types.Basal({ deviceTime: '2018-02-01T01:00:00', ...useRawData });
  const automatedBasal = { ...basal, deliveryType: 'automated' };
  const tempBasal = { ...basal, deliveryType: 'temp' };
  const suspendedBasal = { ...basal, deviceTime: '2018-02-02T01:00:00', deliveryType: 'suspend', rate: 0 };
  const automatedSuspendBasal = new Types.DeviceEvent({
    deviceTime: '2018-02-01T01:00:00',
    subType: 'status',
    status: 'suspended',
    reason: { suspended: 'automatic' },
    payload: { suspended: { reason: 'Auto suspend by PLGS' } },
    ...useRawData,
  });

  const basalData = _.map([
    automatedBasal,
    tempBasal,
    suspendedBasal,
    automatedSuspendBasal,
  ], d => ({ ..._.toPlainObject(d), id: generateGUID() }));

  const bolus = new Types.Bolus({ deviceTime: '2018-02-01T01:00:00', value: 1, ...useRawData });
  const correctionBolus = { ...bolus, recommended: { correction: 1, carb: 0 } };
  const extendedBolus = { ...bolus, extended: 1, duration: 1, subType: 'square' };
  const interruptedBolus = { ...bolus, normal: 1, expectedNormal: 2 };
  const manualBolus = { ...bolus, wizard: undefined };
  const automatedBolus = { ...manualBolus, subType: 'automated' };
  const overrideBolus = { ...bolus, normal: 2, recommended: { net: 1 } };
  const underrideBolus = { ...bolus, normal: 1, recommended: { net: 2 } };
  const wizardBolus = { ...bolus, deviceTime: '2018-02-02T01:00:00', wizard: '12345' };

  const bolusData = _.map([
    correctionBolus,
    extendedBolus,
    interruptedBolus,
    manualBolus,
    automatedBolus,
    overrideBolus,
    underrideBolus,
    wizardBolus,
  ], d => ({ ..._.toPlainObject(d), id: generateGUID() }));

  const calibration = new Types.DeviceEvent({ deviceTime: '2018-02-01T01:00:00', subType: 'calibration', ...useRawData });

  const smbg = new Types.SMBG({ deviceTime: '2018-02-01T01:00:00', ...useRawData });
  const manualSMBG = { ...smbg, subType: 'manual' };
  const meterSMBG = { ...smbg, subType: undefined };
  const veryHighSMBG = { ...smbg, value: 251 / MGDL_PER_MMOLL };
  const veryLowSMBG = { ...smbg, deviceTime: '2018-02-02T01:00:00', value: 53 / MGDL_PER_MMOLL };

  const fingerstickData = _.map([
    calibration,
    manualSMBG,
    meterSMBG,
    veryHighSMBG,
    veryLowSMBG,
  ], d => ({ ..._.toPlainObject(d), id: generateGUID() }));

  const siteChange = new Types.DeviceEvent({ deviceTime: '2018-02-01T01:00:00', ...useRawData });
  const cannulaPrime = { ...siteChange, subType: 'prime', primeTarget: 'cannula' };
  const reservoirChange = { ...siteChange, subType: 'reservoirChange' };
  const tubingPrime = { ...siteChange, deviceTime: '2018-02-02T01:00:00', subType: 'prime', primeTarget: 'tubing' };
  const cannulaPrimeNextDay = { ...cannulaPrime, deviceTime: '2018-02-02T01:00:00' };

  const siteChangeData = _.map([
    cannulaPrime,
    reservoirChange,
    tubingPrime,
    cannulaPrimeNextDay,
  ], d => ({ ..._.toPlainObject(d), id: generateGUID() }));

  const data = [
    ...basalData,
    ...bolusData,
    ...fingerstickData,
    ...siteChangeData,
  ];

  const bgPrefs = {
    bgClasses: {
      'very-low': { boundary: 54 },
      low: { boundary: 70 },
      target: { boundary: 180 },
      high: { boundary: 250 },
    },
    bgUnits: MGDL_UNITS,
  };

  const twoDayEndpoints = [
    '2018-02-01T00:00:00.000Z',
    '2018-02-03T00:00:00.000Z',
  ];

  const defaultOpts = {
    bgPrefs,
    endpoints: twoDayEndpoints,
  };

  const filterEndpoints = newEndpoints => {
    if (newEndpoints) aggregationUtil.dataUtil.query({ endpoints: newEndpoints });
    aggregationUtil.dataUtil.activeEndpoints = aggregationUtil.dataUtil.endpoints.current;
    aggregationUtil.init(aggregationUtil.dataUtil);
    aggregationUtil.dataUtil.clearFilters();
    aggregationUtil.dataUtil.filter.byEndpoints(aggregationUtil.dataUtil.activeEndpoints.range);
  };

  const createAggregationUtil = (dataset, query) => {
    const dataUtil = new DataUtil();
    dataUtil.addData(dataset, patientId);
    dataUtil.query(query);
    dataUtil.activeEndpoints = dataUtil.endpoints.current;

    aggregationUtil = new AggregationUtil(dataUtil);
    filterEndpoints();

    return aggregationUtil;
  };

  beforeEach(() => {
    aggregationUtil = createAggregationUtil(data, defaultOpts);
  });

  describe('constructor', () => {
    it('should set a reference to the data util', () => {
      expect(aggregationUtil.dataUtil).instanceof(DataUtil);
    });

    it('should set `bgBounds` from bgPrefs option', () => {
      expect(aggregationUtil.bgBounds).to.eql({
        veryHighThreshold: 250,
        targetUpperBound: 180,
        targetLowerBound: 70,
        veryLowThreshold: 54,
        clampThreshold: 600,
      });
    });

    it('should set `timezoneName` from timePrefs option', () => {
      aggregationUtil = createAggregationUtil(data, {
        ...defaultOpts,
        timePrefs: { timezoneName: 'US/Eastern' },
      });
      expect(aggregationUtil.timezoneName).to.eql('US/Eastern');
    });

    it('should set `timezoneName` to `UTC` when not provided from timePrefs option', () => {
      expect(aggregationUtil.timezoneName).to.eql('UTC');
    });

    it('should set `initialActiveEndpoints` as clone of dataUtil.activeEndpoints', () => {
      expect(aggregationUtil.initialActiveEndpoints).to.eql(aggregationUtil.dataUtil.activeEndpoints);
    });

    it('should set `rangeDates` from dataUtil.activeEndpoints option in correct time zone', () => {
      expect(aggregationUtil.rangeDates).to.eql(['2018-02-01', '2018-02-03']);

      aggregationUtil = createAggregationUtil(data, {
        ...defaultOpts,
        timePrefs: { timezoneName: 'US/Eastern' },
      });
      expect(aggregationUtil.rangeDates).to.eql(['2018-01-31', '2018-02-02']);
    });
  });

  describe('aggregateBasals', () => {
    let groupByDate;

    beforeEach(() => {
      groupByDate = aggregationUtil.dataUtil.dimension.byDate.group();
    });

    afterEach(() => {
      groupByDate.dispose();
    });

    it('should summarize total count for all basal events in the entire date range', () => {
      expect(aggregationUtil.aggregateBasals(groupByDate).basal.summary.total).to.equal(3);
    });

    it('should summarize average daily number of basal events in the entire date range', () => {
      expect(aggregationUtil.aggregateBasals(groupByDate).basal.summary.avgPerDay).to.equal(1.5);
    });

    it('should summarize total `suspend`, `automatedStop`, and `temp` basal events for the entire date range', () => {
      expect(aggregationUtil.aggregateBasals(groupByDate).basal.summary.subtotals.automatedStop.count).to.equal(1);
      expect(aggregationUtil.aggregateBasals(groupByDate).basal.summary.subtotals.temp.count).to.equal(1);
      expect(aggregationUtil.aggregateBasals(groupByDate).basal.summary.subtotals.suspend.count).to.equal(1);
    });

    it('should summarize percentage of `suspend`, `automatedStop`, and `temp` basal events for the entire date range', () => {
      expect(aggregationUtil.aggregateBasals(groupByDate).basal.summary.subtotals.automatedStop.percentage).to.equal(1 / 3);
      expect(aggregationUtil.aggregateBasals(groupByDate).basal.summary.subtotals.temp.percentage).to.equal(1 / 3);
      expect(aggregationUtil.aggregateBasals(groupByDate).basal.summary.subtotals.suspend.percentage).to.equal(1 / 3);
    });

    it('should summarize total count for all basal events for each date in the date range', () => {
      expect(aggregationUtil.aggregateBasals(groupByDate).basal.byDate['2018-02-01'].total).to.equal(2);
      expect(aggregationUtil.aggregateBasals(groupByDate).basal.byDate['2018-02-02'].total).to.equal(1);
    });

    it('should count total `suspend`, `automatedStop`, and `temp` basal events for each date in the date range', () => {
      expect(aggregationUtil.aggregateBasals(groupByDate).basal.byDate['2018-02-01'].subtotals.automatedStop).to.equal(1);
      expect(aggregationUtil.aggregateBasals(groupByDate).basal.byDate['2018-02-01'].subtotals.temp).to.equal(1);
      expect(aggregationUtil.aggregateBasals(groupByDate).basal.byDate['2018-02-02'].subtotals.suspend).to.equal(1);
    });

    it('should summarize total count for all automatedSuspend events in the entire date range', () => {
      expect(aggregationUtil.aggregateBasals(groupByDate).automatedSuspend.summary.total).to.equal(1);
    });

    it('should summarize average daily number of automatedSuspend events in the entire date range', () => {
      expect(aggregationUtil.aggregateBasals(groupByDate).automatedSuspend.summary.avgPerDay).to.equal(0.5);
    });

    it('should summarize total `automatedSuspend` events for the entire date range', () => {
      expect(aggregationUtil.aggregateBasals(groupByDate).automatedSuspend.summary.subtotals.automatedSuspend.count).to.equal(1);
    });

    it('should summarize percentage of `automatedSuspend` events for the entire date range', () => {
      expect(aggregationUtil.aggregateBasals(groupByDate).automatedSuspend.summary.subtotals.automatedSuspend.percentage).to.equal(1);
    });

    it('should summarize total count for all automatedSuspend events for each date in the date range', () => {
      expect(aggregationUtil.aggregateBasals(groupByDate).automatedSuspend.byDate['2018-02-01'].total).to.equal(1);
    });

    it('should count total `automatedSuspend` events for each date in the date range', () => {
      expect(aggregationUtil.aggregateBasals(groupByDate).automatedSuspend.byDate['2018-02-01'].subtotals.automatedSuspend).to.equal(1);
    });
  });

  describe('aggregateBoluses', () => {
    let groupByDate;

    beforeEach(() => {
      groupByDate = aggregationUtil.dataUtil.dimension.byDate.group();
    });

    afterEach(() => {
      groupByDate.dispose();
    });

    it('should summarize total count for all non-automated bolus events in the entire date range', () => {
      expect(aggregationUtil.aggregateBoluses(groupByDate).summary.total).to.equal(7);
    });

    it('should summarize average daily number of bolus events in the entire date range', () => {
      expect(aggregationUtil.aggregateBoluses(groupByDate).summary.avgPerDay).to.equal(3.5);
    });

    it('should summarize total `correction`, `extended`, `interrupted`, `manual`, `automated`, `override`, `underride`, and `wizard` bolus events for the entire date range', () => {
      expect(aggregationUtil.aggregateBoluses(groupByDate).summary.subtotals.correction.count).to.equal(1);
      expect(aggregationUtil.aggregateBoluses(groupByDate).summary.subtotals.extended.count).to.equal(1);
      expect(aggregationUtil.aggregateBoluses(groupByDate).summary.subtotals.interrupted.count).to.equal(1);
      expect(aggregationUtil.aggregateBoluses(groupByDate).summary.subtotals.manual.count).to.equal(6);
      expect(aggregationUtil.aggregateBoluses(groupByDate).summary.subtotals.automated.count).to.equal(1);
      expect(aggregationUtil.aggregateBoluses(groupByDate).summary.subtotals.override.count).to.equal(1);
      expect(aggregationUtil.aggregateBoluses(groupByDate).summary.subtotals.underride.count).to.equal(1);
      expect(aggregationUtil.aggregateBoluses(groupByDate).summary.subtotals.wizard.count).to.equal(1);
    });

    it('should summarize percentage of `correction`, `extended`, `interrupted`, `manual`, `automated`, `override`, `underride`, and `wizard` bolus events for the entire date range', () => {
      expect(aggregationUtil.aggregateBoluses(groupByDate).summary.subtotals.correction.percentage).to.equal(1 / 7);
      expect(aggregationUtil.aggregateBoluses(groupByDate).summary.subtotals.extended.percentage).to.equal(1 / 7);
      expect(aggregationUtil.aggregateBoluses(groupByDate).summary.subtotals.interrupted.percentage).to.equal(1 / 7);
      expect(aggregationUtil.aggregateBoluses(groupByDate).summary.subtotals.manual.percentage).to.equal(6 / 7);
      expect(aggregationUtil.aggregateBoluses(groupByDate).summary.subtotals.automated.percentage).to.equal(1 / 7);
      expect(aggregationUtil.aggregateBoluses(groupByDate).summary.subtotals.override.percentage).to.equal(1 / 7);
      expect(aggregationUtil.aggregateBoluses(groupByDate).summary.subtotals.underride.percentage).to.equal(1 / 7);
      expect(aggregationUtil.aggregateBoluses(groupByDate).summary.subtotals.wizard.percentage).to.equal(1 / 7);
    });

    it('should summarize total count for all bolus events for each date in the date range', () => {
      expect(aggregationUtil.aggregateBoluses(groupByDate).byDate['2018-02-01'].total).to.equal(6);
      expect(aggregationUtil.aggregateBoluses(groupByDate).byDate['2018-02-02'].total).to.equal(1);
    });

    it('should count total `correction`, `extended`, `interrupted`, `manual`, `automated`, `override`, `underride`, and `wizard` bolus events for each date in the date range', () => {
      expect(aggregationUtil.aggregateBoluses(groupByDate).byDate['2018-02-01'].subtotals.correction).to.equal(1);
      expect(aggregationUtil.aggregateBoluses(groupByDate).byDate['2018-02-01'].subtotals.extended).to.equal(1);
      expect(aggregationUtil.aggregateBoluses(groupByDate).byDate['2018-02-01'].subtotals.interrupted).to.equal(1);
      expect(aggregationUtil.aggregateBoluses(groupByDate).byDate['2018-02-01'].subtotals.manual).to.equal(6);
      expect(aggregationUtil.aggregateBoluses(groupByDate).byDate['2018-02-01'].subtotals.automated).to.equal(1);
      expect(aggregationUtil.aggregateBoluses(groupByDate).byDate['2018-02-01'].subtotals.override).to.equal(1);
      expect(aggregationUtil.aggregateBoluses(groupByDate).byDate['2018-02-01'].subtotals.underride).to.equal(1);
      expect(aggregationUtil.aggregateBoluses(groupByDate).byDate['2018-02-02'].subtotals.wizard).to.equal(1);
    });
  });

  describe('aggregateFingersticks', () => {
    let groupByDate;

    beforeEach(() => {
      groupByDate = aggregationUtil.dataUtil.dimension.byDate.group();
    });

    afterEach(() => {
      groupByDate.dispose();
    });

    it('should summarize total count for all fingerstick events in the entire date range', () => {
      expect(aggregationUtil.aggregateFingersticks(groupByDate).calibration.summary.total).to.equal(1);
      expect(aggregationUtil.aggregateFingersticks(groupByDate).smbg.summary.total).to.equal(4);
    });

    it('should summarize average daily number of fingerstick events in the entire date range', () => {
      expect(aggregationUtil.aggregateFingersticks(groupByDate).calibration.summary.avgPerDay).to.equal(0.5);
      expect(aggregationUtil.aggregateFingersticks(groupByDate).smbg.summary.avgPerDay).to.equal(2);
    });

    it('should summarize total `calibration`, `manual`, `meter`, `veryHigh`, and `veryLow` fingerstick events for the entire date range', () => {
      expect(aggregationUtil.aggregateFingersticks(groupByDate).calibration.summary.subtotals.calibration.count).to.equal(1);
      expect(aggregationUtil.aggregateFingersticks(groupByDate).smbg.summary.subtotals.manual.count).to.equal(1);
      expect(aggregationUtil.aggregateFingersticks(groupByDate).smbg.summary.subtotals.meter.count).to.equal(3);
      expect(aggregationUtil.aggregateFingersticks(groupByDate).smbg.summary.subtotals.veryHigh.count).to.equal(1);
      expect(aggregationUtil.aggregateFingersticks(groupByDate).smbg.summary.subtotals.veryLow.count).to.equal(1);
    });

    it('should summarize percentage of `calibration`, `manual`, `meter`, `veryHigh`, and `veryLow` fingerstick events for the entire date range', () => {
      expect(aggregationUtil.aggregateFingersticks(groupByDate).calibration.summary.subtotals.calibration.percentage).to.equal(1);
      expect(aggregationUtil.aggregateFingersticks(groupByDate).smbg.summary.subtotals.manual.percentage).to.equal(1 / 4);
      expect(aggregationUtil.aggregateFingersticks(groupByDate).smbg.summary.subtotals.meter.percentage).to.equal(3 / 4);
      expect(aggregationUtil.aggregateFingersticks(groupByDate).smbg.summary.subtotals.veryHigh.percentage).to.equal(1 / 4);
      expect(aggregationUtil.aggregateFingersticks(groupByDate).smbg.summary.subtotals.veryLow.percentage).to.equal(1 / 4);
    });

    it('should summarize total count for all fingerstick events for each date in the date range', () => {
      expect(aggregationUtil.aggregateFingersticks(groupByDate).calibration.byDate['2018-02-01'].total).to.equal(1);
      expect(aggregationUtil.aggregateFingersticks(groupByDate).smbg.byDate['2018-02-01'].total).to.equal(3);
      expect(aggregationUtil.aggregateFingersticks(groupByDate).smbg.byDate['2018-02-02'].total).to.equal(1);
    });

    it('should count total `calibration`, `manual`, `meter`, `veryHigh`, and `veryLow` fingerstick events for each date in the date range', () => {
      expect(aggregationUtil.aggregateFingersticks(groupByDate).calibration.byDate['2018-02-01'].subtotals.calibration).to.equal(1);
      expect(aggregationUtil.aggregateFingersticks(groupByDate).smbg.byDate['2018-02-01'].subtotals.manual).to.equal(1);
      expect(aggregationUtil.aggregateFingersticks(groupByDate).smbg.byDate['2018-02-01'].subtotals.meter).to.equal(2);
      expect(aggregationUtil.aggregateFingersticks(groupByDate).smbg.byDate['2018-02-01'].subtotals.veryHigh).to.equal(1);
      expect(aggregationUtil.aggregateFingersticks(groupByDate).smbg.byDate['2018-02-02'].subtotals.veryLow).to.equal(1);
    });
  });

  describe('aggregateSiteChanges', () => {
    let groupByDate;

    beforeEach(() => {
      groupByDate = aggregationUtil.dataUtil.dimension.byDate.group();
    });

    afterEach(() => {
      groupByDate.dispose();
    });

    it('should summarize days since previous siteChange for all siteChange events for each date in the date range', () => {
      expect(aggregationUtil.aggregateSiteChanges(groupByDate).byDate['2018-02-02'].summary.daysSince).to.eql({ cannulaPrime: 1 });
    });

    it('should count total `cannulaPrime`, `reservoirChange`, and `tubingPrime` siteChange events for each date in the date range', () => {
      expect(aggregationUtil.aggregateSiteChanges(groupByDate).byDate['2018-02-01'].subtotals.cannulaPrime).to.equal(1);
      expect(aggregationUtil.aggregateSiteChanges(groupByDate).byDate['2018-02-01'].subtotals.reservoirChange).to.equal(1);
      expect(aggregationUtil.aggregateSiteChanges(groupByDate).byDate['2018-02-02'].subtotals.tubingPrime).to.equal(1);
      expect(aggregationUtil.aggregateSiteChanges(groupByDate).byDate['2018-02-02'].subtotals.cannulaPrime).to.equal(1);
    });
  });

  describe('aggregateDataByDate', () => {
    let groupByDate;

    beforeEach(() => {
      aggregationUtil = createAggregationUtil(data, {
        ...defaultOpts,
        types: { smbg: {}, bolus: {} },
      });
      groupByDate = aggregationUtil.dataUtil.dimension.byDate.group();
    });

    afterEach(() => {
      groupByDate.dispose();
    });

    it('should aggregate the data by date and by the types set in `dataUtil.types`', () => {
      expect(aggregationUtil.aggregateDataByDate(groupByDate)['2018-02-02'].bolus).to.be.an('array').and.have.lengthOf(1);
      expect(aggregationUtil.aggregateDataByDate(groupByDate)['2018-02-01'].bolus).to.be.an('array').and.have.lengthOf(7);
      expect(aggregationUtil.aggregateDataByDate(groupByDate)['2018-02-02'].smbg).to.be.an('array').and.have.lengthOf(1);
      expect(aggregationUtil.aggregateDataByDate(groupByDate)['2018-02-01'].smbg).to.be.an('array').and.have.lengthOf(3);
    });

    it('should add basals overlapping start of each date range', () => {
      aggregationUtil = createAggregationUtil(data, {
        ...defaultOpts,
        types: { basal: {} },
      });
      groupByDate = aggregationUtil.dataUtil.dimension.byDate.group();

      aggregationUtil.dataUtil.addBasalOverlappingStart = sinon.stub().callsFake(basals => {
        basals.unshift('basal overlapping start');
      });

      expect(aggregationUtil.aggregateDataByDate(groupByDate)['2018-02-01'].basal).to.be.an('array').and.contain('basal overlapping start');
    });

    it('should add pumpSettingsOverride datums overlapping start of each date range', () => {
      aggregationUtil = createAggregationUtil(data, {
        ...defaultOpts,
        types: { deviceEvent: {} },
      });
      groupByDate = aggregationUtil.dataUtil.dimension.byDate.group();

      aggregationUtil.dataUtil.addPumpSettingsOverrideOverlappingStart = sinon.stub().callsFake(overrides => {
        overrides.unshift('pump settings override overlapping start');
      });

      expect(aggregationUtil.aggregateDataByDate(groupByDate)['2018-02-01'].deviceEvent).to.be.an('array').and.contain('pump settings override overlapping start');
    });

    it('should reset endpoint filters to initial values after processing', () => {
      const byEndpointsSpy = sinon.spy(aggregationUtil.dataUtil.filter, 'byEndpoints');
      aggregationUtil.aggregateDataByDate(groupByDate);
      sinon.assert.callCount(byEndpointsSpy, 3);
      expect(byEndpointsSpy.getCall(2).args[0]).to.eql(aggregationUtil.initialActiveEndpoints.range);
    });

    it('should reset `dataUtil.activeEndpoints` to initial values after processing', () => {
      aggregationUtil.aggregateDataByDate(groupByDate);
      expect(aggregationUtil.dataUtil.activeEndpoints).to.eql(aggregationUtil.initialActiveEndpoints);
    });
  });

  describe('aggregateStatsByDate', () => {
    let groupByDate;

    beforeEach(() => {
      aggregationUtil = createAggregationUtil(data, {
        ...defaultOpts,
        stats: 'averageGlucose, timeInRange',
      });
      groupByDate = aggregationUtil.dataUtil.dimension.byDate.group();
    });

    afterEach(() => {
      groupByDate.dispose();
    });

    it('should aggregate stats by date as set in `dataUtil.stats`', () => {
      expect(aggregationUtil.aggregateStatsByDate(groupByDate)['2018-02-02'].averageGlucose).to.be.an('object').and.have.keys([
        'total',
        'averageGlucose',
      ]);

      expect(aggregationUtil.aggregateStatsByDate(groupByDate)['2018-02-01'].timeInRange).to.be.an('object').and.have.keys([
        'total',
        'veryLow',
        'low',
        'target',
        'high',
        'veryHigh',
      ]);
    });

    it('should reset endpoint filters to initial values after processing', () => {
      const byEndpointsSpy = sinon.spy(aggregationUtil.dataUtil.filter, 'byEndpoints');
      aggregationUtil.aggregateStatsByDate(groupByDate);
      sinon.assert.callCount(byEndpointsSpy, 3);
      expect(byEndpointsSpy.getCall(2).args[0]).to.eql(aggregationUtil.initialActiveEndpoints.range);
    });

    it('should reset `dataUtil.activeEndpoints` to initial values after processing', () => {
      aggregationUtil.aggregateStatsByDate(groupByDate);
      expect(aggregationUtil.dataUtil.activeEndpoints).to.eql(aggregationUtil.initialActiveEndpoints);
    });
  });
});


text:
<?php

namespace Webforge\Common;

use stdClass;
use Webforge\Common\ArrayUtil as A;
use Webforge\Common\StringUtil as S;
use Webforge\Common\ClassInterface;
use Webforge\Common\PHPClass;
use RuntimeException;

/**
 * @deprecated dont use this class yet
 *
 * implements \Webforge\Types\Adapters\CodeWriter it does this but i dont want to pull in dependencies for (only) this
 */
class CodeWriter
{
    public static function create()
    {
        return new static();
    }

    public function exportConstructor(ClassInterface $class, array $parameters)
    {
        return $this->writeConstructor($class, $this->exportFunctionParameters($parameters));
    }

    public function writeConstructor(ClassInterface $class, $parametersPHPCode)
    {
        return sprintf('new \%s(%s)', $class->getFQN(), $parametersPHPCode);
    }

    public function callGetter($objectVar, $propertyName)
    {
        return sprintf('%s->get%s()', $this->exportFunctionParameter($objectVar), S::ucfirst($propertyName));
    }

    public function callSetter($objectVar, $propertyName, $value)
    {
        return sprintf('%s->set%s(%s)', $this->exportFunctionParameter($objectVar), S::ucfirst($propertyName), $this->exportFunctionParameter($value));
    }

    public function call($objectVar, $functionName, $args)
    {
        return sprintf(
            '%s->%s(%s)',
            $this->exportFunctionParameter($objectVar),
            $functionName,
            $this->exportFunctionParameter($args)
        );
    }

    public function exportFunctionParameters(array $values)
    {
        $that = $this;
        return A::implode($values, ',', function ($item) use ($that) {
            return $that->exportFunctionParameter($item);
        });
    }

    public function exportFunctionParameter($item)
    {
        if (is_array($item)) {
            return sprintf('%s', $this->exportKeyList($item));
        } elseif ($item instanceof \stdClass) {
            return $this->exportStdClass($item, 'list');
        } elseif ($item instanceof \Psc\Code\AST\LVariable) {
            return sprintf('$%s', $item->getName());
        } elseif ($item instanceof Expression) {
            return $item->php();
        } else {
            return $this->exportBaseTypeValue($item);
        }
    }

    /**
     * Nimmt einen Array und exportiert diesen in einer Zeile
     *
     * es sind nur BasisDatenTypen erlaubt (+ stdClass)
     * also alles was man auch schön exportieren kann. Dies ist für sehr einfache Dinge nur sinnvoll und bietet
     * keine komplexe Export-Möglichkeiten
     *
     * dies ist also ähnliche wie var_export, nur inline
     * @return string
     */
    public function exportList(array $list)
    {
        $that = $this;
        return
      sprintf(
          'array(%s)',
          A::implode($list, ',', function ($item) use ($that) {
          if (is_array($item)) {
              return $that->exportList($item);
          } elseif ($item instanceof \stdClass) {
              return $that->exportStdClass($item, 'list');
          } else {
              return $that->exportValue($item);
          }
      })
      );
    }

    public function exportStdClass(stdClass $var, $type = 'keyList')
    {
        return '(object) '.$this->exportKeyList($this->castStdClassToArray($var), $type);
    }

    /**
     * Sowie exportList, jedoch setzt dieses auch die Keys
     */
    public function exportKeyList(array $array, $type = 'keyList')
    {
        $that = $this;
        return
      sprintf(
          'array(%s)',
          A::implode($array, ',', function ($item, $key) use ($that, $type) {
          if (is_array($item)) {
              // damit wir wenn wir exportList machen und ein objekt mit hilfsfunktion exportKeyList benutzen zu exportList() wieder zurückgehen können
              $value = $type === 'keyList' ? $that->exportKeyList($item) : $that->exportList($item);
          } elseif ($item instanceof \stdClass) {
              $value = $that->exportStdClass($item, 'keyList');
          } else {
              $value = $that->exportValue($item);
          }

          return sprintf('%s=>%s', var_export((string) $key, true), $value);
      })
      );
    }

    public function castStdClassToArray(stdClass $o)
    {
        return (array) $o;
    }

    /**
     * @return string
     */
    public function exportBaseTypeValue($value)
    {
        if (!$this->isBaseType($value)) {
            throw new RuntimeException('export kann keine Komplexen Datentypen wie: '.gettype($value).' exportieren');
        }

        return var_export($value, true);
    }

    public function exportValue($value)
    {
        // qnd: leere ArrayCollection geht
        if ($value instanceof \Psc\Data\ArrayCollection || $value instanceof \Webforge\Collections\ArrayCollection) {
            return $this->writeConstructor(new PHPClass(get_class($value)), $value->toArray());
        } elseif ($value === array()) {
            return 'array()';
        } else {
            return $this->exportBaseTypeValue($value);
        }
    }

    /**
     * @return bool
     */
    protected function isBaseType($var)
    {
        // wir wollen alle php basistypen, aber keine objekte (auch nicht standardclas)
        if (is_object($var)) {
            return false;
        }
        if (is_array($var)) {
            return false;
        }

        return true;
    }
}


text:
<?php
App::uses('AppModel', 'Model');
/**
 * EarnedSponsorship Model
 *
 * @property Employee $Employee
 */
class EarnedSponsorship extends AppModel {

/**
 * Display field
 *
 * @var string
 */
	public $displayField = 'title';

	//The Associations below have been created with all possible keys, those that are not needed can be removed

/**
 * belongsTo associations
 *
 * @var array
 */
	public $belongsTo = array(
		'Employee' => array(
			'className' => 'Employee',
			'foreignKey' => 'employee_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);
}


text:
docker_service 'default' do
  install_method 'package'
  graph '/var/lib/docker'
  action [:create, :start]
end

################
# simple process
################

docker_image 'busybox' do
  host 'unix:///var/run/docker.sock'
end

docker_container 'service default echo server' do
  container_name 'an_echo_server'
  repo 'busybox'
  command 'nc -ll -p 7 -e /bin/cat'
  port '7'
  action :run
end

#####################
# squid forward proxy
#####################

directory '/etc/squid_forward_proxy' do
  recursive true
  owner 'root'
  mode '0755'
  action :create
end

template '/etc/squid_forward_proxy/squid.conf' do
  source 'squid_forward_proxy/squid.conf.erb'
  owner 'root'
  mode '0755'
  notifies :redeploy, 'docker_container[squid_forward_proxy]'
  action :create
end

docker_image 'cbolt/squid' do
  tag 'latest'
  action :pull
end

docker_container 'squid_forward_proxy' do
  repo 'cbolt/squid'
  tag 'latest'
  restart_policy 'on-failure'
  kill_after 5
  port '3128:3128'
  command '/usr/sbin/squid -NCd1'
  volumes '/etc/squid_forward_proxy/squid.conf:/etc/squid/squid.conf'
  subscribes :redeploy, 'docker_image[cbolt/squid]'
  action :run
end

#############
# service one
#############

docker_service 'one' do
  graph '/var/lib/docker-one'
  host 'unix:///var/run/docker-one.sock'
  http_proxy 'http://127.0.0.1:3128'
  https_proxy 'http://127.0.0.1:3128'
  action :start
end

docker_image 'hello-world' do
  host 'unix:///var/run/docker-one.sock'
  tag 'latest'
end

docker_container 'hello-world' do
  host 'unix:///var/run/docker-one.sock'
  command '/hello'
  action :create
end


text:
package org.spongepowered.common.mixin.api.minecraft.world.scores;

import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import net.minecraft.world.scores.PlayerTeam;
import net.minecraft.world.scores.Scoreboard;
import org.spongepowered.api.scoreboard.Team;
import org.spongepowered.api.scoreboard.Visibility;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Implements;
import org.spongepowered.asm.mixin.Interface;
import org.spongepowered.asm.mixin.Interface.Remap;
import org.spongepowered.asm.mixin.Intrinsic;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.common.bridge.world.scores.PlayerTeamBridge;

import java.util.Collection;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;

import javax.annotation.Nullable;

@Mixin(PlayerTeam.class)
@Implements(@Interface(iface = Team.class, prefix = "team$", remap = Remap.NONE))
public abstract class PlayerTeamMixin_API implements Team {

    // @formatter:off
    @Nullable @Shadow @Final @Mutable private Scoreboard scoreboard;
    @Shadow @Final private String name;
    @Shadow @Final private Set<String> players;

    @Shadow public abstract void shadow$setAllowFriendlyFire(boolean friendlyFire);
    @Shadow public abstract void shadow$setSeeFriendlyInvisibles(boolean friendlyInvisibles);
    @Shadow public abstract void shadow$setNameTagVisibility(net.minecraft.world.scores.Team.Visibility visibility);
    @Shadow public abstract void shadow$setDeathMessageVisibility(net.minecraft.world.scores.Team.Visibility visibility);
    @Shadow public abstract void shadow$setCollisionRule(net.minecraft.world.scores.Team.CollisionRule rule);
    @Shadow public abstract void shadow$setDisplayName(net.minecraft.network.chat.Component text);
    @Shadow public abstract boolean shadow$isAllowFriendlyFire();
    @Shadow public abstract boolean shadow$canSeeFriendlyInvisibles();
    @Shadow public abstract net.minecraft.world.scores.Team.Visibility shadow$getNameTagVisibility();
    @Shadow public abstract net.minecraft.world.scores.Team.Visibility shadow$getDeathMessageVisibility();
    @Shadow public abstract net.minecraft.world.scores.Team.CollisionRule shadow$getCollisionRule();
    @Shadow public abstract Collection<String> shadow$getPlayers();
    // @formatter:on

    @Override
    public String name() {
        return this.name;
    }

    @Override
    public Component displayName() {
        return ((PlayerTeamBridge) this).bridge$getDisplayName();
    }

    @Override
    public void setDisplayName(final Component text) {
        ((PlayerTeamBridge) this).bridge$setDisplayName(text);
    }

    @Override
    public NamedTextColor color() {
        return ((PlayerTeamBridge) this).bridge$getColor();
    }

    @Override
    public void setColor(final NamedTextColor color) {
        ((PlayerTeamBridge) this).bridge$setColor(color);
    }

    @Override
    public Component prefix() {
        return ((PlayerTeamBridge) this).bridge$getPrefix();
    }

    @Override
    public void setPrefix(final Component prefix) {
        ((PlayerTeamBridge) this).bridge$setPrefix(prefix);
    }

    @Override
    public Component suffix() {
        return ((PlayerTeamBridge) this).bridge$getSuffix();
    }

    @Override
    public void setSuffix(final Component suffix) {
        ((PlayerTeamBridge) this).bridge$setSuffix(suffix);
    }

    @Override
    public boolean allowFriendlyFire() {
        return this.shadow$isAllowFriendlyFire();
    }

    @Intrinsic
    public void team$setAllowFriendlyFire(final boolean allowFriendlyFire) {
        this.shadow$setAllowFriendlyFire(allowFriendlyFire);
    }

    @Intrinsic
    public boolean team$canSeeFriendlyInvisibles() {
        return this.shadow$canSeeFriendlyInvisibles();
    }

    @Override
    public void setCanSeeFriendlyInvisibles(final boolean enabled) {
        this.shadow$setSeeFriendlyInvisibles(enabled);
    }

    @SuppressWarnings("ConstantConditions")
    @Override
    public Visibility nameTagVisibility() {
        return (Visibility) (Object) this.shadow$getNameTagVisibility();
    }

    @SuppressWarnings("ConstantConditions")
    @Override
    public void setNameTagVisibility(final Visibility visibility) {
        this.shadow$setNameTagVisibility((net.minecraft.world.scores.Team.Visibility) (Object) visibility);
    }

    @SuppressWarnings("ConstantConditions")
    @Override
    public Visibility deathMessageVisibility() {
        return (Visibility) (Object) this.shadow$getDeathMessageVisibility();
    }

    @SuppressWarnings("ConstantConditions")
    @Override
    public void setDeathMessageVisibility(final Visibility visibility) {
        this.shadow$setDeathMessageVisibility((net.minecraft.world.scores.Team.Visibility) (Object) visibility);
    }

    @SuppressWarnings("ConstantConditions")
    @Override
    public org.spongepowered.api.scoreboard.CollisionRule collisionRule() {
        return (org.spongepowered.api.scoreboard.CollisionRule) (Object) this.shadow$getCollisionRule();
    }

    @SuppressWarnings("ConstantConditions")
    @Override
    public void setCollisionRule(final org.spongepowered.api.scoreboard.CollisionRule rule) {
        this.shadow$setCollisionRule((net.minecraft.world.scores.Team.CollisionRule) (Object) rule);
    }

    @Override
    public Set<Component> members() {
        final LegacyComponentSerializer lcs = LegacyComponentSerializer.legacySection();
        return this.shadow$getPlayers().stream().map(lcs::deserialize).collect(Collectors.toSet());
    }

    @Override
    public void addMember(final Component member) {
        final String legacyName = LegacyComponentSerializer.legacySection().serialize(member);
        if (legacyName.length() > 40) {
            throw new IllegalArgumentException(String.format("Member is %s characters long! It must be at most 40.", legacyName.length()));
        }
        if (this.scoreboard != null) {
            this.scoreboard.addPlayerToTeam(legacyName, (PlayerTeam) (Object) this);
        } else {
            this.players.add(legacyName); // this is normally done by addPlayerToTeam
        }
    }

    @SuppressWarnings("RedundantCast")
    @Override
    public boolean removeMember(final Component member) {
        final String legacyName = LegacyComponentSerializer.legacySection().serialize(member);
        if (this.scoreboard != null) {
            final PlayerTeam realTeam = this.scoreboard.getPlayersTeam(legacyName);

            if (realTeam == (PlayerTeam) (Object) this) {
                this.scoreboard.removePlayerFromTeam(legacyName, realTeam);
                return true;
            }
            return false;
        }
        return this.players.remove(legacyName);
    }

    @Override
    public Optional<org.spongepowered.api.scoreboard.Scoreboard> scoreboard() {
        return Optional.ofNullable((org.spongepowered.api.scoreboard.Scoreboard) this.scoreboard);
    }

    @Override
    public boolean unregister() {
        if (this.scoreboard == null) {
            return false;
        }
        this.scoreboard.removePlayerTeam((PlayerTeam) (Object) this);
        this.scoreboard = null;
        return true;
    }

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SSW.DataOnion.UserGroupDemo.Domain
{
    public class Course
    {

        public int Id { get; set; }

        public string Title { get; set; }

        public virtual School School { get; set; }

        public virtual ICollection<Student> Students { get; set; }

    }
}


text:
<?php dialogue_info_snippet(); ?>

<?php
$video_id = '';
$vimeo_code = get_post_meta( $post->ID, 'dialogue_vimeo_embed', TRUE);
$vimeo_id = get_post_meta( $post->ID, 'dialogue_vimeo_id', TRUE);
if ($vimeo_id) :
	$video_id = $vimeo_id;
elseif ($vimeo_code) :
	$video_id = str_replace("https://vimeo.com/", "", $vimeo_code);
endif;

ob_start();
the_content();
$content = ob_get_clean();
echo $content;
if ($video_id) :
echo do_shortcode('[vimeo id="' . $video_id .'" width="" height="" autoplay="no" api_params="" class=""]');
endif; ?>

<?php $dialogue_speakers = get_field('dialogue_speakers');
if( get_field('dialogue_speakers') ) : ?>
	<?php while(has_sub_field('dialogue_speakers')) : ?>

		<?php if (get_sub_field('dialogue_speaker_bio') != '') :
		echo do_shortcode('[separator style_type="single|dashed" top_margin="10" bottom_margin="20" sep_color="#d4d4d4" border_size="1px" icon="" icon_circle="" icon_circle_color="" width="" alignment="left" class="" id=""]'); ?>

<?php echo get_sub_field('dialogue_speaker_bio'); ?>

		<?php endif; ?>

	<?php endwhile; ?>
<?php endif; ?>

<?php $dd_info = get_post_meta( $post->ID, 'dialogue_info_blurb', TRUE);
if ( $dd_info  == '') {
	$dd_info = '
A continuously updated schedule of talks is also available on the Digital Dialogues webpage.

Unable to attend the events in person? Archived podcasts can be found on the MITH website, and you can follow our Digital Dialogues Twitter account @digdialog as well as the Twitter hashtag #mithdd to keep up with live tweets from our sessions. Viewers can watch the live stream as well.

All talks free and open to the public. Attendees are welcome to bring their own lunches.

Contact: MITH (mith.umd.edu, mith@umd.edu, 301.405.8927).
';
}
echo do_shortcode('[tagline_box backgroundcolor="#f9f9f9" shadow="no" shadowopacity="1" border="3px" bordercolor="#f6f6f6" highlightposition="top" content_alignment="left" link="" linktarget="" modal="" button_size="" button_shape="" button_type="" buttoncolor="" button="" title="" description="" margin_top="25px" margin_bottom="" animation_type="" animation_direction="" animation_speed="" class="dd-info" id=""]' . $dd_info . '[/tagline_box]'); ?>


text:
#include "src/codec/SkAndroidCodecAdapter.h"
#include "src/codec/SkCodecPriv.h"

struct SkIRect;
struct SkImageInfo;

SkAndroidCodecAdapter::SkAndroidCodecAdapter(SkCodec* codec)
    : INHERITED(codec)
{}

SkISize SkAndroidCodecAdapter::onGetSampledDimensions(int sampleSize) const {
    float scale = get_scale_from_sample_size(sampleSize);
    return this->codec()->getScaledDimensions(scale);
}

bool SkAndroidCodecAdapter::onGetSupportedSubset(SkIRect* desiredSubset) const {
    return this->codec()->getValidSubset(desiredSubset);
}

SkCodec::Result SkAndroidCodecAdapter::onGetAndroidPixels(const SkImageInfo& info, void* pixels,
        size_t rowBytes, const AndroidOptions& options) {
    return this->codec()->getPixels(info, pixels, rowBytes, &options);
}


text:
package astilectron

import (
	"fmt"
	"net"
	"os"
	"os/exec"
	"os/signal"
	"runtime"
	"sync"
	"syscall"
	"time"

	"github.com/asticode/go-astilog"
	asticontext "github.com/asticode/go-astitools/context"
	astiexec "github.com/asticode/go-astitools/exec"
	"github.com/pkg/errors"
)

// Versions
const (
	DefaultAcceptTCPTimeout   = 30 * time.Second
	DefaultVersionAstilectron = "0.34.0"
	DefaultVersionElectron    = "4.0.1"
)

// Misc vars
var (
	validOSes = map[string]bool{
		"darwin":  true,
		"linux":   true,
		"windows": true,
	}
)

// App event names
const (
	EventNameAppClose         = "app.close"
	EventNameAppCmdQuit       = "app.cmd.quit" // Sends an event to Electron to properly quit the app
	EventNameAppCmdStop       = "app.cmd.stop" // Cancel the context which results in exiting abruptly Electron's app
	EventNameAppCrash         = "app.crash"
	EventNameAppErrorAccept   = "app.error.accept"
	EventNameAppEventReady    = "app.event.ready"
	EventNameAppNoAccept      = "app.no.accept"
	EventNameAppTooManyAccept = "app.too.many.accept"
)

// Astilectron represents an object capable of interacting with Astilectron
type Astilectron struct {
	canceller    *asticontext.Canceller
	channelQuit  chan bool
	closeOnce    sync.Once
	dispatcher   *dispatcher
	displayPool  *displayPool
	dock         *Dock
	executer     Executer
	identifier   *identifier
	listener     net.Listener
	options      Options
	paths        *Paths
	provisioner  Provisioner
	reader       *reader
	stderrWriter *astiexec.StdWriter
	stdoutWriter *astiexec.StdWriter
	supported    *Supported
	writer       *writer
}

// Options represents Astilectron options
type Options struct {
	AcceptTCPTimeout   time.Duration
	AppName            string
	AppIconDarwinPath  string // Darwin systems requires a specific .icns file
	AppIconDefaultPath string
	BaseDirectoryPath  string
	DataDirectoryPath  string
	ElectronSwitches   []string
	SingleInstance     bool
	SkipSetup          bool // If true, the user must handle provisioning and executing astilectron.
	TCPPort            *int // The port to listen on.
	VersionAstilectron string
	VersionElectron    string
}

// Supported represents Astilectron supported features
type Supported struct {
	Notification *bool `json:"notification"`
}

// New creates a new Astilectron instance
func New(o Options) (a *Astilectron, err error) {
	// Validate the OS
	if !IsValidOS(runtime.GOOS) {
		err = errors.Wrapf(err, "OS %s is invalid", runtime.GOOS)
		return
	}

	if o.VersionAstilectron == "" {
		o.VersionAstilectron = DefaultVersionAstilectron
	}
	if o.VersionElectron == "" {
		o.VersionElectron = DefaultVersionElectron
	}

	// Init
	a = &Astilectron{
		canceller:   asticontext.NewCanceller(),
		channelQuit: make(chan bool),
		dispatcher:  newDispatcher(),
		displayPool: newDisplayPool(),
		executer:    DefaultExecuter,
		identifier:  newIdentifier(),
		options:     o,
		provisioner: DefaultProvisioner,
	}

	// Set paths
	if a.paths, err = newPaths(runtime.GOOS, runtime.GOARCH, o); err != nil {
		err = errors.Wrap(err, "creating new paths failed")
		return
	}

	// Add default listeners
	a.On(EventNameAppCmdStop, func(e Event) (deleteListener bool) {
		a.Stop()
		return
	})
	a.On(EventNameDisplayEventAdded, func(e Event) (deleteListener bool) {
		a.displayPool.update(e.Displays)
		return
	})
	a.On(EventNameDisplayEventMetricsChanged, func(e Event) (deleteListener bool) {
		a.displayPool.update(e.Displays)
		return
	})
	a.On(EventNameDisplayEventRemoved, func(e Event) (deleteListener bool) {
		a.displayPool.update(e.Displays)
		return
	})
	a.On(EventNameAppCmdQuit, func(e Event) (deleteListener bool) {
		a.Stop()
		return
	})
	return
}

// IsValidOS validates the OS
func IsValidOS(os string) (ok bool) {
	_, ok = validOSes[os]
	return
}

// SetProvisioner sets the provisioner
func (a *Astilectron) SetProvisioner(p Provisioner) *Astilectron {
	a.provisioner = p
	return a
}

// SetExecuter sets the executer
func (a *Astilectron) SetExecuter(e Executer) *Astilectron {
	a.executer = e
	return a
}

// On implements the Listenable interface
func (a *Astilectron) On(eventName string, l Listener) {
	a.dispatcher.addListener(targetIDApp, eventName, l)
}

// Start starts Astilectron
func (a *Astilectron) Start() (err error) {
	// Log
	astilog.Debug("Starting...")

	// Provision
	if !a.options.SkipSetup {
		if err = a.provision(); err != nil {
			return errors.Wrap(err, "provisioning failed")
		}
	}

	// Unfortunately communicating with Electron through stdin/stdout doesn't work on Windows so all communications
	// will be done through TCP
	if err = a.listenTCP(); err != nil {
		return errors.Wrap(err, "listening failed")
	}

	// Execute
	if !a.options.SkipSetup {
		if err = a.execute(); err != nil {
			return errors.Wrap(err, "executing failed")
		}
	} else {
		synchronousFunc(a.canceller, a, nil, "app.event.ready")
	}
	return nil
}

// provision provisions Astilectron
func (a *Astilectron) provision() error {
	astilog.Debug("Provisioning...")
	var ctx, _ = a.canceller.NewContext()
	return a.provisioner.Provision(ctx, a.options.AppName, runtime.GOOS, runtime.GOARCH, a.options.VersionAstilectron, a.options.VersionElectron, *a.paths)
}

// listenTCP creates a TCP server for astilectron to connect to
// and listens to the first TCP connection coming its way (this should be Astilectron).
func (a *Astilectron) listenTCP() (err error) {
	// Log
	astilog.Debug("Listening...")

	addr := "127.0.0.1:"
	if a.options.TCPPort != nil {
		addr += fmt.Sprint(*a.options.TCPPort)
	}
	// Listen
	if a.listener, err = net.Listen("tcp", addr); err != nil {
		return errors.Wrap(err, "tcp net.Listen failed")
	}

	// Check a connection has been accepted quickly enough
	var chanAccepted = make(chan bool)
	go a.watchNoAccept(a.options.AcceptTCPTimeout, chanAccepted)

	// Accept connections
	go a.acceptTCP(chanAccepted)
	return
}

// watchNoAccept checks whether a TCP connection is accepted quickly enough
func (a *Astilectron) watchNoAccept(timeout time.Duration, chanAccepted chan bool) {
	//check timeout
	if timeout == 0 {
		timeout = DefaultAcceptTCPTimeout
	}
	var t = time.NewTimer(timeout)
	defer t.Stop()
	for {
		select {
		case <-chanAccepted:
			return
		case <-t.C:
			astilog.Errorf("No TCP connection has been accepted in the past %s", timeout)
			a.dispatcher.dispatch(Event{Name: EventNameAppNoAccept, TargetID: targetIDApp})
			a.dispatcher.dispatch(Event{Name: EventNameAppCmdStop, TargetID: targetIDApp})
			return
		}
	}
}

// watchAcceptTCP accepts TCP connections
func (a *Astilectron) acceptTCP(chanAccepted chan bool) {
	for i := 0; i <= 1; i++ {
		// Accept
		var conn net.Conn
		var err error
		if conn, err = a.listener.Accept(); err != nil {
			astilog.Errorf("%s while TCP accepting", err)
			a.dispatcher.dispatch(Event{Name: EventNameAppErrorAccept, TargetID: targetIDApp})
			a.dispatcher.dispatch(Event{Name: EventNameAppCmdStop, TargetID: targetIDApp})
			return
		}

		// We only accept the first connection which should be Astilectron, close the next one and stop
		// the app
		if i > 0 {
			astilog.Errorf("Too many TCP connections")
			a.dispatcher.dispatch(Event{Name: EventNameAppTooManyAccept, TargetID: targetIDApp})
			a.dispatcher.dispatch(Event{Name: EventNameAppCmdStop, TargetID: targetIDApp})
			conn.Close()
			return
		}

		// Let the timer know a connection has been accepted
		chanAccepted <- true

		// Create reader and writer
		a.writer = newWriter(conn)
		ctx, _ := a.canceller.NewContext()
		a.reader = newReader(ctx, a.dispatcher, conn)
		go a.reader.read()
	}
}

// execute executes Astilectron in Electron
func (a *Astilectron) execute() (err error) {
	// Log
	astilog.Debug("Executing...")

	// Create command
	var ctx, _ = a.canceller.NewContext()
	var singleInstance string
	if a.options.SingleInstance == true {
		singleInstance = "true"
	} else {
		singleInstance = "false"
	}
	var cmd = exec.CommandContext(ctx, a.paths.AppExecutable(), append([]string{a.paths.AstilectronApplication(), a.listener.Addr().String(), singleInstance}, a.options.ElectronSwitches...)...)
	a.stderrWriter = astiexec.NewStdWriter(func(i []byte) { astilog.Debugf("Stderr says: %s", i) })
	a.stdoutWriter = astiexec.NewStdWriter(func(i []byte) { astilog.Debugf("Stdout says: %s", i) })
	cmd.Stderr = a.stderrWriter
	cmd.Stdout = a.stdoutWriter

	// Execute command
	if err = a.executeCmd(cmd); err != nil {
		return errors.Wrap(err, "executing cmd failed")
	}
	return
}

// executeCmd executes the command
func (a *Astilectron) executeCmd(cmd *exec.Cmd) (err error) {
	var e = synchronousFunc(a.canceller, a, func() {
		err = a.executer(a, cmd)
	}, EventNameAppEventReady)

	// Update display pool
	if e.Displays != nil {
		a.displayPool.update(e.Displays)
	}

	// Create dock
	a.dock = newDock(a.canceller, a.dispatcher, a.identifier, a.writer)

	// Update supported features
	a.supported = e.Supported
	return
}

// watchCmd watches the cmd execution
func (a *Astilectron) watchCmd(cmd *exec.Cmd) {
	// Wait
	cmd.Wait()

	// Check the canceller to check whether it was a crash
	if !a.canceller.Cancelled() {
		astilog.Debug("App has crashed")
		a.dispatcher.dispatch(Event{Name: EventNameAppCrash, TargetID: targetIDApp})
	} else {
		astilog.Debug("App has closed")
		a.dispatcher.dispatch(Event{Name: EventNameAppClose, TargetID: targetIDApp})
	}
	a.dispatcher.dispatch(Event{Name: EventNameAppCmdStop, TargetID: targetIDApp})
}

// Close closes Astilectron properly
func (a *Astilectron) Close() {
	astilog.Debug("Closing...")
	a.canceller.Cancel()
	if a.listener != nil {
		a.listener.Close()
	}
	if a.reader != nil {
		a.reader.close()
	}
	if a.stderrWriter != nil {
		a.stderrWriter.Close()
	}
	if a.stdoutWriter != nil {
		a.stdoutWriter.Close()
	}
	if a.writer != nil {
		a.writer.close()
	}
}

// HandleSignals handles signals
func (a *Astilectron) HandleSignals() {
	ch := make(chan os.Signal, 1)
	signal.Notify(ch, syscall.SIGABRT, syscall.SIGINT, syscall.SIGQUIT, syscall.SIGTERM)
	go func() {
		for sig := range ch {
			astilog.Debugf("Received signal %s", sig)
			a.Stop()
		}
	}()
}

// Stop orders Astilectron to stop
func (a *Astilectron) Stop() {
	astilog.Debug("Stopping...")
	a.canceller.Cancel()
	a.closeOnce.Do(func() {
		close(a.channelQuit)
	})
}

// Wait is a blocking pattern
func (a *Astilectron) Wait() {
	<-a.channelQuit
}

// Quit quits the app
func (a *Astilectron) Quit() error {
	return a.writer.write(Event{Name: EventNameAppCmdQuit})
}

// Paths returns the paths
func (a *Astilectron) Paths() Paths {
	return *a.paths
}

// Displays returns the displays
func (a *Astilectron) Displays() []*Display {
	return a.displayPool.all()
}

// Dock returns the dock
func (a *Astilectron) Dock() *Dock {
	return a.dock
}

// PrimaryDisplay returns the primary display
func (a *Astilectron) PrimaryDisplay() *Display {
	return a.displayPool.primary()
}

// NewMenu creates a new app menu
func (a *Astilectron) NewMenu(i []*MenuItemOptions) *Menu {
	return newMenu(nil, targetIDApp, i, a.canceller, a.dispatcher, a.identifier, a.writer)
}

// NewWindow creates a new window
func (a *Astilectron) NewWindow(url string, o *WindowOptions) (*Window, error) {
	return newWindow(a.options, a.Paths(), url, o, a.canceller, a.dispatcher, a.identifier, a.writer)
}

// NewWindowInDisplay creates a new window in a specific display
// This overrides the center attribute
func (a *Astilectron) NewWindowInDisplay(d *Display, url string, o *WindowOptions) (*Window, error) {
	if o.X != nil {
		*o.X += d.Bounds().X
	} else {
		o.X = PtrInt(d.Bounds().X)
	}
	if o.Y != nil {
		*o.Y += d.Bounds().Y
	} else {
		o.Y = PtrInt(d.Bounds().Y)
	}
	return newWindow(a.options, a.Paths(), url, o, a.canceller, a.dispatcher, a.identifier, a.writer)
}

// NewTray creates a new tray
func (a *Astilectron) NewTray(o *TrayOptions) *Tray {
	return newTray(o, a.canceller, a.dispatcher, a.identifier, a.writer)
}

// NewNotification creates a new notification
func (a *Astilectron) NewNotification(o *NotificationOptions) *Notification {
	return newNotification(o, a.supported != nil && a.supported.Notification != nil && *a.supported.Notification, a.canceller, a.dispatcher, a.identifier, a.writer)
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<title>iOL Editor</title>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>

        Tools

    <form id="controlPanel" class="dialog">
        <fieldset>

Tools

            Done

                Navigate
                <input id="navigate" type="radio" name="draw" checked="checked"/>

                Draw Points
                <input id="point" type="radio" name="draw" />

                Draw Lines
                <input id="line" type="radio" name="draw" />

                Draw Polygons
                <input id="polygon" type="radio" name="draw" />

                Delete Features
                delete

        </fieldset>
    </form>


text:
For reading user input from stdin.

Similar to the `readline` builtin's `question()` method, but with a
few more features.

## USAGE

```javascript
var read = require("read")
read(options, callback)
```

The callback gets called with either the user input, or the default
specified, or an error, as `callback(error, result, isDefault)`
node style.

## OPTIONS

Every option is optional.

* `prompt` What to write to stdout before reading input.
* `silent` Don't echo the output as the user types it.
* `replace` Replace silenced characters with the supplied character value.
* `timeout` Number of ms to wait for user input before giving up.
* `default` The default value if the user enters nothing.
* `edit` Allow the user to edit the default value.
* `terminal` Treat the output as a TTY, whether it is or not.
* `stdin` Readable stream to get input data from. (default `process.stdin`)
* `stdout` Writeable stream to write prompts to. (default: `process.stdout`)

If silent is true, and the input is a TTY, then read will set raw
mode, and read character by character.

## COMPATIBILITY

This module works sort of with node 0.6.  It does not work with node
versions less than 0.6.  It is best on node 0.8.

On node version 0.6, it will remove all listeners on the input
stream's `data` and `keypress` events, because the readline module did
not fully clean up after itself in that version of node, and did not
make it possible to clean up after it in a way that has no potential
for side effects.

Additionally, some of the readline options (like `terminal`) will not
function in versions of node before 0.8, because they were not
implemented in the builtin readline module.

## CONTRIBUTING

Patches welcome.


text:
require "spec_helper"

describe MollomRestApi::V1::Whitelist do
  describe :create do
    context "when providing a valid url and email", vcr: {cassette_name: "whitelist/create"} do
      let(:request_parameters) { {note: 'patate'} }
      let(:response) {{"context"=>"authorIp", "created"=>"1412787909465", "id"=>"76747", "lastMatch"=>"0", "matchCount"=>"0", "status"=>"1", "value"=>"123.123.80.22"}}

      it "should return a json response containing the whitelist entry" do
        expect(MollomRestApi::V1::Whitelist.create('1lgj17lzuezlu1bn9ry4k3qz4k8nr42n', '123.123.80.22', 'authorIp', request_parameters)).to eq(response)
      end
    end

    include_examples "api error handling", class_under_test: MollomRestApi::V1::Whitelist, method_under_test: :create, method_args: %w(public_key value context)
  end

  describe :update do
    context "when providing a public key and a value for an author name", vcr: {cassette_name: "whitelist/update"} do
      let(:request_parameters) { {value: 'patate', context: 'authorName'} }
      let(:response) {{"context"=>"authorName", "created"=>"1412787909465", "id"=>"76747", "lastMatch"=>"0", "matchCount"=>"0", "status"=>"0", "value"=>"patate"}}

      it "should return a json response containing the updated whitelist entry" do
        expect(MollomRestApi::V1::Whitelist.update('1lgj17lzuezlu1bn9ry4k3qz4k8nr42n', '76747', request_parameters)).to eq(response)
      end
    end

    include_examples "api error handling", class_under_test: MollomRestApi::V1::Whitelist, method_under_test: :update, method_args: %w(public_key whitelist_entry_id)
  end

  describe :delete do
    context "when providing a public key and whitelist entry id", vcr: {cassette_name: "whitelist/delete"} do
      it "should return a json response containing the deleted whitelist entry" do
        expect{MollomRestApi::V1::Whitelist.delete('1lgj17lzuezlu1bn9ry4k3qz4k8nr42n', '79552')}.not_to raise_error
      end
    end

    include_examples "api error handling", class_under_test: MollomRestApi::V1::Whitelist, method_under_test: :delete, method_args: %w(public_key whitelist_entry_id)
  end

  describe :list do
    context "when providing a public key", vcr: {cassette_name: "whitelist/list"} do
      let(:request_parameters) { {count: 5} }
      let(:response) {{"entry"=>{"context"=>"authorName", "created"=>"1412787909465", "id"=>"76747", "lastMatch"=>"0", "matchCount"=>"0", "status"=>"0", "value"=>"patate"}}}

      it "should return a json response containing the list of whitelist entries" do
        expect(MollomRestApi::V1::Whitelist.list('1lgj17lzuezlu1bn9ry4k3qz4k8nr42n', request_parameters)).to eq(response)
      end
    end

    include_examples "api error handling", class_under_test: MollomRestApi::V1::Whitelist, method_under_test: :list, method_args: %w(a_public_key)
  end

  describe :read do
    context "when providing a public key and whitelist entry id", vcr: {cassette_name: "whitelist/read"} do
      let(:response) {{"context"=>"authorName", "created"=>"1413826721455", "id"=>"79557", "lastMatch"=>"0", "matchCount"=>"0", "status"=>"1", "value"=>"patate"}}

      it "should return a json response containing the whitelist entry" do
        expect(MollomRestApi::V1::Whitelist.read('1lgj17lzuezlu1bn9ry4k3qz4k8nr42n', '79557')).to eq(response)
      end
    end

    include_examples "api error handling", class_under_test: MollomRestApi::V1::Whitelist, method_under_test: :read, method_args: %w(public_key whitelist_entry_id)
  end
end


text:
package org.knowm.xchange.wex.v3.service;

import org.knowm.xchange.Exchange;
import org.knowm.xchange.exceptions.ExchangeException;
import org.knowm.xchange.exceptions.FundsExceededException;
import org.knowm.xchange.exceptions.NonceException;
import org.knowm.xchange.service.BaseExchangeService;
import org.knowm.xchange.service.BaseService;
import org.knowm.xchange.wex.v3.WexAuthenticated;
import org.knowm.xchange.wex.v3.dto.WexReturn;
import si.mazi.rescu.ParamsDigest;
import si.mazi.rescu.RestProxyFactory;

public class WexBaseService extends BaseExchangeService implements BaseService {

  private static final String ERR_MSG_NONCE = "invalid nonce parameter; on key:";
  private static final String ERR_MSG_FUNDS = "It is not enough ";

  protected final String apiKey;
  protected final WexAuthenticated btce;
  protected final ParamsDigest signatureCreator;

  /**
   * Constructor
   *
   * @param exchange
   */
  public WexBaseService(Exchange exchange) {

    super(exchange);

    this.btce =
        RestProxyFactory.createProxy(
            WexAuthenticated.class,
            exchange.getExchangeSpecification().getSslUri(),
            getClientConfig());
    this.apiKey = exchange.getExchangeSpecification().getApiKey();
    this.signatureCreator =
        WexHmacPostBodyDigest.createInstance(exchange.getExchangeSpecification().getSecretKey());
  }

  protected void checkResult(WexReturn<?> result) {
    String error = result.getError();

    if (!result.isSuccess()) {
      if (error != null) {
        if (error.startsWith(ERR_MSG_NONCE)) {
          throw new NonceException(error);
        } else if (error.startsWith(ERR_MSG_FUNDS)) {
          throw new FundsExceededException(error);
        } else if (error.equals("no transactions")) {
          return; // this isn't an error - just an indicator that there's no data
        }
      }
      throw new ExchangeException(error);
    } else if (result.getReturnValue() == null) {
      throw new ExchangeException("Didn't receive any return value. Message: " + error);
    } else if (error != null) {
      throw new ExchangeException(error);
    }
  }
}


text:
set -ex

arrow_dir=${1}
source_dir=${1}/rust

export ARROW_TEST_DATA=${arrow_dir}/testing/data
export PARQUET_TEST_DATA=${arrow_dir}/cpp/submodules/parquet-testing/data

pushd ${source_dir}

# run unit tests
cargo test
# run unit tests with SIMD on
pushd arrow
cargo test --features "simd"
popd

# test arrow examples
pushd arrow
cargo run --example builders
cargo run --example dynamic_types
cargo run --example read_csv
cargo run --example read_csv_infer_schema
popd

# test datafusion examples
pushd datafusion
cargo run --example csv_sql
cargo run --example parquet_sql
popd

popd


text:
using System;
using System.Collections.Generic;
using Gtk;
using Moscrif.IDE.Workspace;
using Moscrif.IDE.Devices;
using Moscrif.IDE.Iface.Entities;

namespace Moscrif.IDE.Option
{
	public partial class PreferencesDialog : Gtk.Dialog
	{
		protected TreeStore store;
		Dictionary<int, SettingPanel> pages = new Dictionary<int, SettingPanel>();
		List<SettingPanel> list;
		private TypPreferences typPreferences;
		private object inicialize = null;

		public PreferencesDialog(TypPreferences typ,object inicialize,string title)
		{
			this.Build();

			this.TransientFor = MainClass.MainWindow;
			this.Title = title;

			this.inicialize = inicialize;
			typPreferences = typ;

			GenerateTree();
		}

		public PreferencesDialog(TypPreferences typ,string title)
		{
			this.Build();

			this.TransientFor = MainClass.MainWindow;
			this.Title = title;

			this.inicialize = null;
			typPreferences = typ;

			GenerateTree();
		}

		private void GenerateTree()
		{
			store = new TreeStore(typeof(SettingPanel), typeof(string), typeof(string), typeof(bool),  typeof(bool), typeof(int));

			tvCategory.Model = store;
			tvCategory.HeadersVisible = false;

			TreeViewColumn col = new TreeViewColumn();
			CellRendererPixbuf crp = new CellRendererPixbuf();
			crp.StockSize = (uint)IconSize.LargeToolbar;
			col.PackStart(crp, false);
			col.AddAttribute(crp, "stock-id", 1);
			col.AddAttribute(crp, "visible", 3);
			col.AddAttribute(crp, "sensitive", 4);
			CellRendererText crt = new CellRendererText();
			col.PackStart(crt, true);
			col.AddAttribute(crt, "markup", 2);
			col.AddAttribute(crt, "sensitive", 4);

			tvCategory.AppendColumn(col);

			tvCategory.Selection.Changed += OnSelectionChanged;
			FillTree();

			TreeIter it;
			if (store.GetIterFirst(out it))
				tvCategory.Selection.SelectIter(it);

		}

		public void FillTree()
		{
			list = new List<SettingPanel>();
			store.Clear();

			switch (typPreferences) {
			case TypPreferences.GlobalSetting:
				{
					list = GetGlobalSettingPages();
					break;
				}

			case TypPreferences.ProjectSetting:
				{
					list = GetProjectSettingPages();
					break;
				}
			case TypPreferences.FileSetting:
				{
					list = GetFileSettingPages();
					break;
				}
			case TypPreferences.DirectorySetting:
				{
					list = GetDirSettingPages();
					break;
				}

			default:
				break;
			}

			int i = 0;
			foreach (SettingPanel section in list) {
				AddSection(section, i);
				i++;
			}
		}

		protected TreeIter AddSection(SettingPanel section, int indx)
		{
			return AddSection(TreeIter.Zero, section, indx);
		}

		protected TreeIter AddSection(TreeIter parentIter, SettingPanel section, int indx)
		{
			TreeIter it;
			string sectionLabel;
			if (section.Active)
				sectionLabel = "" + GLib.Markup.EscapeText(section.Panel.Label) + "";
			else {
				sectionLabel = "" + GLib.Markup.EscapeText(section.Panel.Label) + "";

			}
			it = store.AppendValues(section, section.Panel.Icon, sectionLabel, true, section.Active, indx);
			pages.Add(indx, section);

			return it;
		}

		void OnSelectionChanged(object s, EventArgs a)
		{
			TreeIter it;
			if (tvCategory.Selection.GetSelected(out it)) {
				SettingPanel section = (SettingPanel)store.GetValue(it, 0);
				int indx = (int)store.GetValue(it, 5);
				//bool active = (bool)store.GetValue(it, 3);
				ShowPage(section, indx);
			}
		}

		public void ShowPage(SettingPanel section, int indx)
		{
			if (section == null)
				return;

			SettingPanel sp;

			if (!pages.TryGetValue(indx, out sp))
				return;

			foreach (Gtk.Widget w in pageFrame.Children) {
				Container cc = w as Gtk.Container;
				if (cc != null)
					foreach (Gtk.Widget cw in cc)
						cw.Hide();
				pageFrame.Remove(w);
			}

			labelTitle.Markup = "" + GLib.Markup.EscapeText(section.Panel.Label) + "";
			pageFrame.PackStart(sp.Widget, true, true, 0);
			if(!sp.Active)
				sp.Widget.Sensitive = false;

			sp.Panel.ShowPanel();
			sp.Widget.ShowAll();
		}

		private List<SettingPanel> GetProjectSettingPages()
		{
			List<SettingPanel> list = new List<SettingPanel>();

			SettingPanel projectGlobal = new SettingPanel();
			projectGlobal.Panel = new GeneralPanel();
			if (this.inicialize != null)
				projectGlobal.Panel.Initialize(this, inicialize);
			projectGlobal.Widget = projectGlobal.Panel.CreatePanelWidget();
			list.Add(projectGlobal);

			SettingPanel applicationGlobal = new SettingPanel();
			applicationGlobal.Panel = new ApplicationPanel();
			if (this.inicialize != null)
				applicationGlobal.Panel.Initialize(this, inicialize);
			applicationGlobal.Widget = applicationGlobal.Panel.CreatePanelWidget();
			list.Add(applicationGlobal);

			SettingPanel conditionPanel = new SettingPanel();
			conditionPanel.Panel = new ProjectConditionsPanel();
			if (this.inicialize != null)
				conditionPanel.Panel.Initialize(this, inicialize);
			conditionPanel.Widget = conditionPanel.Panel.CreatePanelWidget();
			list.Add(conditionPanel);

			foreach (Rule rl in MainClass.Settings.Platform.Rules){

				if( (rl.Tag == -1 ) && !MainClass.Settings.ShowUnsupportedDevices) continue;
				if( (rl.Tag == -2 ) && !MainClass.Settings.ShowDebugDevices) continue;
				if (inicialize.GetType() == typeof(Project)) {
					Project project = (Project)inicialize;
					Device dvc = project.DevicesSettings.Find(x => x.TargetPlatformId == rl.Id);
					if (dvc == null) {
						Console.WriteLine("generate device -{0}",rl.Id);
						dvc = new Device();
						dvc.TargetPlatformId = rl.Id;
						project.DevicesSettings.Add(dvc);
					}

					DevicePropertyData dpd = new DevicePropertyData();
					dpd.Project = (Project)inicialize;
					dpd.Device = dvc;

					SettingPanel sp = new SettingPanel();
					sp.Panel = new DevicePanel();
					if (this.inicialize != null)
						sp.Panel.Initialize(this, dpd);
					sp.Widget = sp.Panel.CreatePanelWidget();

					//string dirPublish = MainClass.Tools.GetPublishDirectory(rl.Specific);

					/*if(!Device.CheckDevice(rl.Specific)) {
						sp.Active = false;
					}*/

					list.Add(sp);
				}
			}

			return list;
		}

		private List<SettingPanel> GetFileSettingPages()
		{
			List<SettingPanel> list = new List<SettingPanel>();

			SettingPanel fileGlobal = new SettingPanel();
			fileGlobal.Panel = new FileGeneralPanel();
			if (this.inicialize != null)
				fileGlobal.Panel.Initialize(this, inicialize);
			fileGlobal.Widget = fileGlobal.Panel.CreatePanelWidget();
			list.Add(fileGlobal);

			SettingPanel conditionPanel = new SettingPanel();
			conditionPanel.Panel = new FileConditionsPanel();
			if (this.inicialize != null)
				conditionPanel.Panel.Initialize(this, inicialize);
			conditionPanel.Widget = conditionPanel.Panel.CreatePanelWidget();
			list.Add(conditionPanel);

			return list;
		}

		private List<SettingPanel> GetDirSettingPages()
		{
			List<SettingPanel> list = new List<SettingPanel>();

			SettingPanel dirGlobal = new SettingPanel();
			dirGlobal.Panel = new DirGeneralPanel();
			if (this.inicialize != null)
				dirGlobal.Panel.Initialize(this, inicialize);
			dirGlobal.Widget = dirGlobal.Panel.CreatePanelWidget();
			list.Add(dirGlobal);

			SettingPanel conditionPanel = new SettingPanel();
			conditionPanel.Panel = new DirConditionsPanel();
			if (this.inicialize != null)
				conditionPanel.Panel.Initialize(this, inicialize);
			conditionPanel.Widget = conditionPanel.Panel.CreatePanelWidget();
			list.Add(conditionPanel);

			return list;
		}

		private List<SettingPanel> GetGlobalSettingPages()
		{
			List<SettingPanel> list = new List<SettingPanel>();

			SettingPanel item = new SettingPanel();
			item.Panel = new GlobalOptionsPanel();
			item.Panel.Initialize(this, null);
			item.Widget = item.Panel.CreatePanelWidget();
			list.Add(item);

			SettingPanel compilePanel = new SettingPanel();
			compilePanel.Panel = new CompilePanel();
			compilePanel.Widget = compilePanel.Panel.CreatePanelWidget();
			list.Add(compilePanel);

			SettingPanel resolution = new SettingPanel();
			resolution.Panel = new ResolutionOptionsPanel();
			resolution.Panel.Initialize(this, null);
			resolution.Widget = resolution.Panel.CreatePanelWidget();
			list.Add(resolution);

			SettingPanel emulator = new SettingPanel();
			emulator.Panel = new EmulatorOptionsPanel();
			emulator.Panel.Initialize(this, null);
			emulator.Widget = emulator.Panel.CreatePanelWidget();
			list.Add(emulator);

			SettingPanel textEditor = new SettingPanel();
			textEditor.Panel = new TextEditorPanel();
			textEditor.Widget = textEditor.Panel.CreatePanelWidget();
			list.Add(textEditor);

			SettingPanel imageEditorSetting = new SettingPanel();
			imageEditorSetting.Panel = new ImageEditorPanel();
			imageEditorSetting.Widget = imageEditorSetting.Panel.CreatePanelWidget();
			list.Add(imageEditorSetting);

			SettingPanel keybind = new SettingPanel();
			keybind.Panel = new KeyBindingPanel();
			keybind.Panel.Initialize(this, null);
			keybind.Widget = keybind.Panel.CreatePanelWidget();
			list.Add(keybind);

			SettingPanel filtering = new SettingPanel();
			filtering.Panel = new FilteringPanel();
			filtering.Panel.Initialize(this, null);
			filtering.Widget = filtering.Panel.CreatePanelWidget();
			list.Add(filtering);

			SettingPanel proxyPannel = new SettingPanel();
			proxyPannel.Panel = new ProxyPanel();
			proxyPannel.Panel.Initialize(this, null);
			proxyPannel.Widget = proxyPannel.Panel.CreatePanelWidget();
			list.Add(proxyPannel);

			SettingPanel editorEditor = new SettingPanel();
			editorEditor.Panel = new EditorPanel();
			editorEditor.Widget = editorEditor.Panel.CreatePanelWidget();
			list.Add(editorEditor);

			return list;
		}

		protected virtual void OnButtonOkClicked(object sender, System.EventArgs e)
		{
			if (!ValidateChanges())
				return;

			ApplyChanges();
			this.Respond(ResponseType.Ok);
		}

		protected virtual bool ValidateChanges()
		{
			foreach (SettingPanel sp in pages.Values) {
				if (sp.Panel == null)
					continue;
				if (!sp.Panel.ValidateChanges())
					return false;
				// Not valid
			}
			return true;
		}

		protected virtual void ApplyChanges()
		{
			foreach (SettingPanel sp in pages.Values) {
				if (sp.Panel == null)
					continue;
				sp.Panel.ApplyChanges();
			}
		}
		/*	protected virtual void AddChildSections (TreeIter parentIter, SectionPage section, object dataObject)
		{
			foreach (ExtensionNode nod in section.ChildNodes) {
				if (nod is OptionsDialogSection)
					AddSection (parentIter, (OptionsDialogSection) nod, dataObject);
			}
		}
			*/

		void DetachWidgets()
		{
			foreach (Gtk.Widget w in pageFrame.Children)
				pageFrame.Remove(w);

			foreach (SettingPanel sp in pages.Values)
				if (sp.Widget != null) {
					sp.Widget.Destroy();
					sp.Widget = null;
				}
		}

		protected override void OnResponse(ResponseType resp)
		{
			base.OnResponse(resp);
			DetachWidgets();
		}

		protected void OnResizeChecked (object sender, System.EventArgs e)
		{
			buttonOk.Show();
			buttonCancel.Show();
		}
	}

	public enum TypPreferences
	{
		GlobalSetting,
		WorkspaceSetting,
		ProjectSetting,
		FileSetting,
		DirectorySetting
	}

	public class SettingPanel
	{
		public IOptionsPanel Panel;
		public Gtk.Widget Widget;
		public bool Active =true;
		//public string Label;
	}

}


text:
@extends('_visitor.layouts.visitor')
@section('title')
    @parent
    :: {{$sectionName}} - {{$actionName}}
@endsection
@section('content')

{{$sectionName}}

               {{Lang::get('common/button.suppliers_deliveries')}}

    @include('breadcrumbs',['data' => $breadcrumbs])

                    {{$sectionName}} - {{$actionName}}

                        {{HTML::DatatableFilter()}}

                                {{Lang::get('common/general.created')}}
                                {{Lang::get('common/general.name')}}
                                {{Lang::get('common/general.city')}}
                                {{Lang::get('common/general.details')}}

@endsection
@section('js')
    {{ Basset::show('package_datatables.js') }}
@endsection
@section('css')
    {{ Basset::show('package_datatables.css') }}
@endsection


text:
//
//  GameStateException.hpp
//  ShooterInhertiance
//
//  Created by Marco Gillies on 15/03/2016.
//
//

#ifndef GameStateException_hpp
#define GameStateException_hpp

#include <stdio.h>
#include <string>

class GameStateException
{
    std::string message;
public:
    GameStateException(std::string m);

    std::string getMessage() const {
        return message;
    }
};

#endif /* GameStateException_hpp */


text:
<?php

return [

	/*
	|--------------------------------------------------------------------------
	| Default Filesystem Disk
	|--------------------------------------------------------------------------
	|
	| Here you may specify the default filesystem disk that should be used
	| by the framework. A "local" driver, as well as a variety of cloud
	| based drivers are available for your choosing. Just store away!
	|
	| Supported: "local", "s3", "rackspace", "dropbox"
	|
	*/

	'default' => env('FILESYSTEM_DEFAULT', 'local'),

	/*
	|--------------------------------------------------------------------------
	| Default Cloud Filesystem Disk
	|--------------------------------------------------------------------------
	|
	| Many applications store files both locally and in the cloud. For this
	| reason, you may specify a default "cloud" driver here. This driver
	| will be bound as the Cloud disk implementation in the container.
	|
	*/

	'cloud' => 's3',

	/*
	|--------------------------------------------------------------------------
	| Filesystem Disks
	|--------------------------------------------------------------------------
	|
	| Here you may configure as many filesystem "disks" as you wish, and you
	| may even configure multiple disks of the same driver. Defaults have
	| been setup for each driver as an example of the required options.
	|
	*/

	'disks' => [

		'local' => [
			'driver' => 'local',
			'root'   => str_replace('application', '', base_path()),
		],

		's3' => [
			'driver' => 's3',
			'key'    => env('S3_KEY', 'your-key'),
			'secret' => env('S3_SECRET', 'your-secret'),
			'region' => env('S3_REGION', 'your-region'),
			'bucket' => env('S3_BUCKET', 'your-bucket'),
		],

		'rackspace' => [
			'driver'    => 'rackspace',
			'username'  => env('RACKSPACE_USERNAME', 'your-username'),
			'key'       => env('RACKSPACE_KEY', 'your-key'),
			'container' => env('RACKSPACE_CONTAINER', 'your-container'),
			'endpoint'  => 'https://identity.api.rackspacecloud.com/v2.0/',
			'region'    => env('RACKSPACE_REGION', 'IAD'),
			'url_type'  => 'publicURL'
		],

		'dropbox' => [
            'driver'           => 'dropbox',
			'accessToken'      => env('DROPBOX_ACCESS_TOKEN', 'your-token'),
			'clientIdentifier' => env('DROPBOX_CLIENT_IDENTIFIER', 'your-identifier'),
		]
	],

];