text:
<title>
Sympathy for a sad loss
</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php include "../../legacy-includes/Script.htmlf" ?>

<?php include "../../legacy-includes/TopLogo.htmlf" ?>

<?php include "../../legacy-includes/TopAd.htmlf" ?>

<?php include "../../legacy-includes/LeftButtons.htmlf" ?>

<?php include "../../legacy-includes/BodyInsert.htmlf" ?>

VIEWS AND VOICES

Sympathy for a sad loss

August 3, 2007 | Page 6

Dear friends and family of Joshua Brand,

I never knew Joshua, but I've been reading Socialist Worker for nearly three years. I felt moved by your loss and knew that I had to write in ("In memory of Joshua Brand," July 6).

In memory of Josh

THE LOSS of Joshua Brand, a dedicated fighter in the struggle for a better world, was a blow to our movement and to those who knew and loved him.

The Center for Economic Research and Social Change, publisher of Haymarket Books, is accepting donations in memory of Josh to support Haymarket, a project that Josh supported and saw as important to our struggle.

If you would like to contribute, please send checks payable to CERSC (with "In memory of Josh Brand" written in the memo line) to: CERSC, P.O. Box 258082, Chicago, IL 60625. For more information, call 773-583-7884.

I'm so very sorry to hear about his passing and I wanted to express my deepest sympathy. He sounded like a beautiful soul. I especially wanted to express my sympathy to Jenni Rowe. Her letter broke my heart. I'm so very, very sorry for your loss.

Personally, I think a great way to honor his memory would be to write that article for the International Socialist Review in his memory. Do what your heart tells you, but I think it's a good idea.

I'm finally going home soon, and once home, I'll be joining the International Socialist Organization. I'll fight for a better world in which people will be treated better and taken care of.

With deepest empathy,

Christopher Henderson, Low Security Correctional Institution, Butner, N.C.

<?php include "../../legacy-includes/BottomNavLinks.htmlf" ?>

<?php include "../../legacy-includes/RightAdFolder.htmlf" ?>

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>AbstractGraphProvider</title>
<meta name="date" content="2015-03-06">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.jetel.graph.analyse

Class AbstractGraphProvider

java.lang.Object

org.jetel.graph.analyse.AbstractGraphProvider

All Implemented Interfaces:

GraphProvider

Direct Known Subclasses:

SingleGraphProvider

public abstract class AbstractGraphProvider
extends java.lang.Object
implements GraphProvider

Common ancestor for both implementation of GraphProvider interface.
 This abstract implementation is empty for now, can be used later.

Constructor Summary

Constructors

Constructor and Description

AbstractGraphProvider()

Method Summary

Methods

Modifier and Type
Method and Description

EdgeFunction
getEdgeFunction()

Gets transition function between components in the graph.

protected boolean
isAllowedComponent(Node component)

RemoteEdgeComponent and SubJobInput/Output components are not processed in regular way.

boolean
isSubgraphInputOutputAsSingleComponent()

boolean
isSubgraphInputOutputVisibility()

void
setEdgeFunction(EdgeFunction edgeFunction)

Sets transition function between components in the graph.

void
setSubgraphInputOutputAsSingleComponent(boolean subgraphInputOutputAsSingleComponent)

Sets the flag which indicates the SubgraphInput (or SubgraphOutput) component will be considered
 as single component.

void
setSubgraphInputOutputVisibility(boolean subgraphInputOutputVisibility)

Sets the flag which indicates whether the SubgraphInput and SubgraphOutput components are
 part of provided graph.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods inherited from interface org.jetel.graph.analyse.GraphProvider

getNextComponent, reset

Constructor Detail

AbstractGraphProvider

public AbstractGraphProvider()

Method Detail

isAllowedComponent

protected boolean isAllowedComponent(Node component)

RemoteEdgeComponent and SubJobInput/Output components are not processed in regular way.

Returns:

true for the component which are dedicated to be root of graph processing

setEdgeFunction

public void setEdgeFunction(EdgeFunction edgeFunction)

Description copied from interface: GraphProvider

Sets transition function between components in the graph.

Specified by:

setEdgeFunction in interface GraphProvider

getEdgeFunction

public EdgeFunction getEdgeFunction()

Description copied from interface: GraphProvider

Gets transition function between components in the graph.

Specified by:

getEdgeFunction in interface GraphProvider

setSubgraphInputOutputAsSingleComponent

public void setSubgraphInputOutputAsSingleComponent(boolean subgraphInputOutputAsSingleComponent)

Description copied from interface: GraphProvider

Sets the flag which indicates the SubgraphInput (or SubgraphOutput) component will be considered
 as single component. Otherwise, each port of SGI or SGO component represents separate
 'component' entity for this graph provider.
 Default is false.

Specified by:

setSubgraphInputOutputAsSingleComponent in interface GraphProvider

isSubgraphInputOutputAsSingleComponent

public boolean isSubgraphInputOutputAsSingleComponent()

Specified by:

isSubgraphInputOutputAsSingleComponent in interface GraphProvider

Returns:

the flag which indicates the SubgraphInput (or SubgraphOutput) component will be considered
 as single component. Otherwise, each port of SGI or SGO component represents separate
 'component' entity for this graph provider.

setSubgraphInputOutputVisibility

public void setSubgraphInputOutputVisibility(boolean subgraphInputOutputVisibility)

Description copied from interface: GraphProvider

Sets the flag which indicates whether the SubgraphInput and SubgraphOutput components are
 part of provided graph.
 Default is false.

Specified by:

setSubgraphInputOutputVisibility in interface GraphProvider

isSubgraphInputOutputVisibility

public boolean isSubgraphInputOutputVisibility()

Specified by:

isSubgraphInputOutputVisibility in interface GraphProvider

Returns:

the flag which indicates whether the SubgraphInput and SubgraphOutput components are
 part of provided graph.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

				<address>Copyright © 2002-2015 Javlin a.s.</address>


text:
<?php

namespace NBABundle\Controller\API;

use NBABundle\Controller\BaseController;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use NBABundle\Entity\Team;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use NBABundle\Utility\Scripts;

/**
 * Class TeamController
 * @package NBABundle\Controller
 */
class TeamController extends BaseController
{

    /**
     * Fetches all teams
     * @Route("/teams", name="teams", options={"expose" = true})
     * @Method("GET")
     * @return array or objects
     */
    public function teamsAction()
    {
        $teams = $this->getDoctrine()
            ->getRepository(Team::class)
            ->findAllTeams();

        if(!$teams)
        {
            throw $this->createNotFoundException();
        }

        $data = ['teams' => $teams];

        return new JsonResponse($data);

    }

    /**
     * Fetch all teams ordered by how many titles they have
     * @Route("/teams/titles", name="titles", options={"expose" = true})
     * @Method("GET")
     * @return Array / Objects
     */
    public function titlesAction()
    {
        $teamByTitles = $this->getDoctrine()
            ->getRepository(Team::class)
            ->findAllTeamsByTitle();

        if(!$teamByTitles)
        {
            throw $this->createNotFoundException();
        }

        $data = ['teams' => $teamByTitles];

        return new JsonResponse($data);

    }

    /**
     * Fetches a single team based on Id
     * @Route("/team/{teamId}", name="team", options={"expose" = true})
     * @Method("GET")
     * @return Object of Single Team with associated Players
     */
    public function teamIdAction($teamId)
    {

        $team = $this->getDoctrine()
            ->getRepository(Team::class)
            ->findOneBy(array(
                'teamId' => $teamId
            ));

        if(!$team)
        {
            throw $this->createNotFoundException();
        }

        $teamReturn = array(
            'teamId' => $team->getTeamId(),
            'teamName' => $team->getTeamName(),
            'teamCity' => $team->getTeamCity(),
            'teamTitles' => $team->getTeamTitles(),
        );

        return new JsonResponse($teamReturn);
    }

    /**
     * Update the number of titles a team has by Id
     * @Route("/team/update/titles", name="update_team")
     * @Method("PUT")
     */
    public function updateTeamTitleAction(Request $request)
    {
        //fetch UPDATE parameters
        $body = $request->getContent();
        $params = json_decode($body, true);

        $team = $this->getDoctrine()
            ->getRepository(Team::class)
            ->updateTeamTitles($params['teamId'], $params['titles']);

        if(!$team)
        {
            throw $this->createNotFoundException("There is not team with this id: " . $params['teamId']);
        }

        if(is_array($team))
        {
            $response = $team;
        }else{
            $response = $this->createApiResponse($team, 204);
            $response = array(
                'message' => 'successful update',
                'code' => $response->getStatusCode()
            );
        }

        return new JsonResponse($response);

    }

}


text:
FAQ's

            General

            Sponsors

            Care & Accessibility

How does Write/Speak/Code define 'coders'?

We define 'coders' as anyone who has written a line of code (HTML, CSS, JavaScript, Ruby, Python, Java, SQL whatever) and can explain what it does. Designers, E-book publishers, Salesforce Admins and beginners as well as engineers with 20 years of experience have enjoyed our workshops and been inspired by each other.

Which airport should I fly into?

Three airports are accessible to our NYC venue: John F Kennedy International Airport, Laguardia Airport, or Newark Liberty International Airport.

How can I contact the organizers?

To contact the Write/Speak/Code organizers please email info@writespeakcode.com

What is the refund policy?

While we don't offer refunds, you can transfer your ticket to another person free of charge. Please reach out to  info@writespeakcode.com before transferring the ticket for verification.

How many people usually attend the conference?

We're expecting 300 attendees for this year's conference.

Is there dedicated networking time for sponsors to connect with conference attendees?

Sponsor representatives will get to network with attendees during lunch breaks, extended snack breaks, and conference parties.

Is there a sponsorship deadline for 2018?

The deadline for sponsorship depends upon the type and level of sponsorship. To sponsor the conference & conference related events, sponsors must commit by end of July. The sponsorship deadline for the local Own Your Expertise events will vary based on the local schedules.

My company wants to sponsor Write/Speak/Code. What do we do next?

Check out our 2018 Sponsorship Prospectus for information on sponsorship levels and benefits then email us at sponsor@writespeakcode.com.

What kind of childcare and eldercare will the conference provide?

Write/Speak/Code is proud to offer childcare and eldercare for all of our full-day events. Childcare will be available for the entire duration of the conference (4 days). In addition to noting childcare and/or eldercare on your registration when you purchase your ticket, please email info@writespeakcode.com with the following information:

Childcare: Age, dietary restrictions, and play/nap needs for each child.

Elder care: Dietary restrictions, medication schedules and any additional information we should know to provide appropriate care.

Childcare and Eldercare will take place on the premises unless specifically instructed otherwise.

Will the conference provide a private lactation room for attendees?

We will once again be offering a private Lactation Room for attendees during the conference. More information on room scheduling will be released leading up to the conference for those who request it. Please email info@writespeakcode.com.

Which accessibility services will be provided during the conference?

Write/Speak/Code 2018 will be held in an ADA accessible venue. ASL interpreters and/or CART services will be made available as needed. In addition to noting your needs on your registration, please also email info@writespeakcode.com if you require other accommodations. We're happy to do whatever we can to make your experience comfortable, safe, and welcoming.


text:
package xyz.zimuju.basekit.image;

/**
 * Created by Jixiang_Li on 2017/2/6.
 */

import android.graphics.BitmapRegionDecoder;

import java.io.IOException;
import java.io.InputStream;

public class InputstreamBitmapDecoderFactory implements BitmapDecoderFactory {
    private InputStream inputStream;

    public InputstreamBitmapDecoderFactory(InputStream inputStream) {
        super();
        this.inputStream = inputStream;
    }

    @Override
    public BitmapRegionDecoder made() throws IOException {
        return BitmapRegionDecoder.newInstance(inputStream, false);
    }

}


text:
.. _`Introduction`:

############
Introduction
############

The DDS Simulink Integration provides users with DDS custom blocks to model DDS communication between Simulink models and pure DDS applications.

DDS
***

**What is DDS?**

"The Data Distribution Service (DDS™) is a middleware protocol and API standard for data-centric connectivity from the Object Management Group® (OMG®). It integrates the components of a system together, providing low-latency data connectivity, extreme reliability, and a scalable architecture that business and mission-critical Internet of Things (IoT) applications need."

"The main goal of DDS is to share the right data at the right place at the right time, even between time-decoupled publishers and consumers. DDS implements global data space by carefully replicating relevant portions of the logically shared dataspace."  DDS specification

.. figure:: images/dds_overview.png
        :alt: DDS

**Further Documentation**

http://portals.omg.org/dds/

http://ist.adlinktech.com/

Simulink
********

**What is Simulink?**

"Simulink® is a block diagram environment for multidomain simulation and Model-Based Design. It supports system-level design, simulation, automatic code generation, and continuous test and verification of embedded systems. Simulink provides a graphical editor, customizable block libraries, and solvers for modeling and simulating dynamic systems. It is integrated with MATLAB®, enabling you to incorporate MATLAB algorithms into models and export simulation results to MATLAB for further analysis."   Simulink Help


text:
module Crichton
  module Descriptor
    class ResponseHeadersDecorator
      EXTERNAL = 'external'
      SOURCE = 'source'

      attr_reader :descriptor

      def initialize(descriptor, target)
        @descriptor = descriptor || {}
        @target = target
      end

      def to_hash
        @header ||= if external = descriptor[EXTERNAL]
          source = external[SOURCE]
          @target.respond_to?(source) ? respond_to_method(source) : {}
        else
          descriptor
        end
      end

      private
      def respond_to_method(method)
        @target.send(method).tap do |result|
          raise_if_invalid(!result.is_a?(Hash), throw("#{method} method on target must return Hash object"))
        end
      end

      def raise_if_invalid(condition, throw_function)
        throw_function.call if condition
      end

      def throw(message = '')
        ->(){ raise Crichton::TargetMethodResponseError, message }
      end
    end
  end
end


text:
#include "El.hpp"
using namespace El;

int
main( int argc, char* argv[] )
{
    Environment env( argc, argv );
    mpi::Comm comm = mpi::COMM_WORLD;
    const Int commSize = mpi::Size( comm );

    try
    {
        const bool colMajor = Input("--colMajor","column-major ordering?",true);
        const bool colMajorSqrt = Input("--colMajorSqrt","colMajor sqrt?",true);
        const Int m = Input("--height","height of matrix",100);
        const Int n = Input("--width","width of matrix",100);
        const bool print = Input("--print","print matrices?",false);
        ProcessInput();
        PrintInputReport();

        const GridOrder order = ( colMajor ? COLUMN_MAJOR : ROW_MAJOR );
        const GridOrder orderSqrt = ( colMajorSqrt ? COLUMN_MAJOR : ROW_MAJOR );

        // Drop down to a square grid, change the matrix, and redistribute back
        const Int commSqrt = Int(sqrt(double(commSize)));

        std::vector<int> sqrtRanks(commSqrt*commSqrt);
        for( Int i=0; i<commSqrt*commSqrt; ++i )
            sqrtRanks[i] = i;

        mpi::Group group, sqrtGroup;

        mpi::CommGroup( comm, group );
        mpi::Incl( group, sqrtRanks.size(), sqrtRanks.data(), sqrtGroup );

        const Grid grid( comm, order );
        const Grid sqrtGrid( comm, sqrtGroup, commSqrt, orderSqrt );

        DistMatrix<double> A(grid), ASqrt(sqrtGrid);

        Identity( A, m, n );
        if( print )
            Print( A, "A" );

        ASqrt = A;
        if( ASqrt.Participating() )
        {
            if( print )
                Print( ASqrt, "ASqrt := A" );
            ASqrt *= 2;
            if( print )
                Print( ASqrt, "ASqrt := 2 ASqrt" );
        }
        A = ASqrt;
        if( print )
            Print( A, "A := ASqrt" );

        const Grid newGrid( comm, order );
        A.SetGrid( newGrid );
        if( print )
            Print( A, "A after changing grid" );
    }
    catch( std::exception& e ) { ReportException(e); }

    return 0;
}


text:
import {OpaqueToken} from '@angular/core';

export const ArticleToken = new OpaqueToken('app.article');


text:
#include "OgreShaderProgramWriterManager.h"

namespace Ogre {

//-----------------------------------------------------------------------
template<>
RTShader::ProgramWriterManager* Singleton<RTShader::ProgramWriterManager>::ms_Singleton = 0;

namespace RTShader {
//-----------------------------------------------------------------------
ProgramWriterManager* ProgramWriterManager::getSingletonPtr(void)
{
	assert( ms_Singleton );
	return ms_Singleton;
}
//-----------------------------------------------------------------------
ProgramWriterManager& ProgramWriterManager::getSingleton(void)
{
	assert( ms_Singleton );
	return ( *ms_Singleton );
}
//-----------------------------------------------------------------------
ProgramWriterManager::ProgramWriterManager()
{

}
//-----------------------------------------------------------------------
ProgramWriterManager::~ProgramWriterManager()
{

}
//-----------------------------------------------------------------------
void ProgramWriterManager::addFactory(ProgramWriterFactory* factory)
{
	mFactories[factory->getTargetLanguage()] = factory;
}
//-----------------------------------------------------------------------
void ProgramWriterManager::removeFactory(ProgramWriterFactory* factory)
{
	// Remove only if equal to registered one, since it might overridden
	// by other plugins
	FactoryMap::iterator it = mFactories.find(factory->getTargetLanguage());
	if (it != mFactories.end() && it->second == factory)
	{
		mFactories.erase(it);
	}
}
//-----------------------------------------------------------------------
bool ProgramWriterManager::isLanguageSupported(const String& lang)
{
	FactoryMap::iterator i = mFactories.find(lang);

	return i != mFactories.end();
}
//-----------------------------------------------------------------------
ProgramWriter* ProgramWriterManager::createProgramWriter( const String& language)
{
	FactoryMap::iterator it = mFactories.find(language);

	if (it != mFactories.end())
	{
		return (it->second)->create();
	}

	OGRE_EXCEPT( Exception::ERR_ITEM_NOT_FOUND,
		"Could not create ShaderProgramWriter unknown language ",
		"ShaderProgramWriterManager::createProgramWriter" );
}

}
}


text:
<?php
namespace beaba {
    if ( !class_exists('react\\console', false) ) {
        class console {
            public static function log($msg) {
                echo '[log  ] ' . $msg . "\n";
            }
            public static function info($msg) {
                echo '[info ] ' . $msg . "\n";
            }
            public static function trace($msg) {
                echo '[trace] ' . $msg . "\n";
            }
            public static function warn($msg) {
                echo '[warn ] ' . $msg . "\n";
            }
            public static function error($msg) {
                echo '[error] ' . $msg . "\n";
            }
            public static function debug($msg) {
                echo '[debug] ' . $msg . "\n";
            }
        }
        class package {
            private $helpers;
            private $name;
            public function __construct(array $helpers, $name) {
                $this->helpers = $helpers;
                $this->name = $name;
            }
            public function __call($helper, $args) {
                if ( isset($this->helpers[$helper]) ) {
                    return call_user_func_array($this->helpers[$helper], $args);
                } else {
                    throw new \BadMethodCallException (
                        'Undefined helper ' . $this->name . '::' . $helper
                    );
                }
            }
        }
        class json implements \ArrayAccess {
            private $data;
            public function __construct($data) {
                if ( is_string($data)) {
                    $data = json_decode($data, true);
                }
                if ( $data instanceof json ) {
                    $data = $data->getData();
                }
                $this->data = $data;
            }
            public function merge($data) {
                $this->data = array_replace(
                    $this->data,
                    $data instanceof json ?
                    $data->getData() : $data
                );
            }
            public function getData() {
                return $this->data;
            }
            public function __get($key) {
                if (!isset($this->data[$key])) {
                    return null;
                }
                if(is_array($this->data[$key])) {
                    $this->data[$key] = new self($this->data[$key]);
                }
                return $this->data[$key];
            }
            public function __set($key, $value) {
                $this->data[$key] = $value;
            }
            public function __isset($key) {
                return isset($this->data[$key]);
            }
            public function offsetExists($offset) {
                return isset($this->data[$offset]);
            }
            public function offsetGet($offset) {
                return $this->__get($offset);
            }
            public function offsetSet($offset, $value) {
                $this->__set($offset, $value);
            }
            public function offsetUnset($offset) {
                unset($this->data[$offset]);
            }
        }
        class app {
            public function init() { }
            public function request($req, $res) { }
        }
        class process {
            public static $thread;
            public static $wait;
            public static $servers;
            public static $config;
            public static $env;
            public static function start() {
                self::$wait = true;
                /** light autoload system **/
                spl_autoload_register(function($class) {
                    if (substr_compare($class, 'react\\', 0, 6) === 0) {
                        require_once( REACT_PATH . '/' . strtr(substr($class, 6), '\\', '/') . '.php');
                        return true;
                    } else return false;
                }, true);
                /** catch errors **/
                $errorManager = function($error, $desc = null) {
                    if ( !empty($error) ) {
                        if ( $error instanceof \Exception) {
                            console::error($error->__toString());
                            process::stop(2);
                        } else {
                            console::error($desc);
                            debug_print_backtrace();
                        }
                    }
                    return true;
                };
                set_error_handler($errorManager, E_ALL);
                set_exception_handler($errorManager);
                /** loading the env conf **/
                if (empty(self::$env)) {
                    if (file_exists('configuration.json')) {
                        self::$config = new json(
                            file_get_contents('configuration.json')
                        );
                        self::$env = new json(self::$config->env->default);
                        if (!empty(self::$config->current)) {
                            self::$env->merge(
                                self::$config->env[self::$config->current]
                            );
                        }
                    }
                }
            }
            public static function serve($server) {
                self::$servers[] = $server;
                console::trace('Register ' . get_class($server));
                return $server;
            }
            public static function stop($code = 0) {
                if ( self::$thread ) {
                    self::$thread->close();
                } else {
                    if ( self::$wait ) {
                        self::$wait = false;
                    }
                    var_dump(self::$servers);
                    console::log('Program exits with code ' . $code);
                    exit($code);
                }
            }
        }
    }
}
namespace {
    use go\console;
    use react\process;
    /** modular functions **/
    if (!function_exists('react')) {
        function react($package) {
            static $packages = array();
            if ( !isset($packages[$package]) ) {
                $packages[$package] = new \react\package(
                    include(REACT_PATH . '/' . $package. '/package.php'),
                    $package
                );
            }
            return $packages[$package];
        }
    }
    /** main bootstrap **/
    defined('REACT_PATH') or  define('REACT_PATH', __DIR__);
    defined('THREAD_CONTEXT') or define(
        'THREAD_CONTEXT',
        PTHREADS_INHERIT_ALL
        // PTHREADS_INHERIT_CLASSES | PTHREADS_INHERIT_FUNCTIONS
    );
    if ( empty($this) ) {
        /** test compatibility **/
        if (!extension_loaded('libevent')) {
            console::error('The [libevent] extension is *REQUIRED*');
            process::stop(1);
        }
        if (!extension_loaded('pthreads')) {
            console::error('The [pthreads] extension is *REQUIRED*');
            process::stop(1);
        }
        console::debug('Starting the main process');
        /** run servers **/
        register_shutdown_function(function() {
            if ( process::$wait ) {
                console::debug('Starting the server');
                while(process::$wait) {
                    foreach(process::$servers as $id => $server) {
                        if ($server && !$server->isRunning()) {
                            //$server->join();
                            console::trace('server ' .$id . ' is closed');
                            unset(process::$servers[$id]);
                        }
                    }
                    if (empty(process::$servers)) break;
                    sleep(1);
                    console::trace('main loop');
                }
            }
            console::info('Stopping threads...');
            foreach(process::$servers as $server) {
                if ( $server ) {
                    $server->close();
                    $server->join();
                }
            }
        });
    } else {
        process::$thread = $this;
        var_dump(process::$servers);
        console::trace('init thread ' . $this->getThreadId());
    }
    process::start();

}


text:
<?php

namespace Bpocallaghan\Titan\Http\Controllers\Website;

use Bpocallaghan\Titan\Models\Article;
use App\Http\Requests;
use Illuminate\Http\Request;
use Illuminate\Pagination\LengthAwarePaginator;

class BlogController extends WebsiteController
{
    public function index()
    {
        $perPage = 6;
        $page = input('page', 1);
        $baseUrl = config('app.url') . '/blog';
        $items = Article::whereHas('photos')->with('photos')->active()->orderBy('active_from', 'DESC')->get();

        $total = $items->count();

        // paginator
        $paginator = new LengthAwarePaginator($items->forPage($page, $perPage), $items->count(),
            $perPage, $page, ['path' => $baseUrl, 'originalEntries' => $total]);

        // if pagination ajax
        if (request()->ajax()) {
            return response()->json(view('website.blog.pagination')
                ->with('paginator', $paginator)
                ->render());
        }

        return $this->view('titan::blog.blog')->with('paginator', $paginator);
    }

    public function show($newsSlug)
    {
        $item = Article::with('photos')->where('slug', $newsSlug)->first();
        if (!$item) {
            return redirect('/blog');
        }

        $this->addBreadcrumbLink($item->title, false);

        return $this->view('titan::blog.article_show')->with('article', $item);
    }
}


text:
/*eslint-env mocha*/
import chai, {assert} from 'chai';
import sinon from 'sinon';
import frontexpress from '../lib/frontexpress';
import Requester from '../lib/requester';

describe('Test sample from README', () => {
    let window, requester;

    beforeEach(() => {
        global.document = {};
        global.window = {
            location: {
                pathname: '/',
                search: ''
            },
            addEventListener(eventType, callback) {}
        };
        requester = new Requester();
        sinon.stub(requester, 'fetch', ({uri, method, headers, data}, resolve, reject) => {
            resolve(
                {uri, method, headers, data},
                {status: 200, statusText: 'OK', responseText:''}
            );
        });
    });

    it('main sample', (done) => {
        const app = frontexpress();

        // listen HTTP GET request on path (/)
        app.get('/', (req, res) => {
            done();
        });

        // start listening frontend application requests
        app.listen();

        //simulate readystatechange
        document.readyState = 'interactive';
        document.onreadystatechange();
    });

    it('route handlers', (done) => {
        const spy_log = sinon.spy();

        const h1 = (req, res, next) => { spy_log('h1!'); next(); };
        const h2 = (req, res, next) => { spy_log('h2!');};
        const h3 = (req, res, next) => { spy_log('h3!'); next(); };

        const app = frontexpress();
        app.set('http requester', requester);

        app.get('/example/a', h1);
        app.get('/example/a', h2);
        app.get('/example/a', h3);

        // start listening frontend application requests
        app.listen();

        // simulate readystatechange
        document.readyState = 'interactive';
        document.onreadystatechange();

        // make an ajax request on /example/a
        app.httpGet('/example/a', (req, res) => {
            assert(spy_log.calledTwice);
            assert(spy_log.withArgs('h1!').calledOnce);
            assert(spy_log.withArgs('h2!').calledOnce);
            assert(spy_log.neverCalledWith('h3!'));
            done();
        });
    });

    it('app.route()', (done) => {
        const spy_log = sinon.spy();

        const app = frontexpress();
        app.set('http requester', requester);

        app.route('/book')
            .get((req, res) => { spy_log('Get a random book');})
            .post((req, res) => { spy_log('Add a book');})
            .put((req, res) => { spy_log('Update the book');});

        // start listening frontend application requests
        app.listen();

        // simulate readystatechange
        document.readyState = 'interactive';
        document.onreadystatechange();

        // make an ajax request on /book
        app.httpGet('/book', (req, res) => {
            app.httpPost('/book', (req, res) => {
                app.httpPut('/book', (req, res) => {
                    // Yes I know Promise :-) Next evolution
                    assert(spy_log.callCount === 3);
                    assert(spy_log.withArgs('Get a random book').calledOnce);
                    assert(spy_log.withArgs('Add a book').calledOnce);
                    assert(spy_log.withArgs('Update the book').calledOnce);
                    done();
                });
            });
        });
    });

    it('frontexpress.Router', (done) => {
        const spy_log = sinon.spy();

        const router = frontexpress.Router();

        // middleware which is specific to this router
        router.use((req, res, next) => {
            spy_log(`Time: ${Date.now()}`);
            next();
        });

        // react on home page route
        router.get('/', (req, res) => {
            spy_log('
Birds home page
');
        });

        // react on about route
        router.get('/about', (req, res) => {
            spy_log('
About birds
');
        });

        const app = frontexpress();
        app.set('http requester', requester);
        app.use('/birds', router);

        // make an ajax request on /birds
        app.httpGet('/birds/', (req, res) => {
            assert(spy_log.callCount === 2);
            assert(spy_log.withArgs('
Birds home page
').calledOnce);
            assert(spy_log.neverCalledWith('
About birds
'));

            spy_log.reset();
            // make an ajax request on /birds/about
            app.httpGet('/birds/about', (req, res) => {
                assert(spy_log.callCount === 2);
                assert(spy_log.withArgs('
About birds
').calledOnce);
                assert(spy_log.neverCalledWith('
Birds home page
'));
                done();
            });
        });

    });
});


text:
<?php
/*
 * This file is part of Lizard.
 *
 * @author zqhong <i@zqhong.com>
 * @date 2016/10/2 10:10
 * @namespace Commands\Reply
 * @filename AddReplyCommand.php
 * @encoding UTF-8
 */

namespace Lizard\Commands\Reply;

use Lizard\Events\AfterAddReplyEvent;
use Lizard\Events\BeforeAddReplyEvent;
use Lizard\Models\Reply;

final class AddReplyCommand
{
    /**
     * @var int
     */
    protected $thread_id;

    /**
     * @var int
     */
    protected $user_id;

    /**
     * @var string
     */
    protected $original_body;

    /**
     * @var string
     */
    protected $body;

    /**
     * @var string
     */
    protected $user_agent;

    /**
     * AddReplyCommand constructor.
     *
     * @param int $thread_id
     * @param int $user_id
     * @param string $original_body
     * @param string $body
     * @param string $user_agent
     */
    public function __construct($thread_id, $user_id, $original_body, $body, $user_agent)
    {
        $this->thread_id = $thread_id;
        $this->user_id = $user_id;
        $this->original_body = $original_body;
        $this->body = $body;
        $this->user_agent = $user_agent;
    }

    /**
     * Add a reply.
     *
     * @return Reply
     */
    public function handle()
    {
        $data = [
            'thread_id' => $this->thread_id,
            'user_id' => $this->user_id,
            'original_body' => $this->original_body,
            'body' => $this->body,
            'user_agent' => $this->user_agent,
        ];

        event(new BeforeAddReplyEvent($data));

        $reply = Reply::create($data);

        event(new AfterAddReplyEvent($reply));

        return $reply;
    }
}


text:
echo "prefix=$1
exec_prefix=\${prefix}
libdir=\${prefix}/lib
includedir=\${prefix}/include/QtKOAuth

Name: KQOAuth
Description: Qt OAuth support library
Version: $2
Requires: QtCore QtNetwork
Libs: -L\${libdir} -lkqoauth
Cflags: -I\${includedir}" > kqoauth.pc


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

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>Convert Multi-Markdown to HTML — Editorial Documentation</title>
    <link rel="stylesheet" href="../../_static/pythonista.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />

    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within Editorial Documentation"
          href="../../_static/opensearch.xml"/>
    <link rel="author" title="About these documents" href="../../about.html" />
    <link rel="copyright" title="Copyright" href="../../copyright.html" />
    <link rel="top" title="Editorial Documentation" href="../../index.html" />
    <link rel="shortcut icon" type="image/png" href="../../_static/py.png" />
    <meta name = "viewport" content = "width=device-width; initial-scale=1.0; minimum-scale=1.0; maximum-scale=1.0">

Navigation

          index

          modules |

Editorial Documentation »

Convert Multi-Markdown to HTML¶

Converts Multi-Markdown text (given as input) to HTML

The Preview panel uses the same kind of conversion, but the output of this action doesn’t include any (CSS) styling by default.

You can use the Template parameter to build a complete HTML document that can include placeholders for metadata headers, e.g. <tt class="docutils literal">{{META:Title}}</tt>.

The <tt class="docutils literal">{{CONTENT}}</tt> placeholder in the template is replaced with the actual HTML code. While you should usually keep it, it is also possible to use this action to extract only metadata headers (see above), and not convert the actual document.

For more information about the Multi-Markdown syntax, please see the MultiMarkdown Syntax Guide by Fletcher T. Penney.

Input: The Multi-Markdown source text

Output: The converted HTML

See Also¶

Convert Markdown to HTML

Show HTML

    © Copyright 1990-2017, Python Software Foundation.

    The Python Software Foundation is a non-profit corporation.
    Please donate.

    Last updated on Jan 16, 2017.
    Found a bug?

    Created using Sphinx 1.0.7.


text:
/******************************************************************************
 User reactions (e.g. like, unlike)
*******************************************************************************/

'use strict';

var _ = require('underscore'),
    logger = require('../logger'),
    valid_reactions = ['up', 'down'];

module.exports = function(options, instance, self) {
  var storage = self.storage,
      plugins = self.plugins;

  // -------------------------------- REPORT -----------------------------------

  self.react = function(socket, payload) {
    if (!self.validatePayloadID(socket, payload, 'react')) {
      self.fail(payload);
      return;
    }
    var app_id = socket.app_id,
        id = payload.id,
        reaction = payload.reaction || '',
        user = socket.fruum_user;

    if (user.get('anonymous')) {
      logger.error(app_id, 'react_anonymous_noperm', user);
      socket.emit('fruum:react');
      self.fail(payload);
      return;
    }
    storage.get(app_id, id, function(document) {
      if (!document) {
        logger.error(app_id, 'react_invalid_doc', '' + id);
        socket.emit('fruum:react');
        self.fail(payload);
        return;
      }
      // process plugins
      var plugin_payload = {
        app_id: app_id,
        document: document,
        reaction: reaction,
        user: user,
      };
      plugins.beforeReact(plugin_payload, function(err, plugin_payload) { // eslint-disable-line
        document = plugin_payload.document || document;
        if (plugin_payload.storage_noop) {
          socket.emit('fruum:react', document.toJSON());
          self.success(payload);
          return;
        }
        logger.info(app_id, 'update_reaction_' + reaction + ':' + document.get('id'), user);
        // success
        var username = user.get('username'),
            attributes = {},
            reaction_list = document.get('react_' + reaction),
            has_reaction = false,
            balance = 0;

        if (reaction_list && reaction_list.indexOf(username) >= 0) {
          has_reaction = true;
        }
        // remove from previous reactions
        _.each(valid_reactions, function(entry) {
          var field = 'react_' + entry,
              list = document.get(field);
          if (!list) return;
          var len = list.length;
          list = _.without(list, username);
          if (len != list.length) balance--;
          if (entry === reaction && !has_reaction) {
            list.push(username);
            balance++;
          }
          document.set(field, list);
          attributes[field] = list;
        });
        storage.update(app_id, document, attributes, function(updated_doc) {
          if (updated_doc) {
            self.invalidateDocument(app_id, updated_doc);
            socket.emit('fruum:react', updated_doc.toJSON());
            self.broadcast(user, updated_doc);
            plugin_payload.document = updated_doc;
            plugin_payload.balance = balance;
            plugins.afterReact(plugin_payload, function() {
              self.success(payload);
            });
          } else {
            socket.emit('fruum:react');
            self.fail(payload);
          }
        });
      });
    });
  };
};


text:
| Getting you to Feathers' **ah-ha** moment as quickly as possible.

Let's write some Feathers code
because once we understand that Feathers generators will be straight forward.

## Is anything wrong, unclear, missing?
[Leave a comment.](https://github.com/eddyystop/feathers-an-introduction/issues/new?title=Comment:Step-Basic-Readme&body=Comment:Step-Basic-Readme)


text:
function BitwigController() {
  var controller = this, util = new ImpulseUtil(this);
  this.util = util;

  this.defaultTemplateTitle = 'Bitwig';
  this.sysexHeader = 'F0 00 20 29 67';
  this.tracksPerPage = 8;
  this.trackBankPage = 0;

  // Device state values.
  this.shiftPressed = false;
  this.loopPressed = false;
  this.forwardPressed = false;
  this.rewindPressed = false;
  this.mixerPage = 0;
  this.mixerPages = ['Mixer', 'Pan', 'Send', 'Record', 'Solo', 'Mute'];

  this.pad1Pressed = false;
  this.pad2Pressed = false;
  this.pad3Pressed = false;
  this.pad4Pressed = false;
  this.pad5Pressed = false;
  this.pad6Pressed = false;
  this.pad7Pressed = false;
  this.pad8Pressed = false;

  this.midiRotary1Value = 0;
  this.midiRotary2Value = 0;
  this.midiRotary3Value = 0;
  this.midiRotary4Value = 0;
  this.midiRotary5Value = 0;
  this.midiRotary6Value = 0;
  this.midiRotary7Value = 0;
  this.midiRotary8Value = 0;

  this.state = {
    mode: 'performance',
    performance: {
      page: 'plugin', // Init the performance mode in plugin state by default.
      mixerPage: 0
    },
    daw: {
      page: 'mixer', // Init the daw mode in mixer state by default.
      mixerPage: 0
    },
    display: {
      text: '',
      value: '',
      host: ''
    },
    textDisplayTimeouts: {
      text: -1,
      value: -1,
      host: -1
    },
    pads: {
      useAsButtons: false,
      blinkIntervalId: false,
      blinking: {},
      1: {
        down: false,
        lastPress: 0
      },
      2: {
        down: false,
        lastPress: 0
      },
      3: {
        down: false,
        lastPress: 0
      },
      4: {
        down: false,
        lastPress: 0
      },
      5: {
        down: false,
        lastPress: 0
      },
      6: {
        down: false,
        lastPress: 0
      },
      7: {
        down: false,
        lastPress: 0
      },
      8: {
        down: false,
        lastPress: 0
      }
    },
    tracks: {
      currentOffset: 0,
    },
    deviceParamPage: 0
  };

  // TODO documentation
  this.defaultVelocityTranslationTable = [];
  this.silentVelocityTranslationTable = [];
  for (var i=0;i<128;i++) {
    this.defaultVelocityTranslationTable.push(i);
    this.silentVelocityTranslationTable.push(0);
  }

  this.device = {
    vendor:           'Novation',
    name:             'Impulse 25',
    version:          '1.1',
    uuid:             '3B1F8670-2433-11E2-81C1-0800200C9A66',
    numMidiOutPorts:  2,
    numMidiInPorts:   1
  };

  // These are all hardcoded CC values that can't be modified on the impulse.
  // All settings that *can* be modified are set in the template (Impulse.template.js).

  this.faders = {
    channel:        49,
    master:         8
  };

  this.buttons = {
    midi:           8,
    mixer:          9,
    plugin:         10,
    pageUp:         11,
    pageDown:       12,
    rewind:         27,
    forward:        28,
    stop:           29,
    play:           30,
    loop:           31,
    record:         32,
    midiMode:       33,
    mixerMode:      34,
    nextTrack:      37,
    prevTrack:      38,
    shift:          39
  };

  this.clips = {
    clip1:          60,
    clip2:          61,
    clip3:          62,
    clip4:          63,
    clip5:          64,
    clip6:          65,
    clip7:          66,
    clip8:          67
  };

  this.midiIns = [];
  this.noteInputs = [];

  this.init = function() {
    this.cursorTrack = host.createArrangerCursorTrack(this.tracksPerPage, 0);
    this.cursorDevice = host.createCursorDevice();
    //this.browser = this.cursorDevice.createDeviceBrowser(5, 7);
    this.trackBank = host.createTrackBank(this.tracksPerPage, 0, 0); // numTracks, numSends, numScenes
    this.mainTrack = host.createMasterTrack(0);
    this.transport = host.createTransport();
    this.application = host.createApplication();

    this.template = new ImpulseTemplate({
      title: this.defaultTemplateTitle
    });
    this.events = new ImpulseEvents(this.template, this);
    // Note: We declared util in the ImpulseController class. So it's available in all class functions.

    var midiCallback = function(status, data1, data2) {
      controller.events.onMidi.call(controller.events, status, data1, data2);
    };

    var sysexCallback = function(data) {
      controller.events.onSysex.call(controller.events, data);
    };

    // Map all device midi out ports to host in ports.
    for (var i=0;i<impulse25.device.numMidiOutPorts;i++) {
      this.midiIns[i] = host.getMidiInPort(i);
      this.midiIns[i].setMidiCallback(midiCallback);
      this.midiIns[i].setSysexCallback(sysexCallback);
    }

    this.createNoteInputs();

    // Send host midi clock to device in ports.
    for (i=0;i<impulse25.device.numMidiInPorts;i++) {
      host.getMidiOutPort(i).setShouldSendMidiBeatClock(true);
    }

    this.sysexHeader = 'F0 00 20 29 67';
    sendSysex(this.sysexHeader + ' 06 01 01 01 F7');

    /*
    var actions = this.application.getActions();
    for (var property in actions) {
      println(property + ': ' + actions[property].getId() + ': ' + actions[property].getName());
    }
    */

    // Init the default shift state.
    controller.shiftPressed = false;
    controller.setDefaultVelocityTranslationTable();

    sendMidi(0xb1, this.buttons.plugin, 0x0); // Initialize the impulse on the device page.

    // Both of these observer are *not* documented :)
    this.cursorTrack.addNameObserver(16, "", function(text) {
      controller.currentTrackName = text;
      // The cursorTrack.addPositionObserver fires before this, so we update the current
      // track info there instead of here.
    });

    this.cursorTrack.addPositionObserver(function(index) {
      controller.activeTrack = parseInt(index, 10);
      // The offset gets set in a later observer causing function calls made here
      // to return incorrect state data. We work around that by manually setting
      // the track offset wihch a bit later gets set again in another observer.
      controller.state.tracks.currentOffset = index - index % 8;
      controller.scrollToTrackBankPage();
      controller.displayModePageTrackOnHost();
      var duration = 'mixer' == controller.getPage() ? 1500 : 0;
      //controller.setTextDisplay(controller.getTrackDisplayText(), 'text', duration);

      if ('mixer' == controller.getPage()) {
        controller.setTextDisplayDefault(controller.getMixerStatusStr, 'text');
        //println('pos: ' + index + ' ' + controller.state.tracks.currentOffset);
        controller.setTextDisplayDefault(controller.getMixerValueText(), 'value');
        controller.updateTrackDetailsOnDisplay(index, 80, 1000)
      }
      else {
        controller.updateTrackDetailsOnDisplay(index, 100);
      }
    });

    this.trackBank.addTrackScrollPositionObserver(function(value) {
      var c = controller;
      c.state.tracks.currentOffset = value;
      if (c.state.pads.useAsButtons) {
        // We only reset the pads since the mute, solo and arm observers
        // handle updating the pad lights by themselves.
        c.resetPads();
      }
    }, 0);

    this.cursorDevice.addNameObserver(20, 'none', function(name) {
      controller.displayModePageTrackOnHost();
    });

    this.cursorDevice.addPositionObserver(function(index) {
      controller.activeDeviceIndex = index;
    });

    this.cursorDevice.hasDrumPads().addValueObserver(function(value) {
      controller.currentDevicehasDrumpads = value;
    });

    this.transport.addIsLoopActiveObserver(function(value) {
      controller.isLoopActive = value;
    });

    for (i=0;i<this.tracksPerPage;i++) {
      var track = this.trackBank.getChannel(i);
      track.getMute().addValueObserver((function() {
        var c = controller;
        var index = i;
        return function(value) {
          var tracks = c.state.tracks;
          var realIndex = tracks.currentOffset + index + 1;
          if ('undefined' == typeof tracks[realIndex]) {
            tracks[realIndex] = {
              mute: false,
              solo: false,
              arm: false
            };
          }
          tracks[realIndex].mute = value;
          if (c.state.pads.useAsButtons) {
            c.trackMuteChanged(realIndex - 1, value);
          }
        };
      })());

      track.getSolo().addValueObserver((function() {
        var c = controller;
        var index = i;
        return function(value) {
          var tracks = c.state.tracks;
          var realIndex = tracks.currentOffset + index + 1;
          if ('undefined' == typeof tracks[realIndex]) {
            tracks[realIndex] = {
              mute: false,
              solo: false,
              arm: false
            };
          }
          tracks[realIndex].solo = value;
          if (c.state.pads.useAsButtons) {
            c.trackSoloChanged(realIndex - 1, value);
          }
        };
      })());

      track.getArm().addValueObserver((function() {
        var c = controller;
        var index = i;
        return function(value) {
          var tracks = c.state.tracks;
          var realIndex = tracks.currentOffset + index + 1;
          if ('undefined' == typeof tracks[realIndex]) {
            tracks[realIndex] = {
              mute: false,
              solo: false,
              arm: false
            };
          }
          tracks[realIndex].arm = value;
          if (c.state.pads.useAsButtons) {
            c.trackArmChanged(realIndex - 1, value);
          }
        };
      })());
    }

    this.notifications = host.getNotificationSettings();
    this.notifications.setShouldShowChannelSelectionNotifications(true);
    this.notifications.setShouldShowDeviceLayerSelectionNotifications(true);
    this.notifications.setShouldShowDeviceSelectionNotifications(true);
    this.notifications.setShouldShowMappingNotifications(true);
    this.notifications.setShouldShowPresetNotifications(true);
    this.notifications.setShouldShowSelectionNotifications(true);
    this.notifications.setShouldShowTrackSelectionNotifications(true);
    this.notifications.setShouldShowValueNotifications(true);
  };

  this.highlightModifyableTracks = function() {
    var track, send;
    var page = this.state[this.state.mode].page;
    var mixerPage = this.state[this.state.mode].mixerPage;

    for (var i=0;i<this.tracksPerPage;i++) {
      track = this.trackBank.getChannel(i);
      if (track && track.exists()) {
        track.getVolume().setIndication('mixer' == page && mixerPage === 0);
        track.getPan().setIndication('mixer' == page && mixerPage === 1);
        send = track.getSend(0);
        if (send) {
          send.setIndication('mixer' == page && mixerPage === 2);
        }
      }
    }
  };

  this.moveTransport = function(amount) {
    this.transport.incPosition(amount, false);

    if ((amount > 0 && this.forwardPressed) || (amount < 0 && this.rewindPressed)) {
      host.scheduleTask(function(amount) {
        controller.moveTransport.call(controller, amount);
      }, [amount], 5);
    }
  };

  this.getTextSysexMessage = function(text, location) {
    text = text || '';
    // The value display has 3 characters, the text display 8.
    var length = 'value' == location ? 3 : 8;
    var sysexCode = 'value' == location ? '09' : '08';
    return controller.sysexHeader + sysexCode + ' ' + text.forceLength(length).toHex(length) +' F7';
  };

  this.scrollToTrackBankPage = function(page) {
    if ('undefined' == typeof page) {
      // Reset the mixer page to the one of the currently selected track.
      page = Math.floor(this.activeTrack / this.tracksPerPage);
    }
    if (page != this.trackBankPage) {
      var diff = this.trackBankPage - page;
      for (var i=0;i<Math.abs(diff);i++) {
        // Honestly, I don't understand why we need to scroll a page up but
        // decrease the trackBankPage value.
        // But otherwise the indicators for the selected trackbank went into the
        // wrong direction :)
        if (diff > 0) {
          this.trackBank.scrollTracksPageUp();
          this.trackBankPage--;
        }
        else {
          this.trackBankPage++;
          this.trackBank.scrollTracksPageDown();
        }
      }
      this.highlightModifyableTracks();
    }
  };

  this.createNoteInputs = function() {
    for (var i=0;i<this.device.numMidiOutPorts;i++) {
      // Set up note input to ignore the last midi channel.
      this.noteInputs[i] = this.midiIns[i].createNoteInput('Impulse keyboard ' + i);

      // For some reason, when creating a note input the rotary 2 would stop working
      // because the midi event gets handled/consumed as note input and does not
      // call our this.onMidiEvent.
      // We work around this by telling bitwig, that the note inputs should not
      // consume the midi events, which means that all midi events get passed along
      // to our midi callbacks.
      this.noteInputs[i].setShouldConsumeEvents(false);
    }
  };

  this.setVelocityTranslationTable = function(table) {
    for (var i=0;i<this.noteInputs.length;i++) {
      this.noteInputs[i].setVelocityTranslationTable(table);
    }
  };

  this.setDefaultVelocityTranslationTable = function() {
    this.setVelocityTranslationTable(this.defaultVelocityTranslationTable);
  };

  this.setSilentVelocityTranslationTable = function() {
    this.setVelocityTranslationTable(this.silentVelocityTranslationTable);
  };

  this.sendMidiToBitwig = function(status, data1, data2) {
    for (var i=0,len=this.noteInputs.length;i<len;i++) {
      this.noteInputs[i].sendRawMidiEvent(status, data1, data2);
    }
  };

  this.setMacroIndications = function(value) {
    for (var i=0;i<8;i++) {
      this.cursorTrack.getPrimaryInstrument().getMacro(i).getAmount().setIndication(value);
    }
  };

  this.setPluginIndications = function(value) {
    var start = 0;
    for (var i=start;i<start+8;i++) {
      this.cursorDevice.getParameter(i).setIndication(value);
    }
  };

  this.setMode = function(mode) {
    this.state.mode = mode;
    var pageText = this.getPageText();

    // We want to revert to the current page after showing the new mode.
    this.setTextDisplayDefault(pageText, 'text');
    var modeText = 'daw' == mode ? 'Edi' : 'Per';
    this.setTextDisplay(modeText, 'value', 2000);
    this.setPage(this.state[mode].page);
  };

  this.setPage = function(page, updateDisplayedTexts) {
    updateDisplayedTexts = updateDisplayedTexts || true;

    var mode = this.getMode()
    this.state[mode].page = page;

    var setPluginIndicationsPerformance = 'performance' == mode && 'plugin' == page && this.shiftPressed;
    var setPluginIndicationsDaw = 'daw' == mode && 'plugin' == page;

    if ('performance' == this.getMode()) {
      if ('mixer' == page) {
        this.setMacroIndications(false);
        this.setPluginIndications(false);
      }
      else {
        this.setMacroIndications(!this.shiftPressed);
        this.setPluginIndications(this.shiftPressed);
      }
    }
    else {
      if ('mixer' == page) {
        this.setMacroIndications(false);
        this.setPluginIndications(false);
      }
      else {
        this.setMacroIndications(this.shiftPressed);
        this.setPluginIndications(!this.shiftPressed);
      }
    }

    //controller.setPluginIndications(setPluginIndicationsPerformance || setPluginIndicationsDaw);
    controller.highlightModifyableTracks();

    // Set the page indicators accordingly.
    sendMidi(0xB1, controller.buttons[page], 0x0);

    this.usePadsAsButtons('mixer' == page);

    if (updateDisplayedTexts) {
      //var pageText = this.getPageText();
      this.displayModePageTrackOnHost();

      switch (this.getPage()) {
        case 'mixer':
          this.setTextDisplay(this.getMixerStatusStr);
          this.setTextDisplay(this.getMixerValueText(), 'value');
          break;

        case 'midi':
          this.setTextDisplay(this.getClipStatusStr);
          break;

        default:
          this.setTextDisplay(this.getTrackDisplayText(), 'text');
      }
    }
  };

  this.getMixerValueText = function() {
    var offset = this.state.tracks.currentOffset;
    return (offset < 10 ? '0' : '') + (offset + 1) + '-';
  };

  this.getTrackValueText = function(trackIndex) {
    var text = '';
    var track = this.state.tracks[trackIndex + 1];
    text += track.mute ? 'M' : ' ';
    text += track.solo ? 'S' : ' ';
    text += track.arm ? 'R' : ' ';

    return text;
  };

  this.getTrackDisplayText = function(index) {
    index = 'undefined' == typeof index ? this.activeTrack + 1 : index;
    return (this.activeTrack + 1) + this.currentTrackName;

  };

  this.getMixerStatusStr = function() {
    // Showing the track numbers is not really helpful.
    // Let's stick with the current track name for now.
    return controller.getTrackDisplayText(controller.state.tracks.currentOffset);
    /*
    var str = '', c = controller, offset = c.state.tracks.currentOffset;
    for (var i=1;i<9;i++) {
      str += i;
    }
    return str;
    */
  };

  this.getClipStatusStr = function() {
    return 'Clip Status';
  };

  this.getPage = function() {
    return this.state[this.state.mode].page;
  };

  this.getMode = function() {
    return this.state.mode;
  };

  this.getPageText = function() {
    switch (this.getPage()) {
      case 'mixer':
        return 'Mix';

      case 'midi':
        return 'Clp';

      default:
        return 'Plg';
    }
  };

  this.setTextDisplayDefault = function(text, location) {
    location = location || 'text';
    this.state.display[location] = text;
  };

  this.setTextDisplayToDefault = function(location) {
    location = location || 'text';
    controller._outputText(controller.state.display[location], location);
  };

  this.setTextDisplay = function(text, location, duration, delay) {
    text = text || '';
    location = location || 'text';
    duration = duration || 0;
    delay = delay || 0;

    var callback = function() {
      controller._setTextDisplay(text, location, duration);
    };

    if (delay > 0) {
      util.setTimeout(callback, [], delay);
    }
    else {
      callback();
    }
  };

  this._setTextDisplay = function(text, location, duration) {
    location = location || 'text';
    duration = duration || 0;

    if (0 === duration) {
      // Only set the text to fallback to if the text we show should be visible permanently.
      this.setTextDisplayDefault(text, location);
    }

    // Clear any possible timeouts. If we set the display with a timeout and before
    // that timeout gets executed set the display text again, we don't want the
    // old timeout to mess with the new text.
    util.clearTimeout(this.state.textDisplayTimeouts[location]);
    this._outputText(text, location);

    if (duration > 0) {
      this.state.textDisplayTimeouts[location] = util.setTimeout(function(location) {
        controller._outputText(controller.state.display[location], location);
      }, [location], duration);
    }
  };

  this._outputText = function(text, location) {
    location = location || 'text';
    if ('function' == typeof text) {
      text = text();
    }

    if ('host' == location) {
      host.showPopupNotification(text);
    }
    else {
      sendSysex(controller.getTextSysexMessage(text, location));
    }
  };

  this.displayModePageTrackOnHost = function() {
    var mode = this.state.mode;
    var page = this.state[mode].page;
    var modeText = 'daw' == mode ? 'Edit' : 'Perform';
    var pageText = page.substr(0, 1).toUpperCase() + page.substr(1);
    this.setTextDisplay(modeText + ' / ' + pageText + ' / ' + this.currentTrackName, 'host');
  };

  this.usePadsAsButtons = function(value) {
    value = !!value;
    this.state.pads.useAsButtons = value;
    this.updatePadLights();
  };

  this.updatePadLights = function(delay) {
    delay = 'undefined' == typeof delay ? 100 : delay;
    var value = 0, blink = false, c = controller, track;

    if (c.state.pads.useAsButtons) {
      var tracks = c.state.tracks;
      var offset = c.state.tracks.currentOffset;
      for (var i=offset;i<offset+8;i++) {
        controller.updatePadLight(i);
      }
    }
  };

  this._setPadLight = function(index, value, blink) {
    var c = controller;
    blink = blink || false;
    cc = c.template.data['pad' + (index % 8 + 1) + 'Note'];
    //println('set pad ' + index + ' / ' + cc + ' to ' + value);
    sendMidi(0xB0, '0x' + cc, value);
    // The value we assign only hold the information whether or not it's currently
    // on or off.
    if (blink) {
      c.state.pads.blinking[index + 1] = !!value;
      if (false === c.state.pads.blinkIntervalId) {
        c.state.pads.blinkIntervalId = util.setInterval(c.padBlinkingHandler, [], 700);
      }
    }
    else {
      delete c.state.pads.blinking[index + 1];
    }
  }

  this.padBlinkingHandler = function() {
    var blinkPads = [], c = controller;
    for (key in c.state.pads.blinking) {
      blinkPads.push(key);
    }
    if (!blinkPads.length) {
      util.clearInterval(c.state.pads.blinkIntervalId);
      c.state.pads.blinkIntervalId = false;
    }
    else {
      var value;
      for (var i=0;i<blinkPads.length;i++) {
        value = c.state.pads.blinking[blinkPads[i]] ? 0 : 127;
        c._setPadLight(blinkPads[i] - 1, value, true);
      }
    }
  };

  this.trackMuteChanged = function(index, value) {
    this.updatePadLight(index);
  };

  this.trackSoloChanged = function(index, value) {
    this.updatePadLight(index);
  };

  this.updatePadLight = function(index, delay) {
    delay = delay || 100;
    host.scheduleTask(function(index) {
      var c = controller;
      var trackIndex = index + 1;
      var isMuted = c.state.tracks[trackIndex].mute;
      var isSoloed = c.state.tracks[trackIndex].solo;
      var isArmed = c.state.tracks[trackIndex].arm;
      //println(index + ' ' + (isMuted ? 'M' : 'm') + ' ' + (isSoloed ? 'S' : 's') + ' ' + (isArmed ? 'R' : 'r'));

      // When the user presses shift on the mixer page we show the record arm
      // status instead mute/solo.
      if (c.shiftPressed && 'mixer' == c.getPage()) {
        controller._setPadLight(index, isArmed ? 127 : 0);
        return;
      }

      // If the track is muted and the user just unsoloed the track we set it to light on.
      if (isSoloed) {
        controller._setPadLight(index, 127, true);
      }
      else if (isMuted) {
        controller._setPadLight(index, 127);
      }
      else {
        controller._setPadLight(index,0, false);
      }
    }, [index], delay);
  };

  this.trackArmChanged = function(index, value) {
  };

  this.resetPads = function() {
    for (var i=0;i<8;i++) {
      this._setPadLight(i, 0);
    };
  };

  this.updateTrackDetailsOnDisplay = function(index, delay, duration) {
    index = 'undefined' == typeof index ? this.activeTrack + 1 : index;
    delay = 'undefined' == typeof delay ? 0 : delay;
    duration = 'undefined' == typeof duration ? 0 : duration;

    util.setTimeout(function(index) {
      controller.setTextDisplay(controller.getTrackValueText(index), 'value', duration);
      controller.setTextDisplay(controller.getTrackDisplayText(index), 'text', duration);
    }, [index], delay);
  }
}


text:
@implementation UIViewController (ECSlidingViewController)

- (ECSlidingViewController *)slidingViewController {
    UIViewController *viewController = self.parentViewController ? self.parentViewController : self.presentingViewController;
    while (!(viewController == nil || [viewController isKindOfClass:[ECSlidingViewController class]])) {
        viewController = viewController.parentViewController ? viewController.parentViewController : viewController.presentingViewController;
    }

    return (ECSlidingViewController *)viewController;
}

@end


text:
class TermLine : public Plugin {
public:
    virtual void Resize(uint32_t col) = 0;
    virtual void Resize(uint32_t col, TermCellPtr cell_template) = 0;

    virtual TermCellPtr GetCell(uint32_t col) = 0;
    //return the removed cell at end of line
    virtual TermCellPtr InsertCell(uint32_t col) = 0;
    virtual bool IsModified() const = 0;
    virtual void SetModified(bool modified) = 0;
    virtual uint32_t GetLastRenderLineIndex() const = 0;
    virtual void SetLastRenderLineIndex(uint32_t index) = 0;
};


text:
@interface ConstraintsParser : NSObject

- (id)parse:(NSString *)string;
@end


text:
/* jshint mocha: true */

var assert = require('assert');
var fs = require('fs');
var path = require('path');

var pkg = require('./../package.json');
var dirs = pkg['h5bp-configs'].directories;

var expectedFilesInArchiveDir = [
    pkg.name + '_v' + pkg.version + '.zip'
];

var expectedFilesInDistDir = [

    '.editorconfig',
    '.gitattributes',
    '.gitignore',
    '.htaccess',

    '404.html',

    'apple-touch-icon.png',
    'browserconfig.xml',
    'crossdomain.xml',

    'css/', // for directories, a `/` character
            // should be included at the end
        'css/main.css',
        'css/normalize.css',

    'doc/',
        'doc/TOC.md',
        'doc/css.md',
        'doc/extend.md',
        'doc/faq.md',
        'doc/html.md',
        'doc/js.md',
        'doc/misc.md',
        'doc/usage.md',

    'favicon.ico',
    'humans.txt',

    'img/',
        'img/.gitignore',
        'img/bg_640.jpg',
        'img/bg_960.jpg',
        'img/bg_1280.jpg',
        'img/bg_1600.jpg',
        'img/bg_1920.jpg',
        'img/fun.png',
        'img/logo_350VancouverLogo.jpeg',
        'img/logo_bicycle_valet.jpg',
        'img/logo_Dogwood_Logo_Grey.png',
        'img/logo_DSF.jpg',
        'img/logo_fish.jpg',
        'img/logo_forest-ethic.png',
        'img/logo_gen-why.jpg',
        'img/logo_georgia.png',
        'img/logo_greenpeace.jpg',
        'img/logo_head.png',
        'img/logo_JointheCircleLogo-03.jpg',
        'img/logo_LOS.png',
        'img/logo_tanker_free.png',
        'img/logo_TheStarfish.jpg',
        'img/logo_together.jpg',

    'fonts/',
        'fonts/farray-webfont.eot',
        'fonts/farray-webfont.svg',
        'fonts/farray-webfont.ttf',
        'fonts/farray-webfont.woff',
        'fonts/farray-webfont.woff2',
        'fonts/fontello.eot',
        'fonts/fontello.svg',
        'fonts/fontello.ttf',
        'fonts/fontello.woff',

    'index.html',
    'index.final.html',

    'js/',
        'js/app.js',
        'js/app.min.js',
        'js/vendor/',
            'js/vendor/jquery-' + pkg.devDependencies.jquery + '.min.js',
            'js/vendor/jquery.min.map',
            'js/vendor/ls.respimg.min.js',
            'js/vendor/modernizr-2.8.3.min.js',

    'LICENSE.txt',
    'robots.txt',
    'tile-wide.png',
    'tile.png'

];

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

function checkFiles(directory, expectedFiles) {

    // Get the list of files from the specified directory
    var files = require('glob').sync('**/*', {
        'cwd': directory,
        'dot': true,      // include hidden files
        'mark': true      // add a `/` character to directory matches
    });

    // Check if all expected files are present in the
    // specified directory, and are of the expected type
    expectedFiles.forEach(function (file) {

        var ok = false;
        var expectedFileType = (file.slice(-1) !== '/' ? 'regular file' : 'directory');

        // If file exists
        if (files.indexOf(file) !== -1) {

            // Check if the file is of the correct type
            if (file.slice(-1) !== '/') {
                // Check if the file is really a regular file
                ok = fs.statSync(path.resolve(directory, file)).isFile();
            } else {
                // Check if the file is a directory
                // (Since glob adds the `/` character to directory matches,
                // we can simply check if the `/` character is present)
                ok = (files[files.indexOf(file)].slice(-1) === '/');
            }

        }

        it('"' + file + '" should be present and it should be a ' + expectedFileType, function () {
            assert.equal(true, ok);
        });

    });

    // List all files that should be NOT
    // be present in the specified directory
    (files.filter(function (file) {
        return expectedFiles.indexOf(file) === -1;
    })).forEach(function (file) {
        it('"' + file + '" should NOT be present', function () {
            assert(false);
        });
    });

}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

function runTests() {

    describe('Test if all the expected files, and only them, are present in the build directories', function () {

        describe(dirs.archive, function () {
            checkFiles(dirs.archive, expectedFilesInArchiveDir);
        });

        describe(dirs.dist, function () {
            checkFiles(dirs.dist, expectedFilesInDistDir);
        });

    });

}

runTests();


text:
package org.arquillian.example.repository;

import javax.enterprise.context.RequestScoped;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.arquillian.example.domain.Beer;

@RequestScoped
public class JpaBeerRepository implements BeerRepository {
    @PersistenceContext
    private EntityManager em;

    @Override
    public void delete(Beer beer) {
        beer.getBrewery().remove(beer);
        em.remove(beer);
    }

    @Override
    public void delete(Long id) {
        em.remove(getById(id));
    }

    @Override
    public Beer getById(Long id) {
        return em.find(Beer.class, id);
    }
}


text:
package com.xiaodong.warmweather.gson;

import java.io.Serializable;

/**
 * Created by yxd on 2017/2/20.
 */
public class Now implements Serializable {

    /**
     * code : 100
     * txt : 晴
     */

    private CondBean cond;
    /**
     * cond : {"code":"100","txt":"晴"}
     * fl : -14
     * hum : 29
     * pcpn : 0
     * pres : 1025
     * tmp : -6
     * vis : 5
     * wind : {"deg":"294","dir":"西北风","sc":"4-5","spd":"19"}
     */

    private String fl;
    private String hum;
    private String pcpn;
    private String pres;
    private String tmp;
    private String vis;
    /**
     * deg : 294
     * dir : 西北风
     * sc : 4-5
     * spd : 19
     */

    private WindBean wind;

    public CondBean getCond() {
        return cond;
    }

    public void setCond(CondBean cond) {
        this.cond = cond;
    }

    public String getFl() {
        return fl;
    }

    public void setFl(String fl) {
        this.fl = fl;
    }

    public String getHum() {
        return hum;
    }

    public void setHum(String hum) {
        this.hum = hum;
    }

    public String getPcpn() {
        return pcpn;
    }

    public void setPcpn(String pcpn) {
        this.pcpn = pcpn;
    }

    public String getPres() {
        return pres;
    }

    public void setPres(String pres) {
        this.pres = pres;
    }

    public String getTmp() {
        return tmp;
    }

    public void setTmp(String tmp) {
        this.tmp = tmp;
    }

    public String getVis() {
        return vis;
    }

    public void setVis(String vis) {
        this.vis = vis;
    }

    public WindBean getWind() {
        return wind;
    }

    public void setWind(WindBean wind) {
        this.wind = wind;
    }

    public static class CondBean {
        private String code;
        private String txt;

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getTxt() {
            return txt;
        }

        public void setTxt(String txt) {
            this.txt = txt;
        }
    }

    public static class WindBean {
        private String deg;
        private String dir;
        private String sc;
        private String spd;

        public String getDeg() {
            return deg;
        }

        public void setDeg(String deg) {
            this.deg = deg;
        }

        public String getDir() {
            return dir;
        }

        public void setDir(String dir) {
            this.dir = dir;
        }

        public String getSc() {
            return sc;
        }

        public void setSc(String sc) {
            this.sc = sc;
        }

        public String getSpd() {
            return spd;
        }

        public void setSpd(String spd) {
            this.spd = spd;
        }
    }
}


text:
/* convolve.c -- implements (non-"fast") convolution */
/*
 * Note: this code is mostly generated by translate.lsp (see convole.tran
 * in the tran directory), but it has been modified by hand to extend the
 * stop time to include the "tail" of the convolution beyond the length
 * of the first parameter.
 */

#include "stdio.h"
#ifndef mips
#include "stdlib.h"
#endif
#include "xlisp.h"
#include "sound.h"

#include "falloc.h"
#include "cext.h"
#include "convolve.h"

void convolve_free();

typedef struct convolve_susp_struct {
    snd_susp_node susp;
    long terminate_cnt;
    boolean logically_stopped;
    sound_type x_snd;
    long x_snd_cnt;
    sample_block_values_type x_snd_ptr;

    table_type table;
    sample_type *h_buf;
    double length_of_h;
    long h_len;
    long x_buf_len;
    sample_type *x_buffer_pointer;
    sample_type *x_buffer_current;
} convolve_susp_node, *convolve_susp_type;

void h_reverse(sample_type *h, long len)
{
    sample_type temp;
    int i;

    for (i = 0; i < len; i++) {
        temp = h[i];
        h[i] = h[len - 1];
        h[len - 1] = temp;
        len--;
    }
}

void convolve_s_fetch(register convolve_susp_type susp, snd_list_type snd_list)
{
    int cnt = 0; /* how many samples computed */
    int togo;
    int n;
    sample_block_type out;
    register sample_block_values_type out_ptr;

    register sample_block_values_type out_ptr_reg;

    register sample_type * h_buf_reg;
    register long h_len_reg;
    register long x_buf_len_reg;
    register sample_type * x_buffer_pointer_reg;
    register sample_type * x_buffer_current_reg;
    register sample_type x_snd_scale_reg = susp->x_snd->scale;
    register sample_block_values_type x_snd_ptr_reg;
    falloc_sample_block(out, "convolve_s_fetch");
    out_ptr = out->samples;
    snd_list->block = out;

    while (cnt < max_sample_block_len) { /* outer loop */
	    /* first compute how many samples to generate in inner loop: */
	    /* don't overflow the output sample block: */
	    togo = max_sample_block_len - cnt;

	    /* don't run past the x_snd input sample block: */
	    /* based on susp_check_term_log_samples, but offset by h_len */

	    /* THIS IS EXPANDED BELOW
	     * susp_check_term_log_samples(x_snd, x_snd_ptr, x_snd_cnt);
	     */
	    if (susp->x_snd_cnt == 0) {
	        susp_get_samples(x_snd, x_snd_ptr, x_snd_cnt);

	        /* THIS IS EXPANDED BELOW
	         *logical_stop_test(x_snd, susp->x_snd_cnt);
	         */
                if (susp->x_snd->logical_stop_cnt ==
		            susp->x_snd->current - susp->x_snd_cnt) {
	            min_cnt(&susp->susp.log_stop_cnt, susp->x_snd,
			    (snd_susp_type) susp, susp->x_snd_cnt);
	        }

	        /* THIS IS EXPANDED BELOW
	         * terminate_test(x_snd_ptr, x_snd, susp->x_snd_cnt);
	         */
	        if (susp->x_snd_ptr == zero_block->samples) {
	            /* ### modify this to terminate at an offset of (susp->h_len) */
                /* Note: in the min_cnt function, susp->x_snd_cnt is *subtracted*
                 *   from susp->x_snd->current to form the terminate time, so to
                 *   increase the time, we need to *subtract* susp->h_len, which
                 *   due to the double negative, *adds* susp->h_len to the ultimate
                 *   terminate time calculation.
                 */
	            min_cnt(&susp->terminate_cnt, susp->x_snd,
			            (snd_susp_type) susp, susp->x_snd_cnt - susp->h_len);
	        }
	    }

	    togo = min(togo, susp->x_snd_cnt);

	    /* don't run past terminate time */
	    if (susp->terminate_cnt != UNKNOWN &&
	        susp->terminate_cnt <= susp->susp.current + cnt + togo) {
	        togo = susp->terminate_cnt - (susp->susp.current + cnt);
	        if (togo == 0) break;
	    }

	    /* don't run past logical stop time */
	    if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
	        int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
	        /* break if to_stop == 0 (we're at the logical stop)
	         * AND cnt > 0 (we're not at the beginning of the
	         * output block).
	         */
	        if (to_stop < togo) {
		    if (to_stop == 0) {
		        if (cnt) {
			    togo = 0;
			    break;
		        } else /* keep togo as is: since cnt == 0, we
		                * can set the logical stop flag on this
		                * output block
		                */
			    susp->logically_stopped = true;
		    } else /* limit togo so we can start a new
		            * block at the LST
		            */
		        togo = to_stop;
	        }
	    }

	    n = togo;
	    h_buf_reg = susp->h_buf;
	    h_len_reg = susp->h_len;
	    x_buf_len_reg = susp->x_buf_len;
	    x_buffer_pointer_reg = susp->x_buffer_pointer;
	    x_buffer_current_reg = susp->x_buffer_current;
	    x_snd_ptr_reg = susp->x_snd_ptr;
	    out_ptr_reg = out_ptr;
	    if (n) do { /* the inner sample computation loop */
            long i; double sum;
            /* see if we've reached end of x_buffer */
            if ((x_buffer_pointer_reg + x_buf_len_reg) <= (x_buffer_current_reg + h_len_reg)) {
                /* shift x_buffer from current back to base */
                for (i = 1; i < h_len_reg; i++) {
                    x_buffer_pointer_reg[i-1] = x_buffer_current_reg[i];
                }
                /* this will be incremented back to x_buffer_pointer_reg below */
                x_buffer_current_reg = x_buffer_pointer_reg - 1;
            }

            x_buffer_current_reg++;

            x_buffer_current_reg[h_len_reg - 1] = (x_snd_scale_reg * *x_snd_ptr_reg++);

            sum = 0.0;
            for (i = 0; i < h_len_reg; i++) {
                sum += x_buffer_current_reg[i] * h_buf_reg[i];
            }

            *out_ptr_reg++ = (sample_type) sum;
	    } while (--n); /* inner loop */

	    susp->x_buffer_pointer = x_buffer_pointer_reg;
	    susp->x_buffer_current = x_buffer_current_reg;
	    /* using x_snd_ptr_reg is a bad idea on RS/6000: */
	    susp->x_snd_ptr += togo;
	    out_ptr += togo;
	    susp_took(x_snd_cnt, togo);
	    cnt += togo;
    } /* outer loop */

    /* test for termination */
    if (togo == 0 && cnt == 0) {
	    snd_list_terminate(snd_list);
    } else {
	    snd_list->block_len = cnt;
	    susp->susp.current += cnt;
    }
    /* test for logical stop */
    if (susp->logically_stopped) {
	    snd_list->logically_stopped = true;
    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
	    susp->logically_stopped = true;
    }
} /* convolve_s_fetch */

void convolve_toss_fetch(susp, snd_list)
  register convolve_susp_type susp;
  snd_list_type snd_list;
{
    time_type final_time = susp->susp.t0;
    long n;

    /* fetch samples from x_snd up to final_time for this block of zeros */
    while ((round((final_time - susp->x_snd->t0) * susp->x_snd->sr)) >=
	   susp->x_snd->current)
	susp_get_samples(x_snd, x_snd_ptr, x_snd_cnt);
    /* convert to normal processing when we hit final_count */
    /* we want each signal positioned at final_time */
    n = round((final_time - susp->x_snd->t0) * susp->x_snd->sr -
         (susp->x_snd->current - susp->x_snd_cnt));
    susp->x_snd_ptr += n;
    susp_took(x_snd_cnt, n);
    susp->susp.fetch = susp->susp.keep_fetch;
    (*(susp->susp.fetch))(susp, snd_list);
}

void convolve_mark(convolve_susp_type susp)
{
    sound_xlmark(susp->x_snd);
}

void convolve_free(convolve_susp_type susp)
{
    table_unref(susp->table);
    free(susp->x_buffer_pointer);    sound_unref(susp->x_snd);
    ffree_generic(susp, sizeof(convolve_susp_node), "convolve_free");
}

void convolve_print_tree(convolve_susp_type susp, int n)
{
    indent(n);
    stdputstr("x_snd:");
    sound_print_tree_1(susp->x_snd, n);
}

sound_type snd_make_convolve(sound_type x_snd, sound_type h_snd)
{
    register convolve_susp_type susp;
    rate_type sr = x_snd->sr;
    time_type t0 = x_snd->t0;
    sample_type scale_factor = 1.0F;
    time_type t0_min = t0;
    falloc_generic(susp, convolve_susp_node, "snd_make_convolve");
    susp->table = sound_to_table(h_snd);
    susp->h_buf = susp->table->samples;
    susp->length_of_h = susp->table->length;
    susp->h_len = (long) susp->length_of_h;
         h_reverse(susp->h_buf, susp->h_len);
    susp->x_buf_len = 2 * susp->h_len;
    susp->x_buffer_pointer = calloc((2 * (susp->h_len)), sizeof(float));
    susp->x_buffer_current = susp->x_buffer_pointer;
    susp->susp.fetch = convolve_s_fetch;
    susp->terminate_cnt = UNKNOWN;
    /* handle unequal start times, if any */
    if (t0 < x_snd->t0) sound_prepend_zeros(x_snd, t0);
    /* minimum start time over all inputs: */
    t0_min = min(x_snd->t0, t0);
    /* how many samples to toss before t0: */
    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
    if (susp->susp.toss_cnt > 0) {
	susp->susp.keep_fetch = susp->susp.fetch;
	susp->susp.fetch = convolve_toss_fetch;
    }

    /* initialize susp state */
    susp->susp.free = convolve_free;
    susp->susp.sr = sr;
    susp->susp.t0 = t0;
    susp->susp.mark = convolve_mark;
    susp->susp.print_tree = convolve_print_tree;
    susp->susp.name = "convolve";
    susp->logically_stopped = false;
    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(x_snd);
    susp->susp.current = 0;
    susp->x_snd = x_snd;
    susp->x_snd_cnt = 0;
    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
}

sound_type snd_convolve(sound_type x_snd, sound_type h_snd)
{
    sound_type x_snd_copy = sound_copy(x_snd);
    return snd_make_convolve(x_snd_copy, h_snd);
}


text:
  test(function () {
    const obs = new PerformanceObserver(() => {});
    assert_throws_js(TypeError, function () {
      obs.observe({entryTypes: "mark"});
    });
  }, "entryTypes must be a sequence or throw a TypeError");

  test(function () {
    const obs = new PerformanceObserver(() => {});
    obs.observe({entryTypes: []});
  }, "Empty sequence entryTypes does not throw an exception.");

  test(function () {
    const obs = new PerformanceObserver(() => {});
    obs.observe({entryTypes: ["this-cannot-match-an-entryType"]});
    obs.observe({entryTypes: ["marks","navigate", "resources"]});
  }, "Unknown entryTypes do not throw an exception.");

  test(function () {
    const obs = new PerformanceObserver(() => {});
    obs.observe({entryTypes: ["mark","this-cannot-match-an-entryType"]});
    obs.observe({entryTypes: ["this-cannot-match-an-entryType","mark"]});
    obs.observe({entryTypes: ["mark"], others: true});
  }, "Filter unsupported entryType entryType names within the entryTypes sequence");

  async_test(function (t) {
    var finish = t.step_func(function () { t.done(); });
    var observer = new PerformanceObserver(
      function (entryList, obs) {
        var self = this;
        t.step(function () {
          assert_true(entryList instanceof PerformanceObserverEntryList, "first callback parameter must be a PerformanceObserverEntryList instance");
          assert_true(obs instanceof PerformanceObserver, "second callback parameter must be a PerformanceObserver instance");
          assert_equals(observer, self, "observer is the this value");
          assert_equals(observer, obs, "observer is second parameter");
          assert_equals(self, obs, "this and second parameter are the same");
          observer.disconnect();
          finish();
        });
      }
    );
    self.performance.clearMarks();
    observer.observe({entryTypes: ["mark"]});
    self.performance.mark("mark1");
  }, "Check observer callback parameter and this values");

  async_test(function (t) {
  var observer = new PerformanceObserver(
      t.step_func(function (entryList, obs) {
        checkEntries(entryList.getEntries(),
          [{ entryType: "measure", name: "measure1"}]);
        observer.disconnect();
        t.done();
      })
    );
    self.performance.clearMarks();
    observer.observe({entryTypes: ["mark"]});
    observer.observe({entryTypes: ["measure"]});
    self.performance.mark("mark1");
    self.performance.measure("measure1");
  }, "replace observer if already present");


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using JOL.Interfaces;

namespace JOL
{
    class EvilBardieEnemy : Enemy
    {
        public enum EvilBardieState {
            offScreen,
            normal,
            stoppedShell,
            movingShell,
            transition,
            dead
        };

        EvilBardieState currentState;

        private static int NORMAL_SPEED = 2, SHELL_SPEED = 4;
        private static int NUMBER_OF_FRAMES = 2, FRAME_WIDTH = 20, FRAME_DELAY = 15;
        private static int UNSHELL_TIME = 240, TRANSITION_TIME = 120, SHELL_FRAME = 2, TRANSITION_FRAME = 3;

        private int currentFrame = 0, frameDelayClock = 0, inShellFor = 0;
        private SoundEffect sound;
        private SoundEffectInstance soundInstance;

        public EvilBardieEnemy(Texture2D sprite, int xPos, int yPos) : base(sprite, xPos, yPos)
        {
            height = 24;
            width = 16;
            currentState = EvilBardieState.normal;

            Initialize();
        }

        public EvilBardieEnemy(Texture2D sprite, SoundEffect sound, int xPos, int yPos) : base(sprite, xPos, yPos)
        {
            height = 24;
            width = 16;
            this.sound = sound;
            soundInstance = sound.CreateInstance();
            currentState = EvilBardieState.normal;

            Initialize();
        }

        public override void Update(GameTime gameTime)
        {
            if (isAlive)
            {
                switch (currentState)
                {
                    case EvilBardieState.offScreen:
                        break;

                    case EvilBardieState.normal:
                        frameDelayClock++;
                        if (frameDelayClock > FRAME_DELAY)
                        {
                            frameDelayClock = 0;
                            currentFrame++;
                            currentFrame = currentFrame % NUMBER_OF_FRAMES;
                        }

                        if (isFacingRight)
                        {
                            xPosDest += NORMAL_SPEED;
                        }
                        else
                        {
                            xPosDest -= NORMAL_SPEED;
                        }

                        yPosDest += (int)fallSpeed;
                        if (fallSpeed.CompareTo(10.0f) < 0)
                        {
                            fallSpeed = fallSpeed * 1.05f;
                        }
                        break;

                    case EvilBardieState.stoppedShell:
                        inShellFor++;
                        if (inShellFor > TRANSITION_TIME)
                        {
                            currentState = EvilBardieState.transition;
                        }
                        break;

                    case EvilBardieState.movingShell:
                        if (isFacingRight)
                        {
                            xPosDest += SHELL_SPEED;
                        }
                        else
                        {
                            xPosDest -= SHELL_SPEED;
                        }
                        yPosDest += (int)fallSpeed;
                        if (fallSpeed.CompareTo(10.0f) < 0)
                        {
                            fallSpeed = fallSpeed * 1.05f;
                        }
                        break;

                    case EvilBardieState.transition:
                        inShellFor++;
                        if (inShellFor > UNSHELL_TIME)
                        {
                            inShellFor = 0;
                            currentState = EvilBardieState.normal;
                        }
                        break;

                    case EvilBardieState.dead:
                        break;

                    default:
                        break;
                }

                destRectangle = new Rectangle(xPosDest, yPosDest, magnifier * width, magnifier * height);
            }
        }

        public override void Draw(SpriteBatch spriteBatch, ICamera camera)
        {
            Rectangle relativeDestRectangle = new Rectangle((int)(destRectangle.X - camera.Position.X), (int)(destRectangle.Y - camera.Position.Y), magnifier * width, magnifier * height);
            Rectangle sourceRectangle;

            switch (currentState)
            {
                case EvilBardieState.offScreen:
                    break;

                case EvilBardieState.normal:
                    sourceRectangle = new Rectangle(xPosSource + currentFrame * FRAME_WIDTH, yPosSource, width, height);
                    if (isFacingRight)
                    {
                        spriteBatch.Draw(sprite, relativeDestRectangle, sourceRectangle, Color.White, 0, Vector2.Zero, SpriteEffects.FlipHorizontally, 1);
                    }
                    else
                    {
                        spriteBatch.Draw(sprite, relativeDestRectangle, sourceRectangle, Color.White);
                    }
                    break;

                case EvilBardieState.stoppedShell:
                    sourceRectangle = new Rectangle(xPosSource + SHELL_FRAME * FRAME_WIDTH, yPosSource, width, height);
                    spriteBatch.Draw(sprite, relativeDestRectangle, sourceRectangle, Color.White);
                    break;

                case EvilBardieState.movingShell:
                    sourceRectangle = new Rectangle(xPosSource + SHELL_FRAME * FRAME_WIDTH, yPosSource, width, height);
                    spriteBatch.Draw(sprite, relativeDestRectangle, sourceRectangle, Color.White);
                    break;

                case EvilBardieState.transition:
                    sourceRectangle = new Rectangle(xPosSource + TRANSITION_FRAME * FRAME_WIDTH, yPosSource, width, height);
                    spriteBatch.Draw(sprite, relativeDestRectangle, sourceRectangle, Color.White);
                    break;

                case EvilBardieState.dead:
                    break;

                default:
                    break;
            }

        }

        // Returns whether the hit was dangerous for player
        public override bool Hit(CollisionDetection.CollisionType collisionType, bool hitRight)
        {
            bool isHit = false;
            switch (collisionType)
            {
                case CollisionDetection.CollisionType.TopCollision:
                    soundInstance.Play();
                    switch (currentState)
                    {
                        case EvilBardieState.normal:
                            currentState = EvilBardieState.stoppedShell;
                            break;

                        case EvilBardieState.stoppedShell:
                            currentState = EvilBardieState.movingShell;
                            isFacingRight = hitRight;
                            inShellFor = 0;
                            break;

                        case EvilBardieState.movingShell:
                            currentState = EvilBardieState.stoppedShell;

                            break;

                        case EvilBardieState.transition:
                            currentState = EvilBardieState.movingShell;
                            isFacingRight = hitRight;
                            inShellFor = 0;
                            break;
                    }
                    break;
                case CollisionDetection.CollisionType.LeftCollision:
                case CollisionDetection.CollisionType.RightCollision:
                    switch (currentState)
                    {
                        case EvilBardieState.normal:
                            isHit = true;
                            break;

                        case EvilBardieState.stoppedShell:
                            currentState = EvilBardieState.movingShell;
                            isFacingRight = hitRight;
                            inShellFor = 0;
                            break;

                        case EvilBardieState.movingShell:
                            isHit = true;
                            break;

                        case EvilBardieState.transition:
                            currentState = EvilBardieState.movingShell;
                            isFacingRight = hitRight;
                            inShellFor = 0;
                            break;
                    }
                    break;
                case CollisionDetection.CollisionType.BottomCollision:
                    switch (currentState)
                    {
                        case EvilBardieState.normal:
                            isHit = true;
                            break;

                        case EvilBardieState.stoppedShell:
                            currentState = EvilBardieState.movingShell;
                            isFacingRight = hitRight;
                            inShellFor = 0;
                            break;

                        case EvilBardieState.movingShell:
                            isHit = true;
                            break;

                        case EvilBardieState.transition:
                            currentState = EvilBardieState.movingShell;
                            isFacingRight = hitRight;
                            inShellFor = 0;
                            break;
                    }
                    break;
            }
            return isHit;
        }
    }
}


text:
import { Injectable } from '@angular/core';

@Injectable()
export class ToastService {
  activate: (message?: string, title?: string) => void;
}


text:
<!DOCTYPE html>
<meta charset=utf-8>
<title>Redirecting...</title>
<link rel=canonical href="../翌/index.html">
<meta http-equiv=refresh content="0; url='../翌/index.html'">

Redirecting...

Click here if you are not redirected.