text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@color/colorBackgroundDark"
    android:padding="5dp"
    android:paddingLeft="10dp"
    android:paddingRight="10dp">

    <android.support.v7.widget.CardView
        android:id="@+id/CardContentView"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="#FFFFFF"
        card_view:cardBackgroundColor="#FFFFFF"
        card_view:cardElevation="1dp"
        card_view:cardUseCompatPadding="true">
        <!--
        card_view:contentPadding="-1dp"
        card_view:cardCornerRadius="3dp"
        -->
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <RelativeLayout
                android:id="@+id/roundedItemHeader"
                android:layout_width="wrap_content"
                android:layout_height="48dp"
                android:layout_margin="8dp"
                android:clickable="false"
                android:focusable="false"
                android:paddingRight="16dp">
                <!--<com.AATech.StopGame_Reader.views.RoundedCornerLayout
                    app:cornerRadius="48dp"
                    app:outerBg="@color/colorDividerDark"/>-->
                <ImageView
                    android:id="@+id/vacancyItemImage"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:layout_alignParentLeft="true"
                    android:layout_alignParentStart="true"
                    android:layout_alignParentTop="true"
                    android:clickable="false"
                    android:focusable="false"
                    android:scaleType="fitXY"
                    android:src="@drawable/no_avatar"
                    android:visibility="invisible" />

                <ImageView
                    android:id="@+id/vacancyItemImagePlaceholder"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:layout_alignParentLeft="true"
                    android:layout_alignParentStart="true"
                    android:layout_alignParentTop="true"
                    android:layout_margin="0dp"
                    android:clickable="false"
                    android:focusable="false"
                    android:scaleType="fitXY"
                    android:src="@drawable/no_avatar"
                    android:visibility="visible" />

                <TextView
                    android:id="@+id/categoryItemTitle"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentEnd="false"
                    android:layout_alignParentLeft="false"
                    android:layout_alignParentRight="false"
                    android:layout_alignParentStart="false"
                    android:layout_marginLeft="8dp"
                    android:layout_marginTop="-4dp"
                    android:layout_toRightOf="@+id/vacancyItemImage"
                    android:clickable="false"
                    android:ellipsize="end"
                    android:focusable="false"
                    android:singleLine="true"
                    android:text="Заголовок"
                    android:textColor="@color/colorTextPrimary"
                    android:textSize="@dimen/materialize_typography_headline" />

                <TextView
                    android:id="@+id/categoryItemDate"
                    android:layout_width="wrap_content"
                    android:layout_height="24dp"
                    android:layout_alignLeft="@+id/categoryItemTitle"
                    android:layout_alignStart="@+id/categoryItemTitle"
                    android:layout_below="@+id/categoryItemTitle"
                    android:clickable="false"
                    android:focusable="false"
                    android:gravity="center_vertical"
                    android:text="Datetime"
                    android:textColor="#aaa"
                    android:textSize="@dimen/materialize_typography_caption" />
            </RelativeLayout>

            <RelativeLayout
                android:id="@+id/roundedItemHeaderFocus"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignBottom="@+id/roundedItemHeader"
                android:layout_alignLeft="@+id/roundedItemHeader"
                android:layout_alignRight="@+id/roundedItemHeader"
                android:layout_alignTop="@+id/roundedItemHeader"
                android:background="@drawable/post_item_header_background"
                android:clickable="true"
                android:focusable="true"
                android:paddingRight="24dp" />
            <!--android:id="@+id/categoryItemShortText"-->

            <TextView
                android:id="@+id/categoryItemIndustryIcon"
                android:layout_width="30dp"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true"
                android:layout_alignParentTop="false"
                android:layout_below="@+id/roundedItemHeader"
                android:layout_marginLeft="8dp"
                android:layout_marginRight="8dp"
                android:paddingTop="10dp"
                android:text="{faw-industry}"
                android:textAlignment="center"
                android:textColor="@color/colorTextPrimary"
                android:textSize="@dimen/materialize_typography_body1" />

            <TextView
                android:id="@+id/categoryItemIndustry"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_alignParentTop="false"
                android:layout_below="@+id/roundedItemHeader"
                android:layout_gravity="fill"
                android:layout_marginRight="8dp"
                android:layout_toEndOf="@+id/categoryItemIndustryIcon"
                android:layout_toLeftOf="@+id/categoryItemIndustryIcon"
                android:layout_toRightOf="@+id/categoryItemIndustryIcon"
                android:layout_toStartOf="@+id/categoryItemIndustryIcon"
                android:paddingLeft="8dp"
                android:paddingStart="8dp"
                android:paddingTop="8dp"
                android:text="Транспорт и логистика"
                android:textColor="@color/colorTextPrimary"
                android:textSize="@dimen/materialize_typography_body1" />

            <TextView
                android:id="@+id/categoryItemContactHumanIcon"
                android:layout_width="30dp"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true"
                android:layout_alignParentTop="false"
                android:layout_below="@+id/categoryItemIndustry"
                android:layout_marginLeft="8dp"
                android:layout_marginRight="8dp"
                android:paddingTop="10dp"
                android:text="{faw-user}"
                android:textAlignment="center"
                android:textColor="@color/colorTextPrimary"
                android:textSize="@dimen/materialize_typography_body1" />

            <TextView
                android:id="@+id/categoryItemContactHuman"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_alignParentTop="false"
                android:layout_below="@+id/categoryItemIndustry"
                android:layout_gravity="fill"
                android:layout_marginEnd="8dp"
                android:layout_marginRight="8dp"
                android:layout_toEndOf="@+id/categoryItemContactHumanIcon"
                android:layout_toLeftOf="@+id/categoryItemContactHumanIcon"
                android:layout_toRightOf="@+id/categoryItemContactHumanIcon"
                android:layout_toStartOf="@+id/categoryItemContactHumanIcon"
                android:paddingLeft="8dp"
                android:paddingRight="8dp"
                android:paddingTop="8dp"
                android:text="Сергей"
                android:textColor="@color/colorTextPrimary"
                android:textSize="@dimen/materialize_typography_body1" />

            <TextView
                android:id="@+id/categoryItemContactPhoneIcon"
                android:layout_width="30dp"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true"
                android:layout_alignParentTop="false"
                android:layout_below="@+id/categoryItemContactHuman"
                android:layout_marginLeft="8dp"
                android:layout_marginRight="8dp"
                android:paddingTop="10dp"
                android:text="{faw-envelope}"
                android:textAlignment="center"
                android:textColor="@color/colorTextPrimary"
                android:textSize="@dimen/materialize_typography_body1" />

            <TextView
                android:id="@+id/categoryItemContactPhone"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_alignParentTop="false"
                android:layout_below="@+id/categoryItemContactHuman"
                android:layout_gravity="fill"
                android:layout_marginRight="8dp"
                android:layout_toEndOf="@+id/categoryItemContactPhoneIcon"
                android:layout_toRightOf="@+id/categoryItemContactPhoneIcon"
                android:paddingLeft="8dp"
                android:paddingRight="8dp"
                android:paddingTop="8dp"
                android:text="+38-000-1234567"
                android:textColor="@color/colorTextPrimary"
                android:textSize="@dimen/materialize_typography_body1" />

            <TextView
                android:id="@+id/categoryItemDescriptionIcon"
                android:layout_width="30dp"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true"
                android:layout_alignParentTop="false"
                android:layout_below="@+id/categoryItemContactPhone"
                android:layout_marginLeft="8dp"
                android:layout_marginRight="8dp"
                android:paddingTop="10dp"
                android:text="{faw-info}"
                android:textAlignment="center"
                android:textColor="@color/colorTextPrimary"
                android:textSize="@dimen/materialize_typography_body1" />

            <TextView
                android:id="@+id/categoryItemDescription"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_alignParentTop="false"
                android:layout_below="@+id/categoryItemContactPhone"
                android:layout_marginEnd="8dp"
                android:layout_marginRight="8dp"
                android:layout_toEndOf="@+id/categoryItemDescriptionIcon"
                android:layout_toRightOf="@+id/categoryItemDescriptionIcon"
                android:bufferType="normal"
                android:ellipsize="end"
                android:maxLines="4"
                android:paddingLeft="8dp"
                android:paddingRight="8dp"
                android:paddingTop="8dp"
                android:singleLine="false"
                android:text="Некоторая очень длинная информация Некоторая очень длинная информация Некоторая очень длинная информацияНекоторая очень длинная информация Некоторая очень длинная информация Некоторая очень длинная информация"
                android:textColor="@color/colorTextPrimary"
                android:textSize="@dimen/materialize_typography_body1" />

            <TextView
                android:id="@+id/readMore"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_alignParentTop="false"
                android:layout_below="@+id/categoryItemDescription"
                android:layout_marginBottom="8dp"
                android:layout_marginRight="8dp"
                android:layout_weight="1"
                android:paddingBottom="8dp"
                android:paddingLeft="8dp"
                android:paddingRight="8dp"
                android:paddingTop="16dp"
                android:text="Читать полностью"
                android:textColor="@color/colorTextPrimary"
                android:textSize="@dimen/materialize_typography_body2" />

        </RelativeLayout>

    </android.support.v7.widget.CardView>
</LinearLayout>


text:
#ifndef BELIEF_H
#define BELIEF_H

//////////////////////
//  Implication     //
//////////////////////
//essentially allowing concepts to predict activations of others

//References//
//-----------//

#include "Term.h"
#include "Stamp.h"

//Data structure//
//--------------//
typedef struct {
    Term term;
    Truth truth;
    Stamp stamp;
    //for deciding occurrence time of conclusion:
    long occurrenceTimeOffset;
    //for efficient spike propagation:
    void *sourceConcept;
    long sourceConceptId; //to check whether it's still the same
    long creationTime;
    bool isUserKnowledge;
} Implication;

//Methods//
//-------//
//Assign a new name to an implication
void Implication_Print(Implication *implication);

#endif

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Threading;

public class Test
{

    public static int Main()
    {
        try
        {
            Monitor.Exit(null);
            Console.WriteLine("Failed to throw exception on Monitor.Exit");
            return 1;
        }
        catch(ArgumentNullException)
        {
            //Expected
        }
        return 100;
    }
}


text:
# -*- coding: utf-8 -*-
"""

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
"""

import os

from PyQt4 import QtGui, uic
from PyQt4.QtGui import QFileDialog, QMessageBox
from PyQt4.QtCore import QCoreApplication

import PagLuxembourg.main

FORM_CLASS, _ = uic.loadUiType(os.path.join(
    os.path.dirname(__file__), 'create_project_dialog.ui'))

class CreateProjectDialog(QtGui.QDialog, FORM_CLASS):
    def __init__(self, parent=None):
        '''
        Constructor.
        '''

        super(CreateProjectDialog, self).__init__(parent)
        # Set up the user interface from Designer.
        # After setupUI you can access any designer object by doing
        # self.<objectname>, and you can use autoconnect slots - see
        # http://qt-project.org/doc/qt-4.8/designer-using-a-ui-file.html
        # #widgets-and-dialogs-with-auto-connect
        self.setupUi(self)

    def showFolderList(self):
        '''
        Display the project folder selection dialog
        '''

        dialog = QFileDialog()
        dialog.setFileMode(QFileDialog.Directory)
        dialog.setOption(QFileDialog.ShowDirsOnly)
        dialog.setWindowTitle(QCoreApplication.translate('CreateProject','Select the new project location'))
        dialog.setSizeGripEnabled(False)
        result = dialog.exec_()

        if result == 0:
            return

        selected_files = dialog.selectedFiles()

        if len(selected_files)==0:
            return

        self.txtProjectFolder.setText(selected_files[0])

    def clear(self):
        '''
        Clears the text boxes
        '''

        self.txtProjectName.setText('')
        self.txtProjectFolder.setText('')

    def accept(self):
        '''
        Dialog accept action (OK)
        '''

        folder = self.txtProjectFolder.text()
        name = self.txtProjectName.text()

        # No project name
        if len(name)==0:
            QMessageBox.critical(self,
                                 QCoreApplication.translate('CreateProject','Error'),
                                 QCoreApplication.translate('CreateProject','Please type a project name'))

        # Project folder error
        if not os.path.exists(folder):
            QMessageBox.critical(self,
                                 QCoreApplication.translate('CreateProject','Error'),
                                 QCoreApplication.translate('CreateProject','The folder does not exist'))

        PagLuxembourg.main.current_project.create(folder,name)

        self.close()


text:
const childProcess = require('child_process');

childProcess.exec('/usr/local/bin/rails server');


text:
layout: post
title:  "[node.js] static method "
date:   2017-8-24 23:01:30 +0530
categories: science
author: "Jin Woo Park"
---
# This post is based on my personal experiences.

create node.js file with express

```javascript
var express = require('express');
var app = express();
var bodyParser = require('body-parser');

app.listen(3000, function() { // when connection with port 3000 is linked then the hello message would be printed.
	console.log("Hello back-end");
});

app.use(express.static('public'))
app.use(bodyParser.json()) //to receive json format text
app.use(bodyParser.urlencoded({extended:true})) //to receive any format excluding json

app.get('/', function(req, res) {
	console.log('test');
	res.sendFile(__dirname + '/public/main.html')
});

app.get('/main', function(req,res) { // when connection with URL "../main" is linked then, the main.html page would be displayed with the console message.
	console.log("you are in main domain");
	res.sendFile(__dirname + '/public/main.html')
});

app.post('/email_post', function(req, res){ // lastly, this function works similarly as previous method. But, it prints received text on webpage.
	//to receive "post" we must declear body-parser;
	console.log("yes you are entered");
	console.log(req.body.email);
	res.send("<h1>welcome " + req.body.email + " </h1>")

})

````


text:
package ca.uhn.fhir.parser.json;

import ca.uhn.fhir.parser.DataFormatException;

import java.io.IOException;
import java.io.Reader;
import java.io.Writer;

/**
 * This interface is the generic representation of any sort of data
 * structure that looks and smells like JSON. These data structures
 * can be abstractly viewed as a <code.Map or List
 * whose members are other Maps, Lists, or scalars (Strings, Numbers, Boolean)
 *
 * @author Bill.Denton
 */
public interface JsonLikeStructure {
	JsonLikeStructure getInstance();

	/**
	 * Parse the JSON document into the Json-like structure
	 * so that it can be navigated.
	 *
	 * @param theReader a Reader that will
	 *                  process the JSON input stream
	 * @throws DataFormatException when invalid JSON is received
	 */
	void load(Reader theReader) throws DataFormatException;

	void load(Reader theReader, boolean allowArray) throws DataFormatException;

	JsonLikeObject getRootObject() throws DataFormatException;

	JsonLikeWriter getJsonLikeWriter();

	JsonLikeWriter getJsonLikeWriter(Writer writer) throws IOException;
}


text:
using UnityEngine;
using System.Collections;

public class HealthBarController : MonoBehaviour
{
	public GameObject healthBarPrefab;
	public Transform target;

	private HealthComp healthComp;
	private UISlider slider;
	// Use this for initialization
	void Start ()
	{
		var ent = GetComponent<EntityWrapper>().entity;
		healthComp = ent.GetComponent<HealthComp>();
		// We need the HUD object to know where in the hierarchy to put the element
		if (HUDRoot.go == null)
		{
			GameObject.Destroy(this);
			return;
		}

		GameObject child = NGUITools.AddChild(HUDRoot.go, healthBarPrefab);
		//hudText = child.GetComponentInChildren<HUDText>();

		// Make the UI follow the target
		child.AddComponent<UIFollowTarget>().target = target;
		slider = child.GetComponentDownward<UISlider>();
		var team = ent.GetComponent<UnitPropertiesComp>().teamID;
		var bar = slider.foregroundWidget as UISprite;
		if (team == 1) // player
		{
			bar.color = new Color(1f, 0, 0, 1f);
		}
		else
		{
			bar.color = new Color(0.5f, 0.5f, 1f, 1f);
		}
	}

	void Update()
	{
		slider.value = healthComp.currentHealth/healthComp.maxHealth;
	}

}


text:
/* start css.sty */
.cmr-7{font-size:58%;}
.cmr-10{font-size:83%;}
.cmmi-7{font-size:58%;font-style: italic;}
.cmmi-10{font-size:83%;font-style: italic;}
.cmsy-7{font-size:58%;}
.cmsy-10{font-size:83%;}
.ecrm-2074{font-size:166%;}
.ecrm-1440{font-size:116%;}
.msbm-10{font-size:83%;}
.cmr-8{font-size:66%;}
.cmr-6{font-size:50%;}
.cmmi-12{font-style: italic;}
.cmmi-8{font-size:66%;font-style: italic;}
.cmmi-6{font-size:50%;font-style: italic;}
.cmsy-8{font-size:66%;}
.cmsy-6{font-size:50%;}
.msbm-10x-x-80{font-size:66%;}
.ecrm-1095{font-size:83%;}
.ecbx-1095{font-size:83%; font-weight: bold;}
.ecbx-1095{ font-weight: bold;}
.ecbx-1095{ font-weight: bold;}
.ecbx-1095{ font-weight: bold;}
.ecbx-1095{ font-weight: bold;}
.ecbx-1095{ font-weight: bold;}
.ecbx-1095{ font-weight: bold;}
.ecbx-1095{ font-weight: bold;}
.ecti-1200{ font-style: italic;}
.ecti-1200{ font-style: italic;}
.ecti-1200{ font-style: italic;}
.ecti-1200{ font-style: italic;}
.ecti-1200{ font-style: italic;}
.ecti-1200{ font-style: italic;}
.ecti-1200{ font-style: italic;}
.ecti-1200{ font-style: italic;}
.ecbx-1200{ font-weight: bold;}
.ecbx-1200{ font-weight: bold;}
.ecbx-1200{ font-weight: bold;}
.ecbx-1200{ font-weight: bold;}
.ecbx-1200{ font-weight: bold;}
.ecbx-1200{ font-weight: bold;}
.ecbx-1200{ font-weight: bold;}
.ecbx-1200{ font-weight: bold;}
.ecrm-1000{font-size:83%;}
.cmbx-12{ font-weight: bold;}
p.noindent { text-indent: 0em }
td p.noindent { text-indent: 0em; margin-top:0em; }
p.nopar { text-indent: 0em; }
p.indent{ text-indent: 1.5em }
@media print {div.crosslinks {visibility:hidden;}}
a img { border-top: 0; border-left: 0; border-right: 0; }
center { margin-top:1em; margin-bottom:1em; }
td center { margin-top:0em; margin-bottom:0em; }
.Canvas { position:relative; }
img.math{vertical-align:middle;}
li p.indent { text-indent: 0em }
li p:first-child{ margin-top:0em; }
li p:last-child, li div:last-child { margin-bottom:0.5em; }
li p~ul:last-child, li p~ol:last-child{ margin-bottom:0.5em; }
.enumerate1 {list-style-type:decimal;}
.enumerate2 {list-style-type:lower-alpha;}
.enumerate3 {list-style-type:lower-roman;}
.enumerate4 {list-style-type:upper-alpha;}
div.newtheorem { margin-bottom: 2em; margin-top: 2em;}
.obeylines-h,.obeylines-v {white-space: nowrap; }
div.obeylines-v p { margin-top:0; margin-bottom:0; }
.overline{ text-decoration:overline; }
.overline img{ border-top: 1px solid black; }
td.displaylines {text-align:center; white-space:nowrap;}
.centerline {text-align:center;}
.rightline {text-align:right;}
div.verbatim {font-family: monospace; white-space: nowrap; text-align:left; clear:both; }
.fbox {padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; }
div.fbox {display:table}
div.center div.fbox {text-align:center; clear:both; padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; }
div.minipage{width:100%;}
div.center, div.center div.center {text-align: center; margin-left:1em; margin-right:1em;}
div.center div {text-align: left;}
div.flushright, div.flushright div.flushright {text-align: right;}
div.flushright div {text-align: left;}
div.flushleft {text-align: left;}
.underline{ text-decoration:underline; }
.underline img{ border-bottom: 1px solid black; margin-bottom:1pt; }
.framebox-c, .framebox-l, .framebox-r { padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; }
.framebox-c {text-align:center;}
.framebox-l {text-align:left;}
.framebox-r {text-align:right;}
span.thank-mark{ vertical-align: super }
span.footnote-mark sup.textsuperscript, span.footnote-mark a sup.textsuperscript{ font-size:80%; }
div.tabular, div.center div.tabular {text-align: center; margin-top:0.5em; margin-bottom:0.5em; }
table.tabular td p{margin-top:0em;}
table.tabular {margin-left: auto; margin-right: auto;}
td p:first-child{ margin-top:0em; }
td p:last-child{ margin-bottom:0em; }
div.td00{ margin-left:0pt; margin-right:0pt; }
div.td01{ margin-left:0pt; margin-right:5pt; }
div.td10{ margin-left:5pt; margin-right:0pt; }
div.td11{ margin-left:5pt; margin-right:5pt; }
table[rules] {border-left:solid black 0.4pt; border-right:solid black 0.4pt; }
td.td00{ padding-left:0pt; padding-right:0pt; }
td.td01{ padding-left:0pt; padding-right:5pt; }
td.td10{ padding-left:5pt; padding-right:0pt; }
td.td11{ padding-left:5pt; padding-right:5pt; }
table[rules] {border-left:solid black 0.4pt; border-right:solid black 0.4pt; }
.hline hr, .cline hr{ height : 1px; margin:0px; }
.tabbing-right {text-align:right;}
span.TEX {letter-spacing: -0.125em; }
span.TEX span.E{ position:relative;top:0.5ex;left:-0.0417em;}
a span.TEX span.E {text-decoration: none; }
span.LATEX span.A{ position:relative; top:-0.5ex; left:-0.4em; font-size:85%;}
span.LATEX span.TEX{ position:relative; left: -0.4em; }
div.float, div.figure {margin-left: auto; margin-right: auto;}
div.float img {text-align:center;}
div.figure img {text-align:center;}
.marginpar {width:20%; float:right; text-align:left; margin-left:auto; margin-top:0.5em; font-size:85%; text-decoration:underline;}
.marginpar p{margin-top:0.4em; margin-bottom:0.4em;}
table.equation {width:100%;}
.equation td{text-align:center; }
td.equation { margin-top:1em; margin-bottom:1em; }
td.equation-label { width:5%; text-align:center; }
td.eqnarray4 { width:5%; white-space: normal; }
td.eqnarray2 { width:5%; }
table.eqnarray-star, table.eqnarray {width:100%;}
div.eqnarray{text-align:center;}
div.array {text-align:center;}
div.pmatrix {text-align:center;}
table.pmatrix {width:100%;}
span.pmatrix img{vertical-align:middle;}
div.pmatrix {text-align:center;}
table.pmatrix {width:100%;}
span.bar-css {text-decoration:overline;}
img.cdots{vertical-align:middle;}
.partToc a, .partToc, .likepartToc a, .likepartToc {line-height: 200%; font-weight:bold; font-size:110%;}
.index-item, .index-subitem, .index-subsubitem {display:block}
div.caption {text-indent:-2em; margin-left:3em; margin-right:1em; text-align:left;}
div.caption span.id{font-weight: bold; white-space: nowrap; }
h1.partHead{text-align: center}
p.bibitem { text-indent: -2em; margin-left: 2em; margin-top:0.6em; margin-bottom:0.6em; }
p.bibitem-p { text-indent: 0em; margin-left: 2em; margin-top:0.6em; margin-bottom:0.6em; }
.paragraphHead, .likeparagraphHead { margin-top:2em; font-weight: bold;}
.subparagraphHead, .likesubparagraphHead { font-weight: bold;}
.quote {margin-bottom:0.25em; margin-top:0.25em; margin-left:1em; margin-right:1em; text-align:justify;}
.verse{white-space:nowrap; margin-left:2em}
div.maketitle {text-align:center;}
h2.titleHead{text-align:center;}
div.maketitle{ margin-bottom: 2em; }
div.author, div.date {text-align:center;}
div.thanks{text-align:left; margin-left:10%; font-size:85%; font-style:italic; }
div.author{white-space: nowrap;}
.quotation {margin-bottom:0.25em; margin-top:0.25em; margin-left:1em; }
.abstract p {margin-left:5%; margin-right:5%;}
div.abstract {width:100%;}
.equation td{text-align:center; }
.equation-star td{text-align:center; }
table.equation-star { width:100%; }
table.equation { width:100%; }
table.align, table.alignat, table.xalignat, table.xxalignat, table.flalign {width:95%; margin-left:5%; white-space: nowrap;}
table.align-star, table.alignat-star, table.xalignat-star, table.flalign-star {margin-left:auto; margin-right:auto; white-space: nowrap;}
td.align-label { width:5%; text-align:center; }
td.align-odd { text-align:right; padding-right:0.3em;}
td.align-even { text-align:left; padding-right:0.6em;}
table.multline, table.multline-star {width:100%;}
td.gather {text-align:center; }
table.gather {width:100%;}
div.gather-star {text-align:center;}
/* end css.sty */


text:
package LeetcodeTemplate;

public class _0173BinarySearchTreeIterator {
	static public class TreeNode {
		int val;
		TreeNode left;
		TreeNode right;

		TreeNode() {
		}

		TreeNode(int val) {
			this.val = val;
		}

		TreeNode(int val, TreeNode left, TreeNode right) {
			this.val = val;
			this.left = left;
			this.right = right;
		}
	}

	public static void main(String[] args) {
		TreeNode tn = new TreeNode(7);
		tn.left = new TreeNode(3);
		tn.right = new TreeNode(15);
		tn.right.left = new TreeNode(9);
		tn.right.right = new TreeNode(20);

		BSTIterator iterator = new BSTIterator(tn);
		System.out.println(iterator.next()); // return 3
		System.out.println(iterator.next()); // return 7
		System.out.println(iterator.hasNext()); // return true
		System.out.println(iterator.next()); // return 9
		System.out.println(iterator.hasNext()); // return true
		System.out.println(iterator.next()); // return 15
		System.out.println(iterator.hasNext()); // return true
		System.out.println(iterator.next()); // return 20
		System.out.println(iterator.hasNext()); // return false
	}

	static class BSTIterator {

	}

}


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Welcome extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see https://codeigniter.com/user_guide/general/urls.html
	 */

	public function index()
	{
	    $title =  "Subscription System";
		$data['message'] =  "";
		$this->load->library('breadcrumbs');
		$this->breadcrumbs->push('Home', '/');
	    $bread  = $this->breadcrumbs->show();
		$this->common_include($title,$bread );
		$this->load->view('welcome', $data);
		$this->load->view('common/footer');
	}
	function common_include($title,$breadcrumb)
	{
		$data['title'] = ($title)?$title:'subscription';
		$data['breadcrumb'] = "Home";//($breadcrumb)?$breadcrumb:'Home';
		$user_data = $this->session->all_userdata();
     	$data['userdata'] = (!empty($user_data))? $user_data:array();
		$this->load->view('common/header',$data);
	}
}


text:
FFI bindings to clfsmgmt.

[Documentation](https://retep998.github.io/doc/clfsmgmt-sys/)


text:
package ru.silverhammer.initializer;

import ru.reflexio.IFieldReflection;
import ru.sanatio.conversion.IStringConverter;
import ru.silverhammer.control.ICollectionControl;

public class StringItemsInitializer implements IInitializer<ICollectionControl<?, ?, String>, StringItems> {

	private final IStringConverter converter;

	public StringItemsInitializer(IStringConverter converter) {
		this.converter = converter;
	}

	@Override
	public void init(ICollectionControl<?, ?, String> control, StringItems annotation, Object data, IFieldReflection field) {
		for (String s : annotation.value()) {
			control.getCollection().add(converter.getString(s));
		}
	}
}


text:
package observer.lab;

import java.util.ArrayList;
import java.util.List;

public class PersonCollection implements GUIName {

	List<Observer> observerList;
	List<Person> personList;

	public void add(Person person) {
		if (!personList.contains(person)) {
			personList.add(person);
			notifyObservers();
		}
	}

	public void remove(Person person) {
		int i = personList.indexOf(person);
		if (i >= 0) {
			personList.remove(i);
			notifyObservers();
		}
	}

	public PersonCollection() {
		personList = new ArrayList<>();
		observerList = new ArrayList<>();
	}

	@Override
	public void attach(Observer observer) {
		// TODO Auto-generated method stub
		if (!observerList.contains(observer))
			observerList.add(observer);
	}

	@Override
	public void detach(Observer observer) {
		// TODO Auto-generated method stub
		int i = observerList.indexOf(observer);
		if (i >= 0)
			observerList.remove(i);
	}

	@Override
	public void notifyObservers() {
		// TODO Auto-generated method stub
		for (Observer observer : observerList) {
			observer.update(personList);
		}

	}

}


text:
using System.Collections.Generic;

using Amazon.RDS.Model;
using Amazon.Runtime.Internal.Transform;

namespace Amazon.RDS.Model.Internal.MarshallTransformations
{
     /// <summary>
     ///   DescribeDBInstancesResult Unmarshaller
     /// </summary>
    internal class DescribeDBInstancesResultUnmarshaller : IUnmarshaller<DescribeDBInstancesResult, XmlUnmarshallerContext>, IUnmarshaller<DescribeDBInstancesResult, JsonUnmarshallerContext>
    {
        public DescribeDBInstancesResult Unmarshall(XmlUnmarshallerContext context)
        {
            DescribeDBInstancesResult describeDBInstancesResult = new DescribeDBInstancesResult();
            int originalDepth = context.CurrentDepth;
            int targetDepth = originalDepth + 1;

            if (context.IsStartOfDocument)
               targetDepth += 2;

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Marker", targetDepth))
                    {
                        describeDBInstancesResult.Marker = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("DBInstances/DBInstance", targetDepth))
                    {
                        describeDBInstancesResult.DBInstances.Add(DBInstanceUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return describeDBInstancesResult;
                }
            }

            return describeDBInstancesResult;
        }

        public DescribeDBInstancesResult Unmarshall(JsonUnmarshallerContext context)
        {
            return null;
        }

        private static DescribeDBInstancesResultUnmarshaller instance;

        public static DescribeDBInstancesResultUnmarshaller GetInstance()
        {
            if (instance == null)
               instance = new DescribeDBInstancesResultUnmarshaller();

            return instance;
        }
    }
}


text:
@interface SIXRefreshNormalHeader : SIXRefreshHeader

@end


text:
#include <math.h>
#include <stdio.h>
#include <stdlib.h>

#include <httperf.h>
#include <event.h>
#include <object.h>
#include <rate.h>
#include <timer.h>

/* By pushing the random number generator state into the caller via
   the xsubi array below, we gain some test repeatability.  For
   example, let us say one generator was starting sessions, and a
   different generator was controlling requests within a session.  If
   both processes were sharing the same random number generator, then
   a premature session termination would change the subsequent session
   arrival spacing.  */

static Time
next_arrival_time_det (Rate_Generator *rg)
{
  return rg->rate->mean_iat;
}

static Time
next_arrival_time_uniform (Rate_Generator *rg)
{
  Time lower, upper;

  lower = rg->rate->min_iat;
  upper = rg->rate->max_iat;

  return lower + (upper - lower)*erand48 (rg->xsubi);
}

static Time
next_arrival_time_exp (Rate_Generator *rg)
{
  Time mean = rg->rate->mean_iat;

  return -mean*log (1.0 - erand48 (rg->xsubi));
}

static void
tick (Timer *t, Any_Type arg)
{
  Time delay, now = timer_now ();
  Rate_Generator *rg = arg.vp;

  rg->timer = 0;
  if (rg->done)
    return;

  while (now > rg->next_time)
    {
      delay = (*rg->next_interarrival_time) (rg);
      if (verbose > 2)
	fprintf (stderr, "next arrival delay = %.4f\n", delay);
      rg->next_time += delay;
      rg->done = ((*rg->tick) (rg->arg) < 0);
      if (rg->done)
	return;
    }
  rg->timer = timer_schedule ((Timer_Callback) tick, arg, rg->next_time - now);
}

static void
done (Event_Type type, Object *obj, Any_Type reg_arg, Any_Type call_arg)
{
  Rate_Generator *rg = reg_arg.vp;

  if (rg->done)
    return;
  rg->done = ((*rg->tick) (rg->arg) < 0);
}

void
rate_generator_start (Rate_Generator *rg, Event_Type completion_event)
{
  Time (*func) (struct Rate_Generator *rg);
  Any_Type arg;
  Time delay;

  /* Initialize random number generator with the init values here, all
     rate generators (although independent) will follow the same
     sequence of random values.  We factor in the client's id to make
     sure no two machines running httperf generate identical random
     numbers.  May want to pass these values as args to
     rate_generator_start in the future.  */
  rg->xsubi[0] = 0x1234 ^ param.client.id;
  rg->xsubi[1] = 0x5678 ^ (param.client.id << 8);
  rg->xsubi[2] = 0x9abc ^ ~param.client.id;

  arg.vp = rg;
  if (rg->rate->rate_param > 0.0)
    {
      switch (rg->rate->dist)
	{
	case DETERMINISTIC: func = next_arrival_time_det; break;
	case UNIFORM:	    func = next_arrival_time_uniform; break;
	case EXPONENTIAL:   func = next_arrival_time_exp; break;
	default:
	  fprintf (stderr, "%s: unrecognized interarrival distribution %d\n",
		   prog_name, rg->rate->dist);
	  exit (-1);
	}
      rg->next_interarrival_time = func;
      delay = (*func) (rg);
      /* bias `next time' so that timeouts are rounded to the closest
         tick: */
      rg->next_time = timer_now () + delay;
      rg->timer = timer_schedule ((Timer_Callback) tick, arg, delay);
    }
  else
    /* generate callbacks sequentially: */
    event_register_handler (completion_event, done, arg);

  rg->start = timer_now ();
  rg->done = ((*rg->tick) (rg->arg) < 0);
}

void
rate_generator_stop (Rate_Generator *rg)
{
  if (rg->timer)
    {
      timer_cancel (rg->timer);
      rg->timer = 0;
    }
  rg->done = 1;
}


text:
using System;
using Renci.SshNet.Sftp.Responses;
using System.Text;

namespace Renci.SshNet.Sftp.Requests
{
    internal class PosixRenameRequest : SftpExtendedRequest
    {
        private byte[] _oldPath;
        private byte[] _newPath;

        public string OldPath
        {
            get { return Encoding.GetString(_oldPath, 0, _oldPath.Length); }
            private set { _oldPath = Encoding.GetBytes(value); }
        }

        public string NewPath
        {
            get { return Encoding.GetString(_newPath, 0, _newPath.Length); }
            private set { _newPath = Encoding.GetBytes(value); }
        }

        public Encoding Encoding { get; private set; }

#if TUNING
        /// <summary>
        /// Gets the size of the message in bytes.
        /// </summary>
        /// <value>
        /// The size of the messages in bytes.
        /// </value>
        protected override int BufferCapacity
        {
            get
            {
                var capacity = base.BufferCapacity;
                capacity += 4; // OldPath length
                capacity += _oldPath.Length; // OldPath
                capacity += 4; // NewPath length
                capacity += _newPath.Length; // NewPath
                return capacity;
            }
        }
#endif

        public PosixRenameRequest(uint protocolVersion, uint requestId, string oldPath, string newPath, Encoding encoding, Action<SftpStatusResponse> statusAction)
            : base(protocolVersion, requestId, statusAction, "posix-rename@openssh.com")
        {
            Encoding = encoding;
            OldPath = oldPath;
            NewPath = newPath;
        }

        protected override void SaveData()
        {
            base.SaveData();
            WriteBinaryString(_oldPath);
            WriteBinaryString(_newPath);
        }
    }
}


text:
layout: share
title: Universal web frameworks
---

## {{ page.title }}

30 July 2013

Node.js [the most used](https://npmjs.org/) web framework is probably [Express](https://npmjs.org/package/express).
It has history of the first coming within Node.js, inspired by [Sinatra](http://en.wikipedia.org/wiki/Sinatra_%28software%29).
It is simple and nice.

On the other hand, it is other framework that you have to learn. If you are developing also in Java or Ruby,
keeping in mind all those peculiarities, when you not using them everyday, is not what you should pay attention.
*Why there are no good framework, that would work in Java, Ruby and Node.js?*

Every platform is reinventing wheel. When long enough time passed by, it can grasp the latest ideas and neglect what is fading away.
That's good. What is bad is that those framework never care to be compatible or share libraries. In fact, on the contrary
 they tend to make everything their own.

I invite for open discussion [here (just modify & send pull request)](https://github.com/Nodeclipse/www.nodeclipse.org/blob/master/_posts/2013-07-30-Universal-webframeworks.md),
 or add comments below. Share good framework you know, that have some features, ideas, templates shared with other languages, platforms.

Recently [Wikipedia articles says, that web frameworks](http://en.wikipedia.org/wiki/Web_application_framework#Features) should take care about:

- Web template system
- Caching
- Security
- Database access, mapping and configuration
- Scaffolding
- URL mapping
- Ajax
- Web services
- Web resources

[Comparison of web application frameworks on Wikipedia](http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks)
has not yet Node.js frameworks, but is good example for references.

**Are there Universal web frameworks**?

UPDATE:

Scaffolding using JS MVC frameworks seems interesting direction.
<https://github.com/robfletcher/grails-angular-scaffolding>


text:
describe("", function() {
  var rootEl;
  beforeEach(function() {
    rootEl = browser.rootEl;
    browser.get("build/docs/examples/example-checkbox-input-directive/index.html");
  });

it('should change state', function() {
  var value1 = element(by.binding('checkboxModel.value1'));
  var value2 = element(by.binding('checkboxModel.value2'));

  expect(value1.getText()).toContain('true');
  expect(value2.getText()).toContain('YES');

  element(by.model('checkboxModel.value1')).click();
  element(by.model('checkboxModel.value2')).click();

  expect(value1.getText()).toContain('false');
  expect(value2.getText()).toContain('NO');
});
});


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Agaricus floridanus Peck

### Remarks
null


text:
package org.citygml.ade.noise.model;

import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.model.citygml.ade.binding.ADEModelObject;
import org.citygml4j.model.gml.feature.FeatureProperty;

public class TrainProperty extends FeatureProperty<Train> implements ADEModelObject {

	public TrainProperty() {
	}

	public TrainProperty(Train train) {
		super(train);
	}

	public TrainProperty(String href) {
		super(href);
	}

	public Train getTrain() {
		return super.getObject();
	}

	public boolean isSetTrain() {
		return super.isSetObject();
	}

	public void setTrain(Train train) {
		super.setObject(train);
	}

	public void unsetTrain() {
		super.unsetObject();
	}

	@Override
	public Class<Train> getAssociableClass() {
		return Train.class;
	}

	@Override
	public Object copy(CopyBuilder copyBuilder) {
		return copyTo(new TrainProperty(), copyBuilder);
	}

	@Override
	public Object copyTo(Object target, CopyBuilder copyBuilder) {
		TrainProperty copy = (target == null) ? new TrainProperty() : (TrainProperty)target;
		return super.copyTo(copy, copyBuilder);
	}

}


text:
package com.evolveum.prism.xml.ns._public.types_3;

import com.evolveum.midpoint.prism.JaxbVisitable;
import com.evolveum.midpoint.prism.JaxbVisitor;
import com.evolveum.midpoint.util.DOMUtil;
import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy;
import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy;
import org.jvnet.jaxb2_commons.lang.Equals;
import org.jvnet.jaxb2_commons.lang.EqualsStrategy;
import org.jvnet.jaxb2_commons.lang.HashCode;
import org.jvnet.jaxb2_commons.lang.HashCodeStrategy;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
import org.w3c.dom.Node;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlMixed;
import javax.xml.bind.annotation.XmlType;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * A class used to hold string represented either as plain string or as XML markup. (Useful e.g. for jasper templates.)
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "XmlAsStringType", propOrder = {
        "content"
})
public class XmlAsStringType implements Serializable, Cloneable, Equals, HashCode, JaxbVisitable {

    private final static long serialVersionUID = 201105211233L;
    @XmlMixed
    @XmlAnyElement(lax = false)             // JAXB should not try to unmarshal inner elements
    protected List<Object> content;

    /**
     * Creates a new {@code XmlAsStringType} instance.
     *
     */
    public XmlAsStringType() {
    }

    public XmlAsStringType(String value) {
        content = new ArrayList<>();
        content.add(value);
    }

    public List<Object> getContent() {
        if (content == null) {
            content = new ArrayList<>();
        }
        return this.content;
    }

    public String getContentAsString() {
        StringBuilder sb = new StringBuilder();
        for (Object object : getContent()) {
            if (object instanceof String) {
                sb.append(object);
            } else if (object instanceof Node) {
                sb.append(DOMUtil.serializeDOMToString((Node) object));
            } else {
                throw new IllegalStateException("Unexpected content in XmlAsStringType: " + (object!=null?object.getClass():"(null)"));
            }
        }
        return sb.toString();
    }

    public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
        int currentHashCode = 1;
        {
            List<Object> theContent;
            theContent = (((this.content!= null)&&(!this.content.isEmpty()))?this.getContent():null);
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "content", theContent), currentHashCode, theContent);
        }
        return currentHashCode;
    }

    public int hashCode() {
        final HashCodeStrategy strategy = DomAwareHashCodeStrategy.INSTANCE;
        return this.hashCode(null, strategy);
    }

    public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
        if (!(object instanceof XmlAsStringType)) {
            return false;
        }
        if (this == object) {
            return true;
        }
        final XmlAsStringType that = ((XmlAsStringType) object);
        {
            List<Object> lhsContent;
            lhsContent = (((this.content!= null)&&(!this.content.isEmpty()))?this.getContent():null);
            List<Object> rhsContent;
            rhsContent = (((that.content!= null)&&(!that.content.isEmpty()))?that.getContent():null);
            if (!strategy.equals(LocatorUtils.property(thisLocator, "content", lhsContent), LocatorUtils.property(thatLocator, "content", rhsContent), lhsContent, rhsContent)) {
                return false;
            }
        }
        return true;
    }

    public boolean equals(Object object) {
        final EqualsStrategy strategy = DomAwareEqualsStrategy.INSTANCE;
        return equals(null, null, object, strategy);
    }

    /**
     * Creates and returns a deep copy of this object.
     *
     * @return
     *     A deep copy of this object.
     */
    @Override
    public XmlAsStringType clone() {
        final XmlAsStringType clone;
        try {
            clone = ((XmlAsStringType) super.clone());
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Couldn't clone object's superclass", e);
        }
        if (this.content != null) {
            clone.content = new ArrayList<>();
            for (Object o : this.getContent()) {
                if (o instanceof String) {
                    clone.content.add(o);
                } else if (o instanceof Node) {
                    clone.content.add(((Node) o).cloneNode(true));
                } else {
                    throw new IllegalStateException("XmlAsStringType.clone: unexpected item in content: " + (o!=null?o.getClass():"(null)"));
                }
            }
        }
        return clone;
    }

    @Override
    public void accept(JaxbVisitor visitor) {
        visitor.visit(this);
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<extension name="sfqc_php" version="0.11.0" xmlns:xi="http://www.w3.org/2001/XInclude">
  libsfq wrapper extension
  <description><?data
This is wrap_libsfq PHP extension module.
  ?></description>

  <maintainers>
    <maintainer>
      <user>cbh34680</user>
      <name>cbh34680</name>
      <email>cbh34680@iret.co.jp</email>
      <role>lead</role>
    </maintainer>
  </maintainers>

  <license>PHP</license>
  <channel>__uri</channel>

  <release>
    <version>0.11.0</version>
    <date>2014-12-08</date>
    <state>stable</state>
    <notes><?data
- Initial release.
    ?></notes>
  </release>

  <deps language="C" platform="unix">
    <with name="libsfq" mode="pkg-config">

    </with>
  </deps>

  <constants>
    <constant type="int" name="SFQ_RC_SUCCESS"			value="SFQ_RC_SUCCESS" />
    <constant type="int" name="SFQ_RC_W_NOELEMENT"		value="SFQ_RC_W_NOELEMENT" />
    <constant type="int" name="SFQ_RC_W_NOSPACE"		value="SFQ_RC_W_NOSPACE" />
    <constant type="int" name="SFQ_RC_W_ACCEPT_STOPPED"		value="SFQ_RC_W_ACCEPT_STOPPED" />
    <constant type="int" name="SFQ_RC_W_TAKEOUT_STOPPED"	value="SFQ_RC_W_TAKEOUT_STOPPED" />
    <constant type="int" name="SFQ_RC_FATAL_MIN"		value="SFQ_RC_FATAL_MIN" />
  </constants>

  <?data
#include <ext/standard/php_smart_str.h>
#include "../sfqc-php.h"
  ?>

  <xi:include href="sfqc-php_push.xml"    parse="xml" />
  <xi:include href="sfqc-php_takeout.xml" parse="xml" />

</extension>


text:
This cookbook has been forked from
https://github.com/Sainsburys/ibm-installmgr

## Scope
This cookbook installs IBM Installation Manager and provides resources for installing IBM packages with a response file.

This cookbook currently uses the Installation Manager Installer method rather than Installation manager to install packages.  For more details see http://www-01.ibm.com/support/knowledgecenter/SSDV2W_1.8.4/com.ibm.silentinstall12.doc/topics/c_installing_differences.html

Group install mode has not been tested. Only admin and nonAdmin have.

## Requirements
* Chef 12.5 or higher
* Installation Media for Installation manager and any other packages.
This can be sourced from an online repository like IBM PassportAdvantage, or from your own download link.  Supports tar, tar.gz and zip.
* Installation Kits may need to be packaged into a single folder.  For example the Websphere installation kit comes in 3 folders disk1, disk2 and disk3.  Make sure all disks are in the same folder like so:

  - WAS/
  - WAS/disk1/
  - WAS/disk2/
  - WAS/disk3/
  - WAS/repository.config

## Platforms
* Centos 6
* Red Hat Enterprise 6
* Centos 7
* Red Hat Enterprise 7

## Usage

See the test cookbook in test/fixtures/cookbooks/ibm-im-test for examples.

##### Install Installation Manager
```ruby

install_mgr 'ibm-im install' do
  install_package 'https://myrepository/agent.installer.linux.gtk.x86_64_1.8.4000.20151125_0201.zip'
  install_package_sha256 '28f5279abc28695c0b99ae0c3fdee26bfec131186f2ca7e41d1317e303adb12e'
  package_name 'com.ibm.cic.agent'
  ibm_root_dir '/opt/IBM'
  service_user 'ibm-im'
  service_group 'ibm-im'
end

ibm_secure_storage_file '/root/MySecureStorageFile' do
  master_pw_file '/root/MyMasterPassFile'
  master_pw 'mypassphrase'
  passport_advantage true
  username 'myPassportAdvUser'
  password 'mypassword'
end

ibm_package 'IHS install' do
  package 'com.ibm.websphere.IHS.v85_8.5.5000.20130514_1044'
  install_dir '/opt/IBM/WAS'
  passport_advantage true
  imcl_dir '/opt/IBM/InstallationManager/eclipse/tools'
  master_pw_file '/root/MyMasterPassFile'
  action :install
end

```

##### Install Websphere with Installation Manager

```ruby
# installation manager must be installed before calling this resource
ibm_package 'WAS ND install' do
  package 'com.ibm.websphere.ND.v85'
  install_dir '/opt/IBM/WAS'
  repositories ['/opt/ibm-media/WASND']
  imcl_dir '/opt/IBM/InstallationManager/eclipse/tools'
  action :install
end
```

### Resources

### install_mgr

Installs IBM Installation Manager

##### Example
```ruby
install_mgr 'ibm-im install' do
  install_package 'https://some-repository/agent.installer.linux.gtk.x86_64_1.8.4000.20151125_0201.zip'
  install_package_sha256 '28f5279abc28695c0b99ae0c3fdee26bfec131186f2ca7e41d1317e303adb12e'
  package_name 'com.ibm.cic.agent'
  ibm_root_dir '/opt/IBM'
  service_user 'ibm-im'
  service_group 'ibm-im'
end
```

##### Parameters

- `:install_package`, Url or local path to a compressed file. Must be .tar, .tar.gz or .zip. String, required: true, default: nil
- `:install_package_sha256`, Hash of install package. String, default: nil
- `:download_temp_dir`, Scratch folder to download to. String, default: Chef::Config['file_cache_path']
- `:extract_dir`, String, default: ""#{download_temp_dir}/ibm-installmgr"
- `:install_dir`, String, default: "#{ibm_root_dir}/InstallationManager/eclipse"
- `:package_name`, String, default: 'com.ibm.cic.agent'
- `:repositories`, [String, Array], default: [extract_dir]
- `:ibm_root_dir`, String, default: '/opt/IBM'
- `:data_location`, This is where Installation Manager stores data about it's installed packages. String, default: '/var/ibm/InstallationManager'
- `:service_user`, String, default: 'ibm-im'
- `:service_group`, String, default: 'ibm-im'
- `:access_rights`, String, default: 'nonAdmin', Can only be nonAdmin, admin or group.  Group is not tested.
- `:preferences`, A hash of preferences that are often contained within a response file. Hash, default: nil
- `:properties`, A hash of properties that are often contained within a response file. Can be used in place of response file. [Hash], default: nil

##### Actions

- `:install` - Installs Installation Manager. Does not start it as this requires gui.

### ibm_package

Installs an IBM application using Installation Manager

##### Example
```ruby
# ... omitted ibm_secure_storage_file resource.

# example to install IHS HTTP Server
ibm_package 'IHS install' do
  package 'com.ibm.websphere.IHS.v85,core.feature,arch.64bit'
  install_dir '/opt/ibm/HTTPServer'
  properties ({
    'eclipseLocation' => '/opt/ibm/HTTPServer',
    'user.import.profile' => 'false',
    'user.ihs.httpPort' => '9080',
    'user.ihs.installHttpService' => 'true',
    'user.ihs.allowNonRootSilentInstall' => 'true',
    'cic.selector.nl' => 'en'
  })
  preferences ({
    'com.ibm.cic.common.core.preferences.preserveDownloadedArtifacts' => 'true'
  })
  repositories ['http://www.ibm.com/software/repositorymanager/com.ibm.websphere.IHS.v85']
  master_pw_file '/root/MyMasterPassFile'
  secure_storage_file '/root/MySecureStorageFile'
  action :install
end

# example to install IBM Directory server.  Note the dual value properties containing two commas ,,

ibm_package 'IBM Diretcory Server' do
  package 'com.ibm.security.directoryserver.v64,main.feature.db2,main.feature.gskit,main.feature.jdk,main.feature.javaclient,'\
    'main.feature.server,main.feature.cclient,main.feature.proxy,main.feature.webadmin'
  install_dir '/opt/ibm/ldap/V6.4'
  repositories [sds_repo]
  access_rights 'admin'
  properties ({
    'eclipseLocation' => '/opt/ibm/ldap/V6.4',
    'user.import.profile' => 'false',
    'cic.selector.os' => 'linux',
    'cic.selector.arch' => 'x86_64',
    'cic.selector.ws' => 'gtk',
    'user.use.existing.db2,,com.ibm.security.directoryserver.v64' => 'false',
    'user.db2.executable.path,,com.ibm.security.directoryserver.v64' => db2_installer_dir,
    'user.use.existing.gskit,,com.ibm.security.directoryserver.v64' => 'false',
    'user.gskit.executable.path,,com.ibm.security.directoryserver.v64' => gskit_installer_dir,
    'user.jdk.executable.path,,com.ibm.security.directoryserver.v64' => jdk_installer
  })
  sensitive_exec false
  action :install
end

```

##### Parameters

- `:package`, The package application id to install. Eg 'com.ibm.websphere.ND.v85_8.5.5000.20130514_1044', String required: true, default: nil
- `install_dir`, Where to install the package. String, required: true, default: nil
- `imcl_dir`, Path to the imcl utility binary You shouldn't need to change this. String, default: '/opt/IBM/InstallationManager/eclipse/tools'
- `repositories`, Array of local dirs or urls to repositories.  Installation Kits may need to be packaged into a single folder, see the Requirements section above. [String, Array], required: true, default: nil
- `service_user`, String, default: 'ibm'
- `service_group`, String, default: 'ibm'
- `properties`, Hash, A hash of properties that are usually found in response files.
- `preferences`, Hash, A hash of preferences that are usually found in response files.
- `additional_options`, a string of additional options to append if needed. String, default: ''
- `access_rights`, String, default: 'nonAdmin', regex: /^(nonAdmin|admin|group)$/
- `log_dir`, String, default: '/var/ibm/InstallationManager/logs'
- `:passport_advantage`, When set to true adds passportAdvantafe repo url to repositories. default: false
- `:secure_storage_file`, path to secure storage file to use for repo credentials. String, default: nil
- `:master_pw_file`, path to file containing password to access encrypted secure_storage_file. String, default: nil
- `:sensitive_exec`, Default: true, Only change this in exceptional debugging circumstances. When set to false you can see the imcl command being executed in the chef logs, which could contain a password.
##### Actions

- `:install` - Installs the package. Does not start, setup a service at this stage.

### ibm_fixpack

Similar to ibm_package but specifically installs an IBM fixpack. All parameters are exactly the same as ibm_package.

##### Example
```ruby

# ... omitted required ibm_secure_storage_file resource.

ibm_fixpack 'WAS ND Fixpack' do
  package 'com.ibm.websphere.ND.v85_8.5.5008.20151112_0939,core.feature,ejbdeploy,thinclient,embeddablecontainer,com.ibm.sdk.6_64bit'
  install_dir '/opt/IBM/Websphere/AppServer'
  repositories ['http://www.ibm.com/software/repositorymanager/com.ibm.websphere.ND.v85']
  master_pw_file '/root/MyMasterPassFile'
  secure_storage_file '/root/MySecureStorageFile'
  action :install
end

```

##### Parameters

Exactly the same as parameters for ibm_package

##### Actions

- `:install`

### ibm_response_file

A simple wrapper around the template resource to create a response file for the ibm_package_response resource. You can use the template resource directly if you like.

##### Example
```ruby
ibm_response_file '/opt/IBM/response_files/my_was_response.xml' do
  cookbook 'ibm-im-test'
  template_source 'was_response.xml.erb'
  variables({
    :key1 => 'val1'
  })
end

```

##### Parameters
- `:package`, The package application id to install. Eg 'com.ibm.websphere.ND.v85_8.5.5000.20130514_1044', String required: true, default: nil,  name_property: true
- `response_file`, Path to create the response file. String
- `group`, File group. String, default: 'ibm-im'
- `owner`, File owner. String, default: 'ibm-im'
- `template_source`, String, default: nil
- `cookbook`, String, default: nil
- `variables`, [Hash], default: nil

##### Actions

- `:create`

### ibm_package_response

NOTE: It's easier and more intuitive to use the ibm_package command and pass in properties and preferences instead of this resource.

Installs an IBM package using a response file.
Please note you may need to create and required users and directories mentioned in the response file first.  You do not need to accept the license or set the accessRights in the response file, this is handled with the command.

##### Example
```ruby
ibm_package_response 'com.ibm.websphere.ND.v85' do
  response_file '/opt/IBM/response_files/my_was_response.xml'
  action :install
end

```

##### Parameters

- `response_file`, String, name_property: true, required: true
- `imcl_dir`, String, default: '/opt/IBM/InstallationManager/eclipse/tools'
- `log_dir`, String, default: '/var/ibm/InstallationManager/logs'
- `pkg_group`, Only used to for log_dir. String, default: 'ibm-im'
- `pkg_owner`, Only used to for log_dir String, default: 'ibm-im'
- `access_rights`, String, default: 'nonAdmin', regex: /^(nonAdmin|admin|group)$/

##### Actions

- `:install`

### ibm_secure_storage_file

Creates an encrypted Eclipse Storage file to store password credentials to repositories such as IBM passport Advantage.

##### Example
```ruby
ibm_secure_storage_file '/root/MySecureStorageFile' do
  master_pw_file '/root/MyMasterPassFile'
  master_pw 'mypassphrase'
  passport_advantage true
  username 'myemail@somedomain.com'
  password 'mypass'
end
```

##### Parameters

- `secure_file`, String, name_property: true
- `master_pw_file`, Contains the password to access the secure_file. String
- `master_pw`, password to put in master_pw_file. String, default: nil
- `url`, String, default: 'http://www.ibm.com/software/repositorymanager/entitled/repository.xml'
- `passport_advantage`, Set to true when credentials are to access passportAdvantage. The url will be ignored if set. [TrueClass, FalseClass], default: false
- `username`, String, default: nil
- `password`, For encrypting the secure file. String, default: nil
- `imutilsc_dir`, Path to imutilsc binary. You shouldn't need to change this from the default. String, default: '/opt/IBM/InstallationManager/eclipse/tools'
##### Actions

- `:create`

## License and Author

* Author: Lachlan Munro, Chris Bell

Copyright: 2015, J Sainsburys

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


text:
package codingbat.functional1;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * https://codingbat.com/prob/p177528
 */
public final class MoreY {
    public List<String> moreY(List<String> strings) {
        return strings.stream()
            .map(n -> "y" + n + "y")
            .collect(Collectors.toCollection(ArrayList::new));
    }
}


text:
name: Leaflet.EditInOSM
category: 3rd-party-integration
repo: https://github.com/yohanboniface/Leaflet.EditInOSM
author: Yohan Boniface
author-url: https://yohanboniface.me/
demo: http://yohanboniface.github.io/Leaflet.EditInOSM/examples/basic.html
compatible-v0:
compatible-v1: true
---

Add a control with links to open the current map view on main OSM editors.


text:
namespace Microsoft.Azure.KeyVault.Models
{
    using Newtonsoft.Json;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;

    /// <summary>
    /// The storage account item containing storage account metadata.
    /// </summary>
    public partial class StorageAccountItem
    {
        /// <summary>
        /// Initializes a new instance of the StorageAccountItem class.
        /// </summary>
        public StorageAccountItem()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the StorageAccountItem class.
        /// </summary>
        /// <param name="id">Storage identifier.</param>
        /// <param name="resourceId">Storage account resource Id.</param>
        /// <param name="attributes">The storage account management
        /// attributes.</param>
        /// <param name="tags">Application specific metadata in the form of
        /// key-value pairs.</param>
        public StorageAccountItem(string id = default(string), string resourceId = default(string), StorageAccountAttributes attributes = default(StorageAccountAttributes), IDictionary<string, string> tags = default(IDictionary<string, string>))
        {
            Id = id;
            ResourceId = resourceId;
            Attributes = attributes;
            Tags = tags;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets storage identifier.
        /// </summary>
        [JsonProperty(PropertyName = "id")]
        public string Id { get; private set; }

        /// <summary>
        /// Gets storage account resource Id.
        /// </summary>
        [JsonProperty(PropertyName = "resourceId")]
        public string ResourceId { get; private set; }

        /// <summary>
        /// Gets the storage account management attributes.
        /// </summary>
        [JsonProperty(PropertyName = "attributes")]
        public StorageAccountAttributes Attributes { get; private set; }

        /// <summary>
        /// Gets application specific metadata in the form of key-value pairs.
        /// </summary>
        [JsonProperty(PropertyName = "tags")]
        public IDictionary<string, string> Tags { get; private set; }

    }
}


text:
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using Wargaming.WebAPI.Enums;

namespace Wargaming.WebAPI.Common.Model
{
    public class ClanEmblems
    {
        /// <summary>
        /// List of links to 24x24 px emblems
        /// </summary>
        [JsonProperty("x24")]
        private Dictionary<string, string> EmblemsX24Values
        {
            get { return this.EmblemsX24.ToDictionary(x => x.Key.ReplaceEnvironments(), x => x.Value.ToString()); }
            set { this.EmblemsX24 = value.ToDictionary(x => x.Key.ReplaceEnvironments(), x => new Uri(x.Value)); }
        }

        /// <summary>
        /// List of links to 24x24 px emblems
        /// </summary>
        [JsonIgnore]
        public Dictionary<Environments, Uri> EmblemsX24 { get; set; }

        /// <summary>
        /// List of links to 32x32 px emblems
        /// </summary>
        [JsonProperty("x32")]
        private Dictionary<string, string> EmblemsX32Values
        {
            get { return this.EmblemsX32.ToDictionary(x => x.Key.ReplaceEnvironments(), x => x.Value.ToString()); }
            set { this.EmblemsX32 = value.ToDictionary(x => x.Key.ReplaceEnvironments(), x => new Uri(x.Value)); }
        }

        /// <summary>
        /// List of links to 32x32 px emblems
        /// </summary>
        [JsonIgnore]
        public Dictionary<Environments, Uri> EmblemsX32 { get; set; }

        /// <summary>
        /// List of links to 64x64 px emblems
        /// </summary>
        [JsonProperty("x64")]
        private Dictionary<string, string> EmblemsX64Values
        {
            get { return this.EmblemsX64.ToDictionary(x => x.Key.ReplaceEnvironments(), x => x.Value.ToString()); }
            set { this.EmblemsX64 = value.ToDictionary(x => x.Key.ReplaceEnvironments(), x => new Uri(x.Value)); }
        }

        /// <summary>
        /// List of links to 64x64 px emblems
        /// </summary>
        [JsonIgnore]
        public Dictionary<Environments, Uri> EmblemsX64 { get; set; }

        /// <summary>
        /// List of links to 195x195 px emblems
        /// </summary>
        [JsonProperty("x195")]
        private Dictionary<string, string> EmblemsX195Values
        {
            get { return this.EmblemsX195.ToDictionary(x => x.Key.ReplaceEnvironments(), x => x.Value.ToString()); }
            set { this.EmblemsX195 = value.ToDictionary(x => x.Key.ReplaceEnvironments(), x => new Uri(x.Value)); }
        }

        /// <summary>
        /// List of links to 195x195 px emblems
        /// </summary>
        [JsonIgnore]
        public Dictionary<Environments, Uri> EmblemsX195 { get; set; }

        /// <summary>
        /// List of links to 256x256 px emblems
        /// </summary>
        [JsonProperty("x256")]
        private Dictionary<string, string> EmblemsX256Values
        {
            get { return this.EmblemsX256.ToDictionary(x => x.Key.ReplaceEnvironments(), x => x.Value.ToString()); }
            set { this.EmblemsX256 = value.ToDictionary(x => x.Key.ReplaceEnvironments(), x => new Uri(x.Value)); }
        }

        /// <summary>
        /// List of links to 256x256 px emblems
        /// </summary>
        [JsonIgnore]
        public Dictionary<Environments, Uri> EmblemsX256 { get; set; }
    }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.slack.api</groupId>
        <artifactId>slack-sdk-parent</artifactId>
        <version>1.1.4-SNAPSHOT</version>
    </parent>

    <groupId>com.slack.api</groupId>
    <artifactId>bolt-kotlin-examples</artifactId>
    <version>1.1.4-SNAPSHOT</version>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>com.slack.api</groupId>
            <artifactId>slack-api-model</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.slack.api</groupId>
            <artifactId>slack-api-client</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.slack.api</groupId>
            <artifactId>slack-app-backend</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.slack.api</groupId>
            <artifactId>bolt</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.slack.api</groupId>
            <artifactId>bolt-jetty</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>com.amazonaws</groupId>
            <artifactId>aws-java-sdk-s3</artifactId>
            <version>${aws.s3.version}</version>
        </dependency>

        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib</artifactId>
            <version>${kotlin.version}</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.version}</version>
        </dependency>
    </dependencies>

    <build>
        <sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
                <version>${kotlin.version}</version>

                <executions>
                    <execution>
                        <id>compile</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>

                    <execution>
                        <id>test-compile</id>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>


text:
/// @todo Documentation Dataflow/Network/PortInterface.h

/// @todo Documentation Dataflow/Network/PortInterface.h

#ifndef DATAFLOW_NETWORK_PORT_INTERFACE_H
#define DATAFLOW_NETWORK_PORT_INTERFACE_H

#include <string>
#include <boost/signals2/signal.hpp>
#include <Dataflow/Network/NetworkFwd.h>
#include <Core/Datatypes/Geometry.h> //TODO
#include <Dataflow/Network/share.h>

namespace SCIRun {
namespace Dataflow {
namespace Networks {

  class SCISHARE PortDescriptionInterface
  {
  public:
    virtual ~PortDescriptionInterface();
    virtual PortId id() const = 0;
    virtual size_t nconnections() const = 0;
    virtual std::string get_typename() const = 0;
    virtual std::string get_portname() const = 0;
    virtual bool isInput() const = 0;
    virtual bool isDynamic() const = 0;
    virtual ModuleId getUnderlyingModuleId() const = 0;
    virtual size_t getIndex() const = 0;
    virtual boost::optional<ConnectionId> firstConnectionId() const = 0;
  };

  class SCISHARE PortInterface : public PortDescriptionInterface
  {
  public:
    virtual ~PortInterface();
    virtual void attach(Connection* conn) = 0;
    virtual void detach(Connection* conn) = 0;
    virtual Connection* connection(size_t) const = 0;
    virtual void setIndex(size_t index) = 0;
    void incrementIndex() { setIndex(getIndex() + 1); }
    void decrementIndex() { setIndex(getIndex() - 1); }
    virtual void setId(const PortId& id) = 0;
    virtual ModuleStateHandle moduleState() const = 0;
    virtual bool hasConnectionCountIncreased() const = 0;
  };

  typedef boost::signals2::signal<void(const PortId&, Core::Datatypes::DatatypeHandle)> DataOnPortHasChangedSignalType;
  typedef boost::function<std::string()> PortDataDescriber;

  class SCISHARE InputPortInterface : virtual public PortInterface
  {
  public:
    virtual ~InputPortInterface();
    virtual Core::Datatypes::DatatypeHandleOption getData() const = 0;
    virtual DatatypeSinkInterfaceHandle sink() const = 0;
    virtual InputPortInterface* clone() const = 0;
    virtual bool hasChanged() const = 0;
    virtual boost::signals2::connection connectDataOnPortHasChanged(const DataOnPortHasChangedSignalType::slot_type& subscriber) = 0;
    virtual void resendNewDataSignal() = 0;
    virtual boost::optional<std::string> connectedModuleId() const = 0;
    virtual ModuleStateHandle stateFromConnectedModule() const = 0;
  };

  typedef boost::signals2::signal<void(const Core::Datatypes::ModuleFeedback&)> ConnectionFeedbackSignalType;

  class SCISHARE OutputPortInterface : virtual public PortInterface
  {
  public:
    virtual ~OutputPortInterface();
    virtual void sendData(Core::Datatypes::DatatypeHandle data) = 0;
    virtual bool hasData() const = 0;
    virtual DatatypeSourceInterfaceHandle source() const = 0;
    virtual OutputPortInterface* clone() const { return nullptr; } // TODO
    virtual PortDataDescriber getPortDataDescriber() const = 0;
    virtual boost::signals2::connection connectConnectionFeedbackListener(const ConnectionFeedbackSignalType::slot_type& subscriber) = 0;
    virtual void sendConnectionFeedback(const Core::Datatypes::ModuleFeedback& info) = 0;
  };

  class SCISHARE PortConnectionDeterminer
  {
  public:
    bool canBeConnected(const PortDescriptionInterface& port1, const PortDescriptionInterface& port2) const;
  };

}}}

#endif


text:
require File.expand_path(File.dirname(__FILE__) + "/../../lib/simple_record")

class MyBaseModel < SimpleRecord::Base

  has_strings :base_string

  has_virtuals :v1

end


text:
<?php

namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Dunglas\ApiBundle\Annotation\Iri;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * The most generic type of item.
 *
 * @see http://schema.org/Thing Documentation on Schema.org
 *
 * @ORM\MappedSuperclass
 * @Iri("http://schema.org/Thing")
 */
abstract class Thing
{
    /**
     * @var string The name of the item.
     *
     * @ORM\Column(nullable=true)
     * @Assert\Type(type="string")
     * @Iri("https://schema.org/name")
     */
    private $name;

    /**
     * Sets name.
     *
     * @param string $name
     *
     * @return $this
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    /**
     * Gets name.
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }
}


text:
package com.netflix.simianarmy.janitor;

import java.util.*;
import com.google.common.collect.Maps;
import com.netflix.servo.annotations.DataSourceType;
import com.netflix.servo.annotations.Monitor;
import com.netflix.servo.annotations.MonitorTags;
import com.netflix.servo.monitor.Monitors;
import com.netflix.servo.tag.BasicTagList;
import com.netflix.servo.tag.TagList;
import com.netflix.simianarmy.*;
import com.netflix.simianarmy.MonkeyRecorder.Event;
import com.netflix.simianarmy.Resource.CleanupState;
import com.netflix.simianarmy.janitor.JanitorMonkey.EventTypes;
import com.netflix.simianarmy.janitor.JanitorMonkey.Type;
import org.apache.commons.lang.Validate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * An abstract implementation of Janitor. It marks resources that the rule engine considers
 * invalid as cleanup candidate and sets the expected termination date. It also removes the
 * cleanup candidate flag from resources that no longer exist or the rule engine no longer
 * considers invalid due to change of conditions. For resources marked as cleanup candidates
 * and the expected termination date is passed, the janitor removes the resources from the
 * cloud.
 */
public abstract class AbstractJanitor implements Janitor {

    /** The Constant LOGGER. */
    private static final Logger LOGGER = LoggerFactory.getLogger(AbstractJanitor.class);

    /** Tags to attach to servo metrics */
    @MonitorTags
    protected TagList tags;

    private final String region;
    /** The region the janitor is running in. */
    public String getRegion() {
        return region;
    }

    /**
     * The rule engine used to decide if a resource should be a cleanup
     * candidate.
     */
    private final JanitorRuleEngine ruleEngine;

    /** The janitor crawler to get resources from the cloud. */
    private final JanitorCrawler crawler;

    /** The resource type that the janitor is responsible for to clean up. **/
    private final ResourceType resourceType;

    /** The janitor resource tracker that is responsible for keeping track of
     * resource status.
     */
    private final JanitorResourceTracker resourceTracker;

    private final Collection<Resource> markedResources = new ArrayList<Resource>();

    private final Collection<Resource> cleanedResources = new ArrayList<Resource>();

    private final Collection<Resource> unmarkedResources = new ArrayList<Resource>();

    private final Collection<Resource> failedToCleanResources = new ArrayList<Resource>();

    private final MonkeyCalendar calendar;

    private final MonkeyConfiguration config;

    /** Flag to indicate whether the Janitor is leashed. */
    private boolean leashed;

    private final MonkeyRecorder recorder;

    /** The number of resources that have been checked on this run. */
    private int checkedResourcesCount;

    /**
     * Sets the flag to indicate if the janitor is leashed.
     *
     * @param isLeashed true if the the janitor is leased, false otherwise.
     */
    protected void setLeashed(boolean isLeashed) {
        this.leashed = isLeashed;
    }

    /**
     * The Interface Context.
     */
    public interface Context {

        /** Region.
         *
         * @return the region
         */
        String region();

        /**
         * Configuration.
         *
         * @return the monkey configuration
         */
        MonkeyConfiguration configuration();

        /**
         * Calendar.
         *
         * @return the monkey calendar
         */
        MonkeyCalendar calendar();

        /**
         * Janitor rule engine.
         * @return the janitor rule engine
         */
        JanitorRuleEngine janitorRuleEngine();

        /**
         * Janitor crawler.
         *
         * @return the chaos crawler
         */
        JanitorCrawler janitorCrawler();

        /**
         * Janitor resource tracker.
         *
         * @return the janitor resource tracker
         */
        JanitorResourceTracker janitorResourceTracker();

        /**
         * Recorder.
         *
         * @return the recorder to record events
         */
        MonkeyRecorder recorder();
    }

    /**
     * Constructor.
     * @param ctx the context
     * @param resourceType the resource type the janitor is taking care
     */
    public AbstractJanitor(Context ctx, ResourceType resourceType) {
        Validate.notNull(ctx);
        Validate.notNull(resourceType);
        this.region = ctx.region();
        Validate.notNull(region);
        this.ruleEngine = ctx.janitorRuleEngine();
        Validate.notNull(ruleEngine);
        this.crawler = ctx.janitorCrawler();
        Validate.notNull(crawler);
        this.resourceTracker = ctx.janitorResourceTracker();
        Validate.notNull(resourceTracker);
        this.calendar = ctx.calendar();
        Validate.notNull(calendar);
        this.config = ctx.configuration();
        Validate.notNull(config);
        // By default the janitor is leashed.
        this.leashed = config.getBoolOrElse("simianarmy.janitor.leashed", true);
        this.resourceType = resourceType;
        Validate.notNull(resourceType);
        // recorder could be null and no events are recorded when it is.
        this.recorder = ctx.recorder();

        // setup servo tags, currently just tag each published metric with the region
        this.tags = BasicTagList.of("simianarmy.janitor.region", ctx.region());

        // register this janitor with servo
        String monitorObjName = String.format("simianarmy.janitor.%s.%s", this.resourceType.name(), this.region);
        Monitors.registerObject(monitorObjName, this);
    }

    @Override
    public ResourceType getResourceType() {
        return resourceType;
    }

    /**
     * Clears this object's internal resource lists in preparation for a new
     * run.
     *
     * This is an optional method as regular Janitor processing will
     * automatically clear resource lists as it runs.
     *
     * This method offers an explicit clear so that the resources will be
     * consistent across the run.  For example, when starting a run after a
     * previous run has finished, cleanedResources will be holding the cleaned
     * resources from the prior run until cleanupResources() is called.  By
     * calling prepareToRun() first, the resource lists will be consistent
     * for the entire run.
     */
    public void prepareToRun() {
        markedResources.clear();
        unmarkedResources.clear();
        checkedResourcesCount = 0;
        cleanedResources.clear();
        failedToCleanResources.clear();
    }

    /**
     * Marks all resources obtained from the crawler as cleanup candidate if
     * the janitor rule engine thinks so.
     */
    @Override
    public void markResources() {
        markedResources.clear();
        unmarkedResources.clear();
        checkedResourcesCount = 0;
        Map<String, Resource> trackedMarkedResources = getTrackedMarkedResources();

        List<Resource> crawledResources = crawler.resources(resourceType);
        LOGGER.info(String.format("Looking for cleanup candidate in %d crawled resources.",
                crawledResources.size()));
        Date now = calendar.now().getTime();
        for (Resource resource : crawledResources) {
        	checkedResourcesCount++;
            Resource trackedResource = trackedMarkedResources.get(resource.getId());
            if (!ruleEngine.isValid(resource)) {
                // If the resource is already marked, ignore it
                if (trackedResource != null) {
                    LOGGER.debug(String.format("Resource %s is already marked.", resource.getId()));
                    continue;
                }
                LOGGER.info(String.format("Marking resource %s of type %s with expected termination time as %s",
                        resource.getId(), resource.getResourceType(), resource.getExpectedTerminationTime()));
                resource.setState(CleanupState.MARKED);
                resource.setMarkTime(now);
                if (!leashed) {
                    resourceTracker.addOrUpdate(resource);
                    if (recorder != null) {
                        Event evt = recorder.newEvent(Type.JANITOR, EventTypes.MARK_RESOURCE, resource, resource.getId());
                        recorder.recordEvent(evt);
                    }
                    postMark(resource);
                } else {
                    LOGGER.info(String.format(
                            "The janitor is leashed, no data change is made for marking the resource %s.",
                            resource.getId()));
                }
                markedResources.add(resource);
            } else if (trackedResource != null) {
                // The resource was marked and now the rule engine does not consider it as a cleanup candidate.
                // So the janitor needs to unmark the resource.
                LOGGER.info(String.format("Unmarking resource %s", resource.getId()));
                resource.setState(CleanupState.UNMARKED);
                if (!leashed) {
                    resourceTracker.addOrUpdate(resource);
                    if (recorder != null) {
                        Event evt = recorder.newEvent(
                                Type.JANITOR, EventTypes.UNMARK_RESOURCE, resource, resource.getId());
                        recorder.recordEvent(evt);
                    }
                } else {
                    LOGGER.info(String.format(
                            "The janitor is leashed, no data change is made for unmarking the resource %s.",
                            resource.getId()));
                }
                unmarkedResources.add(resource);
            }
        }

        // Unmark the resources that are terminated by user so not returned by the crawler.
        unmarkUserTerminatedResources(crawledResources, trackedMarkedResources);
    }

    /**
     * Gets the existing resources that are marked as cleanup candidate. Allowing the subclass to override for e.g.
     * to handle multi-region.
     * @return the map from resource id to marked resource
     */
    protected Map<String, Resource> getTrackedMarkedResources() {
        Map<String, Resource> trackedMarkedResources = Maps.newHashMap();
        for (Resource resource : resourceTracker.getResources(resourceType, Resource.CleanupState.MARKED, region)) {
            trackedMarkedResources.put(resource.getId(), resource);
        }
        return trackedMarkedResources;
    }

    /**
     * Cleans up all cleanup candidates that are OK to remove.
     */
    @Override
    public void cleanupResources() {
        cleanedResources.clear();
        failedToCleanResources.clear();
        Map<String, Resource> trackedMarkedResources = getTrackedMarkedResources();
        LOGGER.info(String.format("Checking %d marked resources for cleanup.", trackedMarkedResources.size()));

        Date now = calendar.now().getTime();
        for (Resource markedResource : trackedMarkedResources.values()) {
            if (canClean(markedResource, now)) {
                LOGGER.info(String.format("Cleaning up resource %s of type %s",
                        markedResource.getId(), markedResource.getResourceType().name()));
                if (!leashed) {
                    try {
                        cleanup(markedResource);
                        markedResource.setActualTerminationTime(now);
                        markedResource.setState(Resource.CleanupState.JANITOR_TERMINATED);
                        resourceTracker.addOrUpdate(markedResource);
                        if (recorder != null) {
                            Event evt = recorder.newEvent(Type.JANITOR, EventTypes.CLEANUP_RESOURCE, markedResource,
                                    markedResource.getId());
                            recorder.recordEvent(evt);
                        }
                    } catch (Exception e) {
                        LOGGER.error(String.format("Failed to clean up the resource %s of type %s.",
                                markedResource.getId(), markedResource.getResourceType().name()), e);
                        failedToCleanResources.add(markedResource);
                        continue;
                    }
                    postCleanup(markedResource);
                } else {
                    LOGGER.info(String.format(
                            "The janitor is leashed, no data change is made for cleaning up the resource %s.",
                            markedResource.getId()));
                }
                cleanedResources.add(markedResource);
            }
        }
    }

    /** Determines if the input resource can be cleaned. The Janitor calls this method
     * before cleaning up a resource and only cleans the resource when the method returns
     * true. A resource is considered to be OK to clean if
     * 1) it is marked as cleanup candidates
     * 2) the expected termination time is already passed
     * 3) the owner has already been notified about the cleanup
     * 4) the resource is not opted out of Janitor monkey
     * The method can be overridden in subclasses.
     * @param resource the resource the Janitor considers to clean
     * @param now the time that represents the current time
     * @return true if the resource is OK to clean, false otherwise
     */
    protected boolean canClean(Resource resource, Date now) {
        return resource.getState() == Resource.CleanupState.MARKED
                && !resource.isOptOutOfJanitor()
                && resource.getExpectedTerminationTime() != null
                && resource.getExpectedTerminationTime().before(now)
                && resource.getNotificationTime() != null
                && resource.getNotificationTime().before(now);
    }

    /**
     * Implements required operations after a resource is marked.
     * @param resource The resource that is marked
     */
    protected abstract void postMark(Resource resource);

    /**
     * Cleans a resource up, e.g. deleting the resource from the cloud.
     * @param resource The resource that is cleaned up.
     */
    protected abstract void cleanup(Resource resource);

    /**
     * Implements required operations after a resource is cleaned.
     * @param resource The resource that is cleaned up.
     */
    protected abstract void postCleanup(Resource resource);

    /** gets the resources marked in the last run of the Janitor. */
    public Collection<Resource> getMarkedResources() {
        return Collections.unmodifiableCollection(markedResources);
    }

    /** gets the resources unmarked in the last run of the Janitor. */
    public Collection<Resource> getUnmarkedResources() {
        return Collections.unmodifiableCollection(unmarkedResources);
    }

    /** gets the resources cleaned in the last run of the Janitor. */
    public Collection<Resource> getCleanedResources() {
        return Collections.unmodifiableCollection(cleanedResources);
    }

    /** gets the resources that failed to be cleaned in the last run of the Janitor. */
    public Collection<Resource> getFailedToCleanResources() {
        return Collections.unmodifiableCollection(failedToCleanResources);
    }

    private void unmarkUserTerminatedResources(
            List<Resource> crawledResources, Map<String, Resource> trackedMarkedResources) {
        Set<String> crawledResourceIds = new HashSet<String>();
        for (Resource crawledResource : crawledResources) {
            crawledResourceIds.add(crawledResource.getId());
        }
        for (Resource markedResource : trackedMarkedResources.values()) {
            if (!crawledResourceIds.contains(markedResource.getId())) {
                // The resource does not exist anymore.
                LOGGER.info(String.format(
                        "Resource %s is not returned by the crawler. It should already be terminated.",
                        markedResource.getId()));
                if (!leashed) {
                    markedResource.setState(Resource.CleanupState.USER_TERMINATED);
                    resourceTracker.addOrUpdate(markedResource);
                } else {
                    LOGGER.info(String.format(
                            "The janitor is leashed, no data change is made for unmarking "
                                    + "the user terminated resource %s.",
                                    markedResource.getId()));
                }
                unmarkedResources.add(markedResource);
            }
        }
    }

    @Monitor(name="cleanedResourcesCount", type=DataSourceType.GAUGE)
    public int getResourcesCleanedCount() {
      return cleanedResources.size();
    }

    @Monitor(name="markedResourcesCount", type=DataSourceType.GAUGE)
    public int getMarkedResourcesCount() {
      return markedResources.size();
    }

    @Monitor(name="failedToCleanResourcesCount", type=DataSourceType.GAUGE)
    public int getFailedToCleanResourcesCount() {
      return failedToCleanResources.size();
    }

    @Monitor(name="unmarkedResourcesCount", type=DataSourceType.GAUGE)
    public int getUnmarkedResourcesCount() {
      return unmarkedResources.size();
    }

    @Monitor(name="checkedResourcesCount", type=DataSourceType.GAUGE)
    public int getCheckedResourcesCount() {
      return checkedResourcesCount;
    }

}