text:
layout: project
title:  Relic Magazine
categories: [print]
images:
  - url: images/relic/relic-1--medium.jpg
    large_url: images/relic/relic-1--large.jpg
    alt: Relic Magazine Cover
    border: true
    srcset:
      - images/relic/relic-1--mini.jpg 160w
      - images/relic/relic-1--tiny.jpg 240w
      - images/relic/relic-1--small.jpg 320w
      - images/relic/relic-1--medium.jpg 480w

  - url: images/relic/relic-2--small.jpg
    large_url: images/relic/relic-2--large.jpg
    alt: Relic Magazine Table of Contents
    border: true
    srcset:
      - images/relic/relic-2--mini.jpg 160w
      - images/relic/relic-2--tiny.jpg 240w
      - images/relic/relic-2--small.jpg 320w
      - images/relic/relic-2--medium.jpg 480w

  - url: images/relic/relic-3--small.jpg
    large_url: images/relic/relic-3--large.jpg
    alt: Relic Magazine First Page
    border: true
    srcset:
      - images/relic/relic-3--mini.jpg 160w
      - images/relic/relic-3--tiny.jpg 240w
      - images/relic/relic-3--small.jpg 320w
      - images/relic/relic-3--medium.jpg 480w

  - url: images/relic/relic-4--small.jpg
    large_url: images/relic/relic-4--large.jpg
    alt: Relic Magazine Second Page
    border: true
    srcset:
      - images/relic/relic-4--mini.jpg 160w
      - images/relic/relic-4--tiny.jpg 240w
      - images/relic/relic-4--small.jpg 320w
      - images/relic/relic-4--medium.jpg 480w

  - url: images/relic/relic-5--small.jpg
    large_url: images/relic/relic-5--large.jpg
    alt: Relic Magazine Second Spread
    border: true
    srcset:
      - images/relic/relic-5--mini.jpg 160w
      - images/relic/relic-5--tiny.jpg 240w
      - images/relic/relic-5--small.jpg 320w
      - images/relic/relic-5--medium.jpg 480w

---

Layout and logo design for _Relic_ magazine. The monthly magazine covers the world of archeology with a fresh mainstream and media-rich point-of-view. Rather than scholarly journal articles, _Relic_ explains the subject which accommodates a mainstream audience without altering the facts or analysis. In particular it seeks to explain different ancient technologies, cultures and historical events, and how particular discoveries affect our modern world.


text:
module Moose
  module TestGroup
    class Builder < Base
      attr_reader :directory, :test_group, :test_suite, :moose_configuration, :runner

      def initialize(directory:, test_suite:, moose_configuration:, runner:)
        @directory = directory
        @test_suite = test_suite
        @moose_configuration = moose_configuration
        @runner = runner
      end

      def build_list
        Dir.glob(File.join(directory, "*")) { |test_dir|
          collection.add_test_group(test_dir)
        }
        self
      end

      def collection
        @collection ||= Collection.new(
          directory: directory,
          test_suite: test_suite,
          moose_configuration: moose_configuration,
          runner: runner,
        )
      end
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
/**
 * @module msg
 * @fileoverview msg - messaging library
 *
 * @version: 0.1.0
 * @since: 2014.07.17
 *
 */

/**
* messaging api for Javascript module.
*
* This module provides JavaScript API's for message service.
* @module msg
*/

/* global connHostUrl: true */

define([connHostUrl + '/socket.io/socket.io.js'], function (sio) {
    'use strict';

    /**
     * user information
     * @property {string} nick - display name
     * @property {string} email - user's email
     * @property {string} uid - user's unique id
     * @property {string} token - user's access token
     * @typedef {object} User
     * @memberOf module:msg
     */

    var User = function (nick, email, uid, token) {
        this.nick = nick;
        this.email = email;
        this.uid = uid;
        this.token = token;
    };

    var Conn = function (user, host, msgMap) {
        var self = this;
        this.user = user;
        this.msgMap = msgMap;
        this.sock = sio.connect(host);
        this.sock.off = this.sock.removeListener;

        this.on = function (name, func) {
            self.sock.off(name);
            self.sock.on(name, func.bind(null, self));
        };

        this.off = function (name) {
            self.sock.off(name);
        };

        function registerMsgMap(arrMap, cli, sock) {
            for (var i = 0; i < arrMap.length; i++) {
                sock.on(arrMap[i].name, arrMap[i].func.bind(
                    null, cli));
            }
        }

        if (msgMap) {
            registerMsgMap(msgMap, self, self.sock);
        }

        this.sock.on('connect', function () {
            console.log('connected to the notify-server');
        });

        this.sock.on('disconnect', function () {
            console.log('disconnected');
            //topicMgr.publish(topics.logout);
        });

        this.disconnect = function () {
            self.sock.disconnect();
            console.log('try disconnecting...');
        };

        this.sendMsg = function (type, msg) {
            self.sock.emit(type, msg);
        };
    };

    var HashMap = function () {
        this.map = new Array([]);
    };

    HashMap.prototype = {
        put: function (key, value) {
            this.map[key] = value;
        },
        get: function (key) {
            return this.map[key];
        },
        getAll: function () {
            return this.map;
        },
        clear: function () {
            this.map = new Array([]);
        },
        getKeys: function () {
            var keys = new Array([]);
            Object.keys(this.map).forEach(function (i) {
                keys.push(i);
            });
            return keys;
        },
        remove: function (key) {
            delete this.map[key];
        }
    };

    /**
     * In order to receive messages, you need to define callback functons as follow
     * @property {usermsg_callback} usermsg - callback functon that you want to receive from other users
     * @property {topicsysnotify_callback} topicsysnotify
     - callback functon that you want to receive system notification on topics
     * @property {topicusernotify_callback} topicusernotify
     - callback functon that you want to receive user notification on topics
     * @typedef {object} options
     * @memberOf module:msg
     */

    var options = null;
    var loginCallback;

    /* jshint camelcase: false */
    function msg_Ready(conn, msg) {
        console.log('ready - ' + JSON.stringify(msg));
        conn.sendMsg('auth', conn.user);
    }

    function msg_authAns(conn, msg) {
        console.log('authAns - ' + JSON.stringify(msg));
        if (loginCallback) {
            if (msg.errcode.code === 0) {
                loginCallback(null, msg.data);
            }
            else {
                loginCallback(new Error(msg.errcode.msg));
            }
        }
    }

    function msg_subAns(conn, msg) {
        console.log('subAns - ' + JSON.stringify(msg));
        var err = (msg.errcode.code === 0) ? null : new Error(msg.errcode.msg);
        taskMgr.popTask(msg.data.taskid, err, msg.data);
    }

    function msg_pubAns(conn, msg) {
        console.log('pubAns - ' + JSON.stringify(msg));
        var err = (msg.errcode.code === 0) ? null : new Error(msg.errcode.msg);
        taskMgr.popTask(msg.data.taskid, err, msg.data);
    }

    function msg_topicUserNtf(conn, msg) {
        console.log('user ntf - ' + JSON.stringify(msg));

        if (!msg.data.topic) {
            console.error('invalid topic:' + JSON.stringify(msg));
            return;
        }
        if (options && options.topicusernotify) {
            var xx = options.topicusernotify.bind(options);
            xx(msg.from, msg.data.topic, msg.data);
        }
    }

    function msg_topicSysNtf(conn, msg) {

        console.log('system ntf - ' + JSON.stringify(msg));

        if (!msg.data.topic) {
            console.error('invalid topic:' + JSON.stringify(msg));
            return;
        }

        if (options && options.topicsysnotify) {
            var xx = options.topicsysnotify.bind(options);
            xx(msg.data.topic, msg.data.data);
        }
    }

    function msg_userMsg(conn, msg) {
        console.log('user msg - - ' + JSON.stringify(msg));

        if (options && options.usermsg) {
            var xx = options.usermsg.bind(options);
            xx(msg.from, msg.data);
        }

    }

    var msgMap = [
        { name: 'ready', func: msg_Ready },
        { name: 'authAns', func: msg_authAns },
        { name: 'subAns', func: msg_subAns },
        { name: 'pubAns', func: msg_pubAns },
        { name: 'userNtf', func: msg_topicUserNtf },
        { name: 'sysNtf', func: msg_topicSysNtf },
        { name: 'userMsg', func: msg_userMsg }
    ];
    /* jshint camelcase: true */

    var guid = (function () {
        function s4() {
            return Math.floor((1 + Math.random()) * 0x10000)
                .toString(16)
                .substring(1);
        }
        return function () {
            return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
                s4() + '-' + s4() + s4() + s4();
        };
    })();

    var TaskMgr = function () {
        var taskMap = new HashMap();
        this.pushTask = function (cb) {
            var taskid = guid();
            taskMap.put(taskid, cb);
            return taskid;
        };

        this.popTask = function (id, err, msg) {
            var func = taskMap.get(id);
            if (func) {
                func(err, msg);
            }
            taskMap.remove(id);
        };
    };

    var taskMgr = new TaskMgr();
    var connMap = new HashMap();

    /**
     * Callback function. If function finished successfully then error is undefined
     *
     * @callback init_callback
     * @param {module:msg.callback_error} error - Error message. Error message is string or undefined
     * @param {module:msg.User} user - user info. consist of email, displayname and accessToken.
     * @memberOf module:msg
     */

    /**
     * subscription info. for a topic
     * @property {string} topic - topic name
     * @typedef {object} subinfo
     * @memberOf module:msg
     */

    /**
     * subscriptions info. for topics
     * @property {Array} topics - topic name array
     * @typedef {object} subinfo2
     * @memberOf module:msg
     */

    /**
     * publication info. for topic
     * @property {string} topic - topic name
     * @property {string} msg - publication message
     * @typedef {object} pubinfo
     * @memberOf module:msg
     */

    /**
     * Callback function. If function finished successfully then error is undefined
     *
     * @callback sub_callback
     * @param {module:msg.callback_error} error - Error message. Error message is string or undefined
     * @param {module:msg.subinfo} subinfo - subscription info
     * @memberOf module:msg
     */

    /**
     * Callback function. If function finished successfully then error is undefined
     *
     * @callback sub2_callback
     * @param {module:msg.callback_error} error - Error message. Error message is string or undefined
     * @param {module:msg.subinfo2} subinfo2 - subscriptions info
     * @memberOf module:msg
     */

    /**
     * Callback function. If function finished successfully then error is undefined
     *
     * @callback pub_callback
     * @param {module:msg.callback_error} error - Error message. Error message is string or undefined
     * @param {module:msg.pubinfo} pubinfo - subscription info
     * @memberOf module:msg
     */

    /**
     *
     * init: login onto connectoin server
     *
     * @method init
     * @param {string} uid - user's unique id
     * @param {string} token - user's access token.
     * @param {string} host - The host name of connection server
     * @param {module:msg.options} options - callback functions to receive notificatons
     * @param {init_callback} callback - callback(err, user)
     * @memberOf module:msg
     */
    var init = function (uid, token, host, option, cb) {
        var user  = new User('nick', 'email', uid, token);
        options = option;
        var conn = new Conn(user, host, msgMap);
        connMap.put(user.uid, conn);
        loginCallback = cb;
    };

    /**
     *
     * sub: subscribes specific topic, if you want to listen on specific topic
     *
     * @method sub
     * @param {module:msg.User} user - user info. consist of email, displayname and accessToken.
     * @param {string} topic - topic means notification channel.
     * @param {module:msg.sub_callback} callback - callback(err, subInfo)
     * @memberOf module:msg
     */
    var sub = function (user, topic, cb) {
        var taskId = taskMgr.pushTask(cb);

        var subInfo = {
            'topic': topic,
            'taskid': taskId
        };
        var conn = connMap.get(user.uid);
        if (!conn) {
            return false;
        }

        conn.sendMsg('sub', subInfo);
        return true;
    };

    /**
     *
     * sub2: subscribes several topics you want to listen notifications of the topic.
     *
     * @method sub2
     * @param {module:msg.User} user - user info. consist of email, displayname and accessToken.
     * @param {Array} topic list - topic list includes several topic strings.
     * @param {module:msg.sub2_callback} callback - callback(err, subInfo)
     * @memberOf module:msg
     */
    var sub2 = function (user, topics, cb) {
        var taskId = taskMgr.pushTask(cb);
        var subInfo = {
            'topiclist': topics,
            'taskid': taskId
        };
        var conn = connMap.get(user.uid);
        if (!conn) {
            return false;
        }

        conn.sendMsg('sub2', subInfo);

        return true;
    };

    /**
     *
     * unsub: unsubscribes topic.
     *
     * @method unsub
     * @param {module:msg.User} user - user info. consist of email, displayname and accessToken.
     * @param {string} topic - topic.
     * @param {module:msg.sub_callback} callback - callback(err, subInfo)
     * @memberOf module:msg
     */

    var unsub = function (user, topic, cb) {
        var taskId = taskMgr.pushTask(cb);
        var subInfo = {
            'topic': topic,
            'taskid': taskId
        };
        var conn = connMap.get(user.uid);
        if (!conn) {
            return false;
        }

        conn.sendMsg('unsub', subInfo);
        return true;

    };

    /**
     *
     * unsub2: unsubscribes topic.
     *
     * @method unsub2
     * @param {module:msg.User} user - user info. consist of email, displayname and accessToken.
     * @param {Array} topic array - topic.
     * @param {module:msg.sub2_callback} callback - callback(err, subInfo)
     * @memberOf module:msg
     */

    var unsub2 = function (user, topics, cb) {
        var taskId = taskMgr.pushTask(cb);
        var subInfo = {
            'topiclist': topics,
            'taskid': taskId
        };
        var conn = connMap.get(user.uid);
        if (!conn) {
            return false;
        }
        conn.sendMsg('unsub2', subInfo);
        return true;
    };

    /**
     *
     * pub: publish message into the topic.
     *
     * @method pub
     * @param {module:msg.User} user - user info. consist of email, displayname and accessToken.
     * @param {string} topic - The name of topic where you want to send message.
     * @param {string} msg - A message to deliver into the topic.
     * @param {module:msg.pub_callback} callback - callback(err, pubInfo)
     * @memberOf module:msg
     */

    var pub = function (user, topic, msg, cb) {
        var taskId = taskMgr.pushTask(cb);
        var pubInfo = {
            'topic': topic,
            'data': msg,
            'taskid': taskId
        };
        var conn = connMap.get(user.uid);
        if (!conn) {
            return false;
        }
        conn.sendMsg('pub', pubInfo);
        return true;
    };

    /**
     *
     * pubToUsers: publish message to users in specific topic.
     *
     * @method pubToUsers
     * @param {module:msg.User} user - user info. consist of email, displayname and accessToken.
     * @param {Array} arrUsers - The name of topic where you want to send message.
     * @param {string} topic - topic name
     * @param {string} msg - message for each topic.
     * @param {module:msg.pubtousers_callback} callback - callback(err, subInfo)
     * @memberOf module:msg
     */

    var pubToUsers = function (user, arrUsers, topic, msg, cb) {
        var taskId = taskMgr.pushTask(cb);
        var pubInfo = {
            'topic': topic,
            'data': msg,
            'arrUsers': arrUsers,
            'taskid': taskId
        };
        var conn = connMap.get(user.uid);
        if (!conn) {
            return false;
        }
        conn.sendMsg('pubtousers', pubInfo);
        return true;
    };

    /**
     *
     * sendToUser: send message to user
     *
     * @method sendToUser
     * @param {module:msg.User} user - user info. consist of email, displayname and accessToken.
     * @param {Array} targetUser - target user
     * @param {string} msg - message to send to user.
     * @param {sendtouser_callback} callback - callback(err, msg)
     * @memberOf module:msg
     */

    var sendToUser = function (user, targetUser, msg, cb) {
        var taskId = taskMgr.pushTask(cb);
        var msgInfo = {
            'targetUser': targetUser,
            'msg': msg,
            'taskid': taskId
        };
        var conn = connMap.get(user.uid);
        if (!conn) {
            return false;
        }

        conn.sendMsg('sendtouser', msgInfo);
        return true;
    };

    /**
     *
     * sendToUsers: send message to users
     *
     * @method sendToUsers
     * @param {module:msg.User} user - user info. consist of email, displayname and accessToken.
     * @param {Array} targetUsers - target user's uid array
     * @param {string} msg - message to send to user.
     * @param {sendtousers_callback} callback - callback(err, msg)
     * @memberOf module:msg
     */

    var sendToUsers = function (user, targetUsers, msg, cb) {
        var taskId = taskMgr.pushTask(cb);
        var msgInfo = {
            'targetUsers': targetUsers,
            'msg': msg,
            'taskid': taskId
        };
        var conn = connMap.get(user.uid);
        if (!conn) {
            return false;
        }
        conn.sendMsg('sendtousers', msgInfo);
        return true;
    };

    return {
        init: init,
        sub: sub,
        sub2: sub2,
        unsub: unsub,
        unsub2: unsub2,
        pub: pub,
        pubToUsers: pubToUsers,
        sendToUser: sendToUser,
        sendToUsers: sendToUsers
    };
});


text:
#include "tr/xqp/serial/deser.h"

#include "tr/xqp/visitor/ASTVisitor.h"
#include "ASTDropColl.h"

ASTDropColl::~ASTDropColl()
{
    delete coll;
}

void ASTDropColl::accept(ASTVisitor &v)
{
    v.addToPath(this);
    v.visit(*this);
    v.removeFromPath(this);
}

ASTNode *ASTDropColl::dup()
{
    return new ASTDropColl(cd, coll->dup());
}

ASTNode *ASTDropColl::createNode(scheme_list &sl)
{
    ASTNodeCommonData cd;
    ASTNode *coll = NULL;

    U_ASSERT(sl[1].type == SCM_LIST && sl[2].type == SCM_LIST);

    cd = dsGetASTCommonFromSList(*sl[1].internal.list);
    coll = dsGetASTFromSchemeList(*sl[2].internal.list);

    return new ASTDropColl(cd, coll);
}

void ASTDropColl::modifyChild(const ASTNode *oldc, ASTNode *newc)
{
    if (coll == oldc)
    {
        coll = newc;
        return;
    }
}


text:
<?php
require '../../../common.inc.php';
require 'init.inc.php';
$_REQUEST['code'] or dalert('Error Request.', $MODULE[2]['linkurl'].$DT['file_login'].'?step=callback&site='.$site);
$par = 'grant_type=authorization_code'
	 . '&code='.$_REQUEST['code']
	 . '&appid='.WX_ID
	 . '&secret='.WX_SECRET;
$rec = dcurl(WX_TOKEN_URL, $par);
if(strpos($rec, 'access_token') !== false) {
	$arr = json_decode($rec, true);
	$_SESSION['wx_access_token'] = $arr['access_token'];
	$_SESSION['wx_openid'] = $arr['openid'];
	dheader('index.php?time='.$DT_TIME);
} else {
	dalert('Error Token.', $MODULE[2]['linkurl'].$DT['file_login'].'?step=token&site='.$site);
}
?>


text:
const gulp = require('gulp');
const express = require('express');

// Production

gulp.task('copyFiles', () => {
  gulp.src(['src/**', '!src/app/**'])
    .pipe(gulp.dest('dist'))
})

gulp.task('default', ['copyFiles']);


text:
<!DOCTYPE html>

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

    <title>mne.viz.plot_montage — MNE 0.14.1 documentation</title>

    <link rel="stylesheet" href="../_static/basic.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/gallery.css" type="text/css" />
    <link rel="stylesheet" href="../_static/bootswatch-3.3.6/flatly/bootstrap.min.css" type="text/css" />
    <link rel="stylesheet" href="../_static/bootstrap-sphinx.css" type="text/css" />

    <link rel="shortcut icon" href="../_static/favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />

<link href='https://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700' rel='stylesheet' type='text/css'>

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

  <link rel="canonical" href="https://mne.tools/stable/index.html" />

        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">

        </button>

        0.14.1

Get started

Tutorials

Examples

API

Manual

Contribute

FAQ

  Site

<form class="navbar-form navbar-right" action="../search.html" method="get">

  <input type="text" name="q" class="form-control" placeholder="Search" />

  <input type="hidden" name="check_keywords" value="yes" />
  <input type="hidden" name="area" value="default" />
</form>

mne.viz.plot_montage

<form action="../search.html" method="get">

  <input type="text" name="q" class="form-control" placeholder="Search" />

  <input type="hidden" name="check_keywords" value="yes" />
  <input type="hidden" name="area" value="default" />
</form>

mne.viz.plot_montage¶

mne.viz.plot_montage(montage, scale_factor=20, show_names=False, show=True)[source]¶

Plot a montage.

<col class="field-name" />
<col class="field-body" />

Parameters:
montage : instance of Montage

The montage to visualize.

scale_factor : float

Determines the size of the points. Defaults to 20.

show_names : bool

Whether to show the channel names. Defaults to False.

show : bool

Show figure if True.

Returns:
fig : Instance of matplotlib.figure.Figure

The figure object.

GitHub

·

Mailing list

·

Gitter

·

What's new

·

Cite MNE

Back to top

© Copyright 2012-2017, MNE Developers. Last updated on 2017-08-15.


text:
// Copyright (c) 2010-2011 Zipline Games, Inc. All Rights Reserved.
// http://getmoai.com

#include "pch.h"
#include <moaicore/MOAILogMessages.h>
#include <moaicore/MOAIScriptNode.h>

//================================================================//
// local
//================================================================//

//----------------------------------------------------------------//
/**	@name	reserveAttrs
	@text	Reserve memory for custom attributes and initializes them to 0.

	@in		MOAIScriptNode self
	@in		number nAttributes
	@out	nil
*/
int MOAIScriptNode::_reserveAttrs ( lua_State* L ) {
	MOAI_LUA_SETUP ( MOAIScriptNode, "UN" );

	u32 size = state.GetValue < u32 >( 2, 0 );
	self->mAttributes.Init ( size );
	self->mAttributes.Fill ( 0.0f );

	return 0;
}

//----------------------------------------------------------------//
/**	@name	setCallback
	@text	Sets a Lua function to be called whenever the node is updated.

	@in		MOAIScriptNode self
	@in		function onUpdate
	@out	nil
*/
int MOAIScriptNode::_setCallback ( lua_State* L ) {
	MOAI_LUA_SETUP ( MOAIScriptNode, "UF" );

	self->SetLocal ( state, 2, self->mOnUpdate );
	return 0;
}

//================================================================//
// MOAIScriptNode
//================================================================//

//----------------------------------------------------------------//
bool MOAIScriptNode::ApplyAttrOp ( u32 attrID, MOAIAttrOp& attrOp, u32 op ) {
	attrID = UNPACK_ATTR(attrID);

	if ( attrID < this->mAttributes.Size ()) {
		this->mAttributes [ attrID ] = attrOp.Apply ( this->mAttributes [ attrID ], op, MOAIAttrOp::ATTR_READ_WRITE );
		return true;
	}
	return false;
}

//----------------------------------------------------------------//
MOAIScriptNode::MOAIScriptNode () {

	RTTI_SINGLE ( MOAINode )
}

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

//----------------------------------------------------------------//
void MOAIScriptNode::OnDepNodeUpdate () {

	if ( this->mOnUpdate ) {

		MOAILuaStateHandle state = MOAILuaRuntime::Get ().State ();

		this->PushLocal ( state, this->mOnUpdate );
		this->PushLuaUserdata ( state );

		state.DebugCall ( 1, 0 );
	}
}

//----------------------------------------------------------------//
void MOAIScriptNode::RegisterLuaClass ( MOAILuaState& state ) {

	MOAINode::RegisterLuaClass ( state );
}

//----------------------------------------------------------------//
void MOAIScriptNode::RegisterLuaFuncs ( MOAILuaState& state ) {

	MOAINode::RegisterLuaFuncs ( state );

	luaL_Reg regTable [] = {
		{ "reserveAttrs",			_reserveAttrs },
		{ "setCallback",			_setCallback },
		{ NULL, NULL }
	};

	luaL_register ( state, 0, regTable );
}


text:
package com.mtt.myapp.common.excpetion;

/**
 * Configuration Exception.
 *
 * @author Mavlarn
 * @since 1.0
 */
@SuppressWarnings("serial")
public class ConfigurationException extends CustomRuntimeException {

	/**
	 * Constructor.
	 *
	 * @param message
	 *            message
	 * @param t
	 *            root cause
	 */
	public ConfigurationException(String message, Throwable t) {
		super(message, t);
	}
}


text:
**This documentation is still a work in progress!!!**

NBlockchain is a .NET standard library for building blockchain applications.

## Block content

A block consists of a collection of transactions, and transactions in turn are simply a container for instructions.
You may define your own schema for each of your own instruction types by inheriting off the `Instruction` abstract class.

Once you have defined your own instruction types, you can implement an instruction repository in order to query accepted instructions within your custom rule sets.  Do this by inheriting off the `InstructionRepository` class for LiteDb or the `MongoInstructionRepository` for MongoDB.

You may then define transaction level rules that can inspect the enclosed instructions by implementing the `ITransactionRule` interface.
At this point you may inject your custom instruction repositories into these rule classes via the constructor.

Furthermore, you may define block level rules that can inspect all the transactions within a block by implementing the `IBlockRule` interface.

## Node configuration

You must configure the IoC container with the various pieces you wish to include.  eg.

```c#
services.AddBlockchain(blockchain =>
{
    blockchain.UseDataConnection("node.db");
    blockchain.UseInstructionRepository<ICustomInstructionRepository, CustomInstructionRepository>();
    blockchain.UseTcpPeerNetwork(port);
    blockchain.UseMulticastDiscovery("My Currency", "224.100.0.1", 8088);
    blockchain.UseNoNatTraversal();
    blockchain.AddInstructionType<TransferInstruction>();
    blockchain.AddInstructionType<CoinbaseInstruction>();
    blockchain.AddTransactionRule<BalanceRule>();
    blockchain.AddTransactionRule<CoinbaseTransactionRule>();
    blockchain.AddBlockRule<CoinbaseBlockRule>();
    blockchain.UseBlockbaseProvider<CoinbaseBuilder>();
    blockchain.UseParameters(new StaticNetworkParameters()
    {
        BlockTime = TimeSpan.FromSeconds(120),
        HeaderVersion = 1
    });
});
```


text:
package com.haulmont.restapi.service.filter;

import java.util.Map;

/**
 * The result of JSON entities filter parsing. It is used by the {@link RestFilterParser}
 */
public class RestFilterParseResult {

    protected String jpqlWhere;

    protected Map<String, Object> queryParameters;

    public RestFilterParseResult(String jpqlWhere, Map<String, Object> queryParameters) {
        this.jpqlWhere = jpqlWhere;
        this.queryParameters = queryParameters;
    }

    public String getJpqlWhere() {
        return jpqlWhere;
    }

    public Map<String, Object> getQueryParameters() {
        return queryParameters;
    }
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text.RegularExpressions;

namespace Azure.AI.FormRecognizer.Models
{
    /// <summary>
    /// Represents a field recognized in an input form.
    /// </summary>
    public class FormField
    {
        internal FormField(string name, int pageNumber, KeyValuePair field, IReadOnlyList<ReadResult> readResults)
        {
            Confidence = field.Confidence;
            Name = name;

            FieldBoundingBox labelBoundingBox = field.Key.BoundingBox == null ? default : new FieldBoundingBox(field.Key.BoundingBox);
            IReadOnlyList<FormElement> labelFormElement = field.Key.Elements != null
                ? ConvertTextReferences(field.Key.Elements, readResults)
                : new List<FormElement>();
            LabelData = new FieldData(labelBoundingBox, pageNumber, field.Key.Text, labelFormElement);

            FieldBoundingBox valueBoundingBox = field.Value.BoundingBox == null ? default : new FieldBoundingBox(field.Value.BoundingBox);
            IReadOnlyList<FormElement> valueFormElement = field.Value.Elements != null
                ? ConvertTextReferences(field.Value.Elements, readResults)
                : new List<FormElement>();
            ValueData = new FieldData(valueBoundingBox, pageNumber, field.Value.Text, valueFormElement);

            Value = new FieldValue(new FieldValue_internal(field.Value.Text), readResults);
        }

        internal FormField(string name, FieldValue_internal fieldValue, IReadOnlyList<ReadResult> readResults)
        {
            Confidence = fieldValue.Confidence ?? Constants.DefaultConfidenceValue;
            Name = name;
            LabelData = null;

            // Bounding box and page are not returned by the service in two scenarios:
            //   - When this field is global and not associated with a specific page (e.g. ReceiptType).
            //   - When this field is a collection, such as a list or dictionary.
            //
            // In these scenarios we do not set a ValueData.

            if (fieldValue.BoundingBox.Count == 0 && fieldValue.Page == null)
            {
                ValueData = null;
            }
            else
            {
                IReadOnlyList<FormElement> fieldElements = ConvertTextReferences(fieldValue.Elements, readResults);

                FieldBoundingBox boundingBox = new FieldBoundingBox(fieldValue.BoundingBox);

                ValueData = new FieldData(boundingBox, fieldValue.Page.Value, fieldValue.Text, fieldElements);
            }

            Value = new FieldValue(fieldValue, readResults);
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="FormField"/> class.
        /// </summary>
        /// <param name="name">Canonical name; uniquely identifies a field within the form.</param>
        /// <param name="labelData">Contains the text, bounding box and content of the label of the field in the form.</param>
        /// <param name="valueData">Contains the text, bounding box and content of the value of the field in the form.</param>
        /// <param name="value">The strongly-typed value of this field.</param>
        /// <param name="confidence">Measures the degree of certainty of the recognition result.</param>
        internal FormField(string name, FieldData labelData, FieldData valueData, FieldValue value, float confidence)
        {
            Name = name;
            LabelData = labelData;
            ValueData = valueData;
            Value = value;
            Confidence = confidence;
        }

        /// <summary>
        /// Canonical name; uniquely identifies a field within the form.
        /// </summary>
        public string Name { get; }

        /// <summary>
        /// Contains the text, bounding box and content of the label of the field in the form.
        /// </summary>
        public FieldData LabelData { get; }

        /// <summary>
        /// Contains the text, bounding box and content of the value of the field in the form.
        /// </summary>
        public FieldData ValueData { get; }

        /// <summary>
        /// The strongly-typed value of this <see cref="FormField"/>.
        /// </summary>
        public FieldValue Value { get; }

        /// <summary>
        /// Measures the degree of certainty of the recognition result. Value is between [0.0, 1.0].
        /// </summary>
        public float Confidence { get; }

        internal static IReadOnlyList<FormElement> ConvertTextReferences(IReadOnlyList<string> references, IReadOnlyList<ReadResult> readResults)
        {
            List<FormElement> FormElement = new List<FormElement>();
            foreach (var reference in references)
            {
                FormElement.Add(ResolveTextReference(readResults, reference));
            }
            return FormElement;
        }

        private static Regex _wordRegex = new Regex(@"/readResults/(?<pageIndex>\d*)/lines/(?<lineIndex>\d*)/words/(?<wordIndex>\d*)$", RegexOptions.Compiled, TimeSpan.FromSeconds(2));
        private static Regex _lineRegex = new Regex(@"/readResults/(?<pageIndex>\d*)/lines/(?<lineIndex>\d*)$", RegexOptions.Compiled, TimeSpan.FromSeconds(2));
        private static Regex _selectionMarkRegex = new Regex(@"/readResults/(?<pageIndex>\d*)/selectionMarks/(?<selectionMarkIndex>\d*)$", RegexOptions.Compiled, TimeSpan.FromSeconds(2));

        private static FormElement ResolveTextReference(IReadOnlyList<ReadResult> readResults, string reference)
        {
            // Example: the following should result in PageIndex = 3, LineIndex = 7, WordIndex = 12
            // "#/analyzeResult/readResults/3/lines/7/words/12" from DocumentResult
            // "#/readResults/3/lines/7/words/12" from PageResult

            // Word Reference
            var wordMatch = _wordRegex.Match(reference);
            if (wordMatch.Success && wordMatch.Groups.Count == 4)
            {
                int pageIndex = int.Parse(wordMatch.Groups["pageIndex"].Value, CultureInfo.InvariantCulture);
                int lineIndex = int.Parse(wordMatch.Groups["lineIndex"].Value, CultureInfo.InvariantCulture);
                int wordIndex = int.Parse(wordMatch.Groups["wordIndex"].Value, CultureInfo.InvariantCulture);

                return new FormWord(readResults[pageIndex].Lines[lineIndex].Words[wordIndex], pageIndex + 1);
            }

            // Line Reference
            var lineMatch = _lineRegex.Match(reference);
            if (lineMatch.Success && lineMatch.Groups.Count == 3)
            {
                int pageIndex = int.Parse(lineMatch.Groups["pageIndex"].Value, CultureInfo.InvariantCulture);
                int lineIndex = int.Parse(lineMatch.Groups["lineIndex"].Value, CultureInfo.InvariantCulture);

                return new FormLine(readResults[pageIndex].Lines[lineIndex], pageIndex + 1);
            }

            // Selection Mark Reference
            var selectionMarkMatch = _selectionMarkRegex.Match(reference);
            if (selectionMarkMatch.Success && selectionMarkMatch.Groups.Count == 3)
            {
                int pageIndex = int.Parse(selectionMarkMatch.Groups["pageIndex"].Value, CultureInfo.InvariantCulture);
                int selectionMark = int.Parse(selectionMarkMatch.Groups["selectionMarkIndex"].Value, CultureInfo.InvariantCulture);

                return new FormSelectionMark(readResults[pageIndex].SelectionMarks[selectionMark], pageIndex + 1);
            }

            throw new InvalidOperationException($"Failed to parse element reference: {reference}");
        }
    }
}


text:
package org.jivesoftware.sparkimpl.plugin.gateways;

import org.jivesoftware.resource.Res;
import org.jivesoftware.resource.SparkRes;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.filter.OrFilter;
import org.jivesoftware.smack.filter.StanzaFilter;
import org.jivesoftware.smack.filter.StanzaTypeFilter;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smack.provider.ProviderManager;
import org.jivesoftware.smackx.disco.packet.DiscoverItems;
import org.jivesoftware.spark.ChatManager;
import org.jivesoftware.spark.PresenceManager;
import org.jivesoftware.spark.SparkManager;
import org.jivesoftware.spark.component.MessageDialog;
import org.jivesoftware.spark.component.VerticalFlowLayout;

import org.jivesoftware.spark.plugin.Plugin;
import org.jivesoftware.spark.ui.*;
import org.jivesoftware.spark.util.SwingWorker;
import org.jivesoftware.spark.util.log.Log;
import org.jivesoftware.sparkimpl.plugin.gateways.transports.*;
import org.jivesoftware.sparkimpl.settings.local.LocalPreferences;
import org.jivesoftware.sparkimpl.settings.local.SettingsManager;
import org.jxmpp.util.XmppStringUtils;

import javax.swing.*;

import java.awt.Color;
import java.util.HashMap;
import java.util.Map;

/**
 * Handles Gateways/Transports in Spark.
 *
 * @author Derek DeMoro
 */
public class GatewayPlugin implements Plugin, ContactItemHandler {

    /**
     * Defined Static Variable for Gateways. *
     */
    public static final String GATEWAY = "gateway";
    private boolean useTab;

    private Map<Transport, GatewayItem> uiMap = new HashMap<>();;
    private JPanel transferTab = new JPanel();

    public void initialize() {
	ProviderManager.addIQProvider(Gateway.ELEMENT_NAME, Gateway.NAMESPACE, new Gateway.Provider());
	LocalPreferences localPref = SettingsManager.getLocalPreferences();
	useTab = localPref.getShowTransportTab();
	transferTab.setBackground((Color)UIManager.get("ContactItem.background"));
        SwingWorker thread = new SwingWorker() {
            public Object construct() {
                try {
                    // Let's try and avoid any timing issues with the gateway presence.
                    Thread.sleep(5000);
                    populateTransports();
                }
                catch (Exception e) {
                    Log.error(e);
                    return false;
                }

                return true;
            }

            public void finished() {

        	transferTab.setLayout(new VerticalFlowLayout(0,0,0,true,false));
        	Boolean transportExists = (Boolean)get();
                if (!transportExists) {
                    return;
                }

                if (TransportUtils.getTransports().size() > 0  && useTab) {
                   SparkManager.getWorkspace().getWorkspacePane().addTab(Res.getString("title.transports"), SparkRes.getImageIcon(SparkRes.TRANSPORT_ICON), transferTab);
                }

                for (final Transport transport : TransportUtils.getTransports()) {
                    addTransport(transport);
                }

                // Register presences.
                registerPresenceListener();
            }
        };

        thread.start();
    }

    public void shutdown() {
    }

    public boolean canShutDown() {
        return false;
    }

    public void uninstall() {
    }

    private void populateTransports() throws Exception {
        DiscoverItems discoItems = SparkManager.getSessionManager().getDiscoveredItems();

        for (DiscoverItems.Item item : discoItems.getItems() ) {

            String entityName = item.getEntityID();
            if (entityName != null) {
        	if (entityName.startsWith("aim.")) {
                    AIMTransport aim = new AIMTransport(item.getEntityID());
                    TransportUtils.addTransport(item.getEntityID(), aim);
                }
                else if (entityName.startsWith("msn.")) {
                    MSNTransport msn = new MSNTransport(item.getEntityID());
                    TransportUtils.addTransport(item.getEntityID(), msn);
                }
                else if (entityName.startsWith("yahoo.")) {
                    YahooTransport yahoo = new YahooTransport(item.getEntityID());
                    TransportUtils.addTransport(item.getEntityID(), yahoo);
                }
                else if (entityName.startsWith("icq.")) {
                    ICQTransport icq = new ICQTransport(item.getEntityID());
                    TransportUtils.addTransport(item.getEntityID(), icq);
                }
                else if (entityName.startsWith("gtalk.")) {
                    GTalkTransport gtalk = new GTalkTransport(item.getEntityID());
                    TransportUtils.addTransport(item.getEntityID(), gtalk);
                }
                else if (entityName.startsWith("xmpp.")) {
                    XMPPTransport xmppTransport = new XMPPTransport(item.getEntityID());
                    TransportUtils.addTransport(item.getEntityID(), xmppTransport);
                }
                else if (entityName.startsWith("irc.")) {
                    IRCTransport ircTransport = new IRCTransport(item.getEntityID());
                    TransportUtils.addTransport(item.getEntityID(), ircTransport);
                }
                else if (entityName.startsWith("sip.") || entityName.startsWith("simple.")) {
                    SimpleTransport simpleTransport = new SimpleTransport(item.getEntityID());
                    TransportUtils.addTransport(item.getEntityID(), simpleTransport);
                }
                else if (entityName.startsWith("gadugadu.")) {
                    GaduGaduTransport gadugaduTransport = new GaduGaduTransport(item.getEntityID());
                    TransportUtils.addTransport(item.getEntityID(), gadugaduTransport);
                }
                else if (entityName.startsWith("qq.")) {
                    QQTransport qqTransport = new QQTransport(item.getEntityID());
                    TransportUtils.addTransport(item.getEntityID(), qqTransport);
                }
                else if (entityName.startsWith("sametime.")) {
                	SametimeTransport sametimeTransport = new SametimeTransport(item.getEntityID());
                    TransportUtils.addTransport(item.getEntityID(), sametimeTransport);
                }
                else if (entityName.startsWith("facebook.")) {
                	FacebookTransport facebookTransport = new FacebookTransport(item.getEntityID());
                    TransportUtils.addTransport(item.getEntityID(), facebookTransport);
                }
                else if (entityName.startsWith("myspace.") || entityName.startsWith("myspaceim.")) {
                	MySpaceTransport myspaceTransport = new MySpaceTransport(item.getEntityID());
                    TransportUtils.addTransport(item.getEntityID(), myspaceTransport);
                }
            }
        }

    }

    private void addTransport(final Transport transport) {
	GatewayItem item;
	if (useTab)
        {
            item = new GatewayTabItem(transport);
            transferTab.add((GatewayTabItem)item);
            }
        else
        {
           item = new GatewayButton(transport);
        }
        uiMap.put(transport, item);
      //  transferTab.add(button);
      //  transferTab.add(new GatewayTabItem(transport));
    }

    private void registerPresenceListener() {
        StanzaFilter orFilter = new OrFilter(new StanzaTypeFilter(Presence.class), new StanzaTypeFilter(Message.class));

        SparkManager.getConnection().addAsyncStanzaListener( stanza -> {
            if (stanza instanceof Presence) {
                Presence presence = (Presence)stanza;
                Transport transport = TransportUtils.getTransport(stanza.getFrom());
                if (transport != null) {
                    boolean registered = true;
                    if (presence.getType() == Presence.Type.unavailable) {
                        registered = false;
                    }

                    GatewayItem button = uiMap.get(transport);

                    button.signedIn(registered);

                    SwingWorker worker = new SwingWorker() {

            @Override
            public Object construct() {
            transferTab.revalidate();
            transferTab.repaint();
            return 41;
            }
        };
        worker.start();
                }
            }
            else if (stanza instanceof Message) {
                Message message = (Message)stanza;
                String from = message.getFrom();
                boolean hasError = message.getType() == Message.Type.error;
                String body = message.getBody();

                if (from != null && hasError) {
                    Transport transport = TransportUtils.getTransport(from);
                    if (transport != null) {
                        String title = "Alert from " + transport.getName();
                        // Show error
                        MessageDialog.showAlert(body, title, "Information", SparkRes.getImageIcon(SparkRes.INFORMATION_IMAGE));
                    }
                }
            }
        }, orFilter);

        ChatManager chatManager = SparkManager.getChatManager();
        chatManager.addContactItemHandler(this);

        // Iterate through Contacts and check for
        final ContactList contactList = SparkManager.getWorkspace().getContactList();
        for (ContactGroup contactGroup : contactList.getContactGroups()) {
            for (ContactItem contactItem : contactGroup.getContactItems()) {
                Presence presence = contactItem.getPresence();
                if (presence.isAvailable()) {
                    String domain = XmppStringUtils.parseDomain(presence.getFrom());
                    Transport transport = TransportUtils.getTransport(domain);
                    if (transport != null) {
                        handlePresence(contactItem, presence);
                        contactGroup.fireContactGroupUpdated();
                    }
                }
            }
        }

        SparkManager.getSessionManager().addPresenceListener( presence -> {
            for (Transport transport : TransportUtils.getTransports()) {
                GatewayItem button = uiMap.get(transport);
                if (button.isLoggedIn()) {
                    if (!presence.isAvailable()) {
                        return;
                    }
                    // Create new presence
                    Presence p = new Presence(presence.getType(), presence.getStatus(), presence.getPriority(), presence.getMode());
                    p.setTo(transport.getServiceName());
                    try
                    {
                        SparkManager.getConnection().sendStanza(p);
                    }
                    catch ( SmackException.NotConnectedException e )
                    {
                        Log.warning( "Unable to forward presence change to transport.", e );
                    }
                }
            }
        } );
    }

    public boolean handlePresence(ContactItem item, Presence presence) {
        if (presence.isAvailable()) {
            String domain = XmppStringUtils.parseDomain(presence.getFrom());
            Transport transport = TransportUtils.getTransport(domain);
            if (transport != null) {
                if (presence.getType() == Presence.Type.available) {
                    item.setSpecialIcon(transport.getIcon());
                }
                else {
                    item.setSpecialIcon(transport.getInactiveIcon());
                }
                return false;
            }
        }

        return false;
    }

    public boolean handleDoubleClick(ContactItem item) {
        return false;
    }

    public Icon getIcon(String jid) {
        String domain = XmppStringUtils.parseDomain(jid);
        Transport transport = TransportUtils.getTransport(domain);
        if (transport != null) {
            if (PresenceManager.isOnline(jid)) {
                return transport.getIcon();
            }
            else {
                return transport.getInactiveIcon();
            }
        }
        return null;
    }

    public Icon getTabIcon(Presence presence) {
        return null;
    }
}


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>EntryProcessor (Hazelcast Root 3.3.3 API)</title>
<meta name="date" content="2014-11-12">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

com.hazelcast.map

Interface EntryProcessor<K,V>

Type Parameters:

K -

V -

All Superinterfaces:

Serializable

All Known Implementing Classes:

AbstractEntryProcessor, AbstractWebDataEntryProcessor, AddSessionEntryProcessor, DestroySessionEntryProcessor, InvalidateSessionAttributesEntryProcessor, ReferenceSessionEntryProcessor

public interface EntryProcessor<K,V>
extends Serializable

An EntryProcessor passes you a Map.Entry. At the time you receive it
 the entry is locked and not released until the EntryProcessor completes.
 This obviates the need to explicitly lock as would be required with a ExecutorService.

 Performance can be very high as the data is not moved off the Member partition. This avoids network cost and, if
 the storage format is InMemoryFormat.OBJECT then there is no de-serialization or serialization
 cost.

 EntryProcessors execute on the partition thread in a member. Multiple operations on the same partition are queued.

 While executing partition migrations are not allowed. Any migrations are queued on the partition thread.

 An EntryProcessor may not be re-entrant i.e. it may not access the same Map. Limitation: you can only access
 data on the same partition.

 Note that to modify an entry by using EntryProcessors you should explicitly call
 Map.Entry.setValue(V) method of Map.Entry such as:

 Override
     public Object process(Map.Entry entry) {
        Value value = entry.getValue();
        // process and modify value
        // ...
        entry.setValue(value);
        return result;
    }

 otherwise EntryProcessor does not guarantee to modify the entry.

Method Summary

Methods

Modifier and Type
Method and Description

EntryBackupProcessor<K,V>
getBackupProcessor()

Get the entry processor to be applied to backup entries.

Object
process(Map.Entry<K,V> entry)

Process the entry without worrying about concurrency.

Method Detail

process

Object process(Map.Entry<K,V> entry)

Process the entry without worrying about concurrency.

 Note that to modify an entry by using EntryProcessor you should explicitly call
 Map.Entry.setValue(V) method of Map.Entry such as:

 Override
        public Object process(Map.Entry entry) {
          Value value = entry.getValue();
          // process and modify value
          // ...
          entry.setValue(value);
          return result;
        }

 otherwise EntryProcessor does not guarantee to modify the entry.

Parameters:

entry - entry to be processed

Returns:

result of the process

getBackupProcessor

EntryBackupProcessor<K,V> getBackupProcessor()

Get the entry processor to be applied to backup entries.

Returns:

back up processor

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.


text:
A vagrant python Machine Learning Stack

## OSX Install
https://www.vagrantup.com/downloads.html
https://www.virtualbox.org/wiki/Downloads

`vagrant plugin install vagrant-vbguest`

## DOCS
 * https://nlp.stanford.edu/software/CRF-NER.shtml
 * http://www.opener-project.eu/
 * https://opennlp.apache.org/documentation/manual/opennlp.html#tools.namefind.recognition.api

## Models
http://opennlp.sourceforge.net/models-1.5/I
 * http://opennlp.sourceforge.net/models-1.5/en-ner-location.bin


text:
layout: article
title: "Du Sud au Nord"
categories: articles
tags: "Queenstown"
date-begin: 2015-03-09
date-end: 2015-03-20
image:
  teaser-ext: "http://lh5.ggpht.com/-RmhLGxhRFZc/VRkBkHMfInI/AAAAAAAADx4/n2xwioltWF4/s1280/upload_-1.jpg"
album: "https://picasaweb.google.com/104897435834545155307/DuSudAuNord?authkey=Gv1sRgCNikmYf2oajX8AE"
translation : "/articles/2015/03/from-south-to-north-vo"
published: true
---

Déjà trois mois que l'on se prélasse en NZ. On mène une vie bien paisible quand on est en vacances pour un an :). De temps en temps, pour briser la monotonie, on se fixe des petits challenges. La mission impossible du jour est de rejoindre Nelson (dans le nord de l'île alors qu'on est actuellement au fin fond du sud) via la West Coast et d'y trouver un travail de fruit picker dans les 2 semaines. Pour pimenter le tout, un incontournable détour par les Catlins est ajouté au programme déjà bien chargé (il faut bien finir ce qu'on avait préalablement commencé).

### Les Catlins: le retour

On est passé par le point le plus au Sud de la Nouvelle-Zélande, on a vu, entre autres, une forêt d'arbres pétrifiés, des pingouins antipodes et des dauphins de Hector (d'assez loin, avouons-le). La visite des Cathedral Caves (grottes uniquement accessibles à marée basse) au tarif enfant a été possible grâce à Olivier, fraichement rasé, qui a fait de l'oeil à la guichetière...

{% include image.html url="http://lh3.ggpht.com/-kA9w8IufUWQ/VRkWeqj7YyI/AAAAAAAAD0g/oJYDCxqIYlQ/s1280/upload_-1.jpg" caption="Slope Point et Curio Bay" %}

{% include image.html url="http://lh5.ggpht.com/-Qhf8TQZZAcI/VRkWcO83Z0I/AAAAAAAAD0Y/pEdh9MhOjF8/s1280/upload_-1.jpg" caption="Cathedral Caves" %}

### Central Otago (le retour aussi)

De retour à Cromwell ! Même camping, même ville, serait-on nostalgique ? Pas du tout, c'est le seul chemin du coin vers le Nord. Profitons-en pour prendre le thé chez Gary (notre sympathique patron, fraîchement édenté pour la petite histoire ... d'après notre expérience, les néo-zélandais vont souvent se faire arracher des dents). Gary nous offre également l'opportunité de récolter le miel de trois de ces ruches. "Suit up and let's harvest the honey!" Pas une piqûre et 2 pots de miel dans le coffre, l'opération est un succès!

{% include image.html url="http://lh3.ggpht.com/-kSRavZbTj5s/VRkWZmEzA_I/AAAAAAAAD0Q/OHMu9h0mATY/s1280/upload_-1.jpg" caption="Glenorchy" %}

{% include image.html url="http://lh5.ggpht.com/-XlaomsigR5o/VRkWXAYT4rI/AAAAAAAAD0I/o7nHFczfzBE/s1280/upload_-1.jpg" caption="Rum's Currie Campsite" %}

{% include image.html url="http://lh5.ggpht.com/-ZQ119lZcutw/VRkWUE-vMRI/AAAAAAAAD0A/fwEI608ThIQ/s1280/upload_-1.jpg" caption="Apiculture chez Gary" %}

### West Coast (ça, c'est nouveau ;) )

On change de région et toujours de nombreuses raisons de s'arrêter en route : Blue Pools, Fantail Falls et Thunder Creek Falls. Et curieusement encore des anecdotes !! De bon matin, en reprenant la route, on suit un camping car assez vieux qui se met à fumer méchamment... Il s'arrête, on s'arrête aussi et nous voilà avec nos premiers passagers clandestins couchés à l'arrière de la chariotte, direction le prochain garage (environ 50kms plus loin). Plus tard dans la journée, on s'arrête à une petite échoppe pour déguster la spécialité locale : une omelette "farcie" aux minuscules petits poissons transparents, les whitebaits. Serait-ce la coupe de cheveux rétro de Olivier qui nous attire encore les sympathies des femmes de 50 ans ou plus ? Car on repart de l'échoppe avec des tomates fraiches et des pommes offertes par la vendeuse.

{% include image.html url="http://lh3.ggpht.com/-Rxf5hMYvE7k/VRkWQ2X2jBI/AAAAAAAADz4/Fei5mDF_laQ/s1280/upload_-1.jpg" caption="Blue Pools, Fantail et Thundercreek Falls" %}

{% include image.html url="http://lh4.ggpht.com/-0lqeSoSMohU/VRkWOQtxd2I/AAAAAAAADzw/bYACioNT2B4/s1280/upload_-1.jpg" caption="Jackson Bay" %}

{% include image.html url="http://lh3.ggpht.com/-BjzXSgda8bc/VRkWLu6Tm1I/AAAAAAAADzo/Ho9-PQwZawg/s1280/upload_-1.jpg" caption="" %}

Départ à l'aube pour éviter tout attroupement au très touristique Fox Glacier. Objectif atteint : on a croisé plus d'opossums que de touristes. Sachez que, sur la route, l'opossum de nuit est bien vivant contrairement à l'opossum de jour qui est souvent bien aplati.

{% include image.html url="http://lh3.ggpht.com/-MmxD8tzqYrQ/VRkWI_Re_UI/AAAAAAAADzg/tOq1THuT-9E/s1280/upload_-1.jpg" caption="Fox Glacier et Gillespie Beach: son lagon, ses anciennes galeries de mines d'or et sa colonie de phoques" %}

Conseil pour le voyageur : toujours avoir suffisamment de monnaie sur soi pour payer les campings. Par manque de prévoyance, le camping de Hokarito Lagoon (super réserve naturelle où il y a des kiwis et des hérons blancs très rares) a reçu un billet de 5€ au lieu de 5NZ$.

Passage obligé par le village de Ross: somme toute assez banal si s'en est le nom. Arrêt à la petite ville d'Hokitika: visite d'un atelier de souffleurs de verre et du "musée des machines à tricoter des chaussettes".

{% include image.html url="http://lh6.ggpht.com/-t-bdPZs_RKU/VRkWFj4OmGI/AAAAAAAADzY/QXasn0P8-NY/s1280/upload_-1.jpg" caption="" %}

On campe au bord du sympathique lac de Kaniere quand, soudain, un gros oiseau brunâtre avec un bec légèrement courbé s'approche de notre chariotte...

> **Rossana :**
> Olivier, regarde !! Un kiwi !!

> **Olivier :**
> C'est pas possib' ! Les kiwis, c'est super rare et ça vit que la nuit...

Notre voisin de camping nous apprendra plus tard qu'il s'agit d'un weka...

{% include image.html url="http://lh3.ggpht.com/-QYniP3dQJZo/VRkWDEUpkJI/AAAAAAAADzQ/jAOliKq1YuI/s1280/upload_-1.jpg" caption="Le kiwi commun ou weka" %}

On continue notre route vers le Nord via Greymouth et Westport : Glow worms (on apprendra que des larves d'insectes qui luisent dans le noir ne se visitent pas en journée), les pancake rocks (mieux au petit déjeuner ;) ... avant les bus remplis d'Asiatiques).

{% include image.html url="http://lh5.ggpht.com/-ajw4_0CIO-w/VRkV_fbebsI/AAAAAAAADzI/OH1_saBciP8/s1280/upload_-1.jpg" caption="Pancake Rocks et la plage de Truman" %}

{% include image.html url="http://lh3.ggpht.com/-9lfAurt5Tz0/VRkV8Zs8X2I/AAAAAAAADzA/T0L9rOLlhak/s1280/upload_-1.jpg" caption="Cape Foulwind à Westport" %}

### Nelson et Golden Bay

On quitte la West Coast comme on y est entré, avec un passager clandestin, un jeune Suisse qui marchait plus vite que son ombre pour ne pas devoir payer les huttes en chemin. Il faisait du stop pour rejoindre sa voiture au début du Heaphy Track (80kms) bouclé en deux jours.

Finalement, Nelson, capitale du soleil où on espère trouver un job de cueilleur de pommes dans un de ses nombreux vergers. Mission accomplie!

{% include image.html url="http://lh4.ggpht.com/-THXsyCCbTck/VRkV5rZUgvI/AAAAAAAADy4/zcg5yCXyRcs/s1280/upload_-1.jpg" caption="Harwood Hole" %}

{% include image.html url="http://lh4.ggpht.com/-1_AHETnzboo/VRkV2QgxxQI/AAAAAAAADyw/0Am613ryDgk/s1280/upload_-1.jpg" caption="Te Waikoropupu Springs" %}

La suite dans le prochain épisode... :)

**Spoiler alerts.**

* *On n'a pas trouvé de travail*
* *Olivier a été chez le coiffeur*


text:
fibs = 1 : 2 : zipWith (+) fibs (tail fibs)

sumEven = sum . takeWhile (< 4000000) . filter even $ fibs


text:
package com.eagle.programmar.TCL.Terminals;

import com.eagle.parsers.EagleFileReader;
import com.eagle.parsers.EagleLineReader;
import com.eagle.tokens.TerminalCommentToken;

public class TCL_Comment extends TerminalCommentToken
{
	public TCL_Comment()
	{
		this("");
	}

	public TCL_Comment(String comment)
	{
		super(comment);
	}

	@Override
	public boolean parse(EagleFileReader lines)
	{
		if (findStart(lines) == FOUND.EOF) return false;

		EagleLineReader rec = lines.get(_currentLine);
		int nc = rec.length();
		if (_currentChar >= nc || rec.charAt(_currentChar) != '#') return false;

		foundIt(_currentLine, nc);
		_comment = rec.substring(_currentChar, nc);
		return true;
	}
}


text:
package br.ufrn.apoo.garbagego.services;

import br.ufrn.apoo.garbagego.exceptions.NegocioException;

public interface ServiceInterface<T> {
	void validar(T obj) throws NegocioException;
}


text:
@interface StringHelperTests : SenTestCase

@end


text:
package junit.tests.framework;

import junit.framework.TestCase;

/**
 * A test case testing the testing framework.
 */
public class Success extends TestCase {

    @Override
    public void runTest() {
    }

    public void testSuccess() {
    }
}


text:
        <title>Attribute Form</title>

        <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-3.4.0/resources/css/ext-all.css" />
        <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-3.4.0/examples/shared/examples.css" />

Attribute Form

This example shows how to create a form with fields creates from
        attributes read from a WFS DescribeFeatureType response. This can be
        useful when doing feature editing with WFS-T.

Note that validation is activated based on the restriction
        information read from the DescribeFeatureType document. For example the
        "STATE_NAME", "STATE_FIPS", "SUB_REGION", and "STATE_ABBR" text fields
        indicate errors if more than 5 characters are entered.

Field labels have been formatted with templates, so that a star is
        displayed when the field is required.

Note that the js is not minified so it is readable.
        See attribute-form.js.


text:
.. -*- coding: utf-8 -*-
.. https://docs.docker.com/mac/step_two/
.. doc version: 1.10
.. check date: 2016/4/13
.. -----------------------------------------------------------------------------

.. Learn about images & containers

.. _learn-about-images-containers-mac:

========================================
イメージとコンテナを学ぶ
========================================

.. sidebar:: 目次

   .. contents::
       :depth: 3
       :local:

.. Docker Engine provides the core Docker technology that enables images and containers. As the last step in your installation, you ran the Engine docker run hello-world command. With this one command, you completed the core tasks to using Engine. The command you ran had three parts.

Docker Engine は Docker の中心となる技術を提供します。これはイメージとコンテナを扱う技術です。先ほどのステップでインストールを終えていますので、 ``docker run hello-world`` コマンドを実行できます。このコマンドを1つ実行するだけで、Engine を使う上で中心となるタスクをこなします。コマンドは3つのパーツに分かれています。

.. image:: /tutimg/container_explainer.png
   :scale: 60%
   :alt: docker run hello-world

.. A container is a stripped-to-basics version of a Linux operating system. An image is software you load into a container. When you ran the command, the Engine Software:

コンテナを基礎まで剥がしていくと、そこには Linux オペレーティング・システムがあります。イメージとはコンテナ内に積み込むソフトウェアです。コマンドを実行すると、Engine のソフトウェアは次の処理をしました。

..    checked to see if you had the hello-world software image
    downloaded the image from the Docker Hub (more about the hub later)
    loaded the image into the container and "ran" it

* ``hello-world`` ソフトウェアのイメージを持っているかどうか確認。
* Docker Hub (詳しくは後述)からイメージをダウンロード。
* コンテナにイメージを載せて(読み込んで)「実行」する。

.. Depending on how it was built, an image might run a simple, single command and then exit. This is what Hello-World did.

イメージが何を実行するかは、イメージがどのように構築されたかに依ります。このイメージは ``Hello-World`` を表示する単純なコマンドを持ちます。

.. A Docker image, though, is capable of much more. An image can start software as complex as a database, wait for you (or someone else) to add data, store the data for later use, and then wait for the next person.

Docker イメージ次第で様々な処理ができます。データベースのような複雑なソフトウェアでも、イメージを使って実行できます。あなた(もしくは誰かが)データを追加するのに待つ必要はなく、保管したデータを使えます。さらに、次の人もすぐに使えるのです。

.. Who built the hello-world software image though? In this case, Docker did but anyone can. Docker Engine lets people (or companies) create and share software through Docker images. Using Docker Engine, you don't have to worry about whether your computer can run the software in a Docker image — a Docker container can always run it.

さて、``hello-world`` ソフトウェアのイメージは、誰が作ったのでしょうか。このイメージは Docker が作りましたが、イメージそのものは誰でも作れます。Docker Engine は人々(あるいは会社)が作成したソフトウェアを、 Docker イメージを通して共有できるようにします。 Docker イメージ内のソフトウェアをどのコンピュータで実行すべきか、Docker Engine を使えば迷う必要がありません。なぜなら Docker コンテナをどこでも実行できるからです。

.. Where to go next

次は何をしますか
====================

.. See, that was quick wasn't it? Now, you are ready to do some really fun stuff with Docker. Go on to the next part to find and run the whalesay image.

ご覧の通り、迅速だとは思いませんか。これで Docker を使って面白いことをする準備が整いました。次の :doc:`step_three` に進みましょう。

.. seealso::

   Learn about images & containers
      https://docs.docker.com/mac/step_two/


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

namespace ConveyorBelt.Tooling.Internal
{
    public static class ServicePointHelper
    {
        /// <summary>
        /// 1. Improving performance of HTTP
        /// 2. Making lifetime of a DNS connection shorter
        /// </summary>
        public static void ApplyStandardSettings(string url)
        {
            var sp = ServicePointManager.FindServicePoint(new Uri(url));
            sp.Expect100Continue = false;
            sp.UseNagleAlgorithm = false;
            sp.ConnectionLeaseTimeout = 60*1000; // 1 minute
        }
    }
}


text:
#include "TTDSP.h"
#include "TTAudioObjectArray.h"

#define thisTTClass			TTAudioObjectArray
#define thisTTClassName		"array"
#define thisTTClassTags		"audio, array"

TT_AUDIO_CONSTRUCTOR,
	mSize(0),
	mInputChannelSignal(NULL),
	mOutputChannelSignal(NULL)
{
	TTUInt16 initialMaxNumChannels = arguments;

	TTObjectInstantiate(kTTSym_audiosignal, &mInputChannelSignal, 1);
	TTObjectInstantiate(kTTSym_audiosignal, &mOutputChannelSignal, 1);

	addAttributeWithSetter(Size,	kTypeUInt16);
	addAttributeWithSetter(Class,	kTypeSymbol);
	addUpdates(MaxNumChannels);

	addMessageWithArguments(set);

	setAttributeValue(kTTSym_maxNumChannels, initialMaxNumChannels);
	setAttributeValue("class", "gain");
	setProcessMethod(processAudio);
}

TTAudioObjectArray::~TTAudioObjectArray()
{
	TTObjectRelease(&mInputChannelSignal);
	TTObjectRelease(&mOutputChannelSignal);
}

TTErr TTAudioObjectArray::updateMaxNumChannels(const TTValue& oldMaxNumChannels, TTValue&)
{
	return setAttributeValue("size", maxNumChannels);
}

TTErr TTAudioObjectArray::setSize(const TTValueRef newSize)
{
	// TODO: lock so that audio is not processed when we are resizing!

	mSize = newSize;

	// 1. free the old instances
	for (TTAudioObjectIter obj = mInstances.begin(); obj != mInstances.end(); ++obj)
		TTObjectRelease(&(*obj));

	// 2. resize the vector of pointers and set to NULL
	mInstances.resize(mSize);
	mInstances.assign(sizeof(TTPtr), 0);

	// 3. create the new instances (if the class has been defined)
	if (mClass) {
		for (TTAudioObjectIter obj = mInstances.begin(); obj != mInstances.end(); ++obj)
			TTObjectInstantiate(mClass, &(*obj), kTTVal1);
	}

	return kTTErrNone;
}

TTErr TTAudioObjectArray::setClass(const TTValueRef newClass)
{
	TTSymbol	theClassName = newClass;
	int			err = 0;

	// TODO: find out if the specified class name is a legitimate class before proceeding

	for (int i=0; i<mSize; i++)
		err |= TTObjectInstantiate(newClass, &mInstances[i], 1);

	if (!err)
		mClass = theClassName;
	return (TTErr)err;
}

TTErr TTAudioObjectArray::set(TTValue& arguments, TTValue&)
{
	// There may be two or more arguments
	// if the first argument is a number, it specifies which instance in the array to address
	// if the first argument is a symbol, then the attribute will be set for all instances
	// the first or second arg (the first which is a symbol) is the name of the attribute
	// the args past that are the value

	TTInt32		target = -1; // -1 means all voices
	TTSymbol	attrName(kTTSymEmpty);
	TTValue		attrValue;
	int			err = kTTErrNone;

	if (ttDataTypeInfo[arguments.getType(0)]->isNumerical)
		target = arguments;

	if (target >= 0) {
		if (target < mSize){
		if (arguments.getSize() < 3)
			return kTTErrWrongNumValues;
		else
			arguments.get(1, attrName);

		if (!attrName)
			return kTTErrInvalidAttribute;

		attrValue.copyFrom(arguments, 2);

		err = mInstances[target]->setAttributeValue(attrName, attrValue);
		}

	}
	else {
		if (arguments.getSize() < 2)
			return kTTErrWrongNumValues;
		else
			arguments.get(0, attrName);

		if (!attrName)
			return kTTErrInvalidAttribute;

		attrValue.copyFrom(arguments, 1);

		for (int i=0; i<mSize; i++)
			err |= mInstances[i]->setAttributeValue(attrName, attrValue);

	}

	arguments.clear();
	return (TTErr)err;
}

TTErr TTAudioObjectArray::processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
{
	TTAudioSignal&	in = inputs->getSignal(0);
	TTAudioSignal&	out = outputs->getSignal(0);
	TTUInt16		channelCount = TTAudioSignal::getMinChannelCount(in, out);
	TTUInt16		vs = in.getVectorSizeAsInt();

	for (TTUInt16 channel=0; channel<channelCount; channel++) {
		mInputChannelSignal->setVector(0, vs, in.mSampleVectors[channel]);
		mOutputChannelSignal->setVector(0, vs, out.mSampleVectors[channel]);
		mInstances[channel]->process(mInputChannelSignal, mOutputChannelSignal);
	}
	return kTTErrNone;
}

TTErr TTAudioObjectArray::test(TTValue& returnedTestInfo)
{
	// TODO: write unit tests
	return TTObject::test(returnedTestInfo);
}


text:
//--------------------------------------
// UTGB Common Project
//
// DoubleType.java
// Since: 2007/04/13
//
// $Date$
// $URL$
// $Author$
//--------------------------------------
package org.utgenome.gwt.utgb.client.db.datatype;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ChangeHandler;
import com.google.gwt.event.dom.client.KeyPressHandler;
import com.google.gwt.json.client.JSONNumber;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.json.client.JSONValue;
import com.google.gwt.user.client.ui.TextBox;

public class DoubleType extends DataTypeBase {
	public DoubleType(String name) {
		super(name);
	}

	public InputForm getInputForm() {
		return new DoubleTypeForm();
	}

	public class DoubleTypeForm extends InputForm {
		private TextBox form = new TextBox();

		public DoubleTypeForm() {
			initWidget(form);
		}

		public String getUserInput() {
			return form.getText();
		}

		public JSONValue getJSONValue() {
			try {
				double value = Double.parseDouble(form.getText());
				return new JSONNumber(value);
			}
			catch (NumberFormatException e) {
				return new JSONString("");
			}
		}

		public void setValue(String value) {
			try {
				double v = Double.parseDouble(value);
				form.setText(value);
			}
			catch (NumberFormatException e) {
				GWT.log(value + " is not a double type", e);
			}
		}

		public void addKeyPressHandler(KeyPressHandler listener) {
			form.addKeyPressHandler(listener);
		}

		public void addChangeHandler(ChangeHandler listener) {
			form.addChangeHandler(listener);
		}
	}

	public String getTypeName() {
		return "double";
	}

}


text:
title: Event Web
date: 2011-09-16 11:08:00 +07:00
nohibah: 095
inisiator: Agung Nugroho
lokasi: Sleman, DI Yogyakarta
dana: 1 Milyar Rupiah
topik: Meretas batas - kebhinekaan bermedia
lama: Oktober - November 2011 (1 bulan)
deskripsi: Eventweb merupakan portal yang berisi berita dan informasi event indoor
  (gallery, expo center, hall, mall, auditorium dan venue indoor sejenisnya) serta
  outdoor area. Juga meliputi informasi event spesifik (panggung musik, pameran, lomba,
  festival, bazar, launching produk, katalog belanja, program / event khusus, party,
  dan sejenisnya), direktori supporting event, info artis, band indie, info SPG, info
  selebriti, info film, program televisi/radio dan project organizer
masalah: Membuat sebuah direktori bisnis gratis yang berisi informasi acara di Indonesia,
  berita event, informasi selebriti, informasi panggung musik, informasi Pameran,
  info SPG (Sales Promotion Girl), info band, promosi, katalog belanja, penawaran
  atau launching produk baru yang ada di pasar, sehingga pembaca dapat dengan mudah
  mencari tahu acara maupun promosi yang mereka inginkan
solusi: 'Dengan mengundang masyarakat untuk mengirimkan informasi mengenai suatu promosi
  atau acara ke email: redaksi@event.web.id'
keberhasilan: Terwujudnya buku direktori bisnis yang berisi informasi acara dan promosi
  sehingga pembaca dapat dengan mudah mencari tahu acara maupun promosi yang mereka
  inginkan, baik online maupun offline (cetak)
organisasi: Riandika Indonesia
diuntungkan: Kalangan masyarakat berusia 12-45 tahun, pelajar, mahasiswa, PNS, swasta,
  dan eksekutif
layout: hibahcmb
---

![095](/static/img/hibahcmb/095.png){: .img-responsive }{: width="350" }

### {{ page.nohibah }} - {{ page.title }}

---


text:
require(['jquery', 'scrollreveal', 'jquery.easing.min','magnific-popup'], function ($, ScrollReveal) {

    // jQuery for page scrolling feature - requires jQuery Easing plugin
    $('a.page-scroll').bind('click', function(event) {
        var $anchor = $(this);
        $('html, body').stop().animate({
            scrollTop: ($($anchor.attr('href')).offset().top - 50)
        }, 1250, 'easeInOutExpo');
        event.preventDefault();
    });

    // Highlight the top nav as scrolling occurs
    $('body').scrollspy({
        target: '.navbar-fixed-top',
        offset: 51
    });

    // Closes the Responsive Menu on Menu Item Click
    $('.navbar-collapse ul li a').click(function() {
        $('.navbar-toggle:visible').click();
    });

    // Offset for Main Navigation
    $('#mainNav').affix({
        offset: {
            top: 100
        }
    })

    // Initialize and Configure Scroll Reveal Animation
    window.sr = ScrollReveal();
    sr.reveal('.sr-icons', {
        duration: 600,
        scale: 0.3,
        distance: '0px'
    }, 200);
    sr.reveal('.sr-button', {
        duration: 1000,
        delay: 200
    });
    sr.reveal('.sr-contact', {
        duration: 600,
        scale: 0.3,
        distance: '0px'
    }, 300);

    // Initialize and Configure Magnific Popup Lightbox Plugin
    $('.popup-gallery').magnificPopup({
        delegate: 'a',
        type: 'image',
        tLoading: 'Loading image #%curr%...',
        mainClass: 'mfp-img-mobile',
        gallery: {
            enabled: true,
            navigateByImgClick: true,
            preload: [0, 1] // Will preload 0 - before current, and 1 after the current image
        },
        image: {
            tError: 'The image #%curr% could not be loaded.'
        }
    });

    // Variable to hold request
    var request;

    // Bind to the submit event of our form
    $("#login-modal form").submit(function(event){

        // Abort any pending request
        if (request) {
            request.abort();
        }
        // setup some local variables
        var $form = $(this);

        // Let's select and cache all the fields
        var $inputs = $form.find("input, select, button, textarea");
        var hasError = false;

        $($inputs).each(function (index, input){
            var error = $(input).parent().find(".error-msg");
            $(error).fadeOut();
            var value = $(input).val();
            if (value == null || value == "") {
                $(error).fadeIn();

                hasError = true;
            }
        });

        if (hasError){
            return false;
        }

        // Serialize the data in the form
        var serializedData = $form.serialize();

        // Let's disable the inputs for the duration of the Ajax request.
        // Note: we disable elements AFTER the form data has been serialized.
        // Disabled form elements will not be serialized.
        $inputs.prop("disabled", true);

        // Fire off the request to /form.php
        request = $.ajax({
            url: myApp.inscripcionURL,
            type: "post",
            data: serializedData
        });

        // Callback handler that will be called on success
        request.done(function (response, textStatus, jqXHR){
            // Log a message to the console
            $inputs.prop("value", "");
            $('#confirmacion').modal();
        });

        // Callback handler that will be called on failure
        request.fail(function (jqXHR, textStatus, errorThrown){
            // Log the error to the console
            console.error(
                "The following error occurred: "+
                textStatus, errorThrown
            );
        });

        // Callback handler that will be called regardless
        // if the request failed or succeeded
        request.always(function () {
            // Reenable the inputs
            $inputs.prop("disabled", false);
        });

        // Prevent default posting of form
        event.preventDefault();
    });

 //console.log('ScrollReveal loaded?', sreveal);
 });


text:
package org.assertj.core.internal;

import static org.mockito.Mockito.spy;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;

/**
 *
 * Base class for {@link Throwables} tests.
 *

 * Is in org.assertj.core.internal package to be able to set {@link Throwables#failures} appropriately.
 *
 * @author Joel Costigliola
 */
public class ThrowablesBaseTest {

  protected Failures failures;
  protected Throwables throwables;
  protected static Throwable actual;

  @BeforeAll
  public static void setUpOnce() {
    actual = new NullPointerException("Throwable message");
  }

  @BeforeEach
  public void setUp() {
    failures = spy(new Failures());
    throwables = new Throwables();
    throwables.failures = failures;
    Objects.instance().failures = failures;
  }

  @AfterEach
  public void tearDown() {
    Objects.instance().failures = Failures.instance();
  }

}


text:
package scouter.server.core;

import scouter.net.RequestCmd
import scouter.server.Logger
import scouter.server.netio.AgentCall
import scouter.server.util.EnumerScala
import scouter.server.util.ThreadScala
import scouter.util.DateUtil
import scouter.util.ThreadUtil
/*
 * 날짜가 바뀌면 해야할 것들...
 */
object TextCacheReset {
    val engine = scouter.server.CounterManager.getInstance().getCounterEngine()
    var oldunit = 0L;
    ThreadScala.startDaemon("scouter.server.core.TextCacheReset") {
      ThreadUtil.sleep(30000)
      while (CoreRun.running) {
        try {
        	var dateUnit = DateUtil.getDateUnit();
	        if (dateUnit != oldunit) {
	            oldunit = dateUnit;
	            EnumerScala.foreach(AgentManager.getLiveObjHashList().iterator(), (oid: Int) => {
	                try {
	                    var agent = AgentManager.getAgent(oid);
	                    AgentCall.call(agent, RequestCmd.OBJECT_RESET_CACHE, null);
	                } catch {
	                    case t: Throwable => Logger.println("S114", "Thread \n" + t)
	                }
	            })
	        }
        } catch {
            case n: NullPointerException => Logger.println("S191", 10, "@startDaemon", n)
            case t: Throwable => Logger.println("S192", 10, "@startDaemon: " + t)
        }
        ThreadUtil.sleep(2000)
      }
    }
}


text:
package dev.jee6demo.cdievent;

import javax.enterprise.event.Event;
import javax.inject.Inject;

public class BeanConsumer {

	@Inject
	private HelloBean helloBean;

	@Inject Event<HelloEvent> events;

	public String use(){
		events.fire(new HelloEvent("from bean " + System.currentTimeMillis()));
		return "The bean contains the followin message: "+helloBean.getText();
	}
}


text:
using namespace gpos;
using namespace gpdxl;

//---------------------------------------------------------------------------
//	@function:
//		CDXLScalarSubquery::CDXLScalarSubquery
//
//	@doc:
//		Constructor
//
//---------------------------------------------------------------------------
CDXLScalarSubquery::CDXLScalarSubquery
	(
	CMemoryPool *mp,
	ULONG colid
	)
	:
	CDXLScalar(mp),
	m_colid(colid)
{
}

//---------------------------------------------------------------------------
//	@function:
//		CDXLScalarSubquery::~CDXLScalarSubquery
//
//	@doc:
//		Destructor
//
//---------------------------------------------------------------------------
CDXLScalarSubquery::~CDXLScalarSubquery()
{
}

//---------------------------------------------------------------------------
//	@function:
//		CDXLScalarSubquery::GetDXLOperator
//
//	@doc:
//		Operator type
//
//---------------------------------------------------------------------------
Edxlopid
CDXLScalarSubquery::GetDXLOperator() const
{
	return EdxlopScalarSubquery;
}

//---------------------------------------------------------------------------
//	@function:
//		CDXLScalarSubquery::GetOpNameStr
//
//	@doc:
//		Operator name
//
//---------------------------------------------------------------------------
const CWStringConst *
CDXLScalarSubquery::GetOpNameStr() const
{
	return CDXLTokens::GetDXLTokenStr(EdxltokenScalarSubquery);
}

//---------------------------------------------------------------------------
//	@function:
//		CDXLScalarSubquery::SerializeToDXL
//
//	@doc:
//		Serialize operator in DXL format
//
//---------------------------------------------------------------------------
void
CDXLScalarSubquery::SerializeToDXL
	(
	CXMLSerializer *xml_serializer,
	const CDXLNode *dxlnode
	)
	const
{
	const CWStringConst *element_name = GetOpNameStr();
	xml_serializer->OpenElement(CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), element_name);

	// serialize computed column id
	xml_serializer->AddAttribute(CDXLTokens::GetDXLTokenStr(EdxltokenColId), m_colid);

	dxlnode->SerializeChildrenToDXL(xml_serializer);
	xml_serializer->CloseElement(CDXLTokens::GetDXLTokenStr(EdxltokenNamespacePrefix), element_name);
}

#ifdef GPOS_DEBUG
//---------------------------------------------------------------------------
//	@function:
//		CDXLScalarSubquery::AssertValid
//
//	@doc:
//		Checks whether operator node is well-structured
//
//---------------------------------------------------------------------------
void
CDXLScalarSubquery::AssertValid
	(
	const CDXLNode *dxlnode,
	BOOL validate_children
	)
	const
{
	GPOS_ASSERT(1 == dxlnode->Arity());

	CDXLNode *child_dxlnode = (*dxlnode)[0];
	GPOS_ASSERT(EdxloptypeLogical == child_dxlnode->GetOperator()->GetDXLOperatorType());

	dxlnode->AssertValid(validate_children);
}
#endif // GPOS_DEBUG

// EOF


text:
#ifndef NETWORKMANAGER_P_H
#define NETWORKMANAGER_P_H

#include <map>
#include <vector>

#include "NetworkManager.h"

namespace Core
{
    class NetworkContext;
    class NetworkStatus;
    class IncomingMiddleware;
    class NetworkManageable;
    class ConnectionRequestMessage;

    /* implementations in NetworkManager.cpp */
    class NetworkManager::PrivateData
    {
    public:
        NetworkContext& _context;
        std::map<std::int32_t, NetworkStatus *> _status;

        std::vector<IncomingMiddleware *> _incomingMiddlewareChain;

    public:
        PrivateData(NetworkContext& context)
            : _context(context)
        {}

    public:
        void On(ConnectionRequestMessage *message, NetworkManageable *mgr);

    public:
      inline NetworkStatus *GetStatus(std::int32_t id) const
        {
            auto statusIter = _status.find(id);
            if (statusIter != _status.end())
            {
                return statusIter->second;
            }
            return nullptr;
        }

        void Close(std::int32_t id);
//        {
//            auto statusIter = _status.find(id);
//            if (statusIter != _status.end())
//            {
//                delete statusIter->second;
//                _status.erase(statusIter);
//            }
//
//            _context.Remove(id);
//        }
    };
}

#endif  /*  NETWORKMANAGER_P_H  */