text:
current_dir = File.expand_path(File.dirname(__FILE__))
proto_dir   = File.join(current_dir + '/lib/vitessproto')
$LOAD_PATH.unshift(current_dir)
$LOAD_PATH.unshift(proto_dir)

require 'google/protobuf'
require 'grpc'

require 'proto/query'
require 'proto/vtgate'
require 'proto/vtgateservice'

require 'logger'

# RubyLogger defines a logger for gRPC based on the standard ruby logger.
module RubyLogger
  def logger
    LOGGER
  end

  LOGGER = Logger.new(STDOUT)
  LOGGER.level = Logger::DEBUG
end

# GRPC is the general RPC module
module GRPC
  # Inject the noop #logger if no module-level logger method has been injected.
  extend RubyLogger
end

module Vitess
  class VtgateServer < Vtgate::Service
    def execute(request, _call)
      row    = Query::Row.new(lengths: [1], values: 'hogehoge'.force_encode("ASCII-8BIT\n"))
      field  = Query::Field.new(name: 'name', type: Query::Type::VARCHAR)
      result = Query::QueryResult.new(fields: [field, field], rows_affected: 1, insert_id: 1, rows: [row, row])
      RubyLogger::LOGGER.info row.values
      Query::ExecuteResponse.new(result: result)
    end

    def begin(request, _call)
    end

    def execute_keyspace_ids(request, _call)
    end
  end
end

s = GRPC::RpcServer.new
s.add_http2_port("localhost:45678", :this_port_is_insecure)
#Logger.info("... running insecurely on #{port}")
s.handle(Vitess::VtgateServer)
s.run_till_terminated


text:
using System;

namespace IPCUtilities
{
    static class Guard
    {
        internal static void ThrowIsNull(object param)
        {
            if (param==null)
                throw new ArgumentNullException(nameof(param));
        }
        internal static void ThrowIsNull(string ceroParam)
        {
            if (string.IsNullOrEmpty(ceroParam))
                throw new ArgumentNullException(ceroParam, "parameters is null");
        }
        internal static void ThrowIsNull(string ceroParam,string primeraParam)
        {
            if (string.IsNullOrEmpty(ceroParam))
                throw new ArgumentNullException(ceroParam, "parameters is null");
            if (string.IsNullOrEmpty(primeraParam))
                throw new ArgumentNullException(primeraParam,"primeraParam is null");
        }
        internal static void ThrowIsNull(string ceroParam, string primeraParam,string segundoParam)
        {
            if (string.IsNullOrEmpty(ceroParam))
                throw new ArgumentNullException(ceroParam,"parameters is null");
            if (string.IsNullOrEmpty(primeraParam))
                throw new ArgumentNullException(primeraParam, "parameters is null");
            if (string.IsNullOrEmpty(segundoParam))
                throw new ArgumentNullException(segundoParam, "parameters is null");
        }
        internal static void ThrowIsNull(string ceroParam, string primeraParam, string segundoParam,string terceraParam)
        {
            if (string.IsNullOrEmpty(ceroParam))
                throw new ArgumentNullException(ceroParam,"parameters is null");
            if (string.IsNullOrEmpty(primeraParam))
                throw new ArgumentNullException(primeraParam, "parameters is null");
            if (string.IsNullOrEmpty(segundoParam))
                throw new ArgumentNullException(segundoParam,"parameters is null");
            if (string.IsNullOrEmpty(terceraParam))
                throw new ArgumentNullException(terceraParam,"parameters is null");
        }

    }
}

redpajama_set_name: RedPajamaGithub


text:
<component name="libraryTable">
  <library name="android-support-v4">
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/MPDroid/libs/android-support-v4.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES />
  </library>
</component>


text:
package org.projectomakase.omakase.job.configuration;

import org.projectomakase.omakase.jcr.JcrEntity;
import org.jcrom.annotations.JcrNode;
import org.jcrom.annotations.JcrProperty;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.stream.Stream;

/**
 * Ingest Job Configuration
 *
 * @author Richard Lucas
 */
@JcrNode(mixinTypes = {"omakase:replicationConfiguration"}, classNameProperty = "className")
public class ReplicationJobConfiguration extends JcrEntity implements JobConfiguration {

    @JcrProperty(name = "omakase:variant")
    private String variant;
    @JcrProperty(name = "omakase:sourceRepositories")
    private List<String> sourceRepositories;
    @JcrProperty(name = "omakase:destinationRepositories")
    private List<String> destinationRepositories;

    @Override
    public String getVariant() {
        return variant;
    }

    public void setVariant(String variant) {
        this.variant = variant;
    }

    public List<String> getSourceRepositories() {
        return Optional.ofNullable(sourceRepositories).orElse(new ArrayList<>());
    }

    public void setSourceRepositories(List<String> sourceRepositories) {
        this.sourceRepositories = sourceRepositories;
    }

    public List<String> getDestinationRepositories() {
        return Optional.ofNullable(destinationRepositories).orElse(new ArrayList<>());
    }

    public void setDestinationRepositories(List<String> destinationRepositories) {
        this.destinationRepositories = destinationRepositories;
    }

    @Override
    public void validate(JobConfigurationValidator validator) {
        validator.validate(this);
    }

    @Override
    public String toString() {
        return "ReplicationJobConfiguration{" +
                "variant='" + variant + '\'' +
                ", sourceRepositories=" + sourceRepositories +
                ", destinationRepositories=" + destinationRepositories +
                '}';
    }

    public static class Builder {
        @FunctionalInterface
        public interface JobConfigurationSetter extends Consumer<ReplicationJobConfiguration> {
        }

        public static ReplicationJobConfiguration build(JobConfigurationSetter... jobSetters) {
            final ReplicationJobConfiguration configuration = new ReplicationJobConfiguration();

            Stream.of(jobSetters).forEach(s -> s.accept(configuration));

            return configuration;
        }
    }
}


text:
#ifndef __GL_TEXSHADERS_H__
#define __GL_TEXSHADERS_H__

#include "tarray.h"
#include "zstring.h"
#include "gl/utility/gl_cycler.h"

enum
{
   SHADER_TexGen_None = 0,
   SHADER_TexGen_Sphere,
   NUM_TexGenTypes
};

//==========================================================================
//
//
//
//==========================================================================

class FShaderLayer
{
public:
	FShaderLayer();
	FShaderLayer(const FShaderLayer &layer);
	~FShaderLayer();
	void Update(float diff);
	CycleType ParseCycleType(FScanner &sc);
	bool ParseLayer(FScanner &sc);

	FTextureID texture;
	int warpspeed;
	unsigned char warp;
	bool animate;
	bool emissive;
	unsigned char texgen;
	float centerX, centerY;
	float rotation;
	float rotate;
	float offsetX, offsetY;
	FCycler adjustX, adjustY;
	FCycler vectorX, vectorY;
	FCycler scaleX, scaleY;
	FCycler alpha;
	FCycler r, g, b;
	FCycler srcFactor, dstFactor;
	unsigned int flags;
	unsigned int blendFuncSrc, blendFuncDst;
	FShaderLayer *layerMask;
};

//==========================================================================
//
//
//
//==========================================================================

class FTextureShader
{
public:
	FTextureShader();
	bool ParseShader(FScanner &sc, TArray<FTextureID> &names);
	bool Available();
	bool Setup(float time);
	void Update(int framems);
	void FakeUpdate(int framems);
	FString CreateName();
	FString GenerateCode();

	FName name;
	TDeletingArray <FShaderLayer *> layers; // layers for shader
	unsigned int lastUpdate;
};

/*
//extern TArray<FShader *> Shaders[NUM_ShaderClasses];
//extern TArray<FShader *> ShaderLookup[NUM_ShaderClasses];

void GL_InitShaders();
void GL_ReleaseShaders();
void GL_UpdateShaders();
void GL_FakeUpdateShaders();
//void GL_UpdateShader(FShader *shader);
void GL_DrawShaders();
//FShader *GL_ShaderForTexture(FTexture *tex);

bool GL_ParseShader();
*/

#endif // __GL_TEXSHADERS_H__


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Histacom2.Engine;
using Histacom2.Engine.Template;

namespace Histacom2.OS.Win95.Win95Apps
{
    public partial class WinClassicThemePanel : UserControl
    {
        public WinClassicThemePanel()
        {
            InitializeComponent();
            applyButton.Paint += (sender, args) => Engine.Paintbrush.PaintClassicBorders(sender, args, 2);
            cancelButton.Paint += (sender, args) => Engine.Paintbrush.PaintClassicBorders(sender, args, 2);
            okButton.Paint += (sender, args) => Engine.Paintbrush.PaintClassicBorders(sender, args, 2);
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch ((string)comboBox1.SelectedItem)
            {
                case "Default":
                    pictureBox2.BackgroundImage = null;
                    break;
                case "Dangerous Creatures":
                    pictureBox2.BackgroundImage = Properties.Resources.DCTheme_BG;
                    break;
                case "Inside Your Computer":
                    pictureBox2.BackgroundImage = Properties.Resources.ICTheme_BG;
                    break;
                case "Windows 95 Default Plus":
                    pictureBox2.BackgroundImage = Properties.Resources.Win95PlusDefaultWallpaper;
                    break;
                case "The Golden Era":
                    pictureBox2.BackgroundImage = Properties.Resources.Win95PlusGoldenEraWallpaper;
                    break;
                case "Leonardo da Vinci":
                    pictureBox2.BackgroundImage = Properties.Resources.Win95PlusLeoWallpaper;
                    break;
                case "Mystery":
                    pictureBox2.BackgroundImage = Properties.Resources.Win95PlusMysteryWallpaper;
                    break;
                case "Nature":
                    pictureBox2.BackgroundImage = Properties.Resources.Win95PlusNatureWallpaper;
                    break;
                case "Science":
                    pictureBox2.BackgroundImage = Properties.Resources.Win95PlusScienceWallpaper;
                    break;
                case "Sports":
                    pictureBox2.BackgroundImage = Properties.Resources.Win95PlusSportsWallpaper;
                    break;
                case "The 60's USA":
                    pictureBox2.BackgroundImage = Properties.Resources.Win95PlusThe60Wallpaper;
                    break;
                case "Travel":
                    pictureBox2.BackgroundImage = Properties.Resources.Win95PlusTravelWallpaper;
                    break;
                case "More Windows":
                    pictureBox2.BackgroundImage = Properties.Resources.Win95PlusMoreWin;
                    break;
            }
        }

        private void WinClassicThemePanel_Load(object sender, EventArgs e)
        {
            switch (SaveSystem.CurrentSave.ThemeName)
            {
                case "default95":
                    comboBox1.SelectedItem = "Default";
                    break;
                case "dangeranimals":
                    comboBox1.SelectedItem = "Dangerous Creatures";
                    break;
                case "insidepc":
                    comboBox1.SelectedItem = "Inside Your Computer";
                    break;
                case "default95plus":
                    comboBox1.SelectedItem = "Windows 95 Default Plus";
                    break;
                case "goldenera":
                    comboBox1.SelectedItem = "The Golden Era";
                    break;
                case "Leo":
                    comboBox1.SelectedItem = "Leonardo da Vinci";
                    break;
                case "Mystery":
                    comboBox1.SelectedItem = "Mystery";
                    break;
                case "Nature":
                    comboBox1.SelectedItem = "Nature";
                    break;
                case "Science":
                    comboBox1.SelectedItem = "Science";
                    break;
                case "Sports":
                    comboBox1.SelectedItem = "Sports";
                    break;
                case "The60":
                    comboBox1.SelectedItem = "The 60's USA";
                    break;
                case "Travel":
                    comboBox1.SelectedItem = "Travel";
                    break;
                case "MoreWin":
                    comboBox1.SelectedItem = "More Windows";
                    break;

            }
        }

        private void cancelButton_Click(object sender, EventArgs e)
        {
            ParentForm.Close();
        }

        private void applyButton_Click(object sender, EventArgs e)
        {
            ChangeTheme();
        }

        private void okButton_Click(object sender, EventArgs e)
        {
            ChangeTheme();
            ParentForm.Close();
        }

        private void ChangeTheme()
        {
            switch ((string)comboBox1.SelectedItem)
            {
                case "Default":
                    SaveSystem.CurrentSave.ThemeName = "default95";
                    SaveSystem.currentTheme = new Default95Theme();
                    TitleScreen.frm95.desktopicons.BackgroundImage = null;
                    break;
                case "Dangerous Creatures":
                    SaveSystem.CurrentSave.ThemeName = "dangeranimals";
                    SaveSystem.currentTheme = new DangerousCreaturesTheme();
                    TitleScreen.frm95.desktopicons.BackgroundImage = new Bitmap(Properties.Resources.DCTheme_BG, TitleScreen.frm95.Width, TitleScreen.frm95.Height);
                    break;
                case "Inside Your Computer":
                    SaveSystem.CurrentSave.ThemeName = "insidepc";
                    SaveSystem.currentTheme = new InsideComputerTheme();
                    TitleScreen.frm95.desktopicons.BackgroundImage = new Bitmap(Properties.Resources.ICTheme_BG, TitleScreen.frm95.Width, TitleScreen.frm95.Height);
                    break;
                case "Windows 95 Default Plus":
                    SaveSystem.CurrentSave.ThemeName = "default95plus";
                    SaveSystem.currentTheme = new Default95PlusTheme();
                    TitleScreen.frm95.desktopicons.BackgroundImage = new Bitmap(Properties.Resources.Win95PlusDefaultWallpaper, TitleScreen.frm95.Width, TitleScreen.frm95.Height);
                    break;
                case "The Golden Era":
                    SaveSystem.CurrentSave.ThemeName = "goldenera";
                    SaveSystem.currentTheme = new GoldenEraTheme();
                    TitleScreen.frm95.desktopicons.BackgroundImage = new Bitmap(Properties.Resources.Win95PlusGoldenEraWallpaper, TitleScreen.frm95.Width, TitleScreen.frm95.Height);
                    break;
                case "Leonardo da Vinci":
                    SaveSystem.CurrentSave.ThemeName = "Leo";
                    SaveSystem.currentTheme = new LeoTheme();
                    TitleScreen.frm95.desktopicons.BackgroundImage = new Bitmap(Properties.Resources.Win95PlusLeoWallpaper, TitleScreen.frm95.Width, TitleScreen.frm95.Height);
                    break;
                case "Mystery":
                    SaveSystem.CurrentSave.ThemeName = "Mystery";
                    SaveSystem.currentTheme = new MysteryTheme();
                    TitleScreen.frm95.desktopicons.BackgroundImage = new Bitmap(Properties.Resources.Win95PlusMysteryWallpaper, TitleScreen.frm95.Width, TitleScreen.frm95.Height);
                    break;
                case "Nature":
                    SaveSystem.CurrentSave.ThemeName = "Nature";
                    SaveSystem.currentTheme = new NatureTheme();
                    TitleScreen.frm95.desktopicons.BackgroundImage = new Bitmap(Properties.Resources.Win95PlusNatureWallpaper, TitleScreen.frm95.Width, TitleScreen.frm95.Height);
                    break;
                case "Science":
                    SaveSystem.CurrentSave.ThemeName = "Science";
                    SaveSystem.currentTheme = new ScienceTheme();
                    TitleScreen.frm95.desktopicons.BackgroundImage = new Bitmap(Properties.Resources.Win95PlusScienceWallpaper, TitleScreen.frm95.Width, TitleScreen.frm95.Height);
                    break;
                case "Sports":
                    SaveSystem.CurrentSave.ThemeName = "Sports";
                    SaveSystem.currentTheme = new SportsTheme();
                    TitleScreen.frm95.desktopicons.BackgroundImage = new Bitmap(Properties.Resources.Win95PlusSportsWallpaper, TitleScreen.frm95.Width, TitleScreen.frm95.Height);
                    break;
                case "The 60's USA":
                    SaveSystem.CurrentSave.ThemeName = "The60";
                    SaveSystem.currentTheme = new The60Theme();
                    TitleScreen.frm95.desktopicons.BackgroundImage = new Bitmap(Properties.Resources.Win95PlusThe60Wallpaper, TitleScreen.frm95.Width, TitleScreen.frm95.Height);
                    break;
                case "Travel":
                    SaveSystem.CurrentSave.ThemeName = "Travel";
                    SaveSystem.currentTheme = new TravelTheme();
                    TitleScreen.frm95.desktopicons.BackgroundImage = new Bitmap(Properties.Resources.Win95PlusTravelWallpaper, TitleScreen.frm95.Width, TitleScreen.frm95.Height);
                    break;
                case "More Windows":
                    SaveSystem.CurrentSave.ThemeName = "MoreWin";
                    SaveSystem.currentTheme = new MoreWinTheme();
                    TitleScreen.frm95.desktopicons.BackgroundImage = new Bitmap(Properties.Resources.Win95PlusMoreWin, TitleScreen.frm95.Width, TitleScreen.frm95.Height);
                    break;
            }
            foreach (Form f in Application.OpenForms)
            {
                if (f is WinClassic)
                {
                    if (((WinClassic)f).isActive)
                    {
                        ((WinClassic)f).programtopbar.BackColor = SaveSystem.currentTheme.activeTitleBarColor;
                        ((WinClassic)f).Title.ForeColor = SaveSystem.currentTheme.activeTitleTextColor;
                    }
                    else
                    {
                        ((WinClassic)f).programtopbar.BackColor = SaveSystem.currentTheme.inactiveTitleBarColor;
                        ((WinClassic)f).Title.ForeColor = SaveSystem.currentTheme.inactiveTitleTextColor;
                    }
                    f.Invalidate();
                    ((WinClassic)f).programContent.Invalidate();
                    ((WinClassic)f).top.Invalidate();
                    ((WinClassic)f).toprightcorner.Invalidate();
                    ((WinClassic)f).right.Invalidate();
                    ((WinClassic)f).bottomrightcorner.Invalidate();
                    ((WinClassic)f).bottom.Invalidate();
                    ((WinClassic)f).bottomleftcorner.Invalidate();
                    ((WinClassic)f).left.Invalidate();
                    ((WinClassic)f).topleftcorner.Invalidate();
                    foreach (Control c in ((WinClassic)f).progContent.Controls) c.Invalidate();
                    ((WinClassic)f).progContent.BackColor = SaveSystem.currentTheme.threeDObjectsColor;
                }
            }
            TitleScreen.frm95.taskbar.Invalidate();
            TitleScreen.frm95.clockPanel.Invalidate();
        }
    }
}


text:
#ifndef TIMEOUT_H
#define TIMEOUT_H

#include <lua.h>

/* timeout control structure */
typedef struct t_timeout_ {
    double block;          /* maximum time for blocking calls */
    double total;          /* total number of miliseconds for operation */
    double start;          /* time of start of operation */
} t_timeout;
typedef t_timeout *p_timeout;

int timeout_open(lua_State *L);
void timeout_init(p_timeout tm, double block, double total);
double timeout_get(p_timeout tm);
double timeout_getretry(p_timeout tm);
p_timeout timeout_markstart(p_timeout tm);
double timeout_getstart(p_timeout tm);
double timeout_gettime(void);
int timeout_meth_settimeout(lua_State *L, p_timeout tm);

#define timeout_iszero(tm)   ((tm)->block == 0.0)

#endif /* TIMEOUT_H */


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
  <!-- changelog for the master branch -->
  <string name="changelog_master" translatable="false">
    <b>Next feature release:</b>\n
    · New: Coordinate calculator (New Waypoint - Calculate Coordinates)\n
    · New: Log image upload for OC\n
    · Fix: Improve parsing of home coordinates\n
    · Fix: Disabled caches might be shown with truncated title\n
    · Fix: Some OC cache URL not detected correctly\n
    · Fix: Some possible crashes on map\n
    · Fix: Search caches by users with a \'+\' in the name\n
     \n
  </string>
</resources>


text:
package ch.hearc.pokerface.gui.options;

import java.awt.Color;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.swing.Box;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JSlider;
import javax.swing.SwingConstants;
import javax.swing.Timer;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

import ch.hearc.pokerface.gameengine.gamecore.SoundEngine;
import ch.hearc.pokerface.gameengine.player.profile.Profile;
import ch.hearc.pokerface.gui.JFrameMain;
import ch.hearc.pokerface.gui.tools.ButtonTools;
import ch.hearc.pokerface.gui.tools.ColorShop;
import ch.hearc.pokerface.gui.tools.ImageShop;

public class JPanelTopBar extends JPanel
{

	/*------------------------------------------------------------------*\
	|*							Attributs Private						*|
	\*------------------------------------------------------------------*/

	private static volatile JPanelTopBar	instance	= null;

	// Inputs / Outputs
	private JLabel							avatar;
	private JLabel							name;
	private JLabel							bankroll;
	private JLabel							coin;
	private JLabel							clockLabel;
	private JLabel							help;
	private JLabel							quitApplication;
	private JLabel							quitGame;
	private JLabel							volumeIcon;
	private JSlider							volumeSlider;

	private SimpleDateFormat				ft;

	private JFrameMain						frameMain;

	/*------------------------------*\
	|*			  Static			*|
	\*------------------------------*/

	private static final String				RULES		= "
The Cards
"
																+ "
At the beginning, each player receives 2 cards, face down. In the deck, there are a total of 52 cards.
"
																+ "During the game, other cards will appear in the middle at the beginning of each phase. Firstly, 3, then 1 and finally 1 other. These cards are shared with the other players
"
																+ "The purpose is to have the best hand ranking. To help you, there is a handranking cheat-sheet in bottom left.
"
																+ "
Game process
"
																+ "
In texas hold'em poker , there are 4 main phases. In order, these states are :"
																+ "
"
																+ "
Pre flop : You receive your 2 cards
"
																+ "
Flop : 3 cards appear over the board
"
																+ "
Turn : 1 card appears over the board
"
																+ "
River : 1 last card appears over the board
"
																+ "
"
																+ "Between each step, there is a betting state. It will be described in detail afterwards.
"
																+ "After the last betting state, all the players still in game have to show their cards. If a player has a worse handranking than another one, he has the possibility to not show his cards.
"
																+ "At the end, the best player takes all the money. If there is more than one winner (a tie), the pot is divided up.
"
																+ "
Bet
"
																+ "During a game, each player has a role : "
																+ "
"
																+ "
Small Blind (only when there are more than 2 players)
"
																+ "
Big Blind
"
																+ "
Dealer
"
																+ "
Nothing
"
																+ "
"
																+ "During the first betting state, after the preflop state, the small blind must bet an set amount. The big blind has to bet double of said set amount.
"
																+ "The dealer deals the card, then the small blind bets and finally the big blind. Afterwards, the next player can play and make a decision.
 After all players have played, the small blind has to play and the big blind has to finish the turn if nobody else has raised.
"
																+ "After the preflop, there are no more roles.
" + "The different possible actions are :" + "
" + "
Fold : leaving the current game
"
																+ "
Check : if no previous player has bet during the current turn, checking lets you continue playing without betting
"
																+ "
Bet  : set a current bet that other players have to call in order to stay in the game
" + "
Call : paying the current bet in order to continue playing
"
																+ "
Raise : raising the bet to a bigger amount.
" + "
";

	/*------------------------------------------------------------------*\
	|*							Constructeurs							*|
	\*------------------------------------------------------------------*/

	/**
	 * Is displayed on top when a profile has been selected.
	 * @contains
	 * 		The time
	 * 		Volume control
	 * 		Avatar
	 * 		Current capital
	 * 		Help button
	 * 		Pokerface logo
	 * @return The only instance of the class
	 */
	public final static JPanelTopBar getInstance()
	{
		if (JPanelTopBar.instance == null)
		{
			synchronized (JPanelTopBar.class)
			{
				if (JPanelTopBar.instance == null)
				{
					JPanelTopBar.instance = new JPanelTopBar();
				}
			}
		}
		return JPanelTopBar.instance;
	}

	private JPanelTopBar()
	{
		geometry();
		control();
		apparence();

		Timer t = new Timer(1000, updateClockAction);
		t.start();
	}

	/*------------------------------------------------------------------*\
	|*							Methodes Public							*|
	\*------------------------------------------------------------------*/

	public void refreshProfile(Profile profile)
	{
		name.setText(profile.getName());
		avatar.setIcon(profile.getAvatar().getIcon());
		bankroll.setText(profile.getCapital() + " $");
	}

	public void setFrameMain(JFrameMain frameMain)
	{
		this.frameMain = frameMain;
	}

	public void setCapital(String capital)
	{
		bankroll.setText(capital + " $");
	}

	/*------------------------------------------------------------------*\
	|*							Methodes Private						*|
	\*------------------------------------------------------------------*/

	private void geometry()
	{
		name = new JLabel();
		avatar = new JLabel();
		coin = new JLabel("", ImageShop.ICON_COIN, 0);
		bankroll = new JLabel();
		clockLabel = new JLabel();
		clockLabel.setFont(new Font("Arial", Font.BOLD, 18));
		help = new JLabel("", ImageShop.ICON_BUTTON_HELP, 0);
		quitApplication = new JLabel("", ImageShop.ICON_BUTTON_QUIT_APPLICATION, 0);
		quitGame = new JLabel("", ImageShop.ICON_BUTTON_QUIT_GAME, 0);
		volumeIcon = new JLabel("\u266B");
		volumeIcon.setFont(new Font("Arial", Font.BOLD, 18));

		volumeSlider = new JSlider(SwingConstants.HORIZONTAL, 0, 100, 80);
		SoundEngine.getInstance().setVolume(80);
		volumeSlider.setPaintLabels(false);

		ft = new SimpleDateFormat("HH:mm:ss");

		Box profil = Box.createHorizontalBox();
		profil.add(avatar);
		profil.add(Box.createHorizontalStrut(20));
		profil.add(name);
		profil.add(Box.createHorizontalStrut(20));
		profil.add(coin);
		profil.add(Box.createHorizontalStrut(5));
		profil.add(bankroll);
		profil.add(Box.createHorizontalStrut(20));
		profil.add(help);

		Box info = Box.createHorizontalBox();
		info.add(volumeIcon);
		info.add(volumeSlider);
		info.add(Box.createHorizontalStrut(20));
		info.add(clockLabel);
		info.add(Box.createHorizontalStrut(20));
		info.add(quitGame);
		info.add(Box.createHorizontalStrut(20));
		info.add(quitApplication);
		info.add(Box.createHorizontalStrut(10));

		setLayout(new GridLayout(1, 3));

		add(profil);
		add(new JLabel(ImageShop.ICON_LOGO_TOPBAR));
		add(info);
	}

	private void apparence()
	{
		setBackground(ColorShop.PF_BACKGROUND);
		name.setForeground(ColorShop.PF_RED);
		bankroll.setForeground(ColorShop.PF_GOLD_COLOR);
		clockLabel.setForeground(Color.WHITE);
		volumeIcon.setForeground(Color.WHITE);
		try
		{
			name.setFont(ButtonTools.getButtonFont(false).deriveFont(26f));
			bankroll.setFont(ButtonTools.getButtonFont(false).deriveFont(26f));
			name.setFont(ButtonTools.getButtonFont(false).deriveFont(26f));
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}

	private void control()
	{
		help.addMouseListener(new MouseAdapter()
		{
			@Override
			public void mouseClicked(MouseEvent e)
			{
				showHelp();
			}
		});

		quitApplication.addMouseListener(new MouseAdapter()
		{
			@Override
			public void mouseClicked(MouseEvent e)
			{
				JPanelTopBar.this.frameMain.closeApp();
			}
		});

		quitGame.addMouseListener(new MouseAdapter()
		{
			@Override
			public void mouseClicked(MouseEvent e)
			{
				if (frameMain != null)
				{
					if (JOptionPane.showConfirmDialog(null, "Confirm going back to main menu?") != 0) { return; }
					frameMain.gameToMainMenu();
				}
			}
		});

		volumeSlider.addChangeListener(new ChangeListener()
		{
			@Override
			public void stateChanged(ChangeEvent arg0)
			{
				SoundEngine.getInstance().setVolume((volumeSlider.getValue()));
			}
		});
	}

	private void showHelp()
	{
		JOptionPane.showMessageDialog(this, RULES, "Poker Rules, Texas Hold'Em No Limit", JOptionPane.INFORMATION_MESSAGE, ImageShop.ICON_BUTTON_HELP);
	}

	private ActionListener	updateClockAction	= new ActionListener()
												{
													@Override
													public void actionPerformed(ActionEvent e)
													{
														clockLabel.setText(ft.format(new Date()));
													}
												};
}


text:
package com.test.controller;

import com.test.entity.User;
import com.test.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by rodbate on 2015/10/23.
 */

@RestController
public class UserController {

    @Autowired
    private UserRepository userRepository;

    @RequestMapping(value = "/user",method = RequestMethod.POST)
    public User register(@RequestBody User user){
        /*User u = new User();
        u.setId(-1);
        u.setUsername(user.getUsername());
        u.setPassword(user.getPassword());*/
        return userRepository.save(user);
    }
}


text:
class Workspace < ApplicationRecord
  has_many :views, dependent: :destroy

  def to_s
    name
  end
end


text:
package native

import (
	"errors"
	"sync"

	"github.com/go-delve/delve/pkg/dwarf/op"
	"github.com/go-delve/delve/pkg/proc"
	"github.com/go-delve/delve/pkg/proc/amd64util"
	"github.com/go-delve/delve/pkg/proc/internal/ebpf"
)

var ErrNativeBackendDisabled = errors.New("native backend disabled during compilation")

// Launch returns ErrNativeBackendDisabled.
func Launch(_ []string, _ string, _ proc.LaunchFlags, _ []string, _ string, _ [3]string) (*proc.Target, error) {
	return nil, ErrNativeBackendDisabled
}

// Attach returns ErrNativeBackendDisabled.
func Attach(_ int, _ []string) (*proc.Target, error) {
	return nil, ErrNativeBackendDisabled
}

// waitStatus is a synonym for the platform-specific WaitStatus
type waitStatus struct{}

// osSpecificDetails holds information specific to the OSX/Darwin
// operating system / kernel.
type osSpecificDetails struct{}

// osProcessDetails holds Darwin specific information.
type osProcessDetails struct{}

func (os *osProcessDetails) Close() {}

func killProcess(pid int) error {
	panic(ErrNativeBackendDisabled)
}

func registers(thread *nativeThread) (proc.Registers, error) {
	panic(ErrNativeBackendDisabled)
}

func (dbp *nativeProcess) loadProcessInformation(wg *sync.WaitGroup) {
	panic(ErrNativeBackendDisabled)
}

func (dbp *nativeProcess) requestManualStop() (err error) {
	panic(ErrNativeBackendDisabled)
}

func (dbp *nativeProcess) resume() error {
	panic(ErrNativeBackendDisabled)
}

func (dbp *nativeProcess) trapWait(pid int) (*nativeThread, error) {
	panic(ErrNativeBackendDisabled)
}

func (dbp *nativeProcess) stop(cctx *proc.ContinueOnceContext, trapthread *nativeThread) (*nativeThread, error) {
	panic(ErrNativeBackendDisabled)
}

func (dbp *nativeProcess) updateThreadList() error {
	panic(ErrNativeBackendDisabled)
}

func (dbp *nativeProcess) kill() (err error) {
	panic(ErrNativeBackendDisabled)
}

func (dbp *nativeProcess) detach(kill bool) error {
	panic(ErrNativeBackendDisabled)
}

// EntryPoint returns the entry point for the process,
// useful for PIEs.
func (dbp *nativeProcess) EntryPoint() (uint64, error) {
	panic(ErrNativeBackendDisabled)
}

func (dbp *nativeProcess) SupportsBPF() bool {
	panic(ErrNativeBackendDisabled)
}

func (dbp *nativeProcess) SetUProbe(fnName string, goidOffset int64, args []ebpf.UProbeArgMap) error {
	panic(ErrNativeBackendDisabled)
}

func (dbp *nativeProcess) GetBufferedTracepoints() []ebpf.RawUProbeParams {
	panic(ErrNativeBackendDisabled)
}

// SetPC sets the value of the PC register.
func (t *nativeThread) setPC(pc uint64) error {
	panic(ErrNativeBackendDisabled)
}

// SetReg changes the value of the specified register.
func (thread *nativeThread) SetReg(regNum uint64, reg *op.DwarfRegister) error {
	panic(ErrNativeBackendDisabled)
}

// ReadMemory reads len(buf) bytes at addr into buf.
func (t *nativeThread) ReadMemory(buf []byte, addr uint64) (int, error) {
	panic(ErrNativeBackendDisabled)
}

// WriteMemory writes the contents of data at addr.
func (t *nativeThread) WriteMemory(addr uint64, data []byte) (int, error) {
	panic(ErrNativeBackendDisabled)
}

func (t *nativeThread) resume() error {
	panic(ErrNativeBackendDisabled)
}

func (t *nativeThread) singleStep() error {
	panic(ErrNativeBackendDisabled)
}

func (t *nativeThread) restoreRegisters(sr proc.Registers) error {
	panic(ErrNativeBackendDisabled)
}

func (t *nativeThread) withDebugRegisters(f func(*amd64util.DebugRegisters) error) error {
	return proc.ErrHWBreakUnsupported
}

// Stopped returns whether the thread is stopped at
// the operating system level.
func (t *nativeThread) Stopped() bool {
	panic(ErrNativeBackendDisabled)
}

// SoftExc returns true if this thread received a software exception during the last resume.
func (t *nativeThread) SoftExc() bool {
	panic(ErrNativeBackendDisabled)
}

func initialize(dbp *nativeProcess) error { return nil }


text:
package org.apache.apex.api;

import org.apache.hadoop.classification.InterfaceStability;

/**
 * Any user generated control tuple must implement {@link UserDefinedControlTuple} interface
 */
@InterfaceStability.Evolving
public interface UserDefinedControlTuple
{
  /**
   * A user generated control tuple must specify a @{@link DeliveryType}
   * @return @{@link DeliveryType} type
   */
  DeliveryType getDeliveryType();

  /**
   * All custom control tuples can be delivered according to the following semantics
   * 1. IMMEDIATE - The control tuple will be delivered immediately to the next operator
   * 2. END_WINDOW - The control tuple will be delivered to the next operator just before the
   * com.datatorrent.api.Operator#endWindow() call.
   */
  enum DeliveryType
  {
    IMMEDIATE,
    END_WINDOW
  }
}


text:
/*global QUnit*/

sap.ui.define([
	"sap/ui/test/opaQunit",
	"./pages/Worklist",
	"./pages/Browser",
	"./pages/NotFound",
	"./pages/App"
], function (opaTest) {
	"use strict";

	QUnit.module("NotFound");

	opaTest("Should see the resource not found page when changing to an invalid hash", function (Given, When, Then) {
		//Arrangement
		Given.iStartMyApp();

		//Actions
		When.onTheBrowser.iChangeTheHashToSomethingInvalid();

		// Assertions
		Then.onTheNotFoundPage.iShouldSeeResourceNotFound();
	});

	opaTest("Clicking the 'Show my worklist' link on the 'Resource not found' page should bring me back to the worklist", function (Given, When, Then) {
		//Actions
		When.onTheNotFoundPage.iPressTheNotFoundShowWorklistLink();

		// Assertions
		Then.onTheWorklistPage.iShouldSeeTheTable();
	});

	opaTest("Should see the not found text for no search results", function (Given, When, Then) {
		//Actions
		When.onTheWorklistPage.iSearchForSomethingWithNoResults();

		// Assertions
		Then.onTheWorklistPage.iShouldSeeTheNoDataTextForNoSearchResults();
	});

	opaTest("Clicking the back button should take me back to the not found page", function (Given, When, Then) {
		//Actions
		When.onTheBrowser.iPressOnTheBackwardsButton();

		// Assertions
		Then.onTheNotFoundPage.iShouldSeeResourceNotFound();

		// Cleanup
		Then.iTeardownMyApp();
	});

	opaTest("Should see the 'Object not found' page if an invalid object id has been called", function (Given, When, Then) {
		//Arrangement
		Given.iStartMyApp({hash : "Objects/SomeInvalidObjectId"});

		// Assertions
		Then.onTheNotFoundPage.iShouldSeeObjectNotFound();
	});

	opaTest("Clicking the 'Show my worklist' link on the 'Object not found' page should bring me back to the worklist", function (Given, When, Then) {
		//Actions
		When.onTheNotFoundPage.iPressTheObjectNotFoundShowWorklistLink();

		// Assertions
		Then.onTheWorklistPage.iShouldSeeTheTable();

		// Cleanup
		Then.iTeardownMyApp();
	});

});


text:
<?php
namespace SerginhoLD\BooleanProperty;

defined('B_PROLOG_INCLUDED') and (B_PROLOG_INCLUDED === true) or die();

use Bitrix\Main\Application;
use Bitrix\Main\Localization\Loc;
use Bitrix\Main\Error;

Loc::loadMessages(__FILE__);

/**
 * Класс свойства "Да/Нет" для инфоблоков
 * Значение свойства является числом, возможные значения: null, 0 или 1
 *
 * Class BooleanProperty
 * @package SerginhoLD\BooleanProperty
 *
 * @link https://dev.1c-bitrix.ru/api_help/iblock/classes/user_properties/index.php
 */
class BooleanProperty
{
    /**
     * Параметры свойства
     *
     * @return array
     */
    public static function GetIBlockPropertyDescription()
    {
        return [
            'PROPERTY_TYPE'             => 'N',
            'USER_TYPE'                 => 'boolean',
            'DESCRIPTION'               => Loc::getMessage('SERGINHOLD_BOOLEAN_PROPERTY_DESCRIPTION'),
            'ConvertToDB'               => [__CLASS__, 'valueToInt'],
            'ConvertFromDB'             => [__CLASS__, 'valueToInt'],
            'GetPropertyFieldHtml'      => [__CLASS__, 'GetPropertyFieldHtml'],
            'GetPropertyFieldHtmlMulty' => [__CLASS__, 'GetPropertyFieldHtmlMulty'],
            'GetAdminListViewHTML'      => [__CLASS__, 'GetAdminListViewHTML'],
            'GetAdminFilterHTML'        => [__CLASS__, 'GetAdminFilterHTML'],
            'GetPublicViewHTML'         => [__CLASS__, 'GetPublicViewHTML'],
            'GetPublicEditHTML'         => [__CLASS__, 'GetPublicEditHTML'],
            //'GetPublicFilterHTML'       => [__CLASS__, 'GetPublicFilterHTML'],
            'PrepareSettings'           => [__CLASS__, 'PrepareSettings'],
            'GetSettingsHTML'           => [__CLASS__, 'GetSettingsHTML'],
        ];
    }

    /**
     * Создание элемента для редактирования свойства
     *
     * @param $name
     *
     * @return object
     */
    public static function createControl($name)
    {
        $control = __NAMESPACE__ . '\\Control\\' . ucfirst(strtolower($name)) . 'Control';

        if (empty($name) || !class_exists($control))
        {
            return new Control\CheckboxControl();
        }

        return new $control;
    }

    /**
     * @param $arProperty
     * @param $value
     *
     * @return array
     */
    public static function valueToInt($arProperty, $value)
    {
        if (is_numeric($value['VALUE']))
        {
            $value['VALUE'] = (int)$value['VALUE'];

            if ($value['VALUE'] > 1) $value['VALUE'] = 1;
            if ($value['VALUE'] < 0) $value['VALUE'] = 0;
        }
        else
        {
            $value['VALUE'] = null;
        }

        return $value;
    }

    /**
     * html значения свойства
     *
     * @param $value
     *
     * @return string
     */
    protected static function renderValue($value = null)
    {
        $message = 'SERGINHOLD_BOOLEAN_PROPERTY_ANY';

        if (is_numeric($value))
        {
            $message = $value ? 'SERGINHOLD_BOOLEAN_PROPERTY_YES' : 'SERGINHOLD_BOOLEAN_PROPERTY_NO';
        }

        return htmlentities(Loc::getMessage($message), ENT_QUOTES);
    }

    /**
     * html значения свойства в списке в административной части сайта
     *
     * @param $arUserField
     * @param $arHtmlControl
     *
     * @return string
     */
    public static function GetAdminListViewHTML($arUserField, $arHtmlControl)
    {
        return self::renderValue($arHtmlControl['VALUE']);
    }

    /**
     * html значения свойства в публичной части сайта
     *
     * @param $arProperty
     * @param $value
     * @param $strHTMLControlName
     *
     * @return string
     */
    public static function GetPublicViewHTML($arProperty, $value, $strHTMLControlName)
    {
        return self::renderValue($value['VALUE']);
    }

    /**
     * html для редактирования свойства
     *
     * @param array $arName
     * @param array $arValue
     * @param mixed $arProperty
     *
     * @return string
     */
    protected static function renderControl(array $arName, array $arValue, $arProperty = null)
    {
        $display = isset($arProperty['USER_TYPE_SETTINGS']['DISPLAY'])
            ? $arProperty['USER_TYPE_SETTINGS']['DISPLAY'] : null;

        $withDescription = (isset($arProperty['WITH_DESCRIPTION']) && $arProperty['WITH_DESCRIPTION'] === 'Y')
            ? true : false;

        return self::createControl($display)->render($arName, $arValue, $withDescription);
    }

    /**
     * html для редактирования свойства в административной части сайта
     *
     * @param $arProperty
     * @param $value
     * @param $strHTMLControlName
     *
     * @return string
     */
    public static function GetPropertyFieldHtml($arProperty, $value, $strHTMLControlName)
    {
        if (empty($strHTMLControlName['DESCRIPTION']))
        {
            $arProperty['WITH_DESCRIPTION'] = 'N';
        }

        return self::renderControl($strHTMLControlName, $value, $arProperty);
    }

    /**
     * html для редактирования множественного свойства в административной части сайта
     *
     * @param $arProperty
     * @param $arValues
     * @param $strHTMLControlName
     *
     * @return string
     */
    public static function GetPropertyFieldHtmlMulty($arProperty, $arValues, $strHTMLControlName)
    {
        $errorMessage = Loc::getMessage('SERGINHOLD_BOOLEAN_PROPERTY_ERROR_MULTY', [
            '#TYPE#' => $arProperty['USER_TYPE']
        ]);

        return (new \CAdminMessage(new Error($errorMessage)))->show();
    }

    /**
     * html фильтра в административной части сайта
     *
     * @param $arProperty
     * @param $strHTMLControlName
     *
     * @return string
     */
    public static function GetAdminFilterHTML($arProperty, $strHTMLControlName)
    {
        $arProperty['USER_TYPE_SETTINGS']['DISPLAY'] = 'Select';

        $request = Application::getInstance()->getContext()->getRequest();

        $value['VALUE'] = $request->getQuery($strHTMLControlName['VALUE']);

        return self::GetPropertyFieldHtml($arProperty, $value, $strHTMLControlName);
    }

    /**
     * html для редактирования свойства в публичной части сайта
     *
     * @param $arProperty
     * @param $value
     * @param $strHTMLControlName
     *
     * @return string
     */
    public static function GetPublicEditHTML($arProperty, $value, $strHTMLControlName)
    {
        $arProperty['WITH_DESCRIPTION'] = 'N';

        return self::renderControl($strHTMLControlName, $value, $arProperty);
    }

    /**
     * html фильтра в публичной части сайта
     *
     * @param $arProperty
     * @param $strHTMLControlName
     *
     * @return string
     */
    public static function GetPublicFilterHTML($arProperty, $strHTMLControlName)
    {
        // TODO: не работает для стандартных компонентов/фильтров (жестко захуярены исходники), не нашел где еще можно использовать
        return null;
    }

    /**
     * @param $arProperty
     *
     * @return string
     */
    public static function PrepareSettings($arProperty)
    {
        $result = [
            'DISPLAY' => null,
        ];

        if (isset($arProperty['USER_TYPE_SETTINGS']['DISPLAY']))
        {
            $result['DISPLAY'] = $arProperty['USER_TYPE_SETTINGS']['DISPLAY'];
        }

        return $result;
    }

    /**
     * html настроек параметров свойства
     *
     * @param $arProperty
     * @param $strHTMLControlName
     * @param $arPropertyFields
     *
     * @return string
     */
    public static function GetSettingsHTML($arProperty, $strHTMLControlName, &$arPropertyFields)
    {
        $arPropertyFields = [
            'HIDE' => [
                'ROW_COUNT',
                'COL_COUNT',
                'MULTIPLE',
                'MULTIPLE_CNT'
            ],
        ];

        $settings = $arProperty['USER_TYPE_SETTINGS'];
        $display = isset($settings['DISPLAY']) ? $settings['DISPLAY'] : null;

        $classFiles = glob(__DIR__ . '/Control/*Control.php');

        $listHtml = null;

        foreach ($classFiles as $file)
        {
            $controlName = preg_replace('/.*\/(\w+)?Control\.php/', "$1", $file);

            if (empty($controlName)) continue;

            $checked = ($display === $controlName) ? 'checked' : null;
            $name = Loc::getMessage('SERGINHOLD_BOOLEAN_PROPERTY_DISPLAY_' . strtoupper($controlName));

            $listHtml .= '

                    <input type="radio" name="' . $strHTMLControlName['NAME'] . '[DISPLAY]" value="' . $controlName . '" '. $checked .'>'
                    . htmlentities($name, ENT_QUOTES) .
                '

';
        }

        return '

            ' . htmlentities(Loc::getMessage('SERGINHOLD_BOOLEAN_PROPERTY_DISPLAY'), ENT_QUOTES) . ':
            ' . $listHtml . '

';
    }
}


text:
define([],function(){
	"use strict";
	//----------------------------------------------------------------
	// [IE | Safari] normalize Event constructors
	//----------------------------------------------------------------
	var CheckEventArgs=function(f,r,a){
		if(!(r instanceof f)){
			throw new TypeError("Failed to construct '"+f.name+"': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");
		}
		if(a.length===0){
			throw new TypeError("Failed to construct '"+f.name+"': An event name must be provided.");
		}
	};
	var shim={
		/**
		 * @namespace jsm.shims
		 * @class Event
		 * @extension Event
		 * @constructor
		 * @param {String} type
		 * @param {Object} [init={bubbles:false,cancelable:false}]
		 */
		Event:function Event(type/*,eventInit*/){
			CheckEventArgs(Event,this,arguments);
			var event=document.createEvent("Event"),
				p=ExtendObject({bubbles:false,cancelable:false},arguments[1],DONT_EXTEND);
			event.initEvent(type,p.bubbles,p.cancelable);
			return event;
		},
		/**
		 * @namespace jsm.shims
		 * @class CustomEvent
		 * @extends jsm.shims.Event
		 * @extension CustomEvent
		 * @constructor
		 * @param {String} type
		 * @param {Object} [init={bubbles:false,cancelable:false,detail:null}]
		 */
		CustomEvent:function CustomEvent(type/*,eventInit*/){
			CheckEventArgs(CustomEvent,this,arguments);
			var event=document.createEvent("CustomEvent"),
				p=ExtendObject({bubbles:false,cancelable:false,detail:null},arguments[1],DONT_EXTEND);
			event.initCustomEvent(type,p.bubbles,p.cancelable,p.detail);
			return event;
		},
		/**
		 * @namespace jsm.shims
		 * @class MessageEvent
		 * @extends jsm.shims.Event
		 * @extension MessageEvent
		 * @constructor
		 * @param {String} type
		 * @param {Object} [init={bubbles:false,cancelable:false,data:null,source:null,origin:""}]
		 */
		MessageEvent:function MessageEvent(type/*,eventInit*/){
			CheckEventArgs(MessageEvent,this,arguments);
			var event=document.createEvent("MessageEvent"),
				p=ExtendObject({bubbles:false,cancelable:false,data:null,origin:"",lastEventId:"",source:null},arguments[1],DONT_EXTEND);
			event.initMessageEvent(type,p.bubbles,p.cancelable,p.data,p.origin,p.lastEventId,p.source);
			return event;
		}
	};
	if(typeof Event==="object"){
		Object.getOwnPropertyNames(shim).forEach(function(name){
		if(!window[name]){return;}
			var Fix=shim[name];
			Fix.prototype=window[name].prototype;
			Fix.prototype.constructor=Fix;
			window[name]=Fix;
		});
	}
	return Event;
});


text:
@implementation TradeModel

+(NSDictionary *)mj_replacedKeyFromPropertyName{
    return @{@"tradeId":@"id"};
}

@end


text:
Sequel.migration do
  change do
    alter_table(:messages) do
      add_column :type, String
    end
  end
end


text:
layout: page
title: "Floating point numbers"
tags: [random]
---

Modern computers use binary, not decimal, number representations for numbers
with a decimal part. The significant digits and exponents are represented in
binary rather than decimal and raise 2 rather than 10 to the exponent.

# Standardization

Nearly all modern programming languages use the same binary representation for
floating point numbers, which was set by the IEEE 754 standard. The most popular
floating point number sizes are usually referred to as single precision and
double precision floating points, these numbers use either 32 bits or 64 bits to
represent their values.

# Limitations

Single precision floating point numbers (32 bits) according to the IEEE 754
standard, can represent values from 1.2e-38 to 3.4e+38. Double precision
floating point numbers of the same standard may represent values from 5.0e-324
to 1.8e+308.

# Example of an exact representation

Some numbers may be represented exactly. For instance, the number 0.625 (5/8)
would be represented as the pair (101, -11); because 5 is 101 in binary and -11
is the binary representation of -3, the pair (101, -11) stands for 5 ·
2<sup>-3</sup> = 5 / 8 = 0.625.

# Example of an approximation

What about the decimal fraction 1/10, which we write as 0.1? The best we can do
with four significant binary digits is (0011, -101). This is equivalent to 3/32,
i.e., 0.09375. If we had five significant binary digits, we would represent 0.1
as (11001, -1000), which is equivalent to 25/256, i.e., 0.09765625. How many
significant digits would we need to get an exact floating-point representation
of 0.1? An infinite number of digits. There do not exist integers `sig` and
`exp` such that `sig * 2 ^ -exp` equals 0.1. Therefore, no matter how many bits
the language chooses to use to represent floating point numbers, it will be able
to represent only an approximation of 0.1. In many implementations, there are 53
bits of precision available for floating point numbers, so the significant
digits stored for the decimal number 0.1 will be

    11001100110011001100110011001100110011001100110011001

This allows for the approximation of the decimal number

    0.1000000000000000055511151231257827021181583404541015625

Which is close to 1/10, but not 1/10.


text:
package org.smartdata.conf;

/**
 * This class contains the configure keys needed by SSM.
 */
public class SmartConfKeys {
  public static final String SMART_DFS_ENABLED = "smart.dfs.enabled";
  public static final boolean SMART_DFS_ENABLED_DEFAULT = true;

  public static final String SMART_CONF_DIR_KEY = "smart.conf.dir";
  public static final String SMART_HADOOP_CONF_DIR_KEY = "smart.hadoop.conf.path";
  public static final String SMART_CONF_DIR_DEFAULT = "conf";
  public static final String SMART_LOG_DIR_KEY = "smart.log.dir";
  public static final String SMART_LOG_DIR_DEFAULT = "logs";

  public static final String SMART_SERVICE_MODE_KEY = "smart.service.mode";
  public static final String SMART_SERVICE_MODE_DEFAULT = "HDFS";
  public static final String SMART_NAMESPACE_FETCHER_BATCH_KEY = "smart.namespace.fetcher.batch";
  public static final int SMART_NAMESPACE_FETCHER_BATCH_DEFAULT = 500;

  public static final String SMART_DFS_NAMENODE_RPCSERVER_KEY = "smart.dfs.namenode.rpcserver";

  // Configure keys for HDFS
  public static final String SMART_NAMESPACE_FETCHER_IGNORE_UNSUCCESSIVE_INOTIFY_EVENT_KEY =
      "smart.namespace.fetcher.ignore.unsuccessive.inotify.event";
  public static final boolean SMART_NAMESPACE_FETCHER_IGNORE_UNSUCCESSIVE_INOTIFY_EVENT_DEFAULT =
      false;
  public static final String SMART_NAMESPACE_FETCHER_PRODUCERS_NUM_KEY =
      "smart.namespace.fetcher.producers.num";
  public static final int SMART_NAMESPACE_FETCHER_PRODUCERS_NUM_DEFAULT = 3;
  public static final String SMART_NAMESPACE_FETCHER_CONSUMERS_NUM_KEY =
      "smart.namespace.fetcher.consumers.num";
  public static final int SMART_NAMESPACE_FETCHER_CONSUMERS_NUM_DEFAULT = 3;

  // Configure keys for Alluxio
  public static final String SMART_ALLUXIO_MASTER_HOSTNAME_KEY = "smart.alluxio.master.hostname";
  public static final String SMART_ALLUXIO_CONF_DIR_KEY = "smart.alluxio.conf.dir";
  public static final String SMART_ALLUXIO_MASTER_JOURNAL_DIR_KEY =
      "smart.alluxio.master.journal.dir";

  // SSM
  public static final String SMART_SERVER_RPC_ADDRESS_KEY = "smart.server.rpc.address";
  public static final String SMART_SERVER_RPC_ADDRESS_DEFAULT = "0.0.0.0:7042";
  public static final String SMART_SERVER_RPC_HANDLER_COUNT_KEY = "smart.server.rpc.handler.count";
  public static final int SMART_SERVER_RPC_HANDLER_COUNT_DEFAULT = 80;
  public static final String SMART_SERVER_HTTP_ADDRESS_KEY = "smart.server.http.address";
  public static final String SMART_SERVER_HTTP_ADDRESS_DEFAULT = "0.0.0.0:7045";
  public static final String SMART_SERVER_HTTPS_ADDRESS_KEY = "smart.server.https.address";
  public static final String SMART_SECURITY_ENABLE = "smart.security.enable";
  public static final String SMART_SERVER_KEYTAB_FILE_KEY = "smart.server.keytab.file";
  public static final String SMART_SERVER_KERBEROS_PRINCIPAL_KEY =
    "smart.server.kerberos.principal";
  public static final String SMART_AGENT_KEYTAB_FILE_KEY = "smart.server.keytab.file";
  public static final String SMART_AGENT_KERBEROS_PRINCIPAL_KEY =
    "smart.agent.kerberos.principal";
  public static final String SMART_SECURITY_CLIENT_PROTOCOL_ACL =
    "smart.security.client.protocol.acl";
  public static final String SMART_SECURITY_ADMIN_PROTOCOL_ACL =
    "smart.security.admin.protocol.acl";
  public static final String SMART_METASTORE_DB_URL_KEY = "smart.metastore.db.url";

  // StatesManager

  // RuleManager
  public static final String SMART_RULE_EXECUTORS_KEY = "smart.rule.executors";
  public static final int SMART_RULE_EXECUTORS_DEFAULT = 5;

  public static final String SMART_CMDLET_EXECUTORS_KEY = "smart.cmdlet.executors";
  public static final int SMART_CMDLET_EXECUTORS_DEFAULT = 10;
  public static final String SMART_DISPATCH_CMDLETS_EXTRA_NUM_KEY =
      "smart.dispatch.cmdlets.extra.num";
  public static final int SMART_DISPATCH_CMDLETS_EXTRA_NUM_DEFAULT = 10;

  // Keep it only for test
  public static final String SMART_ENABLE_ZEPPELIN_WEB = "smart.zeppelin.web.enable";
  public static final boolean SMART_ENABLE_ZEPPELIN_WEB_DEFAULT = true;

  // Cmdlets
  public static final String SMART_CMDLET_MAX_NUM_PENDING_KEY =
      "smart.cmdlet.max.num.pending";
  public static final int SMART_CMDLET_MAX_NUM_PENDING_DEFAULT = 20000;
  public static final String SMART_CMDLET_HIST_MAX_NUM_RECORDS_KEY =
      "smart.cmdlet.hist.max.num.records";
  public static final int SMART_CMDLET_HIST_MAX_NUM_RECORDS_DEFAULT =
      100000;
  public static final String SMART_CMDLET_HIST_MAX_RECORD_LIFETIME_KEY =
      "smart.cmdlet.hist.max.record.lifetime";
  public static final String SMART_CMDLET_HIST_MAX_RECORD_LIFETIME_DEFAULT =
      "30day";
  public static final String SMART_CMDLET_CACHE_BATCH =
      "smart.cmdlet.cache.batch";
  public static final int SMART_CMDLET_CACHE_BATCH_DEFAULT =
      600;
  public static final String SMART_CMDLET_MOVER_MAX_CONCURRENT_BLOCKS_PER_SRV_INST_KEY =
      "smart.cmdlet.mover.max.concurrent.blocks.per.srv.inst";
  public static final int SMART_CMDLET_MOVER_MAX_CONCURRENT_BLOCKS_PER_SRV_INST_DEFAULT = 0;

  // Schedulers
  public static final String SMART_COPY_SCHEDULER_BASE_SYNC_BATCH =
      "smart.copy.scheduler.base.sync.batch";
  public static final int SMART_COPY_SCHEDULER_BASE_SYNC_BATCH_DEFAULT =
      500;
  public static final String SMART_COPY_SCHEDULER_CHECK_INTERVAL =
      "smart.copy.scheduler.check.interval";
  public static final int SMART_COPY_SCHEDULER_CHECK_INTERVAL_DEFAULT =
      500;
  public static final String SMART_FILE_DIFF_MAX_NUM_RECORDS_KEY =
      "smart.file.diff.max.num.records";
  public static final int SMART_FILE_DIFF_MAX_NUM_RECORDS_DEFAULT =
      10000;

  // Dispatcher
  public static final String SMART_CMDLET_DISPATCHER_LOG_DISP_RESULT_KEY =
      "smart.cmdlet.dispatcher.log.disp.result";
  public static final boolean SMART_CMDLET_DISPATCHER_LOG_DISP_RESULT_DEFAULT = true;
  public static final String SMART_CMDLET_DISPATCHERS_KEY = "smart.cmdlet.dispatchers";
  public static final int SMART_CMDLET_DISPATCHERS_DEFAULT = 3;

  // Action
  public static final String SMART_ACTION_MOVE_THROTTLE_MB_KEY = "smart.action.move.throttle.mb";
  public static final long SMART_ACTION_MOVE_THROTTLE_MB_DEFAULT = 0L;  // 0 means unlimited
  public static final String SMART_ACTION_COPY_THROTTLE_MB_KEY = "smart.action.copy.throttle.mb";
  public static final long SMART_ACTION_COPY_THROTTLE_MB_DEFAULT = 0L;  // 0 means unlimited
  public static final String SMART_ACTION_LOCAL_EXECUTION_DISABLED_KEY =
    "smart.action.local.execution.disabled";
  public static final boolean SMART_ACTION_LOCAL_EXECUTION_DISABLED_DEFAULT = false;

  // SmartAgent
  public static final String SMART_AGENT_MASTER_PORT_KEY = "smart.agent.master.port";
  public static final int SMART_AGENT_MASTER_PORT_DEFAULT = 7051;
  public static final String SMART_AGENT_PORT_KEY = "smart.agent.port";
  public static final int SMART_AGENT_PORT_DEFAULT = 7048;

  /** Do NOT configure the following two options manually. They are set by the boot scripts. **/
  public static final String SMART_AGENT_MASTER_ADDRESS_KEY = "smart.agent.master.address";
  public static final String SMART_AGENT_ADDRESS_KEY = "smart.agent.address";

  // Small File Compact
  public static final String SMART_COMPACT_BATCH_SIZE_KEY =
      "smart.compact.batch.size";
  public static final int SMART_COMPACT_BATCH_SIZE_DEFAULT =
      200;
  public static final String SMART_COMPACT_CONTAINER_FILE_THRESHOLD_MB_KEY =
      "smart.compact.container.file.threshold.mb";
  public static final long SMART_COMPACT_CONTAINER_FILE_THRESHOLD_MB_DEFAULT =
      1024;

  // SmartClient

  // Common
  /**
   * Namespace, access info and other info related to files under these dirs will be ignored.
   * Clients will not report access event of these files to SSM.
   * Directories are separated with ','.
   */
  public static final String SMART_IGNORE_DIRS_KEY = "smart.ignore.dirs";

  // Target cluster
  public static final String SMART_STORAGE_INFO_UPDATE_INTERVAL_KEY =
      "smart.storage.info.update.interval";
  public static final int SMART_STORAGE_INFO_UPDATE_INTERVAL_DEFAULT = 60;
  public static final String SMART_STORAGE_INFO_SAMPLING_INTERVALS_KEY =
      "smart.storage.info.sampling.intervals";
  public static final String SMART_STORAGE_INFO_SAMPLING_INTERVALS_DEFAULT =
      "60s,60;1hour,60;1day";
  public static final String SMART_TOP_HOT_FILES_NUM_KEY = "smart.top.hot.files.num";
  public static final int SMART_TOP_HOT_FILES_NUM_DEFAULT = 200;

  //Status report
  public static final String SMART_STATUS_REPORT_PERIOD_KEY = "smart.status.report.period";
  public static final int SMART_STATUS_REPORT_PERIOD_DEFAULT = 10;
  public static final String SMART_STATUS_REPORT_PERIOD_MULTIPLIER_KEY =
      "smart.status.report.period.multiplier";
  public static final int SMART_STATUS_REPORT_PERIOD_MULTIPLIER_DEFAULT = 50;
  public static final String SMART_STATUS_REPORT_RATIO_KEY = "smart.status.report.ratio";
  public static final double SMART_STATUS_REPORT_RATIO_DEFAULT = 0.2;

  //Tidb
  public static final String SMART_TIDB_ENABLED = "smart.tidb.enable";
  public static final boolean SMART_TIDB_ENABLED_DEFAULT = false;

  public static final String PD_CLIENT_PORT_KEY = "pd.client.port";
  public static final String PD_CLIENT_PORT_DEFAULT = "7060";
  public static final String PD_PEER_PORT_KEY = "pd.peer.port";
  public static final String PD_PEER_PORT_DEFAULT = "7061";
  public static final String TIKV_SERVICE_PORT_KEY = "tikv.service.port";
  public static final String TIKV_SERVICE_PORT_DEFAULT = "20160";
  public static final String TIDB_SERVICE_PORT_KEY = "tidb.service.port";
  public static final String TIDB_SERVICE_PORT_KEY_DEFAULT = "7070";
}


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>Code Coverage for C:\xampp\htdocs\pinjamsepeda\application/views/admin/sepeda/tambah_sepeda.php</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="css/bootstrap.min.css" rel="stylesheet">
  <link href="css/bootstrap-responsive.min.css" rel="stylesheet">
  <link href="css/style.css" rel="stylesheet">

C:\xampp\htdocs\pinjamsepeda\application /

views /

admin /

sepeda /

tambah_sepeda.php

Code Coverage

Classes and Traits

Functions and Methods

Lines

      Total

      <acronym title="Change Risk Anti-Patterns (CRAP) Index">CRAP</acronym>

0.00%

0 / 29

1
	<div class="konten">

2
	    <h1>Tambah Sepeda Baru</h1>

3
	    <!--<?php require_once('tinymce.php') ?>-->

4
	    <?php echo validation_errors(); ?>

5
	    <form name="form1" method="post" action="<?php echo base_url() ?>admin/sepeda/tambah" class="myform">

6
	        <p>

7
	            <label for="jenis_sepeda">Merk Sepeda</label>

8
	            <input name="jenis_sepeda" type="text" id="jenis_sepeda" size="70">

9
	        </p>

10
	        <p>

11
	            <label for="ringkasan">Jenis Sepeda</label>

12
	            <input name="ringkasan" type="text" id="ringkasan" size="70">

13
	        </p>

14
	        <p>

15
	            <label for="isi">Deskripsi Sepeda</label>

16
	            <textarea name="isi" id="isi" cols="45" rows="5"></textarea>

17
	        </p>

18
	        <p>

19
	            <label for="status_sepeda">Status Sepeda</label>

20
	            <select name="status_sepeda" id="status_sepeda">

21
	                <option value="Publish">Dipinjam</option>

22
	                <option value="Draft">Tersedia</option>

23
	            </select>

24
	            <!-- UNTUK KEPERLUAN PENGUJIAN, ID USER KITA SET MANUAL DULU -->

25
	            <input name="id_user" type="hidden" id="id_user" value="1">

26
	            <!-- END ID USER -->

27
	            <input type="submit" name="submit" id="submit" value="Submit">

28
	            <input type="reset" name="submit2" id="submit2" value="Reset">

29
	        </p>

30
	    </form>

31
	    <p>&nbsp;</p>

32
	</div>

Legend

     Executed
     Not Executed
     Dead Code

     Generated by PHP_CodeCoverage 1.2.11 using PHP 5.6.3 and PHPUnit 3.7.21 at Thu Oct 19 2:20:51 CEST 2017.


text:
package org.apache.jena.sparql.engine.iterator;

import java.util.Map;
import java.util.Set ;

import org.apache.jena.graph.Node ;
import org.apache.jena.sparql.core.Var ;
import org.apache.jena.sparql.engine.ExecutionContext ;
import org.apache.jena.sparql.engine.QueryIterator ;
import org.apache.jena.sparql.engine.binding.Binding ;
import org.apache.jena.sparql.engine.index.IndexFactory ;
import org.apache.jena.sparql.engine.index.IndexTable ;

/** Minus by materializing the RHS - this is not streamed on the right */
public class QueryIterMinus extends QueryIter2
{
	private IndexTable tableRight;
	private Map<Var, Integer> varColumns ;
	private Set<Node[]> rightTable;
    Binding slot = null ;

	public QueryIterMinus(QueryIterator left, QueryIterator right, Set<Var> commonVars, ExecutionContext qCxt)
    {
        super(left, right, qCxt) ;
        tableRight = IndexFactory.createIndex(commonVars, right) ;
    }

    protected Binding getNextSlot(Binding bindingLeft)
    {
        if ( tableRight.containsCompatibleWithSharedDomain(bindingLeft) )
        	return null ;

        return bindingLeft;
    }

    @Override
    protected final void closeSubIterator() { }

    @Override
    protected void requestSubCancel() { }

    @Override
    protected final boolean hasNextBinding()
    {
        if ( slot != null )
            return true ;

        while ( getLeft().hasNext() )
        {
            Binding bindingLeft = getLeft().nextBinding() ;
            slot = getNextSlot(bindingLeft) ;
            if ( slot != null )
            {
                slot = bindingLeft ;
                return true ;
            }
        }
        getLeft().close() ;
        return false ;
    }

    @Override
    protected final Binding moveToNextBinding()
    {
        if ( ! hasNextBinding() )
            return null ;
        Binding x = slot ;
        slot = null ;
        return x ;
    }
}


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <base href="/">
  <title>reproto</title>
  <link rel="icon" href="/favicon.ico", type="image/x-icon">
  <link rel="shortcut icon" href="/favicon.ico", type="image/x-icon">


text:
<?php

/**
 * y0AdminExpandPlugin configuration.
 *
 * @package     y0AdminExpandPlugin
 * @subpackage  config
 * @author      Your name here
 * @version     SVN: $Id$
 */
class y0AdminExpandPluginConfiguration extends sfPluginConfiguration
{
  const VERSION = '1.0.0-DEV';

  /**
   * @see sfPluginConfiguration
   */
  public function initialize()
  {
  }
}


text:
package se.lagrummet.rinfo.store.depot;

import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.io.*;
import java.net.URI;
import java.net.URISyntaxException;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.AbstractFileFilter;
import org.apache.commons.io.filefilter.IOFileFilter;
import org.apache.commons.io.filefilter.HiddenFileFilter;
import org.apache.commons.io.filefilter.NameFileFilter;
import org.apache.commons.lang.StringUtils;

import org.apache.abdera.Abdera;
import org.apache.abdera.model.Content;
import org.apache.abdera.model.Entry;

public class FileDepotEntry implements DepotEntry {

    public static final String ENTRY_CONTENT_DIR_NAME = "ENTRY-INFO";
    public static final String MANIFEST_FILE_NAME = "manifest.xml";
    public static final Pattern CONTENT_FILE_PATTERN = Pattern.compile(
            "content(?:-(\\w{2}))?.(\\w+)");
    public static final String DELETED_FILE_NAME = "DELETED";
    public static final String GENERIC_META_DIR_NAME = "local-meta";
    public static final String LOCKED_FILE_NAME = "LOCKED";
    public static final String MOVED_ENCLOSURES_DIR_NAME = "enclosures";
    public static final String ROLLOFF_DIR_NAME = "TEMP_ROLLOFF";

    protected static final IOFileFilter NON_ENTRY_DIR_FILTER =  new AbstractFileFilter() {
        public boolean accept(File it) {
            return !isEntryDir(it.getParentFile()) &&
                !it.isHidden() &&
                !it.getName().startsWith(".");
        }
    };

    protected static final FileFilter PUBLIC_FILE_FILTER = new FileFilter() {
        public boolean accept(File it) {
            return !it.isHidden() &&
                !it.getName().startsWith(".") &&
                !it.getName().equals(ENTRY_CONTENT_DIR_NAME);
        }
    };

    protected File entryDir;
    protected File entryContentDir;
    protected File genericMetaDir;

    private FileDepot depot;

    private Entry manifest;
    private String entryUriPath;

    public FileDepotEntry(FileDepot depot, File entryDir, String knownUriPath)
            throws DeletedDepotEntryException, LockedDepotEntryException {
        initialize(depot, entryDir, knownUriPath);
        assertIsNotDeleted();
        assertIsNotLocked();
    }

    protected FileDepotEntry() { }

    protected void initialize(FileDepot depot, File entryDir, String knownUriPath) {
        this.depot = depot;
        this.entryDir = entryDir;
        this.entryUriPath = knownUriPath;
        entryContentDir = new File(entryDir, ENTRY_CONTENT_DIR_NAME);
        genericMetaDir = new File(entryContentDir, GENERIC_META_DIR_NAME);
    }

    public static DepotEntry newUncheckedDepotEntry(
            FileDepot depot, File entryDir, String knownUriPath) {
        FileDepotEntry depotEntry = new FileDepotEntry();
        depotEntry.initialize(depot, entryDir, knownUriPath);
        return depotEntry;
    }

    public static boolean isEntryDir(File dir) {
        return new File(dir, ENTRY_CONTENT_DIR_NAME).isDirectory();
    }

    public String toString() {
        return "FileDepotEntry(entryDir="+entryDir+")";
    }

    public Depot getDepot() {
        return depot;
    }

    public String getEntryUriPath() {
        if (entryUriPath==null) {
            try {
                entryUriPath = computeEntryUriPath();
            } catch (URISyntaxException e) {
                throw new RuntimeException("Malformed entry URI.", e);
            }
        }
        return entryUriPath;
    }

    public URI getId() {
        try {
            return getEntryManifest().getId().toURI();
        } catch (URISyntaxException e) {
            throw new RuntimeException("Malformed entry URI.", e);
        }
    }

    public Date getPublished() {
        return getEntryManifest().getPublished();
    }

    public Date getUpdated() {
        return getEntryManifest().getUpdated();
    }

    public boolean isDeleted() {
        return getDeletedMarkerFile().isFile();
    }

    public boolean isLocked() {
        return getLockedMarkerFile().exists();
    }

    public String getContentMediaType() {
        return getEntryManifest().getContentMimeType().toString();
    }

    public String getContentLanguage() {
        Content contentElem = getEntryManifest().getContentElement();
        if (contentElem == null || contentElem.getLanguage() == null) {
            return null;
        }
        return contentElem.getLanguage().toString();
    }

    /**
     * The last system modification timestamp of this entry.
     */
    public long lastModified() {
        return getManifestFile().lastModified();
    }

    public void assertIsNotDeleted() throws DeletedDepotEntryException {
        if (isDeleted()) {
            throw new DeletedDepotEntryException(this);
        }
    }

    public void assertIsNotLocked() throws LockedDepotEntryException {
        if (isLocked()) {
            throw new LockedDepotEntryException(this);
        }
    }

    public static Iterator<DepotEntry> iterateEntries(
            final FileDepot depot,
            final boolean includeHistorical, final boolean includeDeleted) {

        final Iterator<File> manifestIter = FileUtils.iterateFiles(
                depot.getBaseDir(), new NameFileFilter(MANIFEST_FILE_NAME),
                HiddenFileFilter.VISIBLE);

        /* TODO:
        if (!includeHistorical) {
            dirFilter in manifestIter must be (as the first "if" below does)
                file.parentFile.name != ENTRY_CONTENT_DIR_NAME
            if we use ENTRY_CONTENT_DIR_NAME in history entries.
            And if we don't, we must change the "first if below" to ever
            fulfil includeHistorical.. See also rollOffToHistory.
        }
        */

        return new Iterator<DepotEntry>() {
            public boolean hasNext() { return manifestIter.hasNext(); }
            public DepotEntry next() {
                while (manifestIter.hasNext()) {
                    File contentDir = manifestIter.next().getParentFile();
                    if (!contentDir.getName().equals(ENTRY_CONTENT_DIR_NAME)) {
                        continue;
                    }
                    DepotEntry depotEntry = FileDepotEntry.newUncheckedDepotEntry(
                        depot, contentDir.getParentFile(), null);
                    if (!includeDeleted && depotEntry.isDeleted()) {
                        continue;
                    }
                    return depotEntry;
                }
                throw new NoSuchElementException();
            }
            public void remove() { throw new UnsupportedOperationException(); }
        };
    }

    public static Iterator<DepotEntry> iterateLockedEntries(final FileDepot depot) {
        final Iterator<File> lockedFileIter = FileUtils.iterateFiles(
                depot.getBaseDir(), new NameFileFilter(LOCKED_FILE_NAME),
                HiddenFileFilter.VISIBLE);
        return new Iterator<DepotEntry>() {
            public boolean hasNext() { return lockedFileIter.hasNext(); }
            public DepotEntry next() {
                while (lockedFileIter.hasNext()) {
                    File contentDir = lockedFileIter.next().getParentFile();
                    if (!contentDir.getName().equals(ENTRY_CONTENT_DIR_NAME)) {
                        continue;
                    }
                    DepotEntry depotEntry = FileDepotEntry.newUncheckedDepotEntry(
                        depot, contentDir.getParentFile(), null);
                    return depotEntry;
                }
                throw new NoSuchElementException();
            }
            public void remove() { throw new UnsupportedOperationException(); }
        };
    }

    public List<DepotContent> findContents() {
        return findContents(null, null);
    }

    public List<DepotContent> findContents(String forMediaType) {
        return findContents(forMediaType, null);
    }

    public List<DepotContent> findContents(String forMediaType, String forLang) {
        List<DepotContent> found = new ArrayList<DepotContent>();
        // TODO:IMPROVE: if both qualifiers given, get file with newContentFile?
        for (File file : entryContentDir.listFiles()) {
            Matcher match = CONTENT_FILE_PATTERN.matcher(file.getName());
            if (!match.matches()) {
                continue;
            }
            String mediaHint = match.group(2);
            String mediaType = depot.getPathHandler().mediaTypeForHint(mediaHint);
            if (forMediaType!=null && !mediaType.equals(forMediaType)) {
                continue;
            }
            String lang = match.group(1);
            if ("".equals(lang)) lang = null;
            if (forLang!=null && !forLang.equals(lang)) {
                continue;
            }
            // TODO:IMPROVE: we now decouple suffix and hint logic:
            //  .. although this reintroduces map->remap->back-to-map..!
            //  .. and mediaHint *is* very concise.
            //  - calling computeMediaType that forwards to mediaTypeForHint..
            //  .. could allow mediaHint to be collection-dependent in pathHandler..
            String uriPath = depot.getPathHandler().makeNegotiatedUriPath(
                    getEntryUriPath(), mediaType, lang);
            found.add(new DepotContent(file, uriPath, mediaType, lang));
        }
        return found;
    }

    public List<DepotContent> findEnclosures() {
        List<DepotContent> enclosures = new ArrayList<DepotContent>();
        for (File file : entryDir.listFiles(PUBLIC_FILE_FILTER)) {
            if (file.isFile()) {
                enclosures.add(enclosedDepotContent(file));
            } else if (file.isDirectory() && !isEntryDir(file)) {
                for (File subfile : ((Collection<File>)FileUtils.listFiles(file,
                        HiddenFileFilter.VISIBLE,
                        NON_ENTRY_DIR_FILTER))) {
                    enclosures.add(enclosedDepotContent(subfile));
                }
            }
        }
        return enclosures;
    }

    /**
     * Create a generic metadata resource for usage specific needs. Can be used
     * e.g. to store additional information about creation source.
     */
    public OutputStream getMetaOutputStream(String resourceName)
            throws DepotWriteException {
        if (!genericMetaDir.exists()) {
            if (!genericMetaDir.mkdir()) {
                throw new DepotWriteException(
                        "Cannot create entry meta directory: " + genericMetaDir);
            }
        }
        try {
            return new FileOutputStream(new File(genericMetaDir, resourceName));
        } catch (FileNotFoundException e) {
            throw new DepotWriteException(e);
        }
    }

    /**
     * Get a generic metadata stream if it has been previously created with
     * {@link getMetaOutputStream}.
     * @return An InputStream for the resource, or null if it doesn't exist.
     */
    public InputStream getMetaInputStream(String resourceName)
            throws DepotReadException {
        File metaFile = new File(genericMetaDir, resourceName);
        if (!metaFile.exists()) {
            return null;
        }
        try {
            return new FileInputStream(metaFile);
        } catch (FileNotFoundException e) {
            throw new DepotReadException(e);
        }
    }

    protected String computeEntryUriPath() throws URISyntaxException {
        URI uri = getId();
        //depot.assertWithinBaseUri(uri); // this is already stored..
        return uri.getPath();
    }

    protected Entry getEntryManifest() {
        if (manifest==null) {
            try {
                InputStream inStream = new FileInputStream(getManifestFile());
                manifest = (Entry) Abdera.getInstance().getParser().parse(
                        inStream).getRoot();
                manifest.complete();
                inStream.close();
            } catch (Exception e) {
                throw new RuntimeException("Error reading manifest file.", e);
            }
        }
        return manifest;
    }

    protected File getManifestFile() {
        return new File(entryContentDir, MANIFEST_FILE_NAME);
    }

    protected void saveManifest(Entry manifest) throws DepotWriteException {
        try {
            OutputStream outStream = new FileOutputStream(getManifestFile());
            try {
                manifest.writeTo(outStream);
            } finally {
                outStream.close();
            }
        } catch (IOException e) {
            throw new DepotWriteException(e);
        }
    }

    protected DepotContent enclosedDepotContent(File file) {
        String uriPath = toEnclosedUriPath(file);
        String mediaType = depot.getPathHandler().computeMediaType(file.getName());
        return new DepotContent(file, uriPath, mediaType);
    }

    protected String toEnclosedUriPath(File file) {
        String pathRemainder = FilePathUtil.toRelativeFilePath(file, entryDir);
        String uriPath = getEntryUriPath() + "/" + pathRemainder;
        return uriPath;
    }

    protected File getDeletedMarkerFile() {
        return new File(entryContentDir, DELETED_FILE_NAME);
    }

    protected File getLockedMarkerFile() {
        return new File(entryContentDir, LOCKED_FILE_NAME);
    }

    //== TODO: factor out the above into immutable DepotEntryView base class?

    public void create(Date createTime, List<SourceContent> sourceContents)
            throws DepotWriteException {
        create(createTime, sourceContents, null);
    }

    public void create(Date createTime, List<SourceContent> sourceContents,
            List<SourceContent> sourceEnclosures) throws DepotWriteException {
        create(createTime, sourceContents, sourceEnclosures, true);
    }

    public void create(Date createTime, List<SourceContent> sourceContents,
            List<SourceContent> sourceEnclosures, boolean releaseLock)
            throws DepotWriteException {
        try {
            if(entryContentDir.exists()) {
                // TODO:? if entry is deleted, spec. that it can be recreated.
                throw new DuplicateDepotEntryException(this);
            }
            if (!entryContentDir.mkdir()) {
                throw new DepotWriteException(
                        "Cannot create entry content directory: " + entryContentDir);
            }
            lock();

            Entry manifest = Abdera.getInstance().newEntry();
            // TODO: unify with rest of getId/entryPath stuff!
            manifest.setId(depot.getBaseUri().resolve(getEntryUriPath()).toString());
            manifest.setPublished(createTime);
            manifest.setUpdated(createTime);

            setPrimaryContent(manifest, sourceContents);
            saveManifest(manifest);

            for (SourceContent content : sourceContents) {
                addContent(content);
            }
            if (sourceEnclosures!=null) {
                for (SourceContent encl : sourceEnclosures) {
                    addEnclosure(encl);
                }
            }
            if (releaseLock) {
                unlock();
            }
        } catch (IOException e) {
            throw new DepotWriteException(e);
        }

    }

    public void update(Date updateTime,
            List<SourceContent> sourceContents) throws DepotWriteException {
        update(updateTime, sourceContents, null);
    }

    public void update(Date updateTime,
            List<SourceContent> sourceContents,
            List<SourceContent> sourceEnclosures) throws DepotWriteException {
        try {
            boolean locallyLocked = !isLocked();
            if (locallyLocked) {
                lock();
            }
            rollOffToHistory();

            if (sourceContents!=null) {
                for (SourceContent content : sourceContents) {
                    addContent(content, true);
                }
            }
            if (sourceEnclosures!=null) {
                for (SourceContent encl : sourceEnclosures) {
                    addEnclosure(encl, true);
                }
            }

            Entry manifest = getEntryManifest();
            manifest.setUpdated(updateTime);
            setPrimaryContent(manifest, sourceContents);
            saveManifest(manifest);

            if (locallyLocked) {
                unlock();
            }
        } catch (IOException e) {
            throw new DepotWriteException(e);
        }
    }

    public void delete(Date deleteTime)
            throws DeletedDepotEntryException,
                   DepotIndexException, DepotWriteException {
        if (isDeleted()) {
            throw new DeletedDepotEntryException(this);
        }
        boolean locallyLocked = !isLocked();
        if (locallyLocked) {
            lock();
        }
        // TODO:? wipe content and enclosures?
        // - but keep generated content.entry? (as meta-file?)
        // .. (opt. move away..? zip?)
        rollOffToHistory();

        createMarkerFile(getDeletedMarkerFile());

        Entry manifest = getEntryManifest();
        manifest.setUpdated(deleteTime);
        saveManifest(manifest);
        if (locallyLocked) {
            unlock();
        }
    }

    public void lock() throws DepotWriteException {
        createMarkerFile(getLockedMarkerFile());
    }

    public void unlock() throws DepotWriteException {
        removeMarkerFile(getLockedMarkerFile());
    }

    public void resurrect() throws DepotWriteException {
        // TODO:? this removes *all* history. What are the requirements?
        // Should delete wipe history immediately?
        wipeout();
        /*
        // NOTE: this is a variant for keeping history (but incomplete; create
        // will complain since entry path exists..)
        lock();
        File historyDir = rollOffToHistory();
        try {
            FileUtils.moveFileToDirectory(getDeletedMarkerFile(), historyDir, false);
        } catch (IOException e) {
            throw new DepotWriteException(e);
        }
        unlock();
        */
    }

    // IMPORTANT: these modify *in place*, thus any indexing must occur after!

    public void rollback() throws DepotWriteException {
        if (hasHistory()) {
            restorePrevious();
        } else {
            wipeout();
        }
    }

    protected boolean hasHistory() {
        return getUpdated().compareTo(getPublished()) > 0 &&
            DatePathUtil.youngestEntryHistoryDir(entryContentDir) != null;
    }

    protected void wipeout() throws DepotWriteException {
        try {
            FileUtils.deleteDirectory(entryContentDir);
            FilePathUtil.removeEmptyTrail(
                    entryContentDir.getParentFile(), depot.getBaseDir());
        } catch (IOException e) {
            throw new DepotWriteException(e);
        }
    }

    protected void restorePrevious()
            throws DepotWriteException, DepotIndexException {
        try {
            if (!isLocked())
                lock();
            File rollOffDir = newRollOffDir();
            rollOffToDir(rollOffDir);
            // IMPROVE: use a "HistoryEntry" and "update" from that?
            File historyDir = DatePathUtil.youngestEntryHistoryDir(
                    entryContentDir);
            restoreFromRollOff(historyDir);
            FileUtils.deleteDirectory(historyDir);
            FilePathUtil.removeEmptyTrail(
                    historyDir.getParentFile(), entryContentDir);
            FileUtils.deleteDirectory(rollOffDir);
            unlock();
        } catch (IOException e) {
            throw new DepotWriteException(e);
        }
    }

    protected void addContent(SourceContent srcContent)
            throws DepotWriteException, SourceCheckException, IOException {
        addContent(srcContent, false);
    }

    protected void addContent(SourceContent srcContent, boolean replace)
            throws DepotWriteException, SourceCheckException, IOException {
        File file = newContentFile(srcContent.getMediaType(), srcContent.getLang());
        if (!replace) {
            if (file.exists()) {
                throw new DuplicateDepotContentException(this, srcContent);
            }
        }
        srcContent.writeTo(file);
    }

    protected void addEnclosure(SourceContent srcContent)
            throws DepotWriteException, IOException {
        addEnclosure(srcContent, false);
    }

    protected void addEnclosure(SourceContent srcContent, boolean replace)
            throws DepotWriteException, IOException {
        String enclUriPath = srcContent.getEnclosedUriPath();
        if (enclUriPath.startsWith("/")) {
            if (!enclUriPath.startsWith(entryUriPath)) {
                throw new DepotUriException(
                        "Enclosure <"+enclUriPath +
                        "> is not within depot entry <"+entryUriPath+">.");
            }
        } else {
            String sep = entryUriPath.endsWith("/") ? "" : "/";
            enclUriPath = entryUriPath + sep + enclUriPath;
        }
        String enclPath = StringUtils.removeStart(enclUriPath, entryUriPath);
        File file = new File(entryDir, enclPath);
        if (!replace) {
            if (file.exists()) {
                throw new DuplicateDepotContentException(this, srcContent);
            }
        }
        FilePathUtil.plowParentDirPath(file);
        srcContent.writeTo(file);
    }

    protected File newContentFile(String mediaType) {
        return newContentFile(mediaType, null);
    }

    protected File newContentFile(String mediaType, String lang) {
        String filename = "content";
        if (lang!=null) {
            filename += "-" + lang;
        }
        String suffix = depot.getPathHandler().hintForMediaType(mediaType);
        filename += "." + suffix;
        return new File(entryContentDir, filename);
    }

    protected void setPrimaryContent(Entry manifest,
            List<SourceContent> sourceContents) {
        if (sourceContents != null && sourceContents.size() > 0) {
            SourceContent content = sourceContents.get(0);
            manifest.setContent(((String)null), content.getMediaType());
            if (content.getLang()!=null && !content.getLang().equals("")) {
                manifest.getContentElement().setLanguage(content.getLang());
            }
        }
    }

    protected File rollOffToHistory() throws DepotWriteException {
        try {
            File historyDir = newHistoryDir();
            rollOffToDir(historyDir);
            return historyDir;
        } catch (IOException e) {
            throw new DepotWriteException(e);
        }
    }

    /**
     * Moves the current content (including manifest and enclosures) to the
     * given directory.
     */
    protected void rollOffToDir(File destDir)
            throws DepotWriteException, IOException {
        // NOTE: this means existing content not in the update is removed.
        //      - *including enclosures*

        /* IMPROVE: use an entryContentDir to keep structure (boxed
        content, enclosures) similar to regular entries (for a possible
        HistoryEntry)? But see iterateEntries (it scans for
        entryContentDir name..)! */

        File manifestFile = getManifestFile();
        // NOTE: not required to exist, since this may be invoked as part of a
        // rollback. If there is an ongoing update, the manifest file may have
        // moved to a historyDir.
        if (manifestFile.exists()) {
            FileUtils.moveFileToDirectory(manifestFile, destDir, false);
        }

        for (DepotContent content : findContents()) {
            FileUtils.moveToDirectory(content.getFile(), destDir, false);
        }
        if (genericMetaDir.exists()) {
            FileUtils.moveToDirectory(genericMetaDir, destDir, false);
        }
        File enclosuresDir = getMovedEnclosuresDir(destDir);
        for (File file : entryDir.listFiles(PUBLIC_FILE_FILTER)) {
            if (file.isDirectory() && containsSubEntry(file)) {
                /* NOTE: This doesn't roll off *any* path leading to a
                sub-entry! I believe this is ok (alt. would be forking trees).
                Drawback is that an entry can "shadow" old enclosures.
                This might be prevented by ensuring a "clean path" in create.
                */
                continue;
            }
            FileUtils.moveToDirectory(file, enclosuresDir, false);
            // IMPROVE: removeEmptyTrail(file.getParentFile())?
        }
    }

    protected boolean containsSubEntry(File dir) {
        if (isEntryDir(dir)) {
            return true;
        }
        boolean foundSubEntry = false;
        for (File child : dir.listFiles(PUBLIC_FILE_FILTER)) {
            if (foundSubEntry) {
                return true;
            } else if (child.isDirectory()) {
                foundSubEntry = containsSubEntry(child);
            }
        }
        return foundSubEntry;
    }

    protected void restoreFromRollOff(File rolledOffDir) throws DepotWriteException,
            IOException {
        FileUtils.moveFileToDirectory(new File(rolledOffDir, MANIFEST_FILE_NAME),
                entryContentDir, false);

        for (File file : rolledOffDir.listFiles()) {
            Matcher match = CONTENT_FILE_PATTERN.matcher(file.getName());
            if (match.matches()) {
                FileUtils.moveFileToDirectory(file, entryContentDir, false);
            }
        }

        File movedMetaDir = new File(rolledOffDir, GENERIC_META_DIR_NAME);
        if (movedMetaDir.exists()) {
            FileUtils.moveDirectoryToDirectory(
                    movedMetaDir, entryContentDir, false);
        }

        File movedEnclDir = getMovedEnclosuresDir(rolledOffDir);
        for (File enclFile : ((Collection<File>)FileUtils.listFiles(movedEnclDir,
                HiddenFileFilter.VISIBLE, HiddenFileFilter.VISIBLE))) {
            String enclPath = FilePathUtil.toRelativeFilePath(
                    enclFile, movedEnclDir);
            File target = new File(entryDir, enclPath);
            FilePathUtil.plowParentDirPath(target);
            FileUtils.moveFile(enclFile, target);
        }
    }

    protected File newHistoryDir() throws DepotIndexException, IOException {
        String dirPath = DatePathUtil.toEntryHistoryPath(getUpdated());
        File dir = new File(entryContentDir, dirPath);
        if (dir.exists()) {
            throw new DepotIndexException(
                    "Cannot create history for depot entry <"+this.getId() +
                    "> at date ["+getUpdated()+"]. File <"+dir+"> is in the way!"
                );
        }
        FileUtils.forceMkdir(dir);
        return dir;
    }

    protected File newRollOffDir() throws DepotIndexException, IOException {
        File dir = new File(entryContentDir, ROLLOFF_DIR_NAME);
        if (dir.exists()) {
            throw new DepotIndexException(
                    "Cannot create roll-off for depot entry <"+this.getId() +
                    "> at date ["+getUpdated()+"]. File <"+dir+"> is in the way!"
                );
        }
        FileUtils.forceMkdir(dir);
        return dir;
    }

    protected File getMovedEnclosuresDir(File destDir) throws DepotWriteException {
        File enclosuresDir = new File(destDir, MOVED_ENCLOSURES_DIR_NAME);
        if (!enclosuresDir.exists()) {
            if (!enclosuresDir.mkdir()) {
                throw new DepotWriteException(
                        "Cannot create moved enclosure directory: " + enclosuresDir);
            }
        }
        return enclosuresDir;
    }

    protected void createMarkerFile(File markerFile) throws DepotWriteException {
        try {
            if (!markerFile.createNewFile()) {
                throw new DepotWriteException(
                        "Cannot create entry marker file " + markerFile);
            }
        } catch (IOException e) {
            throw new DepotWriteException(e);
        }
    }

    protected void removeMarkerFile(File markerFile) throws DepotWriteException {
        if (!markerFile.delete()) {
            throw new DepotWriteException(
                    "Cannot remove entry marker file " + markerFile);
        }
    }

}


text:
{% extends 'layout.html' %}
{% import '_macros.html' as macros %}
{% block content %}

  <input autofocus="autofocus" class="filter-table" placeholder="Type here to filter...">

      Certname
      Compile Time
      Compare With

    {% for node in nodes %}

          {{node.name}}
          {{node.catalog_timestamp}}

            {% if node.form %}

                <form method="POST" action="{{url_for('catalog_submit', env=current_env)}}">
                  {{node.form.csrf_token}}

                    {{node.form.compare}}
                    {{node.form.against}}
                    <input type="submit" class="ui submit button" style="height:auto;" value="Compare"/>

                </form>

            {% endif %}

    {% endfor %}

{% endblock content %}


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

	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>com.socklabs</groupId>
		<artifactId>elasticservices-parent</artifactId>
		<version>1.0.0-rc1</version>
		<relativePath>../../</relativePath>
	</parent>

	<artifactId>calc-service</artifactId>
	<packaging>jar</packaging>

	<properties>
		<com.google.guava.guava.version>14.0.1</com.google.guava.guava.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
		</dependency>
		<dependency>
			<groupId>com.google.code.findbugs</groupId>
			<artifactId>jsr305</artifactId>
		</dependency>
		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
		</dependency>
		<dependency>
			<groupId>com.netflix.archaius</groupId>
			<artifactId>archaius-core</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-daemon</groupId>
			<artifactId>commons-daemon</artifactId>
			<version>1.0.15</version>
		</dependency>
		<dependency>
			<groupId>com.netflix.servo</groupId>
			<artifactId>servo-core</artifactId>
		</dependency>
		<dependency>
			<groupId>com.socklabs</groupId>
			<artifactId>elasticservices-core</artifactId>
		</dependency>
		<dependency>
			<groupId>com.socklabs</groupId>
			<artifactId>elasticservices-gossip</artifactId>
		</dependency>
		<dependency>
			<groupId>com.socklabs</groupId>
			<artifactId>elasticservices-http</artifactId>
		</dependency>
	</dependencies>

	<profiles>
		<profile>
			<id>protobuf-build</id>
			<build>
				<plugins>
					<plugin>
						<groupId>com.socklabs</groupId>
						<artifactId>maven-protobuff</artifactId>
						<version>1.0.0</version>
						<executions>
							<execution>
								<id>generate-sources</id>
								<phase>generate-sources</phase>
								<configuration>
									<verbose>true</verbose>
									<protoSources>
										<protoSource>src/main/resources/com/socklabs/elasticservices/examples/calc/calc.proto</protoSource>
									</protoSources>
								</configuration>
								<goals>
									<goal>compile</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>