text:
//The MIT License(MIT)
//
//Copyright(c) 2016 universalappfactory
//
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//
//The above copyright notice and this permission notice shall be included in all
//copies or substantial portions of the Software.
//
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
//SOFTWARE.
using SharpEnd.Pcl.Collections;
using System;
using System.Collections.Generic;
using Windows.Foundation;
using Windows.UI.Xaml.Data;

namespace Sharpend.UAP.Collections
{
    public class IncrementalLoadingSelectableListCollection<TItemType>
        : SelectableListCollection<TItemType>, ISupportIncrementalLoading where TItemType : class
    {
        private Func<uint, IAsyncOperation<LoadMoreItemsResult>> _loadMoreDataFunction;
        private Func<bool> _moreDataAvailableFunction;

        public IncrementalLoadingSelectableListCollection(IEnumerable<TItemType> collection,
            Func<bool> moreDataAvailableFunction,Func<uint, IAsyncOperation<LoadMoreItemsResult>> loadMoreDataFunction)
            : base(collection)
        {
            _moreDataAvailableFunction = moreDataAvailableFunction ?? throw new ArgumentNullException("moreDataAvailableFunction");
            _loadMoreDataFunction = loadMoreDataFunction ?? throw new ArgumentNullException("loadMoreDataFunction");
        }

        public bool HasMoreItems
        {
            get
            {
                return _moreDataAvailableFunction();
            }
        }

        public IAsyncOperation<LoadMoreItemsResult> LoadMoreItemsAsync(uint count)
        {
            return _loadMoreDataFunction(count);
        }
    }
}


text:
#ifndef __EDKII_GLUE_HII_LIB_H__
#define __EDKII_GLUE_HII_LIB_H__

#if (EFI_SPECIFICATION_VERSION < 0x0002000A)

#define PreparePackages GluePreparePackages

/**
  This function allocates pool for an EFI_HII_PACKAGES structure
  with enough space for the variable argument list of package pointers.
  The allocated structure is initialized using NumberOfPackages, Guid,
  and the variable length argument list of package pointers.

  @param  NumberOfPackages The number of HII packages to prepare.
  @param  Guid Package GUID.

  @return
  The allocated and initialized packages.

**/
EFI_HII_PACKAGES *
EFIAPI
GluePreparePackages (
  IN UINTN           NumberOfPackages,
  IN CONST EFI_GUID  *Guid OPTIONAL,
  ...
  )
;

#endif

#endif

redpajama_set_name: RedPajamaGithub


text:
using TrustStampCore.Repository;
using TrustStampCore.Service;
using TrustStampCore.Extensions;
using System.Net;

namespace TrustStampCore.Workflows
{
    public class RemoteStampWorkflow : WorkflowBatch
    {

        public override void Execute()
        {
            var remoteEndpoint = App.Config["remoteendpoint"].ToStringValue().Trim();
            if (!VerifyEndpoint(remoteEndpoint)) // No WIF key, then try to stamp remotely
            {
                WriteLog("Invalid remote endpoint"); // No comment!
                Push(new FailedWorkflow());
                return;
            }

            // Check the root at remote!

            // Submit a root!
            var id = ((byte[])CurrentBatch["root"]).ConvertToHex();
            var url = remoteEndpoint + App.Config["remoteport"].ToInteger() + "/api/proof/" + id;
            using (WebClient client = new WebClient())
            {
                var proof = client.UploadString(url, id);
                // Put proof on the CurrentBatch State?
            }

            Update();
        }

        private bool VerifyEndpoint(string endpoint)
        {
            if (string.IsNullOrEmpty(endpoint))
                return false;

            return true;
        }

    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
    <title>SHPW</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/bootstrap-editable.css" rel="stylesheet">
    <link href="css/styles.css" rel="stylesheet">

    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.11/css/dataTables.bootstrap.min.css"/>

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

Add account

            <form id="addAccount">

                  Name
                  <input type="text" class="form-control" name="name" id="name">

                  Username/Email
                  <input type="text" class="form-control" id="username">

                  Password

                    <input type="text" class="form-control" id="password">

                      <button class="btn btn-default" type="button" onclick="generate()">Generate Password</button>

                  Comment
                  <input type="text" class="form-control" id="comment"></textarea>

            </form>

            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            <button type="button" class="btn btn-success" data-dismiss="modal" id="add">Add</button>

          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            Toggle navigation

          </button>
          Self Hosted Password Manager

Logout

Passwords (current)

Passwords

              <button type="button" class="btn btn-success btn-large" data-toggle="modal" data-target=".add-account-modal">Add</button>

                    id
                    Name
                    Username
                    Password
                    Comment
                    Options


text:
from django.middleware.csrf import get_token

import threading
_thread_locals = threading.local()

from util import LazyDict

def get_current_request():
    return getattr(_thread_locals, 'request', None)

def reset_current_request():
    setattr(_thread_locals, 'request', None)

class ThreadLocals(object):

    def process_request(self, request):
        get_token(request) # force CSRFTOKEN setup
        _thread_locals.request = request

    def process_response(self, request, response):
        reset_current_request()
        return response


text:
require 'test_helper'

class Admin::RepliesControllerTest < ActionController::TestCase
  def setup
    @user  = Factory :user
    @admin = create_admin
    @topic = Factory :topic
    @reply = Factory :reply
    create_site_config
  end

  def test_index
    get :index
    assert_redirected_to login_url

    login_as @user
    get :index
    assert_template 'errors/422'

    login_as @admin
    get :index
    assert_template 'index'
  end

  def test_show
    get :show, :id => @reply.id
    assert_redirected_to login_url

    login_as @user
    get :show, :id => @reply.id
    assert_template 'errors/422'

    login_as @admin
    get :show, :id => @reply.id
    assert_template 'show'
  end

  def test_destroy
    delete :destroy, :id => @reply.id
    assert_redirected_to login_url

    login_as @user
    get :destroy, :id => @reply.id
    assert_template 'errors/422'

    login_as @admin
    get :destroy, :id => @reply.id
    assert_redirected_to :action => :index
  end
end


text:
FROM registry.fedoraproject.org/fedora
COPY . /src/
WORKDIR /src
RUN tests/build.sh
RUN tests/config.sh
ENTRYPOINT [ "/usr/sbin/httpd", "-DFOREGROUND" ]


text:
package org.hawkular.client.android.adapter;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

import java.util.ArrayList;
import java.util.List;

import org.hawkular.client.android.backend.model.Alert;
import org.hawkular.client.android.backend.model.Note;
import org.hawkular.client.android.util.Randomizer;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import android.view.View;

@RunWith(AndroidJUnit4.class)
public final class AlertsAdapterTester {
    private Context context;

    @Before
    public void setUp() {
        context = InstrumentationRegistry.getTargetContext();
    }

    @Test
    public void count() {
        List<Alert> alerts = generateAlerts();

        AlertsAdapter alertsAdapter = new AlertsAdapter(context, new AlertMenuAdapter(), alerts);

        assertThat(alertsAdapter.getItemCount(), is(alerts.size()));
    }

    @Test
    public void item() {
        Alert alert = generateAlert();

        List<Alert> alerts = new ArrayList<>();
        alerts.add(alert);
        alerts.addAll(generateAlerts());

        AlertsAdapter alertsAdapter = new AlertsAdapter(context, new AlertMenuAdapter(), alerts);

        assertThat(alertsAdapter.getItem(0), is(alert));
    }

    private List<Alert> generateAlerts() {
        List<Alert> alerts = new ArrayList<>();

        for (int alertPosition = 0; alertPosition < Randomizer.generateNumber(); alertPosition++) {
            alerts.add(generateAlert());
        }

        return alerts;
    }

    private Alert generateAlert() {
        return new Alert(
                Randomizer.generateString(),
                Randomizer.generateNumber(),
                (new ArrayList<Alert.Lister>()),
                Randomizer.generateString(),
                Randomizer.generateString(),
                new ArrayList<Note>());
    }

    private static final class AlertMenuAdapter implements AlertsAdapter.AlertListener {
        @Override
        public void onAlertMenuClick(View alertView, int alertPosition) {
        }

        @Override public void onAlertBodyClick(View alertView, int alertPosition) {

        }
    }
}


text:
/* Generated code */
import FavoriteCollection from '../definitions/FavoriteCollection';
import PathSegment from '../PathSegment';

export default class Favorite extends PathSegment {
	constructor(prv: PathSegment, id?: string, service?) {
		super('favorite', id, prv, service);
	}

	get(): Promise<void> {
		return this.getRest().call(this.getEndpoint(true), undefined, {
			body: undefined,
			method: 'get'
		}).then(res => {});
	}

	put(body: FavoriteCollection): Promise<void> {
		return this.getRest().call(this.getEndpoint(true), undefined, {
			body: body,
			method: 'put'
		}).then(res => {});
	}

}


text:
package workbench.gui.dialogs.export;

import java.util.Set;

import workbench.db.exporter.BlobMode;
import workbench.db.exporter.ControlFileFormat;
import workbench.util.CharacterEscapeType;

import workbench.util.CharacterRange;
import workbench.util.QuoteEscapeType;

/**
 *
 * @author Thomas Kellerer
 */
public interface TextOptions
{
	String getTextDelimiter();
	void setTextDelimiter(String delim);
	boolean getExportHeaders();
	void setExportHeaders(boolean flag);
	String getTextQuoteChar();
	void setTextQuoteChar(String quote);
	void setQuoteAlways(boolean flag);
	boolean getQuoteAlways();
	void setEscapeRange(CharacterRange range);
	CharacterRange getEscapeRange();
	void setEscapeType(CharacterEscapeType type);
	CharacterEscapeType getEscapeType();
	void setLineEnding(String ending);
	String getLineEnding();
	void setDecimalSymbol(String decimal);
	String getDecimalSymbol();
	QuoteEscapeType getQuoteEscaping();
	Set<ControlFileFormat> getControlFiles();
	BlobMode getBlobMode();
}


text:
<?php

final class PhabricatorBadgesEditor
  extends PhabricatorApplicationTransactionEditor {

  public function getEditorApplicationClass() {
    return 'PhabricatorBadgesApplication';
  }

  public function getEditorObjectsDescription() {
    return pht('Badges');
  }

  public function getCreateObjectTitle($author, $object) {
    return pht('%s created this badge.', $author);
  }

  public function getCreateObjectTitleForFeed($author, $object) {
    return pht('%s created %s.', $author, $object);
  }

  protected function supportsSearch() {
    return true;
  }

  public function getTransactionTypes() {
    $types = parent::getTransactionTypes();
    $types[] = PhabricatorTransactions::TYPE_COMMENT;
    $types[] = PhabricatorTransactions::TYPE_EDGE;
    $types[] = PhabricatorTransactions::TYPE_EDIT_POLICY;

    return $types;
  }

  protected function shouldSendMail(
    PhabricatorLiskDAO $object,
    array $xactions) {
    return true;
  }

  public function getMailTagsMap() {
    return array(
      PhabricatorBadgesTransaction::MAILTAG_DETAILS =>
        pht('Someone changes the badge\'s details.'),
      PhabricatorBadgesTransaction::MAILTAG_COMMENT =>
        pht('Someone comments on a badge.'),
      PhabricatorBadgesTransaction::MAILTAG_OTHER =>
        pht('Other badge activity not listed above occurs.'),
    );
  }

  protected function shouldPublishFeedStory(
    PhabricatorLiskDAO $object,
    array $xactions) {
    return true;
  }

  protected function expandTransactions(
    PhabricatorLiskDAO $object,
    array $xactions) {

    $actor = $this->getActor();
    $actor_phid = $actor->getPHID();

    $results = parent::expandTransactions($object, $xactions);

    // Automatically subscribe the author when they create a badge.
    if ($this->getIsNewObject()) {
      if ($actor_phid) {
        $results[] = id(new PhabricatorBadgesTransaction())
          ->setTransactionType(PhabricatorTransactions::TYPE_SUBSCRIBERS)
          ->setNewValue(
            array(
              '+' => array($actor_phid => $actor_phid),
            ));
      }
    }

    return $results;
  }

  protected function buildReplyHandler(PhabricatorLiskDAO $object) {
    return id(new PhabricatorBadgesReplyHandler())
      ->setMailReceiver($object);
  }

  protected function buildMailTemplate(PhabricatorLiskDAO $object) {
    $name = $object->getName();
    $id = $object->getID();
    $topic = pht('Badge %d', $id);
    $subject = pht('Badge %d: %s', $id, $name);

    return id(new PhabricatorMetaMTAMail())
      ->setSubject($subject)
      ->addHeader('Thread-Topic', $topic);
  }

  protected function getMailTo(PhabricatorLiskDAO $object) {
    return array(
      $object->getCreatorPHID(),
      $this->requireActor()->getPHID(),
    );
  }

  protected function buildMailBody(
    PhabricatorLiskDAO $object,
    array $xactions) {

    $body = parent::buildMailBody($object, $xactions);

    $body->addLinkSection(
      pht('BADGE DETAIL'),
      PhabricatorEnv::getProductionURI('/badges/view/'.$object->getID().'/'));
    return $body;
  }

  protected function getMailSubjectPrefix() {
    return pht('[Badge]');
  }

  protected function applyFinalEffects(
    PhabricatorLiskDAO $object,
    array $xactions) {

    $badge_phid = $object->getPHID();
    $user_phids = array();
    $clear_everything = false;

    foreach ($xactions as $xaction) {
      switch ($xaction->getTransactionType()) {
        case PhabricatorBadgesBadgeAwardTransaction::TRANSACTIONTYPE:
        case PhabricatorBadgesBadgeRevokeTransaction::TRANSACTIONTYPE:
          foreach ($xaction->getNewValue() as $user_phid) {
            $user_phids[] = $user_phid;
          }
          break;
        default:
          $clear_everything = true;
          break;
      }
    }

    if ($clear_everything) {
      $awards = id(new PhabricatorBadgesAwardQuery())
        ->setViewer($this->getActor())
        ->withBadgePHIDs(array($badge_phid))
        ->execute();
      foreach ($awards as $award) {
        $user_phids[] = $award->getRecipientPHID();
      }
    }

    if ($user_phids) {
      PhabricatorUserCache::clearCaches(
        PhabricatorUserBadgesCacheType::KEY_BADGES,
        $user_phids);
    }

    return $xactions;
  }

}


text:
#include <assert.h>
#include <cbmc_proof/cbmc_utils.h>
#include <cbmc_proof/make_common_datastructures.h>
#include <string.h>

#include "api/s2n.h"
#include "stuffer/s2n_stuffer.h"
#include "utils/s2n_mem.h"

void s2n_stuffer_alloc_ro_from_string_harness()
{
    /* Non-deterministic inputs. */
    struct s2n_stuffer *stuffer = cbmc_allocate_s2n_stuffer();
    __CPROVER_assume(s2n_result_is_ok(s2n_stuffer_validate(stuffer)));
    char *str = ensure_c_str_is_allocated(MAX_STRING_LEN);

    /* Save previous state from stuffer. */
    struct s2n_stuffer            old_stuffer = *stuffer;
    struct store_byte_from_buffer old_byte_from_stuffer;
    save_byte_from_blob(&stuffer->blob, &old_byte_from_stuffer);

    nondet_s2n_mem_init();

    /* Operation under verification. */
    if (s2n_stuffer_alloc_ro_from_string(stuffer, str) == S2N_SUCCESS) {
        /* Post-conditions. */
        uint32_t length = strlen(str);
        assert_bytes_match(stuffer->blob.data, ( const uint8_t * )str, length);
        assert(stuffer->alloced);
        assert(stuffer->blob.size == length + 1);
        assert(stuffer->write_cursor == length);
        assert(stuffer->high_water_mark == length);
    }
    assert(s2n_result_is_ok(s2n_stuffer_validate(stuffer)));
}


text:
#include <inviwo/core/util/systemcapabilities.h>
#include <inviwo/core/util/formatconversion.h>
#include <inviwo/core/util/logcentral.h>
#include <inviwo/core/util/stringconversion.h>
#include <inviwo/core/util/assertion.h>
#include <inviwo/core/util/filesystem.h>
#ifdef IVW_SIGAR
#include <sigar/include/sigar.h>
#endif

#include <sstream>
#include <iomanip>

namespace inviwo {

SystemCapabilities::SystemCapabilities() {
#ifdef IVW_SIGAR
    sigar_open(&sigar_);
#endif
    retrieveStaticInfo();
    retrieveDynamicInfo();
}

SystemCapabilities::~SystemCapabilities() {
#ifdef IVW_SIGAR
    sigar_close(sigar_);
#endif
}

void SystemCapabilities::retrieveStaticInfo() {
    successOSInfo_ = lookupOSInfo();
    buildInfo_ = util::getBuildInfo();
}

void SystemCapabilities::retrieveDynamicInfo() {
    successCPUInfo_ = lookupCPUInfo();
    successMemoryInfo_ = lookupMemoryInfo();
    successDiskInfo_ = lookupDiskInfo();
    successProcessMemoryInfo_ = lookupProcessMemoryInfo();
}

const util::BuildInfo& SystemCapabilities::getBuildInfo() const { return buildInfo_; }

bool SystemCapabilities::lookupOSInfo() {
#ifdef IVW_SIGAR
    sigar_sys_info_t systeminfo;
    int status = sigar_sys_info_get(sigar_, &systeminfo);

    if (status == SIGAR_OK) {
        infoOS_.description = std::string(systeminfo.description);

        if (strcmp(systeminfo.arch, "x86") == 0)
            infoOS_.platform = 32;
        else
            infoOS_.platform = 64;

        return true;
    } else {
        return false;
    }

#else
    return false;
#endif
}

bool SystemCapabilities::lookupCPUInfo() {
    infoCPUs_.clear();
#ifdef IVW_SIGAR
    sigar_cpu_info_list_t cpulinfolist;
    int status = sigar_cpu_info_list_get(sigar_, &cpulinfolist);
    bool success = (status == SIGAR_OK);

    if (success) {
        infoCPUs_.resize(cpulinfolist.number);

        for (unsigned long i = 0; i < cpulinfolist.number; i++) {
            sigar_cpu_info_t cpu_info = cpulinfolist.data[i];
            infoCPUs_[i].vendor = std::string(cpu_info.vendor);
            infoCPUs_[i].model = std::string(cpu_info.model);
            infoCPUs_[i].mhz = static_cast<glm::u64>(cpu_info.mhz);
        }
    }

    sigar_cpu_info_list_destroy(sigar_, &cpulinfolist);
    return success;
#else
    return false;
#endif
}

bool SystemCapabilities::lookupMemoryInfo() {
#ifdef IVW_SIGAR
    sigar_mem_t meminfo;
    if (sigar_mem_get(sigar_, &meminfo) == SIGAR_OK) {
        infoRAM_.total = util::megabytes_to_bytes(static_cast<glm::u64>(meminfo.ram));
        infoRAM_.available = static_cast<glm::u64>(meminfo.free);
        return true;
    } else {
        return false;
    }
#else
    return false;
#endif
}

bool SystemCapabilities::lookupDiskInfo() {
    infoDisks_.clear();
#ifdef IVW_SIGAR
    sigar_file_system_list_t diskinfolist;
    sigar_file_system_usage_t diskusageinfo;
    int status = sigar_file_system_list_get(sigar_, &diskinfolist);
    bool success = (status == SIGAR_OK);

    if (success) {
        for (unsigned long i = 0; i < diskinfolist.number; i++) {
            sigar_file_system_t disk_info = diskinfolist.data[i];
            status = sigar_file_system_usage_get(sigar_, disk_info.dir_name, &diskusageinfo);

            if (status == SIGAR_OK) {
                DiskInfo currentDiskInfo;
                currentDiskInfo.diskType = std::string(disk_info.type_name);
                currentDiskInfo.diskType[0] =
                    static_cast<char>(toupper(currentDiskInfo.diskType[0]));

                if (currentDiskInfo.diskType == "Local") {
                    currentDiskInfo.diskName = std::string(disk_info.dev_name);
                    currentDiskInfo.total =
                        util::kilobytes_to_bytes(static_cast<glm::u64>(diskusageinfo.total));
                    currentDiskInfo.free =
                        util::kilobytes_to_bytes(static_cast<glm::u64>(diskusageinfo.free));
                    infoDisks_.push_back(currentDiskInfo);
                }
            }
        }
    }

    sigar_file_system_list_destroy(sigar_, &diskinfolist);
    return success;
#else
    return false;
#endif
}

bool SystemCapabilities::lookupProcessMemoryInfo() {
#ifdef IVW_SIGAR
    sigar_proc_mem_t meminfo;

    if (sigar_proc_mem_get(sigar_, sigar_pid_get(sigar_), &meminfo) == SIGAR_OK) {
        infoProcRAM_.residentMem = static_cast<glm::u64>(meminfo.resident);
        infoProcRAM_.sharedMem = static_cast<glm::u64>(meminfo.share);
        infoProcRAM_.virtualMem = static_cast<glm::u64>(meminfo.size);
        return true;
    } else {
        return false;
    }
#else
    return false;
#endif
}

void SystemCapabilities::printInfo() {
    retrieveDynamicInfo();

    // Try to retrieve operating system information
    if (successOSInfo_) {
        LogInfoCustom("SystemInfo",
                      "OS: " << infoOS_.description << " " << infoOS_.platform << "-bit");
    } else {
        LogInfoCustom("SystemInfo", "OS: Info could not be retrieved");
    }

    // Try to retrieve CPU information
    if (successCPUInfo_) {
        std::string prevCPU = std::string("");
        std::ostringstream cpuStream;
        unsigned long count = 0;
        for (unsigned long i = 0; i < infoCPUs_.size(); i++) {
            cpuStream.str("");
            cpuStream << infoCPUs_[i].vendor << " " << infoCPUs_[i].model;
            if (prevCPU != cpuStream.str()) {
                if (!prevCPU.empty()) {
                    if (count > 0) {
                        LogInfoCustom("SystemInfo",
                                      "CPU " << i + 1 << "-" << i + 1 + count << ": " << prevCPU);
                    } else {
                        LogInfoCustom("SystemInfo", "CPU " << i + 1 << ": " << prevCPU);
                    }
                }
                prevCPU = cpuStream.str();
                count = 0;
            } else {
                count++;
            }
        }
        if (!prevCPU.empty()) {
            if (count > 0) {
                LogInfoCustom("SystemInfo", "CPU " << infoCPUs_.size() - count << "-"
                                                   << infoCPUs_.size() << ": " << prevCPU);
            } else {
                LogInfoCustom("SystemInfo", "CPU " << infoCPUs_.size() << ": " << prevCPU);
            }
        }
    } else {
        LogInfoCustom("SystemInfo", "CPU: Info could not be retrieved");
    }

    // Try to retrieve memory information
    if (successMemoryInfo_) {
        LogInfoCustom("SystemInfo", "RAM: Total - "
                                        << util::formatBytesToString(infoRAM_.total)
                                        << ", Available - "
                                        << util::formatBytesToString(infoRAM_.available));
    } else {
        LogInfoCustom("SystemInfo", "RAM: Info could not be retrieved");
    }

    // Try to retrieve Disk information
    if (successDiskInfo_) {
        for (auto& elem : infoDisks_)
            LogInfoCustom("SystemInfo", "Disk: " << elem.diskName << " Total - "
                                                 << util::formatBytesToString(elem.total)
                                                 << ", Free - "
                                                 << util::formatBytesToString(elem.free));
    } else {
        LogInfoCustom("SystemInfo", "Disk: Info could not be retrieved");
    }

    // Try to retrieve this process memory information
    if (successProcessMemoryInfo_) {
        LogInfoCustom("SystemInfo",
                      "Processor Memory: Resident - "
                          << util::formatBytesToString(infoProcRAM_.residentMem) << ", Shared - "
                          << util::formatBytesToString(infoProcRAM_.sharedMem) << ", Virtual - "
                          << util::formatBytesToString(infoProcRAM_.virtualMem));
    } else {
        LogInfoCustom("SystemInfo", "Processor Memory: Info could not be retrieved");
    }
}

int SystemCapabilities::numberOfCores() const {
    if (successCPUInfo_) {
        return static_cast<int>(infoCPUs_.size());
    } else {
        return -1;
    }
}

glm::u64 SystemCapabilities::getAvailableMemory() {
    successMemoryInfo_ = lookupMemoryInfo();

    if (successMemoryInfo_) {
        return infoRAM_.available;
    } else {
        return 0;
    }
}

glm::u64 SystemCapabilities::getCurrentResidentMemoryUsage() {
    successProcessMemoryInfo_ = lookupProcessMemoryInfo();

    if (successMemoryInfo_) {
        return infoProcRAM_.residentMem;
    } else {
        return 0;
    }
}

}  // namespace inviwo


text:
org=$1
repo=$2
branch=${3:-"master"} # default to master when branch isn't specified

# make folder (same as input, no checking!)
mkdir $repo
#git clone git@github.com:$org/$repo.git --single-branch
git clone http://github.com/$org/$repo.git --single-branch
# switch to gh-pages branch
pushd $repo >/dev/null
git checkout --orphan gh-pages

# remove all content
git rm -rf -q .

# use bower to install runtime deployment
bower cache clean $repo # ensure we're getting the latest from the desired branch.
echo "{
  \"name\": \"$repo#gh-pages\",
  \"private\": true
}
" > bower.json
echo "{
  \"directory\": \"components\"
}
" > .bowerrc
bower install --save $org/$repo#$branch

cp -rf ../../core-component-page ./components/core-component-page
cp -rf ../../webcomponentsjs ./components/webcomponentsjs
cp -rf ../../polymer ./components/polymer
cp -rf ../../NodeBind ./components/NodeBind
cp -rf ../../TemplateBinding ./components/TemplateBinding
cp -rf ../../URL ./components/URL
cp -rf ../../observe-js ./components/observe-js
cp -rf ../../polymer-expressions ./components/polymer-expressions
cp -rf ../../polymer-gestures ./components/polymer-gestures

# redirect by default to the component folder
echo "<META http-equiv="refresh" content=\"0;URL=components/$repo/\">" >index.html

# send it all to github
git add -A .
git commit -am 'seed gh-pages'
git push -u origin gh-pages --force

popd >/dev/null


text:
require 'spec_helper'

module Spree
  describe "Countries", type: :feature do
    stub_authorization!

    it "deletes a country", js: true do
      visit spree.admin_countries_path
      click_link "New Country"

      fill_in "Name", with: "Brazil"
      fill_in "ISO Name", with: "BRL"
      click_button "Create"

      accept_alert do
        click_icon :trash
      end

      expect(page).to have_content 'Country "Brazil" has been successfully removed!'
    end
  end
end


text:
package com.lsjwzh.orm;

import android.database.sqlite.SQLiteDatabase;

public abstract class Migration {

    final void execute(SQLiteDatabase db) {
        onPreMigrate();
        doMigration(db);
        onPostMigrate();

    }

    protected void onPreMigrate(){}
    protected abstract void doMigration(SQLiteDatabase db);
    protected void onPostMigrate(){}

}


text:
import subprocess

releases = {"3.0": "200703112",
     "3.1": "200712072",
     "3.2": "200808253",
     "3.3": "200902041"}

def release2catverno(rno):
     if not rno in releases.keys():
          raise Exception("unknown version %s" % rno)
     return releases[rno]

def stop_cluster():
     p.subprocess.Popen(['gpstop', '-a'], shell=False, close_fds=True,
                              stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     result = p.communicate()

     if p.returncode != 0:
          raise Exception("could not stop cluster: " + result[0] + result[1])

def get_control_data(datadir):
     '''
     Parse the output of pg_controldata run on data directory, returning
     catalog version and state
     '''
     cmd = ['pg_controldata', datadir]
     p = subprocess.Popen(cmd, shell=False, close_fds=True,
                                 stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     result = p.communicate()

     if p.returncode != 0:
          raise Exception("error running " + ' '.join(cmd) + ": " + result[0] + result[1])

     out = result[0].strip()
     ver = ""
     state = ""
     for line in out.split('\n'):
          s = line.split(':')
          if s[0] == 'Catalog version number':
                ver = s[1].strip()
          elif s[0] == 'Database cluster state':
                state = s[1].strip()

     return [ver, state]

def setcatversion(datadir, frm, to):
    '''
    Set catalog version to 'to' from 'frm'. Check that the system is down
    and actually set to the previous version.
    '''
    (ver, state) = get_control_data(datadir)

    frmcatverno = release2catverno(frm)
    if ver != frmcatverno:
         raise Exception("Expected version %s but found %s" % (frmcatverno, ver))

    cmd = ['/Users/swm/greenplum-db-devel/bin/lib/gpmodcatversion', '--catversion', to, datadir]
    p = subprocess.Popen(cmd,
                         shell=False, close_fds=True,
                         stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    result = p.communicate()
    if p.returncode != 0:
        raise Exception("could not update catalog to %s" % to)

if __name__ == '__main__':
    paths = ['/Users/swm/greenplum-db-devel/upg/upgradetest-1',
             '/Users/swm/greenplum-db-devel/upg/upgradetest1',
             '/Users/swm/greenplum-db-devel/upg/upgradetest0']
    for p in paths:
        setcatversion(p, '3.2', '3.3')


text:
<?php

namespace Isaac\BulmaForm\Facades;

use Illuminate\Support\Facades\Facade;

class BulmaForm extends Facade
{
    /**
     * Get the registered name of the component.
     *
     * @return string
     */
    protected static function getFacadeAccessor()
    {
        return 'bulmaform';
    }
}


text:
<!DOCTYPE html>

    <title>Environment Structure Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset='utf-8'>

 Docs

View on GitHub

         Reference

        Environment Structure Reference

            Classes

                Discovery

            Enumerations

                JSON

                QueryAggregation

                RestError

            Structures

                AggregationResult

                Calculation

                Collection

                – Status

                CollectionDiskUsage

                CollectionUsage

                Configuration

                Conversions

                CreateCollectionRequest

                – Language

                DeleteCollectionResponse

                – Status

                DeleteConfigurationResponse

                – Status

                DeleteDocumentResponse

                – Status

                DeleteEnvironmentResponse

                – Status

                DiskUsage

                DocumentAccepted

                – Status

                DocumentCounts

                DocumentSnapshot

                – Step

                DocumentStatus

                – Status

                – FileType

                Enrichment

                EnrichmentOptions

                Environment

                – Status

                EnvironmentDocuments

                Expansion

                Expansions

                Field

                – FieldType

                Filter

                FontSetting

                GenericQueryAggregation

                Histogram

                HtmlSettings

                IndexCapacity

                JSONWrapper

                ListCollectionFieldsResponse

                ListCollectionsResponse

                ListConfigurationsResponse

                ListEnvironmentsResponse

                MemoryUsage

                Nested

                NluEnrichmentCategories

                NluEnrichmentEmotion

                NluEnrichmentEntities

                NluEnrichmentFeatures

                NluEnrichmentKeywords

                NluEnrichmentRelations

                NluEnrichmentSemanticRoles

                NluEnrichmentSentiment

                NormalizationOperation

                – Operation

                Notice

                – Severity

                PdfHeadingDetection

                PdfSettings

                QueryEntities

                QueryEntitiesContext

                QueryEntitiesEntity

                QueryEntitiesResponse

                QueryEntitiesResponseItem

                QueryEvidence

                QueryEvidenceEntity

                QueryFilterType

                QueryNoticesResponse

                QueryNoticesResult

                – FileType

                QueryPassages

                QueryRelations

                – Sort

                QueryRelationsArgument

                QueryRelationsEntity

                QueryRelationsFilter

                QueryRelationsRelationship

                QueryRelationsResponse

                QueryResponse

                QueryResult

                QueryResultMetadata

                SegmentSettings

                Term

                TestDocument

                Timeslice

                TopHits

                TopHitsResults

                TrainingDataSet

                TrainingExample

                TrainingExampleList

                TrainingQuery

                TrainingStatus

                WordHeadingDetection

                WordSettings

                WordStyle

                XPathPatterns

Environment

public struct Environment : Decodable

Details about an environment.

                    Status

Status of the environment.

                        See more

Declaration

Swift

public enum Status : String

                    environmentID

Unique identifier for the environment.

Declaration

Swift

public var environmentID: String?

                    name

Name that identifies the environment.

Declaration

Swift

public var name: String?

                    description

Description of the environment.

Declaration

Swift

public var description: String?

                    created

Creation date of the environment, in the format yyyy-MM-dd’T'HH:mm:ss.SSS'Z’.

Declaration

Swift

public var created: String?

                    updated

Date of most recent environment update, in the format yyyy-MM-dd’T'HH:mm:ss.SSS'Z’.

Declaration

Swift

public var updated: String?

                    status

Status of the environment.

Declaration

Swift

public var status: String?

                    readOnly

If true, then the environment contains read-only collections which are maintained by IBM.

Declaration

Swift

public var readOnly: Bool?

                    size

Deprecated**: Size of the environment.

Declaration

Swift

public var size: Int?

                    indexCapacity

Details about the resource usage and capacity of the environment.

Declaration

Swift

public var indexCapacity: IndexCapacity?

© 2018 . All rights reserved. (Last updated: 2018-05-18)

Generated by jazzy ♪♫ v0.9.3, a Realm project.


text:
#include <gtest/gtest.h>
#include "tensorflow/lite/interpreter.h"
#include "tensorflow/lite/kernels/register.h"
#include "tensorflow/lite/kernels/test_util.h"
#include "tensorflow/lite/model.h"

namespace tflite {
namespace {

using ::testing::ElementsAreArray;

template <typename T>
class ArgBaseOpModel : public SingleOpModel {
 public:
  ArgBaseOpModel(std::initializer_list<int> input_shape, TensorType input_type,
                 TensorType output_type, TensorType index_output_type) {
    input_ = AddInput(input_type);
    axis_ = AddInput(TensorType_INT32);
    output_ = AddOutput(output_type);
  }

  int input() { return input_; }
  int axis() { return axis_; }

  std::vector<T> GetOutput() { return ExtractVector<T>(output_); }
  std::vector<int> GetOutputShape() { return GetTensorShape(output_); }

 protected:
  int input_;
  int axis_;
  int output_;
};

template <typename T>
class ArgMaxOpModel : public ArgBaseOpModel<T> {
 public:
  ArgMaxOpModel(std::initializer_list<int> input_shape, TensorType input_type,
                TensorType output_type, TensorType index_output_type)
      : ArgBaseOpModel<T>(input_shape, input_type, output_type,
                          index_output_type) {
    ArgBaseOpModel<T>::SetBuiltinOp(
        BuiltinOperator_ARG_MAX, BuiltinOptions_ArgMaxOptions,
        CreateArgMaxOptions(ArgBaseOpModel<T>::builder_, index_output_type)
            .Union());
    ArgBaseOpModel<T>::BuildInterpreter({input_shape, {1, 1, 1, 1}});
  }
};

template <typename T>
class ArgMinOpModel : public ArgBaseOpModel<T> {
 public:
  ArgMinOpModel(std::initializer_list<int> input_shape, TensorType input_type,
                TensorType output_type, TensorType index_output_type)
      : ArgBaseOpModel<T>(input_shape, input_type, output_type,
                          index_output_type) {
    ArgBaseOpModel<T>::SetBuiltinOp(
        BuiltinOperator_ARG_MIN, BuiltinOptions_ArgMinOptions,
        CreateArgMinOptions(ArgBaseOpModel<T>::builder_, index_output_type)
            .Union());
    ArgBaseOpModel<T>::BuildInterpreter({input_shape, {1, 1, 1, 1}});
  }
};

TEST(ArgMaxOpTest, GetMaxArgFloat) {
  ArgMaxOpModel<int32_t> model({1, 1, 1, 4}, TensorType_FLOAT32,
                               TensorType_INT32, TensorType_INT32);
  model.PopulateTensor<float>(model.input(), {0.1, 0.9, 0.7, 0.3});
  model.PopulateTensor<int>(model.axis(), {3});
  model.Invoke();

  EXPECT_THAT(model.GetOutput(), ElementsAreArray({1}));
  EXPECT_THAT(model.GetOutputShape(), ElementsAreArray({1, 1, 1}));
}

TEST(ArgMaxOpTest, GetMaxArgUInt8) {
  ArgMaxOpModel<int32_t> model({1, 1, 1, 4}, TensorType_UINT8, TensorType_INT32,
                               TensorType_INT32);
  model.PopulateTensor<uint8_t>(model.input(), {1, 9, 7, 3});
  model.PopulateTensor<int>(model.axis(), {3});
  model.Invoke();

  EXPECT_THAT(model.GetOutput(), ElementsAreArray({1}));
  EXPECT_THAT(model.GetOutputShape(), ElementsAreArray({1, 1, 1}));
}

TEST(ArgMaxOpTest, GetMaxArgInt8) {
  ArgMaxOpModel<int32_t> model({1, 1, 1, 4}, TensorType_INT8, TensorType_INT32,
                               TensorType_INT32);
  model.PopulateTensor<int8_t>(model.input(), {-1, -9, 7, 3});
  model.PopulateTensor<int>(model.axis(), {3});
  model.Invoke();

  EXPECT_THAT(model.GetOutput(), ElementsAreArray({2}));
  EXPECT_THAT(model.GetOutputShape(), ElementsAreArray({1, 1, 1}));
}

TEST(ArgMaxOpTest, GetMaxArgInt) {
  ArgMaxOpModel<int32_t> model({1, 1, 1, 4}, TensorType_INT32, TensorType_INT32,
                               TensorType_INT32);
  model.PopulateTensor<int>(model.input(), {1, 9, 7, 3});
  model.PopulateTensor<int>(model.axis(), {3});
  model.Invoke();

  EXPECT_THAT(model.GetOutput(), ElementsAreArray({1}));
  EXPECT_THAT(model.GetOutputShape(), ElementsAreArray({1, 1, 1}));
}

TEST(ArgMaxOpTest, GetMaxArgMulDimensions) {
  ArgMaxOpModel<int32_t> model({1, 1, 2, 4}, TensorType_INT32, TensorType_INT32,
                               TensorType_INT32);
  model.PopulateTensor<int>(model.input(), {1, 2, 7, 8, 1, 9, 7, 3});
  model.PopulateTensor<int>(model.axis(), {3});
  model.Invoke();

  EXPECT_THAT(model.GetOutput(), ElementsAreArray({3, 1}));
  EXPECT_THAT(model.GetOutputShape(), ElementsAreArray({1, 1, 2}));
}

TEST(ArgMaxOpTest, GetMaxArgNegativeAxis) {
  ArgMaxOpModel<int32_t> model({1, 1, 2, 4}, TensorType_INT32, TensorType_INT32,
                               TensorType_INT32);
  model.PopulateTensor<int>(model.input(), {1, 2, 7, 8, 1, 9, 7, 3});
  model.PopulateTensor<int>(model.axis(), {-2});
  model.Invoke();

  EXPECT_THAT(model.GetOutput(), ElementsAreArray({0, 1, 0, 0}));
  EXPECT_THAT(model.GetOutputShape(), ElementsAreArray({1, 1, 4}));
}

TEST(ArgMaxOpTest, GetMaxArgOutput64) {
  ArgMaxOpModel<int64_t> model({1, 1, 2, 4}, TensorType_INT32, TensorType_INT64,
                               TensorType_INT64);
  model.PopulateTensor<int>(model.input(), {10, 2, 7, 8, 1, 9, 7, 3});
  model.PopulateTensor<int>(model.axis(), {3});
  model.Invoke();

  EXPECT_THAT(model.GetOutput(), ElementsAreArray({0, 1}));
  EXPECT_THAT(model.GetOutputShape(), ElementsAreArray({1, 1, 2}));
}

TEST(ArgMinOpTest, GetMinArgFloat) {
  ArgMinOpModel<int32_t> model({1, 1, 1, 4}, TensorType_FLOAT32,
                               TensorType_INT32, TensorType_INT32);
  model.PopulateTensor<float>(model.input(), {0.1, 0.9, 0.7, 0.3});
  model.PopulateTensor<int>(model.axis(), {3});
  model.Invoke();

  EXPECT_THAT(model.GetOutput(), ElementsAreArray({0}));
  EXPECT_THAT(model.GetOutputShape(), ElementsAreArray({1, 1, 1}));
}

TEST(ArgMinOpTest, GetMinArgInt) {
  ArgMinOpModel<int32_t> model({1, 1, 1, 4}, TensorType_INT32, TensorType_INT32,
                               TensorType_INT32);
  model.PopulateTensor<int>(model.input(), {1, 9, 7, 3});
  model.PopulateTensor<int>(model.axis(), {3});
  model.Invoke();

  EXPECT_THAT(model.GetOutput(), ElementsAreArray({0}));
  EXPECT_THAT(model.GetOutputShape(), ElementsAreArray({1, 1, 1}));
}

TEST(ArgMinOpTest, GetMinArgMulDimensions) {
  ArgMinOpModel<int32_t> model({1, 1, 2, 4}, TensorType_INT32, TensorType_INT32,
                               TensorType_INT32);
  model.PopulateTensor<int>(model.input(), {1, 2, 7, 8, 1, 9, 7, 3});
  model.PopulateTensor<int>(model.axis(), {3});
  model.Invoke();

  EXPECT_THAT(model.GetOutput(), ElementsAreArray({0, 0}));
  EXPECT_THAT(model.GetOutputShape(), ElementsAreArray({1, 1, 2}));
}

TEST(ArgMinOpTest, GetMinArgNegativeAxis) {
  ArgMinOpModel<int32_t> model({1, 1, 2, 4}, TensorType_INT32, TensorType_INT32,
                               TensorType_INT32);
  model.PopulateTensor<int>(model.input(), {1, 2, 7, 8, 1, 9, 7, 3});
  model.PopulateTensor<int>(model.axis(), {-2});
  model.Invoke();

  EXPECT_THAT(model.GetOutput(), ElementsAreArray({0, 0, 0, 1}));
  EXPECT_THAT(model.GetOutputShape(), ElementsAreArray({1, 1, 4}));
}

TEST(ArgMinOpTest, GetMinArgOutput64) {
  ArgMinOpModel<int64_t> model({1, 1, 2, 4}, TensorType_INT32, TensorType_INT64,
                               TensorType_INT64);
  model.PopulateTensor<int>(model.input(), {10, 2, 7, 8, 1, 9, 7, 3});
  model.PopulateTensor<int>(model.axis(), {3});
  model.Invoke();

  EXPECT_THAT(model.GetOutput(), ElementsAreArray({1, 0}));
  EXPECT_THAT(model.GetOutputShape(), ElementsAreArray({1, 1, 2}));
}

}  // namespace
}  // namespace tflite

int main(int argc, char** argv) {
  ::tflite::LogToStderr();
  ::testing::InitGoogleTest(&argc, argv);
  return RUN_ALL_TESTS();
}


text:
/*
    Document   : prints.css
    Created on :
    Author     : agdarby, pvillanueva
    Description: print stylesheet for public site
*/

@media print {

body {
    background: #FFFFFF;
    font-size: 12pt;
    font-family: "Times New Roman" !important;
    color: #000000;
    line-height: 1.2;
    width: 100%;
}

h1 {font-size: 20pt; margin: 0; padding: 0 0 5px 0; font-family: inherit;}
h2 {font-size: 16pt; margin: 0; padding: 0 0 5px 0; font-family: inherit;}
h3 {font-size: 14pt; margin: 0; padding: 0 0 5px 0; font-family: inherit;}
h4 {font-size: 12pt; margin: 0; padding: 0 0 5px 0; font-family: inherit;}
h5 {font-size: 12pt; margin: 0; padding: 0 0 5px 0; font-family: inherit;}
p {font-size: 12pt; margin: 0; padding: 0 0 5px 0; font-family: inherit;}

div {
    width: 100% !important;
    border: none;
    margin: 0 ;
    padding: 0;
    box-shadow: none;
    border-radius: none;
    background: white;
    text-align: left;
    font-family: "Times New Roman";
    font-size: 12pt;
}

img {
border: none; float: none !important;
}

ul, ol {margin: 0 0 0 30px;}

a,
a:link,
a:visited {
    color: #333;
    text-decoration: underline;
    border: none;
}

p a[href^="http://"]:after,
p a[href^="https://"]:after {
content: " (" attr(href) ")";
font-size: 80%;
text-decoration: underline;
}

a[href^="http://"]:after,
a[href^="https://"]:after {
  content: " (" attr(href) ")";
  font-size: 80%;
  text-decoration: underline;
}

p a[href^="#"]:after, a[href^="#"]:after {
display: none;
}

a[href^="#"] {
text-decoration: none;
}

a[name] {display: none;}

a[name]:after {
display: none;
}

p a {
word-wrap: break-word;
}

em {font-style: italic;}

#header_inner_wrap img,
#header_inner_wrap a,
#guide_nav_tools,
form,
.pure-form,
#tab-container,
.pluslet_body form,
#colorbox,
#cboxContent,
#cboxOverlay,
#footer,
.ui-autocomplete,
#expander,
#letterhead,
#letterhead_small,
.faq_filter,
.striper img,
#autoC,
div.vid_container img {display: none !important; visibility: hidden; height: 0; background: transparent;}

.pluslet {display:block !important; clear: both !important; margin-bottom: 20px;}

.pluslet .pluslet_body a {color: #000; text-decoration: none; border-bottom: none;}

.titlebar_text {font-size: 15pt; font-weight: bold; font-family: inherit !important;}

.clearboth,
.clear-both {
    clear: both;
    margin-bottom: 20px;
}

/* Styling for databases.php */

.list_bonus {display: block !important; margin-bottom: 15px;}

.item_listing {margin-bottom: 15px;}

.item_listing td a[href^="http://"]:after,
.item_listing td a[href^="https://"]:after {
      content: " (" attr(href) ")";
      font-size: 80%;
      display: block;
      clear: both;
      text-decoration: underline;
}

.pluslet .pluslet_body ul li a {
  text-decoration: none;
}

.pluslet .pluslet_body ul li a[href^="http://"]:after,
.pluslet .pluslet_body ul li a[href^="https://"]:after,  {
      content: " (" attr(href) ")";
      font-size: 80%;
      display: block !important;
      clear: both !important;
      text-decoration: underline;
}

/* Styling for index.php */

.subject {
    font-size: 12px;
}

/* Styling for faq.php */

.zebra a {text-decoration: none;}

.pluslet_simple {margin-bottom: 15px;}

.pluslet_simple a {text-decoration: none;}

/* Styling for search.php and results */

.striper {background: #FFF !important; padding-bottom: 10px !important;}

.striper a:before{content: "- ";}

/* Styling for staff.php */

.item_listing .staff-name-row a:after,
.item_listing .staff-title-row a:after,
.item_listing .staff-email-row a:after {display: none !important;}

.staff_photo_large {
    border: 1px solid #333;
    margin-right: 10px;
}

.item_listing .staff_contact a:after {display: none !important;}

.staff_photo,
.staff_photo2 {
    border: 1px solid #333;
    margin-bottom: 10px;
    margin-right: 50px;
}

/* Styling for talkback.php */

.tellus_item {
    border-bottom: 1px dashed #333;
    margin: 15px 0;
}

.comment_num {
    color: #000;
    font-size: 14pt;
    margin-right: 10px;
}

/* Styling for video.php */

div.vid_container {
   margin: 0 0 15px 0;
}

div.vid_container h3[href^="http://"]:after {
  content: " (" attr(href) ")";
  display: block;
  clear: both;
  text-decoration: underline;
  font-size: 80%;
  font-weight: normal;
  padding: 0;
}

} /*Close media print */


text:
package org.systemsbiology.addama.commons.web.views;

import org.json.JSONObject;
import org.springframework.web.servlet.View;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
import java.util.Map;

import static org.systemsbiology.addama.commons.web.utils.HttpIO.getDesiredContentType;

/**
 * @author hrovira
 */
public class JsonView implements View {

    public String getContentType() {
        return "application/json";
    }

    public void render(Map map, HttpServletRequest request, HttpServletResponse response) throws Exception {
        JSONObject json = (JSONObject) map.get("json");
        if (json == null) json = new JSONObject();

        response.setContentType(getDesiredContentType(request, this.getContentType()));

        PrintWriter writer = response.getWriter();
        writer.print(json.toString());
    }

}


text:
[cmdletbinding()]
param()

# Arrange.
. $PSScriptRoot\..\..\lib\Initialize-Test.ps1 -Legacy
. $PSScriptRoot\..\..\..\Tasks\PublishSymbols\LegacyIndexHelpers.ps1
$provider = New-Object psobject -Property @{
        PublicCollectionUrl = 'Some public collection URL'
        SourcesRootPath = 'SomeDrive:\SomeRoot\\\' # Function should handle trimming trailing slashes.
        Workspace = New-Object psobject
    }
$sourceFiles = @(
    'SomeDrive:\SomeRoot\SomeSolution\SomeProject\SomeSource.cs'
    'SomeDrive:\SomeRoot\AnotherSolution\AnotherProject\AnotherSource.cs'
)
$script:now = Get-Date
Register-Mock Get-Date { $script:now }
Register-Mock New-ItemSpec { 'Some item spec 1' } -- -LocalPath 'SomeDrive:\SomeRoot\SomeSolution\SomeProject\SomeSource.cs'
Register-Mock New-ItemSpec { 'Some item spec 2' } -- -LocalPath 'SomeDrive:\SomeRoot\AnotherSolution\AnotherProject\AnotherSource.cs'
$provider.Workspace |
    Add-Member -MemberType ScriptMethod -Name GetLocalVersions -Value {
            $expected = @(
                ,('Some item spec 1', 'Some item spec 2')
                $false
            )
            Assert-AreEqual $expected $args
            $jaggedArray = [System.Array]::CreateInstance([object[]], 2)
            $jaggedArray[0] = [System.Array]::CreateInstance([object], 1)
            $jaggedArray[0][0] = New-Object psobject -Property @{
                    Item = 'LocalVersion:\SomeRoot\SomeSolution\SomeProject\SomeSource.cs'
                    Version = 1
                }
            $jaggedArray[1] = [System.Array]::CreateInstance([object], 1)
            $jaggedArray[1][0] = New-Object psobject -Property @{
                    Item = 'LocalVersion:\SomeRoot\AnotherSolution\AnotherProject\AnotherSource.cs'
                    Version = 2
                }
            $jaggedArray
        }
$provider.Workspace |
    Add-Member -MemberType ScriptMethod -Name GetServerItemForLocalItem -Value {
            Assert-AreEqual 1 $args.Count
            switch ($args[0]) {
                'LocalVersion:\SomeRoot\SomeSolution\SomeProject\SomeSource.cs' {
                    '$/SomeTeamProject/SomeSolution/SomeProject/SomeSource.cs'
                    break
                }
                'LocalVersion:\SomeRoot\AnotherSolution\AnotherProject\AnotherSource.cs' {
                    '$/AnotherTeamProject/AnotherSolution/AnotherProject/AnotherSource.cs'
                    break
                }
                default { throw "Unexpected argument: $($args[0])" }
            }
        }

# Act.
$actual = New-TfvcSrcSrvIniContent -Provider $provider -SourceFilePaths $sourceFiles

# Assert.
$expected = @(
    'SRCSRV: ini ------------------------------------------------'
    'VERSION=3'
    'INDEXVERSION=2'
    'VERCTRL=Team Foundation Server'
    [string]::Format(
        [System.Globalization.CultureInfo]::InvariantCulture,
        'DATETIME={0:ddd MMM dd HH:mm:ss yyyy}',
        $script:now)
    'INDEXER=TFSTB'
    'SRCSRV: variables ------------------------------------------'
    'TFS_EXTRACT_CMD=tf.exe view /version:%var4% /noprompt "$%var3%" /server:%fnvar%(%var2%) /console > %SRCSRVTRG%'
    'TFS_EXTRACT_TARGET=%targ%\%var2%%fnbksl%(%var3%)\%var4%\%fnfile%(%var5%)'
    'SRCSRVVERCTRL=tfs'
    'SRCSRVERRDESC=access'
    'SRCSRVERRVAR=var2'
    "VSTFSSERVER=Some public collection URL"
    'SRCSRVTRG=%TFS_EXTRACT_TARGET%'
    'SRCSRVCMD=%TFS_EXTRACT_CMD%'
    'SRCSRV: source files ---------------------------------------'
    "LocalVersion:\SomeRoot\SomeSolution\SomeProject\SomeSource.cs*VSTFSSERVER*/SomeTeamProject/SomeSolution/SomeProject/SomeSource.cs*1*SomeSource.cs"
    "LocalVersion:\SomeRoot\AnotherSolution\AnotherProject\AnotherSource.cs*VSTFSSERVER*/AnotherTeamProject/AnotherSolution/AnotherProject/AnotherSource.cs*2*AnotherSource.cs"
    'SRCSRV: end ------------------------------------------------'
)
Assert-AreEqual $expected $actual


text:
cask :v1 => 'freesmug-chromium' do
  version '46.0.2490.80'
  sha256 'ccdb9cc43f14fbaad353177b20c7b656a39f132c1a4eacae13c957f65248ab90'

  # sourceforge.net is the official download host per the vendor homepage
  url "http://downloads.sourceforge.net/sourceforge/osxportableapps/Chromium_OSX_#{version}.dmg"
  appcast 'http://sourceforge.net/projects/osxportableapps/rss?path=/Chromium'
  name 'Chromium'
  homepage 'http://www.freesmug.org/chromium'
  license :gpl

  app 'Chromium.app'
end


text:
/* NOTE: This file is autogenerated, do not edit this file directly.*/

#include <TRChartsJNI/Support/DateIntervalStructMarshaller.hpp>
#include <TRChartsJNI/Support/Marshallers.hpp>

using namespace TRChartsJNI;
using namespace Charts;

namespace
{
	bool inited = false;
	jclass cls;
	jmethodID ctor;
	jfieldID fidUnit;
	jfieldID fidMagnitude;

	void checkInited(JNIEnv * const env)
	{
		if(!::inited) {
			::inited = true;
			::cls = (jclass)env->NewGlobalRef(env->FindClass("com/thomsonreuters/corptech/charts/DateInterval"));
			::ctor = env->GetMethodID(::cls, "<init>", "()V");
			::fidUnit = env->GetFieldID(cls, "unit", "Lcom/thomsonreuters/corptech/charts/DateUnit;");
			::fidMagnitude = env->GetFieldID(cls, "magnitude", "D");
		}
	}
}

DateInterval DateIntervalStructMarshaller::marshall(JNIEnv * const env, const jobject & in) const
{
	::checkInited(env);
	DateInterval out;
	out.unit = TRChartsJNI::getDateUnitMarshaller().getFieldValue(env, in, ::fidUnit);
	out.magnitude = TRChartsJNI::getNumberMarshaller().getFieldValue(env, in, ::fidMagnitude);
	return out;
}

jobject DateIntervalStructMarshaller::unmarshall(JNIEnv * const env, const DateInterval & in) const
{
	::checkInited(env);
	jobject out = env->NewObject(::cls, ::ctor);
	TRChartsJNI::getDateUnitMarshaller().setFieldValue(env, out, ::fidUnit, in.unit);
	TRChartsJNI::getNumberMarshaller().setFieldValue(env, out, ::fidMagnitude, in.magnitude);
	return out;
}

DateInterval DateIntervalStructMarshaller::getFieldValue(JNIEnv * const env, const jobject obj, const jfieldID fieldID) const
{
	return marshall(env, env->GetObjectField(obj, fieldID));
}

void DateIntervalStructMarshaller::setFieldValue(JNIEnv * const env, const jobject obj, const jfieldID fieldID, const DateInterval & value) const
{
	env->SetObjectField(obj, fieldID, unmarshall(env, value));
}

DateInterval DateIntervalStructMarshaller::callMethod(JNIEnv * const env, const jobject obj, const jmethodID methodID, jvalue * const args) const
{
	return marshall(env, env->CallObjectMethodA(obj, methodID, args));
}


text:
<?php

namespace Drupal\Tests\Component\Utility;

use Drupal\Component\Utility\Number;
use Drupal\Tests\UnitTestCase;

/**
 * Tests number manipulation utilities.
 *
 * @group Utility
 *
 * @coversDefaultClass \Drupal\Component\Utility\Number
 *
 * @see \Drupal\Component\Utility\Number
 */
class NumberTest extends UnitTestCase {

  /**
   * Tests Number::validStep() without offset.
   *
   * @dataProvider providerTestValidStep
   * @covers ::validStep
   *
   * @param numeric $value
   *   The value argument for Number::validStep().
   * @param numeric $step
   *   The step argument for Number::validStep().
   * @param bool $expected
   *   Expected return value from Number::validStep().
   */
  public function testValidStep($value, $step, $expected) {
    $return = Number::validStep($value, $step);
    $this->assertEquals($expected, $return);
  }

  /**
   * Tests Number::validStep() with offset.
   *
   * @dataProvider providerTestValidStepOffset
   * @covers ::validStep
   *
   * @param numeric $value
   *   The value argument for Number::validStep().
   * @param numeric $step
   *   The step argument for Number::validStep().
   * @param numeric $offset
   *   The offset argument for Number::validStep().
   * @param bool $expected
   *   Expected return value from Number::validStep().
   */
  public function testValidStepOffset($value, $step, $offset, $expected) {
    $return = Number::validStep($value, $step, $offset);
    $this->assertEquals($expected, $return);
  }

  /**
   * Provides data for self::testNumberStep().
   *
   * @see \Drupal\Tests\Component\Utility\Number::testValidStep
   */
  public static function providerTestValidStep() {
    return array(
      // Value and step equal.
      array(10.3, 10.3, TRUE),

      // Valid integer steps.
      array(42, 21, TRUE),
      array(42, 3, TRUE),

      // Valid float steps.
      array(42, 10.5, TRUE),
      array(1, 1 / 3, TRUE),
      array(-100, 100 / 7, TRUE),
      array(1000, -10, TRUE),

      // Valid and very small float steps.
      array(1000.12345, 1e-10, TRUE),
      array(3.9999999999999, 1e-13, TRUE),

      // Invalid integer steps.
      array(100, 30, FALSE),
      array(-10, 4, FALSE),

      // Invalid float steps.
      array(6, 5 / 7, FALSE),
      array(10.3, 10.25, FALSE),

      // Step mismatches very close to being valid.
      array(70 + 9e-7, 10 + 9e-7, FALSE),
      array(1936.5, 3e-8, FALSE),
    );
  }

  /**
   * Data provider for \Drupal\Test\Component\Utility\NumberTest::testValidStepOffset().
   *
   * @see \Drupal\Test\Component\Utility\NumberTest::testValidStepOffset()
   */
  public static function providerTestValidStepOffset() {
    return array(
      // Try obvious fits.
      array(11.3, 10.3, 1, TRUE),
      array(100, 10, 50, TRUE),
      array(-100, 90 / 7, -10, TRUE),
      array(2 / 7 + 5 / 9, 1 / 7, 5 / 9, TRUE),

      // Ensure a small offset is still invalid.
      array(10.3, 10.3, 0.0001, FALSE),
      array(1 / 5, 1 / 7, 1 / 11, FALSE),

      // Try negative values and offsets.
      array(1000, 10, -5, FALSE),
      array(-10, 4, 0, FALSE),
      array(-10, 4, -4, FALSE),
    );
  }

  /**
   * Tests the alphadecimal conversion functions.
   *
   * @dataProvider providerTestConversions
   * @covers ::intToAlphadecimal
   * @covers ::alphadecimalToInt
   *
   * @param int $value
   *   The integer value.
   * @param string $expected
   *   The expected alphadecimal value.
   */
  public function testConversions($value, $expected) {
    $this->assertSame(Number::intToAlphadecimal($value), $expected);
    $this->assertSame($value, Number::alphadecimalToInt($expected));
  }

  /**
   * Data provider for testConversions().
   *
   * @see testConversions()
   *
   * @return array
   *   An array containing:
   *     - The integer value.
   *     - The alphadecimal value.
   */
  public function providerTestConversions() {
    return array(
      array(0, '00'),
      array(1, '01'),
      array(10, '0a'),
      array(20, '0k'),
      array(35, '0z'),
      array(36, '110'),
      array(100, '12s'),
    );
  }

}


text:
module Enscalator
  module Plugins
    # CoreOS appliance
    module CoreOS
      class << self
        # CoreOS Release channels
        # @see https://coreos.com/releases
        CHANNELS = [:alpha, :beta, :stable].freeze

        # Get CoreOS mapping for specific version from specific channel (stable, beta or alpha)
        #
        # @param [Symbol] channel channel identifier
        # @param [String] tag specific version release tag
        # @return [Hash] CoreOS mapping for specific version and channel
        #  (if version tag is not given, returns the most latest version number)
        def get_channel_version(channel: :stable, tag: nil)
          fail ArgumentError, "channel can only be one of #{CHANNELS}" unless CHANNELS.include? channel
          base_url = "http://#{channel}.release.core-os.net/amd64-usr"
          fetch_mapping(base_url, tag)
        end

        # Get CoreOS mapping for specific version regardless of its release channel
        #
        # @param [String] tag version tag
        # @return [Hash] CoreOS mapping for specific version
        #  (if version tag is not given, returns the most latest version number)
        def get_specific_version(tag: nil)
          urls = CHANNELS.map { |c| "http://#{c}.release.core-os.net/amd64-usr" }
          mapping = nil
          urls.each do |u|
            mapping ||= fetch_mapping(u, tag)
          end
          mapping
        end

        private

        # Fetch CoreOS region/virtualization/ami mapping
        #
        # @param [String] base_url url excluding version number and mapping file
        # @param [String] tag specific version release tag
        # @return [Hash] CoreOS mapping
        def fetch_mapping(base_url, tag)
          fail ArgumentError, 'url cannot be empty or nil' if base_url.blank?
          versions = fetch_versions(base_url.ends_with?('/') ? base_url : base_url + '/')
          version = if tag && !tag.empty?
                      versions.find { |v| v == Semantic::Version.new(tag) }.to_s
                    else
                      versions.sort.last.to_s
                    end

          images = open([base_url, version, 'coreos_production_ami_all.json'].join('/')) { |f| f.read }

          json = JSON.parse(images) if images
          parse_raw_mapping(json)
        end

        # Make request to CoreOS release pages, parse response and make a list of versions
        #
        # @param [String] url of web page with CoreOS versions
        # @return [Array] list of Semantic::Version
        def fetch_versions(url)
          html = Nokogiri::HTML(open(url))
          raw_versions = html.xpath('/html/body/a').map { |a| a.children.first.text.chomp('/') }
          raw_versions.select { |rw| rw =~ /^[0-9]/ }.map { |rw| Semantic::Version.new(rw) }
        end

        # Parse and reformat CoreOS default mapping
        #
        # @param [Array] coreos_mapping list of region to virtualization kind mappings
        # @return [Hash] mapping, that can be referred to with find_in_map
        def parse_raw_mapping(coreos_mapping)
          return {} unless coreos_mapping
          amis = coreos_mapping.empty? ? [] : coreos_mapping['amis']
          Hash[
            amis.map { |a| [a['name'], { pv: a['pv'], hvm: a['hvm'] }] }
          ].with_indifferent_access
        end
      end # class << self

      # Initialize CoreOS related configurations
      #
      def core_os_init
        mapping 'AWSCoreOSAMI', CoreOS.get_channel_version(channel: :stable)
      end
    end # module CoreOS
  end # module Plugins
end # module Enscalator


text:
package gov.va.escreening.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author jjinn
 */
@Entity
@Table(name = "consult")
@NamedQueries({
        @NamedQuery(name = "Consult.findAll", query = "SELECT c FROM Consult c") })
public class Consult implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "consult_id")
    private Integer consultId;
    @Basic(optional = false)
    @Column(name = "name")
    private String name;
    @Basic(optional = false)
    @Column(name = "vista_ien")
    private String vistaIen;
    @Basic(optional = false)
    @Column(name = "date_created")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateCreated;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "consult")
    private List<VeteranAssessmentConsult> veteranAssessmentConsultList;

    public Consult() {
    }

    public Consult(Integer consultId) {
        this.consultId = consultId;
    }

    public Consult(Integer consultId, String name, String vistaIen, Date dateCreated) {
        this.consultId = consultId;
        this.name = name;
        this.vistaIen = vistaIen;
        this.dateCreated = dateCreated;
    }

    public Integer getConsultId() {
        return consultId;
    }

    public void setConsultId(Integer consultId) {
        this.consultId = consultId;
    }

    public String getName() {
        return name;
    }

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

    public String getVistaIen() {
        return vistaIen;
    }

    public void setVistaIen(String vistaIen) {
        this.vistaIen = vistaIen;
    }

    public Date getDateCreated() {
        return dateCreated;
    }

    public void setDateCreated(Date dateCreated) {
        this.dateCreated = dateCreated;
    }

    public List<VeteranAssessmentConsult> getVeteranAssessmentConsultList() {
        return veteranAssessmentConsultList;
    }

    public void setVeteranAssessmentConsultList(List<VeteranAssessmentConsult> veteranAssessmentConsultList) {
        this.veteranAssessmentConsultList = veteranAssessmentConsultList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (consultId != null ? consultId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Consult)) {
            return false;
        }
        Consult other = (Consult) object;
        if ((this.consultId == null && other.consultId != null)
                || (this.consultId != null && !this.consultId.equals(other.consultId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "gov.va.escreening.entity.Consult[ consultId=" + consultId + " ]";
    }

}


text:
topic: "Jekyll on Travis-CI"
desc: "Setting up a Jekyll site on Travis-CI (so you can see the error messages)"
layout: default
---

# Why should I set up continuous integration for a [Jekyll](/topics/jekyll/) site on Travis-CI

Setting up a [Jekyll](/topics/jekyll/) site on Github Pages is super convenient.

But one thing Github Pages didn't provide is *access to the error messages* that you get when your site is set up
incorrectly.   Instead, you just get a "404 unavailable" message, or your site doesn't update (your changes don't
seem to have any effect.)

The best way to remedy this—in fact its Github Pages own suggestion—is to set up continuous integration for
your Jekyll site via Travis-CI.

Doing so has these advantages:

* If you are using github pages, you won't see the error messages if/when the site build is broken.   TravisCI is the
    one of two ways that Github Pages suggests for making these error messages visible.  (The other way is to run Jekyll locally
    on your own machine (setting up the site on localhost:4000).

* When the site is broken, TravisCI will send you emails until the site is fixed.

Here's how to do it:

1.  Add a .travis.yml file to the root of your repo, with the following contents:

    ```
    language: ruby
    rvm:
      - 2.1.7
    script: "bundle exec jekyll build"
    ```

2.  Make sure this line is in your _config.yml:

    ```
    exclude: [vendor]
    ```

3.   Visit https://travis-ci.org/ and login with your github.com credentials—the same ones you use to maintain the github repo where the github pages site is stored.

...

Eventually, the page you'll visit is the same page as for your github.com repo, except with github.com replaced with travis-ci.org

For example:

For the repo:

https://github.com/ucsd-cse-spis-2016/ucsd-cse-spis-2016.github.io

Access:

https://travis-ci.org/ucsd-cse-spis-2016/ucsd-cse-spis-2016.github.io


text:
shared_examples_for 'a model with unique generator enabled' do

  it 'should include the mixin' do
    example_model.should be < UniqueGenerator
  end

  describe 'on an instance of an object' do

    before :each do
      example_model.create! :name => "Test Name A"
      example_model.create! :name => "Test Name B"
      @other_model = example_model.create! :name => "Test Name C"
    end

    it "should let you correctly check if a field has a unique value" do
      example_model.create(:name => "Test Name A").should_not be_unique_field :name
      example_model.create(:name => "Test Name D").should be_unique_field :name
      @other_model.should be_unique_field :name
      @other_model.name = 'Test Name A'
      @other_model.should_not be_unique_field :name

    end

    it 'should let you generate a unique token' do
      model = example_model.new
      model.token.should be_blank
      model.generate_unique_field! :token
      model.token.should be_present
    end

    it 'should let you generate the token length' do
      model = example_model.new
      model.generate_unique_field! :token, 100
      model.token.length.should == 100
    end

  end

  describe 'on a class including the mixin' do

    it 'should add a generate random method' do
      example_model.should respond_to(:generate_random)
      example_model.generate_random.should be_present
      example_model.generate_random.should_not == example_model.generate_random
    end

    it 'should let you specify the random string length' do
      example_model.generate_random(32).length.should == 32
      example_model.generate_random(64).length.should == 64
      example_model.generate_random(16).length.should == 16
    end

    it 'should let you generate a unique value' do
      example_model.should respond_to(:generate_unique)
      v = nil
      example_model.generate_unique do |value|
        v = value
      end
      v.should be_present
    end

    it 'should use generate random until the predicate is true' do
      times_called = 0
      mock(example_model).generate_random(32).times(3)
      example_model.generate_unique do |t|
        (times_called += 1) == 3
      end
      times_called.should == 3
    end

    it 'should let you pass an argument to generate random' do
      mock(example_model).generate_random(64) { 'Test' }
      example_model.generate_unique(64) { |t| true }
    end

  end

end


text:
require 'carrierwave/orm/activerecord'
require 'file_size_validator'

class ProjectImportData < ActiveRecord::Base
  belongs_to :project

  serialize :data, JSON

  validates :project, presence: true
end


text:
package com.rometools.rome.feed.module;

import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.rometools.rome.feed.CopyFrom;
import com.rometools.rome.feed.impl.CopyFromHelper;
import com.rometools.rome.feed.impl.ObjectBean;
import com.rometools.utils.Lists;

/**
 * Dublin Core ModuleImpl, default implementation.
 *

 *
 * @see Dublin Core module.
 * @author Alejandro Abdelnur
 *
 */
public class DCModuleImpl extends ModuleImpl implements DCModule {

    private static final long serialVersionUID = 1L;

    private final ObjectBean objBean;
    private List<String> title;
    private List<String> creator;
    private List<DCSubject> subject;
    private List<String> description;
    private List<String> publisher;
    private List<String> contributors;
    private List<Date> date;
    private List<String> type;
    private List<String> format;
    private List<String> identifier;
    private List<String> source;
    private List<String> language;
    private List<String> relation;
    private List<String> coverage;
    private List<String> rights;

    /**
     * Properties to be ignored when cloning.
     */
    private static final Set<String> IGNORE_PROPERTIES = new HashSet<String>();

    /**
     * Unmodifiable Set containing the convenience properties of this class.
     *

     * Convenience properties are mapped to Modules, for cloning the convenience properties can be
     * ignored as the will be copied as part of the module cloning.
     */
    public static final Set<String> CONVENIENCE_PROPERTIES = Collections.unmodifiableSet(IGNORE_PROPERTIES);

    static {
        IGNORE_PROPERTIES.add("title");
        IGNORE_PROPERTIES.add("creator");
        IGNORE_PROPERTIES.add("subject");
        IGNORE_PROPERTIES.add("description");
        IGNORE_PROPERTIES.add("publisher");
        IGNORE_PROPERTIES.add("contributor");
        IGNORE_PROPERTIES.add("date");
        IGNORE_PROPERTIES.add("type");
        IGNORE_PROPERTIES.add("format");
        IGNORE_PROPERTIES.add("identifier");
        IGNORE_PROPERTIES.add("source");
        IGNORE_PROPERTIES.add("language");
        IGNORE_PROPERTIES.add("relation");
        IGNORE_PROPERTIES.add("coverage");
        IGNORE_PROPERTIES.add("rights");
    }

    /**
     * Default constructor. All properties are set to null.
     *

     *
     */
    public DCModuleImpl() {
        super(DCModule.class, URI);
        objBean = new ObjectBean(DCModule.class, this, CONVENIENCE_PROPERTIES);
    }

    /**
     * Returns the DublinCore module titles.
     *

     *
     * @return a list of Strings representing the DublinCore module title, an empty list if none.
     *
     */
    @Override
    public List<String> getTitles() {
        return title = Lists.createWhenNull(title);
    }

    /**
     * Sets the DublinCore module titles.
     *

     *
     * @param titles the list of String representing the DublinCore module titles to set, an empty
     *            list or null if none.
     *
     */
    @Override
    public void setTitles(final List<String> titles) {
        title = titles;
    }

    /**
     * Gets the DublinCore module title. Convenience method that can be used to obtain the first
     * item, null if none.
     *

     *
     * @return the first DublinCore module title, null if none.
     */
    @Override
    public String getTitle() {
        return Lists.firstEntry(title);
    }

    /**
     * Sets the DublinCore module title. Convenience method that can be used when there is only one
     * title to set.
     *

     *
     * @param title the DublinCore module title to set, null if none.
     *
     */
    @Override
    public void setTitle(final String title) {
        this.title = Lists.create(title);
    }

    /**
     * Returns the DublinCore module creator.
     *

     *
     * @return a list of Strings representing the DublinCore module creator, an empty list if none.
     *
     */
    @Override
    public List<String> getCreators() {
        return creator = Lists.createWhenNull(creator);
    }

    /**
     * Sets the DublinCore module creators.
     *

     *
     * @param creators the list of String representing the DublinCore module creators to set, an
     *            empty list or null if none.
     *
     */
    @Override
    public void setCreators(final List<String> creators) {
        creator = creators;
    }

    /**
     * Gets the DublinCore module title. Convenience method that can be used to obtain the first
     * item, null if none.
     *

     *
     * @return the first DublinCore module title, null if none.
     */
    @Override
    public String getCreator() {
        return Lists.firstEntry(creator);
    }

    /**
     * Sets the DublinCore module creator. Convenience method that can be used when there is only
     * one creator to set.
     *

     *
     * @param creator the DublinCore module creator to set, null if none.
     *
     */
    @Override
    public void setCreator(final String creator) {
        this.creator = Lists.create(creator);
    }

    /**
     * Returns the DublinCore module subjects.
     *

     *
     * @return a list of DCSubject elements with the DublinCore module subjects, an empty list if
     *         none.
     *
     */
    @Override
    public List<DCSubject> getSubjects() {
        return subject = Lists.createWhenNull(subject);
    }

    /**
     * Sets the DublinCore module subjects.
     *

     *
     * @param subjects the list of DCSubject elements with the DublinCore module subjects to set, an
     *            empty list or null if none.
     *
     */
    @Override
    public void setSubjects(final List<DCSubject> subjects) {
        subject = subjects;
    }

    /**
     * Gets the DublinCore module subject. Convenience method that can be used to obtain the first
     * item, null if none.
     *

     *
     * @return the first DublinCore module subject, null if none.
     */
    @Override
    public DCSubject getSubject() {
        return Lists.firstEntry(subject);
    }

    /**
     * Sets the DCSubject element. Convenience method that can be used when there is only one
     * subject to set.
     *

     *
     * @param subject the DublinCore module subject to set, null if none.
     *
     */
    @Override
    public void setSubject(final DCSubject subject) {
        this.subject = Lists.create(subject);
    }

    /**
     * Returns the DublinCore module description.
     *

     *
     * @return a list of Strings representing the DublinCore module description, an empty list if
     *         none.
     *
     */
    @Override
    public List<String> getDescriptions() {
        return description = Lists.createWhenNull(description);
    }

    /**
     * Sets the DublinCore module descriptions.
     *

     *
     * @param descriptions the list of String representing the DublinCore module descriptions to
     *            set, an empty list or null if none.
     *
     */
    @Override
    public void setDescriptions(final List<String> descriptions) {
        description = descriptions;
    }

    /**
     * Gets the DublinCore module description. Convenience method that can be used to obtain the
     * first item, null if none.
     *

     *
     * @return the first DublinCore module description, null if none.
     */
    @Override
    public String getDescription() {
        return Lists.firstEntry(description);
    }

    /**
     * Sets the DublinCore module description. Convenience method that can be used when there is
     * only one description to set.
     *

     *
     * @param description the DublinCore module description to set, null if none.
     *
     */
    @Override
    public void setDescription(final String description) {
        this.description = Lists.create(description);
    }

    /**
     * Returns the DublinCore module publisher.
     *

     *
     * @return a list of Strings representing the DublinCore module publisher, an empty list if
     *         none.
     *
     */
    @Override
    public List<String> getPublishers() {
        return publisher = Lists.createWhenNull(publisher);
    }

    /**
     * Sets the DublinCore module publishers.
     *

     *
     * @param publishers the list of String representing the DublinCore module publishers to set, an
     *            empty list or null if none.
     *
     */
    @Override
    public void setPublishers(final List<String> publishers) {
        publisher = publishers;
    }

    /**
     * Gets the DublinCore module title. Convenience method that can be used to obtain the first
     * item, null if none.
     *

     *
     * @return the first DublinCore module title, null if none.
     */
    @Override
    public String getPublisher() {
        return Lists.firstEntry(publisher);
    }

    /**
     * Sets the DublinCore module publisher. Convenience method that can be used when there is only
     * one publisher to set.
     *

     *
     * @param publisher the DublinCore module publisher to set, null if none.
     *
     */
    @Override
    public void setPublisher(final String publisher) {
        this.publisher = Lists.create(publisher);
    }

    /**
     * Returns the DublinCore module contributor.
     *

     *
     * @return a list of Strings representing the DublinCore module contributor, an empty list if
     *         none.
     *
     */
    @Override
    public List<String> getContributors() {
        return contributors = Lists.createWhenNull(contributors);
    }

    /**
     * Sets the DublinCore module contributors.
     *

     *
     * @param contributors the list of String representing the DublinCore module contributors to
     *            set, an empty list or null if none.
     *
     */
    @Override
    public void setContributors(final List<String> contributors) {
        this.contributors = contributors;
    }

    /**
     * Gets the DublinCore module contributor. Convenience method that can be used to obtain the
     * first item, null if none.
     *

     *
     * @return the first DublinCore module contributor, null if none.
     */
    @Override
    public String getContributor() {
        return Lists.firstEntry(contributors);
    }

    /**
     * Sets the DublinCore module contributor. Convenience method that can be used when there is
     * only one contributor to set.
     *

     *
     * @param contributor the DublinCore module contributor to set, null if none.
     *
     */
    @Override
    public void setContributor(final String contributor) {
        contributors = Lists.create(contributor);
    }

    /**
     * Returns the DublinCore module date.
     *

     *
     * @return a list of Strings representing the DublinCore module date, an empty list if none.
     *
     */
    @Override
    public List<Date> getDates() {
        return date = Lists.createWhenNull(date);
    }

    /**
     * Sets the DublinCore module dates.
     *

     *
     * @param dates the list of Date representing the DublinCore module dates to set, an empty list
     *            or null if none.
     *
     */
    @Override
    public void setDates(final List<Date> dates) {
        date = dates;
    }

    /**
     * Gets the DublinCore module date. Convenience method that can be used to obtain the first
     * item, null if none.
     *

     *
     * @return the first DublinCore module date, null if none.
     */
    @Override
    public Date getDate() {
        return Lists.firstEntry(date);
    }

    /**
     * Sets the DublinCore module date. Convenience method that can be used when there is only one
     * date to set.
     *

     *
     * @param date the DublinCore module date to set, null if none.
     *
     */
    @Override
    public void setDate(final Date date) {
        this.date = Lists.create(date);
    }

    /**
     * Returns the DublinCore module type.
     *

     *
     * @return a list of Strings representing the DublinCore module type, an empty list if none.
     *
     */
    @Override
    public List<String> getTypes() {
        return type = Lists.createWhenNull(type);
    }

    /**
     * Sets the DublinCore module types.
     *

     *
     * @param types the list of String representing the DublinCore module types to set, an empty
     *            list or null if none.
     *
     */
    @Override
    public void setTypes(final List<String> types) {
        type = types;
    }

    /**
     * Gets the DublinCore module type. Convenience method that can be used to obtain the first
     * item, null if none.
     *

     *
     * @return the first DublinCore module type, null if none.
     */
    @Override
    public String getType() {
        return Lists.firstEntry(type);
    }

    /**
     * Sets the DublinCore module type. Convenience method that can be used when there is only one
     * type to set.
     *

     *
     * @param type the DublinCore module type to set, null if none.
     *
     */
    @Override
    public void setType(final String type) {
        this.type = Lists.create(type);
    }

    /**
     * Returns the DublinCore module format.
     *

     *
     * @return a list of Strings representing the DublinCore module format, an empty list if none.
     *
     */
    @Override
    public List<String> getFormats() {
        return format = Lists.createWhenNull(format);
    }

    /**
     * Sets the DublinCore module formats.
     *

     *
     * @param formats the list of String representing the DublinCore module formats to set, an empty
     *            list or null if none.
     *
     */
    @Override
    public void setFormats(final List<String> formats) {
        format = formats;
    }

    /**
     * Gets the DublinCore module format. Convenience method that can be used to obtain the first
     * item, null if none.
     *

     *
     * @return the first DublinCore module format, null if none.
     */
    @Override
    public String getFormat() {
        return Lists.firstEntry(format);
    }

    /**
     * Sets the DublinCore module format. Convenience method that can be used when there is only one
     * format to set.
     *

     *
     * @param format the DublinCore module format to set, null if none.
     *
     */
    @Override
    public void setFormat(final String format) {
        this.format = Lists.create(format);
    }

    /**
     * Returns the DublinCore module identifier.
     *

     *
     * @return a list of Strings representing the DublinCore module identifier, an empty list if
     *         none.
     *
     */
    @Override
    public List<String> getIdentifiers() {
        return identifier = Lists.createWhenNull(identifier);
    }

    /**
     * Sets the DublinCore module identifiers.
     *

     *
     * @param identifiers the list of String representing the DublinCore module identifiers to set,
     *            an empty list or null if none.
     *
     */
    @Override
    public void setIdentifiers(final List<String> identifiers) {
        identifier = identifiers;
    }

    /**
     * Gets the DublinCore module identifier. Convenience method that can be used to obtain the
     * first item, null if none.
     *

     *
     * @return the first DublinCore module identifier, null if none.
     */
    @Override
    public String getIdentifier() {
        return Lists.firstEntry(identifier);
    }

    /**
     * Sets the DublinCore module identifier. Convenience method that can be used when there is only
     * one identifier to set.
     *

     *
     * @param identifier the DublinCore module identifier to set, null if none.
     *
     */
    @Override
    public void setIdentifier(final String identifier) {
        this.identifier = Lists.create(identifier);
    }

    /**
     * Returns the DublinCore module source.
     *

     *
     * @return a list of Strings representing the DublinCore module source, an empty list if none.
     *
     */
    @Override
    public List<String> getSources() {
        return source = Lists.createWhenNull(source);
    }

    /**
     * Sets the DublinCore module sources.
     *

     *
     * @param sources the list of String representing the DublinCore module sources to set, an empty
     *            list or null if none.
     *
     */
    @Override
    public void setSources(final List<String> sources) {
        source = sources;
    }

    /**
     * Gets the DublinCore module source. Convenience method that can be used to obtain the first
     * item, null if none.
     *

     *
     * @return the first DublinCore module source, null if none.
     */
    @Override
    public String getSource() {
        return Lists.firstEntry(source);
    }

    /**
     * Sets the DublinCore module source. Convenience method that can be used when there is only one
     * source to set.
     *

     *
     * @param source the DublinCore module source to set, null if none.
     *
     */
    @Override
    public void setSource(final String source) {
        this.source = Lists.create(source);
    }

    /**
     * Returns the DublinCore module language.
     *

     *
     * @return a list of Strings representing the DublinCore module language, an empty list if none.
     *
     */
    @Override
    public List<String> getLanguages() {
        return language = Lists.createWhenNull(language);
    }

    /**
     * Sets the DublinCore module languages.
     *

     *
     * @param languages the list of String representing the DublinCore module languages to set, an
     *            empty list or null if none.
     *
     */
    @Override
    public void setLanguages(final List<String> languages) {
        language = languages;
    }

    /**
     * Gets the DublinCore module language. Convenience method that can be used to obtain the first
     * item, null if none.
     *

     *
     * @return the first DublinCore module langauge, null if none.
     */
    @Override
    public String getLanguage() {
        return Lists.firstEntry(language);
    }

    /**
     * Sets the DublinCore module language. Convenience method that can be used when there is only
     * one language to set.
     *

     *
     * @param language the DublinCore module language to set, null if none.
     *
     */
    @Override
    public void setLanguage(final String language) {
        this.language = Lists.create(language);
    }

    /**
     * Returns the DublinCore module relation.
     *

     *
     * @return a list of Strings representing the DublinCore module relation, an empty list if none.
     *
     */
    @Override
    public List<String> getRelations() {
        return relation = Lists.createWhenNull(relation);
    }

    /**
     * Sets the DublinCore module relations.
     *

     *
     * @param relations the list of String representing the DublinCore module relations to set, an
     *            empty list or null if none.
     *
     */
    @Override
    public void setRelations(final List<String> relations) {
        relation = relations;
    }

    /**
     * Gets the DublinCore module relation. Convenience method that can be used to obtain the first
     * item, null if none.
     *

     *
     * @return the first DublinCore module relation, null if none.
     */
    @Override
    public String getRelation() {
        return Lists.firstEntry(relation);
    }

    /**
     * Sets the DublinCore module relation. Convenience method that can be used when there is only
     * one relation to set.
     *

     *
     * @param relation the DublinCore module relation to set, null if none.
     *
     */
    @Override
    public void setRelation(final String relation) {
        this.relation = Lists.create(relation);
    }

    /**
     * Returns the DublinCore module coverage.
     *

     *
     * @return a list of Strings representing the DublinCore module coverage, an empty list if none.
     *
     */
    @Override
    public List<String> getCoverages() {
        return coverage = Lists.createWhenNull(coverage);
    }

    /**
     * Sets the DublinCore module coverages.
     *

     *
     * @param coverages the list of String representing the DublinCore module coverages to set, an
     *            empty list or null if none.
     *
     */
    @Override
    public void setCoverages(final List<String> coverages) {
        coverage = coverages;
    }

    /**
     * Gets the DublinCore module coverage. Convenience method that can be used to obtain the first
     * item, null if none.
     *

     *
     * @return the first DublinCore module coverage, null if none.
     */
    @Override
    public String getCoverage() {
        return Lists.firstEntry(coverage);
    }

    /**
     * Sets the DublinCore module coverage. Convenience method that can be used when there is only
     * one coverage to set.
     *

     *
     * @param coverage the DublinCore module coverage to set, null if none.
     *
     */
    @Override
    public void setCoverage(final String coverage) {
        this.coverage = Lists.create(coverage);
    }

    /**
     * Returns the DublinCore module rights.
     *

     *
     * @return a list of Strings representing the DublinCore module rights, an empty list if none.
     *
     */
    @Override
    public List<String> getRightsList() {
        return rights = Lists.createWhenNull(rights);
    }

    /**
     * Sets the DublinCore module rights.
     *

     *
     * @param rights the list of String representing the DublinCore module rights to set, an empty
     *            list or null if none.
     *
     */
    @Override
    public void setRightsList(final List<String> rights) {
        this.rights = rights;
    }

    /**
     * Gets the DublinCore module rights. Convenience method that can be used to obtain the first
     * item, null if none.
     *

     *
     * @return the first DublinCore module rights, null if none.
     */
    @Override
    public String getRights() {
        return Lists.firstEntry(rights);
    }

    /**
     * Sets the DublinCore module rights. Convenience method that can be used when there is only one
     * rights to set.
     *

     *
     * @param rights the DublinCore module rights to set, null if none.
     *
     */
    @Override
    public void setRights(final String rights) {
        this.rights = Lists.create(rights);
    }

    /**
     * Creates a deep 'bean' clone of the object.
     *

     *
     * @return a clone of the object.
     * @throws CloneNotSupportedException thrown if an element of the object cannot be cloned.
     *
     */
    @Override
    public final Object clone() throws CloneNotSupportedException {
        return objBean.clone();
    }

    /**
     * Indicates whether some other object is "equal to" this one as defined by the Object equals()
     * method.
     *

     *
     * @param other he reference object with which to compare.
     * @return true if 'this' object is equal to the 'other' object.
     *
     */
    @Override
    public final boolean equals(final Object other) {
        return objBean.equals(other);
    }

    /**
     * Returns a hashcode value for the object.
     *

     * It follows the contract defined by the Object hashCode() method.
     *

     *
     * @return the hashcode of the bean object.
     *
     */
    @Override
    public final int hashCode() {
        return objBean.hashCode();
    }

    /**
     * Returns the String representation for the object.
     *

     *
     * @return String representation for the object.
     *
     */
    @Override
    public final String toString() {
        return objBean.toString();
    }

    @Override
    public final Class<DCModule> getInterface() {
        return DCModule.class;
    }

    @Override
    public final void copyFrom(final CopyFrom obj) {
        COPY_FROM_HELPER.copy(this, obj);
    }

    private static final CopyFromHelper COPY_FROM_HELPER;

    static {
        final Map<String, Class<?>> basePropInterfaceMap = new HashMap<String, Class<?>>();
        basePropInterfaceMap.put("titles", String.class);
        basePropInterfaceMap.put("creators", String.class);
        basePropInterfaceMap.put("subjects", DCSubject.class);
        basePropInterfaceMap.put("descriptions", String.class);
        basePropInterfaceMap.put("publishers", String.class);
        basePropInterfaceMap.put("contributors", String.class);
        basePropInterfaceMap.put("dates", Date.class);
        basePropInterfaceMap.put("types", String.class);
        basePropInterfaceMap.put("formats", String.class);
        basePropInterfaceMap.put("identifiers", String.class);
        basePropInterfaceMap.put("sources", String.class);
        basePropInterfaceMap.put("languages", String.class);
        basePropInterfaceMap.put("relations", String.class);
        basePropInterfaceMap.put("coverages", String.class);
        basePropInterfaceMap.put("rightsList", String.class);

        final Map<Class<? extends CopyFrom>, Class<?>> basePropClassImplMap = new HashMap<Class<? extends CopyFrom>, Class<?>>();
        basePropClassImplMap.put(DCSubject.class, DCSubjectImpl.class);

        COPY_FROM_HELPER = new CopyFromHelper(DCModule.class, basePropInterfaceMap, basePropClassImplMap);
    }

}


text:
 - git clone https://github.com/Suryanarayanamurthy/simple-shopping-cart-application-Angularjs.git
 - npm install
 - npm start


text:
using System.Collections.Generic;

namespace Rikrop.Core.Wpf.Collections
{
    public class FirstPageSequentialCollectionRefreshStrategy<TItem> : ISequentialCollectionRefreshStrategy<TItem>
    {
        private readonly int _firstPageSize;
        private readonly int _commonPageSize;

        public FirstPageSequentialCollectionRefreshStrategy(int firstPageSize, int commonPageSize)
        {
            _firstPageSize = firstPageSize;
            _commonPageSize = commonPageSize;
        }

        public FirstPageSequentialCollectionRefreshStrategy(int commonPageSize)
            : this(commonPageSize, commonPageSize)
        {
        }

        public int GetNextPageSize(IList<TItem> targetCollection)
        {
            if (targetCollection.Count == 0)
            {
                return _firstPageSize;
            }
            return _commonPageSize;
        }

        public int GetRefreshTotalItemsCount(IList<TItem> targetCollection)
        {
            return _firstPageSize;
        }

        public ICollectionMerger<TItem> GetCollectionMerger()
        {
            return new ResetCollectionMerger<TItem>();
        }
    }
}


text:
package com.nitroxenon.themoviedb;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;

public class SeasonActivity extends ActionBarActivity {
    int totalSeason;

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

        Bundle b = getIntent().getExtras();
        if (b != null) {
            totalSeason = b.getInt("season");

        }
    }
}