text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Chi siamo - Gruppo Artistico Spinea</title>

    <link href="css/bootstrap.css" rel="stylesheet">

    <link href="css/business-casual.css" rel="stylesheet">

    <link href="font-awesome-4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <link href="css/custom.css" rel="stylesheet">

    <link href="http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/css?family=Josefin+Slab:100,300,400,600,700,100italic,300italic,400italic,600italic,700italic" rel="stylesheet" type="text/css">

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>

                Gruppo Artistico Spinea

                        Home

                        Galleria

                        Pittori

                        Eventi

                        Chi siamo

Chi Siamo
                        Gruppo Artistico Spinea

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugiat, vitae, distinctio, possimus repudiandae cupiditate ipsum excepturi dicta neque eaque voluptates tempora veniam esse earum sapiente optio deleniti consequuntur eos voluptatem.

Spinea
                        Dove Trovarci

Numero:
                        123.456.7890

Email:
                        gruppoartisticospinea@gmail.com

Indirizzo:
                        3481 Melrose Place

Beverly Hills, CA 90210

                            Comune di Spinea

Copyright © Gruppo Artistico Spinea 2015

Seguici su:

redpajama_set_name: RedPajamaGithub


text:
package net.minecraft.command;

import java.util.List;
import net.minecraft.entity.player.PlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.BlockPos;

public class CommandSetSpawnpoint extends CommandBase
{
    /**
     * Gets the name of the command
     */
    public String getCommandName()
    {
        return "spawnpoint";
    }

    /**
     * Return the required permission level for this command.
     */
    public int getRequiredPermissionLevel()
    {
        return 2;
    }

    /**
     * Gets the usage string for the command.
     */
    public String getCommandUsage(CommandSender sender)
    {
        return "commands.spawnpoint.usage";
    }

    /**
     * Callback when the command is invoked
     */
    public void processCommand(CommandSender sender, String[] args) throws CommandException
    {
        if (args.length > 1 && args.length < 4)
        {
            throw new WrongUsageException("commands.spawnpoint.usage", new Object[0]);
        }
        else
        {
            PlayerMP entityplayermp = args.length > 0 ? getPlayer(sender, args[0]) : getCommandSenderAsPlayer(sender);
            BlockPos blockpos = args.length > 3 ? parseBlockPos(sender, args, 1, true) : entityplayermp.getPosition();

            if (entityplayermp.worldObj != null)
            {
                entityplayermp.setSpawnPoint(blockpos, true);
                notifyOperators(sender, this, "commands.spawnpoint.success", new Object[] {entityplayermp.getName(), Integer.valueOf(blockpos.getX()), Integer.valueOf(blockpos.getY()), Integer.valueOf(blockpos.getZ())});
            }
        }
    }

    public List<String> addTabCompletionOptions(CommandSender sender, String[] args, BlockPos pos)
    {
        return args.length == 1 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()) : (args.length > 1 && args.length <= 4 ? func_175771_a(args, 1, pos) : null);
    }

    /**
     * Return whether the specified command parameter index is a username parameter.
     */
    public boolean isUsernameIndex(String[] args, int index)
    {
        return index == 0;
    }
}


text:
#include <Interface/Modules/Math/CreateGeometricTransformDialog.h>
#include <Modules/Math/CreateGeometricTransform.h>
#include <Core/Algorithms/Base/AlgorithmVariableNames.h>
#include <QtGui>

using namespace SCIRun::Gui;
using namespace SCIRun::Modules::Math;
using namespace SCIRun::Dataflow::Networks;
using namespace SCIRun::Core::Algorithms::Math;

CreateGeometricTransformDialog::CreateGeometricTransformDialog(const std::string& name, ModuleStateHandle state,
	QWidget* parent/* = 0*/)
	: ModuleDialogGeneric(state, parent)
{
	setupUi(this);
	setWindowTitle(QString::fromStdString(name));
	fixSize();
  WidgetStyleMixin::tabStyle(transformTabWidget_);

  auto tabIndex = state_->getValue(Parameters::TransformType).toInt();
  if (tabIndex >= 0)
  {
    transformTabWidget_->setCurrentIndex(tabIndex);
  }
  else
  {
    resetValues();
    resetFieldMap();
  }

  addRadioButtonGroupManager({ preMultiplyRadioButton_, postMultiplyRadioButton_ }, Parameters::MultiplyRadioButton);
  addDoubleSpinBoxManager(translateVectorXDoubleSpinBox_, Parameters::TranslateVectorX);
  addDoubleSpinBoxManager(translateVectorYDoubleSpinBox_, Parameters::TranslateVectorY);
  addDoubleSpinBoxManager(translateVectorZDoubleSpinBox_, Parameters::TranslateVectorZ);
  addDoubleSpinBoxManager(scaleFixedPointXDoubleSpinBox_, Parameters::ScalePointX);
  addDoubleSpinBoxManager(scaleFixedPointYDoubleSpinBox_, Parameters::ScalePointY);
  addDoubleSpinBoxManager(scaleFixedPointZDoubleSpinBox_, Parameters::ScalePointZ);
  addDoubleSpinBoxManager(logScaleDoubleSpinBox_, Parameters::LogScale);
  addDoubleSpinBoxManager(logScaleXDoubleSpinBox_, Parameters::LogScaleX);
  addDoubleSpinBoxManager(logScaleYDoubleSpinBox_, Parameters::LogScaleY);
  addDoubleSpinBoxManager(logScaleZDoubleSpinBox_, Parameters::LogScaleZ);
  addDoubleSpinBoxManager(rotationFixedPointXDoubleSpinBox_, Parameters::RotatePointX);
  addDoubleSpinBoxManager(rotationFixedPointYDoubleSpinBox_, Parameters::RotatePointY);
  addDoubleSpinBoxManager(rotationFixedPointZDoubleSpinBox_, Parameters::RotatePointZ);
  addDoubleSpinBoxManager(rotateXAxisDoubleSpinBox_, Parameters::RotateAxisX);
  addDoubleSpinBoxManager(rotateYAxisDoubleSpinBox_, Parameters::RotateAxisY);
  addDoubleSpinBoxManager(rotateZAxisDoubleSpinBox_, Parameters::RotateAxisZ);
  addDoubleSpinBoxManager(rotateThetaDoubleSpinBox_, Parameters::RotateTheta);
  addDoubleSpinBoxManager(shearVectorXDoubleSpinBox_, Parameters::ShearVectorX);
  addDoubleSpinBoxManager(shearVectorYDoubleSpinBox_, Parameters::ShearVectorY);
  addDoubleSpinBoxManager(shearVectorZDoubleSpinBox_, Parameters::ShearVectorZ);
  addDoubleSpinBoxManager(shearFixedPlaneADoubleSpinBox_, Parameters::ShearPlaneA);
  addDoubleSpinBoxManager(shearFixedPlaneBDoubleSpinBox_, Parameters::ShearPlaneB);
  addDoubleSpinBoxManager(shearFixedPlaneCDoubleSpinBox_, Parameters::ShearPlaneC);
  addDoubleSpinBoxManager(shearFixedPlaneDDoubleSpinBox_, Parameters::ShearPlaneD);
  addDynamicLabelManager(fieldMapXLabel_, Parameters::FieldMapX);
  addDynamicLabelManager(fieldMapYLabel_, Parameters::FieldMapY);
  addDynamicLabelManager(fieldMapZLabel_, Parameters::FieldMapZ);
  addDoubleSpinBoxManager(uniformScaleDoubleSpinBox_, Parameters::UniformScale);
  addCheckBoxManager(resizeSeparablyCheckBox_, Parameters::ResizeSeparably);
  addCheckBoxManager(ignoreChangesCheckBox_, Parameters::IgnoreChanges);

  connect(transformTabWidget_, SIGNAL(currentChanged(int)), this, SLOT(changeTransformType(int)));
  connect(resetPushButton_, SIGNAL(clicked()), this, SLOT(resetValues()));
  connect(resetFieldMapPushButton_, SIGNAL(clicked()), this, SLOT(resetFieldMap()));
  connect(resetWidgetPushButton_, SIGNAL(clicked()), this, SLOT(resetWidget()));
  connect(cycleUpPushButton_, SIGNAL(clicked()), this, SLOT(cycleUp()));
  connect(cycleDownPushButton_, SIGNAL(clicked()), this, SLOT(cycleDown()));
  connect(swapXYPushButton_, SIGNAL(clicked()), this, SLOT(swapXY()));
  connect(swapYZPushButton_, SIGNAL(clicked()), this, SLOT(swapYZ()));
  connect(swapXZPushButton_, SIGNAL(clicked()), this, SLOT(swapXZ()));
  connect(flipXPushButton_, SIGNAL(clicked()), this, SLOT(flipX()));
  connect(flipYPushButton_, SIGNAL(clicked()), this, SLOT(flipY()));
  connect(flipZPushButton_, SIGNAL(clicked()), this, SLOT(flipZ()));
  connect(applyTransformPushButton_, SIGNAL(clicked()), this, SLOT(applyTransform()));
  connect(compositeTransformPushButton_, SIGNAL(clicked()), this, SLOT(compositeTransform()));
  connect(logCalculatorLineEdit_, SIGNAL(textEdited(const QString&)), this, SLOT(calculateLog(const QString&)));
}

void CreateGeometricTransformDialog::pullSpecial()
{
}

void CreateGeometricTransformDialog::changeTransformType(int index)
{
  state_->setValue(Parameters::TransformType, index);
}

void CreateGeometricTransformDialog::resetValues()
{
  state_->setValue(Parameters::TransformType, 0);
  state_->setValue(Parameters::MultiplyRadioButton, 1);
  state_->setValue(Parameters::TranslateVectorX, 0.0);
  state_->setValue(Parameters::TranslateVectorY, 0.0);
  state_->setValue(Parameters::TranslateVectorZ, 0.0);
  state_->setValue(Parameters::ScalePointX, 0.0);
  state_->setValue(Parameters::ScalePointY, 0.0);
  state_->setValue(Parameters::ScalePointZ, 0.0);
  state_->setValue(Parameters::LogScale, 0.0);
  state_->setValue(Parameters::LogScaleX, 0.0);
  state_->setValue(Parameters::LogScaleY, 0.0);
  state_->setValue(Parameters::LogScaleZ, 0.0);
  state_->setValue(Parameters::RotatePointX, 0.0);
  state_->setValue(Parameters::RotatePointY, 0.0);
  state_->setValue(Parameters::RotatePointZ, 0.0);
  state_->setValue(Parameters::RotateAxisX, 0.0);
  state_->setValue(Parameters::RotateAxisY, 0.0);
  state_->setValue(Parameters::RotateAxisZ, 1.0);
  state_->setValue(Parameters::RotateTheta, 0.0);
  state_->setValue(Parameters::ShearVectorX, 0.0);
  state_->setValue(Parameters::ShearVectorY, 0.0);
  state_->setValue(Parameters::ShearVectorZ, 0.0);
  state_->setValue(Parameters::ShearPlaneA, 0.0);
  state_->setValue(Parameters::ShearPlaneB, 0.0);
  state_->setValue(Parameters::ShearPlaneC, 0.0);
  state_->setValue(Parameters::ShearPlaneD, 1.0);
  state_->setValue(Parameters::UniformScale, 1.0);
  state_->setValue(Parameters::ResizeSeparably, true);
  state_->setValue(Parameters::IgnoreChanges, true);

  transformTabWidget_->setCurrentIndex(state_->getValue(Parameters::TransformType).toInt());
}

void CreateGeometricTransformDialog::resetFieldMap()
{
  std::string x = "x+";
  std::string y = "y+";
  std::string z = "z+";
  state_->setValue(Parameters::FieldMapX, x);
  state_->setValue(Parameters::FieldMapY, y);
  state_->setValue(Parameters::FieldMapZ, z);
  state_->setValue(Parameters::PermuteX, 1);
  state_->setValue(Parameters::PermuteY, 2);
  state_->setValue(Parameters::PermuteZ, 3);
}

void CreateGeometricTransformDialog::resetWidget()
{
  state_->setValue(Parameters::UniformScale, 1.0);
}

void CreateGeometricTransformDialog::cycleUp()
{
  std::string temp = state_->getValue(Parameters::FieldMapX).toString();
  state_->setValue(Parameters::FieldMapX, state_->getValue(Parameters::FieldMapY).toString());
  state_->setValue(Parameters::FieldMapY, state_->getValue(Parameters::FieldMapZ).toString());
  state_->setValue(Parameters::FieldMapZ, temp);

  int value = state_->getValue(Parameters::PermuteX).toInt();
  state_->setValue(Parameters::PermuteX, state_->getValue(Parameters::PermuteY).toInt());
  state_->setValue(Parameters::PermuteY, state_->getValue(Parameters::PermuteZ).toInt());
  state_->setValue(Parameters::PermuteZ, value);
}

void CreateGeometricTransformDialog::cycleDown()
{
  std::string temp = state_->getValue(Parameters::FieldMapX).toString();
  state_->setValue(Parameters::FieldMapX, state_->getValue(Parameters::FieldMapZ).toString());
  state_->setValue(Parameters::FieldMapZ, state_->getValue(Parameters::FieldMapY).toString());
  state_->setValue(Parameters::FieldMapY, temp);

  int value = state_->getValue(Parameters::PermuteX).toInt();
  state_->setValue(Parameters::PermuteX, state_->getValue(Parameters::PermuteZ).toInt());
  state_->setValue(Parameters::PermuteZ, state_->getValue(Parameters::PermuteY).toInt());
  state_->setValue(Parameters::PermuteY, value);
}

void CreateGeometricTransformDialog::swapXY()
{
  std::string temp = state_->getValue(Parameters::FieldMapX).toString();
  state_->setValue(Parameters::FieldMapX, state_->getValue(Parameters::FieldMapY).toString());
  state_->setValue(Parameters::FieldMapY, temp);

  int value = state_->getValue(Parameters::PermuteX).toInt();
  state_->setValue(Parameters::PermuteX, state_->getValue(Parameters::PermuteY).toInt());
  state_->setValue(Parameters::PermuteY, value);
}

void CreateGeometricTransformDialog::swapYZ()
{
  std::string temp = state_->getValue(Parameters::FieldMapY).toString();
  state_->setValue(Parameters::FieldMapY, state_->getValue(Parameters::FieldMapZ).toString());
  state_->setValue(Parameters::FieldMapZ, temp);

  int value = state_->getValue(Parameters::PermuteY).toInt();
  state_->setValue(Parameters::PermuteY, state_->getValue(Parameters::PermuteZ).toInt());
  state_->setValue(Parameters::PermuteZ, value);
}

void CreateGeometricTransformDialog::swapXZ()
{
  std::string temp = state_->getValue(Parameters::FieldMapX).toString();
  state_->setValue(Parameters::FieldMapX, state_->getValue(Parameters::FieldMapZ).toString());
  state_->setValue(Parameters::FieldMapZ, temp);

  int value = state_->getValue(Parameters::PermuteX).toInt();
  state_->setValue(Parameters::PermuteX, state_->getValue(Parameters::PermuteZ).toInt());
  state_->setValue(Parameters::PermuteZ, value);
}

void CreateGeometricTransformDialog::flipX()
{
  auto x = state_->getValue(Parameters::FieldMapX).toString();
  auto value = state_->getValue(Parameters::PermuteX).toInt();
  if (x[1] == '+')
  {
    x[1] = '-';
  }
  else
  {
    x[1] = '+';
  }
  state_->setValue(Parameters::FieldMapX, x);
  state_->setValue(Parameters::PermuteX, -value);
}

void CreateGeometricTransformDialog::flipY()
{
  auto y = state_->getValue(Parameters::FieldMapY).toString();
  auto value = state_->getValue(Parameters::PermuteY).toInt();
  if (y[1] == '+')
  {
    y[1] = '-';
  }
  else
  {
    y[1] = '+';
  }
  state_->setValue(Parameters::FieldMapY, y);
  state_->setValue(Parameters::PermuteY, -value);
}

void CreateGeometricTransformDialog::flipZ()
{
  auto z = state_->getValue(Parameters::FieldMapZ).toString();
  auto value = state_->getValue(Parameters::PermuteZ).toInt();
  if (z[1] == '+')
  {
    z[1] = '-';
  }
  else
  {
    z[1] = '+';
  }
  state_->setValue(Parameters::FieldMapZ, z);
  state_->setValue(Parameters::PermuteZ, -value);
}

void CreateGeometricTransformDialog::applyTransform()
{

}

void CreateGeometricTransformDialog::compositeTransform()
{

}

void CreateGeometricTransformDialog::calculateLog(const QString& text)
{
  auto val = log10(text.toDouble());
  QString result = QString::number(val, 'f', 5);
  logCalculatorResultLabel_->setText(result);
}


text:
package org.kitesdk.cli.commands;

import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import java.io.IOException;
import java.util.List;
import org.apache.avro.generic.GenericData;
import org.apache.crunch.PipelineResult;
import org.kitesdk.data.View;
import org.kitesdk.tools.CopyTask;
import org.slf4j.Logger;

@Parameters(commandDescription="Copy records from one Dataset to another")
public class CopyCommand extends BaseDatasetCommand {

  public CopyCommand(Logger console) {
    super(console);
  }

  @Parameter(description="<source dataset> <destination dataset>")
  List<String> datasets;

  @Parameter(names={"--no-compaction"},
      description="Copy to output directly, without compacting the data")
  boolean noCompaction = false;

  @Parameter(names={"--num-writers"},
      description="The number of writer processes to use")
  int numWriters = -1;

  @Override
  public int run() throws IOException {
    Preconditions.checkArgument(datasets != null && datasets.size() > 1,
        "Source and target datasets are required");
    Preconditions.checkArgument(datasets.size() == 2,
        "Cannot copy multiple datasets");

    View<GenericData.Record> source = load(datasets.get(0), GenericData.Record.class);
    View<GenericData.Record> dest = load(datasets.get(1), GenericData.Record.class);

    CopyTask task = new CopyTask<GenericData.Record>(
        source, dest, GenericData.Record.class);
    task.setConf(getConf());

    if (noCompaction) {
      task.noCompaction();
    }

    if (numWriters >= 0) {
      task.setNumWriters(numWriters);
    }

    PipelineResult result = task.run();

    if (result.succeeded()) {
      console.info("Added {} records to \"{}\"",
          task.getCount(), datasets.get(1));
      return 0;
    } else {
      return 1;
    }
  }

  @Override
  public List<String> getExamples() {
    return Lists.newArrayList(
        "# Copy the contents of movies_avro to movies_parquet",
        "movies_avro movies_parquet",
        "# Copy the movies dataset into HBase in a map-only job",
        "movies dataset:hbase:zk-host/movies --no-compaction"
    );
  }
}


text:
module.exports = function timeout(ms) {
  return new Promise(res => {
    setTimeout(res, ms);
  });
};


text:
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <winpr/wlog.h>

#include "wlog/PacketMessage.h"

#include <winpr/crt.h>
#include <winpr/stream.h>

#ifndef _WIN32
#include <sys/time.h>
#else
#include <time.h>
#include <sys/timeb.h>
#include <winpr/windows.h>

static int gettimeofday(struct timeval* tp, void* tz)
{
	struct _timeb timebuffer;
	_ftime(&timebuffer);
	tp->tv_sec = (long) timebuffer.time;
	tp->tv_usec = timebuffer.millitm * 1000;
	return 0;
}
#endif

void Pcap_Read_Header(wPcap* pcap, wPcapHeader* header)
{
	fread((void*) header, sizeof(wPcapHeader), 1, pcap->fp);
}

void Pcap_Write_Header(wPcap* pcap, wPcapHeader* header)
{
	fwrite((void*) header, sizeof(wPcapHeader), 1, pcap->fp);
}

void Pcap_Read_RecordHeader(wPcap* pcap, wPcapRecordHeader* record)
{
	fread((void*) record, sizeof(wPcapRecordHeader), 1, pcap->fp);
}

void Pcap_Write_RecordHeader(wPcap* pcap, wPcapRecordHeader* record)
{
	fwrite((void*) record, sizeof(wPcapRecordHeader), 1, pcap->fp);
}

void Pcap_Write_RecordContent(wPcap* pcap, wPcapRecord* record)
{
	fwrite(record->data, record->length, 1, pcap->fp);
}

void Pcap_Read_Record(wPcap* pcap, wPcapRecord* record)
{
	Pcap_Read_RecordHeader(pcap, &record->header);
	record->length = record->header.incl_len;
	record->data = malloc(record->length);
	fread(record->data, record->length, 1, pcap->fp);
}

void Pcap_Write_Record(wPcap* pcap, wPcapRecord* record)
{
	Pcap_Write_RecordHeader(pcap, &record->header);
	Pcap_Write_RecordContent(pcap, record);
}

void Pcap_Add_Record(wPcap* pcap, void* data, UINT32 length)
{
	wPcapRecord* record;
	struct timeval tp;

	if (!pcap->tail)
	{
		pcap->tail = (wPcapRecord*) malloc(sizeof(wPcapRecord));
		ZeroMemory(pcap->tail, sizeof(wPcapRecord));

		pcap->head = pcap->tail;
		pcap->record = pcap->head;
		record = pcap->tail;
	}
	else
	{
		record = (wPcapRecord*) malloc(sizeof(wPcapRecord));
		ZeroMemory(record, sizeof(wPcapRecord));

		pcap->tail->next = record;
		pcap->tail = record;
	}

	if (!pcap->record)
		pcap->record = record;

	record->data = data;
	record->length = length;
	record->header.incl_len = length;
	record->header.orig_len = length;

	gettimeofday(&tp, 0);
	record->header.ts_sec = tp.tv_sec;
	record->header.ts_usec = tp.tv_usec;
}

BOOL Pcap_HasNext_Record(wPcap* pcap)
{
	if (pcap->file_size - (ftell(pcap->fp)) <= 16)
		return FALSE;

	return TRUE;
}

BOOL Pcap_GetNext_RecordHeader(wPcap* pcap, wPcapRecord* record)
{
	if (Pcap_HasNext_Record(pcap) != TRUE)
		return FALSE;

	Pcap_Read_RecordHeader(pcap, &record->header);
	record->length = record->header.incl_len;

	return TRUE;
}

BOOL Pcap_GetNext_RecordContent(wPcap* pcap, wPcapRecord* record)
{
	fread(record->data, record->length, 1, pcap->fp);
	return TRUE;
}

BOOL Pcap_GetNext_Record(wPcap* pcap, wPcapRecord* record)
{
	if (Pcap_HasNext_Record(pcap) != TRUE)
		return FALSE;

	Pcap_Read_Record(pcap, record);

	return TRUE;
}

wPcap* Pcap_Open(char* name, BOOL write)
{
	wPcap* pcap;

	FILE* pcap_fp = fopen(name, write ? "w+b" : "rb");

	if (!pcap_fp)
	{
		perror("opening pcap file");
		return NULL;
	}

	pcap = (wPcap*) malloc(sizeof(wPcap));

	if (pcap)
	{
		ZeroMemory(pcap, sizeof(wPcap));

		pcap->name = name;
		pcap->write = write;
		pcap->record_count = 0;
		pcap->fp = pcap_fp;

		if (write)
		{
			pcap->header.magic_number = PCAP_MAGIC_NUMBER;
			pcap->header.version_major = 2;
			pcap->header.version_minor = 4;
			pcap->header.thiszone = 0;
			pcap->header.sigfigs = 0;
			pcap->header.snaplen = 0xFFFFFFFF;
			pcap->header.network = 1; /* ethernet */
			Pcap_Write_Header(pcap, &pcap->header);
		}
		else
		{
			fseek(pcap->fp, 0, SEEK_END);
			pcap->file_size = (int) ftell(pcap->fp);
			fseek(pcap->fp, 0, SEEK_SET);
			Pcap_Read_Header(pcap, &pcap->header);
		}
	}

	return pcap;
}

void Pcap_Flush(wPcap* pcap)
{
	while (pcap->record)
	{
		Pcap_Write_Record(pcap, pcap->record);
		pcap->record = pcap->record->next;
	}

	if (pcap->fp)
		fflush(pcap->fp);
}

void Pcap_Close(wPcap* pcap)
{
	Pcap_Flush(pcap);

	if (pcap->fp)
		fclose(pcap->fp);

	free(pcap);
}

int WLog_PacketMessage_Write_EthernetHeader(wPcap* pcap, wEthernetHeader* ethernet)
{
	wStream* s;
	BYTE buffer[14];

	s = Stream_New(buffer, 14);

	Stream_Write(s, ethernet->Destination, 6);
	Stream_Write(s, ethernet->Source, 6);
	Stream_Write_UINT16_BE(s, ethernet->Type);

	fwrite(buffer, 14, 1, pcap->fp);

	Stream_Free(s, FALSE);

	return 0;
}

UINT16 IPv4Checksum(BYTE* ipv4, int length)
{
	UINT16 tmp16;
	long checksum = 0;

	while (length > 1)
	{
		tmp16 = *((UINT16*) ipv4);
		checksum += tmp16;
		length -= 2;
		ipv4 += 2;
	}

	if (length > 0)
		checksum += *ipv4;

	while (checksum >> 16)
		checksum = (checksum & 0xFFFF) + (checksum >> 16);

	return (UINT16) (~checksum);
}

int WLog_PacketMessage_Write_IPv4Header(wPcap* pcap, wIPv4Header* ipv4)
{
	wStream* s;
	BYTE buffer[20];

	s = Stream_New(buffer, 20);

	Stream_Write_UINT8(s, (ipv4->Version << 4) | ipv4->InternetHeaderLength);
	Stream_Write_UINT8(s, ipv4->TypeOfService);
	Stream_Write_UINT16_BE(s, ipv4->TotalLength);
	Stream_Write_UINT16_BE(s, ipv4->Identification);
	Stream_Write_UINT16_BE(s, (ipv4->InternetProtocolFlags << 13) | ipv4->FragmentOffset);
	Stream_Write_UINT8(s, ipv4->TimeToLive);
	Stream_Write_UINT8(s, ipv4->Protocol);
	Stream_Write_UINT16(s, ipv4->HeaderChecksum);
	Stream_Write_UINT32_BE(s, ipv4->SourceAddress);
	Stream_Write_UINT32_BE(s, ipv4->DestinationAddress);

	ipv4->HeaderChecksum = IPv4Checksum((BYTE*) buffer, 20);
	Stream_Rewind(s, 10);
	Stream_Write_UINT16(s, ipv4->HeaderChecksum);
	Stream_Seek(s, 8);

	fwrite(buffer, 20, 1, pcap->fp);

	Stream_Free(s, FALSE);

	return 0;
}

int WLog_PacketMessage_Write_TcpHeader(wPcap* pcap, wTcpHeader* tcp)
{
	wStream* s;
	BYTE buffer[20];

	s = Stream_New(buffer, 20);

	Stream_Write_UINT16_BE(s, tcp->SourcePort);
	Stream_Write_UINT16_BE(s, tcp->DestinationPort);
	Stream_Write_UINT32_BE(s, tcp->SequenceNumber);
	Stream_Write_UINT32_BE(s, tcp->AcknowledgementNumber);
	Stream_Write_UINT8(s, (tcp->Offset << 4) | tcp->Reserved);
	Stream_Write_UINT8(s, tcp->TcpFlags);
	Stream_Write_UINT16_BE(s, tcp->Window);
	Stream_Write_UINT16_BE(s, tcp->Checksum);
	Stream_Write_UINT16_BE(s, tcp->UrgentPointer);

	fwrite(buffer, 20, 1, pcap->fp);

	Stream_Free(s, FALSE);

	return 0;
}

static UINT32 g_InboundSequenceNumber = 0;
static UINT32 g_OutboundSequenceNumber = 0;

int WLog_PacketMessage_Write(wPcap* pcap, void* data, DWORD length, DWORD flags)
{
	wTcpHeader tcp;
	wIPv4Header ipv4;
	struct timeval tp;
	wPcapRecord record;
	wEthernetHeader ethernet;

	ethernet.Type = 0x0800;

	if (flags & WLOG_PACKET_OUTBOUND)
	{
		/* 00:15:5D:01:64:04 */
		ethernet.Source[0] = 0x00;
		ethernet.Source[1] = 0x15;
		ethernet.Source[2] = 0x5D;
		ethernet.Source[3] = 0x01;
		ethernet.Source[4] = 0x64;
		ethernet.Source[5] = 0x04;

		/* 00:15:5D:01:64:01 */
		ethernet.Destination[0] = 0x00;
		ethernet.Destination[1] = 0x15;
		ethernet.Destination[2] = 0x5D;
		ethernet.Destination[3] = 0x01;
		ethernet.Destination[4] = 0x64;
		ethernet.Destination[5] = 0x01;
	}
	else
	{
		/* 00:15:5D:01:64:01 */
		ethernet.Source[0] = 0x00;
		ethernet.Source[1] = 0x15;
		ethernet.Source[2] = 0x5D;
		ethernet.Source[3] = 0x01;
		ethernet.Source[4] = 0x64;
		ethernet.Source[5] = 0x01;

		/* 00:15:5D:01:64:04 */
		ethernet.Destination[0] = 0x00;
		ethernet.Destination[1] = 0x15;
		ethernet.Destination[2] = 0x5D;
		ethernet.Destination[3] = 0x01;
		ethernet.Destination[4] = 0x64;
		ethernet.Destination[5] = 0x04;
	}

	ipv4.Version = 4;
	ipv4.InternetHeaderLength = 5;
	ipv4.TypeOfService = 0;
	ipv4.TotalLength = (UINT16) (length + 20 + 20);
	ipv4.Identification = 0;
	ipv4.InternetProtocolFlags = 0x02;
	ipv4.FragmentOffset = 0;
	ipv4.TimeToLive = 128;
	ipv4.Protocol = 6; /* TCP */
	ipv4.HeaderChecksum = 0;

	if (flags & WLOG_PACKET_OUTBOUND)
	{
		ipv4.SourceAddress = 0xC0A80196; /* 192.168.1.150 */
		ipv4.DestinationAddress = 0x4A7D64C8; /* 74.125.100.200 */
	}
	else
	{
		ipv4.SourceAddress = 0x4A7D64C8; /* 74.125.100.200 */
		ipv4.DestinationAddress = 0xC0A80196; /* 192.168.1.150 */
	}

	tcp.SourcePort = 3389;
	tcp.DestinationPort = 3389;

	if (flags & WLOG_PACKET_OUTBOUND)
	{
		tcp.SequenceNumber = g_OutboundSequenceNumber;
		tcp.AcknowledgementNumber = g_InboundSequenceNumber;
		g_OutboundSequenceNumber += length;
	}
	else
	{
		tcp.SequenceNumber = g_InboundSequenceNumber;
		tcp.AcknowledgementNumber = g_OutboundSequenceNumber;
		g_InboundSequenceNumber += length;
	}

	tcp.Offset = 5;
	tcp.Reserved = 0;
	tcp.TcpFlags = 0x0018;
	tcp.Window = 0x7FFF;
	tcp.Checksum = 0;
	tcp.UrgentPointer = 0;

	record.data = data;
	record.length = length;
	record.header.incl_len = record.length + 14 + 20 + 20;
	record.header.orig_len = record.length + 14 + 20 + 20;
	record.next = NULL;

	gettimeofday(&tp, 0);
	record.header.ts_sec = tp.tv_sec;
	record.header.ts_usec = tp.tv_usec;

	Pcap_Write_RecordHeader(pcap, &record.header);
	WLog_PacketMessage_Write_EthernetHeader(pcap, &ethernet);
	WLog_PacketMessage_Write_IPv4Header(pcap, &ipv4);
	WLog_PacketMessage_Write_TcpHeader(pcap, &tcp);
	Pcap_Write_RecordContent(pcap, &record);
	fflush(pcap->fp);

	return 0;
}


text:
package nut

import (
	"crypto/x509/pkix"
	"database/sql"
	"fmt"
	"html/template"
	"log"
	"os"
	"path"
	"time"

	"github.com/astaxie/beego"
	"github.com/astaxie/beego/logs"
	"github.com/astaxie/beego/orm"
	"github.com/astaxie/beego/toolbox"
	"github.com/mattes/migrate"
	"github.com/mattes/migrate/database/postgres"
	"github.com/urfave/cli"
	"golang.org/x/text/language"
)

// Main entry
func Main(args ...string) error {
	ap := cli.NewApp()
	ap.Name = args[0]
	ap.Version = fmt.Sprintf("%s (%s)", Version, BuildTime)
	ap.Authors = []cli.Author{
		cli.Author{
			Name:  AuthorName,
			Email: AuthorEmail,
		},
	}

	ts, err := time.Parse(time.RFC1123Z, BuildTime)
	if err != nil {
		return err
	}
	ap.Compiled = ts

	ap.Copyright = Copyright
	ap.Usage = Usage
	ap.EnableBashCompletion = true
	ap.Commands = []cli.Command{
		{
			Name:    "database",
			Aliases: []string{"db"},
			Usage:   "database operations",
			Subcommands: []cli.Command{
				{
					Name:    "migrate",
					Usage:   "migrate the DB to the most recent version available",
					Aliases: []string{"m"},
					Action: migrateAction(func(_ *cli.Context, mig *migrate.Migrate) error {
						return mig.Up()
					}),
				},
				{
					Name:    "rollback",
					Usage:   "roll back the version by 1",
					Aliases: []string{"r"},
					Action: migrateAction(func(_ *cli.Context, mig *migrate.Migrate) error {
						return mig.Steps(-1)
					}),
				},
				{
					Name:    "version",
					Usage:   "print current migration version",
					Aliases: []string{"v"},
					Action: migrateAction(func(_ *cli.Context, mig *migrate.Migrate) error {
						ver, dirty, err := mig.Version()
						if err != nil {
							return err
						}
						if dirty {
							fmt.Printf("%d(dirty)\n", ver)
						} else {
							fmt.Println(ver)
						}
						return nil
					}),
				},
				{
					Name:    "drop",
					Usage:   "drop everyting inside database",
					Aliases: []string{"d"},
					Action: migrateAction(func(_ *cli.Context, mig *migrate.Migrate) error {
						return mig.Drop()
					}),
				},
			},
		},
		{
			Name:    "generate",
			Aliases: []string{"g"},
			Usage:   "generate file template",
			Subcommands: []cli.Command{
				{
					Name:    "nginx",
					Aliases: []string{"ng"},
					Usage:   "generate nginx.conf",
					Flags: []cli.Flag{
						cli.BoolFlag{
							Name:  "ssl",
							Usage: "https?",
						},
					},
					Action: generateNginxConf,
				},
				{
					Name:    "openssl",
					Aliases: []string{"ssl"},
					Usage:   "generate ssl certificates",
					Flags: []cli.Flag{
						cli.StringFlag{
							Name:  "name, n",
							Usage: "name",
						},
						cli.StringFlag{
							Name:  "country, c",
							Value: "Earth",
							Usage: "country",
						},
						cli.StringFlag{
							Name:  "organization, o",
							Value: "Mother Nature",
							Usage: "organization",
						},
						cli.IntFlag{
							Name:  "years, y",
							Value: 1,
							Usage: "years",
						},
					},
					Action: generateSsl,
				},
				{
					Name:    "migration",
					Usage:   "generate migration file",
					Aliases: []string{"m"},
					Flags: []cli.Flag{
						cli.StringFlag{
							Name:  "name, n",
							Usage: "name",
						},
					},
					Action: func(c *cli.Context) error {
						name := c.String("name")
						if len(name) == 0 {
							cli.ShowCommandHelp(c, "migration")
							return nil
						}
						now := time.Now()
						for _, act := range []string{"up", "down"} {
							if err := generateMigration(now.Unix(), name, act); err != nil {
								return err
							}
						}
						return nil
					},
				},
				{
					Name:    "locale",
					Usage:   "generate locale file",
					Aliases: []string{"l"},
					Flags: []cli.Flag{
						cli.StringFlag{
							Name:  "name, n",
							Usage: "locale name",
						},
					},
					Action: generateLocale,
				},
			},
		},
	}
	ap.Action = mainAction

	return ap.Run(args)
}

func generateSsl(c *cli.Context) error {
	name := c.String("name")
	if len(name) == 0 {
		cli.ShowCommandHelp(c, "openssl")
		return nil
	}
	root := path.Join("etc", "ssl", name)

	key, crt, err := CreateCertificate(
		true,
		pkix.Name{
			Country:      []string{c.String("country")},
			Organization: []string{c.String("organization")},
		},
		c.Int("years"),
	)
	if err != nil {
		return err
	}

	fnk := path.Join(root, "key.pem")
	fnc := path.Join(root, "crt.pem")

	fmt.Printf("generate pem file %s\n", fnk)
	err = WritePemFile(fnk, "RSA PRIVATE KEY", key, 0600)
	fmt.Printf("test: openssl rsa -noout -text -in %s\n", fnk)

	if err == nil {
		fmt.Printf("generate pem file %s\n", fnc)
		err = WritePemFile(fnc, "CERTIFICATE", crt, 0444)
		fmt.Printf("test: openssl x509 -noout -text -in %s\n", fnc)
	}
	if err == nil {
		fmt.Printf(
			"verify: diff <(openssl rsa -noout -modulus -in %s) <(openssl x509 -noout -modulus -in %s)",
			fnk,
			fnc,
		)
	}
	fmt.Println()
	return err
}
func generateMigration(version int64, name, act string) error {
	file := path.Join("db", "migrate", fmt.Sprintf("%d_%s.%s.sql", version, name, act))
	fmt.Printf("generate file %s\n", file)
	fd, err := os.OpenFile(file, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0600)
	if err != nil {
		return err
	}
	defer fd.Close()
	return nil
}
func generateLocale(c *cli.Context) error {
	name := c.String("name")
	if len(name) == 0 {
		cli.ShowCommandHelp(c, "locale")
		return nil
	}
	lng, err := language.Parse(name)
	if err != nil {
		return err
	}
	const root = "locales"
	if err = os.MkdirAll(root, 0700); err != nil {
		return err
	}
	file := path.Join(root, fmt.Sprintf("%s.ini", lng.String()))
	fmt.Printf("generate file %s\n", file)
	fd, err := os.OpenFile(file, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0600)
	if err != nil {
		return err
	}
	defer fd.Close()
	return err
}
func generateNginxConf(c *cli.Context) error {
	tpl, err := template.ParseFiles(path.Join("templates", "nginx.conf"))
	if err != nil {
		return err
	}
	pwd, err := os.Getwd()
	if err != nil {
		return err
	}

	fn := path.Join("tmp", "nginx.conf")
	fmt.Printf("generate file %s\n", fn)
	fd, err := os.OpenFile(fn, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0600)
	if err != nil {
		return err
	}
	defer fd.Close()

	cfg := beego.BConfig
	return tpl.Execute(
		fd,
		map[string]interface{}{
			"name":  cfg.ServerName,
			"port":  cfg.Listen.HTTPPort,
			"theme": cfg.AppName,
			"root":  pwd,
			"ssl":   c.Bool("ssl"),
		})
}

type migrateLogger struct {
}

func (p *migrateLogger) Printf(format string, v ...interface{}) {
	log.Printf(format, v...)
}

func (p *migrateLogger) Verbose() bool {
	return true
}

func migrateAction(fun func(*cli.Context, *migrate.Migrate) error) cli.ActionFunc {
	return func(ctx *cli.Context) error {
		drv := beego.AppConfig.String("databasedriver")
		src := beego.AppConfig.String("databasesource")
		db, err := sql.Open(drv, src)
		if err != nil {
			return err
		}
		defer db.Close()

		ins, err := postgres.WithInstance(db, &postgres.Config{})
		if err != nil {
			return err
		}

		pwd, err := os.Getwd()
		if err != nil {
			return err
		}
		mig, err := migrate.NewWithDatabaseInstance(
			"file://"+path.Join(pwd, "db", "migrate"),
			drv, ins)
		if err != nil {
			return err
		}
		mig.Log = &migrateLogger{}
		if err := fun(ctx, mig); err != nil {
			return err
		}

		fmt.Println("Done!")
		return nil
	}
}

func mainAction(_ *cli.Context) error {
	logs.SetLogger(logs.AdapterConsole)
	logs.SetLogger(logs.AdapterFile, `{"filename":"`+path.Join("tmp", "www.log")+`"}`)

	orm.Debug = beego.BConfig.RunMode != beego.PROD
	orm.RegisterDataBase(
		"default",
		beego.AppConfig.String("databasedriver"),
		beego.AppConfig.String("databasesource"),
	)

	if err := Open(); err != nil {
		return err
	}

	toolbox.StartTask()
	defer toolbox.StopTask()

	go func() {
		host, _ := os.Hostname()
		JOBBER().Receive(host)
	}()

	beego.ErrorController(&ErrorController{})
	beego.Run()
	return nil
}


text:
#ifndef BUBBLEWRAP_COLLISION_COBASE_HPP
#define BUBBLEWRAP_COLLISION_COBASE_HPP

#include "Bubblewrap/Base/Component.hpp"

namespace Bubblewrap
{
	namespace Collision
	{
		/*! Base class for collision objects, probably */
		class CoBase : Base::Component
		{

		};
	}
}

#endif


text:
using System.Drawing;

namespace Nemesis.Rendering.Animation
{
    public interface IAnimationFrame : IDrawableModel
    {
        float FrameDuration { get; set; }

        Size FrameSizeInPixels { get; }
    }
}


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

namespace Asteroids.Tools
{

	// This class is obsolete. Keeping the text for future reference and refactors.

   /* using Microsoft.Xna.Framework.Graphics;
    using Microsoft.Xna.Framework.Input;
    using Microsoft.Xna.Framework;

    using Asteroids.Tools;
    using Asteroids.Entities;
    using Attributes;

    public class GlobalParticleGenerator
    {

        // Flags
        private static bool _initialized = false;
        private static bool _debug = false;
        private static bool _drawRectangle = false;
        private static bool _useRadius = false;

        // Fields.
        private static GenerationMode mode;

        private static Vector2 position; // Location of the generator.
        private static float radius; // How far away from the generator's location should particles be emitted?
        private static float scale; // The scale of the particle.

        private static Vector2 point1; // Gripped first point, when mouse is pressed down.
        private static Vector2 point2; // Gripped second point, when mouse is released.
        private static Vector2 point3; // For the boundaries.
        private static List<Particle> particles; // Particles are kept in the list until they are killed. Once dead, they are removed from the list.
        private static List<DebugLine> lines;
        private static Texture2D tex;

        // Properties.
        public static bool Initialized
        {
            get { return _initialized; }
            private set { _initialized = value; }
        }
        public static List<Particle> Particles
        {
            get
            {
                if (!Initialized)
                {
                    Initialize(null);
                }

                return particles;
            }
        }

        public static void Initialize(Texture2D _texture, Vector2? _pos = null, float _rad = 1.0f, float _scale = 1.0f)
        {
            tex = _texture;
            scale = _scale;
            SetPosition(_pos, _rad);
            point1 = GlobalManager.ScreenCenter;
            point2 = point1 + new Vector2(1, 1);
            point3 = point1 - new Vector2(1, 1);
            particles = new List<Particle>();
            lines = new List<DebugLine>();
            _initialized = true;
        }

        private static void GenerateGlobal()
        {
            // Use points to get velocity.
            float mag = Math.Abs(Vector2.Distance(point1, point2));

            Particle p = new Particle(GlobalManager.Pen, tex, "Particle (Global)", Color.LightGoldenrodYellow, null, new Vector2(15, 15) * scale, null, 1, radius);
            p.Start(10);
            AddParticle(p);
        }

        private static void GenerateLocal()
        {
            // Use points as velocity and location.
            Vector2 location = point1;
            Vector2 velocity = Vector2.Normalize(point2 - point1);
            float mag = Math.Abs(Vector2.Distance(point1, point2) * scale * (radius + 1.0f) * 10.0f);

            Particle p;

            if (!_useRadius)
            {
                Rectangle bounds = new Rectangle(new Point((int)point1.X, (int)point1.Y), new Point((int)point3.X, (int)point3.Y));
                p = new Particle(this, tex, "Particle (Local)" + location.ToString(), Color.LightGoldenrodYellow, location, new Vector2(15, 15) * scale, velocity, _bounds: bounds, _speed: mag);
            }
            else
            {
                p = new Particle(this, tex, "Particle (Local)" + location.ToString(), Color.LightGoldenrodYellow, location, new Vector2(15, 15) * scale, velocity, radius, mag);
            }
            p.Start(10);
            AddParticle(p);
        }

        private static void ToggleDebug()
        {
            _debug = !_debug;
        }

        public static void HandleInput()
        {
            // Toggle debug information for the particles in the generator.
            if (InputManager.IsKeyReleased(Keys.L))
            {
                ToggleDebug();
            }

            _drawRectangle = false;
            bool keypress = false;

            // If the mouse buttons aren't currently down, do functionality concerning key press generation of particles.
            if (InputManager.LeftButtonUp && InputManager.RightButtonUp)
            {
                // Toggle generation mode for the generator by pressing B.
                if (InputManager.IsKeyReleased(Keys.B))
                {
                    ToggleMode();
                    point1 = GlobalManager.ScreenCenter;
                    point2 = point1 + new Vector2(1, 1);
                    keypress = true;
                }

                // If G is pressed, generate a particle globally.
                if (InputManager.IsKeyHeld(Keys.G))
                {
                    GenerateGlobal();
                    keypress = true;
                }

                // If H is pressed, generate a particle locally, if possible.
                if (InputManager.IsKeyHeld(Keys.H))
                {
                    GenerateLocal();
                    keypress = true;
                }

                // If the > button is pressed, increase the radius.
                if (InputManager.IsKeyHeld(Keys.LeftShift))
                {
                    if (InputManager.IsKeyHeld(Keys.OemPeriod))
                    {
                        radius = MathHelper.Clamp(radius + 0.1f, 0.1f, 1000f);
                        keypress = true;
                    }

                    if (InputManager.IsKeyHeld(Keys.OemComma))
                    {
                        radius = MathHelper.Clamp(radius - 0.1f, 0.1f, 1000f);
                        keypress = true;
                    }
                }
            }

            // If G, H, B, are not down, then do functionality concerning mouse generation of particles.
            if(!keypress)
            {
                bool left = false;

                // The distance between the two points creates the magnitude for the velocity.
                // If left button is pressed, get current mouse position for point a.
                if (InputManager.LeftButtonPressed)
                {
                    // Global Mode: Point 1 is start of velocity vector.
                    // Local Mode: Point 1 is start of velocity vector, Point 1 is origin of the particle.
                    Point a = InputManager.GetMousePosition();
                    point1 = new Vector2(a.X, a.Y);
                    left = true;
                }
                else if (InputManager.LeftButtonHeld && InputManager.IsKeyHeld(Keys.LeftShift))
                {
                    // While being held, keep track of the current mouse position for the debug line.
                    Point d = InputManager.GetMousePosition();
                    point3 = new Vector2(d.X, d.Y);

                    _useRadius = false;
                    _drawRectangle = true;
                    left = true;
                }
                else if (InputManager.LeftButtonHeld && !InputManager.IsKeyHeld(Keys.LeftShift))
                {
                    // While being held, keep track of the current mouse position for the debug line.
                    Point b = InputManager.GetMousePosition();
                    point2 = new Vector2(b.X, b.Y);

                    Vector2 difference = point2 - point1;
                    lines.Add(new DebugLine(point1, difference, Color.White, difference.Length(), 3, 1));

                    _useRadius = true;
                    left = true;
                }
                else if ((InputManager.IsKeyHeld(Keys.LeftShift) && (InputManager.LeftButtonReleased)) || (InputManager.IsKeyReleased(Keys.LeftShift) && InputManager.LeftButtonReleased))
                {
                    Point d = InputManager.GetMousePosition();
                    point3 = new Vector2(d.X, d.Y);
                    left = true;
                }
                // On release of the left mouse button, get current mouse position for point b.
                else if (InputManager.LeftButtonReleased)
                {
                    // Global Mode: Point 2 is end of velocity vector.
                    // Local Mode: Point 2 is end of velocity vector.
                    Point b = InputManager.GetMousePosition();
                    point2 = new Vector2(b.X, b.Y);
                    left = true;
                }

                if (InputManager.RightButtonReleased && !left)
                {
                    // If the right mouse button is released, generate a point.
                    // Generate particle with right mouse click.
                    // Generate a point depending on the mode.
                    switch (mode)
                    {
                        case GenerationMode.Global:
                            GenerateGlobal();
                            break;
                        case GenerationMode.Local:
                            GenerateLocal();
                            break;
                    }
                }
            }
        }

        public static void Update(GameTime gameTime)
        {
            if (Initialized)
            {
                // Handle input.
                HandleInput();

                if (!IsEmpty())
                {
                    List<Particle> toRemove = new List<Particle>();

                    foreach (Particle particle in Particles)
                    {
                        particle.Debug = _debug;
                        particle.Update(gameTime);

                        if (particle.IsDead())
                        {
                            toRemove.Add(particle);
                        }
                    }

                    foreach (Particle particle in toRemove)
                    {
                        RemoveParticle(particle);
                    }
                }
            }
        }

        public static void Draw()
        {
            if (Initialized)
            {
                if (!IsEmpty())
                {
                    foreach (Particle particle in Particles)
                    {
                        particle.Draw();
                    }
                }
            }
        }

        public static void DrawGUI()
        {
            if (Initialized)
            {
                if (_drawRectangle)
                {
                    int distX = (int)(point3.X - point1.X);
                    int distY = (int)(point3.Y - point1.Y);
					GlobalManager.Pen.DrawRectOutline((int)point1.X, (int)point1.Y, distX, distY, Color.White);
                }

                if (_debug)
                {

                    Padding padding = new Padding(0, GlobalManager.Pen.StringHeight("A"));
                    Vector2 position = new Vector2(10, 10 + padding.Y);

                    switch (mode)
                    {
                        case GenerationMode.Global:
                            StateManager.AddMessage("[Global Particle Manager] [Global Mode] [" + NumberOfParticles() + " particles]", position, padding, Color.LimeGreen, 0, ShapeDrawer.LEFT_ALIGN);
                            break;
                        case GenerationMode.Local:
                            StateManager.AddMessage("[Global Particle Manager] [Local Mode] [" + NumberOfParticles() + " particles]", position, padding, Color.LimeGreen, 0, ShapeDrawer.LEFT_ALIGN);
                            break;
                    }

                    float mag = Math.Abs(Vector2.Distance(point1, point2) * scale * (radius + 1.0f) * 10.0f);

                    // ABSOLUTE VALUE NEEDS TO BE FIXED

                    StateManager.AddMessage("[Points] <" + point1 + ", " + point2 + ">", position, padding, Color.LimeGreen, 0, ShapeDrawer.LEFT_ALIGN);
                    StateManager.AddMessage("[Bounds] <" + new Rectangle((int)point1.X, (int)point1.Y, (int)(point3.X - point1.X), (int)(point3.Y - point1.Y)) + ">", position, padding, Color.LimeGreen, 0, ShapeDrawer.LEFT_ALIGN);
                    StateManager.AddMessage("[Radius] " + radius, position, padding, Color.LimeGreen, 0, ShapeDrawer.LEFT_ALIGN);
                    StateManager.AddMessage("[Scale] " + scale, position, padding, Color.LimeGreen, 0, ShapeDrawer.LEFT_ALIGN);
                    StateManager.AddMessage("[Magnitude] " + mag, position, padding, Color.LimeGreen, 0, ShapeDrawer.LEFT_ALIGN);
                    StateManager.AddMessage("", position, padding, Color.LimeGreen, 0, ShapeDrawer.LEFT_ALIGN);
                }

                foreach (DebugLine line in lines)
                {
                    DebugLine.Draw(line, true);
                }

                lines = new List<DebugLine>();

                if (!IsEmpty())
                {
                    foreach (Particle particle in Particles)
                    {
                        particle.DrawGUI();
                    }
                }
            }
        }

        public static void Start()
        {
            foreach (Particle particle in Particles)
            {
                Birth(particle);
            }
        }

        public static void Start(float time)
        {
            foreach (Particle particle in Particles)
            {
                Birth(particle, time);
            }
        }

        public static void Stop()
        {
            foreach (Particle particle in Particles)
            {
                Kill(particle);
            }
        }

        public static void Birth(Particle particle)
        {
            particle.Start();
        }

        public static void Birth(Particle particle, float time)
        {
            particle.Start(time);
        }

        public static void Kill(Particle particle)
        {
            particle.Die();
        }

        public static void RemoveParticle(Particle particle)
        {
            if (!IsEmpty())
            {
                List<Particle> p = Particles;

                if (p.Contains(particle))
                {
                    particle.Die();
                    p.Remove(particle);
                }
            }

        }

        public static void AddParticle(Particle particle)
        {
            Particles.Add(particle);
        }

        public static void SetPosition(Vector2? _pos = null, float _rad = 1.0f)
        {
            if (_pos == null || ((Vector2)(_pos)) == Vector2.Zero)
            {
                // If null, then it's global.
                mode = GenerationMode.Global;
            }
            else
            {
                position = (Vector2)_pos;
                radius = _rad;
                mode = GenerationMode.Local;
            }
        }

        public static void ToggleMode()
        {
            switch (mode)
            {
                case GenerationMode.Global:
                    mode = GenerationMode.Local;
                    break;
                case GenerationMode.Local:
                    mode = GenerationMode.Global;
                    break;
            }
        }

        public static bool IsEmpty()
        {
            if (Initialized)
            {
                return (NumberOfParticles() == 0);
            }

            // If not initialized, it's empty.
            return true;
        }

        public static int NumberOfParticles()
        {
            if (Initialized)
            {
                return particles.Count();
            }
            else
            {
                return 0;
            }
        }

        public static void SetScale(float _scale)
        {
            scale = Math.Abs(_scale);

            foreach (Particle particle in Particles)
            {
                particle.SetScale(scale);
            }
        }

    }
	*/
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
	      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
	      http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
	      version="2.4">

  <description>Simple hawtio hello-world type plugin</description>
  <display-name>hawt.io simple plugin</display-name>

  <context-param>
    <description>Plugin's path on the server</description>
    <param-name>plugin-context</param-name>
    <param-value>${plugin-context}</param-value>
  </context-param>

  <context-param>
    <description>Name of the plugin</description>
    <param-name>plugin-name</param-name>
    <param-value>${project.artifactId}</param-value>
  </context-param>

  <context-param>
    <description>Domain of the plugin (not used right now)</description>
    <param-name>plugin-domain</param-name>
    <param-value>${plugin-domain}</param-value>
  </context-param>

  <context-param>
    <description>Paths to the plugin JavaScript files</description>
    <param-name>plugin-scripts</param-name>
    <param-value>${plugin-scripts}</param-value>
  </context-param>

  <listener>
    <listener-class>io.hawt.example.simpleplugin.PluginContextListener</listener-class>
  </listener>

</web-app>


text:
Kubernetes bringt das Konzept von Jobs und Cron Jobs mit.
Dies ermöglicht es, gewisse Tasks einmalig (Job) oder eben jeweils zu einer bestimmten Zeit (Cron Job) auszuführen.

Eine mögliche Auswahl von Anwendungsfällen:

- Jeweils um 23:12 ein Datenbank Backup erstellen und auf ein gemountetes PVC speichern
- Einmaliges generieren von Reports
- Cleanup-Job welcher alte Daten aufräumt
- Asynchrones Senden von Emails

## Job

Jobs im Unterschied zu einem Deployment, welches mittels Replication Controller getrackt wird, führt einen Pod einmalig aus bis der Befehl abgeschlossen ist.
Ein Job erstellt dafür einen Pod und führt die definierte Operation bzw. Befehl aus.
Es muss sich dabei nicht zwingend um nur einen Pod handeln, sondern kann auch mehrere beinhalten.
Wird ein Job gelöscht, werden auch die vom Job gestarteten (und wieder beendeten) Pods gelöscht.

Ein Job eignet sich also bspw. dafür, sicherzustellen, dass ein Pod verlässlich bis zu dessen Vervollständigung ausgeführt wird.
Schlägt ein Pod fehl, zum Beispiel wegen eines Node-Fehlers, startet der Job einen neuen Pod.

Weitere Informationen zu Jobs sind in der [OpenShift Dokumentation](https://docs.openshift.com/container-platform/latest/nodes/jobs/nodes-nodes-jobs.html) zu finden.

## Cron Jobs

Ein OpenShift Cron Job ist nichts anderes als eine Ressource, welche zu definierten Zeitpunkten einen Job erstellt, welcher wiederum wie gewohnt einen Pod startet um einen Befehl auszuführen.

Weitere Informationen zu Cron Jobs sind auf derselben [OpenShift Dokumentationsseite](https://docs.openshift.com/container-platform/latest/nodes/jobs/nodes-nodes-jobs.html) zu finden wie die Jobs.

## Aufgabe: Job für MariaDB-Dump erstellen

Ähnlich wie in [Lab-Aufgabe 9.4](../labs/09_database.md) wollen wir nun einen Dump der laufenden MariaDB-Datenbank erstellen, aber ohne uns in den Pod einloggen zu müssen.

Für dieses Beispiel verwenden wir das Spring Boot Beispiel aus [Lab 4](../labs/04_deploy_dockerimage.md), `[USERNAME]-dockerimage`.

Tippoc project [USERNAME]-dockerimage

Schauen wir uns zuerst die Job-Ressource an, die wir erstellen wollen.
Sie ist unter [resources/job_mariadb-dump.yaml](resources/job_mariadb-dump.yaml) zu finden.
Unter `.spec.template.spec.containers[0].image` sehen wir, dass wir dasselbe Image verwenden wie für die laufende Datenbank selbst.
Wir starten anschliessend aber keine Datenbank, sondern wollen einen `mysqldump`-Befehl ausführen, wie unter `.spec.template.spec.containers[0].command` aufgeführt.
Dazu verwenden wir, wie schon im Datenbank-Deployment, dieselben Umgebungsvariablen, um Hostname, User oder Passwort innerhalb des Pods definieren zu können.

Schlägt der Job fehl, soll er neugestartet werden, dies wird über die `restartPolicy` definiert.
Insgesamt soll 3 mal probiert werden den Job auszuführen (`backoffLimit`).

Erstellen wir nun also unseren Job:

```bash
oc create -f ./additional-labs/resources/job_mariadb-dump.yaml
```

Überprüfen wir, ob der Job erfolgreich war:

```bash
oc describe jobs/mariadb-dump
```

Den ausgeführten Pod können wir wie folgt anschauen:

```bash
oc get pods
```

Um alle Pods, welche zu einem Job gehören, in maschinenlesbarer Form auszugeben, kann bspw. folgender Befehl verwendet werden:

```bash
oc get pods --selector=job-name=mariadb-dump --output=jsonpath={.items..metadata.name}
```

Um zu überprüfen ob der Job erfolgreich war, können die Logs des Pod ausgelesen werden.

```bash
oc logs $(oc get pods --selector=job-name=mariadb-dump --output=jsonpath={.items..metadata.name})
```

## Aufgabe: Cron Job einrichten

In der vorherigen Aufgabe haben wir lediglich einen Job instanziert, welcher einmalig einen Datenbank Dump erstellt.
Nun wollen wir sicherstellen, dass dieser Datebank Dump nächtlich einmal ausgeführt wird.

Dafür erstellen wir nun eine Resource vom Typ Cron Job. Der Cron Job soll jeweils um 23:12 jeden Tag einen Job ausführen, welcher einen Dump der Datenbank erstellt und sichert.

```bash
oc create -f ./additional-labs/resources/cronjob_mariadb-dump.yaml
```

Schauen wir uns nun diesen Cron Job an:

```bash
oc get cronjob mariadb-backup -o yaml
```

__Wichtig__:
Beachten Sie, dass insbesondere Backups überwacht und durch Restore Tests überprüft werden müssen.
Diese Logik kann bspw. in den auszuführenden Befehl integriert oder aber durch ein Monitoring Tool übernommen werden.
Im Test-Cron Job wird der Dump in das `/tmp`-Verzeichnis geschrieben.
Für den produktiven Einsatz sollte dies ein gemountetes Persistent Volume sein.

Versuchen Sie, folgende Fragen zu beantworten:

- Wann wurde der Cron Job das letzte mal ausgeführt?
- War das Backup erfolgreich?
- Konnten die Daten erfolgreich restored werden?

__Ende Lab Cron Jobs__

[← zurück zur Übersicht](../README.md)


text:
package me.tfeng.toolbox.kafka;

import java.io.IOException;
import java.util.Map;

import org.apache.avro.generic.IndexedRecord;
import org.apache.kafka.common.serialization.Serializer;

import kafka.serializer.Encoder;
import kafka.utils.VerifiableProperties;
import me.tfeng.toolbox.avro.AvroHelper;

/**
 * @author Thomas Feng (huining.feng@gmail.com)
 */
public class AvroEncoder<T extends IndexedRecord> implements Encoder<T>, Serializer<T> {

  public AvroEncoder() {
    this(null);
  }

  public AvroEncoder(VerifiableProperties verifiableProperties) {
  }

  @Override
  public void close() {
  }

  @Override
  public void configure(Map<String, ?> configs, boolean isKey) {
  }

  @Override
  public byte[] serialize(String topic, T data) {
    return toBytes(data);
  }

  @Override
  public byte[] toBytes(T record) {
    try {
      return AvroHelper.encodeRecord(record);
    } catch (IOException e) {
      throw new RuntimeException("Unable to encode Kafka event " + record);
    }
  }
}


text:
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using System.Collections.Generic;

namespace Imagination.Controllers
{
    [AllowAnonymous]
    [Route("/")]
    public class APIEntryController : ControllerBase
    {
        private string lastWebhookPost;
        [HttpGet]
        public string Get()
        {
            return "TestWebApplication";
        }

        [HttpPost]
        public void Post([FromBody]string value)
        {
            //string param1 = this.Request.QueryString["context"];
            lastWebhookPost = value;
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;

namespace ArrayManipulator
{
    public class ArrayManipulator
    {
        public static void Main()
        {
            List<string> input = Console.ReadLine().Split().ToList();
            List<int> nums = new List<int>();

            foreach (string strNum in input)
            {
                nums.Add(int.Parse(strNum));
            }

            string[] command = Console.ReadLine().Split();

            do
            {
                switch (command[0])
                {
                    case "add":
                        AddElementAtIndex(command[1], command[2], nums);
                        break;
                    case "addMany":
                        AddManyElementsAtIndex(command[1], command, nums);
                        break;
                    case "contains":
                        ContainsElement(command[1], nums);
                        break;
                    case "remove":
                        int index = int.Parse(command[1]);
                        nums.RemoveAt(index);
                        break;
                    case "shift":
                        ShiftArrayPositions(command[1], nums);
                        break;
                    case "sumPairs":
                        nums = SumArrayPairs(nums);
                        break;
                    default:
                        break;
                }

                command = Console.ReadLine().Split();
            }
            while (command[0] != "print");

            Console.WriteLine("[{0}]", string.Join(", ", nums));
        }

        public static List<int> SumArrayPairs(List<int> numbers)
        {
            // Creating new list that will hold the summed values of each pair:
            List<int> sumed = new List<int>();

            for (int i = 1; i <= numbers.Count; i = i + 2)
            {
                int pairSum = 0;
                if (i != numbers.Count)
                {
                    pairSum = numbers[i] + numbers[i - 1];
                }
                else
                {
                    // If the list has an odd count the last digit in it will be the last pair:
                    pairSum = numbers[numbers.Count - 1];
                }
                sumed.Add(pairSum);
            }
            numbers = sumed;
            return numbers;
        }

        public static void ShiftArrayPositions(string positions, List<int> numbers)
        {
            int shiftPositions = int.Parse(positions);

            for (int i = 0; i < shiftPositions; i++)
            {
                // Storing the first digit of the array:
                int firstDigit = numbers[0];

                for (int j = 0; j < numbers.Count - 1; j++)
                {
                    numbers[j] = numbers[j + 1];
                }

                // After the repositioning of the digits for the current rotation we replace the last digit in the shifted array
                // with the already stored one that was first digit:
                numbers[numbers.Count - 1] = firstDigit;
            }
        }

        public static void ContainsElement(string element, List<int> numbers)
        {
            int checkedElement = int.Parse(element);

            // Checking the original list for that element and prints its index if it exists in the list:
            for (int i = 0; i < numbers.Count; i++)
            {
                if (numbers[i] == checkedElement)
                {
                    Console.WriteLine(i);
                    return; // If there is such an element we exit the method after printing it
                }
            }

            // If there is no such element we print "-1":
            Console.WriteLine(-1);
        }

        public static void AddManyElementsAtIndex(string index, string[] command, List<int> numbers)
        {
            // Creating a list where we will store the elements that will be added to our original list:
            List<int> addElements = new List<int>();

            // Filling that list with the elements that we want to add:
            for (int i = 2; i < command.Length; i++)
            {
                addElements.Add(int.Parse(command[i]));
            }

            int atIndex = int.Parse(index);

            // Adding the desired elements to the original list:
            numbers.InsertRange(atIndex, addElements);
        }

        public static void AddElementAtIndex(string index, string element, List<int> numbers)
        {
            int atIndex = int.Parse(index);
            int addedElement = int.Parse(element);

            numbers.Insert(atIndex, addedElement);
        }
    }
}


text:
var should = require("should");

var Forecastio_weathericons = require('../index');

describe("Forecastio_weathericons", function() {
	it("should accept currently supported Forecast.io icons", function() {
		var supported = [
			"clear-day",
			"clear-night",
			"rain",
			"snow",
			"sleet",
			"wind",
			"fog",
			"cloudy",
			"partly-cloudy-day",
			"partly-cloudy-night"
		];
		for (var index = 0; index < supported.length; index++) {
			Forecastio_weathericons.translate(supported[index] ).should.be.instanceof(String);
		};
	});

	it("should return undefined for non-supported values", function() {
		var invalidValue = Forecastio_weathericons.translate(undefined);
		should(invalidValue).not.be.ok;
	});
});


text:
package com.kazale.pontointeligente.api.security.dto;

public class TokenDto {

	private String token;

	public TokenDto() {
	}

	public TokenDto(String token) {
		this.token = token;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

}


text:
<?php

namespace App\Locale;

use App\Contracts\Language;

final class Swedish implements Language
{
	public function code(): string
	{
		return 'sv';
	}

	public function get_locale(): array
	{
		$locale = [
			'USERNAME' => 'användarnamn',
			'PASSWORD' => 'lösenord',
			'ENTER' => 'Stig in',
			'CANCEL' => 'Avbryt',
			'SIGN_IN' => 'Logga in',
			'CLOSE' => 'Stäng',
			'SETTINGS' => 'Settings',
			'SEARCH' => 'Search ...',
			'MORE' => 'More',
			'DEFAULT' => 'Default',

			'USERS' => 'Users',
			'U2F' => 'U2F',
			'NOTIFICATIONS' => 'Notifications',
			'SHARING' => 'Sharing',
			'CHANGE_LOGIN' => 'Ändra inloggning',
			'CHANGE_SORTING' => 'Ändra sortering',
			'SET_DROPBOX' => 'Ställ in Dropbox',
			'ABOUT_LYCHEE' => 'Om Lychee',
			'DIAGNOSTICS' => 'Diagnostik',
			'DIAGNOSTICS_GET_SIZE' => 'Request space usage',
			'LOGS' => 'Visa logfilen',
			'SIGN_OUT' => 'Logga ut',
			'UPDATE_AVAILABLE' => 'En uppdatering finns!',
			'MIGRATION_AVAILABLE' => 'Migration available!',
			'DEFAULT_LICENSE' => 'Default license for new uploads:',
			'SET_LICENSE' => 'Set License',
			'SET_OVERLAY_TYPE' => 'Set Overlay',
			'SET_MAP_PROVIDER' => 'Set OpenStreetMap tiles provider',

			'SMART_ALBUMS' => 'Smarta album',
			'SHARED_ALBUMS' => 'Shared albums',
			'ALBUMS' => 'Album',
			'PHOTOS' => 'Pictures',
			'SEARCH_RESULTS' => 'Search results',

			'RENAME' => 'Ändra namnet',
			'RENAME_ALL' => 'Byt namn på vald',
			'MERGE' => 'Slå ihop',
			'MERGE_ALL' => 'Sammanfoga vald',
			'MAKE_PUBLIC' => 'Gör publika',
			'SHARE_ALBUM' => 'Dela album',
			'SHARE_PHOTO' => 'Dela fotografi',
			'VISIBILITY_ALBUM' => 'Album Visibility',
			'VISIBILITY_PHOTO' => 'Photo Visibility',
			'DOWNLOAD_ALBUM' => 'Ladda ner album',
			'ABOUT_ALBUM' => 'Om albumet',
			'DELETE_ALBUM' => 'Radera albumet',
			'MOVE_ALBUM' => 'Move Album',
			'FULLSCREEN_ENTER' => 'Enter Fullscreen',
			'FULLSCREEN_EXIT' => 'Exit Fullscreen',

			'SHARING_ALBUM_USERS' => 'Share this album with users',
			'WAIT_FETCH_DATA' => 'Please wait while we get the data...',
			'SHARING_ALBUM_USERS_NO_USERS' => 'There are no users to share the album with',
			'SHARING_ALBUM_USERS_LONG_MESSAGE' => 'Select the users to share this album with',

			'DELETE_ALBUM_QUESTION' => 'Radera album och fotografier',
			'KEEP_ALBUM' => 'Behåll albumet',
			'DELETE_ALBUM_CONFIRMATION_1' => 'Är du säker på att du vill radera albumet',
			'DELETE_ALBUM_CONFIRMATION_2' => 'och alla fotografier det innehåller? Raderingen går inte att ångra!',

			'DELETE_ALBUMS_QUESTION' => 'Radera album och fotografier',
			'KEEP_ALBUMS' => 'Behåll album',
			'DELETE_ALBUMS_CONFIRMATION_1' => 'Är du säker på att du vill radera alla',
			'DELETE_ALBUMS_CONFIRMATION_2' => 'valda album och alla fotografier de innehåller? Raderingen går inte att ångra!',

			'DELETE_UNSORTED_CONFIRM' => 'Är du säker på att du vill radera alla fotografier från \'Osorterat\'?
Det här går inte att ångra!',
			'CLEAR_UNSORTED' => 'Rensa osorterade',
			'KEEP_UNSORTED' => 'Behåll osorterade',

			'EDIT_SHARING' => 'Redrigera delning',
			'MAKE_PRIVATE' => 'Gör privat',

			'CLOSE_ALBUM' => 'Stäng albumet',
			'CLOSE_PHOTO' => 'Stäng fotografiet',
			'CLOSE_MAP' => 'Close Map',

			'ADD' => 'Lägg till',
			'MOVE' => 'Flytta',
			'MOVE_ALL' => 'Flytta valda',
			'DUPLICATE' => 'Kopiera',
			'DUPLICATE_ALL' => 'Kopiera valda',
			'COPY_TO' => 'Kopiera till ...',
			'COPY_ALL_TO' => 'Valda kopia till ...',
			'DELETE' => 'Radera',
			'DELETE_ALL' => 'Radera vald',
			'DOWNLOAD' => 'Ladda ner',
			'DOWNLOAD_ALL' => 'Download Selected',
			'UPLOAD_PHOTO' => 'Ladda upp fotografi',
			'IMPORT_LINK' => 'Importera från länk',
			'IMPORT_DROPBOX' => 'Importera från Dropbox',
			'IMPORT_SERVER' => 'Importera från server',
			'NEW_ALBUM' => 'Nytt album',
			'NEW_TAG_ALBUM' => 'New Tag Album',

			'TITLE_NEW_ALBUM' => 'Skriv en titel för det nya albumet:',
			'UNTITLED' => 'Saknar titel',
			'UNSORTED' => 'Osorterat',
			'STARRED' => 'Stjärnmärkta',
			'RECENT' => 'Nyligen',
			'PUBLIC' => 'Publika',
			'NUM_PHOTOS' => 'Fotografier',

			'CREATE_ALBUM' => 'Skapa album',
			'CREATE_TAG_ALBUM' => 'Create Tag Album',

			'STAR_PHOTO' => 'Stjärnmärk fotografi',
			'STAR' => 'Stjärnmärk',
			'STAR_ALL' => 'Markera valda som favoriter',
			'TAGS' => 'Tag',
			'TAGS_ALL' => 'Vald taggen',
			'UNSTAR_PHOTO' => 'Ta bort stjärnmärke',
			'SET_COVER' => 'Set Album Cover',
			'REMOVE_COVER' => 'Remove Album Cover',

			'FULL_PHOTO' => 'Originalfotografi',
			'ABOUT_PHOTO' => 'Om fotografiet',
			'DISPLAY_FULL_MAP' => 'Map',
			'DIRECT_LINK' => 'Direktlänk',
			'DIRECT_LINKS' => 'Direct Links',

			'ALBUM_ABOUT' => 'Om',
			'ALBUM_BASICS' => 'Grundläggande',
			'ALBUM_TITLE' => 'Titel',
			'ALBUM_NEW_TITLE' => 'Skriv en ny titel för det här albumet:',
			'ALBUMS_NEW_TITLE_1' => 'Skriv en ny titel för alla',
			'ALBUMS_NEW_TITLE_2' => 'valda album:',
			'ALBUM_SET_TITLE' => 'Spara titel',
			'ALBUM_DESCRIPTION' => 'Beskrivning',
			'ALBUM_SHOW_TAGS' => 'Tags to show',
			'ALBUM_NEW_DESCRIPTION' => 'Ny beskrivning för detta album:',
			'ALBUM_SET_DESCRIPTION' => 'Spara beskrivningen',
			'ALBUM_NEW_SHOWTAGS' => 'Enter tags of photos that will be visible in this album:',
			'ALBUM_SET_SHOWTAGS' => 'Set tags to show',
			'ALBUM_ALBUM' => 'Album',
			'ALBUM_CREATED' => 'Skapad',
			'ALBUM_IMAGES' => 'Fotografier',
			'ALBUM_VIDEOS' => 'Videos',
			'ALBUM_SUBALBUMS' => 'Subalbums',
			'ALBUM_SHARING' => 'Dela',
			'ALBUM_SHR_YES' => 'Ja',
			'ALBUM_SHR_NO' => 'Nej',
			'ALBUM_PUBLIC' => 'Publikt',
			'ALBUM_PUBLIC_EXPL' => 'Album can be viewed by others, subject to the restrictions below.',
			'ALBUM_FULL' => 'Original',
			'ALBUM_FULL_EXPL' => 'Full-resolution pictures are available.',
			'ALBUM_HIDDEN' => 'Dold',
			'ALBUM_HIDDEN_EXPL' => 'Bara personer med korrekt länk kan se detta album.',
			'ALBUM_MARK_NSFW' => 'Mark album as sensitive',
			'ALBUM_UNMARK_NSFW' => 'Unmark album as sensitive',
			'ALBUM_NSFW' => 'Sensitive',
			'ALBUM_NSFW_EXPL' => 'Album is marked to contain sensitive content.',
			'ALBUM_DOWNLOADABLE' => 'Nedladdningsbart',
			'ALBUM_DOWNLOADABLE_EXPL' => 'Besökare till din Lychee kan ladda ner detta album.',
			'ALBUM_SHARE_BUTTON_VISIBLE' => 'Share button is visible',
			'ALBUM_SHARE_BUTTON_VISIBLE_EXPL' => 'Display social media sharing links.',
			'ALBUM_PASSWORD' => 'Lösenord',
			'ALBUM_PASSWORD_PROT' => 'Lösenordsskyddad',
			'ALBUM_PASSWORD_PROT_EXPL' => 'Albumet kan bara ses med giltigt lösenord.',
			'ALBUM_PASSWORD_REQUIRED' => 'Albumet är skyddat med ett lösenord. Ange lösenordet nedan för att se fotografierna i albumet:',
			'ALBUM_MERGE_1' => 'Är du säker på att du vill sammanfoga albumet',
			'ALBUM_MERGE_2' => 'med albumet',
			'ALBUMS_MERGE' => 'Är du säker på att du vill sammanfoga samtliga valda album till albumet',
			'MERGE_ALBUM' => 'Sammanfoga album',
			'DONT_MERGE' => 'Sammanfoga inte',
			'ALBUM_MOVE_1' => 'Are you sure you want to move the album',
			'ALBUM_MOVE_2' => 'into the album',
			'ALBUMS_MOVE' => 'Are you sure you want to move all selected albums into the album',
			'MOVE_ALBUMS' => 'Move Albums',
			'NOT_MOVE_ALBUMS' => "Don't Move",
			'ROOT' => 'Album',
			'ALBUM_REUSE' => 'Reuse',
			'ALBUM_LICENSE' => 'License',
			'ALBUM_SET_LICENSE' => 'Set License',
			'ALBUM_LICENSE_HELP' => 'Need help choosing?',
			'ALBUM_LICENSE_NONE' => 'None',
			'ALBUM_RESERVED' => 'All Rights Reserved',
			'ALBUM_SET_ORDER' => 'Set Order',
			'ALBUM_ORDERING' => 'Order by',

			'PHOTO_ABOUT' => 'Om',
			'PHOTO_BASICS' => 'Grundläggande',
			'PHOTO_TITLE' => 'Titel',
			'PHOTO_NEW_TITLE' => 'Skriv in en ny tital för det hör fotografiet:',
			'PHOTO_SET_TITLE' => 'Spara titeln',
			'PHOTO_UPLOADED' => 'Uppladdat',
			'PHOTO_DESCRIPTION' => 'Beskrivning',
			'PHOTO_NEW_DESCRIPTION' => 'Skriv en ny beskrivning för detta fotografi:',
			'PHOTO_SET_DESCRIPTION' => 'Spara beskrivningen',
			'PHOTO_NEW_LICENSE' => 'Add a License',
			'PHOTO_SET_LICENSE' => 'Set License',
			'PHOTO_LICENSE' => 'License',
			'PHOTO_REUSE' => 'Reuse',
			'PHOTO_LICENSE_NONE' => 'None',
			'PHOTO_RESERVED' => 'All Rights Reserved',
			'PHOTO_LATITUDE' => 'Latitude',
			'PHOTO_LONGITUDE' => 'Longitude',
			'PHOTO_ALTITUDE' => 'Altitude',
			'PHOTO_IMGDIRECTION' => 'Direction',
			'PHOTO_LOCATION' => 'Location',
			'PHOTO_IMAGE' => 'Fotografi',
			'PHOTO_VIDEO' => 'Video',
			'PHOTO_SIZE' => 'Storlek',
			'PHOTO_FORMAT' => 'Filformat',
			'PHOTO_DURATION' => 'Duration',
			'PHOTO_FPS' => 'Frame rate',
			'PHOTO_RESOLUTION' => 'Mått',
			'PHOTO_TAGS' => 'Kategori',
			'PHOTO_NOTAGS' => 'Inga kategorier',
			'PHOTO_NEW_TAGS' => 'Skriv in din kategori för det här fotografier. Du kan ange flera kategori genom att separera dem med ett kommatecken:',
			'PHOTO_NEW_TAGS_1' => 'Ange kategori för samtliga valda bilder',
			'PHOTO_NEW_TAGS_2' => 'Befintliga kategorier kommer att raderas. Du kan lägga till nya kategorier genom att separera dem med kommatecken:',
			'PHOTO_SET_TAGS' => 'Spara kategori',
			'PHOTO_CAMERA' => 'Kamera',
			'PHOTO_CAPTURED' => 'Digitaliserad',
			'PHOTO_MAKE' => 'Tillverkare',
			'PHOTO_TYPE' => 'Typ/Modell',
			'PHOTO_LENS' => 'Lens',
			'PHOTO_SHUTTER' => 'Slutartid',
			'PHOTO_APERTURE' => 'Bländartal',
			'PHOTO_FOCAL' => 'Brännvidd',
			'PHOTO_ISO' => 'ISO',
			'PHOTO_SHARING' => 'Delning',
			'PHOTO_SHR_PLUBLIC' => 'Publik',
			'PHOTO_SHR_ALB' => 'Ja (Album)',
			'PHOTO_SHR_PHT' => 'Ja (Fotografi)',
			'PHOTO_SHR_NO' => 'Nej',
			'PHOTO_DELETE' => 'Radera fotografi',
			'PHOTO_KEEP' => 'Spara fotografi',
			'PHOTO_DELETE_1' => 'Är du säker på att du vill radera det här fotografiet?',
			'PHOTO_DELETE_2' => 'Raderingen går inte att ångra!',
			'PHOTO_DELETE_ALL_1' => 'Är du säker på att du vill radera alla',
			'PHOTO_DELETE_ALL_2' => 'valda fotografier? Raderingen går inte att ångra!',
			'PHOTOS_NEW_TITLE_1' => 'Ange en tital för alla',
			'PHOTOS_NEW_TITLE_2' => 'valda fotografier:',
			'PHOTO_MAKE_PRIVATE_ALBUM' => 'Det här fotografier finns i ett publikt album. Du kan ändra fotografiets synlighet genom att redigera egenskapen för albumet.',
			'PHOTO_SHOW_ALBUM' => 'Visa album',
			'PHOTO_PUBLIC' => 'Public',
			'PHOTO_PUBLIC_EXPL' => 'Photo can be viewed by others, subject to the restrictions below.',
			'PHOTO_FULL' => 'Original',
			'PHOTO_FULL_EXPL' => 'Full-resolution picture is available.',
			'PHOTO_HIDDEN' => 'Hidden',
			'PHOTO_HIDDEN_EXPL' => 'Only people with the direct link can view this photo.',
			'PHOTO_DOWNLOADABLE' => 'Downloadable',
			'PHOTO_DOWNLOADABLE_EXPL' => 'Visitors of your gallery can download this photo.',
			'PHOTO_SHARE_BUTTON_VISIBLE' => 'Share button is visible',
			'PHOTO_SHARE_BUTTON_VISIBLE_EXPL' => 'Display social media sharing links.',
			'PHOTO_PASSWORD_PROT' => 'Password protected',
			'PHOTO_PASSWORD_PROT_EXPL' => 'Photo only accessible with a valid password.',
			'PHOTO_EDIT_SHARING_TEXT' => 'The sharing properties of this photo will be changed to the following:',
			'PHOTO_NO_EDIT_SHARING_TEXT' => 'Because this photo is located in a public album, it inherits that album\'s visibility settings.  Its current visibility is shown below for informational purposes only.',
			'PHOTO_EDIT_GLOBAL_SHARING_TEXT' => 'The visibility of this photo can be fine-tuned using global Lychee settings. Its current visibility is shown below for informational purposes only.',
			'PHOTO_SHARING_CONFIRM' => 'Save',

			'LOADING' => 'Laddar',
			'ERROR' => 'Fel',
			'ERROR_TEXT' => 'Ojsan, något verkar ha gått lite fel. Prova att ladda om sidan och försök igen!',
			'ERROR_DB_1' => 'Kan inte ansluta till databasen då åtkomst nekades. Kontrollera adressen, användarnamnet och löseordet samt säkerställ att du har behörighet att ansluta mot databasen från din nuvarande adress.',
			'ERROR_DB_2' => 'Kunde inte skapa databasen. Kontrollera adressen, användarnamnet och löseordet samt säkerställ att du har behörighet att användarnamnet har behörighet att förändra databasen.',
			'ERROR_CONFIG_FILE' => "Kunde inte spara konfigureringen. Åtkomst nekades i 'data/'. Kontrollera rättigheterna för läsning, skrivning och exekvering för andra i 'data/' och 'uploads/'. För mera information läs dokumentet 'readme'.",
			'ERROR_UNKNOWN' => 'Något oväntat inträffade. Vänligen försök igen och kontrollera installationen av Lychee och din server. För mera information läs dokumentet readme.',
			'ERROR_LOGIN' => 'Kunde inte spara inloggningsuppgifterna. Vänligen prova med ett annat användarnamn och lösenord!',
			'ERROR_MAP_DEACTIVATED' => 'Map functionality has been deactivated under settings.',
			'ERROR_SEARCH_DEACTIVATED' => 'Search functionality has been deactivated under settings.',
			'SUCCESS' => 'OK',
			'RETRY' => 'Försök igen',

			'SETTINGS_SUCCESS_LOGIN' => 'Login Info updated.',
			'SETTINGS_SUCCESS_SORT' => 'Sorting order updated.',
			'SETTINGS_SUCCESS_DROPBOX' => 'Dropbox Key updated.',
			'SETTINGS_SUCCESS_LANG' => 'Language updated',
			'SETTINGS_SUCCESS_LAYOUT' => 'Layout updated',
			'SETTINGS_SUCCESS_IMAGE_OVERLAY' => 'EXIF Overlay setting updated',
			'SETTINGS_SUCCESS_PUBLIC_SEARCH' => 'Offentlig sökning uppdaterad',
			'SETTINGS_SUCCESS_LICENSE' => 'Default license updated',
			'SETTINGS_SUCCESS_MAP_DISPLAY' => 'Map display settings updated',
			'SETTINGS_SUCCESS_MAP_DISPLAY_PUBLIC' => 'Map display settings for public albums updated',
			'SETTINGS_SUCCESS_MAP_PROVIDER' => 'Map provider settings updated',

			'U2F_NOT_SUPPORTED' => 'U2F not supported. Sorry.',
			'U2F_NOT_SECURE' => 'Environment not secured. U2F not available.',
			'U2F_REGISTER_KEY' => 'Register new device.',
			'U2F_REGISTRATION_SUCCESS' => 'Registration successful!',
			'U2F_AUTHENTIFICATION_SUCCESS' => 'Authentication successful!',
			'U2F_CREDENTIALS' => 'Credentials',
			'U2F_CREDENTIALS_DELETED' => 'Credentials deleted!',

			'NEW_PHOTOS_NOTIFICATION' => 'Send new photos notification emails.',
			'SETTINGS_SUCCESS_NEW_PHOTOS_NOTIFICATION' => 'New photos notification updated',
			'USER_EMAIL_INSTRUCTION' => 'Add your email below to enable receiving email notifications.
To stop receiving emails, simply remove your email below.',

			'DB_INFO_TITLE' => 'Ange dina uppgifter för databasanslutninge nedan:',
			'DB_INFO_HOST' => 'Databasens adress (valfritt)',
			'DB_INFO_USER' => 'Databasens användarnamn',
			'DB_INFO_PASSWORD' => 'Databasens lösenord',
			'DB_INFO_TEXT' => 'Lychee kommer nu att skapa sin egen databas. Vill du istället ansluta till en befintlig databas anger du namnet på den:',
			'DB_NAME' => 'Databasens namn (valfritt)',
			'DB_PREFIX' => 'Tabell prefix (valfritt)',
			'DB_CONNECT' => 'Anslut',

			'LOGIN_TITLE' => 'Ange ett användarnamn och lösenord för din installation:',
			'LOGIN_USERNAME' => 'Nytt användarnamn',
			'LOGIN_PASSWORD' => 'Nytt lösenord',
			'LOGIN_PASSWORD_CONFIRM' => 'Confirm Password',
			'LOGIN_CREATE' => 'Skapa inloggning',

			'PASSWORD_TITLE' => 'Ange dina befintliga inloggningsuppgifter:',
			'USERNAME_CURRENT' => 'Befintligt användarnamn',
			'PASSWORD_CURRENT' => 'Befintligt lösenord',
			'PASSWORD_TEXT' => 'Ditt inloggningsuppgifter kommer att ändras till:',
			'PASSWORD_CHANGE' => 'Spara ändringar av inloggningsuppgifter',

			'EDIT_SHARING_TITLE' => 'Redigera delning',
			'EDIT_SHARING_TEXT' => 'Albumets egenskaper för delning kommer att ändras till:',
			'SHARE_ALBUM_TEXT' => 'Det här albumet kommer att delas ut med dessa egenskaper::',
			'ALBUM_SHARING_CONFIRM' => 'Save',

			'SORT_ALBUM_BY_1' => 'Sortera album efter',
			'SORT_ALBUM_BY_2' => 'i en',
			'SORT_ALBUM_BY_3' => 'ordning.',

			'SORT_ALBUM_SELECT_1' => 'skapelsetid',
			'SORT_ALBUM_SELECT_2' => 'titel',
			'SORT_ALBUM_SELECT_3' => 'beskrivning',
			'SORT_ALBUM_SELECT_4' => 'publikt',
			'SORT_ALBUM_SELECT_5' => 'senaste datum',
			'SORT_ALBUM_SELECT_6' => 'äldsta datum',

			'SORT_PHOTO_BY_1' => 'Sortera fotografier efter',
			'SORT_PHOTO_BY_2' => 'i en',
			'SORT_PHOTO_BY_3' => 'ordning.',

			'SORT_PHOTO_SELECT_1' => 'Uppladdningstid',
			'SORT_PHOTO_SELECT_2' => 'Fotograferingsdatum',
			'SORT_PHOTO_SELECT_3' => 'Titel',
			'SORT_PHOTO_SELECT_4' => 'Beskrivning',
			'SORT_PHOTO_SELECT_5' => 'Publikt',
			'SORT_PHOTO_SELECT_6' => 'Stjärnmärkning',
			'SORT_PHOTO_SELECT_7' => 'Bildformat',

			'SORT_ASCENDING' => 'stigande',
			'SORT_DESCENDING' => 'fallande',
			'SORT_CHANGE' => 'Spara ändringar av sorteringsföljden',

			'DROPBOX_TITLE' => 'Spara nyckeln för Dropbox',
			'DROPBOX_TEXT' => "För att kunna importera fotografier från ditt Dropboxkonto behöver du en godkänd applikationsnyckel från Dropbox.\n Skapa en personlig nyckel och ange den sedan här nedan:",

			'LANG_TEXT' => 'Ändra språket i Lychee till:',
			'LANG_TITLE' => 'Spara ändringen av språket',
			'PUBLIC_SEARCH_TEXT' => 'Offentlig sökning tillåts:',
			'OVERLAY_TYPE' => 'Photo overlay:',
			'OVERLAY_NONE' => 'None',
			'OVERLAY_EXIF' => 'EXIF data',
			'OVERLAY_DESCRIPTION' => 'Description',
			'OVERLAY_DATE' => 'Date taken',
			'MAP_DISPLAY_TEXT' => 'Enable maps (provided by OpenStreetMap):',
			'MAP_DISPLAY_PUBLIC_TEXT' => 'Enable maps for public albums (provided by OpenStreetMap):',
			'MAP_PROVIDER' => 'Provider of OpenStreetMap tiles:',
			'MAP_PROVIDER_WIKIMEDIA' => 'Wikimedia',
			'MAP_PROVIDER_OSM_ORG' => 'OpenStreetMap.org (no HiDPI)',
			'MAP_PROVIDER_OSM_DE' => 'OpenStreetMap.de (no HiDPI)',
			'MAP_PROVIDER_OSM_FR' => 'OpenStreetMap.fr (no HiDPI)',
			'MAP_PROVIDER_RRZE' => 'University of Erlangen, Germany (only HiDPI)',
			'MAP_INCLUDE_SUBALBUMS_TEXT' => 'Include photos of subalbums on map:',
			'LOCATION_DECODING' => 'Decode GPS data into location name',
			'LOCATION_SHOW' => 'Show location name',
			'LOCATION_SHOW_PUBLIC' => 'Show location name for public mode',
			'LAYOUT_TYPE' => 'Layout of photos:',
			'LAYOUT_SQUARES' => 'Square thumbnails',
			'LAYOUT_JUSTIFIED' => 'With aspect, justified',
			'LAYOUT_UNJUSTIFIED' => 'With aspect, unjustified',
			'SET_LAYOUT' => 'Change layout',

			'NSFW_VISIBLE_TEXT_1' => 'Make Sensitive albums visible by default.',
			'NSFW_VISIBLE_TEXT_2' => 'If the album is public, it is still accessible, just hidden from the view and can be revealed by pressing <hkb>H</hkb>.',
			'SETTINGS_SUCCESS_NSFW_VISIBLE' => 'Default sensitive album visibility updated with success.',

			'VIEW_NO_RESULT' => 'Inget resultat',
			'VIEW_NO_PUBLIC_ALBUMS' => 'Inga publika album',
			'VIEW_NO_CONFIGURATION' => 'Ingen konfigurering',
			'VIEW_PHOTO_NOT_FOUND' => 'Fotografiet hittade inte',

			'NO_TAGS' => 'Inga kategorier',

			'UPLOAD_MANAGE_NEW_PHOTOS' => 'Du kan nu hantera de nya bilderna.',
			'UPLOAD_COMPLETE' => 'Uppladdning klar',
			'UPLOAD_COMPLETE_FAILED' => 'Kunde inte ladda upp en eller flera bilder.',
			'UPLOAD_IMPORTING' => 'Importering',
			'UPLOAD_IMPORTING_URL' => 'Adress för importering',
			'UPLOAD_UPLOADING' => 'Uppladdning',
			'UPLOAD_FINISHED' => 'Klar',
			'UPLOAD_PROCESSING' => 'Bearbetning',
			'UPLOAD_FAILED' => 'Misslyckades',
			'UPLOAD_FAILED_ERROR' => 'Uppladdning misslyckades. Servern svarade med ett felmeddelande!',
			'UPLOAD_FAILED_WARNING' => 'Uppladdning misslyckades. Servern svarade med en varning!',
			'UPLOAD_CANCELLED' => 'Cancelled',
			'UPLOAD_SKIPPED' => 'Ignorerade',
			'UPLOAD_UPDATED' => 'Updated',
			'UPLOAD_IMPORT_SKIPPED_DUPLICATE' => 'This photo has been skipped because it\'s already in your library.',
			'UPLOAD_IMPORT_RESYNCED_DUPLICATE' => 'This photo has been skipped because it\'s already in your library, but its metadata has been updated.',
			'UPLOAD_ERROR_CONSOLE' => 'Kontrollera din webbläsares konsoll för ytterligare information.',
			'UPLOAD_UNKNOWN' => 'Servern returnerade ett oklart svar. Kontrollera din webbläsares konsoll för ytterligare information.',
			'UPLOAD_ERROR_UNKNOWN' => 'Uppladdning misslyckades. Servern returnerade ett oklart fel!',
			'UPLOAD_ERROR_POSTSIZE' => 'Upload failed. The PHP post_max_size may be too small! Otherwise check the FAQ.',
			'UPLOAD_ERROR_FILESIZE' => 'Upload failed. The PHP upload_max_filesize may be too small! Otherwise check the FAQ.',
			'UPLOAD_IN_PROGRESS' => 'Lychee laddar för tillfället upp material!',
			'UPLOAD_IMPORT_WARN_ERR' => 'Importeringen är avslutad, men processen gav felmeddelanden. Kontrollera logfilen (Inställningar -> Visa logfilen) för ytterligare detaljer.',
			'UPLOAD_IMPORT_COMPLETE' => 'Importeringen klar',
			'UPLOAD_IMPORT_INSTR' => 'Ange den exakta länken till fotografiet du vill importera.',
			'UPLOAD_IMPORT' => 'Importera',
			'UPLOAD_IMPORT_SERVER' => 'Importera från server',
			'UPLOAD_IMPORT_SERVER_FOLD' => 'Mappen du angav var tom eller saknade läsbara filer. Kontrollera logfilen (Inställningar -> Visa logfilen) för ytterligare detaljer',
			'UPLOAD_IMPORT_SERVER_INSTR' => 'Den här processen kommer att importera alla fotografier, inklusive alla mappar och undermappar från platse du angav.',
			'UPLOAD_ABSOLUTE_PATH' => 'Exakt sökväg till mappen',
			'UPLOAD_IMPORT_SERVER_EMPT' => 'Kunde inte påbörja importeringen då mappen saknade innehåll!',
			'UPLOAD_IMPORT_DELETE_ORIGINALS' => 'Delete originals',
			'UPLOAD_IMPORT_DELETE_ORIGINALS_EXPL' => 'Originalfotografierna kommer att raderas efter att importering genomförts.',
			'UPLOAD_IMPORT_VIA_SYMLINK' => 'Symbolic links',
			'UPLOAD_IMPORT_VIA_SYMLINK_EXPL' => 'Import files using symbolic links to originals.',
			'UPLOAD_IMPORT_SKIP_DUPLICATES' => 'Skip duplicates',
			'UPLOAD_IMPORT_SKIP_DUPLICATES_EXPL' => 'Existing media files are skipped.',
			'UPLOAD_IMPORT_RESYNC_METADATA' => 'Re-sync metadata',
			'UPLOAD_IMPORT_RESYNC_METADATA_EXPL' => 'Update metadata of existing media files.',
			'UPLOAD_IMPORT_LOW_MEMORY' => 'Low memory condition!',
			'UPLOAD_IMPORT_LOW_MEMORY_EXPL' => 'The import process on the server is approaching the memory limit and may end up being terminated prematurely.',
			'UPLOAD_WARNING' => 'Warning',
			'UPLOAD_IMPORT_NOT_A_DIRECTORY' => 'The given path is not a readable directory!',
			'UPLOAD_IMPORT_PATH_RESERVED' => 'The given path is a reserved path of Lychee!',
			'UPLOAD_IMPORT_UNREADABLE' => 'Could not read the file!',
			'UPLOAD_IMPORT_FAILED' => 'Could not import the file!',
			'UPLOAD_IMPORT_UNSUPPORTED' => 'Unsupported file type!',
			'UPLOAD_IMPORT_ALBUM_FAILED' => 'Could not create the album!',
			'UPLOAD_IMPORT_CANCELLED' => 'Import cancelled',

			'ABOUT_SUBTITLE' => 'Self-hosted photo-management done right',
			'ABOUT_DESCRIPTION' => 'is a free photo-management tool, which runs on your server or web-space. Installing is a matter of seconds. Upload, manage and share photos like from a native application. Lychee comes with everything you need and all your photos are stored securely.',
			'FOOTER_COPYRIGHT' => 'Alla bilder på denna webbplats är föremål för upphovsrätt från',
			'HOSTED_WITH_LYCHEE' => 'Hosted with Lychee',

			'URL_COPY_TO_CLIPBOARD' => 'Copy to clipboard',
			'URL_COPIED_TO_CLIPBOARD' => 'Copied URL to clipboard!',
			'PHOTO_DIRECT_LINKS_TO_IMAGES' => 'Direct links to image files:',
			'PHOTO_MEDIUM' => 'Medium',
			'PHOTO_MEDIUM_HIDPI' => 'Medium HiDPI',
			'PHOTO_SMALL' => 'Thumb',
			'PHOTO_SMALL_HIDPI' => 'Thumb HiDPI',
			'PHOTO_THUMB' => 'Square thumb',
			'PHOTO_THUMB_HIDPI' => 'Square thumb HiDPI',
			'PHOTO_LIVE_VIDEO' => 'Video part of live-photo',
			'PHOTO_VIEW' => 'Lychee Photo View:',

			'PHOTO_EDIT_ROTATECWISE' => 'Rotate clockwise',
			'PHOTO_EDIT_ROTATECCWISE' => 'Rotate counter-clockwise',
		];

		return $locale;
	}
}


text:
package org.frameworkset.web.socket.sockjs;

import org.frameworkset.util.Assert;

public abstract class AbstractSockJsMessageCodec  implements SockJsMessageCodec {

	@Override
	public String encode(String... messages) {
		Assert.notNull(messages, "messages must not be null");
		StringBuilder sb = new StringBuilder();
		sb.append("a[");
		for (int i=0; i < messages.length; i++) {
			sb.append('"');
			char[] quotedChars = applyJsonQuoting(messages[i]);
			sb.append(escapeSockJsSpecialChars(quotedChars));
			sb.append('"');
            if (i < messages.length - 1) {
                sb.append(',');
            }
		}
		sb.append(']');
		return sb.toString();
	}

	/**
	 * Apply standard JSON string quoting (see http://www.json.org/).
	 */
	protected abstract char[] applyJsonQuoting(String content);

	/**
	 * See "JSON Unicode Encoding" section of SockJS protocol.
	 */
	private String escapeSockJsSpecialChars(char[] characters) {
		StringBuilder result = new StringBuilder();
		for (char c : characters) {
			if (isSockJsSpecialChar(c)) {
				result.append('\\').append('u');
				String hex = Integer.toHexString(c).toLowerCase();
				for (int i = 0; i < (4 - hex.length()); i++) {
					result.append('0');
				}
				result.append(hex);
			}
			else {
				result.append(c);
			}
		}
		return result.toString();
	}

	/**
	 * See `escapable_by_server` variable in the SockJS protocol test suite.
	 */
	private boolean isSockJsSpecialChar(char ch) {
		return (ch >= '\u0000' && ch <= '\u001F') || (ch >= '\u200C' && ch <= '\u200F') ||
				(ch >= '\u2028' && ch <= '\u202F') || (ch >= '\u2060' && ch <= '\u206F') ||
				(ch >= '\uFFF0' && ch <= '\uFFFF') || (ch >= '\uD800' && ch <= '\uDFFF');
	}

}


text:
=============

## playing with GWT

1. GwtWithDb

2. Classroom

## playing with MVP

1. Activity(Presenter) + Place + View
* If we use the whole page as the container display of each activity, which means each view will have the same layout widgets in its UI template.

## Tomcat 7 on Linux Mint

1. install apache tomcat 7

2. sudo vi setenv.sh and move to tomcat/bin folder


text:
namespace glsp {

using glm::vec4;

ScreenMapper::ScreenMapper():
	PipeStage("Viewport Transform", DrawEngine::getDrawEngine())
{
}

void ScreenMapper::emit(void *data)
{
	Batch *bat = static_cast<Batch *>(data);

	viewportTransform(bat);

	getNextStage()->emit(bat);
}

void ScreenMapper::viewportTransform(Batch *bat)
{
	GLContext   *gc = bat->mDC->gc;

	const float xCenter = gc->mState.mViewport.xCenter;
	const float yCenter = gc->mState.mViewport.yCenter;
	const float xScale  = gc->mState.mViewport.xScale;
	const float yScale  = gc->mState.mViewport.yScale;

	Primlist &pl = bat->mPrims;
	Primlist::iterator it = pl.begin();

	while(it != pl.end())
	{
		for(size_t i = 0; i < 3; ++i)
		{
			// TODO: snap to sub-pixel grids
			vec4 &pos = (*it)->mVert[i].position();
			pos.x = xCenter + pos.x * xScale;
			pos.y = yCenter + pos.y * yScale;
			pos.z = (pos.z + 1) * 0.5f;
		}

		const vec4 &pos0 = (*it)->mVert[0].position();
		const vec4 &pos1 = (*it)->mVert[1].position();
		const vec4 &pos2 = (*it)->mVert[2].position();

		const float ex = pos1.x - pos0.x;
		const float ey = pos1.y - pos0.y;
		const float fx = pos2.x - pos0.x;
		const float fy = pos2.y - pos0.y;
		const float area = ex * fy - ey * fx;

		// Discard degenerate triangles
		if(abs(area) == 0.0f)
		{
			Primitive *prim = *it;
			it = pl.erase(it);

			prim->~Primitive();
			MemoryPoolMT::get().deallocate(prim, sizeof(Primitive));
		}
		else
		{
			(*it)->mAreaReciprocal = 1.0f / area;
			it++;
		}
	}
}

void ScreenMapper::finalize()
{
}

} // namespace glsp


text:
	<title>Tanveer Ahmed's panel show appearances</title>

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

Tanveer Ahmed's panel show appearances

Tanveer Ahmed has appeared in 2 episodes between 2009-2011.  Tanveer Ahmed on Wikipedia.

2009

2010

2011

2011-10-31 / Q&A

2009-03-12 / Q&A


text:
<?php
$logged = false;
$user = '';
if(isset($_SESSION["logged"])){
	$logged = $_SESSION["logged"];
	$user = $_SESSION["username"];
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="<?=base_url();?>assets/css/home.css" type="text/css" media="screen" />
<link rel="stylesheet" href="<?=base_url();?>assets/css/menu_bar.css" type="text/css" media="screen" />
<link rel="stylesheet" href="<?=base_url();?>assets/css/table.css" type="text/css" media="screen" />
<link rel="stylesheet" href="<?=base_url();?>assets/css/bottom_footer.css" type="text/css" media="screen" />
<link REL="SHORTCUT ICON" HREF="<?=base_url();?>assets/img/icon.ico" type="image/x-icon">
<link REL="ICON" HREF="<?=base_url();?>assets/img/icon.ico" type="image/x-icon">

Please enable Javascript to enjoy your viewing
<title>Home Page | Welcome to Betips.co.ke</title>

<a href="<?=base_url();?>howto">How it works

<a href="<?=base_url();?>about/services">Services

M-Pesa to 0712594022

Free Tips

<a href="<?=base_url();?>tips/valuebets/">Value Bet Tips

                    <?php
					if($logged){
                    ?>

<a href="<?=base_url();?>tips/premium/">Premium Tips

<a href="<?=base_url();?>home/profile/">My Profile

<a href="<?=base_url();?>transactions/buy">Buy Credits

                    <?php
					}else{
                    ?>

<a href="<?=base_url();?>bethelp/">Bet Advice

<a href="<?=base_url();?>about/">About

                     <?php
					}
                    ?>

<a href="<?=base_url();?>contacts">Contact Us

                    <?php if(!$logged) echo '
Join Now!
';?>

            <?php
			if(!$logged){
			?>

				<?php echo form_open("login/auth/"); ?>

                	Username:
                	<input type="text" id="email" name="username" class="txt" required="required" placeholder="username" />

                    Password:
                    <input type="password" id="password" name="password" class="txt" required="required" placeholder="********" />

                    <input type="submit" name="submit" id="submit" value="Go" />
                <?php echo form_close(); ?>
                <?php
				if(isset($disp_msg)) echo $disp_msg;
				?>

            <?php
			}else{
			?>
            <a id="logout" href="<?=base_url();?>logout">logout [<?php echo $user; ?>]

            	<form id="login_form" method="post" action="login_user.php">

                	<?php //echo 'Your account bal. '.number_format($_SESSION['balance'], 2).''; ?>

                </form>

            <?php }?>

        <?php if(!$logged){ ?>

            	Register Now

        <?php }else{?>

        <?php } ?>

        	*as per odds on sportpesa and betin

                    Time: 18:01:08
09-03-2014

                    Today's Matches to bet on:                          Average Odds:              Yesterday's Tips

Day &Time

Game

Tip

Weight

1

X

2

FT Result

outcome

                Contact Us

                	Nairobi
                    Gansta drive, All buildings
                    1st Floor, Hall 6
                    P.O Box 0988-98765
                    Westlands
                    <address>business@mybets.co.ke
					0712-789-654</address>

            	Games

Football

Basketball

Horse racing

Rugby

Tennis

            	Leagues

KPL

EPL

La Liga

Serie A

NBA

            	Links

Affiliates

Refer a friend

Betting rules

Advertisements

Help

            	For enquiries kindly email us at:info@mybets.co.ke or support@mybets.co.ke

Home

Games

<a href="<?=base_url();?>about">About Us

Privacy policy

<a href="<?=base_url();?>terms">Terms&Conditions

<a href="<?=base_url();?>about/services">Services

Contacts

                ©2014 mybets inc. All rights reserved.


text:
<!DOCTYPE html>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>Tools — Brackets 0.5.2 documentation</title>

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

        <link rel="index" title="Index"
              href="../genindex.html"/>
        <link rel="search" title="Search" href="../search.html"/>
    <link rel="top" title="Brackets 0.5.2 documentation" href="../index.html"/>
        <link rel="next" title="bpy-compile" href="bpy-compile.html"/>
        <link rel="prev" title="Importer hooks" href="../brackets/importer.html"/>

             Brackets

                0.5.2

  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>

Contents:

Introduction

Getting Started

Tutorial

Using Brackets

Tools

bpy-compile

Jupyter

          Brackets

Docs »

Tools

             View page source

Tools¶

Brackets has some tools, that are included in the package and are available
after install, these will be explained here.

Contents:

bpy-compile

Jupyter

        Next

         Previous

        © Copyright 2017, Pouya Eghbali.

  Built with Sphinx using a theme provided by Read the Docs.