text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta property="fb:app_id" content="486603034805006">
    <title>making / learning / work</title>

	<meta name="twitter:title" content="Technology innovation & adult learning">

	<meta name="twitter:site" content="@medialab">
	<meta name="twitter:creator" content="@medialab">

	<meta name="twitter:card" content="summary">
	<meta name="twitter:image" content="http://learn.media.mit.edu/mlw/images/">

	<meta property="og:locale" content="Cambirdge MA USA">
	<meta property="og:type" content="article">
	<meta property="og:title" content="Technology innovation & adult learning">

	<meta property="og:url" content="http://learn.media.mit.edu/">
	<meta property="og:site_name" content="making / learning / work">

    <link rel="canonical" href="http://learn.media.mit.edu/">

    <link href="http://learn.media.mit.edu/mlw/atom.xml" type="application/atom+xml" rel="alternate" title="making / learning / work Atom Feed">
    <link href="http://learn.media.mit.edu/mlw/sitemap.xml" type="application/xml" rel="sitemap" title="Sitemap">
    <link href='http://fonts.googleapis.com/css?family=Roboto:900,300,400' rel='stylesheet' type='text/css'>

    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="cleartype" content="on">

    <link rel="stylesheet" href="http://learn.media.mit.edu/mlw/css/main.css">

    making / learning / work

making / learning / work

Technology innovation & adult learning

Making / Learning / Work was an adult learning innovation project hosted at the MIT Media Lab from September 2014 to May 2016. This site is an archive of the project documentation. The research work will be continued as part of a new Learning Innovation Fellowship at the Media Lab.

In the US, 36 Million adults have low basic literacy and numeracy skills. Many are stuck in low-paying jobs or unemployment. This is a challenge not just for the individuals and families directly affected, but for the US economy as a whole. "Learning" is the most promising pathway towards family-supporting employment and better futures. [Read More]

Current Prototypes

Project Updates

<time datetime="2015-06-02" itemprop="datePublished">June 02, 2015</time>

Read Out Loud Alpha Released!

We have just released an alpha version of Read Out Loud on the Google Play Store!

<time datetime="2015-04-19" itemprop="datePublished">April 19, 2015</time>

Askii as an API

As we built the SMS and mobile webpage learning system discussed in the post, Creating Askii, we found we were most interested the algorithms behind the syst...

<time datetime="2015-04-09" itemprop="datePublished">April 09, 2015</time>

Looking for Libranet Content

After redefining the goals of Libranet we needed to start looking for content!

<time datetime="2015-04-02" itemprop="datePublished">April 02, 2015</time>

The New Libranet

Last May, libraries emerged as a theme from our kick-off Making / Learning / Work Ideashop. Using libraries as spaces for adult learning seemed obvious. They...

<time datetime="2015-03-06" itemprop="datePublished">March 06, 2015</time>

Creating an SMS Learning System with Askii

Askii began first as a mobile application called "XpressMe", which originated from one of the ideas at the IdeaShop in May 2014.

<time datetime="2015-03-05" itemprop="datePublished">March 05, 2015</time>

Testing Read Out Loud in the Classroom

On March 3rd, Srishti and I went to a ESOL school for adult learners in East Boston, Massachusetts, to get the students' feedback on the newest iteration of ...

<time datetime="2015-02-03" itemprop="datePublished">February 03, 2015</time>

Is This The Future of Adult Learning?

Reblogged from the EdSurge article on Making / Learning / Work by Taylor Bennett

<time datetime="2014-10-28" itemprop="datePublished">October 28, 2014</time>

Rough Prototyping Update

Over the past few weeks, we have been working on a new edition of the "storyteller" prototype, which I want to introduce briefly here. Back in September, we ...

<time datetime="2014-10-22" itemprop="datePublished">October 22, 2014</time>

Visit to an ESOL class for parents

Last week, I went to sit in on an intermediate ESOL class for parents at a local elementary school in Boston. I wanted to quickly post my findings from the c...

<time datetime="2014-09-22" itemprop="datePublished">September 22, 2014</time>

Rough Prototyping

In this post, we will focus on "Storyteller", one of the ideas we have been working on to prototype how technology can help adult learners with very basic li...

<time datetime="2014-08-11" itemprop="datePublished">August 11, 2014</time>

Narrowing down the ideas

15 > 5 > 2-3.

<time datetime="2014-08-05" itemprop="datePublished">August 05, 2014</time>

Libranet Initial Concept

Beyond book stacks - Utilizing libraries as bridges for meaningful employment

<time datetime="2014-07-10" itemprop="datePublished">July 10, 2014</time>

Initial Ideas

These ideas were created by participants of the IdeaShop (held at the MIT Media Lab in May 2014). They are currently in rough draft form. We welcome any feed...

<time datetime="2014-06-23" itemprop="datePublished">June 23, 2014</time>

Themes from the IdeaShop

Wall of themes that emerged from the IdeaShop on adult learning on 5/22-5/23

<time datetime="2014-06-19" itemprop="datePublished">June 19, 2014</time>

Connecting Adult Learners

Reblogged from the DML Central blog post by Philipp Schmidt

<time datetime="2014-05-29" itemprop="datePublished">May 29, 2014</time>

Adult Learning Innovations - Kickoff Workshop

On May 22nd and 23rd, adult learning experts from around the country came to the Media Lab to help us brainstorm ideas for how we can use technology to help ...

A project of the Learning Initiative at the MIT Media Lab

	Supported by The Joyce Foundation

	All materials licensed under the Creative Commons Attribution 4.0 license unless otherwise noted.


text:
<?php

namespace Rawebone\Injector;

class RegisterResolver implements ResolverInterface
{
	protected $services = array();

	/**
	 * Returns the service by name.
	 *
	 * @param string $service
	 * @return \Rawebone\Injector\Func
	 * @throws \Rawebone\Injector\ResolutionException
	 */
	public function resolve($service)
	{
		if (!isset($this->services[$service])) {
			throw new ResolutionException("Could not resolve service '$service'");
		}

		return new Func($this->services[$service]);
	}

	/**
	 * Registers a service by name into the resolver.
	 *
	 * @param string $service
	 * @param callable $callable
	 * @throws ResolutionException
	 */
	public function register($service, $callable)
    {
		if (!is_callable($callable)) {
			throw new ResolutionException("Service '$service' cannot be register as it's value is invalid");
		}

		$this->services[$service] = $callable;
    }

	/**
	 * Convenience wrapper over register().
	 *
	 * @param array $services
	 * @see register
	 */
	public function registerMany(array $services)
    {
        foreach ($services as $service => $callable) {
			$this->register($service, $callable);
		}
    }

	/**
	 * Registers an object with the container.
	 *
	 * @param string $service
	 * @param object $object
	 * @see register
	 */
	public function registerObject($service, $object)
    {
		if (!is_object($object)) {
			throw new ResolutionException("Service '$service' cannot be register as it's value is invalid");
		}

        $this->services[$service] = function () use ($object) { return $object; };
    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.raul.rsd.android.popularmovies.data;

import android.content.AsyncQueryHandler;
import android.content.ContentResolver;

import javax.inject.Inject;

public class MoviesAsyncHandler {

    // --------------------------- VALUES ----------------------------

    public static final int UPDATE_TOKEN = 1, DELETE_TOKEN = 3;
    static final int INSERT_TOKEN = 2;

    // ------------------------- CONSTRUCTOR -------------------------

    @Inject
    public MoviesAsyncHandler() { }

    // -------------------------- USE CASES --------------------------

    public MoviesAsyncQueryHandler getHandler(ContentResolver cr) {
        return new MoviesAsyncQueryHandler(cr);
    }

    // ---------------------------- CLASS ----------------------------

    public static class MoviesAsyncQueryHandler extends AsyncQueryHandler {

        @Inject
        MoviesAsyncQueryHandler(ContentResolver cr) {
            super(cr);
        }
    }
}


text:
import java.util.Arrays;

/**
 * Define objetos ElfoVerde.
 *
 * @author CWI Software
 */
public class ElfoVerde extends Elfo
{
    private final String[] ITENS_PERMITIDOS = new String[] {
        "Espada de aço valiriano",
        "Arco e Flecha de vidro"
    };

    public ElfoVerde(String nome) {
        super(nome);
    }

    /**
     * Atira a flecha "à moda verde".
     * Por ser um elfo verde, ganhará o dobro de experiência que um Elfo comum.
     *
     * @param orc Orc que receberá a flechada.
     */
    public void atirarFlecha(Orc orc) {
        super.atirarFlecha(orc);
        this.experiencia++;
    }

    /**
     * Adiciona o item no inventário, desde que o mesmo tenha descrição válida.
     * Atuais descrições válidas: "Espada de aço valiriano", "Arco e Flecha de vidro"
     *
     * @param item ItemDoInventario a ser adicionado
     */
    public void adicionarItem(ItemDoInventario item) {

        boolean descricaoValida = item != null && Arrays.asList(ITENS_PERMITIDOS).contains(item.getDescricao());

        if (descricaoValida) {
            super.adicionarItem(item);
        }

    }

    @Override
    public String toString() {
        return "Elfo Verde: " + super.toString();
    }
}


text:
![Maji Mobile](img/maji-mobile-logo.png)

Maji Mobile is a mobile platform development solution, that allows you to quickly create mobile applications for any platform, using web technologies.
It allows any (Web-)developer to quickly start developing mobile applications for any mobile platform.

Maji Mobile is not a framework on itself; it generates a ready-to-go project that integrates several frameworks and custom scripts to allow building and running on mobile platforms. You can build Maji Mobile Apps for all mobile platforms and you can submit the apps to their respective Stores.

Whether you want to develop for iOS or Android, mobile or tablet, or any of the other mobile platforms, you can use Maji Mobile to develop applications for it.

Your Idea. Our Technology. For Everyone.

## Prerequisites

Before you can use Maji, make sure you have the following:

### General

* Ruby, for the Cucumber specs
* NodeJS, for the build system (`bin/setup` will install this if you've got Homebrew)
* Homebrew (`bin/setup` will use this to hook you up with all of the dependencies, except Ruby)

### Mac OS X

* [Homebrew](http://brew.sh) a Mac OS X package manager

### Linux

* [Nodejs](http://nodejs.org) allows JavaScript to be run Server-side
* [Apache Ant](http://ant.apache.org) is used for building Java Applications
* [PhantomJS](http://phantomjs.org/download.html) is a headless WebKit Browser, scriptable with a JavaScript API

## Getting started

To create a new app execute the following commands in your shell:

```
$ npm install git://github.com/kabisaict/maji.git
$ ./node_modules/.bin/maji new org.example.my-app /desired/path/to/your/project/
$ cd /desired/path/to/your/project/
$ bin/setup
```

Your new Maji app will now be generated at the supplied path.

### bin/maji

  Usage: `bin/maji [options] [command]`

  Commands:

    run [options] <platform>    build and run a native app for the specified platform
    build [options] <platform>  build a native app for the specified platform
    new <package_name> <path>   create a new Maji app

  Options:

    -h, --help     output usage information
    -V, --version  output the version number

## Using Maji Apps

### Starting in the browser

To start your app, `cd` into its directory, execute `make watch` and navigate to http://localhost:9090/ with your browser.

### Running tests

To run test, you have several options:
* To run JavaScript tests run `bin/karma start`. This will start a Karma server with Phantomjs and will continuously watch your Javascript files and run tests on changes.
* To run JavaScript tests once, run `bin/karma start --single-run`.
* To run features specs once, run `bundle exec rspec`.
* To run all tests once, run `bin/ci`.

### Creating builds

To build a static HTML5 app, run `make dist`.

To build a native app, run `bin/maji build <platform>`.

## Build-up

You can find the sources in the `src\` folder.
Compiled javascript is stored in `lib/`.  It is included in this repository so this module can be used straight from Github. Now an application using Maji doesn't have to compile its sources to javascript first.

### Frameworks

A Maji Mobile App comes with several frameworks built-in and configured to work together. It's these combinations of frameworks that makes a Maji Mobile App so easy to develop!

 * [Apache Cordova](https://cordova.apache.org) facilitates the translation from web technologies to mobile platforms.
 * [BackboneJS](http://backbonejs.org) our JavaScript MV* framework
 * [MarionetteJS](http://marionettejs.com) Marionette simplifies Backbone Views
 * [FastClick](http://ftlabs.github.io/fastclick/) disable the delay between click and the action on iOS
 * [jQuery](http://jquery.com) JavaScript library for working with the DOM
 * [Browserify](http://browserify.org) is a JavaScript module system that supports CommonJS syntax
 * [BugSnagJS](https://github.com/bugsnag/bugsnag-js) JavaScript client for [BugSnag](http://bugsnag.com/) exception tracker
 * [Karma](http://karma-runner.github.io/) is a JavaScript test runner
 * [MochaJS](http://mochajs.org) a JavaScript testing framework that supports a BDD style of writing tests
 * [Chai](http://chaijs.com) is an assertion library that enables a BDD style of developing

### Documentation

Here are some links to documentation you might need:

 * [Backbone](http://backbonejs.org)
 * [Marionette](http://marionettejs.com/docs/v1.8.7/)
 * [Mocha](http://mochajs.org/#assertions)
 * [Chai Expect/Should](http://chaijs.com/api/bdd/)
 * [Apache Cordova](http://cordova.apache.org/docs/en/4.0.0/)

There is also a [Maji Mobile FAQ](docs/faq.md).

## License

Maji Mobile is released under the [MIT License](LICENSE).


text:
package org.apache.causeway.extensions.secman.applib.user.dom;

import java.util.Collection;
import java.util.Collections;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Consumer;

import javax.inject.Inject;
import javax.inject.Provider;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.lang.Nullable;
import org.springframework.security.crypto.password.PasswordEncoder;

import org.apache.causeway.applib.query.Query;
import org.apache.causeway.applib.services.eventbus.EventBusService;
import org.apache.causeway.applib.services.factory.FactoryService;
import org.apache.causeway.applib.services.queryresultscache.QueryResultsCache;
import org.apache.causeway.applib.services.repository.RepositoryService;
import org.apache.causeway.commons.internal.base._Casts;
import org.apache.causeway.commons.internal.base._NullSafe;
import org.apache.causeway.commons.internal.collections._Sets;
import org.apache.causeway.core.config.CausewayConfiguration;
import org.apache.causeway.extensions.secman.applib.role.dom.ApplicationRole;
import org.apache.causeway.extensions.secman.applib.tenancy.dom.ApplicationTenancy;
import org.apache.causeway.extensions.secman.applib.user.dom.mixins.ApplicationUser_lock;
import org.apache.causeway.extensions.secman.applib.user.dom.mixins.ApplicationUser_unlock;
import org.apache.causeway.extensions.secman.applib.user.events.UserCreatedEvent;
import org.apache.causeway.extensions.secman.applib.util.RegexReplacer;

import lombok.NonNull;
import lombok.val;

/**
 *
 * @since 2.0 {@index}
 */
public class ApplicationUserRepositoryAbstract
implements ApplicationUserRepository {

    @Inject private FactoryService factoryService;
    @Inject private RepositoryService repository;
	@Inject protected CausewayConfiguration config;
    @Inject private EventBusService eventBusService;
    @Inject private RegexReplacer regexReplacer;
    @Inject private Provider<QueryResultsCache> queryResultsCacheProvider;

    // empty if no candidate is available
    @Autowired(required = false) @Qualifier("secman") PasswordEncoder passwordEncoder;

    private final Class applicationUserClass;

    protected ApplicationUserRepositoryAbstract(final Class applicationUserClass) {
        this.applicationUserClass = applicationUserClass;
    }

    @Override
    public ApplicationUser newApplicationUser() {
        return factoryService.detachedEntity(this.applicationUserClass);
    }

    // -- findOrCreateUserByUsername (programmatic)

    /**
     * Uses the {@link QueryResultsCache} in order to support
     * multiple lookups from org.apache.causeway.extensions.secman.jdo.app.user.UserPermissionViewModel.
     *

     *

     * If the user does not exist, it will be automatically created.
     *

     */
    @Override
    public ApplicationUser findOrCreateUserByUsername(
            final String username) {
        // slightly unusual to cache a function that modifies state, but safe because this is idempotent
        return queryResultsCacheProvider.get().execute(()->
            findByUsername(username).orElseGet(()->newDelegateUser(username, null)),
            ApplicationUserRepositoryAbstract.class, "findOrCreateUserByUsername", username);
    }

    // -- findByUsername

    public Optional<ApplicationUser> findByUsernameCached(final String username) {
        return queryResultsCacheProvider.get().execute(this::findByUsername,
                ApplicationUserRepositoryAbstract.class, "findByUsernameCached", username);
    }

    @Override
    public Optional<ApplicationUser> findByUsername(final String username) {
        return _Casts.uncheckedCast(
                repository.uniqueMatch(Query.named(this.applicationUserClass, ApplicationUser.Nq.FIND_BY_USERNAME)
                .withParameter("username", username))
        );
    }

    // -- findByEmailAddress (programmatic)

    public Optional<ApplicationUser> findByEmailAddressCached(final String emailAddress) {
        return queryResultsCacheProvider.get().execute(this::findByEmailAddress,
                ApplicationUserRepositoryAbstract.class, "findByEmailAddressCached", emailAddress);
    }

    @Override
    public Optional<ApplicationUser> findByEmailAddress(final String emailAddress) {
        return _Casts.uncheckedCast(
                repository.uniqueMatch(Query.named(this.applicationUserClass, ApplicationUser.Nq.FIND_BY_EMAIL_ADDRESS)
                .withParameter("emailAddress", emailAddress))
        );
    }

    // -- findByName

    @Override
    public Collection<ApplicationUser> find(final @Nullable String _search) {
        val regex = regexReplacer.asRegex(_search);
        return repository.allMatches(Query.named(this.applicationUserClass, ApplicationUser.Nq.FIND)
                .withParameter("regex", regex))
                .stream()
                .collect(_Sets.toUnmodifiableSorted());
    }

    // -- allUsers

    @Override
    public Collection<ApplicationUser> findByAtPath(final String atPath) {
        return repository.allMatches(Query.named(this.applicationUserClass, ApplicationUser.Nq.FIND_BY_ATPATH)
                .withParameter("atPath", atPath))
                .stream()
                .collect(_Sets.toUnmodifiableSorted());
    }

    @Override
    public Collection<ApplicationUser> findByRole(final ApplicationRole role) {

        return _NullSafe.stream(role.getUsers())
                .collect(_Sets.toUnmodifiableSorted());
    }

    @Override
    public Collection<ApplicationUser> findByTenancy(
            final @NonNull ApplicationTenancy genericTenancy) {
        return findByAtPath(genericTenancy.getPath())
                .stream()
                .collect(_Sets.toUnmodifiableSorted());
    }

    // -- allUsers

    @Override
    public Collection<ApplicationUser> allUsers() {
        return repository.allInstances(this.applicationUserClass)
                .stream()
                .collect(_Sets.toUnmodifiableSorted());
    }

    @Override
    public Collection<ApplicationUser> findMatching(final String search) {
        if (search != null && search.length() > 0) {
            return find(search);
        }
        return Collections.emptySortedSet();
    }

    // -- UPDATE USER STATE

    @Override
    public void enable(final ApplicationUser user) {
        if(user.getStatus() != ApplicationUserStatus.UNLOCKED) {
             factoryService.mixin(ApplicationUser_unlock.class, user)
             .act();
        }
    }

    @Override
    public void disable(final ApplicationUser user) {
        if(user.getStatus() != ApplicationUserStatus.LOCKED) {
            factoryService.mixin(ApplicationUser_lock.class, user)
            .act();
        }
    }

    @Override
    public boolean isAdminUser(final ApplicationUser user) {
        return Objects.equals(
                config.getExtensions().getSecman().getSeed().getAdmin().getUserName(),
                user.getName());
    }

    @Override
    public ApplicationUser newUser(
            @NonNull final String username,
            @Nullable final AccountType accountType,
            final Consumer<ApplicationUser> beforePersist) {

        val user = newApplicationUser();
        user.setUsername(username);
        user.setAccountType(accountType);
        beforePersist.accept(user);
        if(user.getAccountType().equals(AccountType.LOCAL)) {
        	// keep null when is set for status in accept() call above
        } else {
			user.setStatus(ApplicationUserStatus.LOCKED);
        }
        repository.persistAndFlush(user);
        eventBusService.post(UserCreatedEvent.of(user));
        return user;
    }

    @Override
    public boolean updatePassword(
            final ApplicationUser user,
            final String password) {
        // in case called programmatically
        if(!isPasswordFeatureEnabled(user)) {
            return false;
        }
        user.setEncryptedPassword(passwordEncoder.encode(password));
        repository.persistAndFlush(user);
        return true;
    }

    @Override
    public boolean isPasswordFeatureEnabled(final ApplicationUser user) {
        return user.isLocalAccount()
                && passwordEncoder != null;
    }

}


text:
package net.runelite.asm.attributes.code.instructions;

import net.runelite.asm.Type;
import net.runelite.asm.attributes.code.Instruction;
import net.runelite.asm.attributes.code.InstructionType;
import net.runelite.asm.attributes.code.Instructions;
import net.runelite.asm.attributes.code.instruction.types.DivisionInstruction;
import net.runelite.asm.execution.Frame;
import net.runelite.asm.execution.InstructionContext;
import net.runelite.asm.execution.Stack;
import net.runelite.asm.execution.StackContext;
import net.runelite.asm.execution.Value;

public class LDiv extends Instruction implements DivisionInstruction
{
	public LDiv(Instructions instructions, InstructionType type)
	{
		super(instructions, type);
	}

	@Override
	public InstructionContext execute(Frame frame)
	{
		InstructionContext ins = new InstructionContext(this, frame);
		Stack stack = frame.getStack();

		StackContext two = stack.pop();
		StackContext one = stack.pop();

		ins.pop(two, one);

		Value result = Value.UNKNOWN;
		if (!two.getValue().isUnknownOrNull() && !one.getValue().isUnknownOrNull())
		{
			long l2 = (long) two.getValue().getValue(),
				l1 = (long) one.getValue().getValue();

			if (l2 != 0L)
				result = new Value(l1 / l2);
		}

		StackContext ctx = new StackContext(ins, Type.LONG, result);
		stack.push(ctx);

		ins.push(ctx);

		return ins;
	}
}


text:
TryRestartHostedAspnetApp
=========================

This package / library helps auto-restart a asp.net application hosted in iis after a shutdown. Just in 2 steps: adding a library and setting a couple of config settings.

Configuration soon...


text:
class CommitFilter::Commit::DiffsController < CommitFilter::ApplicationController
  def new
    repository = Grit::Repo.new(params[:repository_path])

    diff = repository.diff(
      repository.commit(params[:rev_to]), repository.commit(params[:rev]), params[:path]
    )

    unless diff.length == 1
      raise NotImplementedError.new(
        t('commit_filter.diff.errors.diff_length_not_one', length: diff.length)
      )
    end

    render text: DiffToHtml::GitConverter.new.get_single_file_diff_body(diff.first.diff)
  rescue Exception => e
    if Rails.env.development?
      raise e.class.name + ': ' + e.message + ' ... ' + e.backtrace.join("\n")
    else
      logger.error e.class.name + ': ' + e.message + ' ... ' + e.backtrace.join("\n")
      render text: t('commit_filter.general.errors.internal_server_error')
    end
  end
end


text:
package org.lorislab.armonitor.web.rs.mapper;

import java.util.Set;
import org.kohsuke.MetaInfServices;
import org.lorislab.armonitor.mapper.MapperService;
import org.lorislab.armonitor.store.model.StoreAgent;

/**
 * The agent name mapper.
 *
 * @author Andrej Petras
 */
@MetaInfServices
public class AgentNameMapper implements MapperService<StoreAgent, String> {

    /**
     * {@inheritDoc}
     */
    @Override
    public String map(StoreAgent data, Set<String> profiles) {
        return data.getName();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public StoreAgent update(StoreAgent entity, String data, Set<String> profiles) {
        return entity;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public StoreAgent create(String data, Set<String> profiles) {
        return null;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String create(Set<String> profiles) {
        return null;
    }

}


text:
#pragma once

namespace ArduinoJson {
namespace TypeTraits {

// A meta-function that returns true if T is a reference
template <typename T>
struct IsReference {
  static const bool value = false;
};

template <typename T>
struct IsReference<T&> {
  static const bool value = true;
};
}
}


text:
import 'vue2';
import BasicWithScss from './BasicWithScss.vue';

new Vue({
    components: {
        BasicWithScss
    }
}).$mount('#app');


text:
layout: site
permalink: oslo

location: Oslo

dates: 1 February - 3 February, 2017

splashImage: http://www.uio.no/om/designmanual/images/0-0-forord.jpg

map: sites/oslo.geojson

accommodation: To be determined, Blindern Campus.

about: The university of Oslo is proud to be hosting ResBaz for the first time in 2017!

The Research Bazaar is a (free-of-charge) 3-day intensive festival and conference where researchers come together to up-skill in next generation digital research tools and scholarship. In the spirit of a marketplace or bazaar, ResBaz is a highly participatory event where researchers from many different disciplines can learn, share knowledge and skills, and have fun!

Who should attend? Researchers at ALL levels from ALL disciplines. PhD and research Masters students are especially encouraged to apply. Research technologists who support researchers to do their job should also come along!

ResBaz is particularly aimed at those new to digital research tools.

schedule: We will provide a mix of Software/Library Carpentry workshops and other events. The full schedule is here.
days:
 - day: Wednesday, 1 February
   sessions:
    - title: Theme 'Make'
    - title: Workshop - Software Carpentry (day 1)
    - title: Workshop - Data Management planning
    - title: Workshop - Zotero
 - day: Thursday, 2 February
   sessions:
    - title: Theme 'Share and Collaborate'
    - title: Workshop - Software Carpentry (day 2)
    - title: Workshop - Library Carpentry (day 1)
    - title: Miniseminar - "Digital tools for managing and sharing research data"
    - title: Stands - Research related service providers
    - title: Workshop - Jupyter Notebook
 - day: Friday, 3 February
   sessions:
    - title: Theme 'Women in Data Science'
    - title: Workshop - Library Carpentry (day 2)
    - title: Workshop - Big Data with pyspark
    - title: Workshop - LaTex
    - title: Presentations from Oslo Women in Data Science
    - title: Live streaming of the 'Women in Data Science' conference (evening)

sponsors:
 - name: 'University of Oslo Science Library'
   img: UiO_Seal_A_ENG.png
---

                    About

                    Schedule

                    Register

                    Speakers

                    {{page.location}}

                    {{page.dates}}

About

{{page.about}}

Schedule

{{page.schedule}}

            {% for d in page.days %}

{{ d.day }}

                        {% for session in d.sessions %}
                                {{ session.title }}
                        {% endfor %}

            {% endfor %}

Venue

Come along

Registration through the individual workshop's websites, see the full schedule.

Our Sponsors

Many thanks to our sponsors for helping to bring the Research Bazaar to {{page.location}}.

              {% for sponsor in page.sponsors %}

{{ sponsor.name }}

              {% endfor %}


text:
/* eslint-disable flowtype/require-valid-file-annotation */

import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from 'material-ui/styles';
import Paper from 'material-ui/Paper';
import Tabs, { Tab } from 'material-ui/Tabs';

const styles = theme => ({
  root: {
    flexGrow: 1,
    marginTop: theme.spacing.unit * 3,
  },
});

class CenteredTabs extends React.Component {
  state = {
    value: 0,
  };

  handleChange = (event, value) => {
    this.setState({ value });
  };

  render() {
    const { classes } = this.props;

    return (
      <Paper className={classes.root}>
        <Tabs
          value={this.state.value}
          onChange={this.handleChange}
          indicatorColor="primary"
          textColor="primary"
          centered
        >
          <Tab label="Item One" />
          <Tab label="Item Two" />
          <Tab label="Item Three" />
        </Tabs>
      </Paper>
    );
  }
}

CenteredTabs.propTypes = {
  classes: PropTypes.object.isRequired,
};

export default withStyles(styles)(CenteredTabs);


text:
/**
 *
 * <p>
 * This package provides optimization algorithms that don't require derivatives.
 * </p>
 *
 */
package org.apache.commons.math3.optimization.direct;


text:
/* $Id: maxlength.js,v 1.1.6.6.2.14 2011/02/16 11:09:13 aronnovak Exp $ */

Drupal.maxLength_limit = function (field) {

  // Build maxlength values and settings
  var id = $(field).attr('id');
  // Skip form elements that do not exist. This sometimes occurs with more
  // complex multi step form building modules like pageroute.
  if (id == undefined) {
    return;
  }
  var limit = Drupal.settings.maxlength[id];
  var maxlength = $('#maxlength-' + id.substr(5));
  maxlength.show_count = false;
  maxlength.span_remaining_count = maxlength.find('span.maxlength-counter-remaining');
  maxlength.find('span.maxlength-count', function() {
    maxlength.show_count = true;
    maxlength.span_count = maxlength.find('span.maxlength-count');
  });

  // calculate the remaining count of chars
  var length = $(field).val().length;
  var remainingCount = limit - length;

  // if there is not remaining char, we clear additional content
  if (remainingCount < 0) {
    $(field).val($(field).val().substr(0, limit));
    remainingCount = 0;
  }

  // Update the remaing chars text.
  maxlength.span_remaining_count.html(remainingCount.toString());
  // And the current count.
  if (maxlength.show_count) {
    maxlength.span_count.html(length.toString());
  }
}

Drupal.behaviors.maxlength = function (context) {
  // Get all the settings, and save the limits in the fields.
  var element = {};
  for (var id in Drupal.settings.maxlength) {

    element = $("#"+ id);

    if (element.length) {
      // Update the count at the page load.
      Drupal.maxLength_limit(element);

      // Setup events
      element.load(function() {
        Drupal.maxLength_limit(this);
      });
      element.keyup(function() {
        Drupal.maxLength_limit(this);
      });
      element.change(function() {
        Drupal.maxLength_limit(this);
      });
    }
  }
}


text:
'use strict';
angular.module('application.directives')
  .directive('ngCompileHtml', ['$compile', function ($compile) {
    return {
      restrict: 'A',
      link: function (scope, element, attrs) {
        scope.$watch(
          attrs.ngCompileHtml,
          function (newValue) {
            element.html(newValue);
            $compile(element.contents())(scope);
          }
        );
      }
    };
  }]);


text:
package consensus

import (
	"github.com/NebulousLabs/Sia/build"
	"github.com/NebulousLabs/Sia/modules"
)

// threadedSendUpdates sends updates to a specific subscriber as they become
// available. One thread is needed per subscriber. A separate function was
// needed due to race conditions; subscribers must receive updates in the
// correct order. Furthermore, a deadlocked subscriber should not interfere
// with consensus; updates cannot make blocking calls from any thread that is
// holding a lock on consensus. The result is a construction where all updates
// are added to a list of updates in the consensus set while the consensus set
// is locked. Then, a separate thread for each subscriber will be notified (via
// the update chan) that there are new updates. The thread will lock the
// consensus set for long enough to get the updates, and then will unlock the
// consensus set while it makes a blocking call to the subscriber. If the
// subscriber deadlocks or has problems, the thread will stall indefinitely,
// but the rest of consensus will not be disrupted.
func (s *State) threadedSendUpdates(update chan struct{}, subscriber modules.ConsensusSetSubscriber) {
	i := 0
	for {
		id := s.mu.RLock()
		updateCount := len(s.consensusChanges)
		s.mu.RUnlock(id)
		for i < updateCount {
			// Get the set of blocks that changed since the previous update.
			id := s.mu.RLock()
			cc := s.consensusChanges[i]
			s.mu.RUnlock(id)

			// Update the subscriber with the changes.
			subscriber.ReceiveConsensusSetUpdate(cc)
			i++
		}

		// Wait until there has been another update.
		<-update
	}
}

// updateSubscribers will inform all subscribers of the new update to the
// consensus set.
func (s *State) updateSubscribers(revertedNodes []*blockNode, appliedNodes []*blockNode) {
	// Sanity check - len(appliedNodes) should never be 0.
	if build.DEBUG {
		if len(appliedNodes) == 0 {
			panic("cannot have len(appliedNodes) = 0 in consensus set - blockchain must always get heavier")
		}
	}

	// Take the nodes and condense them into a consensusChange object.
	var cc modules.ConsensusChange
	for _, rn := range revertedNodes {
		// Because the direction is 'revert', the order of the diffs needs to
		// be flipped and the direction of the diffs also needs to be flipped.
		cc.RevertedBlocks = append(cc.RevertedBlocks, rn.block)
		for i := len(rn.siacoinOutputDiffs) - 1; i >= 0; i-- {
			scod := rn.siacoinOutputDiffs[i]
			scod.Direction = !scod.Direction
			cc.SiacoinOutputDiffs = append(cc.SiacoinOutputDiffs, scod)
		}
		for i := len(rn.fileContractDiffs) - 1; i >= 0; i-- {
			fcd := rn.fileContractDiffs[i]
			fcd.Direction = !fcd.Direction
			cc.FileContractDiffs = append(cc.FileContractDiffs, fcd)
		}
		for i := len(rn.siafundOutputDiffs) - 1; i >= 0; i-- {
			sfod := rn.siafundOutputDiffs[i]
			sfod.Direction = !sfod.Direction
			cc.SiafundOutputDiffs = append(cc.SiafundOutputDiffs, sfod)
		}
	}
	for _, an := range appliedNodes {
		cc.AppliedBlocks = append(cc.AppliedBlocks, an.block)
		for _, scod := range an.siacoinOutputDiffs {
			cc.SiacoinOutputDiffs = append(cc.SiacoinOutputDiffs, scod)
		}
		for _, fcd := range an.fileContractDiffs {
			cc.FileContractDiffs = append(cc.FileContractDiffs, fcd)
		}
		for _, sfod := range an.siafundOutputDiffs {
			cc.SiafundOutputDiffs = append(cc.SiafundOutputDiffs, sfod)
		}
	}
	// Handle the siafund pool diff - handling depends on whether there are
	// reverted nodes.
	if len(revertedNodes) != 0 {
		cc.SiafundPoolDiff.Previous = revertedNodes[0].siafundPoolDiff.Adjusted
	} else {
		cc.SiafundPoolDiff.Previous = appliedNodes[0].siafundPoolDiff.Previous
	}
	// Add the changes to the change set.
	s.consensusChanges = append(s.consensusChanges, cc)

	// Notify each update channel that a new update is ready.
	for _, subscriber := range s.subscriptions {
		// If the channel is already full, don't block.
		select {
		case subscriber <- struct{}{}:
		default:
		}
	}
}

// ConsensusSetNotify returns a channel that will be sent an empty struct every
// time the consensus set changes.
func (s *State) ConsensusSetNotify() <-chan struct{} {
	id := s.mu.Lock()
	c := make(chan struct{}, modules.NotifyBuffer)
	s.subscriptions = append(s.subscriptions, c)
	s.mu.Unlock(id)
	return c
}

// ConsensusSetSubscribe accepts a new subscriber who will receive a call to
// ReceiveConsensusSetUpdate every time there is a change in the consensus set.
func (s *State) ConsensusSetSubscribe(subscriber modules.ConsensusSetSubscriber) {
	c := make(chan struct{}, 1)
	id := s.mu.Lock()
	s.subscriptions = append(s.subscriptions, c)
	s.mu.Unlock(id)
	go s.threadedSendUpdates(c, subscriber)
}


text:
"""
chapter4.py
==========

Models from Chapter 4 of [G&L 2012].

- Model PC = Model with Portfolio Choice

Note that if using the book initial conditions, not all variables are being set at
present. This will affect some stock variable accounting.

[G&L 2012] "Monetary Economics: An Integrated Approach to credit, Money, Income, Production
and Wealth; Second Edition", by Wynne Godley and Marc Lavoie, Palgrave Macmillan, 2012.
ISBN 978-0-230-30184-9

Copyright 2017 Brian Romanchuk

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

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

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

from sfc_models.gl_book import GL_book_model
from sfc_models.sector_definitions import *

class PC(GL_book_model):
    """
    Implements Model PC from Chapter 4 of G&L. PC = "Portfolio Choice."

    """

    def build_model(self):
        country = self.Country
        tre = Treasury(country, 'TRE', 'Treasury')
        cb = CentralBank(country, 'CB', 'Central Bank')
        cb.Treasury = tre
        hh = Household(country, 'HH', 'Household')
        hh.AlphaIncome = 0.6
        hh.AlphaFin = 0.4
        # A literally non-profit business sector
        bus = FixedMarginBusiness(country, 'BUS', 'Business Sector')
        # Create the linkages between sectors - tax flow, markets - labour ('LAB'), goods ('GOOD')
        tax = TaxFlow(country, 'TF', 'TaxFlow', taxrate=.2, taxes_paid_to='TRE')
        labour = Market(country, 'LAB', 'Labour market')
        goods = Market(country, 'GOOD', 'Goods market')
        mm = MoneyMarket(country, issuer_short_code='CB')
        dep = DepositMarket(country, issuer_short_code='TRE')
        # Create the demand for deposits.  ('MON' is the residual asset.)
        hh.AddVariable('L0', 'lambda_0: share of bills in wealth', '0.635')
        hh.AddVariable('L1', 'lambda_1: parameter related to interest rate', '5.')
        hh.AddVariable('L2', 'lambda_2: parameter related to disposable income', '.01')
        # Generate the equation. Need to get the name of the interest rate variable
        r = dep.GetVariableName('r')
        # The format() call will replace '{0}' with the contents of the 'r' variable.
        eqn = 'L0 + L1 * {0} - L2 * (AfterTax/F)'.format(r)
        hh.GenerateAssetWeighting({'DEP': eqn}, 'MON')
        # Add a decorative equation: Government Fiscal Balance
        # = Primary Balance - Interest expense + Central Bank Dividend (= interest
        # received by the central bank).
        tre.AddVariable('FISCBAL', 'Fiscal Balance', 'PRIM_BAL - INTDEP + CB__INTDEP')

        if self.UseBookExogenous:
            # Need to set the exogenous variable - Government demand for Goods ("G" in economist symbology)
            tre.SetExogenous('DEM_GOOD', '[20.,] * 105')
            dep.SetExogenous('r', '[.025,]*10 + [.035,]*105')
            # NOTE:
            # Initial conditions are only partial; there may be issues with some
            # variables.
            self.Model.AddInitialCondition('HH', 'AfterTax', 86.486)
            self.Model.AddInitialCondition('HH', 'F', 86.486)
            self.Model.AddInitialCondition('TRE', 'F', -86.486)
            self.Model.AddInitialCondition('HH', 'DEM_DEP', 64.865)
            self.Model.AddGlobalEquation('t', 'decorated time axis', '1950. + k')
        return self.Model

    def expected_output(self):
        """
        Expected output for the model (using default input).
        Based on EViews output using code from Gennaro Zezza (from sfcmodels.net)

        NOTE: A spreadsheet at sfcmodels.net gives different output; income is changing during the
        same period as the rate change.

        We ignore value at t=0
        :return: list
        """
        out = [
            ('t', [None, 1951., 1952., 1953., ]),
            ('TRE__DEM_GOOD', [None, 20., 20., 20., 20.]),  # G
            ('DEP__r', [0.025, ] * 10 + [.035] * 5),
            ('HH__WGT_DEP', [None, 0.75, 0.75, 0.75, 0.75, 0.75, 0.75, 0.75, 0.75, 0.75, 0.80, 0.80, 0.80, 0.80, 0.80,
                            0.80, 0.80]),  # Weight of deposits (bills)
            ('HH__AfterTax', [None, 86.49, 86.49, 86.49, 86.49, 86.49, 86.49, 86.49, 86.49, 86.49, 86.49, 87.72,
                             88.04, 88.32, 88.56, 88.77, 88.95, 89.11]),  # YD
            ('TRE__T', [None, 21.62, 21.62, 21.62, 21.62, 21.62, 21.62, 21.62, 21.62, 21.62, 21.62, 21.93, 22.01, 22.08,
                       22.14, 22.19, 22.24, 22.28]),  # T
            ('GOOD__SUP_GOOD', [None, 106.49, 106.49, 106.49, 106.49, 106.49, 106.49, 106.49, 106.49, 106.49, 106.49,
                               107.22, 107.62, 107.95, 108.25, 108.50, 108.71, 108.90, 109.06, 109.20, 109.33]),  # Y
            ('HH__DEM_MON', [None, 21.62, 21.62, 21.62, 21.62, 21.62, 21.62, 21.62, 21.62, 21.62, 17.30, 17.40, 17.49,
                            17.56, 17.62, 17.68, 17.72, 17.76, 17.80]),  # high-powered money (H)
        ]
        return out


text:
#pragma once
#include <aws/ec2/EC2_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
#include <aws/core/utils/DateTime.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Xml
{
  class XmlNode;
} // namespace Xml
} // namespace Utils
namespace EC2
{
namespace Model
{

  /**
   *
Describes the time period for a Scheduled Instance to start its first
   * schedule.

See Also:
   AWS
   * API Reference

   */
  class AWS_EC2_API SlotStartTimeRangeRequest
  {
  public:
    SlotStartTimeRangeRequest();
    SlotStartTimeRangeRequest(const Aws::Utils::Xml::XmlNode& xmlNode);
    SlotStartTimeRangeRequest& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);

    void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
    void OutputToStream(Aws::OStream& oStream, const char* location) const;

    /**
     *
The earliest date and time, in UTC, for the Scheduled Instance to start.

     */
    inline const Aws::Utils::DateTime& GetEarliestTime() const{ return m_earliestTime; }

    /**
     *
The earliest date and time, in UTC, for the Scheduled Instance to start.

     */
    inline bool EarliestTimeHasBeenSet() const { return m_earliestTimeHasBeenSet; }

    /**
     *
The earliest date and time, in UTC, for the Scheduled Instance to start.

     */
    inline void SetEarliestTime(const Aws::Utils::DateTime& value) { m_earliestTimeHasBeenSet = true; m_earliestTime = value; }

    /**
     *
The earliest date and time, in UTC, for the Scheduled Instance to start.

     */
    inline void SetEarliestTime(Aws::Utils::DateTime&& value) { m_earliestTimeHasBeenSet = true; m_earliestTime = std::move(value); }

    /**
     *
The earliest date and time, in UTC, for the Scheduled Instance to start.

     */
    inline SlotStartTimeRangeRequest& WithEarliestTime(const Aws::Utils::DateTime& value) { SetEarliestTime(value); return *this;}

    /**
     *
The earliest date and time, in UTC, for the Scheduled Instance to start.

     */
    inline SlotStartTimeRangeRequest& WithEarliestTime(Aws::Utils::DateTime&& value) { SetEarliestTime(std::move(value)); return *this;}

    /**
     *
The latest date and time, in UTC, for the Scheduled Instance to start.

     */
    inline const Aws::Utils::DateTime& GetLatestTime() const{ return m_latestTime; }

    /**
     *
The latest date and time, in UTC, for the Scheduled Instance to start.

     */
    inline bool LatestTimeHasBeenSet() const { return m_latestTimeHasBeenSet; }

    /**
     *
The latest date and time, in UTC, for the Scheduled Instance to start.

     */
    inline void SetLatestTime(const Aws::Utils::DateTime& value) { m_latestTimeHasBeenSet = true; m_latestTime = value; }

    /**
     *
The latest date and time, in UTC, for the Scheduled Instance to start.

     */
    inline void SetLatestTime(Aws::Utils::DateTime&& value) { m_latestTimeHasBeenSet = true; m_latestTime = std::move(value); }

    /**
     *
The latest date and time, in UTC, for the Scheduled Instance to start.

     */
    inline SlotStartTimeRangeRequest& WithLatestTime(const Aws::Utils::DateTime& value) { SetLatestTime(value); return *this;}

    /**
     *
The latest date and time, in UTC, for the Scheduled Instance to start.

     */
    inline SlotStartTimeRangeRequest& WithLatestTime(Aws::Utils::DateTime&& value) { SetLatestTime(std::move(value)); return *this;}

  private:

    Aws::Utils::DateTime m_earliestTime;
    bool m_earliestTimeHasBeenSet;

    Aws::Utils::DateTime m_latestTime;
    bool m_latestTimeHasBeenSet;
  };

} // namespace Model
} // namespace EC2
} // namespace Aws


text:
package org.mvel2.sh.command.basic;

import org.mvel2.MVEL;
import org.mvel2.sh.Command;
import org.mvel2.sh.ShellSession;

public class PushContext implements Command {
  public Object execute(ShellSession session, String[] args) {
    session.setCtxObject(MVEL.eval(args[0], session.getCtxObject(), session.getVariables()));
    return "Changed Context";
  }

  public String getDescription() {
    return null;
  }

  public String getHelp() {
    return null;
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"

	>
<channel>
	<title>
	Comments on: Dive into UX	</title>
	<atom:link href="./index.html" rel="self" type="application/rss+xml" />
	<link>./../index.html</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Wed, 30 Sep 2015 13:00:50 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.3.1</generator>
</channel>
</rss>


text:
fabricator
==========

A Symfony project created on October 16, 2016, 5:18 pm.


text:
var theResource,
	totalRequests = 0,
	utils = require( "../../assert-to-console" ),
	device = require( "../../../index" )(),
	uuid = process.argv[ 2 ];

console.log( JSON.stringify( { assertionCount: 6 } ) );

function resourceOnRequest( request ) {
	totalRequests++;
	utils.assert( "strictEqual", request.type, "retrieve", "Server: Request is of type retrieve" );
	if ( request.type === "retrieve" ) {
		request.sendResponse( request.target ).then(
			function() {
				utils.assert( "ok", true, "Server: Successfully responded to retrieve request" );
			},
			function( error ) {
				utils.die( "Server: Failed to send response with error " + error + " and result " +
					error.result );
			} );
	}
}

device.configure( {
	role: "server",
	info: {
		uuid: uuid,
		name: "api-retrieval-" + uuid,
		manufacturerName: "Intel"
	}
} ).then(
	function() {
		utils.assert( "ok", true, "Server: device.configure() successful" );

		device.registerResource( {
			id: { path: "/a/" + uuid },
			deviceId: uuid,
			resourceTypes: [ "core.light" ],
			interfaces: [ "oic.if.baseline" ],
			discoverable: true,
			properties: {
				"How many angels can dance on the head of a pin?": "As many as wanting."
			}
		} ).then(
			function( resource ) {
				theResource = resource;
				utils.assert( "ok", true, "Server: device.registerResource() successful" );
				device.addEventListener( "request", resourceOnRequest );

				// Signal to the test suite that we're ready for the client
				console.log( JSON.stringify( { ready: true } ) );
			},
			function( error ) {
				utils.die( "Server: device.registerResource() failed with: " + error +
					" and result " + error.result );
			} );
	},
	function( error ) {
		utils.die( "Server: device.configure() failed with: " + error + " and result " +
			error.result );
	} );

// Cleanup on SIGINT
process.on( "SIGINT", function() {
	utils.assert( "strictEqual", totalRequests, 1, "There has been exactly one request" );
	device.unregisterResource( theResource ).then(
		function() {
			utils.assert( "ok", true, "Server: device.unregisterResource() successful" );
			process.exit( 0 );
		},
		function( error ) {
			utils.die( "Server: device.unregisterResource() failed with: " + error +
				" and result " + error.result );
			process.exit( 0 );
		} );
} );


text:
package org.minijax.dao.converters;

import static org.junit.jupiter.api.Assertions.*;

import java.util.Arrays;
import java.util.List;

import org.junit.jupiter.api.Test;

class StringListConverterTest {

    @Test
    void testNull() {
        final StringListConverter c = new StringListConverter();
        assertNull(c.convertToDatabaseColumn(null));
        assertTrue(c.convertToEntityAttribute(null).isEmpty());
    }

    @Test
    void testSimple() {
        final StringListConverter c = new StringListConverter();
        final List<String> list = Arrays.asList("a", "b", "c");
        final String str = "a,b,c";
        assertEquals(str, c.convertToDatabaseColumn(list));
        assertEquals(list, c.convertToEntityAttribute(str));
    }
}


text:
<?php

namespace Stratify\Router\Test\Route;

use Interop\Http\ServerMiddleware\DelegateInterface;
use PHPUnit\Framework\TestCase;
use Psr\Http\Message\ServerRequestInterface;
use Stratify\Http\Exception\HttpNotFound;
use Stratify\Http\Middleware\LastDelegate;
use Stratify\Http\Response\SimpleResponse;
use Stratify\Router\Router;
use Zend\Diactoros\ServerRequest;
use function Stratify\Router\route;

class RouteBuilderTest extends TestCase
{
    /**
     * @test
     */
    public function configures_parameter_pattern()
    {
        $routes = [
            '/{foo}' => route(function (ServerRequestInterface $request) {
                return new SimpleResponse('Number ' . $request->getAttribute('foo'));
            })->pattern('foo', '\d+'),
        ];

        $router = new Router($routes);

        // Match number
        $response = $router->process($this->request('/9'), new LastDelegate);
        $this->assertEquals('Number 9', $response->getBody()->__toString());

        // Do not match anything else
        $this->expectException(HttpNotFound::class);
        $router->process($this->request('/hello'), new LastDelegate);
    }

    /**
     * @test
     */
    public function configures_optional_parameters()
    {
        $routes = [
            '/{foo}' => route(function (ServerRequestInterface $request) {
                return new SimpleResponse('Hello ' . $request->getAttribute('foo'));
            })->optional('foo', 'bar'),
        ];

        $router = new Router($routes);

        // Default value
        $response = $router->process($this->request('/'), new LastDelegate);
        $this->assertEquals('Hello bar', $response->getBody()->__toString());

        // Request value
        $response = $router->process($this->request('/john'), new LastDelegate);
        $this->assertEquals('Hello john', $response->getBody()->__toString());
    }

    /**
     * @test
     */
    public function configures_http_methods()
    {
        $routes = [
            // Single method
            '/foo' => route(function () {
                return new SimpleResponse('Hello');
            })->method('POST'),
            // Multiple methods
            '/bar' => route(function () {
                return new SimpleResponse('Hello');
            })->method('POST', 'PUT'),
        ];

        $router = new Router($routes);
        $notFoundDelegate = new class() implements DelegateInterface {
            public function process(ServerRequestInterface $request) {
                return new SimpleResponse('Not found');
            }
        };

        // Single method
        $response = $router->process($this->request('/foo', 'POST'), new LastDelegate);
        $this->assertEquals('Hello', $response->getBody()->__toString());
        // Do not match anything else
        $response = $router->process($this->request('/foo'), $notFoundDelegate);
        $this->assertEquals('Not found', $response->getBody()->__toString());

        // Multiple methods
        $response = $router->process($this->request('/bar', 'POST'), new LastDelegate);
        $this->assertEquals('Hello', $response->getBody()->__toString());
        $response = $router->process($this->request('/bar', 'PUT'), new LastDelegate);
        $this->assertEquals('Hello', $response->getBody()->__toString());
        // Do not match anything else
        $response = $router->process($this->request('/bar'), $notFoundDelegate);
        $this->assertEquals('Not found', $response->getBody()->__toString());
    }

    private function request($uri, $method = 'GET')
    {
        return new ServerRequest([], [], $uri, $method);
    }
}


text:
"""
Comparison mix-in
"""

from abc import ABC, abstractmethod
from collections.abc import Callable
from typing import Any, cast

__all__ = ()

class ComparisonMixIn(ABC):
    """
    Mix-in class with support for comparison operators.
    """

    @abstractmethod
    def _cmpValue(self) -> Any:
        """
        Returns a value for use in comparison methods.
        """

    def _cmp(self, other: Any, methodName: str) -> bool:
        if other.__class__ is self.__class__:
            selfValue = self._cmpValue()
            otherValue = other._cmpValue()
            selfValueCmp = cast(
                Callable[[Any], bool], getattr(selfValue, methodName)
            )
            return selfValueCmp(otherValue)
        else:
            return NotImplemented

    def __hash__(self) -> int:
        return hash(self._cmpValue())

    def __eq__(self, other: Any) -> bool:
        return self._cmp(other, "__eq__")

    def __ne__(self, other: Any) -> bool:
        return self._cmp(other, "__ne__")

    def __lt__(self, other: Any) -> bool:
        return self._cmp(other, "__lt__")

    def __le__(self, other: Any) -> bool:
        return self._cmp(other, "__le__")

    def __gt__(self, other: Any) -> bool:
        return self._cmp(other, "__gt__")

    def __ge__(self, other: Any) -> bool:
        return self._cmp(other, "__ge__")


text:
"use strict";

var fs = require("fs");

var _ = require("lodash");
var mkdirp = require("mkdirp");
var map_series = require("promise-map-series");
var walk_sync = require("walk-sync");

var filter = require("broccoli-dep-filter");

var parse_setup = require("zetzer/parse");
var compilers_setup = require("zetzer/compilers");
var process_file_setup = require("zetzer/process");

var dot_compiler_setup = require("zetzer/dot");
var markdown_compiler = require("zetzer/markdown");

var find_closest_match = require("./find_closest_match");

var META_DATA_SEPARATOR = /\r?\n\r?\n/;

module.exports = zetzer;

function zetzer (options, options_compat) {
  // options_compat is only for backwards compatibility because
  // previously options were passed separately from trees
  options = _.merge({}, options, options_compat);

  var pages_tree = options.pages;
  var partials_tree = options.partials;
  var templates_tree = options.templates;

  var env = options.env || {};

  var parse = parse_setup(options.meta_data_separator || META_DATA_SEPARATOR);
  var dot_compiler = dot_compiler_setup({
    template_settings: options.dot_template_settings || {}
  });

  var compile = compilers_setup({
    read_content: _.compose(parse.content, read_file),
    compilers:    [dot_compiler, markdown_compiler]
  });

  return filter({
    trees: {
      pages: pages_tree,
      partials: partials_tree,
      templates: templates_tree
    },
    iterated: ["pages"],
    init: init,
    extensions: ["html", "md"],
    target: "html",
    read: false,
    name: "Zetzer"
  });

  function init (roots) {
    var partials  = { root: roots.partials, paths: walk_sync(roots.partials) };
    var templates = { root: roots.templates, paths: walk_sync(roots.templates) };

    var process_file = process_file_setup({
      compile:            compile,
      read_header:        _.compose(parse.header, read_file),
      find_closest_match: find_closest_match,
      options: {
        env:       env,
        partials:  partials,
        templates: templates
      }
    });

    return run;

    function run (path) {
      return process_file(path).toString();
    }
  }
}

function read_file (path) {
  return fs.readFileSync(path, "utf8");
}


text:
KodeKollektivet.no
==================

A blog site.

Setup guide
-----------
Requirements:

* Node
* MongoDB

Clone source into a folder and then install dependencies with:

```
npm install
```

Launch the site at localhost with:

```
npm start
```

Run all server-side tests with:

```
npm test
```

A more detailed test breakdown can be shown whit:

```
npm run-script spec
```

To run the client side tests, simply open ```/blog-photo/spec/public/runner.html``` in your favorite browser.

### Installation guides

The following guides are for newer versions of Ubuntu, although links to more general instructions can be found.

#### Installing node

This is a brief summary of [howtonode.org](http://howtonode.org/how-to-install-nodejs), but with the updated location of the node git repository. For the most up to date installation guide, refer to the [nodejs.org](http://nodejs.org/download/) homepage.

Install the dependencies:

```
sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
```

Clone and build from source with:

```
git clone git@github.com:joyent/node.git
cd node
./configure
make
sudo make install
```

#### Installing MongoDB

The official guide can be found at [mongodb.org](http://docs.mongodb.org/manual/installation/).

A brief summary for Ubuntu users:

```
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install mongodb-10gen
```

Folder structure
----------------

Server-side code and npm dependencies is put in the root folder. Client-side code is put in the /public folder.

* Server.js contains the Node server code. It uses express.js.
* Post-provider.js contains the database interaction code. It uses mongoose.js.

The /public folder is structured in as following:

* Site view javascrip files are located at the root level.
* /css contains site specific css files.
* /html contains site specific html files.
* /img contains site graphics. Not meant as a location for images related to blogpost content.
* /lib contains pre-compiled client-side libraries, configuration and css.

Heroku setup
------------

First install the [Heroku toolbelt](https://devcenter.heroku.com/articles/quickstart#step-2-install-the-heroku-toolbelt).

Then you have to link the git repository to the Heroku deployment server using:

```
git remote add heroku git@heroku.com:kodekollektivet.git
```

Now you can deploy the site to heroku with:

```
git push heroku master
```

Updating dependencies
---------------------

Sometimes the dependencies to external libraries will be updated, to ensure that the site is using the most recent versions. Developers will then have to update their development repositories. This can be done by running:

```
npm update
bower update
```


text:
package kafka.log

import java.util.Properties

import kafka.server.{KafkaConfig, KafkaServer, ThrottledReplicaListValidator}
import kafka.utils.TestUtils
import org.apache.kafka.common.config.ConfigDef.Importance.MEDIUM
import org.apache.kafka.common.config.ConfigDef.Type.INT
import org.apache.kafka.common.config.{ConfigException, TopicConfig}
import org.junit.{Assert, Test}
import org.junit.Assert._
import org.scalatest.Assertions._

class LogConfigTest {

  /**
   * This test verifies that KafkaConfig object initialization does not depend on
   * LogConfig initialization. Bad things happen due to static initialization
   * order dependencies. For example, LogConfig.configDef ends up adding null
   * values in serverDefaultConfigNames. This test ensures that the mapping of
   * keys from LogConfig to KafkaConfig are not missing values.
   */
  @Test
  def ensureNoStaticInitializationOrderDependency(): Unit = {
    // Access any KafkaConfig val to load KafkaConfig object before LogConfig.
    assertTrue(KafkaConfig.LogRetentionTimeMillisProp != null)
    assertTrue(LogConfig.configNames.forall { config =>
      val serverConfigOpt = LogConfig.serverConfigName(config)
      serverConfigOpt.isDefined && (serverConfigOpt.get != null)
    })
  }

  @Test
  def testKafkaConfigToProps(): Unit = {
    val millisInHour = 60L * 60L * 1000L
    val kafkaProps = TestUtils.createBrokerConfig(nodeId = 0, zkConnect = "")
    kafkaProps.put(KafkaConfig.LogRollTimeHoursProp, "2")
    kafkaProps.put(KafkaConfig.LogRollTimeJitterHoursProp, "2")
    kafkaProps.put(KafkaConfig.LogRetentionTimeHoursProp, "2")

    val kafkaConfig = KafkaConfig.fromProps(kafkaProps)
    val logProps = KafkaServer.copyKafkaConfigToLog(kafkaConfig)
    assertEquals(2 * millisInHour, logProps.get(LogConfig.SegmentMsProp))
    assertEquals(2 * millisInHour, logProps.get(LogConfig.SegmentJitterMsProp))
    assertEquals(2 * millisInHour, logProps.get(LogConfig.RetentionMsProp))
  }

  @Test
  def testFromPropsEmpty(): Unit = {
    val p = new Properties()
    val config = LogConfig(p)
    Assert.assertEquals(LogConfig(), config)
  }

  @Test
  def testFromPropsInvalid(): Unit = {
    LogConfig.configNames.foreach(name => name match {
      case LogConfig.UncleanLeaderElectionEnableProp => assertPropertyInvalid(name, "not a boolean")
      case LogConfig.RetentionBytesProp => assertPropertyInvalid(name, "not_a_number")
      case LogConfig.RetentionMsProp => assertPropertyInvalid(name, "not_a_number" )
      case LogConfig.CleanupPolicyProp => assertPropertyInvalid(name, "true", "foobar")
      case LogConfig.MinCleanableDirtyRatioProp => assertPropertyInvalid(name, "not_a_number", "-0.1", "1.2")
      case LogConfig.MinInSyncReplicasProp => assertPropertyInvalid(name, "not_a_number", "0", "-1")
      case LogConfig.MessageFormatVersionProp => assertPropertyInvalid(name, "")
      case _ => assertPropertyInvalid(name, "not_a_number", "-1")
    })
  }

  @Test
  def testInvalidCompactionLagConfig(): Unit = {
    val props = new Properties
    props.setProperty(LogConfig.MaxCompactionLagMsProp, "100")
    props.setProperty(LogConfig.MinCompactionLagMsProp, "200")
    intercept[Exception] {
      LogConfig.validate(props)
    }
  }

  @Test
  def shouldValidateThrottledReplicasConfig(): Unit = {
    assertTrue(isValid("*"))
    assertTrue(isValid("* "))
    assertTrue(isValid(""))
    assertTrue(isValid(" "))
    assertTrue(isValid("100:10"))
    assertTrue(isValid("100:10,12:10"))
    assertTrue(isValid("100:10,12:10,15:1"))
    assertTrue(isValid("100:10,12:10,15:1  "))
    assertTrue(isValid("100:0,"))

    assertFalse(isValid("100"))
    assertFalse(isValid("100:"))
    assertFalse(isValid("100:0,10"))
    assertFalse(isValid("100:0,10:"))
    assertFalse(isValid("100:0,10:   "))
    assertFalse(isValid("100 :0,10:   "))
    assertFalse(isValid("100: 0,10:   "))
    assertFalse(isValid("100:0,10 :   "))
  }

  /* Sanity check that toHtmlTable produces one of the expected configs */
  @Test
  def testToHtmlTable(): Unit = {
    val html = LogConfig.configDefCopy.toHtmlTable
    val expectedConfig = "file.delete.delay.ms	"
    assertTrue(s"Could not find `$expectedConfig` in:\n $html", html.contains(expectedConfig))
  }

  /* Sanity check that toHtml produces one of the expected configs */
  @Test
  def testToHtml(): Unit = {
    val html = LogConfig.configDefCopy.toHtml
    val expectedConfig = "
file.delete.delay.ms"
    assertTrue(s"Could not find `$expectedConfig` in:\n $html", html.contains(expectedConfig))
  }

  /* Sanity check that toEnrichedRst produces one of the expected configs */
  @Test
  def testToEnrichedRst(): Unit = {
    val rst = LogConfig.configDefCopy.toEnrichedRst
    val expectedConfig = "``file.delete.delay.ms``"
    assertTrue(s"Could not find `$expectedConfig` in:\n $rst", rst.contains(expectedConfig))
  }

  /* Sanity check that toEnrichedRst produces one of the expected configs */
  @Test
  def testToRst(): Unit = {
    val rst = LogConfig.configDefCopy.toRst
    val expectedConfig = "``file.delete.delay.ms``"
    assertTrue(s"Could not find `$expectedConfig` in:\n $rst", rst.contains(expectedConfig))
  }

  @Test
  def testGetConfigValue(): Unit = {
    // Add a config that doesn't set the `serverDefaultConfigName`
    val configDef = LogConfig.configDefCopy
    val configNameWithNoServerMapping = "log.foo"
    configDef.define(configNameWithNoServerMapping, INT, 1, MEDIUM, s"$configNameWithNoServerMapping doc")

    val deleteDelayKey = configDef.configKeys.get(TopicConfig.FILE_DELETE_DELAY_MS_CONFIG)
    val deleteDelayServerDefault = configDef.getConfigValue(deleteDelayKey, LogConfig.ServerDefaultHeaderName)
    assertEquals(KafkaConfig.LogDeleteDelayMsProp, deleteDelayServerDefault)

    val keyWithNoServerMapping = configDef.configKeys.get(configNameWithNoServerMapping)
    val nullServerDefault = configDef.getConfigValue(keyWithNoServerMapping, LogConfig.ServerDefaultHeaderName)
    assertNull(nullServerDefault)
  }

  private def isValid(configValue: String): Boolean = {
    try {
      ThrottledReplicaListValidator.ensureValidString("", configValue)
      true
    } catch {
      case _: ConfigException => false
    }
  }

  private def assertPropertyInvalid(name: String, values: AnyRef*): Unit = {
    values.foreach((value) => {
      val props = new Properties
      props.setProperty(name, value.toString)
      intercept[Exception] {
        LogConfig(props)
      }
    })
  }

}


text:
'use strict';

import React ,{Component} from 'react';
import {View, Text, StyleSheet,Dimensions,TouchableOpacity,Platform,BackAndroid} from 'react-native';
var width = Dimensions.get('window').width;
var height = Dimensions.get('window').height;
import {Actions}  from 'react-native-redux-router';

class TestTip extends React.Component {

    render(){
        let Actions = this.props.routes;
        return (
            <View style={styles.content}>
                <View style={styles.info}>
                    <Text>{this.props.data}</Text>
                </View>
                <TouchableOpacity onPress={()=>this.onPress()}>
                <View style={styles.button}>
                    <Text>Close</Text>
                </View>
                </TouchableOpacity>

            </View>
        );
    }

    onPress(){
        if (this.props.onPress){
           this.props.onPress();
           return;
       }
       Actions.dismiss();
       Actions.testView();
    }

}

const styles = StyleSheet.create({

  content: {
    justifyContent: 'center',
    alignItems: 'center',

  },info:{
    height:300,
    width:width-50,
    justifyContent: 'center',
    borderRadius:10,
    backgroundColor:'#CE1126'
  },button:{
    marginTop:20,
    width:width-50,
    height:50,
    justifyContent: 'center',
    alignItems: 'center',
    borderRadius:10,
    backgroundColor:'#CE1126'
  }
});
module.exports = TestTip


text:
dependency_tests() {
    REQUIRED_APPS=('hadoop')

    for app in "${REQUIRED_APPS[@]}"
    do
        type $app >/dev/null 2>&1 || { echo >&2 "$0 needs the $app command to be installed . Aborting."; exit 1; }
    done
}

# Sanity check of environment
dependency_tests

# Start detecting the other required settings
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ACCUMULO_USER=accumulo

# Parse any arguments passed to the script
declare -A ARGS
while [ $# -gt 0 ]; do
    case "$1" in
        *) NAME="${1:2}"; shift; ARGS[$NAME]="$1" ;;
    esac
    shift
done

determine_hdfs_user() {
    # Various usernames distros configure to be the one with "root" HDFS permissions
    HADOOP_USERS=('hdfs' 'hadoop' 'cloudera-scm')
    if [ ! -z ${ARGS[user]} ]; then # Use custom user if provided
        HADOOP_USERS=( ${ARGS[user]} )
    fi
    HADOOP_USER=
    for user in "${HADOOP_USERS[@]}"
    do
        getent passwd $user > /dev/null
        if [ $? -eq 0 ] ; then
            HADOOP_USER=$user
            break
        fi
    done

    if [ ! -z $HADOOP_USER ]; then
        echo $HADOOP_USER
    else
        echo >&2 "Cannot determine user account to use for HDFS, tried '${HADOOP_USERS[@]}'. Aborting."
        exit 1
    fi
}

HDFS_USER=$(determine_hdfs_user)

parseVersion() {
    echo $(cat "$SCRIPT_DIR/geowave-accumulo-build.properties" | grep "project.version=" | sed -e 's/"//g' -e 's/-SNAPSHOT//g' -e 's/project.version=//g')
}

# Test to see if Accumulo has been initialized by looking at hdfs contents
determine_accumulo_hdfs_root() {
    ACCUMULO_ROOT_DIRS=('/accumulo' '/apps/accumulo')
    ROOT_DIR=
    for dir in "${ACCUMULO_ROOT_DIRS[@]}"
    do
        su $HDFS_USER -c "hadoop fs -ls $dir" > /dev/null
        if [ $? -eq 0 ] ; then
            ROOT_DIR=$dir
            break
        fi
    done

    if [ ! -z $ROOT_DIR ]; then
        echo $ROOT_DIR
    else
        echo >&2 "Accumulo application directory not found in HDFS, tried '${ACCUMULO_ROOT_DIRS[@]}'. Aborting."
        exit 1
    fi
}

ACCUMULO_HDFS_ROOT=$(determine_accumulo_hdfs_root)

# To support concurrent version and vendor installs we're naming the directory that contains the iterator with
# both the vendor and application version so we can support things like 0.8.7-cdh5, 0.8.7-cdh6, 0.8.8-hdp2 etc.
determine_vendor_version() {
    while [ $# -gt 0 ]; do
        ARG="${1:2}"
        KEY="${ARG%%=*}"
        VALUE="${ARG#*=}"
        case "$KEY" in
            "vendor.version") echo "$VALUE" ;;
            *) # Do nothing
        esac
        shift
    done
}
BUILD_ARGS_KEY="project.build.args="
BUILD_ARGS_VAL=$(cat $SCRIPT_DIR/geowave-accumulo-build.properties | grep "$BUILD_ARGS_KEY" | sed -e "s/$BUILD_ARGS_KEY//")
VENDOR_VERSION=$(determine_vendor_version $BUILD_ARGS_VAL)
if [ ! -z $VENDOR_VERSION ]; then
    VENDOR_VERSION="$(parseVersion)-$VENDOR_VERSION"
else
    VENDOR_VERSION="$(parseVersion)"
fi
ACCUMULO_LIB_DIR="$(determine_accumulo_hdfs_root)/classpath/geowave/$VENDOR_VERSION"
GEOWAVE_ACCUMULO_HOME=/usr/local/geowave-$VENDOR_VERSION/accumulo

# Check to see if lib directory is already present
su $HDFS_USER -c "hadoop fs -ls $ACCUMULO_LIB_DIR"
if [ $? -ne 0 ]; then # Try creating
    su $HDFS_USER -c "hadoop fs -mkdir -p $ACCUMULO_LIB_DIR"
    if [ $? -ne 0 ]; then
        echo >&2 "Unable to create $ACCUMULO_LIB_DIR directory in hdfs. Aborting."; exit 1;
    fi
fi

# Check to see if the library is already present and remove if so (put will not replace)
su $HDFS_USER -c "hadoop fs -ls $ACCUMULO_LIB_DIR/geowave-accumulo.jar"
if [ $? -eq 0 ]; then
    su $HDFS_USER -c "hadoop fs -rm $ACCUMULO_LIB_DIR/geowave-accumulo.jar"
fi

# Upload library to hdfs
su $HDFS_USER -c "hadoop fs -put $GEOWAVE_ACCUMULO_HOME/geowave-accumulo.jar $ACCUMULO_LIB_DIR/geowave-accumulo.jar"
if [ $? -ne 0 ]; then
    echo >&2 "Unable to upload geowave-accumulo.jar into hdfs. Aborting."; exit 1;
fi

# Also upload the build metadata file for ease of inspection
su $HDFS_USER -c "hadoop fs -ls $ACCUMULO_LIB_DIR/geowave-accumulo-build.properties"
if [ $? -eq 0 ]; then
    su $HDFS_USER -c "hadoop fs -rm $ACCUMULO_LIB_DIR/geowave-accumulo-build.properties"
fi

su $HDFS_USER -c "hadoop fs -put $GEOWAVE_ACCUMULO_HOME/geowave-accumulo-build.properties $ACCUMULO_LIB_DIR/geowave-accumulo-build.properties"
if [ $? -ne 0 ]; then
    echo >&2 "Unable to upload geowave-accumulo-build.properties into hdfs. Aborting."; exit 1;
fi

# Set ownership to Accumulo user
su $HDFS_USER -c "hadoop fs -chown -R $ACCUMULO_USER:$ACCUMULO_USER $ACCUMULO_LIB_DIR"
if [ $? -ne 0 ]; then
    echo >&2 "Unable to change ownership of the $ACCUMULO_LIB_DIR directory in hdfs. Aborting."; exit 1;
fi


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

package com.azure.resourcemanager.recoveryservicesbackup.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.time.Duration;
import java.time.OffsetDateTime;
import java.util.List;

/** DPM workload-specific job object. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobType")
@JsonTypeName("DpmJob")
@Fluent
public final class DpmJob extends Job {
    /*
     * Time elapsed for job.
     */
    @JsonProperty(value = "duration")
    private Duration duration;

    /*
     * DPM server name managing the backup item or backup job.
     */
    @JsonProperty(value = "dpmServerName")
    private String dpmServerName;

    /*
     * Name of cluster/server protecting current backup item, if any.
     */
    @JsonProperty(value = "containerName")
    private String containerName;

    /*
     * Type of container.
     */
    @JsonProperty(value = "containerType")
    private String containerType;

    /*
     * Type of backup item.
     */
    @JsonProperty(value = "workloadType")
    private String workloadType;

    /*
     * The state/actions applicable on this job like cancel/retry.
     */
    @JsonProperty(value = "actionsInfo")
    private List<JobSupportedAction> actionsInfo;

    /*
     * The errors.
     */
    @JsonProperty(value = "errorDetails")
    private List<DpmErrorInfo> errorDetails;

    /*
     * Additional information for this job.
     */
    @JsonProperty(value = "extendedInfo")
    private DpmJobExtendedInfo extendedInfo;

    /** Creates an instance of DpmJob class. */
    public DpmJob() {
    }

    /**
     * Get the duration property: Time elapsed for job.
     *
     * @return the duration value.
     */
    public Duration duration() {
        return this.duration;
    }

    /**
     * Set the duration property: Time elapsed for job.
     *
     * @param duration the duration value to set.
     * @return the DpmJob object itself.
     */
    public DpmJob withDuration(Duration duration) {
        this.duration = duration;
        return this;
    }

    /**
     * Get the dpmServerName property: DPM server name managing the backup item or backup job.
     *
     * @return the dpmServerName value.
     */
    public String dpmServerName() {
        return this.dpmServerName;
    }

    /**
     * Set the dpmServerName property: DPM server name managing the backup item or backup job.
     *
     * @param dpmServerName the dpmServerName value to set.
     * @return the DpmJob object itself.
     */
    public DpmJob withDpmServerName(String dpmServerName) {
        this.dpmServerName = dpmServerName;
        return this;
    }

    /**
     * Get the containerName property: Name of cluster/server protecting current backup item, if any.
     *
     * @return the containerName value.
     */
    public String containerName() {
        return this.containerName;
    }

    /**
     * Set the containerName property: Name of cluster/server protecting current backup item, if any.
     *
     * @param containerName the containerName value to set.
     * @return the DpmJob object itself.
     */
    public DpmJob withContainerName(String containerName) {
        this.containerName = containerName;
        return this;
    }

    /**
     * Get the containerType property: Type of container.
     *
     * @return the containerType value.
     */
    public String containerType() {
        return this.containerType;
    }

    /**
     * Set the containerType property: Type of container.
     *
     * @param containerType the containerType value to set.
     * @return the DpmJob object itself.
     */
    public DpmJob withContainerType(String containerType) {
        this.containerType = containerType;
        return this;
    }

    /**
     * Get the workloadType property: Type of backup item.
     *
     * @return the workloadType value.
     */
    public String workloadType() {
        return this.workloadType;
    }

    /**
     * Set the workloadType property: Type of backup item.
     *
     * @param workloadType the workloadType value to set.
     * @return the DpmJob object itself.
     */
    public DpmJob withWorkloadType(String workloadType) {
        this.workloadType = workloadType;
        return this;
    }

    /**
     * Get the actionsInfo property: The state/actions applicable on this job like cancel/retry.
     *
     * @return the actionsInfo value.
     */
    public List<JobSupportedAction> actionsInfo() {
        return this.actionsInfo;
    }

    /**
     * Set the actionsInfo property: The state/actions applicable on this job like cancel/retry.
     *
     * @param actionsInfo the actionsInfo value to set.
     * @return the DpmJob object itself.
     */
    public DpmJob withActionsInfo(List<JobSupportedAction> actionsInfo) {
        this.actionsInfo = actionsInfo;
        return this;
    }

    /**
     * Get the errorDetails property: The errors.
     *
     * @return the errorDetails value.
     */
    public List<DpmErrorInfo> errorDetails() {
        return this.errorDetails;
    }

    /**
     * Set the errorDetails property: The errors.
     *
     * @param errorDetails the errorDetails value to set.
     * @return the DpmJob object itself.
     */
    public DpmJob withErrorDetails(List<DpmErrorInfo> errorDetails) {
        this.errorDetails = errorDetails;
        return this;
    }

    /**
     * Get the extendedInfo property: Additional information for this job.
     *
     * @return the extendedInfo value.
     */
    public DpmJobExtendedInfo extendedInfo() {
        return this.extendedInfo;
    }

    /**
     * Set the extendedInfo property: Additional information for this job.
     *
     * @param extendedInfo the extendedInfo value to set.
     * @return the DpmJob object itself.
     */
    public DpmJob withExtendedInfo(DpmJobExtendedInfo extendedInfo) {
        this.extendedInfo = extendedInfo;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public DpmJob withEntityFriendlyName(String entityFriendlyName) {
        super.withEntityFriendlyName(entityFriendlyName);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public DpmJob withBackupManagementType(BackupManagementType backupManagementType) {
        super.withBackupManagementType(backupManagementType);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public DpmJob withOperation(String operation) {
        super.withOperation(operation);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public DpmJob withStatus(String status) {
        super.withStatus(status);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public DpmJob withStartTime(OffsetDateTime startTime) {
        super.withStartTime(startTime);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public DpmJob withEndTime(OffsetDateTime endTime) {
        super.withEndTime(endTime);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public DpmJob withActivityId(String activityId) {
        super.withActivityId(activityId);
        return this;
    }

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


text:
/*
  This file is licensed to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

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

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

namespace net.sf.xmlunit.input {
    /// <summary>
    /// Provides a base implementation for the different concrete ISource
    /// implementations.
    /// </summary>
    public abstract class AbstractSource : ISource {
        private string systemId;
        private readonly XmlReader reader;
        protected AbstractSource(XmlReader r) {
            reader = r;
            systemId = r.BaseURI;
        }
        public XmlReader Reader {
            get {
                return reader;
            }
        }
        public string SystemId {
            get {
                return systemId;
            }
            set {
                systemId = value;
            }
        }
        public override string ToString() {
            return string.Format("{0} with systemId {1}", GetType().Name,
                                 SystemId);
        }
    }
}


text:
How to Use
==========

Hashes
------
Use "hg <hashname> <keyname>" to get a value and
"hs <hashname> <keyname> <value>" to set a value

Simple key/values
-----------------
Use "g <keyname>" to get a value and
"s <keyname> <value>" to set a value