text:
<?php use_helper('a') ?>
<?php
  // Compatible with sf_escaping_strategy: true
  $form = isset($form) ? $sf_data->getRaw('form') : null;
  $popularTags = isset($popularTags) ? $sf_data->getRaw('popularTags') : array();
  $allTags = isset($allTags) ? $sf_data->getRaw('allTags') : array();
?>
<?php echo $form->renderHiddenFields() ?>

	  <?php $w = $form['title_or_tag'] ?>
	  <input class="blog-slot-radio-button" type="radio" id="<?php echo $w->renderId() ?>-tag" name="<?php echo $w->renderName() ?>" value="tags" <?php echo ($w->getValue() === "tags") ? 'checked' : '' ?> />

<label for="<?php echo $w->renderId() ?>-tag"><?php echo a_('By Category and Tag') ?>

					<label for="<?php echo $form['count']->renderId() ?>" class="a-form-field-label"><?php echo a_('Number of Posts') ?>
	      	<?php echo $form['count']->render() ?>

<?php echo $form['count']->renderHelp() ?>

<?php echo $form['count']->renderError() ?>

	      	<label class="a-multiple-select-label" for="<?php echo $form['categories_list']->renderId() ?>"><?php echo a_('Select Categories')?><?php echo $form['categories_list']->render() ?>
<?php /* ?>

<?php echo $form['categories_list']->renderHelp() ?>

<?php //*/ ?>

<?php echo $form['categories_list']->renderError() ?>

			<label for="<?php echo $form['tags_list']->renderId() ?>"><?php echo a_('Tagged') ?>

	  	  <?php echo $form['tags_list']->render() ?>
	      <?php $options = array('popular-tags' => $popularTags, 'tags-label' => ' ', 'commit-selector' => '#a-slot-form-submit-' . $id, 'typeahead-url' => url_for('taggableComplete/complete')) ?>
	      <?php if (sfConfig::get('app_a_all_tags', true)): ?>
	        <?php $options['all-tags'] = $allTags ?>
	      <?php endif ?>
	      <?php a_js_call('pkInlineTaggableWidget(?, ?)', '#' . $form['tags_list']->renderId(), $options) ?>

<?php echo $form['tags_list']->renderHelp() ?>

<?php echo $form['tags_list']->renderError() ?>

	  <?php $w = $form['title_or_tag'] ?>
	  <input class="blog-slot-radio-button" type="radio" id="<?php echo $w->renderId() ?>-title" name="<?php echo $w->renderName() ?>" value="title" <?php echo ($w->getValue() === "title") ? 'checked' : '' ?> />

<label for="<?php echo $w->renderId() ?>-title"><?php echo a_('By Title') ?>

	    <?php echo $form['blog_posts']->render() ?>

<?php a_js_call('aBlog.slotEditView(?)', array('formName' => $form->getName(), 'autocompleteUrl' => a_url('aBlogAdmin', 'search'), 'class' => 'blog-posts', 'selfLabelSelector' => '#'.$w->renderId().'-title', 'debug' => false)) ?>


text:
package basic.recursion;

import static org.junit.Assert.assertEquals;

import java.util.List;

import org.junit.Test;

public class PermutationGeneratorTest {

	@Test
	public void test() {
		PermutationGenerator pg = new PermutationGenerator(new Character[]{'A', 'B', 'C', 'D'});
		List<List<Character>> ret = pg.generate(3);
		for (List<Character> s : ret){
			System.out.println(s);
		}
		assertEquals(24, ret.size());
	}

}

redpajama_set_name: RedPajamaGithub


text:
package org.apache.felix.mosgi.managedelements.osgiprobes;

/**
 * TODO : Should listen to Agent Service lifecycle
 *        Need to change ObjectName
 *        Should listen to serviceLifecycle
**/

import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.Vector;

import javax.management.MBeanServer;
import javax.management.ObjectName;
import javax.management.NotificationBroadcasterSupport;

import org.osgi.framework.Bundle;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleEvent;
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
import org.osgi.framework.ServiceEvent;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
import org.osgi.framework.ServiceListener;

import org.apache.felix.framework.cache.BundleCache;

import org.osgi.service.log.LogService;

public class OsgiProbes extends NotificationBroadcasterSupport implements BundleActivator, OsgiProbesMBean {

  private String version = null;
  private static final String TAB_NAME_STRING = "TabUI:name=OsgiProbes";

  private MBeanServer server = null;
  private BundleContext bc = null;
  private ServiceRegistration sr = null;

  ////////////////////////////////////////////////////////
  //     TabIfc (from OsgiProbesMBean)                  //
  ////////////////////////////////////////////////////////
  public String getBundleName() {
    return this.bc.getProperty("mosgi.jmxconsole.tab.url.osgiprobestab");
  }

  ////////////////////////////////////////////////////////
  //       BundleActivator                              //
  ////////////////////////////////////////////////////////
  public void start(BundleContext context) throws Exception  {
    this.bc=context;
    this.log(LogService.LOG_INFO, "Starting OsgiProbe MBean " + this.version,null);
    java.util.Properties p = new java.util.Properties();
    p.put(org.apache.felix.mosgi.jmx.agent.Constants.OBJECTNAME, TAB_NAME_STRING);
    this.sr = this.bc.registerService(OsgiProbesMBean.class.getName(), this, p);
    this.version=(String)bc.getBundle().getHeaders().get(Constants.BUNDLE_VERSION);
    this.log(LogService.LOG_INFO, "OsgiProbes MBean "+this.version+" started", null);
  }

  public void stop(BundleContext context) {
    this.log(LogService.LOG_INFO, "Stopping OsgiProbes MBean "+this.version, null);
    this.sr.unregister();
    this.sr=null;
    this.log(LogService.LOG_INFO, "OsgiProbes MBean "+this.version+" stopped", null);
    this.bc=null;
  }

  ////////////////////////////////////////////////////////
  //       OsgiProbesMBean                              //
  ////////////////////////////////////////////////////////
  public String getFwVersion(){
    return this.bc.getProperty(Constants.FRAMEWORK_VERSION);
  }

  public String getFwVendor (){
    return this.bc.getProperty(Constants.FRAMEWORK_VENDOR);
  }

  public String getFwLanguage(){
    return this.bc.getProperty(Constants.FRAMEWORK_LANGUAGE);
  }

  public String getFwOsName(){
    return this.bc.getProperty(Constants.FRAMEWORK_OS_NAME);
  }

  public String getFwOsVersion(){
    return this.bc.getProperty(Constants.FRAMEWORK_OS_VERSION);
  }

  public String getFwProcessor(){
    return this.bc.getProperty(Constants.FRAMEWORK_PROCESSOR);
  }

  public String getFwExeEnv(){
    return System.getProperty("java.version");
//    return (String) this.bc.getProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT);
  }

  public String getProfile(){
    return this.bc.getProperty(BundleCache.CACHE_PROFILE_PROP);
  }

  private void log(int prio, String message, Throwable t){
    if (this.bc!=null){
      ServiceReference logSR=this.bc.getServiceReference(LogService.class.getName());
      if (logSR!=null){
        ((LogService)this.bc.getService(logSR)).log(prio, message, t);
      }else{
        System.out.println("No Log Service");
      }
    }else{
      System.out.println(this.getClass().getName()+".log: No bundleContext");
    }
  }

}


text:
<?php

/**
 *
 *  * This is an iumio Framework component
 *  *
 *  * (c) RAFINA DANY <dany.rafina@iumio.com>
 *  *
 *  * iumio Framework, an iumio component [https://iumio.com]
 *  *
 *  * To get more information about licence, please check the licence file
 *
 */

namespace iumioFramework\Core\Requirement\Environment;

/**
 * Class FrameworkEnvironmentDispatcher
 * Class for dispatch to correct environment
 *
 * @package  iumioFramework\Core\Requirement
 * @category Framework
 * @licence  MIT License
 * @link https://framework.iumio.com
 * @author   RAFINA Dany <dany.rafina@iumio.com>
 */
class FrameworkEnvironmentDispatcher
{

    /** Dispatch a client to a specific environment
     * Environment is based on framework.config.json => default_env [dev, prod]
     * @return int Dispatch is a success
     * @throws \Exception Environment is not valid or file framework.config.json is empty or not valid
     * @throws \iumioFramework\Core\Exception\Server\Server500
     */
    public static function dispatch():int
    {
        // Import Composer Autoloader
        require_once __DIR__.'/../../../../../autoload.php';

        // Getting File config
        $config = file_get_contents(realpath(__DIR__ .
            "/../../../../../../elements/config_files/core/framework.config.json"));
        if (!$config) {
            throw new \Exception("Cannot dispatch to specific environment :
            framework.config.json File is empty or not valid");
        }
        $config = json_decode($config);
        $env = $config->default_env;
        if (!in_array($env, array("dev", "prod"))) {
            throw new \Exception("Cannot dispatch to specific environment :
            environment is not valid : $env");
        }

        if ($env === "dev") {
            return (DevEnvironment::start());
        } else {
            return (ProdEnvironment::start());
        }
    }
}


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

<TITLE>
Uses of Class com.appygram.java.AppygramMessage
</TITLE>

<META NAME="date" CONTENT="2014-04-08">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
com.appygram.java.AppygramMessage

Uses of AppygramMessage in com.appygram.java

Subclasses of AppygramMessage in com.appygram.java

 class
AppygramTrace

          Represents an Appygram message specifically for handling exceptions.

Methods in com.appygram.java that return AppygramMessage

 AppygramMessage
AppygramMessenger.create()

          Creates a new AppygramMessage based on your configuration
 settings, setting defaults for fields such as topic,
 platform, and software.

 AppygramMessage
AppygramEvent.getMessage()

          The original message that was sent.

Methods in com.appygram.java with parameters of type AppygramMessage

 void
AppygramMessenger.send(AppygramMessage message)

          Send an Appygram message.

 void
AppygramEvent.setMessage(AppygramMessage message)

      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes


text:
import { Question } from 'inquirer';
import UI = require('console-ui');

new UI({
    inputStream: process.stdin,
    outputStream: process.stderr,
    errorStream: process.stdout,
    writeLevel: 'DEBUG',
    ci: false
});

const ui = new UI();

ui.write(); // $ExpectError
ui.write('hello');
ui.write('hello', 'DEBUG');
ui.write('hello', 'INFO');
ui.write('hello', 'WARNING');
ui.write('hello', 'ERROR');
ui.write('hello', 'NONEXISTENT'); // $ExpectError

ui.writeLine(); // $ExpectError
ui.writeLine('hello');
ui.writeLine('hello', 'DEBUG');
ui.writeLine('hello', 'INFO');
ui.writeLine('hello', 'WARNING');
ui.writeLine('hello', 'ERROR');
ui.writeLine('hello', 'NONEXISTENT'); // $ExpectError

ui.writeDebugLine('hello');

ui.writeWarnLine('hello');
ui.writeWarnLine('hello', true);
ui.writeWarnLine('hello', false, true);

ui.writeDeprecateLine('hello');
ui.writeDeprecateLine('hello', true);
ui.writeDeprecateLine('hello', false, true);

ui.writeError(new Error('boom!'));
ui.writeError('boom!'); // $ExpectError

ui.setWriteLevel('DEBUG');
ui.setWriteLevel('INFO');
ui.setWriteLevel('WARNING');
ui.setWriteLevel('ERROR');
ui.setWriteLevel('NONEXISTENT'); // $ExpectError

ui.startProgress('hello');
ui.stopProgress();
ui.stopProgress('hello'); // $ExpectError

const question: Question<{ answer: boolean }> = {
    message: 'Yes / No?',
    type: 'confirm'
};

ui.prompt(question).then(result => {
    result.answer; // $ExpectType boolean
});


text:
<!DOCTYPE html>

        <meta charset="utf-8">

            The following lines should not be rendered with the same
            font.

        اختبار النص مائل

        اختبار النص مائل


text:
<?php

namespace DataSift\Storyplayer\Injectables;

use DataSift\Storyplayer\Output;

/**
 * support for output to the user
 *
 * @category  Libraries
 * @package   Storyplayer/Injectables
 * @author    Stuart Herbert <stuart.herbert@datasift.com>
 * @copyright 2011-present Mediasift Ltd www.datasift.com
 * @license   http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @link      http://datasift.github.io/storyplayer
 */
trait OutputSupport
{
    /**
     * the output proxy
     * @var Output
     */
    public $output = null;

    /**
     *
     * @return Output
     */
    public function initOutputSupport()
    {
        $this->output = new Output();

        return $this->output;
    }

    /**
     * @return Output
     */
    public function getOutput()
    {
        if ($this->output === null) {
            throw new E4xx_NotInitialised('output');
        }

        return $this->output;
    }
}


text:
package gov.nih.nci.catrip.service.test;

import gov.nih.nci.cagrid.cae.client.CAEClient;
import gov.nih.nci.cagrid.cqlquery.CQLQuery;
import gov.nih.nci.cagrid.cqlresultset.CQLQueryResults;
import gov.nih.nci.cagrid.data.utilities.CQLQueryResultsIterator;
import java.io.File;
import java.io.FileInputStream;

import java.io.IOException;

import java.util.Properties;

import junit.framework.TestCase;
import org.globus.wsrf.encoding.ObjectDeserializer;
import org.xml.sax.InputSource;

/**
 * This system test validates an existing CAE service by submitting CQL to it.
 * @author Patrick McConnell
 * @testType system
 */
public class TestCAEService extends TestCase {
//
    private static String url = "";
    private static String clientConfig = "";
    public static String CQL_FILES_DIR = "./cql";

    static {
        Properties properties = new Properties();
        try {
                properties.load(new FileInputStream(CQL_FILES_DIR+File.separator+"cql.properties"));
            } catch (IOException e) {
                e.printStackTrace();
        }
        url=properties.getProperty("serviceURL");
        clientConfig=properties.getProperty("clientConfig");
    }

    public TestCAEService (String sTestName) {
        super(sTestName);
    }

    protected void setUp() throws Exception {
        super.setUp();
    }

    protected void tearDown() throws Exception {
        super.tearDown();
    }

    public CQLQuery getCQLQuery(String fileName)  throws Exception {

        java.lang.Object obj = ObjectDeserializer.deserialize(new InputSource(new FileInputStream(CQL_FILES_DIR+File.separator+fileName)),CQLQuery.class);
        return (CQLQuery)obj;

    }

    private void getParticipants(String fileName)  throws Exception {
         //String fileName = "many-to-many.xml";
         CAEClient client = new CAEClient(url);
         CQLQueryResults results = client.query(getCQLQuery(fileName));

         CQLQueryResultsIterator iter = new CQLQueryResultsIterator(results, new FileInputStream(new File(clientConfig)));
		 System.out.println("Results for "+fileName);
         while (iter.hasNext()) {
//                edu.duke.catrip.cae.domain.general.Participant de = (edu.duke.catrip.cae.domain.general.Participant) iter.next();
//          System.out.println(de.getId());
         }
         System.out.println("---------------------");
    }

    /**
     * Test getting participants
     * @throws Exception
     */
    public void testGetParticipants() throws Exception {
        getParticipants("Participants.xml");
    }

}


text:
package org.pac4j.oauth.client;

import org.pac4j.core.util.HttpActionHelper;
import org.pac4j.oauth.profile.wordpress.WordPressProfileDefinition;
import org.pac4j.oauth.profile.wordpress.WordPressProfile;
import org.pac4j.scribe.builder.api.WordPressApi20;

import java.util.Optional;

/**
 *
This class is the OAuth client to authenticate users in WordPress.

 *
It returns a {@link WordPressProfile}.

 *
More information at http://developer.wordpress.com/docs/oauth2/

 *
 * @author Jerome Leleu
 * @since 1.1.0
 */
public class WordPressClient extends OAuth20Client {

    public WordPressClient() {
    }

    public WordPressClient(final String key, final String secret) {
        setKey(key);
        setSecret(secret);
    }

    @Override
    protected void internalInit(final boolean forceReinit) {
        configuration.setApi(new WordPressApi20());
        configuration.setProfileDefinition(new WordPressProfileDefinition());
        configuration.setTokenAsHeader(true);
        defaultLogoutActionBuilder((ctx, session, profile, targetUrl) ->
            Optional.of(HttpActionHelper.buildRedirectUrlAction(ctx, "https://wordpress.com/wp-login.php?action=logout")));

        super.internalInit(forceReinit);
    }
}


text:
"use strict";

Object.defineProperty(exports, "__esModule", {
    value: true
});

var _bluebirdLst;

function _load_bluebirdLst() {
    return _bluebirdLst = require("bluebird-lst");
}

var _bluebirdLst2;

function _load_bluebirdLst2() {
    return _bluebirdLst2 = _interopRequireDefault(require("bluebird-lst"));
}

var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();

var _electronBuilderCore;

function _load_electronBuilderCore() {
    return _electronBuilderCore = require("electron-builder-core");
}

var _electronBuilderUtil;

function _load_electronBuilderUtil() {
    return _electronBuilderUtil = require("electron-builder-util");
}

var _binDownload;

function _load_binDownload() {
    return _binDownload = require("electron-builder-util/out/binDownload");
}

var _fs;

function _load_fs() {
    return _fs = require("electron-builder-util/out/fs");
}

var _log;

function _load_log() {
    return _log = require("electron-builder-util/out/log");
}

var _fsExtraP;

function _load_fsExtraP() {
    return _fsExtraP = require("fs-extra-p");
}

var _path = _interopRequireWildcard(require("path"));

var _uuid;

function _load_uuid() {
    return _uuid = require("uuid-1345");
}

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

const appImageVersion = process.platform === "darwin" ? "AppImage-09-07-16-mac" : "AppImage-09-07-16-linux";
//noinspection SpellCheckingInspection
const appImageSha256 = process.platform === "darwin" ? "5d4a954876654403698a01ef5bd7f218f18826261332e7d31d93ab4432fa0312" : "ac324e90b502f4e995f6a169451dbfc911bb55c0077e897d746838e720ae0221";
//noinspection SpellCheckingInspection
const appImagePathPromise = (0, (_binDownload || _load_binDownload()).getBin)("AppImage", appImageVersion, `https://dl.bintray.com/electron-userland/bin/${appImageVersion}.7z`, appImageSha256);
class AppImageTarget extends (_electronBuilderCore || _load_electronBuilderCore()).Target {
    constructor(ignored, packager, helper, outDir) {
        super("appImage");
        this.packager = packager;
        this.helper = helper;
        this.outDir = outDir;
        this.options = Object.assign({}, this.packager.platformSpecificBuildOptions, this.packager.config[this.name]);
        // we add X-AppImage-BuildId to ensure that new desktop file will be installed
        this.desktopEntry = (_bluebirdLst2 || _load_bluebirdLst2()).default.promisify((_uuid || _load_uuid()).v1)({ mac: false }).then(uuid => helper.computeDesktopEntry(this.options, "AppRun", null, {
            "X-AppImage-Version": `${packager.appInfo.buildVersion}`,
            "X-AppImage-BuildId": uuid
        }));
    }
    build(appOutDir, arch) {
        var _this = this;

        return (0, (_bluebirdLst || _load_bluebirdLst()).coroutine)(function* () {
            (0, (_log || _load_log()).log)(`Building AppImage for arch ${(_electronBuilderCore || _load_electronBuilderCore()).Arch[arch]}`);
            const packager = _this.packager;
            // avoid spaces in the file name
            const resultFile = _path.join(_this.outDir, packager.generateName("AppImage", arch, true));
            yield (0, (_fs || _load_fs()).unlinkIfExists)(resultFile);
            const appImagePath = yield appImagePathPromise;
            const desktopFile = yield _this.desktopEntry;
            const args = ["-joliet", "on", "-volid", "AppImage", "-dev", resultFile, "-padding", "0", "-map", appOutDir, "/usr/bin", "-map", _path.join(__dirname, "..", "..", "templates", "linux", "AppRun.sh"), "/AppRun",
            // we get executable name in the AppRun by desktop file name, so, must be named as executable
            "-map", desktopFile, `/${_this.packager.executableName}.desktop`];
            for (const _ref of yield _this.helper.icons) {
                var _ref2 = _slicedToArray(_ref, 2);

                const from = _ref2[0];
                const to = _ref2[1];

                args.push("-map", from, `/usr/share/icons/default/${to}`);
            }
            // must be after this.helper.icons call
            if (_this.helper.maxIconPath == null) {
                throw new Error("Icon is not provided");
            }
            args.push("-map", _this.helper.maxIconPath, "/.DirIcon");
            if (arch === (_electronBuilderCore || _load_electronBuilderCore()).Arch.x64) {
                const libDir = yield (0, (_binDownload || _load_binDownload()).getBin)("AppImage-packages", "10.03.17", "https://bintray.com/electron-userland/bin/download_file?file_path=AppImage-packages-10.03.17-x64.7z", "172f9977fe9b24d35091d26ecbfebe2a14d96516a9c903e109e12b2a929042fe");
                args.push("-map", libDir, "/usr/lib");
            }
            args.push("-chown_r", "0", "/", "--");
            args.push("-zisofs", `level=${process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL || (packager.config.compression === "store" ? "0" : "9")}:block_size=128k:by_magic=off`);
            args.push("set_filter_r", "--zisofs", "/");
            if (_this.packager.packagerOptions.effectiveOptionComputed != null && (yield _this.packager.packagerOptions.effectiveOptionComputed([args, desktopFile]))) {
                return;
            }
            yield (0, (_electronBuilderUtil || _load_electronBuilderUtil()).exec)(process.arch !== "x64" || process.env.USE_SYSTEM_XORRISO === "true" || process.env.USE_SYSTEM_XORRISO === "" ? "xorriso" : _path.join(appImagePath, "xorriso"), args, {
                maxBuffer: 2 * 1024 * 1024
            });
            yield new (_bluebirdLst2 || _load_bluebirdLst2()).default(function (resolve, reject) {
                const rd = (0, (_fsExtraP || _load_fsExtraP()).createReadStream)(_path.join(appImagePath, arch === (_electronBuilderCore || _load_electronBuilderCore()).Arch.ia32 ? "32" : "64", "runtime"));
                rd.on("error", reject);
                const wr = (0, (_fsExtraP || _load_fsExtraP()).createWriteStream)(resultFile, { flags: "r+" });
                wr.on("error", reject);
                wr.on("close", resolve);
                rd.pipe(wr);
            });
            const fd = yield (0, (_fsExtraP || _load_fsExtraP()).open)(resultFile, "r+");
            try {
                const magicData = new Buffer([0x41, 0x49, 0x01]);
                yield (0, (_fsExtraP || _load_fsExtraP()).write)(fd, magicData, 0, magicData.length, 8);
            } finally {
                yield (0, (_fsExtraP || _load_fsExtraP()).close)(fd);
            }
            yield (0, (_fsExtraP || _load_fsExtraP()).chmod)(resultFile, "0755");
            packager.dispatchArtifactCreated(resultFile, _this, arch);
        })();
    }
}
exports.default = AppImageTarget; //# sourceMappingURL=appImage.js.map


text:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:baselineAligned="false"
    android:divider="?android:attr/dividerHorizontal"
    android:orientation="horizontal"
    tools:context="com.popumovies.MainActivity">

    <!--
    This layout is a two-pane layout for the Items master/detail flow.
    -->

    <!--<fragment-->
        <!--android:id="@+id/fragment_main"-->
        <!--android:name="com.popumovies.MainActivityFragment"-->
        <!--android:layout_width="0dp"-->
        <!--android:layout_height="match_parent"-->
        <!--android:layout_weight="1"-->
        <!--tools:layout="@layout/fragment_main" />-->
    <FrameLayout android:layout_height="match_parent"
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="0dp" android:id="@+id/main_container"
        android:layout_weight="1"
        tools:layout="@layout/fragment_main" />

    <FrameLayout
        android:id="@+id/movie_detail_container"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:visibility="gone"/>

</LinearLayout>


text: Game content processor tool.


text:
function Get-JIRAProject {
	<#
		.SYNOPSIS
			Get one or more JIRAProject objects.
		.DESCRIPTION
			The Get-JIRAProject cmdlet gets a specified JIRAProject object or performs a search to get multiple JIRAProject objects.
		.PARAMETER Key
			Specifies the key to be used to retrieve the JIRAProject object(s).
		.PARAMETER Name
			Specifies the full name or a part of the name used to retrieve the JIRAProject object(s).
		.PARAMETER All
			Specifies if you want to retrieve all JIRAProjects available to the specified AtlassianSession.
		.PARAMETER Session
			Specifies the AtlassianSession to use to perform this task.
			If none is specified Get-AtlassianSession is called.
		.EXAMPLE
			PS C:\> Get-JIRAProject -Name 'Test'
			Get all projects that have 'Test' in their name using the already imported AtlassianSession
		.INPUTS
			None
			You cannot pipe input to this cmdlet.
		.OUTPUTS
			JIRAProject
			Returns one or more JIRAProject objects.
		.NOTES
	#>
	[CmdletBinding(
		#SupportsShouldProcess=$true,
		HelpURI = "https://invoke-automation.github.io/Invoke-Documentation/projects/AtlassianCLI/docs/Get-JIRAProject"
	)]
	Param(
		[Parameter(
			Mandatory = $true,
			ParameterSetName = 'Key'
		)]
		[String] $Key,
		[Parameter(
			Mandatory = $true,
			ParameterSetName = 'Name'
		)]
		[String] $Name,
		[Parameter(
			Mandatory = $true,
			ParameterSetName = 'All'
		)]
		[Switch] $All,
		[Parameter(
			Mandatory = $false
		)]
		[AtlassianSession] $Session = (Get-AtlassianSession)
	)
	Begin {}
	Process {
		if ($Key) {
			$method = 'GET'
			$uri = ('{0}/project/{1}' -f $SETTINGS.API.Uri, $Key)
			$requestResult = Invoke-APIRequest -Method $method -Uri $uri -Session $Session
		} elseif ($Name) {
			$method = 'GET'
			$uri = ('{0}/project/' -f $SETTINGS.API.Uri)
			$requestResult = Invoke-APIRequest -Method $method -Uri $uri -Session $Session | Where-Object {$_.Name -like ('*{0}*' -f $Name)}
		} elseif ($All) {
			$method = 'GET'
			$uri = ('{0}/project/' -f $SETTINGS.API.Uri)
			$requestResult = Invoke-APIRequest -Method $method -Uri $uri -Session $Session
		}
		if ($requestResult -ne $null) {
			$output = @()
			foreach ($obj in $requestResult) {
				$output += New-JIRAProject -Uri $obj.self
			}
			$output
		} else {
			throw 'No result for request'
		}
	}
	End {}
}


text:
package org.gwtbootstrap3.client.ui.constants;

/**
 * @author Sven Jacobs
 */
public enum Spy {
    SCROLL("scroll"),
    AFFIX("affix");

    private final String spy;

    private Spy(final String spy) {
        this.spy = spy;
    }

    public String getSpy() {
        return spy;
    }
}


text:
/*********************                                                        */
/*! \file array.h
 ** \verbatim
 ** Original author: Morgan Deters
 ** Major contributors: none
 ** Minor contributors (to current version): none
 ** This file is part of the CVC4 project.
 ** Copyright (c) 2009-2014  New York University and The University of Iowa
 ** See the file COPYING in the top-level source directory for licensing
 ** information.\endverbatim
 **
 ** \brief Array types.
 **
 ** Array types.
 **/

#include <cvc4/cvc4_public.h>

#ifndef __CVC4__ARRAY_H
#define __CVC4__ARRAY_H

// we get ArrayType right now by #including type.h.
// array.h is still useful for the auto-generated kinds #includes.
#include <cvc4/expr/type.h>

#endif /* __CVC4__ARRAY_H */


text:
package io;

import interfaces.Lancable;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.SocketException;
import java.net.SocketTimeoutException;

import reseau.listeners.ReceiveListener;
import reseau.paquets.TypePaquet;
import exception.HorsLigneException;
import exception.InvalideException;

public abstract class InOut extends Out implements Runnable, Lancable {
    private InputStream input;
    private boolean run;

    public InOut() {}

    public InOut(InputStream reader, OutputStream writer) {
	super(writer);
	setOut(writer);
    }

    public abstract byte[] lire() throws IOException, InvalideException, HorsLigneException;

    public void setIn(InputStream input) {
	this.input = input;
    }

    public InputStream getIn() {
	return input;
    }

    public void addReceiveListener(ReceiveListener l) {
	addListener(ReceiveListener.class, l);
    }

    public void removeReceiveListener(ReceiveListener l) {
	removeListener(ReceiveListener.class, l);
    }

    public byte lireByte() throws IOException, HorsLigneException {
	int i = input.read();
	if(i == -1)
	    throw new HorsLigneException();
	return (byte) i;
    }

    public int lireShortInt() throws IOException, HorsLigneException {
	return IO.getInt(lireByte(), lireByte(), lireByte());
    }

    public byte[] lire(int nbr) throws IOException, HorsLigneException {
	byte[] b = new byte[nbr];
	for(int i=0 ; i<b.length ; i++)
	    b[i] = lireByte();
	return b;
    }

    protected void notifyReceiveListener(TypePaquet type, IO in) {
	for(final ReceiveListener l : getListeners(ReceiveListener.class)) {
	    in.setIndex(1);
	    try {
		l.recu(type, in);
	    } catch(Exception e) {
		e.printStackTrace();
	    }
	}
    }

    public boolean isRunning() {
	return run;
    }

    @Override
    public void run() {
	while(isRunning()) try {
	    IO io = new IO(lire());
	    notifyReceiveListener(TypePaquet.get(io.nextPositif()), io);
	} catch(SocketTimeoutException e) {
	    fermer();
	} catch(SocketException e) {
	    fermer();
	} catch(HorsLigneException e) {
	    fermer();
	} catch(InvalideException e) {
	    e.printStackTrace();
	} catch(IOException e) {
	    e.printStackTrace();
	} catch(Exception e) {
	    e.printStackTrace();
	}
    }

    @Override
    public boolean lancer() {
	run = true;
	new Thread(this).start();
	return run;
    }

    @Override
    public boolean fermer() {
	if(super.fermer()) try {
	    input.close();
	    run = false;
	} catch(IOException e) {
	    e.printStackTrace();
	}
	return !run;
    }

}


text:
require File.join(File.dirname(__FILE__), '..', 'test_helper')

module TaliaCore

  # Test the ActiveSource
  class ActiveSourcePredicateTest < Test::Unit::TestCase

    def setup
      setup_once(:flush) { TestHelper::flush_store }
    end

    def test_each_cached
      src = ActiveSource.new('http://pred_test/each_cached')
      src[N::RDF.rew] << 'value'
      cached = []
      src.each_cached_wrapper do |w|
        cached << w
      end
      assert_equal(2, cached.size)
    end

    def test_cached_predicate
      src = ActiveSource.new('http://pred_test/cached_predicate')
      src[N::RDF.rew] << 'value'
      # We assume that the cached thing is now in the internal structure
      w = src.instance_variable_get(:@type_cache)[N::RDF.rew.to_s]
      items = w.instance_variable_get(:@items)
      assert_kind_of(Array, items)
      assert_equal(['value'], items.collect { |i| i.value })
      assert_same(src[N::RDF.rew], w)
    end

    def test_cached_after_save
      src = ActiveSource.new('http://pred_test/cached_after_save')
      src[N::RDF.rew] << 'value'
      src.save!
      # We assume that the cached thing is now in the internal structure
      w = src.instance_variable_get(:@type_cache)[N::RDF.rew.to_s]
      items = w.send(:items) # This should correctly reload the items
      assert_kind_of(Array, items)
      assert_equal(['value'], items.collect { |i| i.value })
      assert_same(src[N::RDF.rew], w)
      # Check if the RDF was updated. The RDF must be updated from the cached wrappers
      # before the wrappers are saved themselves
      assert_equal(['value'], src.my_rdf[N::RDF.rew], "Mismatch of the RDF, maybe the callbacks in wrong order?")
    end

  end
end


text:
Servlet filter for Restful web service interface. Filter requests by request destinations, users. Response of web service can encrypt for selected webservices or all. Configurations has to be define in rusty-config file. Client side of rusty has feature to prevent web service replay attacks and decrypt data of web service if secured.

Users and destination management is highly customizable and currently those have to define in rusty-config.xml

We are looking forward to integrate LDAP or any other database to manage users and destinations.

## Demo Setup instructions

Rusty Demo Service and Client Application is in Demo folder.

1. Rusty Service Demo is Web Project developed using Netbeans 7.4. Deploy Project in Any Java Application server. and add Rusty.jar before build the project.
2. Rusty Client Application has to deploy or place it in ROOT.war folder(need a .jsp deployer) and run Client Application

## Setup instructions

* **Download Rusty.jar**
 Download Rusty.jar and add to library.

* **Add Web filter annotation to URL**
 `@WebFilter("/rest/rustyDemo/*")`
 `public class RustyDemoService implements Filter{`

 Implement javax.servlet.Filter with your java class. Override init, doFilter and destroy methods in Filter interface.

* **Override doFilter() Method**
 `@Override`
    `public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,    ServletException {`
        `Rusty.initRustyFilter(request, response, chain);`
    `}`
 That's It. You are now implemented Rusty Filter to your Rest Web service Interface. Now Lets Start with Rusty Configurations.

### rusty-config.xml

 Rusty Configuration file is managing all request and response modifying.

 rusty-config.xml must place under rusty folder in WEB-INF.

 > WEB-INF
>  -rusty
>   -rusty-config.xml

* **Encryption Enabling**
 `<encryption active="true" apply="*">`
     `<key>rustykey12345678</key>`
 `</encryption>`

 If you need to encrypt all you responses add attribute apply="*" in encryption tag.

 If you need to encrypt responses of selected services then use apply="~" in ancryption tag.

 If you need your service to be secure(Encrypt Response) use secured="true"
 auth="true" make service authenticate. Request need to have valid username and password to access this web service. If `<user-management active="true">` you don't need to add attribute by default service need valid credentials to access service.

 `<service-item secured="true" auth="true">/rustyDemo/getSecureUsers</service-item>`

Or

`<service-item secured="true" auth="false">/rustyDemo/getUnSecureUsers</service-item>`

If auth="false" in `<user-management active="true">` mode means service don't need credentials to access the service. If `<user-management active="false">` by default all services don't need credentials.

 If you don't care about securing your service secured="false" or do not add "secured" attribute

 `<service-item secured="false">/rustyDemo/getUnSecureUsers</service-item> `

* **User Access Management**

 `<user-management active="true">`
     `<management-type>custom</management-type>`
     `<connection-string></connection-string>`
     `<users>`
        `<user username="admin" password="admin"></user>`
        `<user username="rustyAdmin" password="rustyAdmin"></user>`
     `</users>`
 `</user-management>`

 Add active="true" to active Rusty user access management.

 Define management type "custom" to filter users by defined in rusty-config.xml
 users must define under users tag

 We are working forward to integrate with LDAP user management or MySql, MsSql and Oracle DB.

* **Domain Access Management**

 You can define which IP or domain can access web services. ex : 192.0.0.31 can only access those 4 web services.

 `<destination>`
    `<ip>192.0.0.31</ip>`
    `<allowed-services>`
        `<service>/rustyDemo/getUnSecureUsers</service> `
        `<service>/rustyDemo/getSecureUsers</service> `
    `</allowed-services>`
 `</destination>`

 If you want to give 192.0.0.31 to access all services,

 `<destination>`
      `<ip>192.0.0.31</ip>`
      `<allowed-services>`
          `*`
      `</allowed-services>`
 `</destination>`

## Features

* **Easy to use**
 Call rusty filter and define configurations in rusty-config.xml

* **Integrate with any servlet container**
 Can Integrate in any Java Application server with servlet container

* **Prevent XHR Replay Attacks**
 Rusty client side request handler can prevent XHR Replay Attacks.

* **Add audit trail using session attributes**
 Client side audit trail injection can handle by rusty request handler

* **Authenticate Web service**
 Authenticate selected web service or all services with credentials

* **Secure Web service (s) without using SSL**
 Encrypt response using Java AES encryption and decrypt by Rusty Request handler before access by client application

* **Authenticate web service by domain**
 You can restrict web service call by domain or any given IP Addresses. Authenticate all services or selected services.

* **Prevent Man in Middle Attack**
 No one can sniff or grab data in transport layer. All data is encrypted before send it to web service layer and response also encrypted.

* **Processing Speed**
 Rusty request handler can process multiple requests at time

## Requirements

* [JAVA](http://jquery.com/) v. 1.6+
* [JAVA EE](http://jquery.com/) v. 5+
* [Servlet](http://jquery.com/) v. 2+
* AJAVA Application Server

## License
Released under the [MIT license](http://www.opensource.org/licenses/MIT).


text:
namespace google {
namespace cloud {
namespace storage {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
namespace internal {
namespace {

using google::cloud::rest_internal::RestRequest;
using ::testing::Eq;
using ::testing::UnorderedElementsAre;

TEST(RestRequestBuilderTest, WellKnownParameterRequest) {
  class WellKnownParameterRequest
      : public GenericRequest<WellKnownParameterRequest, Deleted, MaxResults,
                              Prefix, Projection, UserProject> {};

  WellKnownParameterRequest request;
  request.set_option(Deleted(true));
  request.set_option(MaxResults(42));
  request.set_option(Prefix("my_prefix"));
  request.set_option(Projection("my_projection"));
  request.set_option(UserProject("my_project"));

  RestRequestBuilder builder("service/path");
  request.AddOptionsToHttpRequest(builder);
  builder.AddQueryParameter("foo", "bar");

  RestRequest rest_request = std::move(builder).BuildRequest();

  EXPECT_THAT(
      rest_request.parameters(),
      UnorderedElementsAre(
          Eq(std::pair<std::string, std::string>("projection",
                                                 "my_projection")),
          Eq(std::pair<std::string, std::string>("foo", "bar")),
          Eq(std::pair<std::string, std::string>("userProject", "my_project")),
          Eq(std::pair<std::string, std::string>("maxResults", "42")),
          Eq(std::pair<std::string, std::string>("prefix", "my_prefix")),
          Eq(std::pair<std::string, std::string>("deleted", "true"))));
}

TEST(RestRequestBuilderTest, WellKnownHeaderRequest) {
  class WellKnownHeaderRequest
      : public GenericRequest<WellKnownHeaderRequest, ContentType,
                              IfMatchEtag> {};

  WellKnownHeaderRequest request;
  request.set_option(ContentType("application/json"));
  request.set_option(IfMatchEtag("my_etag"));

  RestRequestBuilder builder("service/path");
  request.AddOptionsToHttpRequest(builder);
  builder.AddHeader("foo", "bar");
  builder.AddHeader("foo", "baz");

  RestRequest rest_request = std::move(builder).BuildRequest();

  EXPECT_THAT(rest_request.headers(),
              UnorderedElementsAre(
                  Eq(std::pair<std::string const, std::vector<std::string>>(
                      "foo", {"bar", "baz"})),
                  Eq(std::pair<std::string const, std::vector<std::string>>(
                      "content-type", {"application/json"})),
                  Eq(std::pair<std::string const, std::vector<std::string>>(
                      "if-match", {"my_etag"}))));
}

TEST(RestRequestBuilderTest, CustomHeaderRequest) {
  class CustomHeaderRequest
      : public GenericRequest<CustomHeaderRequest, CustomHeader> {};

  CustomHeaderRequest request;
  request.set_option(CustomHeader("my_header_key", "my_header_value"));

  RestRequestBuilder builder("service/path");
  request.AddOptionsToHttpRequest(builder);
  builder.AddHeader("foo", "bar");

  RestRequest rest_request = std::move(builder).BuildRequest();

  EXPECT_THAT(rest_request.headers(),
              UnorderedElementsAre(
                  Eq(std::pair<std::string const, std::vector<std::string>>(
                      "my_header_key", {"my_header_value"})),
                  Eq(std::pair<std::string const, std::vector<std::string>>(
                      "foo", {"bar"}))));
}

TEST(RestRequestBuilderTest, EncryptionKeyHeaderRequest) {
  class EncryptionKeyHeaderRequest
      : public GenericRequest<EncryptionKeyHeaderRequest, EncryptionKey> {};

  EncryptionKeyHeaderRequest request;
  EncryptionKeyData data;
  data.algorithm = "my_algorithm";
  data.key = "my_key";
  data.sha256 = "my_sha256";
  request.set_option(EncryptionKey(data));

  RestRequestBuilder builder("service/path");
  request.AddOptionsToHttpRequest(builder);
  builder.AddHeader("foo", "bar");

  RestRequest rest_request = std::move(builder).BuildRequest();

  EXPECT_THAT(rest_request.headers(),
              UnorderedElementsAre(
                  Eq(std::pair<std::string const, std::vector<std::string>>(
                      "x-goog-encryption-key-sha256", {"my_sha256"})),
                  Eq(std::pair<std::string const, std::vector<std::string>>(
                      "x-goog-encryption-key", {"my_key"})),
                  Eq(std::pair<std::string const, std::vector<std::string>>(
                      "x-goog-encryption-algorithm", {"my_algorithm"})),
                  Eq(std::pair<std::string const, std::vector<std::string>>(
                      "foo", {"bar"}))));
}

TEST(RestRequestBuilderTest, SourceEncryptionKeyHeaderRequest) {
  class SourceEncryptionKeyHeaderRequest
      : public GenericRequest<SourceEncryptionKeyHeaderRequest,
                              SourceEncryptionKey> {};

  SourceEncryptionKeyHeaderRequest request;
  EncryptionKeyData data;
  data.algorithm = "my_algorithm";
  data.key = "my_key";
  data.sha256 = "my_sha256";
  request.set_option(SourceEncryptionKey(data));

  RestRequestBuilder builder("service/path");
  request.AddOptionsToHttpRequest(builder);
  builder.AddHeader("foo", "bar");

  RestRequest rest_request = std::move(builder).BuildRequest();

  EXPECT_THAT(rest_request.path(), Eq("service/path"));
  EXPECT_THAT(
      rest_request.headers(),
      UnorderedElementsAre(
          Eq(std::pair<std::string const, std::vector<std::string>>(
              "x-goog-copy-source-encryption-key-sha256", {"my_sha256"})),
          Eq(std::pair<std::string const, std::vector<std::string>>(
              "x-goog-copy-source-encryption-key", {"my_key"})),
          Eq(std::pair<std::string const, std::vector<std::string>>(
              "x-goog-copy-source-encryption-algorithm", {"my_algorithm"})),
          Eq(std::pair<std::string const, std::vector<std::string>>("foo",
                                                                    {"bar"}))));
}

TEST(RestRequestBuilderTest, ComplexOptionRequest) {
  struct TestComplexOption
      : public google::cloud::storage::internal::ComplexOption<
            TestComplexOption, std::string> {
    TestComplexOption() = default;
    explicit TestComplexOption(std::string test)
        : ComplexOption(std::move(test)) {}
    static char const* name() { return "test-complex-option"; }
  };

  class ComplexOptionRequest
      : public GenericRequest<ComplexOptionRequest, TestComplexOption> {};

  ComplexOptionRequest request;
  request.set_option(TestComplexOption("test-complex-option-data"));

  RestRequestBuilder builder("service/path");
  request.AddOptionsToHttpRequest(builder);
  builder.AddHeader("foo", "bar");

  RestRequest rest_request = std::move(builder).BuildRequest();

  EXPECT_THAT(rest_request.path(), Eq("service/path"));
  EXPECT_THAT(rest_request.headers(),
              UnorderedElementsAre(
                  Eq(std::pair<std::string const, std::vector<std::string>>(
                      "foo", {"bar"}))));
}

}  // namespace
}  // namespace internal
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
}  // namespace storage
}  // namespace cloud
}  // namespace google


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Collection extends CI_Controller {

    private $page_title = "Collection";

	public function __construct() {
        parent::__construct();
        $this->load->helper('encrypt_helper');
        $this->load->helper('user_auth_helper');
    }

    public function index() {
        $active_token = warpmc_decrypt($_SESSION['access_token'], WARP_ENC_KEY);
        $data['page_title'] = $this->page_title;
        $data['data_parent'] = $this->get_parent_info($active_token);
        $data['data_kerabat'] = $this->get_kerabat($active_token);

        $this->load->view('parent/collection', $data);
    }

    public function get_trophy() {
        $result = array('status' => 0);
        $params = $this->input->get();

        //preparing parameter to get
        $num_to_get = 7;

        $date_now = date('d-m-Y');
        for($i=0; $i<$num_to_get; $i++){
            $month_year = date('m:Y', strtotime('-'.$i.' months', strtotime($date_now)));
            $months_to_get[] = $month_year;
        }

        if(isset($params['idUser'])) {
            $active_token = warpmc_decrypt($_SESSION['access_token'], WARP_ENC_KEY);
            $id_user = $params['idUser'];
            // $bulan = '06';
            // $tahun = '2017';

            $data = array();
            foreach ($months_to_get as $month) {
                //parameter = id_user:bulan:tahun;
                // $parameter = $id_user.':'.$bulan.':'.$tahun;
                $parameter = $id_user.':'.$month;
                $url = REST_URL.'master/periode?parameter='.$parameter.'&access_token='.$active_token;

                $parameters = array();
                $json_arr = $this->get_contents($active_token, $url, $parameters, 'GET');

                //perhitungan poin untuk menentukan trofi
                if($json_arr->point > 2000) {
                    $color = 'platinum';
                }
                else if(($json_arr->point > 1500) && ($json_arr->point <= 2000)) {
                    $color = 'gold';
                }
                else if(($json_arr->point > 1000) && ($json_arr->point <= 1500)) {
                    $color = 'silver';
                }
                else if(($json_arr->point > 500) && ($json_arr->point <= 1000)) {
                    $color = 'bronze';
                }
                else {
                    $color = 'none';
                }

                $data_month = str_replace(':', '-', '01:'.$month);
                $data[] = array(
                            'month' => date('F Y', strtotime($data_month)),
                            'point' => ($json_arr->point ? $json_arr->point : 0),
                            'color' => $color
                            );
            }

            if(!empty($data)) {
                $result = array('status' => 1, 'data' => $data);
            }
        }
        echo json_encode($result);
    }

    private function get_contents($active_token='', $url='', $parameters='', $method='GET') {
        $result = FALSE;
        if(!empty($active_token) && !empty($url)) {
            $post_data = http_build_query($parameters);
            $options = array(
                        'http' => array (
                                'method' => $method,
                                'header' => 'Content-type: application/x-www-form-urlencoded',
                                'content' => $post_data
                            )
                    );
            $context = stream_context_create($options);
            $json_obj = file_get_contents($url, FALSE, $context);
            $json_arr = json_decode($json_obj);

            $result = $json_arr;
        }
        return $result;
    }

    private function get_parent_info($active_token='') {
        $result = FALSE;
        if(!empty($active_token)) {
            //fetching parent info
            $url = REST_URL.'users/Parent?access_token='.$active_token;
            $parameters = array();
            $json_arr = $this->get_contents($active_token, $url, $parameters, 'GET');

            if(isset($json_arr->data)) {
                $result = $json_arr->data[0];
            }
        }
        return $result;
    }

    private function get_kerabat($active_token='') {
        $result = FALSE;
        if(!empty($active_token)) {
            //fetching parent info
            $url = REST_URL.'users/parent/list?opsi=kerabat&access_token='.$active_token;
            $parameters = array();
            $json_arr = $this->get_contents($active_token, $url, $parameters, 'GET');

            if(isset($json_arr->data)) {
                $result = $json_arr->data;
            }
        }
        return $result;
    }

}


text:
#ifndef _MIMEHeaderTest_H
#define _MIMEHeaderTest_H

#include "FoundationTestTypes.h"

//---- MIMEHeaderTest ----------------------------------------------------------
class MIMEHeaderTest: public testframework::TestCaseWithConfig {
public:
	//!TestCase constructor
	//! \param name name of the test
	MIMEHeaderTest(TString tstrName) :
		TestCaseType(tstrName) {
	}

	//!builds up a suite of testcases for this test
	static Test *suite();

	void SimpleHeaderTest();
	void ConfiguredTests();
	void spiritTests();
	void testrfcheaders();
};

#endif


text:
require 'rails_config'
require 'simple-navigation'
require 'r18n-rails'
require 'kramdown'
require 'valid_email'
require 'squeel'
require 'haml-rails'
require 'apotomo'
require 'simple_form'
require 'nested_form'
require 'meta_tags'
require 'kaminari'
require 'draper'
require 'compass-rails'
require 'carrierwave'
require 'jquery-rails'
require 'devise'
require 'cancan'

# Rails 4
require 'strong_parameters'

require 'lens_base/actions'

module LensBase
  class Engine < ::Rails::Engine
    isolate_namespace LensBase

    paths['app/views'] << 'app/views/layouts/lens_base/backend/'

  end
end


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * OAI Provider: Sets model
 *
 * OAI Sets are sourced from:
 *  - `data_sources`
 *  - `registry_objects`#class
 *  - `registry_object_attributes`#value(where attribute=group)
 *
 * Sets have 2 pieces of information:
 *  - setSpec: something that uniquely identifies the set
 *  - setName: something human readable
 *
 *
 * @author Steven McPhillips <steven.mcphillips@gmail.com>
 * @package ands/services/oai
 *
 */
class Sets extends CI_Model
{
	/**
	 * Get sets, optionally for a specific record
	 * @param a record id (optional)
	 * @return an array of `_set`s
	 */
	public function get($id=false)
	{
	    $ds = array();
	    $roa = array();
	    $roc = array();
	    $this->load->model('data_source/Data_sources', 'ds');
	    $this->load->model('registry_object/Registry_objects', 'ro');

	    if ($id)
	    {
		try
		{
		    $reg_obj = $this->ro->getByID($id);
		}
		catch (Exception $e)
		{
		    #invalid id: ignore it
		    return array();
		}
		if ($reg_obj)
		{
		    $ds = array($this->ds->getByID($reg_obj->data_source_id));
		    $roa = array(str_replace(" ", "0x20", $reg_obj->getAttribute("group")));
		    $roc = array($reg_obj->class);
		}
		else
		{
		    #invalid id: ignore it
		    return array();
		}
	    }
	    else
	    {
		$ds = $this->ds->getAll(0);

		$query = $this->db->distinct()->select("class")->get("registry_objects");
		$roc = array_map(create_function('$r', 'return $r["class"];'),
				 $query->result_array());

		$query = $this->db->distinct()->select("value")
		    ->get_where("registry_object_attributes",
				array("attribute" => "group"));
		$roa = array_map(create_function('$r', 'return str_replace(" ", "0x20",$r["value"]);'),
				 $query->result_array());
	    }

	    foreach ($ds as $set)
	    {
		$sets[] = $this->_from_ds($set);
	    }

	    foreach ($roc as $set)
	    {
	    	$sets[] = $this->_from_class($set);
	    }

	    foreach ($roa as $set)
	    {
		$sets[] = $this->_from_group($set);
	    }
	    return $sets;
	}

	private function _from_group($set)
	{
	    	return new _set("group", $set, $set);
	}

	private function _from_ds($set)
	{
	    if ($set instanceof _data_source)
	    {
		return new _set("datasource",
				$set->getAttribute("slug"),
				str_replace("&"," ",$set->getAttribute("title")));
	    }
	    else
	    {
		return null;
	    }
	}

	private function _from_class($set)
	{
	    	return new _set("class", $set, $set);
	}

	/**
	 * Retrieve a _set object matching the supplied spec
	 *
	 * @param the setSpec to identify the spec
	 * @return a _set object, or null if the supplied spec didn't identify anything
	 */
	public function getBySpec($spec)
	{
	    $spec = urldecode($spec);
	    $split_spec = explode(':', $spec, 2);
	    if (count($split_spec) < 2)
	    {
		throw new Oai_BadArgument_Exceptions("malformed set spec '$spec'");
	    }
	    $prefix = $split_spec[0];
	    $spec = (string)$split_spec[1];

	    switch($prefix)
	    {
	    case "datasource":
		$this->load->model('data_source/Data_sources', 'ds');

		$ds = $this->ds->getBySlug($spec);
		// Needed to fix returning all records when the datasource doesn't exist - if the datsource is null then must set up a dummy useless set
		if($ds){
			$set = $this->_from_ds($ds);
		}else{
			$set='No set';
		}
		break;
	    case "class":
		$query = $this->db->distinct()->select("class")
		    ->get_where("registry_objects",
				array("class" => $spec));
		if ($query->num_rows < 0)
		{
		    $set = null;
		}
		else
		{
		    $set = $this->_from_class($spec);
		}
		$query->free_result();
		break;
	    case "group":
		$query = $this->db->distinct()->select("value")
		    ->get_where("registry_object_attributes",
				array("attribute" => "group",
				      "value" => str_replace(" ", "0x20",$spec)));
		if ($query->num_rows < 0)
		{
		    $set = null;
		}
		else
		{
		    $set = $this->_from_group($spec);
		}
		$query->free_result();
		break;
	    default:
		throw new Oai_BadArgument_Exceptions("unknown setSpec '$spec'");
	    }
	    return $set;
	}

	/**
	 * Retrieve an array of registry_object_ids for a given set
	 *
	 * @param a `_set` object
	 * @return an array of ints that are `registry_objects.registry_object_ids`.
	 * note that if `$set` is not an instance of `_set`, an empty array will
	 * be returned.
	 */
	public function getIDsforSet($set)
	{
	    if ($set instanceof _set)
	    {
		$ids = array();
		$query = false;
		$sname = $set->name;
		$split_spec = explode(':', $set->spec, 2);
		if (count($split_spec) < 2)
		{
		    throw new Oai_BadArgument_Exceptions("malformed set spec '$spec'");
		}
		$prefix = $split_spec[0];
		$spec = $split_spec[1];
		switch($set->source)
		{
		case 'datasource':
			$query = $this->db->distinct()->select("registry_objects.registry_object_id")
				->join("data_sources",
				       "data_sources.data_source_id = registry_objects.data_source_id",
				       "inner")
				->get_where("registry_objects",
					    array("data_sources.slug" => $spec));
			break;
		case 'group':
			$query = $this->db->distinct()->select("registry_objects.registry_object_id")
				->join("registry_object_attributes",
				       "registry_object_attributes.registry_object_id = registry_objects.registry_object_id")
				->get_where("registry_objects",
					    array("registry_object_attributes.attribute" => "group",
						  "registry_object_attributes.value" => str_replace("0x20"," ",$sname)));
			break;
		case 'class':
			$query = $this->db->distinct()->select("registry_objects.registry_object_id")
				->get_where("registry_objects",
					    array("class" => $sname));
		    break;
		default:
		    //this should never really happen, but just in case
		    return array();
		    break;
		}
		$ids = array_map(create_function('$e', 'return $e["registry_object_id"];'),
						 $query->result_array());
		$query->free_result();
		return $ids;
	    }
	    else
	    {
		return array();
	    }
	}

	public function __construct()
	{
		parent::__construct();
		include_once("_set.php");
	}

}
?>


text:
<?php

/**
* This file is part of Metayogi.
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Metayogi\Foundation;

use Metayogi\Foundation\Application;
use Metayogi\Foundation\FlattenedArray;

/**
 * Registry is a configuration service
 *
 * @package Metayogi;
 * @author  Doug Macdonald <doug.macdonald@usask.ca>
 */
class Registry extends FlattenedArray
{
    /**
    * Database service
    * @var Metayogi\Database\DatabaseInterface
    */
    protected $dbh;

    /**
     * Loads registry from database
     *
     * @param Metayogi\Foundation\Application $app
     * @access public
     * @return void
     */
    public function __construct(Application $app)
    {
        try {
            $this->dbh = $app['dbh'];
            $this->store = $this->dbh->load(Kernel::REGISTRY_COLLECTION, Kernel::REGISTRY_ROOT);
        } catch (\Exception $e) {
            $this->store = array();
            Install::install($this->dbh, $this);
        }
    }

    /**
     * Reloads the registry from database
     *
     * @access public
     * @return void
     */
    public function reload()
    {
        $this->store = $this->dbh->load(Kernel::REGISTRY_COLLECTION, Kernel::REGISTRY_ROOT);
    }

    /**
     * Saves the registry to database
     *
     * @access public
     * @return void
     */
    public function save()
    {
        $this->dbh->update(Kernel::REGISTRY_COLLECTION, $this->store);
    }
}


text:
//********************************************************************
//*
//* Warning: This file was generated by MDE4CPP Generator
//*
//********************************************************************

#ifndef UML4CPPPROFILE_FACTORYIMPL_HPP
#define UML4CPPPROFILE_FACTORYIMPL_HPP

#include <functional>
#include <map>

#include "uml/impl/FactoryImpl.hpp"
#include "UML4CPPProfile/UML4CPPProfileFactory.hpp"

namespace UML4CPPProfile
{
	class UML4CPPProfileFactoryImpl : virtual public uml::FactoryImpl , virtual public UML4CPPProfileFactory
	{
		protected:
			friend class UML4CPPProfileFactory;
			// Constructor
			UML4CPPProfileFactoryImpl();

		public:
			virtual ~UML4CPPProfileFactoryImpl();
			virtual std::shared_ptr<uml::Element> create(const unsigned int _metaClassId,  std::shared_ptr<uml::Element> container= nullptr, const unsigned int referenceID = -1) const;
			virtual std::shared_ptr<uml::Element> create(const std::shared_ptr<uml::Class> _class,  std::shared_ptr<uml::Element> container= nullptr, const unsigned int referenceID = -1) const;
			virtual std::shared_ptr<uml::Element> create(const std::string _className,  std::shared_ptr<uml::Element> container= nullptr, const unsigned int referenceID = -1) const;

			//Creator functions
			//START Create methods for class DoNotGenerate
			virtual std::shared_ptr<UML4CPPProfile::DoNotGenerate> createDoNotGenerate(const int metaElementID = UML4CPPProfilePackage::DONOTGENERATE_CLASS) const ;
			//END Create methods for class DoNotGenerate
			//START Create methods for class ExternalLibrary
			virtual std::shared_ptr<UML4CPPProfile::ExternalLibrary> createExternalLibrary(const int metaElementID = UML4CPPProfilePackage::EXTERNALLIBRARY_CLASS) const ;
			//END Create methods for class ExternalLibrary
			//START Create methods for class GetterName
			virtual std::shared_ptr<UML4CPPProfile::GetterName> createGetterName(const int metaElementID = UML4CPPProfilePackage::GETTERNAME_CLASS) const ;
			//END Create methods for class GetterName
			//START Create methods for class MainBehavior
			virtual std::shared_ptr<UML4CPPProfile::MainBehavior> createMainBehavior(const int metaElementID = UML4CPPProfilePackage::MAINBEHAVIOR_CLASS) const ;
			//END Create methods for class MainBehavior
			//START Create methods for class NonExecutable
			virtual std::shared_ptr<UML4CPPProfile::NonExecutable> createNonExecutable(const int metaElementID = UML4CPPProfilePackage::NONEXECUTABLE_CLASS) const ;
			//END Create methods for class NonExecutable
			//START Create methods for class SetterName
			virtual std::shared_ptr<UML4CPPProfile::SetterName> createSetterName(const int metaElementID = UML4CPPProfilePackage::SETTERNAME_CLASS) const ;
			//END Create methods for class SetterName
			//START Create methods for class Singleton
			virtual std::shared_ptr<UML4CPPProfile::Singleton> createSingleton(const int metaElementID = UML4CPPProfilePackage::SINGLETON_CLASS) const ;
			//END Create methods for class Singleton
			//START Create methods for class UML4CPPPackage
			virtual std::shared_ptr<UML4CPPProfile::UML4CPPPackage> createUML4CPPPackage(const int metaElementID = UML4CPPProfilePackage::UML4CPPPACKAGE_CLASS) const ;
			//END Create methods for class UML4CPPPackage

			//Package
			virtual std::shared_ptr<UML4CPPProfilePackage> getUML4CPPProfilePackage();

		private:
			static UML4CPPProfileFactory * create();
			std::map<std::string,unsigned int> m_idMap;
			virtual void init() {}
	};
}
#endif /* end of include guard: UML4CPPPROFILE_FACTORYIMPL_HPP */


text:
module RuboCop
  module Cop
    module Test
      class ModuleMustBeAClassCop < RuboCop::Cop::Cop
        def on_module(node)
          add_offense(node, :expression, 'Module must be a Class')
        end

        def autocorrect(node)
          ->(corrector) { corrector.replace(node.loc.keyword, 'class') }
        end
      end
    end
  end
end


text:
using System;
using System.Reflection;

namespace AutoFixture.Xunit
{
    /// <summary>
    /// Base class for customizing parameters in methods decorated with
    /// <see cref="AutoDataAttribute"/>.
    /// </summary>
    [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = true)]
    public abstract class CustomizeAttribute : Attribute, IParameterCustomizationSource
    {
        /// <summary>
        /// Gets a customization for a parameter.
        /// </summary>
        /// <param name="parameter">The parameter for which the customization is requested.</param>
        /// <returns></returns>
        public abstract ICustomization GetCustomization(ParameterInfo parameter);
    }
}


text:
package org.sakaiproject.tool.messageforums.jsf;

import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;

import javax.faces.component.UIComponent;
import javax.faces.component.UIForm;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.el.ValueBinding;
import javax.faces.model.SelectItem;

/**
 * Common static utility methods that help in implementing JSF tags.
 */
public class RendererUtil
{

    /** This class is meant for static use only */
    private RendererUtil()
    {
    }

    /**
     * Sets component attribute value - if a ValueBinding exists for that
     * attribute, set through the binding; otherwise, set the value directly on
     * the component.
     */
    public static void setAttribute(FacesContext context, UIComponent component, String name,
            Object value)
    {
        ValueBinding binding = component.getValueBinding(name);
        if (binding != null)
        {
            try
            {
                binding.setValue(context, value);
            } catch (IllegalArgumentException e)
            {
                // try setting the value as a String
                binding.setValue(context, String.valueOf(value));
            }
        } else
        {
            component.getAttributes().put(name, value);
        }
    }

    /**
     * Return the attribute value - handles getting the value from a
     * ValueBinding if necessary. This is necessary because of a difference in
     * the Sun JSF RI versus the MyFaces RI. The Sun RI
     * component.getAttributes().get(attrName) will automatically return value
     * bindings, whereas the MyFaces implmentation requires getting values from
     * ValueBinding seperately.
     */
    public static Object getAttribute(FacesContext context, UIComponent component, String name)
    {
        // first check the attributes
        Object ret = component.getAttributes().get(name);
        if (ret != null)
            return ret;

        // next check the value bindings
        ValueBinding vb = component.getValueBinding(name);
        if (vb != null)
            ret = vb.getValue(context);

        return ret;
    }

    /**
     * Same as getAttribute, but if not found, we return a default value.
     */
    public static Object getDefaultedAttribute(FacesContext context, UIComponent component,
            String name, Object defaultValue)
    {
        Object o = getAttribute(context, component, name);
        if (o == null)
            o = defaultValue;
        return o;
    }

    /**
     * Helper method for recursively encoding a component.
     *
     * @param context
     *            the given FacesContext
     * @param component
     *            the UIComponent to render
     * @throws IOException
     */
    public static void encodeRecursive(FacesContext context, UIComponent component)
            throws IOException
    {
        if (!component.isRendered())
        {
            return;
        }

        component.encodeBegin(context);

        if (component.getRendersChildren())
        {
            component.encodeChildren(context);
        } else
        {
            Iterator iter = component.getChildren().iterator();

            while (iter.hasNext())
            {
                UIComponent child = (UIComponent) iter.next();
                encodeRecursive(context, child);
            }
        }
        component.encodeEnd(context);
    }

    /**
     * If renderer supports disabled or readonly attributes use this method to
     * obtain an early exit from decode method. Good idea to include it anyway,
     * compnent will continue to work when these properties are added.
     */
    public static boolean isDisabledOrReadonly(FacesContext context, UIComponent component)
    {
        boolean disabled = false;
        boolean readOnly = false;

        Object disabledAttr = getAttribute(context, component, "disabled");
        if (disabledAttr != null)
        {
            disabled = disabledAttr.equals(Boolean.TRUE);
        }

        Object readOnlyAttr = getAttribute(context, component, "readonly");
        if (readOnlyAttr != null)
        {
            readOnly = readOnlyAttr.equals(Boolean.TRUE);
        }

        return readOnly | disabled;
    }

    /**
     * Write default HTML passthrough attributes
     */
    public static void writePassthroughs(FacesContext context, UIComponent component)
            throws IOException
    {
        String[] passthrus = { "ondblclick", "onclick", "onkeydown", "onkeypress", "onkeyup",
                "onmousedown", "onmousemove", "onmouseout", "onmouseover", "onmouseup" };
        writePassthroughAttributes(passthrus, true, context, component);
    }

    /**
     * write passthough attributes on the current element
     */
    public static void writePassthroughAttributes(String[] passthrus, boolean writeNullAttrs,
            FacesContext context, UIComponent component) throws IOException
    {
        ResponseWriter writer = context.getResponseWriter();
        for (int i = 0; i < passthrus.length; i++)
        {
            String key = passthrus[i];
            String value = (String) getAttribute(context, component, key);
            if (writeNullAttrs && value == null)
                value = "";
            if (value != null)
                writer.writeAttribute(key, value, null);
        }
    }

    /**
     * @param attributeMap
     *            String key/value pairs
     * @param writer
     *            response writer
     */
    public static void writeAttributes(Map attributeMap, ResponseWriter writer) throws IOException
    {
        Iterator<Entry<String, String>> iter = attributeMap.entrySet().iterator();
        while (iter.hasNext())
        {
        	Entry<String, String> entry = iter.next();
            String key = entry.getKey();
            String value = entry.getValue();
            if (value == null)
                value = "";
            writer.writeAttribute(key, value, key);
        }

    }

    /**
     * @param attributeMap
     *            String key/value pairs
     * @param context
     *            Faces context
     * @param component
     *            the UIComponent
     * @throws IOException
     */
    public static void writeAttributes(Map attributeMap, FacesContext context) throws IOException
    {
        ResponseWriter writer = context.getResponseWriter();
        writeAttributes(attributeMap, writer);
    }

    /**
     * Renders a script that includes an external JavaScript that gets added to
     * the document through a document.write() if a gatekeeper value is NOT set.
     * This effectively makes the script inclusion a per request JavaScript
     * singleton.
     *
     * @param gateKey
     *            for key value pair
     * @param gateValue
     *            value for key value pair for gatekeeper
     * @param contextBasePath
     *            the web app with the script
     * @param scriptPath
     *            the webapp-relative path
     * @throws IOException
     */
    public static void writeSmartExternalScripts(FacesContext context, String gateKey,
            String gateValue, String contextBasePath, String[] scriptPaths) throws IOException
    {
        ResponseWriter writer = context.getResponseWriter();
        writeSmartExternalScripts(writer, gateKey, gateValue, contextBasePath, scriptPaths);
    }

    /**
     * Renders a script that includes an external JavaScript that gets added to
     * the document through a document.write() if a gatekeeper value is NOT set.
     * This effectively makes the script inclusion a per request JavaScript
     * singleton.
     *
     * @param writer
     *            the ResponseWriter
     * @param gateKey
     *            for key value pair
     * @param gateValue
     *            value for key value pair for gatekeeper
     * @param contextBasePath
     *            the web app with the script
     * @param scriptPath
     *            the webapp-relative path
     * @throws IOException
     */
    public static void writeSmartExternalScripts(ResponseWriter writer, String gateKey,
            String gateValue, String contextBasePath, String[] scriptPaths) throws IOException
    {
        writer.write("<script>");
        writer.write("  if (typeof window['" + gateKey + "'] == '" + gateValue + "')");
        writer.write("  {");

        for (int i = 0; i < scriptPaths.length; i++)
        {
            writer.write("    document.write(");
            writer.write("   \"<\" + \"script type='text/javascript' src='/'\" + "
                    + contextBasePath + " +");
            writer.write("   \"'" + scriptPaths[i] + "'><\" + \"/script>);");
        }

        writer.write("   var " + gateKey + " = '" + gateValue + "';");

        writer.write("  }");
        writer.write("</script>");
        writer.write("");
        writer.write("");
    }

    /**
     * Get a Map of String key/value pairs from a UIComponent for all attributes
     * keys in a collection
     *
     * @param collection
     * @param component
     * @return Map of String key/value pairs from a UIComponent for all keys in
     *         a collection
     */
    public static Map mapComponentAttributes(Collection collection, UIComponent component)
    {
        Map attributeMap = new HashMap();
        if (collection == null)
            return attributeMap;
        String[] attributeNames = new String[collection.size()];
        Object[] objs = collection.toArray();
        for (int i = 0; i < objs.length; i++)
        {
            attributeNames[i] = (String) objs[i];
        }
        return mapComponentAttributes(attributeNames, component);
    }

    /**
     * Get String key/value pairs from a UIComponent for all attributes keys in
     * an array
     *
     * @param attributeNames
     * @param component
     * @return Map of String key/value pairs from a UIComponent for all keys in
     *         a collection
     */
    public static Map mapComponentAttributes(String[] attributeNames, UIComponent component)
    {
        Map attributeMap = new HashMap();
        for (int i = 0; i < attributeNames.length; i++)
        {
            attributeMap.put(attributeNames[i], (String) component.getAttributes().get(
                    attributeNames[i]));
        }
        return attributeMap;
    }

    /**
     * Switch handling utility.
     *
     * @param rawSwitch
     *            String input string
     * @param supportOnOff
     *            boolean can input string be on, off?
     * @param supportTrueFalse
     *            boolean can input string be true, false?
     * @param supportYesNo
     *            boolean can input string be yes, no?
     * @param returnOnOff
     *            boolean output on, off instead of true false
     * @param returnYesNo
     *            boolean output yes, no instead of true false
     * @param defaultValue
     *            boolean if unknown, return true or false?
     * @return String raw swrich sring translated to correct switch value or
     *         default
     */
    public static String makeSwitchString(String rawSwitch, boolean supportOnOff,
            boolean supportTrueFalse, boolean supportYesNo, boolean returnOnOff,
            boolean returnYesNo, boolean defaultValue)
    {
        boolean switchValue = defaultValue;

        String trueString = "true";
        String falseString = "false";

        if (returnOnOff)
        {
            trueString = "on";
            falseString = "off";
        } else if (returnYesNo)
        {
            trueString = "yes";
            falseString = "no";
        }

        if (supportOnOff)
        {
            if ("on".equalsIgnoreCase(rawSwitch))
                switchValue = true;
            if ("off".equalsIgnoreCase(rawSwitch))
                switchValue = false;
        } else if (supportTrueFalse)
        {
            if ("true".equalsIgnoreCase(rawSwitch))
                switchValue = true;
            if ("false".equalsIgnoreCase(rawSwitch))
                switchValue = false;
        } else if (supportYesNo)
        {
            if ("yes".equalsIgnoreCase(rawSwitch))
                switchValue = true;
            if ("no".equalsIgnoreCase(rawSwitch))
                switchValue = false;
        }

        if (switchValue)
        {
            return trueString;
        } else
        {
            return falseString;
        }
    }

    /**
     * Given a List of SelectItems render the select options
     *
     * @param out
     * @param items
     *            List of SelectItems
     * @param selected
     *            seelcted choice
     * @param clientId
     *            the id
     * @param styleClass
     *            the optional style class
     * @param component
     *            the component being rendered
     * @throws IOException
     */

    public static void renderMenu(ResponseWriter out, List items, int selected, String clientId,
            String styleClass, UIComponent component) throws IOException
    {
        // // debug lines
        // out.writeText("startElement select", null);
        // if (true) return;
        out.startElement("select", component);
        out.writeAttribute("name", clientId, "id");
        out.writeAttribute("id", clientId, "id");
        if (styleClass != null)
        {
            out.writeAttribute("class", styleClass, "styleClass");
        }

        Iterator iter = items.iterator();
        while (iter.hasNext())
        {
            SelectItem si = (SelectItem) iter.next();
            Integer value = (Integer) si.getValue();
            String label = si.getLabel();
            out.startElement("option", component);
            out.writeAttribute("value", value, null);
            if (value.intValue() == selected)
            {
                out.writeAttribute("selected", "selected", null);
            }
            out.writeText(label, null);
        }
        out.endElement("select");
    }

    /** Return the Locale from the FacesContext */
    public static Locale getLocale(FacesContext context)
    {
        Locale locale = null;
        UIViewRoot viewRoot = context.getViewRoot();
        if (viewRoot != null)
            locale = viewRoot.getLocale();
        if (locale == null)
            locale = Locale.getDefault();
        return locale;
    }

    /** Return the form ID of the form containing the given component */
    public static String getFormId(FacesContext context, UIComponent component)
    {
        while (component != null && !(component instanceof UIForm))
        {
            component = component.getParent();
        }
        if (component instanceof UIForm)
            return ((UIForm) component).getId();
        return null;
    }

}


text:
<?php

// See lib/base in this plugin for the actual code. You can extend that
// class in your own application level override of this file

class aPDFSlotActions extends BaseaPDFSlotActions
{
}


text:
define([
    'angular'
], function(angular) {
    'use strict';

    // From http://blog.parkji.co.uk/2013/08/11/native-drag-and-drop-in-angularjs.html
    function Droppable($parse) {
        return {
            link: function(scope, element, attrs) {
                // again we need the native object
                var el = element[0],
                    droppableData = $parse(attrs.droppableData)(scope) || {}
                ;

                el.addEventListener(
                    'dragover',
                    function(e) {
                        e.dataTransfer.dropEffect = 'move';
                        // allows us to drop
                        if (e.preventDefault) { e.preventDefault(); }
                        this.classList.add('over');
                        return false;
                    },
                    false
                );

                el.addEventListener(
                    'dragenter',
                    function() {
                        this.classList.add('over');
                        return false;
                    },
                    false
                );

                el.addEventListener(
                    'dragleave',
                    function() {
                        this.classList.remove('over');
                        return false;
                    },
                    false
                );

                el.addEventListener(
                    'drop',
                    function(e) {
                        // Stops some browsers from redirecting.
                        if (e.stopPropagation) { e.stopPropagation(); }

                        this.classList.remove('over');

                        var elementDropped = angular.element(document.getElementById(e.dataTransfer.getData('Text'))),
                            draggableData = elementDropped.scope() ? elementDropped.scope().draggableData : null
                        ;

                        if (draggableData) {
                            scope.$emit('$elementDropSuccess', {
                                droppableData: droppableData,
                                draggableData: draggableData
                            });
                        }
                        return false;
                    },
                    false
                );
            }
        };
    }

    Droppable.$inject = ['$parse'];

    return Droppable;
});


text:
package ssainterp_test

import (
	"bytes"
	"fmt"

	"github.com/go-interpreter/ssainterp"
)

const code = `
package main

import "fmt"

func main() {
	fmt.Println("42")
}

`

// ExampleRun trivial example, more to add.
func ExampleRun() {
	var output bytes.Buffer
	ssainterp.Run(code, nil, nil, &output)
	fmt.Println(output.String())
	// Output: 42
}


text:
//
//  RESTfulNormalServiceDiscoveryProfileTest.m
//  dConnectDeviceTest
//
//  Copyright (c) 2014 NTT DOCOMO, INC.
//  Released under the MIT license
//  http://opensource.org/licenses/mit-license.php
//

#import "RESTfulTestCase.h"

@interface RESTfulNormalServiceDiscoveryProfileTest : RESTfulTestCase

@end

/*!
 * @class RESTfulNormalServiceDiscoveryProfileTest
 * @brief Service Discoveryプロファイルの正常系テスト.
 * @author NTT DOCOMO, INC.
 */
@implementation RESTfulNormalServiceDiscoveryProfileTest

/*!
 * @brief デバイス一覧取得リクエストを送信するテスト.
 *

 * 【HTTP通信】
 * Method: GET
 * Path: /servicediscovery
 *

 *

 * 【期待する動作】
 * ・resultに0が返ってくること。
 * ・servicesに少なくとも1つ以上のサービスが発見されること。
 * ・servicesの中に「Test Success Device」のnameを持ったサービスが存在すること。
 *

 */
- (void) testHttpNormalServiceDiscoveryGet
{
    NSURL *uri = [NSURL URLWithString:@"http://localhost:4035/gotapi/servicediscovery"];
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:uri];
    [request setHTTPMethod:@"GET"];
    [request setValue:@"org.deviceconnect.test" forHTTPHeaderField:@"X-GotAPI-Origin"];

    NSURLSession *session = [NSURLSession sharedSession];
    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
    [[session dataTaskWithRequest:request  completionHandler: ^(NSData *data, NSURLResponse *response, NSError *error) {
        XCTAssertNotNil(data);
        XCTAssertNil(error);
        NSDictionary *actualResponse = [NSJSONSerialization JSONObjectWithData:data
                                                                       options:NSJSONReadingMutableContainers
                                                                         error:nil];
        XCTAssertNotNil(actualResponse);

        NSArray *services = actualResponse[DConnectServiceDiscoveryProfileParamServices];
        XCTAssertTrue(services.count > 0);
        BOOL found = NO;
        for (NSDictionary *service in services) {
            NSString *deviceName = service[DConnectServiceDiscoveryProfileParamName];
            if ([deviceName isEqualToString:@"Test Success Device"]) {
                found = YES;
                break;
            }
        }
        XCTAssertTrue(found == YES);
        dispatch_semaphore_signal(semaphore);
    }] resume];
    dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, 3 * NSEC_PER_SEC));
}

@end


text:
FROM library/python:3-onbuild

EXPOSE 5000

CMD [ "python", "dash.py" ]


text:
package myservice.mynamespace.service;

import java.io.InputStream;
import java.util.List;
import java.util.Locale;

import myservice.mynamespace.data.Storage;

import org.apache.olingo.commons.api.data.ContextURL;
import org.apache.olingo.commons.api.data.Entity;
import org.apache.olingo.commons.api.data.Property;
import org.apache.olingo.commons.api.edm.EdmEntitySet;
import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
import org.apache.olingo.commons.api.edm.EdmProperty;
import org.apache.olingo.commons.api.format.ContentType;
import org.apache.olingo.commons.api.http.HttpHeader;
import org.apache.olingo.commons.api.http.HttpStatusCode;
import org.apache.olingo.server.api.OData;
import org.apache.olingo.server.api.ODataApplicationException;
import org.apache.olingo.server.api.ODataRequest;
import org.apache.olingo.server.api.ODataResponse;
import org.apache.olingo.server.api.ServiceMetadata;
import org.apache.olingo.server.api.deserializer.DeserializerException;
import org.apache.olingo.server.api.processor.PrimitiveProcessor;
import org.apache.olingo.server.api.serializer.ODataSerializer;
import org.apache.olingo.server.api.serializer.PrimitiveSerializerOptions;
import org.apache.olingo.server.api.serializer.SerializerException;
import org.apache.olingo.server.api.serializer.SerializerResult;
import org.apache.olingo.server.api.uri.UriInfo;
import org.apache.olingo.server.api.uri.UriParameter;
import org.apache.olingo.server.api.uri.UriResource;
import org.apache.olingo.server.api.uri.UriResourceEntitySet;
import org.apache.olingo.server.api.uri.UriResourceProperty;

public class DemoPrimitiveProcessor implements PrimitiveProcessor {

	private OData odata;
	private Storage storage;
  private ServiceMetadata serviceMetadata;

	public DemoPrimitiveProcessor(Storage storage) {
		this.storage = storage;
	}

	public void init(OData odata, ServiceMetadata serviceMetadata) {
		this.odata = odata;
    this.serviceMetadata = serviceMetadata;

	}

	/*
	 * In our example, the URL would be: http://localhost:8080/DemoService/DemoService.svc/Products(1)/Name
	 * and the response:
	 * {
	 *	  @odata.context: "$metadata#Products/Name",
	 *	  value: "Notebook Basic 15"
	 * }
	 * */
	public void readPrimitive(ODataRequest request, ODataResponse response,
								UriInfo uriInfo, ContentType responseFormat)
								throws ODataApplicationException, SerializerException {

		// 1. Retrieve info from URI
		// 1.1. retrieve the info about the requested entity set
		List<UriResource> resourceParts = uriInfo.getUriResourceParts();
		// Note: only in our example we can rely that the first segment is the EntitySet
		UriResourceEntitySet uriEntityset = (UriResourceEntitySet) resourceParts.get(0);
		EdmEntitySet edmEntitySet = uriEntityset.getEntitySet();
		// the key for the entity
		List<UriParameter> keyPredicates = uriEntityset.getKeyPredicates();

		// 1.2. retrieve the requested (Edm) property
		// the last segment is the Property
		UriResourceProperty uriProperty = (UriResourceProperty)resourceParts.get(resourceParts.size() -1);
		EdmProperty edmProperty = uriProperty.getProperty();
		String edmPropertyName = edmProperty.getName();
		// in our example, we know we have only primitive types in our model
		EdmPrimitiveType edmPropertyType = (EdmPrimitiveType) edmProperty.getType();

		// 2. retrieve data from backend
		// 2.1. retrieve the entity data, for which the property has to be read
		Entity entity = storage.readEntityData(edmEntitySet, keyPredicates);
		if (entity == null) { // Bad request
			throw new ODataApplicationException("Entity not found", HttpStatusCode.NOT_FOUND.getStatusCode(), Locale.ENGLISH);
		}

		// 2.2. retrieve the property data from the entity
		Property property = entity.getProperty(edmPropertyName);
		if (property == null) {
			throw new ODataApplicationException("Property not found", HttpStatusCode.NOT_FOUND.getStatusCode(),
			                                    Locale.ENGLISH);
		}

		// 3. serialize
		Object value = property.getValue();
		if (value != null) {
			// 3.1. configure the serializer
			ODataSerializer serializer = odata.createSerializer(responseFormat);

			ContextURL contextUrl = ContextURL.with().entitySet(edmEntitySet).navOrPropertyPath(edmPropertyName).build();
			PrimitiveSerializerOptions options = PrimitiveSerializerOptions.with().contextURL(contextUrl).build();
			// 3.2. serialize
			SerializerResult serializerResult = serializer.primitive(serviceMetadata, edmPropertyType, property, options);
			InputStream propertyStream = serializerResult.getContent();

			//4. configure the response object
			response.setContent(propertyStream);
			response.setStatusCode(HttpStatusCode.OK.getStatusCode());
			response.setHeader(HttpHeader.CONTENT_TYPE, responseFormat.toContentTypeString());
		} else {
			// in case there's no value for the property, we can skip the serialization
			response.setStatusCode(HttpStatusCode.NO_CONTENT.getStatusCode());
		}
	}

	/*
	 * These processor methods are not handled in this tutorial
	 * */

	public void updatePrimitive(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType requestFormat,
	    ContentType responseFormat) throws ODataApplicationException, DeserializerException, SerializerException {
		throw new ODataApplicationException("Not supported.", HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), Locale.ROOT);
	}

	public void deletePrimitive(ODataRequest request, ODataResponse response, UriInfo uriInfo)
	    throws ODataApplicationException {
		throw new ODataApplicationException("Not supported.", HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), Locale.ROOT);
	}
}


text:
package org.apache.flink.kubernetes.kubeclient.resources;

import io.fabric8.kubernetes.api.model.ContainerStateTerminated;
import io.fabric8.kubernetes.api.model.Pod;

import java.util.stream.Collectors;

/** Represent KubernetesPod resource in kubernetes. */
public class KubernetesPod extends KubernetesResource<Pod> {

    public KubernetesPod(Pod pod) {
        super(pod);
    }

    public String getName() {
        return this.getInternalResource().getMetadata().getName();
    }

    public boolean isTerminated() {
        if (getInternalResource().getStatus() != null) {
            return getInternalResource().getStatus().getContainerStatuses().stream()
                    .anyMatch(e -> e.getState() != null && e.getState().getTerminated() != null);
        }
        return false;
    }

    public String getTerminatedDiagnostics() {
        final StringBuilder sb = new StringBuilder();
        sb.append("Pod terminated, container termination statuses: [");
        if (getInternalResource().getStatus() != null) {
            sb.append(
                    getInternalResource().getStatus().getContainerStatuses().stream()
                            .filter(
                                    containerStatus ->
                                            containerStatus.getState() != null
                                                    && containerStatus.getState().getTerminated()
                                                            != null)
                            .map(
                                    (containerStatus) -> {
                                        final ContainerStateTerminated containerStateTerminated =
                                                containerStatus.getState().getTerminated();
                                        return String.format(
                                                "%s(exitCode=%d, reason=%s, message=%s)",
                                                containerStatus.getName(),
                                                containerStateTerminated.getExitCode(),
                                                containerStateTerminated.getReason(),
                                                containerStateTerminated.getMessage());
                                    })
                            .collect(Collectors.joining(",")));
        }
        sb.append("]");
        return sb.toString();
    }
}