text:
<!DOCTYPE html>

        <meta chrset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <link rel="apple-touch-icon" sizes="57x57" href="/noteshare/assets/img/icon/favicon.jpg">
        <link rel="apple-touch-icon" sizes="60x60" href="/noteshare/assets/img/icon/favicon.jpg">
        <link rel="apple-touch-icon" sizes="72x72" href="/noteshare/assets/img/icon/favicon.jpg">
        <link rel="apple-touch-icon" sizes="76x76" href="/noteshare/assets/img/icon/favicon.jpg">
        <link rel="apple-touch-icon" sizes="114x114" href="/noteshare/assets/img/icon/favicon.jpg">
        <link rel="apple-touch-icon" sizes="120x120" href="/noteshare/assets/img/icon/favicon.jpg">
        <link rel="apple-touch-icon" sizes="144x144" href="/noteshare/assets/img/icon/favicon.jpg">
        <link rel="apple-touch-icon" sizes="152x152" href="/noteshare/assets/img/icon/favicon.jpg">
        <link rel="apple-touch-icon" sizes="180x180" href="/noteshare/assets/img/icon/favicon.jpg">
        <link rel="icon" type="image/jpg" href="/noteshare/assets/img/icon/favicon.jpg" sizes="32x32">
        <link rel="icon" type="image/jpg" href="/noteshare/assets/img/icon/favicon.jpg" sizes="192x192">
        <link rel="icon" type="image/jpg" href="/noteshare/assets/img/icon/favicon.jpg" sizes="96x96">
        <link rel="icon" type="image/jpg" href="/noteshare/assets/img/icon/favicon.jpg" sizes="16x16">
        <link rel="manifest" href="/manifest.json">
        <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
        <meta name="apple-mobile-web-app-title" content="http://susumago.sakura.ne.jp/noteshare/">
        <meta name="application-name" content="http://susumago.sakura.ne.jp/noteshare/">
        <meta name="msapplication-TileColor" content="#da532c">
        <meta name="msapplication-TileImage" content="/mstile-144x144.png">
        <meta name="theme-color" content="#ffffff">

        <title>Note Share app --- Supported by るんば!</title>

        <?php echo Asset::css('bootstrap.css'); ?>

        <?php echo Asset::css('font-awesome.min.css'); ?>
        <link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
        <?php echo Asset::css('zabuto_calendar.css'); ?>
        <?php echo Asset::css('gritter_css/jquery.gritter.css'); ?>

        <?php echo Asset::css('style.css'); ?>
        <?php echo Asset::css('style-responsive.css'); ?>
        <?php echo Asset::js('chart-master/Chart.js'); ?>

                <?php include APPPATH . 'views/layout_admin/header.php' ?>

                <?php include APPPATH . 'views/layout_admin/sidebar.php' ?>

User Management

                            <?php echo Form::Open('usermanagement/Delete'); ?>

                            <input type="button" value="Remove" id="column" class="button" href="#" style=" float:right; margin-left: 2px;" >

                            <?php echo Html::anchor("usermanagement/Add", 'UserAdd', array('class' => 'button', 'style' => 'float: right;')); ?>

                                        Name
                                        UserID
                                        Class
                                        Email
                                        Processing
                                        <input type="checkbox" id="check" class="checkAll col" style="display:none;">

                                <?php foreach ($rows as $row): ?>

                                            <?php echo $row['fullname']; ?>
                                            <?php echo $row['username']; ?>
                                            <?php echo $row->class->class; ?>
                                            <?php echo $row['email']; ?>

                                                <?php echo Html::anchor('usermanagement/Edit/' . $row['id'], 'edit', array('class' => 'btn btn-link')); ?>

                                            <input type="checkbox" name="check[]" value="<?php echo $row['id']; ?>" class="check col" style="display:none;"  >

                                <?php endforeach; ?>

                                <button class="button" type="submit" style="margin-left: 2px;" >Comit</button>
                                <input type="button" id="dcolmn" value="Cancel" class="button" style="margin-left: 2px;" >

                            <?php echo Form::close(); ?>

                <?php include APPPATH . 'views/layout_admin/footer.php' ?>

        <?php echo Asset::js('jquery.js'); ?>
        <?php echo Asset::js('jquery-1.8.3.min.js'); ?>
        <?php echo Asset::js('bootstrap.min.js'); ?>
        <?php echo Asset::js('jquery.dcjqaccordion.2.7.js'); ?>
        <?php echo Asset::js('jquery.scrollTo.min.js'); ?>
        <?php echo Asset::js('jquery.nicescroll.js'); ?>
        <?php echo Asset::js('jquery.sparkline.js'); ?>

        <?php echo Asset::js('common-scripts.js'); ?>
        <?php echo Asset::js('gritter/css/jquery.gritter.css'); ?>
        <?php echo Asset::js('gritter-conf.js'); ?>

        <?php echo Asset::js('sparkline-chart.js'); ?>
        <?php echo Asset::js('zabuto_calendar.js'); ?>
        <?php echo Asset::js('responsive-tables.js'); ?>


text:
import ava from 'ava';
import { promises as fs } from 'fs';
import { tempFileLoc } from './lib';
import * as nextra from '../src';

ava('File', async (test): Promise<void> => {
	test.plan(3);

	const file = tempFileLoc();
	await fs.writeFile(file, 'test', 'utf8');
	const fileName = `${tempFileLoc()}.gz`;
	await nextra.gzip(fileName, file);
	const output = tempFileLoc();
	const retVal = await nextra.gunzipAtomic(output, fileName);
	const stats = await fs.stat(output);

	test.is(retVal, undefined);
	test.true(stats.isFile());
	test.is(await fs.readFile(output, 'utf8'), 'test');
});

redpajama_set_name: RedPajamaGithub


text:
package br.com.example.android.popularmovies.movies;

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

import br.com.example.android.popularmovies.model.data.Movie;
import br.com.example.android.popularmovies.model.networking.MovieFetcher;
import rx.Observer;

public class MainScreenViewModel {
    private final DataListener listener;
    private List<Movie> movies;

    public MainScreenViewModel(DataListener listener) {
        this.listener = listener;
    }

    public void onCreate() {
        movies = new ArrayList<>();
        /**
         * We use flavors to determine which movie provider to use.
         * mockData flavor will return a preset list of movies, whereas realData will recover
         * movies from the movieDB API.
         */
        MovieFetcher.getInstance().fetchMovies(new Observer<List<Movie>>() {
            @Override
            public void onCompleted() {
                listener.updateMovies(movies);
            }

            @Override
            public void onError(Throwable e) {
                listener.showErrorMessage();
            }

            @Override
            public void onNext(List<Movie> movieList) {
                movies.addAll(movieList);
            }
        });
    }

    public interface DataListener {
        void updateMovies(List<Movie> movies);

        void showErrorMessage();
    }
}


text:
package com.thihy.es.analysis.paoding.knife;

import net.paoding.analysis.knife.Dictionaries;
import net.paoding.analysis.knife.Knife;

public interface KnifeFactory<T extends Knife> {
	T create(Dictionaries dictionaries);
}


text:
<?php

namespace App\UserdirectoryBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;

/**
 * @ORM\Entity
 * @ORM\Table(name="user_transfusionReactionTypeList")
 */
class TransfusionReactionTypeList extends ListAbstract
{

    /**
     * @ORM\OneToMany(targetEntity="TransfusionReactionTypeList", mappedBy="original")
     **/
    protected $synonyms;

    /**
     * @ORM\ManyToOne(targetEntity="TransfusionReactionTypeList", inversedBy="synonyms")
     * @ORM\JoinColumn(name="original_id", referencedColumnName="id")
     **/
    protected $original;

}


text:
'use strict'

//don't put ,[] because that declares a new module. This gets the existing one
angular.module('DivinElegy.components.simfiles').

directive('latestSimfile', ['rockEndpoint', '$http', 'UserService', 'HelloService', 'UiSettingsService', '$rootScope', function(rockEndpoint, $http, UserService, HelloService, UiSettingsService, $rootScope)
{
    return {
        templateUrl: 'components/simfiles/latest-simfile.html',
        scope: {},
        link: function($scope) {
            $http({
                url: rockEndpoint + "simfiles/latest/simfile",
                method: "GET"
            }).
            success(function (data)
            {
                var authors = [];
                for(var i=0; i<data.steps.single.length; i++)
                {
                    if(authors.indexOf(data.steps.single[i].artist) === -1)
                    {
                        authors.push(data.steps.single[i].artist);
                    }
                }

                var filesizeBytes = function(size)
                {
                    //units are already bytes
                    if(!isNaN(size.substring(size.length-2, size.length-1)))
                    {
                        return size.substring(0, size.length-1);
                    }

                    var units = size.substring(size.length-2, size.length);
                    var size = size.substring(0, size.length-2);
                    var fileUnits = ["B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];

                    for(var i=0; i<fileUnits.length; i++)
                    {
                        if(fileUnits[i] == units) { break; }
                        size = size*1000;
                    }

                    return Number(size);
                };

                //TODO: This is duplicated in a few places. What do?
                $scope.downloadFromDe = function(simfile)
                {
                    if(!UserService.getCurrentUser())
                    {
                        $rootScope.$broadcast('message.error', 'You need to be logged in to download from DivinElegy.');
                        return;
                    }

                    UserService.getCurrentUser().then(function(user)
                    {
                        var size = filesizeBytes(simfile.size);
                        var quotaRemaining = filesizeBytes(user.quotaRemaining);

                        if(quotaRemaining < size)
                        {
                            $rootScope.$broadcast('message.error', 'Sorry, you do not have enough quota to download that file. Quota resets at 00:00 UTC+0');
                        } else {
                            //TODO: Maybe access token should be in user obj?
                            var url = rockEndpoint + '' + simfile.download + '?token=' + HelloService.getAccessToken(); //0th mirror will always be de
                            if(UiSettingsService.getDirective('showDownloadWarning') === 'Yes')
                            {
                                $rootScope.$broadcast('message.warning', 'You are about to download ' + simfile.title + ' which is ' + simfile.size + '. Your current quota is ' + user.quotaRemaining + ' click here to confirm.');
                            } else {
                                window.location = url;
                                $rootScope.updateUserCache();
                            }
                        }
                    });
                };

                $scope.simfile = data;
                $scope.rockEndpoint = rockEndpoint;
                $scope.authors = authors.join(', ');
                $rootScope.$$phase || $rootScope.$apply();
            });
        }
    };
}]);


text:
package com.codepath.apps.restclienttemplate.models;

import org.json.JSONException;
import org.json.JSONObject;
import org.parceler.Parcel;

import static com.codepath.apps.restclienttemplate.helper.ParseRelativeDate.getRelativeTimeAgo;

/**
 * Created by praniti on 9/27/17.
 */

@Parcel
public class Tweet {

    public String body;
    public long uid;  //database ID for the tweet
    public User user;
    public String createdAt;
    public String timeAgo;

    public Tweet(){

    }

    // deserialize the JSON
    public static Tweet fromJSON(JSONObject jsonObject) throws JSONException {
        Tweet tweet = new Tweet();

        tweet.body = jsonObject.getString("text");
        tweet.uid = jsonObject.getLong("id");
        tweet.createdAt = jsonObject.getString("created_at");
        tweet.user = User.fromJSON(jsonObject.getJSONObject("user"));
        tweet.timeAgo = getRelativeTimeAgo(tweet.createdAt);
        return tweet;
    }

}


text:
The Hamburger template builds on the foundation of the Minimal template by showing one way that the hamburger control can be used. You are welcome to customize your implementation.

Hit `F5` right now and run your new app! To refresh Visual Studio's intellisense, follow this:

1. Press Ctrl+Q, type `pac man gen`
1. Ensure `Allow NuGet to download missing packages` is checked.
1. Ensure `Automatically check for missing packages during build in Visual Studio` is checked.
1. Right-click your Solution, and select `Clean`.
1. Right-click your Solution, and select `Rebuild`.
1. Select your project, and click the `Refresh` button at the top of Solution Explorer.

Congratulations, you can now use your project without "missing assemblies" errors. If you want, return the Package Manager Settings back to their original values. This will make your builds significantly faster.

![](https://raw.githubusercontent.com/Windows-XAML/Template10/master/Assets/GetStarted.gif)

The approach taken is to create a frame consisting of a ModalDialog that then shows the [HamburgerMenu](./Controls#hamburgermenu) control alongside the current page that the user has navigated to. The frame is created with the following code in App.xaml.cs:

````csharp
if (Window.Current.Content as ModalDialog == null)
{
    // create a new frame
    var nav = NavigationServiceFactory(BackButton.Attach, ExistingContent.Include);

    // create modal root
    Window.Current.Content = new ModalDialog
    {
        DisableBackButtonWhenModal = true,
        Content = new Views.Shell(nav),
        ModalContent = new Views.Busy(),
    };
}
````

This is executed in `OnInitializeAsync` and a more detailed explanation can be found in [Implementing a shell](./Controls#implementing-a-shell). This approach ensures that the HamburgerMenu is displayed on every page without the developer needing to add it explicitly to every page.

If you are seeing squiggly lines after creating a project with this template, please follow the [instructions to fix missing assemblies](./Fixing-Missing-Assemblies).

> Do you have technical questions you want to ask the community? Use the `Template10` tag on StackOverflow. http://stackoverflow.com/questions/tagged/template10


text:
<?php

/*
|--------------------------------------------------------------------------
| Nova Language Lines
|--------------------------------------------------------------------------
|
| The following language lines contain the default error messages used by
| the validator class. Some of these rules have multiple versions such
| as the size rules. Feel free to tweak each of these messages here.
|
*/

return [
    'attached'  => 'Šis laukas jau yra pridėtas.',
    'relatable' => 'Šis laukas negali būti susijęs su šiuo šaltiniu.',
];


text:
package org.mifos.accounts.business;

import java.util.Date;
import java.util.Locale;

import org.joda.time.LocalDate;
import org.mifos.accounts.util.helpers.AccountState;
import org.mifos.customers.personnel.business.PersonnelBO;
import org.mifos.dto.domain.SavingsStatusChangeHistoryDto;
import org.mifos.framework.business.AbstractEntity;
import org.mifos.framework.util.DateTimeService;
import org.mifos.framework.util.helpers.DateUtils;

public class AccountStatusChangeHistoryEntity extends AbstractEntity {

    private final Integer accountStatusChangeId;
    private final AccountBO account;
    private final AccountStateEntity oldStatus;
    private final AccountStateEntity newStatus;
    private final PersonnelBO personnel;
    private Locale locale = null;
    private Date createdDate;

    protected AccountStatusChangeHistoryEntity() {
        accountStatusChangeId = null;
        this.oldStatus = null;
        this.newStatus = null;
        this.personnel = null;
        this.account = null;
    }

    public AccountStatusChangeHistoryEntity(AccountStateEntity oldStatus, AccountStateEntity newStatus,
            PersonnelBO personnel, AccountBO account) {
        this(oldStatus, newStatus, personnel, account, new DateTimeService().getCurrentJavaDateTime());
    }

    public AccountStatusChangeHistoryEntity(AccountStateEntity oldStatus, AccountStateEntity newStatus,
            PersonnelBO personnel, AccountBO account, Date createdDate) {
        accountStatusChangeId = null;
        this.oldStatus = oldStatus;
        this.newStatus = newStatus;
        this.personnel = personnel;
        this.account = account;
        this.createdDate = createdDate;
    }

    public AccountBO getAccount() {
        return account;
    }

    public Date getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }

    public Integer getAccountStatusChangeId() {
        return accountStatusChangeId;
    }

    public AccountStateEntity getNewStatus() {
        return newStatus;
    }

    public AccountStateEntity getOldStatus() {
        return oldStatus;
    }

    public PersonnelBO getPersonnel() {
        return personnel;
    }

    public String getPersonnelName() {
        return personnel.getDisplayName();
    }

    public String getOldStatusName() {
        if (oldStatus == null || oldStatus.getId().equals(newStatus.getId())) {
            return "-";
        }
        return oldStatus.getName();
    }

    public String getNewStatusName() {
        return newStatus.getName();
    }

    public Locale getLocale() {
        return locale;
    }

    public void setLocale(Locale locale) {
        this.locale = locale;
    }

    public String getUserPrefferedTransactionDate() {
        return DateUtils.getUserLocaleDate(getLocale(), getCreatedDate().toString());
    }

    public SavingsStatusChangeHistoryDto toDto() {
        return new SavingsStatusChangeHistoryDto(getPersonnelName(), getNewStatusName(), getOldStatusName(), getUserPrefferedTransactionDate(), new LocalDate(this.createdDate));
    }

    public boolean isLoanActive() {
        return oldStatus.getId().equals(AccountState.LOAN_ACTIVE_IN_BAD_STANDING.getValue())
                || oldStatus.getId().equals(AccountState.LOAN_ACTIVE_IN_GOOD_STANDING.getValue());
    }
}


text:
authors:
- OKF
date: 2016-04-19 10:38:00
image:
  src: /files/blog/2016/04/kas-opendata.jpg
  title: Open Data bringt Mehrwert von 43,1 Mrd. Euro im Jahr
  license: CC-0
type: post
layout: post
card: true
tags:
- Open Data
- Studie
- Konrad-Adenauer-Stiftung
title: "KAS: Open Data bringt Mehrwert von 43,1 Mrd. Euro im Jahr"
---

Die Konrad-Adenauer-Stiftung hat eine neue Studie zu Open Data herausgegeben. Sie belegt, dass offene Verwaltungsdaten in Deutschland einen volkswirtschaftlichen Mehrwert von 43,1 Milliarden Euro im Jahr erzeugen und 20.000 Arbeitsplätze schaffen können.

Damit liefert die Studie weitere Argumente, um die systematische Bereitstellung offener Daten zu forcieren. Und viel mehr: Open Data kann Treiber des gesellschaftlichen Wandels sein und das Verhältnis von Staat, Bürger und Wirtschaft entscheidend prägen. Verbesserte Rahmenbedingungen und politische Führung sind dafür zwingend erforderlich.

Zur Studie


text:
/* eslint-disable import/prefer-default-export */
export const createError = (name, message) => {
    const e = new Error(message);
    e.name = name;
    return e;
};


text:
<project name="target.package.flex">

  <target name="package-flex">
    <mkdir dir="${build.dir.output.package}"/>
    <copy toDir="${build.dir.output.package}">
      <fileset dir="${build.dir.output.binary}">
        <include name="**/*.*"/>
      </fileset>
    </copy>
    <create-flex-html-wrapper
      swf="${project.name}"
      application="${project.name}"
      html-page-title="${project.name}"
      output-file-name="${project.name}.html"/>
    <copy-flex-rsls
      output-dir="${build.dir.output.package}"
      flex-dir-home-rsl="${flex.dir.home}/frameworks/rsls"/>
  </target>

</project>


text:
/*
 * $Id$
 */

#if !defined(XERCESC_INCLUDE_GUARD_ATTRIBUTELIST_HPP)
#define XERCESC_INCLUDE_GUARD_ATTRIBUTELIST_HPP

#include <xercesc/util/XercesDefs.hpp>

XERCES_CPP_NAMESPACE_BEGIN

/**
  * Interface for an element's attribute specifications.
  *
  * The SAX parser implements this interface and passes an instance
  * to the SAX application as the second argument of each startElement
  * event.
  *
  * The instance provided will return valid results only during the
  * scope of the startElement invocation (to save it for future
  * use, the application must make a copy: the AttributeListImpl
  * helper class provides a convenient constructor for doing so).
  *
  * An AttributeList includes only attributes that have been
  * specified or defaulted: \#IMPLIED attributes will not be included.
  *
  * There are two ways for the SAX application to obtain information
  * from the AttributeList.  First, it can iterate through the entire
  * list:
  *
  *
  * public void startElement (String name, AttributeList atts) {

  *  for (XMLSize_t i = 0; i < atts.getLength(); i++) {

  *   String name = atts.getName(i);

  *   String type = atts.getType(i);

  *   String value = atts.getValue(i);

  *   [...]

  *  }

  * }
  *
  *
  * (Note that the result of getLength() will be zero if there
  * are no attributes.)
  *
  * As an alternative, the application can request the value or
  * type of specific attributes:
  *
  *
  * public void startElement (String name, AttributeList atts) {

  *  String identifier = atts.getValue("id");

  *  String label = atts.getValue("label");

  *  [...]

  * }
  *
  *
  * The AttributeListImpl helper class provides a convenience
  * implementation for use by parser or application writers.
  *
  * @see DocumentHandler#startElement
  * @see AttributeListImpl#AttributeListImpl
  */

class SAX_EXPORT AttributeList
{
public:
    // -----------------------------------------------------------------------
    //  Constructors and Destructor
    // -----------------------------------------------------------------------
    /** @name Constructors and Destructor */
    //@{
    /** Default constructor */
    AttributeList()
    {
    }

    /** Destructor */
    virtual ~AttributeList()
    {
    }
    //@}

    /** @name The virtual attribute list interface */
    //@{
  /**
    * Return the number of attributes in this list.
    *
    * The SAX parser may provide attributes in any
    * arbitrary order, regardless of the order in which they were
    * declared or specified.  The number of attributes may be
    * zero.
    *
    * @return The number of attributes in the list.
    */
    virtual XMLSize_t getLength() const = 0;

  /**
    * Return the name of an attribute in this list (by position).
    *
    * The names must be unique: the SAX parser shall not include the
    * same attribute twice.  Attributes without values (those declared
    * \#IMPLIED without a value specified in the start tag) will be
    * omitted from the list.
    *
    * If the attribute name has a namespace prefix, the prefix
    * will still be attached.
    *
    * @param index The index of the attribute in the list (starting at 0).
    * @return The name of the indexed attribute, or null
    *         if the index is out of range.
    * @see #getLength
    */
    virtual const XMLCh* getName(const XMLSize_t index) const = 0;

  /**
    * Return the type of an attribute in the list (by position).
    *
    * The attribute type is one of the strings "CDATA", "ID",
    * "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES",
    * or "NOTATION" (always in upper case).
    *
    * If the parser has not read a declaration for the attribute,
    * or if the parser does not report attribute types, then it must
    * return the value "CDATA" as stated in the XML 1.0 Recommendation
    * (clause 3.3.3, "Attribute-Value Normalization").
    *
    * For an enumerated attribute that is not a notation, the
    * parser will report the type as "NMTOKEN".
    *
    * @param index The index of the attribute in the list (starting at 0).
    * @return The attribute type as a string, or
    *         null if the index is out of range.
    * @see #getLength
    * @see #getType
    */
    virtual const XMLCh* getType(const XMLSize_t index) const = 0;

  /**
    * Return the value of an attribute in the list (by position).
    *
    * If the attribute value is a list of tokens (IDREFS,
    * ENTITIES, or NMTOKENS), the tokens will be concatenated
    * into a single string separated by whitespace.
    *
    * @param index The index of the attribute in the list (starting at 0).
    * @return The attribute value as a string, or
    *         null if the index is out of range.
    * @see #getLength
    * @see #getValue
    */
    virtual const XMLCh* getValue(const XMLSize_t index) const = 0;

  /**
    * Return the type of an attribute in the list (by name).
    *
    * The return value is the same as the return value for
    * getType(XMLSize_t).
    *
    * If the attribute name has a namespace prefix in the document,
    * the application must include the prefix here.
    *
    * @param name The name of the attribute.
    * @return The attribute type as a string, or null if no
    *         such attribute exists.
    * @see #getType
    */
    virtual const XMLCh* getType(const XMLCh* const name) const = 0;

  /**
    * Return the value of an attribute in the list (by name).
    *
    * The return value is the same as the return value for
    * getValue(XMLSize_t).
    *
    * If the attribute name has a namespace prefix in the document,
    * the application must include the prefix here.
    *
    * @param name The name of the attribute in the list.
    * @return The attribute value as a string, or null if
    *         no such attribute exists.
    * @see #getValue
    */
    virtual const XMLCh* getValue(const XMLCh* const name) const = 0;

  /**
    * Return the value of an attribute in the list (by name).
    *
    * The return value is the same as the return value for
    * getValue(XMLSize_t).
    *
    * If the attribute name has a namespace prefix in the document,
    * the application must include the prefix here.
    *
    * @param name The name of the attribute in the list.
    * @return The attribute value as a string, or null if
    *         no such attribute exists.
    * @see #getValue
    */
    virtual const XMLCh* getValue(const char* const name) const = 0;
    //@}

private :
    /* Constructors and operators */
    /* Copy constructor */
    AttributeList(const AttributeList&);
    /* Assignment operator */
    AttributeList& operator=(const AttributeList&);

};

XERCES_CPP_NAMESPACE_END

#endif


text:
from indy import ledger

import json
import pytest

@pytest.mark.asyncio
async def test_build_get_revoc_reg_request_work():
    identifier = "Th7MpTaRZVRYnPiabds81Y"

    rev_reg_def_id = "RevocRegID"
    timestamp = 100

    expected_response = {
        "operation": {
            "type": "116",
            "revocRegDefId": rev_reg_def_id,
            "timestamp": timestamp
        }
    }

    request = json.loads(await ledger.build_get_revoc_reg_request(identifier, rev_reg_def_id, timestamp))
    assert expected_response.items() <= request.items()


text:
/**
 * Collect logs, organize by type, and programatically flush to a single
 * endpoint.
 *
 * @author Wells Johnston <wells@littlstar.com>
 */

var http = require('superagent');

/**
 * `Lager' constructor
 *
 * @api public
 * @constructor
 */

module.exports = Lager;

function Lager(opts) {

  if (!(this instanceof Lager)) {
    return new Lager(opts);
  }

  this.host = opts.host;
  this.data = {};
};

/**
 * Stores data in memory to be logged. Optionally flush the log to the
 * endpoint right away.
 *
 * @api public
 * @param {string} endpoint The type of log.
 * @param {object} data The payload to send to the endpoint.
 * @param {boolean} [flush] If true, send the logs immediately.
 */

Lager.prototype.log = function(endpoint, data, flush) {

  if (typeof flush == 'undefined') flush = false;

  if (!this.data[endpoint]) {
    this.data[endpoint] = [data];
  } else {
    this.data[endpoint].push(data);
  }

  if (flush) this.flush();
};

/**
 * flush
 *
 * Send the stored log data to the backend server, which will store
 * the log data to the respective endpoints.
 *
 * @api public
 * @param {string} [endpoint]
 */

Lager.prototype.flush = function(endpoint) {

  var dataToLog = null;
  if (typeof endpoint == 'undefined') {
    dataToLog = this.data;
    this.data = {};
  } else {
    dataToLog = {};
    dataToLog[endpoint] = this.data[endpoint];
    delete this.data[endpoint];
  }

  http
    .post(this.host)
    .send({
      payload: dataToLog
    })
    .set('Accept', 'application/json')
    .end(function(e, r) {});
};


text:
LLVM_VERSION_MAJOR=$1

source /multibuild/manylinux_utils.sh

detect_llvm_version() {
  curl -sL https://api.github.com/repos/llvm/llvm-project/releases | \
    grep tag_name | \
    grep -o "llvmorg-${LLVM_VERSION_MAJOR}[^\"]*" | \
    grep -v rc | \
    sed -e "s/^llvmorg-//g" | \
    head -n 1
}

LLVM_VERSION=$(detect_llvm_version)
curl -sL https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz -o llvm-${LLVM_VERSION}.src.tar.xz
unxz llvm-${LLVM_VERSION}.src.tar.xz
tar xf llvm-${LLVM_VERSION}.src.tar
pushd llvm-${LLVM_VERSION}.src
mkdir build
pushd build
cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DLLVM_TARGETS_TO_BUILD=host \
    -DLLVM_INCLUDE_DOCS=OFF \
    -DLLVM_INCLUDE_EXAMPLES=OFF \
    -DLLVM_INCLUDE_TESTS=OFF \
    -DLLVM_INCLUDE_UTILS=OFF \
    -DLLVM_ENABLE_TERMINFO=OFF \
    -DLLVM_ENABLE_ASSERTIONS=ON \
    -DLLVM_ENABLE_RTTI=ON \
    -DLLVM_ENABLE_OCAMLDOC=OFF \
    -DLLVM_USE_INTEL_JITEVENTS=ON \
    -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \
    -DPYTHON_EXECUTABLE="$(cpython_path 3.6)/bin/python" \
    -GNinja \
    ..
ninja install
popd
popd
rm -rf llvm-${LLVM_VERSION}.src.tar.xz llvm-${LLVM_VERSION}.src.tar llvm-${LLVM_VERSION}.src

# clang is only used to precompile Gandiva bitcode
if [ ${LLVM_VERSION_MAJOR} -lt 9 ]; then
  clang_package_name=cfe
else
  clang_package_name=clang
fi
curl -sL https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/${clang_package_name}-${LLVM_VERSION}.src.tar.xz -o ${clang_package_name}-${LLVM_VERSION}.src.tar.xz
unxz ${clang_package_name}-${LLVM_VERSION}.src.tar.xz
tar xf ${clang_package_name}-${LLVM_VERSION}.src.tar
pushd ${clang_package_name}-${LLVM_VERSION}.src
mkdir build
pushd build
cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCLANG_INCLUDE_TESTS=OFF \
    -DCLANG_INCLUDE_DOCS=OFF \
    -DLLVM_INCLUDE_TESTS=OFF \
    -DLLVM_INCLUDE_DOCS=OFF \
    -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \
    -GNinja \
    ..
ninja -w dupbuild=warn install # both clang and llvm builds generate llvm-config file
popd
popd
rm -rf ${clang_package_name}-${LLVM_VERSION}.src.tar.xz ${clang_package_name}-${LLVM_VERSION}.src.tar ${clang_package_name}-${LLVM_VERSION}.src


text:
require 'test_helper'

class DirecPayModuleTest < Test::Unit::TestCase
  include OffsitePayments::Integrations

  def test_notification_method
    assert_instance_of DirecPay::Notification, DirecPay.notification('name=me', {})
  end

  def test_return
    assert_instance_of DirecPay::Return, DirecPay.return("name=me", {})
  end

  def test_status_update_instantiates_status_class
    DirecPay::Status.any_instance.expects(:update).with('authorization', 'http://localhost/return')
    DirecPay.request_status_update('mid', 'authorization', 'http://localhost/return')
  end
end


text:
#ifndef PlatformClockCA_h
#define PlatformClockCA_h

#if USE(COREAUDIO)

#include "Clock.h"

typedef struct OpaqueCAClock *CAClockRef;

namespace WebCore {

class PlatformClockCA final : public Clock {
public:
    PlatformClockCA();
    virtual ~PlatformClockCA();

private:
    void setCurrentTime(double) override;
    double currentTime() const override;

    void setPlayRate(double) override;
    double playRate() const override;

    void start() override;
    void stop() override;
    bool isRunning() const override { return m_running; }

    CAClockRef m_clock;
    bool m_running;
};

}

#endif

#endif


text:
@class SBJsonStreamParser;
@class SBJsonStreamParserAdapter;

@interface TweetStreamViewController : UIViewController {
    IBOutlet UITextField *username;
    IBOutlet UITextField *password;
    IBOutlet UITextView *tweet;

    SBJsonStreamParser *parser;
    SBJsonStreamParserAdapter *adapter;
}

- (IBAction)go;

@end


text:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%     Copyright 2014 University of Memphis
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
%     http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
%%
intermittentRipNida=load('C:\DataProcessingFramework\data\UbiComp\Data\compareNidaMemphisLoss\episodes_intermittentBad_rip_nida.csv');
intermittentRipMemphis=load('C:\DataProcessingFramework\data\UbiComp\Data\compareNidaMemphisLoss\episodes_intermittent_bad_rip_active.csv');

wearingMemphis=load('C:\DataProcessingFramework\data\UbiComp\Data\compareNidaMemphisLoss\episodes_wearing_all_active_period.csv');
wearingNida=load('C:\DataProcessingFramework\data\UbiComp\Data\compareNidaMemphisLoss\episodes_wearing_minusDropout.csv');

%we compare intermittent loosening / wearing ratio for each individual

subjectwiseMemphis=[];
for i=[12,13,14,15,16,17,18,19,20,21,22,24,25,26,27,28,29,30,31,32,33,34,35,36,37,39,40,41,42,43,44]
    ind1=find(wearingMemphis(:,1)==i);
    wearing_i=sum(wearingMemphis(ind1,4)-wearingMemphis(ind1,3))/1000/60/60;
    ind2=find(intermittentRipMemphis(:,1)==i);
    intermittent_i=sum(intermittentRipMemphis(ind2,4)-intermittentRipMemphis(ind2,3))/1000/60/60;
    subjectWiseRatio=intermittent_i/wearing_i;
    subjectwiseMemphis=[subjectwiseMemphis;i subjectWiseRatio];
end

subjectwiseNida=[];
for i=[1,2,3,4,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,33,34,35,36,38,39,40,41,42,43,44]
    ind1=find(wearingNida(:,1)==i);
    wearing_i=sum(wearingNida(ind1,4)-wearingNida(ind1,3))/1000/60/60;
    ind2=find(intermittentRipNida(:,1)==i);
    intermittent_i=sum(intermittentRipNida(ind2,4)-intermittentRipNida(ind2,3))/1000/60/60;
    subjectWiseRatio=intermittent_i/wearing_i;
    subjectwiseNida=[subjectwiseNida;i subjectWiseRatio];
end


text:
require "goodreads/version"
require "goodreads/errors"
require "goodreads/request"
require "goodreads/client"

module Goodreads
  class << self
    attr_accessor :options
  end
  self.options = {}

  # Create a new Goodreads::Client instance
  #
  def self.new(params = {})
    Goodreads::Client.new(params)
  end

  # Define a global configuration
  #
  # options[:api_key]    - Account API key
  # options[:api_secret] - Account API secret
  #
  def self.configure(params = {})
    fail(ArgumentError, "Options hash required.") unless params.is_a?(Hash)

    options[:api_key]    = params[:api_key]
    options[:api_secret] = params[:api_secret]
    options
  end

  # Returns global configuration hash
  #
  def self.configuration
    options
  end

  # Resets the global configuration
  #
  def self.reset_configuration
    self.options = {}
  end
end


text:
'use strict';

const ComputedArtifact = require('./computed-artifact');
const DevtoolsTimelineModel = require('../../lib/traces/devtools-timeline-model');

class ScreenshotFilmstrip extends ComputedArtifact {

  get name() {
    return 'Screenshots';
  }

  fetchScreenshot(frame) {
    return frame
      .imageDataPromise()
      .then(data => 'data:image/jpg;base64,' + data);
  }

  /**
   * @param {{traceEvents: !Array}} trace
   * @return {!Promise}
  */
  compute_(trace) {
    const model = new DevtoolsTimelineModel(trace.traceEvents);
    const filmStripFrames = model.filmStripModel().frames();

    const frameFetches = filmStripFrames.map(frame => this.fetchScreenshot(frame));
    return Promise.all(frameFetches).then(images => {
      const result = filmStripFrames.map((frame, i) => ({
        timestamp: frame.timestamp,
        datauri: images[i],
      }));
      return result;
    });
  }
}

module.exports = ScreenshotFilmstrip;


text:
#include "ble_flash.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "nrf_soc.h"
#include "nordic_common.h"
#include "nrf_error.h"
#include "nrf.h"
#include "nrf51_bitfields.h"
#include "nrf_assert.h"
#include "app_util.h"
#include "app_timer.h"
#include "config.h"
#include "simple_uart.h"
#include "bd_sync_data.h"
#include "nrf_sdm.h"
#include "nrf_delay.h"
#include "bd_wall_clock_timer.h"
#include "ble_radio_notification.h"

#define ERASABLE_PAGE_CHECK(page_num)    ASSERT((page_num >= ERASABLE_BLOCK_START) && (page_num < ERASABLE_BLOCK_END))

app_timer_id_t m_erase_flash_timer_id;

static volatile bool m_radio_active = false;  /**< TRUE if radio is active (or about to become active), FALSE otherwise. */
static volatile bool erase_op_scheduled = false;    /* delay erase op has scheduled or not */

uint16_t ble_flash_crc16_compute(uint8_t * p_data, uint16_t size, uint16_t * p_crc)
{
    uint16_t i;
    uint16_t crc = (p_crc == NULL) ? 0xffff : *p_crc;

    for (i = 0; i < size; i++) {
        crc  = (unsigned char)(crc >> 8) | (crc << 8);
        crc ^= p_data[i];
        crc ^= (unsigned char)(crc & 0xff) >> 4;
        crc ^= (crc << 8) << 4;
        crc ^= ((crc & 0xff) << 4) << 1;
    }
    return crc;
}

/**@brief Function for erasing a page in flash.
 *
 * @param[in]  p_page  Pointer to first word in page to be erased.
 */
static void flash_page_erase(uint32_t * p_page)
{

    // Turn on flash erase enable and wait until the NVMC is ready.
    NRF_NVMC->CONFIG = (NVMC_CONFIG_WEN_Een << NVMC_CONFIG_WEN_Pos);
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy) {
        // Do nothing.
    }

    // Erase page.
    NRF_NVMC->ERASEPAGE = (uint32_t)p_page;
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy) {
        // Do nothing.
    }

    // Turn off flash erase enable and wait until the NVMC is ready.
    NRF_NVMC->CONFIG = (NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos);
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy) {
        // Do nothing
    }
}

/**@brief Function for writing one word to flash. Unprotected write, which can interfere with radio communication.
 *
 * @details This function DOES NOT use the m_radio_active variable, but will force the write even
 *          when the radio is active. To be used only from @ref ble_flash_page_write.
 *
 * @note Flash location to be written must have been erased previously.
 *
 * @param[in]  p_address   Pointer to flash location to be written.
 * @param[in]  value       Value to write to flash.
 */
static void flash_word_unprotected_write(uint32_t * p_address, uint32_t value)
{
    // Turn on flash write enable and wait until the NVMC is ready.
    NRF_NVMC->CONFIG = (NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos);
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy) {
        // Do nothing.
    }
    *p_address = value;

    // Wait flash write to finish
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy) {
        // Do nothing.
    }

    // Turn off flash write enable and wait until the NVMC is ready.
    NRF_NVMC->CONFIG = (NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos);
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy) {
        // Do nothing.
    }
}

/**@brief Function for writing one word to flash.
 *
 * @note Flash location to be written must have been erased previously.
 *
 * @param[in]  p_address   Pointer to flash location to be written.
 * @param[in]  value       Value to write to flash.
 */
static void flash_word_write(uint32_t * p_address, uint32_t value)
{
    // If radio is active, wait for it to become inactive.
    while (m_radio_active) {
        // Do nothing (just wait for radio to become inactive).
        (void) sd_app_event_wait();
    }

    // Turn on flash write enable and wait until the NVMC is ready.
    NRF_NVMC->CONFIG = (NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos);
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy) {
        // Do nothing.
    }

    *p_address = value;
    // Wait flash write to finish
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy) {
        // Do nothing.
    }
    // Turn off flash write enable and wait until the NVMC is ready.
    NRF_NVMC->CONFIG = (NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos);
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy) {
        // Do nothing
    }
}

uint32_t ble_flash_word_write(uint32_t * p_address, uint32_t value)
{
    flash_word_write(p_address, value);
    return NRF_SUCCESS;
}

uint32_t ble_flash_block_write(uint32_t * p_address, uint32_t * p_in_array, uint16_t word_count)
{
    uint16_t i;

    for (i = 0; i < word_count; i++) {
        flash_word_write(p_address, p_in_array[i]);
        p_address++;
    }

    return NRF_SUCCESS;
}

uint32_t ble_flash_page_erase(uint8_t page_num)
{
    uint32_t * p_page = (uint32_t *)(BLE_FLASH_PAGE_SIZE * page_num);
#ifdef DEBUG_LOG
    LOG(LEVEL_INFO,"page_num:[%d]\n",page_num);
#endif
    ERASABLE_PAGE_CHECK(page_num);

    flash_page_erase(p_page);

    return NRF_SUCCESS;
}

/*******************************************************************************************
* This function is used to write content to a flash page which has already been
* erased, this is the main difference to ble_flash_page_write
********************************************************************************************/
uint32_t bd_flash_write_erased_page(uint8_t page_num ,uint32_t *p_in_array,uint8_t word_count)
{
    //check is page already erased
    ERASABLE_PAGE_CHECK(page_num);

    ASSERT(word_count <= (BLE_FLASH_PAGE_SIZE/sizeof(uint32_t) - FLASH_PAGE_HEADER_LEN));

    uint8_t     i = 0;
    uint32_t *  address = 0;
    uint16_t    flash_crc;
    uint32_t    flash_header;

    ble_flash_page_addr(page_num,&address);

    for(i = 0; i< (word_count + FLASH_PAGE_HEADER_LEN); ++i ) {
        if(*(address + i) != 0xFFFFFFFF) {
            break;
        }
    }

    if( i< (word_count + FLASH_PAGE_HEADER_LEN) ) {
        LOG(LEVEL_ERROR,"want to write a flash page which is not erased");
        return NRF_ERROR_INVALID_ADDR;
    }

    for(i = 0; i < word_count ; ++i) {
        ble_flash_word_write((address + i + FLASH_PAGE_HEADER_LEN), p_in_array[i] );
    }

    //write flash header
    flash_crc = ble_flash_crc16_compute((uint8_t *)p_in_array,word_count * sizeof(uint32_t),NULL);

    flash_header = BLE_FLASH_MAGIC_NUMBER | (uint32_t)flash_crc;
    ble_flash_word_write(address,flash_header);

    //write flash word_count
    ble_flash_word_write(address + 1, word_count);

    return NRF_SUCCESS;

}

/***********************************************************************************
* cooperated with the above Function
************************************************************************************/
uint32_t bd_flash_read_page(uint8_t page_num, uint32_t * p_out_array, uint8_t * p_word_count)
{
    return  ble_flash_page_read(page_num,p_out_array,p_word_count);
}

/***********************************************************************************
* this function is used to check whether the given flash block is erased
************************************************************************************/
uint32_t check_is_flash_erased(uint32_t * address ,uint16_t wordCount)
{
    uint16_t index = 0;

    for( ; index < wordCount; index ++) {
        if(*(address + index) != 0xFFFFFFFF) {
            return NRF_ERROR_INVALID_STATE;
        }
    }

    return NRF_SUCCESS;
}

uint32_t ble_flash_page_write(uint8_t page_num, uint32_t * p_in_array, uint8_t word_count)
{
    int        i;
    uint32_t * p_page;
    uint32_t * p_curr_addr;
    uint16_t   in_data_crc;
    uint16_t   flash_crc;
    uint32_t   flash_header;

    p_page      = (uint32_t *)(BLE_FLASH_PAGE_SIZE * page_num);
    p_curr_addr = p_page;

    // Calculate CRC of the data to write.
    in_data_crc = ble_flash_crc16_compute((uint8_t *)p_in_array,
                                          word_count * sizeof(uint32_t),
                                          NULL);

    // Compare the calculated to the one in flash.
    flash_header = *p_curr_addr;
    flash_crc    = (uint16_t)flash_header;

    if (flash_crc == in_data_crc) {
        // Data is the same as the data already stored in flash, return without modifying flash.
        return NRF_SUCCESS;
    }

    // Erase flash page
    flash_page_erase(p_page);

    // Reserve space for magic number (for detecting if flash content is valid).
    p_curr_addr++;

    // Reserve space for saving word_count.
    p_curr_addr++;

    // Write data
    for (i = 0; i < word_count; i++) {
        flash_word_unprotected_write(p_curr_addr, p_in_array[i]);
        p_curr_addr++;
    }

    // Write number of elements.
    flash_word_write(p_page + 1, (uint32_t)(word_count));

    // Write magic number and CRC to indicate that flash content is valid.
    flash_header = BLE_FLASH_MAGIC_NUMBER | (uint32_t)in_data_crc;
    flash_word_write(p_page, flash_header);

    return NRF_SUCCESS;
}

uint32_t ble_flash_page_read(uint8_t page_num, uint32_t * p_out_array, uint8_t * p_word_count)
{
    int        byte_count;
    uint32_t * p_page;
    uint32_t * p_curr_addr;
    uint32_t   flash_header;
    uint32_t   calc_header;
    uint16_t   calc_crc;
    uint32_t   tmp;

    p_page      = (uint32_t *)(BLE_FLASH_PAGE_SIZE * page_num);
    p_curr_addr = p_page;

    // Check if block is valid
    flash_header = *p_curr_addr;
    tmp = flash_header & 0xFFFF0000;
    if (tmp != BLE_FLASH_MAGIC_NUMBER) {
        *p_word_count = 0;
        return NRF_ERROR_NOT_FOUND;
    }
    p_curr_addr++;

    // Read number of elements
    *p_word_count = (uint8_t)(*(p_curr_addr));
    p_curr_addr++;

    // Read data
    byte_count = (*p_word_count) * sizeof(uint32_t);
    memcpy(p_out_array, p_curr_addr, byte_count);

    // Check CRC
    calc_crc  = ble_flash_crc16_compute((uint8_t *)p_out_array,
                                        (*p_word_count) * sizeof(uint32_t),
                                        NULL);
    calc_header = BLE_FLASH_MAGIC_NUMBER | (uint32_t)calc_crc;

    if (calc_header != flash_header) {
        return NRF_ERROR_NOT_FOUND;
    }

    return NRF_SUCCESS;
}

uint32_t ble_flash_page_addr(uint8_t page_num, uint32_t ** pp_page_addr)
{
    *pp_page_addr = (uint32_t *)(BLE_FLASH_PAGE_SIZE * page_num);
    return NRF_SUCCESS;
}

#define ERASE_Q_MAX_LEN 8
typedef struct flash_page_to_erase {
    uint8_t page_num;
} flash_page_to_erase_t;

flash_page_to_erase_t flash_page_to_erase_Q[ERASE_Q_MAX_LEN]; // [page_num][delay_time]

uint8_t flash_page_to_erase_Q_len = 0;

bool ble_flash_page_delay_erase_finished(uint8_t page_num)
{
    uint8_t index;
    for(index = 0; index < flash_page_to_erase_Q_len; index ++) {

#ifdef DEBUG_LOG
        LOG(LEVEL_INFO,"--check erase_finished: %d/%d\r\n",index,flash_page_to_erase_Q_len);
#endif
        if(page_num == flash_page_to_erase_Q[index].page_num)
            return false;
    }

    return true;
}

uint32_t ble_flash_page_delay_erase(uint8_t page_num)
{
    uint8_t index;

    for(index = 0; index < flash_page_to_erase_Q_len; index ++) { // if this page aready exist here, ignore new request
        if(page_num == flash_page_to_erase_Q[index].page_num)
            return NRF_SUCCESS;
    }

    if(!((page_num >= ERASABLE_BLOCK_START) && (page_num < ERASABLE_BLOCK_END))) {
        LOG(LEVEL_ERROR, "want to erase illegal page num is %d",page_num);
        return NRF_ERROR_INVALID_ADDR;
    }

    if(get_global_bluetooth_status() == NotWork) { //if bluetooth not work just erase the page
        return ble_flash_page_erase(page_num);
    }

    //will put it into the queue
    if(flash_page_to_erase_Q_len == ERASE_Q_MAX_LEN) {
        return NRF_ERROR_NO_MEM;
    }

    flash_page_to_erase_Q[flash_page_to_erase_Q_len ++ ].page_num= page_num;

#ifdef DEBUG_LOG
    LOG(LEVEL_INFO,"-------delay_erase page:%d len: %d\r\n",flash_page_to_erase_Q[flash_page_to_erase_Q_len-1].page_num,flash_page_to_erase_Q_len);
#endif

    return NRF_SUCCESS;
}

uint32_t radio_inactive_time;

/************************************************************************************
* erase when slow advertising & long connection interval
*************************************************************************************/
#define ERASE_LIMIT    APP_TIMER_TICKS(400, APP_TIMER_PRESCALER)
#define MAX_RTC_COUNTER_VAL     0x00FFFFFF

void ble_flash_erase_data_page(void * p_event_data, uint16_t event_size)
{
    uint32_t inactive_last_time;

    //do not need lock
    erase_op_scheduled = false;

    //add this jusge for assurance, because this function is scheduled while
    //radio is working, so   get_global_bluetooth_status() == NotWork may never
    //occure
    if(get_global_bluetooth_status() == NotWork) {

        ble_flash_page_erase(flash_page_to_erase_Q[flash_page_to_erase_Q_len - 1].page_num);

        sync_data_to_flash(flash_page_to_erase_Q[flash_page_to_erase_Q_len - 1].page_num);
        flash_page_to_erase_Q_len --;

        if(flash_page_to_erase_Q_len >0 ) {
            app_sched_event_put(&(flash_page_to_erase_Q_len),sizeof(flash_page_to_erase_Q_len),ble_flash_erase_data_page);
        }

        return;

    }

    if((get_global_bluetooth_status() == SlowAdvertising) || (get_global_bluetooth_status() == LongConnectInterval)) {

        if(NRF_RTC1->COUNTER > radio_inactive_time)
            inactive_last_time = NRF_RTC1->COUNTER - radio_inactive_time;
        else
            inactive_last_time = NRF_RTC1->COUNTER - radio_inactive_time + MAX_RTC_COUNTER_VAL;

        if (inactive_last_time > ERASE_LIMIT ) {
            return;
        } else {
#ifdef DEBUG_LOG
            LOG(LEVEL_INFO,"inactive_time:%d\r\n",inactive_last_time);
            LOG(LEVEL_INFO,"erase needs: %d\r\n",NRF_RTC1->COUNTER);
            LOG(LEVEL_INFO,"len:%d,page: %d\r\n",flash_page_to_erase_Q_len, flash_page_to_erase_Q[flash_page_to_erase_Q_len - 1].page_num);
#endif
            ble_flash_page_erase(flash_page_to_erase_Q[flash_page_to_erase_Q_len - 1].page_num);

            sync_data_to_flash(flash_page_to_erase_Q[flash_page_to_erase_Q_len - 1].page_num);
            flash_page_to_erase_Q_len --;
        }
    }

}

bool ble_radio_active(void)
{
    return m_radio_active;
}

void ble_flash_on_radio_active_evt(bool radio_active)
{
    m_radio_active = radio_active;

    if( !m_radio_active && flash_page_to_erase_Q_len && ((get_global_bluetooth_status() == SlowAdvertising) || (get_global_bluetooth_status() == LongConnectInterval))) {

        if(erase_op_scheduled == false) {
            erase_op_scheduled = true;
            radio_inactive_time = NRF_RTC1->COUNTER;

            LOG(LEVEL_INFO,"-m_radio_active: %d,rtc: %d\r\n",m_radio_active,radio_inactive_time);
            app_sched_event_put(&(flash_page_to_erase_Q_len),sizeof(flash_page_to_erase_Q_len),ble_flash_erase_data_page);
        }
    }
}

void radio_disable(void)
{
    sd_softdevice_disable();

    NRF_RADIO->SHORTS          = 0;
    NRF_RADIO->EVENTS_DISABLED = 0;
    NRF_RADIO->TEST            = 0;
    NRF_RADIO->TASKS_DISABLE   = 1;
    while (NRF_RADIO->EVENTS_DISABLED == 0) {
        nrf_delay_ms(5);
    }
    NRF_RADIO->EVENTS_DISABLED = 0;

    //should only be called here
    set_radio_active_flag(false);
}

/*******************************************************************************
* This function should only be called after stop radio
********************************************************************************/
void set_radio_active_flag(bool value)
{
    if(value == false) {
        m_radio_active = false;
    }
}


text:
<?php

namespace Application\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use	Doctrine\ORM\EntityManager;
use Application\Entity\DomainObject;

/**
 * A music album.
 *
 * @ORM\Entity
 * @ORM\Table(name="contact")
 * @property int $id
 * @property string $paddress
 * @property string $raddress
 * @property int $altcontactnumber
 * @property int $user_id

 */
class Contact
{
	/**
	 * @ORM\Id
	 * @ORM\Column(type="integer");
	 * @ORM\GeneratedValue(strategy="AUTO")
	 */
	protected  $id;

	/**
	 * @ORM\Column(type="string")
	 */
	protected  $paddress;
	/**
	 * @ORM\Column(type="string")
	 */
	protected  $raddress;

	/**
	 * @ORM\Column(type="bigint",length=20,nullable=true)
	 */
	protected  $altcontactnumber;
	/**
	 * @ORM\Column(type="integer")
	 */
	protected  $user_id;
	/**
	 * @var Doctrine\ORM\EntityManager
	 */
	protected $em;

	public function __construct() {
		$this->login = new ArrayCollection();
		$this->tmp=new ArrayCollection();
	}
	/**
	 * Magic getter to expose protected properties.
	 *
	 * @param string $property
	 * @return mixed
	 */

	public function __get($property)
	{
		return $this->$property;
	}
	/**
	 * Magic setter to save protected properties.
	 *
	 * @param string $property
	 * @param mixed $value
	 */
	public function __set($property, $value)
	{
		$this->$property = $value;
	}

	public function getLogin(){
		return $this->login;
	}

	public function setEntityManager(EntityManager $em)
	{
		$this->em = $em;
		parent::setEntityManager($this->em);
	}

	public function getEntityManager()
	{
		return $this->em;
	}

}


text:
.copyUrl {
	-moz-box-shadow:inset 0px 1px 4px -4px #bbdaf7;
	-webkit-box-shadow:inset 0px 1px 4px -4px #bbdaf7;
	box-shadow:inset 0px 1px 4px -4px #bbdaf7;
	background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #79bbff), color-stop(1, #378de5) );
	background:-moz-linear-gradient( center top, #79bbff 5%, #378de5 100% );
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#79bbff', endColorstr='#378de5');
	background-color:#79bbff;
	-moz-border-radius:8px;
	-webkit-border-radius:8px;
	border-radius:8px;
	border:1px solid #84bbf3;
	display:inline-block;
	color:#ffffff;
	font-family:Verdana;
	font-size:11px;
	font-weight:normal;
	padding:5px 16px;
	text-decoration:none;
}.copyUrl:hover {
	background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #378de5), color-stop(1, #79bbff) );
	background:-moz-linear-gradient( center top, #378de5 5%, #79bbff 100% );
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#378de5', endColorstr='#79bbff');
	background-color:#378de5;
}.copyUrl:active {
	position:relative;
	top:1px;
}
/* This imageless css button was generated by CSSButtonGenerator.com */

.extension-info {
	margin: 4px 4px 4px 4px;
}

.extension-info  img,
.extension-info a {
	margin-right: 10px;
	Text-decoration: none;
}
/* This imageless css button was generated by CSSButtonGenerator.com */

table {
	font: 11px/24px Verdana, Arial, Helvetica, sans-serif;
	border-collapse: collapse;
	width: 320px;
	}

th {
	padding: 0 0.5em;
	text-align: left;
	}

tr.yellow td {
	border-top: 1px solid #FB7A31;
	border-bottom: 1px solid #FB7A31;
	background: #FFC;
	}

td {
	border-bottom: 1px solid #CCC;
	padding: 0 0.5em;
	}

td:first-child {
	width: 30px;
	}

td+td {
	border-left: 1px solid #CCC;
	text-align: left;
	}


text:
!/bin/bash
# written by Fritz Sedlazeck, for questions: fsedlazeck@cshl.edu

min_args=3
#path to the mumer install directory:
script_path=/seq/schatz/fritz/sge_mummer2/sge_mummer/
#path to the mumer install directory:
mummer_path=/sonas-hs/schatz/hpc/home/fsedlaze/programs/MUMmer3.23/

#check if user specified the requried parameters
if [ $# -eq $min_args ]; then
	#get full paths:
	ref=$(readlink -f $1)
	query=$(readlink -f $2)
	work=$(readlink -f $3)

	#prepare ref file:
	mkdir -p $work
	echo "split up ref"
	$script_path/explode_fasta.pl $ref $work

	#create sge job:
	num=$(wc -l < $work/summary)
	sed "s/NUMMER/$num/g" $script_path/sge_mummer_helper.sh > $work'/mummer.sh'
	qsub -sync y -N mummersplit -o $work/output.txt -e $work/error.txt -v PATHMUM=\'$mummer_path\',REF_FASTA_LIST=\'$work/summary\',QRY=\'$query\',WORK=\'$work\' $work'/mummer.sh'
	echo "wating for mummer to finish"
	echo "reconstructing file"
	#create a merged file:
	#header:
	echo "$ref $query" > $work/'merged_results.delta'
	echo "NUCMER" >> $work/'merged_results.delta'
	#footer:
	for i in `/bin/ls $work/*/nucmer.proc`
	do
		DIR=$(dirname "${i}")
		if [ ! -f $DIR'/nucmer.success' ]; then
  			echo "ERROR: One subprocess exit with error!"
			exit
		fi
  		awk ' NR > 2 {print $0} ' $DIR/*.delta >> $work/'merged_results.delta'
	done
	#cleaning up the working directory
	tmp=1
	for i in $(cat $work/summary)
	do
		rm $i
		rm -r $work/$tmp
		tmp=$((tmp+1))
	done
	rm $work/summary
	rm $work'/mummer.sh'
	echo "Finished succesfully."
else
        echo "Splits and aligns the ref.fa to the query.fa"
        echo "File path of the ref file"
	echo "File path of the query file"
	echo "Working directory"
fi


text:
$:.unshift(File.dirname(__FILE__) + '/../lib')
require 'rednode'
begin
  require 'rspec/autorun'
rescue LoadError
  require 'rubygems'
  require 'rspec/autorun'
end

require 'erb'
def rputs(msg)
  puts "<div>#{ERB::Util.h(msg)}</div>"
  $stdout.flush
end


text:
#import "TiProxy.h"
#ifdef USE_TI_CALENDAR
@interface TiCalendarReminder : TiProxy {

}

@end
#endif


text:
//We are given an integer number n, a bit value v (v=0 or 1) and a position p. Write a sequence of operators (a few lines of C# code) that modifies n to hold the value v at the position p from the binary representation of n while preserving all other bits in n. Examples:

using System;

class ModifyBitByPosition
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        int p = int.Parse(Console.ReadLine());
        int v = int.Parse(Console.ReadLine());

        if (v == 0)
        {
            n = n & ~(1 << p); // (0 & 1 = 0); (1 & 0 = 0);
            Console.WriteLine(n);
        }
        else
        {
            n = n | (1 << p); // (0 | 1 = 1) and (0 | 1 = 1)
            Console.WriteLine(n);
        }
    }
}


text:
import { Observable } from '../../Observable';
import { share } from '../../operator/share';
Observable.prototype.share = share;
//# sourceMappingURL=share.js.map


text:
package echosign.api.clientv20.dto9;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for MergeFieldInfo complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="MergeFieldInfo">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="mergeFields" type="{http://dto9.api.echosign}ArrayOfMergeField" minOccurs="0"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MergeFieldInfo", propOrder = {
    "mergeFields"
})
public class MergeFieldInfo {

    @XmlElement(nillable = true)
    protected ArrayOfMergeField mergeFields;

    /**
     * Gets the value of the mergeFields property.
     *
     * @return
     *     possible object is
     *     {@link ArrayOfMergeField }
     *
     */
    public ArrayOfMergeField getMergeFields() {
        return mergeFields;
    }

    /**
     * Sets the value of the mergeFields property.
     *
     * @param value
     *     allowed object is
     *     {@link ArrayOfMergeField }
     *
     */
    public void setMergeFields(ArrayOfMergeField value) {
        this.mergeFields = value;
    }

}


text:
// Copyright 2017 The Bazel Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.devtools.common.options;

import com.google.common.collect.ImmutableList;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.List;

/**
 * Applied to an {@link OptionsBase} subclass to indicate that all of its options fields have types
 * chosen from {@link #coreTypes}. Any subclasses of the class to which it's applied must also
 * satisfy the same property.
 *
 *
Options classes with this annotation are serializable and deeply immutable, except that the
 * fields of the options class can be reassigned (although this is bad practice).
 *
 *
Note that {@link Option#allowMultiple} is not allowed for options in classes with this
 * annotation, since their type is {@link List}.
 */
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
public @interface UsesOnlyCoreTypes {

  /**
   * These are the core options field types. They all have default converters, are deeply immutable,
   * and are serializable.
   *
   * Lists are not considered core types, so {@link Option#allowMultiple} options are not permitted.
   */
  public static final ImmutableList<Class<?>> CORE_TYPES = ImmutableList.of(
      // 1:1 correspondence with Converters.DEFAULT_CONVERTERS.
      String.class,
      int.class,
      long.class,
      double.class,
      boolean.class,
      TriState.class,
      Void.class
  );
}


text:
Package('twitter')
.use('tupai.ViewController')
.use('tupai.ui.TableView')
.use('tupai.ui.View')
.use('twitter.Templates')
.use('tupai.Application')
.use('twitter.ui.TimeLineTableViewCell')
.define('TimeLineViewController', function(cp) { return cp.ViewController.extend({
    viewInit: function() {
        var tableView = new cp.TableView();
        tableView.setTableViewDelegate(this);
        this.setContentView(tableView);
        this.registerCacheObserver('timeline', this);
        this._cache = this.getCache('timeline');
    },
    didCacheChanged: function(e) {
        //console.log('did cache changed ' + JSON.stringify(e));
        this.getContentView().reloadData();
    },
    viewDidLoad: function() {
        this._fetchNext();
    },
    _fetchNext: function() {
        this.executeApi({
            name: 'timeline',
            requestName: 'search',
            parameters: {q: 'ネコ'}
        });
    },
    _fetchPrev: function() {
        this.executeApi({
            name: 'timeline',
            requestName: 'search',
            attributes: {old: true}
        });
    },
    numberOfRows: function() {
        return this._cache.size();
    },
    cellForRowAtBottom: function() {
        var nextPage = cp.Application.instance.getAttribute('nextPage');
        if(!nextPage) return undefined;

        var v = new cp.View({
            template: cp.Templates.get('more_link')
        });
        var THIS = this;
        v.bind('click', function() {
            THIS._fetchPrev();
        });
        return v;
    },
    cellForRowAtIndexPath: function(indexPath, tableView) {
        var row = indexPath.row;
        var cell = tableView.dequeueReusableCell('timeline_table_cell');
        if(cell == null) {
            cell = new cp.TimeLineTableViewCell();
        }
        cell.setData(this._cache.get(row));
        return cell;
    }
});});


text:
package edu.berkeley.nlp.util;

import java.io.Serializable;
import java.lang.reflect.Array;
import java.util.*;

/**
 * Filters contains some simple implementations of the Filter interface.
 *
 * @author Christopher Manning
 * @version 1.0
 */
public class Filters {

  /**
   * Nothing to instantiate
   */
  private Filters() {
  }

  /**
   * The acceptFilter accepts everything.
   */
  public static Filter acceptFilter() {
    return new CategoricalFilter(true);
  }

  /**
   * The rejectFilter accepts nothing.
   */
  public static Filter rejectFilter() {
    return new CategoricalFilter(false);
  }

  private static final class CategoricalFilter implements Filter {

    private final boolean judgment;

    private CategoricalFilter(boolean judgment) {
      this.judgment = judgment;
    }

    /**
     * Checks if the given object passes the filter.
     *
     * @param obj an object to test
     */
    public boolean accept(Object obj) {
      return judgment;
    }
  }

  /**
   * The collectionAcceptFilter accepts a certain collection.
   */
  public static Filter collectionAcceptFilter(Object[] objs) {
    return new CollectionAcceptFilter(Arrays.asList(objs), true);
  }

  /**
   * The collectionAcceptFilter accepts a certain collection.
   */
  public static Filter collectionAcceptFilter(Collection objs) {
    return new CollectionAcceptFilter(objs, true);
  }

  /**
   * The collectionRejectFilter rejects a certain collection.
   */
  public static Filter collectionRejectFilter(Object[] objs) {
    return new CollectionAcceptFilter(Arrays.asList(objs), false);
  }

  /**
   * The collectionRejectFilter rejects a certain collection.
   */
  public static Filter collectionRejectFilter(Collection objs) {
    return new CollectionAcceptFilter(objs, false);
  }

  private static final class CollectionAcceptFilter implements Filter, Serializable {

    private final Collection args;
    private final boolean judgment;

    private CollectionAcceptFilter(Collection c, boolean judgment) {
      this.args = new HashSet(c);
      this.judgment = judgment;
    }

    /**
     * Checks if the given object passes the filter.
     *
     * @param obj an object to test
     */
    public boolean accept(Object obj) {
      if (args.contains(obj)) {
        return judgment;
      } else {
        return !judgment;
      }
    }
  }

  /**
   * Filter that accepts only when both filters accept (AND).
   */
  public static Filter andFilter(Filter f1, Filter f2) {
    return (new CombinedFilter(f1, f2, true));
  }

  /**
   * Filter that accepts when either filter accepts (OR).
   */
  public static Filter orFilter(Filter f1, Filter f2) {
    return (new CombinedFilter(f1, f2, false));
  }

  /**
   * Conjunction or disjunction of two filters.
   */
  private static class CombinedFilter implements Filter {
    private Filter f1, f2;
    private boolean conjunction; // and vs. or

    public CombinedFilter(Filter f1, Filter f2, boolean conjunction) {
      this.f1 = f1;
      this.f2 = f2;
      this.conjunction = conjunction;
    }

    public boolean accept(Object o) {
      if (conjunction) {
        return (f1.accept(o) && f2.accept(o));
      }
      return (f1.accept(o) || f2.accept(o));
    }
  }

  /**
   * Filter that does the opposite of given filter (NOT).
   */
  public static Filter notFilter(Filter filter) {
    return (new NegatedFilter(filter));
  }

  /**
   * Filter that's either negated or normal as specified.
   */
  public static Filter switchedFilter(Filter filter, boolean negated) {
    return (new NegatedFilter(filter, negated));
  }

  /**
   * Negation of a filter.
   */
  private static class NegatedFilter implements Filter {
    private Filter filter;
    private boolean negated;

    public NegatedFilter(Filter filter, boolean negated) {
      this.filter = filter;
      this.negated = negated;
    }

    public NegatedFilter(Filter filter) {
      this(filter, true);
    }

    public boolean accept(Object o) {
      return (negated ^ filter.accept(o)); // xor
    }
  }

  /**
   * Applies the given filter to each of the given elems, and returns the
   * list of elems that were accepted. The runtime type of the returned
   * array is the same as the passed in array.
   */
  public static Object[] filter(Object[] elems, Filter filter) {
    List filtered = new ArrayList();
    for (int i = 0; i < elems.length; i++) {
      if (filter.accept(elems[i])) {
        filtered.add(elems[i]);
      }
    }
    return (filtered.toArray((Object[]) Array.newInstance(elems.getClass().getComponentType(), filtered.size())));
  }

  /**
   * Removes all elems in the given Collection that aren't accepted by the given Filter.
   */
  public static void retainAll(Collection elems, Filter filter) {
    for (Iterator iter = elems.iterator(); iter.hasNext();) {
      Object elem = iter.next();
      if (!filter.accept(elem)) {
        iter.remove();
      }
    }
  }
}


text:
import {io} from '@tensorflow/tfjs-core';

import {BlazePoseEstimationConfig, BlazePoseModelConfig} from '../blazepose_mediapipe/types';

/**
 * Model parameters for BlazePose TFJS runtime.
 *
 * `runtime`: Must set to be 'tfjs'.
 *
 * `enableSmoothing`: Optional. A boolean indicating whether to use temporal
 * filter to smooth the predicted keypoints. Defaults to True. The temporal
 * filter relies on the currentTime field of the HTMLVideoElement. You can
 * override this timestamp by passing in your own timestamp (in milliseconds)
 * as the third parameter in `estimatePoses`. This is useful when the input is
 * a tensor, which doesn't have the currentTime field. Or in testing, to
 * simulate different FPS.
 *
 * `modelType`: Optional. Possible values: 'lite'|'full'|'heavy'. Defaults to
 * 'full'. The model accuracy increases from lite to heavy, while the inference
 * speed decreases and memory footprint increases. The heavy variant is intended
 * for applications that require high accuracy, while the lite variant is
 * intended for latency-critical applications. The full variant is a balanced
 * option.
 *
 * `detectorModelUrl`: Optional. An optional string that specifies custom url of
 * the detector model. This is useful for area/countries that don't have access
 * to the model hosted on tf.hub.
 *
 * `landmarkModelUrl`: Optional. An optional string that specifies custom url of
 * the landmark model. This is useful for area/countries that don't have access
 * to the model hosted on tf.hub.
 */
export interface BlazePoseTfjsModelConfig extends BlazePoseModelConfig {
  runtime: 'tfjs';
  detectorModelUrl?: string|io.IOHandler;
  landmarkModelUrl?: string|io.IOHandler;
}

/**
 * Pose estimation parameters for BlazePose TFJS runtime.
 *
 * `maxPoses`: Optional. Defaults to 1. BlazePose only supports 1 pose for now.
 *
 * `flipHorizontal`: Optional. Default to false. When image data comes from
 * camera, the result has to flip horizontally.
 */
export interface BlazePoseTfjsEstimationConfig extends
    BlazePoseEstimationConfig {}


text:
using MT4LiquidityIndicator.Net.Fdk;
using SoftFX.Extended;
using SoftFX.Extended.Storage;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;

namespace MT4LiquidityIndicator.Net.View
{
	public partial class GoToDialog : Form
	{
		#region construction

		public GoToDialog(string symbol, int duration)
		{
			InitializeComponent();

			m_symbol = symbol;
			m_duration = duration;
			m_dateTime.Value = m_lastUsingDateTime ?? DateTime.UtcNow;
		}

		#endregion

		public Quote[] Quotes { get; private set; }

		#region event handlers

		private void OnGo(object sender, EventArgs e)
		{
			DateTime value = m_dateTime.Value;
			m_timestamp = new DateTime(value.Year, value.Month, value.Day, value.Hour, value.Minute, value.Second, DateTimeKind.Utc);
			m_lastUsingDateTime = m_timestamp;

			try
			{
				m_go.Enabled = false;
				m_cancel.Enabled = false;
				m_thread = new Thread(Download);
				m_thread.Start();
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK);
				this.Close();
			}
		}

		private void OnClosing(object sender, FormClosingEventArgs e)
		{
			if (null != m_thread)
			{
				e.Cancel = true;
			}
		}

		#endregion

		#region helper methods
		private void Log(string message)
		{
			if (this.InvokeRequired)
			{
				Action<string> func = Log;
				BeginInvoke(func, message);
			}
			else
			{
				m_log.Items.Add(message);
			}
		}

		private void Log(string format, params object[] args)
		{
			string message = string.Format(format, args);
			Log(message);
		}

		private void Close(DialogResult result)
		{
			if (this.InvokeRequired)
			{
				Action<DialogResult> func = Close;
				BeginInvoke(func, result);
			}
			else
			{
				this.DialogResult = result;
				this.Close();
			}
		}

		#endregion

		#region downloading quotes

		private void Download()
		{
			string path = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
			Log("Using a temporary directory = {0}", path);

			bool isSuccessfull = SafeDownload(path) && SafeDeleteDirectory(path);
			m_thread = null;

			if (isSuccessfull)
			{
				Close(DialogResult.OK);
			}
		}

		private bool SafeDownload(string path)
		{
			bool result = false;

			try
			{
				Log("Downloading quotes...");
				using (DataFeedImpl impl = DataFeedImpl.Create())
				{
					DataFeed feed = impl.Instance;
					using (DataFeedStorage storage = new DataFeedStorage(path, StorageProvider.Ntfs, 1, feed, false))
					{
						HistoryInfo info = storage.Online.GetQuotesInfo(m_symbol, 0);
						string availbaleFrom = info.AvailableFrom.ToString(cDateTimeFormat);
						string availableTo = info.AvailableTo.ToString(cDateTimeFormat);
						Log("Quotes history available from = {0} to = {1}", availbaleFrom, availableTo);
						DateTime startTime = m_timestamp.AddSeconds(-m_duration);
						Log("Start time = {0}", startTime.ToString(cDateTimeFormat));
						DateTime endTime = m_timestamp;
						Log("End time = {0}", endTime.ToString(cDateTimeFormat));
						this.Quotes = storage.Online.GetQuotes(m_symbol, startTime, endTime, 0);
					}
				}

				Log("{0} quotes have been loaded", this.Quotes.Length);

				result = this.Quotes.Length > 0;
			}
			catch (Exception ex)
			{
				Log(ex.Message);
			}

			return result;
		}

		private bool SafeDeleteDirectory(string path)
		{
			bool result = false;

			try
			{
				Log("Trying to delete a directory = {0}", path);
				if (Directory.Exists(path))
				{
					Directory.Delete(path, true);
				}
				Log("The directory has been deleted successfully");
				result = true;
			}
			catch (Exception ex)
			{
				Log(ex.Message);
			}
			return result;
		}
		#endregion

		#region input arguments

		private readonly string m_symbol;
		private readonly int m_duration;
		private const string cDateTimeFormat = "yyyy-MM-dd HH:mm:ss";

		#endregion

		#region members
		private DateTime m_timestamp;
		private Thread m_thread;
		private static DateTime? m_lastUsingDateTime;
		#endregion
	}
}


text:
package edu.smu.tspell.wordnet.impl.file.synset;

import edu.smu.tspell.wordnet.AdjectiveSynset;
import edu.smu.tspell.wordnet.NounSynset;
import edu.smu.tspell.wordnet.SynsetType;
import edu.smu.tspell.wordnet.WordNetException;
import edu.smu.tspell.wordnet.WordSense;

import edu.smu.tspell.wordnet.impl.file.ReferenceSynset;
import edu.smu.tspell.wordnet.impl.file.RelationshipPointers;
import edu.smu.tspell.wordnet.impl.file.RelationshipType;
import edu.smu.tspell.wordnet.impl.file.RetrievalException;
import edu.smu.tspell.wordnet.impl.file.SenseKey;
import edu.smu.tspell.wordnet.impl.file.WordPositions;

/**
 * Reference implementation of an adjective synset.
 *
 * @author Brett Spell
 */
public class AdjectiveReferenceSynset extends ReferenceSynset
		implements AdjectiveSynset
{

	/**
	 * Used to store information about what position a word form must occupy.
	 * This may be null if there is no word position information
	 * for this synset.
	 *
	 * @see
	 *      Format of Lexicographer Files ("Word Syntax") and
	 *
	 *      Format of Lexicographer Files ("Special Adjective Syntax").
	 */
	private WordPositions wordPositions;

	/**
	 * Constructor that accepts adjective synset properties.
	 *
	 * @param  definition Short description / definition of the meaning.
	 * @param  examples Examples of how the synset is used.
	 * @param  senseKeys Keys of word senses associated with this synset.
	 * @param  pointers Pointers to unresolved relationships.
	 * @param  lexFile Lexical file that contains the synset.
	 * @param  offset Byte offset into the data file where synset is defined.
	 * @param  positions Positions that the words in this synset can occupy.
	 */
	public AdjectiveReferenceSynset(String definition, String[] examples,
			SenseKey[] senseKeys, RelationshipPointers pointers,
			int lexFile, int offset, WordPositions positions)
	{
		this(SynsetType.ADJECTIVE, definition, examples, senseKeys, pointers,
			lexFile, offset, positions);
	}

	/**
	 * Constructor that accepts the basic synset properties and that is used
	 * to construct instances of adjective and adjective satellite synsets.
	 *
	 * @param  definition Short description / definition of the meaning.
	 * @param  examples Examples of how the synset is used.
	 * @param  senseKeys Keys of word senses associated with this synset.
	 * @param  pointers Pointers to unresolved relationships.
	 * @param  lexFile Lexical file that contains the synset.
	 * @param  offset Byte offset into the data file where synset is defined.
	 * @param  positions Positions that the words in this synset can occupy.
	 */
	AdjectiveReferenceSynset(SynsetType type, String definition,
			String[] examples, SenseKey[] senseKeys,
			RelationshipPointers pointers, int lexFile, int offset,
			WordPositions positions)
	{
		super(type, definition, examples, senseKeys, pointers, lexFile, offset);
		this.wordPositions = positions;
	}

	/**
	 * Returns the synsets, if any, with similar meaning.
	 *

	 * For example, "abridged" is similar to "shortened".
	 *
	 * @return The synsets representing meanings similar to this one.
	 * @throws RetrievalException An error occurred retrieving data.
	 */
	public AdjectiveSynset[] getSimilar() throws RetrievalException
	{
		return getAdjectiveSynsets(RelationshipType.SIMILAR);
	}

	/**
	 * The verb from which the adjective was derived if one exists.
	 *

	 * For example, the participle of "beaten" is "beat".
	 *
	 * @param  wordForm Word form for which to return the verb participle.
	 * @return Verb participle (the root verb from which the specified word
	 *         form was derived.
	 * @throws RetrievalException An error occurred retrieving data.
	 */
	public WordSense getParticiple(String wordForm) throws RetrievalException
	{
		return getSingletonSense(RelationshipType.PARTICIPLE, wordForm);
	}

	/**
	 * Returns the pertainyms (words from which a word in this synset was
	 * derived), if any, associated with a word form in this synset.
	 *

	 * For example, a pertainym of "academic" is "academia".
	 *
	 * @param  wordForm Word form for which to return pertainyms.
	 * @return The pertainyms of this synset or null.
	 * @throws RetrievalException An error occurred retrieving data.
	 */
	public WordSense[] getPertainyms(String wordForm) throws RetrievalException
	{
		return getReferences(RelationshipType.PERTAINYM, wordForm);
	}

	/**
	 * Returns the synsets of which this adjective concept is an attribute.
	 *

	 * For example, "accurate" is an attribute of "truth".
	 *
	 * @return Synsets of which this adjective concept is an attribute.
	 * @throws RetrievalException An error occurred retrieving data.
	 */
	public NounSynset[] getAttributes() throws RetrievalException
	{
		return getNounSynsets(RelationshipType.ATTRIBUTE);
	}

	/**
	 * Returns the synsets representing related ("see also") concepts.
	 *

	 * For example, "aggressive" is related to "hostile".
	 *
	 * @return Synsets representing concepts related to this one.
	 * @throws RetrievalException An error occurred retrieving data.
	 * @deprecated Use {@link #getRelatedConcepts()}.
	 */
	public AdjectiveSynset[] getRelated() throws RetrievalException
	{
		return getRelatedConcepts();
	}

	/**
	 * Returns the synsets representing related ("see also") concepts.
	 *

	 * For example, "aggressive" is related to "hostile".
	 *
	 * @return Synsets representing concepts related to this one.
	 * @throws RetrievalException An error occurred retrieving data.
	 */
	public AdjectiveSynset[] getRelatedConcepts() throws RetrievalException
	{
		return getAdjectiveSynsets(RelationshipType.ALSO_SEE);
	}

	/**
	 * Returns the position that the specified adjective word form must
	 * occupy relative to a nount it modifies.
	 *
	 * @param  wordForm Word form for which to return the required position.
	 * @return Position at which the word must occur or null if
	 *         there is no restriction on its position.
	 * @see    AdjectiveSynset
	 */
	public String getRequiredPosition(String wordForm)
	{
		return wordPositions.getRequiredPosition(wordForm);
	}

	/**
	 * Indicates whether this is a head synset or a satellite synset.
	 *
	 * @return true if this a head synset or
	 *         false if it is a satellite synset.
	 * @throws WordNetException An error occurred retrieving data.
	 * @see    #getSimilar()
	 */
	public boolean isHeadSynset() throws WordNetException
	{
		return true;
	}

}


text:
<?php

include dirname(__file__) . '/../../manage.php';


text:
// This file is automatically generated.

package adila.db;

/*
 * Southern Telecom a4
 *
 * DEVICE: a4
 * MODEL: a4
 */
final class a4_a4 {
    public static final String DATA = "Southern Telecom|a4|";
}


text:
package org.apache.camel.component.routebox.direct;

import java.util.HashMap;
import java.util.Map;

import org.apache.camel.Component;
import org.apache.camel.Consumer;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
import org.apache.camel.component.routebox.RouteboxConfiguration;
import org.apache.camel.component.routebox.RouteboxEndpoint;

public class RouteboxDirectEndpoint extends RouteboxEndpoint {
    private final Map<String, RouteboxDirectConsumer> consumers = new HashMap<String, RouteboxDirectConsumer>();

    public RouteboxDirectEndpoint(String endpointUri) {
        super(endpointUri);
    }

    public RouteboxDirectEndpoint(String endpointUri, Component component) {
        super(endpointUri, component);
    }

    public RouteboxDirectEndpoint(String uri, Component component, RouteboxConfiguration config) {
        super(uri, component, config);
    }

    public Producer createProducer() throws Exception {
        return new RouteboxDirectProducer(this);
    }

    public Consumer createConsumer(Processor processor) throws Exception {
        return new RouteboxDirectConsumer(this, processor);
    }

    public boolean isSingleton() {
        return true;
    }

    public void addConsumer(RouteboxDirectConsumer consumer) {
        String key = consumer.getEndpoint().getEndpointKey();
        consumers.put(key, consumer);
    }

    public void removeConsumer(RouteboxDirectConsumer consumer) {
        String key = consumer.getEndpoint().getEndpointKey();
        consumers.remove(key);
    }

    public boolean hasConsumer(RouteboxDirectConsumer consumer) {
        String key = consumer.getEndpoint().getEndpointKey();
        return consumers.containsKey(key);
    }

    public RouteboxDirectConsumer getConsumer() {
        String key = getEndpointKey();
        return consumers.get(key);
    }

}


text:
// sysscalartypes.h
//
#pragma once
#ifndef __SDL_SYSOBJ_SYSSCALARTYPES_H__
#define __SDL_SYSOBJ_SYSSCALARTYPES_H__

#include "dataserver/system/page_head.h"

namespace sdl { namespace db {

#pragma pack(push, 1)

struct sysscalartypes_row_meta;
struct sysscalartypes_row_info;

/* (ObjectID = 50)
The sysscalartypes table holds a row for every built-in and user-defined data type.
It can be read using the DMVs sys.systypes and sys.types. */

struct sysscalartypes_row
{
    using meta = sysscalartypes_row_meta;
    using info = sysscalartypes_row_info;

    struct data_type { // 49 bytes

        row_head head; // 4 bytes

        scalartype      id;             // id - 4 bytes - the unique id for this built-in type or UDT.
        uint32          schid;          // schid - 4 bytes - the schema that owns this data type.
        column_xtype    xtype;          // xtype - 1 byte - the same as the xtype values in the syscolpars table - equal to the id for built-in types.
        scalarlen       length;         // length - 2 bytes - the length of the data type in bytes
        uint8           prec;           // prec - 1 byte
        uint8           scale;          // scale - 1 byte
        uint32          collationid;    // collationid - 4 bytes
        uint32          status;         // status - 4 bytes - status flags about the type.  If 0x1 is set, the type does not allow NULLs (default is to allow NULLs)
        datetime_t      created;        // created - datetime, 8 bytes
        datetime_t      modified;       // modified - datetime, 8 bytes
        uint32          dflt;           // dflt - 4 bytes
        uint32          chk;            // chk - 4 bytes
    };
    union {
        data_type data;
        char raw[sizeof(data_type)];
    };
};

#pragma pack(pop)

template<> struct null_bitmap_traits<sysscalartypes_row> {
    enum { value = 1 };
};

template<> struct variable_array_traits<sysscalartypes_row> {
    enum { value = 1 };
};

struct sysscalartypes_row_meta: is_static {

    typedef_col_type_n(sysscalartypes_row, head);
    typedef_col_type_n(sysscalartypes_row, id);
    typedef_col_type_n(sysscalartypes_row, schid);
    typedef_col_type_n(sysscalartypes_row, xtype);
    typedef_col_type_n(sysscalartypes_row, length);
    typedef_col_type_n(sysscalartypes_row, prec);
    typedef_col_type_n(sysscalartypes_row, scale);
    typedef_col_type_n(sysscalartypes_row, collationid);
    typedef_col_type_n(sysscalartypes_row, status);
    typedef_col_type_n(sysscalartypes_row, created);
    typedef_col_type_n(sysscalartypes_row, modified);
    typedef_col_type_n(sysscalartypes_row, dflt);
    typedef_col_type_n(sysscalartypes_row, chk);

    typedef_var_col(0, nchar_range, name);

    typedef TL::Seq<
        head
        ,id
        ,schid
        ,xtype
        ,length
        ,prec
        ,scale
        ,collationid
        ,status
        ,created
        ,modified
        ,dflt
        ,chk
        ,name
    >::Type type_list;
};

struct sysscalartypes_row_info: is_static {
    static std::string type_meta(sysscalartypes_row const &);
    static std::string type_raw(sysscalartypes_row const &);
    static std::string col_name(sysscalartypes_row const &);
};

} // db
} // sdl

#endif // __SDL_SYSOBJ_SYSSCALARTYPES_H__


text:
<?php

namespace Laminas\View\Renderer;

use Laminas\View\Exception;
use Laminas\View\Model\FeedModel;
use Laminas\View\Model\ModelInterface as Model;
use Laminas\View\Resolver\ResolverInterface as Resolver;

/**
 * Class for Laminas\View\Strategy\FeedStrategy compatible template engine implementations
 */
class FeedRenderer implements RendererInterface
{
    /**
     * @var Resolver
     */
    protected $resolver;

    /**
     * @var string 'rss' or 'atom'; defaults to 'rss'
     */
    protected $feedType = 'rss';

    /**
     * Return the template engine object, if any
     *
     * If using a third-party template engine, such as Smarty, patTemplate,
     * phplib, etc, return the template engine object. Useful for calling
     * methods on these objects, such as for setting filters, modifiers, etc.
     *
     * @return mixed
     */
    public function getEngine()
    {
        return $this;
    }

    /**
     * Set the resolver used to map a template name to a resource the renderer may consume.
     *
     * @todo   Determine use case for resolvers for feeds
     * @param  Resolver $resolver
     * @return FeedRenderer
     */
    public function setResolver(Resolver $resolver)
    {
        $this->resolver = $resolver;
        return $this;
    }

    /**
     * Renders values as JSON
     *
     * @todo   Determine what use case exists for accepting only $nameOrModel
     * @param  string|Model $nameOrModel The script/resource process, or a view model
     * @param  null|array|\ArrayAccess $values Values to use during rendering
     * @throws Exception\InvalidArgumentException
     * @return string The script output.
     */
    public function render($nameOrModel, $values = null)
    {
        if ($nameOrModel instanceof Model) {
            // Use case 1: View Model provided
            // Non-FeedModel: cast to FeedModel
            if (! $nameOrModel instanceof FeedModel) {
                $vars    = $nameOrModel->getVariables();
                $options = $nameOrModel->getOptions();
                $type    = $this->getFeedType();
                if (isset($options['feed_type'])) {
                    $type = $options['feed_type'];
                } else {
                    $this->setFeedType($type);
                }
                $nameOrModel = new FeedModel($vars, ['feed_type' => $type]);
            }
        } elseif (is_string($nameOrModel)) {
            // Use case 2: string $nameOrModel + array|Traversable|Feed $values
            $nameOrModel = new FeedModel($values, (array) $nameOrModel);
        } else {
            // Use case 3: failure
            throw new Exception\InvalidArgumentException(sprintf(
                '%s expects a ViewModel or a string feed type as the first argument; received "%s"',
                __METHOD__,
                (is_object($nameOrModel) ? get_class($nameOrModel) : gettype($nameOrModel))
            ));
        }

        // Get feed and type
        $feed = $nameOrModel->getFeed();
        $type = $nameOrModel->getFeedType();
        if (! $type) {
            $type = $this->getFeedType();
        } else {
            $this->setFeedType($type);
        }

        // Render feed
        return $feed->export($type);
    }

    /**
     * Set feed type ('rss' or 'atom')
     *
     * @param  string $feedType
     * @throws Exception\InvalidArgumentException
     * @return FeedRenderer
     */
    public function setFeedType($feedType)
    {
        $feedType = strtolower($feedType);
        if (! in_array($feedType, ['rss', 'atom'])) {
            throw new Exception\InvalidArgumentException(sprintf(
                '%s expects a string of either "rss" or "atom"',
                __METHOD__
            ));
        }

        $this->feedType = $feedType;
        return $this;
    }

    /**
     * Get feed type
     *
     * @return string
     */
    public function getFeedType()
    {
        return $this->feedType;
    }
}


text:
require_relative '../../spec_helper'

describe "NilClass#|" do
  it "returns false if other is nil or false, otherwise true" do
    (nil | nil).should == false
    (nil | true).should == true
    (nil | false).should == false
    (nil | "").should == true
    (nil | mock('x')).should == true
  end
end


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System;
using System.Net.Http;
using System.Runtime.Serialization;
#if !PORTABLE && !DNXCORE50
using System.Security.Permissions;
#endif

namespace Microsoft.Rest
{
    /// <summary>
    /// Exception thrown for an invalid response with custom error information.
    /// </summary>
#if !PORTABLE && !DNXCORE50
    [Serializable]
#endif
    public class HttpOperationException : RestException
    {
        /// <summary>
        /// Gets information about the associated HTTP request.
        /// </summary>
        public HttpRequestMessage Request { get; set; }

        /// <summary>
        /// Gets information about the associated HTTP response.
        /// </summary>
        public HttpResponseMessage Response { get; set; }

        /// <summary>
        /// Gets or sets the response object.
        /// </summary>
        public object Body { get; set; }

        /// <summary>
        /// Initializes a new instance of the HttpOperationException class.
        /// </summary>
        public HttpOperationException()
        {
        }

        /// <summary>
        /// Initializes a new instance of the HttpOperationException class.
        /// </summary>
        /// <param name="message">The exception message.</param>
        public HttpOperationException(string message)
            : this(message, null)
        {
        }

        /// <summary>
        /// Initializes a new instance of the HttpOperationException class.
        /// </summary>
        /// <param name="message">The exception message.</param>
        /// <param name="innerException">Inner exception.</param>
        public HttpOperationException(string message, Exception innerException)
            : base(message, innerException)
        {
        }

#if !PORTABLE && !DNXCORE50
        /// <summary>
        /// Initializes a new instance of the HttpOperationException class.
        /// </summary>
        /// <param name="info">Serialization info.</param>
        /// <param name="context">Streaming context.</param>
        protected HttpOperationException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }

        /// <summary>
        /// Serializes content of the exception.
        /// </summary>
        /// <param name="info">Serialization info.</param>
        /// <param name="context">Streaming context.</param>
        [SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            base.GetObjectData(info, context);
            if (info == null)
            {
                throw new ArgumentNullException("info");
            }

            info.AddValue("Request", Request);
            info.AddValue("Response", Response);
            info.AddValue("Body", Body);
        }
#endif
    }
}


text:
package smile.math.kernel;

import smile.math.Math;
import smile.math.SparseArray;

/**
 * The Laplacian Kernel. k(u, v) = e<sup>-||u-v|| / σ</sup>,
 * where σ > 0 is the scale parameter of the kernel.

 * @author Haifeng Li
 */
public class SparseLaplacianKernel implements MercerKernel<SparseArray> {

    /**
     * The width of the kernel.
     */
    private double gamma;

    /**
     * Constructor.
     * @param sigma the smooth/width parameter of Laplacian kernel.
     */
    public SparseLaplacianKernel(double sigma) {
        if (sigma <= 0)
            throw new IllegalArgumentException("sigma is not positive.");

        this.gamma = 1.0 / sigma;
    }

    @Override
    public String toString() {
        return String.format("Sparse Laplacian kernel (\u02E0 = %.4f)", 1.0/gamma);
    }

    @Override
    public double k(SparseArray x, SparseArray y) {
        return Math.exp(-gamma * Math.distance(x, y));
    }
}


text:
require 'rails_helper'

# Specs in this file have access to a helper object that includes
# the UserDataHistoriesHelper. For example:
#
# describe UserDataHistoriesHelper do
#   describe "string concat" do
#     it "concats two strings with spaces" do
#       expect(helper.concat_strings("this","that")).to eq("this that")
#     end
#   end
# end
RSpec.describe UserDataHistoriesHelper, type: :helper do
  pending "add some examples to (or delete) #{__FILE__}"
end


text:
var parent = require('../../../actual/string/virtual/small');

module.exports = parent;


text:
{% comment %}
  Render two fields in the same row, this is col 1.

  field: The field.
  options: The field options.
{% endcomment %}

{% load floppyforms %}

{% with classes=field.css_classes label=label|default:field.label help_text=help_text|default:field.help_text %}
  {% block errors %}
    {% include "form/errors.html" with errors=field.errors %}
  {% endblock %}

      {% if options.helptext and options.helptext_position != 'tooltip' %}
        {% include "form/helptext.html" with helptext=options.helptext helptext_length=options.helptext_length %}
      {% endif %}
      {% widget field %}

{% endwith %}