text:
import dataconfig
from repmak_yacc import parser
# from repmak_lex import reserved
import pprint

class FluidProperties:
    def __init__(self):
        pass

    def __call__(self, properties):
        self.color = properties[0]
        self.density = properties[1]
        self.luminosity = properties[2]
        self.temp = properties[3]
        self.viscosity = properties[4]

class ModeSelector:

    def __init__(self):
        self.ore_lookup = dict()
        self.fluid_lookup = dict()
        self.modes = {'recipedumper:oredict': self.load_oredict,
                      'recipedumper:fluid': self.load_fluid,
                      }

    def __call__(self, itemdict):
        currentmode = itemdict.get('mode', None)
        if currentmode is not None and currentmode in self.modes.keys():
            self.modes[currentmode](itemdict)

    def load_oredict(self, oredict):
        ts_items = [x.get('itemid') for x in oredict['target']]
        self.ore_lookup[oredict['orename']] = ts_items
        for item in ts_items:
            self.ore_lookup[item] = oredict['orename']

    def load_fluid(self, fluiddict):
        self.fluid_lookup[fluiddict['fluid']] = fluiddict.get('properties')

    def getOreDictionary(self):
        return self.ore_lookup.items()

FILES = [dataconfig.ITEMS, dataconfig.OREDICT, dataconfig.RECIPES]

itemlist = list()

MS = ModeSelector()
P = FluidProperties()

fp = open(dataconfig.FLUID, mode='rt')

for line in fp:
    s = parser.parse(line.strip('\n'))
    if (s is not None):
        MS(s)
fp.close()

for k, v in MS.fluid_lookup.items():
    P(v)
    print(P.color)


text:
package com.faforever.api.league;

import com.faforever.api.config.LeagueDatasourceConfig;
import org.junit.jupiter.api.Test;
import org.springframework.http.HttpHeaders;
import org.springframework.test.context.jdbc.Sql;
import org.springframework.test.context.jdbc.Sql.ExecutionPhase;
import org.springframework.test.context.jdbc.SqlConfig;

import static com.faforever.api.data.JsonApiMediaType.JSON_API_MEDIA_TYPE;
import static org.hamcrest.Matchers.hasSize;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

@Sql(executionPhase = ExecutionPhase.BEFORE_TEST_METHOD, scripts = "classpath:sql/league/truncateTables.sql", config = @SqlConfig(dataSource = LeagueDatasourceConfig.LEAGUE_DATA_SOURCE, transactionManager = LeagueDatasourceConfig.LEAGUE_TRANSACTION_MANAGER))
@Sql(executionPhase = ExecutionPhase.BEFORE_TEST_METHOD, scripts = "classpath:sql/league/prepLeagueData.sql", config = @SqlConfig(dataSource = LeagueDatasourceConfig.LEAGUE_DATA_SOURCE, transactionManager = LeagueDatasourceConfig.LEAGUE_TRANSACTION_MANAGER))
class LeagueSeasonElideTest extends LeagueAbstractIntegrationTest {

  @Test
  void anyOneCanReadAllLeagueSeason() throws Exception {
    mockMvc.perform(
      get("/data/leagueSeason")
    )
      .andExpect(status().isOk())
      .andExpect(jsonPath("$.data[*]", hasSize(2)));
  }

  @Test
  void anyOneCanReadSpecificLeagueSeason() throws Exception {
    mockMvc.perform(
      get("/data/leagueSeason/1")
    )
      .andExpect(status().isOk());
  }

  @Test
  void noOneCanCreateLeagueSeason() throws Exception {
    mockMvc.perform(
      post("/data/leagueSeason")
        .with(getOAuthTokenWithActiveUser(NO_SCOPE, NO_AUTHORITIES))
        .header(HttpHeaders.CONTENT_TYPE, JSON_API_MEDIA_TYPE)
        .content("""
          {
            "data": {
              "type": "leagueSeason",
              "attributes": {
                "endDate": "2021-04-21T17:28:39+02:00",
                "startDate": "2021-03-23T16:28:39+01:00"
              },
              "relationships": {
                "leaderboard": {
                  "data": {
                    "type": "leaderboard",
                    "id": "1"
                  }
                },
                "league": {
                  "data": {
                    "type": "league",
                    "id": "1"
                  }
                }
              }
            }
          }
          """)
    )
      .andExpect(status().isForbidden());
  }

  @Test
  void noOneCanUpdateLeagueSeason() throws Exception {
    mockMvc.perform(
      patch("/data/leagueSeason/1")
        .with(getOAuthTokenWithActiveUser(NO_SCOPE, NO_AUTHORITIES))
        .header(HttpHeaders.CONTENT_TYPE, JSON_API_MEDIA_TYPE)
        .content("""
          {
            "data": {
              "type": "leagueSeason",
              "id": 1,
              "attributes": {
                "startDate": "2021-03-23T16:28:39+01:00"
              }
            }
          }
          """)
    )
      .andExpect(status().isForbidden());
  }

  @Test
  void noOneCanDeleteLeagueSeason() throws Exception {
    mockMvc.perform(
      delete("/data/leagueSeason/1")
        .with(getOAuthTokenWithActiveUser(NO_SCOPE, NO_AUTHORITIES)))
      .andExpect(status().isForbidden());
  }
}

redpajama_set_name: RedPajamaGithub


text:
package com.netflix.servo.publish.cloudwatch;

import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.cloudwatch.AmazonCloudWatch;
import com.amazonaws.services.cloudwatch.AmazonCloudWatchClient;
import com.amazonaws.services.cloudwatch.model.MetricDatum;
import com.amazonaws.services.cloudwatch.model.PutMetricDataRequest;

import java.util.Date;

//CHECKSTYLE.OFF: LineLength
/**
 * Test program for exploring the limits for values that can be written to cloudwatch.
 *
 * <pre>
 * ERROR NaN 1024 - com.amazonaws.services.cloudwatch.model.InvalidParameterValueException: The value ? for parameter MetricData.member.1.Value is invalid.
 * ERROR -Infinity 1024 - com.amazonaws.services.cloudwatch.model.InvalidParameterValueException: The value -∞ for parameter MetricData.member.1.Value is invalid.
 * ERROR Infinity 1024 - com.amazonaws.services.cloudwatch.model.InvalidParameterValueException: The value ∞ for parameter MetricData.member.1.Value is invalid.
 * ERROR 4.900000e-324 -1023 - com.amazonaws.services.cloudwatch.model.InvalidParameterValueException: The value 0 for parameter MetricData.member.1.Value is invalid.
 * ERROR 1.797693e+308 1023 - com.amazonaws.services.cloudwatch.model.InvalidParameterValueException: The value 179,769,313,486,231,570,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 for parameter MetricData.member.1.Value is invalid.
 * ERROR 4.697085e+108 361 - com.amazonaws.services.cloudwatch.model.InvalidParameterValueException: The value 4,697,085,165,547,666,500,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 for parameter MetricData.member.1.Value is invalid.
 * ERROR 2.128980e-109 -361 - com.amazonaws.services.cloudwatch.model.InvalidParameterValueException: The value 0 for parameter MetricData.member.1.Value is invalid.
 * ERROR -4.697085e+108 361 - com.amazonaws.services.cloudwatch.model.InvalidParameterValueException: The value -4,697,085,165,547,666,500,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 for parameter MetricData.member.1.Value is invalid.
 * ERROR -2.128980e-109 -361 - com.amazonaws.services.cloudwatch.model.InvalidParameterValueException: The value -0 for parameter MetricData.member.1.Value is invalid.
 * </pre>
 */
//CHECKSTYLE.ON: LineLength
final class CloudWatchValueTest {

    private CloudWatchValueTest() {
    }

    private static final String ACCESS_KEY = "";
    private static final String SECRET_KEY = "";

    private static final AWSCredentials CREDENTIALS = new BasicAWSCredentials(ACCESS_KEY,
            SECRET_KEY);
    private static final AmazonCloudWatch CLIENT = new AmazonCloudWatchClient(CREDENTIALS);

    private static final double[] SPECIAL_VALUES = {
        Double.NaN,
        Double.NEGATIVE_INFINITY,
        Double.POSITIVE_INFINITY,
        Double.MIN_VALUE,
        Double.MAX_VALUE,
        Math.pow(2.0, 360),
        -Math.pow(2.0, 360),
        0.0,
        1.0,
        -1.0
    };

    private static double[] getValues(double start, double multiplier, int n) {
        double[] values = new double[n];
        values[0] = start;
        for (int i = 1; i < n; ++i) {
            values[i] = values[i - 1] * multiplier;
        }
        return values;
    }

    private static boolean putValue(String name, long timestamp, double value) {
        Date d = new Date(timestamp);
        MetricDatum m = new MetricDatum().withMetricName(name).withTimestamp(d).withValue(value);
        PutMetricDataRequest req = new PutMetricDataRequest().withNamespace("TEST")
                .withMetricData(m);
        try {
            CLIENT.putMetricData(req);
            return true;
        } catch (Exception e) {
            System.out.printf("ERROR %e %d - %s: %s%n",
                value, Math.getExponent(value), e.getClass().getName(), e.getMessage());
            return false;
        }
    }

    private static void putValues(String name, long start, double[] values,
                                  boolean ignoreFailures) {
        long t = start;
        boolean succeeded = true;
        for (int i = 0; (succeeded || ignoreFailures) && i < values.length; ++i, t += 60000) {
            succeeded = putValue(name, t, values[i]);
        }
    }

    public static void main(String[] args) throws Exception {
        if (args.length != 1) {
            System.err.println("Usage: cwtest <test-name>");
            System.exit(1);
        }

        long start = System.currentTimeMillis() - (1000 * 60 * 1000);
        double[] posLargeValues = getValues(1.0, 2.0, 500);
        double[] posSmallValues = getValues(1.0, 0.5, 500);
        double[] negLargeValues = getValues(-1.0, 2.0, 500);
        double[] negSmallValues = getValues(-1.0, 0.5, 500);

        putValues(args[0] + "_special", start, SPECIAL_VALUES, true);
        putValues(args[0] + "_pos_large", start, posLargeValues, false);
        putValues(args[0] + "_pos_small", start, posSmallValues, false);
        putValues(args[0] + "_neg_large", start, negLargeValues, false);
        putValues(args[0] + "_neg_small", start, negSmallValues, false);
    }
}


text:
export default class NavTree {
  constructor (id) {
    this.id = id || null
    this.parent = null
    this.nodes = {}
    this.nodesId = [] // array of nodes ID to keep the order they are added
    this.focusedNode = null

    this.onNavCallback = null
    this.resolveFunc = null
  }

  /**
   * Add child node
   * @param id
   * @returns {NavTree}
   */
  addNode (id) {
    if (!id) {
      id = this._genId()
    } else {
      if (this.nodes[id] !== undefined) { // `id` is taken
        if (process.env.NODE_ENV !== 'production') {
          console.warn('NavTree.addNode() - duplicated ID:', id)
        }
        id = this._genId()
      }
    }

    let child = new this.constructor(id)
    child.parent = this

    this.nodes[id] = child
    this.nodesId.push(id)

    return child
  }

  /**
   * Remove child node
   * @param id
   */
  removeNode (id) {
    if (this.focusedNode === id) {
      this.focusedNode = null
    }

    this.nodes[id].parent = null

    delete this.nodes[id]
    this.nodesId.splice(this.nodesId.indexOf(id), 1)
  }

  /**
   * Find available node ID
   * @returns {string}
   * @private
   */
  _genId () {
    // use the first available numeric `id`
    let id = this.nodesId.length + 1
    while (this.nodes[id]) {
      id++
    }
    return id.toString()
  }

  /**
   * Focus a node specified by path (or itself if path is omitted or empty)
   * @param path - array or a list or arguments, e.g. focus(['a', 'b']) or focus('a', 'b')
   */
  focus (path) {
    if (Array.isArray(path)) {
      path = path.slice()
    } else {
      path = [].slice.call(arguments)
    }

    // get the root node and full path to the target node
    let node = this
    while (node.parent) {
      path.unshift(node.id)
      node = node.parent
    }

    node._focus(path)
  }

  /**
   * Focus a node specified by path. Must be called on root instance.
   * @param path {Array|false}
   * @private
   */
  _focus (path) {
    // `onNav` event
    if (this.onNavCallback) {
      this.onNavCallback(path === false ? false : path.slice())
    }

    let newFocusedNode

    if (path === false) {
      newFocusedNode = null
    } else {
      newFocusedNode = path.length > 0 ? path.shift() : null
    }

    // wrong node ID
    if (newFocusedNode !== null && this.nodes[newFocusedNode] === undefined) {
      if (process.env.NODE_ENV !== 'production') {
        console.warn('trying to focus invalid ID', newFocusedNode)
      }
      return
    }

    // revoke focus from previously focused node
    if (this.focusedNode !== null && this.focusedNode !== newFocusedNode) {
      this.nodes[this.focusedNode]._focus(false) // revoke focus recursively
    }

    this.focusedNode = newFocusedNode

    // focus
    if (newFocusedNode !== null) {
      this.nodes[newFocusedNode]._focus(path) // focus down the path recursively
    }
  }

  /**
   * Resolve an event to a node that should be focused next.
   * @param event
   * @returns {NavTree|false}
   */
  resolve (event) {
    let node = this

    // get the root node
    while (node.parent) {
      node = node.parent
    }
    const rootNode = node

    // intercept `focus()` call during resolving process
    const ctrl = { break: false }
    const originalFocusFunc = rootNode._focus
    rootNode._focus = (path) => {
      ctrl.break = true
      return originalFocusFunc.call(rootNode, path)
    }

    // resolving
    let targetNode = rootNode._resolve(event, ctrl)

    rootNode._focus = originalFocusFunc

    if (targetNode && !ctrl.break && rootNode !== targetNode) {
      targetNode.focus() // focus resolved node
      return targetNode
    } else {
      return false
    }
  }

  /**
   * Resolve an event to a node that should be focused next. Must be called on root instance.
   * @param event
   * @param ctrl {{break: boolean}} - flag to stop the process (set to true if `focus()` gets called during resolving process)
   * @returns {NavTree|false}
   * @private
   */
  _resolve (event, ctrl) {
    let deepestFocusedNode = this.getFocusedNode(true) || this
    let node = deepestFocusedNode

    //
    // Phase 1
    // Traversing up the tree (up the focused path) until the event is resolved, starting from the deepest focused node
    //
    do {
      let resolvedNode = this._getResolveFuncResult(node, event, deepestFocusedNode)
      if (ctrl.break) return false

      if (resolvedNode) {
        if (resolvedNode === node) {
          return node
        }
        node = resolvedNode
        break // move to phase 2
      } else {
        node = node.parent // traversing up the tree until the event is resolved
      }
    }
    while (node)

    if (!node) return false // the event couldn't be resolved
    if (node.parent && node.parent.focusedNode === node.id) return node // phase 2 is redundant if `node` is focused

    //
    // Phase 2
    // Traversing down the tree as long as the event is resolved, starting from the last node from phase 1
    //
    while (true) {
      let resolvedNode = this._getResolveFuncResult(node, event, deepestFocusedNode)
      if (ctrl.break) return false

      if (resolvedNode) {
        if (resolvedNode === node) {
          return node
        }

        node = resolvedNode // traversing down the tree as long as the event is resolved
      } else {
        return node
      }
    }
  }

  /**
   * Get a node returned by the resolve function
   * @param node {NavTree}
   * @param event
   * @param deepestFocusedNode {NavTree}
   * @returns {NavTree|null}
   * @private
   */
  _getResolveFuncResult (node, event, deepestFocusedNode) {
    let resolveFuncResult = node.resolveFunc(event, node, deepestFocusedNode)

    if (resolveFuncResult === null) {
      return node
    } else if (node.nodes[resolveFuncResult] !== undefined) {
      return node.nodes[resolveFuncResult]
    } else {
      return null
    }
  }

  /**
   * Get descendant node specified by path (or itself if path is empty or omitted)
   * @param path - array or a list of arguments
   * @returns {NavTree|null}
   */
  getNode (path) {
    if (!Array.isArray(path)) {
      path = [].slice.call(arguments)
    }

    let node = this
    for (let i in path) {
      node = node.nodes[path[i]]
      if (!node) return null
    }
    return node
  }

  /**
   * Get path to the deepest focused node
   * @returns {Array<string>}
   */
  getFocusedPath () {
    let path = []
    let node = this
    while (node.focusedNode !== null) {
      path.push(node.focusedNode)
      node = node.nodes[node.focusedNode]
    }
    return path
  }

  /**
   * Get the focused node
   * @param deep {boolean} get the deepest focused node
   * @returns {NavTree|null}
   */
  getFocusedNode (deep) {
    let node = this.nodes[this.focusedNode]

    if (!deep || !node) return node || null

    while (node.focusedNode !== null) {
      node = node.nodes[node.focusedNode]
    }
    return node
  }
}


text:
module Questinnet
  module Downloader
    class RSSDownloader
      attr_accessor :address, :path, :username, :password, :file
      def initialize options={}
        @address, @path, @username, @password, @file = options.values_at(:address, :path, :username, :password, :file)
      end

      def get
        Net::HTTP.get(URI([address, path, file].join('/')))
      end
    end
  end
end


text:
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
#import <Foundation/NSRange.h>

typedef enum
{
    notSetType,
    pointType,
    offsetType,
    sizeType,
    rectType,
    transformType,
    affineTransformType,
    pointerType,
    objcType,
    nonRetainedObjectType,
} NSValueType;

struct CBAffineTransform {
    CGFloat a;
    CGFloat b;
    CGFloat c;
    CGFloat d;
    CGFloat tx;
    CGFloat ty;
};

struct CBTransform3D {
    union {
        struct {
            float m11, m12, m13, m14;
            float m21, m22, m23, m24;
            float m31, m32, m33, m34;
            float m41, m42, m43, m44;
        };
        float m[4][4];
    };
};

struct objcValue {
    char *pType;
    int   size;
    void *copy;
};

FOUNDATION_EXPORT_CLASS
@interface NSValue : NSObject <NSCopying,NSCoding> {
@public
    NSValueType _valueType;

    union {
        CGPoint pointValue;
        CGSize sizeValue;
        CGRect rectValue;
        struct CBTransform3D transformValue;
        struct CBAffineTransform affineTransformValue;
        void*  pointerValue;
        struct objcValue genericValue;
    } v;
}

-initWithBytes:(const void *)value objCType:(const char *)type;
+(NSValue *)valueWithBytes:(const void *)value objCType:(const char *)type;
+(NSValue *)value:(const void *)value withObjCType:(const char *)type;

+(NSValue *)valueWithNonretainedObject:object;
+(NSValue *)valueWithPointer:(const void *)pointer;
+(NSValue *)valueWithPoint:(NSPoint)point;
+(NSValue *)valueWithSize:(NSSize)size;
+(NSValue *)valueWithRect:(NSRect)rect;
+(NSValue *)valueWithRange:(NSRange)range;

-(BOOL)isEqualToValue:(NSValue *)other;

-(void)getValue:(void *)value;
-(const char *)objCType;

-nonretainedObjectValue;

-(void *)pointerValue;

-(NSPoint)pointValue;
-(NSSize)sizeValue;
-(NSRect)rectValue;
-(NSRange)rangeValue;

@end

#import <Foundation/NSNumber.h>


text:
using System;

namespace _0426
{
    /*
// Definition for a Node.
*/
    public class Node
    {
        public int val;
        public Node left;
        public Node right;

        public Node() { }
        public Node(int _val, Node _left, Node _right)
        {
            val = _val;
            left = _left;
            right = _right;
        }
        public class Solution
        {
            public Node TreeToDoublyList(Node root)
            {
                if (root == null)
                {
                    return null;
                }
                var result = ConvertBST(root);
                result.LeftMost.left = result.RightMost;
                result.RightMost.right = result.LeftMost;
                return result.LeftMost;
            }

            private (Node LeftMost, Node RightMost) ConvertBST(Node root)
            {
                if (root == null)
                {
                    return (null, null);
                }

                var leftResult = ConvertBST(root.left);
                var rightResult = ConvertBST(root.right);

                var leftMost = leftResult.LeftMost;
                var rightMost = rightResult.RightMost;

                if (leftMost == null)
                {
                    // no left subtree
                    leftMost = root;
                    //root.left = root;
                }
                else
                {
                    leftResult.RightMost.right = root;
                    root.left = leftResult.RightMost;
                }

                if (rightMost == null)
                {
                    // no right subtree
                    rightMost = root;
                    //root.right = root;
                }
                else
                {
                    rightResult.LeftMost.left = root;
                    root.right = rightResult.LeftMost;
                }

                return (leftMost, rightMost);
            }
        }

        class Program
        {
            static void Main(string[] args)
            {
                Console.WriteLine("Hello World!");
            }
        }
    }


text:
// coding: utf-8

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

#ifndef XPCC_SSD1306_HPP
#define XPCC_SSD1306_HPP

#include <xpcc/ui/display/buffered_graphic_display.hpp>
#include <xpcc/processing/protothread.hpp>
#include <xpcc/processing/resumable.hpp>
#include <xpcc/architecture/interface/i2c_device.hpp>
#include <xpcc/processing/timer.hpp>

namespace xpcc
{

struct ssd1306
{
protected:
	/// @cond
	enum Command : uint8_t
	{
		// fundamental commands
		SetContrastControl = 0x81,
		SetChargePump = 0x8D,
		SetEntireDisplayResumeToRam = 0xA4,
		SetEntireDisplayIgnoreRam = 0xA5,
		SetNormalDisplay = 0xA6,
		SetInvertedDisplay = 0xA7,
		SetDisplayOff = 0xAE,
		SetDisplayOn = 0xAF,

		// scrolling commands
		SetHorizontalScrollRight = 0x26,
		SetHorizontalScrollLeft = 0x27,
		SetVerticalAndHorizontalScrollRight = 0x29,
		SetVerticalAndHorizontalScrollLeft = 0x2A,
		SetDisableScroll = 0x2E,
		SetEnableScroll = 0x2F,
		SetVerticalScrollArea = 0xA3,

		// addressing commands
		SetLowerColumnStartAddress = 0x00,
		SetHigherColumnStartAddress = 0x10,
		SetMemoryMode = 0x20,
		SetColumnAddress = 0x21,
		SetPageAddress = 0x22,
		SetPageStartAddress = 0xB0,

		// Hardware configuration
		SetDisplayStartLine = 0x40,
		SetSegmentRemap0 = 0xA0,
		SetSegmentRemap127 = 0xA1,
		SetMultiplexRatio = 0xA8,
		SetComOutputScanDirectionIncrement = 0xC0,
		SetComOutputScanDirectionDecrement = 0xC8,
		SetDisplayOffset = 0xD3,
		SetComPins = 0xDA,

		// timing configuration
		SetDisplayClockDivideRatio = 0xD5,
		SetPreChargePeriod = 0xD9,
		SetV_DeselectLevel = 0xDB,
		Nop = 0xE3,
	};
	/// @endcond

public:
	enum class
	Rotation : bool
	{
		Normal,
		UpsideDown
	};

	enum class
	ScrollStep : uint8_t
	{
		Frames2 = 0b111,
		Frames3 = 0b100,
		Frames4 = 0b101,
		Frames5 = 0b000,
		Frames25 = 0b110,
		Frames64 = 0b001,
		Frames128 = 0b010,
		Frames256 = 0b011
	};

	enum class
	ScrollDirection : uint8_t
	{
		Right = SetHorizontalScrollRight,
		Left = SetHorizontalScrollLeft
	};

	enum class
	DisplayMode : uint8_t
	{
		Normal = SetNormalDisplay,
		Inverted = SetInvertedDisplay
	};

protected:
	/// @cond
	static constexpr uint8_t
	i(ScrollDirection direction) { return uint8_t(direction); }
	static constexpr uint8_t
	i(ScrollStep step) { return uint8_t(step); }

public:
	class DataTransmissionAdapter : public xpcc::I2cWriteTransaction
	{
	public:
		DataTransmissionAdapter(uint8_t address);

		void xpcc_always_inline
		setCommandBuffer(uint8_t *buffer)
		{ commands = buffer; }

		bool
		configureDisplayWrite(uint8_t (*buffer)[8], std::size_t size);

	protected:
		virtual Writing
		writing() override;

		virtual void
		detaching(xpcc::I2c::DetachCause cause) override;

	private:
		uint8_t *commands;
	public:
		bool writeable;
	};
	/// @endcond
}; // struct ssd1306

/**
 * Driver for SSD1306 based OLED-displays using I2C.
 * This display is only rated to be driven with 400kHz, which limits
 * the frame rate to about 40Hz.
 *
 * @author	Niklas Hauser
 * @ingroup	driver_display
 */
template < class I2cMaster >
class Ssd1306 : public ssd1306, public BufferedGraphicDisplay<128, 64>,
				public I2cDevice<I2cMaster, 2, ssd1306::DataTransmissionAdapter>
{
public:
	Ssd1306(uint8_t address = 0x3C);

	/// Pings the display
	bool inline
	pingBlocking()
	{
		return RF_CALL_BLOCKING(this->ping());
	}

	/// initializes for 3V3 with charge-pump
	bool inline
	initializeBlocking()
	{
		return RF_CALL_BLOCKING(initialize());
	}

	/// Update the display with the content of the RAM buffer.
	void
	update() override
	{
		RF_CALL_BLOCKING(startWriteDisplay());
	}

	/// Use this method to synchronize writing to the displays buffer
	/// to avoid tearing.
	/// @return	`true` if the frame buffer is not being copied to the display
	bool xpcc_always_inline
	isWritable()
	{
		return this->transaction.writeable;
	}

	// MARK: - TASKS
	/// initializes for 3V3 with charge-pump asynchronously
	xpcc::ResumableResult<bool>
	initialize();

	// starts a frame transfer and waits for completion
	xpcc::ResumableResult<bool>
	writeDisplay();

	xpcc::ResumableResult<bool> xpcc_always_inline
	setDisplayMode(DisplayMode mode = DisplayMode::Normal)
	{ return writeCommand(static_cast<Command>(mode)); }

	xpcc::ResumableResult<bool> xpcc_always_inline
	setContrast(uint8_t contrast = 0xCE)
	{ return writeCommand(Command::SetContrastControl, contrast); }

	xpcc::ResumableResult<bool>
	setRotation(Rotation rotation=Rotation::Normal);

	xpcc::ResumableResult<bool>
	configureScroll(uint8_t origin, uint8_t size,
			ScrollDirection direction, ScrollStep steps);

	xpcc::ResumableResult<bool> xpcc_always_inline
	enableScroll()
	{ return writeCommand(Command::SetEnableScroll); }

	xpcc::ResumableResult<bool> xpcc_always_inline
	disableScroll()
	{ return writeCommand(Command::SetDisableScroll); }

protected:
	/// Write a command without data
	xpcc::ResumableResult<bool>
	writeCommand(uint8_t command);

	/// Write a command with one byte data
	xpcc::ResumableResult<bool>
	writeCommand(uint8_t command, uint8_t data);

	/// Write a command with two bytes data
	xpcc::ResumableResult<bool>
	writeCommand(uint8_t command, uint8_t data1, uint8_t data2);

private:
	xpcc::ResumableResult<void>
	startWriteDisplay();

	bool
	startTransactionWithLength(uint8_t length);

private:
	uint8_t commandBuffer[14];
};

} // namespace xpcc

#include "ssd1306_impl.hpp"

#endif // XPCC_SSD1306_HPP


text:
'''
Created by auto_sdk on 2015.06.23
'''
from aliyun.api.base import RestApi
class Dns20150109DeleteBatchDomainRecordsRequest(RestApi):
	def __init__(self,domain='dns.aliyuncs.com',port=80):
		RestApi.__init__(self,domain, port)
		self.Records = None

	def getapiname(self):
		return 'dns.aliyuncs.com.DeleteBatchDomainRecords.2015-01-09'


text:
package org.kannel.protocol.gateway;

import java.io.IOException;
import java.util.LinkedList;
import org.kannel.protocol.kbinds.KannelBinding;
import org.kannel.protocol.packets.BasicKannelProtocolMessage;
import org.kannel.protocol.packets.SMSPacketMessage;

/**
 * This class redirects to a Kannel link.
 *
 * @author Oscar Medina Duarte
 * @author garth
 */
public class KjWritingThread extends Thread {

  protected KannelBinding kbind = null;
  protected AckCycleThread ackAdminThread = null;
  protected LinkedList messages = null;

  /**
   * Constructor for the KjWritingThread object
   *
   * @param kbind Description of the Parameter
   */
  public KjWritingThread(KannelBinding kbind) {
    this.kbind = kbind;
    this.messages = new LinkedList();
  }

  public void send(String sender, String receiver, String udhdata, String msgdata) {
    send(new SMSPacketMessage(sender, receiver, udhdata, msgdata));
  }

  public void send(SMSPacketMessage pack) {
    try {
      if (this.ackAdminThread != null) {
        this.ackAdminThread.waitAck(pack);
      }
      this.kbind.write((BasicKannelProtocolMessage) pack);
    } catch (Exception e) {
      System.out.println("sendind message failed : " + e);
    }
  }

  public void sendOnThread(String sender, String receiver, String udhdata, String msgdata) {
    sendOnThread(new SMSPacketMessage(sender, receiver, udhdata, msgdata));
  }

  public void sendOnThread(SMSPacketMessage pack) {
    this.messages.add(pack);
  }

  public void rawWrite(byte[] pktMessage) {
    try {
      this.kbind.rawWrite(pktMessage);
    } catch (IOException e) {
      System.out.println("Raw writing failed : " + e);
    }
  }

  public void addAckCycleThread(AckCycleThread ackAdminThread) {
    this.ackAdminThread = ackAdminThread;
  }

  /** Main processing method for the KjWritingThread object */
  public void run() {
    System.out.println("Writing thread started.");
    SMSPacketMessage sms = null;
    while (true) {
      if (this.messages.size() > 0) {
        System.out.println("sending");
        sms = (SMSPacketMessage) this.messages.removeFirst();
        send(sms);
      }
    }
  }
}


text:
<!DOCTYPE html>

<meta charset="utf-8">
<title>Dynamically-indexed row-major matrix test</title>
<link rel="stylesheet" href="../../resources/js-test-style.css"/>


text:
#include <maestro/maestro_note.h>
#include "maestro_command.h"

static int maestro_cmd_connect(maestro_cmd_ctxt_t *cmd_ctxt,
	gru_uri_t uri,
	gru_status_t *status) {
	logger_t logger = gru_logger_get();

	msg_opt_t opt = {
		.direction = MSG_DIRECTION_SENDER,
		.statistics = MSG_STAT_NONE,
	};

	msg_conn_info_gen_id(&opt.conn_info);

	gru_status_reset(status);
	opt.uri = gru_uri_clone(uri, status);
	if (gru_status_error(status)) {
		logger(GRU_ERROR, "Failed to set connection URL: %s", status->message);
		return -1;
	}

	if (!maestro_cmd_ctxt_start(cmd_ctxt, opt, status)) {
		return 1;
	}

	return 0;
}

static int maestro_cmd_without_payload(maestro_cmd_ctxt_t *cmd_ctxt,
									   const char *path, maestro_command_t cmd, gru_status_t *status) {
	int ret = maestro_cmd_connect(cmd_ctxt, options_get_maestro_uri(), status);
	if (ret != 0) {
		return ret;
	}

	gru_uri_set_path(&cmd_ctxt->msg_ctxt->msg_opts.uri, path);

	msg_content_data_t req = {0};
	maestro_easy_request(&req, cmd);

	if (!maestro_cmd_ctxt_send(cmd_ctxt, &req, status)) {
		fprintf(stderr, "Failed to send command to %s: %s\n", path, status->message);
		msg_content_data_release(&req);
		maestro_cmd_ctxt_stop(cmd_ctxt, status);

		return 1;
	}

	msg_content_data_release(&req);
	maestro_cmd_ctxt_stop(cmd_ctxt, status);

	return 0;
}

int maestro_cmd_start_receiver(maestro_cmd_ctxt_t *cmd_ctxt, gru_status_t *status) {
	return maestro_cmd_without_payload(cmd_ctxt, MAESTRO_RECEIVER_DAEMONS, MAESTRO_NOTE_START_RECEIVER, status);
}

int maestro_cmd_stop_receiver(maestro_cmd_ctxt_t *cmd_ctxt, gru_status_t *status) {
	return maestro_cmd_without_payload(cmd_ctxt, MAESTRO_RECEIVER_DAEMONS, MAESTRO_NOTE_STOP_RECEIVER, status);
}

int maestro_cmd_start_sender(maestro_cmd_ctxt_t *cmd_ctxt, gru_status_t *status) {
	return maestro_cmd_without_payload(cmd_ctxt, MAESTRO_SENDER_DAEMONS, MAESTRO_NOTE_START_SENDER, status);
}

int maestro_cmd_stop_sender(maestro_cmd_ctxt_t *cmd_ctxt, gru_status_t *status) {
	return maestro_cmd_without_payload(cmd_ctxt, MAESTRO_SENDER_DAEMONS, MAESTRO_NOTE_STOP_SENDER, status);
}

int maestro_cmd_start_inspector(maestro_cmd_ctxt_t *cmd_ctxt, gru_status_t *status) {
	return maestro_cmd_without_payload(cmd_ctxt, MAESTRO_BROKER_INSPECTOR_DAEMONS,
									   MAESTRO_NOTE_START_INSPECTOR, status);
}

int maestro_cmd_stop_inspector(maestro_cmd_ctxt_t *cmd_ctxt, gru_status_t *status) {
	return maestro_cmd_without_payload(cmd_ctxt, MAESTRO_BROKER_INSPECTOR_DAEMONS,
									   MAESTRO_NOTE_STOP_INSPECTOR, status);
}

int maestro_cmd_start_all(maestro_cmd_ctxt_t *cmd_ctxt, gru_status_t *status) {
	maestro_cmd_start_inspector(cmd_ctxt, status);
	maestro_cmd_start_receiver(cmd_ctxt, status);
	return maestro_cmd_start_sender(cmd_ctxt, status);
}

int maestro_cmd_stop_all(maestro_cmd_ctxt_t *cmd_ctxt, gru_status_t *status) {
	maestro_cmd_stop_sender(cmd_ctxt, status);
	maestro_cmd_stop_receiver(cmd_ctxt, status);
	return maestro_cmd_stop_inspector(cmd_ctxt, status);
}

static void maestro_cmd_print_responses(maestro_note_t *note) {
	printf("Name: %-45s\tID: %-40s ", note->payload->response.name, note->payload->response.id);

	switch (note->command) {
	case MAESTRO_NOTE_OK: {
		printf("Response: OK\n");
		break;
	}
	case MAESTRO_NOTE_PING: {
		printf("Time: %"PRIu64" ms\n",  note->payload->response.body.ping.elapsed);

		break;
	}
	case MAESTRO_NOTE_STATS: {
		printf("Children: %"PRIu32" Count: %"PRIu64" Rate: %.2f Latency: %.2f\n",
			   note->payload->response.body.stats.child_count,
			   note->payload->response.body.stats.stats.perf.count,
			   note->payload->response.body.stats.stats.perf.rate,
			   note->payload->response.body.stats.stats.perf.latency);
		break;
	}
	case MAESTRO_NOTE_PROTOCOL_ERROR: {
		printf("Error: one of more of the commands did not complete successfully\n");
		break;
	}
	case MAESTRO_NOTE_INTERNAL_ERROR: {
		printf("Error: internal server error\n");
		break;
	}
	default: {
		printf("Error: unhandled response: %d\n", note->command);
		break;
	}
	}
}

static void maestro_cmd_print_notifications(maestro_note_t *note) {
	printf("Notification from: %-45s\tID: %-40s Message: ", note->payload->response.name, note->payload->response.id);

	switch (note->command) {
	case MAESTRO_NOTE_ABNORMAL_DISCONNECT:
	case MAESTRO_NOTE_NOTIFY_FAIL:
	case MAESTRO_NOTE_NOTIFY_SUCCESS: {
		printf("%s\n", note->payload->notification.body.message);
		break;
	}
	default: {
		printf("Error: unhandled notification\n");
		break;
	}
	}
}

static const char *maestro_cmd_get_string(const gru_list_t *strings, uint32_t pos) {
	if (!strings) {
		return NULL;
	}

	const gru_node_t *node = gru_list_get(strings, pos);
	if (!node) {
		return NULL;
	}

	return gru_node_get_data_ptr(char, node);
}

static int maestro_cmd_do_collect(maestro_cmd_ctxt_t *cmd_ctxt, gru_list_t *strings,
	gru_status_t *status)
{
	while (true) {
		char buf[MAESTRO_NOTE_SIZE] = {0};

		ssize_t ret = msgrcv(cmd_ctxt->queue, &buf, sizeof(buf), 0, IPC_NOWAIT);
		if (ret < 0) {
			if (errno == ENOMSG) {
				break;
			}

			int err = errno;
			fprintf(stdout, "Failed to read %"PRIu64" bytes from the local forward queue: %s\n",
				sizeof(buf), strerror(err));

			return 1;

		}

		maestro_note_t note = {0};
		msg_content_data_t msg = {0};

		msg_content_data_copy(&msg, &buf, ret);

		maestro_trace_proto(buf, ret);

		if (!maestro_deserialize_note(&msg, &note, status)) {
			fprintf(stderr, "Unknown protocol data\n");
		} else {
			if (note.type == MAESTRO_TYPE_RESPONSE) {
				maestro_cmd_print_responses(&note);
			}
			else {
				maestro_cmd_print_notifications(&note);
			}
		}

		maestro_note_payload_cleanup(&note);
		msg_content_data_release(&msg);

	}

	return 0;
}

int maestro_cmd_collect(maestro_cmd_ctxt_t *cmd_ctxt, gru_list_t *strings,
	gru_status_t *status)
{
	const char *count_str = maestro_cmd_get_string(strings, 1);
	const char *interval_str = maestro_cmd_get_string(strings, 2);

	if (count_str && interval_str) {
		uint32_t count = atoi(count_str);
		uint32_t interval = atoi(interval_str);

		for (int i = 0; i < count; i++) {
			int ret = maestro_cmd_do_collect(cmd_ctxt, strings, status);
			if (ret != 0) {
				return ret;
			}
			sleep(interval);
		}

		return 0;
	}

	return maestro_cmd_do_collect(cmd_ctxt, strings, status);

}

int maestro_cmd_flush(maestro_cmd_ctxt_t *cmd_ctxt, gru_status_t *status) {
	return maestro_cmd_without_payload(cmd_ctxt, MAESTRO_ALL_DAEMONS, MAESTRO_NOTE_FLUSH, status);
}

static int maestro_cmd_set_opt_by_name(msg_content_data_t *data,
	const char *opt,
	const char *val,
	gru_status_t *status) {
	maestro_note_t note = {0};

	maestro_note_set_type(&note, MAESTRO_TYPE_REQUEST);
	maestro_note_set_cmd(&note, MAESTRO_NOTE_SET);

	if (!maestro_note_payload_prepare(&note, status)) {
		return -1;
	}

	if (strcmp(opt, "broker") == 0) {
		maestro_note_set_opt(&note, MAESTRO_NOTE_OPT_SET_BROKER, val);
	} else if (strcmp(opt, "duration") == 0) {
		maestro_note_set_opt(&note, MAESTRO_NOTE_OPT_SET_DURATION_TYPE, val);
	} else if (strcmp(opt, "log-level") == 0) {
		maestro_note_set_opt(&note, MAESTRO_NOTE_OPT_SET_LOG_LEVEL, val);
	} else if (strcmp(opt, "parallel-count") == 0) {
		maestro_note_set_opt(&note, MAESTRO_NOTE_OPT_SET_PARALLEL_COUNT, val);
	} else if (strcmp(opt, "message-size") == 0) {
		maestro_note_set_opt(&note, MAESTRO_NOTE_OPT_SET_MESSAGE_SIZE, val);
	} else if (strcmp(opt, "throttle") == 0) {
		maestro_note_set_opt(&note, MAESTRO_NOTE_OPT_SET_THROTTLE, val);
	} else if (strcmp(opt, "rate") == 0) {
		maestro_note_set_opt(&note, MAESTRO_NOTE_OPT_SET_RATE, val);
	} else if (strcmp(opt, "fcl") == 0) {
		maestro_note_set_opt(&note, MAESTRO_NOTE_OPT_FCL, val);
	} else {
		return -1;
	}

	maestro_serialize_note(&note, data);
	maestro_note_payload_cleanup(&note);
	return 0;
}

int maestro_cmd_set_opt(maestro_cmd_ctxt_t *cmd_ctxt,
	gru_list_t *strings,
	gru_status_t *status) {

	const gru_node_t *node = gru_list_get(strings, 1);
	if (!node) {
		gru_status_set(status, GRU_FAILURE, "Missing option name");
		return 1;
	}

	char *opt = gru_node_get_data_ptr(char, node);

	if (!node->next) {
		gru_status_set(status, GRU_FAILURE, "Missing option value: parser error");
		return 1;
	}

	char *val = gru_node_get_data_ptr(char, node->next);
	if (!val) {
		gru_status_set(status, GRU_FAILURE, "Missing option value: invalid CLI data");
		return 1;
	}

	int ret = maestro_cmd_connect(cmd_ctxt, options_get_maestro_uri(), status);
	if (ret != 0) {
		return ret;
	}

	gru_uri_set_path(&cmd_ctxt->msg_ctxt->msg_opts.uri, MAESTRO_ALL_DAEMONS);

	msg_content_data_t req = {0};
	if (maestro_cmd_set_opt_by_name(&req, opt, val, status) == -1) {
		gru_status_set(status, GRU_FAILURE, "Invalid option: %s", opt);
		maestro_cmd_ctxt_stop(cmd_ctxt, status);

		return 1;
	}

	if (!maestro_cmd_ctxt_send(cmd_ctxt, &req, status)) {
		fprintf(stderr, "Failed to send command: %s\n", status->message);
		msg_content_data_release(&req);
		maestro_cmd_ctxt_stop(cmd_ctxt, status);

		return 1;
	}

	msg_content_data_release(&req);
	maestro_cmd_ctxt_stop(cmd_ctxt, status);

	return 0;
}

static void maestro_cmd_request_ping(msg_content_data_t *out, gru_status_t *status) {
	maestro_note_t note = {0};

	if (!maestro_note_payload_prepare(&note, status)) {
		return;
	}

	maestro_note_set_type(&note, MAESTRO_TYPE_REQUEST);
	maestro_note_set_cmd(&note, MAESTRO_NOTE_PING);

	gru_timestamp_t ts = gru_time_now();
	maestro_note_ping_set_ts(&note, ts);
	maestro_serialize_note(&note, out);
	maestro_note_payload_cleanup(&note);
}

int maestro_cmd_ping(maestro_cmd_ctxt_t *cmd_ctxt, gru_status_t *status) {
	int ret = maestro_cmd_connect(cmd_ctxt, options_get_maestro_uri(), status);
	if (ret != 0) {
		return ret;
	}

	gru_uri_set_path(&cmd_ctxt->msg_ctxt->msg_opts.uri, MAESTRO_ALL_DAEMONS);

	msg_content_data_t req = {0};
	maestro_cmd_request_ping(&req, status);
	if (!gru_status_success(status)) {
		return 1;
	}

	if (!maestro_cmd_ctxt_send(cmd_ctxt, &req, status)) {
		fprintf(stderr, "Failed to send command: %s\n", status->message);
		msg_content_data_release(&req);
		maestro_cmd_ctxt_stop(cmd_ctxt, status);

		return 1;
	}

	msg_content_data_release(&req);
	maestro_cmd_ctxt_stop(cmd_ctxt, status);

	return 0;
}

int maestro_cmd_stats(maestro_cmd_ctxt_t *cmd_ctxt, gru_list_t *strings,
	gru_status_t *status)
{
	const char *count_str = maestro_cmd_get_string(strings, 1);
	const char *interval_str = maestro_cmd_get_string(strings, 2);

	if (count_str && interval_str) {
		uint32_t count = atoi(count_str);
		uint32_t interval = atoi(interval_str);

		for (int i = 0; i < count; i++) {
			int ret = 0;

			ret = maestro_cmd_without_payload(cmd_ctxt, MAESTRO_ALL_DAEMONS, MAESTRO_NOTE_STATS, status);
			if (ret != 0) {
				return ret;
			}

			ret = maestro_cmd_do_collect(cmd_ctxt, NULL, status);
			if (ret != 0) {
				return ret;
			}

			sleep(interval);
		}

		return 0;
	}

	return maestro_cmd_without_payload(cmd_ctxt, MAESTRO_ALL_DAEMONS, MAESTRO_NOTE_STATS, status);

}

int maestro_cmd_halt(maestro_cmd_ctxt_t *cmd_ctxt, gru_list_t *strings,
	gru_status_t *status)
{
	return maestro_cmd_without_payload(cmd_ctxt, MAESTRO_ALL_DAEMONS, MAESTRO_NOTE_HALT, status);
}


text:
The following is a list of packages implement the NLPModels API.

If you want your package listed here, open a Pull Request.

If you want to create your own interface, check these [Guidelines](@ref).
## Packages

- [NLPModelsModifiers.jl](https://github.com/JuliaSmoothOptimizers/NLPModelsModifiers.jl):
  Models that modify existing models.
  For instance, creating slack variables, or moving constraints into the objective functions, or using Quasi-Newton LBFSG approximations to the Hessian.
- [ADNLPModels.jl](https://github.com/JuliaSmoothOptimizers/ADNLPModels.jl):
  Models with automatic differentiation. It has a very simple interface, although it isn't very efficient for larger problems.
- [CUTEst.jl](https://github.com/JuliaSmoothOptimizers/CUTEst.jl):
  For problems from [CUTEst](https://github.com/ralna/CUTEst/wiki).
- [AmplNLReader.jl](https://github.com/JuliaSmoothOptimizers/AmplNLReader.jl):
  For problems modeled using [AMPL](https://ampl.com)
- [NLPModelsJuMP.jl](https://github.com/JuliaSmoothOptimizers/NLPModelsJuMP.jl):
  For problems modeled using [JuMP.jl](https://github.com/jump-dev/JuMP.jl).
- [QuadraticModels.jl](https://github.com/JuliaSmoothOptimizers/QuadraticModels.jl):
  For problems with quadratic and linear structure.
- [LLSModels.jl](https://github.com/JuliaSmoothOptimizers/LLSModels.jl):
  Creates a linear least squares model.
- [PDENLPModels.jl](https://github.com/JuliaSmoothOptimizers/PDENLPModels.jl):
  For PDE problems.

## Model internals

```@docs
AbstractNLPModel
AbstractNLSModel
AbstractNLPModelMeta
NLPModelMeta
NLSMeta
nls_meta
```


text:
package jintgen.jigir;

import cck.text.StringUtil;
import java.util.List;

/**
 * The IfStmt class represents a simple branch within the IR. Since loops and switch statements
 * are not allowed, if statements (and subroutine calls) are the only form of control flow.
 *
 * @author Ben L. Titzer
 */
public class IfStmt extends Stmt {
    /**
     * The cond field stores a reference to the expression that is evaluated as the condition
     * determining which branch is executed.
     */
    public final Expr cond;

    /**
     * The trueBranch field stores a reference to the list of statements to be executed if the
     * condition is true.
     */
    public final List<Stmt> trueBranch;

    /**
     * The falseBranch field stores a reference to the list of statements to be executed if the
     * condition is false.
     */
    public final List<Stmt> falseBranch;

    /**
     * The constructor of the IfStmt class simply initializes the internal fields based on the
     * parameters.
     *
     * @param c a reference to the expression representing the condition
     * @param t a reference to the list of statements to execute if the condition evaluates to true
     * @param f a reference to the list of statements to execute if the condition evaluates to false
     */
    public IfStmt(Expr c, List<Stmt> t, List<Stmt> f) {
        cond = c;
        trueBranch = t;
        falseBranch = f;
    }

    /**
     * The accept() method implements one half of the visitor pattern for visiting the abstract
     * syntax trees representing the code of a particular instruction or subroutine.
     *
     * @param v the visitor to accept
     */
    public void accept(StmtVisitor v) {
        v.visit(this);
    }

    /**
     * The toString() method recursively converts this statement to a string.
     *
     * @return a string representation of this statement
     */
    public String toString() {
        StringBuffer buf = new StringBuffer();
        buf.append("if ( ");
        buf.append(cond);
        buf.append(" ) {\n");
        StringUtil.linelist(buf, trueBranch);
        buf.append("} else {\n");
        StringUtil.linelist(buf, falseBranch);
        buf.append('}');
        return buf.toString();
    }

    /**
     * The accept() method implements one half of the visitor pattern for visiting the abstract
     * syntax trees representing the code of a particular instruction or subroutine. The
     * StmtRebuilder interface allows visitors to rearrange and rebuild the statements.
     *
     * @param r the visitor to accept
     * @return the result of calling the appropriate visit() of the rebuilder passed
     */
    public <Res, Env> Res accept(StmtAccumulator<Res, Env> r, Env env) {
        return r.visit(this, env);
    }

}


text:
<!doctype html>
<html ng-app="docsRestrictDirective">
<head>
<script src="../static/angularjs/1.4.4/angular.min.js"></script>
<script type="text/javascript">
angular.module('docsRestrictDirective', [])
.controller('Controller', ['$scope', function($scope) {
  $scope.customer = {
    name: 'Naomi',
    address: '1600 Amphitheatre'
  };
}])
.directive('myCustomer', function() {
  return {
    restrict: 'E',
    templateUrl: 'my-customer.html'
  };
});
</script>
</head>
<body>
<div ng-controller="Controller">
  <my-customer></my-customer>
</div>
</body>
</html>


text:
<html>
<head>
	<title>Brix Chart Demo Index</title>
	<meta charset="utf-8" />
	<!-- <link rel="stylesheet" type="text/css" href="test.css"> -->
</head>
<body>
	<form name="form" onsubmit="return false;">
        <input type="button" value="直方图" onclick="link('test_histogram.html')"/>
        <input type="button" value="直方图2" onclick="link('test_histogram2.html')"/>
        <input type="button" value="直方图3" onclick="link('test_histogram3.html')"/>
	    <input type="button" value="综合图" onclick="link('test_integrate.html')"/>
	    <input type="button" value="综合图2" onclick="link('test_integrate2.html')"/>
	    <input type="button" value="综合图3" onclick="link('test_integrate3.html')"/>
	    <input type="button" value="综合图4" onclick="link('test_integrate4.html')"/>
	    <input type="button" value="综合图5" onclick="link('test_integrate5.html')"/>
	    <input type="button" value="折线图" onclick="link('test_line.html')"/>
	    <input type="button" value="折线图(双日期)" onclick="link('test_line2.html')"/>
	    <input type="button" value="折线图(双指标)" onclick="link('test_line3.html')"/>
	    <input type="button" value="散点图" onclick="link('test_scatter.html')"/>
	    <input type="button" value="饼图" onclick="link('test_pie.html')"/>
	    <input type="button" value="地图" onclick="link('test_map.html')"/>
	    <input type="button" value="treemap" onclick="link('test_treemap.html')"/>
        <input type="button" value="treemap2" onclick="link('test_treemap2.html')"/>
    </form>

    <form name="form" onsubmit="return false;">
        <input type="button" value="自适应" onclick="link('_test_resize.html')"/>
	    <input type="button" value="对外接口" onclick="link('_test_interface.html')"/>
	    <input type="button" value="事件" onclick="link('_test_events.html')"/>
    </form>

	<script type="text/javascript">
		function link($s){
			// var s = $s + '?local=true'
			var s = $s
			window.open(s);
		}
	</script>
</body>
</html>


text:
package org.locationtech.geomesa.curve

import org.locationtech.geomesa.curve.TimePeriod.TimePeriod
import org.locationtech.sfcurve.IndexRange
import org.locationtech.sfcurve.zorder.{Z3, ZRange}

class Z3SFC(period: TimePeriod) extends SpaceTimeFillingCurve[Z3] {

  private val xprec: Long = math.pow(2, 21).toLong - 1
  private val yprec: Long = math.pow(2, 21).toLong - 1
  private val tprec: Long = math.pow(2, 20).toLong - 1
  private val tmax: Double = BinnedTime.maxOffset(period).toDouble

  override val lon  = NormalizedLon(xprec)
  override val lat  = NormalizedLat(yprec)
  override val time = NormalizedTime(tprec, tmax)

  override def index(x: Double, y: Double, t: Long): Z3 =
    Z3(lon.normalize(x), lat.normalize(y), time.normalize(t))

  override def invert(z: Z3): (Double, Double, Long) = {
    val (x, y, t) = z.decode
    (lon.denormalize(x), lat.denormalize(y), time.denormalize(t).toLong)
  }

  override def ranges(xy: Seq[(Double, Double, Double, Double)],
                      t: Seq[(Long, Long)],
                      precision: Int,
                      maxRanges: Option[Int]): Seq[IndexRange] = {
    val zbounds = for { (xmin, ymin, xmax, ymax) <- xy ; (tmin, tmax) <- t } yield {
      ZRange(index(xmin, ymin, tmin).z, index(xmax, ymax, tmax).z)
    }
    Z3.zranges(zbounds.toArray, precision, maxRanges)
  }
}

object Z3SFC {

  private val SfcDay   = new Z3SFC(TimePeriod.Day)
  private val SfcWeek  = new Z3SFC(TimePeriod.Week)
  private val SfcMonth = new Z3SFC(TimePeriod.Month)
  private val SfcYear  = new Z3SFC(TimePeriod.Year)

  def apply(period: TimePeriod): Z3SFC = period match {
    case TimePeriod.Day   => SfcDay
    case TimePeriod.Week  => SfcWeek
    case TimePeriod.Month => SfcMonth
    case TimePeriod.Year  => SfcYear
  }
}


text:
"""
#  PHP commands :
#  exec("python audio.py -f ".$filename." -c ".$convertto." -b ".$bitrate)
"""

from pydub import AudioSegment
from argparse import ArgumentParser

ap = ArgumentParser()
ap.add_argument("-f", "--filename", required=True)
ap.add_argument("-c", "--convertto", required=True)
ap.add_argument("-b", "--bitrate", required=True)
ap.add_argument("-e", "--codec",required=False)
args = vars(ap.parse_args())

file_name = args["filename"]
convert_to = args["convertto"]
bit_rate = args["bitrate"]
codec = args["codec"]

# AudioSegment.from_file('./uploads/Audio/dolphin.wav').export('./compressed/Audio/dolphin.mp3', format='mp3', bitrate=bit_rate)
AudioSegment.from_file('./uploads/Audio/'+file_name).export('./compressed/Audio/'+file_name.split('.')[0]+'.'+convert_to, format=convert_to, bitrate=bit_rate, codec=codec)


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace Bolt.Generators
{
    public class DocumentGenerator : ContractGeneratorBase
    {
        private const string Warning = @"//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.

//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------";

        private readonly List<GeneratorBase> _contractGenerator = new List<GeneratorBase>();

        public DocumentGenerator()
            : this(new StringWriter(), new TypeFormatter(), new IntendProvider())
        {
        }

        public DocumentGenerator(StringWriter output, TypeFormatter formatter, IntendProvider intendProvider)
            : base(output, formatter, intendProvider)
        {
        }

        public static DocumentGenerator Create(ContractDefinition contract = null)
        {
            return new DocumentGenerator
            {
                ContractDefinition = contract
            };
        }

        public object Context { get; set; }

        public string GetResult(object context = null)
        {
            Generate(context ?? Context);
            return Output.GetStringBuilder().ToString().Trim();
        }

        public override void Generate(object context)
        {
            WriteLine();

            foreach (GeneratorBase generator in _contractGenerator)
            {
                try
                {
                    generator.Generate(context);
                }
                catch (Exception e)
                {
                    WriteLine("/*");
                    WriteLine("Execution of '{0}' generator failed with error '{1}'", generator.GetType().Name, e.ToString());
                    WriteLine("*/");
                }
            }

            StringBuilder sb = new StringBuilder();
            sb.AppendLine(Warning);
            sb.AppendLine();

            IEnumerable<string> systemNamespaces = Formatter.GetNamespaces().Where(n => n.StartsWith("System")).ToList();
            foreach (string ns in Formatter.GetNamespaces().Where(n => n.StartsWith("System")))
            {
                sb.AppendFormat("using {0};\n", ns);
            }
            if (systemNamespaces.Any())
            {
                sb.AppendLine();
            }

            foreach (string ns in Formatter.GetNamespaces().Except(systemNamespaces))
            {
                sb.AppendFormat("using {0};\n", ns);
            }
            sb.AppendLine();

            Output.GetStringBuilder().Insert(0, sb.ToString());
        }

        public DocumentGenerator Async(ContractDefinition definition = null, ClassDescriptor contractDescriptor = null, bool force = false)
        {
            return AddContractGenerator(new InterfaceGenerator(Output, Formatter, IntendProvider)
            {
                ContractDefinition = definition ?? ContractDefinition,
                ContractDescriptor = contractDescriptor,
                ForceAsync = force
            });
        }

        public DocumentGenerator Proxy(ContractDefinition definition = null, ClassDescriptor descriptor = null, bool forceAsync = false)
        {
            return AddContractGenerator(new ProxyGenerator(Output, Formatter, IntendProvider)
            {
                ContractDefinition = definition ?? ContractDefinition,
                ContractDescriptor = descriptor,
                ForceAsync = forceAsync
            });
        }

        public void Add(GeneratorBase generator)
        {
            var generatorBase = generator as ContractGeneratorBase;
            if (generatorBase != null)
            {
                generatorBase.MetadataProvider = MetadataProvider;
                Formatter.AddNamespace(generatorBase.ContractDefinition.Namespace);
            }

            generator.Output = Output;
            generator.Formatter = Formatter;
            generator.IntendProvider = IntendProvider;

            _contractGenerator.Add(generator);
        }

        private DocumentGenerator AddContractGenerator(ContractGeneratorBase generator)
        {
            Add(generator);
            return this;
        }
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>org.apache.catalina.util Class Hierarchy (Apache Tomcat 9.0.0.M11 API Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Apache Tomcat 9.0.0.M11

Prev

Next

Frames

No Frames

All Classes

Hierarchy For Package org.apache.catalina.util

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

java.util.AbstractCollection<E> (implements java.util.Collection<E>)

java.util.AbstractSet<E> (implements java.util.Set<E>)

java.util.HashSet<E> (implements java.lang.Cloneable, java.io.Serializable, java.util.Set<E>)

org.apache.catalina.util.ResourceSet<T>

java.util.AbstractMap<K,V> (implements java.util.Map<K,V>)

java.util.HashMap<K,V> (implements java.lang.Cloneable, java.util.Map<K,V>, java.io.Serializable)

java.util.LinkedHashMap<K,V> (implements java.util.Map<K,V>)

org.apache.catalina.util.ParameterMap<K,V>

org.apache.catalina.util.CharsetMapper

org.apache.catalina.util.ConcurrentDateFormat

org.apache.catalina.util.ContextName

org.apache.catalina.util.DOMWriter

org.apache.catalina.util.Extension

org.apache.catalina.util.ExtensionValidator

java.io.InputStream (implements java.io.Closeable)

java.io.ObjectInputStream (implements java.io.ObjectInput, java.io.ObjectStreamConstants)

org.apache.catalina.util.CustomObjectInputStream

org.apache.catalina.util.Introspection

org.apache.catalina.util.IOTools

org.apache.catalina.util.LifecycleBase (implements org.apache.catalina.Lifecycle)

org.apache.catalina.util.LifecycleMBeanBase (implements org.apache.catalina.JmxEnabled)

org.apache.catalina.util.SessionIdGeneratorBase (implements org.apache.catalina.SessionIdGenerator)

org.apache.catalina.util.StandardSessionIdGenerator

org.apache.catalina.util.ManifestResource

org.apache.catalina.util.RequestUtil

org.apache.catalina.util.ServerInfo

org.apache.catalina.util.SessionConfig

org.apache.catalina.util.Strftime

org.apache.catalina.util.TomcatCSS

org.apache.catalina.util.URLEncoder

org.apache.catalina.util.XMLWriter

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Apache Tomcat 9.0.0.M11

Prev

Next

Frames

No Frames

All Classes

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.


text:
<!DOCTYPE html>
<html>
  <!--
    Copyright 2009 Google Inc. All Rights Reserved.

    Use of this source code is governed by an Apache 2.0 License.
    See the COPYING file for details.
  -->

  <!--
  Unit tests for overalldirectionalitydetector.js.
  -->
  <head>
    <title>bidichecker - Javascript Unit Tests</title>
    <script type="text/javascript" src="../third_party/closure-library/closure/goog/base.js">
    </script>

    <!-- Include the generated deps.js which enables goog.require of
         the modules under test.
    -->
    <script type="text/javascript" src="deps.js"></script>
    <script type="text/javascript">
// This in turn pulls in the rest of the files.
goog.require('bidichecker');

goog.require('goog.testing.jsunit');
    </script>
    <script type="text/javascript" src="testutils.js"></script>

  </head>
  <body>
    <script type="text/javascript">

/**
 * Runs the overall directionality detector on the contents of a DOM element.
 * @param {!Element} rootElement The root element of the DOM to be checked.
 * @param {boolean} shouldBeRtl Is the root expected to be right-to-left?
 * @return {!Array.<!bidichecker.Error>} List of error messages.
 */
function runOverallDirectionalityDetector(rootElement, shouldBeRtl) {
  var errorCollector =
      new bidichecker.ErrorCollector(new bidichecker.FrameStack());

  var scanner = new bidichecker.Scanner();
  // Override the buildDetectors method to build only one detector.
  scanner.buildDetectors = function(element, shouldBeRtl) {
    return [new bidichecker.OverallDirectionalityDetector(shouldBeRtl,
                                                          errorCollector)];
  };

  scanner.scan(rootElement, shouldBeRtl);
  return errorCollector.getErrors();
}

function testOverallDirectionalityDetector_DirectionalityIsLtrSucceeds() {
  var testDiv = goog.dom.createDom('div', {'id': 'test'});
  goog.dom.appendChild(document.body, testDiv);
  var errors = runOverallDirectionalityDetector(testDiv, false);
  assertErrorFields([], errors);
}

function testOverallDirectionalityDetector_DirectionalityIsRtlSucceeds() {
  var testDiv = goog.dom.createDom('div', {'id': 'test', 'dir': 'rtl'});
  goog.dom.appendChild(document.body, testDiv);
  var errors = runOverallDirectionalityDetector(testDiv, true);
  assertErrorFields([], errors);
}

function testOverallDirectionalityDetector_DirectionalityIsLtrError() {
  var testDiv = goog.dom.createDom('div', {'id': 'test'});
  goog.dom.appendChild(document.body, testDiv);
  var errors = runOverallDirectionalityDetector(testDiv, true);
  var expected = [{'type': 'Overall directionality not RTL',
                   'severity': 1}];
  assertErrorFields(expected, errors);

  // The highlightable element is the root node of the DOM.
  var highlightableArea = new bidichecker.HighlightableElement(testDiv);
  assertObjectEquals(highlightableArea, errors[0].getHighlightableArea());
}

function testOverallDirectionalityDetector_DirectionalityIsRtlError() {
  var testDiv = goog.dom.createDom('div', {'id': 'test', 'dir': 'rtl'});
  goog.dom.appendChild(document.body, testDiv);
  var errors = runOverallDirectionalityDetector(testDiv, false);
  var expected = [{'type': 'Overall directionality not LTR',
                   'severity': 1}];
  assertErrorFields(expected, errors);
}

    </script>

  </body>
</html>


text:
[![Build Status](https://travis-ci.org/stefanbirkner/fishbowl.svg?branch=master)](https://travis-ci.org/stefanbirkner/fishbowl)

Fishbowl provides helper methods for dealing with exceptions.

Fishbowl is published under the
[MIT license](http://opensource.org/licenses/MIT).

## Installation

Fishbowl is available from [Maven Central](http://search.maven.org/).

    <dependency>
      <groupId>com.github.stefanbirkner</groupId>
      <artifactId>fishbowl</artifactId>
      <version>1.4.1</version>
    </dependency>

Please don't forget to add the scope `test` if you use Fishbowl for
tests only.

## Usage

Fishbowl's documentation is stored in the `gh-pages` branch and is
available online at
http://stefanbirkner.github.io/fishbowl/index.html

## Contributing

You have three options if you have a feature request, found a bug or
simply have a question about Fishbowl.

* [Write an issue.](https://github.com/stefanbirkner/fishbowl/issues/new)
* Create a pull request. (See [Understanding the GitHub Flow](https://guides.github.com/introduction/flow/index.html))
* [Write an email to mail@stefan-birkner.de](mailto:mail@stefan-birkner.de)

## Development Guide

Fishbowl is build with [Maven](http://maven.apache.org/). If you want to
contribute code than

* Please write a test for your change.
* Ensure that you didn't break the build by running `./mvnw test`.
* Fork the repo and create a pull request. (See [Understanding the GitHub Flow](https://guides.github.com/introduction/flow/index.html))

The basic coding style is described in the
[EditorConfig](http://editorconfig.org/) file `.editorconfig`.

Fishbowl supports [Travis CI](https://travis-ci.org/) for continuous
integration. Your pull request will be automatically build by Travis
CI.

## Release Guide

* Select a new version according to the
  [Semantic Versioning 2.0.0 Standard](http://semver.org/).
* Set the new version in `pom.xml` and in the `Installation` section of
  this readme.
* Commit the modified `pom.xml` and `README.md`.
* Run `./mvnw clean deploy` with JDK 6 or 7.
* Add a tag for the release: `git tag fishbowl-X.X.X`


text:
/**
* Module gallery.js
*
* Used to setup the theme's masonry gallery.  For some reason, requirejs
* refuses to load the depencencies automatically but they are only used here.
*/
define(['domReady', 'masonry', 'lazyload', 'lightbox'],
	function(domReady, Masonry, lazyload, lightbox) {

	// Note: Lazyload requires this function to load first.
	var loadMasonry = function() {
		var grid = document.querySelector('.masonry-container'),
			msnry = new Masonry( grid, {
				itemSelector: '.masonry-item'
			});
	};

	lightbox.option({
		'resizeDuration': 100,
		'wrapAround': true
	});

	domReady(function(){

		$("img.lazy").lazyload({
			effect: 'fadeIn',
			effectspeed: 1000,
			threshold: 200,
			load: loadMasonry
		});
	});

});


text:
using UnityEngine;
using UnityEditor;

namespace Anima2D
{
	[CanEditMultipleObjects]
	[CustomEditor(typeof(Bone2D))]
	public class Bone2DEditor : Editor
	{
		SerializedProperty m_ColorProperty;
		SerializedProperty m_AlphaProperty;
		SerializedProperty m_ChildProperty;
		SerializedProperty m_ChildTransformProperty;
		SerializedProperty m_LengthProperty;
		Bone2D m_Bone;

		void OnEnable()
		{
			Tools.hidden = Tools.current == Tool.Move;

			m_Bone = target as Bone2D;

			m_ColorProperty = serializedObject.FindProperty("m_Color");
			m_AlphaProperty = m_ColorProperty.FindPropertyRelative("a");

			//DEPRECATED
			m_ChildProperty = serializedObject.FindProperty("m_Child");

			m_ChildTransformProperty = serializedObject.FindProperty("m_ChildTransform");
			m_LengthProperty = serializedObject.FindProperty("m_Length");

			UpgradeToChildTransform();
		}

		void UpgradeToChildTransform()
		{
			if(Selection.transforms.Length == 1 && !m_ChildTransformProperty.objectReferenceValue && m_ChildProperty.objectReferenceValue)
			{
				serializedObject.Update();

				Bone2D l_bone = m_ChildProperty.objectReferenceValue as Bone2D;

				if(l_bone)
				{
					m_ChildTransformProperty.objectReferenceValue = l_bone.transform;
				}

				m_ChildProperty.objectReferenceValue = null;

				serializedObject.ApplyModifiedProperties();
			}
		}

		void OnDisable()
		{
			Tools.hidden = false;
		}

		override public void OnInspectorGUI()
		{
			bool childChanged = false;

			serializedObject.Update();

			EditorGUILayout.PropertyField(m_ColorProperty);
			EditorGUILayout.Slider(m_AlphaProperty,0f,1f,new GUIContent("Alpha"));

			Transform childTransform = null;

			if(m_Bone.child)
			{
				childTransform = m_Bone.child.transform;
			}

			EditorGUI.BeginDisabledGroup(targets.Length > 1);

			EditorGUI.showMixedValue = targets.Length > 1;

			EditorGUI.BeginChangeCheck();

			Transform newChildTransform = EditorGUILayout.ObjectField(new GUIContent("Child"),childTransform,typeof(Transform),true) as Transform;

			if(EditorGUI.EndChangeCheck())
			{
				if(newChildTransform && (newChildTransform.parent != m_Bone.transform || !newChildTransform.GetComponent<Bone2D>()))
				{
					newChildTransform = null;
				}

				m_ChildTransformProperty.objectReferenceValue = newChildTransform;

				childChanged = true;
			}

			EditorGUI.EndDisabledGroup();

			EditorGUILayout.PropertyField(m_LengthProperty);

			serializedObject.ApplyModifiedProperties();

			if(childChanged)
			{
				BoneUtils.OrientToChild(m_Bone,true,"set child",false);
			}
		}

		void OnSceneGUI()
		{
			if(Tools.current == Tool.Move)
			{
				Tools.hidden = true;

				float size = HandleUtility.GetHandleSize(m_Bone.transform.position) / 5f;

				Quaternion rotation = m_Bone.transform.rotation;

				EditorGUI.BeginChangeCheck();

				Quaternion cameraRotation = Camera.current.transform.rotation;

				if(Event.current.type == EventType.Repaint)
				{
					Camera.current.transform.rotation = m_Bone.transform.rotation;
				}

#if UNITY_5_6_OR_NEWER
				Vector3 newPosition = Handles.FreeMoveHandle(m_Bone.transform.position, rotation, size, Vector3.zero, Handles.RectangleHandleCap);
#else
				Vector3 newPosition = Handles.FreeMoveHandle(m_Bone.transform.position, rotation, size, Vector3.zero, Handles.RectangleCap);
#endif

				if(Event.current.type == EventType.Repaint)
				{
					Camera.current.transform.rotation = cameraRotation;
				}

				if(EditorGUI.EndChangeCheck())
				{
					Undo.RecordObject(m_Bone.transform,"Move");

					m_Bone.transform.position = newPosition;

					BoneUtils.OrientToChild(m_Bone.parentBone,Event.current.shift,Undo.GetCurrentGroupName(),true);

					EditorUtility.SetDirty(m_Bone.transform);

					EditorUpdater.SetDirty("Move");
				}
			}else{
				Tools.hidden = false;
			}
		}
	}
}


text:
require File.dirname(__FILE__) + '/../spec_helper'

module PhotoSpecHelper
  def valid_photo_attributes
    {
        :id => 2984637736,
        :owner => "80755658@N00",
        :secret => "9e5762e027",
        :server => 3180,
        :farm => 4,
        :title => "Demolition of Hotel Rzeszów",
        :is_public => 1,
        :is_friend => 0,
        :is_family => 0
    }
  end
end

describe Flickr::Photos::Photo do

  include PhotoSpecHelper

  before :all do
    @info_xml = File.read(File.dirname(__FILE__) + "/../fixtures/flickr/photos/get_info-0.xml")
    @sizes_xml = File.read(File.dirname(__FILE__) + "/../fixtures/flickr/photos/get_sizes-0.xml")
  end

  before :each do
    @flickr = SpecHelper.flickr
    #@flickr.stub!(:request_over_http).and_return(info_xml)
    @photo = Flickr::Photos::Photo.new(@flickr, valid_photo_attributes)
  end

  describe ".description" do
    it "should return the description" do
      @flickr.should_receive(:request_over_http).and_return(@info_xml)
      @photo.description.should ==
          "The last picture from a quite old event. The demolition of the best known hotel in Rzeszów called Hotel Rzeszów."
    end
  end

  describe ".photo_size" do

    before :each do
      sizes_xml = File.read(File.dirname(__FILE__) + "/../fixtures/flickr/photos/get_sizes-0.xml")
      @flickr.stub!(:request_over_http).and_return(sizes_xml)
    end

    it "should return the appropriate Flickr::Photos::Size instance when requested by symbol" do
      @photo.photo_size(:square).class.should == Flickr::Photos::Size
      @photo.photo_size(:square).label.should == "Square"
    end

    it "should return the appropriate Flickr::Photos::Size instance when requested by string" do
      @photo.photo_size('square').class.should == Flickr::Photos::Size
      @photo.photo_size('square').label.should == "Square"
    end

    it "should return the :medium Flickr::Photos::Size instance invalidly requested" do
      @photo.photo_size(:doubleplusbig).class.should == Flickr::Photos::Size
      @photo.photo_size(:doubleplusbig).label.should == "Medium"
    end
  end

  describe ".image_url" do
    it "should return all standard sizes (thumbnail, square, small, medium and large) when requested" do
      @photo.image_url(:square).should == "http://farm4.static.flickr.com/3180/2984637736_9e5762e027_s.jpg"
      @photo.image_url(:large_square).should == "http://farm4.static.flickr.com/3180/2984637736_9e5762e027_q.jpg"
      @photo.image_url(:thumbnail).should == "http://farm4.static.flickr.com/3180/2984637736_9e5762e027_t.jpg"
      @photo.image_url(:small).should == "http://farm4.static.flickr.com/3180/2984637736_9e5762e027_m.jpg"
      @photo.image_url(:small_320).should == "http://farm4.static.flickr.com/3180/2984637736_9e5762e027_n.jpg"
      @photo.image_url(:medium).should == "http://farm4.static.flickr.com/3180/2984637736_9e5762e027.jpg"
      @photo.image_url(:medium_640).should == "http://farm4.static.flickr.com/3180/2984637736_9e5762e027_z.jpg"
      @photo.image_url(:medium_800).should == "http://farm4.static.flickr.com/3180/2984637736_9e5762e027_c.jpg"
      @photo.image_url(:large).should == "http://farm4.static.flickr.com/3180/2984637736_9e5762e027_b.jpg"
    end

    it "should return the same image even if you pass a string as an argument" do
      @photo.image_url("square").should == @photo.image_url(:square)
      @photo.image_url("large").should == @photo.image_url(:large)
    end

    it "should not call getSizes if not requested the url of the original image" do
      @flickr.should_not_receive(:request_over_http)
      @photo.image_url :square
      @photo.image_url :large_square
      @photo.image_url :thumbnail
      @photo.image_url :small
      @photo.image_url :small_320
      @photo.image_url :medium
      @photo.image_url :medium_640
      @photo.image_url :medium_800
      @photo.image_url :large
    end

    it "should call getSizes if requested the url of the original image" do
      @flickr.should_receive(:request_over_http).and_return(@sizes_xml)
      @photo.image_url :original
    end

    it "should return nil if original image url not available" do
      @flickr.should_receive(:request_over_http).and_return(@sizes_xml)
      @photo.image_url(:original).should == nil
    end
  end

  describe ".video_url" do
    it "should return nil, since it's not a video" do
      @flickr.should_receive(:request_over_http).and_return(@sizes_xml)
      @photo.video_url.should == nil
    end
  end

  describe ".location" do
    it "should return the picture location as specified in flickr.photos.geo.getLocation" do
      location_xml = File.read(File.dirname(__FILE__) + "/../fixtures/flickr/photos/geo/get_location-0.xml")
      @flickr.should_receive(:request_over_http).twice.and_return(location_xml)
      expected_loc = @flickr.photos.geo.get_location(@photo.id)
      acctual_loc = @photo.location
      # Checking by latitude and longitude is enough for us
      acctual_loc.latitude.should == expected_loc.latitude
      acctual_loc.longitude.should == expected_loc.longitude
    end

    it "should return nil if picture is not geo-tagged" do
      no_location_xml = File.read(File.dirname(__FILE__) + "/../fixtures/flickr/photos/geo/get_location-fail-2.xml")
      @flickr.should_receive(:request_over_http).and_return(no_location_xml)
      @photo.location.should be_nil
    end
  end

  describe Flickr::Photos::Photo, "but it's really a video" do

    include PhotoSpecHelper

    before :all do
      @info_xml = File.read(File.dirname(__FILE__) + "/../fixtures/flickr/videos/get_info-0.xml")
      @sizes_xml = File.read(File.dirname(__FILE__) + "/../fixtures/flickr/videos/get_sizes-0.xml")
    end

    before :each do
      @flickr = SpecHelper.flickr
      #@flickr.stub!(:request_over_http).and_return(info_xml)
      @photo = Flickr::Photos::Photo.new(@flickr, valid_photo_attributes)
    end

    describe ".video_url" do
      it "should return something sane" do
        @flickr.should_receive(:request_over_http).and_return(@sizes_xml)
        @photo.video_url.should == "http://www.flickr.com/apps/video/stewart.swf?v=63881&photo_id=2729556270&photo_secret=eee23fb14a"
      end
    end
  end
end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SocketIOClient
{
    public enum WebSocketState
    {
        None = -1,
        Connecting = 0,
        Open = 1,
        Closing = 2,
        Closed = 3,
    }
}


text:
Fully written in Python3

## Installation
### From github
Run `pip3 install https://github.com/lepelog/twitchIrcClient/archive/master.zip`

### From source
Clone the Repository, change to this directory and execute `python3 setup.py install`.

### Local installation
If you don't have root-privileges and/or want to install the package just for yourself, use the `--user`-Flag at the end of the command.

### Uninstall
To uninstall this package with pip run `pip3 uninstall twitchircclient`

## Features
- Joining/Parting multiple channels
- Reading/Sending messages
- Catching Events such as people joining/parting, roomstate changes, twitch notices etc.
- Sending/Recieving Whisper-messages
- Mocked version for testing purposes

## Usage
Import the TwitchIrcClient from twitchircclient and start the connection. Example:
```python
from twitchircclient import TwitchIrcClient

# Instantiate the client with username and oauth-token
irc = TwitchIrcClient('username','oauth:p4ssw0rd')

# Define a message-reciever-function.
# Signatures for each listener are described below
def messagelistener(username, channel, tags, message):
    print('message: '+message)

# Register the listener for recieving messages
irc.messagespreader.add(messagelistener)

# Create the connecion to the twitchIrc, logging in
# Now it starts recieving messages etc.
irc.create_connection()

# Joins the channel 'channel'
# you only recieve messages sent in a channel if you are logged in
irc.join('channel')

# Send a message to a channel
irc.sendprivmsg('channel','Kappa')

# Stop the listener from recieving messages
irc.messagespreader.remove(messagelistener)

# Send a whisper a user
irc.sendwhisper('username','OpieOP')
```

### Notes about oauth-token
Use the [Twitch-Oauth-Generator](https://twitchapps.com/tmi/) to create your oauth-token which is needed to connect to twitchIrc. **Copy the whole token**, with the `oauth:`-prefix.

### Notes about `irc_test.py`
To test the basic functionality of this library there is `irc_test.py`, but it needs a username, a oauth-token and a channel to join, which should **not** be public. This information is stored in `test-config.py`, which is not commited. If you want to run the test, copy `test-config-example.py`, rename the copy to `test-config.py` and replace the placeholders with your config.

## Reciever-functions
To recieve one of these events, write a function with the specific signature and add it to the specific `EventSpreader`, Attributes of the TwitchIrcClient-instance. Add a listener with add, as described in the example above.
All params are strings except tags, which are a dict of strings
Name of the `EventSpreader`s and their signature:

**messagespreader**: Used if a user sends a message in a channel you are joined in:
`channel, username, tags, message`

**whisperspreader**: Used if a user whispers a message directly to you:
`username, tags, message`

**joinspreader**: Used if a user joins a channel you are joined in:
`channel, username`

**partspreader**: Used if a user parts a channel you are joined in:
`channel, username`

**roomstatespreader**: Used if you join a channel or if the roomstate changes in a channel you are joined in:
`channel, tags`

**usernoticespreader**: Used if  a user (re)subscribes or raids:
`channel, tags, message`

**noticespreader**: Used if twitch sends a notification:
`channel, tags, message`

**clearchatspreader**: Used if someone got timeuted or banned:
`channel, tags, username`

**globaluserstatespreader**: Used if you create the connection, informs about your global config:
`tags`

**userstatespreader**: Used if you join a channel, informs about your state in the channel:
`channel, tags`

**hostspreader**: Used if the joined channel starts/stops hosting another channel:
`channel`, `target`, `viewers`

**gainoperatorspreader**: Used if a mod joins a channel:
`channel, username`

**looseoperatorspreader**: Used if a mod leaves a channel:
`channel, username`

**nameslistspreader**: Used when twitch sends all users (list `names`) in the channel after joining:
`channel, names`

See [Twtich IRC documentation](https://github.com/justintv/Twitch-API/blob/master/IRC.md) for more information. For the subgifts (since twitchs is too lazy to document that), there are some other tags in the USERNOTICE event:
'display-name' and 'login' are from the person that gifted the sub, 'msg-id': 'subgift', 'msg-param-recipient-display-name', 'msg-param-recipient-id', 'msg-param-recipient-user-name' are the values for the person that got the sub gifted.

# MockIrcClient
```python
from twitchircclient import MockIrcClient
```
Has all functions of the real ircClient but doesn't connect to twitch at all, for testing purposes, example:

```python
irc = MockIrcClient('test', None, debug=True)

def reciever(msg):
    assert msg=='JOIN #me'
#Set a reciever to handle outgoing messages
irc.set_send_reciever(reciever)

irc.join('me')

#Send a message from 'twitch'
irc.mock_msg_incomming(irc.generate_mock_privmsg('channel','usenname','message',{'tag':'tg','sdf':'sdf'}))

#Send a whisper from 'twitch'
irc.mock_msg_incomming(irc.generate_mock_whisper('usenname','message',{'tag':'tg','sdf':'sdf'}))
```


text:
package org.antlr.v4.test.runtime;

import org.antlr.v4.Tool;
import org.antlr.v4.runtime.misc.Pair;
import org.antlr.v4.runtime.misc.Utils;
import org.antlr.v4.test.runtime.java.BaseJavaTest;
import org.antlr.v4.tool.ANTLRMessage;
import org.antlr.v4.tool.DefaultToolListener;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestRule;
import org.junit.rules.TestWatcher;
import org.junit.runner.Description;
import org.stringtemplate.v4.ST;
import org.stringtemplate.v4.STGroup;
import org.stringtemplate.v4.STGroupFile;
import org.stringtemplate.v4.StringRenderer;

import java.io.File;
import java.io.IOException;
import java.lang.reflect.Modifier;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import static junit.framework.TestCase.assertEquals;
import static org.junit.Assume.assumeFalse;

/** This class represents a single runtime test. It pulls data from
 *  a {@link RuntimeTestDescriptor} and uses junit to trigger a test.
 *  The only functionality needed to execute a test is defined in
 *  {@link RuntimeTestSupport}. All of the various test rig classes
 *  derived from this one. E.g., see {@link org.antlr.v4.test.runtime.java.TestParserExec}.
 *
 *  @since 4.6.
 */
public abstract class BaseRuntimeTest {
	public final static String[] Targets = {
		"Cpp",
		"Java",
		"Go",
		"CSharp",
		"Python2", "Python3",
		"Node", "Safari", "Firefox", "Explorer", "Chrome"
	};
	public final static String[] JavaScriptTargets = {
		"Node", "Safari", "Firefox", "Explorer", "Chrome"
	};

	static {
		// Add heartbeat thread to gen minimal output for travis, appveyor to
		// avoid timeout.
		Thread t = new Thread("heartbeat") {
			@Override
			public void run() {
				while (true) {
					System.out.print('.');
					try {
						Thread.sleep(5000);
					}
					catch (Exception e) {
						e.printStackTrace();
					}
				}
			}
		};
		t.start();
	}

	/** ANTLR isn't thread-safe to process grammars so we use a global lock for testing */
	public static final Object antlrLock = new Object();

	protected RuntimeTestSupport delegate;
	protected RuntimeTestDescriptor descriptor;

	public BaseRuntimeTest(RuntimeTestDescriptor descriptor, RuntimeTestSupport delegate) {
		this.descriptor = descriptor;
		this.delegate = delegate;
	}

	public static void mkdir(String dir) {
		File f = new File(dir);
		f.mkdirs();
	}

	@Before
	public void setUp() throws Exception {
		// From http://junit.sourceforge.net/javadoc/org/junit/Assume.html
		// "The default JUnit runner treats tests with failing assumptions as ignored"
		assumeFalse(descriptor.ignore(descriptor.getTarget()));
		delegate.testSetUp();
	}

	@Rule
	public final TestRule testWatcher = new TestWatcher() {
		@Override
		protected void succeeded(Description description) {
			// remove tmpdir if no error.
			delegate.eraseTempDir();
		}
	};

	@Test
	public void testOne() throws Exception {
		// System.out.println(delegate.getTmpDir());
		if ( descriptor.ignore(descriptor.getTarget()) ) {
			System.out.printf("Ignore "+descriptor);
			return;
		}
		if ( descriptor.getTestType().contains("Parser") ) {
			testParser(descriptor);
		}
		else {
			testLexer(descriptor);
		}
	}

	public void testParser(RuntimeTestDescriptor descriptor) throws Exception {
		mkdir(delegate.getTmpDir());

		Pair<String, String> pair = descriptor.getGrammar();

		ClassLoader cloader = getClass().getClassLoader();
		URL templates = cloader.getResource("org/antlr/v4/test/runtime/templates/"+descriptor.getTarget()+".test.stg");
		STGroupFile targetTemplates = new STGroupFile(templates, "UTF-8", '<', '>');
		targetTemplates.registerRenderer(String.class, new StringRenderer());

		// write out any slave grammars
		List<Pair<String, String>> slaveGrammars = descriptor.getSlaveGrammars();
		if ( slaveGrammars!=null ) {
			for (Pair<String, String> spair : slaveGrammars) {
				STGroup g = new STGroup('<', '>');
				g.registerRenderer(String.class, new StringRenderer());
				g.importTemplates(targetTemplates);
				ST grammarST = new ST(g, spair.b);
				writeFile(delegate.getTmpDir(), spair.a+".g4", grammarST.render());
			}
		}

		String grammarName = pair.a;
		String grammar = pair.b;
		STGroup g = new STGroup('<', '>');
		g.importTemplates(targetTemplates);
		g.registerRenderer(String.class, new StringRenderer());
		ST grammarST = new ST(g, grammar);
		grammar = grammarST.render();

		String found = delegate.execParser(grammarName+".g4", grammar,
		                                   grammarName+"Parser",
		                                   grammarName+"Lexer",
		                                   grammarName+"Listener",
		                                   grammarName+"Visitor",
		                                   descriptor.getStartRule(),
		                                   descriptor.getInput(),
		                                   descriptor.showDiagnosticErrors()
		                                  );
		if ( delegate instanceof SpecialRuntimeTestAssert ) {
			((SpecialRuntimeTestAssert)delegate).assertEqualStrings(descriptor.getErrors(), delegate.getParseErrors());
			((SpecialRuntimeTestAssert)delegate).assertEqualStrings(descriptor.getOutput(), found);
		}
		else {
			assertEquals(descriptor.getErrors(), delegate.getParseErrors());
			assertEquals(descriptor.getOutput(), found);
		}
	}

	public void testLexer(RuntimeTestDescriptor descriptor) throws Exception {
		mkdir(delegate.getTmpDir());

		Pair<String, String> pair = descriptor.getGrammar();

		ClassLoader cloader = getClass().getClassLoader();
		URL templates = cloader.getResource("org/antlr/v4/test/runtime/templates/"+descriptor.getTarget()+".test.stg");
		STGroupFile targetTemplates = new STGroupFile(templates, "UTF-8", '<', '>');
		targetTemplates.registerRenderer(String.class, new StringRenderer());

		// write out any slave grammars
		List<Pair<String, String>> slaveGrammars = descriptor.getSlaveGrammars();
		if ( slaveGrammars!=null ) {
			for (Pair<String, String> spair : slaveGrammars) {
				STGroup g = new STGroup('<', '>');
				g.registerRenderer(String.class, new StringRenderer());
				g.importTemplates(targetTemplates);
				ST grammarST = new ST(g, spair.b);
				writeFile(delegate.getTmpDir(), spair.a+".g4", grammarST.render());
			}
		}

		String grammarName = pair.a;
		String grammar = pair.b;
		STGroup g = new STGroup('<', '>');
		g.registerRenderer(String.class, new StringRenderer());
		g.importTemplates(targetTemplates);
		ST grammarST = new ST(g, grammar);
		grammar = grammarST.render();

		String found = delegate.execLexer(grammarName+".g4", grammar, grammarName, descriptor.getInput(), descriptor.showDFA());
		if ( delegate instanceof SpecialRuntimeTestAssert ) {
			((SpecialRuntimeTestAssert)delegate).assertEqualStrings(descriptor.getOutput(), found);
			((SpecialRuntimeTestAssert)delegate).assertEqualStrings(descriptor.getANTLRToolErrors(), delegate.getANTLRToolErrors());
			((SpecialRuntimeTestAssert)delegate).assertEqualStrings(descriptor.getErrors(), delegate.getParseErrors());
		}
		else {
			assertEquals(descriptor.getOutput(), found);
			assertEquals(descriptor.getANTLRToolErrors(), delegate.getANTLRToolErrors());
			assertEquals(descriptor.getErrors(), delegate.getParseErrors());
		}
	}

	/** Write a grammar to tmpdir and run antlr */
	public static ErrorQueue antlrOnString(String workdir,
	                                       String targetName,
	                                       String grammarFileName,
	                                       String grammarStr,
	                                       boolean defaultListener,
	                                       String... extraOptions)
	{
		mkdir(workdir);
		BaseJavaTest.writeFile(workdir, grammarFileName, grammarStr);
		return antlrOnString(workdir, targetName, grammarFileName, defaultListener, extraOptions);
	}

	/** Run ANTLR on stuff in workdir and error queue back */
	public static ErrorQueue antlrOnString(String workdir,
	                                       String targetName,
	                                       String grammarFileName,
	                                       boolean defaultListener,
	                                       String... extraOptions)
	{
		final List<String> options = new ArrayList<>();
		Collections.addAll(options, extraOptions);
		if ( targetName!=null ) {
			options.add("-Dlanguage="+targetName);
		}
		if ( !options.contains("-o") ) {
			options.add("-o");
			options.add(workdir);
		}
		if ( !options.contains("-lib") ) {
			options.add("-lib");
			options.add(workdir);
		}
		if ( !options.contains("-encoding") ) {
			options.add("-encoding");
			options.add("UTF-8");
		}
		options.add(new File(workdir,grammarFileName).toString());

		final String[] optionsA = new String[options.size()];
		options.toArray(optionsA);
		Tool antlr = new Tool(optionsA);
		ErrorQueue equeue = new ErrorQueue(antlr);
		antlr.addListener(equeue);
		if (defaultListener) {
			antlr.addListener(new DefaultToolListener(antlr));
		}
		synchronized (antlrLock) {
			antlr.processGrammarsOnCommandLine();
		}

		List<String> errors = new ArrayList<>();

		if ( !defaultListener && !equeue.errors.isEmpty() ) {
			for (int i = 0; i < equeue.errors.size(); i++) {
				ANTLRMessage msg = equeue.errors.get(i);
				ST msgST = antlr.errMgr.getMessageTemplate(msg);
				errors.add(msgST.render());
			}
		}
		if ( !defaultListener && !equeue.warnings.isEmpty() ) {
			for (int i = 0; i < equeue.warnings.size(); i++) {
				ANTLRMessage msg = equeue.warnings.get(i);
				// antlrToolErrors.append(msg); warnings are hushed
			}
		}

		return equeue;
	}

	// ---- support ----

	public static RuntimeTestDescriptor[] getRuntimeTestDescriptors(Class<?> clazz, String targetName) {
		Class<?>[] nestedClasses = clazz.getClasses();
		List<RuntimeTestDescriptor> descriptors = new ArrayList<RuntimeTestDescriptor>();
		for (Class<?> nestedClass : nestedClasses) {
			int modifiers = nestedClass.getModifiers();
			if ( RuntimeTestDescriptor.class.isAssignableFrom(nestedClass) && !Modifier.isAbstract(modifiers) ) {
				try {
					RuntimeTestDescriptor d = (RuntimeTestDescriptor) nestedClass.newInstance();
					d.setTarget(targetName);
					descriptors.add(d);
				} catch (Exception e) {
					e.printStackTrace(System.err);
				}
			}
		}
		return descriptors.toArray(new RuntimeTestDescriptor[0]);
	}

	public static void writeFile(String dir, String fileName, String content) {
		try {
			Utils.writeFile(dir+"/"+fileName, content, "UTF-8");
		}
		catch (IOException ioe) {
			System.err.println("can't write file");
			ioe.printStackTrace(System.err);
		}
	}
}


text:
title: policies
category: sla
authors: doron, lhornyak
wiki_category: SLA
wiki_title: Sla/policies
wiki_revision_count: 10
wiki_last_updated: 2012-12-04
---

# SLA: policies

## Summary

This page will hold the major policies oVirt would like to support.

In general, policy spectrum ranges from overcommitment (high-utilization) to high QoS.
So we'd like to begin with 3 policies expressing the range.

![](Policies-Doron.jpg "Policies-Doron.jpg")

## Aggressive Policy

*   Definition
*   Implementation considerations
*   oVirt modules
    -   UI / REST
    -   Engine
    -   VDSM
    -   MoM
*   Detailed design: [Sla/policies/aggressive](Sla/policies/aggressive)

## Default / Naive Policy

*   Definition
*   Implementation considerations
*   oVirt modules
    -   UI / REST
    -   Engine
    -   VDSM
    -   MoM
*   Detailed design: [Sla/policies/default](Sla/policies/default)

## High QoS Policy

*   Definition
*   Implementation considerations
*   oVirt modules
    -   UI / REST
    -   Engine
    -   VDSM
    -   MoM
*   Detailed design: [Sla/policies/qos](Sla/policies/qos)


text:
describe "Hash#clone" do
  it "copies instance variable but not the objects they refer to" do
    hash = {'key' => 'value'}

    clone = hash.clone

    clone.should == hash
    clone.object_id.should_not == hash.object_id
  end
end


text:
package test.dependent;

import org.testng.Assert;
import org.testng.annotations.Test;

/**
 * This class exercises dependent groups
 *
 * @author Cedric Beust, Aug 19, 2004
 */
public class SampleDependent1 {

  @Test(groups = {"fail"})
  public void fail() {
    Assert.assertTrue(false);
  }

  @Test(dependsOnGroups = {"fail"})
  public void shouldBeSkipped() {}
}


text:
package org.nwapw.abacus.fx;

import javafx.scene.control.Label;
import javafx.scene.control.ListCell;
import javafx.scene.control.TitledPane;
import javafx.scene.layout.VBox;
import org.nwapw.abacus.function.Documentation;

public class DocumentationCell extends ListCell<Documentation> {

    private Label codeNameLabel;
    private Label nameLabel;
    private Label description;
    private Label longDescription;
    private TitledPane titledPane;

    public DocumentationCell() {
        VBox vbox = new VBox();
        vbox.setSpacing(10);
        titledPane = new TitledPane();
        codeNameLabel = new Label();
        nameLabel = new Label();
        description = new Label();
        longDescription = new Label();
        codeNameLabel.setWrapText(true);
        nameLabel.setWrapText(true);
        description.setWrapText(true);
        longDescription.setWrapText(true);
        vbox.getChildren().add(codeNameLabel);
        vbox.getChildren().add(nameLabel);
        vbox.getChildren().add(description);
        vbox.getChildren().add(longDescription);
        titledPane.textProperty().bindBidirectional(codeNameLabel.textProperty());
        titledPane.setContent(vbox);
        titledPane.setExpanded(false);
        titledPane.prefWidthProperty().bind(widthProperty().subtract(32));

        visibleProperty().addListener((a, b, c) -> titledPane.setExpanded(false));
    }

    @Override
    protected void updateItem(Documentation item, boolean empty) {
        super.updateItem(item, empty);
        if (empty) {
            codeNameLabel.setText("");
            nameLabel.setText("");
            description.setText("");
            longDescription.setText("");
            setGraphic(null);
        } else {
            codeNameLabel.setText(item.getCodeName());
            nameLabel.setText(item.getName());
            description.setText(item.getDescription());
            longDescription.setText(item.getLongDescription());
            setGraphic(titledPane);
        }
        titledPane.setExpanded(false);
    }
}


text:
package org.ujorm.orm;

import java.util.List;
import org.ujorm.orm.metaModel.MetaTable;

/**
 * Wrapper for a MetaTable
 * @author Pavel Ponec
 */
public interface TableWrapper {

    /** Returns a meta-table model */
    public MetaTable getModel();

    /** Returns a unique table name in the one SQL statement. */
    public String getAlias();

    /** Is the instance a database relation model? */
    public boolean isView();

    /** Get all table columns */
    public List<? extends ColumnWrapper> getColumns();
}