text:
package com.bukhmastov.cdoitmo.model.converter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bukhmastov.cdoitmo.exception.SilentException;
import com.bukhmastov.cdoitmo.firebase.FirebasePerformanceProvider;
import com.bukhmastov.cdoitmo.model.JsonEntity;

public abstract class Converter<IN extends JsonEntity, OUT extends JsonEntity> extends ConverterBase {

    private IN entity;

    public Converter(@NonNull IN entity) {
        super();
        this.entity = entity;
    }

    public @Nullable OUT convert() {
        String trace = firebasePerformanceProvider.startTrace(getTraceName());
        try {
            OUT converted = doConvert(entity);
            firebasePerformanceProvider.putAttribute(trace, "state", "done");
            return converted;
        } catch (SilentException silent) {
            firebasePerformanceProvider.putAttribute(trace, "state", "failed");
            return null;
        } catch (Throwable e) {
            firebasePerformanceProvider.putAttribute(trace, "state", "failed");
            firebasePerformanceProvider.putAttribute(trace, "exception", e.getMessage());
            log.get().exception("Failed to convert entity", e);
            return null;
        } finally {
            firebasePerformanceProvider.stopTrace(trace);
        }
    }

    protected abstract OUT doConvert(IN entity) throws Throwable;

    protected abstract @FirebasePerformanceProvider.TRACE String getTraceName();
}


text:
simpleapikeyengine
=====================

Simple API Key Engine.

redpajama_set_name: RedPajamaGithub


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

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Uses of Class org.apache.solr.client.solrj.request.UpdateRequest (Solr 5.3.0 API)</title>
<meta name="date" content="2015-08-17">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
org.apache.solr.client.solrj.request.UpdateRequest

Packages that use UpdateRequest

Package
Description

org.apache.solr.client.solrj.impl

Concrete implementations of client API classes.

org.apache.solr.client.solrj.request

Convenience classes for dealing with various types of Solr requests.

Uses of UpdateRequest in org.apache.solr.client.solrj.impl

Methods in org.apache.solr.client.solrj.impl with parameters of type UpdateRequest

Modifier and Type
Method and Description

ContentStream
BinaryRequestWriter.getContentStream(UpdateRequest request)

Uses of UpdateRequest in org.apache.solr.client.solrj.request

Methods in org.apache.solr.client.solrj.request that return UpdateRequest

Modifier and Type
Method and Description

UpdateRequest
UpdateRequest.add(Collection<SolrInputDocument> docs)

UpdateRequest
UpdateRequest.add(SolrInputDocument doc)

UpdateRequest
UpdateRequest.add(SolrInputDocument doc,
   Boolean overwrite)

UpdateRequest
UpdateRequest.add(SolrInputDocument doc,
   Integer commitWithin)

UpdateRequest
UpdateRequest.add(SolrInputDocument doc,
   Integer commitWithin,
   Boolean overwrite)

UpdateRequest
UpdateRequest.deleteById(List<String> ids)

UpdateRequest
UpdateRequest.deleteById(String id)

UpdateRequest
UpdateRequest.deleteById(String id,
          Long version)

UpdateRequest
UpdateRequest.deleteById(String id,
          String route)

UpdateRequest
UpdateRequest.deleteById(String id,
          String route,
          Long version)

UpdateRequest
UpdateRequest.deleteByQuery(String q)

UpdateRequest
JavaBinUpdateRequestCodec.unmarshal(InputStream is,
         JavaBinUpdateRequestCodec.StreamingUpdateHandler handler)

Reads a NamedList from the given InputStream, converts it into a SolrInputDocument and passes it to the given
 StreamingUpdateHandler

Methods in org.apache.solr.client.solrj.request with parameters of type UpdateRequest

Modifier and Type
Method and Description

ContentStream
RequestWriter.getContentStream(UpdateRequest req)

void
JavaBinUpdateRequestCodec.marshal(UpdateRequest updateRequest,
       OutputStream os)

Converts an UpdateRequest to a NamedList which can be serialized to the given OutputStream in the javabin format

void
JavaBinUpdateRequestCodec.StreamingUpdateHandler.update(SolrInputDocument document,
      UpdateRequest req,
      Integer commitWithin,
      Boolean override)

Constructors in org.apache.solr.client.solrj.request with parameters of type UpdateRequest

Constructor and Description

RequestWriter.LazyContentStream(UpdateRequest req)

Overview

Package

Class

Use

Tree

Deprecated

Help

Prev

Next

Frames

No Frames

All Classes

          Copyright © 2000-2015 Apache Software Foundation.  All Rights Reserved.


text:
import * as events from 'events';

interface Security {
}

export interface SoapMethod {
    (args: any, callback: (err: any, result: any) => void, options?: any, extraHeaders?: any): void;
}

export class BasicAuthSecurity implements Security {
    constructor(username: string, password: string);
}

export class BearerSecurity implements Security {
    constructor(token: string);
}

export class WSSecurity implements Security {
    constructor(username: string, password: string, options?: any);
}

export class ClientSSLSecurity implements Security {
    constructor(key: Buffer | string, cert: Buffer | string, ca: Buffer | string, defaults?: any);
    constructor(key: Buffer | string, cert: Buffer | string, defaults?: any);
}

export interface Client extends events.EventEmitter {
    addBodyAttribute(bodyAttribute: any, name?: string, namespace?: string, xmlns?: string): void;
    addHttpHeader(name: string, value: any): void;
    addSoapHeader(soapHeader: any, name?: string, namespace?: string, xmlns?: string): number;
    changeSoapHeader(index: number, soapHeader: any, name?: string, namespace?: string, xmlns?: string): void;
    clearBodyAttributes(): void;
    clearHttpHeaders(): void;
    clearSoapHeaders(): void;
    describe(): any;
    getBodyAttributes(): any[];
    getHttpHeaders(): any[];
    getSoapHeaders(): any[];
    setEndpoint(endpoint: string): void;
    setSOAPAction(action: string): void;
    setSecurity(s: Security): void;
    [method: string]: SoapMethod | Function;
}

export interface Server extends events.EventEmitter {
    addSoapHeader(soapHeader: any, name: any, namespace: any, xmlns: any): any;
    changeSoapHeader(index: any, soapHeader: any, name: any, namespace: any, xmlns: any): any;
    getSoapHeaders(): any;
    clearSoapHeaders(): any;
    log(type: any, data: any): any;
}
export function listen(server: any, path: string, service: any, wsdl: string): Server;
declare function createClient(wsdlPath: string, options: Option, fn: (err: any, client: Client) => void): void;

export interface Option {
    attributesKey?: string;
    disableCache?: boolean;
    endpoint?: string;
    envelopeKey?: string;
    escapeXML?: boolean;
    forceSoap12Headers?: boolean;
    httpClient?: HttpClient;
    ignoreBaseNameSpaces?: boolean,
    ignoredNamespaces?: string[] | { namespaces: string[], override: boolean };
    overrideRootElement?: { namespace: string, xmlnsAttributes?: string[] };
    request?: (options: any, callback?: (error: any, res: any, body: any) => void) => void;
    stream?: boolean;
    valueKey?: string;
    wsdl_headers?: { [key: string]: any };
    wsdl_options?: { [key: string]: any };
    xmlKey?: string;
}

export class HttpClient {
    constructor(options?: Option);
    buildRequest(rurl: string, data: any | string, exheaders?: { [key: string]: any }, exoptions?: { [key: string]: any }): any;
    handleResponse(req: any, res: any, body: any | string): any | string;
    request(rurl: string, data: any | string, callback: (err: any, res: any, body: any | string) => void, exheaders?: { [key: string]: any }, exoptions?: { [key: string]: any }): any;
    requestStream(rurl: string, data: any | string, exheaders?: { [key: string]: any }, exoptions?: { [key: string]: any }): any;
}


text:
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using MonoGame.Extended;
using MonoGame.Extended.BitmapFonts;
using MonoGame.Extended.Graphics;
using MonoGame.Extended.Graphics.Effects;

namespace Demo.Features.Demos
{
    public struct SpriteInfo
    {
        public Vector2 Position;
        public float Rotation;
        public Color Color;
        public Texture2D Texture;
        public Matrix2D TransformMatrix;
    }

    public class BatchingDemo : DemoBase
    {
        public override string Name => "Batching";

        private Batcher2D _batcher;
        private SpriteBatch _spriteBatch;
        private BitmapFont _bitmapFont;
        private Texture2D _spriteTexture1;
        private Texture2D _spriteTexture2;
        private Vector2 _spriteOrigin;
        private Vector2 _spriteScale;
        private DefaultEffect _effect;

        private readonly Random _random = new Random();
        private readonly SpriteInfo[] _sprites = new SpriteInfo[2048];
        private Matrix _worldMatrix;
        private Matrix _viewMatrix;
        private Matrix _projectionMatrix;

        public BatchingDemo(GameMain game) : base(game)
        {
            // disable fixed time step so max frames can be measured otherwise the update & draw frames would be capped to the default 60 fps timestep
            //game.IsFixedTimeStep = false;

            //_graphicsDeviceManager = new GraphicsDeviceManager(this)
            //{
            //    // also disable v-sync so max frames can be measured otherwise draw frames would be capped to the screen's refresh rate
            //    SynchronizeWithVerticalRetrace = false,
            //    PreferredBackBufferWidth = 800,
            //    PreferredBackBufferHeight = 600
            //};
        }

        protected override void LoadContent()
        {
            var graphicsDevice = GraphicsDevice;

            _effect = new DefaultEffect(graphicsDevice)
            {
                TextureEnabled = true,
                VertexColorEnabled = true
            };
            _batcher = new Batcher2D(graphicsDevice);
            _spriteBatch = new SpriteBatch(graphicsDevice);
            _bitmapFont = Content.Load<BitmapFont>("Fonts/montserrat-32");

            // load the texture for the sprites
            _spriteTexture1 = Content.Load<Texture2D>("Textures/logo-square-128");
            _spriteTexture2 = Content.Load<Texture2D>("Textures/logo-square-512");
            _spriteOrigin = new Vector2(_spriteTexture1.Width * 0.5f, _spriteTexture1.Height * 0.5f);
            _spriteScale = new Vector2(0.5f);

            var viewport = GraphicsDevice.Viewport;

            // ReSharper disable once ForCanBeConvertedToForeach
            for (var index = 0; index < _sprites.Length; index++)
            {
                var sprite = _sprites[index];
                sprite.Position = new Vector2(_random.Next(viewport.X, viewport.Width),
                    _random.Next(viewport.Y, viewport.Height));
                sprite.Rotation = MathHelper.ToRadians(_random.Next(0, 360));
                sprite.Texture = index % 2 == 0 ? _spriteTexture1 : _spriteTexture2;
                _sprites[index] = sprite;
            }
        }

        protected override void Update(GameTime gameTime)
        {
            var keyboard = Keyboard.GetState();
            var gamePadState = GamePad.GetState(PlayerIndex.One);

            if (gamePadState.Buttons.Back == ButtonState.Pressed || keyboard.IsKeyDown(Keys.Escape))
                Exit();

            // ReSharper disable once ForCanBeConvertedToForeach
            for (var index = 0; index < _sprites.Length; index++)
            {
                var sprite = _sprites[index];

                if (index % 2 == 0)
                    sprite.Rotation = (sprite.Rotation + MathHelper.ToRadians(0.5f)) % MathHelper.TwoPi;
                else
                    sprite.Rotation = (sprite.Rotation - MathHelper.ToRadians(0.5f) + MathHelper.TwoPi) % MathHelper.TwoPi;

                sprite.Color = ColorHelper.FromHsl(sprite.Rotation / MathHelper.TwoPi, 0.5f, 0.3f);

                sprite.TransformMatrix = Matrix2D.CreateFrom(sprite.Position, sprite.Rotation, _spriteScale, _spriteOrigin);

                _sprites[index] = sprite;
            }

            base.Update(gameTime);
        }

        protected override void Draw(GameTime gameTime)
        {
            var graphicsDevice = GraphicsDevice;

            graphicsDevice.Clear(Color.CornflowerBlue);

            // update the matrices
            _worldMatrix = Matrix.Identity;
            _viewMatrix = _effect.View = Matrix.Identity;
            _projectionMatrix = _effect.Projection = Matrix.CreateOrthographicOffCenter(0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height, 0, 0, -1);

            // comment and uncomment either of the two below lines to compare

            DrawSpritesWithBatcher2D();
            //DrawSpritesWithSpriteBatch();

            base.Draw(gameTime);
        }

        private void DrawSpritesWithBatcher2D()
        {
            _batcher.Begin(_viewMatrix, _projectionMatrix, effect: _effect);

            // ReSharper disable once ForCanBeConvertedToForeach
            for (var index = 0; index < _sprites.Length; index++)
            {
                var sprite = _sprites[index];
                _batcher.DrawTexture(sprite.Texture, ref sprite.TransformMatrix, sprite.Color);
            }

            _batcher.End();
        }

        private void DrawSpritesWithSpriteBatch()
        {
            _effect.Projection = _projectionMatrix;
            _effect.View = _viewMatrix;
            _spriteBatch.Begin(SpriteSortMode.Texture, effect: _effect);

            // ReSharper disable once ForCanBeConvertedToForeach
            for (var index = 0; index < _sprites.Length; index++)
            {
                var sprite = _sprites[index];
                _spriteBatch.Draw(sprite.Texture, sprite.Position, null, sprite.Color, sprite.Rotation, _spriteOrigin, _spriteScale, SpriteEffects.None, 0);
            }

            _spriteBatch.End();
        }
    }
}


text:
Monika Henzinger Homepage
Monika Rauch Henzinger
Assistant Professor
Computer Science Department
Cornell University
Ithaca, NY 14853

Email: mhr@cs.cornell.edu
Phone: (607) 255-1068
Fax: (607) 255-4428

Currently on leave at:
Digital Equipment Corporation Systems Research Center
Homepage

Research Interests
Combinatorial and Graph Algorithms,
especially Dynamic Graph Algorithms and Randomized Data Structures; Graph Theory;
Data Structures; Lower Bounds.

13~

 Recent Publications

 Dynamic Graph Algorithms Project Page

Program Committees:  STOC'96 ,
 SODA'97

 Homepage of CS 681 (Fall 95)


text:
<?php
declare(strict_types=1);

namespace TestPlugin\Model\Table;

use Cake\ORM\Table;

/**
 * AuthorsTable
 */
class AuthorsTable extends Table
{
}


text:
/* eslint no-unused-expressions:0 */

import { createElement } from 'react';
import ReactDOM from 'react-dom';
import sinon from 'sinon';

import Checkbox from './index';
import { $, conformanceChecker } from '../boundless-utils-test-helpers/index';

describe('Checkbox component', () => {
    const mountNode = document.body.appendChild(document.createElement('div'));
    const render = (vdom) => ReactDOM.render(vdom, mountNode);

    const sandbox = sinon.sandbox.create();
    const props = {
        inputProps: {
            checked: false,
            name: 'foo',
            value: 'bar',
        },
    };

    afterEach(() => {
        ReactDOM.unmountComponentAtNode(mountNode);
        sandbox.restore();
    });

    it('conforms to the Boundless prop interface standards', () => conformanceChecker(render, Checkbox, props));

    it('allows the wrapper component to be overridden with an html tagname', () => {
        render(<Checkbox {...props} component='section' />);
        expect($('section.b-checkbox-wrapper')).not.toBeNull();
    });

    it('defaults to being unchecked', () => {
        const element = render(<Checkbox {...props} />);
        const node = element.refs.input;

        expect(node.getAttribute('aria-checked')).toBe('false');
        expect(node.hasAttribute('checked')).toBe(false);
    });

    it('accepts arbitrary React-supported HTML attributes via the `inputProps` prop', () => {
        const element = render(<Checkbox {...props} inputProps={{ ...props.inputProps, 'data-id': 'foo' }} />);
        const node = element.refs.input;

        expect(node.getAttribute('data-id')).toBe('foo');
    });

    it('accepts arbitrary React-supported HTML attributes via the `labelProps` prop', () => {
        const element = render(<Checkbox {...props} labelProps={{ 'data-id': 'foo' }} label='foo' />);
        const node = element.refs.label;

        expect(node.getAttribute('data-id')).toBe('foo');
    });

    it('accepts a string label', () => {
        const element = render(<Checkbox {...props} label='foo' />);

        expect(element.refs.label.textContent).toBe('foo');
    });

    it('accepts an element label', () => {
        const element = render(<Checkbox {...props} label={
foo
} />);

        expect(element.refs.label.textContent).toBe('foo');
    });

    it('renders .b-checkbox-wrapper', () => {
        const element = render(<Checkbox {...props} />);

        expect(element.refs.wrapper.classList.contains('b-checkbox-wrapper')).toBe(true);
    });

    it('renders .b-checkbox-label', () => {
        const element = render(<Checkbox {...props} label='foo' />);

        expect(element.refs.label.classList.contains('b-checkbox-label')).toBe(true);
    });

    it('renders .b-checkbox', () => {
        const element = render(<Checkbox {...props} />);

        expect(element.refs.input.classList.contains('b-checkbox')).toBe(true);
    });

    it('renders .b-checkbox-checked when the checkbox value is truthy', () => {
        const element = render(<Checkbox {...props} inputProps={{ ...props.inputProps, checked: true }} />);

        expect(element.refs.input.classList.contains('b-checkbox-checked')).toBe(true);
    });

    it('renders .b-checkbox-unchecked when the checkbox value is falsy', () => {
        const element = render(<Checkbox {...props} />);

        expect(element.refs.input.classList.contains('b-checkbox-unchecked')).toBe(true);
    });

    it('renders .b-checkbox-mixed when the checkbox is indeterminate', () => {
        const element = render(<Checkbox {...props} inputProps={{ ...props.inputProps, checked: true, indeterminate: true }} />);

        expect(element.refs.input.classList.contains('b-checkbox-mixed')).toBe(true);
    });

    it('associates a provided label with the underlying input', () => {
        const element = render(<Checkbox {...props} label='foo' />);

        expect(element.refs.label.htmlFor).not.toBe('');
        expect(element.refs.label.htmlFor).toEqual(element.refs.input.id);
    });

    describe('checkbox state change', () => {
        it('triggers onChecked when the checkbox value becomes truthy', () => {
            const stub = sandbox.stub();
            const element = render(<Checkbox {...props} onChecked={stub} />);

            element.handleChange();

            expect(stub.calledOnce).toBe(true);
        });

        it('triggers onUnchecked when the checkbox value becomes falsy', () => {
            const stub = sandbox.stub();
            const element = render(<Checkbox {...props} inputProps={{ ...props.inputProps, checked: true }} onUnchecked={stub} />);

            element.handleChange();

            expect(stub.calledOnce).toBe(true);
        });
    });

    describe('clicking on the wrapper', () => {
        it('moves focus to the input', () => {
            const element = render(<Checkbox {...props} />);

            expect(document.activeElement).not.toBe(element.refs.input);

            element.handleClick({});
            expect(document.activeElement).toBe(element.refs.input);
        }); // patching a browser inconsistency between webkit & gecko

        it('does nothing if the input is disabled', () => {
            const stub = sandbox.stub();

            render(<Checkbox {...props} inputProps={{ ...props.inputProps, disabled: true }} onClick={stub} />);
            expect(stub.called).toBe(false);
        });
    });

    describe('indeterminate state', () => {
        it('is programmatically set on the underlying input', () => {
            const element = render(<Checkbox {...props} inputProps={{ ...props.inputProps, indeterminate: true }} />);

            expect(element.refs.input.indeterminate).toBe(true);
        });

        it('is kept in sync when the prop changes', () => {
            let element;

            element = render(<Checkbox {...props} inputProps={{ ...props.inputProps, indeterminate: false }} />);
            expect(element.refs.input.indeterminate).toBeFalsy();

            element = render(<Checkbox {...props} inputProps={{ ...props.inputProps, indeterminate: true }} />);
            expect(element.refs.input.indeterminate).toBeTruthy();
        });
    });

    describe('proxied events', () => {
        it('forwards input change events if `props.inputProps.onChange` is provided', () => {
            const stub = sandbox.stub();
            const element = render(<Checkbox {...props} inputProps={{ ...props.inputProps, onChange: stub }} />);

            element.handleChange({ checked: true });

            expect(stub.calledOnce).toBe(true);
        });

        it('does not forward input change events if the input is disabled', () => {
            const stub = sandbox.stub();
            const element = render(<Checkbox {...props} inputProps={{ ...props.inputProps, onChange: stub, disabled: true }} />);

            element.handleChange({ checked: true });

            expect(stub.called).toBe(false);
        });

        it('forwards input click events if `props.inputProps.onClick` is provided', () => {
            const stub = sandbox.stub();
            const element = render(<Checkbox {...props} inputProps={{ ...props.inputProps, onClick: stub }} />);

            element.handleClick({});

            expect(stub.calledOnce).toBe(true);
        });

        it('does not forward input click events if the input is disabled', () => {
            const stub = sandbox.stub();
            const element = render(<Checkbox {...props} inputProps={{ ...props.inputProps, onClick: stub, disabled: true }} />);

            element.handleClick({});

            expect(stub.called).toBe(false);
        });
    });
});


text:
namespace DiscUtils.Btrfs.Base.Items
{
    /// <summary>
    /// Maps logical address to physical
    /// </summary>
    internal class XattrItem : DirItem
    {
        public XattrItem(Key key) : base(key) {}
    }
}


text:
package com.robotca.ControlApp.Fragments;

/**
 * Fragment containing the ServoView.
 *
 * Created by Zhipeng Dong on 10/30/16.
 */

import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.robotca.ControlApp.Core.ControlMode;
import com.robotca.ControlApp.R;
import com.robotca.ControlApp.Views.ServoView;

public class ServoFragment extends Fragment {
    private ServoView virtualJoystick;
    private View view;
    private ControlMode controlMode = ControlMode.Joystick;

    /**
     * Default Constructor.
     */
    public ServoFragment() {
    }

    /**
     * Create this Fragments View.
     */
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        // Inflate the view if needed
        if (view == null) {
            view = inflater.inflate(R.layout.fragment_servo_view, container, false);

            // Grab the JoystickView and set its topic
            virtualJoystick = (ServoView) view.findViewById(R.id.servo_view);
        }

        return view;
    }

    /**
     * Returns the ServoView
     * @return The ServoView
     */
    public ServoView getJoystickView() {
        return virtualJoystick;
    }

    /**
     * Get the currently active ControlMode.
     * @return The current ControlMode
     */
    public ControlMode getControlMode() {
        return controlMode;
    }

    /**
     * Set the ControlMode for controlling the Joystick.
     * @param controlMode The new ControlMode
     */
    public void setControlMode(ControlMode controlMode) {
        this.controlMode = controlMode;
        this.invalidate();
    }

    /**
     * Tests whether the Joystick supports accelerometer control.
     * @return True if the Joystick supports accelerometer control, false otherwise
     */
    @SuppressWarnings("unused") // Maybe later...
    public boolean hasAccelerometer() {
        return virtualJoystick.hasAccelerometer();
    }

    /**
     * Invalidate the Fragment, updating the visibility of the Joystick based on the ControlMode.
     *
     */
    public void invalidate() {

        switch (controlMode) {
            case Joystick:
                show();
                break;

            case Tilt:
                show();
                break;

            default:
                hide();
                break;
        }

        virtualJoystick.setControlMode(controlMode);
        virtualJoystick.controlSchemeChanged();
    }

    /**
     * Stops the ServoFragment.
     */
    public void stop() {
        virtualJoystick.stop();
    }

    /**
     * Shows the ServoFragment.
     */
    public void show(){
        getFragmentManager()
                .beginTransaction()
                .show(this)
                .commit();
    }

    /**
     * Hides the ServoFragment.
     */
    public void hide(){
        getFragmentManager()
                .beginTransaction()
                .hide(this)
                .commit();
    }
}


text:
import pytest
from ConfigParser import ConfigParser

import apiserver.const as C
from datastore.lrucache import LRUCache
from datastore.slabutil import slabutil_make_slab, slabutil_init

_INLINE_SIZE = 256
_LRUSZ = 8
_SLABSZ = 16
_NOSUCHKEY = '__nosuchkey__'
_KEY = '_key'
_NS = 'node'
_NS1 = 'way'

def pytest_funcarg__lrucache(request):
    "Prepare a pre-initialized cache object."
    return LRUCache(_LRUSZ)

def pytest_funcarg__slabutil(request):
    cfg = ConfigParser()
    cfg.add_section(C.DATASTORE)

    for k in [C.CHANGESETS_INLINE_SIZE, C.NODES_INLINE_SIZE,
              C.RELATIONS_INLINE_SIZE, C.WAYS_INLINE_SIZE]:
        cfg.set(C.DATASTORE, k, str(_INLINE_SIZE))

    for k in [C.CHANGESETS_PER_SLAB, C.NODES_PER_SLAB,
              C.RELATIONS_PER_SLAB, C.WAYS_PER_SLAB]:
        cfg.set(C.DATASTORE, k, str(_SLABSZ))

    slabutil_init(cfg)
    return cfg

def test_empty(slabutil):
    "Test the properties of an empty cache object."

    lc = LRUCache(_LRUSZ)
    assert len(lc) == 0
    assert lc.get(_NS, _KEY) is None

def test_get(lrucache, slabutil):
    "Test insert and retrieval of one slab descriptor."

    values = range(_SLABSZ)
    keys = map(str, values)
    slabitems = zip(keys, values)

    slabdesc = slabutil_make_slab(_NS, slabitems)
    lrucache.insert_slab(slabdesc)

    for i in xrange(_SLABSZ):
        st, v = lrucache.get(_NS, str(i))
        assert st
        assert v == values[i]

def test_duplicate_slabdesc(lrucache, slabutil):
    "Test insertion of a duplicate slab descriptor."

    values = range(_SLABSZ)
    keys = map(str, values)
    slabitems = zip(keys, values)
    slabdesc = slabutil_make_slab(_NS, slabitems)

    lrucache.insert_slab(slabdesc)
    with pytest.raises(ValueError):
        lrucache.insert_slab(slabdesc)

def test_duplicate_values(lrucache, slabutil):
    "Test insertion of duplicate values in a namespace."

    values = range(_SLABSZ)
    keys = map(str, values)
    slabitems = zip(keys, values)
    slabdesc = slabutil_make_slab(_NS, slabitems)
    lrucache.insert_slab(slabdesc)

    slabdesc2 = slabutil_make_slab(_NS, slabitems)
    with pytest.raises(ValueError):
        lrucache.insert_slab(slabdesc2)

def test_namespaces(lrucache, slabutil):
    "Test that different namespaces are distinct."
    values = range(_SLABSZ)
    slabdesc1 = slabutil_make_slab(_NS, zip(map(str, values), values))
    lrucache.insert_slab(slabdesc1)

    slabdesc2 = slabutil_make_slab(_NS1, zip(map(str, values),
                                             map(lambda x: x*x, values)))
    lrucache.insert_slab(slabdesc2)

    for i in xrange(_SLABSZ):
        st, v1 = lrucache.get(_NS, str(i))
        assert st
        assert v1 == i
        st, v2 = lrucache.get(_NS1, str(i))
        assert st
        assert v2 == i*i

def test_get_nonexistent(lrucache, slabutil):
    "Test that unknown keys are rejected."
    values = range(_SLABSZ)
    keys = map(str, values)
    slabitems = zip(keys, values)
    slabdesc = slabutil_make_slab(_NS, slabitems)
    lrucache.insert_slab(slabdesc)

    assert lrucache.get(_NS+_NS, '0') is None # Invalid namespace, valid key
    # Valid namespace, out-of-slab key
    assert lrucache.get(_NS, _SLABSZ+1) is None

def test_get_nonexistent_element(lrucache, slabutil):
    "Test that a missing keys is shown as not-present."
    values = range(0, _SLABSZ, 2) # Alternate elements.
    keys = map(str, values)
    slabitems = zip(keys, values)
    slabdesc = slabutil_make_slab(_NS, slabitems)
    lrucache.insert_slab(slabdesc)

    st, v = lrucache.get(_NS, '1') # Valid namespace, missing key
    assert not st
    assert v == '1'

def test_remove(lrucache, slabutil):
    "Test the remove_slab() method."

    values1 = range(_SLABSZ)
    slabdesc1 = slabutil_make_slab(_NS,  zip(map(str, values1), values1))
    lrucache.insert_slab(slabdesc1)

    values2 = range(_SLABSZ, 2*_SLABSZ)
    slabdesc2 = slabutil_make_slab(_NS,  zip(map(str, values2), values2))
    lrucache.insert_slab(slabdesc2)

    # Remove the first slab.
    lrucache.remove_slab(slabdesc1)

    # Items in the original slab should be missing.
    for i in xrange(_SLABSZ):
        st = lrucache.get(_NS, str(i))
        assert st is None

    # Items in the second slab should be present.
    for i in xrange(_SLABSZ, 2 * _SLABSZ):
        st, v = lrucache.get(_NS, str(i))
        assert st
        assert v == i

def test_non_overflow(slabutil):
    "Test that slabs do not overflow upto the slab LRU size."
    slabs = []
    def _mkslab(i):
        v = [i * _SLABSZ]
        return slabutil_make_slab(_NS, zip(map(str, v), v))

    def _cb(self, key, slabdesc, seq=[0]):
        assert False

    lc = LRUCache(_LRUSZ, _cb)
    for i in xrange(_LRUSZ):
        sl = _mkslab(i)
        slabs.append(sl)
        lc.insert_slab(sl)

def test_overflow(slabutil):
    "Test that slabs overflow in LRU sequence."

    slabs = []
    def _mkslab(i):
        v = [i * _SLABSZ]
        return slabutil_make_slab(_NS, zip(map(str, v), v))

    def _cb(slabkey, slabdesc, seq=[0]):
        n = seq[0]
        assert slabdesc is slabs[n]
        seq[0] = n + 1

    lc = LRUCache(_LRUSZ, _cb)
    for i in xrange(2*_LRUSZ):
        sl = _mkslab(i)
        slabs.append(sl)
        lc.insert_slab(sl)

def test_flush(slabutil):
    "Test that flush presents slabs in sequence."

    slabs = []
    def _mkslab(i):
        v = [i * _SLABSZ]
        return slabutil_make_slab(_NS, zip(map(str, v), v))

    seen = [False]
    def _cb(slabkey, slabdesc, seq=[0], seen=seen):
        seen[0] = True
        n = seq[0]
        assert slabdesc is slabs[n]
        seq[0] = n + 1

    lc = LRUCache(_LRUSZ, _cb)
    for i in xrange(_LRUSZ):
        sl = _mkslab(i)
        slabs.append(sl)
        lc.insert_slab(sl)

    lc.flush()
    assert seen[0] is True


text:
package org.stajistics.integration.groovy;

import org.stajistics.StatsConfig;
import org.stajistics.StatsConfigManager;
import org.stajistics.StatsKey;
import org.stajistics.StatsKeyMatcher;

import java.util.Map;
import java.util.Set;

/**
 *
 * @author The Stajistics Project
 */
public class GroovyStatsConfigManager implements StatsConfigManager {

    private final StatsConfigManager delegate;

    private final StatsConfigDSLInterpreter interp = new StatsConfigDSLInterpreter();

    public GroovyStatsConfigManager(final StatsConfigManager delegate) {
        this(delegate, null);
    }

    public GroovyStatsConfigManager(final StatsConfigManager delegate,
                                    final String dsl) {
        if (delegate == null) {
            throw new NullPointerException("delegate");
        }

        this.delegate = delegate;

        if (dsl != null) {
            setConfigs(dsl);
        }
    }

    public void setConfigs(final CharSequence dsl) {
        Map<String,StatsConfig> configMap = interp.eval(dsl);
        for (Map.Entry<String,StatsConfig> entry : configMap.entrySet()) {
            delegate.setConfig(entry.getKey(), entry.getValue());
        }
    }

    public void clearConfigs() {
        delegate.clearConfigs();
    }

    public StatsConfig getConfig(final StatsKey key) {
        return delegate.getConfig(key);
    }

    public Set<String> getKeyNames() {
        return delegate.getKeyNames();
    }

    public StatsConfig getOrCreateConfig(final StatsKey key) {
        return delegate.getOrCreateConfig(key);
    }

    public StatsConfig getRootConfig() {
        return delegate.getRootConfig();
    }

    public StatsConfig removeConfig(final String keyName) {
        return delegate.removeConfig(keyName);
    }

    public StatsConfig removeConfig(final StatsKey key) {
        return delegate.removeConfig(key);
    }

    public void setConfig(final String keyName, final String dsl) {
        delegate.setConfig(keyName, interp.evalConfig(dsl));
    }

    public void setConfig(final StatsKey key, final String dsl) {
        delegate.setConfig(key, interp.evalConfig(dsl));
    }

    public void setConfig(final String keyName, final StatsConfig config) {
        delegate.setConfig(keyName, config);
    }

    public void setConfig(final StatsKey key, final StatsConfig config) {
        delegate.setConfig(key, config);
    }

    public void setRootConfig(final StatsConfig config) {
        delegate.setRootConfig(config);
    }

    public int getConfigCount() {
        return delegate.getConfigCount();
    }

    public Map<StatsKey, StatsConfig> getConfigs() {
        return delegate.getConfigs();
    }

    public Map<StatsKey,StatsConfig> getConfigs(final StatsKeyMatcher matcher) {
        return delegate.getConfigs(matcher);
    }
}


text:
#ifndef SENDANOR_ENV_H
#define SENDANOR_ENV_H 1

#include <string>
#include <cstring>
#include <map>
#include "exception.h"

//#include <cstdio>
//#include <cstdlib>
//extern char **environ;

namespace sendanor {

	/** Get environment variable */
	inline std::string getenv(const std::string& env);

	/** Environment iterator functions */
	class env {
	public:

		struct item {
			inline item(const std::string& a_key, const std::string& a_value)
			 : key(a_key), value(a_value) { }
			inline item(const std::string& a)
			 : key( a.substr(0, a.find_first_of('=')) )
			 , value( a.substr(a.find_first_of('=')+1) ) { }
			inline item(const item& i)
			 : key(i.key), value(i.value) { }
			std::string key;
			std::string value;
		};

		class iterator {
		public:
			inline iterator(char **a_ptr)
			 : m_ptr(a_ptr), m_item("", "") {
				normalize();
			}

			inline item const operator*() const {
				if(!m_ptr) throw RUNTIME_ERROR("!m_ptr");
				if(!(*m_ptr)) throw RUNTIME_ERROR("!(*m_ptr)");
				return item( std::string(*m_ptr, std::strlen(*m_ptr) ) );
			}

			inline item const* operator->() const {
				return &m_item;
			}

			inline bool operator==(iterator const& i) const { return m_ptr == i.m_ptr; }
			inline bool operator!=(iterator const& i) const { return m_ptr != i.m_ptr; }

			inline iterator& operator++() {
				if(!m_ptr) throw RUNTIME_ERROR("!m_ptr");
				++m_ptr;
				normalize();
				return *this;
			}

			//iterator& operator--() { if(!m_ptr) throw RUNTIME_ERROR("!m_ptr"); --m_ptr; return *this; }

			inline iterator operator++(int) {
				if(!m_ptr) throw RUNTIME_ERROR("!m_ptr");
				iterator i(m_ptr++);
				normalize();
				return i;
			}

			//iterator operator--(int) { if(!m_ptr) throw RUNTIME_ERROR("!m_ptr"); return iterator(m_ptr--); }

		private:
			char **m_ptr;
			item m_item; // Temporary for operator->

			inline void normalize() {
				if(!m_ptr) throw RUNTIME_ERROR("!m_ptr");
				if(*m_ptr) m_item = item( std::string(*m_ptr, std::strlen(*m_ptr) ) );
				else m_item = item("", "");
			}

		};

		inline env(char **a_env);
		inline iterator begin();
		inline iterator end();
	private:
		char **m_env;

		// For end()
    	bool m_end_once;
    	char **m_end_next;

	};

} // end of namespace

/*
 * The Source Implementation
 */

#include "logger.h"
//#include <cstdlib>              // for std::getenv and environ
//#include <cstdio>               // for environ
//extern char **environ;

/* Get environment variable */
inline std::string sendanor::getenv(const std::string& env) {
	SENDANOR_LOGGER_FUNCTION("getenv", "env=" << env);
	char* tmp = std::getenv(env.c_str());
	if(!tmp) return "";
	return std::string(tmp);
}

/* Constructor */
inline sendanor::env::env(char **a_env)
 : m_env(a_env)
 , m_end_once(false)
 , m_end_next(a_env) {
	SENDANOR_LOGGER_FUNCTION("env", "");
}

/* Get start iterator */
inline sendanor::env::iterator sendanor::env::begin() {
	SENDANOR_LOGGER_FUNCTION("begin", "");
	return iterator(m_env);
}

/* Get end iterator */
inline sendanor::env::iterator sendanor::env::end() {
	SENDANOR_LOGGER_FUNCTION("end", "");
	if(!m_end_once) {
		m_end_once = true;
		while (*m_end_next) m_end_next++;
	}
	return iterator(m_end_next);
}

#endif
/* EOF */


text:
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>Comments for page "Guitar Envy Bonus"</title>
		<link>http://bvs.wikidot.com/forum/t-218644/guitar-envy-bonus</link>
		<description>Posts in the discussion thread "Guitar Envy Bonus"</description>
				<copyright></copyright>
		<lastBuildDate>Sun, 10 Jul 2022 03:37:17 +0000</lastBuildDate>

				</channel>
</rss>


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

namespace Webplayer.Modules.Youtube.Converters
{
    class CollapsIfNotNull : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return value == null ? Visibility.Visible : Visibility.Collapsed;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}


text:
public class A {
  Object customStep(Object o) { return null; }

  Object source() { return null; }

  void sink(Object o) { }

  Object through1(Object o) {
    Object o2 = customStep(o);
    String s = (String)o2;
    return s;
  }

  void foo() {
    Object x = through1(source());
    sink(x);
  }
}


text:
package com.sun.xzd.rest.service.request;

import java.math.BigDecimal;

public class CustomBillBOInfo
{
    public String id;

    public String delivery;

    public String preTax;

    public String afterTax;

    public String status;

    public BigDecimal paid;

    public BigDecimal unpaid;

    public String getId()
    {
        return id;
    }

    public void setId(String id)
    {
        this.id = id;
    }

    public String getDelivery()
    {
        return delivery;
    }

    public void setDelivery(String delivery)
    {
        this.delivery = delivery;
    }

    public String getPreTax()
    {
        return preTax;
    }

    public void setPreTax(String preTax)
    {
        this.preTax = preTax;
    }

    public String getAfterTax()
    {
        return afterTax;
    }

    public void setAfterTax(String afterTax)
    {
        this.afterTax = afterTax;
    }

    public String getStatus()
    {
        return status;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }

    public BigDecimal getPaid()
    {
        return paid;
    }

    public void setPaid(BigDecimal paid)
    {
        this.paid = paid;
    }

    public BigDecimal getUnpaid()
    {
        return unpaid;
    }

    public void setUnpaid(BigDecimal unpaid)
    {
        this.unpaid = unpaid;
    }
}


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

import org.flowable.engine.ProcessEngine;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHandler;
import org.springframework.messaging.MessagingException;

/**
 * Spring Integration Java Configuration DSL integration for Flowable.
 *
 * @author Josh Long
 */
public class Flowable {

    /**
     * This is the component that you'll use in your Spring Integration
     * {@link org.springframework.integration.dsl.IntegrationFlow}.
     */
    public static FlowableInboundGateway inboundGateway(ProcessEngine processEngine, String... varsToPreserve) {
        return new FlowableInboundGateway(processEngine, varsToPreserve);
    }

    /**
     * This is the bean to expose and then reference
     * from your Flowable BPMN flow in an expression.
     */
    public static IntegrationActivityBehavior inboundGatewayActivityBehavior(FlowableInboundGateway gateway) {
        return new IntegrationActivityBehavior(gateway);
    }

    /**
     * Any message that enters this {@link org.springframework.messaging.MessageHandler}
     * containing a {@code executionId} parameter will trigger a
     * {@link org.flowable.engine.RuntimeService#signal(String)}.
     */
    public static MessageHandler signallingMessageHandler(final ProcessEngine processEngine) {
        return new MessageHandler() {
            @Override
            public void handleMessage(Message<?> message) throws MessagingException {
                String executionId = message.getHeaders().containsKey("executionId") ?
                        (String) message.getHeaders().get("executionId") : (String) null;

                if (null != executionId)
                    processEngine.getRuntimeService().trigger(executionId);
            }
        };
    }
}


text:
using namespace chrono;
using namespace chrono::collision;
using namespace chrono::irrlicht;

// Use the main namespaces of Irrlicht
using namespace irr;
using namespace irr::core;
using namespace irr::scene;
using namespace irr::video;
using namespace irr::io;
using namespace irr::gui;

std::shared_ptr<ChBody> create_wheel(ChVector<> mposition, ChIrrAppInterface& mapplication) {

    ChCollisionModel::SetDefaultSuggestedEnvelope(0.005);
    ChCollisionModel::SetDefaultSuggestedMargin(0.004);

    // create a basic rigid body, it comes with no visualization or collision shapes
    auto mrigidBody = chrono_types::make_shared<ChBody>();
    mapplication.GetSystem()->Add(mrigidBody);
    mrigidBody->SetMass(50);
    mrigidBody->SetInertiaXX(ChVector<>(10, 10, 10));
    mrigidBody->SetPos(mposition);

    // now attach a visualization shape, as a mesh from disk
    auto tireMesh = chrono_types::make_shared<ChObjShapeFile>();
    tireMesh->SetFilename(GetChronoDataFile("models/tractor_wheel/tractor_wheel.obj").c_str());
    mrigidBody->AddAsset(tireMesh);

    // contact material shared by all collision shapes of the wheel
    auto mat = chrono_types::make_shared<ChMaterialSurfaceNSC>();
    mat->SetFriction(0.5f);

    // now attach collision shape, as a compound of convex hulls (for each thread pair):
    mrigidBody->GetCollisionModel()->ClearModel();
    // describe the (invisible) colliding shape by adding the 'carcass' decomposed shape and the
    // 'knobs'. Since these decompositions are only for 1/15th of the wheel, use for() to pattern them:
    for (double mangle = 0; mangle < 360.; mangle += (360. / 15.)) {
        ChQuaternion<> myrot;
        ChStreamInAsciiFile myknobs(GetChronoDataFile("models/tractor_wheel/tractor_wheel_knobs.chulls").c_str());
        ChStreamInAsciiFile myslice(GetChronoDataFile("models/tractor_wheel/tractor_wheel_slice.chulls").c_str());
        myrot.Q_from_AngAxis(mangle * (CH_C_PI / 180.), VECT_X);
        ChMatrix33<> mm(myrot);
        mrigidBody->GetCollisionModel()->AddConvexHullsFromFile(mat, myknobs, ChVector<>(0, 0, 0), mm);
        mrigidBody->GetCollisionModel()->AddConvexHullsFromFile(mat, myslice, ChVector<>(0, 0, 0), mm);
        // break;
    }
    // complete the description.
    mrigidBody->GetCollisionModel()->BuildModel();
    mrigidBody->SetCollide(true);

    return mrigidBody;
}

void create_some_falling_items(ChSystemNSC& mphysicalSystem, ISceneManager* msceneManager, IVideoDriver* driver) {
    ChCollisionModel::SetDefaultSuggestedEnvelope(0.003);
    ChCollisionModel::SetDefaultSuggestedMargin(0.002);

    ChQuaternion<> rot;
    rot.Q_from_AngAxis(ChRandom() * CH_C_2PI, VECT_Y);

    auto pebble_mat = chrono_types::make_shared<ChMaterialSurfaceNSC>();
    pebble_mat->SetFriction(0.4f);

    double bed_x = 0.6;
    double bed_z = 1;

    int n_pebbles = 30;
    for (int bi = 0; bi < n_pebbles; bi++) {
        double sphrad = 0.02 + 0.02 * ChRandom();
        double sphdens = 1;
        ChQuaternion<> randrot(ChRandom(), ChRandom(), ChRandom(), ChRandom());
        randrot.Normalize();

        auto mrigidBody = chrono_types::make_shared<ChBodyEasySphere>(sphrad, sphdens, true, true, pebble_mat);
        mphysicalSystem.Add(mrigidBody);
        mrigidBody->SetRot(randrot);
        mrigidBody->SetPos(ChVector<>(-0.5 * bed_x + ChRandom() * bed_x,
                            0.01 + 0.04 * ((double)bi / (double)n_pebbles),
                              -0.5 * bed_z + ChRandom() * bed_z));
    }

    // Create the a plane using body of 'box' type:
    auto ground_mat = chrono_types::make_shared<ChMaterialSurfaceNSC>();
    ground_mat->SetFriction(0.5f);

    auto mrigidBodyB = chrono_types::make_shared<ChBodyEasyBox>(10, 1, 10, 1000, true, true, ground_mat);
    mphysicalSystem.Add(mrigidBodyB);
    mrigidBodyB->SetBodyFixed(true);
    mrigidBodyB->SetPos(ChVector<>(0, -0.5, 0));
    auto mcolor = chrono_types::make_shared<ChColorAsset>();
    mcolor->SetColor(ChColor(0.2f,0.2f,0.2f));
    mrigidBodyB->AddAsset(mcolor);
}

int main(int argc, char* argv[]) {
    GetLog() << "Copyright (c) 2017 projectchrono.org\nChrono version: " << CHRONO_VERSION << "\n\n";

    // Create a ChronoENGINE physical system
    ChSystemNSC mphysicalSystem;

    // Create the Irrlicht visualization (open the Irrlicht device,
    // bind a simple user interface, etc. etc.)
    ChIrrApp application(&mphysicalSystem, L"Convex decomposed wheel", core::dimension2d<u32>(800, 600));
    application.AddTypicalLogo();
    application.AddTypicalSky();
    application.AddTypicalLights();
    application.AddTypicalCamera(core::vector3df(3.5f, 2.5f, -2.4f));

    // Create some debris

    create_some_falling_items(mphysicalSystem, application.GetSceneManager(), application.GetVideoDriver());

    // Create the wheel

    std::shared_ptr<ChBody> mwheelBody = create_wheel(ChVector<>(0, 1, 0), application);

    // Use this function for adding a ChIrrNodeAsset to all items
    // Otherwise use application.AssetBind(myitem); on a per-item basis.
    application.AssetBindAll();

    // Use this function for 'converting' assets into Irrlicht meshes
    application.AssetUpdateAll();

    //
    // THE SOFT-REAL-TIME CYCLE
    //

    application.SetTimestep(0.01);
    application.SetTryRealtime(true);

    while (application.GetDevice()->run()) {
        application.BeginScene(true, true, SColor(255, 140, 161, 192));

        application.DrawAll();

        application.DoStep();

        application.EndScene();
    }

    return 0;
}


text:
img = imread('cameraman.tif');

%Threshold the image at the intensity level 128
%make all the values in the image less than 128 to 0 and equal or greater than 128 to 255

imgT = img;
imgT(img >= 128) = 255;
imgT(img < 128) = 0;

figure;
subplot(1,2,1)
imshow(img)
subplot(1,2,2)
imshow(imgT)


text:
package com.jeff;

import com.jeff.core.State;
import com.jeff.shell.InputCommand;

/**
 * Created by jeff on 7/17/16.
 */
public class Main {
    public static void main(String[] strs){
        State state=new State();
        new InputCommand().invoke(state);
        while(state.getNext()!=null){
            state.getNext().invoke(state);
        }
    }

}


text:
package org.apache.storm.metric.api;

public class CountMetric implements IMetric {
  private org.apache.heron.api.metric.CountMetric delegate;

  public CountMetric() {
    delegate = new org.apache.heron.api.metric.CountMetric();
  }

  public void incr() {
    delegate.incr();
  }

  public void incrBy(long incrementBy) {
    delegate.incrBy(incrementBy);
  }

  public Object getValueAndReset() {
    return delegate.getValueAndReset();
  }
}


text:
/**
 *
 */
package net.duckling.vmt.api.impl;

import cn.vlabs.rest.ServiceClient;
import cn.vlabs.rest.ServiceContext;
import cn.vlabs.rest.ServiceException;

/**基本服务,所有的服务都继承自此类,主要用于构造通讯对象
 * <br>其他应用请勿直接使用此类
 * @author lvly
 * @since 2013-6-3
 */
public class BaseService {
	private ServiceContext context;
	private ServiceClient client;
	/**
	 * Constructor
	 * @param baseUrl umt的serviceurl,如http://vmt.escience.cn/services
	 * */
	public BaseService(String baseUrl){
		context = new ServiceContext(baseUrl);
		context.setKeepAlive(true);
		client = new ServiceClient(context);
	}
	/**
	 * 发送请求
	 * @param service 服务接口名称 ,比如"Servie.someMethod"
	 * @param value 传参,一个的话,直接赋值即可,如果是多个,请用Object[]{}包装
	 * @return 返回值,需要自己强转
	 * @throws ServiceException 异常包装类,统一用此类
	 */
	public Object sendService(String service, Object value) throws ServiceException{
		Object returnValue= client.sendService(service, value);
		context.close();
		return returnValue;
	}
}


text:
<!--
This component frames a page, potentially on a separate domain, and then
automatically communicates with a corresponding element on a framed page to
enable common cross-frame communication scenarios. For example, this component
can automatically adjust its height to match that of the framed page. (This
replicates the intent of the standard HTML "seamless" iframe attribute, which is
unfortunately implemented poorly on most browsers.)

This component can also be used to let you pass content back and forth between
the framed page and the outer page.

Such scenarios are normally blocked whenever an iframe hosts a page on a
different domain. Various web sources recommend that a frame and its contained
page communicate by means of window.postMessage(), but this is somewhat
cumbersome to set up. This component and its companion, basic-framed-content,
transparently set up and handle that postMessage-based communication for you.

If the framed page contains a basic-framed-content element, then:

1. The outer basic-seamless-iframe can set and inspect the content of the
   inner basic-framed-content element.
2. The outer basic-seamless-iframe can adjust its height to exactly contain the
   inner basic-framed-content element.

Note: This component does not currently support having two instances on the
same document that frame the same page.

@element basic-seamless-iframe
@demo ../packages/sample/basic-seamless-iframe/index.html
-->

<!--
TODO: Extend an HTML iframe element directly?
TODO: Give contained pages on the same domain more direct ways to cooperatively
communicate with this element.
TODO: Allow two instances of this component to frame the same page. This
requires coming up with unique way identify the content component; the code
currently uses frame src for that purpose, but that won't work if two frames
are showing the same page.
-->

<link rel="import" href="../polymer/polymer.html">

<dom-module id="basic-seamless-iframe">
  <template>

    <style>
    :host {
      display: block;
      position: relative;
    }

    #iframe {
      border: none;
      display: block;
      height: 100%;
      position: absolute;
      width: 100%;
    }
    </style>

    <iframe id="iframe" src="{{src}}" scrollbars="no"></iframe>

  </template>
</dom-module>

<script>
Polymer({

  /**
   * Fired when a basic-framed-content element within the framed page has had
   * its content change.
   *
   * @event framedContentChanged
   * @param Object detail The new content of the basic-framed-content element.
   */

  /**
   * Fired when a basic-framed-content element has completed loading its
   * components and raised its polymer-ready event.
   *
   * @event framedWebComponentsReady
   */

  is: 'basic-seamless-iframe',

  properties: {
    /**
     * If true, the element will automatically adjust its height to match that
     * of a contained basic-framed-content element on the framed page.
     *
     * @attribute autoSize
     * @type boolean
     * @default true
     */
    autoSize: {
      observer: '_autoSizeChanged',
      type: Boolean,
      value: true
    },

    /**
     * The page to show in the iframe.
     *
     * For security purposes, this URL needs to exactly match the URL which will
     * returned by the server. E.g., if the server will return a trailing slash,
     * this URL should include a trailing slash to exactly match it.
     *
     * @attribute src
     */
    src: {
      observer: '_srcChanged',
      type: String
    }
  },

  ready: function() {
    window.addEventListener('resize', function() {
      if (this.autoSize && this.clientWidth !== this._clientWidth) {
        // Ping framed content for its new -- potentially changed -- height.
        this._postMessageToFrame('requestHeight');
        this._clientWidth = this.clientWidth;
      }
    }.bind(this));

    // Raise our own load event when the frame loads.
    this.$.iframe.addEventListener('load', function() {
      this.dispatchEvent(new CustomEvent('load'));
    }.bind(this));

    // Listen for messages posted by the framed page.
    window.addEventListener('message', function(event) {
      // For security reasons, only handle messages with the same origin as the
      // framed page.
      if  (event.origin !== this._frameOrigin) {
        return;
      }
      // We also check that the message (ostensibly) comes from the framed page.
      // This can be spoofed, but isn't intended as a security measure. Rather,
      // it's just a way that this component can indentify which messages are
      // meant for it.
      if (!event.data || event.data.source !== this.$.iframe.src) {
        return;
      }
      switch (event.data && event.data.message) {

        case 'framedContentResponse':
          this._framedContentChanged(event.data.detail);
          break;

        case 'framedHeightResponse':
          this._framedHeightChanged(event.data.detail);
          break;

        case 'framedWebComponentsReady':
          this._framedWebComponentsReady();
          break;

      }
    }.bind(this), false);
  },

  /**
   * Reload the content of the frame.
   *
   * @method reload
   */
  reload: function() {
    // We'd like to just invoke this.$.iframe.contentWindow.location.reload().
    // However, as of 11/3/2014, IE chokes on that. We workaround that by
    // forcing the src on the frame again, which reloads the frame.
    this.$.iframe.src = this.src;
  },

  /**
   * Pass the indicated content to the basic-framed-content element within the
   * framed page.
   *
   * @method setFramedContent
   * @param content The content to pass to the basic-framed-content element.
   */
  setFramedContent: function(content) {
    this._pendingContent = content;
    this._updateFramedContent();
  },

  _autoSizeChanged: function() {
    if (this.autoSize) {
      this._postMessageToFrame('requestHeight');
    }
  },

  // Track the last known width of this element.
  _clientWidth: null,

  _framedContentChanged: function(framedContent) {
    var event = new CustomEvent('framedContentChanged', {
      detail: framedContent
    });
    this.dispatchEvent(event);
  },

  _framedHeightChanged: function(framedHeight) {
    if (this.autoSize) {
      this.style.minHeight = framedHeight + 'px';
    }
  },

  _framedWebComponentsReady: function() {
    this._frameReady = true;
    var event = new CustomEvent('framedWebComponentsReady');
    this.dispatchEvent(event);
    this._updateFramedContent();
  },

  _frameReady: false,

  // Content we want to write to the framed page when it's ready for it.
  _pendingContent: null,

  _srcChanged: function() {
    // Extract the origin from the src using an anchor tag as a parser.
    var a = document.createElement('a');
    a.href = this.src;
    var origin = a.origin;
    if (origin == undefined) {
      /* IE 10/11 links don't expose an origin property. Get it ourselves. */
      var originRegex = /(.*\/\/[^\/]+)\//; /* Everything up to first slash in path. */
      var match = originRegex.exec(a.href);
      if (match) {
        origin = match[1];
      }
    }
    this._frameOrigin = origin;
  },

  _updateFramedContent: function() {
    if (this._frameReady && this._pendingContent != null) {
      this._postMessageToFrame('setContent', this._pendingContent);
      this._pendingContent = null;
    }
  },

  _postMessageToFrame: function(message, detail) {
    if (!this._frameOrigin) {
      // Not ready to post yet.
      return;
    }
    var payload = {
      message: message
    };
    if (detail != null) {
      payload.detail = detail;
    }
    this.$.iframe.contentWindow.postMessage(payload, this._frameOrigin);
  }

});
</script>


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

<title>Cogges Parish newsletter September 2003</title>
<link rel="stylesheet" href="../cogges.css">
<link rev=made href="mailto:cogges.pcc@comlab.ox.ac.uk">

From the newsletter ...

Time to get out of the boat

I don't know about you but the beginning of the school term is always a
challenging time of the year for me. I work on 'school term time' and this
seems like the beginning of the year for me. It's a time when I set new
goals and dream the odd dream or two without ever really having the guts
to carry them through.

A book that I'm reading quotes these words from Theodore Roosevelt which
have certainly challenged me to believe my hopes and dreams are truly
achievable.

"It's not the critic who counts; not the person who points out how the
strong stumble, or where the doer of deeds could have done better. The
credit belongs to the person who is actually in the arena ... who, at
best, knows in the end the triumph of great achievement, and who, at
worst, if they fail, at least fails while daring greatly. So that their
place will never be with those cold timid souls who know neither victory
nor defeat."

I suspect Peter, friend of Jesus, would have appreciated Roosevelt's
words -- after all, he encapsulated them! Remember his unforgettable
walk -- on water! Put yourself in Peter's position for a moment. The
boat is small, the waves are violent, even a seasoned professional
like Peter is struggling to stand upright. Two choices -- stay in the
boat, get out and walk towards Jesus -- no choice -- stay in the boat!
But here's the predicament -- if you don't get out of the boat you will
never walk on the water .

I believe there is something inherent -- Someone -- who tells us there
is more to life than sitting in the boat trying to avoid failure.  Each
of us were made with a divine intention, a divine appointment which
requires us to leave the comfort of our routine existence and begin the
adventure of finding out what life is really all about.

What's stopping you? In other words, what is your boat?  What is it
that provides you with safety and security when you feel most afraid?
What do you put your trust in when life gets a little stormy?  Staying
in the boat doesn't guarantee safety.

My friend John Otrberg said,
"You can live on bland food so as to avoid an ulcer, drink no tea,
coffee or other stimulants in the name of health, go to bed early, stay
away from night life, avoid all controversial subjects so as never to
give offence, mind your own business, avoid involvement in other people's
problems, spend money on only necessities and save all you can. You can
still break your neck in the bath tub, and it will serve you right."

I'm determined to take a few risks in the year ahead, to realise a few
dreams and to make a few mistakes and the great thing about water-walking
is that God helps us do what we know we could never do on our own!
I pray that you too will have the courage to follow Peter's example,
step out of the boat and seek the divine intention that has always been
on God's heart for you.

Happy sailing!

Andrew Sweeney

Cogges Parish |
Other articles |

Feedback

© 2003;
Published in Cogges Parish monthly newsletter,
September 2003


text:
package high.mackenzie.autumn.lang.compiler.typesystem;

import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import high.mackenzie.autumn.lang.compiler.typesystem.design.IArrayType;
import high.mackenzie.autumn.lang.compiler.typesystem.design.IElementType;
import high.mackenzie.autumn.lang.compiler.typesystem.design.IType;
import high.mackenzie.autumn.lang.compiler.typesystem.design.ITypeFactory;
import high.mackenzie.autumn.resources.Finished;
import java.io.Serializable;

/**
 * This class provides a concrete implementation of the IArrayType interface.
 *
 * @author Mackenzie High
 */
@Finished("2014/07/12")
public final class ArrayType
        extends AbstractType
        implements IArrayType
{
    private final IElementType element;

    private final int dimensions;

    private final Class clazz;

    /**
     * Sole Constructor.
     *
     * @param factory is the type factory that is used to create types.
     * @param element are the type of the array-type's elements.
     * @param dimensions are the number of dimensions in the array-type.
     * @param clazz is the class representation of the array-type, if one exists.
     */
    public ArrayType(final ITypeFactory factory,
                     final IElementType element,
                     final int dimensions,
                     final Class clazz)
    {
        super(factory, Strings.repeat("[", dimensions) + element.getDescriptor());

        Preconditions.checkNotNull(factory);
        Preconditions.checkNotNull(element);
        Preconditions.checkArgument(dimensions >= 1);

        this.element = element;
        this.dimensions = dimensions;
        this.clazz = clazz;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isSubtypeOf(final IType target)
    {
        final boolean case1 = target.equals(getTypeFactory().fromClass(Object.class));

        final boolean case2 = target.equals(getTypeFactory().fromClass(Serializable.class));

        final boolean case3 = target instanceof IArrayType
                              && dimensions == ((IArrayType) target).getDimensions()
                              && element.isSubtypeOf(((IArrayType) target).getElement());

        return case1 || case2 || case3;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public IElementType getElement()
    {
        return element;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int getDimensions()
    {
        return dimensions;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Class toClass()
    {
        return clazz;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isArrayType()
    {
        return true;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isDeclaredType()
    {
        return false;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isPrimitiveType()
    {
        return false;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isReferenceType()
    {
        return true;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isAnnotationType()
    {
        return false;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isClassType()
    {
        return false;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isEnumType()
    {
        return false;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isInterfaceType()
    {
        return false;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isNullType()
    {
        return false;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isVoidType()
    {
        return false;
    }
}


text:
'use strict';

const Base = require('../HttpException');

module.exports = class FailedDependency extends Base {

    constructor (err, data) {
        super(424, err || 'Failed dependency', data);
    }
};


text:
@interface Person : NSObject

@property (nonatomic,assign,setter=settest:)int age;

@property(nonatomic,assign,getter=isHasNewMessage) BOOL hasNewMessage;

@end


text:
package org.elasticsearch.index.analysis;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.Tokenizer;
import org.apache.lucene.util.CloseableThreadLocal;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.CollectionUtils;

import java.io.Reader;
import java.util.Map;

public final class ReloadableCustomAnalyzer extends Analyzer implements AnalyzerComponentsProvider {

    private volatile AnalyzerComponents components;

    private CloseableThreadLocal<AnalyzerComponents> storedComponents = new CloseableThreadLocal<>();

    private final int positionIncrementGap;

    private final int offsetGap;

    /**
     * An alternative {@link ReuseStrategy} that allows swapping the stored analyzer components when they change.
     * This is used to change e.g. token filters in search time analyzers.
     */
    private static final ReuseStrategy UPDATE_STRATEGY = new ReuseStrategy() {
        @Override
        public TokenStreamComponents getReusableComponents(Analyzer analyzer, String fieldName) {
            ReloadableCustomAnalyzer custom = (ReloadableCustomAnalyzer) analyzer;
            AnalyzerComponents components = custom.getComponents();
            AnalyzerComponents storedComponents = custom.getStoredComponents();
            if (storedComponents == null || components != storedComponents) {
                custom.setStoredComponents(components);
                return null;
            }
            TokenStreamComponents tokenStream = (TokenStreamComponents) getStoredValue(analyzer);
            assert tokenStream != null;
            return tokenStream;
        }

        @Override
        public void setReusableComponents(Analyzer analyzer, String fieldName, TokenStreamComponents tokenStream) {
            setStoredValue(analyzer, tokenStream);
        }
    };

    ReloadableCustomAnalyzer(AnalyzerComponents components, int positionIncrementGap, int offsetGap) {
        super(UPDATE_STRATEGY);
        if (components.analysisMode().equals(AnalysisMode.SEARCH_TIME) == false) {
            throw new IllegalArgumentException(
                    "ReloadableCustomAnalyzer must only be initialized with analysis components in AnalysisMode.SEARCH_TIME mode");
        }
        this.components = components;
        this.positionIncrementGap = positionIncrementGap;
        this.offsetGap = offsetGap;
    }

    @Override
    public AnalyzerComponents getComponents() {
        return this.components;
    }

    @Override
    public int getPositionIncrementGap(String fieldName) {
        return this.positionIncrementGap;
    }

    @Override
    public int getOffsetGap(String field) {
        if (this.offsetGap < 0) {
            return super.getOffsetGap(field);
        }
        return this.offsetGap;
    }

    public AnalysisMode getAnalysisMode() {
        return this.components.analysisMode();
    }

    @Override
    protected Reader initReaderForNormalization(String fieldName, Reader reader) {
        final AnalyzerComponents components = getComponents();
        for (CharFilterFactory charFilter : components.getCharFilters()) {
            reader = charFilter.normalize(reader);
        }
        return reader;
    }

    @Override
    protected TokenStream normalize(String fieldName, TokenStream in) {
        final AnalyzerComponents components = getComponents();
        TokenStream result = in;
        for (TokenFilterFactory filter : components.getTokenFilters()) {
            result = filter.normalize(result);
        }
        return result;
    }

    public synchronized void reload(String name,
                                    Settings settings,
                                    final Map<String, TokenizerFactory> tokenizers,
                                    final Map<String, CharFilterFactory> charFilters,
                                    final Map<String, TokenFilterFactory> tokenFilters) {
        AnalyzerComponents components = AnalyzerComponents.createComponents(name, settings, tokenizers, charFilters, tokenFilters);
        this.components = components;
    }

    @Override
    public void close() {
        super.close();
        storedComponents.close();
    }

    private void setStoredComponents(AnalyzerComponents components) {
        storedComponents.set(components);
    }

    private AnalyzerComponents getStoredComponents() {
        return storedComponents.get();
    }

    @Override
    protected TokenStreamComponents createComponents(String fieldName) {
        final AnalyzerComponents components = getStoredComponents();
        Tokenizer tokenizer = components.getTokenizerFactory().create();
        TokenStream tokenStream = tokenizer;
        for (TokenFilterFactory tokenFilter : components.getTokenFilters()) {
            tokenStream = tokenFilter.create(tokenStream);
        }
        return new TokenStreamComponents(tokenizer, tokenStream);
    }

    @Override
    protected Reader initReader(String fieldName, Reader reader) {
        final AnalyzerComponents components = getStoredComponents();
        if (CollectionUtils.isEmpty(components.getCharFilters()) == false) {
            for (CharFilterFactory charFilter : components.getCharFilters()) {
                reader = charFilter.create(reader);
            }
        }
        return reader;
    }
}


text:
from tools import comObj
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
import numpy as np

#######################################################################
portname        = '/dev/ttyACM0' #verficar el nombre de su puerto
portrate        = 9600           #velocidad baudrate
'''
#esta parte del codigo solo corre usando IPython
arduinoData     = comObj(portname,portrate)
figObj = DynamicPlot(ran_y=[-1,1]) #create figure to plot data
dispObj= GetDisplay(arduinoData,figObj,update=0.2)#create object to update plot with arduino data
arduinoData.start()    #iniciar el hilo que permite leer datos del arduino
dispObj.start()        #iniciar el hilo que permite mostrar los datos
arduinoData.read=True  #iniciar la lectura
'''
#si esta en IPython, debe finalizar el objeto que muestra datos
#dispObj.kill()
#los datos quedan guardados en un archivo de texto
#data=np.loadtxt('newfile.txt')
#plt.plot(data[:,0],data[:,1])
#plt.show()
#######################################################################

#### evaluar el codigo con un lector de texto
#codigo solo corre en IPython
readObj= reader('data.txt')
figObj = DynamicPlot(ran_y=[-1,1])
dispObj= GetDisplay(readObj,figObj)

readObj.start()
dispObj.start()
readObj.read=True

#######################################################################
#este codigo corre en consola o tambien en IPython

#definir una funcion para actualizar la grafica
def update(i):
    buffersize = 256
    y_b   = np.array([])
    x_b   = np.array([])
    if readObj.dataCount>0:
       y_data=readObj.num_data
       x_data=np.linspace(0,readObj.dataCount*readObj.tRead,y_data.size)
       if y_data.size<buffersize:
          y_b=y_data
          x_b=x_data
       else:
          y_b=y_data[y_data.size-buffersize:]
          x_b=x_data[x_data.size-buffersize:]

    ax.clear()
    ax.plot(x_b,y_b)

#definir variables
readObj= reader('data.txt')
readObj.read=True

#para usar arduino comentar las lineas anteriores y quitar el comentario de las siguientes
#readObj     = comObj(portname,portrate)
#readObj.read=True  #iniciar la lectura

fig = plt.figure()
ax  = fig.add_subplot(1,1,1)
ax.set_autoscaley_on(True)
ax.set_ylim(-1, 1)

readObj.start() #iniciar hilo para lectura de datos
ani = FuncAnimation(fig, update, interval=500)#, blit=True)
plt.show()

readObj.stop=True

#######################################################################
#######################################################################
#######################################################################
#arduino code
'''
//sumar tres sinusoidales
float t  = 0;  //valor de la variable independiente
double value = 0;  //resultado que se va a transmitir al pc
int t_sample = 10; //tiempo de muestreo, en ms. Separacion entre muestras, cada cuanto tiempo
                   //se transmite una nueva muestra al pc
const float pi=3.141592;

void setup() {
   Serial.begin(9600);
}

void loop() {
  //sumar tres componentes frecuenciales
  value=sin(2*pi*1*t)+0.7*sin(2*pi*2*t)+0.3*sin(2*pi*4*t);
  Serial.println(value,4);
  t=t+float(t_sample)/1000;
  delay(t_sample);
}
'''
#######################################################################
'''
//generar una onda cuadrada sumando diferentes armonicos usando las series de Fourier
float t  = 0;  //valor de la variable independiente
double value = 0;  //resultado que se va a transmitir al pc
int t_sample = 10; //tiempo de muestreo, en ms. Separacion entre muestras, cada cuanto tiempo
                   //se transmite una nueva muestra al pc
const float pi=3.141592;
const float f = 2;
void setup() {
   Serial.begin(9600);
}

void loop() {
  //sumar tres componentes frecuenciales
  float w;
  int MAX=4;

  if(t>5)   MAX=10;
  if(t>10)  MAX=20;
  if(t>15)  MAX=40;

  value=0;
  for(int i=1;i<MAX;i+=2)
  {
   w=2*pi*f*i;
   value=value+2/(i*pi)*sin(w*t);
  }

  Serial.println(value,4);
  t=t+float(t_sample)/1000;
  delay(t_sample);
}
'''
#######################################################################
'''
//generar una onda triangular sumando diferentes armonicos usando las series de Fourier
float t  = 0;  //valor de la variable independiente
double value = 0;  //resultado que se va a transmitir al pc
int t_sample = 10; //tiempo de muestreo, en ms. Separacion entre muestras, cada cuanto tiempo
                   //se transmite una nueva muestra al pc
const float pi=3.141592;
const float f = 2;
void setup() {
   Serial.begin(9600);
}

void loop() {
  //sumar tres componentes frecuenciales
  float w;
  int MAX=3;

  if(t>5)   MAX=5;
  if(t>10)  MAX=8;
  if(t>15)  MAX=10;
  if(t>20)  MAX=50;

  value=0;
  for(int i=1;i<MAX;i++)
  {
   w=2*pi*f*i;
   value=value+2/(pow(i,2)*pow(pi,2))*(cos(i*pi)-1)*cos(w*t);
  }
  value=2*value;
  Serial.println(value,4);
  t=t+float(t_sample)/1000;
  delay(t_sample);
}

'''


text:
/**
 * @file tests/Tests.h
 * @author Tomas Polasek
 * @brief Main testing file.
 */

#ifndef Tests_H
#define Tests_H

#include <iostream>

#include "testing/Testing.h"

#endif //Tests_H


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Frontend Community</title>

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
        crossorigin="anonymous">
    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Galada|Raleway" rel="stylesheet">
    <link type="text/css" rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300">
    <link href="https://fonts.googleapis.com/css?family=Roboto:100" rel="stylesheet">
    <link rel="stylesheet" href="https://codepen.io/assets/reset/normalize.css">
    <link rel="stylesheet" href="css/styles.css">

erni

about

staff

social

+info

ERNI Frontend Community

In the frontend community, our focus is to experiment, learn, follow up and play with the edge technologies related with our community.

The attendance for our community is totally free for any ERNI employee.

Our community will not flourish without your energy and support, making it work is up to YOU.

If you are interested in becoming a speaker, don't hesistate on contacting us and explain which topics do you know, or you are interested to prepare / share, and join our team

Jorge Artieda

Sponsor

Juan Carlos Coello

Community Lead / Speaker

Miguel Molina

Speaker

Gilberto Cao

Speaker

The community has budget (booked hours) for the organizers (Community Lead) and for people who prepares the content for the community (Subject Matter Expert).

Join us on our networks for more content!

and

The first event will happen on January 18th, 2017

00

Days

00

Hours

00

Minutes

00

Seconds

Looking forward to see you here, on SDC offices at 18:30, learning and sharing with us.


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <title>Where We Left Off</title>
  <meta name="description" content="So what you were caught crying at work. So what you wrote it down even though you would never want to remember it. Everything needs salt. Even us. Even when ...">

    <link href='//fonts.googleapis.com/css?family=Lato:400,400italic' rel='stylesheet' type='text/css'>

  <link rel="stylesheet" type="text/css" href="/css/tufte.css">

  <link rel="canonical" href="/july2015/2015/07/01/12.html">

  <link rel="alternate" type="application/rss+xml" title="Alien Mouth" href="/feed.xml" />

		about
		books
		connect
		submit

Where We Left Off

by Dalton Day on July 1, 2015

So what you were caught crying at work. So what

you wrote it down even though you would never

want to remember it. Everything needs salt. Even

us. Even when we don't. You didn't hear this from

me, but I didn't leave my home for two years. I

discovered a new species of dust mite. I trained

them to arrange themselves in whatever shape I

wanted. I guess I wanted letters. I guess I wanted

IT'S FINE. When your shift ends, I'll be here. I'll

be the one with a fish in my hands, telling

everyone I'm the wrong kind of body for this. You

can't miss me.

    Where We Left Off - July 1, 2015 -


text:
package org.spongepowered.api.stats.achievement;

import org.spongepowered.api.stats.Statistic;
import org.spongepowered.api.text.translation.Translation;

import javax.annotation.Nullable;

/**
 * Represents a builder interface to create new and custom instances of
 * {@link Achievement}s.
 */
public interface AchievementBuilder {

    /**
     * Sets the internal name for the {@link Achievement}.
     *
     * @param name The name of this achievement
     * @return This builder, for chaining
     */
    AchievementBuilder name(String name);

    /**
     * Sets the translation for the {@link Achievement}.
     *
     * @param translation The translation for the achievement
     * @return This builder, for chaining
     */
    AchievementBuilder translation(Translation translation);

    /**
     * Sets the description that describes this {@link Achievement}.
     *
     * @param description The description of this achievement
     * @return This builder, for chaining
     */
    AchievementBuilder description(Translation description);

    /**
     * Sets the parent of this {@link Achievement}, if there is one.
     *
     * @param parent The parent of this achievement
     * @return This builder, for chaining
     */
    AchievementBuilder parent(@Nullable Achievement parent);

    /**
     * Sets a statistic which will be used for tracking this achievement. May be
     * null if this achievement is not backed by a statistic but is manually
     * awarded instead. If the statistic is not null then the
     * {@link #targetValue(long)} must be set as well. This defaults to null if
     * not set.
     *
     * @param stat The statistic, or null if not backed by a statistic
     * @return This builder, for chaining
     */
    AchievementBuilder sourceStatistic(@Nullable Statistic stat);

    /**
     * Sets the target value of the statistic backing this achievement. If the
     * source statistic is not set then this value will be ignored if set.
     * Defaults to 1 if not set.
     *
     * @param value The target value
     * @return This builder, for chaining
     */
    AchievementBuilder targetValue(long value);

    /**
     * Builds and registers an instance of an {@link Achievement}.
     *
     * @return A new instance of a achievement
     * @throws IllegalStateException If the achievement is not completed
     */
    Achievement buildAndRegister() throws IllegalStateException;

}


text:
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
define(["require", "exports", "newui/component/Component"], function (require, exports, Component_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    class InspectEntityInformationSubsection extends Component_1.default {
        constructor() {
            super();
            this.classes.add("debug-tools-inspect-entity-sub-section");
        }
        getImmutableStats() { return []; }
    }
    __decorate([
        Override
    ], InspectEntityInformationSubsection.prototype, "event", void 0);
    exports.default = InspectEntityInformationSubsection;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSW5zcGVjdEVudGl0eUluZm9ybWF0aW9uU3Vic2VjdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy91aS9jb21wb25lbnQvSW5zcGVjdEVudGl0eUluZm9ybWF0aW9uU3Vic2VjdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7SUFXQSxNQUE4QixrQ0FBbUMsU0FBUSxtQkFBUztRQUdqRjtZQUNDLEtBQUssRUFBRSxDQUFDO1lBQ1IsSUFBSSxDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsd0NBQXdDLENBQUMsQ0FBQztRQUM1RCxDQUFDO1FBSU0saUJBQWlCLEtBQWEsT0FBTyxFQUFFLENBQUMsQ0FBQyxDQUFDO0tBQ2pEO0lBVlU7UUFBVCxRQUFRO3FFQUE4RTtJQUR4RixxREFXQyJ9


text: from seriesly.core import Seriesly


text:
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <string name="complication_config" msgid="3090406830927670356">"Konfiguracija spletova brojčanika"</string>
    <string name="watchface_settings" msgid="9086980313887663299">"Konfiguracija postavki brojčanika"</string>
    <string name="style_config" msgid="7270818527618953542">"Konfiguracija stilova brojčanika"</string>
    <string name="none_background_image_provider" msgid="2763799590544856080">"Ništa"</string>
    <string name="settings_complications" msgid="1425815384891476600">"Podaci"</string>
    <string name="settings_background_image" msgid="496585675676995765">"Slika pozadine"</string>
    <string name="settings_styles" msgid="3243144642316786428">"Stilovi"</string>
</resources>


text:
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
module Main where

import Data.BigWord
import Data.List
import Data.Time

import System.Environment

makeBigWordsTo 3

main :: IO ()
main = do
  args <- getArgs
  let
    n =
      case args of
        [] -> 1000000
        n:_ -> read n
  let
    a1 = foldl' (+) 0 $ replicate n (fromInteger @(BigWord 1) $ 3^10)
    a2 = foldl' (+) 0 $ replicate n (fromInteger @(BigWord 2) $ 3^10)
    a3 = foldl' (+) 0 $ replicate n (fromInteger @(BigWord 3) $ 3^10)
    b = foldl' (+) 0 $ replicate n ((3 :: Integer)^10)
  t0 <- getCurrentTime
  a1 `seq` return ()
  t1 <- getCurrentTime
  a2 `seq` return ()
  t2 <- getCurrentTime
  a3 `seq` return ()
  t3 <- getCurrentTime
  b `seq` return ()
  t4 <- getCurrentTime
  putStrLn ""
  putStrLn $ "Agreement: " ++ show (a1 == fromInteger b && a2 == fromInteger b && a3 == fromInteger b)
  putStrLn $ "BigWord1: " ++ show (diffUTCTime t1 t0)
  putStrLn $ "BigWord2: " ++ show (diffUTCTime t2 t1)
  putStrLn $ "BigWord3: " ++ show (diffUTCTime t3 t2)
  putStrLn $ "Integer : " ++ show (diffUTCTime t4 t3)
  return ()


text:
#include <aws/gamesparks/model/StageSummary.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace GameSparks
{
namespace Model
{

StageSummary::StageSummary() :
    m_descriptionHasBeenSet(false),
    m_gameKeyHasBeenSet(false),
    m_nameHasBeenSet(false),
    m_state(StageState::NOT_SET),
    m_stateHasBeenSet(false),
    m_tagsHasBeenSet(false)
{
}

StageSummary::StageSummary(JsonView jsonValue) :
    m_descriptionHasBeenSet(false),
    m_gameKeyHasBeenSet(false),
    m_nameHasBeenSet(false),
    m_state(StageState::NOT_SET),
    m_stateHasBeenSet(false),
    m_tagsHasBeenSet(false)
{
  *this = jsonValue;
}

StageSummary& StageSummary::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("Description"))
  {
    m_description = jsonValue.GetString("Description");

    m_descriptionHasBeenSet = true;
  }

  if(jsonValue.ValueExists("GameKey"))
  {
    m_gameKey = jsonValue.GetString("GameKey");

    m_gameKeyHasBeenSet = true;
  }

  if(jsonValue.ValueExists("Name"))
  {
    m_name = jsonValue.GetString("Name");

    m_nameHasBeenSet = true;
  }

  if(jsonValue.ValueExists("State"))
  {
    m_state = StageStateMapper::GetStageStateForName(jsonValue.GetString("State"));

    m_stateHasBeenSet = true;
  }

  if(jsonValue.ValueExists("Tags"))
  {
    Aws::Map<Aws::String, JsonView> tagsJsonMap = jsonValue.GetObject("Tags").GetAllObjects();
    for(auto& tagsItem : tagsJsonMap)
    {
      m_tags[tagsItem.first] = tagsItem.second.AsString();
    }
    m_tagsHasBeenSet = true;
  }

  return *this;
}

JsonValue StageSummary::Jsonize() const
{
  JsonValue payload;

  if(m_descriptionHasBeenSet)
  {
   payload.WithString("Description", m_description);

  }

  if(m_gameKeyHasBeenSet)
  {
   payload.WithString("GameKey", m_gameKey);

  }

  if(m_nameHasBeenSet)
  {
   payload.WithString("Name", m_name);

  }

  if(m_stateHasBeenSet)
  {
   payload.WithString("State", StageStateMapper::GetNameForStageState(m_state));
  }

  if(m_tagsHasBeenSet)
  {
   JsonValue tagsJsonMap;
   for(auto& tagsItem : m_tags)
   {
     tagsJsonMap.WithString(tagsItem.first, tagsItem.second);
   }
   payload.WithObject("Tags", std::move(tagsJsonMap));

  }

  return payload;
}

} // namespace Model
} // namespace GameSparks
} // namespace Aws


text:
<!--
             LUFA Library
     Copyright (C) Dean Camera, 2015.

  dean [at] fourwalledcubicle [dot] com
           www.lufa-lib.org
-->

<!-- Atmel Studio framework integration file -->

<lufa>
	<asf>
		<select-by-config id="lufa.drivers.usb.class.ms" name="lufa.drivers.usb.class.ms.mode" default="host_device" caption="LUFA USB Class Driver - Mass Storage">
			<build type="doxygen-entry-point" value="Group_USBClassMS"/>

			<info type="gui-flag" value="hidden"/>

			<module type="service" id="lufa.drivers.usb.class.ms#host_device" caption="LUFA USB Class Driver - Mass Storage (Host/Device)">
				<info type="description" value="summary">
					Common definitions and Host/Device mode implementations of the Mass Storage USB class.
				</info>

				<build type="doxygen-entry-point" value="Group_USBClassMS"/>

				<info type="gui-flag" value="hidden"/>

				<device-support-alias value="lufa_avr8"/>
				<device-support-alias value="lufa_xmega"/>
				<device-support-alias value="lufa_uc3"/>

				<build type="header-file" value="Drivers/USB/Class/MassStorageClass.h"/>
				<build type="header-file" value="Drivers/USB/Class/Common/MassStorageClassCommon.h"/>
				<build type="header-file" value="Drivers/USB/Class/Device/MassStorageClassDevice.h"/>
				<build type="c-source"    value="Drivers/USB/Class/Device/MassStorageClassDevice.c"/>
				<build type="header-file" value="Drivers/USB/Class/Host/MassStorageClassHost.h"/>
				<build type="c-source"    value="Drivers/USB/Class/Host/MassStorageClassHost.c"/>
			</module>

			<module type="service" id="lufa.drivers.usb.class.ms#host" caption="LUFA USB Class Driver - Mass Storage (Host)">
				<info type="description" value="summary">
					Common definitions and Host mode implementation of the Mass Storage USB class.
				</info>

				<build type="doxygen-entry-point" value="Group_USBClassMS"/>

				<info type="gui-flag" value="hidden"/>

				<device-support-alias value="lufa_avr8"/>
				<device-support-alias value="lufa_xmega"/>
				<device-support-alias value="lufa_uc3"/>

				<build type="header-file" value="Drivers/USB/Class/MassStorageClass.h"/>
				<build type="header-file" value="Drivers/USB/Class/Common/MassStorageClassCommon.h"/>
				<build type="header-file" value="Drivers/USB/Class/Device/MassStorageClassDevice.h"/>
				<build type="header-file" value="Drivers/USB/Class/Host/MassStorageClassHost.h"/>
				<build type="c-source"    value="Drivers/USB/Class/Host/MassStorageClassHost.c"/>
			</module>

			<module type="service" id="lufa.drivers.usb.class.ms#device" caption="LUFA USB Class Driver - Mass Storage (Device)">
				<info type="description" value="summary">
					Common definitions and Device mode implementation of the Mass Storage USB class.
				</info>

				<build type="doxygen-entry-point" value="Group_USBClassMS"/>

				<info type="gui-flag" value="hidden"/>

				<device-support-alias value="lufa_avr8"/>
				<device-support-alias value="lufa_xmega"/>
				<device-support-alias value="lufa_uc3"/>

				<build type="header-file" value="Drivers/USB/Class/MassStorageClass.h"/>
				<build type="header-file" value="Drivers/USB/Class/Common/MassStorageClassCommon.h"/>
				<build type="header-file" value="Drivers/USB/Class/Device/MassStorageClassDevice.h"/>
				<build type="c-source"    value="Drivers/USB/Class/Device/MassStorageClassDevice.c"/>
				<build type="header-file" value="Drivers/USB/Class/Host/MassStorageClassHost.h"/>
			</module>

			<module type="service" id="lufa.drivers.usb.class.ms#definitions_only" caption="LUFA USB Class Driver - Mass Storage (Definitions Only)">
				<info type="description" value="summary">
					Common definitions only (no implementations) of the Mass Storage USB class.
				</info>

				<build type="doxygen-entry-point" value="Group_USBClassMS"/>

				<info type="gui-flag" value="hidden"/>

				<device-support-alias value="lufa_avr8"/>
				<device-support-alias value="lufa_xmega"/>
				<device-support-alias value="lufa_uc3"/>

				<build type="header-file" value="Drivers/USB/Class/MassStorageClass.h"/>
				<build type="header-file" value="Drivers/USB/Class/Common/MassStorageClassCommon.h"/>
				<build type="header-file" value="Drivers/USB/Class/Device/MassStorageClassDevice.h"/>
				<build type="header-file" value="Drivers/USB/Class/Host/MassStorageClassHost.h"/>
			</module>
		</select-by-config>
	</asf>
</lufa>


text:
package org.jhaws.common.web.wicket.forms.common;

// https://developer.snapappointments.com/bootstrap-select/examples/
@SuppressWarnings("serial")
public class BootstrapMultiSelectSettings extends AbstractSelectSettings<BootstrapMultiSelectSettings> {
    private Integer max = null;

    private Integer size = null;

    public BootstrapMultiSelectSettings() {
        super();
    }

    public BootstrapMultiSelectSettings(BootstrapMultiSelectSettings other) {
        super(other);
    }

    public BootstrapMultiSelectSettings(boolean required) {
        super(required);
    }

    @Override
    public boolean isNullValid() {
        return this.nullValid;
    }

    @Override
    public BootstrapMultiSelectSettings setNullValid(boolean nullValid) {
        this.nullValid = nullValid;
        return this;
    }

    public Integer getMax() {
        return this.max;
    }

    public BootstrapMultiSelectSettings setMax(Integer max) {
        this.max = max;
        return this;
    }

    public Integer getSize() {
        return this.size;
    }

    public BootstrapMultiSelectSettings setSize(Integer size) {
        this.size = size;
        return this;
    }
}


text:
<resources>
    <string name="app_name">ConductorResources</string>
</resources>


text:
/*
 *  drv.c
 *
 *  Created on: 2016. 7. 13.
 *      Author: Baram, PBHP
 */

#include "drv_micros.h"
#include "variant.h"

TIM_HandleTypeDef    TimHandle;

void drv_micros_init()
{
  uint32_t uwPrescalerValue = 0;

  __HAL_RCC_TIM5_CLK_ENABLE();

  // Compute the prescaler value to have TIMx counter clock equal to 1Mh
  uwPrescalerValue = (uint32_t)((SystemCoreClock / 2) / 1000000) - 1;

  TimHandle.Instance = TIM5;
  TimHandle.Init.Period            = 0xFFFFFFFF;
  TimHandle.Init.Prescaler         = uwPrescalerValue;
  TimHandle.Init.ClockDivision     = 0;
  TimHandle.Init.CounterMode       = TIM_COUNTERMODE_UP;
  TimHandle.Init.RepetitionCounter = 0;

  HAL_TIM_Base_Init(&TimHandle);
  HAL_TIM_Base_Start(&TimHandle);
}

uint32_t drv_micros()
{
  return TimHandle.Instance->CNT;
}


text:
<?php

namespace PolderKnowledge\LogModule\Controller\Plugin;

use PolderKnowledge\LogModule\TaskService\ThrowableLogger;
use Throwable;
use Zend\Mvc\Controller\Plugin\AbstractPlugin;

/**
 * A controller plugin that helps to log a throwable object.
 */
final class LogThrowable extends AbstractPlugin
{
    /**
     * @var ThrowableLogger
     */
    private $logger;

    /**
     * Initializes a new instance of this class.
     *
     * @param ThrowableLogger $logger
     */
    public function __construct(ThrowableLogger $logger)
    {
        $this->logger = $logger;
    }

    /**
     * Called when a throwable should be logged.
     *
     * @param Throwable $throwable The throwable object to log.
     */
    public function __invoke(Throwable $throwable)
    {
        $this->logger->logThrowable($throwable);
    }
}


text:
class GuestViewManagerFactory {
 public:
  virtual GuestViewManager* CreateGuestViewManager(
      content::BrowserContext* context) = 0;

 protected:
  virtual ~GuestViewManagerFactory() {}
};

#endif  // CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_MANAGER_FACTORY_H_


text:
  La Chapelotte est
       un village
       situé dans le département de Cher en Centre. Elle comptait 180 habitants en 2008.

À proximité de La Chapelotte sont positionnées géographiquement les communes de
Ivoy-le-Pré située à 7 km, 854 habitants,
Neuvy-Deux-Clochers localisée à 11 km, 301 habitants,
Le Noyer située à 7 km, 271 habitants,
Henrichemont située à 7 km, 1 813 habitants,
Sens-Beaujeu située à 9 km, 428 habitants,
Villegenon localisée à 8 km, 227 habitants,
 entre autres. De plus, La Chapelotte est située à seulement 26 km de Cosne-Cours-sur-Loire.

La commune offre quelques  équipements sportifs, elle propose entre autres une boucle de randonnée.

Le parc d'habitations, à La Chapelotte, était réparti en 2011 en zero appartements et 139 maisons soit
 un marché plutôt équilibré.

Si vous envisagez de demenager à La Chapelotte, vous pourrez facilement trouver une maison à acheter.