text:
/**
  @file         task_conveyer.cpp
  @brief        manages workers in a single thread.
  @author       HRYKY
  @version      $Id: task_conveyer.cpp 373 2014-07-27 04:20:16Z hryky.private@gmail.com $
 */
#include <precompiled.h>
#include "hryky/task/task_terminal.h"
#include "hryky/exclusion/exclusion_lock.h"
#include "hryky/foreach.h"
#include "hryky/log/log_definition.h"
#include "hryky/profiler/profiler_cumulate.h"
#include "hryky/task/task_conveyer.h"
#include "hryky/task/task_worker_base.h"
#include "hryky/thread.h"
#include "hryky/mempool/mempool_instantiate.h"
#include "hryky/is_null.h"
//------------------------------------------------------------------------------
// disables warnings
//------------------------------------------------------------------------------
#pragma hryky_pragma_disable_warning_constant_condition
//------------------------------------------------------------------------------
// macro
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// anonymous namespace
//------------------------------------------------------------------------------
namespace
{
}
//------------------------------------------------------------------------------
// static variable
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// function prototype
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// public member function
//------------------------------------------------------------------------------
/**
  @brief default constructor.
 */
hryky::task::Conveyer::Conveyer()
	: terminal_()
	  , appendeds_()
	  , lockable_()
	  , workable_()
	  , terminating_()
{
}
/**
  @brief constructor with memory pool.
 */
hryky::task::Conveyer::Conveyer(mempool::Ptr const & mempool)
	: terminal_()
	  , appendeds_(mempool)
	  , lockable_()
	  , workable_()
	  , terminating_()
{
}
/**
  @brief destrunctor.
 */
hryky::task::Conveyer::~Conveyer()
{
}
/**
  @brief the entry function called by a concurrent unit.
 */
void hryky::task::Conveyer::operator()()
{
	hryky_log_debug(
		"task conveyer starts"
		<< (json::writer()
			<< "conveyer" << *this
			<< "thread_id" << thread::this_thread::get_id()
			));

	workers_type workers(this->mempool());

	size_t wait_count =     0;
	size_t execute_count =  0;
	size_t error_count =    0;

	chrono::nanoseconds     wait_total;
	chrono::nanoseconds     execute_total;

	while (1) {
		// locks while append_buffer is accessed.
		{
			lock_type lock(this->lockable_);

			if (this->terminating_) {
				break;
			}

			// appends workers
			if (!this->appendeds_.empty()) {
				this->appendeds_.foreach([&workers, &error_count](
					worker_type & worker) {
					if (!workers.push_back(worker)) {
						hryky_log_alert(
							"failed to append a worker to concurrent conveyer"
							<< (json::writer()
								<< stream::denote("workers") << workers
								));

						++error_count;

						worker->error();
						worker->detach();
					}
				});
				this->appendeds_.resize(0);
			}

			// suspends if there is no active worker.
			if (workers.empty()) {
				profiler::Cumulate<chrono::nanoseconds> const
					profile(wait_total);

				++wait_count;

				this->workable_.join(lock);
			}
		}

		workers.foreach([&execute_total, &execute_count](
			worker_type & worker) {
			profiler::Cumulate<chrono::nanoseconds> const
				profile(execute_total);

			++execute_count;

			worker->run();
			worker->detach();
		});
		workers.resize(0);
	}

	hryky_log_debug(
		"task conveyer terminated"
		<< (json::writer()
			<< stream::denote("conveyer") << *this
			<< stream::denote("thread_id") << thread::this_thread::get_id()
			<< stream::denote("wait_count") << wait_count
			<< stream::denote("wait_total") << wait_total.count()
			<< stream::denote("execute_count") << execute_count
			<< stream::denote("execute_total") << execute_total.count()
			<< stream::denote("error_count") << error_count
			));

	if (!hryky_is_null(this->terminal_)) {
		this->terminal_->inactivate(*this);
	}
}
/**
  @brief allocates the capacity of workers.
 */
bool hryky::task::Conveyer::reserve(size_t const capacity)
{
	lock_type const lock(this->lockable_);

	return this->appendeds_.reserve(capacity);
}
/**
  @brief appends an executable worker.
 */
bool hryky::task::Conveyer::append(worker::Base & worker)
{
	if (this->terminating_) {
		hryky_log_err("The conveyer is terminating.");
		return false;
	}

	{
		lock_type const lock(this->lockable_);

		if (!this->appendeds_.push_back(worker_type(&worker))) {
			hryky_log_err(
				"failed to push a worker to the waiting buffer"
				<< (json::writer()
					<< stream::denote("appendeds") << this->appendeds_));
			return false;
		}
	}

	this->workable_.notify();

	return true;
}
/**
  @brief requests the end of the conveyer.
 */
void hryky::task::Conveyer::terminate()
{
	if (this->terminating_) {
		return;
	}

	lock_type lock(this->lockable_);

	this->terminating_ = true;

	this->workable_.notify();
}
/**
  @brief assigns a new receiver of this completion.
 */
void hryky::task::Conveyer::terminal(terminal_type * const src)
{
	this->terminal_ = src;
}
/**
  @brief retrieves the memory pool used in this instance.
 */
hryky::mempool_type hryky::task::Conveyer::mempool() const
{
	return this->appendeds_.get_allocator().mempool();
}
//------------------------------------------------------------------------------
// protected member function
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// private member function
//------------------------------------------------------------------------------
/**
  @brief clears resources.
 */
void hryky::task::Conveyer::clear()
{
	lock_type const lock(this->lockable_);
	hryky::clear(this->appendeds_);
}
//------------------------------------------------------------------------------
// global function
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// static function
//------------------------------------------------------------------------------
namespace
{
}
//------------------------------------------------------------------------------
// explicit instantiation
//------------------------------------------------------------------------------
// end of file


text:
class ESTThread :
	public OpenThreads::Thread
{
public:
	ESTThread(void);
	~ESTThread(void);

	virtual int cancel();

	virtual void run() = 0;
protected:
	bool _done;
};

redpajama_set_name: RedPajamaGithub


text:
Keeps track of connections to an http or tcp server (or any other server object with the same api) and provides a way to close connections

By default, `require('http').createServer` provides no mechanism for tracking client connections and/or closing client connections

[![NPM](https://nodei.co/npm/connections.png)](https://nodei.co/npm/connections/)

## usage

```
var connections = require('connections')(serverInstance)
```

You can also pass an array of server instances

`connections` has `.sockets` and `.destroy`

### connections.on('idle', function() {})

called whenever all active connections have closed

### connections.on('close', function(socket) {})

called whenever a socket closes

### connections.on('connection', function (socket) {})

forwarded event from the server or servers

### connections.sockets

an array of open sockets (http clients)

### connections.destroy()

destroys/closes all active connections (calls .destroy() on each socket)

### connections.add(socket)

manually add a socket to the connection list


text:
FROM python:3.6 as tester
ARG TRAVIS_JOB_ID
WORKDIR /meetup_loto
COPY test-requirements.txt .
RUN pip install -r test-requirements.txt
COPY ./ ./
ENV REQUESTS_CA_BUNDLE ""
ENV CURL_CA_BUNDLE ""
RUN nose2 --with-coverage --coverage-report term-missing
RUN test $TRAVIS_JOB_ID && coveralls -i || echo

FROM python:3.6-alpine
COPY requirements.txt .
COPY --from=tester /root/.cache/ /root/.cache/
RUN pip install -r requirements.txt && rm -Rf /root/.cache
COPY --from=tester /meetup_loto/src /src
COPY --from=tester /meetup_loto/entrypoint.sh /src
WORKDIR /src
ENV PYTHONPATH "/src:/usr/local/lib/python3.6"
EXPOSE 8080
ENTRYPOINT /src/entrypoint.sh


text:
package debop4s.timeperiod.tests.tools;

import debop4s.core.JAction1;
import debop4s.core.parallels.JParallels;
import debop4s.timeperiod.TimeSpec;
import debop4s.timeperiod.YearWeek;
import debop4s.timeperiod.tests.TimePeriodTestBase;
import debop4s.timeperiod.timerange.WeekRange;
import debop4s.timeperiod.utils.Times;
import debop4s.timeperiod.utils.Weeks;
import lombok.extern.slf4j.Slf4j;
import org.joda.time.DateTime;
import org.joda.time.Duration;
import org.junit.Test;

import static org.fest.assertions.Assertions.assertThat;

/**
 * debop4s.timeperiod.test.tools.WeeksFunSuite
 *
 * @author 배성혁 sunghyouk.bae@gmail.com
 * @since 13. 5. 25. 오후 12:55
 */
@Slf4j
public class WeeksTest extends TimePeriodTestBase {

    public static final DateTime[] testTimes = new DateTime[] {
            Times.asDate(2003, 12, 28)
    };

    @Test
    public void getYearAndWeek() {
        for (DateTime moment : testTimes) {
            YearWeek yw = Weeks.yearAndWeek(moment);
            assertThat(yw.weekyear()).isEqualTo(moment.getWeekyear());
            assertThat(yw.weekOfWeekyear()).isEqualTo(moment.getWeekOfWeekyear());
        }
    }

    @Test
    public void getYearAndWeekTest() {

        JParallels.run(2000, 2100, new JAction1<Integer>() {
            @Override
            public void perform(Integer year) {
                DateTime startDay = Times.startTimeOfYear(year);
                DateTime endDay = Times.endTimeOfYear(year - 1);

                YearWeek startYW = Weeks.yearAndWeek(startDay);
                YearWeek endYW = Weeks.yearAndWeek(endDay);

                if (startDay.getDayOfWeek() == TimeSpec.FirstDayOfWeek.getValue())
                    assertThat(endYW.equals(startYW)).isFalse();
                else
                    assertThat(endYW.equals(startYW)).isTrue();
            }
        });
    }

    @Test
    public void getStartWeekRangeOfYear() {
        JParallels.run(2000, 2100, new JAction1<Integer>() {
            @Override
            public void perform(Integer year) {
                WeekRange startWeekRange = Weeks.startWeekRangeOfYear(year);

                log.trace("year=[{}], startWeek=[{}]", year, startWeekRange.startDayStart());

                assertThat(new Duration(Times.asDate(year - 1, 12, 28), startWeekRange.startDayStart()).getStandardDays()).isGreaterThan(0);
                assertThat(new Duration(Times.asDate(year, 1, 3), startWeekRange.endDayStart()).getStandardDays()).isGreaterThan(0);
            }
        });
    }

    @Test
    public void getEndYearAndWeekTest() {
        JParallels.run(1980, 2200, new JAction1<Integer>() {
            @Override
            public void perform(Integer year) {
                YearWeek yw = Weeks.endYearAndWeek(year);

                assertThat(year).isEqualTo(yw.weekyear());
                assertThat(yw.weekOfWeekyear()).isGreaterThanOrEqualTo(52);
            }
        });
    }

    @Test
    public void getEndWeekRangeOfYear() {
        JParallels.run(2000, 2100, new JAction1<Integer>() {
            @Override
            public void perform(Integer year) {
                WeekRange startWeekRange = Weeks.startWeekRangeOfYear(year);
                WeekRange endWeekRange = Weeks.endWeekRangeOfYear(year - 1);

                log.trace("year=[{}], startWeek=[{}], endWeek=[{}]",
                          year, startWeekRange.startDayStart(), endWeekRange.startDayStart());

                assertThat(new Duration(Times.asDate(year - 1, 12, 28), startWeekRange.startDayStart()).getStandardDays()).isGreaterThan(0);
                assertThat(new Duration(Times.asDate(year, 1, 3), startWeekRange.endDayStart()).getStandardDays()).isGreaterThan(0);

                assertThat(endWeekRange.startDayStart().plusWeeks(1)).isEqualTo(startWeekRange.startDayStart());
                assertThat(endWeekRange.endDayStart().plusDays(1)).isEqualTo(startWeekRange.startDayStart());

            }
        });
    }

    @Test
    public void getWeekRangeTest() {
        JParallels.run(2000, 2100, new JAction1<Integer>() {
            @Override
            public void perform(Integer year) {
                DateTime endDay = Times.endTimeOfYear(year - 1);
                DateTime startDay = Times.startTimeOfYear(year);

                YearWeek endDayYearWeek = Weeks.yearAndWeek(endDay);
                assertThat(endDayYearWeek.weekyear()).isGreaterThanOrEqualTo(year - 1);

                YearWeek startDayYearWeek = Weeks.yearAndWeek(startDay);
                assertThat(startDayYearWeek.weekyear()).isLessThanOrEqualTo(year);

                // 해당일자가 속한 주차의 일자들을 구한다. 년말/년초 구간은 꼭 7일이 아닐 수 있다.
                WeekRange endDayWeekRange = Weeks.weekRange(endDayYearWeek);
                WeekRange startDayWeekRange = Weeks.weekRange(startDayYearWeek);

                assertThat(endDayWeekRange.hasPeriod()).isTrue();
                assertThat(startDayWeekRange.hasPeriod()).isTrue();

                log.trace("start day weeksView=[{}]", startDayWeekRange);

                if (endDayYearWeek.equals(startDayYearWeek)) {
                    assertThat(startDayWeekRange).isEqualTo(endDayWeekRange);
                } else {
                    assertThat(startDayWeekRange).isNotEqualTo(endDayWeekRange);
                }
            }
        });
    }

    @Test
    public void addWeekOfYearsTest() {
        JParallels.run(2000, 2100, new JAction1<Integer>() {
            @Override
            public void perform(Integer year) {

                final int step = 2;
                final int maxAddWeeks = 40;

                YearWeek prevResult = null;
                YearWeek maxWeek = Weeks.endYearAndWeek(year);

                for (int week = 1; week < maxWeek.weekOfWeekyear(); week += step) {
                    for (int addWeeks = -maxAddWeeks; addWeeks <= maxAddWeeks; addWeeks += step) {
                        YearWeek current = new YearWeek(year, week);
                        YearWeek result = Weeks.addWeekOfYears(current, addWeeks);

                        if (addWeeks != 0 && prevResult != null) {
                            if (result.weekyear() == prevResult.weekyear())
                                assertThat(result.weekOfWeekyear()).isEqualTo(prevResult.weekOfWeekyear() + step);
                        }

                        assertThat(result.weekOfWeekyear()).isGreaterThan(0);
                        assertThat(result.weekOfWeekyear()).isLessThanOrEqualTo(TimeSpec.MaxWeeksPerYear);

                        prevResult = result;
                    }
                }
            }
        });
    }
}


text:
<readable><title>2976350388_3984e3193d</title><content>
A bicycler jumping over a barrier with his bike .
A cyclist carries his bicycle while jumping over a hurdle .
A man doing tricks with his bicycle .
a man jumps across an obstacle carrying his bike
The man is jumping through the air , while holding a bicycle .
</content></readable>


text:
package se.claremont.taf.core.gui.userpreferences;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class Preferences {
    @JsonProperty private Map<String, Object> prefs = new HashMap<>();

    public Preferences(){}

    public void add(String propertyName, Object property){
        prefs.put(propertyName, property);
    }

    public Object get(String propertyName){
        if(!prefs.containsKey(propertyName))return null;
        return prefs.get(propertyName);
    }

    public void loadFromFile(String path){
        ObjectMapper mapper = new ObjectMapper();
        try {
            mapper.readValue(new File(path), Preferences.class);
        } catch (IOException e) {
            System.out.println("Could not read user preferences from file '" + path + "'. Error: " + e.getMessage());
        }
    }

    public void saveToFile(String path){
        ObjectMapper mapper = new ObjectMapper();
        try {
            mapper.writeValue(new File(path), this);
        } catch (IOException e) {
            System.out.println("Could not write user preferences to file '" + path + "'. Error: " + e.getMessage());
        }
    }

    public static String getPreferencesFile(){
        return "C:\\Temp\\taf.preferences";

    }

}


text:
package org.apache.cassandra.db;

import java.nio.ByteBuffer;
import java.util.UUID;

import org.apache.cassandra.utils.vint.VIntCoding;

public final class TypeSizes
{
//<<<<<<< HEAD
//    public static final TypeSizes NATIVE = new NativeDBTypeSizes();
//    //只看到org.apache.cassandra.cache.SerializingCache和一些测试例子中用到
//    public static final TypeSizes VINT = new VIntEncodedTypeSizes();
//=======

    private TypeSizes(){}

    private static final int BOOL_SIZE = 1;
    private static final int SHORT_SIZE = 2;
    private static final int INT_SIZE = 4;
    private static final int LONG_SIZE = 8;
    private static final int UUID_SIZE = 16;

    /** assumes UTF8 */
    public static int sizeof(String value)
    {
        int length = encodedUTF8Length(value);
        assert length <= Short.MAX_VALUE;
        return sizeof((short) length) + length;
    }

    public static int encodedUTF8Length(String st)
    {
        int strlen = st.length();
        int utflen = 0;
        for (int i = 0; i < strlen; i++)
        {
            int c = st.charAt(i);
            if ((c >= 0x0001) && (c <= 0x007F))
                utflen++;
            else if (c > 0x07FF)
                utflen += 3;
            else
                utflen += 2;
        }
        return utflen;
    }

    public static int sizeofWithShortLength(ByteBuffer value)
    {
        return sizeof((short) value.remaining()) + value.remaining();
    }

    public static int sizeofWithLength(ByteBuffer value)
    {
        return sizeof(value.remaining()) + value.remaining();
    }

    public static int sizeofWithVIntLength(ByteBuffer value)
    {
        return sizeofUnsignedVInt(value.remaining()) + value.remaining();
    }

    public static int sizeof(boolean value)
    {
        return BOOL_SIZE;
    }

    public static int sizeof(short value)
    {
        return SHORT_SIZE;
    }

    public static int sizeof(int value)
    {
        return INT_SIZE;
    }

    public static int sizeof(long value)
    {
        return LONG_SIZE;
    }

    public static int sizeof(UUID value)
    {
        return UUID_SIZE;
    }

    public static int sizeofVInt(long value)
    {
        return VIntCoding.computeVIntSize(value);
    }

    public static int sizeofUnsignedVInt(long value)
    {
        return VIntCoding.computeUnsignedVIntSize(value);
    }
}


text:
<!DOCTYPE html>

	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<link rel="stylesheet" href="../css/lite-editor.css">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
  <link rel="stylesheet" href="./style.css">
	<title>SimpleWysiwyg</title>

  <textarea class='js-lite-editor' name="hoge">  {test} Lite Editor is a modern wysiwyg editor focuses on editing inline elements
And super easy to customize to add original tags and actions on it.

You can find the tons of examples from here

and Compatible with IE9+

Amazing!!</textarea>
<textarea class='js-lite-editor2' name="hoge">  {test} Lite Editor is a modern wysiwyg editor focuses on editing inline elements
And super easy to customize to add original tags and actions on it.

You can find the tons of examples from here

and Compatible with IE9+

Amazing!!</textarea>


text:
<?php

namespace Numencode\Models\User;

use Illuminate\Database\Eloquent\Model;
use Numencode\Models\System\Traits\Sortable;

class Role extends Model
{
    use Sortable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['name', 'label', 'is_admin', 'sort_order'];

    /**
     * Role is deletable if no users or managers are assigned with it.
     *
     * @return bool
     */
    public function isDeletable()
    {
        return !($this->managers()->count() || $this->users()->count());
    }

    /**
     * Role can belong to many permissions.
     *
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
     */
    public function permissions()
    {
        return $this->belongsToMany(Permission::class, 'role_permission')
            ->where('is_admin', $this->is_admin);
    }

    /**
     * Role can belong to many users.
     *
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
     */
    public function users()
    {
        return $this->belongsToMany(User::class, 'role_user');
    }

    /**
     * Role can belong to many managers.
     *
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
     */
    public function managers()
    {
        return $this->belongsToMany(Manager::class, 'role_manager');
    }

    /**
     * Give permission to
     *
     * @param Permission $permission Permission
     *
     * @return Model
     */
    public function givePermissionTo(Permission $permission)
    {
        return $this->permissions()->save($permission);
    }
}


text:
/**
 * Generates a tuple with appropriate DOM props to create an ARIA label
 * relationship based on the ID (ID will be dynamically generated if not supplied)
 *
 * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-labelledby_attribute
 *
 * First portion of tuple should be spread on the label
 * Second should be spread on the controlled element
 *
 * @returns [ label, labeled ]
 */
export declare const useAriaLabelObjectRelationship: (id?: string | undefined) => ({
    'aria-controls': string;
    id: string;
    'aria-labelledby'?: undefined;
} | {
    'aria-labelledby': string;
    id: string;
    'aria-controls'?: undefined;
})[];


text:
#pragma once
#include <aws/workspaces/WorkSpaces_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/workspaces/model/OperatingSystem.h>
#include <aws/workspaces/model/WorkspaceImageState.h>
#include <aws/workspaces/model/WorkspaceImageRequiredTenancy.h>
#include <aws/core/utils/DateTime.h>
#include <aws/workspaces/model/UpdateResult.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace WorkSpaces
{
namespace Model
{

  /**
   *
Describes a WorkSpace image.

See Also:
   AWS
   * API Reference

   */
  class AWS_WORKSPACES_API WorkspaceImage
  {
  public:
    WorkspaceImage();
    WorkspaceImage(Aws::Utils::Json::JsonView jsonValue);
    WorkspaceImage& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
The identifier of the image.

     */
    inline const Aws::String& GetImageId() const{ return m_imageId; }

    /**
     *
The identifier of the image.

     */
    inline bool ImageIdHasBeenSet() const { return m_imageIdHasBeenSet; }

    /**
     *
The identifier of the image.

     */
    inline void SetImageId(const Aws::String& value) { m_imageIdHasBeenSet = true; m_imageId = value; }

    /**
     *
The identifier of the image.

     */
    inline void SetImageId(Aws::String&& value) { m_imageIdHasBeenSet = true; m_imageId = std::move(value); }

    /**
     *
The identifier of the image.

     */
    inline void SetImageId(const char* value) { m_imageIdHasBeenSet = true; m_imageId.assign(value); }

    /**
     *
The identifier of the image.

     */
    inline WorkspaceImage& WithImageId(const Aws::String& value) { SetImageId(value); return *this;}

    /**
     *
The identifier of the image.

     */
    inline WorkspaceImage& WithImageId(Aws::String&& value) { SetImageId(std::move(value)); return *this;}

    /**
     *
The identifier of the image.

     */
    inline WorkspaceImage& WithImageId(const char* value) { SetImageId(value); return *this;}

    /**
     *
The name of the image.

     */
    inline const Aws::String& GetName() const{ return m_name; }

    /**
     *
The name of the image.

     */
    inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }

    /**
     *
The name of the image.

     */
    inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; }

    /**
     *
The name of the image.

     */
    inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); }

    /**
     *
The name of the image.

     */
    inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); }

    /**
     *
The name of the image.

     */
    inline WorkspaceImage& WithName(const Aws::String& value) { SetName(value); return *this;}

    /**
     *
The name of the image.

     */
    inline WorkspaceImage& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;}

    /**
     *
The name of the image.

     */
    inline WorkspaceImage& WithName(const char* value) { SetName(value); return *this;}

    /**
     *
The description of the image.

     */
    inline const Aws::String& GetDescription() const{ return m_description; }

    /**
     *
The description of the image.

     */
    inline bool DescriptionHasBeenSet() const { return m_descriptionHasBeenSet; }

    /**
     *
The description of the image.

     */
    inline void SetDescription(const Aws::String& value) { m_descriptionHasBeenSet = true; m_description = value; }

    /**
     *
The description of the image.

     */
    inline void SetDescription(Aws::String&& value) { m_descriptionHasBeenSet = true; m_description = std::move(value); }

    /**
     *
The description of the image.

     */
    inline void SetDescription(const char* value) { m_descriptionHasBeenSet = true; m_description.assign(value); }

    /**
     *
The description of the image.

     */
    inline WorkspaceImage& WithDescription(const Aws::String& value) { SetDescription(value); return *this;}

    /**
     *
The description of the image.

     */
    inline WorkspaceImage& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;}

    /**
     *
The description of the image.

     */
    inline WorkspaceImage& WithDescription(const char* value) { SetDescription(value); return *this;}

    /**
     *
The operating system that the image is running.

     */
    inline const OperatingSystem& GetOperatingSystem() const{ return m_operatingSystem; }

    /**
     *
The operating system that the image is running.

     */
    inline bool OperatingSystemHasBeenSet() const { return m_operatingSystemHasBeenSet; }

    /**
     *
The operating system that the image is running.

     */
    inline void SetOperatingSystem(const OperatingSystem& value) { m_operatingSystemHasBeenSet = true; m_operatingSystem = value; }

    /**
     *
The operating system that the image is running.

     */
    inline void SetOperatingSystem(OperatingSystem&& value) { m_operatingSystemHasBeenSet = true; m_operatingSystem = std::move(value); }

    /**
     *
The operating system that the image is running.

     */
    inline WorkspaceImage& WithOperatingSystem(const OperatingSystem& value) { SetOperatingSystem(value); return *this;}

    /**
     *
The operating system that the image is running.

     */
    inline WorkspaceImage& WithOperatingSystem(OperatingSystem&& value) { SetOperatingSystem(std::move(value)); return *this;}

    /**
     *
The status of the image.

     */
    inline const WorkspaceImageState& GetState() const{ return m_state; }

    /**
     *
The status of the image.

     */
    inline bool StateHasBeenSet() const { return m_stateHasBeenSet; }

    /**
     *
The status of the image.

     */
    inline void SetState(const WorkspaceImageState& value) { m_stateHasBeenSet = true; m_state = value; }

    /**
     *
The status of the image.

     */
    inline void SetState(WorkspaceImageState&& value) { m_stateHasBeenSet = true; m_state = std::move(value); }

    /**
     *
The status of the image.

     */
    inline WorkspaceImage& WithState(const WorkspaceImageState& value) { SetState(value); return *this;}

    /**
     *
The status of the image.

     */
    inline WorkspaceImage& WithState(WorkspaceImageState&& value) { SetState(std::move(value)); return *this;}

    /**
     *
Specifies whether the image is running on dedicated hardware. When Bring Your
     * Own License (BYOL) is enabled, this value is set to DEDICATED. For
     * more information, see Bring
     * Your Own Windows Desktop Images.

     */
    inline const WorkspaceImageRequiredTenancy& GetRequiredTenancy() const{ return m_requiredTenancy; }

    /**
     *
Specifies whether the image is running on dedicated hardware. When Bring Your
     * Own License (BYOL) is enabled, this value is set to DEDICATED. For
     * more information, see Bring
     * Your Own Windows Desktop Images.

     */
    inline bool RequiredTenancyHasBeenSet() const { return m_requiredTenancyHasBeenSet; }

    /**
     *
Specifies whether the image is running on dedicated hardware. When Bring Your
     * Own License (BYOL) is enabled, this value is set to DEDICATED. For
     * more information, see Bring
     * Your Own Windows Desktop Images.

     */
    inline void SetRequiredTenancy(const WorkspaceImageRequiredTenancy& value) { m_requiredTenancyHasBeenSet = true; m_requiredTenancy = value; }

    /**
     *
Specifies whether the image is running on dedicated hardware. When Bring Your
     * Own License (BYOL) is enabled, this value is set to DEDICATED. For
     * more information, see Bring
     * Your Own Windows Desktop Images.

     */
    inline void SetRequiredTenancy(WorkspaceImageRequiredTenancy&& value) { m_requiredTenancyHasBeenSet = true; m_requiredTenancy = std::move(value); }

    /**
     *
Specifies whether the image is running on dedicated hardware. When Bring Your
     * Own License (BYOL) is enabled, this value is set to DEDICATED. For
     * more information, see Bring
     * Your Own Windows Desktop Images.

     */
    inline WorkspaceImage& WithRequiredTenancy(const WorkspaceImageRequiredTenancy& value) { SetRequiredTenancy(value); return *this;}

    /**
     *
Specifies whether the image is running on dedicated hardware. When Bring Your
     * Own License (BYOL) is enabled, this value is set to DEDICATED. For
     * more information, see Bring
     * Your Own Windows Desktop Images.

     */
    inline WorkspaceImage& WithRequiredTenancy(WorkspaceImageRequiredTenancy&& value) { SetRequiredTenancy(std::move(value)); return *this;}

    /**
     *
The error code that is returned for the image.

     */
    inline const Aws::String& GetErrorCode() const{ return m_errorCode; }

    /**
     *
The error code that is returned for the image.

     */
    inline bool ErrorCodeHasBeenSet() const { return m_errorCodeHasBeenSet; }

    /**
     *
The error code that is returned for the image.

     */
    inline void SetErrorCode(const Aws::String& value) { m_errorCodeHasBeenSet = true; m_errorCode = value; }

    /**
     *
The error code that is returned for the image.

     */
    inline void SetErrorCode(Aws::String&& value) { m_errorCodeHasBeenSet = true; m_errorCode = std::move(value); }

    /**
     *
The error code that is returned for the image.

     */
    inline void SetErrorCode(const char* value) { m_errorCodeHasBeenSet = true; m_errorCode.assign(value); }

    /**
     *
The error code that is returned for the image.

     */
    inline WorkspaceImage& WithErrorCode(const Aws::String& value) { SetErrorCode(value); return *this;}

    /**
     *
The error code that is returned for the image.

     */
    inline WorkspaceImage& WithErrorCode(Aws::String&& value) { SetErrorCode(std::move(value)); return *this;}

    /**
     *
The error code that is returned for the image.

     */
    inline WorkspaceImage& WithErrorCode(const char* value) { SetErrorCode(value); return *this;}

    /**
     *
The text of the error message that is returned for the image.

     */
    inline const Aws::String& GetErrorMessage() const{ return m_errorMessage; }

    /**
     *
The text of the error message that is returned for the image.

     */
    inline bool ErrorMessageHasBeenSet() const { return m_errorMessageHasBeenSet; }

    /**
     *
The text of the error message that is returned for the image.

     */
    inline void SetErrorMessage(const Aws::String& value) { m_errorMessageHasBeenSet = true; m_errorMessage = value; }

    /**
     *
The text of the error message that is returned for the image.

     */
    inline void SetErrorMessage(Aws::String&& value) { m_errorMessageHasBeenSet = true; m_errorMessage = std::move(value); }

    /**
     *
The text of the error message that is returned for the image.

     */
    inline void SetErrorMessage(const char* value) { m_errorMessageHasBeenSet = true; m_errorMessage.assign(value); }

    /**
     *
The text of the error message that is returned for the image.

     */
    inline WorkspaceImage& WithErrorMessage(const Aws::String& value) { SetErrorMessage(value); return *this;}

    /**
     *
The text of the error message that is returned for the image.

     */
    inline WorkspaceImage& WithErrorMessage(Aws::String&& value) { SetErrorMessage(std::move(value)); return *this;}

    /**
     *
The text of the error message that is returned for the image.

     */
    inline WorkspaceImage& WithErrorMessage(const char* value) { SetErrorMessage(value); return *this;}

    /**
     *
The date when the image was created. If the image has been shared, the Amazon
     * Web Services account that the image has been shared with sees the original
     * creation date of the image.

     */
    inline const Aws::Utils::DateTime& GetCreated() const{ return m_created; }

    /**
     *
The date when the image was created. If the image has been shared, the Amazon
     * Web Services account that the image has been shared with sees the original
     * creation date of the image.

     */
    inline bool CreatedHasBeenSet() const { return m_createdHasBeenSet; }

    /**
     *
The date when the image was created. If the image has been shared, the Amazon
     * Web Services account that the image has been shared with sees the original
     * creation date of the image.

     */
    inline void SetCreated(const Aws::Utils::DateTime& value) { m_createdHasBeenSet = true; m_created = value; }

    /**
     *
The date when the image was created. If the image has been shared, the Amazon
     * Web Services account that the image has been shared with sees the original
     * creation date of the image.

     */
    inline void SetCreated(Aws::Utils::DateTime&& value) { m_createdHasBeenSet = true; m_created = std::move(value); }

    /**
     *
The date when the image was created. If the image has been shared, the Amazon
     * Web Services account that the image has been shared with sees the original
     * creation date of the image.

     */
    inline WorkspaceImage& WithCreated(const Aws::Utils::DateTime& value) { SetCreated(value); return *this;}

    /**
     *
The date when the image was created. If the image has been shared, the Amazon
     * Web Services account that the image has been shared with sees the original
     * creation date of the image.

     */
    inline WorkspaceImage& WithCreated(Aws::Utils::DateTime&& value) { SetCreated(std::move(value)); return *this;}

    /**
     *
The identifier of the Amazon Web Services account that owns the image.

     */
    inline const Aws::String& GetOwnerAccountId() const{ return m_ownerAccountId; }

    /**
     *
The identifier of the Amazon Web Services account that owns the image.

     */
    inline bool OwnerAccountIdHasBeenSet() const { return m_ownerAccountIdHasBeenSet; }

    /**
     *
The identifier of the Amazon Web Services account that owns the image.

     */
    inline void SetOwnerAccountId(const Aws::String& value) { m_ownerAccountIdHasBeenSet = true; m_ownerAccountId = value; }

    /**
     *
The identifier of the Amazon Web Services account that owns the image.

     */
    inline void SetOwnerAccountId(Aws::String&& value) { m_ownerAccountIdHasBeenSet = true; m_ownerAccountId = std::move(value); }

    /**
     *
The identifier of the Amazon Web Services account that owns the image.

     */
    inline void SetOwnerAccountId(const char* value) { m_ownerAccountIdHasBeenSet = true; m_ownerAccountId.assign(value); }

    /**
     *
The identifier of the Amazon Web Services account that owns the image.

     */
    inline WorkspaceImage& WithOwnerAccountId(const Aws::String& value) { SetOwnerAccountId(value); return *this;}

    /**
     *
The identifier of the Amazon Web Services account that owns the image.

     */
    inline WorkspaceImage& WithOwnerAccountId(Aws::String&& value) { SetOwnerAccountId(std::move(value)); return *this;}

    /**
     *
The identifier of the Amazon Web Services account that owns the image.

     */
    inline WorkspaceImage& WithOwnerAccountId(const char* value) { SetOwnerAccountId(value); return *this;}

    /**
     *
The updates (if any) that are available for the specified image.

     */
    inline const UpdateResult& GetUpdates() const{ return m_updates; }

    /**
     *
The updates (if any) that are available for the specified image.

     */
    inline bool UpdatesHasBeenSet() const { return m_updatesHasBeenSet; }

    /**
     *
The updates (if any) that are available for the specified image.

     */
    inline void SetUpdates(const UpdateResult& value) { m_updatesHasBeenSet = true; m_updates = value; }

    /**
     *
The updates (if any) that are available for the specified image.

     */
    inline void SetUpdates(UpdateResult&& value) { m_updatesHasBeenSet = true; m_updates = std::move(value); }

    /**
     *
The updates (if any) that are available for the specified image.

     */
    inline WorkspaceImage& WithUpdates(const UpdateResult& value) { SetUpdates(value); return *this;}

    /**
     *
The updates (if any) that are available for the specified image.

     */
    inline WorkspaceImage& WithUpdates(UpdateResult&& value) { SetUpdates(std::move(value)); return *this;}

  private:

    Aws::String m_imageId;
    bool m_imageIdHasBeenSet;

    Aws::String m_name;
    bool m_nameHasBeenSet;

    Aws::String m_description;
    bool m_descriptionHasBeenSet;

    OperatingSystem m_operatingSystem;
    bool m_operatingSystemHasBeenSet;

    WorkspaceImageState m_state;
    bool m_stateHasBeenSet;

    WorkspaceImageRequiredTenancy m_requiredTenancy;
    bool m_requiredTenancyHasBeenSet;

    Aws::String m_errorCode;
    bool m_errorCodeHasBeenSet;

    Aws::String m_errorMessage;
    bool m_errorMessageHasBeenSet;

    Aws::Utils::DateTime m_created;
    bool m_createdHasBeenSet;

    Aws::String m_ownerAccountId;
    bool m_ownerAccountIdHasBeenSet;

    UpdateResult m_updates;
    bool m_updatesHasBeenSet;
  };

} // namespace Model
} // namespace WorkSpaces
} // namespace Aws


text:
package net.jawr.web.resource.bundle.hashcode;

import java.io.IOException;

import net.jawr.web.config.JawrConfig;
import net.jawr.web.exception.BundlingProcessException;
import net.jawr.web.resource.bundle.CheckSumUtils;

/**
 * This class defines the bundle hashcode generator which use MD5 as hashcode algorithm
 *
 * @author Ibrahim Chaehoi
 */
public class MD5BundleHashcodeGenerator implements BundleHashcodeGenerator {

	/* (non-Javadoc)
	 * @see net.jawr.web.resource.bundle.hash.BundleHashcodeGenerator#generateHashCode(net.jawr.web.config.JawrConfig, java.lang.String)
	 */
	public String generateHashCode(JawrConfig config, String content) {

		try {
			return CheckSumUtils.getMD5Checksum(content, config.getResourceCharset());
		} catch (IOException e) {
			throw new BundlingProcessException("Unable to generate the bundle hashcode", e);
		}
	}

}


text:
'''
	=== Instituto Politécnico Nacional
	=== Escuela Superior de Cómputo

	*** Análisis de Algoritmos - 2CM3
	>>> ww ww ww (@ww)
	<<< www.ww.com/algoritmos

	Nota: el código de esta licencia se distribuye bajo la especificada
	en el repositorio de github.com/ww/ESCOM
'''

from sys import stderr as error
import argparse as argumentos
import re as regexxx
from pprint import pprint as nicePrinter
from ww.algoritmos.modulo_cinco import init as iniciarAlgoritmo

def separarTamanios(ts):
	nums = []
	for i in ts:
		tmp = i.split('x')
		for j in tmp:
			nums.append(j)
	# Siempre debe ser un número par la cantidad de números
	if len(nums) % 2 != 0:
		return False
	# Validar que sean iguales para hacer las multiplicaciones
	for i in range(1, len(nums)-1, 2):
		if nums[i] != nums[i+1]:
			return False
	return nums
def armarMegaTupla(nombres, tamanios):
	if len(nombres) != len(tamanios) / 2:
		return False
	numz = []
	j = 0
	for i in range(0, len(tamanios), 2):
		numz.append([nombres[j], int(tamanios[i]), int(tamanios[i+1])]) # NombreTabla, M, N
		j += 1
	return numz
def init(matrices, verbosidad):
	resultados = iniciarAlgoritmo(matrices)
	resumen = resultados[0][len(resultados)-1]
	if verbosidad:
		nicePrinter(resultados)
	print 'Matriz resultante "'+resumen[0]+'" con tamaño = '+str(resumen[1])+'x'+str(resumen[3])+' y '+str(resumen[4])+' productos'

parseador = argumentos.ArgumentParser(description='Práctica 5: Producto secuencia de matrices por wwww', epilog='Ejemplo: ./practica5.py -n nombre1,nombre2,nombre3 -t 2x4,4x3,3x5 -v')
parseador.add_argument('-n', '--nombres', action='store', dest='nombresMatrices', help='Almacena los nombres que se darán a cada una de las matrices separadas por comas.', required=True)
parseador.add_argument('-t', '--tamanios', action='store', dest='tams', help='Permite establecer los tamaños para cada una de las matrices anteriores; la cantidad debe ser la misma y además debe estar en el formato <M>x<N>.', required=True)
parseador.add_argument('-v', '--verboso', action='store_true', dest='verbosidad', help='Indica si se debe mostrar la tabla de valores o solamente los resultados')
arr = parseador.parse_args()

if regexxx.compile('^(\w+\,)+\w+$').match(arr.nombresMatrices) and regexxx.compile('^(\d+x\d+\,)+\d+x\d+$').match(arr.tams):
	nombres = arr.nombresMatrices.split(',')
	tamanios = separarTamanios(arr.tams.split(','))
	if tamanios != False:
		megatupla = armarMegaTupla(nombres, tamanios)
		if megatupla != False:
			init(megatupla, arr.verbosidad)
		else:
			error.write('Error: La asignación de nombres y tamaños no es suficiente.\n')
	else:
		error.write('Error: no es posible realizar la multiplicación.\n')
else:
	error.write('Error: los argumentos no tienen un formato de entrada válido.\n')
print "Por ww ww - ww.com/algoritmos"
exit()


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

<title>SetHomeLocationActivity</title>
<meta name="date" content="2015-04-07">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV CLASS

NEXT CLASS

FRAMES

NO FRAMES

All Classes

SUMMARY:

NESTED |

FIELD |

CONSTR |

METHOD

DETAIL:

FIELD |

CONSTR |

METHOD

ca.ualberta.cs.scandaloutraveltracker.views

Class SetHomeLocationActivity

java.lang.Object

Activity

ca.ualberta.cs.scandaloutraveltracker.views.MenuActivity

ca.ualberta.cs.scandaloutraveltracker.views.SetHomeLocationActivity

public class SetHomeLocationActivity
extends MenuActivity

Allows the user to pick a spot on a map to be able to save it as the new home location.
        If a location is passed to this activity as two intents, one latitude and one longitude, then
        it is displayed as the previous location. The userId of the user that is editing their home
        location needs to be passed as an intent to the activity as well.

Author:

Team3ScandalouStopwatch

Constructor Summary

Constructors

Constructor and Description

SetHomeLocationActivity()

Method Summary

Methods

Modifier and Type
Method and Description

void
goCurrent(View v)

Called when home button is clicked, the map goes to previous home location if
  one was passed to the activity as an intent

void
goToGps(View v)

Called when GPS is clicked, the map goes to current gps location

void
onCreate(Bundle savedInstanceState)

Called when the activity is created.

void
saveLocation(View v)

Called when save new location is clicked.

Methods inherited from class ca.ualberta.cs.scandaloutraveltracker.views.MenuActivity

onCreateOptionsMenu, onOptionsItemSelected

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SetHomeLocationActivity

public SetHomeLocationActivity()

Method Detail

onCreate

public void onCreate(Bundle savedInstanceState)

Called when the activity is created. Sets up the map and adds a marker if a location
        was passed as intents to the activity. A listener is also made for long clicks on spots
  on the map that sets a marker and the spot long clicked on as the new location.

goCurrent

public void goCurrent(View v)

Called when home button is clicked, the map goes to previous home location if
  one was passed to the activity as an intent

Parameters:

v - the current view

goToGps

public void goToGps(View v)

Called when GPS is clicked, the map goes to current gps location

Parameters:

v - the current view

saveLocation

public void saveLocation(View v)

Called when save new location is clicked. Saves the location as the given users home location

Parameters:

v - the current view

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV CLASS

NEXT CLASS

FRAMES

NO FRAMES

All Classes

SUMMARY:

NESTED |

FIELD |

CONSTR |

METHOD

DETAIL:

FIELD |

CONSTR |

METHOD


text: YuPlayGod ODM


text:
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
rocksdb_target_header = """REPO_PATH = package_name() + "/"

BUCK_BINS = "buck-out/gen/" + REPO_PATH

TEST_RUNNER = REPO_PATH + "buckifier/rocks_test_runner.sh"

rocksdb_compiler_flags = [
    "-fno-builtin-memcmp",
    "-DROCKSDB_PLATFORM_POSIX",
    "-DROCKSDB_LIB_IO_POSIX",
    "-DROCKSDB_FALLOCATE_PRESENT",
    "-DROCKSDB_MALLOC_USABLE_SIZE",
    "-DROCKSDB_RANGESYNC_PRESENT",
    "-DROCKSDB_SCHED_GETCPU_PRESENT",
    "-DROCKSDB_SUPPORT_THREAD_LOCAL",
    "-DOS_LINUX",
    # Flags to enable libs we include
    "-DSNAPPY",
    "-DZLIB",
    "-DBZIP2",
    "-DLZ4",
    "-DZSTD",
    "-DGFLAGS=gflags",
    "-DNUMA",
    "-DTBB",
    # Needed to compile in fbcode
    "-Wno-expansion-to-defined",
]

rocksdb_external_deps = [
    ("bzip2", None, "bz2"),
    ("snappy", None, "snappy"),
    ("zlib", None, "z"),
    ("gflags", None, "gflags"),
    ("lz4", None, "lz4"),
    ("zstd", None),
    ("tbb", None),
    ("numa", None, "numa"),
    ("googletest", None, "gtest"),
]

rocksdb_preprocessor_flags = [
    # Directories with files for #include
    "-I" + REPO_PATH + "include/",
    "-I" + REPO_PATH,
]

rocksdb_arch_preprocessor_flags = {
    "x86_64": ["-DHAVE_SSE42"],
}

build_mode = read_config("fbcode", "build_mode")

is_opt_mode = build_mode.startswith("opt")

# -DNDEBUG is added by default in opt mode in fbcode. But adding it twice
# doesn't harm and avoid forgetting to add it.
if is_opt_mode:
    rocksdb_compiler_flags.append("-DNDEBUG")
"""

library_template = """
cpp_library(
    name = "%s",
    srcs = [%s],
    headers = %s,
    arch_preprocessor_flags = rocksdb_arch_preprocessor_flags,
    compiler_flags = rocksdb_compiler_flags,
    preprocessor_flags = rocksdb_preprocessor_flags,
    deps = [%s],
    external_deps = rocksdb_external_deps,
)
"""

binary_template = """
cpp_binary(
    name = "%s",
    srcs = [%s],
    arch_preprocessor_flags = rocksdb_arch_preprocessor_flags,
    compiler_flags = rocksdb_compiler_flags,
    preprocessor_flags = rocksdb_preprocessor_flags,
    deps = [%s],
    external_deps = rocksdb_external_deps,
)
"""

test_cfg_template = """    [
        "%s",
        "%s",
        "%s",
    ],
"""

unittests_template = """
# [test_name, test_src, test_type]
ROCKS_TESTS = [
%s]

# Generate a test rule for each entry in ROCKS_TESTS
# Do not build the tests in opt mode, since SyncPoint and other test code
# will not be included.
if not is_opt_mode:
    for test_cfg in ROCKS_TESTS:
        test_name = test_cfg[0]
        test_cc = test_cfg[1]
        ttype = "gtest" if test_cfg[2] == "parallel" else "simple"
        test_bin = test_name + "_bin"

        cpp_binary (
          name = test_bin,
          srcs = [test_cc],
          deps = [":rocksdb_test_lib"],
          preprocessor_flags = rocksdb_preprocessor_flags,
          arch_preprocessor_flags = rocksdb_arch_preprocessor_flags,
          compiler_flags = rocksdb_compiler_flags,
          external_deps = rocksdb_external_deps,
        )

        custom_unittest(
          name = test_name,
          type = ttype,
          deps = [":" + test_bin],
          command = [TEST_RUNNER, BUCK_BINS + test_bin]
        )

custom_unittest(
    name = "make_rocksdbjavastatic",
    command = ["internal_repo_rocksdb/make_rocksdbjavastatic.sh"],
    type = "simple",
)

custom_unittest(
    name = "make_rocksdb_lite_release",
    command = ["internal_repo_rocksdb/make_rocksdb_lite_release.sh"],
    type = "simple",
)
"""


text:
//
//  SampleRootTableViewController.m
//  STAControls
//
//  Created by Aaron Jubbal on 3/30/15.
//  Copyright (c) 2015 Aaron Jubbal. All rights reserved.
//

#import "SampleRootTableViewController.h"
#import "ViewController.h"
#import "SampleSTATextFieldViewController.h"
#import "SampleSTASegmentedControlViewController.h"
#import "SampleSTAButtonViewController.h"

@interface SampleRootTableViewController ()

@end

@implementation SampleRootTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
    self.title = @"STAControls Sample";
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    // Return the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    // Return the number of rows in the section.
    return 3;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"reuseIdentifier"];
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"reuseIdentifier" forIndexPath:indexPath];

    // Configure the cell...
    if (indexPath.row == 0) {
        cell.textLabel.text = @"STATextField";
    } else if (indexPath.row == 1) {
        cell.textLabel.text = @"STASegmentedControl";
    } else if (indexPath.row == 2) {
        cell.textLabel.text = @"STAButton";
    }
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.row == 0) {
        SampleSTATextFieldViewController *vc = [[SampleSTATextFieldViewController alloc] initWithNibName:@"SampleSTATextFieldViewController"
                                                                                bundle:nil];
        [self.navigationController pushViewController:vc animated:YES];
    } else if (indexPath.row == 1) {
        SampleSTASegmentedControlViewController *vc = [[SampleSTASegmentedControlViewController alloc] initWithNibName:@"SampleSTASegmentedControlViewController"
                                                                                bundle:nil];
        [self.navigationController pushViewController:vc animated:YES];
    } else if (indexPath.row == 2) {
        SampleSTAButtonViewController *vc = [[SampleSTAButtonViewController alloc] initWithNibName:@"SampleSTAButtonViewController"
                                                                                bundle:nil];
        [self.navigationController pushViewController:vc animated:YES];
    }
}

/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    } else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
package c5db.interfaces;

import c5db.messages.generated.ModuleType;
import com.google.common.collect.ImmutableMap;
import com.google.common.util.concurrent.ListenableFuture;
import org.jetlang.channels.Subscriber;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;

/**
 * A service that provides information about C5Modules.
 */
public interface ModuleInformationProvider {

  // TODO this could be generified if we used an interface instead of ModuleType

  /**
   * This is primary mechanism via which modules with compile time binding via interfaces
   * that live in {@link c5db.interfaces} may obtain instances of their dependencies.
   *

   * This method returns a future, which implies that the module may not be started yet.
   * The future will be signalled when the module is started, and callers may just add a
   * callback and wait.
   *

   * In the future when automatic service startup order is working, this method might just
   * return the type without a future, or may not require much/any waiting.
   *

   * Right now modules are specified via an enum, in the future perhaps we should
   * use a Java interface type?
   *
   * @param moduleType the specific module type you wish to retrieve
   * @return a future that will be set when the module is running
   */
  ListenableFuture<C5Module> getModule(ModuleType moduleType);

  /**
   * Get a future returning the map of currently online modules and their associated ports.
   */
  ListenableFuture<ImmutableMap<ModuleType, Integer>> getOnlineModules();

  /**
   * Each time a module comes online or goes offline, the returned Subscriber will emit
   * a complete map of the currently online modules, mapping them to their associated
   * ports.
   *
   * @return A Subscriber the caller may subscribe to to receive such maps.
   */
  Subscriber<ImmutableMap<ModuleType, Integer>> moduleChangeChannel();

  /**
   * This is deprecated because it is synchronous and allows blocking implementations;
   * clients of this interface should use getModule instead, which is async.
   */
  @Deprecated
  ImmutableMap<ModuleType, C5Module> getModules() throws ExecutionException, InterruptedException, TimeoutException;
}


text:
ModelLoader::ModelLoader(const char *path)
{
    this->loadModel(path);
}

void ModelLoader::Draw(GLSLShader shader)
{
    for (GLuint i=0; i<_meshes.size(); i++)
        _meshes[i].Draw(shader);
}

void ModelLoader::loadModel(std::string path)
{
    Assimp::Importer import;
    const aiScene* Scene = import.ReadFile(path, aiProcess_Triangulate | aiProcess_FlipUVs);

    std::cout << "Importing model..." << std::endl;
    if (!Scene || Scene->mFlags == AI_SCENE_FLAGS_INCOMPLETE || !Scene->mRootNode)
    {
        std::cout << "Error reading common model file. Details: " << import.GetErrorString() << std::endl;
        return;
    }

    this->directory = path.substr(0, path.find_last_of('/'));
    this->processNode(Scene->mRootNode, Scene);
}

void ModelLoader::processNode(aiNode* node, const aiScene *scene)
{

    for (GLuint i=0; i<node->mNumMeshes; i++)
    {
        std::cout << "Processing main nodes and mesh. Count: " << i << std::endl;
        aiMesh* Mesh = scene->mMeshes[node->mMeshes[i]];
        this->_meshes.push_back(this->processMesh(Mesh, scene));
    }
    for (GLuint i=0; i<node->mNumChildren; i++)
    {
        std::cout << "Processing child nodes and mesh. Count: " << i << std::endl;
        this->processNode(node->mChildren[i], scene);
    }
}

Mesh ModelLoader::processMesh(aiMesh *mesh, const aiScene *scene)
{
    std::vector<Vertex> vertices;
    std::vector<GLuint> indices;
    std::vector<Texture> textures;

    for (GLuint i=0; i<mesh->mNumVertices; i++)
    {
        Vertex vertex;

        glm::vec3 verts;
        verts.x = mesh->mVertices[i].x;
        verts.y = mesh->mVertices[i].y;
        verts.z = mesh->mVertices[i].z;
        vertex.Position = verts;

        glm::vec3 norms;
        norms.x = mesh->mNormals[i].x;
        norms.y = mesh->mNormals[i].y;
        norms.z = mesh->mNormals[i].z;
        vertex.Normal = norms;

        if (mesh->mTextureCoords[0])
        {
            glm::vec2 texCoords;
            texCoords.x = mesh->mTextureCoords[0][i].x;
            texCoords.y = mesh->mTextureCoords[0][i].y;
            vertex.TexCoords = texCoords;
        }
        else vertex.TexCoords = glm::vec2(0.0f, 0.0f);

        vertices.push_back(vertex);
    }

    for (GLuint i=0; i<mesh->mNumFaces; i++)
    {
        aiFace face = mesh->mFaces[i];
        for (GLuint j=0; j<face.mNumIndices; j++)
        {
            indices.push_back(face.mIndices[j]);
        }
    }

    if (mesh->mMaterialIndex > 0)
    {
        aiMaterial* material = scene->mMaterials[mesh->mMaterialIndex];

        std::vector<Texture> diffuseMaps = this->loadMaterials(material, aiTextureType_DIFFUSE, "texture_diffuse");
        textures.insert(textures.end(), diffuseMaps.begin(), diffuseMaps.end());

        std::vector<Texture> speculiarMaps = this->loadMaterials(material, aiTextureType_SPECULAR, "texture_specular");
        textures.insert(textures.end(), speculiarMaps.begin(), speculiarMaps.end());
    }

    return Mesh(vertices, indices, textures);
}

std::vector<Texture> ModelLoader::loadMaterials(aiMaterial* mat, aiTextureType type, std::string typeName)
{
    std::vector<Texture> Textures;
    for (GLuint i=0; i<mat->GetTextureCount(type); i++)
    {
        aiString str;
        mat->GetTexture(type, i, &str);

        GLboolean skip = false;
        for (GLuint j=0; j<loadedTextures.size(); j++)
        {
            if (loadedTextures[j].path == str)
            {
                Textures.push_back(loadedTextures[j]);
                skip = true;
                break;
            }
        }

        if (!skip)
        {
            Texture texture;

            texture.id = TextureFromFile(str.C_Str(), this->directory);
            texture.type = typeName;
            texture.path = str;
            Textures.push_back(texture);
            this->loadedTextures.push_back(texture);

        }
    }
    return Textures;
}

GLuint TextureFromFile(const char* path, std::string directory)
{
    std::string filename = std::string(path);
    filename = directory + '/' + filename;

    GLuint textureId;
    glGenTextures(1, &textureId);
    int width, height;
    unsigned char* image = SOIL_load_image(filename.c_str(), &width, &height, 0, SOIL_LOAD_RGB);

    glBindTexture(GL_TEXTURE_2D, textureId);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, image);
    glGenerateMipmap(GL_TEXTURE_2D);

    glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
    glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
    glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

    glBindTexture(GL_TEXTURE_2D, 0);
    SOIL_free_image_data(image);

    return textureId;
}


text:
package org.adligo.models.core.shared;

public class ModelsCoreEnglishConstants implements I_ModelsCoreConstants {

	public static final String A_END_VALUE_OF_THE_DATE_RANGE_IS_REQUIRED = "A End value of the Date Range is required.";
	public static final String A_START_VALUE_OF_THE_DATE_RANGE_IS_REQUIRED = "A Start value of the Date Range is required.";
	public static final String THE_START_OF_THE_DATE_RANGE_MUST_BE_BEFORE_THE_END = "The Start of the date range must be before the End.";
	public static final String THE_END_OF_THE_DATE_RANGE_MUST_BE_AFTER_THE_START = "The End of the date range must be after the Start.";
	public static final String EMAIL_ATTACHMENT_MAY_NOT_BE_EMPTY = "A E-mail attachment may NOT be empty.";
	public static final String EMAIL_ATTACHEMNT_MAY_NOT_BE_NULL = "A E-mail attachemnt may NOT be null.";
	public static final String EMAIL_ADDRESS_IS_NOT_VALID = "E-mail address is not valid.";
	public static final String EMAIL_REQUIRES_A_DESTINATION_ADDRESS = "A E-mail requires a destination address.";
	public static final String EMAIL_REQUIRES_A_VALID_FROM_ADDRESS = "A E-mail requires a valid from address.";
	public static final String EMAIL_REQUIRES_A_FROM_ADDRESS = "A E-mail requires a from address.";

	public static final String USER_RELATIONS_EMPTY_ROLE = "Can't add a empty role to UserRelations.";
	public static final String USER_RELATIONS_EMPTY_GROUP = "Can't add a empty group to UserRelations.";
	public static final String USER_GROUP_EMPTY_ROLE_TO_USER_GROUP = "Can't add a empty role to UserGroup.";

	public static final String ADDRESS_THE_COUNTRY_SUBDIVISION_CODE_MUST_BE_4_DIGITS_OR_LESS = "The country subdivision code must be 4 digits or less.";
	public static final String ADDRESS_THE_COUNTRY_SUBDIVISION_CODE_MAY_NOT_BE_EMPTY = "The country subdivision code may not be empty.";
	public static final String ADDRESS_THE_STREET_FIELD_MAY_NOT_BE_EMPTY = "The street field may not be empty.";
	public static final String ADDRESS_THE_POSTAL_CODE_FIELD_MAY_NOT_BE_EMPTY = "The postal code field may not be empty.";
	public static final String ADDRESS_THE_COUNTRY_FIELD_MAY_NOT_BE_EMPTY = "The country field may not be empty.";
	public static final String ADDRESS_THE_CITY_FIELD_MAY_NOT_BE_EMPTY = "The city field may not be empty.";
	public static final String ADDRESS_THE_COUNTRY_FIELD_MUST_BE_2_DIGITS = "The country field must be 2 digits.";

	public static final String DOMAIN_CAN_NOT_HAVE_A_DOT_AS_ITS_LAST_CHARACTER = "Domain can NOT have a dot as its last character.";
	public static final String DOMAIN_CAN_NOT_HAVE_A_DOT_AS_ITS_FIRST_CHARACTER = "Domain can NOT have a dot as its first character.";
	public static final String DOMAIN_CAN_NOT_HAVE_TWO_CONSECUTIVE_DOTS = "Domain can NOT have two consecutive dots ie. (foo..bar).";
	public static final String DOMAIN_TO_SHORT = "Domain to short must be at least 4 characters ie. (a.ok).";
	public static final String DOMAIN_MAY_NOT_CONTAIN_A_SPACE = "Domain may not contain a space.";
	public static final String DOMAIN_MUST_CONTAIN_A_DOT = "Domain must contain a dot ie. (name.com).";
	public static final String DOMAIN_CAN_NOT_BE_EMPTY = "Domain can not be empty.";

	public static final String EMAIL_ADDRESS_TWO_SHORT = "E-mail is two short to be a real E-mail address. ie. (a@l.ok)";
	public static final String EMAIL_ADDRESS_NO_USER = "E-mail must contain a user name before the @ symbol.";
	public static final String EMAIL_ADDRESS_SPACE_CHARACTER = "E-mail may NOT contain a space character.";
	public static final String EMAIL_ADDRESS_NO_DOMAIN_NAME = "E-mail must have a domain name after the @ symbol.  ie. (adligo.com)";
	public static final String EMAIL_ADDRESS_NO_AT_SYMBOL = "E-mail must contain the @ symbol.";
	public static final String EMAIL_ADDRESS_E_MAIL_CAN_NOT_BE_EMPTY = "E-mail can NOT be empty.";
	public static final String EMAIL_ADDRESS_DOMAIN_ERROR = "There is a issue with the domain portion of the E-mail, after the @ symbol.";

	public static final String ORG_EMPTY_TYPE = "The type field can not be empty.";
	public static final String ORG_EMPTY_NAME = "The name field can not be empty.";

	public static final String PERSON_A_NAME_IS_REQUIRED = "A name is required.";
	public static final String PERSON_A_FIRST_NAME_IS_REQUIRED = "A first name is required.";
	public static final String PERSON_A_MIDDLE_NAME_IS_REQUIRED = "A middle name is required.";
	public static final String PERSON_A_LAST_NAME_IS_REQUIRED = "A last name is required.";
	public static final String PERSON_A_NICK_NAME_IS_REQUIRED = "A nick name is required.";
	public static final String PERSON_GENDER_IS_NOT_VALID = "The gender must be one of (Male, Female, Other).";

	public static final String PHONE_NUMBER_MAY_ONLY_HAVE_ARABIC_NUMERALS = "A phone number may only have Arabic numerals ie (0-9).";
	public static final String PHONE_NUMBER_CAN_NOT_BE_EMPTY = "A phone number can not be empty.";

	public static final String USER_PASSWORD_CAN_T_BE_EMPTY = "User password can't be set to empty!";
	public static final String USER_DOMAIN_NAME_CANT_BE_EMPTY = "User domain name can't be set to empty!";
	public static final String USER_NAME_CANT_CONTAIN_A_SPACE = "User name can't contain a space character!";
	public static final String USER_NAME_CANT_BE_SET_TO_EMPTY = "User name can't be set to empty!";

	public String getAddressCountryCodeWrongSizeError() {
		return ADDRESS_THE_COUNTRY_FIELD_MUST_BE_2_DIGITS;
	}

	public String getAddressEmptyCityError() {
		return ADDRESS_THE_CITY_FIELD_MAY_NOT_BE_EMPTY;
	}

	public String getAddressEmptyCountryError() {
		return ADDRESS_THE_COUNTRY_FIELD_MAY_NOT_BE_EMPTY;
	}

	public String getAddressEmptyPostalError() {
		return ADDRESS_THE_POSTAL_CODE_FIELD_MAY_NOT_BE_EMPTY;
	}

	public String getAddressEmptyStreetError() {
		return ADDRESS_THE_STREET_FIELD_MAY_NOT_BE_EMPTY;
	}

	public String getAddressEmptySubCodeError() {
		return ADDRESS_THE_COUNTRY_SUBDIVISION_CODE_MAY_NOT_BE_EMPTY;
	}

	public String getAddressSubCodeTwoBigError() {
		return ADDRESS_THE_COUNTRY_SUBDIVISION_CODE_MUST_BE_4_DIGITS_OR_LESS;
	}

	public String getDomainNameEmptyError() {
		return DOMAIN_CAN_NOT_BE_EMPTY;
	}

	public String getDomainNameNoDotError() {
		return DOMAIN_MUST_CONTAIN_A_DOT;
	}

	public String getDomainNameNoSpaceError() {
		return DOMAIN_MAY_NOT_CONTAIN_A_SPACE;
	}

	public String getDomainNameToShortError() {
		return DOMAIN_TO_SHORT;
	}

	public String getDomainNameDotCantBeConsecutive() {
		return DOMAIN_CAN_NOT_HAVE_TWO_CONSECUTIVE_DOTS;
	}

	public String getDomainNameDotCantBeFirst() {
		return DOMAIN_CAN_NOT_HAVE_A_DOT_AS_ITS_FIRST_CHARACTER;
	}

	public String getDomainNameDotCantBeLast() {
		return DOMAIN_CAN_NOT_HAVE_A_DOT_AS_ITS_LAST_CHARACTER;
	}

	public String getEmaiAddressBadDomainError() {
		return EMAIL_ADDRESS_DOMAIN_ERROR;
	}

	public String getEmailAddressEmptyError() {
		return EMAIL_ADDRESS_E_MAIL_CAN_NOT_BE_EMPTY;
	}

	public String getEmailAddressNoAtError() {
		return EMAIL_ADDRESS_NO_AT_SYMBOL;
	}

	public String getEmailAddressNoDomainError() {
		return EMAIL_ADDRESS_NO_DOMAIN_NAME;
	}

	public String getEmailAddressNoSpaceError() {
		return EMAIL_ADDRESS_SPACE_CHARACTER;
	}

	public String getEmailAddressNoUserError() {
		return EMAIL_ADDRESS_NO_USER;
	}

	public String getEmailAddressToShortError() {
		return EMAIL_ADDRESS_TWO_SHORT;
	}

	public String getOrgEmptyNameError() {
		return ORG_EMPTY_NAME;
	}

	public String getOrgEmptyTypeError() {
		return ORG_EMPTY_TYPE;
	}

	public String getPersonNoNameError() {
		return PERSON_A_NAME_IS_REQUIRED;
	}

	public String getPhoneEmptyError() {
		return PHONE_NUMBER_CAN_NOT_BE_EMPTY;
	}

	public String getPhoneInvalidCharacterError() {
		return PHONE_NUMBER_MAY_ONLY_HAVE_ARABIC_NUMERALS;
	}

	public String getUserNoUserNameMessage() {
		return USER_NAME_CANT_BE_SET_TO_EMPTY;
	}

	public String getUserNoSpaceInNameMessage() {
		return USER_NAME_CANT_CONTAIN_A_SPACE;
	}

	public String getUserNoEmptyDomainMessage() {
		return USER_DOMAIN_NAME_CANT_BE_EMPTY;
	}

	public String getUserNoEmptyPasswordMessage() {
		return USER_PASSWORD_CAN_T_BE_EMPTY;
	}

	public String getUserGroupEmptyRoleError() {
		return USER_GROUP_EMPTY_ROLE_TO_USER_GROUP;
	}

	public String getUserRelationsEmptyGroupError() {
		return USER_RELATIONS_EMPTY_GROUP;
	}

	public String getUserRelationsEmptyRoleError() {
		return USER_RELATIONS_EMPTY_ROLE;
	}

	public String getEMailRequiresADestAddress() {
		return EMAIL_REQUIRES_A_DESTINATION_ADDRESS;
	}

	public String getEMailRequiresAFromAddress() {
		return EMAIL_REQUIRES_A_FROM_ADDRESS;
	}

	public String getEMailRequiresAValidAddress() {
		return EMAIL_ADDRESS_IS_NOT_VALID;
	}

	public String getEMailRequiresAValidFromAddress() {
		return EMAIL_REQUIRES_A_VALID_FROM_ADDRESS;
	}

	public String getEMailRequiresANonNullAttachemt() {
		return EMAIL_ATTACHEMNT_MAY_NOT_BE_NULL;
	}

	public String getEMailRequiresAValidAttachemt() {
		return EMAIL_ATTACHMENT_MAY_NOT_BE_EMPTY;
	}

	public String getPersonNoFirstNameError() {
		return PERSON_A_FIRST_NAME_IS_REQUIRED;
	}

	public String getPersonNoMiddleNameError() {
		return PERSON_A_MIDDLE_NAME_IS_REQUIRED;
	}

	public String getPersonNoLastNameError() {
		return PERSON_A_LAST_NAME_IS_REQUIRED;
	}

	public String getPersonNoNickNameError() {
		return PERSON_A_NICK_NAME_IS_REQUIRED;
	}

	public String getPersonMustBeAKnownGenderType() {
		return PERSON_GENDER_IS_NOT_VALID;
	}

	public String getEndOfDateRangeMustBeAfterStart() {
		return THE_END_OF_THE_DATE_RANGE_MUST_BE_AFTER_THE_START;
	}

	public String getStartOfDateRangeMustBeBeforeEnd() {
		return THE_START_OF_THE_DATE_RANGE_MUST_BE_BEFORE_THE_END;
	}

	public String getDateRangeRequiresStartValue() {
		return A_START_VALUE_OF_THE_DATE_RANGE_IS_REQUIRED;
	}

	public String getDateRangeRequiresEndValue() {
		return A_END_VALUE_OF_THE_DATE_RANGE_IS_REQUIRED;
	}

}


text:
/**
 * Installs KylePay payment app.
 * @param {String} method - The payment method name that this app supports.
 * @return {string} The 'success' or error message.
 */
async function install(method) { // eslint-disable-line no-unused-vars
  try {
    let registration = await navigator.serviceWorker.getRegistration('app.js');
    if (registration) {
      return 'The payment handler is already installed.';
    }
    await navigator.serviceWorker.register('app.js');
    registration = await navigator.serviceWorker.ready;
    if (!registration.paymentManager) {
      return 'PaymentManager API not found.';
    }
    if (!registration.paymentManager.enableDelegations) {
      return 'PaymentManager does not support enableDelegations method';
    }
    await registration.paymentManager.enableDelegations(
        ['shippingAddress', 'payerName', 'payerEmail', 'payerPhone']);
    await registration.paymentManager.instruments.set('instrument-id', {
      name: 'Kyle Pay',
      method,
    });
    return 'success';
  } catch (e) {
    return e.toString();
  }
}


text:
using System;
using System.Linq.Expressions;

struct S<T> where T : struct
{
	public static int Test ()
	{
		Expression<Func<T?, bool>> e = (T? o) => o == null;
		if (!e.Compile ().Invoke (null))
			return 1;

		if (e.Compile ().Invoke (default (T)))
			return 2;

		Console.WriteLine ("OK");
		return 0;
	}
}

class C
{
	public static int Main()
	{
		return S<int>.Test ();
	}
}


text:
import { createContext, useMemo, useRef, useState } from 'react';
import { MESSAGE_MAP } from '@isrd-isi-edu/chaise/src/utils/message-map';

// TODO should we move the types to somewhere else?

export enum ChaiseAlertType {
  SUCCESS = 'success',
  ERROR = 'error',
  WARNING = 'warning',
  INFO = 'info'
}

/**
 * mapping from our definition of alert type to bootstrap version.
 * NOTE our definition of alert type is used as a title. so it should be human-readble
 * for example error instead of danger.
 */
export const CHAISE_ALERT_TYPE_MAPPING: { [key: string]: string } = {
  'success': 'success',
  'error': 'danger',
  'warning': 'warning',
  'info': 'info'
};

export type ChaiseAlert = {
  message: string,
  type: ChaiseAlertType
  onRemove?: () => void,
  isSessionExpiredAlert?: boolean
};

type AddAlertFunction = (
  message: string,
  type: ChaiseAlertType,
  onRemove?: () => void,
  isSessionExpiredAlert?: boolean,
) => ChaiseAlert;

type RemoveAlertFunction = (
  alert: ChaiseAlert
) => void;

export const AlertsContext = createContext<{
  alerts: ChaiseAlert[],
  addAlert: AddAlertFunction,
  removeAlert: RemoveAlertFunction,
  addURLLimitAlert: () => void,
  removeURLLimitAlert: () => void,
} |
  // NOTE: since it can be null, to make sure the context is used properly with
  //       a provider, the useRecordset hook will throw an error if it's null.
  null>(null);

type AlertsProviderProps = {
  children: React.ReactNode,
}

/**
 * The provider that ensures errors are captured.
 * The whole app should be wrapped in this provider. and if we need local display of
 * alerts (for example recordset popup, then we should also call the provider again locally).
 * Alerts component can be used to show the errors.
 */
export default function AlertsProvider({ children }: AlertsProviderProps): JSX.Element {
  const [alerts, setAlerts] = useState<ChaiseAlert[]>([]);
  // const [urlLimitAlert, setURLLimitAlert] = useState<ChaiseAlert|null>(null);
  const urlLimitAlert = useRef<ChaiseAlert|null>(null);

  /**
   * create add an alert
   * @param message the message that will be displayed
   * @param type type of message
   * @param onRemove the callback that will be called when the users remove the alert.
   * @return the newly created alert
   */
  const addAlert: AddAlertFunction = (message: string, type: ChaiseAlertType, onRemove?: () => void, isSessionExpiredAlert?: boolean) => {
    const newAlert = { message, type, onRemove, isSessionExpiredAlert };
    setAlerts((alerts) => [...alerts, newAlert]);
    return newAlert;
  };

  /**
   * remove a given alert from the list of alerts
   * @param alert the alert that should be removed
   */
  const removeAlert: RemoveAlertFunction = (alert: ChaiseAlert) => {
    setAlerts(
      (prev: ChaiseAlert[]) => {
        if (alert.onRemove) alert.onRemove();
        return prev.filter((al: ChaiseAlert) => {
          return alert !== al;
        })
      }
    )
  };

  /**
   * Display the URL limit alert
   * (we want to ensure only one alert is displayed at the time)
   */
  const addURLLimitAlert = () => {
    // if (urlLimitAlert) return;
    if (urlLimitAlert.current) return;
    // setURLLimitAlert(
      urlLimitAlert.current = addAlert(MESSAGE_MAP.URLLimitMessage, ChaiseAlertType.WARNING, () => urlLimitAlert.current = null)
    // );
  };

  /**
   * Remove the URL limit alert
   */
  const removeURLLimitAlert = () => {
    if (!urlLimitAlert.current) return;
    removeAlert(urlLimitAlert.current);
    urlLimitAlert.current = null;
    // setURLLimitAlert(null);
  }

  const providerValue = useMemo(() => {
    return {
      alerts,
      addAlert,
      removeAlert,
      addURLLimitAlert,
      removeURLLimitAlert
    }
  }, [alerts]);

  return (
    <AlertsContext.Provider value={providerValue}>
      {children}
    </AlertsContext.Provider>
  )
}


text:
layout: post

#event information
title:  "Meet A Nobel Laureate"
cover: "/images/Einstein_Memorial.jpg"
attribution:
  name: "Einstein Memorial"
  license: "CC BY 2.5"
  name_url: "https://he.wikipedia.org/wiki/%D7%A7%D7%95%D7%91%D7%A5:Einstein_Memorial.jpg"
  license_url: "https://creativecommons.org/licenses/by/2.5"
date:   "2016-07-16 11:00"
endDate:   "2016-07-16 14:00"
creation: "2016-07-14"
start_time: "11:00 AM"
end_time: "2:00 PM"
location:
  name: "Albert Einstein Memorial"
  address:
    - "2101 Constitution Avenue NW"
  city: Washington
  state: DC
  zip: 20418
tags: [ 'Koshland Science Museum', 'Family Events' ]
excerpt: >
  Meet up at the Albert Einstein Memorial on Saturday July 16 for your chance
  to talk with astrophysicist John C. Mather, the 2006 Nobel Prize winner in
  Physics. Want to know more about the big-bang theory? Interested in the work
  that goes on at the NASA Goddard Space Flight Center? Then stop by for a
  chat! This event will also feature hands-on science activities from the
  Society of Physics Students.

---

Meet up at the Albert Einstein Memorial for your chance to talk with
astrophysicist John C. Mather, the 2006 Nobel Prize winner in Physics. Want to
know more about the big-bang theory? Interested in the work that goes on at the
NASA Goddard Space Flight Center? Then stop by for a chat! This event will also
feature hands-on science activities from the Society of Physics Students.

The event is free and open to the public. [Registration is recommended](https://www.eventbrite.com/e/meet-a-nobel-laureate-einstein-memorial-pop-up-tickets-24099808175) but not required.


text:
using System;
using System.Collections;

using NBitcoin.BouncyCastle.Asn1;
using NBitcoin.BouncyCastle.Asn1.Nist;
using NBitcoin.BouncyCastle.Asn1.Pkcs;
using NBitcoin.BouncyCastle.Asn1.X9;
using NBitcoin.BouncyCastle.Crypto.Agreement.Kdf;
using NBitcoin.BouncyCastle.Crypto.Parameters;
using NBitcoin.BouncyCastle.Math;
using NBitcoin.BouncyCastle.Security;

namespace NBitcoin.BouncyCastle.Crypto.Agreement
{
	public class ECMqvWithKdfBasicAgreement
		: ECMqvBasicAgreement
	{
		private readonly string algorithm;
		private readonly IDerivationFunction kdf;

		public ECMqvWithKdfBasicAgreement(
			string				algorithm,
			IDerivationFunction	kdf)
		{
			if (algorithm == null)
				throw new ArgumentNullException("algorithm");
			if (kdf == null)
				throw new ArgumentNullException("kdf");

			this.algorithm = algorithm;
			this.kdf = kdf;
		}

		public override BigInteger CalculateAgreement(
			ICipherParameters pubKey)
		{
			// Note that the ec.KeyAgreement class in JCE only uses kdf in one
			// of the engineGenerateSecret methods.

			BigInteger result = base.CalculateAgreement(pubKey);

			int keySize = GeneratorUtilities.GetDefaultKeySize(algorithm);

			DHKdfParameters dhKdfParams = new DHKdfParameters(
				new DerObjectIdentifier(algorithm),
				keySize,
				BigIntToBytes(result));

			kdf.Init(dhKdfParams);

			byte[] keyBytes = new byte[keySize / 8];
			kdf.GenerateBytes(keyBytes, 0, keyBytes.Length);

			return new BigInteger(1, keyBytes);
		}

		private byte[] BigIntToBytes(BigInteger r)
		{
			int byteLength = X9IntegerConverter.GetByteLength(privParams.StaticPrivateKey.Parameters.Curve);
			return X9IntegerConverter.IntegerToBytes(r, byteLength);
		}
	}
}


text:
namespace BraillIOExample
{
    partial class Form1
    {
        /// <summary>
        /// Erforderliche Designervariable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Verwendete Ressourcen bereinigen.
        /// </summary>
        /// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Vom Windows Form-Designer generierter Code

        /// <summary>
        /// Erforderliche Methode für die Designerunterstützung.
        /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.timer_screenCaptureUpdate = new System.Windows.Forms.Timer(this.components);
            this.SuspendLayout();
            //
            // timer_screenCaptureUpdate
            //
            this.timer_screenCaptureUpdate.Interval = 500;
            this.timer_screenCaptureUpdate.Tick += new System.EventHandler(this.timer_screenCaptureUpdate_Tick);
            //
            // Form1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(196, 19);
            this.Name = "Form1";
            this.Text = "Form1";
            this.WindowState = System.Windows.Forms.FormWindowState.Minimized;
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.Timer timer_screenCaptureUpdate;
    }
}


text: This is an example of how to run through creating branches and pull requests.


text:
const argv = require('minimist')(process.argv);

exports.getEnvName = () => {
	return argv.env || 'development';
};

exports.beepSound = () => {
	process.stdout.write('\u0007');
};


text:
package org.edx.mobile.test.http;

import org.edx.mobile.model.api.ProfileModel;
import org.junit.Test;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assume.assumeFalse;

/**
 * This class contains unit tests for API calls to server.
 *
 * if we run it in the CI of github, we can not provide the credential to
 * make the service call.
 * unless we find a way to handle it,  we will disable all the testing agaist
 * real webservice right now
 *
 */
public class SocialLoginTests extends HttpBaseTestCase  {

    @Override
    public void setUp() throws Exception {
        super.setUp();
    }

    @Test
    public void testGetProfile() throws Exception {
        assumeFalse(shouldSkipTest);

        ProfileModel profile = api.getProfile();
        assertNotNull(profile);
        assertNotNull("profile.email cannot be null", profile.email);
        print("finished getProfile");
    }
}