text:
<title>Member List - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link type="text/css" rel="stylesheet" href="doxygen.css">
<link type="text/css" rel="stylesheet" href="tabs.css">

Main Page

Related Pages

Modules

Namespaces

Classes

Files

Directories

Class List

Class Index

Class Hierarchy

Class Members

Ogre

NedAllocPolicy

Ogre::NedAllocPolicy Member List

This is the complete list of members for Ogre::NedAllocPolicy, including all inherited members.

allocateBytes(size_t count, const char *file=0, int line=0, const char *func=0)	Ogre::NedAllocPolicy	 [static]

deallocateBytes(void *ptr)	Ogre::NedAllocPolicy	 [static]

getMaxAllocationSize()	Ogre::NedAllocPolicy	 [static]

NedAllocPolicy()	Ogre::NedAllocPolicy	 [private]

Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

Last modified Sun Sep 2 2012 07:27:31


text:
$packageName = '{{PackageName}}'
$installerType = 'exe'
$silentArgs = ''
$url = '{{DownloadUrl}}'
$checksum = '{{Checksum}}'
$checksumType = 'sha1'
$validExitCodes = @(0)
$scriptPath = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$ahkFile = Join-Path $scriptPath 'swftoolsInstall.ahk'

Start-Process 'AutoHotKey' "$ahkFile"
Install-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$url" -validExitCodes $validExitCodes -Checksum "$checksum" -ChecksumType "$checksumType"

redpajama_set_name: RedPajamaGithub


text:
@implementation FIRStorageMetadata

#pragma mark - Initializers

- (instancetype)init {
  return [self initWithDictionary:[NSDictionary dictionary]];
}

- (instancetype)initWithDictionary:(NSDictionary *)dictionary {
  self = [super init];
  if (self) {
    _bucket = dictionary[kFIRStorageMetadataBucket];
    _cacheControl = dictionary[kFIRStorageMetadataCacheControl];
    _contentDisposition = dictionary[kFIRStorageMetadataContentDisposition];
    _contentEncoding = dictionary[kFIRStorageMetadataContentEncoding];
    _contentLanguage = dictionary[kFIRStorageMetadataContentLanguage];
    _contentType = dictionary[kFIRStorageMetadataContentType];
    _customMetadata = dictionary[kFIRStorageMetadataCustomMetadata];
    _size = [dictionary[kFIRStorageMetadataSize] longLongValue];
    _downloadURLs = dictionary[kFIRStorageMetadataDownloadURLs];
    _generation = [dictionary[kFIRStorageMetadataGeneration] longLongValue];
    _metageneration = [dictionary[kFIRStorageMetadataMetageneration] longLongValue];
    _timeCreated = [self dateFromRFC3339String:dictionary[kFIRStorageMetadataTimeCreated]];
    _updated = [self dateFromRFC3339String:dictionary[kFIRStorageMetadataUpdated]];
    // GCS "name" is our path, our "name" is just the last path component of the path
    _path = dictionary[kFIRStorageMetadataName];
    _name = [_path lastPathComponent];
    NSString *downloadTokens = dictionary[kFIRStorageMetadataDownloadTokens];
    if (downloadTokens) {
      NSArray<NSString *> *downloadStringArray = [downloadTokens componentsSeparatedByString:@","];
      NSMutableArray<NSURL *> *downloadURLArray =
          [[NSMutableArray alloc] initWithCapacity:[downloadStringArray count]];
      [downloadStringArray enumerateObjectsUsingBlock:^(NSString *_Nonnull token, NSUInteger idx,
                                                        BOOL *_Nonnull stop) {
        NSURLComponents *components = [[NSURLComponents alloc] init];
        components.scheme = kFIRStorageScheme;
        components.host = kFIRStorageHost;
        NSString *path = [FIRStorageUtils GCSEscapedString:_path];
        NSString *fullPath = [NSString stringWithFormat:kFIRStorageFullPathFormat, _bucket, path];
        components.percentEncodedPath = fullPath;
        components.query = [NSString stringWithFormat:@"alt=media&token=%@", token];

        [downloadURLArray insertObject:[components URL] atIndex:idx];
      }];
      _downloadURLs = downloadURLArray;
    }
  }
  return self;
}

#pragma mark - NSObject overrides

- (instancetype)copyWithZone:(NSZone *)zone {
  return [[[self class] allocWithZone:zone] initWithDictionary:[self dictionaryRepresentation]];
}

- (BOOL)isEqual:(id)object {
  if (self == object) {
    return YES;
  }

  if (![object isKindOfClass:[FIRStorageMetadata class]]) {
    return NO;
  }

  BOOL isEqualObject = [self isEqualToFIRStorageMetadata:(FIRStorageMetadata *)object];
  return isEqualObject;
}

- (BOOL)isEqualToFIRStorageMetadata:(FIRStorageMetadata *)metadata {
  return [[self dictionaryRepresentation] isEqualToDictionary:[metadata dictionaryRepresentation]];
}

- (NSUInteger)hash {
  NSUInteger hash = [[self dictionaryRepresentation] hash];
  return hash;
}

- (NSString *)description {
  NSDictionary *metadataDictionary = [self dictionaryRepresentation];
  return [NSString stringWithFormat:@"%@ %p: %@", [self class], self, metadataDictionary];
}

#pragma mark - Public methods

- (NSDictionary *)dictionaryRepresentation {
  NSMutableDictionary *metadataDictionary = [[NSMutableDictionary alloc] initWithCapacity:13];

  if (_bucket) {
    metadataDictionary[kFIRStorageMetadataBucket] = _bucket;
  }

  if (_cacheControl) {
    metadataDictionary[kFIRStorageMetadataCacheControl] = _cacheControl;
  }

  if (_contentDisposition) {
    metadataDictionary[kFIRStorageMetadataContentDisposition] = _contentDisposition;
  }

  if (_contentEncoding) {
    metadataDictionary[kFIRStorageMetadataContentEncoding] = _contentEncoding;
  }

  if (_contentLanguage) {
    metadataDictionary[kFIRStorageMetadataContentLanguage] = _contentLanguage;
  }

  if (_contentType) {
    metadataDictionary[kFIRStorageMetadataContentType] = _contentType;
  }

  if (_customMetadata) {
    metadataDictionary[kFIRStorageMetadataCustomMetadata] = _customMetadata;
  }

  if (_downloadURLs) {
    NSMutableArray *downloadTokens = [[NSMutableArray alloc] init];
    [_downloadURLs
        enumerateObjectsUsingBlock:^(NSURL *_Nonnull URL, NSUInteger idx, BOOL *_Nonnull stop) {
          NSArray *queryItems = [URL.query componentsSeparatedByString:@"&"];
          [queryItems enumerateObjectsUsingBlock:^(NSString *queryString, NSUInteger idx,
                                                   BOOL *_Nonnull stop) {
            NSString *key;
            NSString *value;
            NSScanner *scanner = [NSScanner scannerWithString:queryString];
            [scanner scanUpToString:@"=" intoString:&key];
            [scanner scanString:@"=" intoString:NULL];
            [scanner scanUpToString:@"\n" intoString:&value];
            if ([key isEqual:@"token"]) {
              [downloadTokens addObject:value];
              *stop = YES;
            }
          }];
        }];
    NSString *downloadTokenString = [downloadTokens componentsJoinedByString:@","];
    metadataDictionary[kFIRStorageMetadataDownloadTokens] = downloadTokenString;
  }

  if (_generation) {
    NSString *generationString = [NSString stringWithFormat:@"%lld", _generation];
    metadataDictionary[kFIRStorageMetadataGeneration] = generationString;
  }

  if (_metageneration) {
    NSString *metagenerationString = [NSString stringWithFormat:@"%lld", _metageneration];
    metadataDictionary[kFIRStorageMetadataMetageneration] = metagenerationString;
  }

  if (_timeCreated) {
    metadataDictionary[kFIRStorageMetadataTimeCreated] = [self RFC3339StringFromDate:_timeCreated];
  }

  if (_updated) {
    metadataDictionary[kFIRStorageMetadataUpdated] = [self RFC3339StringFromDate:_updated];
  }

  if (_path) {
    metadataDictionary[kFIRStorageMetadataName] = _path;
  }

  return [metadataDictionary copy];
}

- (BOOL)isFile {
  return _type == FIRStorageMetadataTypeFile;
}

- (BOOL)isFolder {
  return _type == FIRStorageMetadataTypeFolder;
}

- (nullable NSURL *)downloadURL {
  return [_downloadURLs firstObject];
}

#pragma mark - RFC 3339 conversions

static NSDateFormatter *sRFC3339DateFormatter;

static void setupDateFormatterOnce(void) {
  static dispatch_once_t onceToken;
  dispatch_once(&onceToken, ^{
    sRFC3339DateFormatter = [[NSDateFormatter alloc] init];
    NSLocale *enUSPOSIXLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"];

    [sRFC3339DateFormatter setLocale:enUSPOSIXLocale];
    [sRFC3339DateFormatter setDateFormat:@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.SSSZZZZZ"];
    [sRFC3339DateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
  });
}

- (nullable NSDate *)dateFromRFC3339String:(NSString *)dateString {
  setupDateFormatterOnce();
  NSDate *rfc3339Date = [sRFC3339DateFormatter dateFromString:dateString];
  return rfc3339Date;
}

- (nullable NSString *)RFC3339StringFromDate:(NSDate *)date {
  setupDateFormatterOnce();
  NSString *rfc3339String = [sRFC3339DateFormatter stringFromDate:date];
  return rfc3339String;
}

@end


text:
require 'recursive-open-struct'
require "bigcartel/version"
require "bigcartel/api"
require "bigcartel/bigcartel_object"
require "bigcartel/account"
require "bigcartel/order"

module Bigcartel
  class << self
    attr_accessor :api_key
  end
end


text:
package com.autonomy.abc.dashboards;

import com.hp.autonomy.frontend.selenium.config.TestConfig;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.SearchContext;
import org.openqa.selenium.WebElement;

import java.util.List;

import static com.hp.autonomy.frontend.selenium.framework.state.TestStateAssert.assertThat;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.core.IsNot.not;
import static org.junit.Assert.assertTrue;

public class ResultsListWidgetITCase extends ClickableDashboardITCase {
    public ResultsListWidgetITCase(final TestConfig config) {
        super(config, 1, "List Dashboard", "List", "ListSearch");
    }

    @Test
    public void testElementExists() {
        final WebElement webElement = page.getWidgets().get(0);
        assertThat("class has not been rendered", webElement.findElement(By.cssSelector(".results-list")) != null);
    }

    @Test
    public void testResultsDisplay() {
        final WebElement webElement = page.getWidgets().get(0);
        final List<WebElement> results = webElement.findElements(By.cssSelector(".search-result"));

        assertThat("There should be at least one result", results, not(empty()));

        checkOutOfViewClass(webElement);
    }

    @Test
    public void testResultsOrientation() {
        final WebElement webElement = page.getWidgets().get(0);
        assertThat("incorrect flex direction, should be column", "column".equals(webElement.findElement(By.cssSelector(".results-list")).getCssValue("flex-direction")));
    }

    @Test
    public void testResize() {
        getDriver().manage().window().setSize(new Dimension(1000, 800));
        final WebElement webElement = page.getWidgets().get(0);
        checkOutOfViewClass(webElement);
    }

    private void checkOutOfViewClass(final SearchContext widget) {
        final List<WebElement> results = widget.findElements(By.cssSelector(".search-result"));

        results.forEach(result -> {
            final boolean isDisplayed = result.isDisplayed();
            final boolean hasClass = result.getAttribute("class").contains("out-of-view");

            assertTrue(
                    "All invisible results (and only invisible results) must have the out-of-view class",
                    isDisplayed ^ hasClass
            );
        });
    }
}


text:
layout: notfound
title: CPU Benchmark - sitespeed.io
permalink: /cpu.html
---


text:
/**
 * Parse profile.
 *
 * References:
 *  - https://www.dropbox.com/developers-v1/core/docs#account-info
 *
 * @param {object|string} json
 * @return {object}
 * @api public
 */
exports.parse = function(json) {
  if ('string' == typeof json) {
    json = JSON.parse(json);
  }

  var profile = {};
  profile.id = String(json.uid)
  profile.displayName = json.display_name;
  profile.emails = [{ value: json.email }];

  return profile;
};


text:
set -e

if [ "${CIRCLE_BRANCH}" != "master" ] && [ "${CI_PULL_REQUEST}" != "" ]
then
  # Not a push to master, so no system tests or doc updates required.
  exit 0
fi

echo $GCLOUD_TESTS_KEY | base64 --decode > ${HOME}/key.json
export GCLOUD_TESTS_KEY="$(pwd)/key.json"

git config user.name "circle-ci"
git config user.email "circle-ci@circleci.com"

set +e # allows `git` commands during prepare-ghpages to fail

npm run prepare-ghpages

cd gh-pages
git push origin master --follow-tags

cd ..
npm run remove-ghpages
git push origin master --follow-tags


text:
package org.robotninjas.barge.utils;

import java.io.File;

/**
 */
public class Files {
  @SuppressWarnings({ "ConstantConditions", "ResultOfMethodCallIgnored" })
  public static void delete(File directory) {

    for (File file : directory.listFiles()) {

      if (file.isFile()) {
        file.delete();
      } else {
        delete(file);
      }
    }

    directory.delete();
  }
}


text:
R Analyses & other statistics courses
====

Here you may find all exercises with R from :

1.  [Udacity - Statistics @ Sebastian Thrun](https://www.udacity.com/course/st101)
2.  [Coursera's Statistics One](https://class.coursera.org/stats1-002/class)
3.  [Data Analysis and Statistical Inference class](https://www.coursera.org/course/statistics)
4.  [R Programming - Roger Peng et al. @ JHU](https://www.coursera.org/course/rprog)
5.  [Exploratory Data Analysis - Roger Peng et al. @ JHU](https://www.coursera.org/course/exdata)
6.  [Practical Machine Learning - Jeff Leek et al. @ JHU](https://www.coursera.org/course/predmachlearn)
7.  [Programming for Everybody (Getting Started with Python)](https://www.coursera.org/learn/python/)
8.  [Crowdsourcing Data Analysis 2, Phase 2: Explaining Variability in Analyses and Results](https://docs.google.com/document/d/1fXQBLdWydISskOKhoq8gl5unuwsv7VA3pkKY4IWFS6o/edit)
    - [Results](http://rpubs.com/F789GH/AnalysisOfEdgeOrgData)
9.  [Data analysis course @ FAU university](https://www.statistik.rw.fau.de/lehre/bachelor/datenanalyse/)
10. [R Programming Language Explained - FreeCodeCamp.org Article](https://www.freecodecamp.org/news/r-programming-language-explained/)

My IDE of choice is [RStudio](http://www.rstudio.com/). Just try it and [follow its development](https://www.github.com/rstudio/rstudio)


text:
           <link type="text/css" rel="stylesheet" href="./resources/templates/f39803f7-df02-4169-93eb-7547fb8c961a-1442592103626.css" />

           <link type="text/css" rel="stylesheet" href="./resources/screens/942e5448-8c5e-408c-9726-b36adab20d8c-1442592103626.css" />

                   WELCOME TO VELOCITY!
We will be in contact shortly.

HOME

JOIN

HOW IT WORKS

ABOUT US

CONTACT US

LOGIN


text:
#!/usr/bin/env node

/* By converting each letter in a word to a number corresponding to
   its alphabetical position and adding these values we form a word
   value. For example, the word value for SKY is
   19 + 11 + 25 = 55 = t_(10). If the word value is a triangle number
   then we shall call the word a triangle word.

   Using words.txt (right click and 'Save Link/Target As...'), a 16K
   text file containing nearly two-thousand common English words,
   how many are triangle words?

   I've renamed words.txt as no042.txt */

var fns = require('../functions.js'),
    operator = require('../operator.js'),
    timer = require('../timer.js');

function wordToValue(word) {
  var letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  function indexToVal(letter) {
    return operator.inArray(letter, letters) + 1;
  };
  return operator.sum(word.split('').map(indexToVal));
};

function numTriangle() {
  // Assumes file is "A","ABILITIY","ABLE",...
  var words = fns.getData(42).slice(1, -1).split('","'),
      vals = words.map(wordToValue),
      triangleHash = {}, count = 0;
  for (var i = 0, val; val = vals[i]; i++) {
    if (fns.reversePolygonalNumber(3, val, triangleHash) != -1) {
      count++;
    }
  }
  return count;
};

exports.main = function(verbose) {
  if (typeof verbose == 'undefined') {
    verbose = false;
  }
  return numTriangle();
};

if (require.main === module) {
  timer.timer(42, exports.main);
}


text:
//@@author A0105748B

package seedu.bulletjournal.model.util;

import seedu.bulletjournal.commons.exceptions.IllegalValueException;
import seedu.bulletjournal.model.ReadOnlyTodoList;
import seedu.bulletjournal.model.TodoList;
import seedu.bulletjournal.model.tag.UniqueTagList;
import seedu.bulletjournal.model.task.BeginDate;
import seedu.bulletjournal.model.task.DueDate;
import seedu.bulletjournal.model.task.Status;
import seedu.bulletjournal.model.task.Task;
import seedu.bulletjournal.model.task.TaskName;
import seedu.bulletjournal.model.task.UniqueTaskList.DuplicateTaskException;

/**
 * Class for sample data to be loaded into the TodoList
 */

public class SampleDataUtil {
    public static Task[] getSampleTasks() {
        try {
            return new Task[] {
                new Task(new TaskName("Assignment for CS"), new DueDate("9th April 4pm"), new Status("undone"),
                            new BeginDate("9th April 2pm"), new UniqueTagList("school")),
                new Task(new TaskName("Do laundry"), null, new Status("undone"),
                            new BeginDate("8th April 1pm"), new UniqueTagList("life")),
                new Task(new TaskName("Take shower"), null, new Status("undone"),
                            new BeginDate("8th April 9pm"), new UniqueTagList("life")),
                new Task(new TaskName("Play basketball"), new DueDate("9th April 9pm"), new Status("undone"),
                            new BeginDate("9th April 7pm"), new UniqueTagList("life")),
                new Task(new TaskName("Change test cases"), new DueDate("10th April 10am"), new Status("undone"),
                            new BeginDate("10th April 8am"), new UniqueTagList("school")),
                new Task(new TaskName("Submit cs project"), new DueDate("10th April 12pm"), new Status("undone"),
                            null, new UniqueTagList("deadline")),
                new Task(new TaskName("project meeting"), null, new Status("undone"),
                            new BeginDate("10th April 6am"), new UniqueTagList("school")),
                new Task(new TaskName("CCA meeting"), new DueDate("15th April 12pm"), new Status("undone"),
                            new BeginDate("15th April 10am"), new UniqueTagList("cca")),
                new Task(new TaskName("go get a drink"), null, new Status("undone"),
                            new BeginDate("10th April 12:15"), new UniqueTagList("life")),
                new Task(new TaskName("Richard birthday"), null, new Status("undone"),
                            new BeginDate("20th May 12am"), new UniqueTagList("life")),
                new Task(new TaskName("Relocate plants"), null, new Status("undone"),
                            new BeginDate("16th April 5pm"), new UniqueTagList("life")),
                new Task(new TaskName("Study hacking"), new DueDate("22th April 4pm"), new Status("undone"),
                            new BeginDate("27th April 9am"), new UniqueTagList("life")),
                new Task(new TaskName("Apply for volunteer"), new DueDate("27th April 23:59"), new Status("undone"),
                            null, new UniqueTagList("deadline")),
                new Task(new TaskName("Buy new laptop"), null, new Status("undone"),
                            new BeginDate("29th April 2pm"), new UniqueTagList("life")),
                new Task(new TaskName("Buy new sandals"), null, new Status("undone"),
                            new BeginDate("29th April 2016 2pm"), new UniqueTagList("life")),
                new Task(new TaskName("Buy gift for Danny"), new DueDate("30th April 5pm"), new Status("undone"),
                            new BeginDate("30th April 2016 2pm"), new UniqueTagList("life")),
                new Task(new TaskName("3241 project due"), new DueDate("17th April 23:59"), new Status("undone"),
                            null, new UniqueTagList("deadline")),
                new Task(new TaskName("FYP presentation"), new DueDate("20th April 4pm"), new Status("undone"),
                            new BeginDate("20th April 12pm"), new UniqueTagList("school")),
                new Task(new TaskName("Submit FYP report"), new DueDate("24th March 4pm"), new Status("undone"),
                            null, new UniqueTagList("deadline")),
                new Task(new TaskName("Order Mcdonald"), null, new Status("undone"),
                            new BeginDate("24th March 4:15"), new UniqueTagList("life")),
                new Task(new TaskName("CS quiz"), new DueDate("22th February 3pm"), new Status("undone"),
                            new BeginDate("22th February 2pm"), new UniqueTagList("school")),
                new Task(new TaskName("Watch webcast"), new DueDate("21th February 9pm"), new Status("undone"),
                            new BeginDate("21th February 9am"), new UniqueTagList("school")),
                new Task(new TaskName("Print out pyp"), new DueDate("30th April 8am"), new Status("undone"),
                            new BeginDate("30th April 7am"), new UniqueTagList("school")),
                new Task(new TaskName("Check tutorial answer"), new DueDate("1 march 4pm"), new Status("undone"),
                            new BeginDate("1 march 12pm"), new UniqueTagList("school")),
                new Task(new TaskName("Revise for finals"), new DueDate("5th May 4pm"), new Status("undone"),
                            new BeginDate("30th April 12pm"), new UniqueTagList("school")),
                new Task(new TaskName("Buy eye drops"), new DueDate("9th Jan 3pm"), new Status("undone"),
                            new BeginDate("9th Jan 2pm"), new UniqueTagList("life")),
                new Task(new TaskName("Wash backpack"), null, new Status("undone"),
                            new BeginDate("10th May 2016 2pm"), new UniqueTagList("life")),
                new Task(new TaskName("Buy planting pots"), null, new Status("undone"),
                            new BeginDate("1 April 11pm"), new UniqueTagList("life")),
                new Task(new TaskName("Clean aircon"), new DueDate("1th April 2pm"), new Status("undone"),
                            new BeginDate("1th April 1pm"), new UniqueTagList("life")),
                new Task(new TaskName("Econs sharing session"), new DueDate("16th May 12pm"), new Status("undone"),
                            new BeginDate("16th May 2016 9am"), new UniqueTagList("school")),
                new Task(new TaskName("Google interview"), null, new Status("undone"),
                            new BeginDate("22th May 2018"), new UniqueTagList("work")),
                new Task(new TaskName("Read new novel"), null, null,
                            null, new UniqueTagList("life")),
                new Task(new TaskName("Dinner with girlfriend"), new DueDate("22th May 9pm"), new Status("undone"),
                            new BeginDate("22th May 6pm"), new UniqueTagList("life")),
                new Task(new TaskName("Move to new hostel"), null, new Status("undone"),
                            new BeginDate("1 May 2016"), new UniqueTagList("life")),
                new Task(new TaskName("Fly to Taipei"), new DueDate("1 June 2pm"), new Status("undone"),
                            new BeginDate("1 June 10am"), new UniqueTagList("travel")),
                new Task(new TaskName("Visit night markets"), new DueDate("1 June 11pm"), new Status("undone"),
                            new BeginDate("1 June 7pm"), new UniqueTagList("travel")),
                new Task(new TaskName("Buy souvenir for friends"), new DueDate("10 June 3pm"), new Status("undone"),
                            new BeginDate("1 June 2pm"), new UniqueTagList("travel")),
                new Task(new TaskName("Bus to Hualian"), new DueDate("10th June 6pm"), new Status("undone"),
                            new BeginDate("10th June 3pm"), new UniqueTagList("travel")),
                new Task(new TaskName("Book hotel in Beijing"), null, new Status("undone"),
                            new BeginDate("10th June 4pm"), new UniqueTagList("travel")),
                new Task(new TaskName("Fly to Tianjin"), new DueDate("15th June 5pm"), new Status("undone"),
                            new BeginDate("15th June 12pm"), new UniqueTagList("travel")),
                new Task(new TaskName("Watch Beijing opera"), new DueDate("20th June 9:30"), new Status("undone"),
                            new BeginDate("20th June 7pm"), new UniqueTagList("travel")),
                new Task(new TaskName("Fly to Paris"), new DueDate("10th July 11am"), new Status("undone"),
                            new BeginDate("10th July 2am"), new UniqueTagList("travel")),
                new Task(new TaskName("Visit London bridge"), new DueDate("13th July 5am"), new Status("undone"),
                            new BeginDate("13th July 3am"), new UniqueTagList("travel")),
                new Task(new TaskName("Shopping for CNY"), new DueDate("10th February 2018"), new Status("undone"),
                            new BeginDate("4th March"), new UniqueTagList("life")),
                new Task(new TaskName("Buy watermelon"), null, new Status("undone"),
                            new BeginDate("8th April 6pm"), new UniqueTagList("life")),
                new Task(new TaskName("Internship report"), new DueDate("23th June 23:59"), new Status("undone"),
                            null, new UniqueTagList("deadline")),
                new Task(new TaskName("Internship presentation"), new DueDate("20th June 12pm"), new Status("undone"),
                            new BeginDate("20th June 10am"), new UniqueTagList("work")),
                new Task(new TaskName("Site visit"), new DueDate("20th June 2pm"), new Status("undone"),
                            new BeginDate("20th June 12pm"), new UniqueTagList("work")),
                new Task(new TaskName("Call mom"), null, null,
                            null, new UniqueTagList("life")),
                new Task(new TaskName("Ride bicycle"), new DueDate("11th June 1am"), new Status("undone"),
                            new BeginDate("10th June 7pm"), new UniqueTagList("travel")) };
        } catch (IllegalValueException e) {
            throw new AssertionError("sample data cannot be invalid", e);
        }
    }

    public static ReadOnlyTodoList getSampleTodoList() {
        try {
            TodoList sampleAB = new TodoList();
            for (Task sampleTask : getSampleTasks()) {
                sampleAB.addTask(sampleTask);
            }
            return sampleAB;
        } catch (DuplicateTaskException e) {
            throw new AssertionError("sample data cannot contain duplicate tasks", e);
        }
    }
}


text:
.. _license:

LICENSE
#######

.. include:: ../../LICENSE
    :literal:


text:
require_xpr64;
require_fp;
softfloat_roundingMode = RM;
WRITE_HFRD(ui64_to_f32(RS1));
set_fp_exceptions;


text:
        <button type="button" class="u-close" data-dismiss="modal" aria-label="Close">×</button>

Silhouette

 Product Manager

Duration

6 months

Challenge

Offer customers a way to reduce OPEX by up to 40% and control operational budgets.

Solution

Introduce a shared services platform for with built-in monitoring and analytics. Design it to scale across International regions and capture detailed, real-time shipping expenditures for reporting.

Final Product

Parcel Analytics


text:
FROM jwilder/nginx-proxy

COPY vhost.d/default /etc/nginx/vhost.d/default
COPY custom.conf /etc/nginx/conf.d/custom.conf


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class CI_roulette_unittest extends CI_Controller{

    function __construct(){
        parent::__construct();
        $this->load->database();
        $this->load->library('Roulette');
    }
    function index(){
        require('../Roulette_unittest.php');
        $tester = new Roulette_unittest;
        $tester->connection = $this->db;
        $tester->test();
        $tester->printResult();
    }
}

// class Roulette_unittest_x extends CI_Controller {

//     protected $test_model_dir = 'test/';
//     protected $test_model = array(
//         'roulette_test',
//         'rouletteproxy_test',
//     );
//     protected $template_report = '
//

//             {rows}
//

//                     {result}
//

//             {/rows}
//

//     ';

//     public function __construct(){
//         parent::__construct();
//         $this->load->library('parser');
//         $this->load->library('unit_test');
//         $this->load->library('roulette');
//         $this->load->model('roulette_unittest_model');
//         foreach ($this->test_model as $key => $model) {
//             $this->load->model($this->test_model_dir.$model);
//         }
//     }

//     public function index(){
//         $this->test();
//     }

//     public function test( $test = null ){
//         $this->unit->set_template($this->template_report);
//         $this->unit->set_test_items(array('test_name','result')); //'file' 'notes'

//         // init
//         $classes = array();
//         $classes_count = count($this->test_model);
//         $passed = $failed = $total = 0;

//         $str = '';
//         $start_time = round(microtime(true)*1000);
//         $test_model = empty($test) ? $this->test_model : array($test.'_test');

//         foreach ($test_model as $key => $model) {
//             $classes[] = $this->{$model}->title;
//         }
//         foreach ($test_model as $key => $model) {
//             $str .= $this->{$model}->test(false);
//         }
//         foreach ($this->unit->result() as $key => $value) {
//             $total++;
//             if( strtolower($value['Result']) == 'passed' ){
//                 $passed++;
//             }else{
//                 $failed++;
//             }
//         }
//         $end_time = round(microtime(true)*1000);
//         $long_time = ($end_time - $start_time)/1000;

//         $str = "

//             Roulette Unit Testing

//
//                 completed in ".$long_time." second
//                 (result:
//                 ".$classes_count." classes,
//                 ".$total." test,
//                 ".$passed." passed,
//                 ".$failed." failed
//                 )
//
//

//             Class tested:
".implode(',
 ', $classes)."
//
".$str;
//         $str = preg_replace('/\{code\}(.*?)\{\/code\}/si', '${1}', $str);

//         echo $str;
//     }

// }


text:
'use strict';

const test = require('tape');
const sinon = require('sinon');
const User = require('./../models/user.js');
const common = require('./../../common.js');
const server = require('./../../server');
const request = {

	method: 'GET',

	url: `${common.getVersionApi()}/users/1`

};

test('should return Unauthorized status if header is not present', (t) => {

	server
		.inject(request, (response) => {

			t.equal(response.statusCode, 401, 'HTTP request must be 401(Unauthorized)');

			t.end();

		});

});

test('should return an error if user model fails', (t) => {

	request.credentials = { id: 3, username: 'admin@god.com', role: 'ADMIN' };

	const findById = sinon.stub(User, 'findById', () => {

		return new Promise( (resolve, reject) => {

			reject(new Error('Cannot load user'));

		});

	});

	server
		.inject(request, (response) => {

			t.equal(response.statusCode, 500, 'HTTP request must be 500(Internal Server Error)');

			findById.restore();

			t.end();

		});

});

test('should return user information according the identifier parameter', (t) => {

	const mockUser = {

		id: 1,

		name: 'Eduardo'

	};

	request.credentials =  { username: 'admin', password: 'ok_pass', role:'ADMIN' };

	const findById = sinon.stub(User, 'findById', () => {

		return new Promise( (resolve) => {

			resolve(mockUser);

		});

	});

	server
		.inject(request, (response) => {

			t.plan(3);

			t.equal(response.result.id, mockUser.id, 'result must contain user identifier');

			t.equal(response.result.name, mockUser.name, 'result must contain user name');

			t.equal(response.statusCode, 200, 'HTTP request must be 200(OK)');

			findById.restore();

			t.end();

		});

});

test('should return Forbidden if user does not have role admin or user', (t) => {

	request.credentials =  { id: 5, username: 'spy@mail.com', role: 'USER' };

	server
		.inject(request, (response) => {

			t.equal(response.statusCode, 403, 'HTTP request must be 403(Forbidden)');

			t.end();

		});

});

test('should return Forbidden if user does not any role', (t) => {

	request.credentials = { id: 2, username: 'bad@guy.com' };

	server
		.inject(request, (response) => {

			t.equal(response.statusCode, 403, 'HTTP request must be 403(Forbidden)');

			t.end();

		});

});


text:
package org.elasticsearch.xpack.core.security.action.role;

import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.support.WriteRequest;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;

import java.io.IOException;

import static org.elasticsearch.action.ValidateActions.addValidationError;

/**
 * A request delete a role from the security index
 */
public class DeleteRoleRequest extends ActionRequest implements WriteRequest<DeleteRoleRequest> {

    private String name;
    private RefreshPolicy refreshPolicy = RefreshPolicy.IMMEDIATE;

    public DeleteRoleRequest(StreamInput in) throws IOException {
        super(in);
        name = in.readString();
        refreshPolicy = RefreshPolicy.readFrom(in);
    }

    public DeleteRoleRequest() {}

    @Override
    public DeleteRoleRequest setRefreshPolicy(RefreshPolicy refreshPolicy) {
        this.refreshPolicy = refreshPolicy;
        return this;
    }

    @Override
    public RefreshPolicy getRefreshPolicy() {
        return refreshPolicy;
    }

    @Override
    public ActionRequestValidationException validate() {
        ActionRequestValidationException validationException = null;
        if (name == null) {
            validationException = addValidationError("role name is missing", validationException);
        }
        return validationException;
    }

    public void name(String name) {
        this.name = name;
    }

    public String name() {
        return name;
    }

    @Override
    public void writeTo(StreamOutput out) throws IOException {
        super.writeTo(out);
        out.writeString(name);
        refreshPolicy.writeTo(out);
    }
}


text:
class ScopeTimer {
public:
  ScopeTimer(string name, bool isVerbose = true);
  ~ScopeTimer();

  int64 getElapsedMilliseconds() const;

private:
  chrono::high_resolution_clock::time_point m_t0;
  string m_sName;
  bool m_bIsVerbose;
};


text:
#include <aws/ecs/model/TransportProtocol.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

using namespace Aws::Utils;

namespace Aws
{
  namespace ECS
  {
    namespace Model
    {
      namespace TransportProtocolMapper
      {

        static const int tcp_HASH = HashingUtils::HashString("tcp");
        static const int udp_HASH = HashingUtils::HashString("udp");

        TransportProtocol GetTransportProtocolForName(const Aws::String& name)
        {
          int hashCode = HashingUtils::HashString(name.c_str());
          if (hashCode == tcp_HASH)
          {
            return TransportProtocol::tcp;
          }
          else if (hashCode == udp_HASH)
          {
            return TransportProtocol::udp;
          }
          EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
          if(overflowContainer)
          {
            overflowContainer->StoreOverflow(hashCode, name);
            return static_cast<TransportProtocol>(hashCode);
          }

          return TransportProtocol::NOT_SET;
        }

        Aws::String GetNameForTransportProtocol(TransportProtocol enumValue)
        {
          switch(enumValue)
          {
          case TransportProtocol::tcp:
            return "tcp";
          case TransportProtocol::udp:
            return "udp";
          default:
            EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
            if(overflowContainer)
            {
              return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
            }

            return "";
          }
        }

      } // namespace TransportProtocolMapper
    } // namespace Model
  } // namespace ECS
} // namespace Aws


text:
package org.wso2.andes.management.ui.actions;

import java.io.InputStream;
import java.util.Properties;

import org.wso2.andes.management.ui.Constants;
import org.wso2.andes.management.ui.jmx.MBeanUtility;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.ui.IWorkbenchWindow;

public class VersionAction extends Action
{
    private IWorkbenchWindow _window;
    public static final String VERSION_RESOURCE = "qpidversion.properties";

    public static final String PRODUCT_NAME_PROPERTY = "qpid.name";
    public static final String RELEASE_VERSION_PROPERTY = "qpid.version";
    public static final String BUILD_VERSION_PROPERTY = "qpid.svnversion";

    private static final String DEFAULT = "unknown";
    private static String _releaseVersion;
    private static String _buildVersion;
    private static String _text;

    static
    {
        Properties props = new Properties();
        try
        {
            InputStream propertyStream = VersionAction.class.getClassLoader().getResourceAsStream(VERSION_RESOURCE);
            if (propertyStream != null)
            {
                props.load(propertyStream);
                _releaseVersion = readPropertyValue(props, RELEASE_VERSION_PROPERTY);
                _buildVersion = readPropertyValue(props, BUILD_VERSION_PROPERTY);
                _text = "Build Version : " + _buildVersion + "\n" +
                        "Release Version : " + _releaseVersion;
            }
            else
            {
                _text = "Build Version :  \n" +
                        "Release Version :  ";
            }
        }
        catch (Exception ex)
        {
            MBeanUtility.printStackTrace(ex);
        }
    }

    public VersionAction(IWorkbenchWindow window)
    {
        _window = window;
        setText("About " + Constants.APPLICATION_NAME);
        setId("qpidmc.about");
        setActionDefinitionId("qpidmc.about");
    }

    private static String readPropertyValue(Properties props, String propertyName)
    {
        String retVal = (String) props.get(propertyName);
        if (retVal == null)
        {
            retVal = DEFAULT;
        }
        return retVal;
    }

    public void run()
    {
        MessageDialog.openInformation(_window.getShell(), Constants.APPLICATION_NAME, _text);
    }
}


text:
sap.ui.define(["exports", "sap/ui/webc/common/thirdparty/base/types/Integer", "sap/ui/webc/common/thirdparty/icons/fob-watch", "./TimePickerBase", "./generated/i18n/i18n-defaults"], function (_exports, _Integer, _fobWatch, _TimePickerBase, _i18nDefaults) {
  "use strict";

  Object.defineProperty(_exports, "__esModule", {
    value: true
  });
  _exports.default = void 0;
  _Integer = _interopRequireDefault(_Integer);
  _TimePickerBase = _interopRequireDefault(_TimePickerBase);

  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

  /**
   * @private
   */
  const metadata = {
    tag: "ui5-duration-picker",
    properties:
    /** @lends sap.ui.webcomponents.main.DurationPicker.prototype */
    {
      /**
       * Defines a formatted time value.
       *
       * @type {string}
       * @defaultvalue "00:00:00"
       * @public
       */
      value: {
        type: String,
        defaultValue: "00:00:00"
      },

      /**
       * Defines the selection step for the minutes
       * @type {Integer}
       * @public
       * @defaultValue 1
       * @since 1.0.0-rc.8
       */
      minutesStep: {
        type: _Integer.default,
        defaultValue: 1
      },

      /**
       * Defines the selection step for the seconds
       * @type {Integer}
       * @public
       * @defaultValue 1
       * @since 1.0.0-rc.8
       */
      secondsStep: {
        type: _Integer.default,
        defaultValue: 1
      },

      /**
       * Defines a formatted maximal time that the user will be able to adjust.
       *
       * @type {string}
       * @defaultvalue "23:59:59"
       * @public
       */
      maxValue: {
        type: String,
        defaultValue: "23:59:59"
      },

      /**
       * Defines whether a slider for seconds will be available. By default there are sliders for hours, minutes and seconds.
       * @type {boolean}
       * @defaultvalue false
       * @public
       */
      hideSeconds: {
        type: Boolean
      },

      /**
       * Defines whether the slider for minutes will be available. By default there are sliders for hours, minutes and seconds.
       * @type {boolean}
       * @defaultvalue false
       * @public
       * @since 1.0.0-rc.8
       */
      hideMinutes: {
        type: Boolean
      },

      /**
       * Defines whether the slider for hours will be available. By default there are sliders for hours, minutes and seconds.
       * @type {boolean}
       * @defaultvalue false
       * @public
       * @since 1.0.0-rc.8
       */
      hideHours: {
        type: Boolean
      }
    }
  };

  const getNearestValue = (x, step, max) => {
    const down = Math.floor(x / step) * step; // closest value rounded down to the step

    const up = Math.ceil(x / step) * step; // closest value rounded up to the step

    if (up > max || x - down < up - x) {
      // if the rounded-up value is more than max, or x is closer to the rounded-down value, return down
      return down;
    }

    return up; // x is closer to the rounded-up value and it is not
  };

  const pad = number => {
    number = parseInt(number);
    return number < 9 ? `0${number}` : `${number}`;
  };
  /**
   * @class
   *
   *
Overview

   * The ui5-duration-picker component provides an input field with assigned sliders which are opened on user action.
   * The ui5-duration-picker allows users to select a time duration.
   * It consists of two parts: the time input field and the sliders.
   *
   *
   *
Usage

   *
   *
   * The Duration Picker is used for input of time. Users are able to select hours, minutes and seconds.
   * The user can enter a time by:
   *

   *
Using the sliders that opens in a popup

   *
Typing it in directly in the input field

   *

   *

   * When the user makes an entry and chooses the enter key, the sliders shows the corresponding time.
   * When the user directly triggers the sliders display, the actual time is displayed.
   *
   * For the ui5-duration-picker
   *
   *
Keyboard handling

   * [F4], [ALT]+[UP], [ALT]+[DOWN] Open/Close picker dialog and move focus to it.
   *

   * When closed:
   *

   *
[PAGEUP] - Increments hours by 1. If max value is reached, the slider doesn't increment.

   *
[PAGEDOWN] - Decrements the corresponding field by 1. If min value is reached, the slider doesn't increment.

   *
[SHIFT]+[PAGEUP] Increments minutes by 1.

   *
[SHIFT]+ [PAGEDOWN] Decrements minutes by 1.

   *
[SHIFT]+[CTRL]+[PAGEUP] Increments seconds by 1.

   *
[SHIFT]+[CTRL]+ [PAGEDOWN] Decrements seconds by 1.

   *

   * When opened:
   *

   *
[UP] If focus is on one of the selection lists: Select the value which is above the current value. If the first value is selected, select the last value in the list.

   *
[DOWN] If focus is on one of the selection lists: Select the value which is below the current value. If the last value is selected, select the first value in the list.

   *
[LEFT] If focus is on one of the selection lists: Move focus to the selection list which is left of the current selection list. If focus is at the first selection list, move focus to the last selection list.

   *
[RIGHT] If focus is on one of the selection lists: Move focus to the selection list which is right of the current selection list. When focus is at the last selection list, move focus to the first selection list.

   *
[PAGEUP] If focus is on one of the selection lists: Move focus to the first entry of this list.

   *
[PAGEDOWN] If focus is on one of the selection lists: Move focus to the last entry of this list.

   *

   *
   *
ES6 Module Import

   *
   * import "@ui5/webcomponents/dist/DurationPicker.js";
   *
   * @constructor
   * @since 1.0.0-rc.7
   * @author SAP SE
   * @alias sap.ui.webcomponents.main.DurationPicker
   * @extends TimePickerBase
   * @tagname ui5-duration-picker
   * @private
   */

  class DurationPicker extends _TimePickerBase.default {
    static get metadata() {
      return metadata;
    }
    /**
     * In order to keep the existing behavior (although not consistent with the other picker components), we enforce limits and step on each change and initially
     */

    onBeforeRendering() {
      const value = this.value;

      if (this.isValid(value)) {
        this.value = this.normalizeValue(value);
      }
    }
    /**
     * In order to keep the existing behavior (although not consistent with the other picker components), we do not update "value" on input, only fire event
     * @override
     */

    async _handleInputLiveChange(event) {
      const value = event.target.value;
      const valid = this.isValid(value);

      this._updateValueState(); // Change the value state to Error/None, but only if needed

      this.fireEvent("input", {
        value,
        valid
      });
    }

    get _formatPattern() {
      return "HH:mm:ss";
    }
    /**
     * The "value" property might be "02:03" (HH:ss) or just "12"(ss) but the ui5-time-selection component requires a value compliant with _formatPattern
     * We split the value and shift up to 3 times, filling the values for the configured units (based on hideHours, hideMinutes, hideSeconds)
     * @override
     */

    get _effectiveValue() {
      return this.isValid(this.value) ? this._toFullFormat(this.value) : "00:00:00";
    }

    get _timeSelectionValue() {
      return this._effectiveValue;
    }
    /**
     * @override
     */

    get openIconName() {
      return "fob-watch";
    }
    /**
     * Transforms the value to HH:mm:ss format to be compatible with time manipulation logic (keyboard handling, time selection component)
     * @private
     */

    _toFullFormat(value) {
      let hours = "00",
          minutes = "00",
          seconds = "00";
      const parts = value.split(":");

      if (parts.length && !this.hideHours) {
        hours = parts.shift();
      }

      if (parts.length && !this.hideMinutes) {
        minutes = parts.shift();
      }

      if (parts.length && !this.hideSeconds) {
        seconds = parts.shift();
      }

      return `${hours}:${minutes}:${seconds}`;
    }
    /**
     * Transforms the value from HH:mm:ss format to the needed partial format (f.e. HH:ss or mm or ss) to be displayed in the input
     * @private
     */

    _toPartialFormat(value) {
      const parts = value.split(":");
      const newParts = [];

      if (!this.hideHours) {
        newParts.push(parts[0]);
      }

      if (!this.hideMinutes) {
        newParts.push(parts[1]);
      }

      if (!this.hideSeconds) {
        newParts.push(parts[2]);
      }

      return newParts.join(":");
    }

    _enforceLimitsAndStep(fullFormatValue) {
      let [hours, minutes, seconds] = fullFormatValue.split(":");
      hours = Math.min(hours, this.maxHours);
      minutes = Math.min(minutes, this.maxMinutes);
      seconds = Math.min(seconds, this.maxSeconds);
      minutes = getNearestValue(minutes, this.minutesStep, this.maxMinutes);
      seconds = getNearestValue(seconds, this.secondsStep, this.maxSeconds);
      return `${pad(hours)}:${pad(minutes)}:${pad(seconds)}`;
    }
    /**
     * @override
     */

    normalizeValue(value) {
      let fullFormatValue = this._toFullFormat(value); // transform to full format (HH:mm:ss) if not already in this format, in order to normalize the value

      fullFormatValue = this._enforceLimitsAndStep(fullFormatValue);
      return this._toPartialFormat(fullFormatValue); // finally transform back to the needed format for the input
    }

    get maxHours() {
      return parseInt(this.maxValue.split(":")[0]);
    }

    get maxMinutes() {
      return parseInt(this.maxValue.split(":")[1]);
    }

    get maxSeconds() {
      return parseInt(this.maxValue.split(":")[2]);
    }

    get dateAriaDescription() {
      return DurationPicker.i18nBundle.getText(_i18nDefaults.DURATION_INPUT_DESCRIPTION);
    }

    get accInfo() {
      return {
        "ariaRoledescription": this.dateAriaDescription,
        "ariaHasPopup": "dialog",
        "ariaAutoComplete": "none",
        "role": "combobox",
        "ariaControls": `${this._id}-responsive-popover`,
        "ariaExpanded": this.isOpen()
      };
    }

  }

  DurationPicker.define();
  var _default = DurationPicker;
  _exports.default = _default;
});


text:
// Copyright (c) MOSA Project. Licensed under the New BSD License.

namespace Mosa.Test.Collection
{
	public static class CharTests
	{
		public static int AddCC(char first, char second)
		{
			return (first + second);
		}

		public static int SubCC(char first, char second)
		{
			return (first - second);
		}

		public static int MulCC(char first, char second)
		{
			return (first * second);
		}

		public static int DivCC(char first, char second)
		{
			return (first / second);
		}

		public static int RemCC(char first, char second)
		{
			return (first % second);
		}

		public static char RetC(char first)
		{
			return first;
		}

		public static int AndCC(char first, char second)
		{
			return (first & second);
		}

		public static int OrCC(char first, char second)
		{
			return (first | second);
		}

		public static int XorCC(char first, char second)
		{
			return (first ^ second);
		}

		public static int CompC(char first)
		{
			return (~first);
		}

		public static int ShiftLeftCC(char first, byte second)
		{
			return (first << second);
		}

		public static int ShiftRightCC(char first, byte second)
		{
			return (first >> second);
		}

		public static bool CeqCC(char first, char second)
		{
			return (first == second);
		}

		public static bool CltCC(char first, char second)
		{
			return (first < second);
		}

		public static bool CgtCC(char first, char second)
		{
			return (first > second);
		}

		public static bool CleCC(char first, char second)
		{
			return (first <= second);
		}

		public static bool CgeCC(char first, char second)
		{
			return (first >= second);
		}

		public static bool Newarr()
		{
			char[] arr = new char[0];
			return arr != null;
		}

		public static bool Ldlen(int length)
		{
			char[] arr = new char[length];
			return arr.Length == length;
		}

		public static bool Ldelem(int index, char value)
		{
			char[] arr = new char[index + 1];
			arr[index] = value;
			return value == arr[index];
		}

		public static bool Stelem(int index, char value)
		{
			char[] arr = new char[index + 1];
			arr[index] = value;
			return true;
		}

		public static bool Ldelema(int index, char value)
		{
			char[] arr = new char[index + 1];
			SetValueInRefValue(ref arr[index], value);
			return arr[index] == value;
		}

		private static void SetValueInRefValue(ref char destination, char value)
		{
			destination = value;
		}
	}
}


text:
package io.buoyant.linkerd
package protocol

import com.fasterxml.jackson.annotation.JsonIgnore
import com.twitter.finagle.Path
import io.buoyant.config.Parser
import io.buoyant.router.{Mux, RoutingFactory}

class MuxInitializer extends ProtocolInitializer.Simple {
  val name = "mux"

  protected type Req = com.twitter.finagle.mux.Request
  protected type Rsp = com.twitter.finagle.mux.Response

  protected val defaultRouter = Mux.router

  protected val defaultServer = Mux.server

  override def defaultServerPort: Int = 4141

  val configClass = classOf[MuxConfig]
}

object MuxInitializer extends MuxInitializer

class MuxConfig extends RouterConfig {

  var servers: Seq[ServerConfig] = Nil
  var client: Option[ClientConfig] = None

  @JsonIgnore
  override def protocol = MuxInitializer
}


text:
package passwordless

import (
	"io/ioutil"
	"mime/multipart"
	"net/mail"
	"regexp"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
)

func TestEmail(t *testing.T) {
	d := time.Date(2001, 2, 3, 4, 5, 6, 0, time.UTC)
	e := Email{
		To:      "bender@ilovebender.com",
		Subject: "Mom Calling",
		Date:    d,
	}

	// Empty body
	m, err := mail.ReadMessage(e.Buffer())
	assert.NoError(t, err)
	assert.Equal(t, "bender@ilovebender.com", m.Header.Get("To"))
	assert.Equal(t, "Mom Calling", m.Header.Get("Subject"))
	assert.Equal(t, d.Format(time.RFC822), m.Header.Get("Date"))

	// Plain body
	e.AddBody("", "Hello dear")
	m, err = mail.ReadMessage(e.Buffer())
	assert.NoError(t, err)
	assert.Equal(t, "text/plain; charset=\"UTF-8\";", m.Header.Get("Content-Type"))
	body, err := ioutil.ReadAll(m.Body)
	assert.NoError(t, err)
	assert.Equal(t, "Hello dear\r\n", string(body))

	// Additional HTML body (multipart)
	e.AddBody("text/html", "Hello dear")
	m, err = mail.ReadMessage(e.Buffer())
	assert.Equal(t, "1.0", m.Header.Get("MIME-Version"))
	ct := m.Header.Get("Content-Type")
	re := regexp.MustCompile("^multipart/alternative; boundary=([a-z0-9]+)$")
	assert.Regexp(t, re, ct)
	boundary := re.FindStringSubmatch(ct)[1]
	assert.NotEmpty(t, boundary)

	mpr := multipart.NewReader(m.Body, boundary)

	// Read first part
	p, err := mpr.NextPart()
	assert.NoError(t, err, "reading first part")
	assert.Equal(t, "text/plain; charset=\"UTF-8\";", p.Header.Get("Content-Type"))
	body, err = ioutil.ReadAll(p)
	assert.NoError(t, err, "reading body of first part")
	assert.Equal(t, "Hello dear", string(body))

	// Read second part
	p, err = mpr.NextPart()
	assert.NoError(t, err, "reading second part")
	assert.Equal(t, "text/html; charset=\"UTF-8\";", p.Header.Get("Content-Type"))
	body, err = ioutil.ReadAll(p)
	assert.NoError(t, err, "reading body of second part")
	assert.Equal(t, "Hello dear", string(body))

	// Read (non-existent) next part
	p, err = mpr.NextPart()
	assert.Nil(t, p)
}