text:
package org.apache.oodt.cas.pge.writers;

//JDK imports
import java.io.File;
import java.io.IOException;
import java.util.logging.Logger;

//OODT imports
import org.apache.commons.io.FileUtils;
import org.apache.oodt.cas.metadata.Metadata;

//Junit imports
import junit.framework.TestCase;

/**
 *
 * Test harness for the MetadataKeyReplacementWriter.
 *
 * @author mattmann
 * @version $Revision$
 *
 */
public class MetadataKeyReplacementTemplateWriterTest extends TestCase {

  private static final Logger LOG = Logger
      .getLogger(MetadataKeyReplacementTemplateWriterTest.class.getName());

  private static final String expected = "Welcome to ApacheCon Paul and Chris! You are a member of the following projects OODT,Tika,SIS,Gora.";

  public void testGenerateTemplate() throws IOException {
    MetadataKeyReplacerTemplateWriter writer = new MetadataKeyReplacerTemplateWriter();
    String templateSourcePath = "./src/test/resources/metkeyreplace.template";
    String outPath = File.createTempFile("foo", "bar").getParentFile()
        .getAbsolutePath();
    if (!outPath.endsWith("/"))
      outPath += "/";

    outPath += "generated.template";

    Metadata met = new Metadata();
    met.addMetadata("Person1", "Paul");
    met.addMetadata("Person2", "Chris");
    met.addMetadata("Projects", "OODT");
    met.addMetadata("Projects", "Tika");
    met.addMetadata("Projects", "SIS");
    met.addMetadata("Projects", "Gora");

    try {
      writer.generateFile(outPath, met, LOG, templateSourcePath);
    } catch (Exception e) {
      e.printStackTrace();
      fail(e.getMessage());
    }

    assertTrue(new File(outPath).exists());
    String fileString = FileUtils.readFileToString(new File(outPath));
    assertNotNull(fileString);
    assertEquals(expected, fileString);
  }
}


text:
require 'vlad'

module Sprinkle
  module Actors
    # The Vlad actor is one of the delivery method options available out of the
    # box with Sprinkle. If you have the vlad the deployer gem installed, you
    # may use this delivery. The only configuration option available, and
    # which is mandatory to include is +script+. An example:
    #
    #   deployment do
    #     delivery :vlad do
    #       script 'deploy'
    #     end
    #   end
    #
    # script is given a list of files which vlad will include and load.
    # These recipes are mainly to set variables such as :user, :password, and to
    # set the app domain which will be sprinkled.
    class Vlad < Actor
      attr_accessor :loaded_recipes #:nodoc:

      def initialize(&block) #:nodoc:
        self.instance_eval &block if block
      end

      def servers_for_role?
        raise "The vlad actor needs a maintainer.  "+
        "Please file an issue on github.com/sprinkle-tool/sprinkle if you can help."
      end

      def sudo?
        # TODO
        raise
      end

      def sudo_command
        "sudo"
      end

      # Defines a script file which will be included by vlad. Use these
      # script files to set vlad specific configurations. Multiple scripts
      # may be specified through multiple script calls, an example:
      #
      #   deployment do
      #     delivery :vlad do
      #       script 'deploy'
      #       script 'magic_beans'
      #     end
      #   end
      def script(name)
        @loaded_recipes ||= []
        require name
        @loaded_recipes << name
      end

      def install(installer, roles, opts={})
        @installer=installer
        if installer.install_sequence.include?(:TRANSFER)
          process_with_transfer(installer.package.name, installer.install_sequence, roles, opts)
        else
          process(installer.package.name, installer.install_sequence, roles, opts)
        end
      # recast our rake error to the common sprinkle error type
      rescue ::Rake::CommandFailedError => e
        raise Sprinkle::Errors::RemoteCommandFailure.new(installer, {}, e)
      ensure
        @installer = nil
      end

      def verify(verifier, roles, opts={})
        process(verifier.package.name, commands, roles,
          :suppress_and_return_failures => true)
      end

      protected

      def process(name, commands, roles, opts ={}) #:nodoc:
        commands = commands.map{|x| "#{sudo_command} #{x}"} if sudo?
        commands = commands.join(' && ')
        puts "executing #{commands}"
        task = remote_task(task_sym(name), :roles => roles) { run commands }
        invoke(task)
      end

      def process_with_transfer(name, commands, roles, opts ={}) #:nodoc:
        raise "cant do non recursive file transfers, sorry" if opts[:recursive] == false
        commands = commands.map{|x| x == :TRANSFER ? x : "sudo #{x}" } if sudo?
        i = commands.index(:TRANSFER)
        before = commands.first(i).join(" && ")
        after = commands.last(commands.size-i+1).join(" && ")
        inst = @installer
        task = remote_task(task_sym(name), :roles => roles) do
          run before unless before.empty?
          rsync inst.sourcepath, inst.destination
          run after unless after.empty?
        end
        invoke(task)
      end

      def invoke(t)
        t.invoke
        return true
      rescue ::Rake::CommandFailedError => e
        return false if opts[:suppress_and_return_failures]
        # Reraise error if we're not suppressing it
        raise e
      end

      private

        def task_sym(name)
          "install_#{name.to_task_name}".to_sym
        end
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
package org.panteleyev.money.app.cells;

import javafx.scene.control.TableCell;
import org.panteleyev.money.app.icons.IconManager;
import org.panteleyev.money.model.Transaction;

import static org.panteleyev.money.app.GlobalContext.cache;

public class TransactionDebitedAccountCell extends TableCell<Transaction, Transaction> {
    @Override
    public void updateItem(Transaction transaction, boolean empty) {
        super.updateItem(transaction, empty);

        setText("");
        setGraphic(null);

        if (empty || transaction == null) {
            return;
        }

        cache().getAccount(transaction.accountDebitedUuid()).ifPresent(account -> {
            setText(account.name());
            setGraphic(IconManager.getAccountImageView(account));
        });
    }
}


text:
package org.mdpnp.vista.spi;

public interface VistaConnection<Request, Reply> {

    boolean isConnected();

    boolean connect();

    boolean disconnect();

    Transport getTransport();
}


text:
source /etc/profile.d/modules.sh
module load matlab
module load gams/23.6.3
GAMS=`which gams`
export GAMS
module load cplex
cd ~/projects/advpower/models/MATLAB


text:
var deploy  = require('./deployment'),
    args = process.argv.slice(2);

// help/usage function
function help() {
    console.log('');
    console.log('Usage: node target-list.js [--win10] [ --emulators | --devices | --started_emulators | --all ]');
    console.log('    --win10             : Chooses to list Windows 10 devices (Windows 8.1 is default).');
    console.log('    --emulators         : List the possible target emulators availible.');
    console.log('    --devices           : List the possible target devices availible.');
    console.log('    --started_emulators : List any started emulators availible. *NOT IMPLEMENTED YET*');
    console.log('    --all               : List all available devices');
    console.log('examples:');
    console.log('    node target-list.js --emulators');
    console.log('    node target-list.js --win10 --devices');
    console.log('    node target-list.js --started_emulators');
    console.log('    node target-list.js --all');
    console.log('');
}

// Handle help flag
if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(args[0]) > -1) {
    help();
} else {

    var version = '8.1';
    if (args.indexOf('--win10') >= 0) {
        version = '10.0';
    }

    var onlyDevices = false;
    if (args.indexOf('--devices') >= 0) {
        onlyDevices = true;
    }

    var onlyEmulators = false;
    if (args.indexOf('--emulators') >= 0) {
        onlyEmulators = true;
    }

    if (onlyDevices && onlyEmulators) {
        console.warn('Error: Cannot specify both --emulators and --devices');
        help();
        return;
    }

    var deploymentTool = deploy.getDeploymentTool(version);
    deploymentTool.enumerateDevices().then(function (deviceList) {
        if (onlyDevices || onlyEmulators) {
            deviceList = deviceList.filter(function(device) {
                return (onlyDevices && device.type === 'device') || (onlyEmulators && device.type === 'emulator');
            });
        }

        deviceList.forEach(function (device) {
            console.log(device.toString());
        });

        if (deviceList.length === 0) {
            console.log('No devices found matching the specified criteria.');
        }
    });
}


text:
from lof_gfx import renderer as base_renderer
from lof_fs import fs
import lof_game as game

import os, time
import pygame
from pygame.locals import *

TILE_WIDTH = 16
TILE_HEIGHT = TILE_WIDTH
FRAMERATE = 60
TIME_PER_FRAME = 1.0/float(FRAMERATE)

rotation = {"up": 0, "left": 90, "down": 180, "right": 270}

keys = {
	pygame.K_a: "a",
	pygame.K_b: "b",
	pygame.K_c: "c",
	pygame.K_d: "d",
	pygame.K_e: "e",
	pygame.K_f: "f",
	pygame.K_g: "g",
	pygame.K_h: "h",
	pygame.K_i: "i",
	pygame.K_j: "j",
	pygame.K_k: "k",
	pygame.K_l: "l",
	pygame.K_m: "m",
	pygame.K_n: "n",
	pygame.K_o: "o",
	pygame.K_p: "p",
	pygame.K_q: "q",
	pygame.K_r: "r",
	pygame.K_s: "s",
	pygame.K_t: "t",
	pygame.K_u: "u",
	pygame.K_v: "v",
	pygame.K_w: "w",
	pygame.K_x: "x",
	pygame.K_y: "y",
	pygame.K_z: "z",
	pygame.K_UP: "UPARROW",
	pygame.K_LEFT: "LEFTARROW",
	pygame.K_DOWN: "DOWNARROW",
	pygame.K_RIGHT: "RIGHTARROW",
	pygame.K_ESCAPE: "ESC",
	pygame.K_RETURN: "ENTER"
}

class renderer (base_renderer):

    def _init_dpy (self):
        pygame.font.init()
        self.dpy = pygame.display.set_mode((640, 480))
        self.last_refresh = time.clock()

    def _init_res (self):
        self.sprites = {"tiles": {},
                        "units": {"red": {}, "blue": {}},
                        "beams": {"red": {}, "blue": {}},
                        "cursors": {},
                        "shades": {}
                        }
        self.fs.add_resource_type ("sprite", "sprites", "png")
        self.fs.add_resource_type ("font", "fonts", "ttf")
        for tilename in ["blank", "goal"]:
            resfile = self.fs.locate_resource ("sprite", tilename+"_tile")
            self.sprites["tiles"][tilename] = self.load_sprite (resfile)
        for unitname in ["triangle", "diamond"]:
            for teamname in ["red", "blue"]:
                resname = teamname + "_" + unitname
                resfile = self.fs.locate_resource ("sprite", resname)
                ressurf = self.load_sprite (resfile)
                self.sprites["units"][teamname][unitname] = ressurf
        for beamname in ["beam", "beam_end"]:
            for teamname in ["red", "blue"]:
                resname = teamname + "_" + beamname
                resfile = self.fs.locate_resource ("sprite", resname)
                ressurf = self.load_sprite (resfile)
                self.sprites["beams"][teamname][beamname] = ressurf
        for cursorname in ["selected", "target", "std"]:
            resfile = self.fs.locate_resource ("sprite", cursorname+"_cursor")
            self.sprites["cursors"][cursorname] = self.load_sprite (resfile)
        for shadename in ["red", "blue"]:
            resfile = self.fs.locate_resource ("sprite", shadename+"_shaded")
            self.sprites["shades"][shadename] = self.load_sprite (resfile)
        menu_font_path = pygame.font.match_font ("liberation mono,courier new")
        if menu_font_path == None:
            for resname in ["LiberationMono-Regular", "cour"]:
                respath = self.fs.locate_resource ("font", resname)
                if os.path.exists (respath):
                    menu_font_path = respath
                    break
        assert menu_font_path != None, "Unable to locate a usable font!"
        self.font = pygame.font.Font (menu_font_path, (TILE_HEIGHT*3)/4)
        self.button_cache = {}

    def load_sprite (self, filename):
        res = pygame.image.load (filename).convert_alpha()
        assert res.get_width() == TILE_WIDTH, \
                filename+" is the wrong width!"
        assert res.get_height() == TILE_HEIGHT, \
                filename+" is the wrong height!"
        return res

    def get_resource (self, piece):
        try:
            if piece.piecetype == "tile":
                assert  piece.tiletype in self.sprites["tiles"], \
                        "No such tile type "+piece.tiletype
                return self.sprites["tiles"][piece.tiletype]
            elif piece.piecetype == "shade":
                assert  piece.team in self.sprites["shades"], \
                        "No such team "+piece.team
                return self.sprites["shades"][piece.team]
            elif piece.piecetype == "cursor":
                assert  piece.cursortype in self.sprites["cursors"], \
                        "No such cursor "+piece.cursortype
                return self.sprites["cursors"][piece.cursortype]
            elif piece.piecetype == "unit":
                assert  piece.team in self.sprites["units"], \
                        "No such team "+piece.team
                unittypes = self.sprites["units"][piece.team]
                assert  piece.unittype in unittypes, \
                        "No such unit type "+piece.unittype
                assert  piece.direction in rotation, \
                        "No such direction "+piece.direction
                if piece.unittype == "diamond":
                    return unittypes[piece.unittype] #diamonds aren't rotated
                return pygame.transform.rotate (unittypes[piece.unittype],
                                                rotation[piece.direction])
            elif piece.piecetype == "beam":
                assert  piece.team in self.sprites["beams"], \
                        "No such team "+piece.team
                beamtypes = self.sprites["beams"][piece.team]
                assert  piece.beamtype in beamtypes, \
                        "No such beam type "+piece.beamtype
                assert  piece.direction in rotation, \
                        "No such direction "+piece.direction
                return pygame.transform.rotate (beamtypes[piece.beamtype],
                                                rotation[piece.direction])
            else:
                assert False, "No such piece type "+piece.piecetype
        except:
            print "Malformed piece object!"
            raise

    def get_button_resource (self, text):
        if text in self.button_cache:
            return self.button_cache[text]
        surf = self.font.render (text, True, (255,255,255), (0,0,0))
        self.button_cache[text] = (surf, surf.get_width())
        return self.button_cache[text]

    def refresh (self):
        time.sleep (max(TIME_PER_FRAME-time.clock()+self.last_refresh, 0))
        pygame.display.update()
        self.last_refresh = time.clock()

    def draw_cell (self, cell):
        pos = (cell.x*TILE_WIDTH, cell.y*TILE_HEIGHT)
        if cell.layers[game.LAYER_TILE] == None:
            self.dpy.blit (self.get_resource (game.tile ("blank")), pos)
        for piece in cell.layers:
            if piece != None:
                spr = self.get_resource (piece)
                self.dpy.blit (spr, pos)

    def draw_button (self, button, selected):
        pos = (button.startx, (button.rownum+25)*TILE_HEIGHT)
        if selected:
            self.dpy.blit (button.selected, pos)
        else:
            self.dpy.blit (button.resource, pos)

    def update_inputstate (self, input_state):
        for event in pygame.event.get():
            evtype = event.type
            if evtype == pygame.MOUSEMOTION:
                (mouse_x, mouse_y) = pygame.mouse.get_pos()
                input_state.cursor_x = mouse_x/TILE_WIDTH
                input_state.cursor_y = mouse_y/TILE_HEIGHT
            elif evtype == pygame.KEYUP:
                if event.key in keys:
                    input_state.buttons = [keys[event.key]] + input_state.buttons
                else:
                    print "Unknown key type", event.key
            elif evtype == pygame.MOUSEBUTTONUP:
                if event.button == 1: #left click
                    input_state.buttons = ["MOUSE1"] + input_state.buttons
                elif event.button == 2: #middle click
                    input_state.buttons = ["MOUSE3"] + input_state.buttons
                elif event.button == 3: #right click
                    input_state.buttons = ["MOUSE2"] + input_state.buttons


text:
angular.module('app.form-samples-mgmt')
    .controller('Example4Ctrl', function () {
        'use strict';

        this.customMessageRepo = {
            password: {
                equal: {
                    msg: 'OASP.VALIDATION.SHOWCASE.PSWD_EQUAL'
                },
                required: {
                    msg: 'OASP.VALIDATION.SHOWCASE.PSWD_REQUIRED'
                }
            }
        };

    });


text:
var mongoose = require('mongoose')
  , Schema = mongoose.Schema;

var Page = new Schema({
  pageID: String,
  userID: String,
  options: Object,
  created_at: { type: Date, default: Date.now }
});

var page = mongoose.model('Page', Page);

module.exports = page;


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

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import io.trino.filesystem.TrinoFileSystem;
import io.trino.filesystem.hdfs.HdfsFileSystemFactory;
import io.trino.parquet.ParquetReaderOptions;
import io.trino.plugin.deltalake.AccessTrackingFileSystemFactory;
import io.trino.plugin.deltalake.transactionlog.checkpoint.CheckpointSchemaManager;
import io.trino.plugin.hive.FileFormatDataSourceStats;
import io.trino.plugin.hive.parquet.ParquetReaderConfig;
import io.trino.spi.connector.SchemaTableName;
import org.apache.hadoop.fs.Path;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Stream;

import static com.google.common.collect.ImmutableList.toImmutableList;
import static io.trino.plugin.deltalake.transactionlog.checkpoint.CheckpointEntryIterator.EntryType.ADD;
import static io.trino.plugin.deltalake.transactionlog.checkpoint.CheckpointEntryIterator.EntryType.PROTOCOL;
import static io.trino.plugin.hive.HiveTestUtils.HDFS_ENVIRONMENT;
import static io.trino.testing.TestingConnectorSession.SESSION;
import static io.trino.type.InternalTypeManager.TESTING_TYPE_MANAGER;
import static org.assertj.core.api.Assertions.assertThat;
import static org.testng.Assert.assertEquals;

@Test(singleThreaded = true)
public class TestTableSnapshot
{
    private final ParquetReaderOptions parquetReaderOptions = new ParquetReaderConfig().toParquetReaderOptions();

    private CheckpointSchemaManager checkpointSchemaManager;
    private AccessTrackingFileSystemFactory accessTrackingFileSystemFactory;
    private TrinoFileSystem accessTrackingFileSystem;
    private Path tableLocation;

    @BeforeMethod
    public void setUp()
            throws URISyntaxException
    {
        checkpointSchemaManager = new CheckpointSchemaManager(TESTING_TYPE_MANAGER);
        URI deltaLogPath = getClass().getClassLoader().getResource("databricks/person").toURI();
        tableLocation = new Path(deltaLogPath);

        accessTrackingFileSystemFactory = new AccessTrackingFileSystemFactory(new HdfsFileSystemFactory(HDFS_ENVIRONMENT));
        accessTrackingFileSystem = accessTrackingFileSystemFactory.create(SESSION);
    }

    @Test
    public void testOnlyReadsTrailingJsonFiles()
            throws IOException
    {
        Map<String, Integer> expectedFileAccess = new HashMap<>();
        TableSnapshot tableSnapshot = TableSnapshot.load(
                new SchemaTableName("schema", "person"), accessTrackingFileSystem, tableLocation, parquetReaderOptions, true);
        expectedFileAccess.put("_last_checkpoint", 1);
        expectedFileAccess.put("00000000000000000011.json", 1);
        expectedFileAccess.put("00000000000000000012.json", 1);
        expectedFileAccess.put("00000000000000000013.json", 1);
        expectedFileAccess.put("00000000000000000014.json", 1);
        assertEquals(accessTrackingFileSystemFactory.getOpenCount(), expectedFileAccess);

        tableSnapshot.getJsonTransactionLogEntries().forEach(entry -> {});
        assertEquals(accessTrackingFileSystemFactory.getOpenCount(), expectedFileAccess);
    }

    // TODO: Can't test the FileSystem access here because the DeltaLakePageSourceProvider doesn't use the FileSystem passed into the TableSnapshot. (https://github.com/trinodb/trino/issues/12040)
    @Test
    public void readsCheckpointFile()
            throws IOException
    {
        TableSnapshot tableSnapshot = TableSnapshot.load(
                new SchemaTableName("schema", "person"), accessTrackingFileSystem, tableLocation, parquetReaderOptions, true);
        tableSnapshot.setCachedMetadata(Optional.of(new MetadataEntry("id", "name", "description", null, "schema", ImmutableList.of(), ImmutableMap.of(), 0)));
        try (Stream<DeltaLakeTransactionLogEntry> stream = tableSnapshot.getCheckpointTransactionLogEntries(
                SESSION, ImmutableSet.of(ADD), checkpointSchemaManager, TESTING_TYPE_MANAGER, accessTrackingFileSystem, new FileFormatDataSourceStats())) {
            List<DeltaLakeTransactionLogEntry> entries = stream.collect(toImmutableList());

            assertThat(entries).hasSize(9);

            assertThat(entries).element(3).extracting(DeltaLakeTransactionLogEntry::getAdd).isEqualTo(
                    new AddFileEntry(
                            "age=42/part-00003-0f53cae3-3e34-4876-b651-e1db9584dbc3.c000.snappy.parquet",
                            Map.of("age", "42"),
                            2634,
                            1579190165000L,
                            false,
                            Optional.of("{" +
                                    "\"numRecords\":1," +
                                    "\"minValues\":{\"name\":\"Alice\",\"address\":{\"street\":\"100 Main St\",\"city\":\"Anytown\",\"state\":\"NY\",\"zip\":\"12345\"},\"income\":111000.0}," +
                                    "\"maxValues\":{\"name\":\"Alice\",\"address\":{\"street\":\"100 Main St\",\"city\":\"Anytown\",\"state\":\"NY\",\"zip\":\"12345\"},\"income\":111000.0}," +
                                    "\"nullCount\":{\"name\":0,\"married\":0,\"phones\":0,\"address\":{\"street\":0,\"city\":0,\"state\":0,\"zip\":0},\"income\":0}" +
                                    "}"),
                            Optional.empty(),
                            null));

            assertThat(entries).element(7).extracting(DeltaLakeTransactionLogEntry::getAdd).isEqualTo(
                    new AddFileEntry(
                            "age=30/part-00002-5800be2e-2373-47d8-8b86-776a8ea9d69f.c000.snappy.parquet",
                            Map.of("age", "30"),
                            2688,
                            1579190165000L,
                            false,
                            Optional.of("{" +
                                    "\"numRecords\":1," +
                                    "\"minValues\":{\"name\":\"Andy\",\"address\":{\"street\":\"101 Main St\",\"city\":\"Anytown\",\"state\":\"NY\",\"zip\":\"12345\"},\"income\":81000.0}," +
                                    "\"maxValues\":{\"name\":\"Andy\",\"address\":{\"street\":\"101 Main St\",\"city\":\"Anytown\",\"state\":\"NY\",\"zip\":\"12345\"},\"income\":81000.0}," +
                                    "\"nullCount\":{\"name\":0,\"married\":0,\"phones\":0,\"address\":{\"street\":0,\"city\":0,\"state\":0,\"zip\":0},\"income\":0}" +
                                    "}"),
                            Optional.empty(),
                            null));
        }

        // lets read two entry types in one call; add and protocol
        try (Stream<DeltaLakeTransactionLogEntry> stream = tableSnapshot.getCheckpointTransactionLogEntries(
                SESSION, ImmutableSet.of(ADD, PROTOCOL), checkpointSchemaManager, TESTING_TYPE_MANAGER, accessTrackingFileSystem, new FileFormatDataSourceStats())) {
            List<DeltaLakeTransactionLogEntry> entries = stream.collect(toImmutableList());

            assertThat(entries).hasSize(10);

            assertThat(entries).element(3).extracting(DeltaLakeTransactionLogEntry::getAdd).isEqualTo(
                    new AddFileEntry(
                            "age=42/part-00003-0f53cae3-3e34-4876-b651-e1db9584dbc3.c000.snappy.parquet",
                            Map.of("age", "42"),
                            2634,
                            1579190165000L,
                            false,
                            Optional.of("{" +
                                    "\"numRecords\":1," +
                                    "\"minValues\":{\"name\":\"Alice\",\"address\":{\"street\":\"100 Main St\",\"city\":\"Anytown\",\"state\":\"NY\",\"zip\":\"12345\"},\"income\":111000.0}," +
                                    "\"maxValues\":{\"name\":\"Alice\",\"address\":{\"street\":\"100 Main St\",\"city\":\"Anytown\",\"state\":\"NY\",\"zip\":\"12345\"},\"income\":111000.0}," +
                                    "\"nullCount\":{\"name\":0,\"married\":0,\"phones\":0,\"address\":{\"street\":0,\"city\":0,\"state\":0,\"zip\":0},\"income\":0}" +
                                    "}"),
                            Optional.empty(),
                            null));

            assertThat(entries).element(6).extracting(DeltaLakeTransactionLogEntry::getProtocol).isEqualTo(new ProtocolEntry(1, 2));

            assertThat(entries).element(8).extracting(DeltaLakeTransactionLogEntry::getAdd).isEqualTo(
                    new AddFileEntry(
                            "age=30/part-00002-5800be2e-2373-47d8-8b86-776a8ea9d69f.c000.snappy.parquet",
                            Map.of("age", "30"),
                            2688,
                            1579190165000L,
                            false,
                            Optional.of("{" +
                                    "\"numRecords\":1," +
                                    "\"minValues\":{\"name\":\"Andy\",\"address\":{\"street\":\"101 Main St\",\"city\":\"Anytown\",\"state\":\"NY\",\"zip\":\"12345\"},\"income\":81000.0}," +
                                    "\"maxValues\":{\"name\":\"Andy\",\"address\":{\"street\":\"101 Main St\",\"city\":\"Anytown\",\"state\":\"NY\",\"zip\":\"12345\"},\"income\":81000.0}," +
                                    "\"nullCount\":{\"name\":0,\"married\":0,\"phones\":0,\"address\":{\"street\":0,\"city\":0,\"state\":0,\"zip\":0},\"income\":0}" +
                                    "}"),
                            Optional.empty(),
                            null));
        }
    }

    @Test
    public void testMaxTransactionId()
            throws IOException
    {
        TableSnapshot tableSnapshot = TableSnapshot.load(
                new SchemaTableName("schema", "person"), accessTrackingFileSystem, tableLocation, parquetReaderOptions, true);
        assertEquals(tableSnapshot.getVersion(), 13L);
    }
}


text:
namespace dcisharp.Experiments.Mapping
{
    public class LedgerEntry
    {
        public LedgerEntry(string message, int amount)
        {
            Message = message;
            Amount = amount;
        }

        public string Message { get; private set; }
        public int Amount { get; private set; }
    }
}


text:
.class public Landroid/content/pm/ComponentInfo;
.super Landroid/content/pm/PackageItemInfo;
.source "ComponentInfo.java"

# instance fields
.field public applicationInfo:Landroid/content/pm/ApplicationInfo;

.field public descriptionRes:I

.field public enabled:Z

.field public exported:Z

.field public processName:Ljava/lang/String;

# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 66
    invoke-direct {p0}, Landroid/content/pm/PackageItemInfo;-><init>()V

    .line 56
    const/4 v0, 0x1

    iput-boolean v0, p0, Landroid/content/pm/ComponentInfo;->enabled:Z

    .line 64
    const/4 v0, 0x0

    iput-boolean v0, p0, Landroid/content/pm/ComponentInfo;->exported:Z

    .line 66
    return-void
.end method

.method public constructor <init>(Landroid/content/pm/ComponentInfo;)V
    .locals 1
    .param p1, "orig"    # Landroid/content/pm/ComponentInfo;

    .prologue
    .line 70
    invoke-direct {p0, p1}, Landroid/content/pm/PackageItemInfo;-><init>(Landroid/content/pm/PackageItemInfo;)V

    .line 56
    const/4 v0, 0x1

    iput-boolean v0, p0, Landroid/content/pm/ComponentInfo;->enabled:Z

    .line 64
    const/4 v0, 0x0

    iput-boolean v0, p0, Landroid/content/pm/ComponentInfo;->exported:Z

    .line 71
    iget-object v0, p1, Landroid/content/pm/ComponentInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    iput-object v0, p0, Landroid/content/pm/ComponentInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    .line 72
    iget-object v0, p1, Landroid/content/pm/ComponentInfo;->processName:Ljava/lang/String;

    iput-object v0, p0, Landroid/content/pm/ComponentInfo;->processName:Ljava/lang/String;

    .line 73
    iget v0, p1, Landroid/content/pm/ComponentInfo;->descriptionRes:I

    iput v0, p0, Landroid/content/pm/ComponentInfo;->descriptionRes:I

    .line 74
    iget-boolean v0, p1, Landroid/content/pm/ComponentInfo;->enabled:Z

    iput-boolean v0, p0, Landroid/content/pm/ComponentInfo;->enabled:Z

    .line 75
    iget-boolean v0, p1, Landroid/content/pm/ComponentInfo;->exported:Z

    iput-boolean v0, p0, Landroid/content/pm/ComponentInfo;->exported:Z

    .line 69
    return-void
.end method

.method protected constructor <init>(Landroid/os/Parcel;)V
    .locals 3
    .param p1, "source"    # Landroid/os/Parcel;

    .prologue
    const/4 v1, 0x1

    const/4 v2, 0x0

    .line 171
    invoke-direct {p0, p1}, Landroid/content/pm/PackageItemInfo;-><init>(Landroid/os/Parcel;)V

    .line 56
    iput-boolean v1, p0, Landroid/content/pm/ComponentInfo;->enabled:Z

    .line 64
    iput-boolean v2, p0, Landroid/content/pm/ComponentInfo;->exported:Z

    .line 172
    sget-object v0, Landroid/content/pm/ApplicationInfo;->CREATOR:Landroid/os/Parcelable$Creator;

    invoke-interface {v0, p1}, Landroid/os/Parcelable$Creator;->createFromParcel(Landroid/os/Parcel;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/content/pm/ApplicationInfo;

    iput-object v0, p0, Landroid/content/pm/ComponentInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    .line 173
    invoke-virtual {p1}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Landroid/content/pm/ComponentInfo;->processName:Ljava/lang/String;

    .line 174
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v0

    iput v0, p0, Landroid/content/pm/ComponentInfo;->descriptionRes:I

    .line 175
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v0

    if-eqz v0, :cond_0

    move v0, v1

    :goto_0
    iput-boolean v0, p0, Landroid/content/pm/ComponentInfo;->enabled:Z

    .line 176
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v0

    if-eqz v0, :cond_1

    :goto_1
    iput-boolean v1, p0, Landroid/content/pm/ComponentInfo;->exported:Z

    .line 170
    return-void

    :cond_0
    move v0, v2

    .line 175
    goto :goto_0

    :cond_1
    move v1, v2

    .line 176
    goto :goto_1
.end method

# virtual methods
.method protected dumpBack(Landroid/util/Printer;Ljava/lang/String;)V
    .locals 3
    .param p1, "pw"    # Landroid/util/Printer;
    .param p2, "prefix"    # Ljava/lang/String;

    .prologue
    .line 152
    iget-object v0, p0, Landroid/content/pm/ComponentInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    if-eqz v0, :cond_0

    .line 153
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string/jumbo v1, "ApplicationInfo:"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-interface {p1, v0}, Landroid/util/Printer;->println(Ljava/lang/String;)V

    .line 154
    iget-object v0, p0, Landroid/content/pm/ComponentInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string/jumbo v2, "  "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, p1, v1}, Landroid/content/pm/ApplicationInfo;->dump(Landroid/util/Printer;Ljava/lang/String;)V

    .line 158
    :goto_0
    invoke-super {p0, p1, p2}, Landroid/content/pm/PackageItemInfo;->dumpBack(Landroid/util/Printer;Ljava/lang/String;)V

    .line 151
    return-void

    .line 156
    :cond_0
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string/jumbo v1, "ApplicationInfo: null"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-interface {p1, v0}, Landroid/util/Printer;->println(Ljava/lang/String;)V

    goto :goto_0
.end method

.method protected dumpFront(Landroid/util/Printer;Ljava/lang/String;)V
    .locals 2
    .param p1, "pw"    # Landroid/util/Printer;
    .param p2, "prefix"    # Ljava/lang/String;

    .prologue
    .line 143
    invoke-super {p0, p1, p2}, Landroid/content/pm/PackageItemInfo;->dumpFront(Landroid/util/Printer;Ljava/lang/String;)V

    .line 144
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string/jumbo v1, "enabled="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-boolean v1, p0, Landroid/content/pm/ComponentInfo;->enabled:Z

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string/jumbo v1, " exported="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-boolean v1, p0, Landroid/content/pm/ComponentInfo;->exported:Z

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 145
    const-string/jumbo v1, " processName="

    .line 144
    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 145
    iget-object v1, p0, Landroid/content/pm/ComponentInfo;->processName:Ljava/lang/String;

    .line 144
    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-interface {p1, v0}, Landroid/util/Printer;->println(Ljava/lang/String;)V

    .line 146
    iget v0, p0, Landroid/content/pm/ComponentInfo;->descriptionRes:I

    if-eqz v0, :cond_0

    .line 147
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string/jumbo v1, "description="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget v1, p0, Landroid/content/pm/ComponentInfo;->descriptionRes:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-interface {p1, v0}, Landroid/util/Printer;->println(Ljava/lang/String;)V

    .line 142
    :cond_0
    return-void
.end method

.method protected getApplicationInfo()Landroid/content/pm/ApplicationInfo;
    .locals 1

    .prologue
    .line 206
    iget-object v0, p0, Landroid/content/pm/ComponentInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    return-object v0
.end method

.method public final getBannerResource()I
    .locals 1

    .prologue
    .line 139
    iget v0, p0, Landroid/content/pm/ComponentInfo;->banner:I

    if-eqz v0, :cond_0

    iget v0, p0, Landroid/content/pm/ComponentInfo;->banner:I

    :goto_0
    return v0

    :cond_0
    iget-object v0, p0, Landroid/content/pm/ComponentInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    iget v0, v0, Landroid/content/pm/ApplicationInfo;->banner:I

    goto :goto_0
.end method

.method public final getIconResource()I
    .locals 1

    .prologue
    .line 117
    iget v0, p0, Landroid/content/pm/ComponentInfo;->icon:I

    if-eqz v0, :cond_0

    iget v0, p0, Landroid/content/pm/ComponentInfo;->icon:I

    :goto_0
    return v0

    :cond_0
    iget-object v0, p0, Landroid/content/pm/ComponentInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    iget v0, v0, Landroid/content/pm/ApplicationInfo;->icon:I

    goto :goto_0
.end method

.method public final getLogoResource()I
    .locals 1

    .prologue
    .line 128
    iget v0, p0, Landroid/content/pm/ComponentInfo;->logo:I

    if-eqz v0, :cond_0

    iget v0, p0, Landroid/content/pm/ComponentInfo;->logo:I

    :goto_0
    return v0

    :cond_0
    iget-object v0, p0, Landroid/content/pm/ComponentInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    iget v0, v0, Landroid/content/pm/ApplicationInfo;->logo:I

    goto :goto_0
.end method

.method public isEnabled()Z
    .locals 1

    .prologue
    .line 106
    iget-boolean v0, p0, Landroid/content/pm/ComponentInfo;->enabled:Z

    if-eqz v0, :cond_0

    iget-object v0, p0, Landroid/content/pm/ComponentInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    iget-boolean v0, v0, Landroid/content/pm/ApplicationInfo;->enabled:Z

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method protected loadDefaultBanner(Landroid/content/pm/PackageManager;)Landroid/graphics/drawable/Drawable;
    .locals 1
    .param p1, "pm"    # Landroid/content/pm/PackageManager;

    .prologue
    .line 191
    iget-object v0, p0, Landroid/content/pm/ComponentInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    invoke-virtual {v0, p1}, Landroid/content/pm/ApplicationInfo;->loadBanner(Landroid/content/pm/PackageManager;)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    return-object v0
.end method

.method public loadDefaultIcon(Landroid/content/pm/PackageManager;)Landroid/graphics/drawable/Drawable;
    .locals 1
    .param p1, "pm"    # Landroid/content/pm/PackageManager;

    .prologue
    .line 184
    iget-object v0, p0, Landroid/content/pm/ComponentInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    invoke-virtual {v0, p1}, Landroid/content/pm/ApplicationInfo;->loadIcon(Landroid/content/pm/PackageManager;)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    return-object v0
.end method

.method protected loadDefaultLogo(Landroid/content/pm/PackageManager;)Landroid/graphics/drawable/Drawable;
    .locals 1
    .param p1, "pm"    # Landroid/content/pm/PackageManager;

    .prologue
    .line 199
    iget-object v0, p0, Landroid/content/pm/ComponentInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    invoke-virtual {v0, p1}, Landroid/content/pm/ApplicationInfo;->loadLogo(Landroid/content/pm/PackageManager;)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    return-object v0
.end method

.method public loadLabel(Landroid/content/pm/PackageManager;)Ljava/lang/CharSequence;
    .locals 4
    .param p1, "pm"    # Landroid/content/pm/PackageManager;

    .prologue
    .line 79
    iget-object v2, p0, Landroid/content/pm/ComponentInfo;->nonLocalizedLabel:Ljava/lang/CharSequence;

    if-eqz v2, :cond_0

    .line 80
    iget-object v2, p0, Landroid/content/pm/ComponentInfo;->nonLocalizedLabel:Ljava/lang/CharSequence;

    return-object v2

    .line 82
    :cond_0
    iget-object v0, p0, Landroid/content/pm/ComponentInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    .line 84
    .local v0, "ai":Landroid/content/pm/ApplicationInfo;
    iget v2, p0, Landroid/content/pm/ComponentInfo;->labelRes:I

    if-eqz v2, :cond_1

    .line 85
    iget-object v2, p0, Landroid/content/pm/ComponentInfo;->packageName:Ljava/lang/String;

    iget v3, p0, Landroid/content/pm/ComponentInfo;->labelRes:I

    invoke-virtual {p1, v2, v3, v0}, Landroid/content/pm/PackageManager;->getText(Ljava/lang/String;ILandroid/content/pm/ApplicationInfo;)Ljava/lang/CharSequence;

    move-result-object v1

    .line 86
    .local v1, "label":Ljava/lang/CharSequence;
    if-eqz v1, :cond_1

    .line 87
    return-object v1

    .line 90
    .end local v1    # "label":Ljava/lang/CharSequence;
    :cond_1
    iget-object v2, v0, Landroid/content/pm/ApplicationInfo;->nonLocalizedLabel:Ljava/lang/CharSequence;

    if-eqz v2, :cond_2

    .line 91
    iget-object v2, v0, Landroid/content/pm/ApplicationInfo;->nonLocalizedLabel:Ljava/lang/CharSequence;

    return-object v2

    .line 93
    :cond_2
    iget v2, v0, Landroid/content/pm/ApplicationInfo;->labelRes:I

    if-eqz v2, :cond_3

    .line 94
    iget-object v2, p0, Landroid/content/pm/ComponentInfo;->packageName:Ljava/lang/String;

    iget v3, v0, Landroid/content/pm/ApplicationInfo;->labelRes:I

    invoke-virtual {p1, v2, v3, v0}, Landroid/content/pm/PackageManager;->getText(Ljava/lang/String;ILandroid/content/pm/ApplicationInfo;)Ljava/lang/CharSequence;

    move-result-object v1

    .line 95
    .restart local v1    # "label":Ljava/lang/CharSequence;
    if-eqz v1, :cond_3

    .line 96
    return-object v1

    .line 99
    .end local v1    # "label":Ljava/lang/CharSequence;
    :cond_3
    iget-object v2, p0, Landroid/content/pm/ComponentInfo;->name:Ljava/lang/String;

    return-object v2
.end method

.method public writeToParcel(Landroid/os/Parcel;I)V
    .locals 3
    .param p1, "dest"    # Landroid/os/Parcel;
    .param p2, "parcelableFlags"    # I

    .prologue
    const/4 v1, 0x1

    const/4 v2, 0x0

    .line 162
    invoke-super {p0, p1, p2}, Landroid/content/pm/PackageItemInfo;->writeToParcel(Landroid/os/Parcel;I)V

    .line 163
    iget-object v0, p0, Landroid/content/pm/ComponentInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    invoke-virtual {v0, p1, p2}, Landroid/content/pm/ApplicationInfo;->writeToParcel(Landroid/os/Parcel;I)V

    .line 164
    iget-object v0, p0, Landroid/content/pm/ComponentInfo;->processName:Ljava/lang/String;

    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V

    .line 165
    iget v0, p0, Landroid/content/pm/ComponentInfo;->descriptionRes:I

    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V

    .line 166
    iget-boolean v0, p0, Landroid/content/pm/ComponentInfo;->enabled:Z

    if-eqz v0, :cond_0

    move v0, v1

    :goto_0
    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V

    .line 167
    iget-boolean v0, p0, Landroid/content/pm/ComponentInfo;->exported:Z

    if-eqz v0, :cond_1

    :goto_1
    invoke-virtual {p1, v1}, Landroid/os/Parcel;->writeInt(I)V

    .line 161
    return-void

    :cond_0
    move v0, v2

    .line 166
    goto :goto_0

    :cond_1
    move v1, v2

    .line 167
    goto :goto_1
.end method


text:
void hx_PhysicsHingeConstraint_setLimits(value thisObj, value minAngle, value maxAngle, value bounciness)
{
    PhysicsHingeConstraint *_thisObj;
    float _minAngle = ValueToFloat(minAngle);
    float _maxAngle = ValueToFloat(maxAngle);
    float _bounciness = ValueToFloat(bounciness);
    ValueToObject(thisObj, _thisObj);
    _thisObj->setLimits(_minAngle, _maxAngle, _bounciness);
}
DEFINE_PRIM(hx_PhysicsHingeConstraint_setLimits, 4);

// END
//


text:
package io.katharsis.resource.annotations;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Defines a resource. Each class annotated with {@link JsonApiResource} must have defined {@link JsonApiResource#type()}.
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface JsonApiResource {

    /**
     * Defines name of the resource called type. According to JSON API, the type can be either singular or
     * plural.
     *
     * @return type of the resource
     * @see JSON API - Resource Types
     */
    String type();
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Small Business - Start Bootstrap Template</title>

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

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


text:
<?php
namespace Line;
/**
 * Autogenerated by Thrift Compiler (0.9.1)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;

interface UniversalNotificationServiceIf {
  public function notify(\GlobalEvent $event);
}

class UniversalNotificationServiceClient implements \UniversalNotificationServiceIf {
  protected $input_ = null;
  protected $output_ = null;

  protected $seqid_ = 0;

  public function __construct($input, $output=null) {
    $this->input_ = $input;
    $this->output_ = $output ? $output : $input;
  }

  public function notify(\GlobalEvent $event)
  {
    $this->send_notify($event);
    $this->recv_notify();
  }

  public function send_notify(\GlobalEvent $event)
  {
    $args = new \UniversalNotificationService_notify_args();
    $args->event = $event;
    $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
    if ($bin_accel)
    {
      thrift_protocol_write_binary($this->output_, 'notify', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
    }
    else
    {
      $this->output_->writeMessageBegin('notify', TMessageType::CALL, $this->seqid_);
      $args->write($this->output_);
      $this->output_->writeMessageEnd();
      $this->output_->getTransport()->flush();
    }
  }

  public function recv_notify()
  {
    $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
    if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\UniversalNotificationService_notify_result', $this->input_->isStrictRead());
    else
    {
      $rseqid = 0;
      $fname = null;
      $mtype = 0;

      $this->input_->readMessageBegin($fname, $mtype, $rseqid);
      if ($mtype == TMessageType::EXCEPTION) {
        $x = new TApplicationException();
        $x->read($this->input_);
        $this->input_->readMessageEnd();
        throw $x;
      }
      $result = new \UniversalNotificationService_notify_result();
      $result->read($this->input_);
      $this->input_->readMessageEnd();
    }
    if ($result->e !== null) {
      throw $result->e;
    }
    return;
  }

}

// HELPER FUNCTIONS AND STRUCTURES

class UniversalNotificationService_notify_args {
  static $_TSPEC;

  public $event = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        2 => array(
          'var' => 'event',
          'type' => TType::STRUCT,
          'class' => '\GlobalEvent',
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['event'])) {
        $this->event = $vals['event'];
      }
    }
  }

  public function getName() {
    return 'UniversalNotificationService_notify_args';
  }

  public function read($input)
  {
    $xfer = 0;
    $fname = null;
    $ftype = 0;
    $fid = 0;
    $xfer += $input->readStructBegin($fname);
    while (true)
    {
      $xfer += $input->readFieldBegin($fname, $ftype, $fid);
      if ($ftype == TType::STOP) {
        break;
      }
      switch ($fid)
      {
        case 2:
          if ($ftype == TType::STRUCT) {
            $this->event = new \GlobalEvent();
            $xfer += $this->event->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        default:
          $xfer += $input->skip($ftype);
          break;
      }
      $xfer += $input->readFieldEnd();
    }
    $xfer += $input->readStructEnd();
    return $xfer;
  }

  public function write($output) {
    $xfer = 0;
    $xfer += $output->writeStructBegin('UniversalNotificationService_notify_args');
    if ($this->event !== null) {
      if (!is_object($this->event)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('event', TType::STRUCT, 2);
      $xfer += $this->event->write($output);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class UniversalNotificationService_notify_result {
  static $_TSPEC;

  public $e = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'e',
          'type' => TType::STRUCT,
          'class' => '\UniversalNotificationServiceException',
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['e'])) {
        $this->e = $vals['e'];
      }
    }
  }

  public function getName() {
    return 'UniversalNotificationService_notify_result';
  }

  public function read($input)
  {
    $xfer = 0;
    $fname = null;
    $ftype = 0;
    $fid = 0;
    $xfer += $input->readStructBegin($fname);
    while (true)
    {
      $xfer += $input->readFieldBegin($fname, $ftype, $fid);
      if ($ftype == TType::STOP) {
        break;
      }
      switch ($fid)
      {
        case 1:
          if ($ftype == TType::STRUCT) {
            $this->e = new \UniversalNotificationServiceException();
            $xfer += $this->e->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        default:
          $xfer += $input->skip($ftype);
          break;
      }
      $xfer += $input->readFieldEnd();
    }
    $xfer += $input->readStructEnd();
    return $xfer;
  }

  public function write($output) {
    $xfer = 0;
    $xfer += $output->writeStructBegin('UniversalNotificationService_notify_result');
    if ($this->e !== null) {
      $xfer += $output->writeFieldBegin('e', TType::STRUCT, 1);
      $xfer += $this->e->write($output);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}


text:
""" Module for the KMCRateCalculatorPlugin class """

# Copyright (c)  2013  Mikael Leetmaa
#
# This file is part of the KMCLib project distributed under the terms of the
# GNU General Public License version 3, see <http://www.gnu.org/licenses/>.
#

import numpy

from KMCLib.Backend import Backend
from KMCLib.Exceptions.Error import Error

class KMCRateCalculatorPlugin(Backend.RateCalculator):
    """
    Class for providing an interface to easily extend and customize
    the behaviour of the calculation of individual rates in the KMC simulation.
    """

    def __init__(self):
        """
        Base class constructor.
        """
        # Call the C++ base class constructor.
        Backend.RateCalculator.__init__(self)

        # Call the custom setup.
        self.initialize()

    def backendRateCallback(self,
                            cpp_coords,
                            coords_len,
                            types_before,
                            types_after,
                            rate_constant,
                            process_number,
                            global_x,
                            global_y,
                            global_z):
        """
        Function called from C++ to get the rate. It function recieves
        the data from C++ and parse it to a Python friendly format to send it
        forward to the custom rate function.
        """
        # Call and return the custom rate.
        # PERFORMME: Consider creating the numpy array in C++ if possible.
        global_coordinate = (global_x, global_y, global_z)
        return self.rate(numpy.array(cpp_coords).reshape(coords_len,3),
                         types_before,
                         types_after,
                         rate_constant,
                         process_number,
                         global_coordinate)

    def initialize(self):
        """
        Called as the last statement in the base class constructor
        to allow for custom setup of the object.
        """
        pass

    def rate(self,
             coords,
             types_before,
             types_after,
             rate_constant,
             process_number,
             global_coordinate):
        """
        Called from the base class to get the rate for a particular
        local geometry. Any class inheriting from the plugin base class
        must provide an implementation of this function.

        :param coords: The coordinates of the configuration as a Nx3 numpy array
                       in fractional units of the primitive cell.

        :param types_before: The types before the process, as tuple of strings.

        :param types_after: The types after the process, as tuple of strings.

        :param rate_constant: The rate constant associated with the process
                              to either update or replace.

        :param process_number: The process id number.

        :param global_coordinate: The global coordinate of the central index.

        :returns: The custom rate of the process. Note that the returned rate must
                  not be negative or zero.
        """
        raise Error("The rate(self,...) API function in the 'KMCRateCalculator' base class must be overloaded when using a custom rate calculator.")

    def cutoff(self):
        """
        To determine the radial cutoff of the geometry around the central
        lattice site to cut out and send down to the rustom rate function.
        If not implemented by derrived classes the default is to use
        the cutoff of the largetst process local geometry.

        :returns: The desiered cutoff in primitive cell internal coordinates.
        :rtype: float
        """
        # Returning None results in default behaviour.
        return None


text:
import pymongo

client = pymongo.MongoClient()
database = client.person_info
col = database.people

info_dict = {'name': 'carson', 'age': 0, 'sex': 'unknown', 'salary': 0}
col.insert(info_dict)

kingname = col.find()
for each in kingname:
    print(each['name'])

col.update({'name': 'carson'}, {'$set': {'age': 19, 'sex': 'male'}})
# col.update_many({'name': 'carson'}, {'$set': {'age': 19, 'sex': 'male'}})

# col.delete_one({'name': 'carson'})
col.drop()


text:
from democracy.models.section import CommentImage
from democracy.views.base import BaseImageSerializer
from democracy.views.utils import Base64ImageField

class CommentImageSerializer(BaseImageSerializer):
    class Meta:
        model = CommentImage
        fields = ['url', 'width', 'height', 'title', 'caption', 'id']

class CommentImageCreateSerializer(BaseImageSerializer):
    """
    Serializer for comment_image creation.
    """
    image = Base64ImageField()

    class Meta:
        model = CommentImage
        fields = ['title', 'image', 'id', 'width', 'height', 'caption']


text:
[//]: # ( )
[//]: # (This file is automatically generated by a `metapak`)
[//]: # (module. Do not change it  except between the)
[//]: # (`content:start/end` flags, your changes would)
[//]: # (be overridden.)
[//]: # ( )
# metapak
> Node modules authoring made easy.

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/nfroidure/metapak/blob/master/LICENSE)
[![Build status](https://travis-ci.com/nfroidure/metapak.svg?branch=master)](https://travis-ci.com/github/nfroidure/metapak)
[![Coverage Status](https://coveralls.io/repos/github/nfroidure/metapak/badge.svg?branch=master)](https://coveralls.io/github/nfroidure/metapak?branch=master)

[//]: # (::contents:start)

## What's that?

`metapak` provides a set of tools to build your own meta npm packages easily.

A meta npm package takes advantage of npm
[lifecycle scripts](https://docs.npmjs.com/misc/scripts) to allow you to manage
several similar npm packages/NodeJS projects in a simple and versioned way.

Here is a [simple deck](https://slides.com/nfroidure/meta-npm-packages/live#/)
introducing it.

## What is it good for?

Let's say you are the author of thousands of Node modules. Now, imagine you
want, for all of them:

- change your linter,
- change your license,
- change your CI provider,
- add a README template system,
- add a contributors guide,
- setup git hooks.

This could look like a developer nightmare but with `metapak` you can manage
that complexity by creating idempotent scripts to run on all your projects.

## Features

Allows you to create a npm meta module to:

- amend all your npm modules `package.json` globally, in a composable way
  (shared dependencies, utility scripts etc...),
- add assets to all your projects without polluting your git history with
  insignificant changes,
- automatically install git hooks so that all your coding flow are respected by
  your contributors.

`metapak` can handle several meta packages so that you can compose them easily
and keep them small and focused on one concern.

Zero config for your contributors, nothing to install globally.

## Usage

First create your own `metapak` module (you can look
[at mine](https://github.com/nfroidure/metapak-nfroidure) to grasp its
architecture).

You **must** name your module with the `metapak-` prefix in order to make it
work.

Now, just define the states of all your Node modules:

```sh
mkdir src
mkdir src/_common

# Let's set the package.json of all your modules
# Note this has to be an idempotent function
# (ie: same run same result)
echo "
module.exports = (packageConf) => {
  // Looks like i am the contributor of all
  // my modules ;)
  packageConf.author = 'Nicolas Froidure';

  // I mostly publish under MIT license,
  // let's default to it
  packageConf.license = 'MIT';

  // Let's add my handy scripts
  packageConf.scripts = packageConf.scripts || {};
  packageConf.scripts.cli = 'env NODE_ENV=${NODE_ENV:-cli}';

  // And the MUST HAVE dependencies
  packageConf.dependencies = packageConf.dependencies || {};
  packageConf.dependencies.debug = '1.0.0';

  // And the MUST HAVE dev dependencies
  packageConf.devDependencies = packageConf.devDependencies || {};
  packageConf.devDependencies.eslint = '3.0.0';

  return packageConf;
}" > src/_common/package.js

# Let's also add some common assets
# metapak will add/update for us
mkdir src/_common/assets
# Adding the license
wget -O src/_common/assets/LICENSE https://mit-license.org/license.txt
# Adding a git ignore file
# Note we replaced the dot of the file per _dot_
# This is due to a magic behavior of npm
# See: https://github.com/npm/npm/issues/15660
# metapak will rename it to .gitignore
echo "node_modules" > src/_common/assets/_dot_gitignore

# And make some additions to them, like templating
echo "
module.exports = (file, packageConf) => {
  // Simple templating of the LICENSE
  // There is no glob matching or templating system
  // in metapak to let you choose the ones you like
  if(file.name === 'LICENSE') {
    file.data = file.data.replace(
      /<copyright holders>/g,
      'Nicolas Froidure'
    );
    return file;
  }
  return file;
};
" > src/_common/assets.js

# Finally let's add my git hooks on it
echo "module.exports = (hooks, packageConf) => {
  hooks['pre-commit'] = hooks['pre-commit'] || [];

  // Ensure tests and linting are ok
  hooks['pre-commit'].push('npm run test && npm run lint || exit 1');

  // Ensure that metapak state is stable
  // Indeed, you do not want to commit
  // while metapak has some changes to do
  // doing so would create a gap between
  // you metapak module/config and the
  // repository contents
  hooks['pre-commit'].push('npm run metapak -- --safe || exit 1');
  return hooks;
};
" > src/_common/hooks.js
```

For convenience, you can add a post install script and a peer dependency to your
metapak plugin for a better user experience:

```js
{
  "scripts": {
    "postinstall": "npm run metapak",
  },
  "peerDependencies": {
    "metapak": "^2.0.0"
  },
}
```

Now publish your package to npm and install it in all your repositories
development dependencies with metapak:

```
npm i --save-dev metapak metapak-nfroidure
```

That's it! There is a lot of things you can set on all your projects like CI
scripts, linters, tests configuration etc...

You can also create specific configs and combine them. Let's say I work for the
Big Brother inc. and i want to add special behaviors for the modules I create at
work:

```sh
mkdir src/bigbrother

# Let's add a package.json template
echo "
module.exports = (packageConf) => {
  // Lets proudly claim I work at BB inc.!
  packageConf.author = 'Nicolas Froidure (Big Brother inc.)';

  // Let's change the license
  packageConf.license = 'SEE LICENSE IN LICENSE.md';

  // Let's avoid loosing my job :D
  packageConf.private = true;

  return packageConf;
}" > src/bigbrother/package.js

# Simply override the default license
mkdir src/bigbrother/assets
echo "
Copyright Big Brother inc. All rights reserved.
" > src/bigbrother/assets/LICENSE.md
```

Now, just create a new version of your package, publish it and add this specific
behavior by adding the following property to your Big Brother's projects:

```
{
  "version": "1.0.0",
  "metapak": {
    "configs": ["bigbrother"]
  }
}
```

Note that the `_common` folder config cannot be disabled. That said you can only
create specific configs and have no common behavior set at all. Keep common
configs simple and very general to avoid having to change it too often.

[//]: # (::contents:end)

# Authors
- [Nicolas Froidure](http://insertafter.com/en/index.html)

# License
[MIT](https://github.com/nfroidure/metapak/blob/master/LICENSE)


text:
namespace dyloc {
namespace test {

//Jakub
TEST_F(TopologyTest, DistanceMetric) {
  dyloc::init(&TESTENV.argc, &TESTENV.argv);
  auto & topo = dyloc::team_topology();
  DYLOC_LOG_DEBUG("TopologyTest.DistanceMetric", "Total Distance:");
//TODO

  auto dist_fn= [](int a){ return a; };
  std::string str="TestMetric";
  topo.add_distance_metric(str, dist_fn);
  ASSERT_EQ(0, str.compare(topo.list_distance_metrics()));
  ASSERT_EQ(42, dist_fn(42));
  dyloc::finalize();
}

TEST_F(TopologyTest, ExcludeDomains) {
  dyloc::init(&TESTENV.argc, &TESTENV.argv);

  auto & topo = dyloc::team_topology();
  locality_domain_dfs_output_visitor<typename topology::domain_map>
    vis(topo.domains());

  DYLOC_LOG_DEBUG("TopologyTest.ExcludeDomains", "total domain hierarchy:");
  if (dyloc::myid().id == 0) {
    topo.depth_first_search(vis);
  }
  dart_barrier(DART_TEAM_ALL);

  std::vector<std::string> excluded_domain_tags;
  excluded_domain_tags.push_back(".0.0");

  topo.exclude_domains(
    excluded_domain_tags.begin(),
    excluded_domain_tags.end());

  if (dyloc::myid().id == 0) {
    DYLOC_LOG_DEBUG("TopologyTest.ExcludeDomains",
                    "domain hierarchy after excludes:");
    topo.depth_first_search(vis);
  }

  ASSERT_EQ(0, topo.domains().count(".0.0"));

  dyloc::finalize();
}

TEST_F(TopologyTest, DomainsAncestor) {
  dyloc::init(&TESTENV.argc, &TESTENV.argv);

  auto & topo = dyloc::team_topology();
  locality_domain_dfs_output_visitor<typename topology::domain_map>
    vis(topo.domains());

  DYLOC_LOG_DEBUG("TopologyTest.DomainsAncestor", "total domain hierarchy:");
  if (dyloc::myid().id == 0) {
    topo.depth_first_search(vis);
  }
  dart_barrier(DART_TEAM_ALL);

  int myid = dyloc::myid().id;

  // Find ancestor domain from this vector of unit ids:
  //
  std::vector<dart_global_unit_t> unit_ids;
  unit_ids.push_back(dyloc::myid());
  for (int nd = 0; nd < std::min<int>(2, topo.domains().size()); ++nd) {
    std::srand((nd + 1) * (myid + 1));
    int random_unit_id = std::rand() % dyloc::num_units();
    unit_ids.push_back(random_unit_id);
  }

  // Unit ids to domain tags:
  //
  std::vector<std::string> unit_domain_tags(unit_ids.size());
  std::transform(unit_ids.begin(), unit_ids.end(),
                 unit_domain_tags.begin(),
                 [&](const dart_global_unit_t uid) -> std::string {
                   auto unit_dom_tag = topo[uid].domain_tag;
                   DYLOC_LOG_DEBUG_VAR("TopologyTest.DomainsAncestor",
                                       unit_dom_tag);
                   return unit_dom_tag;
                 });

  // Ancestor from unit domain tags:
  //
  const auto & ancestor = topo.ancestor(
                            unit_domain_tags.begin(),
                            unit_domain_tags.end());
  for (const dart_global_unit_t & uid : unit_ids) {
    ASSERT_NE(ancestor.unit_ids.end(),
              std::find(ancestor.unit_ids.begin(),
                        ancestor.unit_ids.end(),
                        uid));
  }
  DYLOC_LOG_DEBUG_VAR("TopologyTest.DomainsAncestor", ancestor);

  dyloc::finalize();
}

TEST_F(TopologyTest, ScopeDomains) {
  dyloc::init(&TESTENV.argc, &TESTENV.argv);

  auto & topo = dyloc::team_topology();
  locality_domain_dfs_output_visitor<typename topology::domain_map>
    vis(topo.domains());

  DYLOC_LOG_DEBUG("TopologyTest.ScopeDomains", "total domain hierarchy:");
  if (dyloc::myid().id == 0) {
    topo.depth_first_search(vis);
  }
  dart_barrier(DART_TEAM_ALL);

  // Tags of locality domains in CORE scope:
  auto core_domain_tags = topo.scope_domain_tags(
                            DYLOC_LOCALITY_SCOPE_CORE);
  ASSERT_LT(0, core_domain_tags.size());
  for (const auto & core_domain_tag : core_domain_tags) {
    DYLOC_LOG_DEBUG_VAR("TopologyTest.ScopeDomains", core_domain_tag);
    auto core_dom_it = topo.domains().find(core_domain_tag);
    ASSERT_NE(topo.domains().end(), core_dom_it);
    ASSERT_EQ(DYLOC_LOCALITY_SCOPE_CORE, core_dom_it->second.scope);
  }

  // Tags of locality domains in NUMA scope:
  auto numa_domain_tags = topo.scope_domain_tags(
                            DYLOC_LOCALITY_SCOPE_NUMA);
  ASSERT_LT(0, numa_domain_tags.size());
  for (const auto & numa_domain_tag : numa_domain_tags) {
    DYLOC_LOG_DEBUG_VAR("TopologyTest.ScopeDomains", numa_domain_tag);
    auto numa_dom_it = topo.domains().find(numa_domain_tag);
    ASSERT_NE(topo.domains().end(), numa_dom_it);
    ASSERT_EQ(DYLOC_LOCALITY_SCOPE_NUMA, numa_dom_it->second.scope);
  }

  dyloc::finalize();
}

} // namespace dyloc
} // namespace test


text:
/** \file
 * File for the vbox widget.
 *
 * @author Nathan Samson
*/

#include <algorithm>

#include "widgets/vbox.h"

namespace Zabbr {
	/**
	 * Public constructor.
	 *
	 * @param win The Window.
	 * @param homogenous True if all widgets should have the same size.
	 * @param spacing The spacing in pixels between 2 widgets.
	*/
	VBox::VBox(Window* win, bool homogenous, int spacing):
	        Box(win, homogenous, spacing, XALIGN_CENTER, YALIGN_TOP) {
	}

	/**
	 * Public constructor.
	 *
	 * @param win The Window.
	 * @param homogenous True if all widgets should have the same size.
	 * @param spacing The spacing in pixels between 2 widgets.
	 * @param yAlign The Y-alignment of the widgets.
	*/
	VBox::VBox(Window* win, bool homogenous, int spacing, YAlignment yAlign):
	        Box(win, homogenous, spacing, XALIGN_CENTER, yAlign) {
	}

	/**
	 * Public constructor.
	 *
	 * @param win The Window.
	 * @param homogenous True if all widgets should have the same size.
	 * @param spacing The spacing in pixels between 2 widgets.
	 * @param xAlign The X-alignment of the widgets.
	 * @param yAlign The Y-alignment of the widgets.
	*/
	VBox::VBox(Window* win, bool homogenous, int spacing, XAlignment xAlign, YAlignment yAlign):
	        Box(win, homogenous, spacing, xAlign, yAlign) {
	}

	VBox::~VBox() {
	}

	/**
	 * Draws all widgets in the box.
	 *
	 * @param x The x-coordinate of the top-left of the box.
	 * @param y The y-coordinate of the top-left of the box.
	*/
	void VBox::draw(int x, int y) {
		if (yAlignment == YALIGN_CENTER) {
			y += (getHeight() - requestedHeight()) / 2;
		} else if (yAlignment == YALIGN_BOTTOM) {
			y += getHeight() - requestedHeight();
		}
		for(std::vector<VWidget*>::iterator it = fWidgets.begin(); it != fWidgets.end(); it++) {
			if (xAlignment == XALIGN_CENTER) {
				(*it)->draw(x+(getWidth() - (*it)->getWidth())/2, y);
			} else if (xAlignment == XALIGN_RIGHT) {
				(*it)->draw(x+(getWidth() - (*it)->getWidth()), y);
			} else if (xAlignment == XALIGN_LEFT) {
				(*it)->draw(x, y);
			}

			y += (*it)->getHeight() + fSpacing;
		}
	}

	/**
	 * Returns the minimal width of the box.
	 *
	 * @return The minimal width of the box.
	*/
	int VBox::requestedWidth() {
		int w = 0;
		for(std::vector<VWidget*>::iterator it = fWidgets.begin(); it != fWidgets.end(); it++) {
			w = std::max(w, (*it)->getWidth());
		}
		return w;
	}

	/**
	 * Returns the minimal height of the box.
	 *
	 * @return The minimal height of the box.
	*/
	int VBox::requestedHeight() {
		int h = 0;
		for(std::vector<VWidget*>::iterator it = fWidgets.begin(); it != fWidgets.end(); it++) {
			h += (*it)->getHeight();
		}
		return h + (fWidgets.size() - 1) * fSpacing;
	}
}


text:
/**
 */
package org.afplib.afplib;

import org.afplib.base.SF;
import org.afplib.base.Triplet;

import org.eclipse.emf.common.util.EList;

/**
 *
 * A representation of the model object 'GDD'.
 *
 *
 *

 * The following features are supported:
 *

 *

 *
{@link org.afplib.afplib.GDD#getGOCAdes GOC Ades}

 *
{@link org.afplib.afplib.GDD#getCommands Commands}

 *

 *
 * @see org.afplib.afplib.AfplibPackage#getGDD()
 * @model
 * @generated
 */
public interface GDD extends SF {
	/**
	 * Returns the value of the 'GOC Ades' attribute.
	 *
	 *
	 *
	 *
optional
variable length

	 *
	 * @return the value of the 'GOC Ades' attribute.
	 * @see #setGOCAdes(byte[])
	 * @see org.afplib.afplib.AfplibPackage#getGDD_GOCAdes()
	 * @model
	 * @generated
	 */
	byte[] getGOCAdes();

	/**
	 * Sets the value of the '{@link org.afplib.afplib.GDD#getGOCAdes GOC Ades}' attribute.
	 *
	 *
	 * @param value the new value of the 'GOC Ades' attribute.
	 * @see #getGOCAdes()
	 * @generated
	 */
	void setGOCAdes(byte[] value);

	/**
	 * Returns the value of the 'Commands' containment reference list.
	 * The list contents are of type {@link org.afplib.base.Triplet}.
	 *
	 *
	 *
	 *
optional
variable length

	 *
	 * @return the value of the 'Commands' containment reference list.
	 * @see org.afplib.afplib.AfplibPackage#getGDD_Commands()
	 * @model containment="true" resolveProxies="true"
	 * @generated
	 */
	EList<Triplet> getCommands();

} // GDD