text:
<?xml version="1.0" encoding="UTF-8"?>
<?relations relSet="Martin1992" lexURL="jar:file:/home/lisa/Arbeit/Conano-Distrib/conano.jar!/de/uni_potsdam/ling/coli/resources/ConnectorLexicon.xml"?>
<discourse>
   Steilpass Wunder gibt es immer wieder !
      <unit type="ext" id="2">
         <unit type="ext" id="1">
            Erst spielen die Dallgower Gemeindevertreter so statisch und verzagt wie die deutsche Abwehrreihe der Fußballkicker .
         </unit>
      </unit>
   <unit type="ext" id="4">
      <unit type="int" id="2">
         <unit type="int" id="1">
            <connective id="1" relation="addition">Und</connective>
            <connective id="2" relation="successive">dann</connective>
            kommt aus der Tiefe solch ein fulminanter Steilpass , von dem man hofft , dass die Seeburger oder Groß-Glienicker Mitspieler ihn aufnehmen können .
         </unit>
      </unit>
   </unit>
   <unit type="int" id="4">
      <unit type="ext" id="5">
         Ein Befreiungsschlag ist es
         <connective id="4" relation="concession">allerdings</connective>
         nicht ,
      </unit>
      <unit type="int" id="5">
         <connective id="5" relation="consequence">weil</connective>
         es vorerst keine Gefahr fürs Dallgower Tor gab .
      </unit>
   </unit>
   <unit type="ext" id="6">
      Die Seeburger und einige Groß-Glienicker haben
      <unit type="ext" id="3">
         den Ball erst zurückgespielt
      </unit>
   </unit>
   <unit type="int" id="6">
      <unit type="int" id="3">
         <connective id="6" relation="addition">und</connective>
         <connective id="3" relation="successive">dann</connective>
         um so drängender wieder gefordert .
      </unit>
   </unit>
   Nun sollen sie zeigen , wie sie die Chance verwerten .
   <unit type="ext" id="7">
      Eine Diskussion , wo künftig die Trainerkabine stehen soll , wäre in der jetzigen Spielsituation verheerend .
   </unit>
   <unit type="int" id="7">
      <connective id="7" relation="addition">Und</connective>
      eine Parallele zu den deutschen Grotten-Kickern gibt es immer noch .
   </unit>
   <unit type="int" id="8">
      <connective id="8" relation="concession">Auch</connective>
      <connective id="8" relation="concession">wenn</connective>
      die Spieler aus den verschiedenen Vereinen zusammengewürfelt sind ,
   </unit>
   <unit type="ext" id="12">
   <unit type="ext" id="8">sie müssen sich daran gewöhnen , dass sie nun in einer Mannschaft " Döberitzer Heide " spielen .</unit></unit>
<unit type="int" id="12">
   <connective id="12" relation="addition">Und</connective> das heißt gemeinsam und nicht gegeneinander .
</unit>
   <unit type="ext" id="11">Ermahnungen von der Seitenlinie , miteinander fair umzugehen und sich nicht beim kleinsten Schubser gegenseitig zu zerfleischen , sind normalerweise überflüssig .</unit>
   <unit type="int" id="11">
      Vorerst
      <connective id="11" relation="concession">allerdings</connective>
      hilfreich .
   </unit>
</discourse>


text:
package ws.wamp.jawampa.connectionStates;

import ws.wamp.jawampa.WampClient.Status;

public interface InternalConnectionState {
    public void open();
    public void close();
    public void connectionEstablished();
    public void connectionFailed();
    public void handshakeComplete();
    public void handshakeFailed();
    public void goodbyeReceived();
    public void connectionTerminated();
    public Status getExternalConnectionStatus();
}

redpajama_set_name: RedPajamaGithub


text:
<?php
namespace Kahlan\Spec\Suite\Plugin;

use Exception;
use DateTime;
use Kahlan\Jit\ClassLoader;
use Kahlan\Plugin\Monkey;
use Kahlan\Jit\Patcher\Monkey as MonkeyPatcher;

use Kahlan\Spec\Fixture\Plugin\Monkey\Mon;

function mytime()
{
    return 245026800;
}

function myrand($min, $max)
{
    return 101;
}

describe("Monkey", function () {

    beforeAll(function () {
        $cachePath = rtrim(sys_get_temp_dir(), DS) . DS . 'kahlan';
        $include = ['Kahlan\Spec\\'];
        $this->loader = new ClassLoader();
        $this->loader->patch(compact('include', 'cachePath'));
        $this->loader->patchers()->add('monkey', new MonkeyPatcher());
        $this->loader->addPsr4('Kahlan\\', 'src');
        $this->loader->addPsr4('Kahlan\Spec\\', 'spec');
        $this->loader->register(true);
    });

    afterAll(function () {
        $this->loader->unregister();
    });

    it("patches a core function", function () {

        $mon = new Mon();
        Monkey::patch('time', 'Kahlan\Spec\Suite\Plugin\mytime');
        expect($mon->time())->toBe(245026800);

    });

    describe("::patch()", function () {

        it("patches a core function with a closure", function () {

            $mon = new Mon();
            Monkey::patch('time', function () {
                return 123;
            });
            expect($mon->time())->toBe(123);

        });

        it("patches a core class", function () {

            $mon = new Mon();
            Monkey::patch('DateTime', 'Kahlan\Spec\Mock\Plugin\Monkey\MyDateTime');
            expect($mon->datetime()->getTimestamp())->toBe(245026800);

        });

        it("patches a core class using substitutes", function () {

            $mon = new Mon();
            $patch = Monkey::patch('DateTime');
            $patch->toBe(new DateTime('@123'), new DateTime('@456'));
            expect($mon->datetime()->getTimestamp())->toBe(123);
            expect($mon->datetime()->getTimestamp())->toBe(456);

        });

        it("patches a function", function () {

            $mon = new Mon();
            Monkey::patch('Kahlan\Spec\Fixture\Plugin\Monkey\rand', 'Kahlan\Spec\Suite\Plugin\myrand');
            expect($mon->rand(0, 100))->toBe(101);

        });

        it("patches a class", function () {

            $mon = new Mon();
            Monkey::patch('Kahlan\Util\Text', 'Kahlan\Spec\Mock\Plugin\Monkey\MyString');
            expect($mon->dump((object)'hello'))->toBe('myhashvalue');

        });

        it("can unpatch a monkey patch", function () {

            $mon = new Mon();
            Monkey::patch('Kahlan\Spec\Fixture\Plugin\Monkey\rand', 'Kahlan\Spec\Suite\Plugin\myrand');
            expect($mon->rand(0, 100))->toBe(101);

            Monkey::reset('Kahlan\Spec\Fixture\Plugin\Monkey\rand');
            expect($mon->rand(0, 100))->toBe(50);

        });

        it("throws an exception with trying to patch an unsupported functions or core langage statements", function () {

            $closure = function () {
                Monkey::patch('func_get_args', function () {
                    return [];
                });
            };

            expect($closure)->toThrow(new Exception('Monkey patching `func_get_args()` is not supported by Kahlan.'));
        });

    });

});


text:
// MainDlg.cpp : implementation of the CMainDlg class
//
/////////////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "resource.h"

#include "MainDlg.h"

#include <mmdeviceapi.h>
#include <endpointvolume.h>

BOOL CMainDlg::PreTranslateMessage(MSG* pMsg)
{
  return CWindow::IsDialogMessage(pMsg);
}

BOOL CMainDlg::OnIdle()
{
  UIUpdateChildWindows();
  return FALSE;
}

LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
  // center the dialog on the screen
  CenterWindow();

  // set icons
  HICON hIcon = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON));
  SetIcon(hIcon, TRUE);
  HICON hIconSmall = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
  SetIcon(hIconSmall, FALSE);

  // register object for message filtering and idle updates
  CMessageLoop* pLoop = _Module.GetMessageLoop();
  ATLASSERT(pLoop != NULL);
  pLoop->AddMessageFilter(this);
  pLoop->AddIdleHandler(this);

  UIAddChildWindowContainer(m_hWnd);

  if (!mixer_.Init(m_hWnd)) CloseDialog(mixer_.GetLastError());

  sender_.Initialize();

  if (receiver_.Initialize())
  {
    receiver_.Listen(m_hWnd);
  }

  smallIcon_.Attach(hIconSmall);
  InstallIcon(_T("mixer-server"), smallIcon_, IDR_SYSTRAYMENU);

  return TRUE;
}

LRESULT CMainDlg::OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
  // unregister message filtering and idle updates
  CMessageLoop* pLoop = _Module.GetMessageLoop();
  ATLASSERT(pLoop != NULL);
  pLoop->RemoveMessageFilter(this);
  pLoop->RemoveIdleHandler(this);

  return 0;
}

LRESULT CMainDlg::OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
  CloseDialog(wID);
  return 0;
}

void CMainDlg::CloseDialog(int nVal)
{
  SendServerShutdown();
  DestroyWindow();
  ::PostQuitMessage(nVal);
}

LRESULT CMainDlg::OnWindowPosChanging(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)
{
  bHandled = FALSE;
  WINDOWPOS* pWinPos = reinterpret_cast<WINDOWPOS*>(lParam);
  pWinPos->flags &= ~SWP_SHOWWINDOW;
  return 0;
}

LRESULT CMainDlg::OnMessageReceived(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
  std::unique_ptr<Message> pMsg(reinterpret_cast<Message*>(wParam));

  switch (pMsg->GetType())
  {
  case Message::Discovery:
    SendDiscoveryMessage();
    SendVolumeToClient();
    SendMuteToClient();
    break;

  case Message::Volume:
    {
      int payloadSize = pMsg->GetPayloadSize();
      DWORD mapped = 0;
      for (int i = 0; i < payloadSize; ++i)
      {
        mapped |= ((int)(pMsg->GetPayload()[i]) & 0xff) << (((payloadSize - i) - 1) * 8);
      }
      float volume = (float)mapped / 65536;
      // This fixes the slider bouncing around on the client side
      //
      suppressFeedback_ = true;
      SetTimer(FEEDBACK_TIMER, FEEDBACK_TIMEOUT);
      mixer_.SetVolume(volume);
    }
    break;

  case Message::Mute:
    mixer_.SetMute(pMsg->GetPayload()[0] == 1);
    break;
  }

  return 0;
}

void CMainDlg::SendDiscoveryMessage()
{
  char name[Message::MAX_PAYLOAD];

  if (gethostname(name, Message::MAX_PAYLOAD) != SOCKET_ERROR)
  {
    Message msg(Message::Discovery, (unsigned char)strlen(name), name);
    sender_.Send(msg);
  }
}

void CMainDlg::SendVolumeToClient()
{
  if (!suppressFeedback_)
  {
    float volume = 0.0;
    if (mixer_.GetVolume(volume))
    {
      DWORD converted = (DWORD)(volume * 65536.0);
      char buffer[4];
      buffer[0] = static_cast<char>(converted >> 24 & 0xff);
      buffer[1] = static_cast<char>(converted >> 16 & 0xff);
      buffer[2] = static_cast<char>(converted >> 8 & 0xff);
      buffer[3] = static_cast<char>(converted & 0xff);
      Message msg(Message::Volume, 4, buffer);
      sender_.Send(msg);
    }
  }
}

void CMainDlg::SendMuteToClient()
{
  bool mute = false;
  if (mixer_.GetMute(mute))
  {
    char buffer[1];
    buffer[0] = (mute) ? 1 : 0;
    Message msg(Message::Mute, 1, buffer);
    sender_.Send(msg);
  }
}

void CMainDlg::SendServerShutdown()
{
  Message msg(Message::ServerShutdown);
  sender_.Send(msg);
}

LRESULT CMainDlg::OnTimer(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
  if (wParam == FEEDBACK_TIMER)
  {
    KillTimer(FEEDBACK_TIMER);
    suppressFeedback_ = false;
    SendVolumeToClient();
  }
  return 0;
}

LRESULT CMainDlg::OnTaskbarCreated(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
  InstallIcon(_T("mixer-server"), smallIcon_, IDR_SYSTRAYMENU);
  return 0;
}

LRESULT CMainDlg::OnMixerChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
  SendVolumeToClient();
  SendMuteToClient();
  return 0;
}


text:
<?php
/*
 * This file is part of ThraceFormBundle
 *
 * (c) Nikolay Georgiev <symfonist@gmail.com>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */
namespace Thrace\FormBundle\Form\Type;

use Symfony\Component\Form\FormView;

use Symfony\Component\OptionsResolver\Options;

use Symfony\Component\OptionsResolver\OptionsResolverInterface;

use Symfony\Component\Form\FormBuilderInterface;

use Symfony\Component\Form\FormInterface;

use Symfony\Component\Form\AbstractType;

/**
 * This class creates jquery slider range element
 *
 * @author Nikolay Georgiev <symfonist@gmail.com>
 * @since 1.0
 */
class SliderRangeType extends AbstractType
{

    /**
     * (non-PHPdoc)
     * @see Symfony\Component\Form.AbstractType::buildForm()
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add($options['first_name'], 'hidden')
            ->add($options['second_name'], 'hidden')
        ;
    }

    /**
     * (non-PHPdoc)
     * @see Symfony\Component\Form.AbstractType::buildView()
     */
    public function buildView(FormView $view, FormInterface $form, array $options)
    {
        $view->vars['configs'] = $options['configs'];
    }

    /**
     * (non-PHPdoc)
     * @see Symfony\Component\Form.AbstractType::setDefaultOptions()
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $defaults = array(
            'tpl' => 'slider.value.min: __value_1__ slider.value.max: __value_2__',
            'min' => 0,
            'max' => 100,
            'orientation' => 'horizontal',
            'width' => '300px',
            'height' => '300px',
       );

        $resolver->setDefaults(array(
            'first_name' => 'first_slider',
            'second_name' => 'second_slider',
            'translation_domain' => 'ThraceFormBundle',
            'configs' => $defaults,
        ));

        $resolver->setNormalizers(array(
            'configs' => function (Options $options, $value) use ($defaults) {
                $value = array_replace_recursive($defaults, $value);

                if($value['orientation'] == 'horizontal'){
                    unset($value['height']);
                } else {
                    unset($value['width']);
                }

                $value['first_name'] = $options->get('first_name');
                $value['second_name'] = $options->get('second_name');
                $value['range'] = true;

                return $value;
            }
        ));
    }

    /**
     * (non-PHPdoc)
     * @see Symfony\Component\Form.FormTypeInterface::getName()
     */
    public function getName()
    {
        return 'thrace_slider_range';
    }
}


text:
import React, {Component, PropTypes as types} from 'react';
import classnames from 'classnames';
import pure from 'pure-render-decorator';

@pure
class Headline extends Component {
	displayName = 'Headline';

	static propTypes = {
		children: types.node.isRequired,
		order: types.oneOf([1, 2, 3, 4, 5, 6]).isRequired,
		display: types.oneOf([1, 2, 3, 4, 5, 6]),
		className: types.string
	};

	static defaultProps = {
		children: 'Headline',
		order: 1
	};

	render() {
		const TagName = `h${this.props.order}`;
		const className = classnames('h', `h${this.props.display || this.props.order}`, this.props.className);

		return (
			<TagName className={className}>
				{this.props.children}
			</TagName>
		);
	}
}

export default Headline;


text:
<!doctype html>

		<meta charset="UTF-8">
		<link rel="stylesheet" href="../style.css"/>
		<link rel="stylesheet" href="../reset.css"/>
		<link href='http://fonts.googleapis.com/css?family=Raleway:300,400,600,700' rel='stylesheet' type='text/css'>
			<link rel="stylesheet" href="../font-awesome/css/font-awesome.min.css">
			<meta name="viewport" content="width=device-width, initial-scale=1">
			<title>Allison Reilly - DevBootcamp</title>

					allisonreilly

Home

About

Blog

ProFolio

>>

Week One Technical Blog

Facebook

I consider facebook to be one of my favorite sites because I use it often. Its a form of amusement for me rather than a social use. The first thing my eye is drawn to is my notifications, because they are in red. Then it would be the posts. Facebook is simple, somewhat cluttered, and rather easy to navigate and browse. After being on the site for awhile, it can get boring, unless there are new posts that entertain me. This site is constantly advertising.

Nettus

I enjoy nettus because it has great tutorials and all the information you need when it comes to coding, design, ect. I have the premium membership which has helped me learn a lot in terms of coding. The site is basic. There is the main site, then there are sub sites (web design, photoshop ect), and the premium site. It is pretty easy to navigate, all you have to do is find the sub site, then the navigation breaks down what you need into categories. There is a lot of information and blog posts so I usually just do a search within the site to find what I want. The first thing I see when I go to the site is the navigation. There are advertisements as well. I don't tend to get too bored, I use the site for what I need, but if I am browsing, there is so much information that I don't think it could possibly get old. The site is simple, spacious, and to the point.

Netflix

I enjoy netflix because I like to watch movies and TV shows. It had fast loading times and no advertisements. The first thing my eye is drawn to are the suggested popular movies. The site is somewhat easy to navigate, they cut the navigation down to be the most basic its been, which I don't like as much. The site is simple, but the design layout is very visually appealing. You really can't get bored on this website, there are tons of tv shows and movies.

					Please enable JavaScript to view the comments powered by Disqus.
					comments powered by Disqus

© allison reilly


text:
package com.atanarro.contentprovidersample;

import android.content.ContentProvider;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
import android.content.UriMatcher;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteQueryBuilder;
import android.net.Uri;
import android.text.TextUtils;
import android.util.Log;

/**
 * Class that extends ContentProvider to manage a collection of songs
 *
 * @author atanarro
 *
 */
public class SongsProvider extends ContentProvider {
	public static final String PROVIDER_NAME = "net.atanarro.provider.Songs";

	public static final Uri CONTENT_URI = Uri.parse("content://"
			+ PROVIDER_NAME + "/songs");

	private static final int SONGS = 1;
	private static final int SONG_ID = 2;

	private static final UriMatcher uriMatcher;
	static {
		uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
		uriMatcher.addURI(PROVIDER_NAME, "songs", SONGS);
		uriMatcher.addURI(PROVIDER_NAME, "songs/#", SONG_ID);
	}

	// database stuff
	private SQLiteDatabase songsDB;

	public static final String _ID = "_id";
	public static final String TITLE = "title";
	public static final String AUTHOR = "author";

	private static final String DATABASE_NAME = "Songs";
	private static final String DATABASE_TABLE = "titles";
	private static final int DATABASE_VERSION = 1;
	private static final String DATABASE_CREATE = "create table "
			+ DATABASE_TABLE + " (" + _ID
			+ " integer primary key autoincrement, " + TITLE
			+ " text not null, " + AUTHOR + " text not null);";

	private static class DatabaseHelper extends SQLiteOpenHelper {
		DatabaseHelper(Context context) {
			super(context, DATABASE_NAME, null, DATABASE_VERSION);
		}

		@Override
		public void onCreate(SQLiteDatabase db) {
			db.execSQL(DATABASE_CREATE);
		}

		@Override
		public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
			Log.w("Content provider database",
					"Upgrading database from version " + oldVersion + " to "
							+ newVersion + ", which will destroy all old data");
			db.execSQL("DROP TABLE IF EXISTS " + DATABASE_TABLE);
			onCreate(db);
		}
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see android.content.ContentProvider#getType(android.net.Uri)
	 */
	@Override
	public String getType(Uri uri) {
		switch (uriMatcher.match(uri)) {
		// get all songs
		case SONGS:
			return "vnd.android.cursor.dir/vnd.atanarro.songs";
			// get a particular song
		case SONG_ID:
			return "vnd.android.cursor.item/vnd.atanarro.songs";
		default:
			throw new IllegalArgumentException("Unsupported URI: " + uri);
		}
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see android.content.ContentProvider#onCreate()
	 */
	@Override
	public boolean onCreate() {
		Context context = getContext();
		DatabaseHelper dbHelper = new DatabaseHelper(context);
		songsDB = dbHelper.getWritableDatabase();
		return (songsDB == null) ? false : true;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see android.content.ContentProvider#query(android.net.Uri,
	 * java.lang.String[], java.lang.String, java.lang.String[],
	 * java.lang.String)
	 */
	@Override
	public Cursor query(Uri uri, String[] projection, String selection,
			String[] selectionArgs, String sortOrder) {
		SQLiteQueryBuilder sqlBuilder = new SQLiteQueryBuilder();
		sqlBuilder.setTables(DATABASE_TABLE);

		if (uriMatcher.match(uri) == SONG_ID)
			// if getting a particular song
			sqlBuilder.appendWhere(_ID + " = " + uri.getPathSegments().get(1));

		if (sortOrder == null || sortOrder == "")
			sortOrder = TITLE;

		Cursor c = sqlBuilder.query(songsDB, projection, selection,
				selectionArgs, null, null, sortOrder);

		// register to watch a content URI for changes
		c.setNotificationUri(getContext().getContentResolver(), uri);
		return c;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see android.content.ContentProvider#insert(android.net.Uri,
	 * android.content.ContentValues)
	 */
	@Override
	public Uri insert(Uri uri, ContentValues values) {
		// add a new song
		long rowID = songsDB.insert(DATABASE_TABLE, "", values);

		// if added successfully
		if (rowID > 0) {
			Uri _uri = ContentUris.withAppendedId(CONTENT_URI, rowID);
			getContext().getContentResolver().notifyChange(_uri, null);
			return _uri;
		}
		throw new SQLException("Failed to insert row into " + uri);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see android.content.ContentProvider#delete(android.net.Uri,
	 * java.lang.String, java.lang.String[])
	 */
	@Override
	public int delete(Uri uri, String selection, String[] selectionArgs) {
		int count = 0;
		switch (uriMatcher.match(uri)) {
		case SONGS:
			count = songsDB.delete(DATABASE_TABLE, selection, selectionArgs);
			break;
		case SONG_ID:
			String id = uri.getPathSegments().get(1);
			count = songsDB.delete(DATABASE_TABLE, _ID
					+ " = "
					+ id
					+ (!TextUtils.isEmpty(selection) ? " AND (" + selection
							+ ')' : ""), selectionArgs);
			break;
		default:
			throw new IllegalArgumentException("Unknown URI " + uri);
		}
		getContext().getContentResolver().notifyChange(uri, null);
		return count;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see android.content.ContentProvider#update(android.net.Uri,
	 * android.content.ContentValues, java.lang.String, java.lang.String[])
	 */
	@Override
	public int update(Uri uri, ContentValues values, String selection,
			String[] selectionArgs) {
		int count = 0;
		switch (uriMatcher.match(uri)) {
		case SONGS:
			count = songsDB.update(DATABASE_TABLE, values, selection,
					selectionArgs);
			break;
		case SONG_ID:
			count = songsDB.update(DATABASE_TABLE, values, _ID
					+ " = "
					+ uri.getPathSegments().get(1)
					+ (!TextUtils.isEmpty(selection) ? " AND (" + selection
							+ ')' : ""), selectionArgs);
			break;
		default:
			throw new IllegalArgumentException("Unknown URI " + uri);
		}
		getContext().getContentResolver().notifyChange(uri, null);
		return count;
	}

}


text:
package ru.linker.whattodo.Model;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Locale;

import ru.linker.whattodo.ActionListener;

/**
 * Created by NotLebedev on 2/5/17.
 * Licensed under Attribution-NonCommercial 3.0 Unported
 */

public class TaskStorageModel {

    //Singleton:
    private static TaskStorageModel taskStorageModel = null;
    //List views listening for added/deleted/modifyed tasks
    private ArrayList<Task> highPriority; //Over 80 priority
    private ArrayList<Task> midPriority; //51-80 priority
    private ArrayList<Task> lowPriority; //less than 51
    private ArrayList<ActionListener> highPriorityListeners;
    private ArrayList<ActionListener> midPriorityListeners;
    private ArrayList<ActionListener> lowPriorityListeners;
    //Database stuff
    private TaskDbHelper mDbHelper;

    private TaskStorageModel(Context context) {

        highPriority = new ArrayList<>();
        midPriority = new ArrayList<>();
        lowPriority = new ArrayList<>();

        highPriorityListeners = new ArrayList<>();
        midPriorityListeners = new ArrayList<>();
        lowPriorityListeners = new ArrayList<>();

        mDbHelper = null;
        //TaskStorageModel.context = context;
        mDbHelper = new TaskDbHelper(context);

    }

    /*public static TaskStorageModel getInstance() throws NoContextException {

        if (context == null) {

            throw new NoContextException();

        } else if (taskStorageModel == null) {

            taskStorageModel = new TaskStorageModel(TaskStorageModel.context);

        }

        return taskStorageModel;

    }*/

    public static TaskStorageModel getInstance(Context context) {

        if (taskStorageModel == null) {

            taskStorageModel = new TaskStorageModel(context);

        }

        return taskStorageModel;

    }
    //Singleton

    //TODO: refresh this add policy
    //This all was created to prevent duplicating tasks in db on start sync
    private void add(Task task) {

        Comparator<Task> comparator = new Comparator<Task>() {
            @Override
            public int compare(Task o1, Task o2) {

                if (o1.getPriority() < o2.getPriority()) {
                    return 1;
                } else {
                    return -1;
                }

            }
        };

        if (task.getPriority() > 80) {

            highPriority.add(task);

            Collections.sort(highPriority, comparator);

        } else if (task.getPriority() > 50) {

            midPriority.add(task);

            Collections.sort(midPriority, comparator);

        } else {

            lowPriority.add(task);

            Collections.sort(lowPriority, comparator);

        }

    }

    private void addSync(Task task) {
        add(task);
        syncTableAddTask(task);
    }

    private void delete(Task task) {

        Comparator<Task> comparator = new Comparator<Task>() {
            @Override
            public int compare(Task o1, Task o2) {

                if (o1.getPriority() < o2.getPriority()) {
                    return 1;
                } else {
                    return -1;
                }

            }
        };

        if (task.getPriority() > 80) {

            highPriority.remove(task);

            Collections.sort(highPriority, comparator);

        } else if (task.getPriority() > 50) {

            midPriority.remove(task);

            Collections.sort(midPriority, comparator);

        } else {

            lowPriority.remove(task);

            Collections.sort(lowPriority, comparator);

        }

    }

    private void deleteSync(Task task) {

        delete(task);
        syncTableDeleteTask(task);

    }

    //Sends actionPerformed to all listeners
    public void syncListeners() {
        for (ActionListener highPriorityListener : highPriorityListeners) {
            highPriorityListener.actionPerformed(0);
        }
        for (ActionListener midPriorityListener : midPriorityListeners) {
            midPriorityListener.actionPerformed(1);
        }
        for (ActionListener lowPriorityListener : lowPriorityListeners) {
            lowPriorityListener.actionPerformed(2);
        }
    }

    public void addTask(Task task) {

        addSync(task);
        syncListeners();

    }

    public void addTasks(ArrayList<Task> tasks) {

        for (Task task : tasks) {
            addSync(task);
        }

        syncListeners();

    }

    public void deleteTask(Task task) {

        deleteSync(task);
        syncListeners();

    }

    public void updateTask(Task oldTask, Task newTask) {

        delete(oldTask);
        add(newTask);
        syncTableUpdateTask(oldTask, newTask);
        syncListeners();

    }

    public void addHighPriorityListener(ActionListener listener) {
        highPriorityListeners.add(listener);
    }

    public void addMidPriorityListener(ActionListener listener) {
        midPriorityListeners.add(listener);
    }

    public void addLowPriorityListener(ActionListener listener) {
        lowPriorityListeners.add(listener);
    }

    public void removeListener(ActionListener listener) {
        highPriorityListeners.remove(listener);
        midPriorityListeners.remove(listener);
        lowPriorityListeners.remove(listener);
    }

    public ArrayList<Task> getList(Integer params) {

        if (params.compareTo(0) == 0)
            return highPriority;
        else if (params.compareTo(1) == 0)
            return midPriority;
        else if (params.compareTo(2) == 0)
            return lowPriority;
        else
            return null;

    }

    public void syncModel() {

        SQLiteDatabase db = mDbHelper.getReadableDatabase();

        String[] projection = TaskDbHelper.TaskTable.projectionAll;

        Cursor cursor = db.query(TaskDbHelper.TaskTable.TABLE_NAME, projection, null, null, null, null, null);

        if (cursor.moveToFirst()) {

            do {

                Task task = null;

                if (cursor.getInt(cursor.getColumnIndexOrThrow(TaskDbHelper.TaskTable.COLUMN_NAME_IS_DATED)) == 0) {
                    task = (new Task(cursor.getString(cursor.getColumnIndexOrThrow(TaskDbHelper.TaskTable.COLUMN_NAME_DESCRIPTION)),
                            cursor.getInt(cursor.getColumnIndexOrThrow(TaskDbHelper.TaskTable.COLUMN_NAME_PRIORITY))));
                } else {
                    try {
                        task = new DatedTask(cursor.getString(cursor.getColumnIndexOrThrow(TaskDbHelper.TaskTable.COLUMN_NAME_DESCRIPTION)),
                                cursor.getInt(cursor.getColumnIndexOrThrow(TaskDbHelper.TaskTable.COLUMN_NAME_PRIORITY)),
                                formCalendar(cursor.getString(cursor.getColumnIndexOrThrow(TaskDbHelper.TaskTable.COLUMN_NAME_DATE))),
                                formCalendar(cursor.getString(cursor.getColumnIndexOrThrow(TaskDbHelper.TaskTable.COLUMN_NAME_DATE_START))));
                    } catch (DateBeforeTodayException e) {
                        e.printStackTrace();
                    }
                }

                add(task);

            } while (cursor.moveToNext());

            syncListeners();

        }

        cursor.close();
        db.close();

    }

    private void syncTableAddTask(Task task) {

        SQLiteDatabase db = mDbHelper.getWritableDatabase();

        ContentValues values = new ContentValues();
        values.put(TaskDbHelper.TaskTable.COLUMN_NAME_IS_DATED, 0);
        values.put(TaskDbHelper.TaskTable.COLUMN_NAME_DESCRIPTION, task.getTaskDescription());
        values.put(TaskDbHelper.TaskTable.COLUMN_NAME_PRIORITY, task.getNonDatedPriority());

        if (task instanceof DatedTask) {
            values.put(TaskDbHelper.TaskTable.COLUMN_NAME_IS_DATED, 1);
            values.put(TaskDbHelper.TaskTable.COLUMN_NAME_DATE, formDatetime(((DatedTask) task).getDateEnd()));
            values.put(TaskDbHelper.TaskTable.COLUMN_NAME_DATE_START, formDatetime(((DatedTask) task).getDateStart()));
        }

        db.insert(TaskDbHelper.TaskTable.TABLE_NAME, null, values);

        db.close();

    }

    private void syncTableDeleteTask(Task task) {

        SQLiteDatabase db = mDbHelper.getWritableDatabase();

        String selection;
        String[] selectionArgs;

        if (task instanceof DatedTask) {

            selection =
                    TaskDbHelper.TaskTable.COLUMN_NAME_DESCRIPTION
                            + " = ? AND " + TaskDbHelper.TaskTable.COLUMN_NAME_PRIORITY
                            + " = ? AND " + TaskDbHelper.TaskTable.COLUMN_NAME_IS_DATED
                            + " = ? AND " + TaskDbHelper.TaskTable.COLUMN_NAME_DATE
                            + " = ? AND " + TaskDbHelper.TaskTable.COLUMN_NAME_DATE_START
                            + " = ?";

            selectionArgs = new String[]{task.getTaskDescription(), task.getNonDatedPriority().toString(),
                    "1", formDatetime(((DatedTask) task).getDateEnd()), formDatetime(((DatedTask) task).getDateStart())};

        } else {

            selection =
                    TaskDbHelper.TaskTable.COLUMN_NAME_DESCRIPTION
                            + " = ? AND " + TaskDbHelper.TaskTable.COLUMN_NAME_PRIORITY +
                            " = ?";

            selectionArgs = new String[]{task.getTaskDescription(), task.getNonDatedPriority().toString()};

        }

        db.delete(TaskDbHelper.TaskTable.TABLE_NAME, selection, selectionArgs);

    }

    private void syncTableUpdateTask(Task oldTask, Task newTask) {

        syncTableDeleteTask(oldTask);

        syncTableAddTask(newTask);

    }

    private String formDatetime(Calendar date) {

        SimpleDateFormat dateFormat = new SimpleDateFormat(
                "yyyy-MM-dd HH:mm:ss", Locale.getDefault());

        return dateFormat.format(date.getTime());

    }

    private Calendar formCalendar(String date) {

        SimpleDateFormat dateFormat = new SimpleDateFormat(
                "yyyy-MM-dd HH:mm:ss", Locale.getDefault());

        java.util.Date dateParsed = null;

        try {
            dateParsed = (java.util.Date) dateFormat.parseObject(date);
        } catch (ParseException e) {
            e.printStackTrace();
        }

        Calendar calendar = Calendar.getInstance();
        calendar.setTime(dateParsed);

        return calendar;

    }

}


text:
/**
 * Publish the plaintext of the help to elastic search...
 */
module.exports = function (config, file , records , callback ) {
  var helpSystemIndex = config.search.index;
  var helpSystemType = config.search.type;
  var async = require('async');
  var elasticsearch = require('elasticsearch');
  var client = new elasticsearch.Client({
      host: config.search.host,
      apiVersion: '6.8'
  });
  console.log("Publish externals for file "+file);
  async.eachSeries(records, function (record, callbackLoop) {
      var id = record.id || (file + ":" + record.href);
      if( record.href ) {
        client.delete({
          index: helpSystemIndex,
          type: helpSystemType,
          id: id,
        }, function (error, response) {
            var bodyContent = {
                title: record.title,
                path: record.href,
                file: file,
                description: record.description
            };
            if( !error ) {
                console.log("Removed external "+id);
            }
            client.create({
              index: helpSystemIndex,
              type: helpSystemType,
              id: id,
              body: bodyContent
            }, function (error) {
                console.log("Created external "+JSON.stringify(bodyContent));
                callbackLoop();
            });
        });
      } else {
        callbackLoop();
      }
  },function() {
      callback(null, { updated: true, reindexed: false, publish: {} });
  });
}


text:
/**
 * Created by kintesh on 17/02/15.
 */

@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 400;
    src: local('Open Sans'), local('OpenSans');
    src: url('../fonts/Open_Sans-Regular.eot');
    src: url('../fonts/Open_Sans-Regular.eot?#iefix') format('embedded-opentype'),
    url('../fonts/Open_Sans-Regular.woff2') format('woff2'),
    url('../fonts/Open_Sans-Regular.woff') format('woff'),
    url('../fonts/Open_Sans-Regular.ttf') format('ttf');
}

@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 700;
    src: local('Open Sans Bold'), local('OpenSans-Bold');
    src: url('../fonts/Open_Sans-Bold.eot');
    src: url('../fonts/Open_Sans-Bold.eot?#iefix') format('embedded-opentype'),
    url('../fonts/Open_Sans-Bold.woff2') format('woff2'),
    url('../fonts/Open_Sans-Bold.woff') format('woff'),
    url('../fonts/Open_Sans-Bold.ttf') format('ttf');
}

@font-face {
    font-family: 'Open Sans';
    font-style: italic;
    font-weight: 400;
    src: local('Open Sans Italic'), local('OpenSans-Italic');
    src: url('../fonts/Open_Sans-Italic.eot');
    src: url('../fonts/Open_Sans-Italic.eot?#iefix') format('embedded-opentype'),
    url('../fonts/Open_Sans-Italic.woff2') format('woff2'),
    url('../fonts/Open_Sans-Italic.woff') format('woff'),
    url('../fonts/Open_Sans-Italic.ttf') format('ttf');
}

* {
    transition: none !important;
}

body {
    font-family: 'Open Sans', sans-serif;
    font-size: 10pt;
    margin: 0;
}

body, .slide {
    background-color: #FFF !important;
    color: #000 !important;
}

.sBar {
    display: none;
}

.sControls {
    display: none;
}

@page {
    margin: 0.6in;
}

.slide {
    border: 1px solid #DDD;
    margin-top: 5px;
    padding: 0 20px;
    position: relative;
    display: inline-block !important;
    opacity: 1 !important;
    transform: none !important;
    z-index: 0 !important;
    height: 480px !important;
    page-break-after: avoid !important;
    width:680px;
}

.title_title {
    text-align: center;
    font-size: 2vh !important;
}

.title_subTitle {
    text-align: center;
    font-size: 1.5vh !important;
}

.title_author {
    text-align: center;
    font-size: 1.2vh !important;
}

.title_date {
    text-align: center;
    font-size: 1.2vh !important;
}

hr {
    border: 1px dashed coral;
}

.controlled_elem {
    visibility: visible !important;
    opacity: 1 !important;
}

table {
    width: 100% !important;
    border-collapse: collapse !important;
    border: 1px solid #98bf21 !important;
}

table td, table th {
    font-size: 1em !important;
    border-right: 1px solid #98bf21 !important;
    padding: 3px 7px 2px 7px !important;
}

table th {
    font-size: 1.1em !important;
    text-align: left !important;
    background-color: #A7C942 !important;
    color: #ffffff !important;
    border-bottom: 1px solid #98BF21 !important;
}

table tr.alt td {
    color: #000000 !important;
    background-color: #EAF2D3 !important;
}

img {
    width: 60%;
    margin-left: auto;
    margin-right: auto;
    display: block;
}


text:
package com.jivesoftware.os.jive.utils.collections.lh;

import java.util.Arrays;

/**
 *
 * @author jonathan.colt
 */
public class LHMapState<V> {

    public static final byte[] NIL = new byte[0];

    private final long capacity;
    private final long nilKey;
    private final long skipKey;
    private final long[] keys;
    private final Object[] values;
    private int count;

    public LHMapState(long capacity, long nilKey, long skipKey) {
        this.count = 0;
        this.capacity = capacity;
        this.nilKey = nilKey;
        this.skipKey = skipKey;

        this.keys = new long[(int) capacity];
        Arrays.fill(keys, nilKey);
        this.values = new Object[(int) capacity];
    }

    public LHMapState<V> allocate(long capacity) {
        return new LHMapState<>(capacity, nilKey, skipKey);
    }

    public long skipped() {
        return skipKey;
    }

    public long nil() {
        return nilKey;
    }

    public long first() {
        return 0;
    }

    public long size() {
        return count;
    }

    public void update(long i, long key, V value) {
        keys[(int) i] = key;
        values[(int) i] = value;
    }

    public void link(long i, long key, V value) {
        keys[(int) i] = key;
        values[(int) i] = value;
        count++;
    }

    public void clear(long i) {
        keys[(int) i] = nilKey;
        values[(int) i] = null;
    }

    public void remove(long i, long key, V value) {
        keys[(int) i] = key;
        values[(int) i] = value;
        count--;
    }

    public long next(long i) {
        return (i >= capacity - 1) ? -1 : i + 1;
    }

    public long capacity() {
        return capacity;
    }

    public long key(long i) {
        return keys[(int) i];
    }

    public V value(long i) {
        return (V) values[(int) i];
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.redhat.samples.switchyard</groupId>
        <artifactId>samples-switchyard-rest-proxy</artifactId>
        <version>2.0</version>
    </parent>

    <artifactId>samples-switchyard-rest-proxy-rest</artifactId>
    <packaging>war</packaging>

    <build>
        <finalName>sample-rest</finalName>
        <plugins>
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-jaxrs</artifactId>
        </dependency>
    </dependencies>

</project>


text:
package com.intellij.execution.services;

import com.intellij.ide.dnd.DnDEvent;
import org.jetbrains.annotations.NotNull;

public interface ServiceViewDnDDescriptor {
  boolean canDrop(@NotNull DnDEvent event, @NotNull Position position);

  void drop(@NotNull DnDEvent event, @NotNull Position position);

  enum Position {
    ABOVE, INTO, BELOW
  }
}


text:
/**
 * @author Anton V. Karnachuk
 */

/**
 * Created on 16.03.2005
 */
package org.apache.harmony.jpda.tests.framework.jdwp;

import java.util.List;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Hashtable;

import org.apache.harmony.jpda.tests.framework.LogWriter;
import org.apache.harmony.jpda.tests.framework.TestOptions;
import org.apache.harmony.jpda.tests.framework.jdwp.exceptions.TimeoutException;

/**
 * This class provides asynchronous sending JDWP commands and receiving JDWP
 * events through established JDWP connection and supports timeout for these
 * operations.
 */
public class PacketDispatcher extends Thread {

    /**
     * Variables below are intended only to help with tests failures
     * investigation. They turn on/off some kinds of trace during
     * tests execution which can clear up details of test failure.
     *
     * commandsNumberForTrace and begCommandIdForTrace define trace
     * of sent JDWP commands and received replies for these commands:
     * - begCommandIdForTrace defines starting command ID for trace
     *   (the first command has ID=1, the second - ID=2 and so on).
     *   if <= 0 then the same as = 1.
     * - commandsNumberForTrace defines number of command for trace.
     *   if <= 0 then commands' trace is off.
     *
     * - eventRequestIDForTrace defines trace of received events
     *   according to request ID value:
     *   if < 0 then this trace is off;
     *   if = 0 then trace is for all received events;
     *   if > 0 then trace is for received events, which are triggered
     *          by this specified request ID value;
     *
     * - eventKindForTrace defines trace of received events
     *   according to this specified kind of event.
     *   if = 0 then this trace is off;
     *   See JDWPConstants.EventKind class for values of
     *   event kinds.
     */
    int begCommandIdForTrace = 1;

    int commandsNumberForTrace = 0;

    int eventRequestIDForTrace = -1;

    byte eventKindForTrace = 0;

    /**
     * Internal class to synchronize jdwp events. When an event is received it
     * is stored in eventQueue. If there are any thread that waits for event it
     * is notified.
     */
    private class EventsSynchronyzer {

        /**
         * List of received events.
         */
        private List<EventPacket> eventQueue;

        /**
         * A default constructor.
         */
        EventsSynchronyzer() {
            // initialize eventQueue
            eventQueue = new ArrayList<EventPacket>();
        }

        /**
         * Notifies thread that the new event has been received.
         *
         * @param eventPacket
         *            instance of EventPacket
         * @throws InterruptedException
         */
        public void notifyThread(EventPacket eventPacket)
                throws InterruptedException {

            // use this object as lock
            synchronized (this) {
                // add the event to eventQueue
                eventQueue.add(eventPacket);

                // notify next waiting thread
                this.notify();
            }
        }

        /**
         * Waits for new event during timeout.
         *
         * @param timeout
         *            wait timeout
         * @return EventPacket
         * @throws InterruptedException
         * @throws IOException
         * @throws TimeoutException
         *             if no event was received
         */
        public EventPacket waitForNextEvent(long timeout)
                throws InterruptedException, IOException {

            // use this object as lock
            synchronized (this) {

                // if there is already received event in eventQueue,
                // then return it
                synchronized (eventQueue) {
                    if (!eventQueue.isEmpty()) {
                        return (EventPacket) eventQueue.remove(0);
                    }

                    // if eventQueue is empty and connection is already closed
                    // reraise the exception
                    if (connectionException != null)
                        throw connectionException;
                }

                // wait for the next event
                this.wait(timeout);

                // We have the following opportunities here -
                // next event was received, exception in main cyrcle or timeout
                // happens
                synchronized (eventQueue) {
                    if (!eventQueue.isEmpty()) {
                        // event received
                        EventPacket event = (EventPacket) eventQueue.remove(0);
                        return event;
                    }

                    if (connectionException != null) {
                        // if eventQueue is empty and connection is already
                        // closed
                        // reraise the exception
                        throw connectionException;
                    }
                }
            }

            // no events were occurred during timeout
            throw new TimeoutException(false);
        }

        /**
         * This method is called when connection is closed. It notifies all the
         * waiting threads.
         */
        public void terminate() {
            synchronized (this) {
                this.notifyAll();
            }
        }
    }

    /**
     * Internal class to synchronize jdwp commands. It sends command packets
     * through connection and returns replies.
     */
    class CommandsSynchronyzer {

        private int commandId;

        private Hashtable<Integer, CommandPacket> commands;

        private Hashtable<Integer, ReplyPacket> replies;

        /**
         * A default constructor.
         */
        CommandsSynchronyzer() {
            commands = new Hashtable<Integer, CommandPacket>();
            replies = new Hashtable<Integer, ReplyPacket>();

            // set first command id to 1
            commandId = 1;
        }

        /**
         * Gets the next new id for a command.
         *
         * @return int
         */
        private synchronized int getNextId() {
            return commandId++;
        }

        /**
         * Notifies thread that reply packet was received.
         *
         * @param replyPacket
         *            instance of ReplyPacket
         * @throws IOException
         * @throws InterruptedException
         */
        public void notifyThread(ReplyPacket replyPacket) throws IOException,
                InterruptedException {

            synchronized (commands) {

                // obtain the current command id
                Integer Id = new Integer(replyPacket.getId());

                // obtain the current command packet by command id
                CommandPacket command = (CommandPacket) commands.remove(Id);
                if (command == null) {
                    // we received reply's id that does not correspond to any
                    // command
                    throw new IOException(
                            "Reply id is corresponded to no command. Id = "
                                    + Id);
                }

                synchronized (command) {
                    // put the reply in replies queue
                    synchronized (replies) {
                        replies.put(new Integer(replyPacket.getId()),
                                replyPacket);
                    }
                    // notify waiting thread
                    command.notifyAll();
                }
            }
        }

        /**
         * Sends command and waits for the reply during timeout.
         *
         * @param command
         *            instance of CommandPacket
         * @param timeout
         *            reply wait timeout
         * @return
         * @throws TimeoutException
         *             if no reply was received
         */
        public ReplyPacket waitForReply(CommandPacket command, long timeout)
                throws InterruptedException, IOException {

            synchronized (command) {

                // if connection is already closed reraise the exception
                if (connectionException != null)
                    throw connectionException;

                // obtain new command id
                Integer Id = new Integer(getNextId());
                command.setId(Id.intValue());

                // add command into commands hashtable
                synchronized (commands) {
                    commands.put(Id, command);

                    // below is trace for sent coomasnds
                    if (commandsNumberForTrace > 0) {
                        int begCommandId = begCommandIdForTrace > 1 ? begCommandIdForTrace
                                : 1;
                        if (Id.intValue() >= begCommandId) {
                            if ((Id.intValue() - begCommandId) < commandsNumberForTrace) {
                                logWriter
                                        .println(">>>>>>>>>> PacketDispatcher: PERFORM command: ID = "
                                                + Id.intValue()
                                                + "; CommandSet = "
                                                + command.getCommandSet()
                                                + "; Command = "
                                                + command.getCommand() + "...");
                            }
                        }
                    }

                    // write this package to connection
                    connection.writePacket(command.toBytesArray());
                }

                // if connection is already closed reraise the exception
                if (connectionException != null)
                    throw connectionException;

                // wait for reply
                command.wait(timeout);

                // receive the reply
                ReplyPacket currentReply = null;
                synchronized (replies) {
                    currentReply = (ReplyPacket) replies.remove(Id);
                }

                // if reply is ok, return it
                if (currentReply != null) {
                    return currentReply;
                }

                // if connection is already closed reraise the exception
                if (connectionException != null)
                    throw connectionException;
            }

            // no event was occurred during timeout
            throw new TimeoutException(false);
        }

        /**
         * Sends command without waiting for the reply and returns id of the
         * sent command.
         *
         * @param command
         *            instance of CommandPacket
         * @return command id
         * @throws IOException
         */
        public int sendCommand(CommandPacket command) throws IOException {

            // if connection is already closed reraise the exception
            if (connectionException != null)
                throw connectionException;

            // obtain new command id
            Integer Id = new Integer(getNextId());
            command.setId(Id.intValue());

            // add command into commands hashtable
            synchronized (commands) {
                commands.put(Id, command);

                // below is trace for sent coomasnds
                if (commandsNumberForTrace > 0) {
                    int begCommandId = begCommandIdForTrace > 1 ? begCommandIdForTrace
                            : 1;
                    if (Id.intValue() >= begCommandId) {
                        if ((Id.intValue() - begCommandId) < commandsNumberForTrace) {
                            logWriter
                                    .println(">>>>>>>>>> PacketDispatcher: PERFORM command: ID = "
                                            + Id.intValue()
                                            + "; CommandSet = "
                                            + command.getCommandSet()
                                            + "; Command = "
                                            + command.getCommand() + "...");
                        }
                    }
                }

                // write this package to connection
                connection.writePacket(command.toBytesArray());
            }

            // if connection is already closed reraise the exception
            if (connectionException != null) {
                throw connectionException;
            }

            return Id.intValue();

        }

        /**
         * Receives the reply during timeout for command with specified command
         * ID.
         *
         * @param commandId
         *            id of previously sent commend
         * @param timeout
         *            receive timeout
         * @return received ReplyPacket
         * @throws TimeoutException
         *             if no reply was received
         */
        public ReplyPacket receiveReply(int commandId, long timeout)
                throws InterruptedException, IOException {

            // if connection is already closed reraise the exception
            if (connectionException != null)
                throw connectionException;

            // receive the reply
            ReplyPacket currentReply = null;
            long endTimeMlsecForWait = System.currentTimeMillis() + timeout;
            synchronized (replies) {
                while (true) {
                    currentReply = (ReplyPacket) replies.remove(new Integer(
                            commandId));
                    // if reply is ok, return it
                    if (currentReply != null) {
                        return currentReply;
                    }
                    // if connection is already closed reraise the exception
                    if (connectionException != null) {
                        throw connectionException;
                    }
                    if (System.currentTimeMillis() >= endTimeMlsecForWait) {
                        break;
                    }
                    replies.wait(100);
                }
            }
            // no expected reply was found during timeout
            throw new TimeoutException(false);
        }

        /**
         * This method is called when connection is closed. It notifies all the
         * waiting threads.
         *
         */
        public void terminate() {

            synchronized (commands) {
                // enumerate all waiting commands
                for (Enumeration en = commands.keys(); en.hasMoreElements();) {
                    CommandPacket command = (CommandPacket) commands.get(en
                            .nextElement());
                    synchronized (command) {
                        // notify the waiting object
                        command.notifyAll();
                    }
                }
            }
        }
    }

    /** Transport which is used to sent and receive packets. */
    private TransportWrapper connection;

    /** Current test run configuration. */
    TestOptions config;

    private CommandsSynchronyzer commandsSynchronyzer;

    private EventsSynchronyzer eventsSynchronyzer;

    private LogWriter logWriter;

    private IOException connectionException;

    /**
     * Creates new PacketDispatcher instance.
     *
     * @param connection
     *            open connection for reading and writing packets
     * @param config
     *            test run options
     * @param logWriter
     *            LogWriter object
     */
    public PacketDispatcher(TransportWrapper connection, TestOptions config,
            LogWriter logWriter) {

        this.connection = connection;
        this.config = config;
        this.logWriter = logWriter;

        commandsSynchronyzer = new CommandsSynchronyzer();
        eventsSynchronyzer = new EventsSynchronyzer();

        // make thread daemon
        setDaemon(true);

        // start the thread
        start();
    }

    /**
     * Reads packets from connection and dispatches them between waiting
     * threads.
     */
    public void run() {

        connectionException = null;

        try {
            // start listening for replies
            while (!isInterrupted()) {

                // read packet from transport
                byte[] packet = connection.readPacket();

                // break cycle if empty packet
                if (packet == null || packet.length == 0)
                    break;

                // check flags
                if (packet.length < Packet.FLAGS_INDEX) {
                    logWriter
                            .println(">>>>>>>>>> PacketDispatcher WARNING: WRONG received packet size = "
                                    + packet.length);
                } else {
                    int flag = packet[Packet.FLAGS_INDEX] & 0xFF;
                    if (flag != 0) {
                        if (flag != Packet.REPLY_PACKET_FLAG) {
                            logWriter
                                    .println(">>>>>>>>>> PacketDispatcher WARNING: WRONG received packet flags = "
                                            + Integer.toHexString(flag));
                        }
                    }
                }

                // check the reply flag
                if (Packet.isReply(packet)) {
                    // new reply
                    ReplyPacket replyPacket = new ReplyPacket(packet);

                    // check for received reply packet length
                    int packetLength = replyPacket.getLength();
                    if (packetLength < Packet.HEADER_SIZE) {
                        logWriter
                                .println(">>>>>>>>>> PacketDispatcher WARNING: WRONG received packet length = "
                                        + packetLength);
                    }

                    // below is trace for received coomasnds
                    if (commandsNumberForTrace > 0) {
                        int replyID = replyPacket.getId();
                        int begCommandId = begCommandIdForTrace > 1 ? begCommandIdForTrace
                                : 1;
                        if (replyID >= begCommandId) {
                            if ((replyID - begCommandId) < commandsNumberForTrace) {
                                logWriter
                                        .println(">>>>>>>>>> PacketDispatcher: Received REPLY ID = "
                                                + replyID);
                            }
                        }
                    }

                    commandsSynchronyzer.notifyThread(replyPacket);
                } else {
                    // new event
                    EventPacket eventPacket = new EventPacket(packet);
                    // below is to check received events for correctness

                    // below is trace for received events
                    ParsedEvent[] parsedEvents = ParsedEvent
                            .parseEventPacket(eventPacket);
                    if ((eventRequestIDForTrace >= 0)
                            || (eventKindForTrace > 0)) {
                        for (int i = 0; i < parsedEvents.length; i++) {
                            boolean trace = false;
                            int eventRequestID = parsedEvents[i].getRequestID();
                            if (eventRequestIDForTrace == 0) {
                                trace = true;
                            } else {
                                if (eventRequestID == eventRequestIDForTrace) {
                                    trace = true;
                                }
                            }
                            byte eventKind = parsedEvents[i].getEventKind();
                            if (eventKind == eventKindForTrace) {
                                trace = true;
                            }
                            if (trace) {
                                logWriter
                                        .println(">>>>>>>>>> PacketDispatcher: Received_EVENT["
                                                + i
                                                + "]: eventRequestID= "
                                                + eventRequestID
                                                + "; eventKind =  "
                                                + eventKind
                                                + "("
                                                + JDWPConstants.EventKind
                                                        .getName(eventKind)
                                                + ")");
                            }
                        }
                    }
                    eventsSynchronyzer.notifyThread(eventPacket);
                }
            }

            // this exception is send for all waiting threads
            connectionException = new TimeoutException(true);
        } catch (IOException e) {
            // connection exception is send for all waiting threads
            connectionException = e;

            // print stack trace
            e.printStackTrace();
        } catch (InterruptedException e) {
            // connection exception is send for all waiting threads
            connectionException = new InterruptedIOException(e.getMessage());
            connectionException.initCause(e);

            // print stack trace
            e.printStackTrace();
        }

        // notify all the waiting threads
        eventsSynchronyzer.terminate();
        commandsSynchronyzer.terminate();
    }

    /**
     * Receives event from event queue if there are any events or waits during
     * timeout for any event occurrence. This method should not be used
     * simultaneously from different threads. If there were no reply during the
     * timeout, TimeoutException is thrown.
     *
     * @param timeout
     *            timeout in milliseconds
     * @return received event packet
     * @throws IOException
     *             is any connection error occurred
     * @throws InterruptedException
     *             if reading packet was interrupted
     * @throws TimeoutException
     *             if timeout exceeded
     */
    public EventPacket receiveEvent(long timeout) throws IOException,
            InterruptedException, TimeoutException {

        return eventsSynchronyzer.waitForNextEvent(timeout);
    }

    /**
     * Sends JDWP command packet and waits for reply packet during default
     * timeout. If there were no reply packet during the timeout,
     * TimeoutException is thrown.
     *
     * @return received reply packet
     * @throws InterruptedException
     *             if reading packet was interrupted
     * @throws IOException
     *             if any connection error occurred
     * @throws TimeoutException
     *             if timeout exceeded
     */
    public ReplyPacket performCommand(CommandPacket command)
            throws InterruptedException, IOException, TimeoutException {

        return performCommand(command, config.getTimeout());
    }

    /**
     * Sends JDWP command packet and waits for reply packet during certain
     * timeout. If there were no reply packet during the timeout,
     * TimeoutException is thrown.
     *
     * @param command
     *            command packet to send
     * @param timeout
     *            timeout in milliseconds
     * @return received reply packet
     * @throws InterruptedException
     *             if packet reading was interrupted
     * @throws IOException
     *             if any connection error occurred
     * @throws TimeoutException
     *             if timeout exceeded
     */
    public ReplyPacket performCommand(CommandPacket command, long timeout)
            throws InterruptedException, IOException, TimeoutException {

        return commandsSynchronyzer.waitForReply(command, timeout);
    }

    /**
     * Sends CommandPacket to debuggee VM without waiting for the reply. This
     * method is intended for special cases when there is need to divide
     * command's performing into two actions: command's sending and receiving
     * reply (e.g. for asynchronous JDWP commands' testing). After this method
     * the 'receiveReply()' method must be used latter for receiving reply for
     * sent command. It is NOT recommended to use this method for usual cases -
     * 'performCommand()' method must be used.
     *
     * @param command
     *            Command packet to be sent
     * @return command ID of sent command
     * @throws IOException
     *             if any connection error occurred
     */
    public int sendCommand(CommandPacket command) throws IOException {
        return commandsSynchronyzer.sendCommand(command);
    }

    /**
     * Waits for reply for command which was sent before by 'sendCommand()'
     * method. Specified timeout is used as time limit for waiting. This method
     * (jointly with 'sendCommand()') is intended for special cases when there
     * is need to divide command's performing into two actions: command's
     * sending and receiving reply (e.g. for asynchronous JDWP commands'
     * testing). It is NOT recommended to use 'sendCommand()- receiveReply()'
     * pair for usual cases - 'performCommand()' method must be used.
     *
     * @param commandId
     *            Command ID of sent before command, reply from which is
     *            expected to be received
     * @param timeout
     *            Specified timeout in milliseconds to wait for reply
     * @return received ReplyPacket
     * @throws IOException
     *             if any connection error occurred
     * @throws InterruptedException
     *             if reply packet's waiting was interrupted
     * @throws TimeoutException
     *             if timeout exceeded
     */
    public ReplyPacket receiveReply(int commandId, long timeout)
            throws InterruptedException, IOException, TimeoutException {
        return commandsSynchronyzer.receiveReply(commandId, timeout);
    }

}


text:
package org.jfree.chart.plot;

import java.io.ObjectStreamException;
import java.io.Serializable;

/**
 * Used to indicate the background shape for a
 * {@link org.jfree.chart.plot.MeterPlot}.
 */
public final class DialShape implements Serializable {

    /** For serialization. */
    private static final long serialVersionUID = -3471933055190251131L;

    /** Circle. */
    public static final DialShape CIRCLE = new DialShape("DialShape.CIRCLE");

    /** Chord. */
    public static final DialShape CHORD = new DialShape("DialShape.CHORD");

    /** Pie. */
    public static final DialShape PIE = new DialShape("DialShape.PIE");

    /** The name. */
    private String name;

    /**
     * Private constructor.
     *
     * @param name  the name.
     */
    private DialShape(String name) {
        this.name = name;
    }

    /**
     * Returns a string representing the object.
     *
     * @return The string.
     */
    public String toString() {
        return this.name;
    }

    /**
     * Returns true if this object is equal to the specified
     * object, and false otherwise.
     *
     * @param obj  the other object.
     *
     * @return A boolean.
     */
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof DialShape)) {
            return false;
        }
        DialShape shape = (DialShape) obj;
        if (!this.name.equals(shape.toString())) {
            return false;
        }
        return true;
    }

    /**
     * Returns a hash code for this instance.
     *
     * @return A hash code.
     */
    public int hashCode() {
        return this.name.hashCode();
    }

    /**
     * Ensures that serialization returns the unique instances.
     *
     * @return The object.
     *
     * @throws ObjectStreamException if there is a problem.
     */
    private Object readResolve() throws ObjectStreamException {
        if (this.equals(DialShape.CIRCLE)) {
            return DialShape.CIRCLE;
        }
        else if (this.equals(DialShape.CHORD)) {
            return DialShape.CHORD;
        }
        else if (this.equals(DialShape.PIE)) {
            return DialShape.PIE;
        }
        return null;
    }

}


text:
GMT does not actually have a *contourf* module like Matlab for example, but we can obtain the same result using *grdview*, *grdcontour* and *pscontour*. However, to make things the Julia wrapper wrapped up a module called *contourf* that makes it really easy to use. To show how it works let's start by creating an example grid and a CPT.

```julia
G = GMT.peaks();
```

```julia
C = makecpt(T=(-7,9,2));
```

Now if we pass those two to the *contourf* module we get an annotated plot where the annotations come from the color CPT.

```julia
contourf(G, C, show=true)
```

```@raw html
<img src="../contf_fig1.png" width="500" class="center"/>
```

If we want to just draw some contours and not annotate them, we pass an array with the contours to be drawn.

```julia
contourf(G, C, contour=[-2, 0, 2, 5], show=true)
```

```@raw html
<img src="../contf_fig2.png" width="500" class="center"/>
```

### What if one has an *x,y,z* file instead of a grid?

That is also simple, let's simulate it with synthetic data.

```julia
d = [0 2 5; 1 4 5; 2 0.5 5; 3 3 9; 4 4.5 5; 4.2 1.2 5; 6 3 1; 8 1 5; 9 4.5 5];
```

```julia
contourf(d, limits=(-0.5,9.5,0,5), pen=0.25, labels=(line=(:min,:max),), show=1)
```

```@raw html
<img src="../contf_fig3.png" width="500" class="center"/>
```

In the above since we did not specify a CPT the program picked the GMT's default one. But if we want use another one it's only a question of creating and passed it in.

```julia
cpt = makecpt(range=(0,10,1), cmap=:batlow);
contourf(d, contours=cpt, limits=(-0.5,9.5,0,5), pen=0.25, labels=(line=(:min,:max),), show=true)
```

```@raw html
<img src="../contf_fig4.png" width="500" class="center"/>
```

---

*Download a [Pluto Notebook here](contourf.jl)*


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.gigigo.orchextra.scanner">

  <uses-permission android:name="android.permission.CAMERA"/>

  <application
      android:supportsRtl="true">
    <activity
        android:name=".ScannerActivity"
        android:theme="@style/OxAppTheme.NoActionBar"
        android:screenOrientation="portrait">
    </activity>
  </application>

</manifest>


text:
Kuvauksen kirjoitti: Vesa Kivistö

## Lyhyt kuvaus

DevOps on kehitys- ja toimintamalli, joka pyrkii ohjelmistokehittäjien ja muiden IT-alan ammattilaisten sujuvaan yhteistyöhön ja kommunikaatioon sekä ohjelmistokehitysprosessin automatisointiin. DevOpsin tavoitteena on luoda kehitysympäristö, jossa ohjelmistojen kehitys, testaus ja julkaisu tapahtuu nopeasti, usein ja luotettavasti. Sana DevOps on sanojen development (kehitys) ja operations (tuotanto) yhdistelmä.

_![devops-basics](https://upload.wikimedia.org/wikipedia/commons/thumb/b/b5/Devops.svg/500px-Devops.svg.png)_

DevOps, ketterä kehittäminen ja jatkuva integrointi omaavat tiettyjä samankaltaisia piirteitä. Siinä missä ketterä kehittäminen pyrkii muuttamaan ajattelutapaa ohjelmistokehityksessä, DevOps pyrkii muutamaan koko organisaation toimintatapaa. Pohjimmiltaan DevOps syntyi ketterän kehittämisen jatkuvasta suosion kasvamisesta. Jatkuva integrointi ja DevOps pyrkivät molemmat pieniin ja nopeisiin muutoksiin, jotka ovat loppukäyttäjälle tärkeitä ja jotka voidaan tarvittaessa toimittaa nopeasti.

DevOpsille ei ole olemassa yhtä ja ainoaa työkalua, vaan käytössä on useammasta työkalusta koostuvia työkaluketjuja. Työkaluketjut ja niiden työkalut voivat vaihdella eri organisaatioiden sisällä paljonkin, mutta tavallisesti DevOpsin työkalut sopivat yhteen seuraavista ryhmistä:

- Koodi - ohjelmistokoodin kirjoittaminen ja tarkastaminen, jatkuvan integroinnin työkalut
- Koonti - versionhallinta
- Testaus - testaus ja tulokset suorituskyvyn määrittelyyn
- Paketointi - sovelluksen valmistelu käyttöönottoa varten
- Julkaisu - julkaisujen hyväksyminen, automatisointi
- Konfigurointi - infrastruktuuri konfigurointi ja hallinta, Infrastructure as Code -työkalut
- Monitorointi - sovelluksen suorituskyvyn seuranta, käyttäkokemus

## Esimerkkejä

Organisaatiolla on kaksi branchia GitHubissa - toinen kehittämiseen ja testaukseen ja toinen tuotantoon. Kumpaakin ajetaan omassa Docker-ympäristössä. Ohjelmistoon uusien ominaisuuksien toteuttamisen jälkeen ominaisuutta testataan Jenkinsillä, jolla testitulokset saadaan suoraan ja suorituskyky voidaan määrittää. Kehittämistä ja testausta jatketaan kehitysympäristössä jatkuvasti, ja uusien ominaisuuksien suorituskyvyn päästyä vaaditulle tasolle koodi viedään tuotantobranchiin ja Dockerissa olevat kontit päivitetään uuteen versioon.

![devops-development](https://insights.sei.cmu.edu/assets/content/image%20for%20continuous%20integration%20and%20devops_01262015.jpg)

## Lähteitä liittyen aiheeseen

- [The Agile Admin - What Is DevOps?](https://theagileadmin.com/what-is-devops/)
- [Wikipedia - DevOps](https://en.wikipedia.org/wiki/DevOps)
- [DevOps.com](https://devops.com/)

## Linkit wikin muihin sivuihin

- [Jatkuva integrointi](aihe-Jatkuva-integrointi)
- [Ketterä kehittäminen](aihe-ketterä-kehittäminen)


text:
package stft

import (
	"github.com/mjibson/go-dsp/fft"
	"github.com/r9y9/gossp/window"
)

// Reference:
// D. W. Griffin and J. S. Lim, "Signal estimation from modified short-time
// Fourier transform," IEEE Trans. ASSP, vol.32, no.2, pp.236–243, Apr. 1984.

// STFT represents Short Time Fourier Transform Analysis.
type STFT struct {
	FrameShift int
	FrameLen   int
	Window     []float64 // window funtion
}

// New returns a new STFT instance.
func New(frameShift, frameLen int) *STFT {
	s := &STFT{
		FrameShift: frameShift,
		FrameLen:   frameLen,
		Window:     window.CreateHanning(frameLen),
	}

	return s
}

// NumFrames returnrs the number of frames that will be analyzed in STFT.
func (s *STFT) NumFrames(input []float64) int {
	return int(float64(len(input)-s.FrameLen)/float64(s.FrameShift)) + 1
}

// DivideFrames returns overlapping divided frames for STFT.
func (s *STFT) DivideFrames(input []float64) [][]float64 {
	numFrames := s.NumFrames(input)
	frames := make([][]float64, numFrames)
	for i := 0; i < numFrames; i++ {
		frames[i] = s.FrameAt(input, i)
	}
	return frames
}

// FrameAt returns frame at specified index given an input signal.
// Note that it doesn't make copy of input.
func (s *STFT) FrameAt(input []float64, index int) []float64 {
	return input[index*s.FrameShift : index*s.FrameShift+s.FrameLen]
}

// STFT returns complex spectrogram given an input signal.
func (s *STFT) STFT(input []float64) [][]complex128 {
	numFrames := s.NumFrames(input)
	spectrogram := make([][]complex128, numFrames)

	frames := s.DivideFrames(input)
	for i, frame := range frames {
		// Windowing
		windowed := window.Windowing(frame, s.Window)
		// Complex Spectrum
		spectrogram[i] = fft.FFTReal(windowed)
	}

	return spectrogram
}

// ISTFT performs invere STFT signal reconstruction and returns reconstructed
// signal.
func (s *STFT) ISTFT(spectrogram [][]complex128) []float64 {
	frameLen := len(spectrogram[0])
	numFrames := len(spectrogram)
	reconstructedSignal := make([]float64, frameLen+numFrames*s.FrameShift)

	// Griffin's method
	windowSum := make([]float64, len(reconstructedSignal))
	for i := 0; i < numFrames; i++ {
		buf := fft.IFFT(spectrogram[i])
		index := 0
		for t := i * s.FrameShift; t < i*s.FrameShift+frameLen; t++ {
			reconstructedSignal[t] += real(buf[index]) * s.Window[index]
			windowSum[t] += s.Window[index] * s.Window[index]
			index++
		}
	}

	// Normalize by window
	for n := range reconstructedSignal {
		if windowSum[n] > 1.0e-21 {
			reconstructedSignal[n] /= windowSum[n]
		}
	}

	return reconstructedSignal
}


text:
import React from 'react';
import Navigation from '../components/Navigation/Navigation';
import PageContentWrapper, {
    PageContentItem,
    PageContentBlock
} from '../components/PageContent/PageContent';

const ReflectPage = ({ location, data }) => {
    return (

            <Navigation activeLocation={location.pathname}/>
            <PageContentWrapper>
                {data.allMarkdownRemark.edges.map(({ node }) =>
                    <PageContentItem key={node.fields.slug}>
                        <PageContentBlock>

{node.frontmatter.title}

                            {node.frontmatter.date}
                        </PageContentBlock>

                    </PageContentItem>
                )}
            </PageContentWrapper>

    );
};

export const query = graphql`
    query ReflectQuery {
        allMarkdownRemark(sort: {fields: [frontmatter___date], order: DESC}) {
            edges {
                node {
                    frontmatter {
                        title
                        date(formatString: "DD MMMM, YY")
                    }
                    fields {
                        slug
                    }
                    html
                }
            }
        }
    }
`

export default ReflectPage;


text:
<?xml version="1.0" encoding="UTF-8"?>
<billStatus>
  <bill>
    <subjects>
      <billSubjects>
        <legislativeSubjects>
          <item>
            <name>Bank accounts, deposits, capital</name>
          </item>
          <item>
            <name>Banking and financial institutions regulation</name>
          </item>
          <item>
            <name>Credit and credit markets</name>
          </item>
          <item>
            <name>Real estate business</name>
          </item>
        </legislativeSubjects>
        <policyArea>
          <name>Finance and Financial Sector</name>
        </policyArea>
      </billSubjects>
    </subjects>
    <updateDate>2017-10-13T07:23:48Z</updateDate>
    <amendments />
    <calendarNumbers />
    <notes />
    <actions>
      <item>
        <actionDate>2017-10-12</actionDate>
        <committee>
          <name>Financial Services Committee</name>
          <systemCode>hsba00</systemCode>
        </committee>
        <links />
        <sourceSystem>
          <name>House committee actions</name>
          1
        </sourceSystem>
        <text>Ordered to be Reported (Amended) by the Yeas and Nays: 59 - 1.</text>
        <type>Committee</type>
      </item>
      <item>
        <actionDate>2017-10-12</actionDate>
        <committee>
          <name>Financial Services Committee</name>
          <systemCode>hsba00</systemCode>
        </committee>
        <links />
        <sourceSystem>
          <name>House committee actions</name>
          1
        </sourceSystem>
        <text>Committee Consideration and Mark-up Session Held.</text>
        <type>Committee</type>
      </item>
      <item>
        <actionDate>2017-10-11</actionDate>
        <committee>
          <name>Financial Services Committee</name>
          <systemCode>hsba00</systemCode>
        </committee>
        <links />
        <sourceSystem>
          <name>House committee actions</name>
          1
        </sourceSystem>
        <text>Committee Consideration and Mark-up Session Held.</text>
        <type>Committee</type>
      </item>
      <item>
        <actionDate>2017-07-12</actionDate>
        <committee>
          <name>Financial Institutions and Consumer Credit Subcommittee</name>
          <systemCode>hsba15</systemCode>
        </committee>
        <links />
        <sourceSystem>
          <name>House committee actions</name>
          1
        </sourceSystem>
        <text>Hearings Held by the Subcommittee on Financial Institutions and Consumer Credit Prior to Referral.</text>
        <type>Committee</type>
      </item>
      <item>
        <type>IntroReferral</type>
        <actionDate>2017-04-26</actionDate>
        <links />
        <sourceSystem>
          <name>House floor actions</name>
          2
        </sourceSystem>
        <text>Referred to the House Committee on Financial Services.</text>
        <actionCode>H11100</actionCode>
        <committee>
          <name>Financial Services Committee</name>
          <systemCode>hsba00</systemCode>
        </committee>
      </item>
      <item>
        <type>IntroReferral</type>
        <actionDate>2017-04-26</actionDate>
        <links />
        <sourceSystem>
          <name>Library of Congress</name>
          9
        </sourceSystem>
        <text>Introduced in House</text>
        <actionCode>Intro-H</actionCode>
        <committee />
      </item>
      <item>
        <type>IntroReferral</type>
        <actionDate>2017-04-26</actionDate>
        <links />
        <sourceSystem>
          <name>Library of Congress</name>
          9
        </sourceSystem>
        <text>Introduced in House</text>
        <actionCode>1000</actionCode>
        <committee />
      </item>
      <actionTypeCounts>
        <billReferrals>1</billReferrals>
        <introducedInHouse>1</introducedInHouse>
        <actionStageOverride>2</actionStageOverride>
        <placeholderTextForH>2</placeholderTextForH>
        <introducedInTheHouse>1</introducedInTheHouse>
      </actionTypeCounts>
      <actionByCounts>
        <houseOfRepresentatives>7</houseOfRepresentatives>
      </actionByCounts>
    </actions>
    <version>1.0.0</version>
    <constitutionalAuthorityStatementText><![CDATA[
From the Congressional Record Online through the Government Publishing Office [www.gpo.gov]By Mr. PITTENGER:H.R. 2148.Congress has the power to enact this legislation pursuantto the following:Article I Section 1: All legislative Powers herein shall bevested in a Congress of the United States[Page H2897]
]]></constitutionalAuthorityStatementText>
    <sponsors>
      <item>
        <identifiers>
          <lisID>2141</lisID>
          <bioguideId>P000606</bioguideId>
          <gpoId />
        </identifiers>
        <bioguideId>P000606</bioguideId>
        <party>R</party>
        <district>9</district>
        <firstName>Robert</firstName>
        <middleName />
        <state>NC</state>
        <fullName>Rep. Pittenger, Robert [R-NC-9]</fullName>
        <lastName>Pittenger</lastName>
        <byRequestType />
      </item>
    </sponsors>
    <relatedBills />
    <recordedVotes />
    <cosponsors>
      <item>
        <bioguideId>S001157</bioguideId>
        <fullName>Rep. Scott, David [D-GA-13]</fullName>
        <party>D</party>
        <sponsorshipDate>2017-04-26</sponsorshipDate>
        <firstName>David</firstName>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <middleName />
        <state>GA</state>
        <district>13</district>
        <identifiers>
          <lisID>1722</lisID>
          <bioguideId>S001157</bioguideId>
          <gpoId>7910</gpoId>
        </identifiers>
        <lastName>Scott</lastName>
      </item>
      <item>
        <bioguideId>W000819</bioguideId>
        <fullName>Rep. Walker, Mark [R-NC-6]</fullName>
        <party>R</party>
        <sponsorshipDate>2017-05-16</sponsorshipDate>
        <firstName>Mark</firstName>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <middleName />
        <state>NC</state>
        <district>6</district>
        <identifiers>
          <lisID>2255</lisID>
          <bioguideId>W000819</bioguideId>
          <gpoId />
        </identifiers>
        <lastName>Walker</lastName>
      </item>
      <item>
        <bioguideId>R000593</bioguideId>
        <fullName>Rep. Ross, Dennis A. [R-FL-15]</fullName>
        <party>R</party>
        <sponsorshipDate>2017-06-06</sponsorshipDate>
        <firstName>Dennis</firstName>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <middleName>A.</middleName>
        <state>FL</state>
        <district>15</district>
        <identifiers>
          <bioguideId>R000593</bioguideId>
          <lisID>2003</lisID>
          <gpoId>7884</gpoId>
        </identifiers>
        <lastName>Ross</lastName>
      </item>
      <item>
        <bioguideId>W000812</bioguideId>
        <fullName>Rep. Wagner, Ann [R-MO-2]</fullName>
        <party>R</party>
        <sponsorshipDate>2017-06-06</sponsorshipDate>
        <firstName>Ann</firstName>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <middleName />
        <state>MO</state>
        <district>2</district>
        <identifiers>
          <lisID>2137</lisID>
          <bioguideId>W000812</bioguideId>
          <gpoId />
        </identifiers>
        <lastName>Wagner</lastName>
      </item>
      <item>
        <bioguideId>B001282</bioguideId>
        <fullName>Rep. Barr, Andy [R-KY-6]</fullName>
        <party>R</party>
        <sponsorshipDate>2017-06-08</sponsorshipDate>
        <firstName>Andy</firstName>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <middleName />
        <state>KY</state>
        <district>6</district>
        <identifiers>
          <lisID>2131</lisID>
          <gpoId />
          <bioguideId>B001282</bioguideId>
        </identifiers>
        <lastName>Barr</lastName>
      </item>
      <item>
        <bioguideId>T000470</bioguideId>
        <fullName>Rep. Tipton, Scott  R. [R-CO-3]</fullName>
        <party>R</party>
        <sponsorshipDate>2017-06-13</sponsorshipDate>
        <firstName>Scott</firstName>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <middleName>R.</middleName>
        <state>CO</state>
        <district>3</district>
        <identifiers>
          <bioguideId>T000470</bioguideId>
          <lisID>1997</lisID>
          <gpoId>7861</gpoId>
        </identifiers>
        <lastName>Tipton</lastName>
      </item>
      <item>
        <bioguideId>S001187</bioguideId>
        <fullName>Rep. Stivers, Steve [R-OH-15]</fullName>
        <party>R</party>
        <sponsorshipDate>2017-06-16</sponsorshipDate>
        <firstName>Steve</firstName>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <middleName />
        <state>OH</state>
        <district>15</district>
        <identifiers>
          <bioguideId>S001187</bioguideId>
          <lisID>2047</lisID>
          <gpoId>8105</gpoId>
        </identifiers>
        <lastName>Stivers</lastName>
      </item>
      <item>
        <bioguideId>G000583</bioguideId>
        <fullName>Rep. Gottheimer, Josh [D-NJ-5]</fullName>
        <party>D</party>
        <sponsorshipDate>2017-08-25</sponsorshipDate>
        <firstName>Josh</firstName>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <middleName />
        <state>NJ</state>
        <district>5</district>
        <identifiers>
          <lisID>2338</lisID>
          <bioguideId>G000583</bioguideId>
          <gpoId />
        </identifiers>
        <lastName>Gottheimer</lastName>
      </item>
      <item>
        <bioguideId>F000466</bioguideId>
        <fullName>Rep. Fitzpatrick, Brian K. [R-PA-8]</fullName>
        <party>R</party>
        <sponsorshipDate>2017-09-06</sponsorshipDate>
        <firstName>Brian</firstName>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <middleName>K.</middleName>
        <state>PA</state>
        <district>8</district>
        <identifiers>
          <bioguideId>F000466</bioguideId>
          <lisID>2345</lisID>
          <gpoId />
        </identifiers>
        <lastName>Fitzpatrick</lastName>
      </item>
      <item>
        <bioguideId>C001077</bioguideId>
        <fullName>Rep. Coffman, Mike [R-CO-6]</fullName>
        <party>R</party>
        <sponsorshipDate>2017-09-07</sponsorshipDate>
        <firstName>Mike</firstName>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <middleName />
        <state>CO</state>
        <district>6</district>
        <identifiers>
          <bioguideId>C001077</bioguideId>
          <lisID>1912</lisID>
          <gpoId>7864</gpoId>
        </identifiers>
        <lastName>Coffman</lastName>
      </item>
      <item>
        <bioguideId>B001305</bioguideId>
        <fullName>Rep. Budd, Ted [R-NC-13]</fullName>
        <party>R</party>
        <sponsorshipDate>2017-09-26</sponsorshipDate>
        <firstName>Ted</firstName>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <middleName />
        <state>NC</state>
        <district>13</district>
        <identifiers>
          <bioguideId>B001305</bioguideId>
          <lisID>2336</lisID>
          <gpoId />
        </identifiers>
        <lastName>Budd</lastName>
      </item>
      <item>
        <bioguideId>M001189</bioguideId>
        <fullName>Rep. Messer, Luke [R-IN-6]</fullName>
        <party>R</party>
        <sponsorshipDate>2017-09-26</sponsorshipDate>
        <firstName>Luke</firstName>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <middleName />
        <state>IN</state>
        <district>6</district>
        <identifiers>
          <lisID>2130</lisID>
          <bioguideId>M001189</bioguideId>
          <gpoId />
        </identifiers>
        <lastName>Messer</lastName>
      </item>
      <item>
        <bioguideId>L000569</bioguideId>
        <fullName>Rep. Luetkemeyer, Blaine [R-MO-3]</fullName>
        <party>R</party>
        <sponsorshipDate>2017-10-02</sponsorshipDate>
        <firstName>Blaine</firstName>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <middleName />
        <state>MO</state>
        <district>3</district>
        <identifiers>
          <bioguideId>L000569</bioguideId>
          <gpoId>8017</gpoId>
          <lisID>1931</lisID>
        </identifiers>
        <lastName>Luetkemeyer</lastName>
      </item>
      <item>
        <bioguideId>L000583</bioguideId>
        <fullName>Rep. Loudermilk, Barry [R-GA-11]</fullName>
        <party>R</party>
        <sponsorshipDate>2017-10-03</sponsorshipDate>
        <firstName>Barry</firstName>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <middleName />
        <state>GA</state>
        <district>11</district>
        <identifiers>
          <lisID>2238</lisID>
          <gpoId />
          <bioguideId>L000583</bioguideId>
        </identifiers>
        <lastName>Loudermilk</lastName>
      </item>
      <item>
        <bioguideId>E000294</bioguideId>
        <fullName>Rep. Emmer, Tom [R-MN-6]</fullName>
        <party>R</party>
        <sponsorshipDate>2017-10-12</sponsorshipDate>
        <firstName>Tom</firstName>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <middleName />
        <state>MN</state>
        <district>6</district>
        <identifiers>
          <bioguideId>E000294</bioguideId>
          <gpoId />
          <lisID>2253</lisID>
        </identifiers>
        <lastName>Emmer</lastName>
      </item>
    </cosponsors>
    <billType>HR</billType>
    <summaries>
      <billSummaries />
    </summaries>
    <createDate>2017-04-27T03:11:48Z</createDate>
    <title>Clarifying Commercial Real Estate Loans</title>
    <originChamber>House</originChamber>
    <cboCostEstimates />
    <laws />
    <latestAction>
      <actionDate>2017-10-12</actionDate>
      <text>Ordered to be Reported (Amended) by the Yeas and Nays: 59 - 1.</text>
      <links />
    </latestAction>
    <committeeReports />
    <titles>
      <item>
        <titleType>(Extracted from GPO) Short Titles as Introduced</titleType>
        <chamberName />
        <title>Clarifying Commercial Real Estate Loans</title>
        <parentTitleType />
        <chamberCode />
      </item>
      <item>
        <titleType>Short Titles as Introduced</titleType>
        <chamberName />
        <title>Clarifying Commercial Real Estate Loans</title>
        <parentTitleType />
        <chamberCode />
      </item>
      <item>
        <titleType>Official Title as Introduced</titleType>
        <chamberName />
        <title>To amend the Federal Deposit Insurance Act to clarify capital requirements for certain acquisition, development, or construction loans.</title>
        <parentTitleType />
        <chamberCode />
      </item>
      <item>
        <titleType>Display Title</titleType>
        <chamberName />
        <title>Clarifying Commercial Real Estate Loans</title>
        <parentTitleType />
        <chamberCode />
      </item>
    </titles>
    <policyArea>
      <name>Finance and Financial Sector</name>
    </policyArea>
    <billNumber>2148</billNumber>
    <introducedDate>2017-04-26</introducedDate>
    <congress>115</congress>
    <committees>
      <billCommittees>
        <item>
          <name>Financial Services Committee</name>
          <chamber>House</chamber>
          <type>Standing</type>
          <subcommittees>
            <item>
              <name>Financial Institutions and Consumer Credit Subcommittee</name>
              <systemCode>hsba15</systemCode>
              <activities>
                <item>
                  <name>Hearings by</name>
                  <date>2017-07-12T17:13:31Z</date>
                </item>
              </activities>
            </item>
          </subcommittees>
          <activities>
            <item>
              <name>Markup by</name>
              <date>2017-10-12T21:48:22Z</date>
            </item>
            <item>
              <name>Referred to</name>
              <date>2017-04-26T14:02:00Z</date>
            </item>
          </activities>
          <systemCode>hsba00</systemCode>
        </item>
      </billCommittees>
    </committees>
  </bill>
  <dublinCore xmlns:dc="http://purl.org/dc/elements/1.1/">
    <dc:format>text/xml</dc:format>
    <dc:language>EN</dc:language>
    <dc:rights>Pursuant to Title 17 Section 105 of the United States Code, this file is not subject to copyright protection and is in the public domain.</dc:rights>
    <dc:contributor>Congressional Research Service, Library of Congress</dc:contributor>
    <dc:description>This file contains bill summaries and statuses for federal legislation. A bill summary describes the most significant provisions of a piece of legislation and details the effects the legislative text may have on current law and federal programs. Bill summaries are authored by the Congressional Research Service (CRS) of the Library of Congress. As stated in Public Law 91-510 (2 USC 166 (d)(6)), one of the duties of CRS is "to prepare summaries and digests of bills and resolutions of a public general nature introduced in the Senate or House of Representatives". For more information, refer to the User Guide that accompanies this file.</dc:description>
  </dublinCore>
</billStatus>


text:
using Atomiv.Core.Application;
using Atomiv.Core.Domain;
using Cli.Core.Application.MyFoos.Requests;
using Cli.Core.Application.MyFoos.Responses;
using Cli.Core.Domain.MyFoos.Entities;
using Cli.Core.Domain.MyFoos.Repositories;
using Cli.Core.Domain.MyFoos.ValueObjects;

namespace Cli.Core.Application.MyFoos.UseCases
{
    public class UpdateMyFooUseCase : UpdateAggregateUseCase<IMyFooRepository, UpdateMyFooRequest, UpdateMyFooResponse, MyFoo, MyFooIdentity, int>
    {
        public UpdateMyFooUseCase(IUnitOfWork unitOfWork, IResponseMapper responseMapper)
            : base(unitOfWork, responseMapper)
        {
        }

        protected override MyFooIdentity GetIdentity(int id)
        {
            return new MyFooIdentity(id);
        }

        protected override void Update(MyFoo aggregateRoot, UpdateMyFooRequest request)
        {
            aggregateRoot.FirstName = request.FirstName;
            aggregateRoot.LastName = request.LastName;
        }
    }
}