text:
/
    unsigned int tv_usec; /* and microseconds */
};

#ifndef IWPLATFORM_EXPORT
#define IWPLATFORM_EXPORT
#endif

enum EbrFileType { EbrFileTypeUnknown, EbrFileTypeIO, EbrFileTypeSocket, EbrFileTypeVirtual, EbrFileTypeZipAsset };

//  Note: IWPLATFORM_EXPORT should not be required on member functions but clang does not yet support exporting
//  full classes
class EbrFile {
public:
    int idx;
    EbrFileType type;

    IWPLATFORM_EXPORT EbrFile();
    IWPLATFORM_EXPORT virtual ~EbrFile();

    IWPLATFORM_EXPORT virtual int Close();
    IWPLATFORM_EXPORT virtual size_t Read(void* dest, size_t elem, size_t count);
    IWPLATFORM_EXPORT virtual size_t Write(void* dest, size_t elem, size_t count);
    IWPLATFORM_EXPORT virtual int Seek(long offset, int origin);
    IWPLATFORM_EXPORT virtual size_t Tell();
    IWPLATFORM_EXPORT virtual int Eof();
    IWPLATFORM_EXPORT virtual int Putc(int c);
    IWPLATFORM_EXPORT virtual int Rewind();
    IWPLATFORM_EXPORT virtual int Error();
    IWPLATFORM_EXPORT virtual int Getc();
    IWPLATFORM_EXPORT virtual int Ungetc(int val);
    IWPLATFORM_EXPORT virtual char* Gets(char* dest, size_t size);
    IWPLATFORM_EXPORT virtual int Puts(const char* str);
    IWPLATFORM_EXPORT virtual void Clearerr();
    IWPLATFORM_EXPORT virtual int Flush();
    IWPLATFORM_EXPORT virtual int Setpos(__int64* pos);
    IWPLATFORM_EXPORT virtual int Getpos(__int64* pos);

    IWPLATFORM_EXPORT virtual int HostFd();
    IWPLATFORM_EXPORT virtual int Stat(struct stat* ret);
    IWPLATFORM_EXPORT virtual int Read(void* dest, size_t count);
    IWPLATFORM_EXPORT virtual int Write(const void* src, size_t count);
    IWPLATFORM_EXPORT virtual int Lseek(off_t pos, int whence);
    IWPLATFORM_EXPORT virtual int Truncate(off_t size);
    IWPLATFORM_EXPORT virtual int Dup();

    IWPLATFORM_EXPORT virtual void* Mmap(void* addr, size_t size, uint32_t prot, uint32_t flags, uint32_t offset);
    IWPLATFORM_EXPORT virtual int Munmap(void* addr, size_t size);
};

IWPLATFORM_EXPORT EbrFile* EbrAllocFile(EbrFile* ioInterface);
IWPLATFORM_EXPORT void EbrFreeFile(EbrFile* pFile);
IWPLATFORM_EXPORT EbrFile* EbrFileFromFd(int fd);
IWPLATFORM_EXPORT EbrFileType EbrFileGetType(EbrFile* pFile);

struct stat;

IWPLATFORM_EXPORT EbrFile* EbrFmake(FILE* fp);
IWPLATFORM_EXPORT EbrFile* EbrFopen(const char* filename, const char* mode);
IWPLATFORM_EXPORT EbrFile* EbrFdopen(int handle, const char* mode);
IWPLATFORM_EXPORT int EbrFclose(EbrFile* file);
IWPLATFORM_EXPORT size_t EbrFread(void* dest, size_t elem, size_t count, EbrFile* file);
IWPLATFORM_EXPORT size_t EbrFwrite(void* dest, size_t elem, size_t count, EbrFile* file);
IWPLATFORM_EXPORT int EbrFseek(EbrFile* fp, long offset, int origin);
IWPLATFORM_EXPORT size_t EbrFtell(EbrFile* fp);
IWPLATFORM_EXPORT int EbrFeof(EbrFile* fp);
IWPLATFORM_EXPORT int EbrStat(const char* filename, struct stat* ret);
IWPLATFORM_EXPORT int EbrFputc(int c, EbrFile* fp);
IWPLATFORM_EXPORT int EbrAccess(const char* file, int mode);
IWPLATFORM_EXPORT int EbrRewind(EbrFile* fp);
IWPLATFORM_EXPORT int EbrFerror(EbrFile* fp);
IWPLATFORM_EXPORT int EbrFgetc(EbrFile* fp);
IWPLATFORM_EXPORT int EbrUngetc(int val, EbrFile* fp);
IWPLATFORM_EXPORT char* EbrFgets(char* dest, size_t size, EbrFile* fp);
IWPLATFORM_EXPORT int EbrFputs(const char* str, EbrFile* fp);
IWPLATFORM_EXPORT int EbrFileno(EbrFile* fp);
IWPLATFORM_EXPORT FILE* EbrNativeFILE(EbrFile* fp);
IWPLATFORM_EXPORT void EbrClearerr(EbrFile* fp);
IWPLATFORM_EXPORT EbrFile* EbrFreopen(const char* filename, const char* mode, EbrFile* cur);
IWPLATFORM_EXPORT int EbrFflush(EbrFile* fp);
IWPLATFORM_EXPORT int EbrFsetpos(EbrFile* fp, __int64* pos);
IWPLATFORM_EXPORT int EbrFgetpos(EbrFile* fp, __int64* pos);

IWPLATFORM_EXPORT int EbrOpen(const char* file, int mode, int share);
IWPLATFORM_EXPORT int EbrClose(int fd);
IWPLATFORM_EXPORT int EbrFd2Host(int fd);
IWPLATFORM_EXPORT void* EbrFdGetPtr(int fd);
IWPLATFORM_EXPORT int EbrFstat(int fd, struct stat* ret);
IWPLATFORM_EXPORT int EbrRead(int fd, void* dest, size_t count);
IWPLATFORM_EXPORT int EbrWrite(int fd, const void* src, size_t count);
IWPLATFORM_EXPORT int EbrLseek(int fd, off_t pos, int whence);
IWPLATFORM_EXPORT int EbrTruncate(int fd, off_t size);
IWPLATFORM_EXPORT int EbrDup(int fd);

#define EBR_PAGE_READ 0x01
#define EBR_PAGE_WRITE 0x02
#define EBR_PAGE_EXECUTE 0x04

IWPLATFORM_EXPORT void* EbrMmap(void* addr, size_t size, uint32_t prot, uint32_t flags, int fd, uint32_t offset);
IWPLATFORM_EXPORT int EbrMunmap(void* addr, size_t size);

IWPLATFORM_EXPORT bool EbrRename(const char* path1, const char* path2);
IWPLATFORM_EXPORT bool EbrUnlink(const char* path);
IWPLATFORM_EXPORT bool EbrMkdir(const char* path);

IWPLATFORM_EXPORT char* EbrGetcwd(char* buf, size_t len);
IWPLATFORM_EXPORT int EbrChdir(const char* path);

// Remove an item at this path, be it a file or directory:
IWPLATFORM_EXPORT bool EbrRemove(const char* path);
IWPLATFORM_EXPORT bool EbrRemoveEmptyDir(const char* path);

struct _EbrDirEnt {
    char fileName[4096];
    bool isDir;
};

typedef struct _EbrDirEnt EbrDirEnt;

struct EbrDir;

class EbrDirReader {
public:
    virtual bool readNext(EbrDir* curDir, EbrDirEnt* end) = 0;
    virtual ~EbrDirReader() {
    }
};

IWPLATFORM_EXPORT bool EbrIsDir(const char* path);
IWPLATFORM_EXPORT EbrDir* EbrOpenDir(const char* path);
IWPLATFORM_EXPORT bool EbrReadDir(EbrDir* pDir, EbrDirEnt* ent);
IWPLATFORM_EXPORT void EbrCloseDir(EbrDir* pDir);

struct _EbrThread_t {
    uint32_t mask;
    uint32_t termRoutine;
    pthread_t tid;
    uint32_t threadID;
    uint32_t ret;
    uint32_t startAddr, startParam;
    uint32_t stackBase, stackSize;
};

typedef _EbrThread_t* EbrThread_t;

IWPLATFORM_EXPORT int EbrGetTimeOfDay(struct EbrTimeval* curtime);
IWPLATFORM_EXPORT unsigned __int64 EbrGetAbsoluteTime();
IWPLATFORM_EXPORT double EbrGetMediaTime();
IWPLATFORM_EXPORT void EbrSetAPC(int signal, void (*func)(int));
IWPLATFORM_EXPORT void EbrCallAPC(pthread_t thread, int signal, int param);
IWPLATFORM_EXPORT int EbrThreadCreateGuest(EbrThread_t* tid, const pthread_attr_t* attr, uint32_t addr, uint32_t arg);
IWPLATFORM_EXPORT EbrThread_t EbrThreadSelf();
IWPLATFORM_EXPORT void EbrThreadAssociate(EbrThread_t pInfo, uint32_t stackBase, uint32_t stackSize);
IWPLATFORM_EXPORT void EbrThreadDissociate();
IWPLATFORM_EXPORT uint32_t EbrThreadGetList(EbrThread_t* listOut);
IWPLATFORM_EXPORT void EbrPlatformInit();
IWPLATFORM_EXPORT void EbrShowKeyboard();
IWPLATFORM_EXPORT void EbrHideKeyboard();
IWPLATFORM_EXPORT void EbrSetKeyboardType(int type);
IWPLATFORM_EXPORT void EbrPlatformShowKeyboard();
IWPLATFORM_EXPORT void EbrPlatformHideKeyboard();
IWPLATFORM_EXPORT void EbrRefreshKeyboard();
IWPLATFORM_EXPORT int EbrGetWantedOrientation();
IWPLATFORM_EXPORT void EbrExitToBackground();

inline void EbrOnShowKeyboardInternal() {
}
inline void EbrOnHideKeyboardInternal() {
}

//  maxLen should be MAX_PATH.  Sorry Jordan.
IWPLATFORM_EXPORT bool EbrGetRootMapping(const char* dirName, char* dirOut, uint32_t maxLen);
IWPLATFORM_EXPORT void EbrSetWritableFolder(const char* folder);

IWPLATFORM_EXPORT void EbrPlatformCommonInit();

IWPLATFORM_EXPORT void EbrPauseSound();
IWPLATFORM_EXPORT void EbrResumeSound();

IWPLATFORM_EXPORT void EbrBlockIfBackground();
IWPLATFORM_EXPORT void EbrEnterBackground();
IWPLATFORM_EXPORT void EbrLeaveBackground();

IWPLATFORM_EXPORT void EbrSignalsSafe();
IWPLATFORM_EXPORT void EbrSignalsUnsafe();

typedef void* EbrEvent;

IWPLATFORM_EXPORT void EbrEventInit(EbrEvent* pEvent);
IWPLATFORM_EXPORT void EbrEventSignal(EbrEvent event);
IWPLATFORM_EXPORT void EbrEventWait(EbrEvent event);
IWPLATFORM_EXPORT bool EbrEventTryWait(EbrEvent event);
IWPLATFORM_EXPORT bool EbrEventTimedWait(EbrEvent event, double seconds);

IWPLATFORM_EXPORT void EbrRequestFrame();

typedef struct {
    int WakeupSocketRead, WakeupSocketWrite;
    void *fdread, *fdwrite, *fderror;
    int max, result;
} SocketWait;

IWPLATFORM_EXPORT int EbrEventTimedMultipleWait(EbrEvent* events, int numEvents, double timeout, SocketWait* sockets);
IWPLATFORM_EXPORT void EbrEventDestroy(EbrEvent event);
IWPLATFORM_EXPORT void EbrOpenURL(const char* url);
IWPLATFORM_EXPORT void EbrUUIDCreate128(void* dest);

typedef struct {
    const char* platformName;
    const char* manufacturer;
    const char* model;
    const char* deviceProductName;
    const char* serialNo;
    const char* carrier;
    const char* osVersion;
    int osVersionInt;
    int deviceResX, deviceResY;
    float devicePhysWidth, devicePhysHeight;
} EbrPlatformInfo;

IWPLATFORM_EXPORT EbrPlatformInfo* EbrGetDeviceInfo();

class TimingFunction {
public:
    double startTime;
    const char* pName;

    TimingFunction(const char* name) {
        pName = name;
        startTime = EbrGetMediaTime();
    }

    ~TimingFunction() {
        double endTime = EbrGetMediaTime();
        // printf("%s: %f ms\n", pName, (endTime - startTime) * 1000.0);
    }
};

IWPLATFORM_EXPORT void* EbrSystemMalloc(size_t sz);
IWPLATFORM_EXPORT void EbrSystemFree(void* ptr);

IWPLATFORM_EXPORT bool EbrIsBridgedClass(const char* name);
IWPLATFORM_EXPORT void EbrThrowFatal(int code, const char* errorFmt, ...);
IWPLATFORM_EXPORT void EbrThrowFatalWithTrace(int code, const char* backTrace, const char* errorFmt, ...);
IWPLATFORM_EXPORT void EbrThrowFatalWithStack(int code, const char* errorFmt, ...);

IWPLATFORM_EXPORT void EbrSetCurrentThreadName(const char* name);

IWPLATFORM_EXPORT void EbrThreadMakeBackgroundExecutable();

IWPLATFORM_EXPORT void EbrSetApplicationBadgeNumber(int number);

IWPLATFORM_EXPORT bool EbrGetRandomData(void* dest, int numBytes);

IWPLATFORM_EXPORT bool EbrUIAppStart();
#endif


text:
Given a year, report if it is a leap year.

The tricky thing here is that a leap year in the Gregorian calendar occurs:

```plain
on every year that is evenly divisible by 4
  except every year that is evenly divisible by 100
    unless the year is also evenly divisible by 400
```

For example, 1997 is not a leap year, but 1996 is.  1900 is not a leap
year, but 2000 is.

If your language provides a method in the standard library that does
this look-up, pretend it doesn't exist and implement it yourself.

## Notes

Though our exercise adopts some very simple rules, there is more to
learn!

For a delightful, four minute explanation of the whole leap year
phenomenon, go watch [this youtube video][video].

[video]: http://www.youtube.com/watch?v=xX96xng7sAE

### Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.

For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.

For more detailed information about running tests, code style and linting,
please see the [help page](http://exercism.io/languages/python).

## Source

JavaRanch Cattle Drive, exercise 3 [http://www.javaranch.com/leap.jsp](http://www.javaranch.com/leap.jsp)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

redpajama_set_name: RedPajamaGithub


text:
import * as React from "react";
import { BloomSelect, IOption } from "../../react_components/bloomSelect";

export interface IProps {
    // I don't know how to express exact types in Typescript here and it doesn't seem worth a lot of effort.
    a11yLevel: IOption;
}

const levelOptions: IOption[] = [
    {
        value: "none",
        label: "None",
        l10nKey: "BookMetadata.a11yLevelNone",
        comment:
            "indicates that no level of accessibility conformance is claimed"
    },
    {
        value: "wcag-a",
        label: "Level A conformance",
        l10nKey: "BookMetadata.a11yLevelA"
    },
    {
        value: "wcag-aa",
        label: "Level AA conformance",
        l10nKey: "BookMetadata.a11yLevelAA"
    },
    {
        value: "wcag-aaa",
        label: "Level AAA conformance",
        l10nKey: "BookMetadata.a11yLevelAAA"
    }
];

export class A11yLevelChooser extends React.Component<IProps> {
    public render() {
        return (
            <BloomSelect
                currentOption={this.props.a11yLevel}
                options={levelOptions}
                nullOption="none"
                className="a11y-level-chooser"
            />
        );
    }
}

export default A11yLevelChooser;


text:
import unittest
from flax import errors
from flax.core import Scope, scope, freeze, init, apply, nn
from flax.core.scope import LazyRng

import jax
from jax import config as jax_config
from jax import random
from jax import numpy as jnp

import numpy as np

from absl.testing import absltest

class ScopeTest(absltest.TestCase):

  def test_rng(self):
    def f(scope):
      self.assertTrue(scope.has_rng('params'))
      self.assertFalse(scope.has_rng('dropout'))
      rng = scope.make_rng('params')
      self.assertTrue(np.all(rng == LazyRng.create(random.PRNGKey(0), 1).as_jax_rng()))
    init(f)(random.PRNGKey(0))

  def test_in_filter(self):
    filter_true = lambda x, y : self.assertTrue(scope.in_filter(x, y))
    filter_false = lambda x, y : self.assertFalse(scope.in_filter(x, y))

    filter_true(True, 'any_string1')
    filter_false(False, 'any_string2')
    filter_true('exact_match', 'exact_match')
    filter_false('no_match1', 'no_match2')
    filter_true(['one', 'two'], 'one')
    filter_false(['one', 'two'], 'three')
    filter_false([], 'one')
    filter_false([], None)

  def test_union_filter(self):
    def union_check(a, b, ans):
      self.assertEqual(scope.union_filters(a, b), ans)
      self.assertEqual(scope.union_filters(b, a), ans)

    union_check(['a', 'b'], ['b', 'c'], set(['a', 'b', 'c']))
    union_check(True, False, True)
    union_check(False, False, set())
    union_check(True, True, True)
    union_check(scope.DenyList(['a', 'b']), scope.DenyList(['b', 'c']), scope.DenyList(set(['b'])))
    union_check(scope.DenyList(['a', 'b']), ['b', 'c'], scope.DenyList(set(['a'])))

  def test_intersect_filter(self):
    def intersect_check(a, b, ans):
      self.assertEqual(scope.intersect_filters(a, b), ans)
      self.assertEqual(scope.intersect_filters(b, a), ans)

    intersect_check(['a', 'b'], ['b', 'c'], set(['b']))
    intersect_check(True, False, False)
    intersect_check(False, False, set())
    intersect_check(True, True, True)
    intersect_check(scope.DenyList(['a', 'b']), scope.DenyList(['b', 'c']), scope.DenyList(set(['a', 'b', 'c'])))
    intersect_check(scope.DenyList(['a', 'b']), ['b', 'c'], set(['c']))

  def test_subtract_filter(self):
    def subtract_check(a, b, ans):
      self.assertEqual(scope.subtract_filters(a, b), ans)

    subtract_check(['a', 'b'], ['b', 'c'], set(['a']))
    subtract_check(True, False, scope.DenyList(False))
    subtract_check(False, False, set())
    subtract_check(True, True, False)
    subtract_check(True, 'a', scope.DenyList('a'))
    subtract_check(scope.DenyList(['a', 'b']), scope.DenyList(['b', 'c']), set(['c']))
    subtract_check(scope.DenyList(['a', 'b']), ['b', 'c'], scope.DenyList(set(['a', 'b', 'c'])))

  def test_group_collections(self):
    params = { 'dense1': { 'x': [10, 20] } }
    batch_stats = { 'dense1': { 'ema': 5 } }
    xs = { 'params': params, 'batch_stats': batch_stats }

    # Retrieve all keys only once.
    group = scope.group_collections(xs, ['params', 'params'])
    self.assertEqual(group, ({'params': params}, {}))

    # Ignore non-existing keys.
    self.assertEqual(scope.group_collections(xs, ['vars']), ({},))

    # False gets nothing and True retrieves all keys once.
    self.assertEqual(scope.group_collections(xs, [False, True, True]),
                                             ({}, xs, {}))

  def test_inconsistent_param_shapes(self):
    def f(scope):
      scope.param('test', nn.initializers.ones, (4,))

    msg = r'Inconsistent shapes between value and initializer for parameter "test" in "/": \(2,\), \(4,\).'
    with self.assertRaisesRegex(errors.ScopeParamShapeError, msg):
      apply(f)(freeze({'params': {'test': np.ones((2,))}}))

  def test_apply_variables_bad_pytree(self):
    def f(scope):
      scope.param('kernel', nn.initializers.ones, (4,))

    params = freeze({
        'params': {
            'kernel': np.ones((4,)),
        },
    })
    apply(f)(params)  # Valid.
    msg = 'but got a dict with an extra params layer'
    with self.assertRaisesRegex(errors.ApplyScopeInvalidVariablesStructureError,
                                msg):
      apply(f)({'params': params})

  def test_mutate_undefined_collection(self):
    def f(scope):
      scope.put_variable('state', 'test', 123)

    msg = r'Cannot update variable "test" in "/" because collection "state" is immutable.'
    with self.assertRaisesRegex(errors.ModifyScopeVariableError, msg):
      init(f, mutable='params')(random.PRNGKey(0))

  def test_undefined_param(self):
    def f(scope):
      nn.dense(scope.push('dense'), np.ones((1, 2)), 2)

    msg = r'Could not find parameter named "kernel" in scope "/dense".'
    with self.assertRaisesRegex(errors.ScopeParamNotFoundError, msg):
      apply(f)({'params': {'abc': 1}})

  def test_variable_is_mutable(self):
    def f(scope, should_be_mutable):
      test = scope.variable('state', 'test', lambda: 1)
      self.assertEqual(test.is_mutable(), should_be_mutable)

    _, variables = apply(f, mutable='state')({}, True)
    apply(f, mutable=False)(variables, False)

  def test_rngs_check_w_frozen_dict(self):
    def f(scope, x):
      return x
    _ = apply(f)(
        {}, np.array([0.]), rngs=freeze({'a':random.PRNGKey(0)}))

  @unittest.skipIf(not hasattr(jax_config, 'jax_enable_custom_prng'),
                   'custom PRNG tests require config.jax_enable_custom_prng')
  def test_rng_check_w_old_and_new_keys(self):
    old_setting = jax_config.jax_enable_custom_prng
    try:
      jax_config.update('jax_enable_custom_prng', False)
      self.assertTrue(scope._is_valid_rng(random.PRNGKey(0)))
      jax_config.update('jax_enable_custom_prng', True)
      self.assertTrue(scope._is_valid_rng(random.PRNGKey(0)))
    finally:
      jax_config.update('jax_enable_custom_prng', old_setting)

  def test_jax_leak_detector(self):
    with jax.check_tracer_leaks(True):
      def f(scope):
        def g(scope):
          pass
        scope.child(g)()
      jax.jit(init(f))(random.PRNGKey(0))

  def test_rng_counter_reuse(self):
    root = Scope({}, {'dropout': random.PRNGKey(0)})
    def f(scope):
      return scope.make_rng('dropout')
    a = root.child(f)()
    root = root.rewound()
    b = root.child(f)()
    self.assertFalse(jnp.allclose(a, b))

  def test_empty_col_error(self):
    root = Scope({})
    with self.assertRaises(errors.ScopeCollectionNotFound):
      root.param('test', nn.initializers.zeros, ())
    root = Scope({'params': {}})
    with self.assertRaises(errors.ScopeCollectionNotFound):
      root.param('test', nn.initializers.zeros, ())

    root = Scope({'params': {'abc': 1}})
    with self.assertRaises(errors.ScopeCollectionNotFound):
      root.variable('state', 'test', jnp.zeros, ())
    root = Scope({'state': {}})
    with self.assertRaises(errors.ScopeCollectionNotFound):
      root.variable('state', 'test', jnp.zeros, ())

  def test_variable_no_init(self):
    root = Scope({}, mutable='state')
    with self.assertRaises(errors.ScopeCollectionNotFound):
      root.variable('state', 'test')
    root = Scope({'state': {'abc': 1}}, mutable='state')
    abc = root.variable('state', 'abc')
    self.assertEqual(abc.value, 1)
    with self.assertRaises(errors.ScopeVariableNotFoundError):
      root.variable('state', 'test')

  def test_variable_alias(self):
    scope = Scope({}, mutable='state')
    subscope = scope.push(name="a")
    subscope.put_variable('state', 'x', 0.)
    scope.put_variable('state', 'a', {'x': jnp.array(1., jnp.float32)})
    self.assertEqual(scope.variables()['state']['a']['x'], subscope.variables()['state']['x'])

if __name__ == '__main__':
  absltest.main()


text: /usr/sbin/secstate audit -o audit password-req


text:
'use strict';

// External libs.
var path = require('path');

(function(exports) {
  exports.www_vendors_path = path.resolve(__dirname+"/../shared/")+"/";

}(typeof exports === 'object' && exports || this));


text:
<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Sales
 *
 * @author Theophilus Alamu <theophilus.alamu at gmail.com>
 */
namespace Multiple\Backend\Models;

class Sales extends BaseModel{
    //put your code here
}


text:
/* eslint func-names: 0 */
var webpack = require('webpack');
var path = require('path');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var StatsPlugin = require('stats-webpack-plugin');
var loadersByExtension = require('loaders-by-extension');
var webpackTargetElectronRenderer = require('webpack-target-electron-renderer');
var projectRoot = path.join(__dirname, '..');
var appRoot = path.join(projectRoot, 'app');

module.exports = function(opts) {
  var entry = {
    main: opts.prerender ? path.join(appRoot, 'main-app') : path.join(appRoot, 'main-app')
  };

  var loaders = {
    'jsx': opts.hotComponents ? [ 'react-hot-loader', 'babel-loader' ] : 'babel-loader',
    'js': {
      loader: 'babel-loader',
      include: appRoot
    },
    'json': 'json-loader',
    'txt': 'raw-loader',
    'png|jpg|jpeg|gif|svg': 'url-loader?limit=10000',
    'woff|woff2': 'url-loader?limit=100000',
    'ttf|eot': 'file-loader',
    'wav|mp3': 'file-loader',
    'html': 'html-loader',
    'md|markdown': [ 'html-loader', 'markdown-loader' ]
  };

  var cssLoader = opts.minimize ? 'css-loader' : 'css-loader?localIdentName=[path][name]---[local]---[hash:base64:5]';

  var stylesheetLoaders = {
    'css': cssLoader,
    'less': [ cssLoader, 'less-loader' ],
    'styl': [ cssLoader, 'stylus-loader' ],
    'scss|sass': [ cssLoader, 'sass-loader' ]
  };

  var additionalLoaders = [
    // { test: /some-reg-exp$/, loader: 'any-loader' }
  ];

  var alias = {
    "React": "react"
  };

  var aliasLoader = {

  };

  var externals = [

  ];

  var modulesDirectories = [ 'node_modules' ];

  var extensions = [ '', '.js', '.jsx', '.json', '.node' ];

  var publicPath = opts.devServer
                 ? 'http://localhost:2992/dist/'
                 : '/dist/';

  var output = {
    path: projectRoot + '/dist/',
    filename: 'bundle.js',
    publicPath: publicPath,
    contentBase: projectRoot + '/public/',
    libraryTarget: 'commonjs2'
  };

  var excludeFromStats = [
    /node_modules[\\\/]react(-router)?[\\\/]/
  ];

  var plugins = [
    new webpack.PrefetchPlugin('react'),
    new webpack.PrefetchPlugin('arda'),
    new webpack.PrefetchPlugin('react/lib/ReactComponentBrowserEnvironment')
  ];

  if (opts.prerender) {
    plugins.push(new StatsPlugin(path.join(projectRoot, 'dist', 'stats.prerender.json'), {
      chunkModules: true,
      exclude: excludeFromStats
    }));
    aliasLoader['react-proxy$'] = 'react-proxy/unavailable';
    aliasLoader['react-proxy-loader$'] = 'react-proxy-loader/unavailable';
    externals.push(
      /^react(\/.*)?$/,
      /^reflux(\/.*)?$/,
      'arda',
      'superagent',
      'async'
    );
    plugins.push(new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1 }));
  } else {
    plugins.push(new StatsPlugin(path.join(projectRoot, 'dist', 'stats.json'), {
      chunkModules: true,
      exclude: excludeFromStats
    }));
  }

  if (opts.commonsChunk) {
    plugins.push(new webpack.optimize.CommonsChunkPlugin('commons', 'commons.js' + (opts.longTermCaching && !opts.prerender ? '?[chunkhash]' : '')));
  }

  var asyncLoader = {
    test: [],
    loader: opts.prerender ? 'react-proxy-loader/unavailable' : 'react-proxy-loader'
  };

  Object.keys(stylesheetLoaders).forEach(function(ext) {
    var stylesheetLoader = stylesheetLoaders[ext];
    if (Array.isArray(stylesheetLoader)) stylesheetLoader = stylesheetLoader.join('!');
    if (opts.prerender) {
      stylesheetLoaders[ext] = stylesheetLoader.replace(/^css-loader/, 'css-loader/locals');
    } else if (opts.separateStylesheet) {
      stylesheetLoaders[ext] = ExtractTextPlugin.extract('style-loader', stylesheetLoader);
    } else {
      stylesheetLoaders[ext] = 'style-loader!' + stylesheetLoader;
    }
  });

  if (opts.separateStylesheet && !opts.prerender) {
    plugins.push(new ExtractTextPlugin('[name].css' + (opts.longTermCaching ? '?[contenthash]' : '')));
  }

  if (opts.minimize && !opts.prerender) {
    plugins.push(
      new webpack.optimize.UglifyJsPlugin({
        compressor: {
          warnings: false
        }
      }),
      new webpack.optimize.DedupePlugin()
    );
  }

  if (opts.minimize) {
    plugins.push(
      new webpack.DefinePlugin({
        'process.env': {
          NODE_ENV: "'production'"
        }
      }),
      new webpack.NoErrorsPlugin()
    );
  }

  externals.push(
    'promised-redmine'
    // put your node 3rd party libraries which can't be built with webpack here (mysql, mongodb, and so on..)
  );

  var options = {
    entry: entry,
    output: output,
    externals: externals,
    module: {
      loaders: [asyncLoader].concat(loadersByExtension(loaders)).concat(loadersByExtension(stylesheetLoaders)).concat(additionalLoaders)
    },
    devtool: opts.devtool,
    debug: opts.debug,
    resolve: {
      root: appRoot,
      modulesDirectories: modulesDirectories,
      extensions: extensions,
      alias: alias,
      packageMains: ['webpack', 'browser', 'web', 'browserify', ['jam', 'main'], 'main']
    },
    plugins: plugins,
    devServer: {
      stats: {
        cached: false,
        exclude: excludeFromStats
      }
    }
  };

  options.target = webpackTargetElectronRenderer(options);

  return options;
};


text:
package com.nflabs.zeppelin.spark;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import java.io.File;
import java.util.HashMap;
import java.util.Properties;

import org.junit.After;
import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;

import com.nflabs.zeppelin.display.GUI;
import com.nflabs.zeppelin.interpreter.InterpreterContext;
import com.nflabs.zeppelin.interpreter.InterpreterResult;
import com.nflabs.zeppelin.interpreter.InterpreterResult.Code;

@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class SparkInterpreterTest {
  public static SparkInterpreter repl;
  private InterpreterContext context;
  private File tmpDir;

  @Before
  public void setUp() throws Exception {
    tmpDir = new File(System.getProperty("java.io.tmpdir") + "/ZeppelinLTest_" + System.currentTimeMillis());
    System.setProperty("zeppelin.dep.localrepo", tmpDir.getAbsolutePath() + "/local-repo");

    tmpDir.mkdirs();

	  if (repl == null) {
		  Properties p = new Properties();

	    repl = new SparkInterpreter(p);
  	  repl.open();
	  }

    context = new InterpreterContext("id", "title", "text", new HashMap<String, Object>(), new GUI());
	}

  @After
  public void tearDown() throws Exception {
    delete(tmpDir);
  }

  private void delete(File file) {
    if (file.isFile()) file.delete();
    else if (file.isDirectory()) {
      File[] files = file.listFiles();
      if (files != null && files.length > 0) {
        for (File f : files) {
          delete(f);
        }
      }
      file.delete();
    }
  }

	@Test
	public void testBasicIntp() {
		assertEquals(InterpreterResult.Code.SUCCESS, repl.interpret("val a = 1\nval b = 2", context).code());

		// when interpret incomplete expression
		InterpreterResult incomplete = repl.interpret("val a = \"\"\"", context);
		assertEquals(InterpreterResult.Code.INCOMPLETE, incomplete.code());
		assertTrue(incomplete.message().length()>0); // expecting some error message
		/*
		assertEquals(1, repl.getValue("a"));
		assertEquals(2, repl.getValue("b"));
		repl.interpret("val ver = sc.version");
		assertNotNull(repl.getValue("ver"));
		assertEquals("HELLO\n", repl.interpret("println(\"HELLO\")").message());
		*/
	}

	@Test
	public void testEndWithComment() {
		assertEquals(InterpreterResult.Code.SUCCESS, repl.interpret("val c=1\n//comment", context).code());
	}

	@Test
	public void testSparkSql(){
		repl.interpret("case class Person(name:String, age:Int)\n", context);
		repl.interpret("val people = sc.parallelize(Seq(Person(\"moon\", 33), Person(\"jobs\", 51), Person(\"gates\", 51), Person(\"park\", 34)))\n", context);
		assertEquals(Code.SUCCESS, repl.interpret("people.take(3)", context).code());

		// create new interpreter
		Properties p = new Properties();
		SparkInterpreter repl2 = new SparkInterpreter(p);
		repl2.open();

		repl.interpret("case class Man(name:String, age:Int)", context);
		repl.interpret("val man = sc.parallelize(Seq(Man(\"moon\", 33), Man(\"jobs\", 51), Man(\"gates\", 51), Man(\"park\", 34)))", context);
		assertEquals(Code.SUCCESS, repl.interpret("man.take(3)", context).code());
		repl2.getSparkContext().stop();
	}

	@Test
	public void testReferencingUndefinedVal(){
		InterpreterResult result = repl.interpret("def category(min: Int) = {" +
				       "    if (0 <= value) \"error\"" +
                       "}", context);
		assertEquals(Code.ERROR, result.code());
	}

  @Test
  public void testZContextDependencyLoading() {
    // try to import library does not exist on classpath. it'll fail
    assertEquals(InterpreterResult.Code.ERROR, repl.interpret("import org.apache.commons.csv.CSVFormat", context).code());

    // load library from maven repository and try to import again
    repl.interpret("z.load(\"org.apache.commons:commons-csv:1.1\")", context);
    assertEquals(InterpreterResult.Code.SUCCESS, repl.interpret("import org.apache.commons.csv.CSVFormat", context).code());
  }
}


text:
<!---
Copyright 2015 The AMP HTML Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS-IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# Doubleclick

## Example

### Basic

```html
<amp-ad width=320 height=50
    type="doubleclick"
    data-slot="/4119129/mobile_ad_banner">
</amp-ad>
```

### With additional targeting

```html
<amp-ad width=320 height=50
    type="doubleclick"
    data-slot="/4119129/mobile_ad_banner"
    json='{"targeting":{"sport":["rugby","cricket"]},"categoryExclusions":["health"],"tagForChildDirectedTreatment":1}'>
</amp-ad>
```

## Configuration

For semantics of configuration, please see [ad network documentation](https://developers.google.com/doubleclick-gpt/reference).

### Ad size

By default the ad size is based on the `width` and `height` attributes of the `amp-ad` tag. In order to explicitly request different ad dimensions from those values, pass the attributes `data-override-width` and `data-override-height` to the ad.

Example:

```html
<amp-ad width=320 height=50
    data-override-width=111
    data-override-height=222
    type="doubleclick"
    data-slot="/4119129/mobile_ad_banner">
</amp-ad>
```

### Supported parameters

- `data-slot`

Supported via `json` attribute:

- `categoryExclusions`
- `cookieOptions`
- `tagForChildDirectedTreatment`
- `targeting`

### Unsupported DFP Features & Formats

#### Unsupported Features:
- Multisize requests. Since the size of the adslot needs to be defined prior to the ad request, multisize requests are not supported.
- Guaranteed Roadblocks. Non-guaranteed roadblocks (As many as possible, One or More) delivery is supported

#### Unsupported Formats/Creatives:
- Interstitials
- Expandables. Although expandables on interaction/click is a format that is work in progress.
- Flash
- Anchor Ads / Adhesion Units
- Creatives served over HTTP.

### DFP Implementation Examples
[This](http://dfp-amp-testing-1185.appspot.com/) website has a list of implementation examples with source code that showcase DFP features.


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Odontoglossum divaricatum Lindl.

### Remarks
null


text:
namespace volt {

class PieceFrame : public BlockContainer {
public:
	PieceFrame(int columnCount, int rowCount);
	void Render(sf::RenderTarget& target) const;

	bool operator==(const PieceFrame& other) const;

};

}

#endif // PieceFrame_h__


text:
#[=======================================================================[.rst:
CPackComponent
--------------

Build binary and source package installers

Variables concerning CPack Components
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The CPackComponent module is the module which handles the component
part of CPack.  See CPack module for general information about CPack.

For certain kinds of binary installers (including the graphical
installers on macOS and Windows), CPack generates installers that
allow users to select individual application components to install.
The contents of each of the components are identified by the COMPONENT
argument of CMake's INSTALL command.  These components can be
annotated with user-friendly names and descriptions, inter-component
dependencies, etc., and grouped in various ways to customize the
resulting installer.  See the cpack_add_* commands, described below,
for more information about component-specific installations.

Component-specific installation allows users to select specific sets
of components to install during the install process.  Installation
components are identified by the COMPONENT argument of CMake's INSTALL
commands, and should be further described by the following CPack
commands:

.. variable:: CPACK_COMPONENTS_ALL

 The list of component to install.

 The default value of this variable is computed by CPack and contains all
 components defined by the project.  The user may set it to only include the
 specified components.

 Instead of specifying all the desired components, it is possible to obtain a
 list of all defined components and then remove the unwanted ones from the
 list. The :command:`get_cmake_property` command can be used to obtain the
 ``COMPONENTS`` property, then the :command:`list(REMOVE_ITEM)` command can be
 used to remove the unwanted ones. For example, to use all defined components
 except ``foo`` and ``bar``::

   get_cmake_property(CPACK_COMPONENTS_ALL COMPONENTS)
   list(REMOVE_ITEM CPACK_COMPONENTS_ALL "foo" "bar")

.. variable:: CPACK_<GENNAME>_COMPONENT_INSTALL

 Enable/Disable component install for CPack generator <GENNAME>.

 Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
 default behavior.  e.g.  RPM builds monolithic whereas NSIS builds
 component.  One can change the default behavior by setting this variable to
 0/1 or OFF/ON.

.. variable:: CPACK_COMPONENTS_GROUPING

 Specify how components are grouped for multi-package component-aware CPack
 generators.

 Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates
 several packages files when asked for component packaging.  They group
 the component differently depending on the value of this variable:

 * ONE_PER_GROUP (default): creates one package file per component group
 * ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) components
 * IGNORE : creates one package per component, i.e. IGNORE component group

 One can specify different grouping for different CPack generator by
 using a CPACK_PROJECT_CONFIG_FILE.

.. variable:: CPACK_COMPONENT_<compName>_DISPLAY_NAME

 The name to be displayed for a component.

.. variable:: CPACK_COMPONENT_<compName>_DESCRIPTION

 The description of a component.

.. variable:: CPACK_COMPONENT_<compName>_GROUP

 The group of a component.

.. variable:: CPACK_COMPONENT_<compName>_DEPENDS

 The dependencies (list of components) on which this component depends.

.. variable:: CPACK_COMPONENT_<compName>_HIDDEN

 True if this component is hidden from the user.

.. variable:: CPACK_COMPONENT_<compName>_REQUIRED

 True if this component is required.

.. variable:: CPACK_COMPONENT_<compName>_DISABLED

 True if this component is not selected to be installed by default.

.. command:: cpack_add_component

Describes a CPack installation
component named by the COMPONENT argument to a CMake INSTALL command.

::

  cpack_add_component(compname
                      [DISPLAY_NAME name]
                      [DESCRIPTION description]
                      [HIDDEN | REQUIRED | DISABLED ]
                      [GROUP group]
                      [DEPENDS comp1 comp2 ... ]
                      [INSTALL_TYPES type1 type2 ... ]
                      [DOWNLOADED]
                      [ARCHIVE_FILE filename]
                      [PLIST filename])

The cmake_add_component command describes an installation component,
which the user can opt to install or remove as part of the graphical
installation process.  compname is the name of the component, as
provided to the COMPONENT argument of one or more CMake INSTALL
commands.

DISPLAY_NAME is the displayed name of the component, used in graphical
installers to display the component name.  This value can be any
string.

DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about the
component.  Descriptions can span multiple lines using ``\n`` as the
line separator.  Typically, these descriptions should be no more than
a few lines long.

HIDDEN indicates that this component will be hidden in the graphical
installer, so that the user cannot directly change whether it is
installed or not.

REQUIRED indicates that this component is required, and therefore will
always be installed.  It will be visible in the graphical installer,
but it cannot be unselected.  (Typically, required components are
shown greyed out).

DISABLED indicates that this component should be disabled (unselected)
by default.  The user is free to select this component for
installation, unless it is also HIDDEN.

DEPENDS lists the components on which this component depends.  If this
component is selected, then each of the components listed must also be
selected.  The dependency information is encoded within the installer
itself, so that users cannot install inconsistent sets of components.

GROUP names the component group of which this component is a part.  If
not provided, the component will be a standalone component, not part
of any component group.  Component groups are described with the
cpack_add_component_group command, detailed below.

INSTALL_TYPES lists the installation types of which this component is
a part.  When one of these installations types is selected, this
component will automatically be selected.  Installation types are
described with the cpack_add_install_type command, detailed below.

DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself.  For more information, see the
cpack_configure_downloads command.

ARCHIVE_FILE provides a name for the archive file created by CPack to
be used for downloaded components.  If not supplied, CPack will create
a file with some name based on CPACK_PACKAGE_FILE_NAME and the name of
the component.  See cpack_configure_downloads for more information.

PLIST gives a filename that is passed to pkgbuild with the
``--component-plist`` argument when using the productbuild generator.

.. command:: cpack_add_component_group

Describes a group of related CPack installation components.

::

  cpack_add_component_group(groupname
                           [DISPLAY_NAME name]
                           [DESCRIPTION description]
                           [PARENT_GROUP parent]
                           [EXPANDED]
                           [BOLD_TITLE])

The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options.  Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option.  Use component groups to reduce the
complexity of installers with many options.  groupname is an arbitrary
name used to identify the group in the GROUP argument of the
cpack_add_component command, which is used to place a component in a
group.  The name of the group must not conflict with the name of any
component.

DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name.  This value
can be any string.

DESCRIPTION is an extended description of the component group, used in
graphical installers to give the user additional information about the
components within that group.  Descriptions can span multiple lines
using ``\n`` as the line separator.  Typically, these descriptions
should be no more than a few lines long.

PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups, providing
an arbitrary hierarchy of groups.

EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the components
within the group.  Otherwise, the group will initially show up as a
single entry.

BOLD_TITLE indicates that the group title should appear in bold, to
call the user's attention to the group.

.. command:: cpack_add_install_type

Add a new installation type containing
a set of predefined component selections to the graphical installer.

::

  cpack_add_install_type(typename
                         [DISPLAY_NAME name])

The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an application.  For
example, a "Developer" install type might include an application along
with its header and library files, while an "End user" install type
might just include the application's executable.  Each component
identifies itself with one or more install types via the INSTALL_TYPES
argument to cpack_add_component.

DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical installer.
This value can be any string.

.. command:: cpack_configure_downloads

Configure CPack to download
selected components on-the-fly as part of the installation process.

::

  cpack_configure_downloads(site
                            [UPLOAD_DIRECTORY dirname]
                            [ALL]
                            [ADD_REMOVE|NO_ADD_REMOVE])

The cpack_configure_downloads command configures installation-time
downloads of selected components.  For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site.  When the user
selects that component for installation, the installer will download
and extract the component in place.  This feature is useful for
creating small installers that only download the requested components,
saving bandwidth.  Additionally, the installers are small enough that
they will be installed as part of the normal installation process, and
the "Change" button in Windows Add/Remove Programs control panel will
allow one to add or remove parts of the application after the original
installation.  On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:

::

  http://nsis.sourceforge.net/ZipDLL_plug-in

On macOS, installers that download components on-the-fly can only
be built and installed on system using macOS 10.5 or later.

The site argument is a URL where the archives for downloadable
components will reside, e.g.,
https://cmake.org/files/2.6.1/installer/ All of the archives
produced by CPack should be uploaded to that location.

UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components.  The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument.  If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.

The ALL flag indicates that all components be downloaded.  Otherwise,
only those components explicitly marked as DOWNLOADED or that have a
specified ARCHIVE_FILE will be downloaded.  Additionally, the ALL
option implies ADD_REMOVE (unless NO_ADD_REMOVE is specified).

ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components.
NO_ADD_REMOVE turns off this behavior.  This option is ignored on Mac
OS X.
#]=======================================================================]

# Define var in order to avoid multiple inclusion
if(NOT CPackComponent_CMake_INCLUDED)
set(CPackComponent_CMake_INCLUDED 1)

# Macro that appends a SET command for the given variable name (var)
# to the macro named strvar, but only if the variable named "var"
# has been defined. The string will eventually be appended to a CPack
# configuration file.
macro(cpack_append_variable_set_command var strvar)
  if (DEFINED ${var})
    string(APPEND ${strvar} "set(${var}")
    foreach(APPENDVAL ${${var}})
      string(APPEND ${strvar} " ${APPENDVAL}")
    endforeach()
    string(APPEND ${strvar} ")\n")
  endif ()
endmacro()

# Macro that appends a SET command for the given variable name (var)
# to the macro named strvar, but only if the variable named "var"
# has been defined and is a string. The string will eventually be
# appended to a CPack configuration file.
macro(cpack_append_string_variable_set_command var strvar)
  if (DEFINED ${var})
    list(LENGTH ${var} CPACK_APP_VALUE_LEN)
    if(${CPACK_APP_VALUE_LEN} EQUAL 1)
      string(APPEND ${strvar} "set(${var} \"${${var}}\")\n")
    endif()
  endif ()
endmacro()

# Macro that appends a SET command for the given list variable name (var)
# to the macro named strvar, but only if the variable named "var"
# has been defined. It's like add variable, but wrap each item to quotes.
# The string will eventually be appended to a CPack configuration file.
macro(cpack_append_list_variable_set_command var strvar)
  if (DEFINED ${var})
    string(APPEND ${strvar} "set(${var}")
    foreach(_val IN LISTS ${var})
      string(APPEND ${strvar} "\n  \"${_val}\"")
    endforeach()
    string(APPEND ${strvar} ")\n")
  endif ()
endmacro()

# Macro that appends a SET command for the given variable name (var)
# to the macro named strvar, but only if the variable named "var"
# has been set to true. The string will eventually be
# appended to a CPack configuration file.
macro(cpack_append_option_set_command var strvar)
  if (${var})
    list(LENGTH ${var} CPACK_APP_VALUE_LEN)
    if(${CPACK_APP_VALUE_LEN} EQUAL 1)
      string(APPEND ${strvar} "set(${var} TRUE)\n")
    endif()
  endif ()
endmacro()

# Macro that adds a component to the CPack installer
macro(cpack_add_component compname)
  string(TOUPPER ${compname} _CPACK_ADDCOMP_UNAME)
  cmake_parse_arguments(CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}
    "HIDDEN;REQUIRED;DISABLED;DOWNLOADED"
    "DISPLAY_NAME;DESCRIPTION;GROUP;ARCHIVE_FILE;PLIST"
    "DEPENDS;INSTALL_TYPES"
    ${ARGN}
    )

  if (CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_DOWNLOADED)
    set(_CPACK_ADDCOMP_STR "\n# Configuration for downloaded component \"${compname}\"\n")
  else ()
    set(_CPACK_ADDCOMP_STR "\n# Configuration for component \"${compname}\"\n")
  endif ()

  if(NOT CPACK_MONOLITHIC_INSTALL)
    # If the user didn't set CPACK_COMPONENTS_ALL explicitly, update the
    # value of CPACK_COMPONENTS_ALL in the configuration file. This will
    # take care of any components that have been added after the CPack
    # moduled was included.
    if(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
      get_cmake_property(_CPACK_ADDCOMP_COMPONENTS COMPONENTS)
      string(APPEND _CPACK_ADDCOMP_STR "\nSET(CPACK_COMPONENTS_ALL")
      foreach(COMP ${_CPACK_ADDCOMP_COMPONENTS})
       string(APPEND _CPACK_ADDCOMP_STR " ${COMP}")
      endforeach()
      string(APPEND _CPACK_ADDCOMP_STR ")\n")
    endif()
  endif()

  cpack_append_string_variable_set_command(
    CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_DISPLAY_NAME
    _CPACK_ADDCOMP_STR)
  cpack_append_string_variable_set_command(
    CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_DESCRIPTION
    _CPACK_ADDCOMP_STR)
  cpack_append_variable_set_command(
    CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_GROUP
    _CPACK_ADDCOMP_STR)
  cpack_append_variable_set_command(
    CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_DEPENDS
    _CPACK_ADDCOMP_STR)
  cpack_append_variable_set_command(
    CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_INSTALL_TYPES
    _CPACK_ADDCOMP_STR)
  cpack_append_string_variable_set_command(
    CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_ARCHIVE_FILE
    _CPACK_ADDCOMP_STR)
  cpack_append_option_set_command(
    CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_HIDDEN
    _CPACK_ADDCOMP_STR)
  cpack_append_option_set_command(
    CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_REQUIRED
    _CPACK_ADDCOMP_STR)
  cpack_append_option_set_command(
    CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_DISABLED
    _CPACK_ADDCOMP_STR)
  cpack_append_option_set_command(
    CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_DOWNLOADED
    _CPACK_ADDCOMP_STR)
  cpack_append_string_variable_set_command(
    CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_PLIST
    _CPACK_ADDCOMP_STR)
  # Backward compatibility issue.
  # Write to config iff the macros is used after CPack.cmake has been
  # included, other it's not necessary because the variables
  # will be encoded by cpack_encode_variables.
  if(CPack_CMake_INCLUDED)
    file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${_CPACK_ADDCOMP_STR}")
  endif()
endmacro()

# Macro that adds a component group to the CPack installer
macro(cpack_add_component_group grpname)
  string(TOUPPER ${grpname} _CPACK_ADDGRP_UNAME)
  cmake_parse_arguments(CPACK_COMPONENT_GROUP_${_CPACK_ADDGRP_UNAME}
    "EXPANDED;BOLD_TITLE"
    "DISPLAY_NAME;DESCRIPTION;PARENT_GROUP"
    ""
    ${ARGN}
    )

  set(_CPACK_ADDGRP_STR "\n# Configuration for component group \"${grpname}\"\n")
  cpack_append_string_variable_set_command(
    CPACK_COMPONENT_GROUP_${_CPACK_ADDGRP_UNAME}_DISPLAY_NAME
    _CPACK_ADDGRP_STR)
  cpack_append_string_variable_set_command(
    CPACK_COMPONENT_GROUP_${_CPACK_ADDGRP_UNAME}_DESCRIPTION
    _CPACK_ADDGRP_STR)
  cpack_append_string_variable_set_command(
    CPACK_COMPONENT_GROUP_${_CPACK_ADDGRP_UNAME}_PARENT_GROUP
    _CPACK_ADDGRP_STR)
  cpack_append_option_set_command(
    CPACK_COMPONENT_GROUP_${_CPACK_ADDGRP_UNAME}_EXPANDED
    _CPACK_ADDGRP_STR)
  cpack_append_option_set_command(
    CPACK_COMPONENT_GROUP_${_CPACK_ADDGRP_UNAME}_BOLD_TITLE
    _CPACK_ADDGRP_STR)
  # Backward compatibility issue.
  # Write to config iff the macros is used after CPack.cmake has been
  # included, other it's not necessary because the variables
  # will be encoded by cpack_encode_variables.
  if(CPack_CMake_INCLUDED)
    file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${_CPACK_ADDGRP_STR}")
  endif()
endmacro()

# Macro that adds an installation type to the CPack installer
macro(cpack_add_install_type insttype)
  string(TOUPPER ${insttype} _CPACK_INSTTYPE_UNAME)
  cmake_parse_arguments(CPACK_INSTALL_TYPE_${_CPACK_INSTTYPE_UNAME}
    ""
    "DISPLAY_NAME"
    ""
    ${ARGN}
    )

  set(_CPACK_INSTTYPE_STR
    "\n# Configuration for installation type \"${insttype}\"\n")
  string(APPEND _CPACK_INSTTYPE_STR
    "list(APPEND CPACK_ALL_INSTALL_TYPES ${insttype})\n")
  cpack_append_string_variable_set_command(
    CPACK_INSTALL_TYPE_${_CPACK_INSTTYPE_UNAME}_DISPLAY_NAME
    _CPACK_INSTTYPE_STR)
  # Backward compatibility issue.
  # Write to config iff the macros is used after CPack.cmake has been
  # included, other it's not necessary because the variables
  # will be encoded by cpack_encode_variables.
  if(CPack_CMake_INCLUDED)
    file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${_CPACK_INSTTYPE_STR}")
  endif()
endmacro()

macro(cpack_configure_downloads site)
  cmake_parse_arguments(CPACK_DOWNLOAD
    "ALL;ADD_REMOVE;NO_ADD_REMOVE"
    "UPLOAD_DIRECTORY"
    ""
    ${ARGN}
    )

  set(CPACK_CONFIG_DL_STR
    "\n# Downloaded components configuration\n")
  set(CPACK_UPLOAD_DIRECTORY ${CPACK_DOWNLOAD_UPLOAD_DIRECTORY})
  set(CPACK_DOWNLOAD_SITE ${site})
  cpack_append_string_variable_set_command(
    CPACK_DOWNLOAD_SITE
    CPACK_CONFIG_DL_STR)
  cpack_append_string_variable_set_command(
    CPACK_UPLOAD_DIRECTORY
    CPACK_CONFIG_DL_STR)
  cpack_append_option_set_command(
    CPACK_DOWNLOAD_ALL
    CPACK_CONFIG_DL_STR)
  if (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
    set(CPACK_DOWNLOAD_ADD_REMOVE ON)
  endif ()
  set(CPACK_ADD_REMOVE ${CPACK_DOWNLOAD_ADD_REMOVE})
  cpack_append_option_set_command(
    CPACK_ADD_REMOVE
    CPACK_CONFIG_DL_STR)
  # Backward compatibility issue.
  # Write to config iff the macros is used after CPack.cmake has been
  # included, other it's not necessary because the variables
  # will be encoded by cpack_encode_variables.
  if(CPack_CMake_INCLUDED)
    file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_CONFIG_DL_STR}")
  endif()
endmacro()
endif()


text:
package rummage

import java.util.concurrent.{ Executors, ThreadFactory, ScheduledExecutorService, ScheduledFuture }
import java.util.concurrent.TimeUnit.MILLISECONDS
import java.util.concurrent.atomic.AtomicLong
import scala.concurrent.ExecutionContext
import scala.concurrent.duration._
import akka.actor.{ ActorSystem, Cancellable, Scheduler }

/**
 * An interface for scheduling tasks to run one or more times at some point in the future.
 */
@deprecated("Timers are replaced by the Clock API", "1.1")
trait Timer {

  import Timer.Task

  /**
   * Creates a builder capable of building timers that perform a task once or repeatedly after the specified delay.
   *
   * @param delay The amount of time to wait before performing the task for the first time.
   */
  def after(delay: FiniteDuration): Builder = new Builder(delay)

  /**
   * Performs a task after the specified delay and repeatedly thereafter, waiting the specified interval between
   * invocations.
   *
   * @tparam U Any type, treated as if it was `Unit`.
   * @param interval The amount of time to wait before performing the task and between subsequent executions.
   * @param f The action to repeatedly perform.
   * @param ec The execution context to perform the action on.
   */
  def every[U](interval: FiniteDuration)(f: => U)(implicit ec: ExecutionContext): Task =
    submit(interval, Some(interval), f _)

  /**
   * Submits a task for execution after the specified delay and possibly repeatedly thereafter, waiting the specified
   * interval (if specified) between invocations.
   *
   * @param delay The amount of time to wait before performing the task for the first time.
   * @param interval A `Some` containing the amount of time to wait between subsequent executions or `None`.
   * @param f The action to (possibly repeatedly) perform.
   * @param ec The execution context to perform the action on.
   */
  def submit(delay: FiniteDuration, interval: Option[FiniteDuration], f: () => Unit)(
    implicit ec: ExecutionContext): Task

  /**
   * A secondary interface for building tasks that fire after an initial delay.
   *
   * @param delay The initial delay duration.
   */
  final class Builder private[Timer] (delay: FiniteDuration) {

    /**
     * Performs a task once after this builder's delay.
     *
     * @tparam U Any type, treated as if it was `Unit`.
     * @param f The action to perform after the specified delay.
     * @param ec The execution context to perform the action on.
     */
    def apply[U](f: => U)(implicit ec: ExecutionContext): Task =
      submit(delay, None, f _)

    /**
     * Performs a task once after this builder's delay and repeatedly thereafter, waiting the specified interval
     * between subsequent invocations.
     *
     * @tparam U Any type, treated as if it was `Unit`.
     * @param interval The amount of time to wait between subsequent executions.
     * @param f The action to repeatedly perform.
     * @param ec The execution context to perform the action on.
     */
    def andEvery[U](interval: FiniteDuration)(f: => U)(implicit ec: ExecutionContext): Task =
      submit(delay, Some(interval), f _)

  }

}

/**
 * Definitions associated with timers as well as the infrastructure for publishing the global implicit timer.
 *
 * This object publishes an implicit, lazily-initialized, global timer backed by a single daemon thread. It
 * additionally implements `Timer` itself and forwards all task submissions to the aforementioned global timer.
 */
@deprecated("Timers are replaced by the Clock API", "1.1")
object Timer extends Timer {

  /** The default global timer backed by a single thread. */
  implicit lazy val global: Timer = new JavaTimer(Executors.newSingleThreadScheduledExecutor(new ThreadFactory {
    val counter = new AtomicLong
    def newThread(r: Runnable) = {
      val thread = new Thread(r, s"${classOf[Timer].getName}-${counter.incrementAndGet()}")
      thread.setDaemon(true)
      thread
    }
  }))

  /* Delegates to the global timer instance. */
  def submit(delay: FiniteDuration, interval: Option[FiniteDuration], f: () => Unit)(implicit ec: ExecutionContext) =
    global.submit(delay, interval, f)

  /**
   * Represents a task spawned by a timer.
   */
  trait Task {

    /** Returns true if this task has been cancelled. */
    def isCancelled: Boolean

    /** Cancels this task. */
    def cancel(): Unit

  }

}

/**
 * A timer implemented with a Java `ScheduledExecutorService`.
 *
 * @param executor The `ScheduledExecutorService` instance to view as a timer.
 */
@deprecated("Timers are replaced by the Clock API", "1.1")
final class JavaTimer(executor: ScheduledExecutorService) extends Timer {
  def submit(delay: FiniteDuration, interval: Option[FiniteDuration], f: () => Unit)(implicit ec: ExecutionContext) = {
    @volatile var handle = None: Option[ScheduledFuture[_]]
    val nested = new Runnable { def run = if (handle forall (!_.isCancelled)) f() }
    val action = new Runnable { def run = ec execute nested }
    val future = interval match {
      case Some(interval) => executor.scheduleAtFixedRate(action, delay.toMillis, interval.toMillis, MILLISECONDS)
      case None => executor.schedule(action, delay.toMillis, MILLISECONDS)
    }
    handle = Some(future)
    new Timer.Task {
      def isCancelled = future.isCancelled
      def cancel() = future.cancel(false)
    }: Timer.Task
  }
}

/**
 * Factory for timers implemented with a Java `ScheduledExecutorService`.
 */
@deprecated("Timers are replaced by the Clock API", "1.1")
object JavaTimer {

  /**
   * Creates a Java timer from the specified executor.
   *
   * @param executor The `ScheduledExecutorService` instance to view as a timer.
   */
  def apply(executor: ScheduledExecutorService): JavaTimer = new JavaTimer(executor)

}

/**
 * A timer implemented with an Akka `Scheduler`.
 *
 * @param scheduler The `Scheduler` instance to view as a timer.
 */
@deprecated("Timers are replaced by the Clock API", "1.1")
final class AkkaTimer(scheduler: Scheduler) extends Timer {
  def submit(delay: FiniteDuration, interval: Option[FiniteDuration], f: () => Unit)(implicit ec: ExecutionContext) = {
    @volatile var handle = None: Option[Cancellable]
    val action = new Runnable { def run = if (handle forall (!_.isCancelled)) f() }
    val cancellable = interval match {
      case Some(interval) => scheduler.schedule(delay, interval, action)
      case None => scheduler.scheduleOnce(delay, action)
    }
    handle = Some(cancellable)
    new Timer.Task {
      def isCancelled = cancellable.isCancelled
      def cancel() = cancellable.cancel()
    }: Timer.Task
  }
}

/**
 * Factory for timers implemented with an Akka `Scheduler`.
 */
@deprecated("Timers are replaced by the Clock API", "1.1")
object AkkaTimer {

  /**
   * Creates an Akka timer from the specified scheduler.
   *
   * @param scheduler The `Scheduler` instance to view as a timer.
   */
  def apply(scheduler: Scheduler): AkkaTimer = new AkkaTimer(scheduler)

  /**
   * Creates an Akka timer from the specified actor system's scheduler.
   *
   * @param system The actor system that contains the scheduler to view as a timer.
   */
  def apply(system: ActorSystem): AkkaTimer = AkkaTimer(system.scheduler)

}


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

<TITLE>CSS1 Test Suite: 5.5.04 margin-left</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META http-equiv="Content-Style-Type" content="text/css">

<LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css">

The style declarations which apply to the text below are:

.zero {background-color: silver; margin-left: 0;}
.one {margin-left: 0.5in; background-color: aqua;}
.two {margin-left: 25px; background-color: aqua;}
.three {margin-left: 5em; background-color: aqua;}
.four {margin-left: 25%; background-color: aqua;}
.five {margin-left: -10px; background-color: aqua;}

This element has a class of zero.

This sentence should have a left margin of half an inch.

This sentence should have a left margin of 25 pixels.

This sentence should have a left margin of 5 em.

This sentence should have a left margin of 25%, which is calculated with respect to the width of the parent element.

The left margin on this unordered list has been set to 25 pixels, and its background color has been set to gray.

Another list item might not be such a bad idea, either, considering that such things do need to be double-checked.  This list item has its left margin also set to 25 pixels, which should combine with the list's margin to make 50 pixels of margin, and its background color has been set to white.

This is an unclassed list item

This element has a class of zero.

This paragraph has a left margin of -10px, which should cause it to be wider than it might otherwise be, and it has a light blue background.  In all other respects, however, the element should be normal.  No styles have been applied to it besides the negative left margin and the background color.

TABLE Testing Section

This element has a class of zero.

This sentence should have a left margin of half an inch.

This sentence should have a left margin of 25 pixels.

This sentence should have a left margin of 5 em.

This sentence should have a left margin of 25%, which is calculated with respect to the width of the parent element.

The left margin on this unordered list has been set to 25 pixels, and its background color has been set to gray.

Another list item might not be such a bad idea, either, considering that such things do need to be double-checked.  This list item has its left margin also set to 25 pixels, which should combine with the list's margin to make 50 pixels of margin, and its background color has been set to white.

This is an unclassed list item

This element has a class of zero.

This paragraph has a left margin of -10px, which should cause it to be wider than it might otherwise be, and it has a light blue background.  In all other respects, however, the element should be normal.  No styles have been applied to it besides the negative left margin and the background color.


text:
package org.omg.CORBA;

final public class TypeCodeHolder implements org.omg.CORBA.portable.Streamable {
    public TypeCode value;

    public TypeCodeHolder() {
    }

    public TypeCodeHolder(TypeCode initial) {
        value = initial;
    }

    public void _read(org.omg.CORBA.portable.InputStream input) {
        value = input.read_TypeCode();
    }

    public void _write(org.omg.CORBA.portable.OutputStream output) {
        output.write_TypeCode(value);
    }

    public org.omg.CORBA.TypeCode _type() {
        return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_TypeCode);
    }
}


text:
redirect_to: /someplace-else/
---


text:
include ApplicationCookbook::ProviderBase

action :deploy do

  before_compile

  before_deploy

  run_deploy

end

action :force_deploy do

  before_compile

  before_deploy

  run_deploy(true)

end

action :restart do

  before_compile

  run_actions_with_context(:before_restart, @run_context)

  run_restart

  run_actions_with_context(:after_restart, @run_context)

  @new_resource.updated_by_last_action(true)

end

protected

def before_compile
  new_resource.application_provider self
  new_resource.sub_resources.each do |resource|
    resource.application_provider self
    resource.run_action :before_compile
  end
end

def before_deploy
  new_resource.packages.each do |pkg,ver|
    package pkg do
      action :install
      version ver if ver && ver.length > 0
    end
  end

  directory new_resource.path do
    owner new_resource.owner
    group new_resource.group
    mode '0755'
    recursive true
  end

  directory "#{new_resource.path}/shared" do
    owner new_resource.owner
    group new_resource.group
    mode '0755'
    recursive true
  end

  if new_resource.deploy_key
    file "#{new_resource.path}/id_deploy" do
      content new_resource.deploy_key
      owner new_resource.owner
      group new_resource.group
      mode '0600'
    end

    template "#{new_resource.path}/deploy-ssh-wrapper" do
      source "deploy-ssh-wrapper.erb"
      cookbook "application"
      owner new_resource.owner
      group new_resource.group
      mode "0755"
      variables :id => new_resource.name, :deploy_to => new_resource.path
    end
  end

  ruby_block "#{new_resource.name} before_deploy" do
    block do
      new_resource.sub_resources.each do |resource|
        resource.run_action :before_deploy
      end
      callback(:before_deploy, new_resource.before_deploy)
    end
  end
end

def run_deploy(force = false)
  # Alias to a variable so I can use in sub-resources
  new_resource = @new_resource
  app_provider = self

  @deploy_resource = send(new_resource.strategy.to_sym, new_resource.name) do
    action force ? :force_deploy : :deploy
    scm_provider new_resource.scm_provider
    revision new_resource.revision
    repository new_resource.repository
    enable_submodules new_resource.enable_submodules
    user new_resource.owner
    group new_resource.group
    deploy_to new_resource.path
    ssh_wrapper "#{new_resource.path}/deploy-ssh-wrapper" if new_resource.deploy_key
    shallow_clone new_resource.shallow_clone
    rollback_on_error new_resource.rollback_on_error
    all_environments = ([new_resource.environment]+new_resource.sub_resources.map{|res| res.environment}).inject({}){|acc, val| acc.merge(val)}
    environment all_environments
    migrate new_resource.migrate
    all_migration_commands = ([new_resource.migration_command]+new_resource.sub_resources.map{|res| res.migration_command}).select{|cmd| cmd && !cmd.empty?}
    migration_command all_migration_commands.join(' && ')
    restart_command do
      ([new_resource]+new_resource.sub_resources).each do |res|
        cmd = res.restart_command
        if cmd.is_a? Proc
          version = Chef::Version.new(Chef::VERSION)
          provider = if version.major > 10 || version.minor >= 14
            Chef::Platform.provider_for_resource(res, :nothing)
          else
            Chef::Platform.provider_for_resource(res)
          end
          provider.load_current_resource
          provider.instance_eval(&cmd)
        elsif cmd && !cmd.empty?
          execute cmd do
            user new_resource.owner
            group new_resource.group
            environment all_environments
          end
        end
      end
    end
    purge_before_symlink (new_resource.purge_before_symlink + new_resource.sub_resources.map(&:purge_before_symlink)).flatten
    create_dirs_before_symlink (new_resource.create_dirs_before_symlink + new_resource.sub_resources.map(&:create_dirs_before_symlink)).flatten
    all_symlinks = [new_resource.symlinks]+new_resource.sub_resources.map{|res| res.symlinks}
    symlinks all_symlinks.inject({}){|acc, val| acc.merge(val)}
    all_symlinks_before_migrate = [new_resource.symlink_before_migrate]+new_resource.sub_resources.map{|res| res.symlink_before_migrate}
    symlink_before_migrate all_symlinks_before_migrate.inject({}){|acc, val| acc.merge(val)}
    before_migrate do
      app_provider.send(:run_actions_with_context, :before_migrate, @run_context)
    end
    before_symlink do
      app_provider.send(:run_actions_with_context, :before_symlink, @run_context)
    end
    before_restart do
      app_provider.send(:run_actions_with_context, :before_restart, @run_context)
    end
    after_restart do
      app_provider.send(:run_actions_with_context, :after_restart, @run_context)
    end
  end
end

def run_actions_with_context(action, context)
  new_resource.sub_resources.each do |resource|
    saved_run_context = resource.instance_variable_get :@run_context
    resource.instance_variable_set :@run_context, context
    resource.run_action action
    resource.instance_variable_set :@run_context, saved_run_context
  end
  callback(action, new_resource.send(action))
end


text:
import fs from 'fs';
import { Builder } from 'selenium-webdriver';
import firefox from 'selenium-webdriver/firefox';
import http from 'http';

interface Options {
  height: number;
  pngPath: string;
  svgPath: string;
  width: number;
}

const getPNG = (pngDataUrl: string): Buffer => {
  const pngEncoded = pngDataUrl.substring('data:image/png;base64,'.length);
  const png = Buffer.from(pngEncoded, 'base64');
  return png;
};

// data:image/png;base64,...
const getPNGDataURL = async (
  svgDataUrl: string,
  width: number,
  height: number
): Promise<string> => {
  return runServer(async (port) => {
    const driver =
      new Builder()
        .forBrowser('firefox')
        .setFirefoxOptions(new firefox.Options().headless())
        .build();
    await driver.get('http://localhost:' + port);
    const pngDataUrl = await driver.executeAsyncScript(
      [
        'const svgDataUrl = "' + svgDataUrl + '";',
        'const callback = arguments[arguments.length - 1];',
        'const canvas = document.createElement("canvas");',
        'const image = new Image();',
        'image.onload = () => {',
        '  canvas.height = ' + height + ';',
        '  canvas.width = ' + width + ';',
        '  context = canvas.getContext("2d");',
        '  context.drawImage(image, 0, 0, canvas.width, canvas.height);',
        '  callback(canvas.toDataURL("image/png"))',
        '};',
        'image.src = svgDataUrl;'
      ].join('\n')
    );
    if (
      typeof pngDataUrl !== 'string' ||
      !pngDataUrl.startsWith('data:image/png;base64,')
    ) throw new Error('unknown format');
    return pngDataUrl;
  });
};

// data:image/svg+xml;base64,...
const getSVGDataURL = async (svg: string): Promise<string> => {
  const svgEncoded = Buffer.from(svg, 'utf8').toString('base64');
  return 'data:image/svg+xml;base64,' + svgEncoded;
};

const parseOptions = (): Options => {
  const args = process.argv.slice(2);
  if (args.length < 4) throw new Error('<svg> <width> <height> <png>');
  const svgPath = args[0];
  const width = parseInt(args[1], 10);
  const height = parseInt(args[2], 10);
  const pngPath = args[3];
  if (Number.isNaN(height)) throw new Error('height is NaN');
  if (Number.isNaN(width)) throw new Error('width is NaN');
  return { height, pngPath, svgPath, width };
};

const runServer = <T>(
  callback: (port: number) => Promise<T>
): Promise<T> => {
  return new Promise((resolve, reject) => {
    const server = http.createServer((_, res) => res.end());
    const close = (v?: T): void => {
      server.close((error) => {
        if (typeof error !== 'undefined') reject(error);
        else resolve(v);
      });
    };
    server.listen(() => {
      const port = (server.address() as any).port;
      Promise.resolve()
        .then(() => callback(port))
        .then((v) => close(v), () => close());
    });
  });
};

const main = async (): Promise<void> => {
  const options = parseOptions();
  const svg = fs.readFileSync(options.svgPath, { encoding: 'utf8' });
  const svgDataUrl = await getSVGDataURL(svg);
  const pngDataUrl = await getPNGDataURL(
    svgDataUrl, options.width, options.height
  );
  const png = getPNG(pngDataUrl);
  fs.writeFileSync(options.pngPath, png, { encoding: 'buffer' });
};

main();


text:
from application.auth import requires_auth
from application.direct import Base, Overview
from flask import Flask, request, Response
from pyextdirect.api import create_api
from pyextdirect.router import Router
from wsgiref.handlers import CGIHandler
import json

app = Flask('gentoo-chroot')

@app.route('/direct/router', methods=['POST'])
@requires_auth(groups=['administrators'])
def route():
    router = Router(Base)
    return Response(router.route(request.json or dict((k, v[0] if len(v) == 1 else v) for k, v in request.form.to_dict(False).iteritems())), mimetype='application/json')

@app.route('/direct/poller', methods=['GET'])
@requires_auth(groups=['administrators'])
def poll():
    overview = Overview()
    event = {'type': 'event', 'name': 'status', 'data': {
             'installed': 'installed' if overview.is_installed() else 'installing',
             'running_services': overview.running_services()}}
    return Response(json.dumps(event), mimetype='application/json')

@app.route('/direct/api')
@requires_auth(groups=['administrators'])
def api():
    return create_api(Base)

if __name__ == '__main__':
    CGIHandler().run(app)


text:
#ifndef DUNGEONGEN_HEADER
#define DUNGEONGEN_HEADER

#include "voxel.h"
#include "noise.h"
#include "mapgen.h"

#define VMANIP_FLAG_DUNGEON_INSIDE VOXELFLAG_CHECKED1
#define VMANIP_FLAG_DUNGEON_PRESERVE VOXELFLAG_CHECKED2
#define VMANIP_FLAG_DUNGEON_UNTOUCHABLE (\
		VMANIP_FLAG_DUNGEON_INSIDE|VMANIP_FLAG_DUNGEON_PRESERVE)

class MMVManip;
class INodeDefManager;

v3s16 rand_ortho_dir(PseudoRandom &random, bool diagonal_dirs);
v3s16 turn_xz(v3s16 olddir, int t);
v3s16 random_turn(PseudoRandom &random, v3s16 olddir);
int dir_to_facedir(v3s16 d);

struct DungeonParams {
	content_t c_water;
	content_t c_river_water;
	content_t c_cobble;
	content_t c_moss;
	content_t c_stair;

	GenNotifyType notifytype;
	bool diagonal_dirs;
	float mossratio;
	v3s16 holesize;
	v3s16 roomsize;

	NoiseParams np_rarity;
	NoiseParams np_wetness;
	NoiseParams np_density;
};

class DungeonGen {
public:
	MMVManip *vm;
	Mapgen *mg;
	u32 blockseed;
	PseudoRandom random;
	v3s16 csize;

	content_t c_torch;
	DungeonParams dp;

	//RoomWalker
	v3s16 m_pos;
	v3s16 m_dir;

	DungeonGen(Mapgen *mg, DungeonParams *dparams);
	void generate(u32 bseed, v3s16 full_node_min, v3s16 full_node_max);

	void makeDungeon(v3s16 start_padding);
	void makeRoom(v3s16 roomsize, v3s16 roomplace);
	void makeCorridor(v3s16 doorplace, v3s16 doordir,
					  v3s16 &result_place, v3s16 &result_dir);
	void makeDoor(v3s16 doorplace, v3s16 doordir);
	void makeFill(v3s16 place, v3s16 size, u8 avoid_flags, MapNode n, u8 or_flags);
	void makeHole(v3s16 place);

	bool findPlaceForDoor(v3s16 &result_place, v3s16 &result_dir);
	bool findPlaceForRoomDoor(v3s16 roomsize, v3s16 &result_doorplace,
			v3s16 &result_doordir, v3s16 &result_roomplace);

	void randomizeDir()
	{
		m_dir = rand_ortho_dir(random, dp.diagonal_dirs);
	}
};

extern NoiseParams nparams_dungeon_rarity;
extern NoiseParams nparams_dungeon_wetness;
extern NoiseParams nparams_dungeon_density;

#endif


text:
<!doctype html>

<title>Reference for img wide.jpg; overflow:visible; -o-object-fit:fill; -o-object-position:left center</title>
<link rel="stylesheet" href="../../support/reftests.css">


text:
import elementToFunction from '../../src/libs/element-to-function';

describe('elementToFunction', () => {

    it('should return same class when its an Function', () => {

        elementToFunction(HTMLElement).should.have.property('prototype');
        elementToFunction(HTMLElement).should.be.Function();
        elementToFunction(HTMLElement).should.be.equal(HTMLElement);

    });

    it('should make object to Function with prototype', () => {

        let elementObject = {};
        elementToFunction(elementObject).should.have.property('prototype');
        elementToFunction(elementObject).should.be.Function();

    });

});


text:
@protocol WYAudioIODelegate <NSObject>

@end

typedef bool (*audioProcessingCallback) (void *clientdata, float **buffers, unsigned int inputChannels, unsigned int outputChannels, unsigned int numberOfSamples, unsigned int samplerate, uint64_t hostTime);

@interface WYAudioIO : NSObject

- (instancetype)initWithDelegate:(id)delegate preferredIOBufferDuration:(unsigned int)preferredIOBufferDuration preferredSampleRate:(unsigned int)preferredSampleRate audioSessionCategory:(NSString *)audioSessionCategory channels:(int)channels audioProcessingCallback:(audioProcessingCallback)callback clientdata:(void *)clientdata;

- (bool)start;
- (void)stop;

@end


text:
using Microsoft.VisualStudio.TestTools.UnitTesting;

using restlicsharpdata.restlidata;

namespace restlicsharpdata.restlidatatest
{
    [TestClass]
    public class BytesTests
    {
        [TestMethod]
        public void Init()
        {
            byte[] expected = new byte[] { 0, 1, 2, 3 };
            string input = "\u0000\u0001\u0002\u0003";

            try
            {
                Bytes output = new Bytes(BytesUtil.StringToBytes(input));
            }
            catch
            {
                Assert.Fail("Exception while instantiating Bytes object.");
            }
        }

        [TestMethod]
        public void Immutable()
        {
            string input = "\u0000\u0001\u0002\u0003";

            Bytes output = new Bytes(BytesUtil.StringToBytes(input));

            byte[] copy = output.GetBytes();
            const byte VALUE = 0x00ff;
            copy[0] = VALUE;
            CollectionAssert.AreNotEqual(copy, output.GetBytes());

            byte[] copy2 = output.GetBytes();
            const byte VALUE2 = 0x00ee;
            copy2[0] = VALUE2;
            CollectionAssert.AreNotEqual(copy, output.GetBytes());

            // Test that both copies are separate copies
            Assert.AreNotSame(copy2, copy);
            CollectionAssert.AreNotEqual(copy2, copy);
        }

        [TestMethod]
        public void CopyInitArg()
        {
            string input = "\u0000\u0001\u0002\u0003";
            byte[] inputBytes = BytesUtil.StringToBytes(input);

            Bytes output = new Bytes(inputBytes);

            Assert.AreNotSame(inputBytes, output.GetBytes());

            byte VALUE = 0x00ff;
            inputBytes[0] = VALUE;
            Assert.AreNotEqual(VALUE, output.GetBytes()[0]);
        }
    }
}


text:
This old bundles are for Symfony2.
The only thing you need to do if want to try it is make it run as a bundle in your symfony project.

The SshBundle was made for execute a command in the server (linux) were you are opening the proyect or other you want. The idea is basically, take the command, execute it through ssh in the desired server, and received back a text file with the result. Result that will be show on the web for you.


text:
<?php

namespace Concrete\Core\Entity\OAuth;

use Concrete\Core\Entity\Express\EntityRepository;
use Doctrine\ORM\EntityManagerInterface;
use League\OAuth2\Server\Entities\RefreshTokenEntityInterface;
use League\OAuth2\Server\Repositories\RefreshTokenRepositoryInterface;

class RefreshTokenRepository extends EntityRepository implements RefreshTokenRepositoryInterface
{

    /**
     * Creates a new refresh token
     *
     * @return RefreshTokenEntityInterface
     */
    public function getNewRefreshToken()
    {
        return new RefreshToken();
    }

    /**
     * Create a new refresh token_name.
     *
     * @param RefreshTokenEntityInterface $refreshTokenEntity
     * @throws \Exception
     */
    public function persistNewRefreshToken(RefreshTokenEntityInterface $refreshTokenEntity)
    {
        $this->getEntityManager()->transactional(function(EntityManagerInterface $em) use ($refreshTokenEntity) {
            $em->persist($refreshTokenEntity);
        });
    }

    /**
     * Revoke the refresh token.
     *
     * @param string $tokenId
     * @throws \Exception
     */
    public function revokeRefreshToken($tokenId)
    {
        $this->getEntityManager()->transactional(function(EntityManagerInterface $em) use ($tokenId) {
            $token = $this->find($tokenId);

            if ($token) {
                $em->remove($token);
            }
        });
    }

    /**
     * Check if the refresh token has been revoked.
     *
     * @param string $tokenId
     *
     * @return bool Return true if this token has been revoked
     */
    public function isRefreshTokenRevoked($tokenId)
    {
        return $this->find($tokenId) === null;
    }
}


text:
#region License

#endregion

#region Imports

using System;
using System.Runtime.Remoting.Lifetime;

using NUnit.Framework;

using Spring.Context;
using Spring.Context.Support;
using Spring.Remoting.Support;

#endregion

namespace Spring.Remoting
{
    /// <summary>
    /// Unit tests for the CaoExporter class.
    /// </summary>
    /// <author>Bruno Baia</author>
    [TestFixture]
    public class CaoExporterTests : BaseRemotingTestFixture
    {
        [Test]
        public void BailsWhenNotConfigured()
        {
            CaoExporter exp = new CaoExporter();
            Assert.Throws<ArgumentException>(() => exp.AfterPropertiesSet());
        }

        [Test]
        public void RegistersSimpleObject()
        {
            IApplicationContext ctx = new XmlApplicationContext("assembly://Spring.Services.Tests/Spring.Data.Spring.Remoting/caoLifetimeService.xml");
            ContextRegistry.RegisterContext(ctx);

            ICaoRemoteFactory caoFactory = Activator.GetObject(typeof(ICaoRemoteFactory), "tcp://localhost:8005/counter2") as ICaoRemoteFactory;
            Assert.IsNotNull(caoFactory, "Cao factory is null even though it has been registered.");

            MarshalByRefObject cao = caoFactory.GetObject() as MarshalByRefObject;
            Assert.IsNotNull(cao);
        }

        [Test]
        public void RegistersWithLifetimeService()
        {
            IApplicationContext ctx = new XmlApplicationContext("assembly://Spring.Services.Tests/Spring.Data.Spring.Remoting/caoLifetimeService.xml");
            ContextRegistry.RegisterContext(ctx);

            ICaoRemoteFactory caoFactory = Activator.GetObject(typeof(ICaoRemoteFactory), "tcp://localhost:8005/counter2") as ICaoRemoteFactory;
            Assert.IsNotNull(caoFactory, "Cao factory is null even though it has been registered.");

            MarshalByRefObject cao = caoFactory.GetObject() as MarshalByRefObject;
            Assert.IsNotNull(cao);

            ILease lease = (ILease) cao.GetLifetimeService();
            Assert.AreEqual(TimeSpan.FromMilliseconds(10000), lease.InitialLeaseTime, "InitialLeaseTime");
            Assert.AreEqual(TimeSpan.FromMilliseconds(1000), lease.RenewOnCallTime, "RenewOnCallTime");
            Assert.AreEqual(TimeSpan.FromMilliseconds(100), lease.SponsorshipTimeout, "SponsorshipTimeout");
        }
    }
}


text:
package org.apache.axis2.wsdl.codegen.writer;

import java.io.File;

public class InterfaceImplementationWriter extends FileWriter {
    public InterfaceImplementationWriter(String outputFileLocation) {
        this.outputFileLocation = new File(outputFileLocation);
    }

    public InterfaceImplementationWriter(File outputFileLocation,
                                         String language) {
        this.outputFileLocation = outputFileLocation;
        this.language = language;
    }

}


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\models\Decreto */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'nombre')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'gaceta')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'fecha')->textInput() ?>

        <?= Html::submitButton($model->isNewRecord ? Yii::t('models', 'Create') : Yii::t('models', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>

    <?php ActiveForm::end(); ?>


text:
from xdg import BaseDirectory
import time
import os
import urllib
from urllib2 import urlopen
from lxml import etree

EVECACHEPATH=os.path.join(BaseDirectory.xdg_cache_home, "evedustrial")
class EveXmlException(Exception):
    def __init__(self, trouble_element):
        self.element = trouble_element

class EveXml(object):
    """
    This class is responsible for handling the generic elements which
    exist in all Eve API objects, such as timestamp, caching style,
    and other metadata.
    """

    def __init__(self):
        self.fetchedtime = None
        self.cacheduntil = None
        self.api_version = None
        self.xml = None
        self.is_shortcache = False
        self.label = type(self).__name__

    def cached_name(self):
        name = os.path.join(EVECACHEPATH, self.label + "_" +
            "_".join(self.args.values())+ ".xml")
        return name

    def refresh(self, force=False):
        self.update_xml(force)
        self.parse_xml()

    def update_xml(self, force=False):
        fname = self.cached_name()
        if force and self.is_short_cache:
            # Forcing an update on short_cache stuff
            # won't help us.
            return
        if (os.path.exists(fname) and not force):
            f = open(fname, 'r')
            self.xml = f.read()
            f.close()
            self.parse_xml()
        if (self.cacheduntil < time.gmtime()) or force:
            url_args = urllib.urlencode(self.args)
            self.xml = urlopen(self.url, url_args).read()
            if not os.path.exists(EVECACHEPATH):
                os.makedirs(EVECACHEPATH)
            f = open(fname, 'w')
            f.write(self.xml)

    def parse_xml(self):
        if not self.xml:
            self.update_xml()
        self.xmlroot = etree.fromstring(self.xml)
        xmlroot = self.xmlroot
        eveapi = xmlroot.xpath("/eveapi")
        self.api_version = float(eveapi[0].attrib["version"])

        fetchedtime = xmlroot.xpath("/eveapi/currentTime")
        fetchedtime = fetchedtime[0].text
        fetchedtime = time.strptime(fetchedtime, "%Y-%m-%d %H:%M:%S")
        self.fetchedtime = fetchedtime

        cacheduntil = xmlroot.xpath("/eveapi/cachedUntil")
        cacheduntil = cacheduntil[0].text
        cacheduntil = time.strptime(cacheduntil, "%Y-%m-%d %H:%M:%S")
        self.cacheduntil = cacheduntil

        return


text:
module Candies
  module Server
    class Base
      attr_accessor :request, :id, :responders

      def initialize(responders = {})
        @responders = responders
      end

      def call(env)
        @request = Rack::Request.new(env)
        @responders.fetch(format) {@responders[:json]}.call(env)
      end

      protected
        def format
          @request.path.split(".").last.to_sym
        end

        def tracker
          @request.path.match(/^\/(\w+)\.?(\w+$)?/)[1]
        end

        def id
          @id ||= @request.params.delete("id")
        end

        def status
          200
        end

    end
  end
end


text:
@implementation FLObjectDatabase

- (void) deleteObject:(id) inputObject {
    FLAssertIsNotNilWithComment(inputObject, nil);

    FLDatabaseTable* table = [[inputObject class] sharedDatabaseTable];

    FLDatabaseStatement* statement = [FLDatabaseStatement databaseStatement:table];
    [statement appendString:SQL_DELETE];
    [statement appendString:SQL_FROM andString:table.tableName];

    if(![statement appendWhereClauseForSelectingObject:inputObject]) {
        FLThrowErrorCodeWithComment(FLObjectDatabaseErrorDomain, FLDatabaseErrorNoParametersSpecified, @"No parameters specified");
    }

    [self executeStatement:statement];

    FLPerformSelector1(inputObject, @selector(wasRemovedFromDatabase:), self);
}

- (NSArray*) readObjectsMatchingInputObject:(id) inputObject
                              columnsFilter:(NSArray*) columnsFilter {

    FLAssertNotNil(inputObject);

    if(!inputObject) {
        return nil;
    }

    __block NSMutableArray* outObjects = nil;

	FLDatabaseTable* table = [[inputObject class] sharedDatabaseTable];

    FLDatabaseStatement* statement = [FLDatabaseStatement databaseStatement:table];

    NSString* resultColumns = [FLSqlBuilder sqlListFromArray:columnsFilter
                                                   delimiter:@","
                                                withinParens:NO
                                    prefixDelimiterWithSpace:NO
                                                 emptyString:SQL_ALL];

    [statement appendString:SQL_SELECT andString:resultColumns];
    [statement appendString:SQL_FROM andString:table.tableName];

    if(![statement appendWhereClauseForSelectingObject:inputObject]) {
        FLAssertFailed();
    }

    statement.objectResultBlock = ^(id object, BOOL* stop) {

        if(!outObjects) {
            outObjects = [NSMutableArray arrayWithObject:object];
        }
        else {
            [outObjects addObject:object];
        }
    };

    statement.finished = ^{

    };

    [self executeStatement:statement];

    return outObjects;
}

- (NSArray*) readAllObjectsInTable:(FLDatabaseTable*) table {

    FLAssertNotNil(table);

    __block NSMutableArray* outObjects = nil;

    FLDatabaseStatement* statement = [FLDatabaseStatement databaseStatement:table];
    [statement appendString:SQL_SELECT andString:SQL_ALL];
    [statement appendString:SQL_FROM andString:table.tableName];

    statement.objectResultBlock = ^(id object, BOOL* stop) {

        if(!outObjects) {
            outObjects = [NSMutableArray arrayWithObject:object];
        }
        else {
            [outObjects addObject:object];
        }
    };

    [self executeStatement:statement];

    return outObjects;
}

- (NSArray*) readAllObjectsForClass:(Class) aClass {
	return [self readAllObjectsInTable:[aClass sharedDatabaseTable]];
}

- (NSUInteger) objectCountForClass:(Class) aClass {
    return [self rowCountForTable:[aClass sharedDatabaseTable]];
}

- (void) deleteAllObjectsForClass:(Class) aClass {
    [self dropTable:[aClass sharedDatabaseTable]];
}

- (id) readObject:(id) inputObject {
    FLAssertNotNil(inputObject);

    if(!inputObject) {
        return nil;
	}

    NSArray* array = [self readObjectsMatchingInputObject:inputObject];
	if(array) {
		if(array.count == 1) {
			return FLRetainWithAutorelease(([array objectAtIndex:0]));
		}
		else if(array.count > 1) {
			FLThrowErrorCodeWithComment(FLObjectDatabaseErrorDomain, FLDatabaseErrorTooManyObjectsReturned,
                             ([NSString stringWithFormat:@"Too many objects returned for input object of type: %@", NSStringFromClass([inputObject class])]));
		}
	}

	return nil;
}

- (NSArray*) readObjectsMatchingInputObject:(id) inputObject {
	return [self readObjectsMatchingInputObject:inputObject columnsFilter:nil];
}

- (BOOL) containsObject:(id) inputObject
{
	if(!inputObject) {
		FLThrowErrorCodeWithComment(FLObjectDatabaseErrorDomain, FLDatabaseErrorInvalidInputObject, @"null input object");
	}

    __block BOOL foundIt = NO;

	FLDatabaseTable* table = [[inputObject class] sharedDatabaseTable];
    FLDatabaseStatement* statement = [FLDatabaseStatement databaseStatement:table];

    // TODO: it'd be faster to just load only primary key columns instead of all columns

    [statement appendString:SQL_SELECT andString:SQL_ALL];
    [statement appendString:SQL_FROM andString:table.tableName];

    if(![statement appendWhereClauseForSelectingObject:inputObject]) {

        FLAssertFailedWithComment(@"No.");
    }

    statement.rowResultBlock = ^(NSDictionary* row, BOOL* stop) {
        foundIt = YES;
        *stop = YES;
    };

    [self executeStatement:statement];

    return foundIt;
}

- (void) writeObject:(id) object {
    FLDatabaseTable* table = [[object class] sharedDatabaseTable];
    FLDatabaseStatement* statement = [FLDatabaseStatement databaseStatement:table];
    [statement appendString:SQL_INSERT];
    [statement appendString:SQL_OR];
    [statement appendString:SQL_REPLACE];
    [statement appendString:SQL_INTO andString:table.tableName];
    [statement appendInsertClauseForObject:object];
    [self executeStatement:statement];

    FLPerformSelector1(object, @selector(wasSavedToDatabase:), self);

}

- (void) writeObjectsInArray:(NSArray*) array {
	if(array && array.count) {
        [self executeTransaction:^{
            for(id object in array) {
                [self writeObject:object];
            }
        }];
    }
}

//- (id) sqlStatement:(FLSqlStatement*) statement
//   willDecodeObject:(NSData*) data
//          forTable:(FLDatabaseTable*) table
//          forColumn:(FLDatabaseColumn*) column {
//
//    FLObjectDescriber* objectDescriber = [[table classRepresentedByTable] objectDescriber];
//
//    FLPropertyDescriber* property = [objectDescriber propertyForName:column.decodedColumnName];
//
//    if(property) {
//        return [property representedObjectFromSqliteColumnData:data];
//    }
//
//    return nil;
//}

@end


text:
class DbiSugar
  def initialize(rsc)
    @rsc = rsc;
  end

  def method_missing(method_name, *args)
    @rsc.dbi(method_name)
  end
end


text:
/*
 * Global variables; used for tests and metrics
 *
 * @exception_safe: nothrow
 * @thread_safe: no
 */

#ifndef UPS_GLOBALS_H
#define UPS_GLOBALS_H

#include "0root/root.h"

#include "ups/types.h"

// Always verify that a file of level N does not include headers > N!
#include "1base/error.h"

#ifndef UPS_ROOT_H
#  error "root.h was not included"
#endif

namespace upscaledb {

struct Globals {
  // for counting extended keys
  static uint64_t ms_extended_keys;

  // for counting extended duplicate tables
  static uint64_t ms_extended_duptables;

  // Move every key > threshold to a blob. For testing purposes.
  // TODO currently gets assigned at runtime
  static uint32_t ms_extended_threshold;

  // Create duplicate table if amount of duplicates > threshold. For testing
  // purposes.
  // TODO currently gets assigned at runtime
  static uint32_t ms_duplicate_threshold;

  // linear search threshold for the PAX layout
  static int ms_linear_threshold;

  // used in error.h/error.cc
  static int ms_error_level;

  // used in error.h/error.cc
  static const char *ms_error_file;

  // used in error.h/error.cc
  static int ms_error_line;

  // used in error.h/error.cc
  static const char *ms_error_expr;

  // used in error.h/error.cc
  static const char *ms_error_function;

  // used in error.h/error.cc
  static ups_error_handler_fun ms_error_handler;

  // Tracking key bytes before compression
  static uint64_t ms_bytes_before_compression;

  // Tracking key bytes after compression
  static uint64_t ms_bytes_after_compression;

  // enable/disable SIMD
  static bool ms_is_simd_enabled;

  // usage metrics - number of page splits
  static uint64_t ms_btree_smo_split;

  // usage metrics - number of page merges
  static uint64_t ms_btree_smo_merge;

  // usage metrics - number of page shifts
  static uint64_t ms_btree_smo_shift;
};

} // namespace upscaledb

#endif /* UPS_GLOBALS_H */