text:
<TITLE>Review for Wirey Spindell (1999)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Wirey Spindell (1999)

reviewed by
Harvey S. Karten

WIREY SPINDELL

 Reviewed by Harvey Karten
 WinStar Cinema
 Director: Eric Schaeffer
 Writer: Eric Schaeffer
 Cast: Eric Mabius, Eric Schaeffer, Callie Thorne, Bill
Weeden, Devin Matthews-Johnson, Zane Adlum, Samantha
Buck

   Woody Allen transformed nerdiness into art while Eric
Schaeffer tries to follow that path with "Wirey Spindell," a
semiautobiographical look at his current screwed-up
personality with peeks at the 36-year-old man during various
earlier stages of his life.  The result is a strange movie,
mixing vulgar, Kevin-Smith type comedy with a disheartening
view of the title character--a blend that does not come off but
at times demonstrates Schaeffer's inclination to locate key
incidents in his life that made him the person he is.  The film
is based on his ten-year-old unpublished novel, though
Schaeffer in effect produces the book by providing so much
narration in the movie that you wonder if Schaeffer really
wants to cram the novel down your throat by way of the
screen.  Still somehow the narration does not come off as
intrusive as you'd expect if you were annoyed with the
perpetual philosophisizing on the sound track of Terrence
Malick's "The Thin Red Line."

   The picture gets off to an awful start, one that could
encourage people to walk out on what promises to be a
prelude to a sophomoric story.  Wirey (Eric Schaeffer) sits
fully clothed in the bathroom while his fiancee, Tabatha
(Callie Thorne) opens the door in time to hear Wirey
complain that she is invading his space during his private
time.  But Wirey does not simply explain this point to his girl
friend but illuminates it such a nebbishy way that Woody
Allen could be considered Laurence Olivier next to him.
Things can only get better after that.

   The basic conflict examined by the movie is Wirey
Spindell's inability to sit next to his fiance without having his
eyes wander around the room, scrutinizing just about anyone
in a skirt and presumably fantasying about what it's like to be
intimate with her.  This is not all that drives Tabatha crazy:
for the past nine months, Wirey has been unable to perform
in bed with her.  Exploring his background as though under
analysis by a Freudian therapist with an earthy sense of
humor, Wirey ultimately discovers the cause of his neuroses,
an origin that is all too farfetched and which, having been
discovered, can hardly cure him of his malady in time for his
upcoming, and probably short-lived, marriage.

   Spindell takes us to seminal incidents of his past, starting
with his first memory of being blown across the room while
licking an electrical outlet to his battle with addiction to drugs
and alcohol (his father was a hippie), through his experiences
with several women in junior high, high school and college.
Unpopular with his male peers, he has mixed success with
women culminating in a heartbreaking fling with the sexy
Samantha (Samantha Buck).

   Much of what Schaeffer shows us has been done in other
films with more resonance, poignancy and humor.  The
wacky therapy sessions (his stepmother's former lesbian
lover as the analyst); affiliations with some wacked-out coke-
heads and with leggy and pliant females; the sorrowful
contacts with a mother and estranged father who demand
obedience but haven't a clue how to express their love to the
young man.

   There isn't a single likable character in the film, from the
high-school teacher in Vermont who makes fun of the New
Yorker on his very first day to the uninspiring fiance who calls
her boyfriend honey and sweetie at least a decade before
such endearing terms should ever be used.  For the most
part Mr. Schaeffer, by mixing melodrama and comedy in
ways that they do not combine, neither shows how Wirey's
early life is so terrible that he winds up a drugged and
drunken misfit nor jogs the comedy to a level beyond the
mildly amusing.

Rated R.  Running Time: 95 minutes.  (C) 2000
Harvey Karten, film_critic@compuserve.com

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
FROM opensuse:42.1

RUN zypper --non-interactive install python
RUN zypper --non-interactive install python-pip

# "which" command required by python's run_distrib_test.sh
RUN zypper --non-interactive install which

# Without this, pip won't be able to connect to
# https://pypi.python.org/simple/
RUN zypper --non-interactive install ca-certificates-mozilla

RUN pip install virtualenv

redpajama_set_name: RedPajamaGithub


text: A social contact web


text:
const List = window.List;
$(() => {
  // Find tables with rows with data-link attribute, then make them clickable
  $('tr[data-link]').on('click', function (e) {
    const loc = $(this).attr('data-link');
    if (e.metaKey || (window.navigator.platform.toLowerCase().indexOf('win') !== -1 && e.ctrlKey)) {
      window.open(loc, '_blank');
    } else {
      window.location = loc;
    }
    return false;
  });

  // Course sorting
  // only sort if there are tables to sort
  let courseList;
  if ($('#courses table').length) {
    courseList = new List('courses', {
      page: 500,
      valueNames: [
        'title', 'revisions', 'characters', 'average-words', 'views', 'students', 'creation-date', 'untrained'
      ]
    });
  }

  // Campaign sorting
  // only sort if there are tables to sort
  let campaignList;
  if ($('#campaigns table').length) {
    campaignList = new List('campaigns', {
      page: 500,
      valueNames: [
        'title', 'num-courses', 'articles-created', 'characters', 'views', 'students', 'creation-date'
      ]
    });
  }

  return $('select.sorts').on('change', function () {
    const list = (() => {
      switch ($(this).attr('rel')) {
        case 'courses': return courseList;
        case 'campaigns': return campaignList;
        default: break;
      } })();
    if (list) {
      return list.sort($(this).val(), {
        order: $(this).children('option:selected').attr('rel')
      });
    }
  });
});


text:
//
// This file is part of nunn Library
// Copyright (c) Antonino Calderone (antonino.calderone@gmail.com)
// All rights reserved.
// Licensed under the MIT License.
// See COPYING file in the project root for full license information.
//

/* -------------------------------------------------------------------------- */

#ifndef __NU_SOFTMAX_POLICY_H__
#define __NU_SOFTMAX_POLICY_H__

/* -------------------------------------------------------------------------- */

#include "nu_random_gen.h"
#include <cmath>
#include <cassert>

/* -------------------------------------------------------------------------- */

namespace nu {

/* -------------------------------------------------------------------------- */

template<class Action, class Agent, class RndGen = RandomGenerator<>>
class SoftmaxPolicy {
public:
    void setTemperature(const double & temperature) noexcept {
        _temperature = temperature;
    }

    double getTemperature() const noexcept {
        return _temperature;
    }

    template<class QMap>
    Action selectAction(const Agent& agent, QMap & qMap) const {
        // Get agent to reward map
        auto actionReward = qMap[agent.getCurrentState()];
        auto validActions = agent.getValidActions();
        decltype(actionReward) quasiProbs;

        double sumReward = 0;

        for (const auto & item : validActions) {
            const auto reward = actionReward[item];
            const auto numerator = std::exp(reward / getTemperature());
            quasiProbs[item] = numerator;
            sumReward += numerator;
        }

        assert(sumReward != 0);

        // Select an action
        const auto cutoff = _rndGen();

        double sum = 0;
        auto it = quasiProbs.begin();

        for (; it != quasiProbs.end(); ++it) {

            const auto prob = it->second / sumReward;
            sum += prob;

            if (sum > cutoff) {
                return it->first;
            }
        }

        assert(0);

        return it->first;
    }

    template<class QMap>
    Action getLearnedAction(const Agent& agent, QMap & qMap) const {
        auto validActions = agent.getValidActions();

        assert(!validActions.empty());

        Action action = validActions[0];

        double reward = 0;

        const auto & agentState = agent.getCurrentState();

        reward = qMap[agentState][action];

        for (const auto & anAction : validActions) {
            const auto & val = qMap[agentState][anAction];
            if (val > reward) {
                reward = val;
                action = anAction;
            }
        }

        if (reward == .0) {
            action = selectAction(agent, qMap);
        }

        return action;
    }

private:
    double _temperature = 1.0;
    mutable RandomGenerator<> _rndGen;
};

/* -------------------------------------------------------------------------- */

}

/* -------------------------------------------------------------------------- */

#endif // __NU_SOFTMAX_POLICY_H__


text:
import ButterflyButton from './ButterflyButton';

export default ButterflyButton;
export * from './constants';


text:
  <md-input-container>
    <input mdInput placeholder="Select source"
           [formControl]="myControl"
           [mdAutocomplete]="auto"
    >
  </md-input-container>

  <md-autocomplete #auto="mdAutocomplete" [displayWith]="displayFn">
    <md-option *ngFor="let option of filteredOptions | async"
               [value]="option"
               (onSelectionChange)="onSelected($event, option)"
    >
      {{ option.name }}
    </md-option>
  </md-autocomplete>


text:
---
layout: page
title: "Race Forecast - Regions"
permalink: "/population/data/race-forecast-regions/"
custom_js:
- /assets/js/FileSaver.min.js
- /assets/js/common/dola_custom_functions.js
description: "Search for information on population by region, year, age group and race."
years: "2010-2050"
tag: ""

---
{% if page.custom_js %}
  {% for js_file in page.custom_js %}

  {% endfor %}
{% endif %}

Race by Age Forecast - Region

Need County Data?

Regions WebMap

Select 1 or more regions:

<select id="countiesSelected" name="countiesSelected" multiple="multiple" size="5">
{% include _optionValuesRegion.html %}
</select>

Select 1 or more years:

<select id="yearsSelected" name="yearsSelected" multiple="multiple" size="5">

</select>

Select 1 or more age groups:

<select id="ageGroups" name="ageGroups" multiple="multiple" size="3">
  <option value="0">Age 0-17</option>
	<option value="18">Age 18-64</option>
	<option value="65">Age 65+</option>
</select>

Select 1 or more race categories:

<select id="raceGroups" name="raceGroups" multiple="multiple" size="5">
  <option value="1">Hispanic</option>
	<option value="2">White non Hispanic</option>
	<option value="3">Asian non Hispanic</option>
	<option value="4">American Indian non Hispanic</option>
	<option value="5">Black non Hispanic</option>

</select>

Select 0 or more variables to summarize by:

<select id="groupBy" name="groupBy" multiple="multiple" size="4">
  <option value="a">Year</option>
	<option value="b">Region</option>
	<option value="c">Age Group</option>
	<option value="d">Race</option>
</select>

<input type="submit" id="callapi" value="View Results" class="form-submit" />

<input type="submit" id="dlcsv" value="Download CSV" style="display:none;" />


text:
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.io.*;

import javax.imageio.*;
import javax.swing.*;

public class WC1CockpitViewer extends JComponent implements Viewer
{
    private BufferedImage[] images;
    private JFrame frame;
    private int image = 0;
    private int rot = 0;
    private int[] order = {0, 1, 3, 2};

    public WC1CockpitViewer(String filename) throws IOException
    {
        this(new File(filename));
    }

    public WC1CockpitViewer(File file) throws IOException
    {
        frame = new JFrame("WC1 VR Cockpit Viewer");

        loadImages(file);

        frame.getContentPane().add(this);
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);

        frame.addKeyListener(new KeyAdapter()
        {
            public void keyPressed(KeyEvent evt)
            {
                if(evt.getKeyCode() == evt.VK_ESCAPE) System.exit(0);
                if(evt.getKeyCode() == evt.VK_LEFT) turnClockwise();
                if(evt.getKeyCode() == evt.VK_RIGHT) turnCounterClockwise();

                repaint();
            }
        });
    }

    private void loadImages(File file) throws IOException
    {
        WC1Reader reader = new WC1Reader(file);

        images = new BufferedImage[4];

        for(int i=0; i<4; i++)
        {
            images[i] = reader.nextImage();
        }
    }

    public void paint(Graphics g)
    {
        Graphics2D g2d = (Graphics2D)g;
        BufferedImage bufferedImage = images[image];

        g2d.drawImage(bufferedImage, 320 - bufferedImage.getWidth(), 200 - bufferedImage.getHeight(), bufferedImage.getWidth()*2, bufferedImage.getHeight()*2, null);
    }

    public Dimension getPreferredSize()
    {
        return new Dimension(640, 400);
    }

    private void turnCounterClockwise()
    {
        rot = (rot + 1) % order.length;

        image = order[rot];
    }

    private void turnClockwise()
    {
        rot--;

        if(rot < 0) rot += order.length;

        image = order[rot];
    }

    public JFrame getFrame()
    {
        return frame;
    }

    public void override(int count)
    {
        //Currently does nothing
    }

    public static void main(String[] args) throws Exception
    {
        if(args.length < 1)
        {
            System.out.println("Usage: java WC1CockpitViewer <pcship file>");
            return;
        }

        new WC1CockpitViewer(args[0]).getFrame().setVisible(true);
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <!--Custom configurable attributes for HorizontalBar-->
    <declare-styleable name="HorizontalBar">
        <attr name="textLo" format="string"/>
        <attr name="textHi" format="string"/>
        <attr name="textBar" format="string"/>
        <attr name="textSizePx" format="integer"/>
        <attr name="textColor" format="color"/>
        <attr name="barTextColorIn" format="color"/>
        <attr name="barTextColorOut" format="color"/>

        <attr name="barHeightPx" format="integer"/>
        <attr name="barColor" format="color"/>
        <attr name="barGradientColorStart" format="color"/>
        <attr name="barGradientColorEnd" format="color"/>

        <attr name="progressPercentage" format="integer"/>
        <attr name="backgroundColor" format="color"/>
    </declare-styleable>
</resources>


text:
.. :changelog:

API changes
-----------

0.8.2
~~~~~

- Event emitters are no longer started on schedule if ``Observer`` is not
  already running.

0.8.0
~~~~~

- ``DirectorySnapshot``: methods returning internal stat info replaced by
  ``mtime``, ``inode`` and ``path`` methods.
- ``DirectorySnapshot``: ``walker_callback`` parameter deprecated.


text:
local Channel = require('../Channel')
local Message = require('../Message')
local OrderedCache = require('../../../utils/OrderedCache')

local fs = require('coro-fs')
local http = require('coro-http')
local pathjoin = require('pathjoin')

local clamp = math.clamp
local format = string.format
local readFile = fs.readFile
local request = http.request
local splitPath = pathjoin.splitPath
local wrap, yield = coroutine.wrap, coroutine.yield
local insert, remove, concat = table.insert, table.remove, table.concat

local TextChannel, property, method, cache = class('TextChannel', Channel)
TextChannel.__description = "Abstract base class for guild and private text channels."

function TextChannel:__init(data, parent)
	Channel.__init(self, data, parent)
	local client = self._parent._parent or self._parent
	self._messages = OrderedCache({}, Message, 'id', client._options.messageLimit, self)
	-- abstract class, don't call update
end

function TextChannel:_update(data)
	Channel._update(self, data)
end

local function _messageIterator(self, success, data, predicate)
	if not success then return function() end end
	predicate = type(predicate) == 'function' and predicate
	return wrap(function()
		for _, v in ipairs(data) do
			local m = Message(v, self)
			if not predicate or predicate(m) then
				yield(m)
			end
		end
	end)
end

local function loadMessages(self, limit)
	local query = limit and {limit = clamp(limit, 1, 100)}
	local client = self._parent._parent or self._parent
	local success, data = client._api:getChannelMessages(self._id, query)
	if success then
		for i = #data, 1, -1 do
			self._messages:new(data[i])
		end
	end
	return success
end

local function _getMessageHistory(self, query, predicate)
	local client = self._parent._parent or self._parent
	local success, data = client._api:getChannelMessages(self._id, query)
	return _messageIterator(self, success, data, predicate)
end

local function getMessageHistory(self, limit, predicate)
	local query = limit and {limit = clamp(limit, 1, 100)}
	return _getMessageHistory(self, query, predicate)
end

local function getMessageHistoryBefore(self, message, limit, predicate)
	local t = type(message)
	local id = t == 'table' and message._id or t == 'string' and message or nil
	local query = {before = id, limit = limit and clamp(limit, 1, 100) or nil}
	return _getMessageHistory(self, query, predicate)
end

local function getMessageHistoryAfter(self, message, limit, predicate)
	local t = type(message)
	local id = t == 'table' and message._id or t == 'string' and message or nil
	local query = {after = id, limit = limit and clamp(limit, 1, 100) or nil}
	return _getMessageHistory(self, query, predicate)
end

local function getMessageHistoryAround(self, message, limit, predicate)
	local t = type(message)
	local id = t == 'table' and message._id or t == 'string' and message or nil
	local query = {around = id, limit = limit and clamp(limit, 2, 100) or nil}
	return _getMessageHistory(self, query, predicate)
end

local function getPinnedMessages(self)
	local client = self._parent._parent or self._parent
	return _messageIterator(self, client._api:getPinnedMessages(self._id))
end

local function getFirstMessage(self)
	return _getMessageHistory(self, {after = '0', limit = 1})() or nil
end

local function getLastMessage(self)
	return _getMessageHistory(self, {limit = 1})() or nil
end

-- begin send message --

-- overhaul planned for 2.0

local function parseMentions(content, mentions)
	if type(mentions) == 'table' then
		local strings = {}
		if mentions.getMentionString then
			insert(strings, mentions:getMentionString())
		elseif mentions.iter then
			for obj in mentions:iter() do
				if obj.getMentionString then
					insert(strings, obj:getMentionString())
				end
			end
		else
			for _, obj in pairs(mentions) do
				if obj.getMentionString then
					insert(strings, obj:getMentionString())
				end
			end
		end
		insert(strings, content)
		content = concat(strings, ' ')
	end
	return content
end

local function parseFile(filename, file, client)
	if type(file) == 'string' then
		local data, err
		if file:find('https?://') == 1 then
			err, data = request('GET', file)
			err = err.code > 299 and format('%s / %s / %s', err.code, err.reason, file)
		else
			data, err = readFile(file)
		end
		if err then
			client:warning(err)
		else
			return {type(filename) == 'string' and filename or remove(splitPath(file)), data}
		end
	elseif type(file) == 'table' and type(file[1]) == 'string' and type(file[2]) == 'string' then
		return file
	end
end

local function parseFiles(filename, file, files, client)
	local f1 = parseFile(filename, file, client)
	local ret = f1 and {f1} or nil
	if type(files) == 'table' then
		ret = ret or {}
		for _, v in ipairs(files) do
			local f = parseFile(nil, v, client)
			if f then insert(ret, f) end
		end
	end
	return ret
end

local function sendMessage(self, content, ...) -- mentions, tts
	local client = self._parent._parent or self._parent
	local payload, files
	if select('#', ...) > 0 then
		client:warning('Multiple argument usage for TextChannel:sendMessage is deprecated. Use a table instead.')
		payload = {content = parseMentions(content, select(1, ...)), tts = select(2, ...)}
	else
		local arg = content
		local t = type(arg)
		if t == 'string' then
			payload = {content = arg}
		elseif t == 'table' then
			payload = {
				content = parseMentions(arg.content, arg.mentions),
				tts = arg.tts,
				nonce = arg.nonce,
				embed = arg.embed,
			}
			files = parseFiles(arg.filename, arg.file, arg.files, client)
		end
	end
	local success, data = client._api:createMessage(self._id, payload, files)
	return success and self._messages:new(data) or nil
end

-- end send message --

local function broadcastTyping(self)
	local client = self._parent._parent or self._parent
	return (client._api:triggerTypingIndicator(self._id))
end

-- messages --

local function getMessageCount(self)
	return self._messages._count
end

local function getMessages(self, key, value)
	return self._messages:getAll(key, value)
end

local function getMessage(self, key, value)
	local message = self._messages:get(key, value)
	if message or value then return message end
	local client = self._parent._parent or self._parent
	local success, data = client._api:getChannelMessage(self.id, key)
	return success and Message(data, self) or nil
end

local function findMessage(self, predicate)
	return self._messages:find(predicate)
end

local function findMessages(self, predicate)
	return self._messages:findAll(predicate)
end

property('pinnedMessages', getPinnedMessages, nil, 'function', "Iterator for all of the pinned messages in the channel")
property('firstMessage', getFirstMessage, nil, 'Message', "The first message found in the channel via HTTP (not cached).")
property('lastMessage', getLastMessage, nil, 'Message', "The last message found in the channel via HTTP (not cached).")

method('broadcastTyping', broadcastTyping, nil, "Causes the 'User is typing...' indicator to show in the channel.", 'HTTP')
method('loadMessages', loadMessages, '[limit]', "Downloads 1 to 100 (default: 50) of the channel's most recent messages into the channel cache.", 'HTTP')
method('sendMessage', sendMessage, 'content', "Sends a message to the channel. Content is a string or table.", 'HTTP')

method('getMessageHistory', getMessageHistory, '[limit[, predicate]', 'Returns an iterator for up to 1 to 100 (default: 50) of the most recent messages in the channel.', 'HTTP')
method('getMessageHistoryBefore', getMessageHistoryBefore, 'message[, limit[, predicate]]', 'Get message history before a specific message or ID.', 'HTTP')
method('getMessageHistoryAfter', getMessageHistoryAfter, 'message[, limit[, predicate]]', 'Get message history after a specific message or ID.', 'HTTP')
method('getMessageHistoryAround', getMessageHistoryAround, 'message[, limit[, predicate]]', 'Get message history around a specific message or ID.', 'HTTP')

cache('Message', getMessageCount, getMessage, getMessages, findMessage, findMessages)

return TextChannel


text:
export C_INCLUDE_PATH=${PREFIX}/include
export LD_LIBRARY_PATH=${PREFIX}/lib
export LDFLAGS="-L${PREFIX}/lib"

env MAX_READLENGTH=500 ./configure --prefix=${PREFIX} --enable-avx2=no
make -j 2
make install prefix=${PREFIX}


text:
<!DOCTYPE html>

  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
  <title>My Website</title>

  <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">


text:
/*
 *  Neutering.
 */

/*---
custom: true
skip: true
---*/

/* Currently there is no neutering support, so just sketching what could be
 * covered by tests.
 */

function neuter(b) {
    // XXX: need an API to do this
}

function neuteredTest() {
    var b;
    var v;

    // .byteLength is required to read as zero.

    b = new ArrayBuffer(8); neuter(b);
    print(b.byteLength);

    // Typed array byteOffset and byteLength must read as zero if the
    // referenced ArrayBuffer (note: not the same as duk_hbufferobject
    // internal 'buf' reference!) has been neutered.

    b = new ArrayBuffer(8); v = new Uint8Array(b, 3); neuter(b);
    print(v.byteOffset);
    print(v.byteLength);

    b = new ArrayBuffer(8); v = new DataView(b, 3); neuter(b);
    print(v.byteOffset);
    print(v.byteLength);

    // XXX: behavior for DataView and TypedArray constructors?

    // XXX: behavior when used as method arguments (e.g. .set(), .subarray())?
}

neuteredTest();


text:
package hr.schteph.common.rest.autoproxy;

import hr.schteph.common.rest.autoproxy.model.CookieValue;
import hr.schteph.common.rest.autoproxy.model.PathVariable;
import hr.schteph.common.rest.autoproxy.model.RequestHeader;
import hr.schteph.common.rest.autoproxy.model.RequestParam;

import java.util.Map;

import lombok.Setter;

import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.ValueConstants;

/**
 * @author scvitanovic
 */
@Setter
public class RequestArgumentsMapperDefault implements RequestArgumentsMapper {

	private RequestArgumentsValidator validator = new RequestArgumentsValidatorDefault();

	@Override
	public boolean fillRequestHeader(Integer key, Object object, HttpHeaders headerValues,
			Map<Integer, RequestHeader> requestHeaders)
	{
		if (!requestHeaders.containsKey(key)) {
			return false;
		}
		RequestHeader rh = requestHeaders.get(key);
		String value = convertArgumentToString(object, rh.isRequired(), rh.getDefaultValue(), "Request header", rh.getValue());
		headerValues.set(rh.getValue(), value);
		return true;
	}

	@Override
	public boolean fillRequestParam(Integer key, Object value, Map<String, Object> requestParamValues,
			Map<Integer, RequestParam> requestParams)
	{
		if (!requestParams.containsKey(key)) {
			return false;
		}
		RequestParam rp = requestParams.get(key);
		validator.validateArgument(value, rp.isRequired(), "Request param", rp.getValue());
		Object realValue = value;
		if (realValue == null && !ValueConstants.DEFAULT_NONE.equals(rp.getDefaultValue())) {
			realValue = rp.getDefaultValue();
		}
		requestParamValues.put(rp.getValue(), realValue);
		return true;
	}

	@Override
	public boolean fillPathVariable(Integer key, Object value, Map<String, Object> pathVariableValues,
			Map<Integer, PathVariable> pathVariables)
	{
		if (!pathVariables.containsKey(key)) {
			return false;
		}
		PathVariable pv = pathVariables.get(key);
		validator.validateArgument(value, true, "Path variable", pv.getValue());
		pathVariableValues.put(pv.getValue(), value);
		return true;
	}

	@Override
	public boolean fillCookies(Integer key, Object value, Map<String, String> cookies,
			Map<Integer, CookieValue> cookieValues)
	{
		if (!cookieValues.containsKey(key)) {
			return false;
		}
		CookieValue cv = cookieValues.get(key);
		String realValue = convertArgumentToString(value, cv.isRequired(), cv.getDefaultValue(), "Cookie value", cv.getValue());
		cookies.put(cv.getValue(), realValue);
		return true;
	}

	@Override
	public Object extractRequestBody(Object object, boolean requestBodyRequired) {
		Object retVal = object;
		validator.validateRequestBody(retVal, requestBodyRequired);
		return retVal;
	}

	public String convertArgumentToString(Object arg, boolean required, String defaultValue, String type, String name)
	{
		validator.validateArgument(arg, required, type, name);
		String value;
		if (arg == null) {
			if (!ValueConstants.DEFAULT_NONE.equals(defaultValue)) {
				value = defaultValue;
			} else {
				value = null;
			}
		} else {
			value = arg.toString();
		}
		return value;
	}
}


text:
// DfuFileMgrDlg.h : header file
//

#if !defined(AFX_DfuFileMgrDLG_H__E5AD213B_6DC4_4073_A0F7_0EEC25640AEC__INCLUDED_)
#define AFX_DfuFileMgrDLG_H__E5AD213B_6DC4_4073_A0F7_0EEC25640AEC__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/////////////////////////////////////////////////////////////////////////////
// CDfuFileMgrDlg dialog

class CDfuFileMgrDlg : public CDialog
{
private:
	BOOL GetImageFromS19(CFile *pFile, PBYTE pBuffer, DWORD Size, DWORD S19Size);

// Construction
public:
	CDfuFileMgrDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CDfuFileMgrDlg)
	enum { IDD = IDD_DfuFileMgrGenerate_DIALOG };
	CHexEdit	m_VersionCtrl;
	CHexEdit	m_PIDCtrl;
	CHexEdit	m_VIDCtrl;
	CListBox	m_ListFiles;
	BYTE	m_AltSet;
	CString	m_Bcd;
	CString	m_Vid;
	CString	m_Pid;
	CString	m_TargetName;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDfuFileMgrDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;
	CDWordArray m_Images;
	// Generated message map functions
	//{{AFX_MSG(CDfuFileMgrDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnButtonadd();
	afx_msg void OnButtongenerate();
	afx_msg void OnClose();
	afx_msg void OnButtondelete();
	afx_msg void OnButtonaddbin();
	afx_msg void OnSelchangeListfiles();
	afx_msg void OnButtonadds19hex();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_DfuFileMgrDLG_H__E5AD213B_6DC4_4073_A0F7_0EEC25640AEC__INCLUDED_)


text:
<?php

namespace Mastercard\services\Match\domain;

class DriversLicenseType {
    private $number;
    private $countySubdivision;
    private $country;

    public function getNumber(){
        return $this->number;
    }

    public function setNumber($number){
        $this->number = $number;
    }

    public function getCountrySubdivision(){
        return $this->countySubdivision;
    }

    public function setCountrySubdivision($countrySubdivision){
        $this->countySubdivision = $countrySubdivision;
    }

    public function getCountry(){
        return $this->country;
    }

    public function setCountry($country){
        $this->country = $country;
    }
}


text:
<?php namespace Anouar\Paypalpayment;

use Illuminate\Support\Facades\URL;
use PayPal\Api\Address;
use PayPal\Api\Amount;
use PayPal\Api\Details;
use PayPal\Api\Authorization;
use PayPal\Api\Capture;
use PayPal\Api\CreditCard;
use PayPal\Api\CreditCardToken;
use PayPal\Api\FundingInstrument;
use PayPal\Api\Item;
use PayPal\Api\ItemList;
use PayPal\Api\Links;
use PayPal\Api\Payee;
use PayPal\Api\Payer;
use PayPal\Api\PayerInfo;
use PayPal\Api\Payment;
use PayPal\Api\PaymentExecution;
use PayPal\Api\PaymentHistory;
use PayPal\Api\RedirectUrls;
use PayPal\Api\Refund;
use PayPal\Api\RelatedResources;
use PayPal\Api\Sale;
use PayPal\Api\ShippingAddress;
use PayPal\Api\Transaction;
use PayPal\Api\Transactions;
use PayPal\Core\PPConfigManager;
use PayPal\Rest\ApiContext;
use PayPal\Auth\OAuthTokenCredential;

class PaypalPayment{

    /**
     * @return Paypal\Api\Address
     */
    public function address()
    {
        return new Address;
    }

    /**
     * @return Paypal\Api\Amount
     */
    public function amount()
    {
        return new Amount;
    }

    /**
     * @return Paypal\Api\Details
     */
    public  function details()
    {
        return new Details;
    }

    /**
     * @return Paypal\Api\Authorization
     */
    public  function authorization()
    {
        return new Authorization;
    }

    /**
     * @return Paypal\Api\Capture
     */
    public  function capture()
    {
        return new Capture;
    }

    /**
     * @return Paypal\Api\CreditCard
     */
    public  function creditCard()
    {
        return new CreditCard;
    }

    /**
     * @return Paypal\Api\CreditCardToken
     */
    public  function creditCardToken()
    {
        return new CreditCardToken;
    }

    /**
     * @return Paypal\Api\FundingInstrument
     */
    public  function fundingInstrument()
    {
        return new FundingInstrument;
    }

    /**
     * @return Paypal\Api\Item
     */
    public  function item()
    {
        return new Item;
    }

    /**
     * @return Paypal\Api\ItemList
     */
    public  function itemList()
    {
        return new ItemList;
    }

    /**
     * @return Paypal\Api\Links
     */
    public  function links()
    {
        return new Links;
    }

    /**
     * @return Paypal\Api\Payee
     */
    public  function payee()
    {
        return new Payee;
    }

    /**
     * @return Paypal\Api\Payer
     */
    public  function payer()
    {
        return new Payer;
    }

    /**
     * @return Paypal\Api\PayerInfo
     */
    public  function payerInfo()
    {
        return new PayerInfo;
    }

    /**
     * @return Paypal\Api\Payment
     */
    public  function payment()
    {
        return new Payment;
    }

    /**
     * @return Paypal\Api\PaymentExecution
     */
    public  function paymentExecution()
    {
        return new PaymentExecution;
    }

    /**
     * @return Paypal\Api\PaymentHistory
     */
    public  function paymentHistory()
    {
        return new PaymentHistory;
    }

    /**
     * @return Paypal\Api\RedirectUrls
     */
    public  function redirectUrls()
    {
        return new RedirectUrls;
    }

    /**
     * @return Paypal\Api\Refund
     */
    public  function refund()
    {
        return new Refund;
    }

    /**
     * @return Paypal\Api\RelatedResources
     */
    public  function relatedResources()
    {
        return new RelatedResources;
    }

    /**
     * @return Paypal\Api\Sale
     */
    public  function sale()
    {
        return new Sale;
    }

    /**
     * @return Paypal\Api\ShippingAddress
     */
    public  function shippingAddress()
    {
        return new ShippingAddress;
    }

    /**
     * @return Paypal\Api\Transactions
     */
    public  function transactions()
    {
        return new Transactions;
    }

    /**
     * @return Paypal\Api\Transaction
     */
    public function transaction()
    {
        return new Transaction;
    }

    /**
     * @param null $clientId
     * @param null $clientSecret
     * @param null $requestId
     * @return Paypal\Rest\ApiContext
     */
    public function apiContext($clientId = null, $clientSecret = null, $requestId = null)
    {
        $credentials = self::OAuthTokenCredential($clientId, $clientSecret);

        return new ApiContext($credentials, $requestId);
    }

    /**
     * @param null $ClientId
     * @param null $ClientSecret
     * @return PayPal/Auth/OAuthTokenCredential
     */
    public  static function OAuthTokenCredential($ClientId = null, $ClientSecret=null)
    {
        //define("PP_CONFIG_PATH", __DIR__);

        if(isset($ClientId) && isset($ClientSecret)) {
          return new OAuthTokenCredential($ClientId, $ClientSecret);
        }

        $configManager  = PPConfigManager::getInstance();
        // $cred is used by samples that include this bootstrap file
        // This piece of code simply demonstrates how you can
        // dynamically pass in a client id/secret instead of using
        // the config file. If you do not need a way to pass
        // in credentials dynamically, you can skip the
        // <Resource>::setCredential($cred) calls that
        // you see in the samples.

        $cred = new OAuthTokenCredential(
            $configManager->get('acct1.ClientId'),
            $configManager->get('acct1.ClientSecret'));

        return $cred;
    }

    /**
     * Get the base URL
     * @return mixed
     */
    public function getBaseUrl()
    {
        return URL::to('/');
    }

    /**
     * grape payment details using the paymentId
     * @param $paymentId
     * @param null $apiContext
     * @return Paypal\Api\Payment
     */
    public static function getById($paymentId, $apiContext = null)
    {
        if (isset($apiContext)) {
            return Payment::get($paymentId, $apiContext);
        }
        return Payment::get($paymentId);
    }

    /**
     * grape all payment details
     * @param $param
     * @param null $apiContext
     * @return Paypal\Api\Payment
     */
    public static function getAll($param, $apiContext = null)
    {
        if (isset($apiContext)) {
            return Payment::all($param, $apiContext);
        }
        return Payment::all($param);
    }

}


text:
namespace TelerikAcademy.Models
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;
    using System.Diagnostics.CodeAnalysis;

    public class Employee
    {
        [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public Employee()
        {
            this.Departments = new HashSet<Department>();
            this.Employees1 = new HashSet<Employee>();
            this.Projects = new HashSet<Project>();
        }

        public int EmployeeID { get; set; }

        [Required]
        [StringLength(50)]
        public string FirstName { get; set; }

        [Required]
        [StringLength(50)]
        public string LastName { get; set; }

        [StringLength(50)]
        public string MiddleName { get; set; }

        [Required]
        [StringLength(50)]
        public string JobTitle { get; set; }

        public int DepartmentID { get; set; }

        public int? ManagerID { get; set; }

        [Column(TypeName = "smalldatetime")]
        public DateTime HireDate { get; set; }

        [Column(TypeName = "money")]
        public decimal Salary { get; set; }

        public int? AddressID { get; set; }

        public virtual Address Address { get; set; }

        [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<Department> Departments { get; set; }

        public virtual Department Department { get; set; }

        [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<Employee> Employees1 { get; set; }

        public virtual Employee Employee1 { get; set; }

        [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<Project> Projects { get; set; }
    }
}


text:
<?xml version='1.0' encoding='UTF-8' ?>

<!DOCTYPE service-builder PUBLIC
        "-//Liferay//DTD Service Builder 6.2.0//EN"
        "http://www.liferay.com/dtd/liferay-service-builder_6_2_0.dtd">

<service-builder package-path='com.marcelmika.lims.persistence.generated'>

    <!-- This will be a prefix of all entity tables -->
    <namespace>Lims</namespace>

    <!-- Panel -->
    <entity name='Panel' local-service='true' remote-service='false'>
        <column name='pid' type='long' primary='true'/>
        <column name='userId' type='long'/>
        <column name='activePanelId' type='String'/>
        <finder name='UserId' return-type='Panel'>
            <finder-column name='userId'/>
        </finder>
    </entity>

    <!-- Settings -->
    <entity name='Settings' local-service='true' remote-service='false'>
        <column name='sid' type='long' primary='true'/>
        <column name='userId' type='long'/>
        <column name='presence' type='String'/>
        <column name="presenceUpdatedAt" type="long" />
        <column name='mute' type='boolean'/>
        <column name='chatEnabled' type='boolean'/>
        <column name='adminAreaOpened' type='boolean'/>
        <finder name='UserId' return-type='Settings'>
            <finder-column name='userId'/>
        </finder>
        <finder name='Presence' return-type='Collection'>
            <finder-column name='presence'/>
        </finder>
    </entity>

    <!-- Conversation -->
    <entity name='Conversation' local-service='true' remote-service='false'>
        <column name='cid' type='long' primary='true'/>
        <column name='conversationId' type='String'/>
        <column name='conversationType' type='String'/>
        <column name='updatedAt' type='Date'/>
        <finder name='ConversationId' return-type='Conversation'>
            <finder-column name='conversationId'/>
        </finder>
    </entity>

    <!-- Message -->
    <entity name='Message' local-service='true' remote-service='false'>
        <column name='mid' type='long' primary='true'/>
        <column name='cid' type='long'/>
        <column name='creatorId' type='long'/>
        <column name='createdAt' type='Date'/>
        <column name='body' type='String'/>
        <order>
            <order-column name="createdAt" order-by="asc"/>
        </order>
        <finder name='CreatorId' return-type='Buddy'>
            <finder-column name='creatorId'/>
        </finder>
        <finder name='Cid' return-type='Collection'>
            <finder-column name='cid'/>
        </finder>
    </entity>

    <!-- Participant -->
    <entity name='Participant' local-service='true' remote-service='false'>
        <column name='pid' type='long' primary='true'/>
        <column name='cid' type='long' primary='false'/>
        <column name='participantId' type='long'/>
        <column name='unreadMessagesCount' type='int'/>
        <column name='isOpened' type='boolean'/>
        <column name='openedAt' type='long'/>
        <order>
            <order-column name="openedAt" order-by="asc"/>
        </order>
        <finder name='Cid' return-type='Collection'>
            <finder-column name='cid'/>
        </finder>
        <finder name='CidParticipantId' return-type='Participant'>
            <finder-column name='cid'/>
            <finder-column name='participantId'/>
        </finder>
        <finder name='ParticipantIdIsOpened' return-type='Collection'>
            <finder-column name='participantId'/>
            <finder-column name='isOpened'/>
        </finder>
    </entity>

</service-builder>


text:
type: post
title:  Distributed Mirror
categories: SBP
parent: production.html
weight: 50
---

|Author|XAP Version|Last Updated | Reference | Download |
|------|-----------|-------------|-----------|:----------:|
| Shay Hassidim| 12.0 | March 2017| [Asynchronous Persistence]({{%latestjavaurl%}}/asynchronous-persistency-with-the-mirror.html)| {{%download "/download_files/sbp/distributed-mirror.zip"%}}|

# Overview

By default a single mirror instance used to perform write-behind activity, persisting data from the space to the enterprise backend database. For most systems this will provide sufficient throughput to address the activity a single clustered space generating. There are cases with large space clusters or with systems that produce large volume of activity where the amount of activity performed by a clustered space would require a distributed (multi-instance) mirror setup. The solution described here allows each partition (primary and backup instances) to perform write-behind activity via a dedicated mirror. This forms an architecture where each partition using a separate mirror instance that may run on a different machine, utilizing its full CPU and network bandwidth. This approach reducing the potential for redolog accumulation generating a lag between the space data state and the persistency backend state as a result of a single mirror.

# Architecture

With the example below we will run a partitioned space (2 partitions) and 2 mirror instances, both writing into a single database.

{{%align center%}}
![image](/attachment_files/sbp/mirror/distributed-mirror-1.png)
{{%/align%}}

#  The Example
Download {{%download "/download_files/sbp/distributed-mirror.zip"%}} the example and extract its content into an empty folder. You will find 3 zip files:

- multi-mirror.zip – A Mirror PU configured to support multiple mirror instances
- space.zip - A Space PU configured to support multiple mirror instances
- feeder.zip – A PU writing objects into the space

##  Start the Database and its UI

Run SQLDB:
```bash
java -cp hsqldb-2.3.2.jar org.hsqldb.Server -database.0 file:testDB -dbname.0 testDB
```

Run SQLDB Manager:
```bash
java -cp hsqldb-2.3.2.jar org.hsqldb.util.DatabaseManager
```

##  Connect to the database:

{{%align center%}}
![image](/attachment_files/sbp/mirror/distributed-mirror-2.jpg)
{{%/align%}}

You can find the hsqldb-2.3.2.jar within the multi-mirror.zip lib folder.

##  Start Agent
Start an agent with 7 GSCs. This will allow the GSM to deploy each instance into a dedicated GSC. It will allow you to track the activity easily by monitoring the GSC log file each PU instance using.
```bash
gs-agent gsa.gsc 7
```

##  Deploying Multiple Mirror Instances
To scale the mirror activity deploy multiple mirror instances , one per partition. You should deploy each separately. Each can use the same PU library with different mirror-service_id value – see below example:

```bash
gs deploy -properties embed://mirror-service_id=1 -override-name mirror1 multi-mirror.zip

gs deploy -properties embed://mirror-service_id=2 -override-name mirror2 multi-mirror.zip
```

You can create a script that will loop and deploy multiple mirror instances each with its own unique ID.

##  Deploying the Space
To deploy the space:

```bash
gs deploy -cluster schema=partitioned total_members=2,1 -override-name space space.zip
```

##  Deploying the Feeder
Deploy the feeder via the following:

```bash
gs deploy feeder.zip
```

This will write objects into the space. The mirrors will persist these into the database.

##  View the Space and the Mirrors Status

Start the GS-Web UI. You should see the space and the different mirror instances:

{{%align center%}}
![image](/attachment_files/sbp/mirror/distributed-mirror-3.jpg)
{{%/align%}}

Or you can start the Management console and view the space and the different mirror instances:

{{%align center%}}
![image](/attachment_files/sbp/mirror/distributed-mirror-4.jpg)
{{%/align%}}

{{%align center%}}
![image](/attachment_files/sbp/mirror/distributed-mirror-5.png)
{{%/align%}}

You may access the database and check the amount of rows inserted – this should match the amount of objects within the space:

{{%align center%}}
![image](/attachment_files/sbp/mirror/distributed-mirror-6.jpg)
{{%/align%}}

##  Space pu.xml configuration

The cluster-config.mirror-service.url should include the ${clusterInfo.instanceId} as demonstrated below:

```xml
<os-core:space id="space" url="/./space" mirror="true" >
        <os-core:properties>
            <props>
                <prop key="cluster-config.mirror-service.url">jini://*/mirror-service${clusterInfo.instanceId}_container/mirror-service${clusterInfo.instanceId}</prop>
            </props>
        </os-core:properties>
    </os-core:space>
```

##  Mirror pu.xml configuration

The url mirror bean property should include the mirror service id together with the mirror name as demonstrated below:

```bash
<os-core:mirror id="mirror" url="/./mirror-service${mirror-service_id}" space-sync-endpoint="hibernateSpaceSynchronizationEndpoint" operation-grouping="group-by-space-transaction">
        <os-core:source-space name="space" partitions="2" backups="1"/>
    </os-core:mirror>
```

#  Limitations
- Distributed transactions are not supported. Local transactions are supported.


text:
require "rubygems"
require "rbench"

class Array
  alias_method :concat, :<<
end

require 'erubis'
module Erubis
  # This adds support for embedding the return value of a block call:
  #   <%= foo do %>...<% end =%>
  #
  # :api: private
  module Basic::Converter
    def convert_input(src, input)
      pat = @pattern
      regexp = pat.nil? || pat == '<% %>' ? DEFAULT_REGEXP : pattern_regexp(pat)
      pos = 0
      is_bol = true     # is beginning of line
      input.scan(regexp) do |indicator, code, tailch, rspace|
        match = Regexp.last_match()
        len  = match.begin(0) - pos
        text = input[pos, len]
        pos  = match.end(0)
        ch   = indicator ? indicator[0] : nil
        lspace = ch == ?= ? nil : detect_spaces_at_bol(text, is_bol)
        is_bol = rspace ? true : false
        add_text(src, text) if text && !text.empty?
        ## * when '<%= %>', do nothing
        ## * when '<% %>' or '<%# %>', delete spaces iff only spaces are around '<% %>'
        if ch == ?=              # <%= %>
          rspace = nil if tailch && !tailch.empty?
          add_text(src, lspace) if lspace
          add_expr(src, code, indicator)
          add_text(src, rspace) if rspace
        elsif ch == ?\#          # <%# %>
          n = code.count("\n") + (rspace ? 1 : 0)
          if @trim && lspace && rspace
            add_stmt(src, "\n" * n)
          else
            add_text(src, lspace) if lspace
            add_stmt(src, "\n" * n)
            add_text(src, rspace) if rspace
          end
        elsif ch == ?%           # <%% %>
          s = "#{lspace}#{@prefix||='<%'}#{code}#{tailch}#{@postfix||='%>'}#{rspace}"
          add_text(src, s)
        else                     # <% %>
          if @trim && lspace && rspace
            if respond_to?(:add_stmt2)
              add_stmt2(src, "#{lspace}#{code}#{rspace}", tailch)
            else
              add_stmt(src, "#{lspace}#{code}#{rspace}")
            end
          else
            add_text(src, lspace) if lspace
            if respond_to?(:add_stmt2)
              add_stmt2(src, code, tailch)
            else
              add_stmt(src, code)
            end
            add_text(src, rspace) if rspace
          end
        end
      end
      #rest = $' || input                        # ruby1.8
      rest = pos == 0 ? input : input[pos..-1]   # ruby1.9
      add_text(src, rest)
    end

  end

  # Loads a file, runs it through Erubis and parses it as YAML.
  #
  # ===== Parameters
  # file<String>:: The name of the file to load.
  # binding<Binding>::
  #   The binding to use when evaluating the ERB tags. Defaults to the current
  #   binding.
  #
  # :api: private
  def self.load_yaml_file(file, binding = binding)
    YAML::load(Erubis::MEruby.new(IO.read(File.expand_path(file))).result(binding))
  end
end

module Erubis
  module BlockAwareEnhancer
    # :api: private
    def add_preamble(src)
      src << "_old_buf, @_erb_buf = @_erb_buf, ''; "
      src << "@_engine = 'erb'; "
    end

    # :api: private
    def add_postamble(src)
      src << "\n" unless src[-1] == ?\n
      src << "_ret = @_erb_buf; @_erb_buf = _old_buf; _ret.to_s;\n"
    end

    # :api: private
    def add_text(src, text)
      src << " @_erb_buf.concat('" << escape_text(text) << "'); "
    end

    # :api: private
    def add_expr_escaped(src, code)
      src << ' @_erb_buf.concat(' << escaped_expr(code) << ');'
    end

    # :api: private
    def add_stmt2(src, code, tailch)
      src << code
      src << ") ).to_s; " if tailch == "="
      src << ';' unless code[-1] == ?\n
    end

    # :api: private
    def add_expr_literal(src, code)
      if code =~ /(do|\{)(\s*\|[^|]*\|)?\s*\Z/
        src << ' @_erb_buf.concat( (' << code << "; "
      else
        src << ' @_erb_buf.concat((' << code << ').to_s);'
      end
    end
  end

  class BlockAwareEruby < Eruby
    include BlockAwareEnhancer
  end

  class PercentEruby < Erubis::Eruby
    include PercentLineEnhancer
    # include StringBufferEnhancer
    include BlockAwareEnhancer
  end

  class StringBufferEruby < Erubis::Eruby
    include StringBufferEnhancer
    include BlockAwareEnhancer
  end

  class InterpolationEruby < Erubis::Eruby
    include InterpolationEnhancer
    include BlockAwareEnhancer
  end
end

class Erubis::ArrayEruby < Erubis::BlockAwareEruby
  def add_preamble(src)
    src << "_old_buf, @_erb_buf = @_erb_buf, []; "
    src << "@_engine = 'erb'; "
  end

  # :api: private
  def add_postamble(src)
    src << "\n" unless src[-1] == ?\n
    src << "_ret = @_erb_buf; @_erb_buf = _old_buf; _ret.join;\n"
  end
end

class Context
  def initialize
    @hello = "Hello world"
  end

  def helper1
    "Hello!"
  end

  def helper2
    old, @_erb_buf = @_erb_buf, ""
    yield
    ret = @_erb_buf
    @_erb_buf = old
    "<div>#{ret}  </div>\n"
  end
end

text = [__LINE__ + 1, <<-HTML]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  <title>ERB</title>

</head>
<body>
  Text only!
</body>
</html>
HTML

basic = [__LINE__ + 1, <<-HTML]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  <title>ERB</title>

</head>
<body>
  <%= @hello %>
  <%= helper1 %>
  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  <%= helper1 %>
  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  <%= helper1 %>
  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  <%= helper1 %>
  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</body>
</html>
HTML

blocks = [__LINE__ + 1, <<-HTML]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  <title>ERB</title>

</head>
<body>
  <%= @hello %>
  <%= helper1 %>
  <%= helper2 do %>
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    <%= helper1 %>
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  <% end =%>
  <%= helper1 %>
  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  <%= helper1 %>
  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  <%= helper1 %>
  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  <%= helper1 %>
  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</body>
</html>
HTML

def define_template(name, template, line)
  begin
    code = "def #{name}(_locals={}); #{template.src}; end"
  rescue => e
    puts code
    raise
  end
  Context.module_eval code, __FILE__, line
end

KINDS = %w(BlockAware Array Percent StringBuffer)

KINDS.each do |kind|
  define_template("text_#{kind}", Erubis.const_get("#{kind}Eruby").new(text[1]), text[0])
  define_template("basic_#{kind}", Erubis.const_get("#{kind}Eruby").new(basic[1]), basic[0])
  define_template("blocks_#{kind}", Erubis.const_get("#{kind}Eruby").new(blocks[1]), blocks[0])
end

puts Context.new.blocks_Array

(ARGV[0] || 1).to_i.times do
RBench.run(100_000) do
  column :BlockAware
  column :Array
  column :Percent
  column :StringBuffer

  report("text") do
    KINDS.each do |k|
      eval "#{k} { Context.new.text_#{k} }"
    end
  end

  report("basic") do
    KINDS.each do |k|
      eval "#{k} { Context.new.basic_#{k} }"
    end
  end

  report("blocks") do
    KINDS.each do |k|
      eval "#{k} { Context.new.blocks_#{k} }"
    end
  end
end
end


text:
/* eslint-disable no-alert */
/* eslint-disable import/extensions */
/* eslint-disable import/no-unresolved */
/* eslint-disable import/no-extraneous-dependencies */
import React, { Component } from 'react';
import { dripForm, Validator } from 'react-drip-form';
import { Input, Textarea } from 'react-drip-form-components';
import 'drip-form-validator/lib/locale/ja';
import { Layout, Button, Code } from '../../components/';

const I18nForm = dripForm({
  validations: {
    email: {
      required: true,
      email: true,
    },
    message: {
      required: true,
    },
  },
})(({
  handlers,
  meta: { invalid, pristine },
}) => (
  <form onSubmit={handlers.onSubmit}>

      送信先
      <Input
        id="email"
        type="email"
        name="email"
        label="送信先"
      />

      メッセージ
      <Textarea
        id="message"
        name="message"
        label="メッセージ"
      />

    <Button
      primary
      onClick={handlers.onSubmit}
      disabled={invalid || pristine}
    >
      送信
    </Button>
  </form>
));

export default class BasicFormExample extends Component {
  state = {
    values: {},
  };

  componentWillMount() {
    Validator.setLocale('ja');
  }

  componentWillUnmount() {
    Validator.setLocale('en');
  }

  render() {
    const { location } = this.props;
    const { values } = this.state;

    return (
      <Layout
        title="i18n"
        location={location}
      >

          react-drip-form supports to the error message i18n.

          You can deal with just one line using setLocale() of drip-form-validator.

          For locales that do not exist in drip-form-validator, you can also define them with defineLocale().

          Labels and other components are not supported. I think yahoo/react-intl is useful!

Example:

        <I18nForm
          onChange={v => this.setState({ values: v })}
          onValidSubmit={(v) => {
            alert('See console');
            console.log(v);
          }}
        />

Values:

        {JSON.stringify(values, null, 2)}

Sample Code:

        {`import React from 'react';
import { dripForm, Validator } from 'react-drip-form';
import { Input, Textarea } from 'react-drip-form-components';
import 'drip-form-validator/lib/locale/ja';

Validator.setLocale('ja')

const I18nForm = dripForm({
  validations: {
    email: {
      required: true,
      email: true,
    },
    message: {
      required: true,
    },
  },
})(({
  handlers,
  meta: { invalid, pristine },
}) => (
  <form onSubmit={handlers.onSubmit}>

      送信先
      <Input
        id="email"
        type="email"
        name="email"
        label="送信先"
      />

      メッセージ
      <Textarea
        id="message"
        name="message"
        label="メッセージ"
      />

    <Button
      primary
      onClick={handlers.onSubmit}
      disabled={invalid || pristine}
    >
      送信
    </Button>
  </form>
));
`}
      </Layout>
    );
  }
}


text:
The material used to shade the geometry, including colorMixMode options.

**Referenced by:** [FillSymbol3DLayer](fillSymbol3DLayer.md)

### Properties

| Property | Details
| --- | ---
| [color](color.md) | Color is represented as a three or four-element array.
| colorMixMode | Controls how symbolLayer or visualVariable color is applied onto the underlying geometry color/texture. This property only applies to FillSymbol3DLayer within MeshSymbol3D.

`tint`: the feature's appearance (in terms of color) should be altered to match the symbol / visual variable color.

`replace`: the feature's color is replaced with the symbol / visual variable color.

`multiply`: the feature's color is multiplied with the symbol color.

If property is present, must be one of the following values:

`multiply`

`replace`

`tint`

| transparency | A value between `100` (full transparency) and `0` (full opacity). Ignored if no color is specified.

### Example

```json
{
  "material": {
    "color": [
      255,
      0,
      0
    ],
    "transparency": 20,
    "colorMixMode": "tint"
  }
}
```


text:
class McaFeedManager;
class McaAggregatedModel;
class McaFeedFilter;
class McaFeedAdapter;
class McaAdapter;

#define AGREGATEDMODEL_DBUS_NAME "/AggreagatedModel"
#define SERVICEMODELPROXY_DBUS_NAME "/ServiceModelProxy"

class QSortFilterProxyModel;

struct FeedInfo
{
    QString upid;
    McaAdapter *feed;
    McaFeedFilter *filter;
};

class McaAbstractManagerDBus : public QObject
{
    Q_OBJECT

public:
    McaAbstractManagerDBus(QObject *parent = 0);
    virtual ~McaAbstractManagerDBus();

    //managerData will be panelName for PanelManagerDBus, searchText for SearchManagerDBus
    Q_INVOKABLE virtual void initialize(const QString& managerData = QString()) = 0;

    QString dbusObjectId();
    qint64 lastTime();

public slots:
    QString feedModelPath();
    void ping();

protected:
    virtual void addFeed(const QModelIndex &index);
    virtual void removeFeed(const QModelIndex &index);
    virtual QString fullEnabledKey() { return ""; }
    void removeAllFeeds();

    static QString generateUniqueId();

signals:
    void updateCounts();

protected slots:
    virtual void rowsInserted(const QModelIndex &index, int start, int end);
    virtual void rowsAboutToBeRemoved(const QModelIndex &index, int start, int end);
    virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);

    virtual void createFeedDone(QObject *containerObj, McaFeedAdapter *feedAdapter, int uniqueRequestId);
    virtual void removeFeedCleanup(const QString& upid) = 0;
    void createFeedError(QString serviceName, int uniqueRequestId);

private:
    virtual QModelIndex serviceModelIndex(int row) = 0;
    virtual int serviceModelRowCount() = 0;
    virtual QVariant serviceModelData(const QModelIndex &index, int role) = 0;
//    virtual QVariant serviceModelData(int row, int role) = 0;
    virtual bool dataChangedCondition(const QModelIndex &index) = 0;
//    virtual bool dataChangedCondition(int row) = 0;

    virtual int createFeed(const QAbstractItemModel *serviceModel, const QString& name) = 0;
    virtual void createFeedFinalize(QObject *containerObj, McaFeedAdapter *feedAdapter, FeedInfo *feedInfo) = 0;

protected:
    McaFeedManager *m_feedmgr;
    McaAggregatedModel *m_aggregator;
    QHash<QString, FeedInfo *> m_upidToFeedInfo;
    QMap<int, int> m_requestIds;
    QString m_dbusObjectId;
    qint64 m_lastTime;
};

#endif // ABSTRACTMANAGER_H


text:
<!doctype html>

		<meta charset="utf-8">

		<title>Scene: The Social App For Gigs, Restaurants, Parties & More!</title>

		<meta name="description" content="A Social App For Gigs, Restaurants, Parties & More">
		<meta name="author" content="Group 2">

		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />

		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">

		<link rel="stylesheet" href="css/reveal.css">
		<link rel="stylesheet" href="css/theme/white.css" id="theme">

		<link rel="stylesheet" href="lib/css/zenburn.css">

The Social App For Gigs, Restaurants, Parties & More!

						Created by Group 2

Video

						<video controls >
						  <source src="images/soc_network.mp4" type="video/mp4">
						</video>

How does SCENE work?

Competition

Foursquare and Socialeyes have/had points system

Poor reaction when Foursquare removed them

Buisness Model

Advertisement and Promotion,
 Affiliate.

						 The ultimate social database

 Interests based on age, gender, ethnicity, "their Scene".

 Excellent marketing opportunities

Target Audience

18+

 12+ in a future release


text:
using DevExpress.Mvvm;
using DevExpress.Mvvm.DataAnnotations;
using System.IO;

namespace Example.ViewModel {
    [POCOViewModel]
    public class SaveFileDialogViewModel {
        public virtual string DefaultExt { get; set; }
        public virtual string DefaultFileName { get; set; }
        public virtual string Filter { get; set; }
        public virtual int FilterIndex { get; set; }
#if !SILVERLIGHT
        public virtual string Title { get; set; }
        public virtual bool OverwritePrompt { get; set; }
#endif
        public virtual bool DialogResult { get; protected set; }
        public virtual string ResultFileName { get; protected set; }
        public virtual string FileBody { get; set; }
        protected virtual ISaveFileDialogService SaveFileDialogService { get { return null; } }

        public SaveFileDialogViewModel() {
            DefaultExt = "txt";
            DefaultFileName = "Document1";
            Filter = "Text Files (.txt)|*.txt|All Files (*.*)|*.*";
            FilterIndex = 1;
            FileBody = "Hello";
#if !SILVERLIGHT
            Title = "Test Dialog";
            OverwritePrompt = true;
#endif
        }
        public void Save() {
            SaveFileDialogService.DefaultExt = DefaultExt;
            SaveFileDialogService.DefaultFileName = DefaultFileName;
            SaveFileDialogService.Filter = Filter;
            SaveFileDialogService.FilterIndex = FilterIndex;
            DialogResult = SaveFileDialogService.ShowDialog();
            if(!DialogResult) {
                ResultFileName = string.Empty;
            } else {
                using(var stream = new StreamWriter(SaveFileDialogService.OpenFile())) {
                    stream.Write(FileBody);
                }
            }
        }
    }
}


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using Microsoft.CodeAnalysis.CSharp.Test.Utilities;
using Roslyn.Test.Utilities;
using Xunit;

namespace Microsoft.CodeAnalysis.CSharp.UnitTests
{
    public class DisabledRegionTests : CSharpTestBase
    {
        [WorkItem(544917, "DevDiv")]
        [Fact]
        public void DisabledError_DiagnosticsAndEffect()
        {
            var source = @"
#if false
#error ""error1""
#endif
#error ""error2""
class C { }
";

            ParserErrorMessageTests.ParseAndValidate(source,
                Diagnostic(ErrorCode.ERR_ErrorDirective, @"""error2""").WithArguments(@"""error2"""));
        }

        [WorkItem(544917, "DevDiv")]
        [Fact]
        public void DisabledWarning_DiagnosticsAndEffect()
        {
            var source = @"
#if false
#warning ""warning1""
#endif
#warning ""warning2""
class C { }
";

            ParserErrorMessageTests.ParseAndValidate(source,
                Diagnostic(ErrorCode.WRN_WarningDirective, @"""warning2""").WithArguments(@"""warning2"""));
        }

        [WorkItem(544917, "DevDiv")]
        [Fact]
        public void DisabledLine_Diagnostics()
        {
            var source = @"
#if false
#line
#line 0
#endif
#line
#line 0
class C { }
";

            ParserErrorMessageTests.ParseAndValidate(source,
                Diagnostic(ErrorCode.ERR_InvalidLineNumber, ""),
                Diagnostic(ErrorCode.ERR_InvalidLineNumber, "0"));
        }

        [WorkItem(544917, "DevDiv")]
        [Fact]
        public void DisabledPragma_Diagnostics()
        {
            var source = @"
#if false
#pragma
#pragma warning
#pragma warning disable ""something""
#pragma warning disable 0
#pragma warning disable -1
#pragma checksum
#pragma checksum ""file""
#pragma checksum ""file"" ""guid""
#pragma checksum ""file"" ""guid"" ""bytes""
#endif
#pragma
#pragma warning
#pragma warning disable ""something2""
#pragma warning disable 1
#pragma warning disable -2
#pragma checksum
#pragma checksum ""file""
#pragma checksum ""file"" ""guid""
#pragma checksum ""file"" ""guid"" ""bytes""
class C { }
";

            ParserErrorMessageTests.ParseAndValidate(source,
                Diagnostic(ErrorCode.WRN_IllegalPragma, ""),
                Diagnostic(ErrorCode.WRN_IllegalPPWarning, ""),
                Diagnostic(ErrorCode.WRN_IdentifierOrNumericLiteralExpected, "\"something2\""),
                Diagnostic(ErrorCode.WRN_IdentifierOrNumericLiteralExpected, "-"),
                Diagnostic(ErrorCode.WRN_IllegalPPChecksum, ""),
                Diagnostic(ErrorCode.WRN_IllegalPPChecksum, ""),
                Diagnostic(ErrorCode.WRN_IllegalPPChecksum, @"""guid"""),
                Diagnostic(ErrorCode.WRN_IllegalPPChecksum, ""),
                Diagnostic(ErrorCode.WRN_IllegalPPChecksum, @"""guid"""),
                Diagnostic(ErrorCode.WRN_IllegalPPChecksum, @"""bytes"""));
        }

        [WorkItem(544917, "DevDiv")]
        [Fact]
        public void DisabledReference_Diagnostics()
        {
            var source = @"
#if false
#r
#endif
#r
class C { }
";

            ParserErrorMessageTests.ParseAndValidate(source,
                Diagnostic(ErrorCode.ERR_ExpectedPPFile, ""));
        }

        [WorkItem(544917, "DevDiv")]
        [Fact]
        public void DisabledDefine_Effect()
        {
            var source = @"
#if false
#define foo
#endif
#if foo
#warning ""warning""
#endif
class C { }
";

            ParserErrorMessageTests.ParseAndValidate(source);
        }

        [WorkItem(544917, "DevDiv")]
        [Fact]
        public void DisabledDefine_Diagnostics()
        {
            var source = @"
#if false
#define
#endif
class C { }
";

            ParserErrorMessageTests.ParseAndValidate(source,
                Diagnostic(ErrorCode.ERR_IdentifierExpected, ""));
        }

        [WorkItem(544917, "DevDiv")]
        [Fact]
        public void DisabledUndef_Effect()
        {
            var source = @"
#define foo
#if false
#undef foo
#endif
#if foo
#warning ""warning""
#endif
class C { }
";

            ParserErrorMessageTests.ParseAndValidate(source,
                Diagnostic(ErrorCode.WRN_WarningDirective, @"""warning""").WithArguments(@"""warning"""));
        }

        [WorkItem(544917, "DevDiv")]
        [Fact]
        public void DisabledUndef_Diagnostics()
        {
            var source = @"
#if false
#undef
#endif
class C { }
";

            ParserErrorMessageTests.ParseAndValidate(source,
                Diagnostic(ErrorCode.ERR_IdentifierExpected, ""));
        }

        [WorkItem(544917, "DevDiv")]
        [Fact]
        public void DisabledRegion_Diagnostics()
        {
            var source = @"
#if false
#region
#endif
class C { }
";

            // CONSIDER: it would be nicer not to double-report this.
            // (It's happening because the #endif doesn't pop the region
            // off the directive stack, so it's still there when we clean
            // up.)
            // NOTE: we deliberately suppress the "missing endif" that
            // dev10 would have reported - we only report the first error
            // when unwinding the stack.
            ParserErrorMessageTests.ParseAndValidate(source,
                Diagnostic(ErrorCode.ERR_EndRegionDirectiveExpected, "#endif"),
                Diagnostic(ErrorCode.ERR_EndRegionDirectiveExpected, ""));
        }

        [WorkItem(544917, "DevDiv")]
        [Fact]
        public void DisabledEndRegion_Diagnostics()
        {
            var source = @"
#if false
#endregion
#endif
class C { }
";

            // Deliberately refined from ERR_UnexpectedDirective in Dev10.
            ParserErrorMessageTests.ParseAndValidate(source,
                Diagnostic(ErrorCode.ERR_EndifDirectiveExpected, "#endregion"));
        }

        [WorkItem(544917, "DevDiv")]
        [Fact]
        public void DisabledIf_Effect()
        {
            var source = @"
#if false
#if true
#error error
#endif
#endif
class C { }
";

            ParserErrorMessageTests.ParseAndValidate(source);
        }

        [WorkItem(544917, "DevDiv")]
        [Fact]
        public void DisabledIf_Diagnostics()
        {
            var source = @"
#if false
#if true
#endif
class C { }
";

            ParserErrorMessageTests.ParseAndValidate(source,
                Diagnostic(ErrorCode.ERR_EndifDirectiveExpected, ""));
        }
    }
}


text:
<?php

namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Current
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="AppBundle\Entity\CurrentRepository")
 */
class Current
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }
}


text:
source concourse-up/ci/tasks/lib/test-setup.sh

# shellcheck disable=SC1091
source concourse-up/ci/tasks/lib/letsencrypt.sh

handleVerboseMode

cp "$BINARY_PATH" ./cup
chmod +x ./cup

setDeploymentName crt

trapDefaultCleanup

echo "DEPLOY WITH LETSENCRYPT STAGING CERT, AND CUSTOM DOMAIN"

custom_domain="$deployment-auto-2.concourse-up.engineerbetter.com"

if [ "$IAAS" = "GCP" ]
then
  custom_domain="$deployment-auto-2.gcp2.engineerbetter.com"
fi

./cup deploy "$deployment" \
  --domain "$custom_domain"
sleep 60

config=$(./cup info --json "$deployment")
# shellcheck disable=SC2034
username=$(echo "$config" | jq -r '.config.concourse_username')
# shellcheck disable=SC2034
password=$(echo "$config" | jq -r '.config.concourse_password')
# shellcheck disable=SC2034
manifest="$(dirname "$0")/hello.yml"
# shellcheck disable=SC2034
job="hello"
# shellcheck disable=SC2034
domain="$custom_domain"

assertPipelineIsSettableAndRunnable


text:
A common illustrative example of something undefined behavior in C can do
is "delete your hard drive". Suicide CC is a
LLVM pass which implements this.

The scope of detected undefined behavior is simply local uses of uninitialized
stack variables of primitive type. It should support most POSIX like operating
systems.

This project is named for its similarity to [Suicide
Linux](https://qntm.org/suicide).

> Note: For the safety of my dev machine, the pass in this source tree is
declawed such that it will only emit code to delete a very specific file from
the system executing the program.  However, to achieve the fully advertised
functionality, simply reassign `Suicide::SYSTEM_CMD` in `Suicide.cc` to your
choice of hard drive erasing shell command.

## demo

(slightly out of date)

[![asciicast](https://asciinema.org/a/42649.png)](https://asciinema.org/a/42649)

## building

Install LLVM 3.8.

To build the test program and pass.

```
make
```

To run the pass on the test program.

```
make check
```

## misc

- "SURE" means there is a code path between allocation of a stack variable, and
  a read of it, before any writes to it
- "UNSURE" means that in between the code path between allocation of a stack
  variable, and a read of it, a pointer to that variable is passed into at
  least one function
- in some cases, "SURE" warnings might be misclassified as "UNSURE". this
  occurs when the analysis encounters an "UNSURE" path before a "SURE" path
  involving the same variable and memory read