text:
import time
from flask import request, session, url_for, redirect, \
     render_template, abort, g, flash
from werkzeug.security import check_password_hash, generate_password_hash

from app import app
from db import query_db, get_user_id, get_db

PER_PAGE = app.config.get('PER_PAGE')

@app.route('/')
def timeline():
    """Shows a users timeline or if no user is logged in it will
    redirect to the public timeline.  This timeline shows the user's
    messages as well as all the messages of followed users.
    """
    if not g.user:
        return redirect(url_for('public_timeline'))
    return render_template('timeline.html', messages=query_db('''
        select message.*, user.* from message, user
        where message.author_id = user.user_id and (
            user.user_id = ? or
            user.user_id in (select whom_id from follower
                                    where who_id = ?))
        order by message.pub_date desc limit ?''',
        [session['user_id'], session['user_id'], PER_PAGE]))

@app.route('/public')
def public_timeline():
    """Displays the latest messages of all users."""
    return render_template('timeline.html', messages=query_db('''
        select message.*, user.* from message, user
        where message.author_id = user.user_id
        order by message.pub_date desc limit ?''', [PER_PAGE]))

@app.route('/<username>')
def user_timeline(username):
    """Display's a users tweets."""
    profile_user = query_db('select * from user where username = ?',
                            [username], one=True)
    if profile_user is None:
        abort(404)
    followed = False
    if g.user:
        followed = query_db('''select 1 from follower where
            follower.who_id = ? and follower.whom_id = ?''',
            [session['user_id'], profile_user['user_id']],
            one=True) is not None
    return render_template('timeline.html', messages=query_db('''
            select message.*, user.* from message, user where
            user.user_id = message.author_id and user.user_id = ?
            order by message.pub_date desc limit ?''',
            [profile_user['user_id'], PER_PAGE]), followed=followed,
            profile_user=profile_user)

@app.route('/<username>/follow')
def follow_user(username):
    """Adds the current user as follower of the given user."""
    if not g.user:
        abort(401)
    whom_id = get_user_id(username)
    if whom_id is None:
        abort(404)
    db = get_db()
    db.execute('insert into follower (who_id, whom_id) values (?, ?)',
              [session['user_id'], whom_id])
    db.commit()
    flash('You are now following "%s"' % username)
    return redirect(url_for('user_timeline', username=username))

@app.route('/<username>/unfollow')
def unfollow_user(username):
    """Removes the current user as follower of the given user."""
    if not g.user:
        abort(401)
    whom_id = get_user_id(username)
    if whom_id is None:
        abort(404)
    db = get_db()
    db.execute('delete from follower where who_id=? and whom_id=?',
              [session['user_id'], whom_id])
    db.commit()
    flash('You are no longer following "%s"' % username)
    return redirect(url_for('user_timeline', username=username))

@app.route('/add_message', methods=['POST'])
def add_message():
    """Registers a new message for the user."""
    if 'user_id' not in session:
        abort(401)
    if request.form['text']:
        db = get_db()
        db.execute('''insert into message (author_id, text, pub_date)
          values (?, ?, ?)''', (session['user_id'], request.form['text'],
                                int(time.time())))
        db.commit()
        flash('Your message was recorded')
    return redirect(url_for('timeline'))

@app.route('/login', methods=['GET', 'POST'])
def login():
    """Logs the user in."""
    if g.user:
        return redirect(url_for('timeline'))
    error = None
    if request.method == 'POST':
        user = query_db('''select * from user where
            username = ?''', [request.form['username']], one=True)
        if user is None:
            error = 'Invalid username'
        elif not check_password_hash(user['pw_hash'],
                                     request.form['password']):
            error = 'Invalid password'
        else:
            flash('You were logged in')
            session['user_id'] = user['user_id']
            return redirect(url_for('timeline'))
    return render_template('login.html', error=error)

@app.route('/register', methods=['GET', 'POST'])
def register():
    """Registers the user."""
    if g.user:
        return redirect(url_for('timeline'))
    error = None
    if request.method == 'POST':
        if not request.form['username']:
            error = 'You have to enter a username'
        elif not request.form['email'] or \
                 '@' not in request.form['email']:
            error = 'You have to enter a valid email address'
        elif not request.form['password']:
            error = 'You have to enter a password'
        elif request.form['password'] != request.form['password2']:
            error = 'The two passwords do not match'
        elif get_user_id(request.form['username']) is not None:
            error = 'The username is already taken'
        else:
            db = get_db()
            db.execute('''insert into user (
              username, email, pw_hash) values (?, ?, ?)''',
              [request.form['username'], request.form['email'],
               generate_password_hash(request.form['password'])])
            db.commit()
            flash('You were successfully registered and can login now')
            return redirect(url_for('login'))
    return render_template('register.html', error=error)

@app.route('/logout')
def logout():
    """Logs the user out."""
    flash('You were logged out')
    session.pop('user_id', None)
    return redirect(url_for('public_timeline'))


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Acta bot. Yunn. 26(6): 626 (2004)

#### Original name
Xerocomus magniporus M. Zang & R.H. Petersen

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
//
//  CRNotificationView.h
//  和路通
//
//  Created by roger wu on 01/08/2018.
//  Copyright © 2018 asiainfo. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef void(^LTNotificationViewComplete)(void);

@interface CRNotificationView : UIWindow

+ (instancetype)sharedInstance;

/**
 显示弹窗

 @param title 标题
 @param content 内容
 @param complete 回调
 */
- (void)showWithTitle:(NSString *)title content:(NSString *)content complete:(LTNotificationViewComplete)complete;

// 隐藏
- (void)dismiss;

@end


text:
require 'faraday'
require 'multi_json'

require 'wowwer/character'
require 'wowwer/version'

module Wowwer
  REGIONS = {
    us: {
      base_uri: 'us.battle.net'
    }
  }

  def self.connection
    @connection ||= Faraday.new
  end

  def self.connection=(connection)
    @connection = connection
  end

  def self.default_region
    @default_region ||= :us
  end

  def self.default_region=(region)
    @default_region = region
  end

  def self.region_uri(region = Wowwer.default_region)
    'https://' + REGIONS[region][:base_uri]
  end
end


text:
namespace omaha {

class UserWorkItem {
 public:
  UserWorkItem() : shutdown_event_(NULL) {}
  virtual ~UserWorkItem() {}

  // Template method interface
  void Process() { DoProcess(); }

  HANDLE shutdown_event() const { return shutdown_event_; }
  void set_shutdown_event(HANDLE shutdown_event) {
    shutdown_event_ = shutdown_event;
  }

 private:
  // Executes the work item.
  virtual void DoProcess() = 0;

  // It is the job of implementers to watch for the signaling of this event
  // and shutdown correctly. This event is set when the thread pool is closing.
  // Do not close this event as is owned by the thread pool.
  HANDLE shutdown_event_;
  DISALLOW_EVIL_CONSTRUCTORS(UserWorkItem);
};

class ThreadPool {
 public:
  ThreadPool();

  // The destructor might block for 'shutdown_delay'.
  ~ThreadPool();

  HRESULT Initialize(int shutdown_delay);

  // Returns true if any work items are still in progress.
  bool HasWorkItems() const { return (0 != work_item_count_); }

  // Adds a work item to the queue. If the add fails the ownership of the
  // work items remains with the caller.
  HRESULT QueueUserWorkItem(UserWorkItem* work_item, uint32 flags);

 private:
  // Calls UserWorkItem::Process() in the context of the worker thread.
  void ProcessWorkItem(UserWorkItem* work_item);

  // This is the thread callback required by the underlying windows API.
  static DWORD WINAPI ThreadProc(void* context);

  // Approximate number of work items in the pool.
  volatile LONG work_item_count_;

  // This event signals when the thread pool destructor is in progress.
  scoped_event shutdown_event_;

  // How many milliseconds to wait for the work items to finish when
  // the thread pool is shutting down. The shutdown delay resolution is ~10ms.
  int shutdown_delay_;

  DISALLOW_EVIL_CONSTRUCTORS(ThreadPool);
};

}   // namespace omaha

#endif  // OMAHA_COMMON_THREAD_POOL_H__


text:
/*
  * Npm dependencies
 */
import express from 'express';
import passport from 'passport';

const router = express.Router();

router.get('/', passport.authMiddleware(), (req, res, next) => {
  req.logout();
  res.redirect('/login');
});

export default router;


text:
/**
 * Add widget directive
 *
 * @author <contact@dannycoulombe.com>
 */
(function() {

	/**
	 * Initialize widget's requirement (once)
	 */
	Zemit.app.run(['$modal', function($modal) {

		$modal.create('zm_widget_add', {
			title: 'Add a new widget',
			content: '<zm-widget-modal-add />'
		});
	}]);

	/**
	 * Modal: Add a new widget
	 *
	 * This modal offers a list of widget that you can add inside the column.
	 */
	Zemit.app.directive('zmWidgetModalAdd', ['$history', '$filter', '$zm', function($history, $filter, $zm) {
		return {
			restrict: 'E',
			replace: true,
			templateUrl: 'components/widget/default/add/add.html',
			link: function ($s, $e, attrs) {

				var widgets = Zemit.widgets.getAll();

				$s.modal = $s.$parent.modal;

				$s.tab = {
					current: 'content'
				};

				// List of available widgets (items)
				$s.items = {
					structure: {
						title: 'Structure',
						widgets: []
					},
					content: {
						title: 'Content',
						widgets: []
					},
					// custom: {
					// 	title: 'Custom',
					// 	widgets: []
					// }
				};

				angular.forEach(widgets, function(widget, key) {
					var inject = widget.injectable;
					if(inject && $s.items[inject.section]) {
						$s.items[widget.injectable.section].widgets.push({
							type: key,
							title: inject.title,
							desc: inject.desc,
							icon: inject.icon
						});
					}
				});

				angular.forEach($s.items, function(section) {
					section.rows = $filter('columnize')(section.widgets, 3);
				});

				/**
				 * Add a new widget in the column
				 */
				$s.addWidget = function(item) {

					$zm.action($s.modal.data.widget.addNewChild, [
						item.type,
						$s.modal.data.index, {
							defaultTemplate: item.defaultTemplate === false ? false : true
						}
					], $s.modal.data.widget);

					// Close modal
					$s.modal.close();
				};
			}
		};
	}]);
})();


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

<?php
	# FUNCIONES
	function ConectarFTPA(){
		//Permite conectarse al Servidor FTP
		$id_ftp=ftp_connect("192.168.40.3",21); //Obtiene un manejador del Servidor FTP
		ftp_login($id_ftp,"fork","fork"); //Se loguea al Servidor FTP
		return $id_ftp; //Devuelve el manejador a la función
	}

	function SubirArchivo($archivo_local,$archivo_remoto){
		//Sube archivo de la maquina Cliente al Servidor (Comando PUT)
		$id_ftp=ConectarFTP(); //Obtiene un manejador y se conecta al Servidor FTP
		ftp_put($id_ftp,$archivo_remoto,$archivo_local,FTP_BINARY);
		//Sube un archivo al Servidor FTP en modo Binario
		ftp_quit($id_ftp); //Cierra la conexion FTP
	}

    function eliminar_acentos($str){
    	$a = array('Á','É','Í','Ó','Ú');
    	$b = array('A','E','I','O','U');
    	return str_replace($a, $b, $str);
    }

    // establecer una conexión básica
    $conn_id = ConectarFTPA();
    //me ubico en un directorio
    ftp_chdir($conn_id, "Vantage/Rename");
    // Obtener los archivos contenidos en el directorio actual
    $contents = ftp_nlist($conn_id, ".");
    // output $contents

    //conecto a la bd de mysqlserver
    $link = mssql_connect('192.168.70.7', 'sa', '') or die("Could not connect !");
    $selected = mssql_select_db("creatv_data", $link);

    foreach ($contents as $c) {
        if($c!=".DS_Store" and $c!="._.DS_Store" and $c!='otros'){
            $dato=explode(".", $c);
            $idcoriginal=$dato[0];
            $idrecortado=substr($dato[0],0,-2);
            $ext=$dato[1];

            $query="
              SELECT p.Identificador, c.Titol_Emissio as tcontenido,p.Titol_Emissio as tproduccion
              FROM [creatv_data].[dbo].[Produccion] p ,[creatv_data].[dbo].[Contenido] c
              where p.IdPrograma=c.IdPrograma and p.Identificador='".$idrecortado."'
            ";

            $result = mssql_query($query);
            $row = mssql_fetch_array($result);
            ftp_rename($conn_id, $idcoriginal.".".$ext, "../From_Interplay/".$row['tcontenido']." - ".$row['tproduccion'].".".$ext);

        }
    }


text:
(function() {
    /*
    * Плагин для множественного вывода сообщений
    */

    $.extend({
        ulejMessages: {
            messagesSettingDate: {'success': {}, 'error': {}}, /* Группы сообщений */
            messagesContainer:  $('.nb-alert-container'), /* Контейнер сообщения */
            maxShowMessages: 3, /* Максимальное число отображаемых сообщений */
            fadeInTime: 1000, /* Время появления */
            fadeOutTime: 2000, /* Время исчезновения */
            waitingTime: 2000, /* Время отображения сообщения */
			defaultMessages: { /* Сообщения по уполчанию для определённого типа */
				'success': 'Данные успешно сохранены',
				'error': 'Внимание! Ошибка сохранения'
			},

			/*
			 *  Инициализация групп сообщений
			 */
            init: function() {
                this.messagesSettingDate.success = this.messagesSettingDate.error = {
                    counter: 0, /* Количество сообщений в группе */
                    pendingMessages: [] /* Набор сообщений */
                };
            },
			/*
			 * Отображение сообщения
			 *
			 * type - один из вышеперечисленных типов сообщения
			 * message - текст сообщения
			 *
			 * @param string type
			 * @param string message
			 */
            showMessage: function(type, message) {
                var messageHTML = this.getAlertContentTemplate(type, message);

                if(messageHTML) {
                    this.showCurrentMessage(type, messageHTML);
                }
            },
			/*
			 *	Отображение текущего сообщения
			 *
			 *  type - один из вышеперечисленных типов сообщения
			 *  message - блок текущего сообщения
			 *
			 *	@param string type
			 *	@param object message
			 */
            showCurrentMessage:function(type, message) {
                var $this = this;
                this.messagesContainer.prepend(message); /* Устанавливаем сообщение перед предыдущими */

				message.fadeIn(this.fadeInTime, function() {}); /* Отображаем сообщение */
				setTimeout(function() {
					/*
					* По истечении установленного количества времени на отображение сообщение, прячем его и удаляем из разметки.
					* После этого уменьшаем значение счётчика и переходим к выборке другого ожидающего сообщения, если конечно таковые имеются
					* */
                    message.fadeOut($this.fadeOutTime, function() {
                        $this.changingNumberMessages(type, true);
                        $this.getPendingMessage(type);
                        message.remove();
                    });
                }, this.waitingTime);
            },
			/*
			 *	Осуществляем выборку следующего сообщения
			 */
            getPendingMessage: function(type) {
                if(this.messagesSettingDate[type].pendingMessages.length) {
					/*
					*	Выбераем из массива ожидающих сообщений все начиная со второго
					*/
                    var $this = this, pendingMessages = this.messagesSettingDate[type].pendingMessages.slice(1);
					/*
					 *	Первое сообщение отправляем на отображение
					 */
                    this.showCurrentMessage(type, this.messagesSettingDate[type].pendingMessages[0]);
					/*
					 *	Обновляем список ожидающих сообщений (без первого, т.к. оно уже перешло на стадию отображения)
					 */
                    this.messagesSettingDate[type].pendingMessages = pendingMessages;
                }
            },
			/*
			*  Осуществляем поиск шаблона сообщения, дублируем и передаём сообщение на вывод или помещаем в список ожидающих сообщений одной из групп
			*/
            getAlertContentTemplate: function(type, message) {
                var alert = $("#js-alert-" + type).clone();
                alert.removeAttr('id');

				/*
				* Увеличиваем значение счётчика
				*/
                this.changingNumberMessages(type);

				/*
				 * Устанавливаем сообщение или используе сообщение по умолчанию
				 */
                if(message) {
                    alert.html(message);
                } else if(this.defaultMessages[type]) {
					alert.html(this.defaultMessages[type]);
				}

				/*
				 * Если количество отображаемых сообщений более максимального, то пополняем группу без передачи блока сообщения
				 */
                if(this.messagesSettingDate[type].counter > this.maxShowMessages) {
                    this.messagesSettingDate[type].pendingMessages.push(alert)
                }

				/*
				 * Если в группе нет ожидающих сообщений передаём текущее
				 */
                if(!this.messagesSettingDate[type].pendingMessages.length) {
                    return alert;
                }
            },
            changingNumberMessages: function(type, minus) {
                if(minus) this.messagesSettingDate[type].counter--;
                else this.messagesSettingDate[type].counter++;
            }
        }
    });

    $.ulejMessages.init();
})(jQuery);


text:
/* Generated By:JJTree: Do not edit this line. OMetadataIdentifier.java Version 4.3 */
/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=true,NODE_PREFIX=O,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
package com.orientechnologies.orient.core.sql.parser;

import com.orientechnologies.orient.core.sql.executor.OResult;
import com.orientechnologies.orient.core.sql.executor.OResultInternal;
import java.util.Map;

public class OMetadataIdentifier extends SimpleNode {

  protected String name;

  public OMetadataIdentifier(int id) {
    super(id);
  }

  public OMetadataIdentifier(OrientSql p, int id) {
    super(p, id);
  }

  public void toString(Map<Object, Object> params, StringBuilder builder) {
    builder.append("metadata:");
    builder.append(name);
  }

  public void toGenericStatement(StringBuilder builder) {
    builder.append("metadata:");
    builder.append(name);
  }

  public String getName() {
    return name;
  }

  public OMetadataIdentifier copy() {
    OMetadataIdentifier result = new OMetadataIdentifier(-1);
    result.name = name;
    return result;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    OMetadataIdentifier that = (OMetadataIdentifier) o;

    if (name != null ? !name.equals(that.name) : that.name != null) return false;

    return true;
  }

  @Override
  public int hashCode() {
    return name != null ? name.hashCode() : 0;
  }

  public OResult serialize() {
    OResultInternal result = new OResultInternal();
    result.setProperty("name", name);
    return result;
  }

  public void deserialize(OResult fromResult) {
    name = fromResult.getProperty("name");
  }
}
/* JavaCC - OriginalChecksum=85e179b9505270f0596904070fdf0745 (do not edit this line) */


text:
// CIconMenu

#ifndef __CICONMENU__MULBERRY__
#define __CICONMENU__MULBERRY__

class CIconMenu : public CMenu
{
public:

	struct SIconMenuData
	{
		cdstring	mTxt;
		UINT		mIcon;

		SIconMenuData(const cdstring& txt, UINT icon) :
			mTxt(txt), mIcon(icon) {}

	};
	CIconMenu();
	~CIconMenu();

	SIconMenuData* AddData(SIconMenuData* data)
	{
		mData.push_back(data);
		return data;
	}

protected:
	ptrvector<SIconMenuData> mData;

	virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
	virtual void DrawItem( LPDRAWITEMSTRUCT lpDrawItemStruct );
};

#endif


text:
Title: Annual Report
Date: 2008-03-19 00:16:57
Author: stpeter
Slug: annual-report
Category: post
Tags:
Summary: description:
Link: http://xmpp.org/2008/03/annual-report/
post_id: 37

Regrettably, the XSF has not issued an annual report since 2002. It seems we're always too busy getting things done to report on our activities. But this year we decided to turn over a new leaf by completing an annual report, available at <[http://www.xmpp.org/xsf/docs/annual-report-2007.shtml](http://www.xmpp.org/xsf/docs/annual-report-2007.shtml)>. Feedback is welcome, as always.


text:
CBaseException::CBaseException(void)
{
}

CBaseException::~CBaseException(void)
{
}


text:
using Cosmos.Core;
using Cosmos.HAL.Audio;
using System;

namespace Cosmos.HAL.Audio {
    /// <summary>
    /// Represents a buffer of channel-interleaved audio samples.
    /// </summary>
    public class AudioBuffer {
        int size;
        byte[] buffer;
        readonly int sampleAmount;

        /// <summary>
        /// The audio format of the buffer.
        /// </summary>
        public readonly SampleFormat Format;

        /// <summary>
        /// Creates an empty <see cref="AudioBuffer"/>.
        /// </summary>
        /// <param name="size">The size of the buffer.</param>
        /// <param name="format">The target format of the audio buffer.</param>
        public AudioBuffer(int size, SampleFormat format)
        {
            Format = format;
            this.size = size;
            buffer = new byte[format.Size * Size];
            sampleAmount = size * format.Channels;
        }

        /// <summary>
        /// Provides access to the raw buffer data.
        /// </summary>
        public byte[] RawData => buffer;

        /// <summary>
        /// The size of the audio buffer, in audio samples. Setting this property
        /// to a different value causes the audio buffer to flush.
        /// </summary>
        public int Size {
            get => size;
            set {
                if(value != size)
                {
                    size = value;
                    buffer = new byte[Format.Size * Size];
                }
            }
        }

        /// <summary>
        /// The amount of sample values the buffer contains.
        /// </summary>
        public int SampleAmount => sampleAmount;

        /// <summary>
        /// Flushes (empties) the audio buffer, setting all of its sample data to zero.
        /// </summary>
        public void Flush()
        {
            // Set all of the bytes of the buffer to 0.
            MemoryOperations.Fill(buffer, 0);
        }

        /// <summary>
        /// Reads a sample from the audio buffer to the target array.
        /// </summary>
        /// <param name="index">The index of the audio sample to read.</param>
        /// <param name="dest">The array to write the sample to.</param>
        /// <param name="destOffset">The offset in the array to write data to.</param>
        /// <exception cref="ArgumentException">Thrown when the provided destination array is not large enough to hold all of the bytes.</exception>
        /// <exception cref="ArgumentOutOfRangeException">Thrown when attempting to write to a non-existent sample.</exception>
        public unsafe void ReadSample(int index, byte[] dest, int destOffset = 0)
        {
            if ((dest.Length - destOffset) - Format.Size < 0) {
                throw new ArgumentException("The provided destination array is not large enough to hold all of the bytes.", nameof(dest));
            }

            fixed (byte* destPtr = dest) {
                ReadSample(index, destPtr + destOffset);
            }
        }

        /// <summary>
        /// Reads a sample from the audio buffer to the target pointer in memory.
        /// </summary>
        /// <param name="index">The index of the audio sample to read.</param>
        /// <param name="dest">The part of memory to write the sample to.</param>
        /// <exception cref="ArgumentOutOfRangeException">Thrown when attempting to write to a non-existent sample.</exception>
        public unsafe void ReadSample(int index, byte* dest)
        {
            if (index >= Size) {
                throw new ArgumentOutOfRangeException(nameof(index));
            }

            int bufferOffset = index * Format.Size;

            fixed(byte* bufferPtr = buffer) {
                MemoryOperations.Copy(dest, bufferPtr + bufferOffset, Format.Size);
            }
        }

        /// <summary>
        /// Reads a single channel of a sample to the target array.
        /// </summary>
        /// <param name="index">The index of the audio sample to read the channel of.</param>
        /// <param name="channel">The target channel to read.</param>
        /// <param name="dest">The array to write the sample to.</param>
        /// <param name="destOffset">The offset in the array to write data to.</param>
        /// <exception cref="ArgumentException">Thrown when the provided source array is not large enough to hold all of the bytes.</exception>
        /// <exception cref="ArgumentOutOfRangeException">Thrown when attempting to write to a non-existent channel or sample.</exception>
        public unsafe void ReadSampleChannel(int index, int channel, byte[] dest, int destOffset = 0)
        {
            fixed (byte* destPtr = dest) {
                ReadSampleChannel(index, channel, destPtr + destOffset);
            }
        }

        /// <summary>
        /// Reads a single channel of a sample to the target pointer in memory.
        /// </summary>
        /// <param name="index">The index of the audio sample to read the channel of.</param>
        /// <param name="channel">The target channel to read.</param>
        /// <param name="dest">The part of memory to write the sample to.</param>
        /// <exception cref="ArgumentOutOfRangeException">Thrown when attempting to write to a non-existent channel or sample.</exception>
        public unsafe void ReadSampleChannel(int index, int channel, byte* dest)
        {
            int channelByteSize = Format.ChannelSize;
            int bufferOffset = (index * Format.Size) + (channelByteSize * channel);

            fixed (byte* bufferPtr = buffer) {
                MemoryOperations.Copy(
                    dest,
                    bufferPtr + bufferOffset,
                    channelByteSize
                );
            }
        }

        /// <summary>
        /// Writes a sample to the audio buffer, reading the sample data from
        /// the specified array beginning at <paramref name="srcOffset"/>.
        /// </summary>
        /// <param name="index">The index of the audio sample to overwrite.</param>
        /// <param name="src">The array to read the sample from.</param>
        /// <param name="srcOffset">The offset in the array to read data from.</param>
        /// <exception cref="ArgumentException">Thrown when the provided source array is not large enough to provide all of the bytes.</exception>
        /// <exception cref="ArgumentOutOfRangeException">Thrown when attempting to write to a non-existent sample.</exception>
        public unsafe void WriteSample(int index, byte[] src, int srcOffset = 0)
        {
            if ((src.Length - srcOffset) - Format.Size < 0) {
                throw new ArgumentException("The provided source array is not large enough to provide all of the bytes.", nameof(src));
            }

            fixed (byte* destPtr = src) {
                ReadSample(index, destPtr + srcOffset);
            }
        }

        /// <summary>
        /// Writes a sample from the target pointer in memory to the buffer.
        /// The amount of bytes that will be read is equal to <see cref="SampleSize"/>.
        /// </summary>
        /// <param name="index">The index of the audio sample to overwrite.</param>
        /// <param name="src">The part of memory to read the data from.</param>
        /// <exception cref="ArgumentOutOfRangeException">Thrown when attempting to write to a non-existent sample.</exception>
        public unsafe void WriteSample(int index, byte* src)
        {
            if (index >= Size) {
                throw new ArgumentOutOfRangeException(nameof(index));
            }

            int bufferOffset = index * Format.Size;

            fixed(byte* bufferPtr = buffer) {
                for (int i = 0; i < Format.Size; i++) {
                    *(bufferPtr + i) = *(src + i);
                }
            }
        }

        /// <summary>
        /// Changes the value of a single channel of the specified sample to
        /// the value that's located at index <paramref name="srcOffset"/> of the given
        /// array. The amount of bytes that will be read is equal to the value of <see cref="BitDepth"/>.
        /// </summary>
        /// <param name="index">The index of the audio sample to overwrite the channel of.</param>
        /// <param name="channel">The channel to overwrite.</param>
        /// <param name="src">The array to read the data from.</param>
        /// <param name="srcOffset">The starting index to read the data from <paramref name="src"/>.</param>
        /// <exception cref="ArgumentException">Thrown when the provided source array is not large enough to provide all of the bytes.</exception>
        /// <exception cref="ArgumentOutOfRangeException">Thrown when attempting to write to a non-existent channel or sample.</exception>
        public unsafe void WriteSampleChannel(int index, int channel, byte[] src, int srcOffset = 0)
        {
            if ((src.Length - srcOffset) - (int)Format.BitDepth < 0) {
                throw new ArgumentException("The provided source array is not large enough to provide all of the bytes.", nameof(src));
            }

            fixed (byte* destPtr = src) {
                WriteSampleChannel(index, channel, destPtr + srcOffset);
            }
        }

        /// <summary>
        /// Changes the value of a single channel of the specified sample to
        /// the value that's located in memory at the specified pointer.
        /// The amount of bytes that will be read is equal to the value of <see cref="BitDepth"/>.
        /// </summary>
        /// <param name="index">The index of the audio sample to overwrite the channel of.</param>
        /// <param name="channel">The channel to overwrite.</param>
        /// <param name="src">The part of memory to read the data from.</param>
        /// <exception cref="ArgumentOutOfRangeException">Thrown when attempting to write to a non-existent channel or sample.</exception>
        public unsafe void WriteSampleChannel(int index, int channel, byte* src)
        {
            if (index >= Size) {
                throw new ArgumentOutOfRangeException(nameof(index));
            }

            if (channel > Format.Channels) {
                throw new ArgumentOutOfRangeException(nameof(channel));
            }

            int channelByteSize = (int)Format.BitDepth;
            int bufferOffset = (index * Format.Size) + (channelByteSize * channel);

            fixed (byte* bufferPtr = buffer) {
                for (int i = 0; i < channelByteSize; i++) {
                    *(bufferPtr + i) = *(src + i);
                }
            }
        }
    }
}


text:
[![Build Status](https://travis-ci.org/ledermann/rails-settings.png?branch=master)](https://travis-ci.org/ledermann/rails-settings)
[![Code Climate](https://codeclimate.com/github/ledermann/rails-settings.png)](https://codeclimate.com/github/ledermann/rails-settings)

Ruby gem to handle settings for ActiveRecord instances by storing them as serialized Hash in a separate database table. Namespaces and defaults included.

## Usage

### Define settings

```ruby
class User < ActiveRecord::Base
  has_settings do |s|
    s.key :dashboard, :defaults => { :theme => 'blue', :view => 'monthly', :filter => false }
    s.key :calendar,  :defaults => { :scope => 'company'}
  end
end
```

If no defaults are needed, a simplified syntax can be used:

```ruby
class User < ActiveRecord::Base
  has_settings :dashboard, :calendar
end
```

Every setting is handled by the class `RailsSettings::SettingObject`. You can use your own class, e.g. for validations:

```ruby
class Project < ActiveRecord::Base
  has_settings :info, :class_name => 'ProjectSettingObject'
end

class ProjectSettingObject < RailsSettings::SettingObject
  validate do
    unless self.owner_name.present? && self.owner_name.is_a?(String)
      errors.add(:base, "Owner name is missing")
    end
  end
end
```

### Set settings

```ruby
user = User.find(1)
user.settings(:dashboard).theme = 'black'
user.settings(:calendar).scope = 'all'
user.settings(:calendar).display = 'daily'
user.save! # saves new or changed settings, too
```

or

```ruby
user = User.find(1)
user.settings(:dashboard).update_attributes! :theme => 'black'
user.settings(:calendar).update_attributes! :scope => 'all', :display => 'dialy'
```

### Get settings

```ruby
user = User.find(1)
user.settings(:dashboard).theme
# => 'black

user.settings(:dashboard).view
# => 'monthly'  (it's the default)

user.settings(:calendar).scope
# => 'all'
```

### Using scopes

```ruby
User.with_settings
# => all users having any setting

User.without_settings
# => all users without having any setting

User.with_settings_for(:calendar)
# => all users having a setting for 'calender'

User.without_settings_for(:calendar)
# => all users without having settings for 'calendar'
```

### Defaults as Proc
```ruby
class User < ActiveRecord::Base
  has_settings :calendar, :defaults => Proc.new{ |target| target.company.settings(:calendar)._all }
end

class Company < ActiveRecord::Base
  has_settings :calendar, :defaults => { view: 'week' }
end

user = User.new
user.settings(:calendar).view
# => 'week'

user.settings(:calendar)._all
# => { view: 'week' }
```
Warning! Be carefull with User.default_settings, it contains Proc instead of Hash.

## Requirements

* Ruby 1.9.3 or 2.0.0
* Rails 3.1 or greater (including Rails 4)

## Installation

Include the gem in your Gemfile und run `bundle` to install it:

```ruby
gem 'ledermann-rails-settings', :require => 'rails-settings'
```

Generate and run the migration:

```shell
rails g rails_settings:migration
rake db:migrate
```

## Compatibility

Version 2 is a complete rewrite and has a new DSL, so it's **not** compatible with Version 1. In addition, Rails 2.3 is not supported anymore. But the database schema is unchanged, so you can continue to use the data created by 1.x, no conversion is needed.

If you don't want to upgrade, you find the old version in the [1.x](https://github.com/ledermann/rails-settings/commits/1.x) branch. But don't expect any updates there.

## License

MIT License

Copyright (c) 2013 [Georg Ledermann](http://www.georg-ledermann.de)

This gem is a complete rewrite of [rails-settings](https://github.com/Squeegy/rails-settings) by [Alex Wayne](https://github.com/Squeegy)


text:
set -eu

start-bosh

source /tmp/local-bosh/director/env

#
# stemcell metadata/upload
#

tar -xzf stemcell/*.tgz $( tar -tzf stemcell/*.tgz | grep 'stemcell.MF' )
STEMCELL_OS=$( grep -E '^operating_system: ' stemcell.MF | awk '{print $2}' | tr -d "\"'" )
STEMCELL_VERSION=$( grep -E '^version: ' stemcell.MF | awk '{print $2}' | tr -d "\"'" )

bosh -n upload-stemcell stemcell/*.tgz

#
# release metadata/upload
#

cd release
tar -xzf *.tgz $( tar -tzf *.tgz | grep 'release.MF' )
RELEASE_NAME=$( grep -E '^name: ' release.MF | awk '{print $2}' | tr -d "\"'" )
RELEASE_VERSION=$( grep -E '^version: ' release.MF | awk '{print $2}' | tr -d "\"'" )

bosh -n upload-release *.tgz
cd ../

#
# compilation deployment
#

cat > manifest.yml <<EOF
---
name: compilation
releases:
- name: "$RELEASE_NAME"
  version: "$RELEASE_VERSION"
stemcells:
- alias: default
  os: "$STEMCELL_OS"
  version: "$STEMCELL_VERSION"
update:
  canaries: 1
  max_in_flight: 1
  canary_watch_time: 1000 - 90000
  update_watch_time: 1000 - 90000
instance_groups: []
EOF

bosh -n -d compilation deploy manifest.yml
bosh -d compilation export-release $RELEASE_NAME/$RELEASE_VERSION $STEMCELL_OS/$STEMCELL_VERSION

mv *.tgz compiled-release/$( echo *.tgz | sed "s/\.tgz$/-$( date -u +%Y%m%d%H%M%S ).tgz/" )
sha1sum compiled-release/*.tgz


text:
mkdir -p $HOME/.binaries
cd $HOME/.binaries

MAVEN_VERSION="$1"

if [ -z "$MAVEN_VERSION" ]
then
	echo "Unspecified Maven version" >&2
	exit 255
fi

if [ '!' -d "apache-maven-${MAVEN_VERSION}" ]
then
  if [ '!' -f "apache-maven-${MAVEN_VERSION}-bin.zip" ]
  then
    wget "https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.zip" || exit 1
  fi
  echo "Installing maven ${MAVEN_VERSION}"
  unzip -qq "apache-maven-${MAVEN_VERSION}-bin.zip" || exit 1
  rm -f "apache-maven-${MAVEN_VERSION}-bin.zip"
fi

exit 0


text:
module Arguments
  class ArgumentsNode < Treetop::Runtime::SyntaxNode
    def args
      elements
    end

    def eval!(locals = {})
      args.map do |arg|
        arg.eval!(locals)
      end
    end
  end

  class ArgumentNode < Treetop::Runtime::SyntaxNode
    def method_missing(method_name, *args)
      content.send(method_name, *args) if content.respond_to?(method_name)
    end

    def eval!(locals = {})
      content.eval!(locals)
    end
  end

  class HashNode < Treetop::Runtime::SyntaxNode
    def eval!(locals = {})
      {}.tap do |hash|
        pairs.elements.each do |pair|
          hash[pair.key.eval!(locals)] = pair.value.eval!(locals)
        end
      end
    end
  end

  class ArrayNode < Treetop::Runtime::SyntaxNode
    def args
      arguments.elements
    end

    def eval!(locals = {})
      args.map do |arg|
        arg.eval!(locals)
      end
    end
  end

  class MethodNode < Treetop::Runtime::SyntaxNode
    def name
      method_name.text_value
    end

    def args
      arguments.elements
    end

    def eval!(locals = {})
      args_string = arguments.text_value.strip
      Grunt::Evaluator.new(name, args_string, locals).eval!
    end
  end

  class InterpolatedStringNode < Treetop::Runtime::SyntaxNode
    def arguments
      string_arguments.elements
    end

    def eval!(locals = {})
      arguments.map do |argument|
        argument.eval!(locals)
      end.join("")
    end
  end

  class InterpolatedTextNode < Treetop::Runtime::SyntaxNode
    def eval!(locals = {})
      text_value
    end
  end

  class LiteralStringNode < Treetop::Runtime::SyntaxNode
    def eval!(locals = {})
      content.text_value
    end
  end

  class WordStringNode < Treetop::Runtime::SyntaxNode
    def eval!(locals = {})
      if text_value =~ /^:(.*)$/
        $~[1].to_sym
      else
        text_value.to_num
      end
    end
  end
end


text:
package co.edu.uniandes.csw.artwork.tests.selenium.pages.category;

import co.edu.uniandes.csw.artwork.dtos.minimum.CategoryDTO;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

public class CategoryDetailPage {

    @FindBy(id = "delete-category")
    private WebElement deleteBtn;

    @FindBy(id = "edit-category")
    private WebElement editBtn;

    @FindBy(id = "list-category")
    private WebElement listBtn;

    @FindBy(id = "name")
    private WebElement name;

    public void list() {
        listBtn.click();
    }

    public void edit() {
        editBtn.click();
    }

    public void delete() {
        deleteBtn.click();
    }

    public CategoryDTO getData() {
        CategoryDTO category = new CategoryDTO();
        category.setName(this.name.getText());
        return category;
    }
}


text:
package shiver.me.timbers.waiting;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import java.util.Collections;
import java.util.List;

import static java.lang.String.format;
import static java.util.Arrays.asList;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static shiver.me.timbers.data.random.RandomBooleans.someBoolean;
import static shiver.me.timbers.data.random.RandomEnums.someEnum;
import static shiver.me.timbers.data.random.RandomLongs.someLong;
import static shiver.me.timbers.data.random.RandomStrings.someString;

public class AbstractPropertyParserTest {

    @Rule
    public final ExpectedException expectedException = ExpectedException.none();

    private PropertyGetter propertyGetter;
    private AbstractPropertyParser parser;

    @Before
    public void setUp() {
        propertyGetter = mock(PropertyGetter.class);
        parser = new AbstractPropertyParser(propertyGetter) {
        };
    }

    @Test
    public void Can_get_a_long_property() {

        final String key = someString();
        final Long defaultValue = someLong();

        final Long expected = someLong();

        // Given
        given(propertyGetter.get(key, defaultValue)).willReturn(expected.toString());

        // When
        final Long actual = parser.getLongProperty(key, defaultValue);

        // Then
        assertThat(actual, is(expected));
    }

    @Test
    public void Can_get_a_boolean_property() {

        final String key = someString();
        final Boolean defaultValue = someBoolean();

        final Boolean expected = someBoolean();

        // Given
        given(propertyGetter.get(key, defaultValue)).willReturn(expected.toString());

        // When
        final Boolean actual = parser.getBooleanProperty(key, defaultValue);

        // Then
        assertThat(actual, is(expected));
    }

    @Test
    public void Can_get_an_enum_property() {

        final String key = someString();
        final AnEnum defaultValue = someEnum(AnEnum.class);

        final AnEnum expected = someEnum(AnEnum.class);

        // Given
        given(propertyGetter.get(key, defaultValue)).willReturn(expected.toString());

        // When
        final AnEnum actual = parser.getEnumProperty(key, defaultValue);

        // Then
        assertThat(actual, is(expected));
    }

    @Test
    public void Can_handle_an_invalid_enum_property_value() {

        final String invalidPropertyValue = someString();

        expectedException.expect(IllegalStateException.class);
        expectedException.expectMessage(containsString(invalidPropertyValue));

        final String key = someString();
        final AnEnum expected = someEnum(AnEnum.class);

        // Given
        given(propertyGetter.get(key, expected)).willReturn(invalidPropertyValue);

        // When
        parser.getEnumProperty(key, expected);
    }

    @Test
    public void Can_get_a_single_class_property() {

        final String key = someString();

        // Given
        given(propertyGetter.get(key)).willReturn(AClass.class.getName());

        // When
        final List<Class<AClass>> actual = parser.getClassProperty(key, Collections.<Class<AClass>>emptyList());

        // Then
        assertThat(actual, contains(AClass.class));
    }

    @Test
    public void Can_get_a_multiple_class_property() {

        final String key = someString();

        // Given
        given(propertyGetter.get(key)).willReturn(format("%s,%s", AClass.class.getName(), AnotherClass.class.getName()));

        // When
        final List<Class<AClass>> actual = parser.getClassProperty(key, Collections.<Class<AClass>>emptyList());

        // Then
        assertThat(actual, contains(AClass.class, AnotherClass.class));
    }

    @Test
    public void Can_merge_a_class_property_with_a_manually_set_class() {

        final String key = someString();

        // Given
        given(propertyGetter.get(key)).willReturn(AClass.class.getName());

        // When
        @SuppressWarnings("unchecked")
        final List<Class<? extends AClass>> actual = parser.getClassProperty(key, (List) asList(AnotherClass.class));

        // Then
        assertThat(actual, contains((Class) AnotherClass.class, (Class) AClass.class));
    }

    @Test
    public void Will_get_an_empty_list_for_a_class_property_that_does_not_exist() {

        final String key = someString();

        // Given
        given(propertyGetter.get(key)).willReturn(null);

        // When
        final List<Class<AClass>> actual = parser.getClassProperty(key, Collections.<Class<AClass>>emptyList());

        // Then
        assertThat(actual, empty());
    }

    @Test(expected = IllegalStateException.class)
    public void Will_get_an_exception_for_a_class_that_does_not_exist() {

        final String key = someString();

        // Given
        given(propertyGetter.get(key)).willReturn("this.class.does.not.Exist");

        // When
        parser.getClassProperty(key, Collections.<Class<AClass>>emptyList());
    }

    @Test
    public void Can_get_a_single_instance_property() {

        final String key = someString();

        // Given
        given(propertyGetter.get(key)).willReturn(AClass.class.getName());

        // When
        final List<AClass> actual = parser.getInstanceProperty(key, Collections.<AClass>emptyList());

        // Then
        assertThat(actual, contains(instanceOf(AClass.class)));
    }

    @Test
    public void Can_get_a_multiple_instance_property() {

        final String key = someString();

        // Given
        given(propertyGetter.get(key)).willReturn(format("%s,%s", AClass.class.getName(), AnotherClass.class.getName()));

        // When
        final List<AClass> actual = parser.getInstanceProperty(key, Collections.<AClass>emptyList());

        // Then
        assertThat(actual, contains(instanceOf(AClass.class), instanceOf(AnotherClass.class)));
    }

    @Test
    public void Can_merge_an_instance_property_with_a_manually_set_property() {

        final String key = someString();

        // Given
        given(propertyGetter.get(key)).willReturn(AClass.class.getName());

        // When
        @SuppressWarnings("unchecked")
        final List<AClass> actual = parser.getInstanceProperty(key, asList((AClass) new AnotherClass()));

        // Then
        assertThat(actual, contains(instanceOf(AnotherClass.class), instanceOf(AClass.class)));
    }

    @Test
    public void Will_get_an_empty_list_for_an_instance_property_that_does_not_exist() {

        final String key = someString();

        // Given
        given(propertyGetter.get(key)).willReturn(null);

        // When
        final List<AClass> actual = parser.getInstanceProperty(key, Collections.<AClass>emptyList());

        // Then
        assertThat(actual, empty());
    }

    @Test(expected = IllegalStateException.class)
    public void Will_get_an_exception_for_an_instance_property_class_that_does_not_exist() {

        final String key = someString();

        // Given
        given(propertyGetter.get(key)).willReturn("this.class.does.not.Exist");

        // When
        parser.getInstanceProperty(key, Collections.<AClass>emptyList());
    }

    @Test(expected = IllegalStateException.class)
    public void Will_an_exception_for_an_instance_property_class_that_has_no_default_constructor() {

        final String key = someString();

        // Given
        given(propertyGetter.get(key)).willReturn(ANonDefaultClass.class.getName());

        // When
        parser.getInstanceProperty(key, Collections.<AClass>emptyList());
    }

    @Test(expected = IllegalStateException.class)
    public void Will_get_an_exception_for_an_instance_property_class_with_a_private_constructor() {

        final String key = someString();

        // Given
        given(propertyGetter.get(key)).willReturn(APrivateClass.class.getName());

        // When
        parser.getInstanceProperty(key, Collections.<AClass>emptyList());
    }

    private enum AnEnum {
        A,
        TEST,
        ENUM,
        FOR,
        TESTING
    }

    public static class AClass {
    }

    public static class AnotherClass extends AClass {
    }

    public static class ANonDefaultClass extends AClass {
        public ANonDefaultClass(Object argument) {
        }
    }

    private static class APrivateClass extends AClass {
    }
}


text:
package uk.ac.ox.zoo.seeg.abraid.mp.common.service.workflow.support;

import org.joda.time.DateTime;
import org.joda.time.DateTimeUtils;
import org.junit.Before;
import org.junit.Test;
import uk.ac.ox.zoo.seeg.abraid.mp.common.domain.DiseaseGroup;
import uk.ac.ox.zoo.seeg.abraid.mp.common.domain.DiseaseOccurrence;
import uk.ac.ox.zoo.seeg.abraid.mp.common.domain.DiseaseOccurrenceStatus;
import uk.ac.ox.zoo.seeg.abraid.mp.common.service.core.DiseaseService;
import uk.ac.ox.zoo.seeg.abraid.mp.common.service.workflow.DiseaseOccurrenceValidationService;

import java.util.Arrays;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.*;

public class AutomaticModelRunsEnablerTest {
    private DiseaseService diseaseService;
    private DiseaseOccurrenceValidationService diseaseOccurrenceValidationService;
    private AutomaticModelRunsEnabler automaticModelRunsEnabler;

    @Before
    public void setUp() {
        diseaseService = mock(DiseaseService.class);
        diseaseOccurrenceValidationService = mock(DiseaseOccurrenceValidationService.class);
        automaticModelRunsEnabler = new AutomaticModelRunsEnabler(diseaseService, diseaseOccurrenceValidationService, 7);

        DateTimeUtils.setCurrentMillisFixed(DateTime.now().getMillis());
    }

    @Test
    public void enableAutomaticModelRunsSavesAutomaticModelRunsStartDateOnDiseaseGroup() throws Exception {
        // Arrange
        int diseaseGroupId = 87;
        DiseaseGroup diseaseGroup = new DiseaseGroup(diseaseGroupId);
        when(diseaseService.getDiseaseGroupById(diseaseGroupId)).thenReturn(diseaseGroup);

        DateTime now = DateTime.now();
        DateTimeUtils.setCurrentMillisFixed(now.getMillis());

        // Act
        automaticModelRunsEnabler.enable(diseaseGroupId);

        // Assert
        verify(diseaseService).saveDiseaseGroup(diseaseGroup);
        assertThat(diseaseGroup.getAutomaticModelRunsStartDate()).isEqualTo(now);
    }

    @Test
    public void enableAutomaticModelRunsAddsValidationParametersToDiseaseOccurrence() throws Exception {
        // Arrange
        int diseaseGroupId = 87;

        DiseaseGroup diseaseGroup = new DiseaseGroup(diseaseGroupId);
        when(diseaseService.getDiseaseGroupById(diseaseGroupId)).thenReturn(diseaseGroup);

        DiseaseOccurrence occurrence1 = new DiseaseOccurrence();
        DiseaseOccurrence occurrence2 = new DiseaseOccurrence();
        occurrence1.setOccurrenceDate(DateTime.now().minusDays(21));
        occurrence2.setOccurrenceDate(DateTime.now().minusDays(1));
        when(diseaseService.getDiseaseOccurrencesYetToHaveFinalWeightingAssigned(
                diseaseGroupId,
                DiseaseOccurrenceStatus.READY,
                DiseaseOccurrenceStatus.AWAITING_BATCHING
        )).thenReturn(
                Arrays.asList(occurrence1, occurrence2)
        );

        // Act
        automaticModelRunsEnabler.enable(diseaseGroupId);

        // Assert
        assertThat(occurrence1.getStatus()).isEqualTo(DiseaseOccurrenceStatus.DISCARDED_UNUSED);
        assertThat(occurrence1.getFinalWeighting()).isNull();
        assertThat(occurrence1.getFinalWeightingExcludingSpatial()).isNull();

        verify(diseaseOccurrenceValidationService).addValidationParameters(Arrays.asList(occurrence2));
        verify(diseaseService).saveDiseaseOccurrence(occurrence1);
        verify(diseaseService).saveDiseaseOccurrence(occurrence2);
    }
}


text:
var TaskNavigation = React.createClass({
  render: function() {
    return (

            9

You have 9 tasks

              {/* inner menu: contains the actual data */}

{/* Task item */}

                      Design some buttons
                      20%

                        20% Complete

                {/* end task item */}

{/* Task item */}

                      Create a nice theme
                      40%

                        40% Complete

                {/* end task item */}

{/* Task item */}

                      Some task I need to do
                      60%

                        60% Complete

                {/* end task item */}

{/* Task item */}

                      Make beautiful transitions
                      80%

                        80% Complete

                {/* end task item */}

              View all tasks

    );
  }
});


text:
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:p="http://www.springframework.org/schema/p"
	xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
	xmlns:oxm="http://www.springframework.org/schema/oxm" xmlns:mvc="http://www.springframework.org/schema/mvc"
	xmlns:util="http://www.springframework.org/schema/util" xmlns:task="http://www.springframework.org/schema/task"

	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
           http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
           http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm-3.0.xsd
           http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
           http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
           http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
           http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd">
	<!-- 备注:由于JS使用的上传控件,在FF下Session会失效,无法通过拦截器的UC验证。 所以,增加此配置,跳过拦截器验证。相关代码:CreativeFileUploadController -->
	<bean id="abstractExcludePatternsInterceptor" abstract="true">
		<constructor-arg index="0">
			<list>
				<value>
					/login
				</value>
				<value>
					/logout
				</value>
			</list>
		</constructor-arg>
	</bean>

	<mvc:interceptors>
		<mvc:interceptor>
			<mvc:mapping path="/navi/**" />
			<bean
				class="com.baidu.beidou.navimgr.auth.interceptor.AccessLogInterceptor">
			</bean>
		</mvc:interceptor>
		<mvc:interceptor>
			<mvc:mapping path="/navi/*" />
			<bean class="com.baidu.beidou.navimgr.auth.interceptor.UserIdInterceptor">
			</bean>
		</mvc:interceptor>
		<mvc:interceptor>
			<mvc:mapping path="/navi/**" />
			<bean parent="abstractExcludePatternsInterceptor"
				class="com.baidu.beidou.navimgr.auth.interceptor.LoginInterceptor">
				<property name="notJsonPathList">
					<list>
						<value>/login</value>
					</list>
				</property>
			</bean>
		</mvc:interceptor>
		<mvc:interceptor>
			<mvc:mapping path="/navi/**" />
			<bean parent="abstractExcludePatternsInterceptor"
				class="com.baidu.beidou.navimgr.auth.interceptor.PriviledgeInterceptor">
				<property name="notJsonPathList">
					<list>
						<value>/login</value>
					</list>
				</property>
			</bean>
		</mvc:interceptor>
	</mvc:interceptors>

</beans>


text:
import json

from openstackclient.tests.functional import base

class AvailabilityZoneTests(base.TestCase):
    """Functional tests for availability zone. """

    def test_availability_zone_list(self):
        cmd_output = json.loads(self.openstack(
            'availability zone list -f json'))
        zones = [x['Zone Name'] for x in cmd_output]
        self.assertIn(
            'internal',
            zones
        )
        self.assertIn(
            'nova',
            zones
        )


text:
package org.apache.storm.topology;

import org.apache.storm.generated.GlobalStreamId;
import org.apache.storm.generated.Grouping;
import org.apache.storm.spout.CheckpointSpout;
import org.apache.storm.state.KeyValueState;
import org.apache.storm.state.State;
import org.apache.storm.task.OutputCollector;
import org.apache.storm.task.TopologyContext;
import org.apache.storm.tuple.Tuple;
import org.apache.storm.topology.IStatefulBolt;
import org.apache.storm.topology.StatefulBoltExecutor;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;

import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import static org.apache.storm.spout.CheckPointState.Action.*;
import static org.apache.storm.spout.CheckpointSpout.*;

/**
 * Unit tests for {@link StatefulBoltExecutor}
 */
public class StatefulBoltExecutorTest {
    StatefulBoltExecutor<KeyValueState<String, String>> executor;
    IStatefulBolt<KeyValueState<String, String>> mockBolt;
    TopologyContext mockTopologyContext;
    Tuple mockTuple;
    Tuple mockCheckpointTuple;
    Map<String, Object> mockStormConf = new HashMap<>();
    OutputCollector mockOutputCollector;
    State mockState;
    Map<GlobalStreamId, Grouping> mockGlobalStream;
    Set<GlobalStreamId> mockStreamIds;
    @Before
    public void setUp() throws Exception {
        mockBolt = Mockito.mock(IStatefulBolt.class);
        executor = new StatefulBoltExecutor<>(mockBolt);
        GlobalStreamId mockGlobalStreamId = Mockito.mock(GlobalStreamId.class);
        Mockito.when(mockGlobalStreamId.get_streamId()).thenReturn(CheckpointSpout.CHECKPOINT_STREAM_ID);
        mockStreamIds = new HashSet<>();
        mockStreamIds.add(mockGlobalStreamId);
        mockTopologyContext = Mockito.mock(TopologyContext.class);
        mockOutputCollector = Mockito.mock(OutputCollector.class);
        mockGlobalStream = Mockito.mock(Map.class);
        mockState = Mockito.mock(State.class);
        Mockito.when(mockTopologyContext.getThisComponentId()).thenReturn("test");
        Mockito.when(mockTopologyContext.getThisTaskId()).thenReturn(1);
        Mockito.when(mockTopologyContext.getThisSources()).thenReturn(mockGlobalStream);
        Mockito.when(mockTopologyContext.getComponentTasks(Mockito.anyString())).thenReturn(Collections.singletonList(1));
        Mockito.when(mockGlobalStream.keySet()).thenReturn(mockStreamIds);
        mockTuple = Mockito.mock(Tuple.class);
        mockCheckpointTuple = Mockito.mock(Tuple.class);
        executor.prepare(mockStormConf, mockTopologyContext, mockOutputCollector, mockState);
    }

    @Test
    public void testHandleTupleBeforeInit() throws Exception {
        Mockito.when(mockTuple.getSourceStreamId()).thenReturn("default");
        executor.execute(mockTuple);
        Mockito.verify(mockBolt, Mockito.times(0)).execute(Mockito.any(Tuple.class));
    }

    @Test
    public void testHandleTuple() throws Exception {
        Mockito.when(mockTuple.getSourceStreamId()).thenReturn("default");
        executor.execute(mockTuple);
        Mockito.when(mockCheckpointTuple.getSourceStreamId()).thenReturn(CheckpointSpout.CHECKPOINT_STREAM_ID);
        Mockito.when(mockCheckpointTuple.getValueByField(CHECKPOINT_FIELD_ACTION)).thenReturn(INITSTATE);
        Mockito.when(mockCheckpointTuple.getLongByField(CHECKPOINT_FIELD_TXID)).thenReturn(new Long(0));
        Mockito.doNothing().when(mockOutputCollector).ack(mockCheckpointTuple);
        executor.execute(mockCheckpointTuple);
        Mockito.verify(mockBolt, Mockito.times(1)).execute(mockTuple);
        Mockito.verify(mockBolt, Mockito.times(1)).initState(Mockito.any(KeyValueState.class));
    }

    @Test
    public void testRollback() throws Exception {
        Mockito.when(mockTuple.getSourceStreamId()).thenReturn("default");
        executor.execute(mockTuple);
        Mockito.when(mockCheckpointTuple.getSourceStreamId()).thenReturn(CheckpointSpout.CHECKPOINT_STREAM_ID);
        Mockito.when(mockCheckpointTuple.getValueByField(CHECKPOINT_FIELD_ACTION)).thenReturn(ROLLBACK);
        Mockito.when(mockCheckpointTuple.getLongByField(CHECKPOINT_FIELD_TXID)).thenReturn(new Long(0));
        Mockito.doNothing().when(mockOutputCollector).ack(mockCheckpointTuple);
        executor.execute(mockCheckpointTuple);
        Mockito.verify(mockState, Mockito.times(1)).rollback();
    }

    @Test
    public void testCommit() throws Exception {
        Mockito.when(mockTuple.getSourceStreamId()).thenReturn("default");
        executor.execute(mockTuple);
        Mockito.when(mockCheckpointTuple.getSourceStreamId()).thenReturn(CheckpointSpout.CHECKPOINT_STREAM_ID);
        Mockito.when(mockCheckpointTuple.getValueByField(CHECKPOINT_FIELD_ACTION)).thenReturn(COMMIT);
        Mockito.when(mockCheckpointTuple.getLongByField(CHECKPOINT_FIELD_TXID)).thenReturn(new Long(0));
        Mockito.doNothing().when(mockOutputCollector).ack(mockCheckpointTuple);
        executor.execute(mockCheckpointTuple);
        Mockito.verify(mockBolt, Mockito.times(1)).preCommit(new Long(0));
        Mockito.verify(mockState, Mockito.times(1)).commit(new Long(0));
    }

    @Test
    public void testPrepareAndRollbackBeforeInitstate() throws Exception {
        Mockito.when(mockTuple.getSourceStreamId()).thenReturn("default");
        executor.execute(mockTuple);
        Mockito.when(mockCheckpointTuple.getSourceStreamId()).thenReturn(CheckpointSpout.CHECKPOINT_STREAM_ID);
        Mockito.when(mockCheckpointTuple.getValueByField(CHECKPOINT_FIELD_ACTION)).thenReturn(PREPARE);
        Mockito.when(mockCheckpointTuple.getLongByField(CHECKPOINT_FIELD_TXID)).thenReturn(new Long(100));
        executor.execute(mockCheckpointTuple);
        Mockito.verify(mockOutputCollector, Mockito.times(1)).fail(mockCheckpointTuple);

        Mockito.when(mockCheckpointTuple.getValueByField(CHECKPOINT_FIELD_ACTION)).thenReturn(ROLLBACK);
        Mockito.when(mockCheckpointTuple.getLongByField(CHECKPOINT_FIELD_TXID)).thenReturn(new Long(100));
        Mockito.doNothing().when(mockOutputCollector).ack(mockCheckpointTuple);
        executor.execute(mockCheckpointTuple);
        Mockito.verify(mockState, Mockito.times(1)).rollback();
    }

    @Test
    public void testCommitBeforeInitstate() throws Exception {
        Mockito.when(mockTuple.getSourceStreamId()).thenReturn("default");
        Mockito.when(mockCheckpointTuple.getSourceStreamId()).thenReturn(CheckpointSpout.CHECKPOINT_STREAM_ID);
        Mockito.when(mockCheckpointTuple.getValueByField(CHECKPOINT_FIELD_ACTION)).thenReturn(COMMIT);
        Mockito.when(mockCheckpointTuple.getLongByField(CHECKPOINT_FIELD_TXID)).thenReturn(new Long(100));
        executor.execute(mockCheckpointTuple);
        Mockito.verify(mockOutputCollector, Mockito.times(1)).ack(mockCheckpointTuple);

        Mockito.when(mockCheckpointTuple.getValueByField(CHECKPOINT_FIELD_ACTION)).thenReturn(ROLLBACK);
        Mockito.when(mockCheckpointTuple.getLongByField(CHECKPOINT_FIELD_TXID)).thenReturn(new Long(100));
        executor.execute(mockCheckpointTuple);
        Mockito.verify(mockState, Mockito.times(1)).rollback();
    }

    @Test
    public void testPrepareAndCommit() throws Exception {
        Mockito.when(mockTuple.getSourceStreamId()).thenReturn("default");
        Mockito.when(mockCheckpointTuple.getSourceStreamId()).thenReturn(CheckpointSpout.CHECKPOINT_STREAM_ID);
        Mockito.when(mockCheckpointTuple.getValueByField(CHECKPOINT_FIELD_ACTION)).thenReturn(INITSTATE);
        Mockito.when(mockCheckpointTuple.getLongByField(CHECKPOINT_FIELD_TXID)).thenReturn(new Long(0));
        executor.execute(mockCheckpointTuple);

        executor.execute(mockTuple);
        Mockito.when(mockCheckpointTuple.getSourceStreamId()).thenReturn(CheckpointSpout.CHECKPOINT_STREAM_ID);
        Mockito.when(mockCheckpointTuple.getValueByField(CHECKPOINT_FIELD_ACTION)).thenReturn(PREPARE);
        Mockito.when(mockCheckpointTuple.getLongByField(CHECKPOINT_FIELD_TXID)).thenReturn(new Long(100));
        executor.execute(mockCheckpointTuple);
        executor.execute(mockTuple);
        Mockito.when(mockCheckpointTuple.getValueByField(CHECKPOINT_FIELD_ACTION)).thenReturn(COMMIT);
        Mockito.when(mockCheckpointTuple.getLongByField(CHECKPOINT_FIELD_TXID)).thenReturn(new Long(100));
        executor.execute(mockCheckpointTuple);
        mockOutputCollector.ack(mockTuple);
        Mockito.verify(mockState, Mockito.times(1)).commit(new Long(100));
        Mockito.verify(mockBolt, Mockito.times(2)).execute(mockTuple);
        Mockito.verify(mockOutputCollector, Mockito.times(1)).ack(mockTuple);
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Asteroma tenerrimum var. gei Sacc.

### Remarks
null


text:
layout: page
title: Seattle Police Officer 5893 Thomas S. Yoon
permalink: /information/agencies/city_of_seattle/seattle_police_department/copbook/5893/
---

**Age as of Feb. 24, 2016:** 48


text:
@echo off
cd %~dp0

SETLOCAL
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe

IF EXIST %CACHED_NUGET% goto copynuget
echo Downloading latest version of NuGet.exe...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'"

:copynuget
IF EXIST .nuget\nuget.exe goto restore
md .nuget
copy %CACHED_NUGET% .nuget\nuget.exe > nul

:restore
IF EXIST packages\KoreBuild goto run
.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
.nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion

IF "%SKIP_KRE_INSTALL%"=="1" goto run
CALL packages\KoreBuild\build\kvm upgrade -svr50 -x86
CALL packages\KoreBuild\build\kvm install default -svrc50 -x86

:run
CALL packages\KoreBuild\build\kvm use default -svr50 -x86
packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*


text:
[![Go Report Card](https://goreportcard.com/badge/github.com/pwed/disttube)](https://goreportcard.com/report/github.com/pwed/disttube)

# DistTube
**A decentralized video hosting platform.**

**_Currently in development don't expect everything to work!_**

## Installation
*As of 08/03/2017*

Dependencies: GoLang (1.8 or newer), ffmpeg

### Windows

Download Golang from the official website and install

Download ffmpeg and add ffmpeg\bin to your %PATH%

```
go get github.com/pwed/disttube
```

### Linux

```
sudo apt install ffmpeg golang -y
go get github.com/pwed/disttube
```

*If ffmpeg complains about aac being experimental then you need a newer version*

*If using an earlier version of GoLang you will need to set up a GOPATH and GOROOT*

### Mac

Look at the linux instructions and try your luck.

## Use

From $GOPATH/src/github.com/pwed/disttube, run `go run main.go` in your terminal.

Open `localhost:8080` in your browser.

Have fun.

## TODO

- [x] Ingestion _(is mostly working :D )_
- [ ] Users
- [ ] Channels
- [ ] Video Player
- [ ] Video Browser
- [ ] Admin Tools
- [ ] Config File Setup
- [ ] Docker Container
- [ ] Aggregation Server


text:
//
//  GDataGoogleBaseMetadataAttribute.m
//

#import "GDataGoogleBaseMetadataAttribute.h"
#import "GDataEntryGoogleBase.h"

@implementation GDataGoogleBaseMetadataAttribute
// for gm:attribute, like
// <gm:attribute name='item type' type='text' count='116353'>
//   <gm:value count='87269'>products</gm:value>
//   <gm:value count='2401'>produkte</gm:value>
// </gm:attribute>

// this object may be an extension, so declare its extension characteristics

+ (NSString *)extensionElementURI       { return kGDataNamespaceGoogleBaseMetadata; }
+ (NSString *)extensionElementPrefix    { return kGDataNamespaceGoogleBaseMetadataPrefix; }
+ (NSString *)extensionElementLocalName { return @"attribute"; }

+ (GDataGoogleBaseMetadataAttribute *)metadataAttributeWithType:(NSString *)type
                      name:(NSString *)name
                      count:(NSNumber *)count {

  GDataGoogleBaseMetadataAttribute *obj = [[[GDataGoogleBaseMetadataAttribute alloc] init] autorelease];
  [obj setName:name];
  [obj setType:type];
  [obj setCount:count];
  return obj;
}

- (void)addExtensionDeclarations {

  [super addExtensionDeclarations];

  // gm:attribute may contain gm:value
  [self addExtensionDeclarationForParentClass:[self class]
                                   childClass:[GDataGoogleBaseMetadataValue class]];

}

- (id)initWithXMLElement:(NSXMLElement *)element
                  parent:(GDataObject *)parent {
  self = [super initWithXMLElement:element
                            parent:parent];
  if (self) {
    [self setName:[self stringForAttributeName:@"name"
                                  fromElement:element]];
    [self setType:[self stringForAttributeName:@"type"
                                   fromElement:element]];
    [self setCount:[self intNumberForAttributeName:@"count"
                                                fromElement:element]];
  }
  return self;
}

- (void)dealloc {
  [name_ release];
  [type_ release];
  [count_ release];
  [super dealloc];
}

- (id)copyWithZone:(NSZone *)zone {
  GDataGoogleBaseMetadataAttribute* newObj = [super copyWithZone:zone];
  [newObj setName:[self name]];
  [newObj setType:[self type]];
  [newObj setCount:[self count]];
  return newObj;
}

- (BOOL)isEqual:(GDataGoogleBaseMetadataAttribute *)other {
  if (self == other) return YES;
  if (![other isKindOfClass:[GDataGoogleBaseMetadataAttribute class]]) return NO;

  return [super isEqual:other]
    && AreEqualOrBothNil([self name], [other name])
    && AreEqualOrBothNil([self type], [other type])
    && AreEqualOrBothNil([self count], [other count]);
}

- (NSMutableArray *)itemsForDescription {
  NSMutableArray *items = [NSMutableArray array];

  [self addToArray:items objectDescriptionIfNonNil:name_   withName:@"name"];
  [self addToArray:items objectDescriptionIfNonNil:type_   withName:@"type"];
  [self addToArray:items objectDescriptionIfNonNil:count_  withName:@"count"];

  if ([[self values] count]) {
    [self addToArray:items objectDescriptionIfNonNil:[self values]  withName:@"metadataValues"];
  }

  return items;
}

- (NSXMLElement *)XMLElement {

  NSXMLElement *element = [self XMLElementWithExtensionsAndDefaultName:@"gm:attribute"];

  [self addToElement:element attributeValueIfNonNil:[self name]  withName:@"name"];
  [self addToElement:element attributeValueIfNonNil:[self type]  withName:@"type"];
  [self addToElement:element attributeValueIfNonNil:[[self count] stringValue]
                                           withName:@"count"];

  return element;
}

- (NSString *)name {
  return name_;
}

- (void)setName:(NSString *)str {
  [name_ autorelease];
  name_ = [str copy];
}

- (NSString *)type {
  return type_;
}

- (void)setType:(NSString *)str {
  [type_ autorelease];
  type_ = [str copy];
}

- (NSNumber *)count {
  return count_;
}

- (void)setCount:(NSNumber *)num {
  [count_ autorelease];
  count_ = [num copy];
}

#pragma mark -

- (NSArray *)values {
  NSArray *values = [self objectsForExtensionClass:[GDataGoogleBaseMetadataValue class]];
  return values;
}

- (void)setValues:(NSArray *)values {
  [self setObjects:values forExtensionClass:[GDataGoogleBaseMetadataValue class]];
}

- (void)addValue:(GDataGoogleBaseMetadataValue *)value {
  [self addObject:value forExtensionClass:[GDataGoogleBaseMetadataValue class]];
}

@end


text:
using Robust.Shared.Random;

namespace Content.Server.StationEvents.Events;

public sealed class BluespaceArtifact : StationEventSystem
{
    [Dependency] private readonly IRobustRandom _random = default!;

    public override string Prototype => "BluespaceArtifact";

    public readonly string ArtifactSpawnerPrototype = "RandomArtifactSpawner";
    public readonly string ArtifactFlashPrototype = "EffectFlashBluespace";

    public readonly List<string> PossibleSighting = new()
    {
        "bluespace-artifact-sighting-1",
        "bluespace-artifact-sighting-2",
        "bluespace-artifact-sighting-3",
        "bluespace-artifact-sighting-4",
        "bluespace-artifact-sighting-5",
        "bluespace-artifact-sighting-6",
        "bluespace-artifact-sighting-7"
    };

    public override void Added()
    {
        base.Added();

        var str = Loc.GetString("bluespace-artifact-event-announcement",
            ("sighting", Loc.GetString(_random.Pick(PossibleSighting))));
        ChatSystem.DispatchGlobalAnnouncement(str, colorOverride: Color.FromHex("#18abf5"));
    }

    public override void Started()
    {
        base.Started();

        if (!TryFindRandomTile(out _, out _, out _, out var coords))
            return;

        EntityManager.SpawnEntity(ArtifactSpawnerPrototype, coords);
        EntityManager.SpawnEntity(ArtifactFlashPrototype, coords);

        Sawmill.Info($"Spawning random artifact at {coords}");
    }
}


text:
#region Copyright
//
#endregion
namespace Onspring.API.SDK.Models
{
    /// <summary>
    /// Represents the response for getting applications
    /// </summary>
    public class GetPagedAppsResponse : PagedResponse<App>
    {
    }
}


text:
package org.apache.archiva.metadata.model.facets;

import org.apache.archiva.metadata.model.MetadataFacet;

import java.util.HashMap;
import java.util.Map;

public class RepositoryProblemFacet
    implements MetadataFacet
{
    public static final String FACET_ID = "org.apache.archiva.reports";

    private String repositoryId;

    private String namespace;

    private String project;

    private String version;

    private String id;

    private String message;

    private String problem;

    @Override
    public String getFacetId()
    {
        return FACET_ID;
    }

    @Override
    public String getName()
    {
        return createName( namespace, project, version, id );
    }

    @Override
    public Map<String, String> toProperties()
    {
        Map<String, String> map = new HashMap<>();
        map.put( "repositoryId", repositoryId );
        map.put( "namespace", namespace );
        map.put( "project", project );
        map.put( "version", version );
        if ( id != null )
        {
            map.put( "id", id );
        }
        map.put( "message", message );
        map.put( "problem", problem );
        return map;
    }

    @Override
    public void fromProperties( Map<String, String> properties )
    {
        repositoryId = properties.get( "repositoryId" );
        namespace = properties.get( "namespace" );
        project = properties.get( "project" );
        version = properties.get( "version" );
        id = properties.get( "id" );
        message = properties.get( "message" );
        problem = properties.get( "problem" );
    }

    public void setRepositoryId( String repositoryId )
    {
        this.repositoryId = repositoryId;
    }

    public void setNamespace( String namespace )
    {
        this.namespace = namespace;
    }

    public String getRepositoryId()
    {
        return repositoryId;
    }

    public String getNamespace()
    {
        return namespace;
    }

    public void setProject( String project )
    {
        this.project = project;
    }

    public String getProject()
    {
        return project;
    }

    public void setVersion( String version )
    {
        this.version = version;
    }

    public String getVersion()
    {
        return version;
    }

    public void setId( String id )
    {
        this.id = id;
    }

    public String getId()
    {
        return id;
    }

    public void setMessage( String message )
    {
        this.message = message;
    }

    public String getMessage()
    {
        return message;
    }

    public void setProblem( String problem )
    {
        this.problem = problem;
    }

    public String getProblem()
    {
        return problem;
    }

    public static String createName( String namespace, String project, String projectVersion, String id )
    {
        String name = namespace + "/" + project + "/" + projectVersion;
        if ( id != null )
        {
            name = name + "/" + id;
        }
        return name;
    }
}