text:
import collections
import inspect
import json
import os
import sys
import time
import threading
import traceback

DEBUG = 3

def format_seconds(i):
  h, r = divmod(i, 3600)
  m, s = divmod(r, 60)
  return "%sh%sm%ss" % (h, m, s)

def xttrs(type, *args, **kwargs):
  """
  Wrap an instance of a mapping type such that keys may be accessed as
  attributes. The mapping super-type may be specified, defaulting to dict.
  """
  type = type and type or dict
  class _(type):
    __setattr__ = type.__setitem__
    __delattr__ = type.__delitem__
    def __init__(self):
      super().__init__(*args, **kwargs)
    def __getattr__(self, name):
      if name not in self:
        raise AttributeError("No such attribute: %s" % name)
      return self.__getitem__(name)
  return _()

def attrs(*args, **kwargs):
  return xttrs(dict, *args, **kwargs)

def ottrs(*args, **kwargs):
  return xttrs(collections.OrderedDict, *args, **kwargs)

fds = attrs(
  out=sys.stdout,
  err=sys.stderr,
)

def out(*args):
  print(*args, file=fds.out)

def err(*args):
  print(*args, file=fds.err)

def warn(*args):
  DEBUG > 0 and print("WARN", *args, file=fds.err)

def dbg(*args):
  DEBUG > 1 and print("DBG", *args, file=fds.err)

def spam(*args):
  DEBUG > 2 and print("SPAM", *args, file=fds.err)

def dispatch(handlers, *args, **kwargs):
  errors = []
  for fn in handlers:
    try:
      fn(*args, **kwargs)
      errors.append(None)
    except:
      errors.append(sys.exc_info())
      dbg(traceback.format_exc())
      dbg("%s%sUnhandled exception in event dispatch" % (
        os.linesep, traceback.format_exc()
      ))
  return errors

def loads(s, *a, **kw):
  if hasattr(s, "decode"):
    s = s.decode("utf-8")
  return json.loads(s, *a, object_pairs_hook=ottrs, **kw)

dumps = json.dumps

def make_exc_info(ex):
  if isinstance(ex, SystemExit):
    raise ex
  try:
    raise ex
  except:
    return sys.exc_info()

def spin(timeout, interval, test):
  if interval < 0:
    raise ValueError("'interval' must be >= 0")
  if timeout > 0 and interval > 0:
    interval = min(timeout, interval)
  remaining = timeout > 0 and timeout or 1
  while remaining > 0:
    start = time.time()
    if test and test():
      return True
    if timeout == 0:
      return False
    test_time = time.time() - start
    sleep_time = interval - test_time
    if sleep_time < 0:
      sleep_time = 0
    if timeout < 0:
      time.sleep(sleep_time)
    else:
      start = time.time()
      remaining -= test_time
      if remaining > 0:
        time.sleep(min(sleep_time, remaining))
        remaining -= time.time() - start

def trace(enabled=True, filt=True, indent=True, ignore_self=True):
  def f_module(frame):
    return (
      "__name__" in frame.f_globals and
      "%s." % frame.f_globals["__name__"] or
      ""
    )
  def f_class(frame):
    args, _, _, values = inspect.getargvalues(frame)
    if args and values and "self" in values:
      obj = values["self"]
      return (
        hasattr(obj, "__class__") and
        hasattr(obj.__class__, "__name__") and
        "%s." % obj.__class__.__name__ or
        ""
      )
    return ""
  def f_qualname(frame):
    fn = frame.f_code.co_name
    g = frame.f_globals
    if fn in g:
      fn_obj = g[fn]
      if hasattr(fn_obj, "__qualname__"):
        fn = fn_obj.__qualname__
    return fn
  def filter(module): # FIXME DX
    return (
      filt and not (
        not module or
        module.startswith("ruco") or
        module.endswith("ruco") or
        module.startswith("__")
      ))
  def t(frame, event, arg):
    try:
      label = {"call": "CALL", "return": "EXIT"}.get(event)
      if label is None:
        return
      if ignore_self and frame.f_code in (trace.__code__, t.__code__):
        return
      module = f_module(frame)
      if filter(module):
        return
      sys.stderr.write(
        "%s %s %s %s%s%s%s" % (
          threading.currentThread().name,
          indent and "." * len(inspect.stack()) or "",
          label,
          module,
          f_class(frame),
          f_qualname(frame),
          os.linesep
        ))
    except:
      pass
  if enabled:
    sys.setprofile(None)
    sys.setprofile(t)
  else:
    sys.setprofile(None)


text:
package org.apache.camel.commands;

import java.io.PrintStream;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;

/**
 * From the Camel catalog lists all the languages.
 */
public class CatalogLanguageListCommand extends AbstractCamelCommand {

    private static final String NAME_COLUMN_LABEL = "Name";
    private static final String LABEL_COLUMN_LABEL = "Label";
    private static final String MAVEN_COLUMN_LABEL = "Maven Coordinate";
    private static final String DESCRIPTION_COLUMN_LABEL = "Description";

    private static final int DEFAULT_COLUMN_WIDTH_INCREMENT = 0;
    private static final String DEFAULT_FIELD_PREAMBLE = " ";
    private static final String DEFAULT_FIELD_POSTAMBLE = " ";
    private static final String DEFAULT_HEADER_PREAMBLE = " ";
    private static final String DEFAULT_HEADER_POSTAMBLE = " ";
    private static final int DEFAULT_FORMAT_BUFFER_LENGTH = 24;
    // descriptions can be very long so clip by default after 120 chars
    private static final int MAX_COLUMN_WIDTH = 120;
    private static final int MIN_COLUMN_WIDTH = 12;

    private boolean verbose;
    private String label;

    public CatalogLanguageListCommand(boolean verbose, String label) {
        this.verbose = verbose;
        this.label = label;
    }

    @Override
    public Object execute(CamelController camelController, PrintStream out, PrintStream err) throws Exception {
        List<Map<String, String>> languages = camelController.listLanguagesCatalog(label);

        if (languages == null || languages.isEmpty()) {
            return null;
        }

        final Map<String, Integer> columnWidths = computeColumnWidths(languages);
        final String headerFormat = buildFormatString(columnWidths, true);
        final String rowFormat = buildFormatString(columnWidths, false);

        if (verbose) {
            out.println(String.format(headerFormat, NAME_COLUMN_LABEL, LABEL_COLUMN_LABEL, MAVEN_COLUMN_LABEL, DESCRIPTION_COLUMN_LABEL));
            out.println(String.format(headerFormat, "----", "-----", "----------------", "-----------"));
        } else {
            out.println(String.format(headerFormat, NAME_COLUMN_LABEL, LABEL_COLUMN_LABEL, MAVEN_COLUMN_LABEL));
            out.println(String.format(headerFormat, "----", "-----", "----------------"));
        }
        for (final Map<String, String> language : languages) {
            if (verbose) {
                String name = safeNull(language.get("name"));
                String label = safeNull(language.get("label"));
                String maven = "";
                if (language.containsKey("groupId") && language.containsKey("artifactId") && language.containsKey("version")) {
                    maven = language.get("groupId") + "/" + language.get("artifactId") + "/" + language.get("version");
                }
                String description = safeNull(language.get("description"));
                out.println(String.format(rowFormat, name, label, maven, description));
            } else {
                String name = safeNull(language.get("name"));
                String label = safeNull(language.get("label"));
                String maven = "";
                if (language.containsKey("groupId") && language.containsKey("artifactId") && language.containsKey("version")) {
                    maven = language.get("groupId") + "/" + language.get("artifactId") + "/" + language.get("version");
                }
                out.println(String.format(rowFormat, name, label, maven));
            }
        }

        return null;
    }

    private Map<String, Integer> computeColumnWidths(final Iterable<Map<String, String>> languages) throws Exception {
        if (languages == null) {
            return null;
        } else {
            // some of the options is optional so we need to start from 1
            int maxNameLen = NAME_COLUMN_LABEL.length();
            int maxLabelLen = LABEL_COLUMN_LABEL.length();
            int maxMavenLen = MAVEN_COLUMN_LABEL.length();
            int maxDescriptionLen = DESCRIPTION_COLUMN_LABEL.length();

            for (final Map<String, String> dataFormat : languages) {

                // grab the information and compute max len
                String name = dataFormat.get("name");
                if (name != null) {
                    maxNameLen = Math.max(maxNameLen, name.length());
                }
                String label = dataFormat.get("label");
                if (label != null) {
                    maxLabelLen = Math.max(maxLabelLen, label.length());
                }
                if (dataFormat.containsKey("groupId") && dataFormat.containsKey("artifactId") && dataFormat.containsKey("version")) {
                    String mvn = dataFormat.get("groupId") + "/" + dataFormat.get("artifactId") + "/" + dataFormat.get("version");
                    maxMavenLen = Math.max(maxMavenLen, mvn.length());
                }
                String description = dataFormat.get("description");
                if (description != null) {
                    maxDescriptionLen = Math.max(maxDescriptionLen, description.length());
                }
            }

            final Map<String, Integer> retval = new Hashtable<String, Integer>(4);
            retval.put(NAME_COLUMN_LABEL, maxNameLen);
            retval.put(LABEL_COLUMN_LABEL, maxLabelLen);
            retval.put(MAVEN_COLUMN_LABEL, maxMavenLen);
            retval.put(DESCRIPTION_COLUMN_LABEL, maxDescriptionLen);

            return retval;
        }
    }

    private String buildFormatString(Map<String, Integer> columnWidths, boolean isHeader) {
        final String fieldPreamble;
        final String fieldPostamble;
        final int columnWidthIncrement;

        if (isHeader) {
            fieldPreamble = DEFAULT_HEADER_PREAMBLE;
            fieldPostamble = DEFAULT_HEADER_POSTAMBLE;
        } else {
            fieldPreamble = DEFAULT_FIELD_PREAMBLE;
            fieldPostamble = DEFAULT_FIELD_POSTAMBLE;
        }
        columnWidthIncrement = DEFAULT_COLUMN_WIDTH_INCREMENT;

        if (verbose) {
            int nameLen = Math.min(columnWidths.get(NAME_COLUMN_LABEL) + columnWidthIncrement, getMaxColumnWidth());
            int labelLen = Math.min(columnWidths.get(LABEL_COLUMN_LABEL) + columnWidthIncrement, getMaxColumnWidth());
            int mavenLen = Math.min(columnWidths.get(MAVEN_COLUMN_LABEL) + columnWidthIncrement, getMaxColumnWidth());
            int descriptionLen = Math.min(columnWidths.get(DESCRIPTION_COLUMN_LABEL) + columnWidthIncrement, getMaxColumnWidth());

            nameLen = Math.max(MIN_COLUMN_WIDTH, nameLen);
            labelLen = Math.max(MIN_COLUMN_WIDTH, labelLen);
            mavenLen = Math.max(MIN_COLUMN_WIDTH, mavenLen);
            descriptionLen = Math.max(MIN_COLUMN_WIDTH, descriptionLen);

            final StringBuilder retval = new StringBuilder(DEFAULT_FORMAT_BUFFER_LENGTH);
            retval.append(fieldPreamble).append("%-").append(nameLen).append('.').append(nameLen).append('s').append(fieldPostamble).append(' ');
            retval.append(fieldPreamble).append("%-").append(labelLen).append('.').append(labelLen).append('s').append(fieldPostamble).append(' ');
            retval.append(fieldPreamble).append("%-").append(mavenLen).append('.').append(mavenLen).append('s').append(fieldPostamble).append(' ');
            retval.append(fieldPreamble).append("%-").append(descriptionLen).append('.').append(descriptionLen).append('s').append(fieldPostamble).append(' ');
            return retval.toString();
        } else {
            int nameLen = Math.min(columnWidths.get(NAME_COLUMN_LABEL) + columnWidthIncrement, getMaxColumnWidth());
            int labelLen = Math.min(columnWidths.get(LABEL_COLUMN_LABEL) + columnWidthIncrement, getMaxColumnWidth());
            int mavenLen = Math.min(columnWidths.get(MAVEN_COLUMN_LABEL) + columnWidthIncrement, getMaxColumnWidth());

            nameLen = Math.max(MIN_COLUMN_WIDTH, nameLen);
            labelLen = Math.max(MIN_COLUMN_WIDTH, labelLen);
            mavenLen = Math.max(MIN_COLUMN_WIDTH, mavenLen);

            final StringBuilder retval = new StringBuilder(DEFAULT_FORMAT_BUFFER_LENGTH);
            retval.append(fieldPreamble).append("%-").append(nameLen).append('.').append(nameLen).append('s').append(fieldPostamble).append(' ');
            retval.append(fieldPreamble).append("%-").append(labelLen).append('.').append(labelLen).append('s').append(fieldPostamble).append(' ');
            retval.append(fieldPreamble).append("%-").append(mavenLen).append('.').append(mavenLen).append('s').append(fieldPostamble).append(' ');
            return retval.toString();
        }
    }

    private int getMaxColumnWidth() {
        if (verbose) {
            return Integer.MAX_VALUE;
        } else {
            return MAX_COLUMN_WIDTH;
        }
    }

}

redpajama_set_name: RedPajamaGithub


text:
var tests = [];
for (var file in window.__karma__.files) {
    if (window.__karma__.files.hasOwnProperty(file)) {
        // Removed "Spec" naming from files
        if (/Spec\.js$/.test(file)) {
            tests.push(file);
        }
    }
}

requirejs.config({
    // Karma serves files from '/base'
    baseUrl: '/base/app/scripts',

    paths: {
        angular: '../bower_components/angular/angular',
        sassbootstrap: '../bower_components/sass-bootstrap/dist/js/bootstrap',
        'sass-bootstrap': '../bower_components/sass-bootstrap/dist/js/bootstrap',
        'angular-scenario': '../bower_components/angular-scenario/angular-scenario',
        'angular-sanitize': '../bower_components/angular-sanitize/angular-sanitize',
        'angular-resource': '../bower_components/angular-resource/angular-resource',
        'angular-mocks': '../bower_components/angular-mocks/angular-mocks',
        'angular-cookies': '../bower_components/angular-cookies/angular-cookies',
        'angular-ui-router': '../bower_components/angular-ui-router/release/angular-ui-router'
    },

    shim: {
        'angular': {'exports': 'angular'},
        'angular-cookies': ['angular'],
        'angular-sanitize': ['angular'],
        'angular-resource': ['angular'],
        'angular-ui-router': ['angular'],
        'angular-mocks': {
            deps: ['angular'],
            'exports': 'angular.mock'
        }
    },

    // ask Require.js to load these files (all our tests)
    deps: tests,

    // start test run, once Require.js is done
    callback: window.__karma__.start
});


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package services;
import core.Job;
import java.io.File;
import java.io.FileWriter;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import utils.*;

/**
 *
 * @author JUASP-G73-Android
 */
public class T5PipelineService extends ServicePipeline implements Runnable {
    /******************************/
    /****  PRIVATE ATTRIBUTES *****/
    /******************************/
    private String formatedFolderPath = null;

    /***************************************/
    /***********  CONSTRUCTOR **************/
    /***************************************/
    public T5PipelineService(String ffp) {
        this.formatedFolderPath = ffp;
    }

    /***************************************/
    /*************  METHODS ****************/
    /***************************************/
    @Override
    public void run() {
        Log.log("T5 Service Thread running...");
        boolean run = true;
        String html = "";
        try {
            while(run){
                Log.log("T5 Service Thread: waiting for a new job...");
                Job currentJob = this.popJob();

                if(currentJob != null){
                    Log.log("T5 Service Thread: the file: " + currentJob.getJobName() + " is being process...");

                    //html formating
                    html = "
\n" +
                        "<!DOCTYPE html>\n" +
                        "\n" +
                        "\n" +
                        "<meta charset='UTF-8'>"+
                        "\n"+
                        "<title>"+currentJob.getJobName()+"</title>\n" +
                        "\n" +
                        "\n" +
                        "\n" +
                        "
html-format of a cpp source file
\n" +
                        currentJob.getContent() +
                        "\n" +
                        "\n" +
                        "";

                        currentJob.setContent(html);

                        File file = new File(formatedFolderPath + currentJob.getJobName().replaceAll("\\.[^/.]+$", "thread.html"));
			FileWriter fileWriter = new FileWriter(file);
			fileWriter.write(currentJob.getContent());
			fileWriter.flush();
			fileWriter.close();

                    if(currentJob.isLastJob()){
                        Log.log("T5 Service Thread: the 'NoMoreJob' flag has been detected.");
                        run = false;
                    }
                }
                else{
                    //Thread.currentThread().sleep(25); // IF EMPTY WE SLEEP FOR A WHILE... TO GIVE TIME TO THE PRODUCER
                }
            }
        } catch (Exception ex) {
                Log.log("T5 Service Thread: Exception: " + ex.getMessage());
        } finally {
            stop();
	}
    }

    private void stop(){
        Log.log("T5 Service Thread: is being stop....");
        Thread.currentThread().interrupt();
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<testng-results skipped="0" failed="0" total="3" passed="3">
  <reporter-output>
  </reporter-output>
  <suite name="Default suite" duration-ms="24656" started-at="2014-06-05T18:49:14Z" finished-at="2014-06-05T18:49:39Z">
    <groups>
    </groups>
    <test name="Default test" duration-ms="24656" started-at="2014-06-05T18:49:14Z" finished-at="2014-06-05T18:49:39Z">
      <class name="com.example.tests.GroupCreationTests">
        <test-method status="PASS" signature="setUp()[pri:0, instance:com.example.tests.GroupCreationTests@19a13d9]" name="setUp" is-config="true" duration-ms="8718" started-at="2014-06-05T22:49:14Z" finished-at="2014-06-05T22:49:23Z">
          <reporter-output>
          </reporter-output>
        </test-method> <!-- setUp -->
        <test-method status="PASS" signature="testCreateContact()[pri:0, instance:com.example.tests.GroupCreationTests@19a13d9]" name="testCreateContact" duration-ms="8187" started-at="2014-06-05T22:49:23Z" finished-at="2014-06-05T22:49:31Z">
          <reporter-output>
          </reporter-output>
        </test-method> <!-- testCreateContact -->
        <test-method status="PASS" signature="testEmptyGroupCreation()[pri:0, instance:com.example.tests.GroupCreationTests@19a13d9]" name="testEmptyGroupCreation" duration-ms="3610" started-at="2014-06-05T22:49:31Z" finished-at="2014-06-05T22:49:35Z">
          <reporter-output>
          </reporter-output>
        </test-method> <!-- testEmptyGroupCreation -->
        <test-method status="PASS" signature="testNonEmptyGroupCreation()[pri:0, instance:com.example.tests.GroupCreationTests@19a13d9]" name="testNonEmptyGroupCreation" duration-ms="3797" started-at="2014-06-05T22:49:35Z" finished-at="2014-06-05T22:49:39Z">
          <reporter-output>
          </reporter-output>
        </test-method> <!-- testNonEmptyGroupCreation -->
        <test-method status="PASS" signature="tearDown()[pri:0, instance:com.example.tests.GroupCreationTests@19a13d9]" name="tearDown" is-config="true" duration-ms="297" started-at="2014-06-05T22:49:39Z" finished-at="2014-06-05T22:49:39Z">
          <reporter-output>
          </reporter-output>
        </test-method> <!-- tearDown -->
      </class> <!-- com.example.tests.GroupCreationTests -->
    </test> <!-- Default test -->
  </suite> <!-- Default suite -->
</testng-results>


text:
package com.gs.collections.impl.parallel;

import java.util.ArrayList;
import java.util.Collection;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.atomic.AtomicInteger;

import com.gs.collections.impl.list.Interval;
import org.junit.Assert;
import org.junit.Test;

/**
 * JUnit test for {@link ParallelIterate}.
 */
public class ParallelIterate2Test
{
    /**
     * crude test to check that creation works and that all tasks are executed
     */
    @Test
    public void creationAndExecution() throws InterruptedException
    {
        int howManyTimes = 200;
        final AtomicInteger counter = new AtomicInteger(0);

        final Callable<Integer> task = new Callable<Integer>()
        {
            public Integer call()
            {
                return counter.getAndIncrement();
            }
        };

        final Collection<Callable<Integer>> tasks = new ArrayList<Callable<Integer>>();

        Interval.oneTo(howManyTimes).run(new Runnable()
        {
            public void run()
            {
                tasks.add(task);
            }
        });

        ExecutorService executorService1 = ParallelIterate.newPooledExecutor(4, "test pool 2 4", true);
        executorService1.invokeAll(tasks);
        Assert.assertEquals(howManyTimes, counter.get());

        counter.set(0);
        ExecutorService executorService2 = ParallelIterate.newPooledExecutor(2, "test pool 2", true);
        executorService2.invokeAll(tasks);
        Assert.assertEquals(howManyTimes, counter.get());
    }
}


text:
<!doctype html>

<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Language" content="en-us">

<meta name="description" content="Many people who contact the Minnesota Office of the Attorney General are seeking some type of legal opinion. However, the Attorney General is authorized by statute to issue written legal opinions only to constitutional executive officers, state agencies, bodies of the state legislature, and attorneys for local governments or pension funds. ">
<meta name="keywords" content="Attorney General, Minnesota, Lori Swanson, ">

<title>Attorney General Opinions - By Date | The Office of Attorney General Lori Swanson</title>

<link href="../../_CSS/boilerplate.css" rel="stylesheet" type="text/css">
<link href="../../_CSS/grid.css" rel="stylesheet" type="text/css">
<link href="../../_CSS/mainStyle.css" rel="stylesheet" type="text/css">
<link href="../../_CSS/mobileStyle.css" rel="stylesheet" type="text/css">

Skip Navigation

File a Complaint
Order Publications
Contact Us

<gcse:search tabindex="4" linkTarget="_self"></gcse:search>

Home

How Can We Help?

File a Complaint

Contact Us

Order Publications

Topics

Senior Citizens

Unwanted Calls

Money & Credit

Housing & Mortgage

Scams

Charities

Automobiles

Identity Theft & Computers

Health Care

Courts & the Law

Government Resources

Students

Veterans & Service Members

Utilities

Telephones

Public Protection

Child Support & Custody

Businesses & Organizations

Miscellaneous Information

Charities

Charities Information for the Public

Search for Charities

Search for Professional Fundraisers

File a Complaint about a Charity or Nonprofit

Information for Nonprofits

Registration and Reporting - Charities and Charitable Trusts

Registration and Reporting - Professional Fundraisers

Forms and Instructions for Registration and Reporting

Pay Fees Electronically

Request an Extension of a Filing Deadline

Publications and Other Resources

Club Contracts

About Our Office

Biography of Lori Swanson

Attorney General Opinions

Career Opportunities

Information for Opposing Counsel

Privacy Policy

Contact Us

          <button id="control" class="accordion-control">Menu</button>

        			Home
        			How Can We Help?
 					Topics
                	Charities
					About Our Office
                    File a Complaint
                   	Order Publications
                   	Contact Us
                    Search Our Site

Attorney General Opinions - by Date

        	 Opinions Home Page
        	 Opinions by Date
             Opinions by Subject
          	Opinions by Entity Requesting Opinion

Attorney General Opinions - by Date

October 17, 2014 — Op. Atty. Gen 16-b

AUCTIONEERS: LICENSES: COUNTIES: Time-limited online auction sales are not subject to auctioneer-licensing requirements.  Minn. Stat. § §  330.01-330.13 (2012).

April 22, 2014 — Op. Atty. Gen 280l-1 (Cr. Ref. 86a-16)

LEGISLATIVE: MEMBERS: Privilege from arrest during session does not apply to criminal
conduct. Minn. Const. art. IV, § 10.

April 18, 2013 — Op. Atty. Gen 425c-11

TAX SALES: FORFEITED LAND: PURCHASE BY MUNICIPALITY:  Conveyance of tax-forfeited land by the State of Minnesota to a Township for public park purposes does not supersede a prior Declaration on the property restricting the use of the property to private, residential purposes and therefore, use of the property as a public park is prohibited.  Minn. Stat. § 282.01, subd. 6 (2012).

June 15, 2007 — Op. Atty. Gen 185b (Cr. Ref. 159a-3)

SCHOOL ELECTIONS: PETITIONS: Petition Rules promulgated by the Secretary of State
generally apply to petition for school district referendum. School district clerks should perform the functions of “filing officer under those rules:” Minn Stat. §§ 204B.071, 205A.05, subd. 1, 205A.13 (2006); Minn. R. ch. 8205

October 6, 2006 — Op. Atty. Gen 852 (Cr. Ref. 64, 184a)

GOVERNMENT DATA: CANDIDATES FOR PUBLIC OFFICE: Criminal history data
collected by city on council candidates is not private “applicant” data under
Minn. Stat. § 13.43 (2004). Authority of city to collect such data questioned,
Minn. Stat. §§ 13.03, 13.43, 13.601.

July 14, 2006 — Op. Atty. Gen 852

GOVERNMENT DATA: Where members of governing body are considered employees of
governmental unit, personal information submitted by applicants for appointment
to fill vacancies on the body is private personnel data except for items
designated as public by Minn. Stat. § 13.43, subd. 3 and 13.601, subd. 3.

 April 13, 2004 —  Op. Atty. Gen. 852 (Cr. Ref. 817, 851)

GOVERNMENT DATA:  PROPERTY APPRAISALS:  Data Practices classification of property
appraisals done for purposes of acquisition discussed.  Minn. Stat. §§ 13.44,
117.036 (Supp. 2003).

August 12, 2003 — Op. Atty. Gen. 125a-66

COUNTIES: PLANNING AND ZONING: SUBDIVISION REGULATIONS: FEES: County may not prevent recording of all land conveyance documents that do
not comply with county land use controls and fee requirements. Minn. Stat. §§ 272.12, 272.121, 394.37.

May 13, 2002 —  Op. Atty. Gen. 63b-14 (Cr. Ref. 61c)

CITIES: COUNCIL: ORDINANCES: Computation of two-thirds majority when mayor may only vote in case of a tie.  Minn. Stat. §§ 462.355, subd. 3 (2000), 462.357, subd. 2 (2001 Supp.)

May 8, 2002 — Op. Atty. Gen. 1001k

HOSPITAL DISTRICTS: CONTRACTS: Hospital Districts created
under Minn. Stat. §§ 447.31, et. seq., are subject to the bidding
requirements of Minn. Stat. § 471.345 (2000). Op. Atty. Gen. 1001k, April 18, 1962 superseded.

March 29, 2002 — Op. Atty. Gen. 174 (Cr.
Ref. 159b-12, 161b-14)

TEACHERS: COMPENSATION: SCHOOL:Districts not authorized to pay for teachers’ insurance and retirement contribution while on
extended leave. Minn. Stat. §§ 122A.46, 354.094 (2000).

January 25, 2002 — Op. Atty. Gen. 59a-32 (Cr. Ref. 441h;
477b-34)

MUNICIPALITIES: ZONING: AMENDMENT:With certain
exceptions, municipal zoning ordinances may be adopted or amended by majority
vote of governing body notwithstanding charter provision, or ordinance
requiring greater majority. Minn. Stat.
§§ 462.351, 462.357.

October 18, 2001 — Op. Atty. Gen. 125a (Cr. Ref. 59a-9)

COUNTY: BUILDING CODE: ADOPTION: County may adopt and enforce State
Building Code by ordinance notwithstanding previous referendum. Op. Atty. Gen. 125a.
April 20, 1994, superseded. Minn. Stat. § 16B.72 (2000).

April 30, 2001 — Op. Atty. Gen. 125a-28 (Cr. Ref. 59a-25; 161b-7)

COUNTIES: INSURANCE: RETIRED EMPLOYEES: Health insurance coverage for
retired employees may be modified in connection with a new collective bargaining
agreement. Minn. Stat. §§ 179A.03 subd. 19, 179A.20, 471.61, 471.6161.

 October 5, 2000 — Op. Atty. Gen. 484e-1 (Cr. Ref. 185b-2)

CITIES: CONSOLIDATION: ELECTIONS: Voter approval of consolidation requires
affirmative vote of majority of persons voting on the question. Minn. Stat.
§ 414.01, subd. 6 (1998).

August 4, 2000 — Op. Atty. Gen. 852 (Cr. Ref. 523a-17,
523a-27)

DATA PRACTICES ACT: LABOR AND INDUSTRY: ORDERS: Orders of Commissioner of Labor
and Industry and objections thereto are public data. Minn. Stat. §§ 13.39, 176.181.

June 30, 2000 — Op. Atty. Gen. 229a (Cr. Ref. 1005, 1007, 1016)

DEPARTMENT OF TRANSPORTATION: RESPONSIBILITIES: CONSTRUCTION: Responsibilities of
Commissioner of Transportation and Metropolitan Council in connection with construction of
light rail transit project discussed: Minn. Stat. §§ 471.59, 473.399 473.3997.

May 4, 2000 — Op. Atty. Gen. 62b (Cr. Ref. 477b)

CITIES: ORDINANCES: PREEMPTION: A city may completely prohibit smoking in
restaurants under its general police powers. The Minnesota Clean Indoor Air Act expressly
preserves the authority of cities to ban smoking where the Act, and Health Department
rules promulgated thereunder, would otherwise allow designation of smoking areas by the
proprietor.

November 23, 1999 — Op. Atty. Gen. 471m

STATUTORY CITY COUNCIL: VACANCY IN OFFICE: Person
elected to fill remainder of unexpired mayoral term may assume office upon receipt of
certificate of election. Minn. Stat. § 412.02, subd. 2, 2a.

August 23, 1999 — Op. Atty. Gen. 1035 (Cr. Ref. 170c)

MINNESOTA STATE HIGH SCHOOL LEAGUE: Questions
concerning the nature, governance and powers of the League discussed. Minn. Stat.
§§ 10A.071, 15.0575, 118A.04, 118A.05, 128C.01, 128C.10, 128C.15, 128C.22, 471.345,
471.705, 471.895 (1998).

June 28, 1999 — Op. Atty. Gen. 624a-3

PUBLIC UTILITIES COMMISSION: HOME RULE CHARTER CITIES: City public
utilities commission is authorized to set reasonable rates, including rates in excess of
the precise amounts required to operate utilities, and the City Council may transfer
moneys from the public utilities fund to the city general fund for public purpose
expenditures, subject to applicable charter provisions.

June 9, 1999 — Op. Atty. Gen. 390a-14

SHERIFFS: MOTOR VEHICLES: County Board has authority to specify color of
Sheriff’s squad cars. Minn. Stat. §§ 169.98 subd. 1 (a); 375.18
subd. 2; 387.29 subd. 2.

May 11, 1999 — Op. Atty. Gen. 59a-32 (Cr. Ref. 125a-66, 477b-34,
484a-1, 484e-1)

CITIES: ZONING: City ordinance zoning newly annexed land in Mississippi
headwaters area is not subject to requirement for formal review and certification by
Mississippi Headwaters Board, but must, nonetheless comply with the Boards’
comprehensive land use plan. Minn. Stat. § 103f.371 - 103f.375 (1998).

December 15, 1998 — Op. Atty. Gen. 161b-7 (Cr. Ref. 59a-25, 125a-28,
469a-7)

SCHOOL DISTRICTS: INSURANCE: RETIRED EMPLOYEES: School district is not
required to make available same level of insurance coverage to retired employees 65 years
of age and older as that provided to active employees. Minn. Stat. § 471.61,
subd. 2b.

November 5, 1998 — Op. Atty. Gen. 379c-8c

ROADS: TOWN LINE: MAINTENANCE: County boards may determine division
of maintenance responsibility for town line road established prior to enactment of
authorizing statute. Op. Atty. Gen. 379c-8c, September 18, 1951 superseded. Minn.
Stat. § 164.12 (1996).

November 2, 1998 — Op. Atty. Gen. 624a-3

PUBLIC UTILITIES: COMMISSION STATUTORY CITIES: City council is not
authorized to delegate operation and management of telephone and cable television services
to utility commission. Op. Atty. Gen. 624a-3 , May 7, 1968, superseded. Minn. Stat. §
412.351.

  March 11, 1998 — Op. Atty. Gen. 159a-3

EDUCATION: INDEPENDENT SCHOOL DISTRICT: BOND ELECTION: REVIEW AND COMMENT: School
board which receives petition by voters to hold special election to authorize issuance of
bonds for school facility must submit project for review and comment. A community
recreational facility as described by school district is subject to review and comment
procedures. Unless the review and comment is negative, school board must call the special
election petitioned by voters. Minn. Stat. §§ 121.148 (1996), 121.15 (Supp. 1997),
205A.05 (Supp. 1997). Affirmative vote in bond election does not compel board to issue
bonds. Op. Atty. Gen. 159a-3, May 25, 1970.

December 18, 1997 — Op. Atty. Gen. 107b-19

COUNTY FUNDS: USES: TAX FORFEITED LAND SALE: County may purchase motor
vehicles with tax forfeited land sales funds. Vehicles must be used exclusively for
maintenance and improvement of tax forfeited lands.

October 14, 1997 — Op. Atty. Gen. 268l

JUVENILES, CRIMES, PHOTOS: Minn. Stat § 260.161, subd. 3(a) only
prohibits peace officers from taking photos of children in custody and does not prohibit
news media.

October 14, 1997 — Op. Atty. Gen. 268l

SHERIFFS, POLICE, JURISDICTION: County sheriffs have jurisdiction to
investigate crimes anywhere in their county, even in cities with established police
forces.

 August 27, 1997 — Op. Atty. Gen. 82t

FAIR CAMPAIGN PRACTICES ACT: DISCLAIMER: VIOLATIONS: The prohibition
against anonymous campaign material in Minn. Stat. §§ 211B.04(a) and (b) (1996) is
clearly unconstitutional under controlling U.S. Supreme Court precedent.

August 25, 1997 — Op. Atty. Gen. 90e

CONTRACTS: OFFICERS INTEREST: CITY: Officer and employee of nonprofit
corporation that provides public access cable television services in connection with city
franchise and contract is not disqualified from serving as mayor or council member, but
must abstain from participating in city actions involving franchise. Op. Atty. Gen. 90a-1,
July 12, 1973 superseded. Minn. Stat. §§ 238.15 and 471.87 (1996).

August 4, 1997 — Op. Atty. Gen. 161b-12

SCHOOL BOARD POWERS: SUPERINDENT: SALARY AND BENEFITS: School district
powers regarding salary and benefits for superintendent discussed. Authority of
Commissioner of Children, Families and Learning discussed. Minn. Stat. §§ 43A.17,
123.33-123.35, 356.24, 356.25, 471.38, 471.665.

July 29, 1997 — Op. Atty. Gen. 358e-3

INCOMPATIBLE OFFICE: CITY ATTORNEY: Office of Assistant County Attorney
is not incompatible per se with office of city attorney. Minn. Stat. § 481.17 (1996)

July 10, 1997 — Op. Atty. Gen. 602j

DRAINAGE: REPAIRS: LIMITATION UPON COST: The limitation contained in
Minn. Stat. § 103E.715, subd. 4(a) (1996) on cost of repairs made pursuant to a repair
petition does not apply to routine maintenance and repairs made by a drainage authority
pursuant to Minn. Stat. § 103E.705 (1996).

November 5, 1996 — Op. Atty. Gen. 390a-21

SHERIFFS: SERVICE OF PROCESS: Sheriff is not authorized to serve
documents pertaining to proceedings in purported “courts” not established by
law. Minn. Const. art. VI § 387.03 (1994).

August 28, 1996 — Op. Atty. Gen. 63a-5

OPEN MEETING LAW: CITY COUNCIL: COMMITTEES: Mere attendance by additional
council member(s) at meeting of a council committee, held in compliance with Open Meeting
Law, would not constitute special council meeting requiring separate notice, but such
member(s) should not participate in committee discussions or deliberations, absent
separate notice.

July 25, 1996 — Op. Atty. Gen. 442a-1

TOWN FUNDS: OFFICERS: Town is not required or authorized to reimburse
officer for costs of criminal defense. Minn. Stat. §§ 465.76, 466.07, 471.44 (1994).

 July 24, 1996 — Op. Atty. Gen. 59a-30

CITY OFFICERS: REMOVAL: City charter may not provide for removal of
council member by council. Grounds for removal of elected local official must amount to
malfeasance or nonfeasance in office. Minn. Const. art. VIII, § 5; art. XII, §§ 3, 4.
Minn. Stat. §§ 351.02, 351.14, 410.07, 410.20.

February 23, 1996 — Op. Atty. Gen. 238i

MANUFACTURED HOME PARKS: FIRE CODE: Fire code road width requirements may
be applied to existing park where hazard to life or property exists.

December 4, 1995 — Op. Atty. Gen. 852

DATA PRACTICES: COPYRIGHT: STATE AGENCY DATA: State agency data
constituting original works of authorship are protected by federal copyright law. Certain
restrictions may be placed upon use of public data. Title 17 U.S.C., Minn. Stat.
§§ 13.03, 13.37, 15.95, 16B.483, 16B.51, 16B.53

October 27, 1995 — Op. Atty. Gen. 64f  (Cr. Ref.63b-5)

ELECTIONS: CITIES: Uniform election day statute applies to charter cities transitional provisions discussed. Minn. Stat.
§§ 205.02, 205.07, 410.015, 410.21

August 18, 1995 — Op. Atty. Gen. 59a-32 (Cr. Ref.
59a-9, 125a-66)

CITIES: ZONING: City may extend subdivision regulations and building code
enforcement but not zoning controls, two miles beyond city limits where county zoning
regulations are in effect. Minn. Stat. §§ 16B.62, 16B.72, 462.357, 462.358 (1994).

April 10, 1995 — Op. Atty. Gen. 106e

COUNTY SEAT: REMOVAL: Petition not invalid due to claims that signatures
not personally observed by affiants: Effect of conditional offer of site and funds for
construction.

January 24, 1995 — Op. Atty. Gen. 106e

COUNTY SEAT: REMOVAL: Otherwise qualified voters need not have actually
voted at previous election or be registered to sign petition for changing county seat.
Minn. Stat. §§ 372.01, 372.03 (1994).

December 28, 1994 — Op. Atty. Gen. 104a-9

COUNTIES: OFFICERS: COMPENSATION: County may not provide car allowance
subsidizing personal use of automobile in addition to maximum authorized salary;
authorized vacation leave is not considered severance pay. Minn. Stat. §§ 43A.17, subd.
9, 465.722; 471.665.

October 31, 1994 — Op. Atty. Gen. 390a-6

SHERIFF: COMPENSATION: FEES: County sheriff may not perform privately
contracted policing services within the county for personal compensation. Sheriff's family
members may be involved in private service of process business. Minn. Stat. §§ 387.03,
387.20, 436.05.

August 18, 1994 — Op. Atty. Gen. 632e-1

MOTOR VEHICLE: TAX: BASIS FOR COMPUTING: Motor Vehicle registration tax
must be based upon base price as listed on window sticker. Minn. Stat. § 168.013.

August 1, 1994 — Op. Atty. Gen. 627e

ELECTIONS: CAMPAIGN CONTRIBUTIONS: Candidates for local office are not
precluded by Minn. Stat. § 211A.13 (Supp. 1993) from transferring funds to other
candidates for local office.

June 9, 1994 — Op. Atty. Gen. 90

CONTRACTS: OFFICERS' INTEREST IN: HOUSING AND REDEVELOPMENT AUTHORITIES: Housing
and Redevelopment Authority Commissioner is not prohibited from performing work on
projects approved by authority if notice and nonparticipation requirements of Minn. Stat.
§ 469.009 (1992) are met. Minn. Stat. §§ 469.009, 471.87 (1992)

April 28, 1994 — Op. Atty. Gen. 124a

COUNTY COMMISSIONERS: COMPENSATION PER DIEM ALLOWANCE: Authority to
provide per diem allowance does not permit a per meeting payment. Per diem payment
permitted for meetings of county board. Members may not be paid multiple per diem for
meetings held on the same day, absent independent statutory authority Minn. Stat. §§
375.055, 375.065.

 April 20, 1994 — Op. Atty. Gen. 125a

COUNTY: BUILDING CODE: ADOPTION: County, wherein building code was
rejected by referendum, may not adopt code by ordinance. Matter of code application may be
resubmitted to referendum. Minn. Stat. § 16B.72 (1992).

March 11, 1994 — Op. Atty. Gen. 1007

JOINT POWERS ACT: CHARTER SCHOOLS: Charter schools formed as contemplated
by Minn. Stat. § 120.064 (1992 and Supp. 1993) are not “governmental units” as
the term is defined in the Joint Powers Act, Minn. Stat. § 471.59, subd. 1 (1992);
consequently, such charter schools may not be a party to a joint powers agreement.

 March 9, 1994 — Op. Atty. Gen. 213c

GOVERNOR: LEGISLATION: CONSTITUTIONAL AMENDMENTS: Amendments proposed by
legislative action are not subject to gubernatorial approval or veto. Minn. Const. art.
IV, §§ 23, 24; art. IX, §1.

September 14, 1993 — Op. Atty. Gen. 469b

CITIES: OFFICERS: SALARIES: Compensation of employee for unused vacation
upon termination is not considered salary for purposes of Minn. Stat. § 43A.17.

July 27, 1993 — Op. Atty. Gen. 707a

MUNICIPAL CONTRACTS: ADVERTISING FOR CONSTRUCTION BIDS: City may include
project labor agreement specifications if motivated by economic reasons as purchaser, and
not in regulatory capacity.

May 4, 1993 — Op. Atty. Gen. 414a-5

TAXATION: INDIAN LANDS: The exemption from ad valorem taxation for Indian
lands in Minn. Stat. § 272.01, subd. 1 applies only to lands held in trust by the United
States for the benefit of an Indian Tribe, its members, or an individual Indian, and lands
owned by an Indian Tribe or an individual Indian subject to federal statutory restraints
on alienation. The exemption does not apply to lands owned in fee simple title by Indian
Tribes or individual Indians.

 April 15, 1993 — Op. Atty. Gen. 494a-1

CRIMINAL LAW: UNIFORM TRAFFIC TICKET: Issuance for violation not
committed or attempted in presence of officer. Superseding Op. Atty. Gen. 494a-1, March
14, 1967. Minn. Stat. §§ 169.91, 169.92, 169.99, 629.34.

March 8, 1993 — Op. Atty. Gen. 387b-10

STORM SEWERS: CHARGES: City may impose reasonable charges for storm sewer
services based upon classification of premises in reference to storm water produced.
Minn. Stat. § 444.075 (1992).

March 1, 1993 — Op. Atty. Gen. 484a-1

CITIES: ANNEXATION: Time conditions in orderly annexation agreements do
not bind determinations of Municipal Board or preclude annexation by ordinance pursuant to
Minn. Stat. § 414.033, subd. 2a (1992). Minn. Stat. §§ 414.0325, 414.033.

January 4, 1993 — Op. Atty. Gen. 330c-3

BOARDS: HENNEPIN COUNTY: TERMS OF MEMBERS: Terms of members appointed by
county board expire on January. They may continue in de facto capacity until
successors are selected. Minn. Stat. §§ 383B.68, 383B.69 (1990).

The Official Website of the Minnesota Attorney General

445 Minnesota Street, Suite 1400,

St. Paul, MN 55101

 M-F 8am-5pm

(651) 296-3353

(800) 657-3787

TTY: (651) 297-7206

TTY: (800) 366-4812


text:
function make_setdiff_tol

% function makefile
this_dir         = fileparts(mfilename('fullpath'));
matlab_root      = MATLAB_SVN_ROOT;
mex_support_root = fullfile(matlab_root,'mexSupport');

params.include_path = {mex_support_root};
params.lib_path     = {mex_support_root};
params.libs         = {};
params.objs         = {fullfile(mex_support_root,mexext,['MexSupport.',objext])};
params.src          = {};
params.target       = 'mex_setdiff_tol.cpp';
params.flags        = {};

tmp    = regexp(params.target,'\.','once','split');
output = [tmp{1},'.',mexext];
params.output_dir = fullfile(fileparts(this_dir),tmp{1});
try
    make(params)
catch ME
    simpleExceptionDisplay(ME);
    formattedWarning('Compile Failed')
end


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

namespace TaskLayer
{
    public class MyTaskResults
    {
        #region Public Fields

        public List<string> newSpectra;
        public List<DbForTask> newDatabases;
        public TimeSpan Time;

        #endregion Public Fields

        #region Private Fields

        private readonly List<string> resultTexts;

        private readonly StringBuilder niceText = new StringBuilder();

        #endregion Private Fields

        #region Internal Constructors

        internal MyTaskResults(MetaMorpheusTask s)
        {
            resultTexts = new List<string>();
        }

        #endregion Internal Constructors

        #region Public Methods

        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendLine("Time to run task: " + Time);
            sb.AppendLine();
            sb.AppendLine();
            sb.AppendLine("--------------------------------------------------");
            if ((newSpectra != null && newSpectra.Any()) || (newDatabases != null && newDatabases.Any()))
            {
                sb.AppendLine();
                sb.AppendLine();
                sb.AppendLine("New files:");
                if (newSpectra != null && newSpectra.Any())
                {
                    sb.AppendLine("New spectra: ");
                    sb.AppendLine();
                    sb.AppendLine(string.Join(Environment.NewLine + "\t", newSpectra));
                }
                if (newDatabases != null && newDatabases.Any())
                {
                    sb.AppendLine("New databases: ");
                    sb.AppendLine(string.Join(Environment.NewLine + "\t", newDatabases.Select(b => b.FilePath)).ToString());
                }
                sb.AppendLine();
                sb.AppendLine();
                sb.AppendLine("--------------------------------------------------");
            }
            sb.AppendLine();
            sb.AppendLine();
            sb.AppendLine(niceText.ToString());
            sb.AppendLine();
            sb.AppendLine();
            sb.AppendLine("--------------------------------------------------");
            sb.AppendLine();
            sb.AppendLine();
            sb.AppendLine("Engine Results:");
            sb.AppendLine();
            foreach (var ok in resultTexts)
            {
                sb.AppendLine(ok);
                sb.AppendLine();
            }
            return sb.ToString();
        }

        #endregion Public Methods

        #region Internal Methods

        internal void AddResultText(string resultsText)
        {
            resultTexts.Add(resultsText);
        }

        internal void AddNiceText(string niceTextString)
        {
            niceText.AppendLine(niceTextString);
        }

        #endregion Internal Methods
    }
}


text:
package de.fhws.fiw.pvs.assignment02.prefix.parallel;

import java.util.concurrent.Callable;

public class PrefixWorker implements Callable<Integer>
{
	protected final int[] array;
	protected int size;
	protected int start;

	public PrefixWorker( final int[] array, final int start, final int size )
	{
		this.array = array;
		this.start = start;
		this.size = size;
	}

	@Override
	public Integer call( )
	{
		for ( int i = this.start + 1; i < ( this.start + this.size ); i++ )
		{
			this.array[ i ] = this.array[ i - 1 ] + this.array[ i ];
		}

		return this.array[ this.start + this.size - 1 ];
	}
}


text:
namespace scelta::meta
{
    /// @brief Applies `T`'s value category on `Source`.
    template <typename Source, typename T>
    using as_if_forwarded = std::conditional_t< //
        std::is_lvalue_reference_v<Source>,     //
        std::remove_reference_t<T>&,            //
        std::remove_reference_t<T>&&>;

    /// @brief Forwards `x` with the same value category as `Source`.
    template <typename Source, typename T>
    [[nodiscard]] auto forward_like(T&& x)
        SCELTA_RETURNS(static_cast<as_if_forwarded<Source, T&&>>(x))
}


text:
package springfox.documentation.service;

import com.fasterxml.classmate.ResolvedType;
import com.google.common.base.Optional;
import springfox.documentation.schema.ModelReference;

import java.util.List;

public class Parameter {
  private final String name;
  private final String description;
  private final String defaultValue;
  private final Boolean required;
  private final Boolean allowMultiple;
  private final ModelReference modelRef;
  private final Optional<ResolvedType> type;
  private final AllowableValues allowableValues;
  private final String paramType;
  private final String paramAccess;
  private final Boolean hidden;
  private final List<VendorExtension> vendorExtensions;

  public Parameter(
      String name,
      String description,
      String defaultValue,
      boolean required,
      boolean allowMultiple,
      ModelReference modelRef,
      Optional<ResolvedType> type,
      AllowableValues allowableValues,
      String paramType,
      String paramAccess,
      boolean hidden,
      List<VendorExtension> vendorExtensions) {

    this.description = description;
    this.defaultValue = defaultValue;
    this.required = required;
    this.allowMultiple = allowMultiple;
    this.modelRef = modelRef;
    this.type = type;
    this.allowableValues = allowableValues;
    this.paramType = paramType;
    this.paramAccess = paramAccess;
    this.name = name;
    this.hidden = hidden;
    this.vendorExtensions = vendorExtensions;
  }

  public Optional<ResolvedType> getType() {
    return type;
  }

  public String getName() {
    return name;
  }

  public String getDescription() {
    return description;
  }

  public String getDefaultValue() {
    return defaultValue;
  }

  public Boolean isRequired() {
    return required;
  }

  public Boolean isAllowMultiple() {
    return allowMultiple;
  }

  public AllowableValues getAllowableValues() {
    return allowableValues;
  }

  public String getParamType() {
    return paramType;
  }

  public String getParamAccess() {
    return paramAccess;
  }

  public ModelReference getModelRef() {
    return modelRef;
  }

  public Boolean isHidden() {
    return hidden;
  }

  public List<VendorExtension> getVendorExtentions() {
    return vendorExtensions;
  }
}


text:
using System;
using System.Linq;
using System.Reflection;
using Funq;
using NServiceKit.FluentValidation;
using NServiceKit.FluentValidation.Results;
using NServiceKit.Logging;
using NServiceKit.ServiceHost;
using NServiceKit.WebHost.Endpoints;
using NServiceKit.Text;

namespace NServiceKit.ServiceInterface.Validation
{
    /// A validation feature.
    public class ValidationFeature : IPlugin
    {
        private static readonly ILog Log = LogManager.GetLogger(typeof(ValidationFeature));

        /// Gets or sets the error response filter.
        ///
        /// <value>The error response filter.</value>
        public Func<ValidationResult, object, object> ErrorResponseFilter { get; set; }

        ///
        /// Activate the validation mechanism, so every request DTO with an existing validator
        /// will be validated.
        ///
        /// <param name="appHost">The app host</param>
        public void Register(IAppHost appHost)
        {
            if(!appHost.RequestFilters.Contains(ValidationFilters.RequestFilter))
                appHost.RequestFilters.Add(ValidationFilters.RequestFilter);
        }

        ///
        /// Override to provide additional/less context about the Service Exception.
        /// By default the request is serialized and appended to the ResponseStatus StackTrace.
        ///
        public virtual string GetRequestErrorBody(object request)
        {
            var requestString = "";
            try
            {
                requestString = TypeSerializer.SerializeToString(request);
            }
            catch /*(Exception ignoreSerializationException)*/
            {
                //Serializing request successfully is not critical and only provides added error info
            }

            return string.Format("[{0}: {1}]:\n[REQUEST: {2}]", GetType().Name, DateTime.UtcNow, requestString);
        }
    }

    /// A validation extensions.
    public static class ValidationExtensions
    {
        ///
        /// Auto-scans the provided assemblies for a <see cref="IValidator"/>
        /// and registers it in the provided IoC container.
        ///
        /// <param name="container">The IoC container</param>
        /// <param name="assemblies">The assemblies to scan for a validator</param>
        public static void RegisterValidators(this Container container, params Assembly[] assemblies)
        {
            RegisterValidators(container, ReuseScope.None, assemblies);
        }

        /// Auto-scans the provided assemblies for a <see cref="IValidator"/>and registers it in the provided IoC container.
        ///
        /// <param name="container"> The IoC container.</param>
        /// <param name="scope">     The scope.</param>
        /// <param name="assemblies">The assemblies to scan for a validator.</param>
        public static void RegisterValidators(this Container container, ReuseScope scope, params Assembly[] assemblies)
        {
            foreach (var assembly in assemblies)
            {
                foreach (var validator in assembly.GetTypes()
                .Where(t => t.IsOrHasGenericInterfaceTypeOf(typeof(IValidator<>))))
                {
                    RegisterValidator(container, validator, scope);
                }
            }
        }

        /// A Container extension method that registers the validator.
        ///
        /// <param name="container">The IoC container.</param>
        /// <param name="validator">The validator.</param>
        /// <param name="scope">    The scope.</param>
        public static void RegisterValidator(this Container container, Type validator, ReuseScope scope=ReuseScope.None)
        {
            var baseType = validator.BaseType;
            while (!baseType.IsGenericType)
            {
                baseType = baseType.BaseType;
            }

            var dtoType = baseType.GetGenericArguments()[0];
            var validatorType = typeof(IValidator<>).MakeGenericType(dtoType);

            container.RegisterAutoWiredType(validator, validatorType, scope);
        }
    }
}


text:
import unittest
from pipetree.config import PipelineStageConfig
from pipetree.exceptions import NonPythonicNameError, IncorrectPipelineStageNameError, MissingPipelineAttributeError

class TestPipelineStageConfig(unittest.TestCase):
    def setUp(self):
        pass

    def test_initialize_with_no_type(self):
        try:
            PipelineStageConfig('valid_name', {})
            print('This should have raised an error, the config has no type')
            self.fail()
        except MissingPipelineAttributeError:
            pass

    def test_initialize_with_bad_key(self):
        try:
            PipelineStageConfig('invalid name', {})
            print('This should have raised an error, the name is invalid')
            self.fail()
        except NonPythonicNameError:
            pass

    def test_initialize_with_bad_dictionary(self):
        try:
            PipelineStageConfig('valid_name', 'not a dict')
            print('This should have raised an error, the value isn\'t a dict')
            self.fail()
        except TypeError:
            pass

    def test_initialize_with_bad_type(self):
        try:
            PipelineStageConfig('valid_name', {
                'type': 'InvalidPipelineType'
            })
            print('This should have raised an error, the type is invalid.')
            self.fail()
        except IncorrectPipelineStageNameError:
            pass


text:
import RestSharp;

public string Server = "https://api.chayns.net/v2.0";
private const string Secret = "Your Tapp Secret";

[HttpPost]
[Route("UserPermitted")]
public IHttpActionResult UserPermitted(int locationId, int tappId, int userId, int groupId)
{
    try
    {
        //Test if the user exists in the Group
        dynamic user = AddUserToUacGroup(locationId, tappId, userId, groupId);

        //null means add failed
        if (user == null)
        {
            return InternalServerError();
        }
        else
        {
            //Build user-model
            object userModel = new
            {
                userId = user.userId,
                firstName = user.firstName,
                lastName = user.lastName,
                name = user.firstName,
                gender = user.gender
            };
            return Ok(userModel);
        }

    }
    catch (Exception exception)
    {
        return InternalServerError(exception);
    }
}

public dynamic AddUserToUacGroup(int locationId, int tappId, int userId, int groupId)
{
    //Set up RestSharp
    RestClient restClient = new RestClient(Server);

    //Build the request
    RestRequest req = new RestRequest("/" + locationId + "/Uac/" + groupId + "/User/" + userId);
    req.Method = Method.POST;
    req.AddHeader("Content-Type", "application/json");
    req.AddHeader("Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(Convert.ToString(tappId) + ':' + Secret)));

    //Run the request
    IRestResponse resp = restClient.Execute(req);

    //Test response health
    if (resp.StatusCode == HttpStatusCode.Created)
    {
        //Parse data
        dynamic data = JObject.Parse(resp.Content);
        //Just return the user-Model
        return data.data[0];
    }
    return null;
}


text:
module WeightedAverage
  module ArelSelectManagerInstanceMethods
    # Calculate the weighted average of column(s).
    #
    # @param [Symbol,Array<Symbol>] data_column_names One or more column names whose average should be calculated. Added together before being multiplied by the weighting if more than one.
    # @param [Hash] options
    #
    # @option options [Symbol] :weighted_by The name of the weighting column if it's not :weighting (the default)
    # @option options [Symbol] :disaggregate_by The name of a column to disaggregate by. Usually not necessary.
    #
    # @see WeightedAverage::ActiveRecordRelationInstanceMethods The ActiveRecord-specific version of this method, which knows about associations.
    #
    # @example Weighted average of load factor in flight stage data
    #   Arel::Table.new(:flight_segments).weighted_average(:load_factor, :weighted_by => :passengers)
    #
    # @return [Float,nil]
    def weighted_average(data_column_names, options = {})
      weighted_average = @engine.connection.select_value(weighted_average_relation(data_column_names, options).to_sql)
      weighted_average.nil? ? nil : weighted_average.to_f
    end

    # In case you want to get the relation and/or the SQL of the calculation query before actually runnnig it.
    #
    # @example Get the SQL
    #   Arel::Table.new(:flight_segments).weighted_average_relation(:load_factor, :weighted_by => :passengers).to_sql
    #
    # @return [Arel::SelectManager] A relation you can play around with.
    def weighted_average_relation(data_column_names, options = {})
      unless options[:safe] == true
        return clone.weighted_average_relation(data_column_names, options.merge(:safe => true))
      end

      data_column_names = Array.wrap data_column_names
      left = self.source.left

      weighted_by_column = case options[:weighted_by]
      when Arel::Attribute
        options[:weighted_by]
      when Symbol, String
        left[options[:weighted_by]]
      when NilClass
        left[DEFAULT_WEIGHTED_BY_COLUMN_NAME]
      else
        raise ArgumentError, ":weighted_by => #{options[:weighted_by].inspect} must be a column on #{left.inspect}"
      end

      disaggregate_by_column = if options[:disaggregate_by]
        left[options[:disaggregate_by]]
      end

      data_columns = data_column_names.map do |data_column_name|
        left[data_column_name]
      end

      data_columns_added_together = data_columns.inject(nil) do |memo, data_column|
        if memo
          Arel::Nodes::Addition.new(memo, data_column)
        else
          data_column
        end
      end

      if data_column_names.many?
        data_columns_added_together = Arel::Nodes::Grouping.new(data_columns_added_together)
      end

      if disaggregate_by_column
        self.projections = [Arel::Nodes::Division.new(Arel::Nodes::Sum.new(weighted_by_column * data_columns_added_together / disaggregate_by_column * 1.0), Arel::Nodes::Sum.new([weighted_by_column]))]
      else
        self.projections = [Arel::Nodes::Division.new(Arel::Nodes::Sum.new(weighted_by_column * data_columns_added_together * 1.0), Arel::Nodes::Sum.new([weighted_by_column]))]
      end

      data_columns_not_eq_nil = data_columns.inject(nil) do |memo, data_column|
        if memo
          memo.and(data_column.not_eq(nil))
        else
          data_column.not_eq(nil)
        end
      end

      if disaggregate_by_column
        where data_columns_not_eq_nil.and(weighted_by_column.gt(0)).and(disaggregate_by_column.gt(0))
      else
        where data_columns_not_eq_nil.and(weighted_by_column.gt(0))
      end
    end

  end
end


text:
drop table
    ec_cross_references,
    ec_numbers,
    embl_cross_references,
    go_cross_references,
    go_terms,
    lineages,
    peptides,
    refseq_cross_references,
    sequences,
    taxons,
    uniprot_entries,
    proteomes,
    proteome_cross_references,
    proteome_caches;

rename table unipept2.ec_cross_references to unipept.ec_cross_references;
rename table unipept2.ec_numbers to unipept.ec_numbers;
rename table unipept2.embl_cross_references to unipept.embl_cross_references;
rename table unipept2.go_cross_references to unipept.go_cross_references;
rename table unipept2.go_terms to unipept.go_terms;
rename table unipept2.lineages to unipept.lineages;
rename table unipept2.peptides to unipept.peptides;
rename table unipept2.refseq_cross_references to unipept.refseq_cross_references;
rename table unipept2.sequences to unipept.sequences;
# rename table unipept2.sequences_compressed to unipept.sequences_compressed;
# NOTE: a view cannot be renamed! Create it separately (see structure_no_index_compress.sql)
rename table unipept2.taxons to unipept.taxons;
rename table unipept2.uniprot_entries to unipept.uniprot_entries;
rename table unipept2.proteomes to unipept.proteomes;
rename table unipept2.proteome_cross_references to unipept.proteome_cross_references;
rename table unipept2.proteome_caches to unipept.proteome_caches;


text:
(function() {
  'use strict';

  angular.module('sslv2App')
    .controller('ForgotCtrl', ForgotCtrl);

  ForgotCtrl.$inject = ['$state','ForgotService','ENV', '$cookies'];

  function ForgotCtrl($state,ForgotService,ENV, $cookies) {

    var vm = this;
    vm.login_greetings = localStorage.getItem("first_name") || "";
    vm.help = {
      templateUrl: 'templates/help.html'
    };

    vm.user = {
      email:"",
      redirect_url:""
    }
    vm.organization_name = $cookies.get('organization_name');
    vm.reset = reset;

    function reset(user) {
      user.callback_url = window.location.origin + "/#!reset";
      user.redirect_url = window.location.origin + "/";
      ForgotService.resetPassword(user)
      .then(function(response){
        $state.go('submission');
      },function(error){

      });
    }

  }

})();


text:
cd $(dirname $0)/..

domain=$1

export ANSIBLE_HOST_KEY_CHECKING=False
exec ansible-playbook kerberos-token.yml -v -i inventory/cdh --extra-vars "cf_domain=${domain} kerberos_enabled=True" -s


text:
object T2 {
  import M.f

  private inline val V = "V"
  private inline def D = "D"

  trait Trait { def s: String }

  object MatchFV extends Trait {
    override transparent inline def s: String =
      inline f(V) match { case "V" => "o"; case _   => "x" } // error in RC1
  }

  object MatchFD extends Trait {
    override transparent inline def s: String =
      inline f(D) match { case "D" => "o"; case _   => "x" }
  }
}


text:
cask "reikey" do
  version "1.4.1"
  sha256 "61e13dd9b3bd71aa37f73d5f854a0bd76ddff979cd7646a65a7c607daafd08e0"

  # bitbucket.org/objective-see/ was verified as official when first introduced to the cask
  url "https://bitbucket.org/objective-see/deploy/downloads/ReiKey_#{version}.zip"
  appcast "https://objective-see.com/products/changelogs/ReiKey.txt"
  name "ReiKey"
  desc "Scans, detects, and monitors keyboard taps"
  homepage "https://objective-see.com/products/reikey.html"

  depends_on macos: ">= :high_sierra"

  installer script: {
    executable: "#{staged_path}/ReiKey Installer.app/Contents/MacOS/ReiKey Installer",
    args:       ["-install"],
    sudo:       true,
  }

  uninstall script: {
    executable: "#{staged_path}/ReiKey Installer.app/Contents/MacOS/ReiKey Installer",
    args:       ["-uninstall"],
    sudo:       true,
  }

  zap trash: [
    "~/Library/Caches/SentryCrash/ReiKey Installer",
    "~/Library/Caches/SentryCrash/ReiKey Installer/Data",
    "~/Library/Caches/SentryCrash/ReiKey Installer/Data/ConsoleLog.txt",
    "~/Library/Caches/SentryCrash/ReiKey Installer/Data/CrashState.json",
    "~/Library/Caches/SentryCrash/ReiKey Installer/Reports",
  ]
end


text:
package com.intellij.codeInspection.java19modules;

import com.intellij.codeInsight.intention.QuickFixFactory;
import com.intellij.codeInspection.AbstractBaseJavaLocalInspectionTool;
import com.intellij.codeInspection.ProblemsHolder;
import com.intellij.java.analysis.JavaAnalysisBundle;
import com.intellij.openapi.util.Ref;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.*;
import com.intellij.psi.util.PsiUtil;
import org.jetbrains.annotations.NotNull;

import static com.intellij.psi.SyntaxTraverser.psiTraverser;

public class JavaModuleNamingInspection extends AbstractBaseJavaLocalInspectionTool {
  @NotNull
  @Override
  public PsiElementVisitor buildVisitor(@NotNull ProblemsHolder holder, boolean isOnTheFly) {
    return !PsiUtil.isModuleFile(holder.getFile()) ? PsiElementVisitor.EMPTY_VISITOR : new JavaElementVisitor() {
      @Override
      public void visitModule(PsiJavaModule module) {
        super.visitModule(module);

        PsiJavaModuleReferenceElement name = module.getNameIdentifier();
        Ref<String> newName = Ref.create();
        psiTraverser().children(name).filter(PsiIdentifier.class).forEach(id -> {
          String text = id.getText();
          if (text.length() > 0 && Character.isDigit(text.charAt(text.length() - 1))) {
            String message = JavaAnalysisBundle.message("inspection.java.module.naming.terminal.digits", text);
            if (newName.isNull()) {
              newName.set(StringUtil.join(psiTraverser().children(name).filter(PsiIdentifier.class).map(i -> trimDigits(i.getText())), "."));
            }
            holder.registerProblem(id, message, QuickFixFactory.getInstance().createRenameElementFix(module, newName.get()));
          }
        });
      }
    };
  }

  private static String trimDigits(String text) {
    int p = text.length();
    while (p > 0 && Character.isDigit(text.charAt(p - 1))) p--;
    return text.substring(0, p);
  }
}


text:
<!DOCTYPE html>

        <link href='https://fonts.googleapis.com/css?family=Merriweather:400,300,700' rel='stylesheet' type='text/css'>
        <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,600,600italic,400italic,700,800italic,800,700italic' rel='stylesheet' type='text/css'>
        <meta charset="utf-8">

        <title>N/C | poq</title>
        <meta name="description" content="I'm an interaction designer in the Carnegie Mellon University's Masters of Human Computer Interaction Program.">
        <meta name="keywords" content="Nana Choi">

        <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"/>
        <meta name="generator" content="Lovingly created on 2016/02/10">

        <link rel="stylesheet" type="text/css" href="css/reset.css" media="all">

        <link rel="stylesheet" type="text/css" href="css/style.css" media="all">

              © N/C 2016. All Rights Reserved.

POQ: An informative Translator

Poq is a smart translation system for travelers that provides information beyond just the direct translation. Based on Weiser's idea of Tabs, Pads, and Boards, its ecosystem consists of a small wearable device, mobile app, and a desktop app.

This project is currently work-in-progress.
Please check out the links below to get a glimpse of what I'm working on.

Duration: Jan 18th - Feb 22nd (On-going)
Individual Project
Project Brief: Students will produce prototype design of a scalable User Interface for a connected experience across multiple devices. (The focus of this project is on UI animation and design on multiple screens)
My Role: Ideation, Concept Development, UI Design, Storyboarding, Animation, Video Production

Process Links

works | contact | about


text:
package abi10_0_0.host.exp.exponent;

import abi10_0_0.com.facebook.react.ReactPackage;
import abi10_0_0.com.facebook.react.bridge.JavaScriptModule;
import abi10_0_0.com.facebook.react.bridge.NativeModule;
import abi10_0_0.com.facebook.react.bridge.ReactApplicationContext;
import abi10_0_0.com.facebook.react.uimanager.ViewManager;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;

import host.exp.exponent.ExponentManifest;
import host.exp.exponent.analytics.EXL;
import abi10_0_0.host.exp.exponent.modules.api.AmplitudeModule;
import abi10_0_0.host.exp.exponent.modules.api.ConstantsModule;
import abi10_0_0.host.exp.exponent.modules.api.ContactsModule;
import abi10_0_0.host.exp.exponent.modules.api.CryptoModule;
import abi10_0_0.host.exp.exponent.modules.api.FabricModule;
import abi10_0_0.host.exp.exponent.modules.api.FacebookModule;
import abi10_0_0.host.exp.exponent.modules.api.FileSystemModule;
import abi10_0_0.host.exp.exponent.modules.api.FingerprintModule;
import abi10_0_0.host.exp.exponent.modules.api.FontLoaderModule;
import abi10_0_0.host.exp.exponent.modules.api.ImageCropperModule;
import abi10_0_0.host.exp.exponent.modules.api.ImagePickerModule;
import abi10_0_0.host.exp.exponent.modules.api.KeyboardModule;
import abi10_0_0.host.exp.exponent.modules.api.LocationModule;
import abi10_0_0.host.exp.exponent.modules.api.NotificationsModule;
import abi10_0_0.host.exp.exponent.modules.api.PermissionsModule;
import abi10_0_0.host.exp.exponent.modules.api.SegmentModule;
import abi10_0_0.host.exp.exponent.modules.api.ShakeModule;
import abi10_0_0.host.exp.exponent.modules.api.URLHandlerModule;
import abi10_0_0.host.exp.exponent.modules.api.UtilModule;
import abi10_0_0.host.exp.exponent.modules.api.RNViewShotModule;
import abi10_0_0.host.exp.exponent.modules.api.components.LinearGradientManager;
import abi10_0_0.host.exp.exponent.modules.api.components.VideoViewManager;
import abi10_0_0.host.exp.exponent.modules.api.components.svg.RNSvgPackage;
import abi10_0_0.host.exp.exponent.modules.api.components.maps.MapsPackage;
import abi10_0_0.host.exp.exponent.modules.internal.ExponentAsyncStorageModule;
import abi10_0_0.host.exp.exponent.modules.internal.ExponentIntentModule;
import abi10_0_0.host.exp.exponent.modules.internal.ExponentUnsignedAsyncStorageModule;

public class ExponentPackage implements ReactPackage {

  private static final String TAG = ExponentPackage.class.getSimpleName();

  private final boolean mIsKernel;
  private final Map<String, Object> mExperienceProperties;
  private final JSONObject mManifest;

  public ExponentPackage(Map<String, Object> experienceProperties, JSONObject manifest) {
    mIsKernel = false;
    mExperienceProperties = experienceProperties;
    mManifest = manifest;
  }

  public ExponentPackage() {
    mIsKernel = true;
    mExperienceProperties = null;
    mManifest = new JSONObject();
  }

  @Override
  public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
    boolean isVerified = false;
    if (mManifest != null) {
      isVerified = mManifest.optBoolean(ExponentManifest.MANIFEST_IS_VERIFIED_KEY);
    }

    List<NativeModule> nativeModules = new ArrayList<>(Arrays.<NativeModule>asList(
        new URLHandlerModule(reactContext),
        new ConstantsModule(reactContext, mExperienceProperties, mManifest),
        new ShakeModule(reactContext),
        new FontLoaderModule(reactContext),
        new KeyboardModule(reactContext),
        new UtilModule(reactContext, mExperienceProperties),
        new ExponentIntentModule(reactContext, mExperienceProperties)
    ));

    if (mIsKernel) {
      // Never need this in versioned code. Comment this out if this is in an abi package
      //nativeModules.add(new ExponentKernelModule(reactContext, mApplication));
    } else {
      if (isVerified) {
        try {
          String experienceId = mManifest.getString(ExponentManifest.MANIFEST_ID_KEY);
          String experienceIdEncoded = URLEncoder.encode(experienceId, "UTF-8");

          nativeModules.add(new ExponentAsyncStorageModule(reactContext, mManifest));
          nativeModules.add(new NotificationsModule(reactContext, mManifest));
          nativeModules.add(new ContactsModule(reactContext));
          nativeModules.add(new FileSystemModule(reactContext, mManifest));
          nativeModules.add(new LocationModule(reactContext));
          nativeModules.add(new CryptoModule(reactContext));
          nativeModules.add(new ImagePickerModule(reactContext));
          nativeModules.add(new FacebookModule(reactContext));
          nativeModules.add(new FabricModule(reactContext, mExperienceProperties));
          nativeModules.add(new FingerprintModule(reactContext));
          nativeModules.add(new PermissionsModule(reactContext));
          nativeModules.add(new AmplitudeModule(reactContext, experienceIdEncoded));
          nativeModules.add(new SegmentModule(reactContext, experienceIdEncoded));
          nativeModules.add(new RNViewShotModule(reactContext));
        } catch (JSONException e) {
          EXL.e(TAG, e.toString());
        } catch (UnsupportedEncodingException e) {
          EXL.e(TAG, e.toString());
        }
      } else {
        nativeModules.add(new ExponentUnsignedAsyncStorageModule(reactContext));
      }
      nativeModules.add(new ImageCropperModule(reactContext));
    }

    return nativeModules;
  }

  @Override
  public List<Class<? extends JavaScriptModule>> createJSModules() {
    return Collections.emptyList();
  }

  @Override
  public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
    List<ViewManager> viewManagers = new ArrayList<>(Arrays.<ViewManager>asList(
        new LinearGradientManager(),
        new VideoViewManager()
    ));

    // Add view managers from the react-native-svg package.
    RNSvgPackage svgPackage = new RNSvgPackage();
    viewManagers.addAll(svgPackage.createViewManagers(reactContext));

    // Add view managers from the react-native-maps package.
    MapsPackage mapsPackage = new MapsPackage();
    viewManagers.addAll(mapsPackage.createViewManagers(reactContext));

    return viewManagers;
  }
}


text:
Ext.define('Ext.overrides.scroll.DomScroller', {
    override: 'Ext.scroll.DomScroller',
    _scrollerCls: Ext.baseCSSPrefix +  'domscroller',

    updateElement: function(element, oldElement) {
        element.addCls(this._scrollerCls);
        this.callParent([element, oldElement]);
    }
});


text:
bool setEnvironmentVariables() {
	char * tmp;
	std::string home;
	tmp = std::getenv( "HOME" );
	if ( tmp != nullptr ) {
		home = std::string(tmp);
	} else {
		return false;
	}
	std::string defaultXdgDataHome = home + "/.local/share";
	std::string defaultXdgConfigHome = home + "/.config";
	std::string defaultXdgDataDirs("/usr/local/share/:/usr/share/");
	std::string defaultXdgConfigDirs("/etc/xdg");
	std::string defaultXdgCacheHome = home + "/.cache";
	setenv("XDG_DATA_HOME", defaultXdgDataHome.c_str(), 0);
	setenv("XDG_CONFIG_HOME", defaultXdgConfigHome.c_str(), 0);
	setenv("XDG_DATA_DIRS", defaultXdgDataDirs.c_str(), 0);
	setenv("XDG_CONFIG_DIRS", defaultXdgConfigDirs.c_str(), 0);
	setenv("XDG_CACHE_HOME", defaultXdgCacheHome.c_str(), 0);
	return true;
}

void setApplicationVariables() {
	std::string programDirectory("/neurohex");
	std::string globalDataDirectories( std::getenv("XDG_DATA_DIRS") );
	neuroClient::Application::globalDataDirectory = globalDataDirectories.substr( 0, globalDataDirectories.find_first_of(':') ) + programDirectory;
	std::string localDataDirectories( std::getenv("XDG_DATA_HOME") );
	neuroClient::Application::localDataDirectory = localDataDirectories.substr( 0, localDataDirectories.find_first_of(':') ) + programDirectory;
}

int main() {
	if ( !setEnvironmentVariables() ) {
		std::cerr << "$HOME variable is not set, what are you, using win***s?" << std::endl;
		return 1;
	}
	setApplicationVariables();
	neuroClient::Application application;
	ui::text::client::Application applicationUI(application);
	application.start();
	return 0;
}


text:
typedef struct _Win   Win;
typedef struct _Term  Term;
typedef struct _Split Split;

void main_new(Evas_Object *win, Evas_Object *term);
void main_new_with_dir(Evas_Object *win, Evas_Object *term, const char *wdir);
void main_split_h(Evas_Object *win, Evas_Object *term, char *cmd);
void main_split_v(Evas_Object *win, Evas_Object *term, char *cmd);
void main_close(Evas_Object *win, Evas_Object *term);

void main_trans_update(const Config *config);
void main_media_update(const Config *config);
void main_media_mute_update(const Config *config);
void main_media_visualize_update(const Config *config);
void main_config_sync(const Config *config);

void change_theme(Evas_Object *win, Config *config);

Eina_Bool main_term_popup_exists(const Term *term);
void main_term_focus(Term *term);

Win *main_term_win_get(Term *term);
Evas_Object *main_win_evas_object_get(Win *wn);
Eina_List *main_win_terms_get(Win *wn);
Evas_Object *main_term_evas_object_get(Term *term);
Evas_Object *term_miniview_get(Term *term);
void term_miniview_toggle(Term *term);
void term_miniview_hide(Term *term);

#endif


text:
/*
 *  Document   : base_comp_rating.js
 *  Author     : pixelcave
 *  Description: Custom JS code used in Rating Page
 */

var BaseCompRating = function() {
    // jQuery Raty, for more examples you can check out https://github.com/wbotelhos/raty

    // Init Rating
    var initRating = function(){
        // Set Default options
        jQuery.fn.raty.defaults.starType    = 'i';
        jQuery.fn.raty.defaults.hints       = ['Bad', 'Poor', 'Regular', 'Good', 'Gorgeous'];

        // Init Raty on .js-rating class
        jQuery('.js-rating').each(function(){
            var $ratingEl = jQuery(this);

            $ratingEl.raty({
                score: $ratingEl.data('score') ? $ratingEl.data('score') : 0,
                number: $ratingEl.data('number') ? $ratingEl.data('number') : 5,
                cancel: $ratingEl.data('cancel') ? $ratingEl.data('cancel') : false,
                target: $ratingEl.data('target') ? $ratingEl.data('target') : false,
                targetScore: $ratingEl.data('target-score') ? $ratingEl.data('target-score') : false,
                precision  : $ratingEl.data('precision') ? $ratingEl.data('precision') : false,
                cancelOff: $ratingEl.data('cancel-off') ? $ratingEl.data('cancel-off') : 'fa fa-fw fa-times text-danger',
                cancelOn: $ratingEl.data('cancel-on') ? $ratingEl.data('cancel-on') : 'fa fa-fw fa-times',
                starHalf: $ratingEl.data('star-half') ? $ratingEl.data('star-half') : 'fa fa-fw fa-star-half-o text-warning',
                starOff: $ratingEl.data('star-off') ? $ratingEl.data('star-off') : 'fa fa-fw fa-star text-gray',
                starOn: $ratingEl.data('star-on') ? $ratingEl.data('star-on') : 'fa fa-fw fa-star text-warning',
                click: function(score, evt) {
                    // Here you could add your logic on rating click
                    // console.log('ID: ' + this.id + "\nscore: " + score + "\nevent: " + evt);
                }
            });
        });
    };

    return {
        init: function () {
            // Init all Ratings
            initRating();
        }
    };
}();

// Initialize when page loads
jQuery(function(){ BaseCompRating.init(); });


text:
#ifndef CALL_VIDEO_SEND_STREAM_H_
#define CALL_VIDEO_SEND_STREAM_H_

#include <stdint.h>

#include <map>
#include <string>
#include <vector>

#include "absl/types/optional.h"
#include "api/call/transport.h"
#include "api/crypto/crypto_options.h"
#include "api/frame_transformer_interface.h"
#include "api/rtp_parameters.h"
#include "api/video/video_content_type.h"
#include "api/video/video_frame.h"
#include "api/video/video_sink_interface.h"
#include "api/video/video_source_interface.h"
#include "api/video/video_stream_encoder_settings.h"
#include "api/video_codecs/video_encoder_config.h"
#include "call/rtp_config.h"
#include "common_video/include/quality_limitation_reason.h"
#include "modules/rtp_rtcp/include/report_block_data.h"
#include "modules/rtp_rtcp/include/rtcp_statistics.h"
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"

namespace webrtc {

class FrameEncryptorInterface;

class VideoSendStream {
 public:
  // Multiple StreamStats objects are present if simulcast is used (multiple
  // kMedia streams) or if RTX or FlexFEC is negotiated. Multiple SVC layers, on
  // the other hand, does not cause additional StreamStats.
  struct StreamStats {
    enum class StreamType {
      // A media stream is an RTP stream for audio or video. Retransmissions and
      // FEC is either sent over the same SSRC or negotiated to be sent over
      // separate SSRCs, in which case separate StreamStats objects exist with
      // references to this media stream's SSRC.
      kMedia,
      // RTX streams are streams dedicated to retransmissions. They have a
      // dependency on a single kMedia stream: |referenced_media_ssrc|.
      kRtx,
      // FlexFEC streams are streams dedicated to FlexFEC. They have a
      // dependency on a single kMedia stream: |referenced_media_ssrc|.
      kFlexfec,
    };

    StreamStats();
    ~StreamStats();

    std::string ToString() const;

    StreamType type = StreamType::kMedia;
    // If |type| is kRtx or kFlexfec this value is present. The referenced SSRC
    // is the kMedia stream that this stream is performing retransmissions or
    // FEC for. If |type| is kMedia, this value is null.
    absl::optional<uint32_t> referenced_media_ssrc;
    FrameCounts frame_counts;
    int width = 0;
    int height = 0;
    // TODO(holmer): Move bitrate_bps out to the webrtc::Call layer.
    int total_bitrate_bps = 0;
    int retransmit_bitrate_bps = 0;
    int avg_delay_ms = 0;
    int max_delay_ms = 0;
    uint64_t total_packet_send_delay_ms = 0;
    StreamDataCounters rtp_stats;
    RtcpPacketTypeCounter rtcp_packet_type_counts;
    RtcpStatistics rtcp_stats;
    // A snapshot of the most recent Report Block with additional data of
    // interest to statistics. Used to implement RTCRemoteInboundRtpStreamStats.
    absl::optional<ReportBlockData> report_block_data;
    double encode_frame_rate = 0.0;
    int frames_encoded = 0;
    absl::optional<uint64_t> qp_sum;
    uint64_t total_encode_time_ms = 0;
    uint64_t total_encoded_bytes_target = 0;
    uint32_t huge_frames_sent = 0;
  };

  struct Stats {
    Stats();
    ~Stats();
    std::string ToString(int64_t time_ms) const;
    std::string encoder_implementation_name = "unknown";
    int input_frame_rate = 0;
    int encode_frame_rate = 0;
    int avg_encode_time_ms = 0;
    int encode_usage_percent = 0;
    uint32_t frames_encoded = 0;
    // https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-totalencodetime
    uint64_t total_encode_time_ms = 0;
    // https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-totalencodedbytestarget
    uint64_t total_encoded_bytes_target = 0;
    uint32_t frames_dropped_by_capturer = 0;
    uint32_t frames_dropped_by_encoder_queue = 0;
    uint32_t frames_dropped_by_rate_limiter = 0;
    uint32_t frames_dropped_by_congestion_window = 0;
    uint32_t frames_dropped_by_encoder = 0;
    // Bitrate the encoder is currently configured to use due to bandwidth
    // limitations.
    int target_media_bitrate_bps = 0;
    // Bitrate the encoder is actually producing.
    int media_bitrate_bps = 0;
    bool suspended = false;
    bool bw_limited_resolution = false;
    bool cpu_limited_resolution = false;
    bool bw_limited_framerate = false;
    bool cpu_limited_framerate = false;
    // https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-qualitylimitationreason
    QualityLimitationReason quality_limitation_reason =
        QualityLimitationReason::kNone;
    // https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-qualitylimitationdurations
    std::map<QualityLimitationReason, int64_t> quality_limitation_durations_ms;
    // https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-qualitylimitationresolutionchanges
    uint32_t quality_limitation_resolution_changes = 0;
    // Total number of times resolution as been requested to be changed due to
    // CPU/quality adaptation.
    int number_of_cpu_adapt_changes = 0;
    int number_of_quality_adapt_changes = 0;
    bool has_entered_low_resolution = false;
    std::map<uint32_t, StreamStats> substreams;
    webrtc::VideoContentType content_type =
        webrtc::VideoContentType::UNSPECIFIED;
    uint32_t frames_sent = 0;
    uint32_t huge_frames_sent = 0;
  };

  struct Config {
   public:
    Config() = delete;
    Config(Config&&);
    explicit Config(Transport* send_transport);

    Config& operator=(Config&&);
    Config& operator=(const Config&) = delete;

    ~Config();

    // Mostly used by tests.  Avoid creating copies if you can.
    Config Copy() const { return Config(*this); }

    std::string ToString() const;

    RtpConfig rtp;

    VideoStreamEncoderSettings encoder_settings;

    // Time interval between RTCP report for video
    int rtcp_report_interval_ms = 1000;

    // Transport for outgoing packets.
    Transport* send_transport = nullptr;

    // Expected delay needed by the renderer, i.e. the frame will be delivered
    // this many milliseconds, if possible, earlier than expected render time.
    // Only valid if |local_renderer| is set.
    int render_delay_ms = 0;

    // Target delay in milliseconds. A positive value indicates this stream is
    // used for streaming instead of a real-time call.
    int target_delay_ms = 0;

    // True if the stream should be suspended when the available bitrate fall
    // below the minimum configured bitrate. If this variable is false, the
    // stream may send at a rate higher than the estimated available bitrate.
    bool suspend_below_min_bitrate = false;

    // Enables periodic bandwidth probing in application-limited region.
    bool periodic_alr_bandwidth_probing = false;

    // An optional custom frame encryptor that allows the entire frame to be
    // encrypted in whatever way the caller chooses. This is not required by
    // default.
    rtc::scoped_refptr<webrtc::FrameEncryptorInterface> frame_encryptor;

    // Per PeerConnection cryptography options.
    CryptoOptions crypto_options;

    rtc::scoped_refptr<webrtc::FrameTransformerInterface> frame_transformer;

   private:
    // Access to the copy constructor is private to force use of the Copy()
    // method for those exceptional cases where we do use it.
    Config(const Config&);
  };

  // Updates the sending state for all simulcast layers that the video send
  // stream owns. This can mean updating the activity one or for multiple
  // layers. The ordering of active layers is the order in which the
  // rtp modules are stored in the VideoSendStream.
  // Note: This starts stream activity if it is inactive and one of the layers
  // is active. This stops stream activity if it is active and all layers are
  // inactive.
  virtual void UpdateActiveSimulcastLayers(
      const std::vector<bool> active_layers) = 0;

  // Starts stream activity.
  // When a stream is active, it can receive, process and deliver packets.
  virtual void Start() = 0;
  // Stops stream activity.
  // When a stream is stopped, it can't receive, process or deliver packets.
  virtual void Stop() = 0;

  virtual void SetSource(
      rtc::VideoSourceInterface<webrtc::VideoFrame>* source,
      const DegradationPreference& degradation_preference) = 0;

  // Set which streams to send. Must have at least as many SSRCs as configured
  // in the config. Encoder settings are passed on to the encoder instance along
  // with the VideoStream settings.
  virtual void ReconfigureVideoEncoder(VideoEncoderConfig config) = 0;

  virtual Stats GetStats() = 0;

 protected:
  virtual ~VideoSendStream() {}
};

}  // namespace webrtc

#endif  // CALL_VIDEO_SEND_STREAM_H_


text:
var React = require('react');
var _ = require('underscore');
var Bootstrap = require('react-bootstrap')
    ,Navbar = Bootstrap.Navbar
    ,Nav = Bootstrap.Nav
    ,NavItem = Bootstrap.NavItem
    ,DropdownButton = Bootstrap.DropdownButton
    ,MenuItem = Bootstrap.MenuItem
    ,Modal = Bootstrap.Modal
    ,Button = Bootstrap.Button
    ,Input = Bootstrap.Input
    ;
var moment = require('moment');
var Moment = require('moment');
var Numeral = require('numeral');
var DatePicker = require('react-datepicker');

Numeral.defaultFormat('0,0[.]00');

var CommonModalEventsMixin = require('./../../mixins/CommonModalEventsMixin');

var NewExpenseModal = React.createClass({

  mixins : [CommonModalEventsMixin],

  getInitialState : function () {

    return ({
      ammount : ''
      , new_date : null
    });

  },

  handleClose: function (e) {
    if (_.isFunction(this.props.callback_onclose)) {
      this.props.callback_onclose('atm');
    }
  },

  render: function () {

    return (

        <Modal
          header='Add ATM Cashout'
          bsStyle='primary'
          backdrop={true}
          animation={true}
          onHide={this.handleClose}>

            <Input type='text' ref='ammount' addonBefore='Ammount' placeholder={Numeral(2000.96).format('0,0[.]00')} onChange={this.handleChangeAmmount} value={this.state.ammount} buttonAfter={this.props.currencyDropdown} onFocus={this.handleFocusAmmount} onBlur={this.handleBlurAmmount} />

                Date
                <DatePicker
                  key="date"
                  dateFormat="LL"
                  selected={this.state.new_date}
                  onChange={this.handleNewDateChange}
                  ref = 'date'
                  placeholderText={Moment().format('LL')}
                />

            <Input type='text' ref='account' addonBefore='From' placeholder='TSB' />
            <Input type='text' ref='note' addonBefore='Note' placeholder='Grocery Store' />

            <Button onClick={this.handleClose} >Close</Button>
            <Button onClick={this.handleSave} bsStyle='primary'>Add withdraw</Button>

        </Modal>

    );
  }
});

module.exports = NewExpenseModal;


text:
@interface CCSBaseData : NSObject

@end


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".EmPubLiteActivity" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:text="@string/music_search"
        android:textAppearance="?android:attr/textAppearanceLarge" />

    <EditText
        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/textView1"
        android:layout_marginTop="16dp"
        android:ems="10"
        android:hint="@string/hint" >

        <requestFocus />
    </EditText>

    <Spinner
        android:id="@+id/spinner1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:entries="@array/types"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/editText1" >
    </Spinner>

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignRight="@+id/spinner1"
        android:layout_below="@+id/spinner1"
        android:text="@string/search" />

</RelativeLayout>


text:
/*::
declare module 'exit-on-epipe' {};

declare module 'xlsx' { declare var exports:XLSXModule; };
declare module '../' { declare var exports:XLSXModule; };

declare module 'commander' { declare var exports:any; };
declare module './jszip.js' { declare var exports:any; };
declare module './dist/cpexcel.js' { declare var exports:any; };
declare module 'crypto' { declare var exports:any; };
declare module 'fs' { declare var exports:any; };

type ZIP = any;
*/


text:
@{
    RootModule = 'NanoClusterS2D.schema.psm1';
    ModuleVersion = '1.0';
    GUID = 'd88dce95-f74e-4b68-bf22-ff6df9a17298';
    Author = 'Iain Brighton';
    CompanyName = 'Virtual Engine';
    Copyright = '(c) 2017 Virtual Engine Limited. All rights reserved.';
    Description = 'Virtual Engine Nano Server Storage Spaces Direct (S2D) Cluster DSC composite resource.';
}


text:
Vector* newVector() {
    Vector* vect = malloc(sizeof(Vector));
    vect->capacity = 8;
    vect->objects = malloc(sizeof(Object*) * vect->capacity);
    vect->size = 0;
    return vect;
}

void freeVector(Vector* vect) {
    free(vect->objects);
}

static void checkRange(int index, int size) {
    if (index < 0 || index >= size) {
        error("Out of bounds. index: %d, size: %d", index, size);
    }
}

static void vectorResize(Vector* vect, int capacity) {
    Object** objects = realloc(vect->objects, sizeof(Object*) * capacity);
    if (objects != NULL) {
        vect->objects = objects;
        vect->capacity = capacity;
    } else {
        error("Could not resize array");
    }
}

void vectAdd(Vector* vect, Object* object) {
    if (vect->capacity < vect->size + 1) {
        vectorResize(vect, vect->capacity * 2);
    }
    vect->objects[vect->size] = object;
    vect->size++;
}

Object* vectSet(Vector* vect, Object* object, int index) {
    checkRange(index, vect->size);
    Object* prev = vect->objects[index];
    vect->objects[index] = object;
    return prev;
}

Object* vectGet(Vector* vect, int index) {
    checkRange(index, vect->size);
    return vect->objects[index];
}

Object* vectRemove(Vector* vect, int index) {
    checkRange(index, vect->size);
    Object* removed = vect->objects[index];
    vect->objects[index] = NULL;
    for (int ix = 0; ix < vect->size - 1; ix++) {
        vect->objects[ix] = vect->objects[ix + 1];
        vect->objects[ix + 1] = NULL;
    }
    vect->size--;
    return removed;
}

uint32_t vectSize(Vector* vect) {
    return vect->size;
}

void vectIterate(Vector *vect, void (*iter)(Object*, bool)) {
    for (int ix = 0; ix < vect->size; ix++) {
        iter(vect->objects[ix], ix < vect->size - 1);
    }
}


text:
<?php

namespace Carrooi\ImagesManager\Image;

/**
 *
 * @author David Kudera <kudera.d@gmail.com>
 */
interface IImageFactory
{

	/**
	 * @param string $namespace
	 * @param string $name
	 * @return \Carrooi\ImagesManager\Image\Image
	 */
	public function create($namespace, $name);

}


text:
# Copyright (c) 2009 Cory Ondrejka. All rights reserved.
# See License.txt for licensing details.

require "#{File.dirname(__FILE__)}/../testing_file_support"

describe BalsamiqControlParser do
  it "properly handles icon" do
    data = <<-EOF
            <mockup version="1.0" skin="sketch">
      <controls>
        <control controlID="6" controlTypeID="com.balsamiq.mockups::Icon" x="37" y="12" w="-1" h="-1" zOrder="0" locked="false" isInGroup="-1"/>
        <control controlID="7" controlTypeID="com.balsamiq.mockups::Icon" x="180" y="12" w="-1" h="-1" zOrder="1" locked="false" isInGroup="-1">
          <controlProperties>
            <color>16711680</color>
          </controlProperties>
        </control>
      </controls>
    </mockup>

    EOF
    html = <<-EOF
    <?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" type="text/css" href="reset.css" />
    <title>Balsamiq</title>

    EOF
    css = <<-EOF

    EOF
    js = <<-EOF

    EOF
    filename = "icon"
    TestingFileSupport::test_elements(filename, data, html, css, js, false)
  end

end


text:
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import * as $ from 'jquery';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';

const basePath = location.href.replace(/[^/]*$/, '');
const baseElement = $(`<base href="${basePath}">`);
$('head').append(baseElement);

if (environment.production) {
  enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule).catch(console.error);