text:
namespace chauffeur
{
  using namespace std;

  void GPUDriverRewriteVisitor::InstrumentEntryPoints(FunctionDecl* funcDecl, string fdFile)
  {
    if (funcDecl->getStorageClass() == SC_Static)
      RW.RemoveText(funcDecl->getInnerLocStart(), 7);
    return;
  }

  void GPUDriverRewriteVisitor::CreateCheckerFunction(FunctionDecl* funcDecl, string fdFile)
  {
    string device_str;
    string shared_struct_str;

    FileID fileId = Context->getSourceManager().getFileID(funcDecl->getLocation());
    SourceLocation loc = Context->getSourceManager().getLocForEndOfFile(fileId);

    RW.InsertText(loc, "\n", true, true);
    RW.InsertText(loc, "void whoop$checker(", true, true);

    map<string, string> func_params;
    for (auto i = funcDecl->param_begin(), e = funcDecl->param_end(); i != e; ++i)
    {
      ValueDecl *paramVal = cast<ValueDecl>(*i);
      NamedDecl *paramNam = cast<NamedDecl>(*i);

      string paramType = paramVal->getType().getAsString(Context->getPrintingPolicy());
      string paramName = paramNam->getNameAsString();

      func_params[paramType] = paramName;

      if (i == funcDecl->param_begin())
        RW.InsertText(loc, paramType + " " + paramName + ", ", true, true);
      else
        RW.InsertText(loc, paramType + " " + paramName, true, true);
    }

    RW.InsertText(loc, ")\n", true, true);
    RW.InsertText(loc, "{\n", true, true);

    RW.InsertText(loc, "\tstruct block_device *whoop_bdev = (struct block_device *) malloc(sizeof(struct block_device));\n", true, true);
    RW.InsertText(loc, "\tstruct platform_device *whoop_platform_device = (struct platform_device *) malloc(sizeof(struct platform_device));\n", true, true);
    RW.InsertText(loc, "\tstruct cdrom_device_info *whoop_cdrom_device_info = (struct cdrom_device_info *) malloc(sizeof(struct cdrom_device_info));\n", true, true);
    RW.InsertText(loc, "\tstruct cdrom_multisession *whoop_cdrom_multisession = (struct cdrom_multisession *) malloc(sizeof(struct cdrom_multisession));\n", true, true);
    RW.InsertText(loc, "\tstruct ps3_system_bus_device *whoop_ps3_system_bus_device = (struct ps3_system_bus_device *) malloc(sizeof(struct ps3_system_bus_device));\n", true, true);
    RW.InsertText(loc, "\tstruct hd_geometry *whoop_geo = (struct hd_geometry *) malloc(sizeof(struct hd_geometry));\n", true, true);
    RW.InsertText(loc, "\tstruct inode *whoop_inode = (struct inode *) malloc(sizeof(struct inode));\n", true, true);
    RW.InsertText(loc, "\tstruct file *whoop_file = (struct file *) malloc(sizeof(struct file));\n", true, true);
    RW.InsertText(loc, "\tconst char *whoop_buf = (char *) malloc(sizeof(char));\n", true, true);
    RW.InsertText(loc, "\tstruct gendisk *whoop_disk = (struct gendisk *) malloc(sizeof(struct gendisk));\n\n", true, true);

    RW.InsertText(loc, "\tint whoop_int = __SMACK_nondet();\n", true, true);
    RW.InsertText(loc, "\t__SMACK_code(\"assume @ >= @;\", whoop_int, 0);\n\n", true, true);

    auto entry_points = DI->getInstance().GetEntryPoints();
    for(auto i = entry_points.rbegin(); i != entry_points.rend(); i++)
    {
      string entry_point_call;
      entry_point_call = "" + i->first + "(";

      for(auto j = i->second.begin(); j != i->second.end(); j++)
      {
        if (*j == "void")
          entry_point_call += "";
        else if (*j == "void *")
          entry_point_call += "NULL, ";
        else if (*j == "u64 *")
          entry_point_call += "NULL, ";
        else if (*j == "u8 *")
          entry_point_call += "NULL, ";
        else if (*j == "struct block_device *")
          entry_point_call += "whoop_bdev, ";
        else if (*j == "struct platform_device *")
          entry_point_call += "whoop_platform_device, ";
        else if (*j == "struct cdrom_device_info *")
          entry_point_call += "whoop_cdrom_device_info, ";
        else if (*j == "struct cdrom_multisession *")
          entry_point_call += "whoop_cdrom_multisession, ";
        else if (*j == "struct ps3_system_bus_device *")
          entry_point_call += "whoop_ps3_system_bus_device, ";
        else if (*j == "struct hd_geometry *")
          entry_point_call += "whoop_geo, ";
        else if (*j == "struct inode *")
          entry_point_call += "whoop_inode, ";
        else if (*j == "struct file *")
          entry_point_call += "whoop_file, ";
        else if (*j == "struct gendisk *")
          entry_point_call += "whoop_disk, ";
        else if (*j == "char *")
          entry_point_call += "whoop_buf, ";
        else if (*j == "const char *")
          entry_point_call += "whoop_buf, ";
        else if (*j == "size_t")
          entry_point_call += "whoop_int, ";
        else if (*j == "int")
          entry_point_call += "whoop_int, ";
        else if (*j == "unsigned int")
          entry_point_call += "whoop_int, ";
        else if (*j == "long")
          entry_point_call += "whoop_int, ";
        else if (*j == "unsigned long")
          entry_point_call += "whoop_int, ";
        else if (*j == "u32")
          entry_point_call += "whoop_int, ";
        else if (*j == "fmode_t")
          entry_point_call += "whoop_int, ";
        else
          entry_point_call += *j + ", ";
      }

      if (entry_point_call != i->first + "(")
      {
        entry_point_call.resize(entry_point_call.size() - 2);
      }

      RW.InsertText(loc, "\t" + entry_point_call + ");\n", true, true);
    }

    RW.InsertText(loc, "}", true, true);
  }

  string GPUDriverRewriteVisitor::GetSharedStructStr(CallExpr *callExpr)
  {
    return "";
  }
}


text:
<?php

declare(strict_types=1);

namespace Smuuf\Primi\Helpers\Wrappers;

/**
 * A "wrapper" control structure emulating Python's context manager behavior.
 * This is to provide easy-to-use resource management (so you don't forget
 * anything important after doing something).
 *
 * For details about context managers in Python see:
 * https://docs.python.org/3/library/contextlib.html.
 *
 * Classes may extend this abstract wrapper class and then use it:
 *
 * ```php
 * class YayWrapper extends AbstractWrapper {
 *   public function executeBefore() {
 *     echo "yay enter";
 *   }
 *
 *   public function executeAfter() {
 *     echo "yay exit";
 *   }
 * }
 *
 * $wrapper = new YayWrapper;
 * $wrapper->wrap(function() {
 *   // 'yay enter' will be echoed first.
 *   echo "something.";
 *   // 'yay exit' will be echoed last.
 * });
 * ```
 */
abstract class AbstractWrapper {

	/**
	 * @return mixed
	 */
	public function wrap(callable $fn) {

		$enterRetval = $this->executeBefore();
		try {
			$retval = $fn($enterRetval);
			unset($fn);
			return $retval;
		} finally {
			$this->executeAfter();
		}

	}

	/**
	 * @return mixed
	 */
	abstract public function executeBefore();

	abstract public function executeAfter(): void;

}

redpajama_set_name: RedPajamaGithub


text:
import _ from 'lodash';

// environment names
export const ENV_NAME_DEVELOPMENT = 'DEV';
export const ENV_NAME_STAGING = 'STAGE';
export const ENV_NAME_PRODUCTION = 'PROD';

/*eslint-disable */
export const SENTRY_PRODUCTION_KEY = 'https://c037c826f1864e28a674dcba23350b4b@sentry.io/106472';
export const SENTRY_STAGING_KEY = 'https://6d2bfa8c878d4905b2537647032f61c8@sentry.io/106473';
/*eslint-enable */

// these constants are configuration settings in the application
export const NO_TRANSPARENCY = 1;
export const DEFAULT_TRANSPARENCY = 0.3;

export const VIEW_SIZES = {
  week: 7,
  day: 1,
};

const DEFAULT_REFETCH_INTERVAL = 10;

// in seconds
const REFETCH_INTERVALS = {
  ASSOCIATIONS: 60,
  WHOAMI: 30,
  COMPANY: 60,
  EMPLOYEES: 60,
  TEAMS: 60,
  TEAM_EMPLOYEES: 60,
  TEAM_JOBS: 60,
  TEAM_SHIFTS: 10,
  DEFAULT: DEFAULT_REFETCH_INTERVAL,
};

export function getRefetchInterval(endpoint) {
  return _.get(REFETCH_INTERVALS, endpoint, DEFAULT_REFETCH_INTERVAL);
}

// moment date object displays
export const MOMENT_DAY_DATE_DISPLAY = 'ddd M/D';
export const MOMENT_DATE_DISPLAY = 'M/D';
export const MOMENT_ISO_DATE = 'YYYY-MM-DD';
export const MOMENT_CALENDAR_START_DISPLAY = 'MMM D';
export const MOMENT_CALENDAR_END_DISPLAY = 'MMM D, YYYY';
export const MOMENT_CALENDAR_TIME_DISPLAY = 'h:mm A z';
export const MOMENT_SHIFT_CARD_TIMES = 'h:mm a';
export const API_TIME_FORMAT = 'YYYY-MM-DDTHH:mm:ss';

export const SCHEDULING_VIEW_BY_OPTIONS = [
  {
    id: 'employee',
    name: 'Employee',
  },
  {
    id: 'job',
    name: 'Job',
  },
];

export const UNASSIGNED_SHIFT_NAME = 'Unassigned Shift';

export const DAY_NAME_LETTER_MAP = {
  monday: 'M',
  tuesday: 'T',
  wednesday: 'W',
  thursday: 'Th',
  friday: 'F',
  saturday: 'Sa',
  sunday: 'Su',
};


text:
from django.core.files.storage import get_storage_class
from storages.backends.s3boto import S3BotoStorage

class CachedS3BotoStorage(S3BotoStorage):
    """
    S3 storage backend that saves the files locally, too.
    """
    def __init__(self, *args, **kwargs):
        super(CachedS3BotoStorage, self).__init__(*args, **kwargs)
        self.local_storage = get_storage_class(
            "compressor.storage.CompressorFileStorage")()

    def save(self, name, content):
        name = super(CachedS3BotoStorage, self).save(name, content)
        self.local_storage._save(name, content)
        return name

    def url(self, name):
        u = self.bucket.get_key(name).generate_url(3600, method='GET')
        if u.find('?') > 0:
            u = u[:u.find('?')]
        if u.find('#') > 0:
            u = u[:u.find('#')]

        return u


text:
const os = require('os');
const fs = require('fs-extra');
const path = require('path');
const rewire = require('rewire');
const EventEmitter = require('events');

const PluginInfo = require('cordova-common').PluginInfo;
const Api = require('../../../../bin/templates/scripts/cordova/Api');
const projectFile = require('../../../../bin/templates/scripts/cordova/lib/projectFile');
const pluginHandlers = rewire('../../../../bin/templates/scripts/cordova/lib/plugman/pluginHandlers');

const temp = path.join(os.tmpdir(), 'plugman');

const FIXTURES = path.join(__dirname, '../fixtures');
const iosProject = path.join(FIXTURES, 'ios-config-xml');
const faultyplugin = path.join(FIXTURES, 'org.test.plugins.faultyplugin');
const dummyplugin = path.join(FIXTURES, 'org.test.plugins.dummyplugin');
const weblessplugin = path.join(FIXTURES, 'org.test.plugins.weblessplugin');

const dummyPluginInfo = new PluginInfo(dummyplugin);
const dummy_id = dummyPluginInfo.id;
const valid_source = dummyPluginInfo.getSourceFiles('ios');
const valid_headers = dummyPluginInfo.getHeaderFiles('ios');
const valid_resources = dummyPluginInfo.getResourceFiles('ios');
const valid_custom_frameworks = dummyPluginInfo.getFrameworks('ios').filter(f => f.custom);
const valid_embeddable_custom_frameworks = dummyPluginInfo.getFrameworks('ios').filter(f => f.custom && f.embed);
const valid_weak_frameworks = dummyPluginInfo.getFrameworks('ios').filter(f => !(f.custom) && f.weak);

const faultyPluginInfo = new PluginInfo(faultyplugin);
const invalid_source = faultyPluginInfo.getSourceFiles('ios');
const invalid_headers = faultyPluginInfo.getHeaderFiles('ios');
const invalid_resources = faultyPluginInfo.getResourceFiles('ios');
const invalid_custom_frameworks = faultyPluginInfo.getFrameworks('ios').filter(f => f.custom);

const weblessPluginInfo = new PluginInfo(weblessplugin);

function copyArray (arr) {
    return Array.prototype.slice.call(arr, 0);
}

function slashJoin () {
    // In some places we need to use forward slash instead of path.join().
    // See CB-7311.
    return Array.prototype.join.call(arguments, '/');
}

describe('ios plugin handler', () => {
    let dummyProject;

    beforeEach(() => {
        fs.copySync(iosProject, temp);
        projectFile.purgeProjectFileCache(temp);

        dummyProject = projectFile.parse({
            root: temp,
            pbxproj: path.join(temp, 'SampleApp.xcodeproj/project.pbxproj')
        });
    });

    afterEach(() => {
        fs.removeSync(temp);
    });

    describe('installation', () => {
        describe('of <source-file> elements', () => {
            const install = pluginHandlers.getInstaller('source-file');

            beforeEach(() => {
                spyOn(dummyProject.xcode, 'addSourceFile');
            });

            it('Test 001 : should throw if source-file src cannot be found', () => {
                const source = copyArray(invalid_source);
                expect(() => {
                    install(source[1], faultyPluginInfo, dummyProject);
                }).toThrow();
            });
            it('Test 002 : should throw if source-file target already exists', () => {
                const source = copyArray(valid_source);
                const target = path.join(temp, 'SampleApp', 'Plugins', dummy_id, 'DummyPluginCommand.m');
                fs.ensureDirSync(path.dirname(target));
                fs.writeFileSync(target, 'some bs', 'utf-8');
                expect(() => {
                    install(source[0], dummyPluginInfo, dummyProject);
                }).toThrow();
            });
            it('Test 003 : should call into xcodeproj\'s addSourceFile appropriately when element has no target-dir', () => {
                const source = copyArray(valid_source).filter(s => s.targetDir === undefined);
                install(source[0], dummyPluginInfo, dummyProject);
                expect(dummyProject.xcode.addSourceFile)
                    .toHaveBeenCalledWith(slashJoin('Plugins', dummy_id, 'DummyPluginCommand.m'), {});
            });
            it('Test 004 : should call into xcodeproj\'s addSourceFile appropriately when element has a target-dir', () => {
                const source = copyArray(valid_source).filter(s => s.targetDir !== undefined);
                install(source[0], dummyPluginInfo, dummyProject);
                expect(dummyProject.xcode.addSourceFile)
                    .toHaveBeenCalledWith(slashJoin('Plugins', dummy_id, 'targetDir', 'TargetDirTest.m'), {});
            });
            it('Test 005 : should cp the file to the right target location when element has no target-dir', () => {
                const source = copyArray(valid_source).filter(s => s.targetDir === undefined);
                spyOn(fs, 'copySync');
                install(source[0], dummyPluginInfo, dummyProject);
                expect(fs.copySync).toHaveBeenCalledWith(path.join(dummyplugin, 'src', 'ios', 'DummyPluginCommand.m'), path.join(temp, 'SampleApp', 'Plugins', dummy_id, 'DummyPluginCommand.m'));
            });
            it('Test 006 : should cp the file to the right target location when element has a target-dir', () => {
                const source = copyArray(valid_source).filter(s => s.targetDir !== undefined);
                spyOn(fs, 'copySync');
                install(source[0], dummyPluginInfo, dummyProject);
                expect(fs.copySync).toHaveBeenCalledWith(path.join(dummyplugin, 'src', 'ios', 'TargetDirTest.m'), path.join(temp, 'SampleApp', 'Plugins', dummy_id, 'targetDir', 'TargetDirTest.m'));
            });
            it('Test 007 : should call into xcodeproj\'s addFramework appropriately when element has framework=true set', () => {
                const source = copyArray(valid_source).filter(s => s.framework);
                spyOn(dummyProject.xcode, 'addFramework');
                install(source[0], dummyPluginInfo, dummyProject);
                expect(dummyProject.xcode.addFramework)
                    .toHaveBeenCalledWith(path.join('SampleApp', 'Plugins', dummy_id, 'SourceWithFramework.m'), { weak: false });
            });
        });

        describe('of <header-file> elements', () => {
            const install = pluginHandlers.getInstaller('header-file');

            beforeEach(() => {
                spyOn(dummyProject.xcode, 'addHeaderFile');
            });

            it('Test 008 : should throw if header-file src cannot be found', () => {
                const headers = copyArray(invalid_headers);
                expect(() => {
                    install(headers[1], faultyPluginInfo, dummyProject);
                }).toThrow();
            });
            it('Test 009 : should throw if header-file target already exists', () => {
                const headers = copyArray(valid_headers);
                const target = path.join(temp, 'SampleApp', 'Plugins', dummy_id, 'DummyPluginCommand.h');
                fs.ensureDirSync(path.dirname(target));
                fs.writeFileSync(target, 'some bs', 'utf-8');
                expect(() => {
                    install(headers[0], dummyPluginInfo, dummyProject);
                }).toThrow();
            });
            it('Test 010 : should call into xcodeproj\'s addHeaderFile appropriately when element has no target-dir', () => {
                const headers = copyArray(valid_headers).filter(s => s.targetDir === undefined);
                install(headers[0], dummyPluginInfo, dummyProject);
                expect(dummyProject.xcode.addHeaderFile)
                    .toHaveBeenCalledWith(slashJoin('Plugins', dummy_id, 'DummyPluginCommand.h'));
            });
            it('Test 011 : should call into xcodeproj\'s addHeaderFile appropriately when element a target-dir', () => {
                const headers = copyArray(valid_headers).filter(s => s.targetDir !== undefined);
                install(headers[0], dummyPluginInfo, dummyProject);
                expect(dummyProject.xcode.addHeaderFile)
                    .toHaveBeenCalledWith(slashJoin('Plugins', dummy_id, 'targetDir', 'TargetDirTest.h'));
            });
            it('Test 012 : should cp the file to the right target location when element has no target-dir', () => {
                const headers = copyArray(valid_headers).filter(s => s.targetDir === undefined);
                spyOn(fs, 'copySync');
                install(headers[0], dummyPluginInfo, dummyProject);
                expect(fs.copySync).toHaveBeenCalledWith(path.join(dummyplugin, 'src', 'ios', 'DummyPluginCommand.h'), path.join(temp, 'SampleApp', 'Plugins', dummy_id, 'DummyPluginCommand.h'));
            });
            it('Test 013 : should cp the file to the right target location when element has a target-dir', () => {
                const headers = copyArray(valid_headers).filter(s => s.targetDir !== undefined);
                spyOn(fs, 'copySync');
                install(headers[0], dummyPluginInfo, dummyProject);
                expect(fs.copySync).toHaveBeenCalledWith(path.join(dummyplugin, 'src', 'ios', 'TargetDirTest.h'), path.join(temp, 'SampleApp', 'Plugins', dummy_id, 'targetDir', 'TargetDirTest.h'));
            });
        });

        describe('of <resource-file> elements', () => {
            const install = pluginHandlers.getInstaller('resource-file');

            beforeEach(() => {
                spyOn(dummyProject.xcode, 'addResourceFile');
            });

            it('Test 014 : should throw if resource-file src cannot be found', () => {
                const resources = copyArray(invalid_resources);
                expect(() => {
                    install(resources[0], faultyPluginInfo, dummyProject);
                }).toThrow(new Error(`Cannot find resource file "${path.resolve(faultyplugin, 'src/ios/IDontExist.bundle')}" for plugin ${faultyPluginInfo.id} in iOS platform`));
            });
            it('Test 015 : should throw if resource-file target already exists', () => {
                const resources = copyArray(valid_resources);
                const target = path.join(temp, 'SampleApp', 'Resources', 'DummyPlugin.bundle');
                fs.ensureDirSync(path.dirname(target));
                fs.writeFileSync(target, 'some bs', 'utf-8');
                expect(() => {
                    install(resources[0], dummyPluginInfo, dummyProject);
                }).toThrow(new Error(`File already exists at destination "${target}" for resource file specified by plugin ${dummyPluginInfo.id} in iOS platform`));
            });
            it('Test 016 : should call into xcodeproj\'s addResourceFile', () => {
                const resources = copyArray(valid_resources);
                install(resources[0], dummyPluginInfo, dummyProject);
                expect(dummyProject.xcode.addResourceFile)
                    .toHaveBeenCalledWith(path.join('Resources', 'DummyPlugin.bundle'));
            });
            it('Test 017 : should cp the file to the right target location', () => {
                const resources = copyArray(valid_resources);
                spyOn(fs, 'copySync');
                install(resources[0], dummyPluginInfo, dummyProject);
                expect(fs.copySync).toHaveBeenCalledWith(path.join(dummyplugin, 'src', 'ios', 'DummyPlugin.bundle'), path.join(temp, 'SampleApp', 'Resources', 'DummyPlugin.bundle'));
            });

            it('Test 018 : should link files to the right target location', () => {
                const resources = copyArray(valid_resources);
                const spy = spyOn(fs, 'linkSync');
                install(resources[0], dummyPluginInfo, dummyProject, { link: true });
                const src_bundle = path.join(dummyplugin, 'src', 'ios', 'DummyPlugin.bundle');
                const dest_bundle = path.join(temp, 'SampleApp/Resources/DummyPlugin.bundle');
                expect(spy).toHaveBeenCalledWith(src_bundle, dest_bundle);
            });
        });

        describe('of <framework> elements', () => {
            const install = pluginHandlers.getInstaller('framework');
            beforeEach(() => {
                spyOn(dummyProject.xcode, 'addFramework');
            });

            it('Test 019 : should call into xcodeproj\'s addFramework', () => {
                let frameworks = copyArray(valid_custom_frameworks);
                install(frameworks[0], dummyPluginInfo, dummyProject);
                expect(dummyProject.xcode.addFramework)
                    .toHaveBeenCalledWith('SampleApp/Plugins/org.test.plugins.dummyplugin/Custom.framework', { customFramework: true, embed: false, link: true, sign: true });

                frameworks = copyArray(valid_embeddable_custom_frameworks);
                install(frameworks[0], dummyPluginInfo, dummyProject);
                expect(dummyProject.xcode.addFramework)
                    .toHaveBeenCalledWith('SampleApp/Plugins/org.test.plugins.dummyplugin/CustomEmbeddable.framework', { customFramework: true, embed: true, link: false, sign: true });

                frameworks = copyArray(valid_weak_frameworks);
                install(frameworks[0], dummyPluginInfo, dummyProject);
                expect(dummyProject.xcode.addFramework)
                    .toHaveBeenCalledWith('src/ios/libsqlite3.dylib', { customFramework: false, embed: false, link: true, weak: true });
            });

            // TODO: Add more tests to cover the cases:
            // * framework with weak attribute
            // * framework that shouldn't be added/removed

            describe('with custom="true" attribute', () => {
                it('Test 020 : should throw if framework src cannot be found', () => {
                    const frameworks = copyArray(invalid_custom_frameworks);
                    expect(() => {
                        install(frameworks[0], faultyPluginInfo, dummyProject);
                    }).toThrow(new Error(`Cannot find framework "${path.resolve(faultyplugin, 'src/ios/NonExistantCustomFramework.framework')}" for plugin ${faultyPluginInfo.id} in iOS platform`));
                });
                it('Test 021 : should throw if framework target already exists', () => {
                    const frameworks = copyArray(valid_custom_frameworks);
                    const target = path.join(temp, 'SampleApp/Plugins/org.test.plugins.dummyplugin/Custom.framework');
                    fs.ensureDirSync(target);
                    expect(() => {
                        install(frameworks[0], dummyPluginInfo, dummyProject);
                    }).toThrow(new Error(`Framework "${target}" for plugin ${dummyPluginInfo.id} already exists in iOS platform`));
                });
                it('Test 022 : should cp the file to the right target location', () => {
                    const frameworks = copyArray(valid_custom_frameworks);
                    spyOn(fs, 'copySync');
                    install(frameworks[0], dummyPluginInfo, dummyProject);
                    expect(fs.copySync).toHaveBeenCalledWith(path.join(dummyplugin, 'src', 'ios', 'Custom.framework'),
                        path.join(temp, 'SampleApp/Plugins/org.test.plugins.dummyplugin/Custom.framework'));
                });

                it('Test 023 : should deep symlink files to the right target location', () => {
                    const frameworks = copyArray(valid_custom_frameworks);
                    const spy = spyOn(fs, 'linkSync');
                    install(frameworks[0], dummyPluginInfo, dummyProject, { link: true });
                    const src_binlib = path.join(dummyplugin, 'src', 'ios', 'Custom.framework', 'somebinlib');
                    const dest_binlib = path.join(temp, 'SampleApp/Plugins/org.test.plugins.dummyplugin/Custom.framework/somebinlib');
                    expect(spy).toHaveBeenCalledWith(src_binlib, dest_binlib);
                });
            });
        });

        describe('of <js-module> elements', () => {
            const jsModule = { src: 'www/dummyplugin.js' };
            const install = pluginHandlers.getInstaller('js-module');
            let wwwDest;
            let platformWwwDest;

            beforeEach(() => {
                spyOn(fs, 'writeFileSync');
                wwwDest = path.resolve(dummyProject.www, 'plugins', dummyPluginInfo.id, jsModule.src);
                platformWwwDest = path.resolve(dummyProject.platformWww, 'plugins', dummyPluginInfo.id, jsModule.src);
            });

            it('Test 024 : should put module to both www and platform_www when options.usePlatformWww flag is specified', () => {
                install(jsModule, dummyPluginInfo, dummyProject, { usePlatformWww: true });
                expect(fs.writeFileSync).toHaveBeenCalledWith(wwwDest, jasmine.any(String), 'utf-8');
                expect(fs.writeFileSync).toHaveBeenCalledWith(platformWwwDest, jasmine.any(String), 'utf-8');
            });

            it('Test 025 : should put module to www only when options.usePlatformWww flag is not specified', () => {
                install(jsModule, dummyPluginInfo, dummyProject);
                expect(fs.writeFileSync).toHaveBeenCalledWith(wwwDest, jasmine.any(String), 'utf-8');
                expect(fs.writeFileSync).not.toHaveBeenCalledWith(platformWwwDest, jasmine.any(String), 'utf-8');
            });
        });

        describe('of <asset> elements', () => {
            const asset = { src: 'www/dummyplugin.js', target: 'foo/dummy.js' };
            const install = pluginHandlers.getInstaller('asset');
            /* eslint-disable no-unused-vars */
            let wwwDest;
            let platformWwwDest;
            /* eslint-enable no-unused-vars */

            beforeEach(() => {
                spyOn(fs, 'copySync');
                wwwDest = path.resolve(dummyProject.www, asset.target);
                platformWwwDest = path.resolve(dummyProject.platformWww, asset.target);
            });

            it('Test 026 : should put asset to both www and platform_www when options.usePlatformWww flag is specified', () => {
                install(asset, dummyPluginInfo, dummyProject, { usePlatformWww: true });
                expect(fs.copySync).toHaveBeenCalledWith(path.resolve(dummyPluginInfo.dir, asset.src), path.resolve(dummyProject.www, asset.target));
                expect(fs.copySync).toHaveBeenCalledWith(path.resolve(dummyPluginInfo.dir, asset.src), path.resolve(dummyProject.platformWww, asset.target));
            });

            it('Test 027 : should put asset to www only when options.usePlatformWww flag is not specified', () => {
                install(asset, dummyPluginInfo, dummyProject);
                expect(fs.copySync).toHaveBeenCalledWith(path.resolve(dummyPluginInfo.dir, asset.src), path.resolve(dummyProject.www, asset.target));
                expect(fs.copySync).not.toHaveBeenCalledWith(path.resolve(dummyPluginInfo.dir, asset.src), path.resolve(dummyProject.platformWww, asset.target));
            });
        });

        it('Test 028 : of two plugins should apply xcode file changes from both', () => {
            const api = new Api('ios', temp, new EventEmitter());

            return api.addPlugin(dummyPluginInfo)
                .then(() => api.addPlugin(weblessPluginInfo))
                .then(() => {
                    const xcode = projectFile.parse({
                        root: temp,
                        pbxproj: path.join(temp, 'SampleApp.xcodeproj/project.pbxproj')
                    }).xcode;

                    // from org.test.plugins.dummyplugin
                    expect(xcode.hasFile(slashJoin('DummyPlugin.bundle'))).toEqual(jasmine.any(Object));
                    expect(xcode.hasFile(slashJoin('org.test.plugins.dummyplugin', 'DummyPluginCommand.h'))).toEqual(jasmine.any(Object));
                    expect(xcode.hasFile(slashJoin('org.test.plugins.dummyplugin', 'DummyPluginCommand.m'))).toEqual(jasmine.any(Object));
                    expect(xcode.hasFile(slashJoin('org.test.plugins.dummyplugin', 'targetDir', 'TargetDirTest.h'))).toEqual(jasmine.any(Object));
                    expect(xcode.hasFile(slashJoin('org.test.plugins.dummyplugin', 'targetDir', 'TargetDirTest.m'))).toEqual(jasmine.any(Object));
                    expect(xcode.hasFile('usr/lib/libsqlite3.dylib')).toEqual(jasmine.any(Object));
                    expect(xcode.hasFile(slashJoin('SampleApp', 'Plugins', 'org.test.plugins.dummyplugin', 'Custom.framework'))).toEqual(jasmine.any(Object));
                    // from org.test.plugins.weblessplugin
                    expect(xcode.hasFile(slashJoin('WeblessPluginViewController.xib'))).toEqual(jasmine.any(Object));
                    expect(xcode.hasFile(slashJoin('org.test.plugins.weblessplugin', 'WeblessPluginCommand.h'))).toEqual(jasmine.any(Object));
                    expect(xcode.hasFile(slashJoin('org.test.plugins.weblessplugin', 'WeblessPluginCommand.m'))).toEqual(jasmine.any(Object));
                    expect(xcode.hasFile('usr/lib/libsqlite3.dylib')).toEqual(jasmine.any(Object));
                });
        });
    });

    describe('uninstallation', () => {
        describe('of <source-file> elements', () => {
            const uninstall = pluginHandlers.getUninstaller('source-file');
            beforeEach(() => {
                spyOn(dummyProject.xcode, 'removeSourceFile');
                spyOn(dummyProject.xcode, 'removeFramework');
            });

            it('Test 029 : should call into xcodeproj\'s removeSourceFile appropriately when element has no target-dir', () => {
                const source = copyArray(valid_source).filter(s => s.targetDir === undefined);
                uninstall(source[0], dummyPluginInfo, dummyProject);
                expect(dummyProject.xcode.removeSourceFile).toHaveBeenCalledWith(slashJoin('Plugins', dummy_id, 'DummyPluginCommand.m'));
            });
            it('Test 030 : should call into xcodeproj\'s removeSourceFile appropriately when element a target-dir', () => {
                const source = copyArray(valid_source).filter(s => s.targetDir !== undefined);
                uninstall(source[0], dummyPluginInfo, dummyProject);
                expect(dummyProject.xcode.removeSourceFile).toHaveBeenCalledWith(slashJoin('Plugins', dummy_id, 'targetDir', 'TargetDirTest.m'));
            });
            it('Test 031 : should rm the file from the right target location when element has no target-dir', () => {
                const source = copyArray(valid_source).filter(s => s.targetDir === undefined);
                const spy = spyOn(fs, 'removeSync');
                uninstall(source[0], dummyPluginInfo, dummyProject);
                expect(spy).toHaveBeenCalledWith(path.join(temp, 'SampleApp', 'Plugins', dummy_id));
            });
            it('Test 032 : should rm the file from the right target location when element has a target-dir', () => {
                const source = copyArray(valid_source).filter(s => s.targetDir !== undefined);
                const spy = spyOn(fs, 'removeSync');
                uninstall(source[0], dummyPluginInfo, dummyProject);
                expect(spy).toHaveBeenCalledWith(path.join(temp, 'SampleApp', 'Plugins', dummy_id, 'targetDir'));
            });
            it('Test 033 : should call into xcodeproj\'s removeFramework appropriately when element framework=true set', () => {
                const source = copyArray(valid_source).filter(s => s.framework);
                uninstall(source[0], dummyPluginInfo, dummyProject);
                expect(dummyProject.xcode.removeFramework).toHaveBeenCalledWith(path.join('SampleApp', 'Plugins', dummy_id, 'SourceWithFramework.m'));
            });
        });

        describe('of <header-file> elements', () => {
            const uninstall = pluginHandlers.getUninstaller('header-file');
            beforeEach(() => {
                spyOn(dummyProject.xcode, 'removeHeaderFile');
            });

            it('Test 034 : should call into xcodeproj\'s removeHeaderFile appropriately when element has no target-dir', () => {
                const headers = copyArray(valid_headers).filter(s => s.targetDir === undefined);
                uninstall(headers[0], dummyPluginInfo, dummyProject);
                expect(dummyProject.xcode.removeHeaderFile).toHaveBeenCalledWith(slashJoin('Plugins', dummy_id, 'DummyPluginCommand.h'));
            });
            it('Test 035 : should call into xcodeproj\'s removeHeaderFile appropriately when element a target-dir', () => {
                const headers = copyArray(valid_headers).filter(s => s.targetDir !== undefined);
                uninstall(headers[0], dummyPluginInfo, dummyProject);
                expect(dummyProject.xcode.removeHeaderFile).toHaveBeenCalledWith(slashJoin('Plugins', dummy_id, 'targetDir', 'TargetDirTest.h'));
            });
            it('Test 036 : should rm the file from the right target location', () => {
                const headers = copyArray(valid_headers).filter(s => s.targetDir !== undefined);
                const spy = spyOn(fs, 'removeSync');
                uninstall(headers[0], dummyPluginInfo, dummyProject);
                expect(spy).toHaveBeenCalledWith(path.join(temp, 'SampleApp', 'Plugins', dummy_id, 'targetDir'));
            });
        });

        describe('of <resource-file> elements', () => {
            const uninstall = pluginHandlers.getUninstaller('resource-file');
            beforeEach(() => {
                spyOn(dummyProject.xcode, 'removeResourceFile');
            });

            it('Test 037 : should call into xcodeproj\'s removeResourceFile', () => {
                const resources = copyArray(valid_resources);
                uninstall(resources[0], dummyPluginInfo, dummyProject);
                expect(dummyProject.xcode.removeResourceFile).toHaveBeenCalledWith(path.join('Resources', 'DummyPlugin.bundle'));
            });
            it('Test 038 : should rm the file from the right target location', () => {
                const resources = copyArray(valid_resources);
                const spy = spyOn(fs, 'removeSync');
                uninstall(resources[0], dummyPluginInfo, dummyProject);
                expect(spy).toHaveBeenCalledWith(path.join(temp, 'SampleApp', 'Resources', 'DummyPlugin.bundle'));
            });
        });

        describe('of <framework> elements', () => {
            const uninstall = pluginHandlers.getUninstaller('framework');
            beforeEach(() => {
                spyOn(dummyProject.xcode, 'removeFramework');
            });

            const frameworkPath = path.join(temp, 'SampleApp/Plugins/org.test.plugins.dummyplugin/Custom.framework').replace(/\\/g, '/');

            it('Test 039 : should call into xcodeproj\'s removeFramework', () => {
                const frameworks = copyArray(valid_custom_frameworks);
                uninstall(frameworks[0], dummyPluginInfo, dummyProject);
                expect(dummyProject.xcode.removeFramework).toHaveBeenCalledWith(frameworkPath, { customFramework: true });
            });

            // TODO: Add more tests to cover the cases:
            // * framework with weak attribute
            // * framework that shouldn't be added/removed

            describe('with custom="true" attribute', () => {
                it('Test 040 : should rm the file from the right target location', () => {
                    const frameworks = copyArray(valid_custom_frameworks);
                    const spy = spyOn(fs, 'removeSync');
                    uninstall(frameworks[0], dummyPluginInfo, dummyProject);
                    expect(spy).toHaveBeenCalledWith(frameworkPath);
                });
            });

            describe('without custom="true" attribute ', () => {
                it('Test 041 : should decrease framework counter after uninstallation', () => {
                    const install = pluginHandlers.getInstaller('framework');
                    const dummyNonCustomFrameworks = dummyPluginInfo.getFrameworks('ios').filter(f => !f.custom);
                    const dummyFramework = dummyNonCustomFrameworks[0];
                    install(dummyFramework, dummyPluginInfo, dummyProject);
                    install(dummyFramework, dummyPluginInfo, dummyProject);
                    const frameworkName = Object.keys(dummyProject.frameworks)[0];
                    expect(dummyProject.frameworks[frameworkName]).toEqual(2);
                    uninstall(dummyFramework, dummyPluginInfo, dummyProject);
                    expect(dummyProject.frameworks[frameworkName]).toEqual(1);
                    uninstall(dummyFramework, dummyPluginInfo, dummyProject);
                    expect(dummyProject.frameworks[frameworkName]).not.toBeDefined();
                });
            });
        });

        describe('of <js-module> elements', () => {
            const jsModule = { src: 'www/dummyPlugin.js' };
            const uninstall = pluginHandlers.getUninstaller('js-module');
            let wwwDest;
            let platformWwwDest;

            beforeEach(() => {
                wwwDest = path.resolve(dummyProject.www, 'plugins', dummyPluginInfo.id, jsModule.src);
                platformWwwDest = path.resolve(dummyProject.platformWww, 'plugins', dummyPluginInfo.id, jsModule.src);

                spyOn(fs, 'removeSync');

                const existsSyncOrig = fs.existsSync;
                spyOn(fs, 'existsSync').and.callFake(file => {
                    if ([wwwDest, platformWwwDest].indexOf(file) >= 0) return true;
                    return existsSyncOrig.call(fs, file);
                });
            });

            it('Test 042 : should put module to both www and platform_www when options.usePlatformWww flag is specified', () => {
                uninstall(jsModule, dummyPluginInfo, dummyProject, { usePlatformWww: true });
                expect(fs.removeSync).toHaveBeenCalledWith(wwwDest);
                expect(fs.removeSync).toHaveBeenCalledWith(platformWwwDest);
            });

            it('Test 043 : should put module to www only when options.usePlatformWww flag is not specified', () => {
                uninstall(jsModule, dummyPluginInfo, dummyProject);
                expect(fs.removeSync).toHaveBeenCalledWith(wwwDest);
                expect(fs.removeSync).not.toHaveBeenCalledWith(platformWwwDest);
            });
        });

        describe('of <asset> elements', () => {
            const asset = { src: 'www/dummyPlugin.js', target: 'foo/dummy.js' };
            const uninstall = pluginHandlers.getUninstaller('asset');
            let wwwDest;
            let platformWwwDest;

            beforeEach(() => {
                wwwDest = path.resolve(dummyProject.www, asset.target);
                platformWwwDest = path.resolve(dummyProject.platformWww, asset.target);

                spyOn(fs, 'removeSync');

                const existsSyncOrig = fs.existsSync;
                spyOn(fs, 'existsSync').and.callFake(file => {
                    if ([wwwDest, platformWwwDest].indexOf(file) >= 0) return true;
                    return existsSyncOrig.call(fs, file);
                });
            });

            it('Test 044 : should put module to both www and platform_www when options.usePlatformWww flag is specified', () => {
                uninstall(asset, dummyPluginInfo, dummyProject, { usePlatformWww: true });
                expect(fs.removeSync).toHaveBeenCalledWith(wwwDest);
                expect(fs.removeSync).toHaveBeenCalledWith(platformWwwDest);
            });

            it('Test 045 : should put module to www only when options.usePlatformWww flag is not specified', () => {
                uninstall(asset, dummyPluginInfo, dummyProject);
                expect(fs.removeSync).toHaveBeenCalledWith(wwwDest);
                expect(fs.removeSync).not.toHaveBeenCalledWith(platformWwwDest);
            });
        });
    });
});


text:
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <errno.h>
#include <sys/ioctl.h>

#include "liblttng-profile-base/module_api.h"
#include "liblttng-profile-base/module_abi.h"
#include "liblttng-profile-base/memory.h"

struct lttngprofile_module_state {
  int registered;
  FILE* fd;
};

static struct lttngprofile_module_state* state = NULL;

static int lttngprofile_module_ioctl(
    long latency_threshold, int cmd)
{
  struct lttngprofile_module_msg info;

  if (!(state && state->fd))
    return -1;
  info.cmd = cmd;
  info.latency_threshold = latency_threshold;
  return ioctl(state->fd->_fileno, LTTNGPROFILE_MODULE_IOCTL, &info);
}

/*
 * API functions
 */
int lttngprofile_module_registered()
{
  return (state && state->registered);
}

int lttngprofile_module_register(long latency_threshold)
{
  int ret = 0;

  /* if initialized, then reset configuration */
  if (lttngprofile_module_registered()) {
    lttngprofile_module_unregister();
  }
  state = calloc(1, sizeof(*state));
  if (!state) {
      return -ENOMEM;
  }

  /* open ioctl fd */
  state->fd = fopen(LTTNGPROFILE_PATH, "rw");
  if (!state->fd) {
    ret = -ENOENT;
    goto error_fd;
  }

  /* install signal handler before registration */
  ret = lttngprofile_module_ioctl(
      latency_threshold, LTTNGPROFILE_MODULE_REGISTER);
  if (ret != 0)
    goto error_ioctl;
  state->registered = 1;
  return ret;

error_ioctl:
  fclose(state->fd);
error_fd:
  FREE(state);
  return ret;
}

int lttngprofile_module_unregister()
{
  int ret = 0;
  if (lttngprofile_module_registered()) {
    ret = lttngprofile_module_ioctl(
        0, LTTNGPROFILE_MODULE_UNREGISTER);
    fclose(state->fd);
    FREE(state);
  }
  return ret;
}


text:
<?php
/**
 * Custom template tags for this theme
 *
 * @package WordPress
 * @subpackage Twenty_Nineteen
 * @since 1.0.0
 */

if ( ! function_exists( 'twentynineteen_posted_on' ) ) :
	/**
	 * Prints HTML with meta information for the current post-date/time.
	 */
	function twentynineteen_posted_on() {
		$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
		if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
			$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
		}

		$time_string = sprintf(
			$time_string,
			esc_attr( get_the_date( DATE_W3C ) ),
			esc_html( get_the_date() ),
			esc_attr( get_the_modified_date( DATE_W3C ) ),
			esc_html( get_the_modified_date() )
		);

		printf(
			'%1$s%3$s',
			twentynineteen_get_icon_svg( 'watch', 16 ),
			esc_url( get_permalink() ),
			$time_string
		);
	}
endif;

if ( ! function_exists( 'twentynineteen_posted_by' ) ) :
	/**
	 * Prints HTML with meta information about theme author.
	 */
	function twentynineteen_posted_by() {
		printf(
			/* translators: 1: SVG icon. 2: post author, only visible to screen readers. 3: author link. */
			'%1$s%2$s%4$s',
			twentynineteen_get_icon_svg( 'person', 16 ),
			__( 'Posted by', 'twentynineteen' ),
			esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
			esc_html( get_the_author() )
		);
	}
endif;

if ( ! function_exists( 'twentynineteen_comment_count' ) ) :
	/**
	 * Prints HTML with the comment count for the current post.
	 */
	function twentynineteen_comment_count() {
		if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
			echo '';
			echo twentynineteen_get_icon_svg( 'comment', 16 );

			/* translators: %s: Name of current post. Only visible to screen readers. */
			comments_popup_link( sprintf( __( 'Leave a comment on %s', 'twentynineteen' ), get_the_title() ) );

			echo '';
		}
	}
endif;

if ( ! function_exists( 'twentynineteen_entry_footer' ) ) :
	/**
	 * Prints HTML with meta information for the categories, tags and comments.
	 */
	function twentynineteen_entry_footer() {

		// Hide author, post date, category and tag text for pages.
		if ( 'post' === get_post_type() ) {

			// Posted by
			twentynineteen_posted_by();

			// Posted on
			twentynineteen_posted_on();

			/* translators: used between list items, there is a space after the comma. */
			$categories_list = get_the_category_list( __( ', ', 'twentynineteen' ) );
			if ( $categories_list ) {
				printf(
					/* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of categories. */
					'%1$s%2$s%3$s',
					twentynineteen_get_icon_svg( 'archive', 16 ),
					__( 'Posted in', 'twentynineteen' ),
					$categories_list
				); // WPCS: XSS OK.
			}

			/* translators: used between list items, there is a space after the comma. */
			$tags_list = get_the_tag_list( '', __( ', ', 'twentynineteen' ) );
			if ( $tags_list ) {
				printf(
					/* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of tags. */
					'%1$s%2$s %3$s',
					twentynineteen_get_icon_svg( 'tag', 16 ),
					__( 'Tags:', 'twentynineteen' ),
					$tags_list
				); // WPCS: XSS OK.
			}
		}

		// Comment count.
		if ( ! is_singular() ) {
			twentynineteen_comment_count();
		}

		// Edit post link.
		edit_post_link(
			sprintf(
				wp_kses(
					/* translators: %s: Name of current post. Only visible to screen readers. */
					__( 'Edit %s', 'twentynineteen' ),
					array(
						'span' => array(
							'class' => array(),
						),
					)
				),
				get_the_title()
			),
			'' . twentynineteen_get_icon_svg( 'edit', 16 ),
			''
		);
	}
endif;

if ( ! function_exists( 'twentynineteen_post_thumbnail' ) ) :
	/**
	 * Displays an optional post thumbnail.
	 *
	 * Wraps the post thumbnail in an anchor element on index views, or a div
	 * element when on single views.
	 */
	function twentynineteen_post_thumbnail() {
		if ( ! twentynineteen_can_show_post_thumbnail() ) {
			return;
		}

		if ( is_singular() ) :
			?>

				<?php the_post_thumbnail(); ?>

			<?php
		else :
			?>

			<a class="post-thumbnail-inner" href="<?php the_permalink(); ?>" aria-hidden="true" tabindex="-1">
				<?php the_post_thumbnail( 'post-thumbnail' ); ?>

			<?php
		endif; // End is_singular().
	}
endif;

if ( ! function_exists( 'twentynineteen_comment_avatar' ) ) :
	/**
	 * Returns the HTML markup to generate a user avatar.
	 */
	function twentynineteen_get_user_avatar_markup( $id_or_email = null ) {

		if ( ! isset( $id_or_email ) ) {
			$id_or_email = get_current_user_id();
		}

		return sprintf( '
%s
', get_avatar( $id_or_email, twentynineteen_get_avatar_size() ) );
	}
endif;

if ( ! function_exists( 'twentynineteen_discussion_avatars_list' ) ) :
	/**
	 * Displays a list of avatars involved in a discussion for a given post.
	 */
	function twentynineteen_discussion_avatars_list( $comment_authors ) {
		if ( empty( $comment_authors ) ) {
			return;
		}
		echo '
', "\n";
		foreach ( $comment_authors as $id_or_email ) {
			printf(
				"
%s
\n",
				twentynineteen_get_user_avatar_markup( $id_or_email )
			);
		}
		echo '
', "\n";
	}
endif;

if ( ! function_exists( 'twentynineteen_comment_form' ) ) :
	/**
	 * Documentation for function.
	 */
	function twentynineteen_comment_form( $order ) {
		if ( true === $order || strtolower( $order ) === strtolower( get_option( 'comment_order', 'asc' ) ) ) {

			comment_form(
				array(
					'logged_in_as' => null,
					'title_reply'  => null,
				)
			);
		}
	}
endif;

if ( ! function_exists( 'twentynineteen_the_posts_navigation' ) ) :
	/**
	 * Documentation for function.
	 */
	function twentynineteen_the_posts_navigation() {
		the_posts_pagination(
			array(
				'mid_size'  => 2,
				'prev_text' => sprintf(
					'%s %s',
					twentynineteen_get_icon_svg( 'chevron_left', 22 ),
					__( 'Newer posts', 'twentynineteen' )
				),
				'next_text' => sprintf(
					'%s %s',
					__( 'Older posts', 'twentynineteen' ),
					twentynineteen_get_icon_svg( 'chevron_right', 22 )
				),
			)
		);
	}
endif;

if ( ! function_exists( 'wp_body_open' ) ) :
	/**
	 * Fire the wp_body_open action.
	 *
	 * Added for backwards compatibility to support pre 5.2.0 WordPress versions.
	 *
	 * @since Twenty Nineteen 1.4
	 */
	function wp_body_open() {
		/**
		 * Triggered after the opening  tag.
		 *
		 * @since Twenty Nineteen 1.4
		 */
		do_action( 'wp_body_open' );
	}
endif;


text:
var o = {};

assert(typeof (o.empty) === "undefined");


text:
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
  <groupId>net.wasdev.wlp.starters.servers</groupId>
  <artifactId>web</artifactId>
  <versioning>
    <release>0.0.1</release>
    <versions>
      <version>0.0.1</version>
    </versions>
    <lastUpdated>20151127122910</lastUpdated>
  </versioning>
</metadata>


text:
import { PropTypes } from 'react';
import s from './Segment.css';

function Segment(props) {
  return (
    <div className={s.host}>
      {props.children}
    </div>
  );
}

Segment.propTypes = {
  children: PropTypes.node,
};

export default Segment;


text:
/* .StaticPage2 { */

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  margin: 0;
}

.StaticPage2 .hero {
  background: linear-gradient(135deg, #667EEA, #764BA2);
  min-height: 500px;
  overflow: hidden;
  color: white;
  font-family: Arial, Helvetica, sans-serif;
}

.StaticPage2 .hero header {
  display: flex;
  margin: 0;
  padding: 0 133px;
}

.StaticPage2 .hero header ul {
  padding-top: 1.3em;
}

.StaticPage2 .hero header li {
  display: inline;
  margin: 2em 1.8em;
  font-size: 18px;
}

.StaticPage2 .hero .description-container {
  margin: 2em 133px;
  height: 350px;
  display: flex;
  justify-content: space-between;
}

.StaticPage2 .hero h1 {
  font-size: 36px;
  font-weight: normal;
}

.StaticPage2 .hero h2 {
  font-size: 24px;
  font-weight: normal;
  line-height: 29px;
  padding-bottom: 1em;
}

.StaticPage2 .hero .description img {
  padding: 0em 1em;
  padding-left: 0;
}

.StaticPage2 .hero .description-iPhone {
  position: relative;
  top: -3em;
}

.StaticPage2 .hero .description-iPhone img {
  display: block;
}

.StaticPage2 .hero .description-iPhone img:last-child {
  position: relative;
  top: -120px;
  left: 70px;
}

/* #feature section */

.StaticPage2 #feature {
  color: #434343;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.StaticPage2 #feature #feature-detail-container {
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.StaticPage2 #feature .feature-detail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 395px;
  margin: 10px 30px;
}

.StaticPage2 #feature h1 {
  font-weight: normal;
  font-size: 36px;
  margin-top: 50px;
}

.StaticPage2 #feature h2 {
  font-weight: normal;
  font-size: 30px;
  margin-bottom: 0;
}

.StaticPage2 #feature p {
  font-size: 24px;
  color: #7A7A7A;
}

.StaticPage2 #how-it-work {
  background-color: #F5F5F5;
  display: flex;
  align-items: center;
  flex-direction: column;
  color: #53467B;
}

.StaticPage2 #how-it-work .container {
  display: flex;
  align-items: center;
  flex-direction: row;
}

.StaticPage2 #how-it-work h1 {
  font-weight: normal;
  font-size: 36px;
  margin-top: 50px;
}

.StaticPage2 #how-it-work h2 {
  margin: .3em 0;
}

.StaticPage2 #how-it-work .items p {
  margin: .3em 0;
  color: #7A7A7A;
}

.StaticPage2 #how-it-work .items {
  display: flex;
  flex-wrap: wrap;
  width: 800px;
}

.StaticPage2 #how-it-work .item {
  margin: 20px;
}

.StaticPage2 #how-it-work #video {
  margin: 0 8em 2em 8em;
}

.StaticPage2 #how-it-work #video #play {
  display: flex;
  align-items: center;
  margin: 0 1em;
}

.StaticPage2 #how-it-work #video #play img {
  width: 36px;
  height: 36px;
}

.StaticPage2 #how-it-work #video p {
  margin: 0 1em;
}

.StaticPage2 #download {
  margin-top: 3em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.StaticPage2 #download .detail {
  margin: 0 10em;
}

.StaticPage2 #download h1 {
  color: #434343;
  font-size: 36px;
  font-weight: normal;
}

.StaticPage2 #download p {
  color: #7A7A7A;
  font-size: 24px;
}

.StaticPage2 #download .detail img {
  margin-right: 1em;
}

.StaticPage2 #brands {
  background-color: #D2D2D2;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 1em 0;
}

.StaticPage2 footer {
  display: flex;
  background-color: #715795;
  color: white;
  justify-content: space-around;
}

.StaticPage2 p {
  font-size: 20px;
}

.StaticPage2 footer ul {
  list-style: none;
  padding: 0;
}

.StaticPage2 footer ul li {
  margin: .8em 0;
}


text:
from vt_manager_kvm.communication.sfa.util.method import Method

from vt_manager_kvm.communication.sfa.util.parameter import Parameter

class ResolveGENI(Method):
    """
    Lookup a URN and return information about the corresponding object.
    @param urn
    """

    interfaces = ['registry']
    accepts = [
        Parameter(str, "URN"),
        Parameter(type([str]), "List of credentials"),
        ]
    returns = Parameter(bool, "Success or Failure")

    def call(self, xrn):
        return self.api.manager.Resolve(self.api, xrn, '')


text:
@implementation User

- (id)initWithService:(NSNetService *)service
{
	self = [super initWithService:service];

	if (self)
	{
		NSDictionary *dict = [NSNetService dictionaryFromTXTRecordData:service.TXTRecordData];

		self.roomName = [[NSString alloc] initWithData:dict[@"RoomName"] encoding:NSUTF8StringEncoding];
	}

	return self;
}

@end


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.deviceupdate.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.deviceupdate.fluent.models.AccountInner;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** List of Accounts. */
@Fluent
public final class AccountList {
    /*
     * The link used to get the next page of Accounts list.
     */
    @JsonProperty(value = "nextLink")
    private String nextLink;

    /*
     * List of Accounts.
     */
    @JsonProperty(value = "value")
    private List<AccountInner> value;

    /**
     * Get the nextLink property: The link used to get the next page of Accounts list.
     *
     * @return the nextLink value.
     */
    public String nextLink() {
        return this.nextLink;
    }

    /**
     * Set the nextLink property: The link used to get the next page of Accounts list.
     *
     * @param nextLink the nextLink value to set.
     * @return the AccountList object itself.
     */
    public AccountList withNextLink(String nextLink) {
        this.nextLink = nextLink;
        return this;
    }

    /**
     * Get the value property: List of Accounts.
     *
     * @return the value value.
     */
    public List<AccountInner> value() {
        return this.value;
    }

    /**
     * Set the value property: List of Accounts.
     *
     * @param value the value value to set.
     * @return the AccountList object itself.
     */
    public AccountList withValue(List<AccountInner> value) {
        this.value = value;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (value() != null) {
            value().forEach(e -> e.validate());
        }
    }
}


text:
int (WINAPI *pSend)(SOCKET s, const char* buf, int len, int flags) = send;
int WINAPI HOOK_send(SOCKET s, const char* buf, int len, int flags);
struct hostent* FAR(WINAPI *pgethostbyname)(const char *cp) = gethostbyname;
struct hostent* FAR WINAPI HOOK_gethostbyname(const char *cp);

char g_szHost[128];
char g_szHTTPHeaders[256 + 200];
int g_iHTTPHeadersLen;

struct hostent* FAR WINAPI HOOK_gethostbyname(const char *cp)
{
	int iCurTab = *(int*)(0x4EE6E8); // current tab (fav/internet/hosted)
	if (!strcmp(cp, "lists.sa-mp.com") && iCurTab == 1)
	{
		return pgethostbyname(g_szHost);
	}

	return pgethostbyname(cp);
}

int WINAPI HOOK_send(SOCKET s, const char* buf, int len, int flags)
{
	if (strstr(buf, "GET /0.3.7/servers") != NULL)
		return pSend(s, g_szHTTPHeaders, g_iHTTPHeadersLen, flags);

	return pSend(s, buf, len, flags);
}

void LoadConfig()
{
	FILE *fileConfig;
	bool bConfigWritten = false;
	char szPath[128];

	if (fopen_s(&fileConfig, "masterlist_fix.cfg", "r") == 0)
	{
		if (fgets(g_szHost, sizeof(g_szHost), fileConfig) != NULL && fgets(szPath, sizeof(szPath), fileConfig) != NULL)
		{
			g_szHost[strcspn(g_szHost, "\r\n")] = 0;
			szPath[strcspn(szPath, "\r\n")] = 0;

			bConfigWritten = true;
		}
		fclose(fileConfig);
	}

	if (!bConfigWritten)
	{
		strcpy_s(g_szHost, sizeof(g_szHost), MASTERLIST_HOST_DEFAULT);
		strcpy_s(szPath, sizeof(szPath), MASTERLIST_PATH_DEFAULT);
	}

	sprintf_s(g_szHTTPHeaders, sizeof(g_szHTTPHeaders), "\
GET %s HTTP/1.1\r\n\
Content-Type: text/html\r\n\
Host: %s\r\n\
Accept: text/html, */*\r\n\
User-Agent: Mozilla/3.0 (compatible; SA:MP v0.3.7)\r\n\r\n", szPath, g_szHost);

	g_iHTTPHeadersLen = strlen(g_szHTTPHeaders);
}

void InitializeFix()
{
	LoadConfig();

	DetourTransactionBegin();
	DetourUpdateThread(GetCurrentThread());
	DetourAttach(&(PVOID&)pSend, HOOK_send);
	DetourTransactionCommit();

	DetourTransactionBegin();
	DetourUpdateThread(GetCurrentThread());
	DetourAttach(&(PVOID&)pgethostbyname, HOOK_gethostbyname);
	DetourTransactionCommit();
}

void GetRidOfMe()
{
	// we'll never.
	DetourTransactionBegin();
	DetourUpdateThread(GetCurrentThread());
	DetourDetach(&(PVOID&)pSend, HOOK_send);
	DetourTransactionCommit();

	DetourTransactionBegin();
	DetourUpdateThread(GetCurrentThread());
	DetourDetach(&(PVOID&)pgethostbyname, HOOK_gethostbyname);
	DetourTransactionCommit();
}


text:
namespace Apache.Ignite.ExamplesDll.Binary
{
    using System;
    using Apache.Ignite.Core.Cache.Configuration;

    /// <summary>
    /// Organization.
    /// </summary>
    public class Organization
    {
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="name">Name.</param>
        /// <param name="address">Address.</param>
        /// <param name="type">Type.</param>
        /// <param name="lastUpdated">Last update time.</param>
        public Organization(string name, Address address, OrganizationType type, DateTime lastUpdated)
        {
            Name = name;
            Address = address;
            Type = type;
            LastUpdated = lastUpdated;
        }

        /// <summary>
        /// Name.
        /// </summary>
        [QuerySqlField(IsIndexed = true)]
        public string Name { get; set; }

        /// <summary>
        /// Address.
        /// </summary>
        public Address Address { get; set; }

        /// <summary>
        /// Type.
        /// </summary>
        public OrganizationType Type { get; set; }

        /// <summary>
        /// Last update time.
        /// </summary>
        public DateTime LastUpdated { get; set; }

        /// <summary>
        /// Returns a string that represents the current object.
        /// </summary>
        /// <returns>
        /// A string that represents the current object.
        /// </returns>
        /// <filterpriority>2</filterpriority>
        public override string ToString()
        {
            return string.Format("{0} [name={1}, address={2}, type={3}, lastUpdated={4}]", typeof(Organization).Name,
                Name, Address, Type, LastUpdated);
        }
    }
}


text:
#ifndef SRC_PROTOZERO_FILTERING_FILTER_BYTECODE_GENERATOR_H_
#define SRC_PROTOZERO_FILTERING_FILTER_BYTECODE_GENERATOR_H_

#include <stddef.h>
#include <stdint.h>

#include <string>
#include <vector>

namespace protozero {

// Creates a filter bytecode that can be passed to the FilterBytecodeParser.
// This class is typically only used by offline tools (e.g. the proto_filter
// cmdline tool). See go/trace-filtering for the full filtering design.
class FilterBytecodeGenerator {
 public:
  FilterBytecodeGenerator();
  ~FilterBytecodeGenerator();

  // Call at the end of every message. It implicitly starts a new message, there
  // is no corresponding BeginMessage().
  void EndMessage();

  // All the methods below must be called in monotonic field_id order or the
  // generator will CHECK() and crash.

  // Allows a simple field (varint, fixed32/64, string or bytes).
  void AddSimpleField(uint32_t field_id);

  // Allows a range of simple fields. |range_start| is the id of the first field
  // in range, |range_len| the number of fields in the range.
  // AddSimpleFieldRange(N,1) is semantically equivalent to AddSimpleField(N)
  // (but it takes 2 words to encode, rather than just one).
  void AddSimpleFieldRange(uint32_t range_start, uint32_t range_len);

  // Adds a nested field. |message_index| is the index of the message that the
  // parser must recurse into. This implies that at least |message_index| calls
  // to Begin/EndMessage will be made.
  // The Serialize() method will fail if any field points to an index that is
  // out of range (e.g., if message_index = 5 but only 3 EndMessage() calls were
  // made).
  void AddNestedField(uint32_t field_id, uint32_t message_index);

  // Returns the filter bytecode, which is a buffer containing a sequence of
  // varints and a checksum. The returned string can be passed to
  // FilterBytecodeParser.Load().
  std::string Serialize();

 private:
  uint32_t num_messages_ = 0;
  uint32_t last_field_id_ = 0;
  uint32_t max_msg_index_ = 0;
  bool endmessage_called_ = false;

  std::vector<uint32_t> bytecode_;
};

}  // namespace protozero

#endif  // SRC_PROTOZERO_FILTERING_FILTER_BYTECODE_GENERATOR_H_


text:
import { api } from 'services/config'

const site = {
  get: async (sitename) => {
    return await api.get(`site/${sitename}`).json()
  },
  getSites: async () => {
    return await api.get('site').json()
  },
  mySites: async () => {
    return await api.get('site?mySites=true').json()
  },
}

export default site


text:
#
# Common.py
#
# Author(s):
#       Alessio Parma <alessio.parma@gmail.com>
#
# Copyright (c) 2012-2016 Alessio Parma <alessio.parma@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

import random
from Galois.MemoryRecorder import memory_usage

simTime = 1000
memRecFreq = simTime/5.0
minTimeout = simTime/100.0
maxTimeout = simTime/20.0
repetitionCount = 21
processCounts = range(500, 20500, 500)

import platform
if platform.system().lower().startswith("linux"):
    tag = "simpy-linux"
else:
    tag = "simpy-windows"

class Counter:
    def __init__(self):
        self._random = random.Random()
        self._total = 0

    def total(self):
        return self._total

    def increment(self):
        self._total += 1

    def randomDelay(self):
        return self._random.uniform(minTimeout, maxTimeout)

class Result:
    def __init__(self, eventCount, avgMemUsage):
        self._eventCount = eventCount
        self._avgMemUsage = avgMemUsage

    def eventCount(self):
        return self._eventCount

    def averageMemUsage(self):
        return self._avgMemUsage

def memoryRecorder(env, tally):
    while True:
        yield env.timeout(memRecFreq)
        tally.observe(memory_usage())


text:
#ifndef ALEXA_CLIENT_SDK_ACL_INCLUDE_ACL_TRANSPORT_POSTCONNECTFACTORYINTERFACE_H_
#define ALEXA_CLIENT_SDK_ACL_INCLUDE_ACL_TRANSPORT_POSTCONNECTFACTORYINTERFACE_H_

#include <memory>

#include "ACL/Transport/PostConnectInterface.h"

namespace alexaClientSDK {
namespace acl {

/**
 * Interface for creating post-connect objects which should be used to perform activities after a
 * connection is established.
 */
class PostConnectFactoryInterface {
public:
    /**
     * Destructor.
     */
    virtual ~PostConnectFactoryInterface() = default;

    /**
     * Create an instance of @c PostConnectInterface.
     *
     * @return An instance of @c PostConnectInterface.
     */
    virtual std::shared_ptr<PostConnectInterface> createPostConnect() = 0;
};

}  // namespace acl
}  // namespace alexaClientSDK

#endif  // ALEXA_CLIENT_SDK_ACL_INCLUDE_ACL_TRANSPORT_POSTCONNECTFACTORYINTERFACE_H_


text:
<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "{{%goods}}".
 *
 * @property string $goods_id
 * @property string $name
 * @property string $cat_id
 * @property string $intro
 * @property integer $nostore_sell
 * @property string $params
 * @property string $comments_count
 * @property string $buy_count
 * @property string $image_default_id
 * @property string $image_ids
 * @property string $uptime
 */
class Goods extends \yii\db\ActiveRecord {

    /**
     * @inheritdoc
     */
    public static function tableName() {
        return '{{%goods}}';
    }

    /**
     * @inheritdoc
     */
    public function rules() {
        return [
            [['cat_id', 'nostore_sell', 'comments_count', 'buy_count', 'uptime'], 'integer'],
            [['intro', 'params'], 'string'],
            [['name'], 'string', 'max' => 200],
            [['image_default_id', 'image_ids'], 'string', 'max' => 32]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels() {
        return [
            'goods_id' => 'Goods ID',
            'name' => 'Name',
            'cat_id' => 'Cat ID',
            'intro' => 'Intro',
            'nostore_sell' => 'Nostore Sell',
            'params' => 'Params',
            'comments_count' => 'Comments Count',
            'buy_count' => 'Buy Count',
            'image_default_id' => 'Image Default ID',
            'image_ids' => 'Image Ids',
            'uptime' => 'Uptime',
        ];
    }

    public function getProducts() {
        return $this->hasMany(Product::className(), ['goods_id' => 'goods_id'])->asArray();
    }

}


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

<title>Deprecated List</title>
<meta name="date" content="2022-10-12">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Deprecated API

Contents

Deprecated Methods

Deprecated Methods

Method and Description

com.mgnt.utils.TextUtils.parsingStringToTimeInterval(String)

Use TextUtils.parseStringToTimeInterval(String) instead. The new method the same as this one except the name change.
 This method is left for backwards compatibility only and will be removed in future versions.

com.mgnt.lifecycle.management.httpclient.HttpClient.setRequestProperty(String, String)

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="SutherlandHodgmanClipping.cs" company="OxyPlot">
//   Copyright (c) 2014 OxyPlot contributors
// </copyright>
//
//   Provides polygon clipping by the Sutherland-Hodgman algorithm.
//
// --------------------------------------------------------------------------------------------------------------------

namespace OxyPlot
{
    using System;
    using System.Collections.Generic;

    ///
    /// Provides polygon clipping by the Sutherland-Hodgman algorithm.
    ///
    public static class SutherlandHodgmanClipping
    {
        ///
        /// The rectangle edge.
        ///
        private enum RectangleEdge
        {
            ///
            /// The left.
            ///
            Left,

            ///
            /// The right.
            ///
            Right,

            ///
            /// The top.
            ///
            Top,

            ///
            /// The bottom.
            ///
            Bottom
        }

        ///
        /// The Sutherland-Hodgman polygon clipping algorithm.
        ///
        /// <param name="bounds">The bounds.</param>
        /// <param name="v">The polygon points.</param>
        /// <returns>The clipped points.</returns>
        /// <remarks>See link.</remarks>
        public static List<ScreenPoint> ClipPolygon(OxyRect bounds, IList<ScreenPoint> v)
        {
            List<ScreenPoint> p1 = ClipOneAxis(bounds, RectangleEdge.Left, v);
            List<ScreenPoint> p2 = ClipOneAxis(bounds, RectangleEdge.Right, p1);
            List<ScreenPoint> p3 = ClipOneAxis(bounds, RectangleEdge.Top, p2);
            return ClipOneAxis(bounds, RectangleEdge.Bottom, p3);
        }

        ///
        /// Clips to one axis.
        ///
        /// <param name="bounds">The bounds.</param>
        /// <param name="edge">The edge.</param>
        /// <param name="v">The points of the polygon.</param>
        /// <returns>The clipped points.</returns>
        private static List<ScreenPoint> ClipOneAxis(OxyRect bounds, RectangleEdge edge, IList<ScreenPoint> v)
        {
            if (v.Count == 0)
            {
                return new List<ScreenPoint>();
            }

            var polygon = new List<ScreenPoint>(v.Count);

            var s = v[v.Count - 1];

            for (int i = 0; i < v.Count; ++i)
            {
                var p = v[i];
                bool pin = IsInside(bounds, edge, p);
                bool sin = IsInside(bounds, edge, s);

                if (sin && pin)
                {
                    // case 1: inside -> inside
                    polygon.Add(p);
                }
                else if (sin)
                {
                    // case 2: inside -> outside
                    polygon.Add(LineIntercept(bounds, edge, s, p));
                }
                else if (!pin)
                {
                    // case 3: outside -> outside
                    // emit nothing
                }
                else
                {
                    // case 4: outside -> inside
                    polygon.Add(LineIntercept(bounds, edge, s, p));
                    polygon.Add(p);
                }

                s = p;
            }

            return polygon;
        }

        ///
        /// Determines whether the specified point is inside the edge/bounds.
        ///
        /// <param name="bounds">The bounds.</param>
        /// <param name="edge">The edge to test.</param>
        /// <param name="p">The point.</param>
        /// <returns><c>true</c> if the specified point is inside; otherwise, <c>false</c>.</returns>
        private static bool IsInside(OxyRect bounds, RectangleEdge edge, ScreenPoint p)
        {
            switch (edge)
            {
                case RectangleEdge.Left:
                    return !(p.X < bounds.Left);

                case RectangleEdge.Right:
                    return !(p.X >= bounds.Right);

                case RectangleEdge.Top:
                    return !(p.Y < bounds.Top);

                case RectangleEdge.Bottom:
                    return !(p.Y >= bounds.Bottom);

                default:
                    throw new ArgumentException("edge");
            }
        }

        ///
        /// Fines the edge interception.
        ///
        /// <param name="bounds">The bounds.</param>
        /// <param name="edge">The edge.</param>
        /// <param name="a">The first point.</param>
        /// <param name="b">The second point.</param>
        /// <returns>The interception.</returns>
        private static ScreenPoint LineIntercept(OxyRect bounds, RectangleEdge edge, ScreenPoint a, ScreenPoint b)
        {
            if (a.x.Equals(b.x) && a.y.Equals(b.y))
            {
                return a;
            }

            switch (edge)
            {
                case RectangleEdge.Bottom:
                    if (b.Y.Equals(a.Y))
                    {
                        throw new ArgumentException("no intercept found");
                    }

                    return new ScreenPoint(a.X + (((b.X - a.X) * (bounds.Bottom - a.Y)) / (b.Y - a.Y)), bounds.Bottom);

                case RectangleEdge.Left:
                    if (b.X.Equals(a.X))
                    {
                        throw new ArgumentException("no intercept found");
                    }

                    return new ScreenPoint(bounds.Left, a.Y + (((b.Y - a.Y) * (bounds.Left - a.X)) / (b.X - a.X)));

                case RectangleEdge.Right:
                    if (b.X.Equals(a.X))
                    {
                        throw new ArgumentException("no intercept found");
                    }

                    return new ScreenPoint(bounds.Right, a.Y + (((b.Y - a.Y) * (bounds.Right - a.X)) / (b.X - a.X)));

                case RectangleEdge.Top:
                    if (b.Y.Equals(a.Y))
                    {
                        throw new ArgumentException("no intercept found");
                    }

                    return new ScreenPoint(a.X + (((b.X - a.X) * (bounds.Top - a.Y)) / (b.Y - a.Y)), bounds.Top);
            }

            throw new ArgumentException("no intercept found");
        }
    }
}


text:
The code below will help you to implement an VBScript and VB6 app to create gs1 QR code. ByteScout QR Code is QR Code generation library. It provides full control on the quality, features and encoding. Can embed logo image right into QR Code itself. Batch barcode generation, and many special features like vCard or URL encoding are also supported. It can be used to create gs1 QR code using VBScript and VB6.

Fast application programming interfaces of ByteScout QR Code for VBScript and VB6 plus the instruction and the code below will help you quickly learn how to create gs1 QR code. Follow the instructions from the scratch to work and copy the VBScript and VB6 code. Implementing VBScript and VB6 application typically includes multiple stages of the software development so even if the functionality works please test it with your data and the production environment.

Free trial version of ByteScout QR Code is available for download from our website. Get it to try other source code samples for VBScript and VB6.

## REQUEST FREE TECH SUPPORT

[Click here to get in touch](https://bytescout.zendesk.com/hc/en-us/requests/new?subject=ByteScout%20QR%20Code%20Question)

or just send email to [support@bytescout.com](mailto:support@bytescout.com?subject=ByteScout%20QR%20Code%20Question)

## ON-PREMISE OFFLINE SDK

[Get Your 60 Day Free Trial](https://bytescout.com/download/web-installer?utm_source=github-readme)
[Explore SDK Docs](https://bytescout.com/documentation/index.html?utm_source=github-readme)
[Sign Up For Online Training](https://academy.bytescout.com/)

## ON-DEMAND REST WEB API

[Get your API key](https://pdf.co/documentation/api?utm_source=github-readme)
[Explore Web API Documentation](https://pdf.co/documentation/api?utm_source=github-readme)
[Explore Web API Samples](https://github.com/bytescout/ByteScout-SDK-SourceCode/tree/master/PDF.co%20Web%20API)

## VIDEO REVIEW

[https://www.youtube.com/watch?v=A5hB9ul3tX0](https://www.youtube.com/watch?v=A5hB9ul3tX0)

<!-- code block begin -->

##### ****GS1QRCode.vbs:**

```
' Create and activate QRCode instance
Set barcode = CreateObject("Bytescout.BarCode.QRCode")
barcode.RegistrationName = "demo"
barcode.RegistrationKey = "demo"

' Enable generation of GS1 version of QR Code
barcode.IsGS1 = True

' Set value that is formatted according to GS1 specification
barcode.Value = "(01)07046261398572(17)130331(10)TEST5632(21)19067811811"

' Save barcode image to file
barcode.SaveImage("result.png")

' Open the image in default image viewer (for demo purpose)
Set shell = CreateObject("WScript.Shell")
shell.Run "result.png", 1, false
Set shell = Nothing

Set barcode = Nothing

```

<!-- code block end -->


text:
from gallium.interface      import IExtension
from imagination.loader     import Loader
from imagination.standalone import container as standalone_container
from tornado.web            import URLSpec

class Extension(IExtension):
    def config_key(self):
        return 'http'

    def default_settings(self):
        return {
            'standalone'  : True,
            'handlers'    : [],
            'debug'       : False,
            'auto_reload' : False,
            'port'        : 8000,
        }

    def initialize(self, core, config):
        # NOTE As this is an experiment to work with the standalone, the given core may be ignored.
        container = standalone_container if config['standalone'] else core.container

        assert config['handlers'], 'The handlers is not defined.'

        routes = []

        for name, route in config['handlers'].items():
            assert 'pattern' in route, '"pattern" is not defined for route "{}".'.format(name)
            assert 'handler' in route, '"handler" is not defined for route "{}".'.format(name)

            routes.append(URLSpec(
                name    = name,
                pattern = route['pattern'],
                handler = Loader(route['handler']).package,
            ))

        with container.define_entity('tori5.http.tornado.app', 'tornado.web.Application') as app:
            app.set_param('list', routes,                'handlers')
            app.set_param('bool', config['debug'],       'debug')
            app.set_param('bool', config['auto_reload'], 'autoreload')

            with app.call('listen') as initial_call:
                initial_call.with_param('int', config['port'], 'port')

        with container.define_lambda('tori5.http.tornado.ioloop', 'tornado.ioloop.IOLoop'):
            pass # no parameters required

        with container.define_factorization('tori5.http.tornado', 'tori5.http.tornado.ioloop', 'current') as current_ioloop:
            pass # no parameters required


text:
package org.hisp.dhis.android.sdk.persistence.models.enrollment;

import com.raizlabs.android.dbflow.sql.builder.Condition;
import com.raizlabs.android.dbflow.sql.language.Select;

import org.hisp.dhis.android.sdk.persistence.models.flow.Enrollment$Flow;
import org.hisp.dhis.android.sdk.persistence.models.flow.Enrollment$Flow$Table;
import org.hisp.dhis.android.sdk.persistence.models.flow.Event$Flow;
import org.hisp.dhis.android.sdk.persistence.models.flow.TrackedEntityAttributeValue$Flow;
import org.hisp.dhis.android.sdk.models.enrollment.Enrollment;
import org.hisp.dhis.android.sdk.models.enrollment.IEnrollmentStore;
import org.hisp.dhis.android.sdk.models.event.IEventStore;
import org.hisp.dhis.android.sdk.models.program.Program;
import org.hisp.dhis.android.sdk.models.trackedentity.ITrackedEntityAttributeValueStore;
import org.hisp.dhis.android.sdk.models.trackedentity.TrackedEntityInstance;

import java.util.List;

public final class EnrollmentStore implements IEnrollmentStore {

    private final IEventStore eventStore;
    private final ITrackedEntityAttributeValueStore trackedEntityAttributeValueStore;

    public EnrollmentStore(IEventStore eventStore,
                           ITrackedEntityAttributeValueStore trackedEntityAttributeValueStore) {
        this.eventStore = eventStore;
        this.trackedEntityAttributeValueStore = trackedEntityAttributeValueStore;
    }

    @Override
    public boolean insert(Enrollment object) {
        Enrollment$Flow enrollmentFlow =
                Enrollment$Flow.fromModel(object);
        enrollmentFlow.insert();

        return true;
    }

    @Override
    public boolean update(Enrollment object) {
        //making sure uid is not overwritten with blank value in case uid was updated from server while object was loaded in memory
        if(object.getEnrollmentUid() == null || object.getEnrollmentUid().isEmpty()) {
            Enrollment$Flow persisted = new Select()
                    .from(Enrollment$Flow.class)
                    .where(Condition.column(Enrollment$Flow$Table
                            .ID).is(object.getId()))
                    .querySingle();
            if(persisted != null) {
                object.setEnrollmentUid(persisted.getEnrollmentUid());
            }
        }
        Enrollment$Flow.fromModel(object).update();
        return true;
    }

    @Override
    public boolean save(Enrollment object) {
        //making sure uid is not overwritten with blank value in case uid was updated from server while object was loaded in memory
        if(object.getEnrollmentUid() == null || object.getEnrollmentUid().isEmpty()) {
            Enrollment$Flow persisted = new Select()
                    .from(Enrollment$Flow.class)
                    .where(Condition.column(Enrollment$Flow$Table
                            .ID).is(object.getId()))
                    .querySingle();
            if(persisted != null) {
                object.setEnrollmentUid(persisted.getEnrollmentUid());
            }
        }
        Enrollment$Flow.fromModel(object).update();
        Enrollment$Flow enrollmentFlow =
                Enrollment$Flow.fromModel(object);
        enrollmentFlow.save();

        return true;
    }

    @Override
    public boolean delete(Enrollment object) {
        Enrollment$Flow.fromModel(object).delete();
        return true;
    }

    @Override
    public Enrollment queryById(long id) {
        return null;
    }

    @Override
    public List<Enrollment> queryAll() {
        List<Enrollment$Flow> enrollmentFlows = new Select()
                .from(Enrollment$Flow.class)
                .queryList();
        for(Enrollment$Flow enrollmentFlow : enrollmentFlows) {
            setEvents(enrollmentFlow);
            setTrackedEntityAttributeValues(enrollmentFlow);
        }
        return Enrollment$Flow.toModels(enrollmentFlows);
    }

    @Override
    public Enrollment query(long id) {
        Enrollment$Flow enrollmentFlow = new Select().from(Enrollment$Flow.class)
                .where(Condition.column(Enrollment$Flow$Table
                        .ID).is(id))
                .querySingle();
        setEvents(enrollmentFlow);
        setTrackedEntityAttributeValues(enrollmentFlow);
        return Enrollment$Flow.toModel(enrollmentFlow);
    }

    @Override
    public Enrollment query(String uid) {
        Enrollment$Flow enrollmentFlow = new Select().from(Enrollment$Flow.class)
                .where(Condition.column(Enrollment$Flow$Table
                        .ENROLLMENTUID).is(uid))
                .querySingle();
        setEvents(enrollmentFlow);
        setTrackedEntityAttributeValues(enrollmentFlow);
        return Enrollment$Flow.toModel(enrollmentFlow);
    }

    @Override
    public List<Enrollment> query(Program program, TrackedEntityInstance trackedEntityInstance) {
        List<Enrollment$Flow> enrollmentFlows = new Select()
                .from(Enrollment$Flow.class).where(Condition.column(Enrollment$Flow$Table.
                        PROGRAM).is(program.getUId())).and(Condition.column(Enrollment$Flow$Table.
                        TRACKEDENTITYINSTANCE_TEI).is(trackedEntityInstance)).queryList();
        for(Enrollment$Flow enrollmentFlow : enrollmentFlows) {
            setEvents(enrollmentFlow);
            setTrackedEntityAttributeValues(enrollmentFlow);
        }
        return Enrollment$Flow.toModels(enrollmentFlows);
    }

    @Override
    public Enrollment queryActiveEnrollment(Program program, TrackedEntityInstance trackedEntityInstance) {
        Enrollment$Flow enrollmentFlow = new Select().from(Enrollment$Flow.class)
                .where(Condition.column(Enrollment$Flow$Table.
                        PROGRAM).is(program.getUId())).and(Condition.column(Enrollment$Flow$Table.
                        TRACKEDENTITYINSTANCE_TEI).is(trackedEntityInstance)).
                        and(Condition.column(Enrollment$Flow$Table.STATUS).is(Enrollment.ACTIVE)).
                        querySingle();
        setEvents(enrollmentFlow);
        setTrackedEntityAttributeValues(enrollmentFlow);
        return Enrollment$Flow.toModel(enrollmentFlow);
    }

    @Override
    public List<Enrollment> query(TrackedEntityInstance trackedEntityInstance) {
        List<Enrollment$Flow> enrollmentFlows = new Select()
                .from(Enrollment$Flow.class).where(Condition.column(Enrollment$Flow$Table.
                        TRACKEDENTITYINSTANCE_TEI).is(trackedEntityInstance)).queryList();
        for(Enrollment$Flow enrollmentFlow : enrollmentFlows) {
            setEvents(enrollmentFlow);
            setTrackedEntityAttributeValues(enrollmentFlow);
        }
        return Enrollment$Flow.toModels(enrollmentFlows);
    }

    private void setEvents(Enrollment$Flow enrollmentFlow) {
        if(enrollmentFlow == null) {
            return;
        }
        enrollmentFlow.setEvents(Event$Flow.fromModels(eventStore
                .query(Enrollment$Flow.toModel(enrollmentFlow))));
    }

    private void setTrackedEntityAttributeValues(Enrollment$Flow enrollmentFlow) {
        if(enrollmentFlow == null) {
            return;
        }
        enrollmentFlow.setTrackedEntityAttributeValues(TrackedEntityAttributeValue$Flow
                .fromModels(trackedEntityAttributeValueStore
                        .query(Enrollment$Flow.toModel(enrollmentFlow))));
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<metadata modelVersion="1.1.0">
  <groupId>xyz.enhorse</groupId>
  <artifactId>commons</artifactId>
  <version>1.0-SNAPSHOT</version>
  <versioning>
    <snapshot>
      <timestamp>20160728.054944</timestamp>
      <buildNumber>1</buildNumber>
    </snapshot>
    <lastUpdated>20160728054944</lastUpdated>
    <snapshotVersions>
      <snapshotVersion>
        <extension>jar</extension>
        <value>1.0-20160728.054944-1</value>
        <updated>20160728054944</updated>
      </snapshotVersion>
      <snapshotVersion>
        <extension>pom</extension>
        <value>1.0-20160728.054944-1</value>
        <updated>20160728054944</updated>
      </snapshotVersion>
      <snapshotVersion>
        <classifier>jar-with-dependencies</classifier>
        <extension>jar</extension>
        <value>1.0-20160728.054944-1</value>
        <updated>20160728054944</updated>
      </snapshotVersion>
    </snapshotVersions>
  </versioning>
</metadata>


text:
package server

import (
	"google.golang.org/grpc"
	sdkgrpc "github.com/GoogleCloudPlatform/declarative-resource-client-library/python/proto/vpcaccess/beta/vpcaccess_beta_go_proto"
)

// RegisterServers registers each resource with the gRPC server.
func RegisterServers(s *grpc.Server) {
	sdkgrpc.RegisterVpcaccessBetaConnectorServiceServer(s, &ConnectorServer{})
}


text:
<!DOCTYPE html>

    <link rel="stylesheet" media="all" href="/smartanswers/application.css" />
    <link rel="stylesheet" media="print" href="/smartanswers/print.css" />
    <title>UK benefits if you're going or living abroad - GOV.UK</title>

    <meta name="robots" content="noindex">

        UK benefits if you're going or living abroad

      <form action="/uk-benefits-abroad/y/going_abroad/income_support/is_under_a_year_other/no/yes/no" accept-charset="UTF-8" method="get"><input name="utf8" type="hidden" value="✓" />

    Have you been unable to work or received Statutory Sick Pay for one of the following:

364 days

196 days if you’re terminally ill, or getting the highest rate of Disability Living Allowance (care component) or the enhanced rate of Personal Independence Payment (daily living component)

        <input type="radio" name="response" id="response_0" value="yes" />
        Yes

        <input type="radio" name="response" id="response_1" value="no" />
        No

            <input type="hidden" name="next" value="1" />
            <button type="submit" class="medium button">Next step</button>

      </form>

            Previous answers

          Start again

  Are you currently:

    in the UK and planning to move abroad

      Change answer to "Are you currently:"

  Which benefit will you be claiming?

    Income Support

      Change answer to "Which benefit will you be claiming?"

  How long are you going abroad for?

    Less than 1 year, for a different reason

      Change answer to "How long are you going abroad for?"

  Are you travelling abroad with a partner who is getting Income Support with one of the following:

    No

      Change answer to "Are you travelling abroad with a partner who is getting Income Support with one of the following:"

  Are you getting Income Support while either:

    Yes

      Change answer to "Are you getting Income Support while either:"

  Are you going abroad to get medical treatment for the illness or disability that prevents you from working?

    No

      Change answer to "Are you going abroad to get medical treatment for the illness or disability that prevents you from working?"

Last updated:  1 January 2015


text:
<?php
/* @var $this TeacherController */
/* @var $data Teacher */
?>

	<?php echo CHtml::encode($data->getAttributeLabel('id')); ?>:
	<?php echo CHtml::link(CHtml::encode($data->id), array('view', 'id'=>$data->id)); ?>

	<?php echo CHtml::encode($data->getAttributeLabel('name')); ?>:
	<?php echo CHtml::encode($data->name); ?>

	<?php echo CHtml::encode($data->getAttributeLabel('gender')); ?>:
	<?php echo CHtml::encode($data->gender); ?>

	<?php echo CHtml::encode($data->getAttributeLabel('phone')); ?>:
	<?php echo CHtml::encode($data->phone); ?>


text:
package thrift

import (
	"context"
	"fmt"
)

type TClient interface {
	Call(ctx context.Context, method string, args, result TStruct) error
}

type TStandardClient struct {
	seqId        int32
	iprot, oprot TProtocol
}

// TStandardClient implements TClient, and uses the standard message format for Thrift.
// It is not safe for concurrent use.
func NewTStandardClient(inputProtocol, outputProtocol TProtocol) *TStandardClient {
	return &TStandardClient{
		iprot: inputProtocol,
		oprot: outputProtocol,
	}
}

func (p *TStandardClient) Send(ctx context.Context, oprot TProtocol, seqId int32, method string, args TStruct) error {
	if err := oprot.WriteMessageBegin(method, CALL, seqId); err != nil {
		return err
	}
	if err := args.Write(oprot); err != nil {
		return err
	}
	if err := oprot.WriteMessageEnd(); err != nil {
		return err
	}
	return oprot.Flush(ctx)
}

func (p *TStandardClient) Recv(iprot TProtocol, seqId int32, method string, result TStruct) error {
	rMethod, rTypeId, rSeqId, err := iprot.ReadMessageBegin()
	if err != nil {
		return err
	}

	if method != rMethod {
		return NewTApplicationException(WRONG_METHOD_NAME, fmt.Sprintf("%s: wrong method name", method))
	} else if seqId != rSeqId {
		return NewTApplicationException(BAD_SEQUENCE_ID, fmt.Sprintf("%s: out of order sequence response", method))
	} else if rTypeId == EXCEPTION {
		var exception tApplicationException
		if err := exception.Read(iprot); err != nil {
			return err
		}

		if err := iprot.ReadMessageEnd(); err != nil {
			return err
		}

		return &exception
	} else if rTypeId != REPLY {
		return NewTApplicationException(INVALID_MESSAGE_TYPE_EXCEPTION, fmt.Sprintf("%s: invalid message type", method))
	}

	if err := result.Read(iprot); err != nil {
		return err
	}

	return iprot.ReadMessageEnd()
}

func (p *TStandardClient) Call(ctx context.Context, method string, args, result TStruct) error {
	p.seqId++
	seqId := p.seqId

	if err := p.Send(ctx, p.oprot, seqId, method, args); err != nil {
		return err
	}

	// method is oneway
	if result == nil {
		return nil
	}

	return p.Recv(p.iprot, seqId, method, result)
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<ldswebml type="image" uri="/media-library/images/gospel-art/latter-day-prophets#joseph-f-smith-82940" xml:lang="eng" locale="eng" status="publish">
  <search-meta>
      <uri-title its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">joseph-f-smith-82940</uri-title>
      <source>joseph-f-smith-82940</source>
      <publication-type its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">image</publication-type>
      <media-type its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">image</media-type>
      <publication value="ldsorg">LDS.org</publication>
      <publication-date value="2012-04-09">2012-04-09</publication-date>
      <title>Joseph F. Smith</title>
      <description>Joseph F. Smith (Gospel Art Book [2009], no. 127) - Our Heritage, 105-7</description>
      <collections>
          <collection its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">global-search</collection>
          <collection its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">media</collection>
          <collection its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">images</collection>
      </collections>
      <subjects>
          <subject>PPHIGH O001501-2000</subject>
          <subject>0001511</subject>
          <subject>0001527</subject>
          <subject>0001527.eps</subject>
          <subject>0001527.jpg</subject>
          <subject>31382 PRESIDENTS OF THE CHURCH</subject>
          <subject>34730 GAPP GOSPEL ART PACKET</subject>
          <subject>35936</subject>
          <subject>ART</subject>
          <subject>CHURCH</subject>
          <subject>GAPP</subject>
          <subject>GOSPEL</subject>
          <subject>HIGHRES</subject>
          <subject>JOSEPH</subject>
          <subject>JOSEPH F SMITH</subject>
          <subject>LDPCT6N.J</subject>
          <subject>O001501-2000</subject>
          <subject>PACKET</subject>
          <subject>PPHIGH</subject>
          <subject>PRESIDENTS</subject>
          <subject>PROPHETS</subject>
          <subject>SMITH</subject>
          <subject>TEACHINGS</subject>
          <subject>LDS Church Leaders</subject>
          <subject>Portraits</subject>
          <subject>Presidents of the Church</subject>
          <subject>Smith</subject>
          <subject>Joseph F.</subject>
      </subjects>
  </search-meta>
  <no-search>
      <path>http://media.ldscdn.org/images/media-library/gospel-art/latter-day-prophets/joseph-f-smith-82940-gallery.jpg</path>
      <images>
          http://media.ldscdn.org/images/media-library/gospel-art/latter-day-prophets/joseph-f-smith-82940-thumbnail.jpg
      </images>
          <download-urls>
              <download-url>
                  Mobile
                  <size>288 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/gospel-art/latter-day-prophets/joseph-f-smith-82940-mobile.jpg</path>
              </download-url>
              <download-url>
                  Tablet
                  <size>618 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/gospel-art/latter-day-prophets/joseph-f-smith-82940-tablet.jpg</path>
              </download-url>
              <download-url>
                  Print
                  <size>810 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/gospel-art/latter-day-prophets/joseph-f-smith-82940-print.jpg</path>
              </download-url>
              <download-url>
                  Wallpaper
                  <size>1.2 MB</size>
                  <path>http://media.ldscdn.org/images/media-library/gospel-art/latter-day-prophets/joseph-f-smith-82940-wallpaper.jpg</path>
              </download-url>
          </download-urls>
  </no-search>
<ldse-meta its:translate="no" xmlns="http://lds.org/code/lds-edit" xmlns:its="http://www.w3.org/2005/11/its"><document id="joseph-f-smith-82940" locale="eng" uri="/media-library/images/gospel-art/latter-day-prophets#joseph-f-smith-82940" status="publish" site="ldsorg" source="chq" words="190" tgp="0.6643"/><created username="lds-edit" userid=""/><last-modified date="2012-05-10T12:26:12.550235-06:00" username="lds-edit" userid=""/></ldse-meta></ldswebml>


text:
static TQNothingness *sharedInstance;

@implementation TQNothingness

+ (id)nothing
{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        sharedInstance = class_createInstance(self, 0);
    });
    return sharedInstance;
}

+ (id)include:(Class)aClass recursive:(id)aRecursive
{
    NSAssert(NO, @"Extending nothing is not allowed");
    return nil;
}

+ (id)allocWithZone:(NSZone *)aZone
{
    NSAssert(NO, @"You're trying to create nothing. You make no sense.");
    return nil;
}

- (id)copyWithZone:(NSZone *)zone
{
    NSAssert(NO, @"You're trying to copy nothing. You make no sense.");
    return nil;
}

- (oneway void)release {}
- (id)retain
{
    return self;
}

- (BOOL)respondsToSelector:(SEL)selector
{
    return NO;
}

- (BOOL)conformsToProtocol:(Protocol *)aProtocol
{
    return NO;
}

- (NSUInteger)hash
{
    return 0;
}

- (BOOL)isEqual:(id)obj
{
    return obj == self; // There's only one instance
}

- (NSString *)description
{
    return @"(nothing)";
}

- (Class)class
{
    return nil;
}
@end