text:
'use strict';

exports.up = function(knex) {
  return knex.schema.createTable('users', (table) => {
    table.increments();
    table.string('name').notNullable().defaultTo('');
    table.string('email').unique().notNullable();
    table.specificType('hashed_password', 'char(60)');
    table.timestamps(true, true);
  });
};

exports.down = function(knex) {
  return knex.schema.dropTable('users');
};

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Michaeljennings\Carpenter;

class Laravel4ServiceProvider extends CarpenterServiceProvider
{
    /**
     * Indicates if loading of the provider is deferred.
     *
     * @var bool
     */
    protected $defer = false;

    /**
     * Bootstrap the application events.
     *
     * @return void
     * @codeCoverageIgnore
     */
    public function boot()
    {
        $this->package('michaeljennings/carpenter', 'carpenter', realpath(__DIR__ . '/../'));
    }

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->app->singleton('michaeljennings.carpenter', function ($app) {
            return new Carpenter([
                'store' => $app['config']['carpenter::store'],
                'paginator' => $app['config']['carpenter::paginator'],
                'session' => $app['config']['carpenter::session'],
                'view' => $app['config']['carpenter::view'],
            ]);
        });

        $this->app->alias('michaeljennings.carpenter', 'Michaeljennings\Carpenter\Contracts\Carpenter');
    }
}


text:
package com.android.i18n.addressinput;

/**
 * Enumerates problems that default address verification can report.
 */
public enum AddressProblemType {

    /**
     * The field is not null and not whitespace, and the field should not be used for this country.
     *
     *
For example, in the U.S. the SORTING_CODE field is unused, so its presence is an error.
     */
    USING_UNUSED_FIELD,

    /**
     * The field is null or whitespace, and the field is required.
     *
     *
For example, in the U.S. ADMIN_AREA is a required field.
     */
    MISSING_REQUIRED_FIELD,

    /**
     * A list of values for the field is defined and the value does not occur in the list. Applies
     * to hierarchical elements like REGION, ADMIN_AREA, LOCALITY, and DEPENDENT_LOCALITY.
     *
     *
For example, in the U.S. the only valid values for ADMIN_AREA are the two-letter state
     * codes.
     */
    UNKNOWN_VALUE,

    /**
     * A format for the field is defined and the value does not match. This is used to match
     * POSTAL_CODE against the the format pattern generally.
     *
     *
For example, in the U.S. postal codes are five digits with an optional hyphen followed by
     * four digits.
     */
    UNRECOGNIZED_FORMAT,

    /**
     * A pattern for the field is defined and the value does not match. This is used to match
     * POSTAL_CODE against a regular expression.
     *
     *
For example, in the U.S. postal codes in the state of California start with '9'.
     */
    MISMATCHING_VALUE;

    /**
     * Returns a unique string identifying this problem (for use in a message catalog).
     */
    public String keyname() {
        return name().toLowerCase();
    }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Syst. lich. germ. (Breslau) 426 (1855)

#### Original name
Collema areolatum Flot.

### Remarks
null


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>jQuery Mobile Select Events Test Suite</title>

	<link rel="stylesheet"  href="../../../jquery.mobile-1.0.min.css"/>
	<link rel="stylesheet" href="../../../external/qunit.css"/>

jQuery Mobile Select Event Test Suite


text:
// Array interfaces

#ifndef NUMPP_ARRAYINTERF_HPP_
#define NUMPP_ARRAYINTERF_HPP_

#include <numpp/array/arrayfwd.hpp>
#include <numpp/array/arrayerr.hpp>

namespace numpp
{

/***************************************************************
 *
 *  interfaces (implemented using CRTP):
 *
 *  IAbstractArray(T, ND):
 *  =========================
 *
 *  Required to be implemented
 *  ---------------------------
 *  a.shape()    returns the shape of the array
 *  a.dims()     returns an array of dimensions
 *  a.nelems()   returns the number of elements
 *  a.empty()    returns whether the array is empty
 *               (i.e. contains no elements)
 *
 *  derived methods
 *  ----------------
 *  a.ndims()    returns the number of dimensions
 *  a.dim(k)     returns the k-th dimension
 *  a.size()     returns the number of elements (in size_type)
 *
 *
 *  IDenseArray(T, ND) refines IAbstractArray(T, ND):
 *  ==================================================
 *  supports subscript-based indexing and
 *  STL-like container interface
 *
 *  Required to be implemented
 *  ---------------------------
 *
 *  a.contiguous()   returns whether the array is contiguous
 *  a.ptr()          returns the pointer to the first element
 *  a.strides()      return an array of strides
 *  a.stride(k)      returns the stride along the k-th dimension
 *
 *  iteration methods
 *  ------------------
 *  a.begin()
 *  a.end()
 *  a.cbegin()
 *  a.cend()
 *
 *  indexing functions (external)
 *  ------------------------------
 *
 *  offset(a, i)
 *  offset(a, i0, i1)
 *  offset(a, i0, i1, i2)
 *  offset(a, i0, i1, i2, i3)
 *
 *  derived methods
 *  ---------------
 *  a(i);
 *  a(i0, i1);
 *  a(i0, i1, i2);
 *  a(i0, i1, i2, i3);
 *  a[i];
 *
 ***************************************************************/

template<class Derived, typename T, unsigned int ND>
class IAbstractArray
{
public:
    NPP_CRTP

    typedef ArrayTraits<Derived> traits;
    typedef typename traits::value_type value_type;
    typedef typename traits::shape_type shape_type;
    typedef typename traits::index_type index_type;
    typedef typename traits::size_type size_type;

    NPP_ENSURE_INLINE shape_type shape() const { return derived().shape(); }
    NPP_ENSURE_INLINE std::array<index_type,ND> dims() const { return derived().dims(); }
    NPP_ENSURE_INLINE index_type nelems() const { return derived().nelems(); }
    NPP_ENSURE_INLINE bool empty() const { return derived().empty(); }

    // derived methods;

    NPP_ENSURE_INLINE unsigned int ndims() const { return ND; }
    NPP_ENSURE_INLINE index_type dim(unsigned int k) const { return shape().dim(k); }
    NPP_ENSURE_INLINE size_type size() const { return static_cast<size_type>(derived().nelems()); }

}; // IAbstractArray

template<class Derived, typename T, unsigned int ND>
class IDenseArray : public IAbstractArray<Derived, T, ND>
{
public:
    NPP_CRTP

    typedef ArrayTraits<Derived> traits;
    NPP_DENSEARRTYPEDEFS

    // methods to be implemented

    NPP_ENSURE_INLINE shape_type shape() const { return derived().shape(); }
    NPP_ENSURE_INLINE std::array<index_type,ND> dims() const { return derived().dims(); }
    NPP_ENSURE_INLINE index_type nelems() const { return derived().nelems(); }
    NPP_ENSURE_INLINE bool empty() const { return derived().empty(); }

    NPP_ENSURE_INLINE bool contiguous() const { return derived().contiguous(); }
    NPP_ENSURE_INLINE const_pointer ptr() const { return derived().ptr(); }
    NPP_ENSURE_INLINE pointer ptr() { return derived().ptr(); }
    NPP_ENSURE_INLINE std::array<index_type, ND> strides() const { return derived().strides(); }
    NPP_ENSURE_INLINE index_type stride(unsigned int k) const { return derived().stride(k); }

    NPP_ENSURE_INLINE index_type offset(index_type i) const { return derived().offset(i); }
    NPP_ENSURE_INLINE index_type offset(index_type i, index_type j) const
    {
        return derived().offset(i, j);
    }
    NPP_ENSURE_INLINE index_type offset(index_type i, index_type j, index_type k) const
    {
        return derived().offset(i, j, k);
    }
    NPP_ENSURE_INLINE index_type offset(index_type i, index_type j, index_type k, index_type l) const
    {
        return derived().offset(i, j, k, l);
    }

    NPP_ENSURE_INLINE const_iterator cbegin() const { return derived().begin(); }
    NPP_ENSURE_INLINE const_iterator cend() const { return derived().end(); }
    NPP_ENSURE_INLINE const_iterator begin() const { return derived().begin(); }
    NPP_ENSURE_INLINE const_iterator end() const { return derived().end(); }
    NPP_ENSURE_INLINE iterator begin() { return derived().begin(); }
    NPP_ENSURE_INLINE iterator end() { return derived().end(); }

    // derived indexing methods

    template<typename TInt>
    NPP_ENSURE_INLINE const_reference operator[](TInt i) const
    {
        return operator() (static_cast<index_type>(i));
    }

    template<typename TInt>
    NPP_ENSURE_INLINE reference operator[](TInt i)
    {
        return operator() (static_cast<index_type>(i));
    }

    NPP_ENSURE_INLINE const_reference operator()(index_type i) const
    {
        NPP_CHECK_BOUNDS(inbounds(derived().shape(), i));
        return ptr()[offset(i)];
    }
    NPP_ENSURE_INLINE reference operator()(index_type i)
    {
        NPP_CHECK_BOUNDS(inbounds(derived().shape(), i));
        return ptr()[offset(i)];
    }

    NPP_ENSURE_INLINE const_reference operator()(index_type i, index_type j) const
    {
        NPP_CHECK_BOUNDS(inbounds(derived().shape(), i, j));
        return ptr()[offset(i, j)];
    }

    NPP_ENSURE_INLINE reference operator()(index_type i, index_type j)
    {
        NPP_CHECK_BOUNDS(inbounds(derived().shape(), i, j));
        return ptr()[offset(i, j)];
    }

    NPP_ENSURE_INLINE const_reference operator()(index_type i, index_type j, index_type k) const
    {
        NPP_CHECK_BOUNDS(inbounds(derived().shape(), i, j, k));
        return ptr()[offset(i, j, k)];
    }

    NPP_ENSURE_INLINE reference operator()(index_type i, index_type j, index_type k)
    {
        NPP_CHECK_BOUNDS(inbounds(derived().shape(), i, j, k));
        return ptr()[offset(i, j, k)];
    }

    NPP_ENSURE_INLINE const_reference operator()(index_type i, index_type j, index_type k, index_type l) const
    {
        NPP_CHECK_BOUNDS(inbounds(derived().shape(), i, j, k, l));
        return ptr()[offset(i, j, k, l)];
    }

    NPP_ENSURE_INLINE reference operator()(index_type i, index_type j, index_type k, index_type l)
    {
        NPP_CHECK_BOUNDS(inbounds(derived().shape(), i, j, k, l));
        return ptr()[offset(i, j, k, l)];
    }

}; // IDenseArray

template<class Derived, typename T>
NPP_ENSURE_INLINE
inline index_t nrows(const IDenseArray<Derived, T, 2>& a) { return a.shape().nrows(); }

template<class Derived, typename T>
NPP_ENSURE_INLINE
inline index_t ncolumns(const IDenseArray<Derived, T, 2>& a) { return a.shape().ncolumns(); }

}

#endif


text:
const mongoose = require( 'mongoose' )

var tokenSchema = mongoose.Schema( {
  owner: { type: mongoose.Schema.Types.ObjectId, ref: 'User', required: true },
  token: { type: String, required: true, index: true },
  createdAt: { type: Date, required: true, default: Date.now, expires: '24h' }, // expire in 24h
  action: { type: String, required: true } // email verification, password reset, etc.
}, { timestamps: true } )

var ActionToken = mongoose.model( 'ActionToken', tokenSchema )

module.exports = ActionToken


text:
angular.module('omnibooks.database', ['firebase'])
.factory('fireBase', function($firebaseArray, $firebaseObject) {
    var myDataRef = new Firebase('https://sweltering-inferno-7210.firebaseio.com/');

    var enterBook = function(org, username, title, img, author, isbn, price) {
      var bookDetails = {
        title: title,
        img: img,
        author: author,
        isbn: isbn,
        createdBy: username,
        askingPrice: price
      };

      // push book details in org books and user bookshelf nodes
      var newBookRef = myDataRef.child(org).child('books').push(bookDetails);
      var bookID = newBookRef.key();
      myDataRef.child(org).child('users').child(username).child('bookshelf').child(bookID).set(bookDetails);
    };

    var enterItem = function(org, user, itemImgUrl, itemName, itemDescription, itemPrice, bookDetails, awsInfo){
      var itemDetails = {
        img: itemImgUrl,
        name: itemName,
        description: itemDescription,
        createdBy: user,
        askingPrice: itemPrice,
        bookDetails: bookDetails,
        awsInfo: awsInfo
      };

      var newItemRef = myDataRef.child(org).child('items').push(itemDetails);
      var itemID = newItemRef.key();
      myDataRef.child(org).child('users').child(user).child('itemshelf').child(itemID).set(itemDetails);
    };

    var deleteBook = function(org, user, bookId) {
      myDataRef.child(org).child('users').child(user).child('bookshelf').child(bookId).remove();
      myDataRef.child(org).child('books').child(bookId).remove();
    };

    var updateBook = function(org, user, id, bookNode) {
      myDataRef.child(org).child('users').child(user).child('bookshelf').child(id).update(bookNode);
      myDataRef.child(org).child('books').child(id).update(bookNode);
    };

    var updateItem = function(org, user, id, bookNode) {
      myDataRef.child(org).child('users').child(user).child('itemshelf').child(id).update(bookNode);
      myDataRef.child(org).child('items').child(id).update(bookNode);
    };

    //get all books in same org
    var getOrgBook = function(org){
      var ref = myDataRef.child(org).child('books');
      return $firebaseArray(ref);
    };

    //get all items in same org
    var getOrgItems = function(org){
      var ref = myDataRef.child(org).child('items');
      return $firebaseArray(ref);
    };

    //get one book from a user, return object
    var getUserBook = function(org, username, id, callback) {
      var ref = myDataRef.child(org).child('books').child(id);
      ref.on('value', function(dataSnapshot) {
        callback(dataSnapshot.val());
        ref.off();
      });
      return $firebaseObject(ref);
    };

    //get one book from a user, return object
    var getUserItem = function(org, username, id, callback) {
      var ref = myDataRef.child(org).child('items').child(id);
      ref.on('value', function(dataSnapshot) {
        callback(dataSnapshot.val());
        ref.off();
      });
      return $firebaseObject(ref);
    };

    // returns array of all books belonging to a user
    var getUserBookshelf = function(org, username) {
      var ref = myDataRef.child(org).child('users').child(username).child('bookshelf');
      return $firebaseArray(ref);
    };

    var getUserItems = function(org, username) {
      var ref = myDataRef.child(org).child('users').child(username).child('itemshelf');
      return $firebaseArray(ref);
    };

    //get user detail info, return object
    var getUserInfo = function(org, username) {
      return $firebaseObject(myDataRef.child(org).child('users').child(username));
    };

    //get user detail info, return object
    var getUserEmail = function(org, username, callback) {
      var ref = myDataRef.child(org).child('users').child(username).child('userDetail/email');
      ref.on('value', function(dataSnapshot) {
        callback(dataSnapshot.val());
        ref.off();
      });
      return $firebaseObject(ref);
    };

    //for signup
    var createUser = function(authInfo, success, failed) {
      console.log("Within createuser ", authInfo)
      myDataRef.createUser(authInfo, function(err, userData) {
        if (err) {
          failed('the email address is already registered.');
          return;
        }
        var users = myDataRef.child(authInfo.org).child('users');
        users.child(authInfo.name).set({
          userDetail: {
            email: authInfo.email || "jim@jim.com"
          }
        });
        // save to the userOrg
        var userOrg = myDataRef.child('userOrg');
        userOrg.child(authInfo.name).set(authInfo.org);
        // save to the allUsers
        var allUsers = myDataRef.child('allUsers');
        allUsers.child(userData.uid).set({
          name: authInfo.name,
          org: authInfo.org
        });
        //log in
        myDataRef.authWithPassword(authInfo, function (err) {
          if (err) {
            failed('incorrect password.');
            return;
          }
          // invoke the callback
          success(authInfo);
        });
      });
    };

    //return users list
    var getUserOrg = function() {
      return $firebaseObject(myDataRef.child('userOrg'));
    };

    //for login
    var authWithPassword = function(authInfo, success, failed) {
      myDataRef.authWithPassword(authInfo, function(err, userData) {
        if (err) {
          failed('incorrect password.');
          return;
        }
        success(authInfo);
      });
    };

    //for facebook login
    var authWithFacebook = function(addtoDB, success, failed){
      myDataRef.authWithOAuthPopup("facebook", function(error, authData) {
        if (error) {
          console.log("Login Failed!", error);
          failed();
        } else {
          // TODO do something with authData
          addtoDB(authData);
          console.log("Authenticated successfully with payload:", authData);
          success(authData);
        }
      });
    };

    // auto login
    var autoLogin = function (callback) {
      var authData = myDataRef.getAuth();
      if(!authData){
        return;
      }
      // if the user is logged in, set the user data in auth service using callback
      var uid = authData.uid;
      var email =  "jim@jim.com"
      var allUsers = $firebaseObject(myDataRef.child('allUsers'));
      allUsers.$loaded().then(function () {
        var user = allUsers[uid];
        if(!user){
          return;
        }
        var authInfo = {
          name: user.name,
          email: email,
          org: user.org
        };
        callback(authInfo);
      });
    };

    // log out
    var logOut = function () {
      myDataRef.unauth();
    };

    return {
      enterBook: enterBook,
      enterItem: enterItem,
      deleteBook: deleteBook,
      updateBook: updateBook,
      updateItem: updateItem,
      getOrgBook: getOrgBook,
      getOrgItems: getOrgItems,
      getUserBook: getUserBook,
      getUserItem: getUserItem,
      getUserBookshelf: getUserBookshelf,
      getUserItems: getUserItems,
      getUserInfo: getUserInfo,
      createUser: createUser,
      authWithPassword: authWithPassword,
      authWithFacebook: authWithFacebook,
      getUserOrg: getUserOrg,
      getUserEmail: getUserEmail,
      autoLogin: autoLogin,
      logOut: logOut
    };
  });


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

<title>seqnum (Oracle NoSQL Database Examples)</title>
<meta name="date" content="2015-12-03">
<link rel="stylesheet" type="text/css" href="../style.css" title="Style">

seqnum

Classes

SequenceNumber


text:
using System;

namespace BlitCore
{
	/// <summary>
	/// Interface for destructible objects.
	/// </summary>
	public interface IDestructible
	{
		/// <summary>
		/// Causes the given amount of damage to the object.
		/// </summary>
		void Damage(int damage);

		/// <summary>
		/// Destroys the object
		/// </summary>
		void Destroy();
	}
}


text:
define("ace/theme/mono_industrial", ["require", "exports", "module", "ace/lib/dom"], function(require, exports, module) {

  exports.isDark = true;
  exports.cssClass = "ace-mono-industrial";
  exports.cssText = ".ace-mono-industrial .ace_gutter {\
background: #1d2521;\
color: #C5C9C9\
}\
.ace-mono-industrial .ace_print-margin {\
width: 1px;\
background: #555651\
}\
.ace-mono-industrial {\
background-color: #222C28;\
color: #FFFFFF\
}\
.ace-mono-industrial .ace_cursor {\
color: #FFFFFF\
}\
.ace-mono-industrial .ace_marker-layer .ace_selection {\
background: rgba(145, 153, 148, 0.40)\
}\
.ace-mono-industrial.ace_multiselect .ace_selection.ace_start {\
box-shadow: 0 0 3px 0px #222C28;\
}\
.ace-mono-industrial .ace_marker-layer .ace_step {\
background: rgb(102, 82, 0)\
}\
.ace-mono-industrial .ace_marker-layer .ace_bracket {\
margin: -1px 0 0 -1px;\
border: 1px solid rgba(102, 108, 104, 0.50)\
}\
.ace-mono-industrial .ace_marker-layer .ace_active-line {\
background: rgba(12, 13, 12, 0.25)\
}\
.ace-mono-industrial .ace_gutter-active-line {\
background-color: rgba(12, 13, 12, 0.25)\
}\
.ace-mono-industrial .ace_marker-layer .ace_selected-word {\
border: 1px solid rgba(145, 153, 148, 0.40)\
}\
.ace-mono-industrial .ace_invisible {\
color: rgba(102, 108, 104, 0.50)\
}\
.ace-mono-industrial .ace_string {\
background-color: #151C19;\
color: #FFFFFF\
}\
.ace-mono-industrial .ace_keyword,\
.ace-mono-industrial .ace_meta {\
color: #A39E64\
}\
.ace-mono-industrial .ace_constant,\
.ace-mono-industrial .ace_constant.ace_character,\
.ace-mono-industrial .ace_constant.ace_character.ace_escape,\
.ace-mono-industrial .ace_constant.ace_numeric,\
.ace-mono-industrial .ace_constant.ace_other {\
color: #E98800\
}\
.ace-mono-industrial .ace_entity.ace_name.ace_function,\
.ace-mono-industrial .ace_keyword.ace_operator,\
.ace-mono-industrial .ace_variable {\
color: #A8B3AB\
}\
.ace-mono-industrial .ace_invalid {\
color: #FFFFFF;\
background-color: rgba(153, 0, 0, 0.68)\
}\
.ace-mono-industrial .ace_support.ace_constant {\
color: #C87500\
}\
.ace-mono-industrial .ace_fold {\
background-color: #A8B3AB;\
border-color: #FFFFFF\
}\
.ace-mono-industrial .ace_support.ace_function {\
color: #588E60\
}\
.ace-mono-industrial .ace_entity.ace_name,\
.ace-mono-industrial .ace_support.ace_class,\
.ace-mono-industrial .ace_support.ace_type {\
color: #5778B6\
}\
.ace-mono-industrial .ace_storage {\
color: #C23B00\
}\
.ace-mono-industrial .ace_variable.ace_language,\
.ace-mono-industrial .ace_variable.ace_parameter {\
color: #648BD2\
}\
.ace-mono-industrial .ace_comment {\
color: #666C68;\
background-color: #151C19\
}\
.ace-mono-industrial .ace_entity.ace_other.ace_attribute-name {\
color: #909993\
}\
.ace-mono-industrial .ace_entity.ace_name.ace_tag {\
color: #A65EFF\
}\
.ace-mono-industrial .ace_indent-guide {\
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQ1NbwZfALD/4PAAlTArlEC4r/AAAAAElFTkSuQmCC) right repeat-y\
}";

  var dom = require("../lib/dom");
  dom.importCssString(exports.cssText, exports.cssClass);
});
(function() {
  window.require(["ace/theme/mono_industrial"], function(m) {
    if (typeof module == "object" && typeof exports == "object" && module) {
      module.exports = m;
    }
  });
})();


text:
'use strict';
(function (module) {
  try {
    module = angular.module('awelzijn.filters');
  } catch (e) {
    module = angular.module('awelzijn.filters', []);
  }
  module.filter('to_trusted', ['$sce', function ($sce) {
    return function (text) {
				return $sce.trustAsHtml(text);
			};
  }]);
})();


text:
<!DOCTYPE html>

<TITLE>Manpage of package-cleanup</TITLE>
<meta charset="utf-8">
<link rel="stylesheet" href="/css/main.css" type="text/css">

linux manpages

{"type":"documentation"}

package-cleanup

Section:  (1)
Updated: 03 November 2005
Index
Return to Main Contents

NAME

package-cleanup

SYNOPSIS

package-cleanup [options] <item ...>

DESCRIPTION

package-cleanup is a program for cleaning up the locally-installed RPMs.

GENERAL OPTIONS

-c <config file>

Use alternative config file (default is /etc/yum.conf).

-h, --help

Help; display a help message and then quit.

-q, --quiet

Print out nothing unecessary.

-v, --version

Report program version and exit.

-y

Agree to anything asked.

--leaves

List leaf nodes in the local RPM database.  Leaf nodes are RPMs that
are not relied upon by any other RPM.

--orphans

List installed packages which are not available from currenly configured
repositories. This is identical to "yum list extras", which may provide better
output.

--oldkernels

Remove old kernel and kernel-devel packages.

--problems

List dependency problems in the local RPM database. If any problems are
found it will exit with an exit code of 1.

--dupes

Scan for duplicates in the local RPM database.

--cleandupes

Scan for duplicates in the local RPM database and clean out the
older versions.

--count <COUNT>

Number of duplicate packages to keep on the system (default 2)

LEAVES OPTIONS

--all

When listing leaf nodes also list leaf nodes that are
not libraries.

--leaf-regex

A package name that matches this regular expression will be considered a leaf.

--exclude-devel

When listing leaf nodes do not list development packages.

--exclude-bin

When listing leaf nodes do not list packages with files in bin directories.

OLDKERNELS OPTIONS

--keepdevel

Do not remove kernel-devel packages when removing kernels

EXAMPLES

List all dependency problems:

package-cleanup --problems

List all packages that are not in any Yum repository:

package-cleanup --orphans

Remove old kernels keeping 3 and leaving old kernel-devel packages installed:

package-cleanup --oldkernels --count=3 --keepdevel

List all leaf packages with no files in a bin directory whose name begins with either 'perl' or 'python':

package-cleanup --leaves --exclude-bin --leaf-regex="^(perl)|(python)"

FILES

As package-cleanup uses YUM libraries for retrieving all the information, it
relies on YUM configuration for its default values like which repositories
to use. Consult YUM documentation for details:

/etc/yum.conf
/etc/yum/repos.d/
/var/cache/yum/

SEE ALSO

yum.conf (5)
http://yum.baseurl.org/

AUTHORS

See the Authors file included with this program.

BUGS

There are of course no bugs, but should you find any, you should first
consult the FAQ section on http://yum.baseurl.org/wiki/Faq and if unsuccessful
in finding a resolution contact the mailing list: yum-devel@lists.baseurl.org.
To file a bug use http://bugzilla.redhat.com for Fedora/RHEL/Centos
related bugs and http://yum.baseurl.org/report for all other bugs.

Index

NAME

SYNOPSIS

DESCRIPTION

GENERAL OPTIONS

LEAVES OPTIONS

OLDKERNELS OPTIONS

EXAMPLES

FILES

SEE ALSO

AUTHORS

BUGS

This document was created by
man2html,
using the manual pages.

Time: 05:29:07 GMT, December 24, 2015


text:
package com.thoughtworks.go.server.service.dd.reporting;

import com.thoughtworks.go.config.CaseInsensitiveString;
import com.thoughtworks.go.config.materials.dependency.DependencyMaterialConfig;
import com.thoughtworks.go.domain.PipelineTimelineEntry;
import com.thoughtworks.go.domain.StageIdentifier;
import com.thoughtworks.go.domain.materials.MaterialConfig;
import com.thoughtworks.go.domain.materials.dependency.DependencyMaterialRevision;
import com.thoughtworks.go.server.domain.PipelineTimeline;
import com.thoughtworks.go.util.Pair;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.IterableUtils;

import java.util.*;
import java.util.concurrent.ConcurrentLinkedQueue;

public class ReportingDependencyFanInNode extends ReportingFanInNode {
    private static List<Class<? extends MaterialConfig>> DEPENDENCY_NODE_TYPES = new ArrayList<>();
    public Set<ReportingFanInNode> children = new HashSet<>();
    StageIdentifier currentRevision;
    private int totalInstanceCount = Integer.MAX_VALUE;
    private int currentCount;
    private Map<StageIdentifier, Set<ReportingFaninScmMaterial>> stageIdentifierScmMaterial = new LinkedHashMap<>();

    ReportingDependencyFanInNode(MaterialConfig material) {
        super(material);
        for (Class<? extends MaterialConfig> clazz : DEPENDENCY_NODE_TYPES) {
            if (clazz.isAssignableFrom(material.getClass())) {
                return;
            }
        }
        throw new RuntimeException("Not a valid root node material type");
    }

    public void populateRevisions(ReportingFanInGraphContext context) {
        initialize(context);
        context.out.println("Total Instances: " + totalInstanceCount);
        context.out.println();
        fillNextRevisions(context);
    }

    private void setCurrentRevision() {
        currentRevision = stageIdentifierScmMaterial.keySet().toArray(new StageIdentifier[0])[0];
    }

    public void initialize(ReportingFanInGraphContext context) {
        totalInstanceCount = context.pipelineTimeline.instanceCount(((DependencyMaterialConfig) materialConfig).getPipelineName());
    }

    private void fillNextRevisions(ReportingFanInGraphContext context) {
        if (!hasMoreInstances()) {
            return;
        }

        final Pair<StageIdentifier, List<ReportingFaninScmMaterial>> sIdScmPair = getRevisionNthFor(1, context);

        validateIfRevisionMatchesTheCurrentConfig(context, sIdScmPair);

        if (!validateAllScmRevisionsAreSameWithinAFingerprint(sIdScmPair)) {
            context.out.println("Latest Revision Is Inconsistent ");
        }

        context.out.println();
    }

    private void printCurrentAndOldSCMs(ReportingFanInGraphContext context, Set<MaterialConfig> currentScmMaterials, List<ReportingFaninScmMaterial> scmMaterials,
                                        Pair<StageIdentifier, List<ReportingFaninScmMaterial>> stageIdentifierScmPair) {
        context.out.println();
        context.out.println("----");
        context.out.println("SCM Materials in config:");
        context.out.println(currentScmMaterials);
        final Set<MaterialConfig> scmMaterialsInRev = new HashSet<>();
        for (ReportingFaninScmMaterial scmMaterial : scmMaterials) {
            final MaterialConfig scm = context.fingerprintScmMaterialMap.get(scmMaterial.fingerprint);
            scmMaterialsInRev.add(scm);
        }
        context.out.println("----");
        context.out.println("SCM Materials in Latest Revision:");
        context.out.println(scmMaterialsInRev);
        context.out.println("----");
        context.out.println("Latest Revision of Material:");
        context.out.println(stageIdentifierScmPair.first());
        context.out.println("----");
    }

    private void validateIfRevisionMatchesTheCurrentConfig(ReportingFanInGraphContext context, Pair<StageIdentifier, List<ReportingFaninScmMaterial>> stageIdentifierScmPair) {
        if (stageIdentifierScmPair == null) {
            return;
        }

        final Set<MaterialConfig> currentScmMaterials = context.pipelineScmDepMap.get(materialConfig);
        final List<ReportingFaninScmMaterial> scmMaterials = stageIdentifierScmPair.last();

        printCurrentAndOldSCMs(context, currentScmMaterials, scmMaterials, stageIdentifierScmPair);

        final List<ReportingFaninScmMaterial> setOfRevisions = new ArrayList<>();
        for (final ReportingFaninScmMaterial scmMaterial : scmMaterials) {
            ReportingFaninScmMaterial mat = IterableUtils.find(setOfRevisions, mat1 -> {
                if (mat1 == null) {
                    return false;
                }
                return scmMaterial.fingerprint.equals(mat1.fingerprint)
                        && scmMaterial.revision.equals(mat1.revision);
            });
            if (mat == null) {
                setOfRevisions.add(scmMaterial);
            }
        }

        context.out.println("SCM Revisions of Latest Revision of Material:");
        context.out.println(setOfRevisions);
    }

    private Pair<StageIdentifier, List<ReportingFaninScmMaterial>> getRevisionNthFor(int n, ReportingFanInGraphContext context) {
        List<ReportingFaninScmMaterial> scmMaterials = new ArrayList<>();
        PipelineTimeline pipelineTimeline = context.pipelineTimeline;
        Queue<PipelineTimelineEntry.Revision> revisionQueue = new ConcurrentLinkedQueue<>();
        DependencyMaterialConfig dependencyMaterial = (DependencyMaterialConfig) materialConfig;
        PipelineTimelineEntry entry = pipelineTimeline.instanceFor(dependencyMaterial.getPipelineName(), totalInstanceCount - n);

        StageIdentifier dependentStageIdentifier = dependentStageIdentifier(context, entry, CaseInsensitiveString.str(dependencyMaterial.getStageName()));
        if (!StageIdentifier.NULL.equals(dependentStageIdentifier)) {
            addToRevisionQueue(entry, revisionQueue, scmMaterials, context);
        } else {
            return null;
        }
        while (!revisionQueue.isEmpty()) {
            PipelineTimelineEntry.Revision revision = revisionQueue.poll();
            DependencyMaterialRevision dmr = DependencyMaterialRevision.create(revision.revision, null);
            PipelineTimelineEntry pte = pipelineTimeline.getEntryFor(new CaseInsensitiveString(dmr.getPipelineName()), dmr.getPipelineCounter());
            addToRevisionQueue(pte, revisionQueue, scmMaterials, context);
        }

        return new Pair<>(dependentStageIdentifier, scmMaterials);
    }

    private boolean validateAllScmRevisionsAreSameWithinAFingerprint(Pair<StageIdentifier, List<ReportingFaninScmMaterial>> pIdScmPair) {
        if (pIdScmPair == null) {
            return false;
        }
        List<ReportingFaninScmMaterial> scmMaterialList = pIdScmPair.last();
        for (final ReportingFaninScmMaterial scmMaterial : scmMaterialList) {
            Collection<ReportingFaninScmMaterial> scmMaterialOfSameFingerprint = CollectionUtils.select(scmMaterialList, scmMaterial::equals);

            for (ReportingFaninScmMaterial faninScmMaterial : scmMaterialOfSameFingerprint) {
                if (!faninScmMaterial.revision.equals(scmMaterial.revision)) {
                    return false;
                }
            }
        }
        return true;
    }

    private StageIdentifier dependentStageIdentifier(ReportingFanInGraphContext context, PipelineTimelineEntry entry, final String stageName) {
        return context.pipelineDao.latestPassedStageIdentifier(entry.getId(), stageName);
    }

    private void addToRevisionQueue(PipelineTimelineEntry entry, Queue<PipelineTimelineEntry.Revision> revisionQueue, List<ReportingFaninScmMaterial> scmMaterials,
                                    ReportingFanInGraphContext context) {
        printPipelineTimelineEntry(entry, context);

        for (Map.Entry<String, List<PipelineTimelineEntry.Revision>> revisionList : entry.revisions().entrySet()) {
            String fingerprint = revisionList.getKey();
            PipelineTimelineEntry.Revision revision = revisionList.getValue().get(0);
            if (isScmMaterial(fingerprint, context)) {
                scmMaterials.add(new ReportingFaninScmMaterial(fingerprint, revision));
                continue;
            }

            if (isDependencyMaterial(fingerprint, context)) {
                revisionQueue.add(revision);
            }
        }
    }

    private void printPipelineTimelineEntry(PipelineTimelineEntry entry, ReportingFanInGraphContext context) {
        context.out.println(
                "Pipeline-Timeline-Entry: Id: " + entry.getId() + ", Pipeline-Name: " + entry.getPipelineName() + ", Counter: " + entry.getCounter() + ", Natural-Order: " + entry.naturalOrder());
        Iterator it = entry.revisions().entrySet().iterator();
        while (it.hasNext()) {
            Map.Entry<String, List<PipelineTimelineEntry.Revision>> pairs = (Map.Entry) it.next();
            context.out.println("Flyweight: " + pairs.getKey() + " - " + pairs.getValue());
        }
        context.out.println("***");
    }

    private boolean isDependencyMaterial(String fingerprint, ReportingFanInGraphContext context) {
        return context.fingerprintDepMaterialMap.containsKey(fingerprint);
    }

    private boolean isScmMaterial(String fingerprint, ReportingFanInGraphContext context) {
        return context.fingerprintScmMaterialMap.containsKey(fingerprint);
    }

    private boolean hasMoreInstances() {
        return currentCount < totalInstanceCount;
    }

    enum RevisionAlteration {
        NOT_APPLICABLE, SAME_AS_CURRENT_REVISION, ALTERED_TO_CORRECT_REVISION, ALL_OPTIONS_EXHAUSTED,
        NEED_MORE_REVISIONS
    }

    static {
        DEPENDENCY_NODE_TYPES.add(DependencyMaterialConfig.class);
    }
}


text:
set(SQLITE3_FOUND false)

find_path(SQLITE3_INCLUDE_DIRS
	NAMES
		sqlite3.h
	PATHS
		/usr/include
		/usr/local/include
		/opt/local/include
		/sw/include
)

find_library(SQLITE3_LIBRARIES
	NAMES
		sqlite3
	PATH_SUFFIXES
		lib64
		lib
	PATHS
		/usr/lib
		/usr/local/lib
		/opt/local/lib
		/sw/lib
		/usr/lib/x86_64-linux-gnu
)

if (SQLITE3_INCLUDE_DIRS AND SQLITE3_LIBRARIES)
	set(SQLITE3_FOUND TRUE)
	#these next two are needed by the CocosBuildHelpers cocos_find_package macro
	set(SQLITE3_INCLUDE_DIR ${SQLITE3_INCLUDE_DIRs})
	set(SQLITE3_LIBRARY ${SQLITE3_LIBRARIES})
endif (SQLITE3_INCLUDE_DIRS AND SQLITE3_LIBRARIES)

if (NOT SQLITE3_FOUND)
	message(FATAL_ERROR "Could not find Sqlite3")
endif (NOT SQLITE3_FOUND)

mark_as_advanced(SQLITE3_INCLUDE_DIRS SQLITE3_LIBRARIES)


text:
layout: page
title: Silicon Air Show
date: 2016-05-24
author: Ronald Luna
tags: weekly links, java
status: published
summary: Nulla egestas, quam ac congue.
banner: images/banner/wedding.jpg
booking:
  startDate: 06/07/2018
  endDate: 06/11/2018
  ctyhocn: GLHMSHX
  groupCode: SAS
published: true
---
Vivamus at magna lobortis magna egestas porta at vel odio. Duis tempor turpis mi, auctor venenatis tellus sollicitudin semper. Nunc elit turpis, iaculis et viverra quis, feugiat ut justo. Quisque sit amet rutrum diam. Proin fringilla augue felis, ut aliquet libero feugiat et. Praesent scelerisque lorem eget efficitur vestibulum. Nullam urna mi, condimentum eget sagittis quis, porta sit amet ex. Duis id interdum leo. In dictum, dolor eget eleifend sodales, turpis lorem placerat turpis, sit amet cursus odio lectus id tortor. Donec nisl nisl, vulputate consectetur accumsan quis, suscipit sit amet felis. Pellentesque auctor dignissim nibh eu blandit. Ut vitae sodales nibh, eget facilisis nisi. Quisque non ipsum nulla. Nunc id ornare massa, sit amet cursus odio. Proin porta tellus lacus, vitae consequat neque pharetra quis. Vestibulum posuere eu ligula nec consequat.

* Nulla quis justo vel enim elementum pulvinar ut at dolor
* Integer tempus eros nec ligula tristique dapibus at eget enim
* Morbi ac erat ac lorem egestas efficitur et ac lectus
* Aenean sed nisl non elit dictum viverra non nec urna
* Phasellus ornare odio in libero tristique, ut vestibulum libero mollis.

Mauris lectus libero, posuere eget pulvinar nec, sollicitudin quis massa. Suspendisse a accumsan lectus. Nullam placerat tempus condimentum. Praesent luctus porta aliquam. Nunc ornare lectus neque, sit amet lacinia mauris facilisis eget. Aenean vitae sagittis est. Sed ornare erat odio, non ornare dui euismod vel. In est tortor, tempor sit amet mattis id, cursus in erat.


text:
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.chrome.browser.feed.library.feedstore;

import com.google.protobuf.ByteString;

import org.chromium.base.supplier.Supplier;
import org.chromium.chrome.browser.feed.library.api.host.config.Configuration;
import org.chromium.chrome.browser.feed.library.api.host.logging.BasicLoggingApi;
import org.chromium.chrome.browser.feed.library.api.host.logging.InternalFeedError;
import org.chromium.chrome.browser.feed.library.api.host.logging.Task;
import org.chromium.chrome.browser.feed.library.api.host.storage.CommitResult;
import org.chromium.chrome.browser.feed.library.api.host.storage.ContentStorageDirect;
import org.chromium.chrome.browser.feed.library.api.host.storage.JournalStorageDirect;
import org.chromium.chrome.browser.feed.library.api.internal.common.PayloadWithId;
import org.chromium.chrome.browser.feed.library.api.internal.common.SemanticPropertiesWithId;
import org.chromium.chrome.browser.feed.library.api.internal.common.ThreadUtils;
import org.chromium.chrome.browser.feed.library.api.internal.lifecycle.Resettable;
import org.chromium.chrome.browser.feed.library.api.internal.store.ContentMutation;
import org.chromium.chrome.browser.feed.library.api.internal.store.LocalActionMutation;
import org.chromium.chrome.browser.feed.library.api.internal.store.SemanticPropertiesMutation;
import org.chromium.chrome.browser.feed.library.api.internal.store.SessionMutation;
import org.chromium.chrome.browser.feed.library.api.internal.store.Store;
import org.chromium.chrome.browser.feed.library.api.internal.store.StoreListener;
import org.chromium.chrome.browser.feed.library.api.internal.store.UploadableActionMutation;
import org.chromium.chrome.browser.feed.library.common.Result;
import org.chromium.chrome.browser.feed.library.common.concurrent.MainThreadRunner;
import org.chromium.chrome.browser.feed.library.common.concurrent.TaskQueue;
import org.chromium.chrome.browser.feed.library.common.concurrent.TaskQueue.TaskType;
import org.chromium.chrome.browser.feed.library.common.feedobservable.FeedObservable;
import org.chromium.chrome.browser.feed.library.common.logging.Logger;
import org.chromium.chrome.browser.feed.library.common.protoextensions.FeedExtensionRegistry;
import org.chromium.chrome.browser.feed.library.common.time.Clock;
import org.chromium.chrome.browser.feed.library.common.time.TimingUtils;
import org.chromium.chrome.browser.feed.library.common.time.TimingUtils.ElapsedTimeTracker;
import org.chromium.chrome.browser.feed.library.feedapplifecyclelistener.FeedLifecycleListener;
import org.chromium.chrome.browser.feed.library.feedstore.internal.ClearableStore;
import org.chromium.chrome.browser.feed.library.feedstore.internal.EphemeralFeedStore;
import org.chromium.chrome.browser.feed.library.feedstore.internal.FeedStoreHelper;
import org.chromium.chrome.browser.feed.library.feedstore.internal.PersistentFeedStore;
import org.chromium.components.feed.core.proto.libraries.api.internal.StreamDataProto.StreamLocalAction;
import org.chromium.components.feed.core.proto.libraries.api.internal.StreamDataProto.StreamSharedState;
import org.chromium.components.feed.core.proto.libraries.api.internal.StreamDataProto.StreamStructure;
import org.chromium.components.feed.core.proto.libraries.api.internal.StreamDataProto.StreamUploadableAction;

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

/**
 * {@link Store} implementation that delegates between {@link PersistentFeedStore} and {@link
 * EphemeralFeedStore}.
 *
 * <p>TODO: We need to design the StoreListener support correctly. For the switch to
 * ephemeral mode, the Observers are called from here. If we ever have events which are raised by
 * one of the delegates, we need to make sure the registered observers are called correctly,
 * independent of what delegate is actually running. The delegates currently throw a
 * IllegalStateException if the register/unregister methods are called.
 */
public class FeedStore
        extends FeedObservable<StoreListener> implements Store, Resettable, FeedLifecycleListener {
    private static final String TAG = "FeedStore";

    // Permanent reference to the persistent store (used for setting off cleanup)
    private final PersistentFeedStore mPersistentStore;
    private final MainThreadRunner mMainThreadRunner;
    // The current store
    private ClearableStore mDelegate;

    private final TaskQueue mTaskQueue;

    // Needed for switching to ephemeral mode
    private final FeedStoreHelper mStoreHelper = new FeedStoreHelper();
    private final BasicLoggingApi mBasicLoggingApi;
    private final Clock mClock;
    private final TimingUtils mTimingUtils;
    private final ThreadUtils mThreadUtils;

    private boolean mIsEphemeralMode;

    protected final ContentStorageDirect mContentStorage;
    protected final JournalStorageDirect mJournalStorage;

    public FeedStore(Configuration configuration, TimingUtils timingUtils,
            FeedExtensionRegistry extensionRegistry, ContentStorageDirect contentStorage,
            JournalStorageDirect journalStorage, ThreadUtils threadUtils, TaskQueue taskQueue,
            Clock clock, BasicLoggingApi basicLoggingApi, MainThreadRunner mainThreadRunner) {
        this.mTaskQueue = taskQueue;
        this.mClock = clock;
        this.mTimingUtils = timingUtils;
        this.mThreadUtils = threadUtils;
        this.mBasicLoggingApi = basicLoggingApi;
        this.mMainThreadRunner = mainThreadRunner;
        this.mContentStorage = contentStorage;
        this.mJournalStorage = journalStorage;

        this.mPersistentStore = new PersistentFeedStore(configuration, this.mTimingUtils,
                extensionRegistry, contentStorage, journalStorage, this.mTaskQueue, threadUtils,
                this.mClock, this.mStoreHelper, basicLoggingApi, mainThreadRunner);
        mDelegate = mPersistentStore;
    }

    @Override
    public Result<List<PayloadWithId>> getPayloads(List<String> contentIds) {
        return mDelegate.getPayloads(contentIds);
    }

    @Override
    public Result<List<StreamSharedState>> getSharedStates() {
        return mDelegate.getSharedStates();
    }

    @Override
    public Result<List<StreamStructure>> getStreamStructures(String sessionId) {
        return mDelegate.getStreamStructures(sessionId);
    }

    @Override
    public Result<List<String>> getAllSessions() {
        return mDelegate.getAllSessions();
    }

    @Override
    public Result<List<SemanticPropertiesWithId>> getSemanticProperties(List<String> contentIds) {
        return mDelegate.getSemanticProperties(contentIds);
    }

    @Override
    public Result<List<StreamLocalAction>> getAllDismissLocalActions() {
        return mDelegate.getAllDismissLocalActions();
    }

    @Override
    public Result<Set<StreamUploadableAction>> getAllUploadableActions() {
        return mDelegate.getAllUploadableActions();
    }

    @Override
    public Result<String> createNewSession() {
        return mDelegate.createNewSession();
    }

    @Override
    public void removeSession(String sessionId) {
        mDelegate.removeSession(sessionId);
    }

    @Override
    public void clearHead() {
        mDelegate.clearHead();
    }

    @Override
    public ContentMutation editContent() {
        return mDelegate.editContent();
    }

    @Override
    public SessionMutation editSession(String sessionId) {
        return mDelegate.editSession(sessionId);
    }

    @Override
    public SemanticPropertiesMutation editSemanticProperties() {
        return mDelegate.editSemanticProperties();
    }

    @Override
    public LocalActionMutation editLocalActions() {
        return mDelegate.editLocalActions();
    }

    @Override
    public UploadableActionMutation editUploadableActions() {
        return mDelegate.editUploadableActions();
    }

    @Override
    public Runnable triggerContentGc(Set<String> reservedContentIds,
            Supplier<Set<String>> accessibleContent, boolean keepSharedStates) {
        return mDelegate.triggerContentGc(reservedContentIds, accessibleContent, keepSharedStates);
    }

    @Override
    public Runnable triggerLocalActionGc(
            List<StreamLocalAction> actions, List<String> validContentIds) {
        return mDelegate.triggerLocalActionGc(actions, validContentIds);
    }

    @Override
    public boolean isEphemeralMode() {
        return mIsEphemeralMode;
    }

    @Override
    public void switchToEphemeralMode() {
        // This should be called on a background thread because it's called during error handling.
        mThreadUtils.checkNotMainThread();
        if (!mIsEphemeralMode) {
            mPersistentStore.switchToEphemeralMode();
            mDelegate = new EphemeralFeedStore(mClock, mTimingUtils, mStoreHelper);

            mTaskQueue.execute(Task.CLEAR_PERSISTENT_STORE_TASK, TaskType.BACKGROUND, () -> {
                ElapsedTimeTracker tracker = mTimingUtils.getElapsedTimeTracker(TAG);
                // Try to just wipe content + sessions
                boolean clearSuccess = mPersistentStore.clearNonActionContent();
                // If that fails, wipe everything.
                if (!clearSuccess) {
                    mPersistentStore.clearAll();
                }
                tracker.stop("clearPersistentStore", "completed");
            });

            mIsEphemeralMode = true;
            synchronized (mObservers) {
                for (StoreListener listener : mObservers) {
                    listener.onSwitchToEphemeralMode();
                }
            }
            mMainThreadRunner.execute("log ephemeral switch",
                    () -> mBasicLoggingApi.onInternalError(InternalFeedError.SWITCH_TO_EPHEMERAL));
        }
    }

    @Override
    public void reset() {
        mPersistentStore.clearNonActionContent();
    }

    @Override
    public void onLifecycleEvent(@LifecycleEvent String event) {
        if (LifecycleEvent.ENTER_BACKGROUND.equals(event) && mIsEphemeralMode) {
            mTaskQueue.execute(
                    Task.DUMP_EPHEMERAL_ACTIONS, TaskType.BACKGROUND, this::dumpEphemeralActions);
        }
    }

    private void dumpEphemeralActions() {
        // Get all action-related content (actions + semantic data)
        Result<List<StreamLocalAction>> dismissActionsResult =
                mDelegate.getAllDismissLocalActions();
        if (!dismissActionsResult.isSuccessful()) {
            Logger.e(TAG, "Error retrieving actions when trying to dump ephemeral actions.");
            return;
        }
        List<StreamLocalAction> dismissActions = dismissActionsResult.getValue();
        LocalActionMutation localActionMutation = mPersistentStore.editLocalActions();
        List<String> dismissActionContentIds = new ArrayList<>(dismissActions.size());
        for (StreamLocalAction dismiss : dismissActions) {
            dismissActionContentIds.add(dismiss.getFeatureContentId());
            localActionMutation.add(dismiss.getAction(), dismiss.getFeatureContentId());
        }
        Result<List<SemanticPropertiesWithId>> semanticPropertiesResult =
                mDelegate.getSemanticProperties(dismissActionContentIds);
        if (!semanticPropertiesResult.isSuccessful()) {
            Logger.e(TAG,
                    "Error retrieving semantic properties when trying to dump ephemeral actions.");
            return;
        }
        SemanticPropertiesMutation semanticPropertiesMutation =
                mPersistentStore.editSemanticProperties();
        for (SemanticPropertiesWithId semanticProperties : semanticPropertiesResult.getValue()) {
            semanticPropertiesMutation.add(semanticProperties.contentId,
                    ByteString.copyFrom(semanticProperties.semanticData));
        }

        // Attempt to write action-related content to persistent storage
        CommitResult commitResult = localActionMutation.commit();
        if (commitResult != CommitResult.SUCCESS) {
            Logger.e(TAG,
                    "Error writing actions to persistent store when dumping ephemeral actions.");
            return;
        }
        commitResult = semanticPropertiesMutation.commit();
        if (commitResult != CommitResult.SUCCESS) {
            Logger.e(TAG,
                    "Error writing semantic properties to persistent store when dumping"
                            + " ephemeral actions.");
        }
    }
}


text:
package ilargia.entitas.api.system;

public interface IInitializeSystem extends ISystem {
    void initialize();
}


text:
package org.apache.storm.benchmark.util;

import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import java.io.File;
import java.io.PrintWriter;

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

public class FileUtilsTest {

    private static final String PARENT = "./test/";
    private static final String PATH = PARENT + "file.txt";
    private static File dir;
    private static File file;
    private static PrintWriter writer;

    @BeforeMethod
    public void setUp() {
        dir = new File(PARENT);
        file = new File(PATH);
        assertThat(dir).doesNotExist();
        assertThat(file).doesNotExist();
    }

    @AfterMethod
    public void cleanUp() {
        writer.close();
        file.delete();
        assertThat(file).doesNotExist();
        dir.delete();
        assertThat(dir).doesNotExist();
    }

    @Test
    public void testFileCreateWhenParentDoesNotExist() {
        writer = FileUtils.createFileWriter(PARENT, PATH);
        assertThat(writer).isNotNull();
        assertThat(dir).exists();
        assertThat(file).exists();
    }

    @Test
    public void testFileCreateWhenParentExists() {
        dir.mkdirs();
        assertThat(dir).exists();
        writer = FileUtils.createFileWriter(PARENT, PATH);
        assertThat(writer).isNotNull();
        assertThat(file).exists();
    }

}


text:
By the Cake

Enjoy our awesome cakes

        Home

                Our Cakes

                Our Stores

        My Profile

        Add Cake

        Browse Cakes

        My Orders

        About Us

    Home

Our cakes

Cake is a form of sweet dessert that is typically baked. In its oldest forms, cakes were modifications of breads, but cakes now cover a wide range of preparations that can be simple or elaborate, and that share features with other desserts such as pastries, meringues, custards, and pies.

Our Stores

Our stores are located in 21 cities all over the world. Come and see what we have for you.

City: Hong Kong             City: Salzburg
Address: ChoCoLad 18        Address: SchokoLeiden 73
Phone: +78952804429	    Phone: +49241432990


text:
package org.apache.myfaces.trinidadinternal.style;

import java.io.Serializable;
import java.util.Map;
import java.util.Iterator;

import org.apache.myfaces.trinidad.util.ArrayMap;

/**
 * Base class for Style implementations
 * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/style/BaseStyle.java#0 $) $Date: 10-nov-2005.18:57:54 $
 */
abstract public class BaseStyle implements Style, Serializable
{
  /**
   * Creates an empty BaseStyle.
   */
  public BaseStyle()
  {
  }

  /**
   * Creates a BaseStyle with the specified properties
   *
   * @param properties The properties of this style.  The
   *   values must be Strings.
   */
  public BaseStyle(Map<String, String> properties)
  {
    if ((properties != null) && (properties.size() > 0))
    {
      // Initialize the properties array
      int length = properties.size() * 2;
      _properties = new String[length];

      int i = 0;
      for(Map.Entry<String, String> entry : properties.entrySet())
      {
        String key   = entry.getKey();
        String value = entry.getValue();

        // -= Simon Lessard =-
        // FIXME: If key is ever null, NullPointerException will occurs
        _properties[i*2]   = key.toLowerCase();
        _properties[i*2+1] = value;
        i++;
      }
    }
  }

  /**
   * Creates a BaseStyle from an arbitrary Style object.
   */
  public BaseStyle(Style style)
  {
    if ( style != null)
    {

      // First, loop through to get the property count
      int propertyCount = 0;
      Iterator<Object> e = style.getPropertyNames();
      while (e.hasNext())
      {
        e.next();
        propertyCount++;
      }

      if (propertyCount == 0)
        return;

      // Initialize the properties array
      Object properties[] = new Object[propertyCount * 2];

      // Now, loop through to initialize the properties
      int i = 0;
      Iterator<Object> names = style.getPropertyNames();
      while (names.hasNext())
      {
        String name = (String)names.next();
        String value = style.getProperty(name);

        properties[i*2] = name.toLowerCase();
        properties[i*2+1] = value;

        i++;
      }

      _properties = properties;
    }
  }

  /**
   * Returns the names of the properties defined by this style.
   * <p>
   * The property names can be any valid property name.
   */
  public Iterator<Object> getPropertyNames()
  {
    return ArrayMap.getKeys(_properties);
  }

  /**
   * Returns the value of the property with the specified name.
   *
   * @param name The property name for the property to return
   */
  public String getProperty(String name)
  {
    return (String)ArrayMap.get(_properties, name.toLowerCase());
  }

  /**
   * Returns a parsed Java object corresponding to the specified
   * property key.
   */
  public Object getParsedProperty(ParsedPropertyKey key)
    throws PropertyParseException
  {
    Object value = null;

    // For better or worse, we assume that the key is a ParsedPropertyKey.
    // This isn't part of the public API, but we are in cahoots with the
    // Style interface.  Any other type of key is going to cause a
    // ClassCastException.  Note - we could just make Style.getParsedProperty
    // take a ParsedPropertyKey instead of an Object, but I'm not convinced
    // that the ParsedPropertyKey is the way to go just yet.
    int index = key.getKeyIndex();

    if (_parsedProperties != null)
    {
      value = _parsedProperties[index];

      if (value != null)
      {
        if (value == _NULL_VALUE)
          value = null;

        return value;
      }
    }
    else
    {
      // Just allocate the parsed properties array now, we're going to
      // write to it no matter what at this point
      synchronized (this)
      {
         if (_parsedProperties == null)
           _parsedProperties = new Object[_PARSED_PROPERTIES_COUNT];
      }
    }

    // If we don't have a parsed property value already, try to get it.
    try
    {
      value = parseProperty(key);
    }
    catch (PropertyParseException e)
    {
      _parsedProperties[index] = _NULL_VALUE;
      throw e;
    }

    _parsedProperties[index] = (value == null) ? _NULL_VALUE : value;

    return value;
  }

  /**
   * Sets the specified property value.
   */
  public void setProperty(String name, String value)
  {
    // We store all names/values as lowercase string
    name = name.toLowerCase();

    synchronized (this)
    {
      _properties = ArrayMap.remove(_properties, name);

      if (value != null)
        _properties = ArrayMap.put(_properties, name, value);

      // We need to reset to parsed properties if our properties change
      // Really, we could just null out the corresponding parsed property
      // value, but what the heck.
      _parsedProperties = null;
    }
  }

  /**
   * Converts the style to a String suitable for use as an inline style
   * attribute value.
   */
  abstract public String toInlineString();

  /**
   * Parses the property for the specified key.
   * Subclasses should implement this method to perform style sheet
   * language-specific parsing.
   */
  abstract protected Object parseProperty(Object key)
    throws PropertyParseException;

  private Object[] _properties;
  transient private Object[] _parsedProperties;

  // Count of parsed properties defined by Style
  private static final int _PARSED_PROPERTIES_COUNT = 7;

  // Null value used to indicate that the property has been parsed, but
  // was either invalid or null.  We use this placeholder to avoid re-parsing
  // invalid or null values.
  private static final Object _NULL_VALUE = new Object();
}


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="http://v3.bootcss.com/favicon.ico">

    <title>Product view</title>

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

    <link href="/bootstrap/jumbotron-narrow.css" rel="stylesheet">

Order:<?php echo $detail['idorder'];?>

This order is available for confirm

<?php echo $existedproduct['name'];?>

This current inventory of this product is <?php echo $existedproduct['current'];?>

      <a class="btn btn-primary" href="<?php echo site_url('ordercontrol/confirmorder');?>/<?php echo $detail['idorder'];?>" role="button">Confirm

© 2015 FYP SCM


text:
#include "../interfaces/IUncopyable.h"
#include "../CDefaultUser.h"

#include <string>

class CFCGIRequest;

class CSessionManager : public IUncopyable
{
	public:
		typedef CDefaultUser* (*factoryFuncPtr)();
		factoryFuncPtr userCreationFunc;

		virtual bool checkSession(CFCGIRequest* currRequest);

        virtual void logoutUser(CFCGIRequest* currRequest);
		virtual void loginUser(CFCGIRequest* currRequest, const std::string& login, const std::string& pass);
		virtual void registerUser(CFCGIRequest* currRequest, const std::string& login, const std::string& pass);

		bool getIsNeedSessionCheck() const;
		void setIsNeedSessionCheck(const bool value);

		template<typename Type>	void setUserType()
		{
			userCreationFunc = &CDefaultUser::createUser<Type>;
		}

		CSessionManager();
		virtual ~CSessionManager();
	protected:
		bool isNeedSessionCheck;
	private:
};

#endif // CSESSIONMANAGER_H


text:
<?php
	class Category {
		public static function find_all() {

			$query = "SELECT * FROM xbt_categories ORDER BY cid ASC";

			if($results = DB::query($query)) {
				$categories = array();
				while($result = mysql_fetch_array($results)) {
					$category = new Category($result);
					array_push($categories, $category);
				}
				return $categories;
			} else {
				return false;
			}
		}

		public static function find($params = array('cid' => null, 'name' => null, 'slug' => null)) {

			if($params['cid']) {
				$query = "SELECT * FROM xbt_categories WHERE cid = " . DB::escape($params['cid']);
			} elseif($params['name']) {
				$query = "SELECT * FROM xbt_categories WHERE name = '" . DB::escape($params['name'])."'";
			} elseif($params['slug']) {
				$query = "SELECT * FROM xbt_categories WHERE slug = '" . DB::escape($params['slug'])."'";
			} else {
				return false;
			}

			if($results = DB::query($query) and $result = mysql_fetch_array($results)) {
				return new Category($result);
			} else {
				return false;
			}
		}

		public $cid = null;
		public $name = null;
		public $slug = null;

		function __construct($params) {
			$this->cid = $params['cid'];
			$this->name = $params['name'];
			$this->slug = $params['slug'];
		}
	}
?>


text:
"""Functions to read text morphotactic model files."""

import collections
import itertools
from typing import Dict, List, Tuple

_RuleDefinition = List[str]

def _whitespace_trimmed(line: str) -> str:
  """Strips any leading and trailing whitespace off from the line."""
  return line.lstrip().rstrip()

def _empty(line: str) -> bool:
  """Returns True if line is empty (or only contains whitespace)."""
  return not line or line.isspace()

def _comment(line: str) -> bool:
  """Returns True if line is a comment line (starts with '#')."""
  return line.startswith("#")

def _rule(line: str) -> bool:
  """Returns True if the line defines an FST rule."""
  return not (_empty(line) or _comment(line))

def read_rule_definitions(path: str) -> Dict[int, _RuleDefinition]:
  """Reads morphotactics FST rule definitions from the path.

  Args:
    path: path to a text file which contains the definition of rewrite rules of
        morphotactics FST.

  Raises:
    IOError: morphotactics FST rule definitions cannot be read from the 'path'.

  Returns:
    Morphotactics FST rule definitions as a dictionary. Keys are indices of the
    lines of the source file, values are the list of whitespace tokenized tokens
    of each line. Content for lines those that are empty, only include comments,
    or only composed of whitespace characters are pruned and rule definitions
    are sorted by increasing line index. Returns an empty dictionary, if
    the text file does not contain any rule definitions.
  """
  with open(path, "r", encoding="utf-8") as reader:
    lines = reader.readlines()

  def _index_and_entry(index: int, line: str) -> Tuple[int, _RuleDefinition]:
    return index + 1, _whitespace_trimmed(line).split()

  rules = ((i, l) for i, l in enumerate(lines) if _rule(l))
  return collections.OrderedDict(itertools.starmap(_index_and_entry, rules))


text:
namespace nd4j {
    namespace graph {
        template<typename T>
        Nd4jStatus LogicExpose<T>::processNode(Graph<T> *graph, Node<T> *node) {
            // do we really want this?
            return ND4J_STATUS_OK;
        }

        template class ND4J_EXPORT LogicExpose<float>;
        template class ND4J_EXPORT LogicExpose<float16>;
        template class ND4J_EXPORT LogicExpose<double>;
    }
}


text:
package com.markzhai.lyrichere.ui;

import android.media.browse.MediaBrowser;

/**
 * Provides media content offered by a link MediaBrowserService.
 * <p/>
 * Created by markzhai on 2015/3/19.
 */
public interface MediaBrowserProvider {
    MediaBrowser getMediaBrowser();
}


text:
function(ProcessorCount var)
  # Unknown:
  set(count 0)

  if(WIN32)
    # Windows:
    set(count "$ENV{NUMBER_OF_PROCESSORS}")
    #message("ProcessorCount: WIN32, trying environment variable")
  endif()

  if(NOT count)
    # Mac, FreeBSD, OpenBSD (systems with sysctl):
    find_program(ProcessorCount_cmd_sysctl sysctl
      PATHS /usr/sbin /sbin)
    mark_as_advanced(ProcessorCount_cmd_sysctl)
    if(ProcessorCount_cmd_sysctl)
      execute_process(COMMAND ${ProcessorCount_cmd_sysctl} -n hw.ncpu
        ERROR_QUIET
        OUTPUT_STRIP_TRAILING_WHITESPACE
        OUTPUT_VARIABLE count)
      #message("ProcessorCount: trying sysctl '${ProcessorCount_cmd_sysctl}'")
    endif()
  endif()

  if(NOT count)
    # Linux (systems with getconf):
    find_program(ProcessorCount_cmd_getconf getconf)
    mark_as_advanced(ProcessorCount_cmd_getconf)
    if(ProcessorCount_cmd_getconf)
      execute_process(COMMAND ${ProcessorCount_cmd_getconf} _NPROCESSORS_ONLN
        ERROR_QUIET
        OUTPUT_STRIP_TRAILING_WHITESPACE
        OUTPUT_VARIABLE count)
      #message("ProcessorCount: trying getconf '${ProcessorCount_cmd_getconf}'")
    endif()
  endif()

  if(NOT count)
    # HPUX (systems with machinfo):
    find_program(ProcessorCount_cmd_machinfo machinfo
      PATHS /usr/contrib/bin)
    mark_as_advanced(ProcessorCount_cmd_machinfo)
    if(ProcessorCount_cmd_machinfo)
      execute_process(COMMAND ${ProcessorCount_cmd_machinfo}
        ERROR_QUIET
        OUTPUT_STRIP_TRAILING_WHITESPACE
        OUTPUT_VARIABLE machinfo_output)
      string(REGEX MATCHALL "Number of CPUs = ([0-9]+)" procs "${machinfo_output}")
      set(count "${CMAKE_MATCH_1}")
      #message("ProcessorCount: trying machinfo '${ProcessorCount_cmd_machinfo}'")
    endif()
  endif()

  if(NOT count)
    # IRIX (systems with hinv):
    find_program(ProcessorCount_cmd_hinv hinv
      PATHS /sbin)
    mark_as_advanced(ProcessorCount_cmd_hinv)
    if(ProcessorCount_cmd_hinv)
      execute_process(COMMAND ${ProcessorCount_cmd_hinv}
        ERROR_QUIET
        OUTPUT_STRIP_TRAILING_WHITESPACE
        OUTPUT_VARIABLE hinv_output)
      string(REGEX MATCHALL "([0-9]+) .* Processors" procs "${hinv_output}")
      set(count "${CMAKE_MATCH_1}")
      #message("ProcessorCount: trying hinv '${ProcessorCount_cmd_hinv}'")
    endif()
  endif()

  if(NOT count)
    # AIX (systems with lsconf):
    find_program(ProcessorCount_cmd_lsconf lsconf
      PATHS /usr/sbin)
    mark_as_advanced(ProcessorCount_cmd_lsconf)
    if(ProcessorCount_cmd_lsconf)
      execute_process(COMMAND ${ProcessorCount_cmd_lsconf}
        ERROR_QUIET
        OUTPUT_STRIP_TRAILING_WHITESPACE
        OUTPUT_VARIABLE lsconf_output)
      string(REGEX MATCHALL "Number Of Processors: ([0-9]+)" procs "${lsconf_output}")
      set(count "${CMAKE_MATCH_1}")
      #message("ProcessorCount: trying lsconf '${ProcessorCount_cmd_lsconf}'")
    endif()
  endif()

  if(NOT count)
    # QNX (systems with pidin):
    find_program(ProcessorCount_cmd_pidin pidin)
    mark_as_advanced(ProcessorCount_cmd_pidin)
    if(ProcessorCount_cmd_pidin)
      execute_process(COMMAND ${ProcessorCount_cmd_pidin} info
        ERROR_QUIET
        OUTPUT_STRIP_TRAILING_WHITESPACE
        OUTPUT_VARIABLE pidin_output)
      string(REGEX MATCHALL "Processor[0-9]+: " procs "${pidin_output}")
      list(LENGTH procs count)
      #message("ProcessorCount: trying pidin '${ProcessorCount_cmd_pidin}'")
    endif()
  endif()

  if(NOT count)
    # Sun (systems where uname -X emits "NumCPU" in its output):
    find_program(ProcessorCount_cmd_uname uname)
    mark_as_advanced(ProcessorCount_cmd_uname)
    if(ProcessorCount_cmd_uname)
      execute_process(COMMAND ${ProcessorCount_cmd_uname} -X
        ERROR_QUIET
        OUTPUT_STRIP_TRAILING_WHITESPACE
        OUTPUT_VARIABLE uname_X_output)
      string(REGEX MATCHALL "NumCPU = ([0-9]+)" procs "${uname_X_output}")
      set(count "${CMAKE_MATCH_1}")
      #message("ProcessorCount: trying uname -X '${ProcessorCount_cmd_uname}'")
    endif()
  endif()

  # Execute this code when all previously attempted methods return empty
  # output:
  #
  if(NOT count)
    # Systems with /proc/cpuinfo:
    set(cpuinfo_file /proc/cpuinfo)
    if(EXISTS "${cpuinfo_file}")
      file(STRINGS "${cpuinfo_file}" procs REGEX "^processor.: [0-9]+$")
      list(LENGTH procs count)
      #message("ProcessorCount: trying cpuinfo '${cpuinfo_file}'")
    endif()
  endif()

  if(NOT count)
    # Haiku
    find_program(ProcessorCount_cmd_sysinfo sysinfo)
    if(ProcessorCount_cmd_sysinfo)
      execute_process(COMMAND ${ProcessorCount_cmd_sysinfo}
        ERROR_QUIET
        OUTPUT_STRIP_TRAILING_WHITESPACE
        OUTPUT_VARIABLE sysinfo_X_output)
      string(REGEX MATCHALL "\nCPU #[0-9]+:" procs "\n${sysinfo_X_output}")
      list(LENGTH procs count)
      #message("ProcessorCount: trying sysinfo '${ProcessorCount_cmd_sysinfo}'")
    endif()
  endif()

  # Since cygwin builds of CMake do not define WIN32 anymore, but they still
  # run on Windows, and will still have this env var defined:
  #
  if(NOT count)
    set(count "$ENV{NUMBER_OF_PROCESSORS}")
    #message("ProcessorCount: last fallback, trying environment variable")
  endif()

  # Ensure an integer return (avoid inadvertently returning an empty string
  # or an error string)... If it's not a decimal integer, return 0:
  #
  if(NOT count MATCHES "^[0-9]+$")
    set(count 0)
  endif()

  set(${var} ${count} PARENT_SCOPE)
endfunction()


text:
package chj.handin2.l3_resourcesandintents.l3_app;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

public class MainActivity extends Activity {

    public final static String EXTRA_MESSAGE = "chj.handin2.13_resourcesandintents.13_app.Message";

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

        //Initiate new activity
        Intent secondActivityIntent = new Intent(this, SecondActivity.class);

        secondActivityIntent.putExtra(EXTRA_MESSAGE, "Extra message ");
        startActivity(secondActivityIntent);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {

        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

}


text:
Releases are mostly automated using
[release-it](https://github.com/release-it/release-it/) and
[lerna-changelog](https://github.com/lerna/lerna-changelog/).

## Preparation

Since the majority of the actual release process is automated, the primary
remaining task prior to releasing is confirming that all pull requests that
have been merged since the last release have been labeled with the appropriate
`lerna-changelog` labels and the titles have been updated to ensure they
represent something that would make sense to our users. Some great information
on why this is important can be found at
[keepachangelog.com](https://keepachangelog.com/en/1.0.0/), but the overall
guiding principles here is that changelogs are for humans, not machines.

When reviewing merged PR's the labels to be used are:

* breaking - Used when the PR is considered a breaking change.
* enhancement - Used when the PR adds a new feature or enhancement.
* bug - Used when the PR fixes a bug included in a previous release.
* documentation - Used when the PR adds or updates documentation.
* internal - Used for internal changes that still require a mention in the
  changelog/release notes.

## Release

Once the prep work is completed, the actual release is straight forward:

* First ensure that you have `release-it` installed globally, generally done by
  using one of the following commands:

```
# using https://volta.sh
volta install release-it

# using Yarn
yarn global add release-it

# using npm
npm install --global release-it
```

* Second, ensure that you have installed your projects dependencies:

```
# using yarn
yarn install

# using npm
npm install
```

* And last (but not least 😁) do your release. It requires a
  [GitHub personal access token](https://github.com/settings/tokens) as
  `$GITHUB_AUTH` environment variable. Only "repo" access is needed; no "admin"
  or other scopes are required.

```
export GITHUB_AUTH="f941e0..."
release-it
```

[release-it](https://github.com/release-it/release-it/) manages the actual
release process. It will prompt you through the process of choosing the version
number, tagging, pushing the tag and commits, etc.


text:
import { Group } from 'three'
import { RandomConvexPolygon } from '../../lib/mesh'
import { getRandomGrayscaleHexColor } from '../../lib/helpers'
import bind from '@dlmanning/bind'

export default class RandoPolys extends Group {
  constructor () {
    super()

    this.initialize = bind(this, this.initialize)
    this.update = bind(this, this.update)

    this.initialize()

    this.materialType = 'basic'
  }

  initialize () {
    for (let i = 0; i < 200; i++) {
      const randoPoly = new RandomConvexPolygon({
        color: getRandomGrayscaleHexColor(),
        maxHeight: 5 * Math.random() + 2,
        maxWidth: 5 * Math.random() + 2,
        maxDepth: 5 * Math.random() + 2,
        rotationX: 0.005 * Math.random(),
        rotationY: 0.005 * Math.random(),
        rotationZ: 0.005 * Math.random(),
        wireframe: true
      })

      randoPoly.position.x = Math.random() * 2 - 1
      randoPoly.position.y = Math.random() * 2 - 1
      randoPoly.position.z = Math.random() * 2 - 1
      randoPoly.position.normalize()
      randoPoly.position.multiplyScalar(Math.random() * 60 + 10)
      this.add(randoPoly)
    }
  }

  update (props) {
    const {
      time,
      spread,
      fuckFactor,
      opacity,
      specialEffect
    } = props

    this.rotation.y = 0.0002
    this.rotation.x = 0.0001
    this.rotation.y = 0.0001

    this.children.forEach((poly, i) => {
      poly.applyRotation()

      if (specialEffect && this.materialType === 'basic') {
        poly.switchToNormalMaterial()
        if (i === this.children.length - 1) {
          this.materialType = 'normal'
        }
      } else if (!specialEffect && this.materialType === 'normal') {
        poly.switchToBasicMaterial()
        if (i === this.children.length - 1) {
          this.materialType = 'basic'
        }
      }

      poly.material.opacity = opacity
      poly.material.transparent = true
    })
  }
}


text:
// Copyright 2015 Google Inc. 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.build.lib.profiler.output;

import com.google.devtools.build.lib.profiler.ProfilePhase;
import com.google.devtools.build.lib.profiler.ProfilerTask;
import com.google.devtools.build.lib.profiler.statistics.PhaseStatistics;
import com.google.devtools.build.lib.profiler.statistics.PhaseSummaryStatistics;
import com.google.devtools.build.lib.profiler.statistics.PhaseVfsStatistics;
import com.google.devtools.build.lib.profiler.statistics.PhaseVfsStatistics.Stat;
import com.google.devtools.build.lib.util.StringUtil;
import com.google.devtools.build.lib.util.TimeUtilities;

import java.io.PrintStream;
import java.util.Arrays;
import java.util.EnumMap;
import java.util.Map.Entry;

/**
 * Output {@link PhaseSummaryStatistics}, {@link PhaseStatistics} and {@link PhaseVfsStatistics}
 * in HTML format.
 */
public final class PhaseHtml extends HtmlPrinter {

  private final PhaseSummaryStatistics phaseSummaryStats;
  private final EnumMap<ProfilePhase, PhaseStatistics> phaseStatistics;
  private final int vfsStatsLimit;

  /**
   * @param vfsStatsLimit maximum number of VFS statistics to print, or -1 for no limit.
   */
  public PhaseHtml(
      PrintStream out,
      PhaseSummaryStatistics phaseSummaryStats,
      EnumMap<ProfilePhase, PhaseStatistics> phaseStatistics,
      int vfsStatsLimit) {
    super(out);
    this.phaseSummaryStats = phaseSummaryStats;
    this.phaseStatistics = phaseStatistics;
    this.vfsStatsLimit = vfsStatsLimit;
  }

  /**
   * Output a style tag with all necessary CSS directives
   */
  public void printCss() {
    lnPrint("<style type=\"text/css\"><!--");
    down();
    lnPrint("div.phase-statistics {");
    lnPrint("  margin: 0 10;");
    lnPrint("  font-size: small;");
    lnPrint("  font-family: monospace;");
    lnPrint("  float: left;");
    lnPrint("}");
    lnPrint("table.phase-statistics {");
    lnPrint("  border: 0px; text-align: right;");
    lnPrint("}");
    lnPrint("table.phase-statistics td {");
    lnPrint("  padding: 0 5;");
    lnPrint("}");
    lnPrint("td.left {");
    lnPrint("  text-align: left;");
    lnPrint("}");
    lnPrint("td.center {");
    lnPrint("  text-align: center;");
    lnPrint("}");
    up();
    lnPrint("--></style>");
  }

  /**
   * Print tables from {@link #phaseSummaryStats} and {@link #phaseStatistics} side by side.
   */
  public void print() {
    printPhaseSummaryStatistics();

    for (ProfilePhase phase :
        Arrays.asList(ProfilePhase.INIT, ProfilePhase.LOAD, ProfilePhase.ANALYZE)) {
      PhaseStatistics statistics = phaseStatistics.get(phase);
      if (!statistics.wasExecuted()) {
        continue;
      }
      printPhaseStatistics(statistics);
    }
    lnElement("div", "style", "clear: both;");
  }

  /**
   * Print header and tables for a single phase.
   */
  private void printPhaseStatistics(PhaseStatistics phaseStat) {
    lnOpen("div", "class", "phase-statistics");
    lnElement(
        "h3",
        String.format(
            "%s Phase Information", StringUtil.capitalize(phaseStat.getProfilePhase().nick)));
    lnOpen("table", "class", "phase-statistics");
    lnOpen("tr");
    open("td", "class", "left", "colspan", "3");
    printf("Total %s phase time", phaseStat.getProfilePhase().nick);
    close(); // td
    element("td", TimeUtilities.prettyTime(phaseStat.getPhaseDurationNanos()));
    lnClose(); // tr

    if (!phaseStat.isEmpty()) {
      lnOpen("tr");
      element("td", "class", "left", "colspan", "4", "Total time (across all threads) spent on:");
      close(); // tr
      lnOpen("tr");
      element("td", "Type");
      element("td", "Total");
      element("td", "Count");
      element("td", "Average");
      close(); // tr
      for (ProfilerTask taskType : phaseStat) {
        lnOpen("tr", "class", "phase-task-statistics");
        element("td", taskType);
        element("td", prettyPercentage(phaseStat.getTotalRelativeDuration(taskType)));
        element("td", phaseStat.getCount(taskType));
        element("td", TimeUtilities.prettyTime(phaseStat.getMeanDuration(taskType)));
        close(); // tr
      }
    }
    lnClose(); // table
    printVfsStatistics(phaseStat.getVfsStatistics());
    lnClose(); // div
  }

  /**
   * Print the time spent on VFS operations on each path. Output is grouped by operation and sorted
   * by descending duration. If multiple of the same VFS operation were logged for the same path,
   * print the total duration.
   */
  private void printVfsStatistics(PhaseVfsStatistics stats) {
    if (vfsStatsLimit == 0 || stats.isEmpty()) {
      return;
    }

    lnElement("h4", "VFS path statistics:");

    lnOpen("table", "class", "phase-statistics");
    lnOpen("tr");
    element("td", "Type");
    element("td", "Frequency");
    element("td", "Duration");
    element("td", "class", "left", "Path");
    close(); // tr

    for (ProfilerTask type : stats) {
      int numPrinted = 0;
      for (Entry<Stat, String> stat : stats.getSortedStatistics(type)) {
        lnOpen("tr");
        if (vfsStatsLimit != -1 && numPrinted++ == vfsStatsLimit) {
          open("td", "class", "center", "colspan", "4");
          printf("... %d more ...", stats.getStatisticsCount(type) - vfsStatsLimit);
          close();
          close(); // tr
          break;
        }
        element("td", type.name());
        element("td", stat.getKey().count);
        element("td", TimeUtilities.prettyTime(stat.getKey().duration));
        element("td", "class", "left", stat.getValue());
        close(); // tr
      }
    }

    lnClose(); // table
  }

  /**
   * Print a table for the phase overview with runtime and runtime percentage per phase and total.
   */
  private void printPhaseSummaryStatistics() {
    lnOpen("div", "class", "phase-statistics");
    lnElement("h3", "Phase Summary Information");
    lnOpen("table", "class", "phase-statistics");
    for (ProfilePhase phase : phaseSummaryStats) {
      lnOpen("tr");
      lnOpen("td", "class", "left");
      printf("Total %s phase time", phase.nick);
      close();
      element("td", TimeUtilities.prettyTime(phaseSummaryStats.getDurationNanos(phase)));
      element("td", phaseSummaryStats.getPrettyPercentage(phase));
      lnClose(); // tr
    }
    lnOpen("tr");
    lnElement("td", "class", "left", "Total run time");
    element("td", TimeUtilities.prettyTime(phaseSummaryStats.getTotalDuration()));
    element("td", "100.00%");
    lnClose(); // tr
    lnClose(); // table
    lnClose(); // div
  }
}


text:
import os
import weakref

from ConfigParser import SafeConfigParser

class SingletonMixin(object):
    """
    Adds a singleton behaviour to an existing class.

    weakrefs are used in order to keep a low memory footprint.
    As a result, args and kwargs passed to classes initializers
    must be of weakly refereable types.
    """
    _instances = weakref.WeakValueDictionary()

    def __new__(cls, *args, **kwargs):
        key = (cls, args, tuple(kwargs.items()))

        if key in cls._instances:
            return cls._instances[key]

        new_instance = super(type(cls), cls).__new__(cls, *args, **kwargs)
        cls._instances[key] = new_instance

        return new_instance

class Configuration(SingletonMixin):
    """
    Acts as a proxy to the ConfigParser module
    """
    def __init__(self, fp, parser_dep=SafeConfigParser):
        self.conf = parser_dep()
        self.conf.readfp(fp)

    @classmethod
    def from_env(cls):
        try:
            filepath = os.environ['CITEDBY_SETTINGS_FILE']
        except KeyError:
            if __debug__:
                # load the test configurations
                cwd = os.path.join(os.path.dirname(__file__))
                filepath = os.path.join(cwd, '..', 'config-test.ini')
            else:
                raise ValueError('missing env variable CITEDBY_SETTINGS_FILE')

        return cls.from_file(filepath)

    @classmethod
    def from_file(cls, filepath):
        """
        Returns an instance of Configuration

        ``filepath`` is a text string.
        """
        fp = open(filepath, 'rb')
        return cls(fp)

    def __getattr__(self, attr):
        return getattr(self.conf, attr)

    def items(self):
        """Settings as key-value pair.
        """
        return [(section, dict(self.conf.items(section))) for \
            section in [section for section in self.conf.sections()]]


text:
<resources>
    <string name="app_name">MedicatioNeura</string>
    <string name="app_uid">6b1d18b64c28e498feedeed8dfeb3559734217de4088afb44b1df632c1cb9d27</string>
    <string name="app_secret">814e2a0711f2ec830e5bd25cec2ddf5e1d80756fa33bbf53dbcc1aae9c44a1ed</string>

    <string name="login_with_neura">Login with Neura</string>
    <string name="simulate_event">Simulate an event</string>

    <string name="share">Share Neura with\nyour developers</string>
    <string name="implement_neura">Implementing Neura into your app\ntakes an average of 2 hours</string>

    <string name="morning_pill_header">Morning pills reminder</string>
    <string name="morning_pills_description">Get reminded to take your pills when you wake up</string>
    <string name="evening_pill_header">Evening pills reminder</string>
    <string name="evening_pills_description">Get reminded to take your pills before you go to sleep</string>
    <string name="pillbox_header">Take Pillbox reminder</string>
    <string name="pillbox_description">Get reminded to take your pillbox with you when you leave home</string>

</resources>


text:
import { rpc } from 'electron-simple-rpc';

export default {
    find:    rpc('electron', 'playEvent.find'),
    insert:  rpc('electron', 'playEvent.insert'),
    remove:  rpc('electron', 'playEvent.remove'),
};


text:
clear ; close all; clc
fprintf('Loading Data ...\n');
load('/Volumes/RamDisk/nn_params.mat');
M = csvread ('/Volumes/RamDisk/train.csv', 1, 0);
N = csvread('/Volumes/RamDisk/test.csv', 1, 0);
X = M(:,2:785);
X = rotateStd(X);
y = M(:,1);
y(y==0) = 10;
Xpred = rotateStd(N);

fprintf('Doing principle components analysis ...\n');
L = [X; Xpred];
%L = deepen(L, 194);
Z = redu_dim(L, net.K);
Zpred = Z((1 + size(X, 1)):end, :);
Z = Z(1:size(X, 1), :);

fprintf('Randomly spliting as training set, cv set and test set ...\n');
Xtest = X(net.index.test, :);
ytest = y(net.index.test, :);
Ztest = Z(net.index.test, :);
Xval = X(net.index.validation, :);
yval = y(net.index.validation, :);
Zval = Z(net.index.validation, :);
X = X(net.index.train, :);
y = y(net.index.train, :);
Z = Z(net.index.train, :);
clear L M N
fprintf('Initialization competed, go or press Ctrl+C into manual mode ...\n');

fprintf('Training ...\n');
test(net, Z, y, Zval, yval, Ztest, ytest);
net = train(net, Z, y, 1000);
test(net, Z, y, Zval, yval, Ztest, ytest);
fprintf('Training completed.\n');

fprintf('Writing predicted results ...\n');
pred = predict(net, Zpred);
csvwrite('/Volumes/RamDisk/results.csv', pred);
save '/Volumes/RamDisk/nn_params.mat' net;
fprintf('Task completed.\n');


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ aem-sling-contrib
  ~ https://github.com/dherges/aem-sling-contrib
  ~
  ~ Copyright (c) 2016 David Herges
  ~ Licensed under the MIT license.
  -->

<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
    jcr:primaryType="cq:Dialog"
    title="Image"
    xtype="tabpanel">
    <items jcr:primaryType="cq:WidgetCollection">

        <image
            jcr:primaryType="cq:Widget"
            cropParameter="./imageCrop"
            ddGroups="[media]"
            fileNameParameter="./fileName"
            fileReferenceParameter="./fileReference"
            mapParameter="./imageMap"
            name="./file"
            requestSuffix=".img.png"
            rotateParameter="./imageRotate"
            title="Image"
            xtype="html5smartimage"/>

      <advanced
            jcr:primaryType="cq:Widget"
            title="Advanced"
            xtype="panel">
            <items jcr:primaryType="cq:WidgetCollection">
                <title
                    jcr:primaryType="cq:Widget"
                    fieldLabel="Title"
                    name="./jcr:title"
                    xtype="textfield"/>
                <altText
                    jcr:primaryType="cq:Widget"
                    fieldDescription="(leave empty to use the title defined above)"
                    fieldLabel="Alt Text"
                    name="./altText"
                    xtype="textfield"/>
                <description
                    jcr:primaryType="cq:Widget"
                    fieldLabel="Description"
                    name="./description"
                    xtype="textarea"/>

                </items>
      </advanced>

      <display
            jcr:primaryType="cq:Widget"
            title="Display"
            xtype="panel">
            <items jcr:primaryType="cq:WidgetCollection">
                  <cssShape
                    jcr:primaryType="cq:Widget"
                    defaultValue=""
                    fieldLabel="Image Shape"
                    name="./cssShape"
                    type="select"
                    xtype="selection">
                    <options jcr:primaryType="cq:WidgetCollection">
                        <default
                            jcr:primaryType="nt:unstructured"
                            text="Default"
                            value=""/>
                        <large
                            jcr:primaryType="nt:unstructured"
                            text="img-rounded"
                            value="img-rounded"/>
                        <small
                            jcr:primaryType="nt:unstructured"
                            text="img-circle"
                            value="img-circle"/>
                        <extrasmall
                            jcr:primaryType="nt:unstructured"
                            text="img-thumbnail"
                            value="img-thumbnail"/>
                  </options>
                </cssSize>
          </items>
      </display>

    </items>
</jcr:root>


text:
'''
Process Management
==================

Ensure a process matching a given pattern is absent.

.. code-block:: yaml

    httpd-absent:
      process.absent:
        - name: apache2
'''

def __virtual__():
    return 'ps.pkill' in __salt__

def absent(name, user=None, signal=None):
    '''
    Ensures that the named command is not running.

    name
        The pattern to match.

    user
        The user process belongs

    signal
        Signal to send to the process(es).
    '''
    ret = {'name': name,
           'changes': {},
           'result': False,
           'comment': ''}

    if __opts__['test']:
        running = __salt__['ps.pgrep'](name, user=user)
        ret['result'] = None
        if running:
            ret['comment'] = ('{0} processes will '
                              'be killed').format(len(running))
        else:
            ret['comment'] = 'No matching processes running'
        return ret

    if signal:
        status = __salt__['ps.pkill'](name, user=user,
                                      signal=signal, full=True)
    else:
        status = __salt__['ps.pkill'](name, user=user, full=True)

    ret['result'] = True
    if status:
        ret['comment'] = 'Killed {0} processes'.format(len(status['killed']))
        ret['changes'] = status
    else:
        ret['comment'] = 'No matching processes running'
    return ret


text:
/////////////////////////////////////////////////////////////////////////////
// Name:        splash.h
// Purpose:     Splash screen class
// Author:      Julian Smart
// Modified by:
// Created:     28/6/2000
// RCS-ID:      $Id$
// Copyright:   (c) Julian Smart
// Licence:     wxWindows Licence
/////////////////////////////////////////////////////////////////////////////

#ifndef _WX_SPLASH_H_
#define _WX_SPLASH_H_

#include "wx/bitmap.h"
#include "wx/timer.h"
#include "wx/frame.h"

/*
 * A window for displaying a splash screen
 */

#define wxSPLASH_CENTRE_ON_PARENT   0x01
#define wxSPLASH_CENTRE_ON_SCREEN   0x02
#define wxSPLASH_NO_CENTRE          0x00
#define wxSPLASH_TIMEOUT            0x04
#define wxSPLASH_NO_TIMEOUT         0x00

class WXDLLIMPEXP_FWD_ADV wxSplashScreenWindow;

/*
 * wxSplashScreen
 */

class WXDLLIMPEXP_ADV wxSplashScreen: public wxFrame
{
public:
    // for RTTI macros only
    wxSplashScreen() {}
    wxSplashScreen(const wxBitmap& bitmap, long splashStyle, int milliseconds,
                   wxWindow* parent, wxWindowID id,
                   const wxPoint& pos = wxDefaultPosition,
                   const wxSize& size = wxDefaultSize,
                   long style = wxSIMPLE_BORDER|wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP);
    virtual ~wxSplashScreen();

    void OnCloseWindow(wxCloseEvent& event);
    void OnNotify(wxTimerEvent& event);

    long GetSplashStyle() const { return m_splashStyle; }
    wxSplashScreenWindow* GetSplashWindow() const { return m_window; }
    int GetTimeout() const { return m_milliseconds; }

protected:
    wxSplashScreenWindow*   m_window;
    long                    m_splashStyle;
    int                     m_milliseconds;
    wxTimer                 m_timer;

    DECLARE_DYNAMIC_CLASS(wxSplashScreen)
    DECLARE_EVENT_TABLE()
    wxDECLARE_NO_COPY_CLASS(wxSplashScreen);
};

/*
 * wxSplashScreenWindow
 */

class WXDLLIMPEXP_ADV wxSplashScreenWindow: public wxWindow
{
public:
    wxSplashScreenWindow(const wxBitmap& bitmap, wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxNO_BORDER);

    void OnPaint(wxPaintEvent& event);
    void OnEraseBackground(wxEraseEvent& event);
    void OnMouseEvent(wxMouseEvent& event);
    void OnChar(wxKeyEvent& event);

    void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; }
    wxBitmap& GetBitmap() { return m_bitmap; }

protected:
    wxBitmap    m_bitmap;

    DECLARE_EVENT_TABLE()
    wxDECLARE_NO_COPY_CLASS(wxSplashScreenWindow);
};

#endif
    // _WX_SPLASH_H_


text:
@interface SavedFormsViewController ()
{
    NSMutableArray * savedForms;
}
@end

@implementation SavedFormsViewController

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.title = @"Saved Forms";

    savedForms = [[NSMutableArray alloc] initWithCapacity:3];

    for( StoredForm * form in self.server.storedForms ) {
        if( !form.isFinished ) {
            [savedForms addObject:form];
        }
    }

    self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

-(void) viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];

    savedForms = [[NSMutableArray alloc] initWithCapacity:3];

    for( StoredForm * form in self.server.storedForms ) {
        if( !form.isFinished ) {
            [savedForms addObject:form];
        }
    }

    [self.tableView reloadData];
}

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

#pragma mark - Table view data source

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

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

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    if( cell == nil ) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];

        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        cell.detailTextLabel.numberOfLines = 6;
    }

    StoredForm * form = [savedForms objectAtIndex:indexPath.row];
    cell.textLabel.text = form.xform.name;

    cell.detailTextLabel.text = [self stringFromAnswers: form.formData];

    return cell;
}

-(CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 140;
}

-(NSString*) stringFromAnswers:(NSDictionary*) answers
{
    NSMutableString * string = [[NSMutableString alloc] init];

    for( NSString * key in [answers allKeys] ) {
        id answer = [answers objectForKey:key];

        [string appendFormat:@"%@: %@,  ", [[key componentsSeparatedByString:@"/"] lastObject], [answer description]];
    }

    return string;
}

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

#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    StoredForm * storedForm = [savedForms objectAtIndex:indexPath.row];
    KeepForm * form = storedForm.xform;
    form.progress = storedForm.formData;
    [DHMiscUtilities presentForm:form fromController:self withStored:storedForm];
}

@end