text:
"""
    @author: Exile
    @date: 05-07-2016
    @place: Cartagena - Colombia
    @licence: Creative Common
"""
from django.contrib import admin
from exile_ui.admin import admin_site
from import_export.formats import base_formats
from import_export.admin import ExportMixin, ImportExportModelAdmin
from import_export import resources, fields
from plugins.pdf.format import PDF

class PdfExportMixin(ExportMixin):

    def get_export_formats(self,):
        formats = super(PdfExportMixin, self).get_export_formats()
        return [PDF, base_formats.CSV, base_formats.XLSX]
    # end def
# end class

registry = {}

def register_export(model, resource_class):
	registry[model] = resource_class
# end def

old_register = admin_site.register

def register(model, *args):
    if model in registry:
    	if len(args):
    		modeladmin = args[0]
    	else:
    		modeladmin = admin.ModelAdmin
    	# end if
        class newadmin(PdfExportMixin, modeladmin):
            resource_class = registry[model]
        # end class
        return old_register(model, newadmin)
    # end if
    return old_register(model, *args)
# end def

admin_site.register = register


text:
package pairwise

import (
	"testing"

	"gonum.org/v1/gonum/mat"
	. "github.com/smartystreets/goconvey/convey"
)

func TestCosine(t *testing.T) {
	var vectorX, vectorY *mat.Dense
	cosine := NewCosine()

	Convey("Given two vectors", t, func() {
		vectorX = mat.NewDense(3, 1, []float64{1, 2, 3})
		vectorY = mat.NewDense(3, 1, []float64{2, 4, 6})

		Convey("When doing inner Dot", func() {
			result := cosine.Dot(vectorX, vectorY)

			Convey("The result should be 25", func() {
				So(result, ShouldEqual, 28)
			})
		})

		Convey("When calculating distance", func() {
			result := cosine.Distance(vectorX, vectorY)

			Convey("The result should be 0", func() {
				So(result, ShouldEqual, 0)
			})

		})

	})
}

redpajama_set_name: RedPajamaGithub


text: A place forstib features/bots/etc


text:
module ISO8583

  # This class constructs an object for handling bitmaps
  # with which ISO8583 messages typically begin.
  # Bitmaps are either 8 or 16 bytes long, an extended length
  # bitmap is indicated by the first bit being set.
  # In all likelyhood, you won't be using this class much, it's used
  # transparently by the Message class.
  class Bitmap
    # create a new Bitmap object. In case an iso message
    # is passed in, that messages bitmap will be parsed. If
    # not, this initializes and empty bitmap.
    def initialize(message = nil, hex_bitmap=false)
      @bmp        = Array.new(128, false)
      @hex_bitmap = hex_bitmap

      message ? initialize_from_message(message) : nil
    end

    def hex_bitmap?
	    !!@hex_bitmap
    end

    # yield once with the number of each set field.
    def each #:yields: each bit set in the bitmap except the first bit.
      @bmp[1..-1].each_with_index {|set, i| yield i+2 if set}
    end

    # Returns whether the bit is set or not.
    def [](i)
      @bmp[i-1]
    end

    # Set the bit to the indicated value. Only `true` sets the
    # bit, any other value unsets it.
    def []=(i, value)
      if i > 128
        raise ISO8583Exception.new("Bits > 128 are not permitted.")
      elsif i < 2
        raise ISO8583Exception.new("Bits < 2 are not permitted (continutation bit is set automatically)")
      end
      @bmp[i-1] = (value == true)
    end

    # Sets bit #i
    def set(i)
      self[i] = true
    end

    # Unsets bit #i
    def unset(i)
      self[i] = false
    end

    # Generate the bytes representing this bitmap.
    def to_bytes
      arr = [self.to_s]
      # tricky and ugly, setting bit[1] only when generating to_s...
      count = self[1] ? 128 : 64
      arr.pack("B#{count}")
    end
    alias_method :to_b, :to_bytes

    def to_hex
	    "%02x" % self.to_s.to_i(2)
    end

    # Generate a String representation of this bitmap in the form:
    #	01001100110000011010110110010100100110011000001101011011001010
    def to_s
      #check whether any `high` bits are set
      ret           = (65..128).one? {|bit| self[bit]}
      high, @bmp[0] = ret ? [128, true] : [64, false]

      str = ""
      1.upto(high) do|i|
	      str << (self[i] ? '1' : '0')
      end

      str
    end

    private

    def initialize_from_message(message)
      bmp = if hex_bitmap?
		    message[0..15].hex.to_s(2).rjust(64, '0')
	    else
		    message.unpack("B64")[0]
	    end

      if bmp[0,1] == "1"
	      bmp = if hex_bitmap?
			    message[0..31].hex.to_s(2).rjust(128,'0')
		    else
			    message.unpack("B128")[0]
		    end
      end

	0.upto(bmp.length-1) {|i| @bmp[i] = (bmp[i,1] == "1") }
    end

    class << self
      # Parse the bytes in string and return the Bitmap and bytes remaining in `str`
      # after the bitmap is taken away.
      def parse(str, hex_bitmap = false)
	bmp  = Bitmap.new(str, hex_bitmap)

	 rest = if bmp.hex_bitmap?
			 bmp[1] ? str[32, str.length] : str[16, str.length]
		else
			 bmp[1] ? str[16, str.length] : str[8, str.length]
		end

        [ bmp, rest ]
      end
    end

  end
end

if __FILE__==$0
  mp = ISO8583::Bitmap.new
  20.step(128,7) {|i| mp.set(i)}
  print mp.to_bytes
end


text:
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>Comments for page "Storm Riders"</title>
		<link>http://bvs.wikidot.com/forum/t-75238/storm-riders</link>
		<description>Posts in the discussion thread "Storm Riders"</description>
				<copyright></copyright>
		<lastBuildDate>Sun, 10 Jul 2022 03:56:14 +0000</lastBuildDate>

				</channel>
</rss>


text:
package com.coffeearmy.marvelheroes.injector;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

import javax.inject.Qualifier;

@Qualifier
@Retention(RetentionPolicy.RUNTIME)
public @interface ApplicationScope {
}


text:
<?php
namespace Tea\Regex\Exception;

use Exception;

class ReplacementError extends RegexError
{
	public static function create($pattern, $subject, $message)
	{
		$pattern = static::formatObject($pattern);
		$subject = static::formatObject($subject);
		return new static("Error replacing pattern `{$pattern}` in subject `{$subject}`. {$message}");
	}

}


text:
//
//  NSObject+XFLegoSwizzle.h
//  XFLegoVIPER
//
//  Created by Yizzuide on 2016/12/26.
//  Copyright © 2016年 Yizzuide. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSObject (XFLegoSwizzle)

/**
 *  交换两个方法
 *
 *  @param originSel 原方法
 *  @param customSel 自定义方法
 */
+ (void)xfLego_swizzleMethod:(SEL)originSel withMethod:(SEL)customSel;
@end


text:
package base.entity.service

import base.common.service.{ Services, ServicesBootstrap }
import base.entity.apiKey.impl.ApiKeysServiceImpl
import base.entity.auth.impl.AuthServiceImpl
import base.entity.db.impl.{ DbConfigServiceImpl, DbServiceImpl, EvolutionServiceImpl }
import base.entity.kv.impl.KvServiceImpl
import base.entity.user.impl.UserServiceImpl

/**
 * Injects configuration into Services and boots them up. If it's configurable, it belongs here.
 * @author rconrad
 */
object EntityServicesBootstrap extends ServicesBootstrap {

  /**
   * Config Sections
   */
  protected val DB = "db"
  protected val KV = "kv"

  /**
   * Registration of services, see classes for details on these parameters
   */
  lazy val registered = dbRegistered && kvRegistered && otherRegistered

  /**
   * Register DB services (must come first)
   */
  lazy val dbRegistered = {

    Services.register(new DbConfigServiceImpl(
      Keys(DB, "driver"),
      Keys(DB, "url"),
      Keys(DB, "user"),
      Keys(DB, "pass")
    ))

    Services.register(new DbServiceImpl())

    Services.register(new EvolutionServiceImpl(
      Keys(DB, "evolution")
    ))

    true
  }

  lazy val kvRegistered = {

    Services.register(new KvServiceImpl(
      Keys(KV, "clientCount"),
      Keys(KV, "host"),
      Keys(KV, "port")))

    true
  }

  /**
   * Register all non-DB services
   */
  lazy val otherRegistered = {

    Services.register(new AuthServiceImpl())

    Services.register(new UserServiceImpl())

    Services.register(new ApiKeysServiceImpl())

    true
  }

}


text:
import os
import optparse
import nest
import nest_apps.simple_network as simple

from flask import Flask, request, jsonify
app = Flask(__name__)

# --------------------------
# General request
# --------------------------

@app.route('/', methods=['GET'])
def index():
    response = {
        'name': 'NEST server simulation',
        'version': nest.version().split(' ')[1],
        'ref': 'http://www.github.com/babsey/nest-server-simulation',
        'env': dict(filter(lambda item: 'NEST' in item[0], os.environ.items()))
    }
    return jsonify(response)

# --------------------------
# NEST simulation request
# --------------------------

def simulate(simulation, data):
    # print(data)
    try:
        response = {'data': simulation(data)}
    except Exception as e:
        print(str(e))
        response = {'error': str(e)}
    return jsonify(response)

@app.route('/network/simple/simulate', methods=['POST'])
def simple_network_simulate():
    return simulate(simple.simulate, request.get_json())

@app.route('/network/simple/resume', methods=['POST'])
def simple_network_resume():
    return simulate(simple.resume, request.get_json())

if __name__ == "__main__":
    parser = optparse.OptionParser("usage: python main.py [options]")
    parser.add_option("-H", "--host", dest="hostname",
                      default="127.0.0.1", type="string",
                      help="specify hostname to run on")
    parser.add_option("-p", "--port", dest="port", default=5000,
                      type="int", help="port to run on")
    (options, args) = parser.parse_args()
    app.run(host=options.hostname, port=options.port)


text:
Date: 2014-05-12 11:00
Title: Cloning hard drives in Linux
Category: IT, Linux, Clone, Disaster recovery
Tags: IT, Linux, Clone, Disaster recovery
layout: post
---

# Metadata

This document is formatted using MarkDown

This work was done by Anthony Beck, [OrcID: 0000-0002-2991-811X](http://orcid.org/0000-0002-2991-811X).

A request from Adrian Porter

# Cloning Hard-Drives

At our stand-up today Mark Farrington raised a point about disaster recovery for people working remotely - this pertained to both data and systems. I chipped in that I use a linux live USB and clone the full system drive to an external and can then use that to recreate the drive if it all goes pear shaped. Adrian Porter asked for an overview.

My approach uses the command line (terminal) and a programme called gparted. You also need a Live USB. I would recommend [linux mint](http://www.linuxmint.com/) cinnamon or mate editions. If you're in windows there are numerous guides to downloading and installing these ISOs onto USB sticks. You'll need a 2gb+ USB stick.

Once you've created your bootable USB stick then insert it into your laptop and reboot. It should detect the drive and boot into it. If not you'll either need to go into bios or change your boot order to tell the machine to boot from that device (again Google is your friend).

Once you're in linux mint do the following:

* Read the archwiki on [disk cloning](https://wiki.archlinux.org/index.php/Disk_Cloning)
	* this is for the Arch linux system. Basically it's the best linux advice on the web.
* *MAKE SURE YOU READ** the archwiki on [disk cloning](https://wiki.archlinux.org/index.php/Disk_Cloning)
* Open Gparted (*sudo gparted*)
* Get the name of your source drive
	* Look at your source size
* Get the name of your target drive
	* Ensure your target size is the same (or larger) than your source
* in a terminal type *sudo  dd if=*source drive (/dev/sda) *of=*target drive (/dev/sdb) *bs=4096 conv=notrunc,noerror,sync*
* Press return
* Wait, *patiently* until you see a new command prompt

That's it.

To clone back after a disaster your source becomes your target and vice versa (don't worry about file size differences).

For info it took about 1 our to clone 240gb

[Here is a video explaining this](https://dl.dropboxusercontent.com/u/393477/Temp/Hard_drive_cloning.mkv)


text:
BOOL APIENTRY DllMain(HMODULE hModule,
	DWORD  ul_reason_for_call,
	LPVOID lpReserved
)
{
	switch (ul_reason_for_call)
	{
	case DLL_PROCESS_ATTACH:
		break;
	case DLL_THREAD_ATTACH:
		break;
	case DLL_THREAD_DETACH:
		break;
	case DLL_PROCESS_DETACH:
		break;
	}
	return TRUE;
}

#endif

#if defined(__linux__) || defined(__unix__ )
#define DLLEXPORT extern "C"
#endif

#include <string>

DLLEXPORT double spriter_LoadModel(const char *pFile);

DLLEXPORT double spriter_CreateInstance(double ModelIndex, const char *pInstanceName, double bEnableBones);

DLLEXPORT double spriter_UpdateInstance(double ModelIndex, double InstanceIndex, double TimeElapsed);

DLLEXPORT double spriter_GetObjectInfoCount(double ModelIndex, double InstanceIndex);

#if defined(ANDROID)
DLLEXPORT std::string spriter_GetObjectInfoFileName(double ModelIndex, double InstanceIndex, double ObjectInfoIndex);

DLLEXPORT std::string spriter_GetObjectInfoString(double ModelIndex, double InstanceIndex, double ObjectInfoIndex);
#else
DLLEXPORT const char *spriter_GetObjectInfoFileName(double ModelIndex, double InstanceIndex, double ObjectInfoIndex);

DLLEXPORT const char *spriter_GetObjectInfoString(double ModelIndex, double InstanceIndex, double ObjectInfoIndex);
#endif

DLLEXPORT double spriter_GetObjectInfoPositionX(double ModelIndex, double InstanceIndex, double ObjectInfoIndex);

DLLEXPORT double spriter_GetObjectInfoPositionY(double ModelIndex, double InstanceIndex, double ObjectInfoIndex);

DLLEXPORT double spriter_GetObjectInfoPivotX(double ModelIndex, double InstanceIndex, double ObjectInfoIndex);

DLLEXPORT double spriter_GetObjectInfoPivotY(double ModelIndex, double InstanceIndex, double ObjectInfoIndex);

DLLEXPORT double spriter_GetObjectInfoSizeX(double ModelIndex, double InstanceIndex, double ObjectInfoIndex);

DLLEXPORT double spriter_GetObjectInfoSizeY(double ModelIndex, double InstanceIndex, double ObjectInfoIndex);

DLLEXPORT double spriter_GetObjectInfoScaleX(double ModelIndex, double InstanceIndex, double ObjectInfoIndex);

DLLEXPORT double spriter_GetObjectInfoScaleY(double ModelIndex, double InstanceIndex, double ObjectInfoIndex);

DLLEXPORT double spriter_GetObjectInfoAngle(double ModelIndex, double InstanceIndex, double ObjectInfoIndex);

DLLEXPORT double spriter_IsGetObjectInfoRender(double ModelIndex, double InstanceIndex, double ObjectInfoIndex);

DLLEXPORT double spriter_GetObjectInfoGMRenderPositionX(double ModelIndex, double InstanceIndex, double ObjectInfoIndex);

DLLEXPORT double spriter_GetObjectInfoGMRenderPositionY(double ModelIndex, double InstanceIndex, double ObjectInfoIndex);

DLLEXPORT double spriter_GetObjectInfoAlpha(double ModelIndex, double InstanceIndex, double ObjectInfoIndex);

DLLEXPORT double spriter_GetObjectInfoType(double ModelIndex, double InstanceIndex, double ObjectInfoIndex);

DLLEXPORT double spriter_SetInstanceCurrentAnimation(double ModelIndex, double InstanceIndex, const char *pAnimationName, double BlendTime);

DLLEXPORT double spriter_SetInstancePosition(double ModelIndex, double InstanceIndex, double px, double py);

DLLEXPORT double spriter_GetInstancePositionX(double ModelIndex, double InstanceIndex);

DLLEXPORT double spriter_GetInstancePositionY(double ModelIndex, double InstanceIndex);

DLLEXPORT double spriter_SetInstanceScale(double ModelIndex, double InstanceIndex, double sx, double sy);

DLLEXPORT double spriter_SetInstanceAngle(double ModelIndex, double InstanceIndex, double angle);

DLLEXPORT double spriter_ApplyInstanceCharacterMap(double ModelIndex, double InstanceIndex, const char *charMap);

DLLEXPORT double spriter_RemoveInstanceCharacterMap(double ModelIndex, double InstanceIndex, const char *charMap);

DLLEXPORT double spriter_RemoveInstanceAllCharacterMap(double ModelIndex, double InstanceIndex);

DLLEXPORT double spriter_SetInstancePlaybackSpeedRatio(double ModelIndex, double InstanceIndex, double PlaybackSpeedRatio);

DLLEXPORT double spriter_InstanceStartResumePlayback(double ModelIndex, double InstanceIndex);

DLLEXPORT double spriter_InstancePausePlayback(double ModelIndex, double InstanceIndex);

DLLEXPORT double spriter_InstanceSetTimeRatio(double ModelIndex, double InstanceIndex, double TimeRatio);

DLLEXPORT double spriter_InstanceAnimationJustFinished(double ModelIndex, double InstanceIndex, double bLooped);

DLLEXPORT double spriter_InstanceGetTriggerInfoCount(double ModelIndex, double InstanceIndex);

#if defined(ANDROID)
DLLEXPORT std::string spriter_InstanceGetTriggerInfoName(double ModelIndex, double InstanceIndex, double TriggerIndex);
#else
DLLEXPORT const char* spriter_InstanceGetTriggerInfoName(double ModelIndex, double InstanceIndex, double TriggerIndex);
#endif

DLLEXPORT double spriter_InstanceGetSoundInfoCount(double ModelIndex, double InstanceIndex);

#if defined(ANDROID)
DLLEXPORT std::string spriter_InstanceGetSoundInfoName(double ModelIndex, double InstanceIndex, double SoundIndex);
#else
DLLEXPORT const char* spriter_InstanceGetSoundInfoName(double ModelIndex, double InstanceIndex, double SoundIndex);
#endif

DLLEXPORT double spriter_GetErrorsCount();

#if defined(ANDROID)
DLLEXPORT std::string spriter_GetLastError();
#else
DLLEXPORT const char* spriter_GetLastError();
#endif

DLLEXPORT double spriter_ForceGarbageCollection();

DLLEXPORT double spriter_AddLoadedSprite(double ModelIndex, const char *pSpriteName, double SpritePtr);

DLLEXPORT double spriter_FindLoadedSprite(double ModelIndex, const char *pSpriteName);

DLLEXPORT double spriter_GetNumSprites(double ModelIndex);

#if defined(ANDROID)
DLLEXPORT std::string spriter_GetSprite(double ModelIndex, double SpriteIndex);
#else
DLLEXPORT const char* spriter_GetSprite(double ModelIndex, double SpriteIndex);
#endif

DLLEXPORT double spriter_GetObjectInfoSpriteIndex(double ModelIndex, double InstanceIndex, double ObjectInfoIndex);

DLLEXPORT double spriter_SetLoadedSpriteTexelSize(double ModelIndex, const char *pSpriteName, double TexelWidth, double TexelHeight);

DLLEXPORT double spriter_SetLoadedSpriteSize(double ModelIndex, const char *pSpriteName, double TextureWidth, double TextureHeight);

DLLEXPORT double spriter_GetObjectInfoMeshPointX(double ModelIndex, double InstanceIndex, double ObjectInfoIndex, double PointIndex);
DLLEXPORT double spriter_GetObjectInfoMeshPointY(double ModelIndex, double InstanceIndex, double ObjectInfoIndex, double PointIndex);

DLLEXPORT double spriter_GetObjectInfoMeshUVX(double ModelIndex, double InstanceIndex, double ObjectInfoIndex, double PointIndex);
DLLEXPORT double spriter_GetObjectInfoMeshUVY(double ModelIndex, double InstanceIndex, double ObjectInfoIndex, double PointIndex);

DLLEXPORT double spriter_DestroyInstance(double ModelIndex, double InstanceIndex);

DLLEXPORT double spriter_DestroyModel(double ModelIndex);

DLLEXPORT double spriter_DestroyAllModels();

#if defined(ANDROID)
DLLEXPORT std::string spriter_GetObjectInfoName(double ModelIndex, double InstanceIndex, double ObjectInfoIndex);
#else
DLLEXPORT const char* spriter_GetObjectInfoName(double ModelIndex, double InstanceIndex, double ObjectInfoIndex);
#endif

DLLEXPORT double spriter_SetLockObjectInstance(double ModelIndex, double InstanceIndex, const char *ObjectName);

DLLEXPORT double spriter_SetUnlockObjectInstance(double ModelIndex, double InstanceIndex);

DLLEXPORT double spriter_SetObjectInstanceIKMode(double ModelIndex, double InstanceIndex, double bIKMode, double IKTreshold);

DLLEXPORT double spriter_SetObjectInstanceIKPosition(double ModelIndex, double InstanceIndex, double x, double y);

DLLEXPORT double spriter_SetObjectInstanceManualAngleControl(double ModelIndex, double InstanceIndex, const char *ObjectName, double bManualControl);

DLLEXPORT double spriter_SetObjectInstanceManualAngle(double ModelIndex, double InstanceIndex, double x, double y);

DLLEXPORT double spriter_IsObjectInstanceIKMode(double ModelIndex, double InstanceIndex, const char *ObjectName);

DLLEXPORT double spriter_IsObjectInstanceManualAngleControl(double ModelIndex, double InstanceIndex, const char *ObjectName);

//New

DLLEXPORT double spriter_IsTagActive(double ModelIndex, double InstanceIndex, const char *ObjectName, const char *TagName);

DLLEXPORT double spriter_IsVariableExist(double ModelIndex, double InstanceIndex, const char *ObjectName, const char *VariableName);

#if defined(ANDROID)
DLLEXPORT std::string spriter_GetVariableStringValue(double ModelIndex, double InstanceIndex, const char *ObjectName, const char *VariableName);
#else
DLLEXPORT const char* spriter_GetVariableStringValue(double ModelIndex, double InstanceIndex, const char *ObjectName, const char *VariableName);
#endif

DLLEXPORT double spriter_GetVariableRealValue(double ModelIndex, double InstanceIndex, const char *ObjectName, const char *VariableName);

DLLEXPORT double spriter_GetVariableIntValue(double ModelIndex, double InstanceIndex, const char *ObjectName, const char *VariableName);


text:
% KU Leuven latex presentation template
%
% © 2012 Michael Hofmann
%
% This work is licensed under the Creative Commons Attribution 3.0 Unported License.
% To view a copy of this license, visit
% http://creativecommons.org/licenses/by/3.0/ or send a letter to Creative
% Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

\documentclass[t,12pt,english
\ifx\beamermode\undefined\else,\beamermode\fi
]{beamer}
%\setbeameroption{show notes}
%\setbeameroption{show only notes}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage[nohyperlinks]{acronym}
\usepackage{babel,lmodern,graphicx,mathptmx,xspace,wasysym,microtype,booktabs,tabularx,relsize,textcomp,longtable,lipsum,colortbl,eurosym,url,multicol,etoolbox,multimedia,pdfpages,fixltx2e,ifluatex,epstopdf}
\usepackage[olditem,oldenum]{paralist}
\usepackage[babel=true]{csquotes}
\usepackage[thinqspace,amssymb,textstyle]{SIunits}
\usepackage[textsize=tiny]{todonotes}
\usepackage[symbol]{footmisc}
\usepackage[notquote]{hanging}
\usepackage[normalem]{ulem}
%\usepackage{lua-visual-debug}

\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
\graphicspath{{Images2/}}
% Fix sort order in case the same file exists with multiple extensions
\DeclareGraphicsExtensions{.pdf,.png,.jpeg,.jpg,.eps}
\frenchspacing

\input{templates/definitions.tex}

\hypersetup{
    colorlinks=true,
    linkcolor=blue,
    filecolor=magenta,
    urlcolor=cyan,
    bookmarks=true,
    pdfpagemode=FullScreen,
}

%% From pandoc default template
%% End pandoc

\mode<presentation>

%\hypersetup{pdfpagemode=FullScreen}

\definecolor{kuldefault}{HTML}{00407a}
\definecolor{kulbright}{HTML}{52bdec}
\definecolor{kulleft}{HTML}{1d8db0}
\definecolor{kulright}{HTML}{116e8a}

\definecolor{kulyellow}{HTML}{BC8F00}
\definecolor{kulorange}{HTML}{BC6E00}
\definecolor{kulgreen}{HTML}{007F4F}
\definecolor{kulred}{HTML}{FF4422}

\setbeamercolor{structure}{fg=kulbright}
\setbeamercolor{title}{fg=white}
\setbeamercolor{footline}{parent=title}
\setbeamercolor{normal text}{fg=kuldefault}
\setbeamercolor{item}{parent=normal text}
\setbeamercolor{section in toc}{parent=normal text}
\setbeamerfont{title}{size=\Large}
\setbeamerfont{tiny structure}{series=\bfseries}
\setbeamerfont{caption}{}

\setbeamersize{text margin left=0.8cm}
\setbeamersize{text margin right=0.8cm}
\setbeamersize{sidebar width left=0cm}

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{itemize item}{\footnotesize\raise1pt\hbox{\textbullet}}
\setbeamertemplate{itemize subitem}{--}
\setbeamertemplate{itemize subsubitem}{\tiny\raise1.5pt\hbox{\textbullet}}

\setlength\leftmargini{1em}
\setlength\leftmarginii{1em}
\setlength\leftmarginiii{1em}

\defbeamertemplate{background canvas}{title}
{%
    \pgfdeclarehorizontalshading{bgshading}{8.70cm}{color(0cm)=(kulleft); color(\the\paperwidth)=(kulright)}%
    \vbox to 8.70cm{%
        \pgfuseshading{bgshading}\hspace*{-1.6cm}%
    }%
    \hskip-\paperwidth%
    \hskip1.6cm%
    \vbox to \paperheight{%
        \vskip0.5cm\hskip0.5cm\includegraphics[width=2.83cm]{templates/kuleuven}%
        \vskip0.99cm\hskip0.76cm\includegraphics[width=2.84cm]{templates/key}%
        \vskip-0.57cm\hskip11.61cm\includegraphics[width=0.58cm]{templates/sedes}\hspace*{-1cm}%
        \vfill
    }%
}

\defbeamertemplate{background canvas}{grid}
{%
    \begin{tikzpicture}[remember picture,overlay,every node/.style={anchor=center}]
        \foreach \d in {0,...,20} {
            \draw[gray] (\d,0) -- (\d,-20);
            \draw[gray] (0,-\d) -- (20,-\d);
            \draw[lightgray] (\d+0.5,0) -- (\d+0.5,-20);
            \draw[lightgray] (0,-\d-0.5) -- (20,-\d-0.5);
            \node[anchor=north,red,font=\tiny] at (\d,0) {\d};
            \node[anchor=west,red,font=\tiny] at (0,-\d) {\d};
        }
    \end{tikzpicture}
}

\defbeamertemplate{background canvas}{plain}{}

\defbeamertemplate{footline}{large}
{%
    \pgfdeclarehorizontalshading{bgshading}{0.62cm}{color(0cm)=(kulleft); color(\the\paperwidth)=(kulright)}%
    \vskip.3cm% make room for the logo
    \parbox[t][0.62cm]{\paperwidth}{\pgfuseshading{bgshading}}\par%
    \vskip-0.62cm%
    \begin{beamercolorbox}[ht=0.37cm,dp=0.25cm,center]{page number in head/foot}%
    \insertframenumber%
    \end{beamercolorbox}%
    \vskip-0.92cm%
    \parbox[t][0.92cm]{\paperwidth}{\hskip10.33cm\includegraphics[width=2.10cm]{templates/kuleuven}}\par%
}

\defbeamertemplate{footline}{nopagenumber}
{%
    \pgfdeclarehorizontalshading{bgshading}{0.62cm}{color(0cm)=(kulleft); color(\the\paperwidth)=(kulright)}%
    \vskip.3cm% make room for the logo
    \parbox[t][0.62cm]{\paperwidth}{\pgfuseshading{bgshading}}\par%
    \vskip-0.62cm%
    \begin{beamercolorbox}[ht=0.37cm,dp=0.25cm,center,ignorebg]{page number in head/foot}%
    %
    \end{beamercolorbox}%
    \vskip-0.92cm%
    \parbox[t][0.92cm]{\paperwidth}{\hskip10.33cm\includegraphics[width=2.10cm]{templates/kuleuven}}\par%
}

\defbeamertemplate{footline}{small}
{%
    \vskip.3cm% make room for the logo
    \begin{beamercolorbox}[ht=0.37cm,dp=0.25cm,center,ignorebg]{normal text}%
    \mdseries\insertframenumber%
    \end{beamercolorbox}%
}

\setbeamertemplate{footline}[large]

\setbeamertemplate{frametitle}
{%
    \nointerlineskip%
    \vskip.28cm%
    {\usebeamercolor[fg]{framesubtitle}\usebeamerfont{framesubtitle}\insertsupertitle\strut\par}%
    \vskip-.2cm%
    {\usebeamercolor[fg]{frametitle}\usebeamerfont{frametitle}\insertframetitle\strut\par}%
    \vskip-.3cm%
}

\setbeamertemplate{title page}
{
    \vbox{}%
    \vskip2.8cm%
    \vbox to 6.5cm{%
        \hskip2.8cm%
        \begin{minipage}{7.9cm}
            \begin{beamercolorbox}{title}
                \usebeamerfont{title}%
                \inserttitle\par%
                \ifx\insertsubtitle\undefined%
                \else%
                    \vskip0.25em%
                    {\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
                \fi%
            \end{beamercolorbox}%
            \vskip1em\par
            \begin{beamercolorbox}{author}
                \usebeamerfont{author}\usebeamercolor[fg]{subtitle}%
                \insertauthor
            \end{beamercolorbox}
            \begin{beamercolorbox}{institute}
                \usebeamerfont{institute}\usebeamercolor[fg]{subtitle}%
                \insertinstitute
                \end{beamercolorbox}
            \begin{beamercolorbox}{date}
                \usebeamerfont{date}\usebeamercolor[fg]{subtitle}%
                \insertdate
            \end{beamercolorbox}%
        \end{minipage}%
        \vfill
    }
}

\mode<all>

\newcommand{\inlinesound}[2]{\movie[inlinesound,encoding=Signed,samplingrate=44100]{#1}{#2}}

% disable for now as otherwise all commands that go between frames generated by
% the filter will result in duplicate toc lines
\renewcommand{\addcontentsline}[3]{}

\newcommand{\largefooter}{\setbeamertemplate{footline}[large]}
\newcommand{\emptyfooter}{\setbeamertemplate{footline}[nopagenumber]}
\newcommand{\smallfooter}{\setbeamertemplate{footline}[small]}

\newcommand{\sectiontoc}{\AtBeginSection[]{{
    \nosupertitle
    \emptyfooter
    \begin{frame}[noframenumbering]{Outline}
                \tableofcontents[currentsection]
            \end{frame}
    \largefooter
}}}

\newcommand{\subsectiontoc}{\AtBeginSubsection[]{{
    \nosupertitle
    \emptyfooter
    \begin{frame}[noframenumbering]{Outline}
                \tableofcontents[currentsection,currentsubsection]
           \end{frame}
    \largefooter
}}}

\newcommand{\notoc}{\AtBeginSection[]{}\AtBeginSubsection[]{}}

\newcommand{\nosupertitle}{\renewcommand{\insertsupertitle}{}}
\newcommand{\sectiontitle}{\renewcommand{\insertsupertitle}{\insertsectionhead}}
\newcommand{\subsectiontitle}{\renewcommand{\insertsupertitle}{\insertsectionhead\ifx\insertsubsectionhead\empty\else{} -- \insertsubsectionhead\fi}}

% animations do not work atm as figures are set on independent frames
\newcommand{\slidefig}[2]{\usebackgroundtemplate{\parbox[c][\paperheight][c]{\paperwidth}{\centering\includegraphics#1[height=\paperheight,width=\paperwidth,keepaspectratio]{#2}}}\begin{frame}[plain]\end{frame}\usedefaultcanvas}

\newcommand{\usedefaultcanvas}{\setbeamertemplate{background canvas}[\defaultcanvas]}
\newcommand{\gridcanvas}{\renewcommand{\defaultcanvas}{grid}\usedefaultcanvas}
\newcommand{\plaincanvas}{\renewcommand{\defaultcanvas}{plain}\usedefaultcanvas}

\newcommand{\insertsupertitle}{}

\newcommand{\defaultcanvas}{plain}

% Defining a new coordinate system for the page:
%
% ----------------
% |(0,1)    (1,1)|
% |              |
% |(0,0)    (1,0)|
% ----------------
\makeatletter
\def\parsecomma#1,#2\endparsecomma{\def\page@x{#1}\def\page@y{#2}}
\tikzdeclarecoordinatesystem{page}{
    \parsecomma#1\endparsecomma
    \pgfpointanchor{current page}{north east}
    % Save the upper right corner
    \pgf@xc=\pgf@x%
    \pgf@yc=\pgf@y%
    % save the lower left corner
    \pgfpointanchor{current page}{south west}
    \pgf@xb=\pgf@x%
    \pgf@yb=\pgf@y%
    % Transform to the correct placement
    \pgfmathparse{(\pgf@xc-\pgf@xb)*\page@x+(\pgf@xb)}
    \expandafter\pgf@x\expandafter=\pgfmathresult pt
    \pgfmathparse{(\pgf@yc-\pgf@yb)*\page@y+(\pgf@yb)}
    \expandafter\pgf@y\expandafter=\pgfmathresult pt
}
\makeatother

% Example:
%\begin{tikzpicture}[remember picture,overlay,every node/.style={anchor=center}]
%  \node at (page cs:0.5,0.3) {0.5,0.3};
%  \node at (page cs:0,0) {0,0};
%  \draw(page cs:0,0) -- (page cs:1,1);
%  \draw[thick,red] (page cs:0,0) rectangle (page cs:1,1);
%  \draw[thick,green] (page cs:0.2,0.2) rectangle (page cs:0.8,0.8);
%\end{tikzpicture}

\setcounter{secnumdepth}{0}

\title{Nonlinear signal processing}
\subtitle{\tiny Biomedical Data Procession part II }
\author{\\ \href{vangjush.komini@uzleuven.be}{\textbf{\textit{Vangjush Komini}}}
}

\institute{{\tiny }\vspace{.10cm} }
\date{\href{www.kul.be}{KU Leuven}\\ \vspace{.10cm}\today}

\begin{document}

\setbeamertemplate{background canvas}[title]

\begin{frame}[plain,noframenumbering]
    \titlepage
\end{frame}

\usedefaultcanvas

\emptyfooter
\begin{frame}[noframenumbering]{Outline}
        \tableofcontents
    \end{frame}
\largefooter

\section{Artifact removal for EEG data}\label{first-section}

\begin{frame}{Artifact removal for EEG data}

\begin{figure}[!htbp]
\minipage{.5\textwidth}%
\centering
\includegraphics[width=.8\textwidth]{1.jpg}\\
\tiny{\tiny EEG signal of the first set}
\endminipage\hfill
\minipage{.5\textwidth}%
\centering
\includegraphics[width=.8\textwidth]{2.jpg}\\
\tiny{\tiny EEG signal of the second set}
\endminipage\hfill
\end{figure}

\tiny{Original EEG signals where in addition the most affected channels by the muscles artifacts are pointed out}

\end{frame}

\begin{frame}{CCA of the first set}

\begin{figure}[!htbp]
\minipage{.3\textwidth}%
\centering
\includegraphics[width=1\textwidth]{3.jpg}\\
\tiny{\tiny EEG reconstructed signals after CCA}
\endminipage\hfill
\minipage{.3\textwidth}%
\centering
\includegraphics[width=1\textwidth]{4.jpg}\\
\tiny{\tiny The CCA source channel}
\endminipage\hfill
\minipage{.3\textwidth}%
\centering
\includegraphics[width=1\textwidth]{5.jpg}\\
\tiny{\tiny Correlation values for respective channel}
\endminipage\hfill
\end{figure}

\begin{equation}
    EEG=W^{T}*CCA_{sources}
\end{equation}

\end{frame}

\begin{frame}{CCA of the second set}

\begin{figure}[!htbp]
\minipage{.3\textwidth}%
\centering
\includegraphics[width=1\textwidth]{6.jpg}\\
\tiny{EEG reconstructed signals after CCA}
\endminipage\hfill
\minipage{.3\textwidth}%
\centering
\includegraphics[width=1\textwidth]{7.jpg}\\
\tiny{The CCA source channel}
\endminipage\hfill
\minipage{.3\textwidth}%
\centering
\includegraphics[width=1\textwidth]{8.jpg}\\
\tiny{Correlation values for respective channel}
\endminipage\hfill
\end{figure}

\begin{equation}
    EEG=W^{T}*CCA_{sources}
\end{equation}

\end{frame}

\begin{frame}{Manual processing  for the first set}

\begin{figure}[!htbp]
\minipage{.3\textwidth}%
\centering
\includegraphics[width=1\textwidth]{9.jpg}\\
\includegraphics[width=1\textwidth]{10.jpg}
\endminipage\hfill
\minipage{.3\textwidth}%
\centering
\includegraphics[width=1\textwidth]{11.jpg}\\
\includegraphics[width=1\textwidth]{12.jpg}
\endminipage\hfill
\minipage{.3\textwidth}%
\centering
\includegraphics[width=1\textwidth]{13.jpg}\\
\includegraphics[width=1\textwidth]{14.jpg}
\endminipage\hfill
\end{figure}

\end{frame}

\begin{frame}{Manual processing  for the second set}

\begin{figure}[!htbp]
\minipage{.3\textwidth}%
\centering
\includegraphics[width=1\textwidth]{16.jpg}\\
\includegraphics[width=1\textwidth]{16.jpg}
\endminipage\hfill
\minipage{.3\textwidth}%
\centering
\includegraphics[width=1\textwidth]{19.jpg}\\
\includegraphics[width=1\textwidth]{20.jpg}
\endminipage\hfill
\minipage{.3\textwidth}%
\centering
\includegraphics[width=1\textwidth]{23.jpg}\\
\includegraphics[width=1\textwidth]{24.jpg}
\endminipage\hfill
\end{figure}

\end{frame}

\begin{frame}{Manual processing  for the second set \textit{.cont}}

\begin{figure}[!htbp]
\minipage{.3\textwidth}%
\centering
\includegraphics[width=1\textwidth]{17.jpg}\\
\includegraphics[width=1\textwidth]{18.jpg}
\endminipage\hfill
\minipage{.3\textwidth}%
\centering
\includegraphics[width=1\textwidth]{21.jpg}\\
\includegraphics[width=1\textwidth]{22.jpg}
\endminipage\hfill
\minipage{.3\textwidth}%
\centering
\includegraphics[width=1\textwidth]{25.jpg}\\
\includegraphics[width=1\textwidth]{26.jpg}
\endminipage\hfill
\end{figure}

\end{frame}

\begin{frame}{Automated processing for the second set }

\begin{figure}[!htbp]
\minipage{.5\textwidth}%
\centering
\includegraphics[width=.8\textwidth]{27.jpg}\\
\includegraphics[width=.8\textwidth]{14.jpg}\\
\tiny{CCA results of the first data set}\label{toda1}
\endminipage\hfill
\minipage{.5\textwidth}%
\centering
\includegraphics[width=.8\textwidth]{28.jpg}\\
\includegraphics[width=.8\textwidth]{26.jpg}\\
\tiny{CCA results of the second data set}\label{toda2}
\endminipage\hfill
\end{figure}

\end{frame}

\begin{frame}{Outline of the process}

\begin{block}{\footnotesize{}}\tiny{}
\begin{enumerate}
\vspace{0.05cm}
     \item \tiny{\textbf{\textit{Second dataset much higher level of artifacts compare to the first.}}}
     \item \tiny{\textbf{\textit{Semi automated CCA could be an fast approach}}}
     \item \tiny{\textbf{\textit{Visual perception is a vital for good performance}}}
     \item \tiny{\textbf{\textit{Recognition of low voltage and fast activities.}}}
     \item \tiny{\textbf{\textit{Some of the artifacts could not be suppressed with the CCA from the statistical nature of the method}}}
     \item \tiny{\textbf{\textit{Is still a subspace method where the resulting information is linearly approximated via consistently to the correlation values among channels and the CCA computed channels}}}

\end{enumerate}
\end{block}

\end{frame}

\begin{frame}{Differences between CCA and ICA}

\begin{block}{\footnotesize{}}\tiny{}
\begin{enumerate}
\vspace{0.05cm}
     \item \tiny{\textbf{\textit{CCA is an straight forward implementation, ICA need to iteratively solve or optimize any parameter \cite{17}.}}}
     \item \tiny{\textbf{\textit{In the ICA implementation there is no guarantee on the same output for identical data contrary to the CCA\cite{15}.}}}
     \item \tiny{\textbf{\textit{CCA tries to uncorrelate  whereas ICA tries to independent the sources.}}}
     \item \tiny{\textbf{\textit{CCA much faster compare to ICA}}}
     \item \tiny{\textbf{\textit{CCA claims better result compare to ICA}}}
     \item \tiny{\textbf{\textit{ICA assumes the input data set to be full non-Gaussian CCA has no assumption}}}
     \item \tiny{\textbf{\textit{ICA could be seen from different prospective.}}}
     \item \tiny{\textbf{\textit{ICA in addition requires pre-processing  of the data, including here centering and whitening of the data.}}}
     \item \tiny{\textbf{\textit{Auto-correlation is a well defined method thereby the correlation coefficient between the sources to be proceeded are defined very accurately in a very robust manner.}}}

\end{enumerate}
\end{block}

\end{frame}

\section{Nonlinear signal analysis}\label{Second-section}

\begin{frame}{Nonlinear signal analysis}

\begin{figure}[!htbp]
\minipage{.5\textwidth}%
\centering
\includegraphics[width=.8\textwidth]{E1.jpg}\\
\tiny{DFA result of the control data set}\label{figa}
\endminipage\hfill
\minipage{.5\textwidth}%
\centering
\includegraphics[width=.8\textwidth]{E2.jpg}\\
\tiny{DFA result of the west data set}\label{figb}
\endminipage\hfill
\caption{\tiny Detrended fluctation analysis plots of the two data set}
\end{figure}

\end{frame}

\begin{frame}{Non linear parameter estimation}

\begin{table}[!htbp]
\tiny
\centering
\begin{tabular}{ c c c c c c c c}
\hline
$Control$&$1$&$2$&$3$&$4$&$5$&$\mu$&$\sigma$\\
\hline
$FD $&$1.7438$&$1.7298$&$1.7707$&$1.7208$&$1.7173$&$ 1.7365$&$ 4.7074e-04$\\
$1/f$&$-1.3486$&$-1.0308$&$-1.0754$&$-1.0624$&$-1.5117$&$-1.2058$&$ 0.0455$\\
$LE$&$0.0826$&$0.3860$&$0.2120$&$0.0825$&$0.0944$&$0.1938$&$0.0198$\\
$SampEnResults$&$2.3058$&$2.0164$&$2.0987$&$1.8646$&$2.1077$&$2.0786$&$0.0256$\\
&$0.6178$&$0.6472$&$0.7670$&$0.4271$&$0.5736$&$0.6065$&$0.0152$\\
\hline
\end{tabular}
\end{table}

\begin{table}[!htbp]
\tiny
\centering
\begin{tabular}{ c c c c c c c c}
\hline
$West$&$1$&$2$&$3$&$4$&$5$&$\mu$&$\sigma$\\
\hline
$FD$&$1.7448$&$1.5999$&$1.7198$&$1.7501$&$1.7059$&$ 1.7041$&$ 0.0037$\\
$1/f$&$-1.0898$&$-1.5659$&$-1.0138$&$-1.3829$&$-1.1288$&$-1.2362$&$ 0.0532$\\
$LE$&$0.1217$&$0.0878$&$0.2797$&$0.0807$&$0.3043$&$0.3222$&$0.0829$\\
$SampEnResults$&$2.0307$&$2.2033$&$2.1825$&$2.1837$&$2.2467$&$2.1694$&$0.0067$\\
&$1.0327$&$0.6303$&$0.8739$&$0.5220$&$0.6609$&$ 0.7440$&$0.0423$\\
\hline
\end{tabular}
\end{table}

\begin{table}[!htbp]
\tiny
\centering
\tiny Slope of the second part of line in DFA plots
\begin{tabular}{ c c c c c c c c}
\hline
&$1$&$2$&$3$&$4$&$5$&$\mu$\\
\hline
$Control$&$31.4300$&$ 4.8353$&$4.8058$&$15.0472$&$21.1844$&$6.9868$\\
$West$&$6.9512$&$ 3.7947$&$0.7843$&$ 0.6201$&$13.9351$&$5.2171$\\
\hline
\end{tabular}
\end{table}

\begin{table}[!htbp]
\tiny
\centering
\tiny Slope of the first part of line in DFA plots
\begin{tabular}{ c c c c c c c c}
\hline
&$1$&$2$&$3$&$4$&$5$&$\mu$\\
\hline
$Control$&$129.5984$&$123.5662$&$132.5211$&$147.3374$&$127.0359$&$132.0118$\\
$West$&$137.6878$&$132.0872$&$135.5602$&$129.5709$&$135.0323$&$133.9877$\\
\hline
\end{tabular}
\end{table}

\end{frame}

\begin{frame}{DFA plots for both of the groups}

\begin{figure}[!htbp]
\minipage{.5\textwidth}%
\centering
\includegraphics[width=.7\textwidth]{E3.jpg}\\
\includegraphics[width=.7\textwidth]{E4.jpg}\\
\endminipage\hfill
\minipage{.5\textwidth}%
\centering
\includegraphics[width=.7\textwidth]{E8.jpg}\\
\includegraphics[width=.7\textwidth]{E9.jpg}\\
\endminipage\hfill
\end{figure}

\end{frame}

\begin{frame}{DFA plots for both of the groups.\textit{cont}}

\begin{figure}[!htbp]
\minipage{.5\textwidth}%
\centering
\includegraphics[width=.7\textwidth]{E5.jpg}\\
\includegraphics[width=.7\textwidth]{E6.jpg}\\
\endminipage\hfill
\minipage{.5\textwidth}%
\centering
\includegraphics[width=.7\textwidth]{E10.jpg}\\
\includegraphics[width=.7\textwidth]{E11.jpg}\\
\endminipage\hfill
\end{figure}

\end{frame}

\begin{frame}{DFA plots for both of the groups.\textit{cont I}}

\begin{figure}[!htbp]
\minipage{.5\textwidth}%
\centering
\includegraphics[width=.7\textwidth]{E7.jpg}\\
\endminipage\hfill
\minipage{.5\textwidth}%
\centering
\includegraphics[width=.7\textwidth]{E12.jpg}\\
\endminipage\hfill
\end{figure}

\end{frame}

\begin{frame}{F slope fitting}
\begin{figure}[!htbp]
\minipage{.5\textwidth}%
\centering
\includegraphics[width=.7\textwidth]{E33.jpg}\\
\includegraphics[width=.7\textwidth]{E34.jpg}\\
\endminipage\hfill
\minipage{.5\textwidth}%
\centering
\includegraphics[width=.7\textwidth]{E38.jpg}\\
\includegraphics[width=.7\textwidth]{E39.jpg}\\
\endminipage\hfill
\end{figure}
\end{frame}

\begin{frame}{F slope fitting \textit{cont}}
\begin{figure}[!htbp]
\minipage{.5\textwidth}%
\centering
\includegraphics[width=.7\textwidth]{E35.jpg}\\
\includegraphics[width=.7\textwidth]{E36.jpg}\\
\endminipage\hfill
\minipage{.5\textwidth}%
\centering
\includegraphics[width=.7\textwidth]{E40.jpg}\\
\includegraphics[width=.7\textwidth]{E41.jpg}\\
\endminipage\hfill
\end{figure}
\end{frame}

\begin{frame}{F slope fitting \textit{cont I}}
\begin{figure}[!htbp]
\minipage{.5\textwidth}%
\centering
\includegraphics[width=.7\textwidth]{E37.jpg}\\
\endminipage\hfill
\minipage{.5\textwidth}%
\centering
\includegraphics[width=.7\textwidth]{E42.jpg}\\
\endminipage\hfill
\end{figure}
\end{frame}

\begin{frame}{Discussion}

\begin{block}{\footnotesize{Scaling behaviour of the nonlinear system}}\tiny{}
\begin{enumerate}
\vspace{0.05cm}
     \item \tiny{\textbf{\textit{FD evaluate the complexity degree of the signal. The rhythmic variation tends to decreases consequently FD in this case will be lower than normal subjects.}}}
     \item \tiny{\textbf{\textit{1/f slope indicates the smoothness of the time series. The values of abnormalities tends to be slightly lower compare to normal HR.}}}
     \item \tiny{\textbf{\textit{DFA slope indicates the variability of the time series. It is composed of the short range $\alpha_{1}$ and long range $\alpha_{2}$. The slope is very low for very varying signals and slightly higher than 1 for rhythmically signals}}}
\end{enumerate}
\end{block}

\begin{block}{\footnotesize{Complexity and chaos of the system}}\tiny{}
\begin{enumerate}
\vspace{0.05cm}
     \item \tiny{\textbf{\textit{LE defines the intensity of the chaotic behaviour and how much differ from periodic signals. Geometrically speaking defines the average rate of divergence of two trajectories. Positive values indicates a chaotic behaviour. It also outlines the sensitivity of the system to initial conditions together with a measurement of the predictability.}}}
     \item \tiny{\textbf{\textit{Sample entropy measures statistically the complexity and regularity of the time-series as well as its predictability.Its values are small when the HRV runs under same abnormalities and theoretically should be big when the HRV is normal.}}}

\end{enumerate}
\end{block}

\end{frame}

\begin{frame}{Comparison of the two groups}

\begin{block}{\footnotesize{}}\tiny{}
\begin{enumerate}
\vspace{0.05cm}
     \item \tiny{\textbf{\textit{FD for the \textbf{\textit{Control}} case are fairly high, and there is no variation among the entities. In comparison to the \textbf{\textit{West}} the FD values are on average lower.}}}
     \item \tiny{\textbf{\textit{In the \textbf{\textit{Control}} data set this values on average tend to be lower compare to the \textbf{\textit{West}} data set although the difference is relatively small}}}
     \item \tiny{\textbf{\textit{DFA results on Control case it higher than the West set comparing respective individuate and therefore on average.}}}
     \item \tiny{\textbf{\textit{LE values \textbf{\textit{Control}} likewise the average are significantly smaller compare to the \textbf{\textit{West}} data set.}}}
     \item \tiny{\textbf{\textit{Mean value is however smaller in the \textbf{\textit{Control}} and therefore inferring some abnormalities compare to the \textbf{\textit{West}}.}}}
\end{enumerate}
\end{block}

\end{frame}

\emptyfooter
\begin{frame}{ }
\centering \textbf{\Large \textit{Thank you for your attention!}}
\begin{figure}[!htb]
\includegraphics[width=.3\textwidth]{QA.jpg}
\end{figure}
\largefooter
\end{frame}

\begin{frame}[allowframebreaks]
        \frametitle{References}
        \nocite{*}
        \bibliography{Bibl}
        \bibliographystyle{plain}
\end{frame}

\end{document}


text:
Originally published: 2005-07-05 04:08:05
Last updated: 2005-07-05 04:08:05
Author: Flavio Catalani

The RingList is a class implementing a circular list.
The ring have a fixed size and when it is full and you append a new element, the first one will be deleted.
The class lets you access to the data like a python list or like a string.


text:
class ReadingListModel;

// Implementation of ReadingListModelStorage that stores reading list items in
// the system user defaults.
class ReadingListModelStorageDefaults : public ReadingListModelStorage {
 public:
  std::vector<ReadingListEntry> LoadPersistentReadList() override;
  std::vector<ReadingListEntry> LoadPersistentUnreadList() override;
  bool LoadPersistentHasUnseen() override;

  void SavePersistentReadList(
      const std::vector<ReadingListEntry>& read) override;
  void SavePersistentUnreadList(
      const std::vector<ReadingListEntry>& unread) override;
  void SavePersistentHasUnseen(bool has_unseen) override;
};

#endif  // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_MODEL_STORAGE_DEFAULTS_H_


text:
class HrdPolicy < ApplicationPolicy

    def index?
        @current_user.permission('HRD', :guest)
    end

    def show?
        @current_user.permission('HRD', :guest)
    end

    def new?
        @current_user.permission('HRD', :clerk)
    end

    def create?
        @current_user.permission('HRD', :clerk)
    end

    def edit?
        @current_user.permission('HRD', :clerk)
    end

    def update?
        @current_user.permission('HRD', :clerk)
    end

    def archive?
        @current_user.permission('HRD', :clerk)
    end

    def hrd_items?
        @current_user.permission('HRD', :clerk)
    end

    def update_hrd_item?
        @current_user.permission('HRD', :clerk)
    end

     def edit_hrd_form?
        @current_user.permission('HRD', :clerk)
    end

    def new_hrd_item?
        @current_user.permission('HRD', :clerk)
    end

    def save_hrd_item?
        @current_user.permission('HRD', :clerk)
    end

    def remove_hrd_id?
        @current_user.permission('HRD', :clerk)
    end

    def download_hrd_items?
        @current_user.permission('HRD', :clerk)
    end

end


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.laegler.stubbr.lang</groupId>
		<artifactId>com.laegler.stubbr.lang.parent</artifactId>
		<version>1.0.0-SNAPSHOT</version>
	</parent>
	<artifactId>com.laegler.stubbr.lang.target</artifactId>
	<packaging>eclipse-target-definition</packaging>

	<dependencies>
	</dependencies>
</project>


text:
"""
Usage: xls2po <input.xlsx> <output.po>

Reads messages and translations from the first two columns of an xls/xlsx file
and creates or updates the specified Gettext translation file.

Options:

  -h --help
  --version

"""
from __future__ import print_function

import os
import sys
import xlpo
from docopt import docopt
from xlpo.readers.xlsx import XLSXTranslationsReader
from xlpo.writers.gettext import POFileTranslationsWriter

def execute(argv=None):
    arguments = docopt(__doc__, argv=argv, version=xlpo.__version__)
    input_file = arguments['<input.xlsx>']
    output_file = arguments['<output.po>']
    encoding = 'utf-8'
    discard = False
    metadata = None

    if not os.path.exists(input_file):
        print("File not found: {0}".format(input_file), file=sys.stderr)
        sys.exit(1)

    # TODO: autodetect xls/xlsx?
    if input_file.endswith('.xlsx'):
        reader = XLSXTranslationsReader(input_file)
    else:
        print("Unsupported input file format", file=sys.stderr)
        sys.exit(1)

    if output_file.endswith('.po'):
        try:
            writer = POFileTranslationsWriter(output_file, encoding=encoding)
        except Exception as e:
            print(e.message, file=sys.stderr)
            sys.exit(1)
    else:
        print("Unsupported output file format", file=sys.stderr)
        sys.exit(1)

    try:
        reader.read()
    except Exception as e:
        print(e.message, file=sys.stderr)
        sys.exit(1)

    try:
        writer.write(reader,
                     discard_existing_translations=discard,
                     metadata=metadata)
    except Exception as e:
        print(e.message, file=sys.stderr)
        sys.exit(1)

if __name__ == 'main':
    execute()


text:
@interface LZTopCommentModel : NSObject
@property (nonatomic, copy) NSString *content;
@property (nonatomic, assign) NSInteger like_count;
@property (nonatomic, copy) NSString *username;
@property (nonatomic, copy) NSString *header;
@property (nonatomic, copy) NSString *sex;
@property (nonatomic, assign) NSInteger voicetime;
@property (nonatomic, copy) NSString *voiceurl;

+ (instancetype)commentModelWithDic:(NSDictionary *)dict;

@end


text:
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
workspace_sid = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

client = Client(account_sid, auth_token)
events = client.taskrouter.workspaces(workspace_sid).events.list()

for event in events:
    print(event.event_type)


text:
<?php

namespace Qik\Core;

interface APIControllerInterface
{
	public static function Configure(APIServer $server);

	public function Init();
}


text:
package android.support.v4.app;

import java.util.ArrayList;

// Referenced classes of package android.support.v4.app:
//            NotificationCompat

public static class setBuilder extends setBuilder
{

    ArrayList mTexts;

    public setBuilder addLine(CharSequence charsequence)
    {
        mTexts.add(charsequence);
        return this;
    }

    public mTexts setBigContentTitle(CharSequence charsequence)
    {
        mBigContentTitle = charsequence;
        return this;
    }

    public mBigContentTitle setSummaryText(CharSequence charsequence)
    {
        mSummaryText = charsequence;
        mSummaryTextSet = true;
        return this;
    }

    public ()
    {
        mTexts = new ArrayList();
    }

    public mTexts(mTexts mtexts)
    {
        mTexts = new ArrayList();
        setBuilder(mtexts);
    }
}


text:
package hudson.security.csrf;

import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
import com.gargoylesoftware.htmlunit.WebResponse;
import com.gargoylesoftware.htmlunit.html.DomElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import hudson.model.FreeStyleProject;
import hudson.model.User;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.JenkinsRule.WebClient;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertEquals;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

/**
 *
 * @author dty
 */
//TODO merge back to DefaultCrumbIssuerTest
public class DefaultCrumbIssuerSEC1704Test {

    @Rule public JenkinsRule r = new JenkinsRule();

    @Before public void setIssuer() {
        r.jenkins.setCrumbIssuer(new DefaultCrumbIssuer(false));
    }

    @Test
    @Issue("SECURITY-1704")
    public void custom_notExposedToIFrame() throws Exception {
        ensureXmlIsNotExposedToIFrame("crumbIssuer/");
        ensureJsonIsNotExposedToIFrame("crumbIssuer/");
        ensurePythonIsNotExposedToIFrame("crumbIssuer/");
    }

    private void ensureXmlIsNotExposedToIFrame(String itemUrl) throws Exception {
        WebResponse response = r.createWebClient().goTo(itemUrl + "api/xml", "application/xml").getWebResponse();
        assertThat(response.getResponseHeaderValue("X-Frame-Options"), equalTo("deny"));
    }

    private void ensureJsonIsNotExposedToIFrame(String itemUrl) throws Exception {
        WebResponse response = r.createWebClient().goTo(itemUrl + "api/json", "application/json").getWebResponse();
        assertThat(response.getResponseHeaderValue("X-Frame-Options"), equalTo("deny"));
    }

    private void ensurePythonIsNotExposedToIFrame(String itemUrl) throws Exception {
        WebResponse response = r.createWebClient().goTo(itemUrl + "api/python", "text/x-python").getWebResponse();
        assertThat(response.getResponseHeaderValue("X-Frame-Options"), equalTo("deny"));
    }
}


text:
<?php

namespace PhpOffice\PhpPowerpoint\Shape\Table;

use PhpOffice\PhpPowerpoint\ComparableInterface;
use PhpOffice\PhpPowerpoint\Shape\RichText\Paragraph;
use PhpOffice\PhpPowerpoint\Shape\RichText\TextElementInterface;
use PhpOffice\PhpPowerpoint\Style\Borders;
use PhpOffice\PhpPowerpoint\Style\Fill;

/**
 * Table cell
 */
class Cell implements ComparableInterface
{
    /**
     * Rich text paragraphs
     *
     * @var \PhpOffice\PhpPowerpoint\Shape\RichText\Paragraph[]
     */
    private $richTextParagraphs;

    /**
     * Active paragraph
     *
     * @var int
     */
    private $activeParagraph = 0;

    /**
     * Fill
     *
     * @var \PhpOffice\PhpPowerpoint\Style\Fill
     */
    private $fill;

    /**
     * Borders
     *
     * @var \PhpOffice\PhpPowerpoint\Style\Borders
     */
    private $borders;

    /**
     * Width (in pixels)
     *
     * @var int
     */
    private $width = 0;

    /**
     * Colspan
     *
     * @var int
     */
    private $colSpan = 0;

    /**
     * Rowspan
     *
     * @var int
     */
    private $rowSpan = 0;

    /**
     * Hash index
     *
     * @var string
     */
    private $hashIndex;

    /**
     * Create a new \PhpOffice\PhpPowerpoint\Shape\RichText instance
     */
    public function __construct()
    {
        // Initialise variables
        $this->richTextParagraphs = array(
            new Paragraph()
        );
        $this->activeParagraph    = 0;

        // Set fill
        $this->fill = new Fill();

        // Set borders
        $this->borders = new Borders();
    }

    /**
     * Get active paragraph index
     *
     * @return int
     */
    public function getActiveParagraphIndex()
    {
        return $this->activeParagraph;
    }

    /**
     * Get active paragraph
     *
     * @return \PhpOffice\PhpPowerpoint\Shape\RichText\Paragraph
     */
    public function getActiveParagraph()
    {
        return $this->richTextParagraphs[$this->activeParagraph];
    }

    /**
     * Set active paragraph
     *
     * @param  int $index
     * @throws \Exception
     * @return \PhpOffice\PhpPowerpoint\Shape\RichText\Paragraph
     */
    public function setActiveParagraph($index = 0)
    {
        if ($index >= count($this->richTextParagraphs)) {
            throw new \Exception("Invalid paragraph count.");
        }

        $this->activeParagraph = $index;

        return $this->getActiveParagraph();
    }

    /**
     * Get paragraph
     *
     * @param  int $index
     * @throws \Exception
     * @return \PhpOffice\PhpPowerpoint\Shape\RichText\Paragraph
     */
    public function getParagraph($index = 0)
    {
        if ($index >= count($this->richTextParagraphs)) {
            throw new \Exception("Invalid paragraph count.");
        }

        return $this->richTextParagraphs[$index];
    }

    /**
     * Create paragraph
     *
     * @return \PhpOffice\PhpPowerpoint\Shape\RichText\Paragraph
     */
    public function createParagraph()
    {
        $alignment   = clone $this->getActiveParagraph()->getAlignment();
        $font        = clone $this->getActiveParagraph()->getFont();
        $bulletStyle = clone $this->getActiveParagraph()->getBulletStyle();

        $this->richTextParagraphs[] = new Paragraph();
        $this->activeParagraph      = count($this->richTextParagraphs) - 1;

        $this->getActiveParagraph()->setAlignment($alignment);
        $this->getActiveParagraph()->setFont($font);
        $this->getActiveParagraph()->setBulletStyle($bulletStyle);

        return $this->getActiveParagraph();
    }

    /**
     * Add text
     *
     * @param  \PhpOffice\PhpPowerpoint\Shape\RichText\TextElementInterface $pText Rich text element
     * @throws \Exception
     * @return \PhpOffice\PhpPowerpoint\Shape\RichText
     */
    public function addText(TextElementInterface $pText = null)
    {
        $this->richTextParagraphs[$this->activeParagraph]->addText($pText);

        return $this;
    }

    /**
     * Create text (can not be formatted !)
     *
     * @param  string                                   $pText Text
     * @return \PhpOffice\PhpPowerpoint\Shape\RichText\TextElement
     * @throws \Exception
     */
    public function createText($pText = '')
    {
        return $this->richTextParagraphs[$this->activeParagraph]->createText($pText);
    }

    /**
     * Create break
     *
     * @return \PhpOffice\PhpPowerpoint\Shape\RichText\BreakElement
     * @throws \Exception
     */
    public function createBreak()
    {
        return $this->richTextParagraphs[$this->activeParagraph]->createBreak();
    }

    /**
     * Create text run (can be formatted)
     *
     * @param  string                           $pText Text
     * @return \PhpOffice\PhpPowerpoint\Shape\RichText\Run
     * @throws \Exception
     */
    public function createTextRun($pText = '')
    {
        return $this->richTextParagraphs[$this->activeParagraph]->createTextRun($pText);
    }

    /**
     * Get plain text
     *
     * @return string
     */
    public function getPlainText()
    {
        // Return value
        $returnValue = '';

        // Loop trough all \PhpOffice\PhpPowerpoint\Shape\RichText\Paragraph
        foreach ($this->richTextParagraphs as $p) {
            $returnValue .= $p->getPlainText();
        }

        // Return
        return $returnValue;
    }

    /**
     * Convert to string
     *
     * @return string
     */
    public function __toString()
    {
        return $this->getPlainText();
    }

    /**
     * Get paragraphs
     *
     * @return \PhpOffice\PhpPowerpoint\Shape\RichText\Paragraph[]
     */
    public function getParagraphs()
    {
        return $this->richTextParagraphs;
    }

    /**
     * Set paragraphs
     *
     * @param  \PhpOffice\PhpPowerpoint\Shape\RichText\Paragraph[] $paragraphs Array of paragraphs
     * @throws \Exception
     * @return \PhpOffice\PhpPowerpoint\Shape\RichText
     */
    public function setParagraphs($paragraphs = null)
    {
        if (is_array($paragraphs)) {
            $this->richTextParagraphs = $paragraphs;
            $this->activeParagraph    = count($this->richTextParagraphs) - 1;
        } else {
            throw new \Exception("Invalid \PhpOffice\PhpPowerpoint\Shape\RichText\Paragraph[] array passed.");
        }

        return $this;
    }

    /**
     * Get fill
     *
     * @return \PhpOffice\PhpPowerpoint\Style\Fill
     */
    public function getFill()
    {
        return $this->fill;
    }

    /**
     * Set fill
     *
     * @param  \PhpOffice\PhpPowerpoint\Style\Fill     $fill
     * @return \PhpOffice\PhpPowerpoint\Shape\RichText
     */
    public function setFill(Fill $fill)
    {
        $this->fill = $fill;

        return $this;
    }

    /**
     * Get borders
     *
     * @return \PhpOffice\PhpPowerpoint\Style\Borders
     */
    public function getBorders()
    {
        return $this->borders;
    }

    /**
     * Set borders
     *
     * @param  \PhpOffice\PhpPowerpoint\Style\Borders  $borders
     * @return \PhpOffice\PhpPowerpoint\Shape\RichText
     */
    public function setBorders(Borders $borders)
    {
        $this->borders = $borders;

        return $this;
    }

    /**
     * Get width
     *
     * @return int
     */
    public function getWidth()
    {
        return $this->width;
    }

    /**
     * Set width
     *
     * @param  int                          $value
     * @return \PhpOffice\PhpPowerpoint\Shape\RichText
     */
    public function setWidth($value = 0)
    {
        $this->width = $value;

        return $this;
    }

    /**
     * Get colSpan
     *
     * @return int
     */
    public function getColSpan()
    {
        return $this->colSpan;
    }

    /**
     * Set colSpan
     *
     * @param  int                          $value
     * @return \PhpOffice\PhpPowerpoint\Shape\RichText
     */
    public function setColSpan($value = 0)
    {
        $this->colSpan = $value;

        return $this;
    }

    /**
     * Get rowSpan
     *
     * @return int
     */
    public function getRowSpan()
    {
        return $this->rowSpan;
    }

    /**
     * Set rowSpan
     *
     * @param  int                          $value
     * @return \PhpOffice\PhpPowerpoint\Shape\RichText
     */
    public function setRowSpan($value = 0)
    {
        $this->rowSpan = $value;

        return $this;
    }

    /**
     * Get hash code
     *
     * @return string Hash code
     */
    public function getHashCode()
    {
        $hashElements = '';
        foreach ($this->richTextParagraphs as $element) {
            $hashElements .= $element->getHashCode();
        }

        return md5($hashElements . $this->fill->getHashCode() . $this->borders->getHashCode() . $this->width . __CLASS__);
    }

    /**
     * Get hash index
     *
     * Note that this index may vary during script execution! Only reliable moment is
     * while doing a write of a workbook and when changes are not allowed.
     *
     * @return string Hash index
     */
    public function getHashIndex()
    {
        return $this->hashIndex;
    }

    /**
     * Set hash index
     *
     * Note that this index may vary during script execution! Only reliable moment is
     * while doing a write of a workbook and when changes are not allowed.
     *
     * @param string $value Hash index
     */
    public function setHashIndex($value)
    {
        $this->hashIndex = $value;
    }
}


text:
package info.armado.ausleihe.admin.transport.dataobjects

import javax.xml.bind.annotation.{XmlAccessType, XmlAccessorType, XmlRootElement}

@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
case class LendGameDTO(var barcode: String,
                       var lendTime: String) {
  def this() = this(null, null)
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="commonltr.css"/>
<title>Introducing Hue</title>

Introducing Hue

 Hue is a Web applications that enables you to easily interact with an Hadoop
			cluster. Hue applications let you browse HDFS, Jobs, run Hive, Pig and
			Cloudera Impala queries, manage the Hive Metastore, HBase, Sqoop, ZooKeeper, MapReduce jobs, and
			create and schedule worklows with Oozie.

 Checkout the latest updates and tutorials on http://gethue.com!

 Hue Architecture

 Hue applications run in a Web browser and require no client installation.

 The following figure illustrates how Hue works. Hue Server is a
				"container" web application that sits in between CDH and the browser. It hosts all
				the Hue web applications and communicates with CDH components.

 Starting Applications

 To open a Hue application, click the appropriate icon in the navigation
				bar at the top of the Hue web browser window.

To open a second application concurrently (or a second instance of the same
				application), right-click the icon and select Open
					link in new tab.

 Displaying Help for the Hue Applications

 To display the help text for a Hue application, click the Help (  ) tab in the Hue navigation bar,
				then click the appropriate link in the Help navigation bar at the top of the Help
				window.

 Logging In and Out

 To log out of Hue, click Sign Out from the pull-down list under the logged-in
				user name (at the right of the Hue navigation bar).

 Notice of Misconfiguration

 If Hue detects a misconfiguration, an indicator  appears in the navigation bar at the top of the page.
				Clicking this indicator takes you to the Check Configuration screen which will indicate the
				potential misconfiguration(s) with hints about fixing them.

 Changing Your Password

You can go directly to your own information by selecting <var class="keyword varname">username</var> > Profile at the right of the Hue navigation bar.

If authentication is managed by Hue (that is, authentication is
				not managed via some external mechanism), and you are a superuser, you can use the
					User Admin application to
				change password and personal details.

 Seeking Help, Reporting Bugs, and Providing Feedback

 The Hue team strongly values your feedback. The best way to contact us is to send
				email to hue-user@cloudera.org.

 If you're experiencing transient errors (typically an error message saying a service
				is down), contact your system administrator first.


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Folia cryptog. Estonica 33: 119 (1998)

#### Original name
Polyporus stuckertianus Speg.

### Remarks
null


text:
<?php

namespace Rvdv\Nntp\Tests\Command;

use Rvdv\Nntp\Command\AuthInfoCommand;
use Rvdv\Nntp\Response\Response;

/**
 * AuthInfoCommandTest.
 *
 * @author Robin van der Vleuten <robinvdvleuten@gmail.com>
 */
class AuthInfoCommandTest extends CommandTest
{
    public function testItNotExpectsMultilineResponses()
    {
        $command = $this->createCommandInstance();
        $this->assertFalse($command->isMultiLine());
    }

    public function testItNotExpectsCompressedResponses()
    {
        $command = $this->createCommandInstance();
        $this->assertFalse($command->isCompressed());
    }

    public function testItNotHasDefaultResult()
    {
        $command = $this->createCommandInstance();
        $this->assertNull($command->getResult());
    }

    public function testItReturnsStringWhenExecuting()
    {
        $command = $this->createCommandInstance(AuthInfoCommand::AUTHINFO_USER, 'user');
        $this->assertEquals('AUTHINFO USER user', $command->execute());

        $command = $this->createCommandInstance(AuthInfoCommand::AUTHINFO_PASS, 'pass');
        $this->assertEquals('AUTHINFO PASS pass', $command->execute());
    }

    public function testItNotReceivesAResultWhenAuthenticatedAcceptedResponse()
    {
        $command = $this->createCommandInstance();

        $response = $this->getMockBuilder('Rvdv\Nntp\Response\Response')
            ->disableOriginalConstructor()
            ->getMock();

        $command->onAuthenticationAccepted($response);

        $this->assertNull($command->getResult());
    }

    public function testItNotReceivesAResultWhenPasswordRequiredResponse()
    {
        $command = $this->createCommandInstance();

        $response = $this->getMockBuilder('Rvdv\Nntp\Response\Response')
            ->disableOriginalConstructor()
            ->getMock();

        $command->onPasswordRequired($response);

        $this->assertNull($command->getResult());
    }

    public function testItErrorsWhenAuthenticationRejectedResponse()
    {
        $command = $this->createCommandInstance();

        $response = $this->getMockBuilder('Rvdv\Nntp\Response\Response')
            ->disableOriginalConstructor()
            ->getMock();

        try {
            $command->onAuthenticationRejected($response);
            $this->fail('->onAuthenticationRejected() throws a Rvdv\Nntp\Exception\RuntimeException because the authentication is rejected');
        } catch (\Exception $e) {
            $this->assertInstanceof('Rvdv\Nntp\Exception\RuntimeException', $e, '->onAuthenticationRejected() throws a Rvdv\Nntp\Exception\RuntimeException because the authentication is rejected');
        }
    }

    public function testItErrorsWhenAuthenticationOutOfSequenceResponse()
    {
        $command = $this->createCommandInstance();

        $response = $this->getMockBuilder('Rvdv\Nntp\Response\Response')
            ->disableOriginalConstructor()
            ->getMock();

        try {
            $command->onAuthenticationOutOfSequence($response);
            $this->fail('->onAuthenticationOutOfSequence() throws a Rvdv\Nntp\Exception\RuntimeException because the authentication is out of sequence');
        } catch (\Exception $e) {
            $this->assertInstanceof('Rvdv\Nntp\Exception\RuntimeException', $e, '->onAuthenticationOutOfSequence() throws a Rvdv\Nntp\Exception\RuntimeException because the authentication is out of sequence');
        }
    }

    /**
     * {@inheritdoc}
     */
    protected function createCommandInstance()
    {
        $args = func_get_args();
        if (empty($args)) {
            $args = [AuthInfoCommand::AUTHINFO_USER, 'user'];
        }

        return new AuthInfoCommand($args[0], $args[1]);
    }

    /**
     * {@inheritdoc}
     */
    protected function getRFCResponseCodes()
    {
        return [
            Response::AUTHENTICATION_ACCEPTED,
            Response::PASSWORD_REQUIRED,
            Response::AUTHENTICATION_REJECTED,
            Response::AUTHENTICATION_OUTOFSEQUENCE,
        ];
    }
}


text:
<?php

namespace Sylius\Component\Core\OrderProcessing;

use Sylius\Component\Core\Model\OrderInterface;
use Sylius\Component\Core\Model\OrderShippingStates;
use Sylius\Component\Core\Model\PaymentInterface;
use Sylius\Component\Core\Model\ShipmentInterface;

/**
 * Order state resolver.
 *
 * @author Paweł Jędrzejewski <pawel@sylius.org>
 */
class StateResolver implements StateResolverInterface
{
    /**
     * {@inheritdoc}
     */
    public function resolvePaymentState(OrderInterface $order)
    {
        $paymentState = PaymentInterface::STATE_NEW;

        if ($order->hasPayments()) {
            $payments = $order->getPayments();
            $completedPaymentTotal = 0;

            foreach ($payments as $payment) {
                if (PaymentInterface::STATE_COMPLETED === $payment->getState()) {
                    $completedPaymentTotal += $payment->getAmount();
                }
            }

            if ($completedPaymentTotal === $order->getTotal()) {
                // Payment is completed if we have received full amount.
                $paymentState = PaymentInterface::STATE_COMPLETED;
            } else {
                // Payment is processing if one of the payment is.
                if ($payments->exists(function ($key, $payment) {
                    return in_array($payment->getState(), array(
                        PaymentInterface::STATE_COMPLETED,
                        PaymentInterface::STATE_PROCESSING,
                        PaymentInterface::STATE_PENDING,
                    ));
                })) {
                    $paymentState = PaymentInterface::STATE_PROCESSING;
                }
            }
        }

        $order->setPaymentState($paymentState);
    }

    /**
     * {@inheritdoc}
     */
    public function resolveShippingState(OrderInterface $order)
    {
        if ($order->isBackorder()) {
            $order->setShippingState(OrderShippingStates::BACKORDER);

            return;
        }

        $order->setShippingState($this->getShippingState($order));
    }

    protected function getShippingState(OrderInterface $order)
    {
        $states = array();

        foreach ($order->getShipments() as $shipment) {
            $states[] = $shipment->getState();
        }

        $states = array_unique($states);

        $acceptableStates = array(
            ShipmentInterface::STATE_CHECKOUT   => OrderShippingStates::CHECKOUT,
            ShipmentInterface::STATE_ONHOLD     => OrderShippingStates::ONHOLD,
            ShipmentInterface::STATE_READY      => OrderShippingStates::READY,
            ShipmentInterface::STATE_SHIPPED    => OrderShippingStates::SHIPPED,
            ShipmentInterface::STATE_RETURNED   => OrderShippingStates::RETURNED,
            ShipmentInterface::STATE_CANCELLED  => OrderShippingStates::CANCELLED,
        );

        foreach ($acceptableStates as $shipmentState => $orderState) {
            if (array($shipmentState) == $states) {
                return $orderState;
            }
        }

        return OrderShippingStates::PARTIALLY_SHIPPED;
    }
}


text:
//
//  UILabel+RZColorful.h
//  RZColorfulExample
//
//  Created by 若醉 on 2018/7/6.
//  Copyright © 2018年 rztime. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "RZColorfulConferrer.h"

NS_ASSUME_NONNULL_BEGIN

@interface UILabel (RZColorful)

/**
 仅UILabel、UITextField、UITextView 使用有效 设置富文本,原内容将清除

 @param attribute block description
 */
- (void )rz_colorfulConfer:(void(^)( RZColorfulConferrer * _Nonnull  confer))attribute;

/**
 仅UILabel、UITextField、UITextView 使用有效 追加新的富文本,原内容仍在

 @param attribute block description
 */
- (void )rz_colorfulConferAppend:(void (^)(RZColorfulConferrer * _Nonnull confer))attribute RZWARNING("请使用rz_colorfulConferInsetTo: append:方法");

/**
 仅UILabel、UITextField、UITextView 使用有效  插入文本到头、尾、光标位置

 @param position 插入的位置
 @param attribute 新的内容
 */
- (void )rz_colorfulConferInsetTo:(rzConferInsertPosition)position append:(void (^)(RZColorfulConferrer * _Nonnull confer))attribute;

/**
 仅UILabel、UITextField、UITextView 使用有效  添加到指定位置

 @param location 位置
 @param attribute  attribute
 */
- (void )rz_colorfulConferInsetToLocation:(NSUInteger)location append:(void (^)(RZColorfulConferrer * _Nonnull confer))attribute;

/// 设置富文本(超过行数后,自动追加"展开" "收起")
/// @param attr 原文
/// @param line 最大显示行数
/// @param width 最大显示宽度,这个宽度用于计算文本行
/// @param fold 当前是否折叠
/// @param allText 超过了行数之后,折叠状态显示的文本 如"展开"  需要给文本设置NSTapActionByLabel属性  (tapActionByLable)
/// @param foldText 超过行数之后,全部展开状态显示的文本  如"收起"  需要给文本设置NSTapActionByLabel属性 (tapActionByLable)
- (void)rz_setAttributedString:(NSAttributedString * _Nullable)attr maxLine:(NSInteger)line maxWidth:(CGFloat)width isFold:(BOOL)fold showAllText:(NSAttributedString *_Nullable)allText showFoldText:(NSAttributedString *_Nullable)foldText;

typedef void(^RZLabelTapAction)(UILabel *_Nonnull label, NSString * _Nonnull tapActionId, NSRange range);
/// 给label的富文本添加文本点击事件
/// @param tapAction ,tapActionId 即tapActionByLable里的内容
- (void)rz_tapAction:(RZLabelTapAction _Nullable)tapAction;
@end
NS_ASSUME_NONNULL_END


text:
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/browser/first_party_sets/first_party_sets_handler_database_helper.h"

#include <string>

#include "base/files/scoped_temp_dir.h"
#include "base/test/task_environment.h"
#include "base/version.h"
#include "net/base/schemeful_site.h"
#include "net/first_party_sets/first_party_set_entry.h"
#include "net/first_party_sets/first_party_sets_cache_filter.h"
#include "net/first_party_sets/first_party_sets_context_config.h"
#include "net/first_party_sets/global_first_party_sets.h"
#include "testing/gmock/include/gmock/gmock-matchers.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "url/gurl.h"

using ::testing::Eq;
using ::testing::IsEmpty;
using ::testing::Optional;
using ::testing::Pair;
using ::testing::UnorderedElementsAre;

namespace content {
namespace {
const base::Version kVersion("1.2.3");
}  // namespace

TEST(FirstPartySetsHandlerDatabaseHelper, ComputeSetsDiff_SitesJoined) {
  net::SchemefulSite example(GURL("https://example.test"));
  net::SchemefulSite foo(GURL("https://foo.test"));
  net::SchemefulSite member1(GURL("https://member1.test"));
  net::SchemefulSite member2(GURL("https://member2.test"));
  net::SchemefulSite member3(GURL("https://member3.test"));

  net::GlobalFirstPartySets old_sets(
      kVersion,
      /*entries=*/
      {{example, net::FirstPartySetEntry(example, net::SiteType::kPrimary,
                                         absl::nullopt)},
       {member1,
        net::FirstPartySetEntry(example, net::SiteType::kAssociated, 0)},
       {member3,
        net::FirstPartySetEntry(example, net::SiteType::kAssociated, 1)}},
      /*aliases=*/{});

  net::GlobalFirstPartySets current_sets(
      kVersion,
      /*entries=*/
      {
          {example, net::FirstPartySetEntry(example, net::SiteType::kPrimary,
                                            absl::nullopt)},
          {member1,
           net::FirstPartySetEntry(example, net::SiteType::kAssociated, 0)},
          {member3,
           net::FirstPartySetEntry(example, net::SiteType::kAssociated, 1)},
          {foo, net::FirstPartySetEntry(foo, net::SiteType::kPrimary,
                                        absl::nullopt)},
          {member2,
           net::FirstPartySetEntry(foo, net::SiteType::kAssociated, 0)},
      },
      /*aliases=*/{});

  // "https://foo.test" and "https://member2.test" joined FPSs. We don't clear
  // site data upon joining, so the computed diff should be empty set.
  EXPECT_THAT(
      FirstPartySetsHandlerDatabaseHelper::ComputeSetsDiff(
          old_sets, /*old_config=*/net::FirstPartySetsContextConfig(),
          current_sets, /*current_config=*/net::FirstPartySetsContextConfig()),
      IsEmpty());
}

TEST(FirstPartySetsHandlerDatabaseHelper, ComputeSetsDiff_SitesLeft) {
  net::SchemefulSite example(GURL("https://example.test"));
  net::SchemefulSite foo(GURL("https://foo.test"));
  net::SchemefulSite member1(GURL("https://member1.test"));
  net::SchemefulSite member2(GURL("https://member2.test"));
  net::SchemefulSite member3(GURL("https://member3.test"));

  net::GlobalFirstPartySets old_sets(
      kVersion,
      /*entries=*/
      {{example, net::FirstPartySetEntry(example, net::SiteType::kPrimary,
                                         absl::nullopt)},
       {member1,
        net::FirstPartySetEntry(example, net::SiteType::kAssociated, 0)},
       {member3,
        net::FirstPartySetEntry(example, net::SiteType::kAssociated, 1)},
       {foo,
        net::FirstPartySetEntry(foo, net::SiteType::kPrimary, absl::nullopt)},
       {member2, net::FirstPartySetEntry(foo, net::SiteType::kAssociated, 0)}},
      /*aliases=*/{});

  net::GlobalFirstPartySets current_sets(
      kVersion,
      /*entries=*/
      {{example, net::FirstPartySetEntry(example, net::SiteType::kPrimary,
                                         absl::nullopt)},
       {member1,
        net::FirstPartySetEntry(example, net::SiteType::kAssociated, 0)}},
      /*aliases=*/{});

  // Expected diff: "https://foo.test", "https://member2.test" and
  // "https://member3.test" left FPSs.
  EXPECT_THAT(
      FirstPartySetsHandlerDatabaseHelper::ComputeSetsDiff(
          old_sets, /*old_config=*/net::FirstPartySetsContextConfig(),
          current_sets, /*current_config=*/net::FirstPartySetsContextConfig()),
      UnorderedElementsAre(foo, member2, member3));
}

TEST(FirstPartySetsHandlerDatabaseHelper, ComputeSetsDiff_OwnerChanged) {
  net::SchemefulSite example(GURL("https://example.test"));
  net::SchemefulSite foo(GURL("https://foo.test"));
  net::SchemefulSite member1(GURL("https://member1.test"));
  net::SchemefulSite member2(GURL("https://member2.test"));
  net::SchemefulSite member3(GURL("https://member3.test"));

  net::GlobalFirstPartySets old_sets(
      kVersion,
      /*entries=*/
      {{example, net::FirstPartySetEntry(example, net::SiteType::kPrimary,
                                         absl::nullopt)},
       {member1,
        net::FirstPartySetEntry(example, net::SiteType::kAssociated, 0)},
       {foo,
        net::FirstPartySetEntry(foo, net::SiteType::kPrimary, absl::nullopt)},
       {member2, net::FirstPartySetEntry(foo, net::SiteType::kAssociated, 0)},
       {member3, net::FirstPartySetEntry(foo, net::SiteType::kAssociated, 1)}},
      /*aliases=*/{});

  net::GlobalFirstPartySets current_sets(
      kVersion,
      /*entries=*/
      {{example, net::FirstPartySetEntry(example, net::SiteType::kPrimary,
                                         absl::nullopt)},
       {member1,
        net::FirstPartySetEntry(example, net::SiteType::kAssociated, 0)},
       {member3,
        net::FirstPartySetEntry(example, net::SiteType::kAssociated, 1)},
       {foo,
        net::FirstPartySetEntry(foo, net::SiteType::kPrimary, absl::nullopt)},
       {member2, net::FirstPartySetEntry(foo, net::SiteType::kAssociated, 0)}},
      /*aliases=*/{});

  // Expected diff: "https://member3.test" changed owner.
  EXPECT_THAT(
      FirstPartySetsHandlerDatabaseHelper::ComputeSetsDiff(
          old_sets, /*old_config=*/net::FirstPartySetsContextConfig(),
          current_sets, /*current_config=*/net::FirstPartySetsContextConfig()),
      UnorderedElementsAre(member3));
}

TEST(FirstPartySetsHandlerDatabaseHelper, ComputeSetsDiff_OwnerLeft) {
  net::SchemefulSite example(GURL("https://example.test"));
  net::SchemefulSite foo(GURL("https://foo.test"));
  net::SchemefulSite bar(GURL("https://bar.test"));

  net::GlobalFirstPartySets old_sets(
      kVersion,
      /*entries=*/
      {{example, net::FirstPartySetEntry(example, net::SiteType::kPrimary,
                                         absl::nullopt)},
       {foo, net::FirstPartySetEntry(example, net::SiteType::kAssociated, 0)},
       {bar, net::FirstPartySetEntry(example, net::SiteType::kAssociated, 1)}},
      /*aliases=*/{});

  net::GlobalFirstPartySets current_sets(
      kVersion,
      /*entries=*/
      {{foo,
        net::FirstPartySetEntry(foo, net::SiteType::kPrimary, absl::nullopt)},
       {bar, net::FirstPartySetEntry(foo, net::SiteType::kAssociated, 0)}},
      /*aliases=*/{});

  // Expected diff: "https://example.test" left FPSs, "https://foo.test" and
  // "https://bar.test" changed owner.
  // It would be valid to only have example.test in the diff, but our logic
  // isn't sophisticated enough yet to know that foo.test and bar.test don't
  // need to be included in the result.
  EXPECT_THAT(
      FirstPartySetsHandlerDatabaseHelper::ComputeSetsDiff(
          old_sets, /*old_config=*/net::FirstPartySetsContextConfig(),
          current_sets, /*current_config=*/net::FirstPartySetsContextConfig()),
      UnorderedElementsAre(example, foo, bar));
}

TEST(FirstPartySetsHandlerDatabaseHelper, ComputeSetsDiff_OwnerMemberRotate) {
  net::SchemefulSite example(GURL("https://example.test"));
  net::SchemefulSite foo(GURL("https://foo.test"));

  net::GlobalFirstPartySets old_sets(
      kVersion,
      /*entries=*/
      {{example, net::FirstPartySetEntry(example, net::SiteType::kPrimary,
                                         absl::nullopt)},
       {foo, net::FirstPartySetEntry(example, net::SiteType::kAssociated, 0)}},
      /*aliases=*/{});

  net::GlobalFirstPartySets current_sets(
      kVersion,
      /*entries=*/
      {{example, net::FirstPartySetEntry(foo, net::SiteType::kAssociated, 0)},
       {foo,
        net::FirstPartySetEntry(foo, net::SiteType::kPrimary, absl::nullopt)}},
      /*aliases=*/{});

  // Expected diff: "https://example.test" and "https://foo.test" changed owner.
  // It would be valid to not include example.test and foo.test in the result,
  // but our logic isn't sophisticated enough yet to know that.ß
  EXPECT_THAT(
      FirstPartySetsHandlerDatabaseHelper::ComputeSetsDiff(
          old_sets, /*old_config=*/net::FirstPartySetsContextConfig(),
          current_sets, /*current_config=*/net::FirstPartySetsContextConfig()),
      UnorderedElementsAre(example, foo));
}

TEST(FirstPartySetsHandlerDatabaseHelper, ComputeSetsDiff_EmptyOldSets) {
  net::SchemefulSite example(GURL("https://example.test"));
  net::SchemefulSite member1(GURL("https://member1.test"));

  // Empty old_sets.
  net::GlobalFirstPartySets current_sets(
      kVersion,
      /*entries=*/
      {{example, net::FirstPartySetEntry(example, net::SiteType::kPrimary,
                                         absl::nullopt)},
       {member1,
        net::FirstPartySetEntry(example, net::SiteType::kAssociated, 0)}},
      /*aliases=*/{});

  EXPECT_THAT(
      FirstPartySetsHandlerDatabaseHelper::ComputeSetsDiff(
          /*old_sets=*/net::GlobalFirstPartySets(),
          /*old_config=*/net::FirstPartySetsContextConfig(), current_sets,
          /*current_config=*/net::FirstPartySetsContextConfig()),
      IsEmpty());
}

TEST(FirstPartySetsHandlerDatabaseHelper, ComputeSetsDiff_EmptyCurrentSets) {
  net::SchemefulSite example(GURL("https://example.test"));
  net::SchemefulSite member1(GURL("https://member1.test"));

  // Empty current sets.
  net::GlobalFirstPartySets old_sets(
      kVersion,
      /*entries=*/
      {{example, net::FirstPartySetEntry(example, net::SiteType::kPrimary,
                                         absl::nullopt)},
       {member1,
        net::FirstPartySetEntry(example, net::SiteType::kAssociated, 0)}},
      /*aliases=*/{});

  EXPECT_THAT(FirstPartySetsHandlerDatabaseHelper::ComputeSetsDiff(
                  old_sets, /*old_config=*/net::FirstPartySetsContextConfig(),
                  /*current_sets=*/net::GlobalFirstPartySets(),
                  /*current_config=*/net::FirstPartySetsContextConfig()),
              IsEmpty());
}

TEST(FirstPartySetsHandlerDatabaseHelper, ComputeSetsDiff_PolicySitesJoined) {
  net::SchemefulSite foo(GURL("https://foo.test"));
  net::SchemefulSite member2(GURL("https://member2.test"));

  net::FirstPartySetsContextConfig current_config({
      {foo,
       {net::FirstPartySetEntry(foo, net::SiteType::kPrimary, absl::nullopt)}},
      {member2, {net::FirstPartySetEntry(foo, net::SiteType::kAssociated, 0)}},
  });

  // "https://example.test" and "https://member2.test" joined FPSs via
  // enterprise policy. We don't clear site data upon joining, so the computed
  // diff should be empty.
  EXPECT_THAT(FirstPartySetsHandlerDatabaseHelper::ComputeSetsDiff(
                  /*old_sets=*/net::GlobalFirstPartySets(),
                  /*old_config=*/current_config,
                  /*current_sets=*/net::GlobalFirstPartySets(), current_config),
              IsEmpty());
}

TEST(FirstPartySetsHandlerDatabaseHelper,
     ComputeSetsDiff_PolicyRemovedSitesJoined) {
  net::SchemefulSite example(GURL("https://example.test"));
  net::SchemefulSite foo(GURL("https://foo.test"));
  net::SchemefulSite member1(GURL("https://member1.test"));

  net::GlobalFirstPartySets sets(
      kVersion,
      /*entries=*/
      {{example, net::FirstPartySetEntry(example, net::SiteType::kPrimary,
                                         absl::nullopt)},
       {member1,
        net::FirstPartySetEntry(example, net::SiteType::kAssociated, 0)}},
      /*aliases=*/{});

  // "https://example.test" was removed from FPSs by policy modifications.
  net::FirstPartySetsContextConfig old_config({
      {foo,
       {net::FirstPartySetEntry(foo, net::SiteType::kPrimary, absl::nullopt)}},
      {member1, {net::FirstPartySetEntry(foo, net::SiteType::kAssociated, 0)}},
      {example, absl::nullopt},
  });

  // "https://example.test" added back to FPSs.
  net::FirstPartySetsContextConfig current_config({
      {foo,
       {net::FirstPartySetEntry(foo, net::SiteType::kPrimary, absl::nullopt)}},
      {member1, {net::FirstPartySetEntry(foo, net::SiteType::kAssociated, 0)}},
      {example, {net::FirstPartySetEntry(foo, net::SiteType::kAssociated, 0)}},
  });

  // We don't clear site data upon joining, so the computed diff should be
  // empty.
  EXPECT_THAT(
      FirstPartySetsHandlerDatabaseHelper::ComputeSetsDiff(
          /*old_sets=*/sets, old_config, /*current_sets=*/sets, current_config),
      IsEmpty());
}

TEST(FirstPartySetsHandlerDatabaseHelper, ComputeSetsDiff_PolicyMemberLeft) {
  net::SchemefulSite foo(GURL("https://foo.test"));
  net::SchemefulSite member1(GURL("https://member1.test"));
  net::SchemefulSite member2(GURL("https://member2.test"));

  net::FirstPartySetsContextConfig old_config({
      {foo,
       {net::FirstPartySetEntry(foo, net::SiteType::kPrimary, absl::nullopt)}},
      {member1, {net::FirstPartySetEntry(foo, net::SiteType::kAssociated, 0)}},
      {member2, {net::FirstPartySetEntry(foo, net::SiteType::kAssociated, 0)}},
  });

  // "https://member2.test" left FPSs via enterprise policy.
  net::FirstPartySetsContextConfig current_config({
      {foo,
       {net::FirstPartySetEntry(foo, net::SiteType::kPrimary, absl::nullopt)}},
      {member1, {net::FirstPartySetEntry(foo, net::SiteType::kAssociated, 0)}},
  });

  EXPECT_THAT(FirstPartySetsHandlerDatabaseHelper::ComputeSetsDiff(
                  /*old_sets=*/net::GlobalFirstPartySets(), old_config,
                  /*current_sets=*/net::GlobalFirstPartySets(), current_config),
              UnorderedElementsAre(member2));
}

TEST(FirstPartySetsHandlerDatabaseHelper, ComputeSetsDiff_PolicyOwnerLeft) {
  net::SchemefulSite example(GURL("https://example.test"));
  net::SchemefulSite member1(GURL("https://member1.test"));
  net::SchemefulSite member2(GURL("https://member2.test"));

  net::FirstPartySetsContextConfig old_config({
      {example,
       {net::FirstPartySetEntry(example, net::SiteType::kPrimary,
                                absl::nullopt)}},
      {member1,
       {net::FirstPartySetEntry(example, net::SiteType::kAssociated, 0)}},
      {member2,
       {net::FirstPartySetEntry(example, net::SiteType::kAssociated, 0)}},
  });

  net::FirstPartySetsContextConfig current_config({
      {member1,
       {net::FirstPartySetEntry(member1, net::SiteType::kPrimary,
                                absl::nullopt)}},
      {member2,
       {net::FirstPartySetEntry(member1, net::SiteType::kAssociated, 0)}},
  });

  // Expected diff: "https://example.test" left FPSs, "https://member1.test" and
  // "https://member2.test" changed owner.
  // It would be valid to only have example.test in the diff, but our logic
  // isn't sophisticated enough yet to know that member1.test and member2.test
  // don't need to be included in the result.
  EXPECT_THAT(
      FirstPartySetsHandlerDatabaseHelper::ComputeSetsDiff(
          /*old_sets=*/net::GlobalFirstPartySets(), /*old_config=*/old_config,
          /*current_sets=*/net::GlobalFirstPartySets(), current_config),
      UnorderedElementsAre(example, member1, member2));
}

TEST(FirstPartySetsHandlerDatabaseHelper,
     ComputeSetsDiff_PolicyMembersChangeSet) {
  net::SchemefulSite foo(GURL("https://foo.test"));
  net::SchemefulSite bar(GURL("https://bar.test"));
  net::SchemefulSite member1(GURL("https://member1.test"));
  net::SchemefulSite member2(GURL("https://member2.test"));

  net::FirstPartySetsContextConfig old_config({
      {foo,
       {net::FirstPartySetEntry(foo, net::SiteType::kPrimary, absl::nullopt)}},
      {member1, {net::FirstPartySetEntry(foo, net::SiteType::kAssociated, 0)}},
      {bar,
       {net::FirstPartySetEntry(bar, net::SiteType::kPrimary, absl::nullopt)}},
      {member2, {net::FirstPartySetEntry(bar, net::SiteType::kAssociated, 0)}},
  });

  net::FirstPartySetsContextConfig current_config({
      {foo,
       {net::FirstPartySetEntry(foo, net::SiteType::kPrimary, absl::nullopt)}},
      {member2, {net::FirstPartySetEntry(foo, net::SiteType::kAssociated, 0)}},
      {bar,
       {net::FirstPartySetEntry(bar, net::SiteType::kPrimary, absl::nullopt)}},
      {member1, {net::FirstPartySetEntry(bar, net::SiteType::kAssociated, 0)}},
  });

  EXPECT_THAT(FirstPartySetsHandlerDatabaseHelper::ComputeSetsDiff(
                  /*old_sets=*/net::GlobalFirstPartySets(), old_config,
                  /*current_sets=*/net::GlobalFirstPartySets(), current_config),
              UnorderedElementsAre(member1, member2));
}

class FirstPartySetsHandlerDatabaseHelperTest : public testing::Test {
 public:
  FirstPartySetsHandlerDatabaseHelperTest() {
    EXPECT_TRUE(dir_.CreateUniqueTempDir());
    db_helper_ = std::make_unique<FirstPartySetsHandlerDatabaseHelper>(
        dir_.GetPath().AppendASCII("TestFirstPartySets.db"));
  }

 protected:
  base::ScopedTempDir dir_;
  base::test::TaskEnvironment env_;

  std::unique_ptr<FirstPartySetsHandlerDatabaseHelper> db_helper_;
};

TEST_F(FirstPartySetsHandlerDatabaseHelperTest,
       UpdateAndGetSitesToClearForContext) {
  net::SchemefulSite example(GURL("https://example.test"));
  net::SchemefulSite foo(GURL("https://foo.test"));
  net::SchemefulSite member1(GURL("https://member1.test"));
  net::SchemefulSite member2(GURL("https://member2.test"));
  net::SchemefulSite member3(GURL("https://member3.test"));
  const std::string browser_context_id("b");

  db_helper_->PersistSets(
      browser_context_id,
      net::GlobalFirstPartySets(
          base::Version("0.0.1"),
          /*entries=*/
          {{example, net::FirstPartySetEntry(example, net::SiteType::kPrimary,
                                             absl::nullopt)},
           {member1,
            net::FirstPartySetEntry(example, net::SiteType::kAssociated, 0)},
           {member3,
            net::FirstPartySetEntry(example, net::SiteType::kAssociated, 1)},
           {foo, net::FirstPartySetEntry(foo, net::SiteType::kPrimary,
                                         absl::nullopt)},
           {member2,
            net::FirstPartySetEntry(foo, net::SiteType::kAssociated, 0)}},
          /*aliases=*/{}),
      /*config=*/net::FirstPartySetsContextConfig());

  net::GlobalFirstPartySets current_sets(
      kVersion,
      /*entries=*/
      {{example, net::FirstPartySetEntry(example, net::SiteType::kPrimary,
                                         absl::nullopt)},
       {member1,
        net::FirstPartySetEntry(example, net::SiteType::kAssociated, 0)}},
      /*aliases=*/{});

  std::pair<std::vector<net::SchemefulSite>, net::FirstPartySetsCacheFilter>
      res = db_helper_->UpdateAndGetSitesToClearForContext(
          browser_context_id, current_sets,
          /*current_config=*/net::FirstPartySetsContextConfig());

  // Expected diff: "https://foo.test", "https://member2.test" and
  // "https://member3.test" left FPSs.
  EXPECT_THAT(res.first, UnorderedElementsAre(foo, member2, member3));
  EXPECT_EQ(res.second, net::FirstPartySetsCacheFilter(
                            /*filter=*/{{foo, 1}, {member2, 1}, {member3, 1}},
                            /*browser_run_id=*/1));
}

}  // namespace content


text:
import Vue from 'vue'
import Api from '../utils/api'
import { log } from '../utils/shortcuts'

export const USER_REGISTER = 'USER_REGISTER' // 注册成功
export const USER_SIGNIN = 'USER_SIGNIN' // 登录成功
export const USER_SIGNOUT = 'USER_SIGNOUT' // 退出登录
let loginApi = Api.login
let registerApi = Api.register

let accesslocalStorage = items => {
  let states = {}
  items.forEach(item => {
    states[item] = JSON.parse(localStorage.getItem(item)) || {}
  })
  return states
}

let setlocalStorage = items => {
  for (let item in items) {
    localStorage.setItem(item, JSON.stringify(items[item]))
  }
}

let deelExpTime = exp => {
  exp = Date.now() + 3600 * 1000
  return exp
}

export default {

  state: accesslocalStorage(Object.keys(loginApi.response.data)),
  mutations: {
    [USER_SIGNIN] (state, user) {
      Object.assign(state, user)
    },
    [USER_SIGNOUT] (state, user) {
      // localStorage.removeItem('user')
      // Object.keys(state).forEach(k => Vue.delete(state, k))
      Object.assign(state, user)
    }
  },
  actions: {
    [USER_SIGNIN] ({
      commit
    }, user) {
      let post = Vue.http.post(loginApi.url, user).then(success => {
        let data = success.data.data
        data.exp = deelExpTime(data.exp)
        setlocalStorage(data)
        commit(USER_SIGNIN, data)
      }, failed => {
        commit(USER_SIGNIN, loginApi.response.data)
        throw new Error('请求失败,请检查API接口或者网络状态')
      })
      return post
    },

    [USER_SIGNOUT] ({
      commit
    }) {
      let data = loginApi.response.data
      setlocalStorage(data)
      commit(USER_SIGNOUT, data)
      return Promise.resolve()
    },
    [USER_REGISTER] ({
      commit
    }, user) {
      Vue.http.post(registerApi.url, registerApi.request).then(success => {
        log.log('ty') // TODO: 用promise返回状态
        // alert('注册成功!')
      })
    }
  }
}


text:
/**
 *
 */
package com.hotf.client.action.result;

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

import net.customware.gwt.dispatch.shared.Result;

/**
 * @author Jeff
 *
 */
public class PlacesResult implements Result {

	private List<PlaceResult> locations = new ArrayList<PlaceResult>();

	public PlacesResult() {
		super();
	}

	public List<PlaceResult> getPlaces() {
		return locations;
	}

}