text:
local MATERIA_STEAL = 0x24
local MATERIA_MORPH = 0x28
local MATERIA_ENEMY_SKILL = 0x2C

local ITEM_TENT = 0x46
local ITEM_POWER_SOURCE = 0x47
local ITEM_GUARD_SOURCE = 0x48
local ITEM_MAGIC_SOURCE = 0x49
local ITEM_MIND_SOURCE = 0x4A
local ITEM_SPEED_SOURCE = 0x4B
local ITEM_LUCK_SOURCE = 0x4C

local readCharacterByte = function(character_index, offset)
  return mainmemory.read_u8(0x09C738 + (character_index * 0x84) + offset)
end

local readCharacterWord = function(character_index, offset)
  return mainmemory.read_u16_le(0x09C738 + (character_index * 0x84) + offset)
end

function updateGameContext(game_context)
  game_context.is_in_overworld = mainmemory.read_u8(0x0E55FC) == 0x01 or mainmemory.read_u8(0x0E55FC) == 248

  game_context.menu = {}
  game_context.menu.is_in_menu = mainmemory.read_u8(0x062C27) == 0x01

  if game_context.menu.is_in_menu then
    game_context.menu.main_menu_index = mainmemory.read_u8(0x09A0D3)
    game_context.menu.is_selecting_character = mainmemory.read_u8(0x062F64) == 0x01
    game_context.menu.active_menu_page = mainmemory.read_u8(0x062DD4)
    game_context.menu.selected_character_index = mainmemory.read_u8(0x09A0E5)
    game_context.menu.magic_submenu = mainmemory.read_u8(0x1D2930)
    game_context.menu.magic_spell_x = mainmemory.read_u8(0x1D2AAA)
    game_context.menu.magic_spell_y = mainmemory.read_u8(0x1D2AAB)
    game_context.menu.magic_selected_character_index = mainmemory.read_u8(0x1D2A99)
    game_context.menu.is_accepting_xp = mainmemory.read_u8(0x062DDA) == 0x00
    game_context.menu.is_accepting_items = mainmemory.read_u8(0x0513B6) == 0x05
    game_context.menu.item_top_item = mainmemory.read_u8(0x1D3DF0)
    game_context.menu.item_selected_item = mainmemory.read_u8(0x1D3DF9)
    game_context.menu.item_submenu = mainmemory.read_u8(0x1D3E48)
    game_context.menu.item_selected_character_index = mainmemory.read_u8(0x1D3E0B)
  end

  game_context.characters = {}

  -- read character data
  for character_index = 0,8 do
    local character = {}

    character.id = readCharacterByte(character_index, 0x00)
    character.level = readCharacterByte(character_index, 0x01)

    character.strength = readCharacterByte(character_index, 0x02)
    character.vitality = readCharacterByte(character_index, 0x03)
    character.magic = readCharacterByte(character_index, 0x04)
    character.spirit = readCharacterByte(character_index, 0x05)
    character.dexterity = readCharacterByte(character_index, 0x06)
    character.luck = readCharacterByte(character_index, 0x07)

    character.strength_bonus = readCharacterByte(character_index, 0x08)
    character.vitality_bonus = readCharacterByte(character_index, 0x09)
    character.magic_bonus = readCharacterByte(character_index, 0x0A)
    character.spirit_bonus = readCharacterByte(character_index, 0x0B)
    character.dexterity_bonus = readCharacterByte(character_index, 0x0C)
    character.luck_bonus = readCharacterByte(character_index, 0x0D)

    character.limit_break = readCharacterByte(character_index, 0x0F) == 0xFF

    character.number_of_kills = readCharacterWord(character_index, 0x24)
    character.current_hp = readCharacterWord(character_index, 0x2C)
    character.max_hp = readCharacterWord(character_index, 0x38)
    character.current_mp = readCharacterWord(character_index, 0x30)
    character.max_mp = readCharacterWord(character_index, 0x3A)

    --console.writeline(character_index .. ": " .. character.id .. ", " .. character.level .. ", " .. character.current_hp .. "/" .. character.max_hp .. ", " .. character.current_mp .. "/" .. character.max_mp)

    --character.status = readCharacterByte(character_index, 0x14)

    for materia_index = 0,15 do
      local materia_id = mainmemory.read_u8(0x09C738 + (character_index * 0x84) + 0x40 + (materia_index * 4))
      if materia_id == MATERIA_STEAL then
        character.has_materia_steal = true
      end

      if materia_id == MATERIA_MORPH then
        character.has_materia_morph = true
      end

      if materia_id == MATERIA_ENEMY_SKILL then
        character.has_materia_enemy_skill = true
      end
    end

    game_context.characters[character.id] = character
  end

  game_context.party = {}
  game_context.party[0] = game_context.characters[mainmemory.read_u8(0x09CBDC)]
  game_context.party[1] = game_context.characters[mainmemory.read_u8(0x09CBDD)]
  game_context.party[2] = game_context.characters[mainmemory.read_u8(0x09CBDE)]

  local has_level_change = false
  game_context.party_levels = game_context.party_levels or { 0, 0, 0 }
  if game_context.party[0].level ~= game_context.party_levels[0] then
    game_context.party_levels[0] = game_context.party[0].level
    has_level_change = true
  end
  if game_context.party[1].level ~= game_context.party_levels[1] then
    game_context.party_levels[1] = game_context.party[1].level
    has_level_change = true
  end
  if game_context.party[2].level ~= game_context.party_levels[2] then
    game_context.party_levels[2] = game_context.party[2].level
    has_level_change = true
  end

  if has_level_change then
    console.writeline("levels: " .. game_context.party[0].level .. " / " .. game_context.party[1].level .. " / " .. game_context.party[2].level)
  end

  -- read battle data
  game_context.battle = {}
  game_context.battle.is_in_battle = (mainmemory.read_u16_le(0x051400) == 0x01) or (mainmemory.read_u16_le(0x051400) == 4308) -- 4308 == enemy skill menu

  if game_context.battle.is_in_battle then
    game_context.battle.active_character = mainmemory.read_u8(0x0F38A0)
    game_context.battle.active_menu = mainmemory.read_u8(0x0F3896)
    game_context.battle.is_waiting = game_context.battle.active_menu == 255
    game_context.battle.is_targeting = mainmemory.read_u8(0x0F311C) == 1
    game_context.battle.enemy_count = mainmemory.read_u16_le(0x0F7E04)

    game_context.party[0].main_menu_x = mainmemory.read_u8(0x0F90BE)
    game_context.party[0].main_menu_y = mainmemory.read_u8(0x0F90BF)
    game_context.party[0].menu_enemy_skill_y = mainmemory.read_u8(0x0F9107)

    game_context.party[1].main_menu_x = mainmemory.read_u8(0x0F92FE)
    game_context.party[1].main_menu_y = mainmemory.read_u8(0x0F92FF)
    game_context.party[1].menu_enemy_skill_y = mainmemory.read_u8(0x0F9347)

    game_context.party[2].main_menu_x = mainmemory.read_u8(0x0F953E)
    game_context.party[2].main_menu_y = mainmemory.read_u8(0x0F953F)
    game_context.party[2].menu_enemy_skill_y = mainmemory.read_u8(0x0F9587)

    game_context.battle.enemies = {}
    for enemy_index = 0,game_context.battle.enemy_count do
      local enemy = {}

      enemy.current_hp = mainmemory.read_u16_le(0x0F85AC + (enemy_index * 0x68))
      enemy.max_hp = mainmemory.read_u16_le(0x0F85B0 + (enemy_index * 0x68))

      game_context.battle.enemies[enemy_index] = enemy
    end
  else
    game_context.items = {}

    for item_index = 0,319 do
      local item_id = mainmemory.read_u8(0x9CBE0 + item_index * 2)
      local item_quantity = bit.rshift(mainmemory.read_u8(0x9CBE1 + item_index * 2), 1)
      if item_id == ITEM_TENT then
        game_context.items.tent_index = item_index
        game_context.items.tent_quantity = item_quantity
      elseif item_id == ITEM_GUARD_SOURCE then
        game_context.items.guard_source_index = item_index
        game_context.items.guard_source_quantity = item_quantity
      elseif item_id == ITEM_POWER_SOURCE then
        game_context.items.power_source_index = item_index
        game_context.items.power_source_quantity = item_quantity
      elseif item_id == ITEM_MAGIC_SOURCE then
        game_context.items.magic_source_index = item_index
        game_context.items.magic_source_quantity = item_quantity
      elseif item_id == ITEM_MIND_SOURCE then
        game_context.items.mind_source_index = item_index
        game_context.items.mind_source_quantity = item_quantity
      elseif item_id == ITEM_SPEED_SOURCE then
        game_context.items.speed_source_index = item_index
        game_context.items.speed_source_quantity = item_quantity
      elseif item_id == ITEM_LUCK_SOURCE then
        game_context.items.luck_source_index = item_index
        game_context.items.luck_source_quantity = item_quantity
      end
    end
  end
end

-- this function should perform common aggregations on the game_context so they don't have to be
-- recalculated by each state. it should NOT directly indicate which states should run
function updateBotContext(config, game_context, bot_context)
  bot_context.has_uncapped_levels = false

  local stat_item_high = 90
  local stat_item_low = 10

  if game_context.battle.is_in_battle then
    game_context.should_use_stat_items = false
  else
    if not bot_context.should_use_stat_items then
      if (game_context.items.power_source_index ~= nil and game_context.items.power_source_quantity >= stat_item_high)
        or (game_context.items.guard_source_index ~= nil and game_context.items.guard_source_quantity >= stat_item_high)
        or (game_context.items.magic_source_index ~= nil and game_context.items.magic_source_quantity >= stat_item_high)
        or (game_context.items.mind_source_index ~= nil and game_context.items.mind_source_quantity >= stat_item_high)
        or (game_context.items.speed_source_index ~= nil and game_context.items.speed_source_quantity >= stat_item_high)
        or (game_context.items.luck_source_index ~= nil and game_context.items.luck_source_quantity >= stat_item_high) then
        bot_context.should_use_stat_items = true
        console.writeline('using stat items')
      end
    else
      if (game_context.items.power_source_index ~= nil and game_context.items.power_source_quantity <= stat_item_low)
        and (game_context.items.guard_source_index ~= nil and game_context.items.guard_source_quantity <= stat_item_low)
        and (game_context.items.magic_source_index ~= nil and game_context.items.magic_source_quantity <= stat_item_low)
        and (game_context.items.mind_source_index ~= nil and game_context.items.mind_source_quantity <= stat_item_low)
        and (game_context.items.speed_source_index ~= nil and game_context.items.speed_source_quantity <= stat_item_low)
        and (game_context.items.luck_source_index ~= nil and game_context.items.luck_source_quantity <= stat_item_low) then
        bot_context.should_use_stat_items = false
      end
    end
  end

  for character_index = 0,2 do
    local character = game_context.party[character_index]

    -- check for uncapped levels
    if character.level < config.TARGET_LEVEL then
      bot_context.has_uncapped_levels = true
    end

    if not game_context.battle.is_in_battle then
      if bot_context.should_use_stat_items then
        if game_context.items.power_source_index ~= nil and game_context.items.power_source_quantity > stat_item_low then
          if character.strength + character.strength_bonus < 255 then
            character.has_uncapped_strength = true
          end
        end

        if game_context.items.guard_source_index ~= nil and game_context.items.guard_source_quantity > stat_item_low then
          if character.vitality + character.vitality_bonus < 255 then
            character.has_uncapped_vitality = true
          end
        end

        if game_context.items.magic_source_index ~= nil and game_context.items.magic_source_quantity > stat_item_low then
          if character.magic + character.magic_bonus < 255 then
            character.has_uncapped_magic = true
          end
        end

        if game_context.items.mind_source_index ~= nil and game_context.items.mind_source_quantity > stat_item_low then
          if character.spirit + character.spirit_bonus < 255 then
            character.has_uncapped_spirit = true
          end
        end

        if game_context.items.speed_source_index ~= nil and game_context.items.speed_source_quantity > stat_item_low then
          if character.dexterity + character.dexterity_bonus < 255 then
            character.has_uncapped_dexterity = true
          end
        end

        if game_context.items.luck_source_index ~= nil and game_context.items.luck_source_quantity > stat_item_low then
          if character.luck + character.luck_bonus < 255 then
            character.has_uncapped_luck = true
          end
        end
      end
    end
  end

  bot_context.reload_count = bot_context.reload_count or 0

  return bot_context
end


text:
package com.chainstaysoftware.controls.drawerpanefx;

import javafx.scene.Node;
import javafx.scene.image.Image;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;

import java.net.URL;
import java.util.Collections;
import java.util.List;
import java.util.Optional;

/**
 * Base class for a node that provides content to include within a
 * drawer within the {@link DrawerPane}. The class also provides title text
 * and an icon to include within the show/hide button that is displayed within
 * a {@link DrawerPane} toolbar.
 */
public class DrawerNode extends Pane {
   private final Node contents;
   private final String title;
   private final Image icon;
   private final boolean canFloat;
   private final URL floatStyleSheet;
   private final List<Position> validPositions;

   private boolean isFloating;
   private Optional<Double> floatingX = Optional.empty();
   private Optional<Double> floatingY = Optional.empty();

   /**
    * Constructor. Defaults icon to null and canFloat to True.
    * @param contents Node to display when the drawer is open.
    * @param title Title to show on the drawer show/hide button.
    */
   public DrawerNode(final Node contents,
                     final String title) {
      this(contents, title, null, true, null, Collections.emptyList());
   }

   /**
    * Constructor
    * @param contents Node to display when the drawer is open.
    * @param title Title to show on the drawer show/hide button.
    * @param icon Icon to show on the drawer show/hide button. Can be null.
    * @param canFloat True if the contents can be detached from the {@link DrawerPane}
*                 and contained within its own window.
    * @param floatStyleSheet URL to style sheet to attach to scene when
    *                        the {@link DrawerNode} is floating. Null indicates none.
    * @param validPositions List of sides that this {@link DrawerNode} can
    *                       be positioned at. Empty list indicates that all
    */
   public DrawerNode(final Node contents,
                     final String title,
                     final Image icon,
                     final boolean canFloat,
                     final URL floatStyleSheet,
                     final List<Position> validPositions) {
      if (contents == null) {
         throw new IllegalArgumentException("contents must not be null");
      }

      if (title == null) {
         throw new IllegalArgumentException("title must not be null");
      }

      this.contents = contents;
      this.title = title;
      this.icon = icon;
      this.canFloat = canFloat;
      this.floatStyleSheet = floatStyleSheet;
      this.validPositions = Collections.unmodifiableList(validPositions);

      final VBox vBox = new VBox();
      vBox.setId("DrawerNodeVbox-" + title);
      vBox.getChildren().addAll(contents);

      getChildren().add(vBox);
   }

   /**
    * {@link Node} that this {@link DrawerNode} wraps
    */
   public Node getContents() {
      return contents;
   }

   /**
    * Title to use for show/hide button.
    */
   public String getTitle() {
      return title;
   }

   /**
    * Icon to use for show/hide button.
    */
   public Image getIcon() {
      return icon;
   }

   /**
    * True if this instance is currently floating (detached from the pane).
    */
   public boolean isFloating() {
      return isFloating;
   }

   /**
    * Sets the floating state for this instance.
    */
   public void setFloating(final boolean floating) {
      if (!canFloat && floating) {
         throw new IllegalArgumentException("Cannot set floating to true when canFloat is false!");
      }

      isFloating = floating;
   }

   /**
    * X value to use for the Stage that hosts the {@link DrawerNode} when floating.
    */
   public void setFloatingX(final double x) {
      floatingX = Optional.of(x);
   }

   /**
    * The last X value of the Stage that last hosted the {@link DrawerNode} when floating.
    */
   public Optional<Double> getFloatingX() {
      return floatingX;
   }

   /**
    * Y value to use for the Stage that hosts the {@link DrawerNode} when floating.
    */
   public void setFloatingY(final double y) {
      floatingY = Optional.of(y);
   }

   /**
    * The last Y value of the Stage that last hosted the {@link DrawerNode} when floating.
    */
   public Optional<Double> getFloatingY() {
      return floatingY;
   }

   /**
    * True if this instance can be detached from the owning {@link DrawerPane}.
    * False otherwise.
    */
   public boolean canFloat() {
      return canFloat;
   }

   public Optional<URL> getFloatStyleSheet() {
      return Optional.ofNullable(floatStyleSheet);
   }

   /**
    * A list of valid {@link Position}s for this instance.
    */
   public List<Position> getValidPositions() {
      return validPositions;
   }

   /**
    * True if this instance can be placed at the passed in {@link Position}.
    */
   public boolean isValidPosition(final Position position) {
      return position != null && (validPositions.isEmpty() || validPositions.contains(position));
   }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

class Setup
{
    public $currentStep = 0;
    public $setupEnabled = false;

    public function __construct($reload_config = false)
    {
        // config.php not loading normally because of a cache issue?
        if ($reload_config) $this->reloadConfig();

        $this->loadConfigInfo();
    }

    protected function loadConfigInfo()
    {
        global $config;

        $this->currentStep = (isset($config['setup_step']))
            ? $config['setup_step']
            : 0;
        $this->setupEnabled = (isset($config['setup_enabled']) &&
            $config['setup_enabled'] === true);
    }

    protected function reloadConfig()
    {
        global $config;

        // manually load and execute config file
        if (file_exists(dirname(__FILE__) . '/../config.php')) {
            $settings = file_get_contents(dirname(__FILE__) . '/../config.php');
            $settings = str_replace('<?php', '', $settings);
            eval($settings);
            unset($settings);
        }
    }

    public function requireSetupEnabled($redirect = false)
    {
        // redirect user to main page if not signed in
        if (!$this->setupEnabled) {
            // set the response header
            if ($redirect === true) {
                header("Location: /");
            } else {
                header("HTTP/1.1 500 Internal Server Error");
            }

            // end the connection
            die();
        }
    }

    public function saveConfigFile($config_new, $config_template)
    {
        // loop through each configuration entry
        foreach ($config_new as $key => $value) {
            // check if there are any subkeys
            if (gettype($value) == "array") {
                foreach ($value as $subkey => $subval) {
                    if (gettype($subval) == "boolean") {
                        $subval = ($subval) ? 'true' : 'false';
                    }

                    $config_template = str_replace(
                        '!' . $key . '_' . $subkey,
                        $subval,
                        $config_template
                    );
                }
            } else {
                if (gettype($value) == "boolean") {
                    $value = ($value) ? 'true' : 'false';
                }

                $config_template = str_replace(
                    "!$key",
                    $value,
                    $config_template
                );
            }
        }

        // save the configuration file
        $success = (file_put_contents(
            dirname(__FILE__) . '/../config.php',
            $config_template
        ) !== false);

        return $success;
    }
}


text:
<project name="OpenCards" default="create-jar" basedir=".">

    <!--define kotlin compiler plugin-->
    <!--http://www.jguru.com/faq/view.jsp?EID=476788-->
    <!--<property environment="env" />-->
    <!--suppress AntResolveInspection -->
    <typedef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin_lib_dir}/kotlin-ant.jar" />

    <property name="src.dir" location="${basedir}/src"/>
    <property name="resources.dir" location="${basedir}/resources"/>
    <property name="classes.dir" location="${basedir}/classes"/>
    <property name="lib.dir" location="${basedir}/lib"/>
    <property name="dist.dir" location="${basedir}/../oc-deployed"/>
    <property name="bin.dir" location="${basedir}/bin"/>
    <property name="runtime" location=" /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/" />

    <property name="project.name" value="opencards"/>
    <property name="project.version" value="2.5.1" />

    <path id="classpath">

        <fileset dir="${lib.dir}">
            <include name="**/*.jar"/>
        </fileset>
    </path>

    <condition property="notMac">
        <not>
            <os family="mac" />
        </not>
    </condition>

    <target name="compile" description="compile all sources">
        <mkdir dir="${classes.dir}"/>

        <javac srcdir="${src.dir}" destdir="${classes.dir}" debug="true" debuglevel="lines,source">

            <withKotlin />

            <classpath refid="classpath"/>

            <compilerarg value="-XDignore.symbol.file" />
            <compilerarg value="--add-modules" />
            <compilerarg value="ALL-SYSTEM" />
            <compilerarg value="--add-exports=javafx.graphics/com.sun.javafx.application=ALL-UNNAMED" />

            <!--<if id="isMac">-->
            <!-- enable the next line if you want to compile on other platforms than macos-->
            <!--<exclude if="notMac" name="info/opencards/util/macos/OpenCardsWrapper4MacOSX.java" />-->
            <!--</if>-->
        </javac>
    </target>

    <target name="create-jar" depends="compile" description="Recreates the opencards.jar">

        <property name="jarfile" value="${project.name}.jar"/>
        <delete failonerror="true" file="${jarfile}"/>

        <jar basedir="${classes.dir}" destfile="${jarfile}"/>
        <jar update="true" basedir="${resources.dir}" excludes="**/*.svg" destfile="${jarfile}"/>
        <!--<jar update="true" basedir="${lib.mrj}" destfile="${jarfile}"/>-->

        <!--<jar basedir="${bin.dir}" includes="config/config.sxl" update="true" destfile="${project.name}.jar"/>-->
        <!--<jar basedir="${user.home}" includes=".winlayout" update="true" destfile="${project.name}.jar"/>-->

        <jar destfile="${jarfile}" update="true">
            <manifest>
                <attribute name="Built-By" value="Holger Brandl. All rights reserverd, 2011"/>
                <attribute name="Main-Class" value="info.opencards.OpenCards"/>
                <!-- this listing of jars can be created with find .  -name '*jar' | grep lib  | xargs echo -->
                <attribute name="Class-Path"
                           value="./lib/idea_rt.jar ./lib/markdown-0.1.28.jar ./lib/jcommon-1.0.10.jar ./lib/jfreechart-1.0.6.jar ./lib/junit-4.12.jar ./lib/kotlin-runtime.jar ./lib/poi/commons-codec-1.9.jar ./lib/poi/commons-logging-1.1.jar ./lib/poi/dom4j-1.6.1.jar ./lib/poi/junit-3.8.1.jar ./lib/poi/log4j-1.2.17.jar ./lib/poi/poi-3.14-20160307.jar ./lib/poi/poi-excelant-3.14-20160307.jar ./lib/poi/poi-ooxml-3.14-20160307.jar ./lib/poi/poi-ooxml-schemas-3.14-20160307.jar ./lib/poi/poi-scratchpad-3.14-20160307.jar ./lib/poi/stax-api-1.0.1.jar ./lib/poi/xmlbeans-2.6.0.jar ./lib/xmlpull-1.1.3.1.jar ./lib/xpp3_min-1.1.4c.jar ./lib/xstream-1.4.8.jar"/>
                <!--<attribute name="SplashScreen-Image" value="Logo.gif"/>-->
            </manifest>
        </jar>
    </target>

    <!--old https://github.com/ome/appbundler-->
    <!--new https://bitbucket.org/infinitekind/appbundler/overview-->
    <taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask">
        <classpath>
            <!--<pathelement location="${basedir}/deployment/appbundler-1.0ea.jar" />-->
            <pathelement location="${basedir}/deployment/appbundler-1.1.0.jar" />
            <!--<pathelement location="/Users/holger/projects/opencards/appbundler/appbundler/bin/appbundler-1.1.0.jar" />-->
        </classpath>
    </taskdef>

    <!-- deploy appbundle for mountain lion-->
    <!--http://java.net/downloads/appbundler/appbundler.html-->
    <!--http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/packagingAppsForMac.html-->
    <target name="deploy.macos" depends="create-jar" description="creates an app-bundle for macos">
        <mkdir dir="${dist.dir}"/>
        <delete file="${dist.dir}/Movito.app" />

        <fileset dir="${basedir}" id="myjars">
            <include name="lib/**/*.jar" />
            <include name="opencards.jar" />
        </fileset>

        <!--suppress AntResolveInspection -->
        <bundleapp outputdirectory="${dist.dir}" name="OpenCards" displayname="OpenCards"
            identifier="info.movito.opencards" shortversion="${project.version}" icon="deployment/opencards.icns"
            applicationCategory="public.app-category.developer-tools" executableName="OpenCards"
            mainclassname="info/opencards/util/macos/OpenCardsWrapper4MacOSX">
            <!--<runtime dir="${env.JAVA_HOME}"/>-->
            <classpath refid="myjars" />

            <option value="-Dcom.apple.macos.useScreenMenuBar=true" />
            <option value="-Dapple.laf.useScreenMenuBar=true" />
            <option value="-Dapple.awt.showGrowBox=true" />
            <option value="-Dapple.awt.graphics.EnableQ2DX=true" />
            <option value="-Dcom.apple.mrj.application.apple.menu.about.name=OpenCards" />
            <!--known to not work-->
            <option value="-DNSHighResolutionCapable=true" />

            <argument value="-Xmx2g"/>
            <argument value="-Xms256m" />
            <argument value="-Xdock:name=OpenCards" />
            <argument value="--add-modules ALL-SYSTEM" />
            <argument value="--add-exports=javafx.graphics/com.sun.javafx.application=ALL-UNNAMED" />
        </bundleapp>

        <exec executable="hdiutil" os="Mac OS X">
            <arg value="create" />
            <arg value="-srcfolder" />
            <arg value="${dist.dir}/OpenCards.app" />
            <arg value="-ov" />
            <arg value="${dist.dir}/OpenCards-${project.version}.dmg" />
        </exec>
    </target>

    <target name="deploy.linux" depends="create-jar" description="creates a macos app for the opencards">
        <mkdir dir="${dist.dir}"/>

        <!-- to all contents to a subfolder in the the zip use the prefix attribute in the zipfileset-->
        <property name="multiplatzip" value="${dist.dir}/${project.name}-${project.version}-linux.zip"/>
        <zip basedir="${classes.dir}" destfile="${multiplatzip}"/>
        <zip destfile="${multiplatzip}" basedir="." includes="opencards.jar"/>
        <zip destfile="${multiplatzip}" basedir="." includes="lib/**/*.jar" update="TRUE"/>
        <zip destfile="${multiplatzip}" update="TRUE">
            <zipfileset dir="deployment" includes="OpenCards.sh" filemode="755"/>
        </zip>
    </target>

    <target name="deploy.win" depends="deploy.linux" description="creates a macos app for the opencards">
        <property name="winzip" value="${dist.dir}/${project.name}-${project.version}-windows.zip"/>
        <copyfile src="${dist.dir}/${project.name}-${project.version}-linux.zip" dest="${winzip}"/>

        <zip destfile="${winzip}" basedir="deployment" includes="OpenCards.exe" update="TRUE"/>
    </target>

    <target name="cleanAll" description="Remove all generated files">
        <delete dir="${dist.dir}" failonerror="true"/>
        <delete file="${project.name}.jar"/>
        <delete dir="${classes.dir}" failonerror="false"/>
    </target>

    <!---->
    <!-- Create a Debian package-->
    <!---->

    <taskdef name="deb" classname="com.googlecode.ant_deb_task.Deb">
        <classpath>
            <pathelement location="${basedir}/deployment/ant-deb.jar" />
        </classpath>
    </taskdef>

    <!-- very basic deb target -->
    <!-- unarchive a deb file on macos/linux with: ar vx my.deb -->
    <target name="deploy.debian" depends="create-jar" description="Creates a debian package">
        <deb package="opencards"
             todir="../oc-deployed" section="misc" priority="optional" homepage="http://opencards.info"
            depends="openjdk-8-jre | openjdk-8-jdk, openjfx">
            <version upstream="${project.version}"/>
            <maintainer name="Holger Brandl" email="support@opencards.info" />
            <description synopsis="OpenCards is a free flashcard learning software for ppt-files">
                OpenCards is a free award-winning flashcard learning software. The basic idea of OpenCards is to use
                PowerPoint presentations (*.ppt) as flashcard sets. Thereby, slide-titles are considered as questions
                and the slide contents as their answers. Based on state-of-the-art memorization and scheduling
                algorithms OpenCards will help you to learn any set of flashcards.
            </description>

            <tarfileset dir="" prefix="usr/share/${project.name}">
                <include name="opencards.jar"/>
                <include name="lib/**"/>
            </tarfileset>
            <tarfileset file="deployment/OpenCards.sh" prefix="usr/share/${project.name}" filemode="755"/>
            <tarfileset dir="resources/info/opencards/icons" prefix="usr/share/${project.name}">
                <include name="oclogo.png"/>
            </tarfileset>
            <tarfileset file="deployment/OpenCards.desktop" prefix="usr/share/applications"/>

        </deb>
    </target>

    <target name="deploy.all" depends="deploy.linux, deploy.macos, deploy.win, deploy.debian"
            description="Creates a release for all platforms"/>

</project>


text:
Module XORCrypto

    Sub Main()
        Dim input As String = Console.ReadLine()
        Dim output As String = encryptDecrypt(input)
        Console.WriteLine("Input : " & input)
        Console.WriteLine("Output : " & output)
        Dim rett As String = encryptDecrypt(output)
        Console.WriteLine("RoundAbout : " & rett)
        Console.ReadLine()
    End Sub

    ''' <summary>
    ''' Encrypts and Decrypts string via XOR Operation
    ''' </summary>
    ''' <param name="input">String to be encrypted/decrypted</param>
    ''' <returns>Encrypted/Decrypted output string</returns>
    Private Function encryptDecrypt(input As String) As String
        Dim key As Char() = {"K"c, "C"c, "Q"c}
        'Any chars will work, in an array of any size
        Dim output As Char() = New Char(input.Length - 1) {}
        For i As Integer = 0 To input.Length - 1
            output(i) = ChrW(AscW(input(i)) Xor AscW(key(i Mod key.Length)))
            'ChrW(CharCode As Integer) As Char (Unicode) : Returns the character associated with the specified character code
            'AscW([String] As Char) As Integer (Unicode) : Returns an integer value representing the character code corresponding to a character
        Next
        Return New String(output)
    End Function

End Module


text:
#import <UIKit/UIKit.h>
#import <AdSupport/AdSupport.h>
#import <AppTrackingTransparency/ATTrackingManager.h>

#import "PBMDeviceAccessManager.h"
#import "PBMDeviceAccessManagerKeys.h"
#import "PBMFunctions+Private.h"
#include <sys/sysctl.h>

#import "PrebidMobileSwiftHeaders.h"
#import <PrebidMobile/PrebidMobile-Swift.h>

#pragma mark - PBMDeviceAccessManager

@interface PBMDeviceAccessManager ()
@property (nonatomic, strong, readonly, nonnull) NSLocale *locale;
@property (nonatomic, weak, nullable) UIViewController *rootViewController;
@end

#pragma mark - Implementation

@implementation PBMDeviceAccessManager

#pragma mark - Initialization

- (instancetype)initWithRootViewController:(UIViewController *)viewController {
    return [self initWithRootViewController:viewController
                                     locale:NSLocale.autoupdatingCurrentLocale];
}

- (instancetype)initWithRootViewController:(UIViewController *)viewController
                                    locale:(NSLocale *)locale {
    self = [super init];
    if (self) {
        self.rootViewController = viewController;

        _locale = (locale) ? locale : [NSLocale autoupdatingCurrentLocale];
    }
    return self;
}

#pragma mark - UIDevice

- (nonnull NSString *)deviceMake {
    return @"Apple";
}

- (nonnull NSString *)deviceModel {
    return [UIDevice currentDevice].model;
}

- (nonnull NSString *)identifierForVendor {
    return [UIDevice currentDevice].identifierForVendor.UUIDString;
}

- (nonnull NSString *)deviceOS {
    return [UIDevice currentDevice].systemName;
}

- (nonnull NSString *)OSVersion {
    return [UIDevice currentDevice].systemVersion;
}

- (nullable NSString *)platformString {
    size_t size;
    sysctlbyname("hw.machine", NULL, &size, NULL, 0);
    char *machine = malloc(size);
    sysctlbyname("hw.machine", machine, &size, NULL, 0);
    NSString *platform = [NSString stringWithUTF8String:machine];
    free(machine);

    return platform;
}

- (nullable NSString *)userLangaugeCode {
    return [self.locale objectForKey:NSLocaleLanguageCode];
}

#pragma mark - IDFA

- (nonnull NSString *)advertisingIdentifier {
    return [ASIdentifierManager.sharedManager advertisingIdentifier].UUIDString;
}

- (BOOL)advertisingTrackingEnabled {
    return ASIdentifierManager.sharedManager.isAdvertisingTrackingEnabled;
}

- (NSUInteger)appTrackingTransparencyStatus {
    if (@available(iOS 14.0, *)) {
        return ATTrackingManager.trackingAuthorizationStatus;
    } else {
        return 0; //ATTrackingManagerAuthorizationStatusNotDetermined
    }
}

- (CGSize)screenSize {
    return [PBMFunctions deviceScreenSize];
}

@end

#pragma mark - UIAlertController

@implementation UIAlertController (PBMPrivate)

- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskPortrait;
}

- (BOOL)shouldAutorotate {
    return false;
}

@end


text:
@implementation LocalPoint

@synthesize  x, y, value, rect, valueField;

@end


text:
package stringset

// Set represents a set of strings
type Set struct {
	data map[string]struct{}
}

// New creates an empty set
func New() Set {
	return Set{data: make(map[string]struct{})}
}

// NewFromSlice creates an Set from a given list of strings
func NewFromSlice(list []string) Set {
	set := New()
	for _, element := range list {
		set.data[element] = struct{}{}
	}
	return set
}

// String creates a string from a set
func (s Set) String() string {
	out := "{"
	for v := range s.data {
		out += "\"" + v + "\", "
	}
	// remove last ", "
	if len(out) != 1 {
		out = out[:len(out)-2]
	}
	return out + "}"
}

// Length returns the number of elements a set contains
func (s Set) Length() int {
	return len(s.data)
}

// IsEmpty is true if an Set is Empty
func (s Set) IsEmpty() bool {
	return s.Length() == 0
}

// Has checks if the given element is in the set
func (s Set) Has(elem string) bool {
	_, ok := s.data[elem]
	return ok
}

// Subset is true when s1 is a subset of s2
func Subset(s1, s2 Set) bool {
	if s1.IsEmpty() {
		return true
	}
	if s2.IsEmpty() {
		return false
	}
	for k := range s1.data {
		if !s2.Has(k) {
			return false
		}
	}
	return true
}

// Disjoint is true when the two given sets have no common element
func Disjoint(s1, s2 Set) bool {
	if (s1.IsEmpty() && !s2.IsEmpty()) ||
		(!s1.IsEmpty() && s2.IsEmpty()) {
		return true
	}
	for k := range s2.data {
		if s1.Has(k) {
			return false
		}
	}
	return true
}

// Equal is true when the given sets have (only) the same elements
func Equal(s1, s2 Set) bool {
	if s1.Length() != s2.Length() {
		return false
	}
	for k := range s1.data {
		if !s2.Has(k) {
			return false
		}
	}
	return true
}

// Add adds a string to the set
func (s *Set) Add(elem string) {
	s.data[elem] = struct{}{}
}

// Intersection returns the intersection of two sets
func Intersection(s1, s2 Set) Set {
	intersect := New()
	for k := range s1.data {
		if s2.Has(k) {
			intersect.Add(k)
		}
	}
	return intersect
}

// Difference returns the difference of s1 and s2
func Difference(s1, s2 Set) Set {
	difference := New()
	if s1.IsEmpty() {
		return difference
	}
	for k := range s1.data {
		if !s2.Has(k) {
			difference.Add(k)
		}
	}
	return difference
}

// Clone clone a set and create a new one
func Clone(s Set) Set {
	s1 := New()
	for key := range s.data {
		s1.Add(key)
	}
	return s1
}

// Union returns the union of two sets
func Union(s1, s2 Set) Set {
	union := Clone(s1)
	for k := range s2.data {
		union.Add(k)
	}
	return union
}


text:
<?php

use yii\db\Migration;

class m170217_185715_add_user extends Migration
{
    public function up()
    {
        $this->createTable('{{%user}}', [
            'id' => $this->primaryKey(),
            'first_name' => $this->string(),
            'last_name' => $this->string(),
            'created_at' => $this->integer()->notNull(),
        ]);
    }

    public function down()
    {
        $this->dropTable('{{%user}}');
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}


text:
package io.github.ibuildthecloud.dstack.extension.api.manager;

import io.github.ibuildthecloud.dstack.extension.ExtensionManager;
import io.github.ibuildthecloud.dstack.extension.ExtensionPoint;
import io.github.ibuildthecloud.gdapi.factory.SchemaFactory;
import io.github.ibuildthecloud.gdapi.id.IdFormatter;
import io.github.ibuildthecloud.gdapi.model.ListOptions;
import io.github.ibuildthecloud.gdapi.model.Resource;
import io.github.ibuildthecloud.gdapi.request.ApiRequest;
import io.github.ibuildthecloud.gdapi.request.resource.impl.AbstractNoOpResourceManager;

import java.util.Map;

import javax.inject.Inject;

public class ExtensionManagerApi extends AbstractNoOpResourceManager {

    ExtensionManager extensionManager;

    @Override
    public Class<?>[] getTypeClasses() {
        return new Class<?>[] { ExtensionPoint.class };
    }

    @Override
    protected Resource createResource(Object obj, IdFormatter idFormatter, ApiRequest request) {
        if ( obj instanceof ExtensionPoint ) {
            return constructResource(idFormatter, request.getSchemaFactory(),
                    request.getSchemaFactory().getSchema(ExtensionPoint.class), obj);
        }

        return super.createResource(obj, idFormatter, request);
    }

    @Override
    protected Object listInternal(SchemaFactory schemaFactory, String type, Map<Object, Object> criteria, ListOptions options) {
        return extensionManager.getExtensions();
    }

    public ExtensionManager getExtensionManager() {
        return extensionManager;
    }

    @Inject
    public void setExtensionManager(ExtensionManager extensionManager) {
        this.extensionManager = extensionManager;
    }

}


text:
import {
  AUTH_LOAD,
  AUTH_LOAD_SUCCESS,
  AUTH_LOAD_FAIL,
  AUTH_LOGIN,
  AUTH_LOGIN_SUCCESS,
  AUTH_LOGIN_FAIL,
  AUTH_LOGOUT,
  AUTH_LOGOUT_SUCCESS,
  AUTH_LOGOUT_FAIL
} from '../actions/actionTypes';

const initialState = {
  loaded: false
};

export default function info(state = initialState, action = {}) {
  switch (action.type) {
    case AUTH_LOAD:
      return {
        ...state,
        loading: true
      };
    case AUTH_LOAD_SUCCESS:
      return {
        ...state,
        loading: false,
        loaded: true,
        user: action.result
      };
    case AUTH_LOAD_FAIL:
      return {
        ...state,
        loading: false,
        loaded: false,
        error: action.error
      };
    case AUTH_LOGIN:
      return {
        ...state,
        loggingIn: true
      };
    case AUTH_LOGIN_SUCCESS:
      return {
        ...state,
        loggingIn: false,
        user: action.result
      };
    case AUTH_LOGIN_FAIL:
      return {
        ...state,
        loggingIn: false,
        user: null,
        loginError: action.error
      };
    case AUTH_LOGOUT:
      return {
        ...state,
        loggingOut: true
      };
    case AUTH_LOGOUT_SUCCESS:
      return {
        ...state,
        loggingOut: false,
        user: null
      };
    case AUTH_LOGOUT_FAIL:
      return {
        ...state,
        loggingOut: false,
        logoutError: action.error
      };
    default:
      return state;
  }
}

export function isLoaded(globalState) {
  return globalState.auth && globalState.auth.loaded;
}


text:
namespace ash {
namespace smb_client {

// Holds the number of in-flight requests and the callback to call once all the
// HostLocators are finished. Also holds the hosts found from the HostLocators
// that have already returned.
struct RequestInfo {
  uint32_t remaining_requests;
  FindHostsCallback callback;
  HostMap hosts_found;

  RequestInfo(uint32_t remaining_requests, FindHostsCallback callback);
  RequestInfo(RequestInfo&& other);

  RequestInfo(const RequestInfo&) = delete;
  RequestInfo& operator=(const RequestInfo&) = delete;

  ~RequestInfo();
};

// NetworkScanner discovers SMB hosts in the local network by querying
// registered HostLocators and aggregating their results. RegisterHostLocator is
// used to register HostLocators that are responsible for finding hosts.
// FindHostsInNetwork is called to get a list of discoverable hosts in the
// network. ResolveHost is used to get the IP address of a given host.
class NetworkScanner : public base::SupportsWeakPtr<NetworkScanner> {
 public:
  NetworkScanner();

  NetworkScanner(const NetworkScanner&) = delete;
  NetworkScanner& operator=(const NetworkScanner&) = delete;

  ~NetworkScanner();

  // Query the registered HostLocators and return all the hosts found.
  // |callback| is called once all the HostLocators have responded with their
  // results. If there are no locators, the callback is fired immediately with
  // an empty result and success set to false. Once this call has returned, the
  // hosts found are cached locally and are resolvable individually through
  // ResolveHost().
  void FindHostsInNetwork(FindHostsCallback callback);

  // Registeres a |locator| to be queried when FindHostsInNetwork() is called.
  void RegisterHostLocator(std::unique_ptr<HostLocator> locator);

  // Resolves |host| to an address using the cached results of
  // FindHostsInNetwork(). FindHostsInNetwork() has to be called beforehand. If
  // no address is found, this returns an invalid IPAddress.
  net::IPAddress ResolveHost(const std::string& host) const;

 private:
  // Callback handler for HostLocator::FindHosts().
  void OnHostsFound(uint32_t request_id, bool success, const HostMap& host_map);

  // Adds |host_map| hosts to current results. The host will not be added if the
  // hostname already exists in results, and if the IP address does not match,
  // it will be logged.
  void AddHostsToResults(uint32_t request_id, const HostMap& host_map);

  // Adds a new request to track and saves |callback| to be called when the
  // request is finished. Returns the request id.
  uint32_t AddNewRequest(FindHostsCallback callback);

  // Called after a HostLocator returns with results and decrements the count of
  // requests in RequestInfo for |request_id|. Fires the callback for if
  // there are no more requests and deletes the corresponding RequestInfo.
  void FireCallbackIfFinished(uint32_t request_id);

  std::vector<std::unique_ptr<HostLocator>> locators_;

  // Used for tracking in-flight requests to HostLocators. The key is the
  // request id, and the value is the RequestInfo struct.
  std::map<uint32_t, RequestInfo> requests_;

  uint32_t next_request_id_ = 0;

  // Hosts that are found from FindHostsInNetwork(). This is cached for name
  // resolution when calling ResolveHost().
  HostMap found_hosts_;

  // True if FindHostsInNetwork() has been called and returned results
  // regardless if any hosts are found.
  bool find_hosts_returned_ = false;

  // True if FindHostsInNetwork() has been called and is waiting for
  // FindHostsCallback to be invoked. This is to prevent multiple calls of
  // FindHostsInNetwork() from concurrently executing. Used only for DCHECKing
  // if FindHostsInNetwork() is already running.
  bool running_ = false;
};

}  // namespace smb_client
}  // namespace ash

#endif  // CHROME_BROWSER_ASH_SMB_CLIENT_DISCOVERY_NETWORK_SCANNER_H_


text:
namespace org {
  namespace apache {
    namespace lucene {
      namespace queryparser {
        namespace flexible {
          namespace messages {
            class Message;
          }
        }
      }
    }
  }
}
namespace java {
  namespace util {
    class Locale;
  }
  namespace lang {
    class String;
    class Class;
  }
}
template<class T> class JArray;

namespace org {
  namespace apache {
    namespace lucene {
      namespace queryparser {
        namespace flexible {
          namespace messages {

            class MessageImpl : public ::java::lang::Object {
            public:
              enum {
                mid_init$_5fdc3f48,
                mid_init$_ddea115c,
                mid_getArguments_94e49c77,
                mid_getKey_14c7b5c5,
                mid_getLocalizedMessage_14c7b5c5,
                mid_getLocalizedMessage_c0fb304e,
                mid_toString_14c7b5c5,
                max_mid
              };

              static ::java::lang::Class *class$;
              static jmethodID *mids$;
              static bool live$;
              static jclass initializeClass(bool);

              explicit MessageImpl(jobject obj) : ::java::lang::Object(obj) {
                if (obj != NULL)
                  env->getClass(initializeClass);
              }
              MessageImpl(const MessageImpl& obj) : ::java::lang::Object(obj) {}

              MessageImpl(const ::java::lang::String &);
              MessageImpl(const ::java::lang::String &, const JArray< ::java::lang::Object > &);

              JArray< ::java::lang::Object > getArguments() const;
              ::java::lang::String getKey() const;
              ::java::lang::String getLocalizedMessage() const;
              ::java::lang::String getLocalizedMessage(const ::java::util::Locale &) const;
              ::java::lang::String toString() const;
            };
          }
        }
      }
    }
  }
}

#include <Python.h>

namespace org {
  namespace apache {
    namespace lucene {
      namespace queryparser {
        namespace flexible {
          namespace messages {
            extern PyTypeObject PY_TYPE(MessageImpl);

            class t_MessageImpl {
            public:
              PyObject_HEAD
              MessageImpl object;
              static PyObject *wrap_Object(const MessageImpl&);
              static PyObject *wrap_jobject(const jobject&);
              static void install(PyObject *module);
              static void initialize(PyObject *module);
            };
          }
        }
      }
    }
  }
}

#endif


text:
---
uid: SolidEdgeFramework.Insight.MoveDocumentsThroughWorkFlow(System.String,SolidEdgeFramework.DocumentStatus,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)
summary:
remarks:
syntax:
    parameters:
    - id: draftFileList
      description: Specifies the associated draft files.
    - id: draftFileStatusList
      description: Specifies the new status list for the draft files.
    - id: Filename
      description: Specifies the URL path of the file to be assigned a new status.
    - id: newstatus
      description: Member of the DocumentStatus constant set that specifies the new status of the file.
    - id: NumberOfDraftFiles
      description: Specifies the number of associated draft files.
    - id: NumberOfRevisionFiles
      description: Specifies the number of associated revision files.
    - id: revisionFileList
      description: Specifies the associated revision files.
    - id: RevisionFileStatusList
      description: Specifies the new status list for the revision files.
---


text:
/***************************************
  $Header$

  Processing for relative clauses.

  ***************************************/

/* COPYRIGHT */

#include <assert.h>

#include "nodes.h"
#include "rpc_tab.h"
#include "functions.h"
#include "cmavotab.h"

/*++++++++++++++++++++++++++++++++++++++

  TreeNode *x
  ++++++++++++++++++++++++++++++++++++++*/

static void
process_goi_clause (TreeNode *x)
{
  TreeNode *goi, *term, *termc;
  XDontGloss *xdg;

  goi = find_nth_cmavo_child(x, 1, GOI);
  term = find_nth_child(x, 1, TERM);
  assert (goi);
  assert (term);
  termc = child_ref(term, 0);

  /* What sort of term? */
  switch (termc->data.nonterm.type) {

    case TERM_PLAIN_SUMTI:
      /* This is the standard 'associated with' meaning */
      break;

    case TERM_TAGGED_SUMTI:
    case TAGGED_TERMSET:
      /* In this case we want to elide the gloss for the GOI (in all
         cases of GOI?) */
      xdg = prop_dont_gloss(goi, YES);
      break;

    case TERM_PLACED_SUMTI:
      /* This is bizarre - what ever would it mean? */
      break;

    case TERM_FLOATING_TENSE:
      /* A meaning for this can just about be envisaged :

         e.g. le finpe pe ca cu xamgu    would mean
              the fish associated with something current is good

         but is that what the language definition would say?

         */
      break;

    case TERMSET:
      /* ugh - the branches could differ, plus what would it mean
         anyway, there would be multiple terms in each branch. */
      break;

    case TERM_FLOATING_NEGATE:
      /* meaning? */
      break;

    case TERM_OTHER:
      break;

    default:
      break;
  }
}

/*++++++++++++++++++++++++++++++++++++++
  Processing to decide whether to gloss NOI as 'such that' or as 'which'.

  TreeNode *x
  ++++++++++++++++++++++++++++++++++++++*/

static void
process_noi_clause (TreeNode *x)
{

}

/*++++++++++++++++++++++++++++++++++++++

  TreeNode *x
  ++++++++++++++++++++++++++++++++++++++*/

static void
process_any_rel_clause (TreeNode *x)
{
  TreeNode *rcs, *encl;
  TreeNode *antecedent;

  /* Find enclosing rule */
  rcs = x->parent;
  while (rcs->data.nonterm.type != RELATIVE_CLAUSES) {
    rcs = rcs->parent;
  }

  encl = rcs->parent;

  /* In several cases, it looks like the relative clause can come
     before the antecedent (postcedent? :-) ).  This needs to be
     confirmed. */

  switch (encl->data.nonterm.type) {
    case FRAGMENT:
      antecedent = NULL;
      break;
    case SUMTI:
      antecedent = child_ref(encl, 0); /* The sumti_1 node */
      break;
    case SUMTI_5:
      antecedent = child_ref(encl, 0); /* The sumti_5a or sumti_5b node */
      break;
    case LAHE_SUMTI_6:
      antecedent = find_nth_child(encl, 1, SUMTI);
      break;
    case NAHE_BO_SUMTI_6:
      antecedent = find_nth_child(encl, 1, SUMTI);
      break;
    case NAME_SUMTI_6:
      antecedent = encl;
      break;

    case SUMTI_TAIL:
      antecedent = find_nth_child(encl, 1, SUMTI_6);
      /* If there's a sumti_6 present I think the relative clause
         applies to it, otherwise it's like the case above - does it
         apply to the sumti_tail_1, or to something else??? */
      break;

    case SUMTI_TAIL_1:
      antecedent = child_ref(encl, 0); /* the sumti_tail_1A */
      break;

    case FREE_VOCATIVE:
      /* The relative clause applies to the whole thing (see text
         around example 9.6 in the reference manual.  (Strictly it
         applies to the selbri or CMENE_seq, but ignore that nicety
         for now.) */
      antecedent = encl;
      break;

    default:
      fprintf(stderr, "Shouldn't find relative clause in this context\n");
      antecedent = NULL;
      break;
  }

  /* Set the antecedent on the NOI to where it is, and put a property
     on the antecedent node to warn the bracketer that it needs to
     mark it. */
  if (antecedent) {
    XRequireBrac *xrb;
    XAntecedent *xan;

    xan = prop_antecedent(x, YES);
    xan->node = antecedent;

    xrb = prop_require_brac(antecedent, YES);
  }
}

/*++++++++++++++++++++++++++++++++++++++

  TreeNode *x
  ++++++++++++++++++++++++++++++++++++++*/

static void
process_keha(TreeNode *x)
{
  TreeNode *rel;

  /* Need to extend to deal with subscripted ke'a, where you have to
     back-count out of nested relative clauses. */

  rel = x->parent;
  while ((rel->data.nonterm.type != RELATIVE_CLAUSE) &&
         (rel->data.nonterm.type != CHUNKS)) {
    rel = rel->parent;
  }

  if (rel->data.nonterm.type == RELATIVE_CLAUSE) {
    /* Set property on ke'a to point back to containing clause */
    prop_rel_clause_link(x, YES)->rel = rel;

    /* Set property on containing clause to warn that it contains ke'a */
    prop_contains_keha (rel, YES);
  }

}

/*++++++++++++++++++++++++++++++++++++++
  Do processing for relative clauses.  The actions are as follows

  1. For GOI-type relative clauses, see if the term following is of
  the form <sumti> or <tag> <sumti>.  This determines whether to
  bother glossing the GOI cmavo in the text output.

  2. For NOI-type relative clauses, there is more to do.

  2a. Mark the NOI cmavo with a property to point back to the
  antecedent of the relative clause.

  2b. Look for each instance of ke'a in the text.  Look for a
  subscript on it.  Try to backtrack out to the associated relative
  clause, to point the ke'a at its antecedent.

  2c. If ke'a occurs in a relative clause, mark a property on the NOI
  cmavo.  This indicates it should be glossed as 'such that' rather
  than 'which'.  (Maybe this criterion needs to be based on whether
  any terms precede the selbri in the relative clause?  It gets
  awfully complex in some cases, e.g. if the relative clause is a
  <gek_sentence> because the 2 branches may be different in this
  regard.)

  TreeNode *top
  ++++++++++++++++++++++++++++++++++++++*/

void
relative_clause_processing (TreeNode *x)
{
  /* Traverse parse tree */

  int nc, i;
  struct nonterm *nt;
  TreeNode *c;

  if (x->type == N_NONTERM) {

    nt = &x->data.nonterm;

    /* Child scan first so that ke'a is processed before NOI */
    nc = nt->nchildren;
    for (i=0; i<nc; i++) {
      c = nt->children[i];
      relative_clause_processing(c);
    }

    if (nt->type == RELATIVE_CLAUSE) {
      process_any_rel_clause(x);
    }

    if (nt->type == TERM_RELATIVE_CLAUSE) {
      process_goi_clause(x);
    } else if (nt->type == FULL_RELATIVE_CLAUSE) {
      process_noi_clause(x);
    }

  } else if ((x->type == N_CMAVO) &&
             (!strcmp(cmavo_table[x->data.cmavo.code].cmavo, "ke\'a"))) {

    process_keha(x);

  }

}


text:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>2 on The ED Factor</title>
    <link>https://edugargar.github.io/publication_types/2/</link>
    <description>Recent content in 2 on The ED Factor</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <copyright>&copy; 2017 Eduardo García Garzón</copyright>
    <lastBuildDate>Tue, 01 Sep 2015 00:00:00 +0000</lastBuildDate>
    <atom:link href="/publication_types/2/" rel="self" type="application/rss+xml" />

    <item>
      <title>Multilevel Modeling and Policy Development: Guidelines and Applications to Medical Travel</title>
      <link>https://edugargar.github.io/publication/medical/</link>
      <pubDate>Tue, 01 Sep 2015 00:00:00 +0000</pubDate>

      <guid>https://edugargar.github.io/publication/medical/</guid>
      <description></description>
    </item>

    <item>
      <title>Iteration of Partially Specified Target Matrices: Application to the Bi-Factor Case.</title>
      <link>https://edugargar.github.io/publication/sli/</link>
      <pubDate>Mon, 01 Jul 2013 00:00:00 +0000</pubDate>

      <guid>https://edugargar.github.io/publication/sli/</guid>
      <description></description>
    </item>

  </channel>
</rss>


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

     Copyright 2005-2018 Red Hat, Inc.

     Red Hat licenses this file to you 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.

-->
<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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.jboss.fuse</groupId>
        <artifactId>assemblies</artifactId>
        <version>7.11.0.redhat-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <groupId>org.jboss.fuse</groupId>
    <artifactId>fuse-karaf-framework</artifactId>
    <!--<packaging>kar</packaging>-->
    <packaging>pom</packaging>

    <name>Red Hat Fuse :: Assemblies :: Features :: Framework</name>
    <properties>
        <wagon-maven-plugin.version>2.0.0</wagon-maven-plugin.version>
    </properties>
    <description>
        In Apache Karaf there's org.apache.karaf.features:base and org.apache.karaf.features:framework
        In Red Hat Fuse both are combined in single "framework KAR", which contains all fundamental resources.
        These resources include:
        - bin scripts
        - libs (ext, boot, endorsed)
        - basic etc config files
        - fundamental system libraries (e.g., Felix framework)
    </description>

    <dependencies>

        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <artifactId>base</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>io.swagger.core.v3</groupId>
            <artifactId>swagger-jaxrs2</artifactId>
        </dependency>

    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
            </resource>
            <resource>
                <directory>src/main/filtered-resources</directory>
                <filtering>true</filtering>
            </resource>
            <resource>
                <directory>src/main/appended-resources</directory>
                <filtering>true</filtering>
                <targetPath>${project.build.directory}/appended-resources</targetPath>
            </resource>
            <resource>
                <directory>src/main/feature</directory>
                <filtering>true</filtering>
                <!-- convention for org.apache.karaf.tooling.KarMojo#featuresFile -->
                <targetPath>${project.build.directory}/feature</targetPath>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <!--
                           unpack original org.apache.karaf.features:base and do not alter anything
                           we'll pick required resources later
                        -->
                        <id>unpack-karaf-base</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.apache.karaf.features</groupId>
                                    <artifactId>base</artifactId>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>${project.build.directory}/karaf-base</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!-- required, because we have "pom" packaging -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <!-- selective copy of karaf base resources -->
                        <id>copy-karaf-base-resources</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.outputDirectory}/resources</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.build.directory}/karaf-base/resources</directory>
                                    <includes>
                                        <include>bin/**</include>
                                        <include>data/**</include>
                                        <include>etc/**</include>
                                        <include>lib/**/README</include>
                                    </includes>
                                    <excludes>
                                        <exclude>etc/equinox-debug.properties</exclude>
                                        <exclude>etc/distribution.info</exclude>
                                        <exclude>etc/custom.properties</exclude>
                                        <exclude>bin/instance*</exclude>
                                    </excludes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <!-- additional Fuse resources -->
                        <id>copy-fuse-resources</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.outputDirectory}/resources</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.basedir}/../..</directory>
                                    <includes>
                                        <include>README*</include>
                                        <include>license.txt</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <!--
                            Normal processing according to <build>/<resources> configuration. Any resources
                            copied previously from unpacked org.apache.karaf.features:base will be overwritten
                        -->
                        <id>default</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>resources</goal>
                        </goals>
                        <configuration>
                            <useDefaultDelimiters>false</useDefaultDelimiters>
                            <delimiters>
                                <delimiter>${*}</delimiter>
                            </delimiters>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <!-- final touches -->
                        <id>customize-karaf-base</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <echo message="Fixing start/stop scripts in assembly" />
                                <replace file="${project.build.outputDirectory}/resources/bin/start.bat" token="karaf.bat" value="fuse.bat" />
                                <replace file="${project.build.outputDirectory}/resources/bin/stop.bat" token="karaf.bat" value="fuse.bat" />
                                <replace file="${project.build.outputDirectory}/resources/bin/start" token="bin/karaf" value="bin/fuse" />
                                <replace file="${project.build.outputDirectory}/resources/bin/stop" token="bin/karaf" value="bin/fuse" />

                                <echo message="Customizing etc configuration files" />
                                <concat destfile="${project.build.outputDirectory}/resources/etc/config.properties" append="true" encoding="UTF-8">
                                    <filelist dir="${project.build.directory}/appended-resources" files="append-header.part" />
                                </concat>
                                <concat destfile="${project.build.outputDirectory}/resources/etc/config.properties" append="true" encoding="UTF-8">
                                    <filelist dir="${project.build.directory}/appended-resources/etc" files="config.properties" />
                                    <filterchain>
                                        <headfilter lines="-1" skip="15" />
                                    </filterchain>
                                </concat>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.karaf.tooling</groupId>
                <artifactId>karaf-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>package</id>
                        <goals>
                            <goal>kar</goal>
                        </goals>
                        <configuration>
                            <!--
                                We use own features XML for this KAR - kar goal will copy only these bundles that
                                are referenced from "our" features XML. org.apache.karaf.features/framework/VERSION/xml/features
                                will be used in the distro itself (where karaf-maven-plugin:assembly is configured)
                            -->
                            <featuresFile>${project.build.directory}/feature/feature.xml</featuresFile>
                            <!--<featuresFile>mvn:org.apache.karaf.features/framework/${version.org.apache.karaf}/xml/features</featuresFile>-->
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-artifacts</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>target/feature/feature.xml</file>
                                    <classifier>features</classifier>
                                    <type>xml</type>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>download-prometheus-config</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>wagon-maven-plugin</artifactId>
                        <version>${wagon-maven-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>process-resources</id>
                                <goals>
                                    <goal>download-single</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <url>https://raw.githubusercontent.com</url>
                            <fromFile>jboss-fuse/application-templates/master/prometheus/prometheus-config.yml</fromFile>
                            <toFile>${project.basedir}/src/main/filtered-resources/resources/etc/prometheus-config.yml-example</toFile>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>


text:
package io.deepsense.commons.auth.exceptions

abstract class AuthException(message: String) extends Exception(message)


text:
$(function () {
    bootbox.setLocale("es");
    toastr.options = {
        "closeButton": false,
        "positionClass": "toast-top-center",
        "showEasing": "linear",
        "hideEasing": "linear",
        "showMethod": "slideDown",
    };

    //----------------------------------------

    vCon = $('#vConfig');

    vCon.on('shown.bs.modal', function (e) {
        $('#tbRazon').focus();
    });

    vCon.on('hidden.bs.modal', function (e) {
        $('#fConfig').trigger("reset");
        $('#fConfig .form-group').removeClass('has-error');
    });

    $("#btnGuardarConfig").on("click",function(){
        //$("#fConfig").validator('validate');
        nroErrores = $("#fConfig").validator('validate').has('.has-error').length;

        if (nroErrores) {
            toastr["error"]("Verifique su Formulario");
        } else {
            var data = $("#fConfig").serializeArray();
            data.push({name: 'f', value: 2});

            $.post("funciones/admin_configuracion.php", data, function(d) {
                vCon.waitMe('hide');
                if (d.success) {
                    vCon.modal('hide');
                    swal({title: d.msg, type: "success",},function(){
                            location.reload();
                        }
                    );
                }else {
                    swal({title: d.msg, type: "error"});
                }
            },'json');
        }
    });

    // ----------------- Ventana Cambiar Clave ---------------------

    vCla = $('#vClave');

    vCla.on('shown.bs.modal', function (e) {
        $('#tbClaveActual').focus();
    });

    vCla.on('hidden.bs.modal', function (e) {
        $('#f_cambiarClave').trigger("reset");
        $('#f_cambiarClave .form-group').removeClass('has-error');
    });

    $("#btnGuardarClave").on("click",function(){
        $('#f_cambiarClave .form-group').removeClass('has-error');

        if($.trim($('#tbClaveActual').val())==""){
            $('#tbClaveActual').parent().parent().addClass('has-error');
            swal({
                    title: "Ingrese la clave actual.",
                    type: "error",
                },function(){
                    setTimeout(function(){ $("#tbClaveActual").focus(); }, 200);
                }
            );
            return;
        }
        else if($.trim($('#tbClaveNueva').val())==""){
            $('#tbClaveNueva').parent().parent().addClass('has-error');
            swal({title: "Ingrese la nueva contraseña", type: "error"},
                function(){
                    setTimeout(function(){ $("#tbClaveNueva").focus(); }, 200);
                }
            );
            return;
        }
        else if($.trim($('#tbClaveActual').val())==$.trim($('#tbClaveNueva').val())){
            $('#tbClaveNueva').parent().parent().addClass('has-error');
            swal({title: "La Contraseña Actual y la nueva Contraseña son iguales. Deben ser diferentes", type: "error"},
                function(){
                    setTimeout(function(){ $("#tbClaveNueva").select(); }, 200);
                }
            );
            return;
        }
        else if($.trim($('#tbClaveRepetida').val())==""){
            $('#tbClaveRepetida').parent().parent().addClass('has-error');
            swal({title: "Ingrese la contraseña repetida", type: "error"},
                function(){
                    setTimeout(function(){ $("#tbClaveRepetida").focus(); }, 200);
                }
            );
            return;
        }
        else if($.trim($('#tbClaveNueva').val())!=$.trim($('#tbClaveRepetida').val())){
            $('#tbClaveRepetida').parent().parent().addClass('has-error');
            swal({title: "Las nuevas claves no son iguales", type: "error"},
                function(){
                    setTimeout(function(){ $("#tbClaveRepetida").select(); }, 200);
                }
            );
            return;
        }

        vCla.waitMe();

        var data = $("#f_cambiarClave").serializeArray();
        data.push({name: 'f', value: 2});

        $.post("funciones/admin_usuario.php", data, function(d) {
            if (d.success) {
                vCla.modal('hide');
                swal({title: d.msg, type: "success"});
            }else {
                swal({title: d.msg, type: "error"});
            }
            vCla.waitMe('hide');
        },'json');
    });

    $("#btnCerrarSesion").on("click",function(){
        swal({
            title: "Seguro que desea Cerrar Sesión?",
            type: "error",
            showCancelButton: true,
        },function(){
            document.location = 'logout.php';
        });
    });
});


text:
package cliente;

import java.io.ObjectInputStream;
import java.util.HashMap;

import javax.swing.JOptionPane;

import com.google.gson.Gson;

import comandos.ComandosEscucha;
import juego.Juego;
import mensajeria.Comando;
import mensajeria.Paquete;
import mensajeria.PaqueteMovimiento;
import mensajeria.PaquetePersonaje;
/**La clase EscuchaMensajes tiene como función
 * esuchar los mensajes que se enviaran
 * al servidor.
 */
public class EscuchaMensajes extends Thread {

	private Juego juego;
	private Cliente cliente;
	private ObjectInputStream entrada;
	private final Gson gson = new Gson();

	//private Map<Integer, PaqueteMovimiento> ubicacionPersonajes;
	//private Map<Integer, PaquetePersonaje> personajesConectados;
	/**Constructor de EsuchaMensaje
	 * @param juego juego del que se escucha el mensaje
	 */
	public EscuchaMensajes(final Juego juego) {
		this.juego = juego;
		cliente = juego.getCliente();
		entrada = cliente.getEntrada();
	}

	@Override
	public void run() {

		try {

			Paquete paquete;

			ComandosEscucha comand;
			juego.setPersonajesConectados(new HashMap<Integer, PaquetePersonaje>());
			juego.setUbicacionPersonajes(new HashMap<Integer, PaqueteMovimiento>());

			while (true) {

				String objetoLeido = (String) entrada.readObject();

				paquete = gson.fromJson(objetoLeido , Paquete.class);
				comand = (ComandosEscucha) paquete.getObjeto(Comando.NOMBREPAQUETE);
				comand.setJuego(juego);
				comand.setCadena(objetoLeido);
				comand.ejecutar();

			}
		} catch (Exception e) {
			JOptionPane.showMessageDialog(null, "Fallo la conexión con el servidor.");
		}
	}
	/**Pide la ubicacion de los personajes
	 * @return devuelve el mapa con la ubicacion de los personajes
	 */

	/**Pide los personajes conectados
	 * @return devuelve el mapa con los personajes conectados
	 */

}


text:
package wb.app.seek.modules;

import android.content.Context;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.ViewPropertyAnimatorListener;
import android.support.v4.view.animation.FastOutSlowInInterpolator;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Interpolator;

/**
 * Created by W.b on 2017/2/13.
 */
public class ScrollAwareFabBehavior extends FloatingActionButton.Behavior {

    private static final Interpolator INTERPOLATOR = new FastOutSlowInInterpolator();

    private boolean mIsAnimatingOut = false;

    public ScrollAwareFabBehavior(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public boolean onStartNestedScroll(final CoordinatorLayout coordinatorLayout, final FloatingActionButton child,
                                       final View directTargetChild, final View target, final int nestedScrollAxes) {
        return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL;
    }

    @Override
    public void onNestedScroll(final CoordinatorLayout coordinatorLayout, final FloatingActionButton child,
                               final View target, final int dxConsumed, final int dyConsumed,
                               final int dxUnconsumed, final int dyUnconsumed) {
        super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed);
        if (dyConsumed > 0 && child.getVisibility() == View.VISIBLE && !mIsAnimatingOut) {
            animateOut(child);

        } else if (dyConsumed < 0 && child.getVisibility() != View.VISIBLE) {
            animateIn(child);
        }
    }

    private void animateOut(final FloatingActionButton child) {
        ViewCompat.animate(child).translationY(child.getHeight() + getMarginBottom(child)).setInterpolator(INTERPOLATOR).withLayer()
                .setListener(new ViewPropertyAnimatorListener() {
                    public void onAnimationStart(View view) {
                        ScrollAwareFabBehavior.this.mIsAnimatingOut = true;
                    }

                    public void onAnimationCancel(View view) {
                        ScrollAwareFabBehavior.this.mIsAnimatingOut = false;
                    }

                    public void onAnimationEnd(View view) {
                        ScrollAwareFabBehavior.this.mIsAnimatingOut = false;
                        view.setVisibility(View.GONE);
                    }
                }).start();
    }

    private void animateIn(FloatingActionButton child) {
        child.setVisibility(View.VISIBLE);
        ViewCompat.animate(child).translationY(0)
                .setInterpolator(INTERPOLATOR).withLayer().setListener(null)
                .start();
    }

    private int getMarginBottom(View v) {
        int marginBottom = 0;
        final ViewGroup.LayoutParams layoutParams = v.getLayoutParams();
        if (layoutParams instanceof ViewGroup.MarginLayoutParams) {
            marginBottom = ((ViewGroup.MarginLayoutParams) layoutParams).bottomMargin;
        }
        return marginBottom;
    }
}


text:
module Spree
  module Admin
    class PriceCategoriesController < ResourceController

      def collection
        super.order(:name)
      end

    end
  end
end


text:
$rootDir = $(Get-Item $PSScriptRoot).Parent.FullName
. "$rootDir\Resources\shared_snapshot.ps1"

Download-Browser 'install.msi' 'de-de'
$tag = Get-Version '.\install.msi'

Write-Host "Chrome version $tag"
"google/chrome-de:$tag" | Set-Content "image.txt"

# Silent install arguments: /quiet


text:
cask "bootstrap-studio" do
  version "5.2.1"
  sha256 "a4ca7e54bb7a2b5179694e95ab58cde285eda4574b5c1dc57c436530a42362c4"

  url "https://bootstrapstudio.io/releases/desktop/#{version}/Bootstrap%20Studio.dmg"
  appcast "https://bootstrapstudio.io/pages/releases"
  name "Bootstrap Studio"
  homepage "https://bootstrapstudio.io/"

  auto_updates true

  app "Bootstrap Studio.app"

  zap trash: [
    "~/Library/Application Support/bstudio",
    "~/Library/Application Support/CrashReporter/Bootstrap Studio*",
    "~/Library/Caches/bg.zine.bootstrapstudio",
    "~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/bg.zine.bootstrapstudio.sfl2",
    "~/Library/Caches/bg.zine.bootstrapstudio.ShipIt",
    "~/Library/Preferences/ByHost/bg.zine.bootstrapstudio.ShipIt.*",
    "~/Library/Preferences/bg.zine.bootstrapstudio.helper.plist",
    "~/Library/Preferences/bg.zine.bootstrapstudio.plist",
    "~/Library/Saved Application State/bg.zine.bootstrapstudio.savedState",
  ]
end


text:
//This script creates a gridded circle on the Dynamic Lighting layer, based on a specific token to be used as magical darkness, then moves that token to the map
//      This is based on a darkness concept contributed by Avi on the forum:
//      https://app.roll20.net/forum/post/5899495/stupid-roll20-tricks-and-some-clever-ones
//The circle approximation code is based on theAaron's !dlcircle script, simplified to handle only circles rather than ellipses
//To use:
//  Create a character whose token has the desired image of the darkness generated, and drag that token to the map.
//  Add an Ability macro to call !dldark and set as a token action
/*
SYNTAX
    !dldark <buffer> <makeGrid> <sendToMapLayer>

        "buffer"            < # >           Optional. Default = 0
                                                reduce the radius of the darkness by this many pixels.
                                                allows the source of the darkness to be seen at the outer border of the darkness.
        "makeGrid"          < true/false >  Optional. Default = true
                                                draw a grid inside of the darkness circle.
                                                the grid will be aligned with the map grid based on page settings
        "SendToMapLayer"    < true/false >  Optional. Default = true
                                                send the source token to the map layer after creating the DL path?
                                                if true, will send to map layer and peform a z-order "ToFront"
                                                if false, will keep on token layer and peform a z-order "ToBack"
EXAMPLES
    !dldark

    !dldark 15 true

    !dldark ?{buffer radius?|15} true false
*/

const dldark = (() => {
    const scriptName = "DLdark";
    const version = '0.2';

    const checkInstall = function() {
        log(scriptName + ' v' + version + ' initialized.');
    };

    //Circle/ellipse building portion of function is modified from TheAaron's "dlcircle" script
    const buildCircleGrid = function(who, rad, left, top, makeGrid, gridSize) {
        const centerX = rad
        const centerY = rad
        let circlePoints;
        let gridPoints = ""

        try {
            const at = (theta) => ({x: Math.cos(theta)*rad, y: Math.sin(theta)*rad});
            let steps = Math.min(Math.max(Math.round( (Math.PI*2*Math.sqrt((2*rad*rad)/2))/35),4),20);
            const stepSize = Math.PI/(2*steps);
            let acc=[[],[],[],[]];
            let th=0;
            _.times(steps+1,()=>{
                let pt=at(th);
                acc[0].push([pt.x,pt.y]);
                acc[1].push([-pt.x,pt.y]);
                acc[2].push([-pt.x,-pt.y]);
                acc[3].push([pt.x,-pt.y]);
                th+=stepSize;
            });
            acc = acc[0].concat(
                acc[1].reverse().slice(1),
                acc[2].slice(1),
                acc[3].reverse().slice(1)
            );

            //We will take this string, strip the last "]", append the grid points to the path, then add the trailing "]" when we return the full JSON
            circlePoints = JSON.stringify(acc.map((v,i)=>([(i?'L':'M'),rad+v[0],rad+v[1]])));
            circlePoints = circlePoints.substring(0, circlePoints.length - 1);

            if (makeGrid) {
                //Define grid points & build JSON string
                let x1 = 0, x2 = 0, y1 = 0, y2 = 0;
                let x = 0, y = 0;

                //Try to align the darkness path to the actual map grid
                        //remember, path coords are relative to (left, top) of the path object, NOT to the map grid.
                let startX = gridSize - (left-rad) % gridSize;
                let startY = gridSize - (top-rad) % gridSize;

                //build the grid
                for (x = startX; x <= 2*rad; x+=gridSize) {
                    if( x >= 0) {
                        //vertical lines
                        y1 = centerY + Math.sqrt(rad*rad-(x-centerX)*(x-centerX));
                        y2 = centerY - Math.sqrt(rad*rad-(x-centerX)*(x-centerX));
                        gridPoints = gridPoints + ",[\"M\"," + x.toString() + "," + y1.toString() + "]";
                        gridPoints = gridPoints + ",[\"L\"," + x.toString() + "," + y2.toString() + "]";

                        for (y = startY; y <= 2*rad; y+=gridSize) {
                            if( y >= 0) {
                                //horizontal lines
                                x1 = centerX + Math. sqrt(rad*rad-(y-centerY)*(y-centerY));
                                x2 = centerX - Math. sqrt(rad*rad-(y-centerY)*(y-centerY));
                                gridPoints = gridPoints + ",[\"M\"," + x1.toString() + "," + y.toString() + "]";
                                gridPoints = gridPoints + ",[\"L\"," + x2.toString() + "," + y.toString() + "]";
                            }
                        }
                    }
                }
            }
            //this is the entire path
            return circlePoints + gridPoints + "]";
        }
        catch(err) {
          sendChat(scriptName,`/w "${who}" `+ 'Unhandled exception: ' + err.message);
        }
    };

    const handleInput = function(msg) {
        try {
            if(msg.type=="api" && msg.content.indexOf("!dldark")==0)
            {
                let selected = msg.selected;
                let buffer = 0;
                let makeGrid = true;
                let sendToMap = true;

                let who = getObj('player',msg.playerid).get('_displayname');

                if (selected===undefined) {
                    sendChat(scriptName,`/w "${who}" `+ 'You must select a token to proceed');
                    return;
                }

                let cmd = msg.content.split(/\s+/);
                if (cmd.length > 1) {
                    if (isNaN(cmd[1])) {
                        sendChat(scriptName,`/w "${who}" `+ 'Non-numeric buffer detected. Format is \"!dldark # boolean boolean\"');
                        return;
                    } else {
                        buffer = parseInt(cmd[1]);
                    }
                }
                if (cmd.length > 2) {
                    if (_.contains(['true', 'yes', '1'], cmd[2].toLowerCase())) {
                        makeGrid = true;
                    } else if (_.contains(['false', 'no', '0'], cmd[2].toLowerCase())) {
                        makeGrid = false;
                    } else {
                        sendChat(scriptName,`/w "${who}" `+ 'Non-boolean makeGrid flag detected. Format is \"!dldark # boolean boolean\"');
                        return;
                    }
                }
                if (cmd.length > 3) {
                    if (_.contains(['true', 'yes', '1'], cmd[3].toLowerCase())) {
                        sendToMap = true;
                    } else if (_.contains(['false', 'no', '0'], cmd[3].toLowerCase())) {
                        sendToMap = false;
                    } else {
                        sendChat(scriptName,`/w "${who}" `+ 'Non-boolean sendToMapLayer flag detected. Format is \"!dldark # boolean boolean\"');
                        return;
                    }
                }

                let tok = getObj("graphic",selected[0]._id);
                let left = tok.get("left");
                let top = tok.get("top");
                let pageID = tok.get("pageid");

                //page grid settings
                let thePage = getObj("page", pageID);
                //let pageScaleNumber = thePage.get("scale_number");
                let pageGridSize = 70 * thePage.get("snapping_increment");
                if ( pageGridSize === 0) { //gridless map support
                    //override user input
                    makeGrid = false;
                }

                let radius = (tok.get("width"))/2 - buffer;
                let pathstring = buildCircleGrid(who, radius, left, top, makeGrid, pageGridSize);

                let path = createObj("path", {
                    pageid: tok.get("pageid"),
                    path: pathstring,
                    fill: "transparent",
                    stroke: "#ff0000",
                    layer: "walls",
                    stroke_width: 5,
                    width: radius*2,
                    height: radius*2,
                    left: tok.get("left"),
                    top: tok.get("top"),
                });

                if (path) {
                    if (sendToMap) {
                        tok.set("layer", "map");
                        toFront(tok);
                    } else {
                        toBack(tok);
                    }
                    sendChat(scriptName,`/w "${who}" `+ 'Darkness created on Dynamic Lighting layer');
                } else {
                    sendChat(scriptName,`/w "${who}" `+ 'Unknown error. createObj failed. DL path not created.');
                    return;
                }
            }
        }
        catch(err) {
          sendChat('dldarkAPI',`/w "${who}" `+ 'Unhandled exception: ' + err.message);
        }
    };

    const registerEventHandlers = function() {
        on('chat:message', handleInput);
    };

    on("ready",() => {
        checkInstall();
        registerEventHandlers();
    });
})();


text:
.if exists(arch/${MACHINE})
SUBDIR+=arch/${MACHINE}
.else
SUBDIR+=arch/dummy
.endif

.if ALL_MACHINES

SUBDIR  = arch/amd64
SUBDIR += arch/evbarm
SUBDIR += arch/i386

# XXX notyet SUBDIR += arch/iyonix

# These dirs are present in sys/arch but not here:
#    amigappc cesfic dreamcast epoc32 evbsh3 ia64 ibmnws iyonix luna68k
#    mmeye mvmeppc netwinder next68k rs6000 sbmips sun2 sun3
# (also evbsh5, but it doesn't really exist)
SUBDIR += arch/dummy

.endif

install:

.include <bsd.subdir.mk>


text:
<?php

// Warning! This code was generated by WSDL2PHP tool.
// author: Filippov Andrey <afi.work@gmail.com>
// see https://solo-framework-lib.googlecode.com

namespace Moneta\Types;

/**
 * Запрос на получение данных договора по ID пользователя. Если данные не найдены, возвращается пустой список.
	 * Request for contract information by a user ID. If MONETA.RU does not find information, the request contains an empty list.
	 *
 */
class FindContractsRequest extends Entity
{

	/**
	 * ID пользователя в системе МОНЕТА.РУ.
	 * Если это поле не задано, то используется текущий пользователь.
	 * MONETA.RU user ID.
	 * If you omit this element, MONETA.RU uses the ID of the user who sends the request.
	 *
	 *
	 * @var long
	 */
	 public $unitId = null;

}


text:
<!DOCTYPE html>

    <title>Indoor Patient Register</title>
    <link href="../../../resources/css/datepicker3.css" th:href="@{/resources/css/datepicker3.css}" rel="stylesheet"/>

New Registry Entry

New Register Entry

                <form class="form-horizontal" method='POST' th:object="${register}" th:action="@{/register/save}">

                        <fieldset>
                            <legend th:text="#{heading.patient.emergency.contact}">Register Info</legend>
                            <input type="hidden" th:field="*{patient.id}"/>

                                    Contact Name

                                    <input type="text" class="form-control input-sm" id="patient-contact-name"
                                           th:field="*{patientContact.contactPerson}"/>

                                        Required

                                    Emergency Contact Number

                                    <input type="text" class="form-control input-sm" id="emergency-contact-name"
                                           th:field="*{patientContact.emergencyContactNumber}"/>

                                        Required

                                    Relationship

                                    <select class="form-control"
                                            th:field="*{patientContact.relationship}">
                                        <option value="" th:text="#{common.select.prompt}"></option>
                                        <option th:each="relationship : ${T(org.jugbd.mnet.domain.enums.Relationship).values()}"
                                                th:value="${relationship}"
                                                th:text="${relationship.label}"
                                                th:selected="${relationship == register.patientContact.relationship}">
                                        </option>
                                    </select>

                                        Required

                                    Comment

                                        <input type="text" class="form-control input-sm"
                                               th:field="*{patientContact.comments}"/>

                                            Required

                        </fieldset>

                        <fieldset>
                            <legend>Admission Information</legend>

                                    Registration Number

                                    <input type="text" class="form-control input-sm" th:field="*{registrationId}"/>

                                        Required

                                 Registration Type

                                    <select class="form-control" th:field="*{registrationType}">
                                        <option value="" th:text="#{common.select.prompt}"></option>
                                        <option th:each="type : ${T(org.jugbd.mnet.domain.enums.RegistrationType).values()}"
                                                th:value="${type}"
                                                th:text="${type.label}"
                                                th:selected="${type == register.registrationType}">
                                        </option>
                                    </select>

                                        Required

                                 Ward

                                    <input type="text" class="form-control input-sm" th:field="*{ward}"/>

                                        Required

                                    Comment

                                        <textarea type="text" class="form-control input-sm" th:field="*{wardOther}"></textarea>

                                            Required

                                 Bed
                                    Number

                                    <input type="text" class="form-control input-sm" th:field="*{bedNumber}"/>

                                        Required

                                    Unit

                                    <select class="form-control" th:field="*{unit}">
                                        <option value="" th:text="#{common.select.prompt}"></option>
                                        <option th:each="unit : ${T(org.jugbd.mnet.domain.enums.Unit).values()}"
                                                th:value="${unit}"
                                                th:text="${unit.label}"
                                                th:selected="${unit == register.unit}">
                                        </option>
                                    </select>

                                        Required

                                    Admission Date

                                    <input type="text" class="form-control input-sm" th:field="*{admissionDate}"/>

                                        Required

                        </fieldset>

                         Cancel
                        <button type="submit" class="btn btn-primary pull-right">Save Changes </button>

                </form>


text: export default d => d;