text:
<?php

/**
 * CloudBanking Abstract Request.
 */

namespace Omnipay\CloudBanking\Message;

use Omnipay\Common\Message\ResponseInterface;

/**
 * CloudBanking Abstract Request.
 *
 * This is the parent class for all CloudBanking requests.
 *
 * Test modes:
 *
 * CloudBanking accounts have test-mode API keys as well as live-mode
 * API keys. These keys can be active at the same time. Data
 * created with test-mode credentials will never hit the credit
 * card networks and will never cost anyone money.
 *
 * Unlike some gateways, there is no test mode endpoint separate
 * to the live mode endpoint, the CloudBanking API endpoint is the same
 * for test and for live.
 *
 * Setting the testMode flag on this gateway has no effect.  To
 * use test mode just use your test mode API key.
 *
 * You can use any of the cards listed at https://CloudBanking.com/docs/testing
 * for testing.
 *
 * @see \Omnipay\CloudBanking\Gateway
 * @link https://api.cloudbanking.com.au/
 */
abstract class AbstractRequest extends \Omnipay\Common\Message\AbstractRequest
{
    /**
     * Live or Test Endpoint URL.
     *
     * @var string URL
     */
    private $endpoint = 'https://api.cloudbanking.com.au/version';

    /**
     * Get the gateway endpoint with version.
     *
     * @return string
     */
    protected function getEndpointWithVersion()
    {
        return $this->endpoint . $this->getParameter('apiVersion');
    }

    /**
     * Get the gateway API Key.
     *
     * @return string
     */
    public function getAuthkey()
    {
        return $this->getParameter('authkey');
    }

    /**
     * Set the gateway API Key.
     *
     * @return AbstractRequest provides a fluent interface.
     */
    public function setAuthkey($value)
    {
        return $this->setParameter('authkey', $value);
    }

    /**
     * Get the gateway API version.
     *
     * @return string
     */
    public function getApiVersion()
    {
        return $this->getParameter('apiVersion');
    }

    /**
     * Set the gateway API Version.
     *
     * @return AbstractRequest provides a fluent interface.
     */
    public function setApiVersion($value)
    {
        return $this->setParameter('apiVersion', $value);
    }

    /**
     * Get the customer reference.
     *
     * @return string
     */
    public function getCustomerReference()
    {
        return $this->getParameter('customerReference');
    }

    /**
     * Set the customer reference.
     *
     * Used when calling CreateCard on an existing customer.  If this
     * parameter is not set then a new customer is created.
     *
     * @return AbstractRequest provides a fluent interface.
     */
    public function setCustomerReference($value)
    {
        return $this->setParameter('customerReference', $value);
    }

    /**
     * Get the card nickname.
     *
     * @return string
     */
    public function getCardNickname()
    {
        return $this->getParameter('cardNickname');
    }

    /**
     * Set the card nick name.
     *
     * Used when calling CreateCard on an existing customer.  If this
     * parameter is not set then a new customer is created.
     *
     * @return AbstractRequest provides a fluent interface.
     */
    public function setCardNickname($value)
    {
        return $this->setParameter('cardNickname', $value);
    }

    abstract public function getEndpoint();

    /**
     * Get HTTP Method.
     *
     * This is nearly always POST but can be over-ridden in sub classes.
     *
     * @return string
     */
    public function getHttpMethod()
    {
        return 'POST';
    }
    /**
     * @param       $data
     * @param array $headers
     *
     * @return \Guzzle\Http\Message\RequestInterface
     */
    protected function createClientRequest($data, array $headers = null)
    {
        $config                          = $this->httpClient->getConfig();
        $curlOptions                     = $config->get('curl.options');
        $curlOptions[CURLOPT_SSLVERSION] = 6;
        $config->set('curl.options', $curlOptions);
        $this->httpClient->setConfig($config);
        $httpRequest = $this->httpClient->createRequest(
            $this->getHttpMethod(),
            $this->getEndpoint(),
            $headers,
            $data
        );

        return $httpRequest;
    }

    /**
     * @return array
     */
    public function getHeaders()
    {
        return $this->getParameter('headers');
    }

    /**
     * Set http headers.
     *
     * Used to send the headers array in the http request.
     *
     * @param array $value
     *
     * @return AbstractRequest provides a fluent interface.
     */
    public function setHeaders($value)
    {
        return $this->setParameter('headers', $value);
    }

     /**
     * {@inheritdoc}
     */
    public function sendData($data)
    {
        $card = $this->getCard();
        $card->validate();
        $data['authkey'] = $this->getAuthkey();
        if ($this->getCustomerReference()) {
            $data['customerid'] = $this->getCustomerReference();
        } else {
            $this->validate('customerReference');
        }

        $httpRequest  = $this->createClientRequest($data, $this->getHeaders());
        $httpResponse = $httpRequest->send();

        $this->response = new Response($this, $httpResponse->json());

        // if ($httpResponse->hasHeader('Request-Id')) {
        //     $this->response->setRequestId((string) $httpResponse->getHeader('Request-Id'));
        // }

        return $this->response;
    }

    /**
     * Get the card data.
     *
     * Because the CloudBanking gateway uses a common format for passing
     * card data to the API, this function can be called to get the
     * data from the associated card object in the format that the
     * API requires.
     *
     * @return array
     */
    protected function getCardData()
    {
        $card = $this->getCard();
        $card->validate();

        $data = array();
        $data['object'] = 'card';
        $data['number'] = $card->getNumber();
        $data['exp_month'] = $card->getExpiryMonth();
        $data['exp_year'] = $card->getExpiryYear();
        if ($card->getCvv()) {
            $data['cvc'] = $card->getCvv();
        }
        $data['name'] = $card->getName();
        $data['address_line1'] = $card->getAddress1();
        $data['address_line2'] = $card->getAddress2();
        $data['address_city'] = $card->getCity();
        $data['address_zip'] = $card->getPostcode();
        $data['address_state'] = $card->getState();
        $data['address_country'] = $card->getCountry();
        $data['email']           = $card->getEmail();

        return $data;
    }
}


text:
package com.h6ah4i.android.example.verticalseekbar;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

public class MainActivity extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
}

redpajama_set_name: RedPajamaGithub


text:
namespace {

// Print an event to the chromium log.
void Log(media::MediaLogEvent* event) {
  if (event->type == media::MediaLogEvent::PIPELINE_ERROR) {
    LOG(ERROR) << "MediaEvent: "
               << media::MediaLog::MediaEventToLogString(*event);
  } else if (event->type != media::MediaLogEvent::BUFFERED_EXTENTS_CHANGED &&
             event->type != media::MediaLogEvent::PROPERTY_CHANGE &&
             event->type != media::MediaLogEvent::NETWORK_ACTIVITY_SET) {
    DVLOG(1) << "MediaEvent: "
             << media::MediaLog::MediaEventToLogString(*event);
  }
}

}  // namespace

namespace content {

RenderMediaLog::RenderMediaLog(const GURL& security_origin)
    : security_origin_(security_origin),
      task_runner_(base::ThreadTaskRunnerHandle::Get()),
      tick_clock_(new base::DefaultTickClock()),
      last_ipc_send_time_(tick_clock_->NowTicks()),
      ipc_send_pending_(false) {
  DCHECK(RenderThread::Get())
      << "RenderMediaLog must be constructed on the render thread";
}

void RenderMediaLog::AddEvent(std::unique_ptr<media::MediaLogEvent> event) {
  Log(event.get());

  // For enforcing delay until it's been a second since the last ipc message was
  // sent.
  base::TimeDelta delay_for_next_ipc_send;

  {
    base::AutoLock auto_lock(lock_);

    switch (event->type) {
      case media::MediaLogEvent::BUFFERED_EXTENTS_CHANGED:
        // Keep track of the latest buffered extents properties to avoid sending
        // thousands of events over IPC. See http://crbug.com/352585 for
        // details.
        last_buffered_extents_changed_event_.swap(event);
        // SendQueuedMediaEvents() will enqueue the most recent event of this
        // kind, if any, prior to sending the event batch.
        break;

      // Hold onto the most recent PIPELINE_ERROR and MEDIA_LOG_ERROR_ENTRY for
      // use in GetLastErrorMessage().
      case media::MediaLogEvent::PIPELINE_ERROR:
        queued_media_events_.push_back(*event);
        last_pipeline_error_.swap(event);
        break;
      case media::MediaLogEvent::MEDIA_ERROR_LOG_ENTRY:
        queued_media_events_.push_back(*event);
        last_media_error_log_entry_.swap(event);
        break;

      // Just enqueue all other event types for throttled transmission.
      default:
        queued_media_events_.push_back(*event);
    }

    if (ipc_send_pending_)
      return;

    ipc_send_pending_ = true;
    delay_for_next_ipc_send = base::TimeDelta::FromSeconds(1) -
                              (tick_clock_->NowTicks() - last_ipc_send_time_);
  }

  if (delay_for_next_ipc_send > base::TimeDelta()) {
    task_runner_->PostDelayedTask(
        FROM_HERE, base::Bind(&RenderMediaLog::SendQueuedMediaEvents, this),
        delay_for_next_ipc_send);
    return;
  }

  // It's been more than a second so send ASAP.
  if (task_runner_->BelongsToCurrentThread()) {
    SendQueuedMediaEvents();
    return;
  }
  task_runner_->PostTask(
      FROM_HERE, base::Bind(&RenderMediaLog::SendQueuedMediaEvents, this));
}

std::string RenderMediaLog::GetLastErrorMessage() {
  base::AutoLock auto_lock(lock_);

  // Return the conditional concatenation of the last pipeline error and the
  // last media error log.
  std::stringstream result;
  if (last_pipeline_error_) {
    result << MediaEventToLogString(*last_pipeline_error_)
           << (last_media_error_log_entry_ ? ", " : "");
  }
  if (last_media_error_log_entry_)
    result << MediaEventToLogString(*last_media_error_log_entry_);
  return result.str();
}

void RenderMediaLog::RecordRapporWithSecurityOrigin(const std::string& metric) {
  if (!task_runner_->BelongsToCurrentThread()) {
    task_runner_->PostTask(
        FROM_HERE, base::Bind(&RenderMediaLog::RecordRapporWithSecurityOrigin,
                              this, metric));
    return;
  }

  GetContentClient()->renderer()->RecordRapporURL(metric, security_origin_);
}

void RenderMediaLog::SendQueuedMediaEvents() {
  DCHECK(task_runner_->BelongsToCurrentThread());

  std::vector<media::MediaLogEvent> events_to_send;
  {
    base::AutoLock auto_lock(lock_);

    DCHECK(ipc_send_pending_);
    ipc_send_pending_ = false;

    if (last_buffered_extents_changed_event_) {
      queued_media_events_.push_back(*last_buffered_extents_changed_event_);
      last_buffered_extents_changed_event_.reset();
    }

    queued_media_events_.swap(events_to_send);
    last_ipc_send_time_ = tick_clock_->NowTicks();
  }

  RenderThread::Get()->Send(new ViewHostMsg_MediaLogEvents(events_to_send));
}

RenderMediaLog::~RenderMediaLog() {
}

void RenderMediaLog::SetTickClockForTesting(
    std::unique_ptr<base::TickClock> tick_clock) {
  base::AutoLock auto_lock(lock_);
  tick_clock_.swap(tick_clock);
  last_ipc_send_time_ = tick_clock_->NowTicks();
}

void RenderMediaLog::SetTaskRunnerForTesting(
    const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) {
  task_runner_ = task_runner;
}

}  // namespace content


text:
package com.amazonaws.services.appflow.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.appflow.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * S3SourcePropertiesMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class S3SourcePropertiesMarshaller {

    private static final MarshallingInfo<String> BUCKETNAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("bucketName").build();
    private static final MarshallingInfo<String> BUCKETPREFIX_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("bucketPrefix").build();
    private static final MarshallingInfo<StructuredPojo> S3INPUTFORMATCONFIG_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("s3InputFormatConfig").build();

    private static final S3SourcePropertiesMarshaller instance = new S3SourcePropertiesMarshaller();

    public static S3SourcePropertiesMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(S3SourceProperties s3SourceProperties, ProtocolMarshaller protocolMarshaller) {

        if (s3SourceProperties == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(s3SourceProperties.getBucketName(), BUCKETNAME_BINDING);
            protocolMarshaller.marshall(s3SourceProperties.getBucketPrefix(), BUCKETPREFIX_BINDING);
            protocolMarshaller.marshall(s3SourceProperties.getS3InputFormatConfig(), S3INPUTFORMATCONFIG_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
#ifndef WEBRTC_VIDEO_ENGINE_TEST_COMMON_LINUX_GLX_RENDERER_H_
#define WEBRTC_VIDEO_ENGINE_TEST_COMMON_LINUX_GLX_RENDERER_H_

#include <GL/glx.h>
#include <X11/Xlib.h>

#include "webrtc/video_engine/test/common/gl/gl_renderer.h"
#include "webrtc/typedefs.h"

namespace webrtc {
namespace test {

class GlxRenderer : public GlRenderer {
 public:
  static GlxRenderer* Create(const char* window_title, size_t width,
                             size_t height);
  virtual ~GlxRenderer();

  virtual void RenderFrame(const webrtc::I420VideoFrame& frame, int delta)
      OVERRIDE;
 private:
  GlxRenderer(size_t width, size_t height);

  bool Init(const char* window_title);
  void Resize(size_t width, size_t height);
  void Destroy();

  size_t width_, height_;

  Display* display_;
  Window window_;
  GLXContext context_;
};
}  // test
}  // webrtc

#endif  // WEBRTC_VIDEO_ENGINE_TEST_COMMON_LINUX_GLX_RENDERER_H_


text:
import re
from pathlib import Path

regex = r"(?:.*/)?(?P<firstname>[^/]*) (?P<lastname>[^/]*)_(?P<moodleid>\d*)_\w*/?.*"
#compileing the regex is optional. It is a performance optimization.
cmp_regex = re.compile(regex)

def parseSub(file_path):
    file_path = Path(file_path).as_posix()
    m = re.match(cmp_regex, file_path)
    if m:
      return {
          'last_name' : m.group('lastname'),
          'first_name' : m.group('firstname'),
          'moodle_id' : m.group('moodleid')
      }
    else:
      return {
          'last_name' : '',
          'first_name' : '',
          'moodle_id' : ''
          }

def test():
    test1 = "firstname lastname_1128269_HW2/"
    test2 = "firstname(alternatefirstname) lastname_1093811_HW2/"
    test3 = "stuff/directories/firstname lastname_1128269_HW2/"
    test4 = "stuff/directories/firstname lastname_1128269_HW2/stuffagain/file.py"
    test5 = "stuff/directories/firstname(alternatefirstname) lastname_1093811_HW2/moredire/file.py"
    test6 = ""

    for test in [test1, test2, test3, test4, test5, test6]:
        print(parseSub(test))


text:
from pytest import mark

from engine import Executor
from tests.conftest import Dummy, dummy_invalid_state_volume

class TestExecutor:
    def test_initial_state(self, executor, volume_manager, machine_manager):
        assert executor.volume_manager == volume_manager
        assert executor.machine_manager == machine_manager
        assert executor.delay == 0

        assert executor._should_reset
        assert executor._volumes_to_process == []
        assert executor._watch_index is None

    @mark.parametrize('context', [{'timeout': 'a'}, {}])
    def test_initial_state_wrong_timeout(self, context, volume_manager, machine_manager, p_print):
        executor = Executor(volume_manager, machine_manager, context)

        assert executor.delay == 10
        assert p_print.called

    def test_timeout(self, executor, p_time_sleep):
        executor.timeout()

        p_time_sleep.assert_called_with(executor.delay)

    def test_reset(self, executor):
        executor._should_reset = False
        executor._watch_index = 1

        executor.reset()

        assert executor._should_reset
        assert executor._watch_index is None

    @mark.usefixtures('p_print')
    @mark.parametrize('volume,next_state', [
        [Dummy(value={'control': {'parent_id': ''},
                      'requested': {'reserved_size': 1},
                      'actual': {'reserved_size': 1, 'random': 2}}), 'error'],
        [Dummy(value={'control': {'parent_id': ''},
                      'requested': {'reserved_size': 1},
                      'actual': {'reserved_size': 1}}), 'ready'],
        [Dummy(value={'control': {'parent_id': ''},
                      'requested': {'reserved_size': 1},
                      'actual': {'reserved_size': 2}}), 'resizing'],
        [Dummy(value={'control': {'parent_id': '1'}}), 'cloning']
    ])
    def test_next_state(self, volume, next_state, executor):
        got_state = executor._next_state(volume)
        assert got_state == next_state

    def test_tick_with_reset(self, mocker, executor, p_executor_process, p_volume_manager_all):
        directory = mocker.MagicMock(etcd_index=0)
        volume = mocker.MagicMock()
        p_volume_manager_all.return_value = (directory, [volume])

        executor.tick()

        p_executor_process.assert_called_with(volume)
        assert p_volume_manager_all.called
        assert executor._volumes_to_process == []
        assert executor._watch_index == 1

    def test_tick_with_reset_no_dir(self, mocker, executor, p_executor_process, p_volume_manager_all):
        volume = mocker.MagicMock()
        p_volume_manager_all.return_value = (None, [volume])

        executor.tick()

        p_executor_process.assert_called_with(volume)
        assert p_volume_manager_all.called
        assert executor._volumes_to_process == []
        assert executor._watch_index is None

    @mark.parametrize('initial_index', [None, 1])
    def test_tick_watch_initial_index(self, mocker, executor, p_executor_process, p_volume_manager_all,
                                      p_volume_manager_watch, initial_index):
        index = 2
        volume = mocker.MagicMock(modifiedIndex=2)
        p_volume_manager_all.return_value = (None, [])
        p_volume_manager_watch.return_value = volume

        executor._watch_index = initial_index
        executor.tick()

        p_executor_process.assert_called_with(volume)
        p_volume_manager_watch.assert_called_with(index=initial_index, timeout=executor.delay)
        assert p_volume_manager_all.called
        assert executor._watch_index == index + 1

    def test_tick_watch_timeout(self, mocker, executor, p_executor_process, p_volume_manager_all,
                                p_volume_manager_watch):
        p_volume_manager_all.return_value = (None, [])
        p_volume_manager_watch.return_value = None
        executor.reset = mocker.MagicMock()

        executor.tick()

        p_volume_manager_watch.assert_called_with(index=None, timeout=executor.delay)
        assert p_volume_manager_all.called
        assert executor.reset.called
        assert not p_executor_process.called

    @mark.parametrize('watch_action', ['expire', 'delete'])
    def test_tick_watch_deleting_expire_action(self, mocker, executor, p_executor_process, p_volume_manager_all,
                                               p_volume_manager_watch, watch_action):
        p_volume_manager_all.return_value = (None, [])
        p_volume_manager_watch.return_value = mocker.MagicMock(action=watch_action, modifiedIndex=1)

        executor.tick()

        p_volume_manager_watch.assert_called_with(index=None, timeout=executor.delay)
        assert p_volume_manager_all.called
        assert not p_executor_process.called

    def test_process_not_in_state(self, mocker, executor):
        executor._process_NONE = mocker.MagicMock()

        executor._process(dummy_invalid_state_volume)

        assert not executor._process_NONE.called


text:
package org.json.simple;

/** Represents structural entities in JSON.
 * @since 2.0.0 */
class Yytoken{
    /** Represents the different kinds of tokens. */
    enum Types{
        /** Tokens of this type will always have a value of ":" */
        COLON,
        /** Tokens of this type will always have a value of "," */
        COMMA,
        /** Tokens of this type will always have a value that is a boolean, null, number, or string. */
        DATUM,
        /** Tokens of this type will always have a value of "" */
        END,
        /** Tokens of this type will always have a value of "{" */
        LEFT_BRACE,
        /** Tokens of this type will always have a value of "[" */
        LEFT_SQUARE,
        /** Tokens of this type will always have a value of "}" */
        RIGHT_BRACE,
        /** Tokens of this type will always have a value of "]" */
        RIGHT_SQUARE;
    }

    private final Types  type;
    private final Object value;

    /** @param type represents the kind of token the instantiated token will be.
     * @param value represents the value the token is associated with, will be ignored unless type is equal to
     *        Types.DATUM.
     * @see Types */
    Yytoken(final Types type, final Object value){
        /* Sanity check. Make sure the value is ignored for the proper value unless it is a datum token. */
        switch(type){
            case COLON:
                this.value = ":";
                break;
            case COMMA:
                this.value = ",";
                break;
            case END:
                this.value = "";
                break;
            case LEFT_BRACE:
                this.value = "{";
                break;
            case LEFT_SQUARE:
                this.value = "[";
                break;
            case RIGHT_BRACE:
                this.value = "}";
                break;
            case RIGHT_SQUARE:
                this.value = "]";
                break;
            default:
                this.value = value;
                break;
        }
        this.type = type;
    }

    /** @return which of the Types the token is.
     * @see Types */
    Types getType(){
        return this.type;
    }

    /** @return what the token is.
     * @see Types */
    Object getValue(){
        return this.value;
    }

    @Override
    public String toString(){
        final StringBuffer sb = new StringBuffer();
        sb.append(this.type.toString()).append("(").append(this.value).append(")");
        return sb.toString();
    }
}


text:
package org.datasand.store;

import org.datasand.codec.BytesArray;
import org.datasand.codec.Encoder;
/**
 * @author - Sharon Aicler (saichler@gmail.com)
 */
public class DataLocation {

    private int parentIndex = -1;
    private int recordIndex = -1;
    private int startPosition = -1;
    private int length = -1;

    public DataLocation() {
    }

    public DataLocation(int _startPosition, int _length, int _recordIndex, int _parentIndex) {
        this.startPosition = _startPosition;
        this.length = _length;
        this.recordIndex = _recordIndex;
        this.parentIndex = _parentIndex;
    }

    public int getStartPosition() {
        return this.startPosition;
    }

    public int getLength() {
        return this.length;
    }

    public int getRecordIndex(){
        return this.recordIndex;
    }

    public int getParentIndex(){
        return this.parentIndex;
    }

    public void updateLocationInfo(int _startPosition,int _length){
        this.startPosition = _startPosition;
        this.length = _length;
    }

    public void encode(byte[] byteArray, int location) {
        Encoder.encodeInt32(this.startPosition, byteArray, location);
        Encoder.encodeInt32(this.length, byteArray, location + 4);
        Encoder.encodeInt32(this.recordIndex, byteArray,location+8);
        Encoder.encodeInt32(this.parentIndex, byteArray,location+12);
    }

    public void encode(BytesArray ba) {
        ba.adjustSize(16);
        encode(ba.getBytes(), ba.getLocation());
        ba.advance(16);
    }

    public static DataLocation decode(byte[] byteArray, int location) {
        return new DataLocation(Encoder.decodeInt32(byteArray,location),
                                Encoder.decodeInt32(byteArray, location + 4),
                                Encoder.decodeInt32(byteArray, location + 8),
                                Encoder.decodeInt32(byteArray, location + 12));
    }

    public static DataLocation decode(BytesArray ba) {
        DataLocation result = decode(ba.getBytes(), ba.getLocation());
        ba.advance(16);
        return result;
    }
}


text:
"""
You can run this example like this:

    .. code:: console

            $ luigi --module examples.execution_summary_example examples.EntryPoint --local-scheduler
            ...
            ... lots of spammy output
            ...
            INFO: There are 11 pending tasks unique to this worker
            INFO: Worker Worker(salt=843361665, workers=1, host=arash-spotify-T440s, username=arash, pid=18534) was stopped. Shutting down Keep-Alive thread
            INFO:
            ===== Luigi Execution Summary =====

            Scheduled 218 tasks of which:
            * 195 complete ones were encountered:
                - 195 examples.Bar(num=5...199)
            * 1 ran successfully:
                - 1 examples.Boom(...)
            * 22 were left pending, among these:
                * 1 were missing external dependencies:
                    - 1 MyExternal()
                * 21 had missing dependencies:
                    - 1 examples.EntryPoint()
                    - examples.Foo(num=100, num2=16) and 9 other examples.Foo
                    - 10 examples.DateTask(date=1998-03-23...1998-04-01, num=5)

            This progress looks :| because there were missing external dependencies

            ===== Luigi Execution Summary =====
"""

from __future__ import print_function
import datetime

import luigi

class MyExternal(luigi.ExternalTask):

    def complete(self):
        return False

class Boom(luigi.Task):
    task_namespace = 'examples'
    this_is_a_really_long_I_mean_way_too_long_and_annoying_parameter = luigi.IntParameter()

    def run(self):
        print("Running Boom")

    def requires(self):
        for i in range(5, 200):
            yield Bar(i)

class Foo(luigi.Task):
    task_namespace = 'examples'
    num = luigi.IntParameter()
    num2 = luigi.IntParameter()

    def run(self):
        print("Running Foo")

    def requires(self):
        yield MyExternal()
        yield Boom(0)

class Bar(luigi.Task):
    task_namespace = 'examples'
    num = luigi.IntParameter()

    def run(self):
        self.output().open('w').close()

    def output(self):
        return luigi.LocalTarget('/tmp/bar/%d' % self.num)

class DateTask(luigi.Task):
    task_namespace = 'examples'
    date = luigi.DateParameter()
    num = luigi.IntParameter()

    def run(self):
        print("Running DateTask")

    def requires(self):
        yield MyExternal()
        yield Boom(0)

class EntryPoint(luigi.Task):
    task_namespace = 'examples'

    def run(self):
        print("Running EntryPoint")

    def requires(self):
        for i in range(10):
            yield Foo(100, 2 * i)
        for i in range(10):
            yield DateTask(datetime.date(1998, 3, 23) + datetime.timedelta(days=i), 5)


text:
\documentclass[12pt]{beamer}\usepackage[]{graphicx}\usepackage[]{color}
%% maxwidth is the original width if it is less than linewidth
%% otherwise use linewidth (to make sure the graphics do not exceed the margin)
\makeatletter
\def\maxwidth{ %
  \ifdim\Gin@nat@width>\linewidth
    \linewidth
  \else
    \Gin@nat@width
  \fi
}
\makeatother

\definecolor{fgcolor}{rgb}{0.345, 0.345, 0.345}
\newcommand{\hlnum}[1]{\textcolor[rgb]{0.686,0.059,0.569}{#1}}%
\newcommand{\hlstr}[1]{\textcolor[rgb]{0.192,0.494,0.8}{#1}}%
\newcommand{\hlcom}[1]{\textcolor[rgb]{0.678,0.584,0.686}{\textit{#1}}}%
\newcommand{\hlopt}[1]{\textcolor[rgb]{0,0,0}{#1}}%
\newcommand{\hlstd}[1]{\textcolor[rgb]{0.345,0.345,0.345}{#1}}%
\newcommand{\hlkwa}[1]{\textcolor[rgb]{0.161,0.373,0.58}{\textbf{#1}}}%
\newcommand{\hlkwb}[1]{\textcolor[rgb]{0.69,0.353,0.396}{#1}}%
\newcommand{\hlkwc}[1]{\textcolor[rgb]{0.333,0.667,0.333}{#1}}%
\newcommand{\hlkwd}[1]{\textcolor[rgb]{0.737,0.353,0.396}{\textbf{#1}}}%

\usepackage{framed}
\makeatletter
\newenvironment{kframe}{%
 \def\at@end@of@kframe{}%
 \ifinner\ifhmode%
  \def\at@end@of@kframe{\end{minipage}}%
  \begin{minipage}{\columnwidth}%
 \fi\fi%
 \def\FrameCommand##1{\hskip\@totalleftmargin \hskip-\fboxsep
 \colorbox{shadecolor}{##1}\hskip-\fboxsep
     % There is no \\@totalrightmargin, so:
     \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%
 \MakeFramed {\advance\hsize-\width
   \@totalleftmargin\z@ \linewidth\hsize
   \@setminipage}}%
 {\par\unskip\endMakeFramed%
 \at@end@of@kframe}
\makeatother

\definecolor{shadecolor}{rgb}{.97, .97, .97}
\definecolor{messagecolor}{rgb}{0, 0, 0}
\definecolor{warningcolor}{rgb}{1, 0, 1}
\definecolor{errorcolor}{rgb}{1, 0, 0}
\newenvironment{knitrout}{}{} % an empty environment to be redefined in TeX

\usepackage{alltt}
\usepackage{graphicx}
\usepackage{tikz}
\setbeameroption{hide notes}
\setbeamertemplate{note page}[plain]
\usepackage{listings}

\input{../LaTeX/header.tex}

%------------------------------------------------
% end of header
%------------------------------------------------

\title{Command Line - Part 2}
\subtitle{STAT 133}
\author{\href{http://www.gastonsanchez.com}{Gaston Sanchez}}
\institute{Department of Statistics, UC{\textendash}Berkeley}
\date{\href{http://www.gastonsanchez.com}{\tt \scriptsize \color{foreground} gastonsanchez.com}
\\[-4pt]
\href{http://github.com/gastonstat}{\tt \scriptsize \color{foreground} github.com/gastonstat}
\\[-4pt]
{\scriptsize Course web: \href{http://www.gastonsanchez.com/stat133}{\tt gastonsanchez.com/stat133}}
}
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\begin{document}

{
  \setbeamertemplate{footline}{} % no page number here
  \frame{
    \titlepage
  }
}

%------------------------------------------------

\begin{frame}
\begin{center}
\Huge{\hilit{Standard Input and Output}}
\end{center}
\end{frame}

%------------------------------------------------

\begin{frame}
\frametitle{}

\begin{center}
\Large{Many commands accept {\hilit input} \\
and produce {\mdlit output}}
\end{center}

\end{frame}

%------------------------------------------------

\begin{frame}
\frametitle{Input}

Input can come from:
\bbi
  \item the keyboard (a.k.a. \textbf{standard input})
  \item other files
  \item other commands
\ei

\end{frame}

%------------------------------------------------

\begin{frame}
\frametitle{Output}

Output can be:
\bbi
  \item printed on screen
  \bi
    \item the command's results (a.k.a. \textbf{standard output})
    \item the status and error messages (a.k.a. \textbf{standard error})
  \ei
  \item written to files
  \item sent to other commands
\ei

\end{frame}

%------------------------------------------------

\begin{frame}
\frametitle{Output of commands}

\bi
  \item Consider the command \code{ls}
  \item \code{ls} sends the results to a special file called: \textit{standard output} or \textbf{stdout}
  \item \code{ls} sends status messages to another file called \textit{standard error} or \textbf{stderr}
  \item By default both \textit{stdout} and \textit{stderr} are linked to the screen and not saved into a disk file
\ei

\end{frame}

%------------------------------------------------

\begin{frame}
\frametitle{SI and SO}

\bbi
  \item The ``standard input'' is usually your keyboard
  \item The ``standard output'' is usually your terminal (monitor)
  \item But we can also redirect inputs and outputs
  \item I/O redirection allows us to change where output goes and where input comes from
  \item I/O redirection is done via the {\hilit \code{>}} redirection operator
\ei

\end{frame}

%------------------------------------------------

\begin{frame}
\begin{center}
\Huge{\hilit{Redirection Operator \code{>}}}
\end{center}
\end{frame}

%------------------------------------------------

\begin{frame}[fragile]
\frametitle{The \code{>} operator}

We can tell the shell to send the output of the \code{ls} command to the file \code{ls-output.txt}
\begin{knitrout}\footnotesize
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
ls -l ~/Documents > ls-output.txt
\end{alltt}
\end{kframe}
\end{knitrout}

\end{frame}

%------------------------------------------------

\begin{frame}[fragile]
\frametitle{The \code{>>} operator}

We can tell the shell to send the output of the \code{ls} command and append it to the file \code{ls-output.txt}
\begin{knitrout}\footnotesize
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
ls -l ~/Desktop >> ls-output.txt
\end{alltt}
\end{kframe}
\end{knitrout}

The contents in Desktop are appended to the file \code{ls-output.txt}

\end{frame}

%------------------------------------------------

\begin{frame}
\frametitle{Redirection}

\bbi
  \item[] {\hilit \code{>}} redirects STDOUT to a file
  \item[] {\hilit \code{<}} redirects STDIN from a file
  \item[] {\hilit \code{>>}} redirects STDOUT to a file, but appends rather than overwrites
  \item[] There is also {\hilit \code{<<}} but its use is more advanced than what we'll cover
\ei

\end{frame}

%------------------------------------------------

\begin{frame}
\frametitle{About Redirection}

\bbi
  \item Many times it is useful to send the output of a program to a file rather than to the screen
  \item Redirecting output to files is very common when extracting and combining data (think of merge!)
  \item Think of the redirection operator \code{">"} as an arrow that is pointing to where the output should go
\ei

\end{frame}

%------------------------------------------------

\begin{frame}[fragile]
\frametitle{Joining files with \code{cat}}

We can use {\hilit \code{cat}} and {\hilit \code{>}} to join two or more files:
\begin{knitrout}\footnotesize
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlcom{# remember the files from HW5?}
\hlcom{# (nflweather1960s.csv, ..., nflweather2010s.csv)}
ls nflweather*s.csv

\hlcom{# joining all the decades files in one single file}
cat nflweather*s.csv > allnfl.csv
\end{alltt}
\end{kframe}
\end{knitrout}

{\footnotesize The only issue here is that you would have appended column names}

\end{frame}

%------------------------------------------------

\begin{frame}
\frametitle{Joining files with \code{cat}}

Think about all the steps you would need to join the nfl-weather files without using the command line:
\bi
  \item You would have to open each file
  \item Open a new file \code{allnfl.csv}
  \item Start copy-pasting each adtaset into \code{allnfl.csv}
  \item Close all the decades files
  \item Save and close \code{allnfl.csv}
\ei

\end{frame}

%------------------------------------------------

\begin{frame}
\begin{center}
\Huge{\hilit{Redirection with pipes}}
\end{center}
\end{frame}

%------------------------------------------------

\begin{frame}
\frametitle{Redirection}

\bbi
  \item The idea behind pipes is that rather than redirecting output to a file, we redirect it into another command
  \item STDOUT of one command is used as STDIN to another command
  \item We can redirect inputs and outputs
  \item Redirection is done via the {\hilit \code{|}} pipe operator
\ei

\end{frame}

%------------------------------------------------

\begin{frame}[fragile]
\frametitle{Pipe example}

Let's say you want to count the number of \code{.csv} files in a specfic directory:
\begin{knitrout}\footnotesize
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlcom{# list csv files (one per line)}
\hlstd{ls} \hlopt{-}\hlnum{1} \hlopt{*}\hlstd{.csv}

\hlcom{# piping to count lines with 'wc -l'}
\hlcom{# (how many lines)}
\hlstd{ls} \hlopt{-}\hlnum{1} \hlopt{*}\hlstd{.csv} \hlopt{|} \hlstd{wc} \hlopt{-}\hlstd{l}
\end{alltt}
\end{kframe}
\end{knitrout}

The output of \code{ls -1} is piped to \code{wc -l}

\end{frame}

%------------------------------------------------

\begin{frame}[fragile]
\frametitle{Pipe example}

Let's say you want to inspect the contents of \code{/usr/bin}
\begin{knitrout}\footnotesize
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlcom{# long list of contents}
\hlstd{ls} \hlopt{/}\hlstd{usr}\hlopt{/}\hlstd{bin}

\hlcom{# using 'less' as a pager to see all the contents}
\hlstd{ls} \hlopt{/}\hlstd{usr}\hlopt{/}\hlstd{bin} \hlopt{|} \hlstd{less}
\end{alltt}
\end{kframe}
\end{knitrout}

The output of \code{ls} is piped to \code{less}

\end{frame}

%------------------------------------------------

\begin{frame}
\begin{center}
\Huge{\hilit{Command \code{grep}}}
\end{center}
\end{frame}

%------------------------------------------------

\begin{frame}
\frametitle{Regular Expressions with \code{grep}}

\bbi
  \item We can work with some regular expressions in the command line
  \item For that purpose we use the command {\hilit \code{grep}}
  \item \code{grep} can be very helpful for extracting particular rows from a file
\ei

\end{frame}

%------------------------------------------------

\begin{frame}[fragile]
\frametitle{\code{grep} example}

Consider the data \code{nflweather.csv}
\begin{knitrout}\footnotesize
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlcom{# rows containing Oakland (Raiders)}
grep \hlstr{'Oakland'} nflweather.csv

\hlcom{# rows from 2013}
grep \hlstr{'2013'} nflweather.csv
\end{alltt}
\end{kframe}
\end{knitrout}

\end{frame}

%------------------------------------------------

\begin{frame}[fragile]
\frametitle{\code{grep} example}

Consider the raw data \code{weather\_20131231.csv}
\begin{knitrout}\footnotesize
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlcom{# how many games in 2013}
grep \hlstr{'2013'} weather_20131231.csv | wc -l

\hlcom{# how many games in October 2013}
grep \hlstr{'10/[0-9]*/2013'} weather_20131231.csv | wc -l
\end{alltt}
\end{kframe}
\end{knitrout}

\end{frame}

%------------------------------------------------

\begin{frame}
\begin{center}
\Huge{\hilit{Command \code{curl}}}
\end{center}
\end{frame}

%------------------------------------------------

\begin{frame}
\frametitle{Command \code{curl}}

\bbi
  \item {\hilit \code{curl}} allows you to retrieve content from the Web
  \item \code{curl} stands for ``see URL''
  \item It access Internet files on your behalf, downling the content without any need of a browser window
\ei

\end{frame}

%------------------------------------------------

\begin{frame}[fragile]
\frametitle{\code{curl} example}

\begin{knitrout}\scriptsize
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlcom{# get the content of a URL}
curl \hlstr{"http://www.stat.berkeley.edu/~nolan/data/stat133/Saratoga.txt"}
\end{alltt}
\end{kframe}
\end{knitrout}

\end{frame}

%------------------------------------------------

\begin{frame}[fragile]
\frametitle{\code{curl} example}

\begin{knitrout}\scriptsize
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlcom{# get the content of a URL and save it to a file}
curl \hlstr{"http://www.stat.berkeley.edu/~nolan/data/stat133/Saratoga.txt"}
-o saratoga.txt

\hlcom{# equivalently}
curl \hlstr{"http://www.stat.berkeley.edu/~nolan/data/stat133/Saratoga.txt"}
> saratoga.txt
\end{alltt}
\end{kframe}
\end{knitrout}

\end{frame}

%------------------------------------------------

\begin{frame}
\begin{center}
\Huge{\hilit{Overview}}
\end{center}
\end{frame}

%------------------------------------------------

\begin{frame}
\frametitle{What good is it?}

\bbi
  \item Do I really need to learn these commands?
  \item The GUI file finder can do most of what we've seen (e.g. \code{ls}, \code{cd}, \code{mkdir}, \code{rmdir})
  \item Maybe it can't do what \code{cut} can do, but so what?
\ei

\end{frame}

%------------------------------------------------

\begin{frame}
\frametitle{Advantages of shell commands}

\bbi
  \item Shell commands gives us a programatic way to work with files and processes
  \item They allow you to \textbf{record} what you did
  \item They allow you to repeat it another time
  \item Volumne: Have many many operations to perform
  \item Speed: need to perform things quickly
  \item Less error prone: want to reduce mistakes
\ei

\end{frame}

%------------------------------------------------

\begin{frame}
\begin{center}
\Huge{\hilit{Command \code{cut}}}
\end{center}
\end{frame}

%------------------------------------------------

\begin{frame}
\frametitle{Command \code{cut}}

\bbi
  \item {\hilit \code{cut}} is most often used to extract columns of data from a field-delimited file
  \item They allow you to \textbf{record} what you did
  \item They allow you to repeat it another time
\ei

\end{frame}

%------------------------------------------------

\begin{frame}[fragile]
\frametitle{\code{cut} example}

\begin{knitrout}\scriptsize
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlcom{# 2nd column of a tab-separated file}
cut -f 2 starwarstoy.tsv

\hlcom{# 2nd column of a comma-separated file}
cut -f 2 -d \hlstr{","} starwarstoy.csv
\end{alltt}
\end{kframe}
\end{knitrout}

\end{frame}

%------------------------------------------------

\begin{frame}[fragile]
\frametitle{\code{cut} example}

\begin{knitrout}\scriptsize
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlcom{# columns 2-4 of a tab-separated file}
cut -f 2-4 starwarstoy.tsv

\hlcom{# columns 4-6 of a comma-separated file}
cut -f 4-6 -d \hlstr{","} starwarstoy.csv
\end{alltt}
\end{kframe}
\end{knitrout}

\end{frame}

%------------------------------------------------

\begin{frame}[fragile]
\frametitle{\code{cut} example}

\begin{knitrout}\scriptsize
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlcom{# columns 2-3 of first 10 rows in nflweather}
head -n 10 nflweather.csv | cut -f 2-4
\end{alltt}
\end{kframe}
\end{knitrout}

\end{frame}

%------------------------------------------------

\end{document}


text:
layout: post
title: v3.36.1 Released
date: 2017-08-18  01:00:00
categories: updates
---

We are pleased to announce the immediate release of Ilios **v3.36.1**. This minor point release provides a number of bugfixes and enhancements, notably the addition of the ability to view PDF materials either inline or as a download, and the inclusion of user calendars on every profile page.

The new Profile Calendar allows administrative users with proper privileges to review at a glance the actual live week by week calendar for any of their users. Just go to the Admin page (from the Ilios menu), search for the user you wish to review, and scroll down to the calendar. It will reflect exactly what the user is receiving in their personalized calendar experience in Ilios.

Please [download the most recent release](https://www.github.com/ilios/ilios/releases/latest){:target="_releases"} and update your frontend to take advantage of all the latest updates!


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.dashboard.models;

import com.azure.core.util.ExpandableStringEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.Collection;

/** Defines values for DeterministicOutboundIp. */
public final class DeterministicOutboundIp extends ExpandableStringEnum<DeterministicOutboundIp> {
    /** Static value Disabled for DeterministicOutboundIp. */
    public static final DeterministicOutboundIp DISABLED = fromString("Disabled");

    /** Static value Enabled for DeterministicOutboundIp. */
    public static final DeterministicOutboundIp ENABLED = fromString("Enabled");

    /**
     * Creates or finds a DeterministicOutboundIp from its string representation.
     *
     * @param name a name to look for.
     * @return the corresponding DeterministicOutboundIp.
     */
    @JsonCreator
    public static DeterministicOutboundIp fromString(String name) {
        return fromString(name, DeterministicOutboundIp.class);
    }

    /**
     * Gets known DeterministicOutboundIp values.
     *
     * @return known DeterministicOutboundIp values.
     */
    public static Collection<DeterministicOutboundIp> values() {
        return values(DeterministicOutboundIp.class);
    }
}


text:
Arguments
=========

A swift package for easily defining and retrieve command line arguments and values.

## Requirements
* Swift 2.2

## Installation

### SPM (Swift Package Manager)

To install via the swift package manager, add this line to your Package.swift file:

```
.Package(url: "https://github.com/elliott-minns/Arguments.git",
                 majorVersion: 1),
```

## Usage

To use arguments, first you need to define a set of options that you want your application to expect.

To do this, it is recommended to use an enum to specify the various options.
For example:

```
import Arguments

enum ExampleOptions {

    case Force

    case URL

    case Timeout
}

```

You then need to extend the Options type imported from the Arguments module and implement the required properties.

```
extension ExampleOptions: Options {
    var type: OptionType {
        switch self {
        case .Force:
            return .Flag(short: "f", long: "force", hasValue: false, required: false)

        case .URL:
            return .Indexed(index: 0, required: true)

        case .Timeout:
            return .Flag(short: "t", long: "timeout", hasValue: true, required: false)
        }
    }
}
```

In the above example, the OptionTypes used are .Flag and .Indexed.

.Flag is used to describe a flag type argument. These usually follow the form of -f or --force and can either have a value afterwards or be a value themselves.

.Indexed is used to describe a parameter that must be passed in a certain order. They usually have no flag before them and tend to be the key point of the arguments.

Once you have set up the options you require, you then create an instance of Arguments and pass in the Option as the generic type, followed by the options you are looking for.

```
let arguments = Arguments<ExampleOptions>(options: [.Force, .URL, .Timeout])
```


text:
using namespace Ogitors;

//----------------------------------------------------------------------------
bool dllStartPlugin(void *identifier, Ogre::String& name)
{
    name = "AngelScript Editor Plugin";

    mScriptViewWidget = new ScriptViewWidget();

    ScriptTextEditorCodec::mToolBar = new ScriptTextEditorCodecToolBar("Script Actions");

	Ogitors::DockWidgetData dockWidgetData;
	dockWidgetData.mCaption = "AngleScripts";
    dockWidgetData.mHandle = mScriptViewWidget;
    dockWidgetData.mIcon = ":/icons/script.svg";
    dockWidgetData.mParent = DOCK_RESOURCES;

    ScriptTextEditorCodecFactory* scriptCodecFactory = new ScriptTextEditorCodecFactory();
    GenericTextEditor::getSingletonPtr()->registerCodecFactory("as", scriptCodecFactory);

    OgitorsRoot::getSingletonPtr()->RegisterDockWidget(identifier, dockWidgetData);

    return true;
}
//----------------------------------------------------------------------------
bool dllGetPluginName(Ogre::String& name)
{
    name = "AngelScript Editor Plugin";
    return true;
}
//----------------------------------------------------------------------------
bool dllStopPlugin(void)
{
    return true;
}
//----------------------------------------------------------------------------


text:
const {mapValues} = require('lodash');

const Action = require('./Action');

class Shipment {

    /**
     * @param {Object} [actions = []] Object of functions
     */
    constructor(actions = {}) {

        if (actions instanceof Shipment) return actions;

        this.actions = mapValues(actions, Action.transform);
    }
}

module.exports = Shipment;


text:
//
//  MDAMarvelAPIClient.h
//  Marvel API
//
//  Created by Karl Monaghan on 06/02/2014.
//  Copyright (c) 2014 Crayons and Brown Paper. All rights reserved.
//

#import "AFHTTPSessionManager.h"

/**
 *  A session manager to access the Marvel API.
 */
@interface MDAMarvelAPIClient : AFHTTPSessionManager
+ (instancetype)sharedClient;
/**
 *  Returns the parameteres needed for each request to the API.
 *
 *  @return dictionary with keys representing the paramter names.
 */
- (NSDictionary *)authParams;
/**
 *  Set the public and private keys to use for all requests.
 *
 *  @param publicKey    Your Marvel API public key.
 *  @param privateKey   Your Marvel API private key.
 *
 *  @see https://developer.marvel.com/documentation/authorization
 */
- (void)publicKey:(NSString *)publicKey privateKey:(NSString *)privateKey;
@end


text:
package org.w3c.odrl.W3COdrl2.datatypes;

public class QCode extends XsToken {

	public QCode(String val) throws DataTypeException {
	    super(val);

    }

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycologia 24: 96 (1932)

#### Original name
Uredo cyrthantherae H.S. Jacks. & Holw.

### Remarks
null


text:
using System;
using System.IO;

namespace UnitTestingWithIoC
{
    public interface IResultWriter
    {
        void WriteResult(int value);
    }

    public class ConsoleResultWriter : IResultWriter
    {
        public void WriteResult(int value)
        {
            Console.WriteLine(value);
        }
    }

    public class FileResultWriter : IResultWriter
    {
        public void WriteResult(int value)
        {
            using (var output = File.AppendText("output.txt"))
            {
                output.WriteLine(value);
            }
        }
    }

}


text:
Extend PowerPoint with technologies such as a LaTeX subsystem and a TTS system to allow much easier recording and revising of online course videos.

- Support MS Office 2010 and above.
- Integrated with [TeX4Office](https://github.com/kennywei815/TeX4Office) & [InsertImage++](https://github.com/kennywei815/InsertImagePlus)
- Output both slide format _(.pptx)_ & video format _(.wmv & .mp4)_
- Implemented a TTS subsystem with full support for [Speech Synthesis Markup Language(SSML)](https://www.w3.org/TR/speech-synthesis11/)
- Implemented a LaTeX subsystem and equation transpositon commands for math derivation
- Implemented a pointer subsystem which allows for using laser pointers in the slideshow

## Prerequisite
You need to install these packages first:
- [Ghostscript](https://www.ghostscript.com/download/gsdnld.html) for PDF file processing
- A LaTeX distribution: [MikTeX](https://miktex.org/download) (easier to install on Windows, recommended) or [TeX Live](https://www.tug.org/texlive/) (cross-platform)
- [Python3 interpreter](https://www.python.org/downloads/)

You can find archived installers for these programs with installation manuals in the [Prerequisite folder](https://github.com/kennywei815/Perfect_Lecture/blob/master/Prerequisite)!

## Quick Start

### Install
Just download [Setup_Perfect_Lecture.exe](https://github.com/kennywei815/Perfect_Lecture/raw/master/Setup_Perfect_Lecture.exe) and install it on your machine!

After the installation completes, you can find the user manuals, demo files and the uninstaller in the start menu.

### Usage

Just 1 step: Open the slides and type Perfect Lecture Scripts(enclosed by `<script>...</script>`) in the note page below. Then click "Compile with Perfect Lecture" in the "Add-ins" tab!
![step1_compile_with_perfect_lecture.png](https://github.com/kennywei815/Perfect_Lecture/blob/master/www/step1_compile_with_perfect_lecture.png)

The result slides and videos with machine-synthesized narrative will be put in the same directory.
![step4_results.PNG](https://github.com/kennywei815/Perfect_Lecture/blob/master/www/step4_results.PNG)

## License
Copyright (c) 2017 魏誠寬(Cheng-Kuan Wei) and 汪治平教授(Prof. Jyhpyng Wang) Licensed under the Apache License.

This software contains code derived from Jonathan Le Roux and Zvika Ben-Haim's IguanaTeX project which is originally released under the Creative Commons Attribution 3.0 License and combined into TeX4Office as a whole under Apache License 2.0 .


text:
package de.SweetCode.SweetDB.Table.Action;

import de.SweetCode.SweetDB.Optional;
import de.SweetCode.SweetDB.SweetDB;
import de.SweetCode.SweetDB.Table.Syntax.SyntaxRule;
import de.SweetCode.SweetDB.Table.Table;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Yonas on 29.12.2015.
 */
public class CreateTableAction {

    private Optional<String> name = Optional.empty();
    private boolean overrideExisting = false;

    private SweetDB sweetDB;
    private List<SyntaxRule> syntax = new ArrayList<>();

    public CreateTableAction(SweetDB sweetDB) {
        this.sweetDB = sweetDB;
    }

    public CreateTableAction name(String name) {
        this.name = Optional.of(name);
        return this;
    }

    public CreateTableAction overrideExisting(boolean overrideExisting) {
        this.overrideExisting = overrideExisting;
        return this;
    }

    public CreateTableAction add(SyntaxRule syntaxRule) {
        this.syntax.add(syntaxRule);
        return this;
    }

    public boolean build() {

        if(!(this.name.isPresent())) {
            if(this.sweetDB.isDebugging()) {
                throw new IllegalArgumentException("Set the name before using the build method.");
            } else {
                return false;
            }
        }

        if(this.syntax.isEmpty()) {
            if(this.sweetDB.isDebugging()) {
                throw new IllegalArgumentException("You have to add at least one syntax rule before using the build method.");
            } else {
                return false;
            }
        }

        if(!(this.overrideExisting) && this.sweetDB.tableExist(this.name.get())) {
            return false;
        }

        if(this.overrideExisting && this.sweetDB.tableExist(this.name.get())) {
            this.sweetDB.table(this.name.get()).get().drop();
        }

        Table table = new Table(this.sweetDB, new File(this.sweetDB.getPath() + File.separator + this.name.get() + ".sweet"), this.syntax);

        this.sweetDB.addTable(table);

        if(this.sweetDB.isAutosave()) {
            table.store();
        }

        return true;

    }

}


text:
package net.caseif.flint.steel.lobby.populator;

import net.caseif.flint.common.lobby.populator.StockStatusLobbySignPopulator;
import net.caseif.flint.lobby.LobbySign;

import org.bukkit.ChatColor;

public class RichStockStatusLobbySignPopulator extends StockStatusLobbySignPopulator {

    private static final ChatColor[] STATUS_COLORS = new ChatColor[] {ChatColor.DARK_AQUA, ChatColor.DARK_PURPLE,
            ChatColor.DARK_PURPLE, ChatColor.DARK_BLUE};

    public String first(LobbySign sign) {
        return STATUS_COLORS[0] + super.first(sign);
    }

    public String second(LobbySign sign) {
        return STATUS_COLORS[1] + super.second(sign);
    }

    public String third(LobbySign sign) {
        return STATUS_COLORS[2] + super.third(sign);
    }

    public String fourth(LobbySign sign) {
        return STATUS_COLORS[3] + super.fourth(sign);
    }

}