text:
<?php

namespace OpCacheGUI\OpCache;

use OpCacheGUI\Format\Byte;
use OpCacheGUI\I18n\Translator;
use OpCacheGUI\Format\Trimmer;

/**
 * Container for the current status of OpCache
 *
 * @category   OpCacheGUI
 * @package    OpCache
 * @author     Pieter Hordijk <info@pieterhordijk.com>
 */
class Status
{
    /**
     * @var string The colors of the graphs
     */
    const DARK_GREEN = '#16a085';
    const RED        = '#e74c3c';
    const GREEN      = '#2ecc71';

    /**
     * @var \OpCacheGUI\Format\Byte Formatter of byte values
     */
    private $byteFormatter;

    /**
     * @var \OpCacheGUI\I18n\Translator A translator
     */
    private $translator;

    /**
     * @var array The (unfiltered) output of opcache_get_status()
     */
    private $statusData;

    /**
     * Creates instance
     *
     * @param \OpCacheGUI\Format\Byte     $byteFormatter Formatter of byte values
     * @param \OpCacheGUI\I18n\Translator $translator    A translator
     * @param array                       $statusData    The (unfiltered) output of opcache_get_status()
     */
    public function __construct(Byte $byteFormatter, Translator $translator, array $statusData)
    {
        $this->byteFormatter = $byteFormatter;
        $this->translator    = $translator;
        $this->statusData    = $statusData;
    }

    /**
     * Gets the status info of OpCache
     *
     * @return array The status info
     */
    public function getStatusInfo()
    {
        return [
            'opcache_enabled'     => $this->statusData['opcache_enabled'],
            'cache_full'          => $this->statusData['cache_full'],
            'restart_pending'     => $this->statusData['restart_pending'],
            'restart_in_progress' => $this->statusData['restart_in_progress'],
        ];
    }

    /**
     * Gets the memory info of OpCache
     *
     * @return array The memory info
     */
    public function getMemoryInfo()
    {
        $memory = $this->statusData['memory_usage'];

        return [
            'used_memory'               => $this->byteFormatter->format($memory['used_memory']),
            'free_memory'               => $this->byteFormatter->format($memory['free_memory']),
            'wasted_memory'             => $this->byteFormatter->format($memory['wasted_memory']),
            'current_wasted_percentage' => round($memory['current_wasted_percentage'], 2) . '%',
        ];
    }

    /**
     * Gets the memory info formatted to build a graph
     *
     * @return string JSON encoded memory info
     */
    public function getGraphMemoryInfo()
    {
        $memory = $this->statusData['memory_usage'];

        return json_encode([
            [
                'value' => $memory['used_memory'],
                'color' => self::DARK_GREEN,
                'label' => $this->translator->translate('graph.memory.used'),
            ],
            [
                'value' => $memory['free_memory'],
                'color' => self::GREEN,
                'label' => $this->translator->translate('graph.memory.free'),
            ],
            [
                'value' => $memory['wasted_memory'],
                'color' => self::RED,
                'label' => $this->translator->translate('graph.memory.wasted'),
            ],
        ]);
    }

    /**
     * Gets the statistics info
     *
     * @return array The statistics info
     */
    public function getStatsInfo()
    {
        if (!$this->statusData['opcache_enabled']) {
             return [
                 [
                    'num_cached_scripts'   => 0,
                    'num_cached_keys'      => 0,
                    'max_cached_keys'      => 0,
                    'hits'                 => 0,
                    'misses'               => 0,
                    'blacklist_misses'     => 0,
                    'blacklist_miss_ratio' => 'n/a',
                 ],
                 [
                    'opcache_hit_rate'     => 'n/a',
                    'start_time'           => 'n/a',
                    'last_restart_time'    => 'n/a',
                    'oom_restarts'         => 'n/a',
                    'hash_restarts'        => 'n/a',
                    'manual_restarts'      => 'n/a',
                 ],
            ];
        }

        $stats = $this->statusData['opcache_statistics'];

        $lastRestartTime = null;

        if ($stats['last_restart_time']) {
            $lastRestartTime = (new \DateTime('@' . $stats['last_restart_time']))->format('H:i:s d-m-Y');
        }

        return [
            [
                'num_cached_scripts'   => $stats['num_cached_scripts'],
                'num_cached_keys'      => $stats['num_cached_keys'],
                'max_cached_keys'      => $stats['max_cached_keys'],
                'hits'                 => $stats['hits'],
                'misses'               => $stats['misses'],
                'blacklist_misses'     => $stats['blacklist_misses'],
                'blacklist_miss_ratio' => round($stats['blacklist_miss_ratio'], 2),
            ],
            [
                'opcache_hit_rate'     => round($stats['opcache_hit_rate'], 2) . '%',
                'start_time'           => (new \DateTime('@' . $stats['start_time']))->format('H:i:s d-m-Y'),
                'last_restart_time'    => $lastRestartTime,
                'oom_restarts'         => $stats['oom_restarts'],
                'hash_restarts'        => $stats['hash_restarts'],
                'manual_restarts'      => $stats['manual_restarts'],
            ],
        ];
    }

    /**
     * Gets the key statistics formatted to build a graph
     *
     * @return string JSON encoded key statistics
     */
    public function getGraphKeyStatsInfo()
    {
        $stats = $this->statusData['opcache_statistics'];

        return json_encode([
            [
                'value' => $stats['num_cached_scripts'],
                'color' => self::DARK_GREEN,
                'label' => $this->translator->translate('graph.keys.scripts'),
            ],
            [
                'value' => $stats['max_cached_keys'] - $stats['num_cached_keys'],
                'color' => self::GREEN,
                'label' => $this->translator->translate('graph.keys.free'),
            ],
            [
                'value' => $stats['num_cached_keys'] - $stats['num_cached_scripts'],
                'color' => self::RED,
                'label' => $this->translator->translate('graph.keys.wasted'),
            ],
        ]);
    }

    /**
     * Gets the hit statistics formatted to build a graph
     *
     * @return string JSON encoded hit statistics
     */
    public function getGraphHitStatsInfo()
    {
        $stats = $this->statusData['opcache_statistics'];

        return json_encode([
            [
                'value' => $stats['hits'],
                'color' => self::GREEN,
                'label' => $this->translator->translate('graph.hits.hits'),
            ],
            [
                'value' => $stats['misses'],
                'color' => self::RED,
                'label' => $this->translator->translate('graph.hits.misses'),
            ],
            [
                'value' => $stats['blacklist_misses'],
                'color' => self::DARK_GREEN,
                'label' => $this->translator->translate('graph.hits.blacklist'),
            ],
        ]);
    }

    /**
     * Gets the cached scripts
     *
     * @return array List of the cached scripts
     */
    public function getCachedScripts()
    {
        if (!isset($this->statusData['scripts'])) {
            return [];
        }

        $scripts = [];

        foreach ($this->statusData['scripts'] as $script) {
            if (isset($script['timestamp']) && $script['timestamp'] === 0) {
                continue;
            }

            $timestamp = 'N/A';

            if (isset($script['timestamp'])) {
                $timestamp = (new \DateTime('@' . $script['timestamp']))->format('H:i:s d-m-Y');
            }

            $scripts[] = [
                'full_path'           => $script['full_path'],
                'hits'                => $script['hits'],
                'memory_consumption'  => $this->byteFormatter->format($script['memory_consumption']),
                'last_used_timestamp' => (new \DateTime('@' . $script['last_used_timestamp']))->format('H:i:s d-m-Y'),
                'timestamp'           => $timestamp,
            ];
        }

        usort($scripts, [$this, 'sortCachedScripts']);

        return $scripts;
    }

    /**
     * Gets the cached scripts for the overview (with trimmed prefix)
     *
     * @param \OpCacheGUI\Format\Trimmer $trimmer The prefix trimmer
     *
     * @return array List of the cached scripts
     */
    public function getCachedScriptsForOverview(Trimmer $trimmer)
    {
        return $trimmer->trim($this->getCachedScripts());
    }

    /**
     * Sorts the lists of cached scripts
     *
     * @param array $a Array to compare
     * @param array $b Array to compare
     *
     * @return int The direction of the sort
     */
    private function sortCachedScripts(array $a, array $b)
    {
        return strcmp($a['full_path'], $b['full_path']);
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>ch.thp.proto</groupId>
        <artifactId>spring-time</artifactId>
        <version>1.0.0-SNAPSHOT</version>
    </parent>

    <artifactId>spring-time-helloworld</artifactId>
    <packaging>jar</packaging>
    <name>spring-time HelloWorld Module</name>
    <dependencies>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
        </dependency>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jadira.usertype</groupId>
            <artifactId>usertype.extended</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>ch.thp.proto</groupId>
            <artifactId>spring-time-infra</artifactId>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.4</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
            </plugin>
        </plugins>

    </build>
</project>

redpajama_set_name: RedPajamaGithub


text:
package jsr310;

import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;

@Configuration
public class JacksonConfig {

    @Bean
    public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer() {
        return (jacksonObjectMapperBuilder) -> {
            jacksonObjectMapperBuilder//
                    .findModulesViaServiceLoader(true)//
                    .indentOutput(true)//
                    .modules(new JavaTimeModule(), new Jdk8Module())//
                    // .featuresToDisable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)//
                    .featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);//
        };
    }
}


text:
package org.vizzini.illyriad.robot;

import org.apache.commons.lang3.StringUtils;
import org.vizzini.ai.neuralnetwork.InputFilter;
import org.vizzini.ai.neuralnetwork.format.InputFilterFormat;
import org.vizzini.ai.robot.RobotImage;

/**
 * Provides a robot image input filter formatter.
 */
public final class CSVRobotImageInputFilterFormat implements InputFilterFormat<RobotImage>
{
    @Override
    public String format(final InputFilter<RobotImage> filter)
    {
        String answer = null;

        if (filter != null)
        {
            final RobotImageInputFilter myFilter = (RobotImageInputFilter)filter;

            final StringBuilder sb = new StringBuilder();

            sb.append(filter.getClass().getName()).append(", ");
            sb.append(myFilter.getMaxWidth()).append(", ");
            sb.append(myFilter.getMaxHeight());

            answer = sb.toString();
        }

        return answer;
    }

    @Override
    public RobotImageInputFilter parse(final String source)
    {
        RobotImageInputFilter answer = null;

        if (StringUtils.isNotEmpty(source) && !"null".equals(source))
        {
            final String[] parts = source.split("[,]");

            int k = 0;

            final String className = parts[k++].trim();
            final int maxWidth = Integer.parseInt(parts[k++].trim());
            final int maxHeight = Integer.parseInt(parts[k++].trim());

            if ("org.vizzini.illyriad.robot.BlackAndWhiteImageInputFilter".equals(className))
            {
                answer = new BlackAndWhiteImageInputFilter(maxWidth, maxHeight);
            }
            else if ("org.vizzini.illyriad.robot.GrayscaleImageInputFilter".equals(className))
            {
                answer = new GrayScaleImageInputFilter(maxWidth, maxHeight);
            }
            else if ("org.vizzini.illyriad.robot.RGBImageInputFilter".equals(className))
            {
                answer = new RGBImageInputFilter(maxWidth, maxHeight);
            }
            else
            {
                throw new RuntimeException("Unknown input filter type: " + className);
            }
        }

        return answer;
    }
}


text:
namespace views {
namespace corewm {

// A set of basic focus and activation rules. Specializations should most likely
// subclass this and call up to these methods rather than reimplementing them.
class VIEWS_EXPORT BaseFocusRules : public FocusRules {
 public:
  BaseFocusRules();
  virtual ~BaseFocusRules();

 protected:
  // Overridden from FocusRules:
  virtual bool CanActivateWindow(aura::Window* window) OVERRIDE;
  virtual bool CanFocusWindow(aura::Window* window) OVERRIDE;
  virtual aura::Window* GetActivatableWindow(aura::Window* window) OVERRIDE;
  virtual aura::Window* GetFocusableWindow(aura::Window* window) OVERRIDE;
  virtual aura::Window* GetNextActivatableWindow(aura::Window* ignore) OVERRIDE;
  virtual aura::Window* GetNextFocusableWindow(aura::Window* ignore) OVERRIDE;

 private:
  DISALLOW_COPY_AND_ASSIGN(BaseFocusRules);
};

}  // namespace corewm
}  // namespace views

#endif  // UI_VIEWS_COREWM_BASE_FOCUS_RULES_H_


text:
#if defined  (__SUNPPRO_CC)  && !defined (_STLP_NO_NEW_C_HEADERS)
#  include <time.h>
// For sunpro, it chokes if time.h is included through stat.h
#endif

#include <fstream>

#ifdef __CYGWIN__
#  define __int64 long long
#endif

extern "C" {
// open/close/read/write
#include <sys/stat.h>           // For stat
#if !defined (_CRAY) && ! defined (__EMX__)
#  include <sys/mman.h>           // For mmap
#endif

//  on HP-UX 11, this one contradicts with pthread.h on pthread_atfork, unless we unset this
#if defined (__hpux) && defined (__GNUC__)
#  undef _INCLUDE_POSIX1C_SOURCE
#endif

#include <unistd.h>
#include <fcntl.h>
}

#ifdef __APPLE__
#  include <sys/sysctl.h>
#endif

const _STLP_fd INVALID_STLP_FD = -1;

#ifndef O_ACCMODE
#  define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
#endif

// Compare with streamoff definition in stl/char_traits.h!
#if defined (_STLP_USE_DEFAULT_FILE_OFFSET) || \
    (!defined(_LARGEFILE_SOURCE) && !defined (_LARGEFILE64_SOURCE))
#  define FSTAT fstat
#  define STAT  stat
#  define LSEEK lseek
#  define MMAP  mmap
#  define OPEN  open
#else
#  define FSTAT fstat64
#  define STAT  stat64
#  define LSEEK lseek64
#  define MMAP  mmap64
#  define OPEN  open64
#endif

#ifndef MAP_FAILED /* MMAP failure return code */
#  define MAP_FAILED -1
#endif

_STLP_BEGIN_NAMESPACE

static ios_base::openmode flag_to_openmode(int mode)
{
  ios_base::openmode ret = ios_base::__default_mode;

  switch ( mode & O_ACCMODE ) {
    case O_RDONLY:
      ret = ios_base::in;
      break;
    case O_WRONLY:
      ret = ios_base::out;
      break;
    case O_RDWR:
      ret = ios_base::in | ios_base::out;
      break;
  }

  if ( mode & O_APPEND )
    ret |= ios_base::app;

  return ret;
}

_STLP_MOVE_TO_PRIV_NAMESPACE

// Helper functions for _Filebuf_base.

static bool __is_regular_file(_STLP_fd fd) {
  struct STAT buf;
  return FSTAT(fd, &buf) == 0 && S_ISREG(buf.st_mode);
}

// Number of characters in the file.
static streamoff __file_size(_STLP_fd fd) {
  streamoff ret = 0;

  struct STAT buf;
  if (FSTAT(fd, &buf) == 0 && S_ISREG(buf.st_mode))
    ret = buf.st_size > 0 ? buf.st_size : 0;

  return ret;
}

_STLP_MOVE_TO_STD_NAMESPACE

size_t _Filebuf_base::_M_page_size = 4096;

_Filebuf_base::_Filebuf_base()
  : _M_file_id(INVALID_STLP_FD),
    _M_openmode(0),
    _M_is_open(false),
    _M_should_close(false)
{}

void _Filebuf_base::_S_initialize()
{
#if defined (__APPLE__)
  int mib[2];
  size_t pagesize, len;
  mib[0] = CTL_HW;
  mib[1] = HW_PAGESIZE;
  len = sizeof(pagesize);
  sysctl(mib, 2, &pagesize, &len, NULL, 0);
  _M_page_size = pagesize;
#elif defined (__DJGPP) && defined (_CRAY)
  _M_page_size = BUFSIZ;
#else
  _M_page_size = sysconf(_SC_PAGESIZE);
#endif
}

// Return the size of the file.  This is a wrapper for stat.
// Returns zero if the size cannot be determined or is ill-defined.
streamoff _Filebuf_base::_M_file_size()
{
  return _STLP_PRIV __file_size(_M_file_id);
}

bool _Filebuf_base::_M_open(const char* name, ios_base::openmode openmode,
                            long permission)
{
  _STLP_fd file_no;

  if (_M_is_open)
    return false;

  int flags = 0;

  // Unix makes no distinction between text and binary files.
  switch ( openmode & (~ios_base::ate & ~ios_base::binary) ) {
    case ios_base::out:
    case ios_base::out | ios_base::trunc:
      flags = O_WRONLY | O_CREAT | O_TRUNC;
      break;
    case ios_base::app:
    case ios_base::out | ios_base::app:
      flags = O_WRONLY | O_CREAT | O_APPEND;
      break;
    case ios_base::in:
      flags = O_RDONLY;
      permission = 0;             // Irrelevant unless we're writing.
      break;
    case ios_base::in | ios_base::out:
      flags = O_RDWR;
      break;
    case ios_base::in | ios_base::out | ios_base::trunc:
      flags = O_RDWR | O_CREAT | O_TRUNC;
      break;
    case ios_base::in | ios_base::app:
    case ios_base::in | ios_base::out | ios_base::app:
      flags = O_RDWR | O_CREAT | O_APPEND;
      break;
    default:                      // The above are the only combinations of
      return false;               // flags allowed by the C++ standard.
  }

  file_no = OPEN(name, flags, permission);

  if (file_no < 0)
    return false;

  _M_is_open = true;

  if ((openmode & (ios_base::ate | ios_base::app)) && (LSEEK(file_no, 0, SEEK_END) == -1)) {
    _M_is_open = false;
  }

  _M_file_id = file_no;
  _M_should_close = _M_is_open;
  _M_openmode = openmode;

  if (_M_is_open)
    _M_regular_file = _STLP_PRIV __is_regular_file(_M_file_id);

  return (_M_is_open != 0);
}

bool _Filebuf_base::_M_open(const char* name, ios_base::openmode openmode)
{
  // This doesn't really grant everyone in the world read/write
  // access.  On Unix, file-creation system calls always clear
  // bits that are set in the umask from the permissions flag.
  return this->_M_open(name, openmode, S_IRUSR | S_IWUSR | S_IRGRP |
                                       S_IWGRP | S_IROTH | S_IWOTH);
}

// Associated the filebuf with a file descriptor pointing to an already-
// open file.  Mode is set to be consistent with the way that the file
// was opened.
bool _Filebuf_base::_M_open(int file_no, ios_base::openmode)
{
  if (_M_is_open || file_no < 0)
    return false;

  int mode = fcntl(file_no, F_GETFL);

  if (mode == -1)
    return false;

  _M_openmode = flag_to_openmode(mode);
  _M_file_id = file_no;

  _M_is_open = true;
  _M_should_close = false;
  _M_regular_file = _STLP_PRIV __is_regular_file(_M_file_id);
  return true;
}

bool _Filebuf_base::_M_close()
{
  if (!_M_is_open)
    return false;

  bool ok = _M_should_close ? (close(_M_file_id) == 0) : true;

  _M_is_open = _M_should_close = false;
  _M_openmode = 0;
  return ok;
}

// Read up to n characters into a buffer.  Return value is number of
// characters read.
ptrdiff_t _Filebuf_base::_M_read(char* buf, ptrdiff_t n)
{
  return read(_M_file_id, buf, n);
}

// Write n characters from a buffer.  Return value: true if we managed
// to write the entire buffer, false if we didn't.
bool _Filebuf_base::_M_write(char* buf, ptrdiff_t n)
{
  for (;;) {
    ptrdiff_t written = write(_M_file_id, buf, n);

    if (n == written) {
      return true;
    }

    if (written > 0 && written < n) {
      n -= written;
      buf += written;
    } else {
      return false;
    }
  }
}

// Wrapper for lseek or the like.
streamoff _Filebuf_base::_M_seek(streamoff offset, ios_base::seekdir dir)
{
  int whence;

  switch ( dir ) {
    case ios_base::beg:
      if (offset < 0 /* || offset > _M_file_size() */ )
        return streamoff(-1);
      whence = SEEK_SET;
      break;
    case ios_base::cur:
      whence = SEEK_CUR;
      break;
    case ios_base::end:
      if (/* offset > 0 || */  -offset > _M_file_size() )
        return streamoff(-1);
      whence = SEEK_END;
      break;
    default:
      return streamoff(-1);
  }

  return LSEEK(_M_file_id, offset, whence);
}

// Attempts to memory-map len bytes of the current file, starting
// at position offset.  Precondition: offset is a multiple of the
// page size.  Postcondition: return value is a null pointer if the
// memory mapping failed.  Otherwise the return value is a pointer to
// the memory-mapped file and the file position is set to offset.
void* _Filebuf_base::_M_mmap(streamoff offset, streamoff len)
{
  void* base;
#if !defined (__DJGPP) && !defined (_CRAY)
  base = MMAP(0, len, PROT_READ, MAP_PRIVATE, _M_file_id, offset);
  if (base != (void*)MAP_FAILED) {
    if (LSEEK(_M_file_id, offset + len, SEEK_SET) < 0) {
      this->_M_unmap(base, len);
      base = 0;
    }
  } else
    base =0;
#else
  _STLP_MARK_PARAMETER_AS_UNUSED(&offset)
  _STLP_MARK_PARAMETER_AS_UNUSED(&len)
  base = 0;
#endif
  return base;
}

void _Filebuf_base::_M_unmap(void* base, streamoff len)
{
  // precondition : there is a valid mapping at the moment
#if !defined (__DJGPP) && !defined (_CRAY)
  munmap((char*)base, len);
#else
  _STLP_MARK_PARAMETER_AS_UNUSED(&len)
  _STLP_MARK_PARAMETER_AS_UNUSED(base)
#endif
}

_STLP_END_NAMESPACE


text:
<!DOCTYPE HTML>

<title>PairFloat</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="dc.created" content="2022-11-23">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../jquery/jquery-ui.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

All Classes

SEARCH:
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">

JavaScript is disabled on your browser.

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Package algorithms.util

Class PairFloat

java.lang.Object

algorithms.util.PairFloat

public class PairFloat
extends java.lang.Object

Author:

nichole

Field Summary

Fields

Modifier and Type
Field
Description

protected static int
fnv321aInit

protected static int
fnv32Prime

Constructor Summary

Constructors

Constructor
Description

PairFloat()

PairFloat(float xPoint,
         float yPoint)

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method
Description

boolean
equals(java.lang.Object obj)

protected int
fnvHashCode(float i0,
           float i1)

float
getX()

float
getY()

int
hashCode()

void
setX(float xPoint)

void
setY(float yPoint)

java.lang.String
toString()

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

fnv321aInit

protected static final int fnv321aInit

See Also:

Constant Field Values

fnv32Prime

protected static final int fnv32Prime

See Also:

Constant Field Values

Constructor Detail

PairFloat

public PairFloat()

PairFloat

public PairFloat(float xPoint,
                 float yPoint)

Method Detail

setX

public void setX(float xPoint)

setY

public void setY(float yPoint)

getX

public float getX()

getY

public float getY()

equals

public boolean equals(java.lang.Object obj)

Overrides:

equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:

hashCode in class java.lang.Object

fnvHashCode

protected int fnvHashCode(float i0,
                          float i1)

toString

public java.lang.String toString()

Overrides:

toString in class java.lang.Object

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

All Classes

JavaScript is disabled on your browser.

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
namespace Tesseract {

    public class EngineConfig {
        public string DataPath { get; set; }

        public string Language { get; set; }
    }
}


text:
<?php

/*
 * This file is part of the overtrue/wechat.
 *
 * (c) overtrue <i@overtrue.me>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace EasyWeChat\OpenPlatform\Component;

use Pimple\Container;
use Pimple\ServiceProviderInterface;

class ServiceProvider implements ServiceProviderInterface
{
    public function register(Container $app)
    {
        $app['component'] = function ($app) {
            return new Client($app);
        };
    }
}


text:
import * as React from 'react';
import * as Immutable from 'immutable';
import { connect as originalConnect } from 'react-redux';
import { ActionCreator, Middleware } from 'redux';

interface PropertyBag<T> {
    [propName: string]: T;
}

type GriddleComponent<T> = React.ComponentClass<T> | React.StatelessComponent<T>;

export namespace components {

export interface RowDefinitionProps {
    //The column value that should be used as the key for the row
    //if this is not set it will make one up (not efficient)
    rowKey?: string;

    //The column that will be known used to track child data
    //By default this will be "children"
    childColumnName?: string;

    //The css class name, or a function to generate a class name from props, to apply to this row.
    cssClassName?: string | ((props: any) => string);

    // Allow custom plugin props
    [x: string]: any,
}

export class RowDefinition extends React.Component<RowDefinitionProps, any> {
}

export interface ColumnDefinitionProps {
    //The name of the column that this definition applies to.
    id: string,

    //The order that this column appears in. If not specified will just use the order that they are defined
    order?: number,

    // TODO: Unused?
    //Determines whether or not the user can disable this column from the settings.
    locked?: boolean,

    //The css class name, or a function to generate a class name from props, to apply to the header for the column.
    headerCssClassName?: string | ((props: any) => string);

    //The css class name, or a function to generate a class name from props, to apply to this column.
    cssClassName?: string | ((props: any) => string);

    //The display name for the column. This is used when the name in the column heading and settings should be different from the data passed in to the Griddle component.
    title?: string,

    //The component that should be rendered instead of the standard column data. This component will still be rendered inside of a TD element.
    customComponent?: GriddleComponent<CellProps & any>,

    //The component that should be used instead of the normal title
    customHeadingComponent?: GriddleComponent<TableHeadingCellProps & any>,

    //Can this column be filtered
    filterable?: boolean,

    //Can this column be sorted
    sortable?: boolean,

    //What sort method this column uses
    sortMethod?: (data: any[], column: string, sortAscending?: boolean) => number;

    // TODO: Unused?
    //What sort type this column uses - magic string :shame:
    sortType?: string,

    //Any extra data that should be passed to each instance of this column
    extraData?: any,

    //The width of this column -- this is string so things like % can be specified
    width?: number|string,

    // TODO: Unused?
    //The number of cells this column should extend. Default is 1.
    colSpan?: number,

    // Is this column visible
    visible?: boolean,

    // Is this column metadta
    isMetadata?: boolean,

    // Allow custom plugin props
    [x: string]: any,
}

export class ColumnDefinition extends React.Component<ColumnDefinitionProps, any> {
}

export interface CellProps {
    griddleKey?: number;
    columnId?: string;
    value?: any;
    onClick?: React.MouseEventHandler<Element>;
    onMouseEnter?: React.MouseEventHandler<Element>;
    onMouseLeave?: React.MouseEventHandler<Element>;
    className?: string;
    style?: React.CSSProperties;
}

class Cell extends React.Component<CellProps, any> {
}

export interface RowProps {
    Cell?: any;
    griddleKey?: string;
    columnIds?: number[];
    onClick?: React.MouseEventHandler<Element>;
    onMouseEnter?: React.MouseEventHandler<Element>;
    onMouseLeave?: React.MouseEventHandler<Element>;
    className?: string;
    style?: React.CSSProperties;
}

class Row extends React.Component<RowProps, any> {
}

export interface TableProps {
    visibleRows?: number,
    TableHeading?: any,
    TableBody?: any,
    NoResults?: any,
}

class Table extends React.Component<TableProps, any> {
}

export interface TableBodyProps {
    rowIds?: number[];
    Row?: any;
    style?: React.CSSProperties;
    className?: string;
}

class TableBody extends React.Component<TableBodyProps, any> {
}

export interface TableHeadingProps {
    columnIds?: number[];
    columnTitles?: string[];
    TableHeadingCell: any;
}

class TableHeading extends React.Component<TableHeadingProps, any> {
}

export interface TableHeadingCellProps {
    title?: string;
    columnId?: number;
    onClick?: React.MouseEventHandler<Element>;
    onMouseEnter?: React.MouseEventHandler<Element>;
    onMouseLeave?: React.MouseEventHandler<Element>;
    icon?: any;
    className?: string;
    style?: React.CSSProperties;
}

class TableHeadingCell extends React.Component<TableHeadingCellProps, any> {
}

const TableContainer: (OriginalComponent: any) => any;

export interface SettingsWrapperProps {
    SettingsToggle?: GriddleComponent<SettingsToggleProps>;
    Settings?: GriddleComponent<SettingsProps>;
    isEnabled?: boolean;
    isVisible?: boolean;
    className?: string;
    style?: React.CSSProperties;
}

class SettingsWrapper extends React.Component<SettingsWrapperProps, any> {
}

const SettingsWrapperContainer: (OriginalComponent: any) => any;

export interface SettingsToggleProps {
    onClick?: React.MouseEventHandler<Element>;
    text?: any;
    className?: string;
    style?: React.CSSProperties;
}

class SettingsToggle extends React.Component<SettingsToggleProps, any> {
}

const SettingsToggleContainer: (OriginalComponent: any) => any;

export interface SettingsProps {
    settingsComponents?: GriddleComponent<any>[];
    className?: string;
    style?: React.CSSProperties;
}

class Settings extends React.Component<SettingsProps, any> {
}

const SettingsContainer: (OriginalComponent: any) => any;

const SettingsComponents: PropertyBag<GriddleComponent<any>>;

export interface FilterProps {
    setFilter?: (filter: GriddleFilter) => void;
    placeholder?: string;
    className?: string;
    style?: React.CSSProperties;

    [x: string]: any;
}

class Filter extends React.Component<FilterProps, any> {
}

} // namespace components

export interface GriddleComponents {
    Layout?: GriddleComponent<any>;
    LayoutEnhancer?: (OriginalComponent: GriddleComponent<any>) => GriddleComponent<any>;
    LayoutContainer?: (OriginalComponent: GriddleComponent<any>) => GriddleComponent<any>;
    LayoutContainerEnhancer?: (OriginalComponent: GriddleComponent<any>) => GriddleComponent<any>;

    Style?: GriddleComponent<any>;
    StyleEnhancer?: (OriginalComponent: GriddleComponent<any>) => GriddleComponent<any>;
    StyleContainer?: (OriginalComponent: GriddleComponent<any>) => GriddleComponent<any>;
    StyleContainerEnhancer?: (OriginalComponent: GriddleComponent<any>) => GriddleComponent<any>;

    Filter?: GriddleComponent<components.FilterProps>;
    FilterEnhancer?: (OriginalComponent: GriddleComponent<components.FilterProps>) => GriddleComponent<components.FilterProps>;
    FilterContainer?: (OriginalComponent: GriddleComponent<components.FilterProps>) => GriddleComponent<components.FilterProps>;
    FilterContainerEnhancer?: (OriginalComponent: GriddleComponent<components.FilterProps>) => GriddleComponent<components.FilterProps>;

    SettingsWrapper?: GriddleComponent<components.SettingsWrapperProps>;
    SettingsWrapperEnhancer?: (OriginalComponent: GriddleComponent<components.SettingsWrapperProps>) => GriddleComponent<components.SettingsWrapperProps>;
    SettingsWrapperContainer?: (OriginalComponent: GriddleComponent<components.SettingsWrapperProps>) => GriddleComponent<components.SettingsWrapperProps>;
    SettingsWrapperContainerEnhancer?: (OriginalComponent: GriddleComponent<components.SettingsWrapperProps>) => GriddleComponent<components.SettingsWrapperProps>;

    SettingsToggle?: GriddleComponent<components.SettingsToggleProps>;
    SettingsToggleEnhancer?: (OriginalComponent: GriddleComponent<components.SettingsToggleProps>) => GriddleComponent<components.SettingsToggleProps>;
    SettingsToggleContainer?: (OriginalComponent: GriddleComponent<components.SettingsToggleProps>) => GriddleComponent<components.SettingsToggleProps>;
    SettingsToggleContainerEnhancer?: (OriginalComponent: GriddleComponent<components.SettingsToggleProps>) => GriddleComponent<components.SettingsToggleProps>;

    Settings?: GriddleComponent<components.SettingsProps>;
    SettingsEnhancer?: (OriginalComponent: GriddleComponent<components.SettingsProps>) => GriddleComponent<components.SettingsProps>;
    SettingsContainer?: (OriginalComponent: GriddleComponent<components.SettingsProps>) => GriddleComponent<components.SettingsProps>;
    SettingsContainerEnhancer?: (OriginalComponent: GriddleComponent<components.SettingsProps>) => GriddleComponent<components.SettingsProps>;

    SettingsComponents?: PropertyBag<GriddleComponent<any>>;

    Table?: GriddleComponent<components.TableProps>;
    TableEnhancer?: (OriginalComponent: GriddleComponent<components.TableProps>) => GriddleComponent<components.TableProps>;
    TableContainer?: (OriginalComponent: GriddleComponent<components.TableProps>) => GriddleComponent<components.TableProps>;
    TableContainerEnhancer?: (OriginalComponent: GriddleComponent<components.TableProps>) => GriddleComponent<components.TableProps>;

    TableHeading?: GriddleComponent<components.TableHeadingProps>;
    TableHeadingEnhancer?: (OriginalComponent: GriddleComponent<components.TableHeadingProps>) => GriddleComponent<components.TableHeadingProps>;
    TableHeadingContainer?: (OriginalComponent: GriddleComponent<components.TableHeadingProps>) => GriddleComponent<components.TableHeadingProps>;
    TableHeadingContainerEnhancer?: (OriginalComponent: GriddleComponent<components.TableHeadingProps>) => GriddleComponent<components.TableHeadingProps>;

    TableHeadingCell?: GriddleComponent<components.TableHeadingCellProps>;
    TableHeadingCellEnhancer?: (OriginalComponent: GriddleComponent<components.TableHeadingCellProps>) => GriddleComponent<components.TableHeadingCellProps>;
    TableHeadingCellContainer?: (OriginalComponent: GriddleComponent<components.TableHeadingCellProps>) => GriddleComponent<components.TableHeadingCellProps>;
    TableHeadingCellContainerEnhancer?: (OriginalComponent: GriddleComponent<components.TableHeadingCellProps>) => GriddleComponent<components.TableHeadingCellProps>;

    TableBody?: GriddleComponent<components.TableBodyProps>;
    TableBodyEnhancer?: (OriginalComponent: GriddleComponent<components.TableBodyProps>) => GriddleComponent<components.TableBodyProps>;
    TableBodyContainer?: (OriginalComponent: GriddleComponent<components.TableBodyProps>) => GriddleComponent<components.TableBodyProps>;
    TableBodyContainerEnhancer?: (OriginalComponent: GriddleComponent<components.TableBodyProps>) => GriddleComponent<components.TableBodyProps>;

    Row?: GriddleComponent<components.RowProps>;
    RowEnhancer?: (OriginalComponent: GriddleComponent<components.RowProps>) => GriddleComponent<components.RowProps>;
    RowContainer?: (OriginalComponent: GriddleComponent<components.RowProps>) => GriddleComponent<components.RowProps>;
    RowContainerEnhancer?: (OriginalComponent: GriddleComponent<components.RowProps>) => GriddleComponent<components.RowProps>;

    Cell?: GriddleComponent<components.CellProps>;
    CellEnhancer?: (OriginalComponent: GriddleComponent<components.CellProps>) => GriddleComponent<components.CellProps>;
    CellContainer?: (OriginalComponent: GriddleComponent<components.CellProps>) => GriddleComponent<components.CellProps>;
    CellContainerEnhancer?: (OriginalComponent: GriddleComponent<components.CellProps>) => GriddleComponent<components.CellProps>;

    NoResults?: GriddleComponent<any>;
    NoResultsEnhancer?: (OriginalComponent: GriddleComponent<any>) => GriddleComponent<any>;
    NoResultsContainer?: (OriginalComponent: GriddleComponent<any>) => GriddleComponent<any>;
    NoResultsContainerEnhancer?: (OriginalComponent: GriddleComponent<any>) => GriddleComponent<any>;

    Pagination?: GriddleComponent<any>;
    PaginationEnhancer?: (OriginalComponent: GriddleComponent<any>) => GriddleComponent<any>;
    PaginationContainer?: (OriginalComponent: GriddleComponent<any>) => GriddleComponent<any>;
    PaginationContainerEnhancer?: (OriginalComponent: GriddleComponent<any>) => GriddleComponent<any>;

    NextButton?: GriddleComponent<any>;
    NextButtonEnhancer?: (OriginalComponent: GriddleComponent<any>) => GriddleComponent<any>;
    NextButtonContainer?: (OriginalComponent: GriddleComponent<any>) => GriddleComponent<any>;
    NextButtonContainerEnhancer?: (OriginalComponent: GriddleComponent<any>) => GriddleComponent<any>;

    PageDropdown?: GriddleComponent<any>;
    PageDropdownEnhancer?: (OriginalComponent: GriddleComponent<any>) => GriddleComponent<any>;
    PageDropdownContainer?: (OriginalComponent: GriddleComponent<any>) => GriddleComponent<any>;
    PageDropdownContainerEnhancer?: (OriginalComponent: GriddleComponent<any>) => GriddleComponent<any>;

    PreviousButton?: GriddleComponent<any>;
    PreviousButtonEnhancer?: (OriginalComponent: GriddleComponent<any>) => GriddleComponent<any>;
    PreviousButtonContainer?: (OriginalComponent: GriddleComponent<any>) => GriddleComponent<any>;
    PreviousButtonContainerEnhancer?: (OriginalComponent: GriddleComponent<any>) => GriddleComponent<any>;
}

export type RowFilter = (row: any, index: number, data: Immutable.List<any>) => boolean;
export type GriddleFilter = string | RowFilter | PropertyBag<string | RowFilter>;

export interface GriddleActions extends PropertyBag<ActionCreator<any> | undefined> {
    onSort?: (sortProperties: any) => void;
    onNext?: () => void;
    onPrevious?: () => void;
    onGetPage?: (pageNumber: number) => void;
    setFilter?: (filter: GriddleFilter) => void;
}

export interface GriddleEvents extends GriddleActions {
    onFilter?: (filterText: string) => void;
    setSortProperties?: (sortProperties: utils.SortProperties) => () => void;
}

export interface GriddleSortKey {
    id: string;
    sortAscending: boolean;
}

export interface GriddleStyleElements<T> {
    Cell?: T;
    Filter?: T;
    Layout?: T;
    Loading?: T;
    NextButton?: T;
    NoResults?: T;
    PageDropdown?: T;
    Pagination?: T;
    PreviousButton?: T;
    Row?: T;
    RowDefinition?: T;
    Settings?: T;
    SettingsToggle?: T;
    Table?: T;
    TableBody?: T;
    TableHeading?: T;
    TableHeadingCell?: T;
    TableHeadingCellAscending?: T;
    TableHeadingCellDescending?: T;
}

export interface GriddleStyleIcons {
    sortAscendingIcon?: any;
    sortDescendingIcon?: any;
}

export interface GriddleStyleConfig {
    classNames?: GriddleStyleElements<string>;
    icons?: GriddleStyleElements<GriddleStyleIcons>;
    styles?: GriddleStyleElements<React.CSSProperties>;
}

export interface GriddlePageProperties {
    currentPage?: number;
    pageSize?: number;
    recordCount?: number;
}

interface RowRenderProperties extends components.RowDefinitionProps {
}

interface ColumnRenderProperties extends components.ColumnDefinitionProps {
}

export interface GriddleRenderProperties {
    rowProperties?: RowRenderProperties;
    columnProperties?: PropertyBag<ColumnRenderProperties>;
}

type Reducer = (state: any, action?: any) => void;
type Selector = (state: any, props?: any) => any;
type Listener = (prevState: any, nextState: any, otherArgs?: any) => any;

interface SettingsComponentObject {
    order: number;
    component?: GriddleComponent<any>;
}

interface GriddleExtensibility {
    components?: GriddleComponents,
    events?: GriddleEvents;
    reducer?: PropertyBag<Reducer>,
    renderProperties?: GriddleRenderProperties;
    selectors?: PropertyBag<Selector>,
    settingsComponentObjects?: PropertyBag<SettingsComponentObject>,
    styleConfig?: GriddleStyleConfig,
    listeners?: PropertyBag<Listener>,
}

interface GriddleInitialState {
    enableSettings?: boolean;
    pageProperties?: GriddlePageProperties;
    sortMethod?: (data: any[], column: string, sortAscending?: boolean) => number;
    sortProperties?: GriddleSortKey[];
    textProperties?: {
      next?: string,
      previous?: string,
      settingsToggle?: string,
      filterPlaceholder?: string,
    }

    [x: string]: any;
}

export interface GriddlePlugin extends GriddleExtensibility {
    initialState?: GriddleInitialState;
    reduxMiddleware?: Middleware[];
}

export interface GriddleProps<T> extends GriddlePlugin, GriddleInitialState {
    core?: GriddlePlugin;
    plugins?: GriddlePlugin[];
    data?: T[];
    storeKey?: string;
}

declare class Griddle<T> extends React.Component<GriddleProps<T>, any> {
  static storeKey: string;
}

export const actions: GriddleActions;

export const constants: PropertyBag<string>;

export const selectors: PropertyBag<Selector>;

export const settingsComponentObjects: PropertyBag<SettingsComponentObject>;

export const connect : typeof originalConnect;

export namespace utils {
    const columnUtils: PropertyBag<Function>;
    const compositionUtils: PropertyBag<Function>;
    const dataUtils: PropertyBag<Function>;
    const rowUtils: PropertyBag<Function>;

    const connect : typeof originalConnect;

    interface SortProperties{
      setSortColumn(sortProperties: ((key : GriddleSortKey) => void)) : void;
      sortProperty: GriddleSortKey;
      columnId: string;
    }

    namespace sortUtils {
      function defaultSort(data: any[], column: string, sortAscending?: boolean) : number;
      function setSortProperties(sortProperties: SortProperties) : () => void;
    }
}

export namespace plugins {
    var CorePlugin : GriddlePlugin;

    var LegacyStylePlugin : GriddlePlugin;

    var LocalPlugin : GriddlePlugin;

    interface PositionSettings {
        // The height of the table
        tableHeight?: number|string;

        // The width of the table
        tableWidth?: number|string;

        // The minimum row height
        rowHeight?: number|string;

        // TODO: Unused?
        // The minimum column width
        defaultColumnWidth?: number|string;

        // TODO: Unused?
        // Whether or not the header should be fixed
        fixedHeader?: boolean;

        // TODO: Unused?
        // Disable pointer events while scrolling to improve performance
        disablePointerEvents?: boolean;
    }
    var PositionPlugin : (settings: PositionSettings) => GriddlePlugin;
}

export const ColumnDefinition : typeof components.ColumnDefinition;
export const RowDefinition : typeof components.RowDefinition;

export default Griddle;


text:
namespace socks4 {

const unsigned char version = 0x04;

class request
{
public:
  enum command_type
  {
    connect = 0x01,
    bind = 0x02
  };

  request(command_type cmd, const asio::ip::tcp::endpoint& endpoint,
      const std::string& user_id)
    : version_(version),
      command_(cmd),
      user_id_(user_id),
      null_byte_(0)
  {
    // Only IPv4 is supported by the SOCKS 4 protocol.
    if (endpoint.protocol() != asio::ip::tcp::v4())
    {
      throw asio::system_error(
          asio::error::address_family_not_supported);
    }

    // Convert port number to network byte order.
    unsigned short port = endpoint.port();
    port_high_byte_ = (port >> 8) & 0xff;
    port_low_byte_ = port & 0xff;

    // Save IP address in network byte order.
    address_ = endpoint.address().to_v4().to_bytes();
  }

  boost::array<asio::const_buffer, 7> buffers() const
  {
    boost::array<asio::const_buffer, 7> bufs =
    {
      {
        asio::buffer(&version_, 1),
        asio::buffer(&command_, 1),
        asio::buffer(&port_high_byte_, 1),
        asio::buffer(&port_low_byte_, 1),
        asio::buffer(address_),
        asio::buffer(user_id_),
        asio::buffer(&null_byte_, 1)
      }
    };
    return bufs;
  }

private:
  unsigned char version_;
  unsigned char command_;
  unsigned char port_high_byte_;
  unsigned char port_low_byte_;
  asio::ip::address_v4::bytes_type address_;
  std::string user_id_;
  unsigned char null_byte_;
};

class reply
{
public:
  enum status_type
  {
    request_granted = 0x5a,
    request_failed = 0x5b,
    request_failed_no_identd = 0x5c,
    request_failed_bad_user_id = 0x5d
  };

  reply()
    : null_byte_(0),
      status_()
  {
  }

  boost::array<asio::mutable_buffer, 5> buffers()
  {
    boost::array<asio::mutable_buffer, 5> bufs =
    {
      {
        asio::buffer(&null_byte_, 1),
        asio::buffer(&status_, 1),
        asio::buffer(&port_high_byte_, 1),
        asio::buffer(&port_low_byte_, 1),
        asio::buffer(address_)
      }
    };
    return bufs;
  }

  bool success() const
  {
    return null_byte_ == 0 && status_ == request_granted;
  }

  unsigned char status() const
  {
    return status_;
  }

  asio::ip::tcp::endpoint endpoint() const
  {
    unsigned short port = port_high_byte_;
    port = (port << 8) & 0xff00;
    port = port | port_low_byte_;

    asio::ip::address_v4 address(address_);

    return asio::ip::tcp::endpoint(address, port);
  }

private:
  unsigned char null_byte_;
  unsigned char status_;
  unsigned char port_high_byte_;
  unsigned char port_low_byte_;
  asio::ip::address_v4::bytes_type address_;
};

} // namespace socks4

#endif // SOCKS4_HPP


text:
require 'rails_helper'

describe Status, type: :model, vcr: true do
  subject { FactoryGirl.create(:status) }

  it "works_count" do
    FactoryGirl.create_list(:work, 5, :published_today)
    expect(subject.works_count).to eq(5)
  end

  it "works_new_count" do
    FactoryGirl.create_list(:work, 5, :published_today)
    expect(subject.works_new_count).to eq(5)
  end

  it "results_count" do
    FactoryGirl.create_list(:work, 5, :published_today)
    expect(subject.results_count).to eq(125)
  end

  it "notifications_count" do
    FactoryGirl.create_list(:notification, 5)
    expect(subject.notifications_count).to eq(5)
  end

  it "responses_count" do
    FactoryGirl.create_list(:api_response, 5)
    expect(subject.responses_count).to eq(5)
  end

  it "requests_count" do
    FactoryGirl.create_list(:api_request, 5, created_at: Time.zone.now - 1.hour)
    expect(subject.requests_count).to eq(5)
  end

  it "requests_average" do
    FactoryGirl.create_list(:api_request, 5, created_at: Time.zone.now - 1.hour)
    expect(subject.requests_average).to eq(800)
  end

  it "current_version" do
    expect(subject.current_version).to eq("3.13")
  end

  context "services" do
    it "redis" do
      expect(subject.redis).to eq("OK")
    end

    it "sidekiq" do
      expect(subject.sidekiq).to eq("failed")
    end

    it "services_ok?" do
      expect(subject.services_ok?).to be false
    end
  end
end


text:
title: Simple Grilled Eggplant
author: lbjay
layout: post
permalink: /2007/09/01/simple-grilled-eggplant/
categories:
  - Recipes
---

[Béa ][1] asks for favorite eggplant recipes. I only have one way I like to cook it these days. It’s a recipe shared verbally by an Israeli co-worker.

    Simple Grilled Eggplant

    I’ve got no measurements for you, but it’s simple enough. The ratio of lemon juice to tahini is the only part that took some experimentation. And it’s really best to use the fat/round varieties, like Dusky or “Italian”, rather than the long/skinny kinds–unless you’re really into eggplant skin, which I am not.

    * Eggplant
 * Olive Oil
 * Lemon Juice
 * Tahini

    Slice the eggplant crosswise into discs about 1/2 inch thick. Sprinkle both sides of each slice with a pinch of salt and toss them into a collander to sit for half an hour or so. Go fire up the grill while you’re waiting. You can also prepare the dressing/drizzle: whisk together in a bowl 2 parts lemon juice to one part tahini. For 2 good-sized eggplants this means about 2 T Tahini + 1/4 cup lemon juice.

    By the time your fire’s ready, the eggplant should have weeped out some of its slightly-bitter moisture. Wipe both sides of each slice with a paper towel to dry them and also remove some of the salt. Brush them with olive oil and spread them out in a single layer on the grill. Grill on both sides until they’ve developed some good grill marks and have lost their firmness. Pile the slices on a plate and drizzle with the lemon + Tahini mixture.

 [1]: http://www.latartinegourmande.com/2007/08/30/eggplant-madness-la-folie-des-aubergines/


text:
// Copyright 2022 TF.Text Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "tensorflow_text/core/kernels/sentencepiece/py_tflite_registerer.h"

namespace tflite {
namespace ops {
namespace custom {
TfLiteRegistration* Register_FAST_SENTENCEPIECE_TOKENIZER();
TfLiteRegistration* Register_FAST_SENTENCEPIECE_DETOKENIZER();

namespace text {

extern "C" void AddFastSentencepieceTokenize(
    tflite::MutableOpResolver* resolver) {
  resolver->AddCustom(
      "TFText>FastSentencepieceTokenize",
      ::tflite::ops::custom::Register_FAST_SENTENCEPIECE_TOKENIZER());
}

extern "C" void AddFastSentencepieceDetokenize(
    tflite::MutableOpResolver* resolver) {
  resolver->AddCustom(
      "TFText>FastSentencepieceDetokenize",
      ::tflite::ops::custom::Register_FAST_SENTENCEPIECE_DETOKENIZER());
}

}  // namespace text
}  // namespace custom
}  // namespace ops
}  // namespace tflite


text:
<?php
/**
 * Gets the result from database query and output it into an html table, including links, pagination and sorting.
 *
 */
class CHTMLTable {

  /**
   * Use the current querystring as base, modify it according to $options and return the modified query string.
   *
   * @param array $options to set/change.
   * @param string $prepend this to the resulting query string
   * @return string with an updated query string.
   */
  private function getQueryString($options=array(), $prepend='?') {
    // parse query string into array
    $query = array();
    parse_str($_SERVER['QUERY_STRING'], $query);

    // Modify the existing query string with new options
    $query = array_merge($query, $options);

    // Return the modified querystring
    return $prepend . htmlentities(http_build_query($query));
  }

  /**
   * Create links for hits per page.
   *
   * @param array $hits a list of hits-options to display.
   * @param array $current value.
   * @return string as a link to this page.
   */
  public function getHitsPerPage($hits, $current=null) {
    $nav = "Träffar per sida: ";
    foreach($hits as $val) {
      if($current == $val) {
        $nav .= "$val ";
      }
      else {
        $nav .= "getQueryString(array('hits' => $val)) . "'>$val ";
      }
    }
    return $nav;
  }

  /**
   * Create navigation among pages.
   *
   * @param int $page the current page number.
   * @param int $max the maximum number of pages.
   * @param int $min the the first page number, usually 0 or 1.
   * @return string the link to this page.
   */
  public function getPageNavigation($page, $max, $min=1) {
    $nav  = ($page != $min) ? "getQueryString(array('page' => $min)) . "'><< " : '<< ';
    $nav .= ($page > $min) ? "getQueryString(array('page' => ($page > $min ? $page - 1 : $min) )) . "'>< " : '< ';

    for($i=$min; $i<=$max; $i++) {
      if($page == $i) {
        $nav .= "$i ";
      }
      else {
        $nav .= "getQueryString(array('page' => $i)) . "'>$i ";
      }
    }

    $nav .= ($page < $max) ? "getQueryString(array('page' => ($page < $max ? $page + 1 : $max) )) . "'>> " : '> ';
    $nav .= ($page != $max) ? "getQueryString(array('page' => $max)) . "'>>> " : '>> ';
    return $nav;
  }

  /**
   * Function to create links for sorting.
   *
   * @param string $column the name of the database column to sort by
   * @return string with links to order by column.
   */
  public function orderby($column) {
    $nav  = "getQueryString(array('orderby'=>$column, 'order'=>'asc')) . "'>↓";
    $nav .= "getQueryString(array('orderby'=>$column, 'order'=>'desc')) . "'>↑";
    return "" . $nav . "";
  }

  /**
   * Create select menu for sorting.
   *
   * @param array $columns the names of the database column to sort by
   * @param array $orders the orders of the select menu items
   * @param array $names the names of the select menu items
   * @return string select menu to order by column.
   */
  public function selectOrderby($columns, $orders, $names) {
    $select = null;
    foreach ($columns as $key => $column) {
      $name     = $names[$key];
      $order    = $orders[$key];
      $url      = $this->getQueryString(array('orderby'=>$column, 'order'=>$order));
      $selected = isset($_GET['orderby']) && $_GET['orderby'] == $column && $_GET['order'] == $order  ? " selected" : null;
      $select  .= "<option value='{$url}' {$selected}>{$name}</option>";
    }
    return <<<EOD
      <select onchange='javascript:window.location.href=this.value'>
        {$select}
      </select>
EOD;
  }

  /**
   * Create select menu for hits per page.
   *
   * @param array $hits a list of hits-options to display.
   * @param array $current value.
   * @return string as a link to this page.
   */
  public function getSelectHitsPerPage($hits, $current=null) {
    $select = null;
    foreach($hits as $val) {
      $url      = $this->getQueryString(array('hits' => $val));
      $selected = ($current == $val) ? " selected" : null;
      $select  .= "<option value='{$url}' {$selected}>{$val}</option>";
    }
    return <<<EOD
      <select onchange='javascript:window.location.href=this.value'>
        {$select}
      </select>
EOD;
  }
}


text:
import io
from pathlib import Path
from typing import List, Optional, Sequence, Tuple

import numpy as np
import pandas as pd
import tensorflow as tf

from tensorflow_similarity.types import FloatTensor, PandasDataFrame, Tensor

from .store import Store

class MemoryStore(Store):
    """Efficient in-memory dataset store"""

    def __init__(self) -> None:
        # We are using a native python array in memory for its row speed.
        # Serialization / export relies on Arrow.
        self.labels: List[Optional[int]] = []
        self.embeddings: List[FloatTensor] = []
        self.data: List[Optional[Tensor]] = []
        self.num_items: int = 0
        pass

    def add(
        self,
        embedding: FloatTensor,
        label: Optional[int] = None,
        data: Optional[Tensor] = None,
    ) -> int:
        """Add an Embedding record to the key value store.

        Args:
            embedding: Embedding predicted by the model.

            label: Class numerical id. Defaults to None.

            data: Data associated with the embedding. Defaults to None.

        Returns:
            Associated record id.
        """
        idx = self.num_items
        self.labels.append(label)
        self.embeddings.append(embedding)
        self.data.append(data)
        self.num_items += 1
        return idx

    def batch_add(
        self,
        embeddings: Sequence[FloatTensor],
        labels: Optional[Sequence[int]] = None,
        data: Optional[Sequence[Tensor]] = None,
    ) -> List[int]:
        """Add a set of embedding records to the key value store.

        Args:
            embeddings: Embeddings predicted by the model.

            labels: Class numerical ids. Defaults to None.

            data: Data associated with the embeddings. Defaults to None.

        See:
            add() for what a record contains.

        Returns:
            List of associated record id.
        """
        idxs: List[int] = []
        for idx, embedding in enumerate(embeddings):
            label = None if labels is None else labels[idx]
            rec_data = None if data is None else data[idx]
            idxs.append(self.add(embedding, label, rec_data))
        return idxs

    def get(self, idx: int) -> Tuple[FloatTensor, Optional[int], Optional[Tensor]]:
        """Get an embedding record from the key value store.

        Args:
            idx: Id of the record to fetch.

        Returns:
            record associated with the requested id.
        """

        return self.embeddings[idx], self.labels[idx], self.data[idx]

    def batch_get(self, idxs: Sequence[int]) -> Tuple[List[FloatTensor], List[Optional[int]], List[Optional[Tensor]]]:
        """Get embedding records from the key value store.

        Args:
            idxs: ids of the records to fetch.

        Returns:
            List of records associated with the requested ids.
        """
        embeddings = []
        labels = []
        data = []
        for idx in idxs:
            e, l, d = self.get(idx)
            embeddings.append(e)
            labels.append(l)
            data.append(d)
        return embeddings, labels, data

    def size(self) -> int:
        "Number of record in the key value store."
        return self.num_items

    def save(self, path: str, compression: bool = True) -> None:
        """Serializes index on disk.

        Args:
            path: where to store the data.
            compression: Compress index data. Defaults to True.
        """
        # Writing to a buffer to avoid read error in np.savez when using GFile.
        # See: https://github.com/tensorflow/tensorflow/issues/32090
        io_buffer = io.BytesIO()
        if compression:
            np.savez_compressed(
                io_buffer,
                embeddings=self.embeddings,
                labels=np.array(self.labels),
                data=np.array(self.data),
            )
        else:
            np.savez(
                io_buffer,
                embeddings=self.embeddings,
                labels=np.array(self.labels),
                data=np.array(self.data),
            )

        with tf.io.gfile.GFile(self._make_fname(path), "wb+") as f:
            f.write(io_buffer.getvalue())

    def load(self, path: str) -> int:
        """load index on disk

        Args:
            path: which directory to use to store the index data.

        Returns:
           Number of records reloaded.
        """
        fname = self._make_fname(path, check_file_exit=True)
        with tf.io.gfile.GFile(fname, "rb") as gfp:
            data = np.load(gfp, allow_pickle=True)
        self.embeddings = list(data["embeddings"])
        self.labels = list(data["labels"])
        self.data = list(data["data"])
        self.num_items = len(self.embeddings)
        print("loaded %d records from %s" % (self.size(), path))
        return self.size()

    def _make_fname(self, path: str, check_file_exit: bool = False) -> str:
        p = Path(path)
        if not tf.io.gfile.exists(p):
            raise ValueError("Index path doesn't exist")
        fname = p / "index.npz"

        # only for loading
        if check_file_exit and not tf.io.gfile.exists(fname):
            raise ValueError("Index file not found")
        return str(fname)

    def to_data_frame(self, num_records: int = 0) -> PandasDataFrame:
        """Export data as a Pandas dataframe.

        Args:
            num_records: Number of records to export to the dataframe.
            Defaults to 0 (unlimited).

        Returns:
            pd.DataFrame: a pandas dataframe.
        """

        if not num_records:
            num_records = self.num_items

        data = {
            "embeddings": self.embeddings[:num_records],
            "data": self.data[:num_records],
            "lables": self.labels[:num_records],
        }

        # forcing type from Any to PandasFrame
        df: PandasDataFrame = pd.DataFrame.from_dict(data)
        return df


text:
package hackerrank;

import org.junit.Test;

import java.io.FileInputStream;

public class IntroToTutorialChallengesTest {
    @Test
    public void test1() throws Exception {
        System.setIn(new FileInputStream("src/test/resources/intro-to-tutorial-challenges/test1.txt"));
        IntroToTutorialChallenges.main(new String[]{});
    }
}


text:
Benchmark Algorithms on Windy Gridworld Task
================
Markus Dumke
2017-12-21

``` r
library(reinforcelearn)
env = makeEnvironment("windy.gridworld")
```

The optimal solution is 15 steps.

Simple Q-Learning
-----------------

``` r
policy = makePolicy("epsilon.greedy", epsilon = 0.1)
agent = makeAgent(policy, "table", "qlearning", epsilon = 0.1)

res = interact(env, agent, n.episodes = 500L)
```

Q-Learning with Eligibility Traces
----------------------------------

``` r
env$resetEverything()
#> [1] 30
policy = makePolicy("epsilon.greedy", epsilon = 0.1)
alg = makeAlgorithm("qlearning", lambda = 0.8, traces = "accumulate")
agent = makeAgent(policy, "table", alg)

res = interact(env, agent, n.episodes = 500L)
```

Q-Learning with Experience replay
---------------------------------

``` r
env$resetEverything()
#> [1] 30
policy = makePolicy("epsilon.greedy", epsilon = 0.1)
mem = makeReplayMemory(size = 10L, batch.size = 10L)
agent = makeAgent(policy, "table", "qlearning", experience.replay = mem)

res = interact(env, agent, n.episodes = 500L)
```

Q-Learning with neural network and experience replay
----------------------------------------------------

``` r
env$resetEverything()
#> [1] 30
library(keras)
model = keras_model_sequential() %>%
  layer_dense(units = env$n.actions, activation = "linear",
    input_shape = c(env$n.states), kernel_initializer = initializer_zeros(),
    use_bias = FALSE) %>%
  compile(loss = "mae", optimizer = optimizer_sgd(lr = 1))
mem = makeReplayMemory(size = 2L, batch.size = 2L)
val = makeValueFunction("neural.network", model = model)
policy = makePolicy("epsilon.greedy", epsilon = 0.1)
preprocess = function(x) to_categorical(x, num_classes = env$n.states)
agent = makeAgent(policy, val, "qlearning",
  preprocess = preprocess, experience.replay = mem)

res = interact(env, agent, n.episodes = 500L)
```


text:
package org.apache.solr.common.util;

import org.noggit.CharArr;
import org.apache.solr.common.SolrDocument;
import org.apache.solr.common.SolrDocumentList;
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.common.SolrInputField;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.*;
import java.nio.ByteBuffer;

/**
 * The class is designed to optimaly serialize/deserialize any supported types in Solr response. As we know there are only a limited type of
 * items this class can do it with very minimal amount of payload and code. There are 15 known types and if there is an
 * object in the object tree which does not fall into these types, It must be converted to one of these. Implement an
 * ObjectResolver and pass it over It is expected that this class is used on both end of the pipes. The class has one
 * read method and one write method for each of the datatypes
 * <p/>
 * Note -- Never re-use an instance of this class for more than one marshal or unmarshall operation. Always create a new
 * instance.
 */
public class JavaBinCodec {

  public static final byte
          NULL = 0,
          BOOL_TRUE = 1,
          BOOL_FALSE = 2,
          BYTE = 3,
          SHORT = 4,
          DOUBLE = 5,
          INT = 6,
          LONG = 7,
          FLOAT = 8,
          DATE = 9,
          MAP = 10,
          SOLRDOC = 11,
          SOLRDOCLST = 12,
          BYTEARR = 13,
          ITERATOR = 14,
          /**
           * this is a special tag signals an end. No value is associated with it
           */
          END = 15,

          SOLRINPUTDOC = 16,

          // types that combine tag + length (or other info) in a single byte
          TAG_AND_LEN = (byte) (1 << 5),
          STR = (byte) (1 << 5),
          SINT = (byte) (2 << 5),
          SLONG = (byte) (3 << 5),
          ARR = (byte) (4 << 5), //
          ORDERED_MAP = (byte) (5 << 5), // SimpleOrderedMap (a NamedList subclass, and more common)
          NAMED_LST = (byte) (6 << 5), // NamedList
          EXTERN_STRING = (byte) (7 << 5);

  private static byte VERSION = 2;
  private ObjectResolver resolver;
  protected FastOutputStream daos;

  public JavaBinCodec() {
  }

  public JavaBinCodec(ObjectResolver resolver) {
    this.resolver = resolver;
  }

  public void marshal(Object nl, OutputStream os) throws IOException {
    init(FastOutputStream.wrap(os));
    try {
      daos.writeByte(VERSION);
      writeVal(nl);
    } finally {
      daos.flushBuffer();
    }
  }

  /** expert: sets a new output stream */
  public void init(FastOutputStream os) {
    daos = os;
  }

  byte version;

  public Object unmarshal(InputStream is) throws IOException {
    FastInputStream dis = FastInputStream.wrap(is);
    version = dis.readByte();
    if (version != VERSION) {
      throw new RuntimeException("Invalid version (expected " + VERSION +
          ", but " + version + ") or the data in not in 'javabin' format");
    }
    return readVal(dis);
  }

  public SimpleOrderedMap<Object> readOrderedMap(FastInputStream dis) throws IOException {
    int sz = readSize(dis);
    SimpleOrderedMap<Object> nl = new SimpleOrderedMap<Object>();
    for (int i = 0; i < sz; i++) {
      String name = (String) readVal(dis);
      Object val = readVal(dis);
      nl.add(name, val);
    }
    return nl;
  }

  public NamedList<Object> readNamedList(FastInputStream dis) throws IOException {
    int sz = readSize(dis);
    NamedList<Object> nl = new NamedList<Object>();
    for (int i = 0; i < sz; i++) {
      String name = (String) readVal(dis);
      Object val = readVal(dis);
      nl.add(name, val);
    }
    return nl;
  }

  public void writeNamedList(NamedList<?> nl) throws IOException {
    writeTag(nl instanceof SimpleOrderedMap ? ORDERED_MAP : NAMED_LST, nl.size());
    for (int i = 0; i < nl.size(); i++) {
      String name = nl.getName(i);
      writeExternString(name);
      Object val = nl.getVal(i);
      writeVal(val);
    }
  }

  public void writeVal(Object val) throws IOException {
    if (writeKnownType(val)) {
      return;
    } else {
      Object tmpVal = val;
      if (resolver != null) {
        tmpVal = resolver.resolve(val, this);
        if (tmpVal == null) return; // null means the resolver took care of it fully
        if (writeKnownType(tmpVal)) return;
      }
    }

    writeVal(val.getClass().getName() + ':' + val.toString());
  }

  protected static final Object END_OBJ = new Object();

  protected byte tagByte;

  public Object readVal(FastInputStream dis) throws IOException {
    tagByte = dis.readByte();

    // if ((tagByte & 0xe0) == 0) {
    // if top 3 bits are clear, this is a normal tag

    // OK, try type + size in single byte
    switch (tagByte >>> 5) {
      case STR >>> 5:
        return readStr(dis);
      case SINT >>> 5:
        return readSmallInt(dis);
      case SLONG >>> 5:
        return readSmallLong(dis);
      case ARR >>> 5:
        return readArray(dis);
      case ORDERED_MAP >>> 5:
        return readOrderedMap(dis);
      case NAMED_LST >>> 5:
        return readNamedList(dis);
      case EXTERN_STRING >>> 5:
        return readExternString(dis);
    }

    switch (tagByte) {
      case NULL:
        return null;
      case DATE:
        return new Date(dis.readLong());
      case INT:
        return dis.readInt();
      case BOOL_TRUE:
        return Boolean.TRUE;
      case BOOL_FALSE:
        return Boolean.FALSE;
      case FLOAT:
        return dis.readFloat();
      case DOUBLE:
        return dis.readDouble();
      case LONG:
        return dis.readLong();
      case BYTE:
        return dis.readByte();
      case SHORT:
        return dis.readShort();
      case MAP:
        return readMap(dis);
      case SOLRDOC:
        return readSolrDocument(dis);
      case SOLRDOCLST:
        return readSolrDocumentList(dis);
      case BYTEARR:
        return readByteArray(dis);
      case ITERATOR:
        return readIterator(dis);
      case END:
        return END_OBJ;
      case SOLRINPUTDOC:
        return readSolrInputDocument(dis);
    }

    throw new RuntimeException("Unknown type " + tagByte);
  }

  public boolean writeKnownType(Object val) throws IOException {
    if (writePrimitive(val)) return true;
    if (val instanceof NamedList) {
      writeNamedList((NamedList<?>) val);
      return true;
    }
    if (val instanceof SolrDocumentList) { // SolrDocumentList is a List, so must come before List check
      writeSolrDocumentList((SolrDocumentList) val);
      return true;
    }
    if (val instanceof Collection) {
      writeArray((Collection) val);
      return true;
    }
    if (val instanceof Object[]) {
      writeArray((Object[]) val);
      return true;
    }
    if (val instanceof SolrDocument) {
      //this needs special treatment to know which fields are to be written
      if (resolver == null) {
        writeSolrDocument((SolrDocument) val);
      } else {
        Object retVal = resolver.resolve(val, this);
        if (retVal != null) {
          if (retVal instanceof SolrDocument) {
            writeSolrDocument((SolrDocument) retVal);
          } else {
            writeVal(retVal);
          }
        }
      }
      return true;
    }
    if (val instanceof SolrInputDocument) {
      writeSolrInputDocument((SolrInputDocument)val);
      return true;
    }
    if (val instanceof Map) {
      writeMap((Map) val);
      return true;
    }
    if (val instanceof Iterator) {
      writeIterator((Iterator) val);
      return true;
    }
    if (val instanceof Iterable) {
      writeIterator(((Iterable) val).iterator());
      return true;
    }
    return false;
  }

  public void writeTag(byte tag) throws IOException {
    daos.writeByte(tag);
  }

  public void writeTag(byte tag, int size) throws IOException {
    if ((tag & 0xe0) != 0) {
      if (size < 0x1f) {
        daos.writeByte(tag | size);
      } else {
        daos.writeByte(tag | 0x1f);
        writeVInt(size - 0x1f, daos);
      }
    } else {
      daos.writeByte(tag);
      writeVInt(size, daos);
    }
  }

  public void writeByteArray(byte[] arr, int offset, int len) throws IOException {
    writeTag(BYTEARR, len);
    daos.write(arr, offset, len);
  }

  public byte[] readByteArray(FastInputStream dis) throws IOException {
    byte[] arr = new byte[readVInt(dis)];
    dis.readFully(arr);
    return arr;
  }

  public void writeSolrDocument(SolrDocument doc) throws IOException {
    writeTag(SOLRDOC);
    writeTag(ORDERED_MAP, doc.size());
    for (Map.Entry<String, Object> entry : doc) {
      String name = entry.getKey();
      writeExternString(name);
      Object val = entry.getValue();
      writeVal(val);
    }
  }

  public SolrDocument readSolrDocument(FastInputStream dis) throws IOException {
    NamedList nl = (NamedList) readVal(dis);
    SolrDocument doc = new SolrDocument();
    for (int i = 0; i < nl.size(); i++) {
      String name = nl.getName(i);
      Object val = nl.getVal(i);
      doc.setField(name, val);
    }
    return doc;
  }

  public SolrDocumentList readSolrDocumentList(FastInputStream dis) throws IOException {
    SolrDocumentList solrDocs = new SolrDocumentList();
    List list = (List) readVal(dis);
    solrDocs.setNumFound((Long) list.get(0));
    solrDocs.setStart((Long) list.get(1));
    solrDocs.setMaxScore((Float) list.get(2));

    @SuppressWarnings("unchecked")
    List<SolrDocument> l = (List<SolrDocument>) readVal(dis);
    solrDocs.addAll(l);
    return solrDocs;
  }

  public void writeSolrDocumentList(SolrDocumentList docs)
          throws IOException {
    writeTag(SOLRDOCLST);
    List<Number> l = new ArrayList<Number>(3);
    l.add(docs.getNumFound());
    l.add(docs.getStart());
    l.add(docs.getMaxScore());
    writeArray(l);
    writeArray(docs);
  }

  public SolrInputDocument readSolrInputDocument(FastInputStream dis) throws IOException {
    int sz = readVInt(dis);
    float docBoost = (Float)readVal(dis);
    SolrInputDocument sdoc = new SolrInputDocument();
    sdoc.setDocumentBoost(docBoost);
    for (int i = 0; i < sz; i++) {
      float boost = 1.0f;
      String fieldName;
      Object boostOrFieldName = readVal(dis);
      if (boostOrFieldName instanceof Float) {
        boost = (Float)boostOrFieldName;
        fieldName = (String)readVal(dis);
      } else {
        fieldName = (String)boostOrFieldName;
      }
      Object fieldVal = readVal(dis);
      sdoc.setField(fieldName, fieldVal, boost);
    }
    return sdoc;
  }

  public void writeSolrInputDocument(SolrInputDocument sdoc) throws IOException {
    writeTag(SOLRINPUTDOC, sdoc.size());
    writeFloat(sdoc.getDocumentBoost());
    for (SolrInputField inputField : sdoc.values()) {
      if (inputField.getBoost() != 1.0f) {
        writeFloat(inputField.getBoost());
      }
      writeExternString(inputField.getName());
      writeVal(inputField.getValue());
    }
  }

  public Map<Object,Object> readMap(FastInputStream dis)
          throws IOException {
    int sz = readVInt(dis);
    Map<Object,Object> m = new LinkedHashMap<Object,Object>();
    for (int i = 0; i < sz; i++) {
      Object key = readVal(dis);
      Object val = readVal(dis);
      m.put(key, val);

    }
    return m;
  }

  public void writeIterator(Iterator iter) throws IOException {
    writeTag(ITERATOR);
    while (iter.hasNext()) {
      writeVal(iter.next());
    }
    writeVal(END_OBJ);
  }

  public List<Object> readIterator(FastInputStream fis) throws IOException {
    ArrayList<Object> l = new ArrayList<Object>();
    while (true) {
      Object o = readVal(fis);
      if (o == END_OBJ) break;
      l.add(o);
    }
    return l;
  }

  public void writeArray(List l) throws IOException {
    writeTag(ARR, l.size());
    for (int i = 0; i < l.size(); i++) {
      writeVal(l.get(i));
    }
  }

  public void writeArray(Collection coll) throws IOException {
    writeTag(ARR, coll.size());
    for (Object o : coll) {
      writeVal(o);
    }

  }

  public void writeArray(Object[] arr) throws IOException {
    writeTag(ARR, arr.length);
    for (int i = 0; i < arr.length; i++) {
      Object o = arr[i];
      writeVal(o);
    }
  }

  public List<Object> readArray(FastInputStream dis) throws IOException {
    int sz = readSize(dis);
    ArrayList<Object> l = new ArrayList<Object>(sz);
    for (int i = 0; i < sz; i++) {
      l.add(readVal(dis));
    }
    return l;
  }

  /**
   * write the string as tag+length, with length being the number of UTF-8 bytes
   */
  public void writeStr(String s) throws IOException {
    if (s == null) {
      writeTag(NULL);
      return;
    }
    int end = s.length();
    int maxSize = end * 4;
    if (bytes == null || bytes.length < maxSize) bytes = new byte[maxSize];
    int sz = ByteUtils.UTF16toUTF8(s, 0, end, bytes, 0);

    writeTag(STR, sz);
    daos.write(bytes, 0, sz);
  }

  byte[] bytes;
  CharArr arr = new CharArr();

  public String readStr(FastInputStream dis) throws IOException {
    int sz = readSize(dis);
    if (bytes == null || bytes.length < sz) bytes = new byte[sz];
    dis.readFully(bytes, 0, sz);

    arr.reset();
    ByteUtils.UTF8toUTF16(bytes, 0, sz, arr);
    return arr.toString();
  }

  public void writeInt(int val) throws IOException {
    if (val > 0) {
      int b = SINT | (val & 0x0f);

      if (val >= 0x0f) {
        b |= 0x10;
        daos.writeByte(b);
        writeVInt(val >>> 4, daos);
      } else {
        daos.writeByte(b);
      }

    } else {
      daos.writeByte(INT);
      daos.writeInt(val);
    }
  }

  public int readSmallInt(FastInputStream dis) throws IOException {
    int v = tagByte & 0x0F;
    if ((tagByte & 0x10) != 0)
      v = (readVInt(dis) << 4) | v;
    return v;
  }

  public void writeLong(long val) throws IOException {
    if ((val & 0xff00000000000000L) == 0) {
      int b = SLONG | ((int) val & 0x0f);
      if (val >= 0x0f) {
        b |= 0x10;
        daos.writeByte(b);
        writeVLong(val >>> 4, daos);
      } else {
        daos.writeByte(b);
      }
    } else {
      daos.writeByte(LONG);
      daos.writeLong(val);
    }
  }

  public long readSmallLong(FastInputStream dis) throws IOException {
    long v = tagByte & 0x0F;
    if ((tagByte & 0x10) != 0)
      v = (readVLong(dis) << 4) | v;
    return v;
  }

  public void writeFloat(float val) throws IOException {
    daos.writeByte(FLOAT);
    daos.writeFloat(val);
  }

  public boolean writePrimitive(Object val) throws IOException {
    if (val == null) {
      daos.writeByte(NULL);
      return true;
    } else if (val instanceof String) {
      writeStr((String) val);
      return true;
    } else if (val instanceof Number) {

      if (val instanceof Integer) {
        writeInt(((Integer) val).intValue());
        return true;
      } else if (val instanceof Long) {
        writeLong(((Long) val).longValue());
        return true;
      } else if (val instanceof Float) {
        writeFloat(((Float) val).floatValue());
        return true;
      } else if (val instanceof Double) {
        daos.writeByte(DOUBLE);
        daos.writeDouble(((Double) val).doubleValue());
        return true;
      } else if (val instanceof Byte) {
        daos.writeByte(BYTE);
        daos.writeByte(((Byte) val).intValue());
        return true;
      } else if (val instanceof Short) {
        daos.writeByte(SHORT);
        daos.writeShort(((Short) val).intValue());
        return true;
      }
      return false;

    } else if (val instanceof Date) {
      daos.writeByte(DATE);
      daos.writeLong(((Date) val).getTime());
      return true;
    } else if (val instanceof Boolean) {
      if ((Boolean) val) daos.writeByte(BOOL_TRUE);
      else daos.writeByte(BOOL_FALSE);
      return true;
    } else if (val instanceof byte[]) {
      writeByteArray((byte[]) val, 0, ((byte[]) val).length);
      return true;
    } else if (val instanceof ByteBuffer) {
      ByteBuffer buf = (ByteBuffer) val;
      writeByteArray(buf.array(),buf.position(),buf.limit() - buf.position());
      return true;
    } else if (val == END_OBJ) {
      writeTag(END);
      return true;
    }
    return false;
  }

  public void writeMap(Map<?,?> val) throws IOException {
    writeTag(MAP, val.size());
    for (Map.Entry<?,?> entry : val.entrySet()) {
      Object key = entry.getKey();
      if (key instanceof String) {
        writeExternString((String) key);
      } else {
        writeVal(key);
      }
      writeVal(entry.getValue());
    }
  }

  public int readSize(FastInputStream in) throws IOException {
    int sz = tagByte & 0x1f;
    if (sz == 0x1f) sz += readVInt(in);
    return sz;
  }

  /**
   * Special method for variable length int (copied from lucene). Usually used for writing the length of a
   * collection/array/map In most of the cases the length can be represented in one byte (length < 127) so it saves 3
   * bytes/object
   *
   * @throws IOException If there is a low-level I/O error.
   */
  public static void writeVInt(int i, FastOutputStream out) throws IOException {
    while ((i & ~0x7F) != 0) {
      out.writeByte((byte) ((i & 0x7f) | 0x80));
      i >>>= 7;
    }
    out.writeByte((byte) i);
  }

  /**
   * The counterpart for {@link #writeVInt(int, FastOutputStream)}
   *
   * @throws IOException If there is a low-level I/O error.
   */
  public static int readVInt(FastInputStream in) throws IOException {
    byte b = in.readByte();
    int i = b & 0x7F;
    for (int shift = 7; (b & 0x80) != 0; shift += 7) {
      b = in.readByte();
      i |= (b & 0x7F) << shift;
    }
    return i;
  }

  public static void writeVLong(long i, FastOutputStream out) throws IOException {
    while ((i & ~0x7F) != 0) {
      out.writeByte((byte) ((i & 0x7f) | 0x80));
      i >>>= 7;
    }
    out.writeByte((byte) i);
  }

  public static long readVLong(FastInputStream in) throws IOException {
    byte b = in.readByte();
    long i = b & 0x7F;
    for (int shift = 7; (b & 0x80) != 0; shift += 7) {
      b = in.readByte();
      i |= (long) (b & 0x7F) << shift;
    }
    return i;
  }

  private int stringsCount = 0;
  private Map<String, Integer> stringsMap;
  private List<String> stringsList;

  public void writeExternString(String s) throws IOException {
    if (s == null) {
      writeTag(NULL);
      return;
    }
    Integer idx = stringsMap == null ? null : stringsMap.get(s);
    if (idx == null) idx = 0;
    writeTag(EXTERN_STRING, idx);
    if (idx == 0) {
      writeStr(s);
      if (stringsMap == null) stringsMap = new HashMap<String, Integer>();
      stringsMap.put(s, ++stringsCount);
    }

  }

  public String readExternString(FastInputStream fis) throws IOException {
    int idx = readSize(fis);
    if (idx != 0) {// idx != 0 is the index of the extern string
      return stringsList.get(idx - 1);
    } else {// idx == 0 means it has a string value
      String s = (String) readVal(fis);
      if (stringsList == null) stringsList = new ArrayList<String>();
      stringsList.add(s);
      return s;
    }
  }

  public static interface ObjectResolver {
    public Object resolve(Object o, JavaBinCodec codec) throws IOException;
  }

}


text:
Get a Linux-Shell on Windows, by starting this image in Docker for Windows. Currently using fish shell.

## Install
Be sure, that you can run docker-Commands on your local windows command line.
This is tested with Docker for Windows.

Build the image:
`git clone https://github.com/kekru/docker-linuxshell-on-windows.git`
`docker build -t shell docker-shell-for-work`

Then open `RegisterContextMenu.reg` with a double-click. After that, you'll find a "Docker Shell"-entry in your Explorer's context menu, when you click on an empty space in a directory.
The shell will open and your current directory is  mounted in /data inside the shell's container.

## Remove context menu entry
Run "regedit" in Windows. Navigate to HKEY_CLASSES_ROOT\Directory\Background\shell and delete "DockerShellKeKru"


text:
package com.palantir.atlasdb;

import java.util.Set;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;

import com.palantir.atlasdb.keyvalue.api.KeyValueService;
import com.palantir.atlasdb.keyvalue.impl.InMemoryKeyValueService;
import com.palantir.atlasdb.keyvalue.impl.NamespacedKeyValueServices;
import com.palantir.atlasdb.keyvalue.impl.StatsTrackingKeyValueService;
import com.palantir.atlasdb.keyvalue.impl.TrackingKeyValueService;
import com.palantir.atlasdb.schema.UpgradeSchema;
import com.palantir.atlasdb.table.description.Schemas;
import com.palantir.atlasdb.transaction.api.AtlasDbConstraintCheckingMode;
import com.palantir.atlasdb.transaction.impl.CachingTestTransactionManager;
import com.palantir.atlasdb.transaction.impl.ConflictDetectionManager;
import com.palantir.atlasdb.transaction.impl.ConflictDetectionManagers;
import com.palantir.atlasdb.transaction.impl.SnapshotTransactionManager;
import com.palantir.atlasdb.transaction.impl.SweepStrategyManager;
import com.palantir.atlasdb.transaction.impl.SweepStrategyManagers;
import com.palantir.atlasdb.transaction.impl.TestTransactionManager;
import com.palantir.atlasdb.transaction.impl.TestTransactionManagerImpl;
import com.palantir.atlasdb.transaction.service.TransactionService;
import com.palantir.atlasdb.transaction.service.TransactionServices;
import com.palantir.common.concurrent.PTExecutors;
import com.palantir.lock.LockClient;
import com.palantir.lock.LockServerOptions;
import com.palantir.lock.impl.LockServiceImpl;
import com.palantir.timestamp.InMemoryTimestampService;
import com.palantir.timestamp.TimestampService;

public class AtlasDbTestCase {
    protected static LockClient lockClient;
    protected static LockServiceImpl lockService;

    protected StatsTrackingKeyValueService keyValueServiceWithStats;
    protected TrackingKeyValueService keyValueService;
    protected TimestampService timestampService;
    protected ConflictDetectionManager conflictDetectionManager;
    protected SweepStrategyManager sweepStrategyManager;
    protected TestTransactionManager txManager;
    protected TransactionService transactionService;

    @BeforeClass
    public static void setupLockClient() {
        if (lockClient == null) {
            lockClient = LockClient.of("fake lock client");
        }
    }

    @BeforeClass
    public static void setupLockService() {
        if (lockService == null) {
            lockService = LockServiceImpl.create(new LockServerOptions() {
                private static final long serialVersionUID = 1L;

                @Override
                public boolean isStandaloneServer() {
                    return false;
                }
            });
        }
    }

    @AfterClass
    public static void tearDownLockService() {
        if (lockService != null) {
            lockService.close();
            lockService = null;
        }
    }

    @Before
    public void setUp() throws Exception {
        timestampService = new InMemoryTimestampService();
        KeyValueService kvs = NamespacedKeyValueServices.wrapWithStaticNamespaceMappingKvs(getBaseKeyValueService());
        keyValueServiceWithStats = new StatsTrackingKeyValueService(kvs);
        keyValueService = new TrackingKeyValueService(keyValueServiceWithStats);
        keyValueService.initializeFromFreshInstance();
        SnapshotTransactionManager.createTables(kvs);
        Schemas.createTablesAndIndexes(UpgradeSchema.INSTANCE.getLatestSchema(), kvs);
        transactionService = TransactionServices.createTransactionService(kvs);

        conflictDetectionManager = ConflictDetectionManagers.createDefault(keyValueService);
        sweepStrategyManager = SweepStrategyManagers.createDefault(keyValueService);

        txManager = new TestTransactionManagerImpl(
                keyValueService,
                timestampService,
                lockClient,
                lockService,
                transactionService,
                conflictDetectionManager,
                sweepStrategyManager);
        txManager = new CachingTestTransactionManager(txManager);
    }

    protected KeyValueService getBaseKeyValueService() {
        return new InMemoryKeyValueService(false, PTExecutors.newSingleThreadExecutor(PTExecutors.newNamedThreadFactory(true)));
    }

    @After
    public void tearDown() throws Exception {
        // JUnit keeps instantiated test cases in memory, so we need to null out
        // some fields to prevent OOMs.
        keyValueService.teardown();
        keyValueService = null;
        timestampService = null;
        txManager = null;
    }

    protected void setConstraintCheckingMode(AtlasDbConstraintCheckingMode mode) {
        txManager = new TestTransactionManagerImpl(keyValueService,
                timestampService, lockClient, lockService, transactionService, mode);
    }

    protected void createTable(String tableName) {
        keyValueService.createTable(tableName, Integer.MAX_VALUE);
    }

    protected void deleteTable(String tableName) {
        keyValueService.dropTable(tableName);
    }

    protected void clearTablesWrittenTo() {
        keyValueService.clearTablesWrittenTo();
    }

    protected void clearTablesReadFrom() {
        keyValueService.clearTablesReadFrom();
    }

    protected Set<String> getTablesWrittenTo() {
        return keyValueService.getTablesWrittenTo();
    }

    protected Set<String> getTablesReadFrom() {
        return keyValueService.getTablesReadFrom();
    }

    protected boolean wasTableWrittenTo(String tableName) {
        return getTablesWrittenTo().contains(tableName);
    }

    protected boolean wasTableReadFrom(String tableName) {
        return getTablesReadFrom().contains(tableName);
    }
}


text:
const SignedSoftwareCertificate_Schema = {
    name: "SignedSoftwareCertificate",
    fields: [
        { name: "certificateData", fieldType: "ByteString", documentation: "The data of the certificate." },
        { name: "signature", fieldType: "ByteString", documentation: "The digital signature."}
    ]
};
export {SignedSoftwareCertificate_Schema};


text:
// <copyright file="DiceNotationUtility.cs" company="Patrick Maughan">
// Copyright (c) Patrick Maughan. All rights reserved.
// </copyright>

namespace FireAndManeuver.GameModel
{
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Linq;
    using OnePlat.DiceNotation;
    using OnePlat.DiceNotation.DiceTerms;
    using OnePlat.DiceNotation.DieRoller;

    public class DiceNotationUtility : IDiceUtility
    {
        private RandomDieRoller roller = new RandomDieRoller();
        private IDice dice = new Dice();

        public int RollD6()
        {
            var r = this.dice.Roll("1d6", this.roller);

            Debug.WriteLine($"RollD6: {r.Value}");

            return (int)r.Value;
        }

        public List<int> RollXDY(int numberOfDice, int numberOfSides)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<int> RollStandardDice(int numberOfDice)
        {
            return this.dice.Roll($"{numberOfDice}d6", this.roller).Results.Select(r => r.Value);
        }

        public IEnumerable<int> RollExplodingDice(int numberOfDice, int numberOfSides = 6, int explodeMinimum = 6)
        {
            var r = this.dice.Roll($"{numberOfDice}d{numberOfSides}!{explodeMinimum}", this.roller);

            Debug.WriteLine($"RollExplodingDice: ({string.Join(", ", r.Results.Select(roll => roll.Value))})");

            IEnumerable<int> result = r.Results.Select(d => d.Value);

            return result;
        }

        public int RollPercentile()
        {
            var r = this.dice.Roll("1d100", this.roller);

            Debug.WriteLine($"RollPercentile: {r.Value}");

            return r.Value;
        }

        public int RollSuccesses(int numberOfDice, int dRM = 0, int targetNumber = 4, int doubleSuccessNumber = 6)
        {
            var rolls = this.dice.Roll($"{numberOfDice}(d6-{dRM})", this.roller);

            var standardSuccesses = rolls.Results.Where(i => i.Value >= targetNumber).Count();
            var extraSuccesses = rolls.Results.Where(i => i.Value >= doubleSuccessNumber).Count();

            return standardSuccesses + extraSuccesses;
        }
    }
}


text:
var socketio = require('socket.io');
var mqtt = require('mqtt');
var x10 = require('node-x10-comm');
var x10device = x10.device();

const PAGE_WIDTH = 400;
const PAGE_HEIGHT = 200;

var eventSocket = null;

var Server = function() {
}

Server.getDefaults = function() {
  return { 'title': 'mqtt - X10 bridge' };
}

var replacements;
Server.getTemplateReplacments = function() {
  if (replacements === undefined) {
    var config = Server.config;

    replacements = [{ 'key': '<DASHBOARD_TITLE>', 'value': Server.config.title },
                    { 'key': '<UNIQUE_WINDOW_ID>', 'value': Server.config.title },
                    { 'key': '<PAGE_WIDTH>', 'value': PAGE_WIDTH },
                    { 'key': '<PAGE_HEIGHT>', 'value': PAGE_HEIGHT }];

  }
  return replacements;
}

var recentActivity = new Array()
var pushActivity = function(entry) {
  var newEntry = new Date() + ':' + entry;
  recentActivity.push(newEntry);
  console.log(newEntry);
  eventSocket.emit('recent_activity', newEntry);
  if (recentActivity.length > Server.config.MaxRecentActivity) {
    recentActivity.splice(0,1);
  }
}

Server.startServer = function(server) {

  // print out the available ports to help setup
  x10.listPorts(function (ports) {
    console.log("Available ports");
    for(var i = 0; i < ports.length; i++) {
      console.log('  ' + ports[i].comName);
    }
    console.log();
  });

  x10device.open(Server.config.serialPort, () => {
    console.log('opened X10 device');

    var sendX10Command = function(house, module, command) {
      var messageBody = `H[${house}], M[${module}], C[${command}]`;
      x10device.sendCommand(house.charCodeAt(0) - 'A'.charCodeAt(0), module - 1, parseInt(command), () => {
        pushActivity('sent: ' + messageBody);
      }, () => {
        pushActivity('send failed: ' +  messageBody);
      });
    }

    eventSocket = socketio.listen(server);

    eventSocket.on('connection', function(client) {
      for (var i = 0; i < recentActivity.length; i++) {
        eventSocket.to(client.id).emit('recent_activity', recentActivity[i]);
      }

      client.on('sendX10command', function(event) {
        sendX10Command(event.house, event.module, event.command);
      });
    });

    // setup mqtt
    var mqttOptions;
    if (Server.config.mqttServerUrl.indexOf('mqtts') > -1) {
      mqttOptions = { key: fs.readFileSync(path.join(__dirname, 'mqttclient', '/client.key')),
                      cert: fs.readFileSync(path.join(__dirname, 'mqttclient', '/client.cert')),
                      ca: fs.readFileSync(path.join(__dirname, 'mqttclient', '/ca.cert')),
                      checkServerIdentity: function() { return undefined }
      }
    }

    var mqttClient = mqtt.connect(Server.config.mqttServerUrl, mqttOptions);
    mqttClient.on('connect', function() {
      mqttClient.subscribe(Server.config.topic);
    });

    mqttClient.on('message', function(topic, message) {
      // parse out the House code, module code and command which are in the
      // format house,module,command
      var components = message.toString().split(':');
      var delay = components[1];
      var values = components[0].toString().replace(/ /g,'').split(',');
      if (!delay) {
        // no delay specified so just send immediately
        delay = 0;
      }

      setTimeout(function() {
        sendX10Command(values[0], values[1], values[2]);
      }, delay);
    });
  },
  (err) => {
    console.log(err);
  });
}

if (require.main === module) {
  var path = require('path');
  var microAppFramework = require('micro-app-framework');
  microAppFramework(path.join(__dirname), Server);
}

module.exports = Server;


text:
package com.example.fw;

import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class ApplicationManager {

	public WebDriver driver;
	public String baseUrl;

	private NavigationHelper navigationHelper;
	private GroupHelper groupHelper;
	private ContactHelper contactHelper;

	public ApplicationManager() {
		driver = new FirefoxDriver();
	    baseUrl = "http://localhost";
	    driver.manage().timeouts().implicitlyWait(4, TimeUnit.SECONDS);
	    driver.get(baseUrl + "/addressbookv4.1.4/");
	    driver.manage().window().maximize();
	}

	public void stop() {
		driver.quit();
	}

	public NavigationHelper navigateTo() {
		if (navigationHelper == null)
			navigationHelper = new NavigationHelper(this);
		return navigationHelper;
	}

	public GroupHelper getGroupHelper() {
		if (groupHelper == null)
			groupHelper = new GroupHelper(this);
		return groupHelper;
	}

	public ContactHelper getContactHelper() {
		if (contactHelper == null)
			contactHelper = new ContactHelper(this);
		return contactHelper;
	}
}


text:
layout: post
title: Datura Folk 2
tags:
- folk
- live
- festival
- valencia
- matisse
redirect_from: "blog/27/datura-folk-2/"
---

El fin de semana del 6 y 7 de mayo se celebra la segunda edición del minifestival Datura Folk, este año en Sala Matisse. Y la verdad es que a la gente de Discos Monterey les ha quedado un cartel muy apañao:

6 de mayo (Sesión Eléctrica)
Apertura de puertas: 20 horas
21.30 horas: Steven Munar and The Miracle Band
22.30 horas: Tórtel
23.45 horas: Hola A Todo El Mundo

7 de mayo (Sesión Acústica)
Apertura de puertas: 20 horas
20.30 horas: Manolo Tarancón
22.15 horas: Bob Theil
23.45 horas: Alondra Bentley

+ info: www.daturafolkfest.es