text:
package com.mateuszkoslacz.moviper.rxsample.viper.view.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.mateuszkoslacz.moviper.rxsample.R;
import com.mateuszkoslacz.moviper.rxsample.viper.entity.User;
import com.mateuszkoslacz.moviper.rxsample.viper.view.viewholder.UserViewHolder;

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

/**
 * Created by jjodelka on 17/10/16.
 */

public class UserAdapter extends RecyclerView.Adapter<UserViewHolder> {

    private List<User> mUserList = new ArrayList<>();
    private UserClickListener mUserClickListener;

    public UserAdapter(UserClickListener mUserClickListener) {
        this.mUserClickListener = mUserClickListener;
    }

    @Override
    public UserViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View itemView = LayoutInflater.from(parent.getContext())
                .inflate(R.layout.item_user_row, parent, false);
        return new UserViewHolder(itemView);
    }

    @Override
    public void onBindViewHolder(UserViewHolder holder, int position) {
        holder.bind(mUserList.get(position), mUserClickListener);
    }

    @Override
    public int getItemCount() {
        return mUserList != null ? mUserList.size() : 0;
    }

    public void setUserList(List<User> userList) {
        mUserList.clear();
        mUserList.addAll(userList);
        notifyDataSetChanged();
    }

    public interface UserClickListener {
        void onUserClick(User user);
    }
}


text:
from pywikibot import family

__version__ = '$Id$'

# The Wikimedia family that is known as Wikiquote

class Family(family.WikimediaFamily):
    def __init__(self):
        super(Family, self).__init__()
        self.name = 'wikiquote'

        self.languages_by_size = [
            'pl', 'en', 'it', 'ru', 'fr', 'de', 'pt', 'es', 'cs', 'sk', 'bg',
            'bs', 'tr', 'sl', 'he', 'uk', 'lt', 'eo', 'el', 'id', 'zh', 'fa',
            'hu', 'fi', 'sv', 'nl', 'li', 'ca', 'no', 'nn', 'hr', 'sa', 'ja',
            'az', 'hy', 'ar', 'et', 'ko', 'ml', 'cy', 'ka', 'gl', 'sr', 'ro',
            'ku', 'th', 'te', 'is', 'da', 'eu', 'af', 'vi', 'sq', 'ta', 'hi',
            'la', 'be', 'br', 'mr', 'uz', 'ur', 'zh-min-nan', 'gu', 'su', 'kn',
            'wo', 'ky', 'am',
        ]

        self.langs = dict([(lang, '%s.wikiquote.org' % lang)
                           for lang in self.languages_by_size])

        # attop is a list of languages that prefer to have the interwiki
        # links at the top of the page.
        self.interwiki_attop = []

        # on_one_line is a list of languages that want the interwiki links
        # one-after-another on a single line
        self.interwiki_on_one_line = []

        # Similar for category
        self.category_attop = []

        # List of languages that want the category on_one_line.
        self.category_on_one_line = []

        # Global bot allowed languages on http://meta.wikimedia.org/wiki/Bot_policy/Implementation#Current_implementation
        self.cross_allowed = [
            'af', 'am', 'ar', 'az', 'be', 'bg', 'br', 'bs', 'ca', 'cs', 'da',
            'el', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fr', 'gl', 'he', 'hi',
            'hu', 'hy', 'id', 'is', 'it', 'ja', 'ka', 'kn', 'ku', 'ky', 'la',
            'li', 'lt', 'ml', 'mr', 'nl', 'nn', 'no', 'pt', 'ro', 'ru', 'sk',
            'sl', 'sq', 'sr', 'su', 'sv', 'ta', 'te', 'tr', 'uk', 'uz', 'vi',
            'wo', 'zh',
        ]

        # Which languages have a special order for putting interlanguage links,
        # and what order is it? If a language is not in interwiki_putfirst,
        # alphabetical order on language code is used. For languages that are in
        # interwiki_putfirst, interwiki_putfirst is checked first, and
        # languages are put in the order given there. All other languages are
        # put after those, in code-alphabetical order.
        self.interwiki_putfirst = {
            'en': self.alphabetic,
            'fi': self.alphabetic,
            'fr': self.alphabetic,
            'he': ['en'],
            'hu': ['en'],
            'pl': self.alphabetic,
            'simple': self.alphabetic,
            'pt': self.alphabetic,
        }

        self.obsolete = {
            'als': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Alemannic_Wikiquote
            'ang': None, # https://bugzilla.wikimedia.org/show_bug.cgi?id=29150
            'ast': None, # https://bugzilla.wikimedia.org/show_bug.cgi?id=28964
            'bm': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Bambara_Wikiquote
            'co': None,
            'cr': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Nehiyaw_Wikiquote
            'dk': 'da',
            'ga': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Gaeilge_Wikiquote
            'jp': 'ja',
            'kk': None, # https://bugzilla.wikimedia.org/show_bug.cgi?id=20325
            'kr': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Kanuri_Wikiquote
            'ks': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Kashmiri_Wikiquote
            'kw': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Kernewek_Wikiquote
            'lb': None,
            'minnan':'zh-min-nan',
            'na': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Nauruan_Wikiquote
            'nb': 'no',
            'nds': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Low_Saxon_Wikiquote
            'qu': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Quechua_Wikiquote
            'simple': 'en', #http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Simple_English_(3)_Wikiquote
            'tk': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Turkmen_Wikiquote
            'tokipona': None,
            'tt': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Tatar_Wikiquote
            'ug': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Oyghurque_Wikiquote
            'vo': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Volapuk_Wikiquote
            'za':None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Zhuang_Wikiquote
            'zh-tw': 'zh',
            'zh-cn': 'zh'
        }

    def code2encodings(self, code):
        """
        Return a list of historical encodings for a specific language wikipedia
        """
        # Historic compatibility
        if code == 'pl':
            return 'utf-8', 'iso8859-2'
        if code == 'ru':
            return 'utf-8', 'iso8859-5'
        return self.code2encoding(code),

redpajama_set_name: RedPajamaGithub


text:
This API uses following [RFC5988](http://tools.ietf.org/html/rfc5988) style link relations

## Standard rels

These rels are part of the
[IANA](http://www.iana.org/assignments/link-relations/link-relations.xhtml)
or [Microformats](http://microformats.org/wiki/existing-rel-values)
official registry of rel values.

{: id="self"}
* self

Links back to the current resource.

## Custom rels

Because they are non-standard rels, they need to be URI's. They are formed by prefixing the following keywords with `https://yakscart.herokuapp.com/rels#`

{: id="cart"}
* cart

Links or embeds the current user's shopping cart.

{: id="products"}
* products

Use on: api root. Links to a list of all products.

{: id="product"}
* product

Used on: `line_item`, get the product of this line item.

{: id="line_items"}
* line_items

Used on: `cart`, to embed the line item collection that the cart consists of.


text:
package drivertest

import (
	"math/rand"
	"sync"

	"github.com/google/uuid"
	"gocloud.dev/docstore/driver"
)

// MakeUniqueStringDeterministicForTesting uses a specified seed value to
// produce the same sequence of values in driver.UniqueString for testing.
//
// Call when running tests that will be replayed.
func MakeUniqueStringDeterministicForTesting(seed int64) {
	r := &randReader{r: rand.New(rand.NewSource(seed))}
	uuid.SetRand(r)
}

type randReader struct {
	mu sync.Mutex
	r  *rand.Rand
}

func (r *randReader) Read(buf []byte) (int, error) {
	r.mu.Lock()
	defer r.mu.Unlock()
	return r.r.Read(buf)
}

// MustDocument is like driver.NewDocument, but panics on error.
func MustDocument(doc interface{}) driver.Document {
	dd, err := driver.NewDocument(doc)
	if err != nil {
		panic(err)
	}
	return dd
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8"><title>PLAYING A SONG</title>

<link rel="stylesheet" type="text/css" href="default.css">
<link type="text/css" rel="stylesheet" href="/assets/cmirror/codemirror.css">
<link type="text/css" id="theme" rel="stylesheet" href="/assets/themes/solarized-dark.css">

PLAYING A SONG

In this project, we continue using the sound library to play a version
	    of Mary Had a Little Lamb.

Speaker & Audio Cable

Having issues?  Check out the Troubleshooting Guide.

Below is an example of how you can play a musical tune using
the RaspberrySTEM:

<textarea>
from rstem.sound import Note

notes = [ Note('E'),
	Note('D'),
	Note('C'),
	Note('D'),
	Note('E'),
	Note('E'),
	Note('E'),
	Note('D'),
	Note('D'),
	Note('D'),
	Note('E'),
	Note('G'),
	Note('G'),
	Note('E'),
	Note('D'),
	Note('C'),
	Note('D'),
	Note('E'),
	Note('E'),
	Note('E'),
	Note('E'),
	Note('D'),
	Note('D'),
	Note('E'),
	Note('D'),
	Note('C') ]

for note in notes:
	note.play(duration=0.5)
	note.wait()
</textarea>

The code above is pretty simple -- we create a list of notes, and then we
use a for loop to loop through them, play each in turn.  Now,
the one big issue with this code is that each note is of a fixed
duration.  But, in most songs, you have notes of varying length
(some longer and some shorter).  We can modify this code so that
we can specify the length of each note independently.  We do that
by creating a second list that contains the note durations, and in our for loop, we
use both the note and the duration in our play() function.

zip() Function

The zip() function provides a convenient way to combine two (or more) lists into one.  Just
like a zipper on jacket meshes together two rows of metal pins, the zip() function does the
same things with lists.  zip() will take the first element of each list and combine them
together.  It
will then take the second element of each list and combine those together.  And so on, until
the shortest list runs out of elements.

For example, imagine that you have two lists, one containing the name of all the people in a household
and one containing the age of all those people.  The lists might look like this:

name = [Bob, Susie, Brian, Carol]

age = [31, 29, 7, 4]

If we were to zip() those two lists together:

zipped = zip(name, age)

Our resulting list ("zipped") would contain the following:

[(Bob, 31), (Susie, 29), (Brian, 7), (Carol, 4)]

The zip() function is often helpful when traversing two related lists through a
for loop, as we will do below.

Here is what the code would look like:

<textarea>
from rstem.sound import Note

notes = [ Note('E'),
	Note('D'),
	Note('C'),
	Note('D'),
	Note('E'),
	Note('E'),
	Note('E'),
	Note('D'),
	Note('D'),
	Note('D'),
	Note('E'),
	Note('G'),
	Note('G'),
	Note('E'),
	Note('D'),
	Note('C'),
	Note('D'),
	Note('E'),
	Note('E'),
	Note('E'),
	Note('E'),
	Note('D'),
	Note('D'),
	Note('E'),
	Note('D'),
	Note('C') ]

durations = [ .5,
	.5,
	.5,
	.5,
	.5,
	.5,
	 1,
	.5,
	.5,
	1,
	.5,
	.5,
	1,
	.5,
	.5,
	.5,
	.5,
	.5,
	.5,
	.5,
	.5,
	.5,
	.5,
	.5,
	.5,
	1 ]

for note, duration in zip(notes, durations):
	note.play(duration=duration)
	note.wait()
</textarea>

home | prev |
next


text:
/*		rw_dff_structure.h	Written by Marek Iwaniuk (c).
*		Dff structure documentation http://www.chronetal.co.uk/gta/index.php?page=dff
*		Created on 02/07/2017 (MM/DD/YYYY)
*/

#pragma once

#ifndef RW_DFF_STRUCTURE
#define RW_DFF_STRUCTURE

#include "rw_types.h"
#include "rw_core.h"

enum RwGeometryDataFlags : uint_16 {
	rwOBJECT_VERTEX_TRISTRIP				= 0x01,
	rwOBJECT_VERTEX_POS						= 0x02,
	rwOBJECT_VERTEX_TEXTURED				= 0x04,
	rwOBJECT_VERTEX_PRELIT					= 0x08,
	rwOBJECT_VERTEX_NORMALS					= 0x10,
	rwOBJECT_VERTEX_LIGHT					= 0x20,
	rwOBJECT_VERTEX_MODULATE_MATERIAL_COLOR = 0x40,
	rwOBJECT_VERTEX_TEXTURED_2				= 0x80
};

// Section: Frame List
class RwFrameListData : public RwSectionHeader {
public:
	const size_t		ROT_MAT_DIM = 9;
	uint_32				frameCount;

	class RwFrameListChunk {
	public:
		float_32*	rotationalMatrix;	// [ROT_MAT_DIM]
		float_32	coordinatesOffsetX;
		float_32	coordinatesOffsetY;
		float_32	coordinatesOffsetZ;
		uint_32		parentFrame;	// 0xFFFFFFFF = NONE
		uint_32		unk1;
	} *frameInformation;	// [frameCount]
};

class RwFrame : public RwSectionHeader {
public:
	uint_8* frameName;					// [sectionSize] - should be interpreted as string
};

class RwFrameListExtension : public RwSectionHeader {
public:
	RwFrame frame;
};

class RwFrameList : public RwSectionHeader {
public:
	RwFrameListData				data;
	RwFrameListExtension*		extensions;
};
// ---

// Section: Geometry
class RwGeometryData : public RwSectionHeader {
public:
	class RwGeometryDataHeader {
	public:
		uint_16 flags;
		uint_16 unk1;
		uint_32 triangleCount;
		uint_32 vertexCount;
		uint_32 morphTargetCount;
	} dataHeader;

	class RwGeometryDataLightingHeader { // IF versionNumber = 4099 - according to not complete documentation
	public:
		float_32 ambient;
		float_32 diffuse;
		float_32 specular;
	} lightingHeader;

	class RwGeometryDataColorInformationChunk { // if rwOBJECT_VERTEX_PREILIT in flags
	public:
		uint_8 red;
		uint_8 green;
		uint_8 blue;
		uint_8 alpha;
	} *colorInformation; // [vertexCount]

	class RwGeometryDataTextureMappingInformationChunk { // if rwOBJECT_VERTEX_TEXTURED in flags
	public:
		float_32 u;
		float_32 v;
	} *textureMappingInformation; // [vertexCount]

	class RwGeometryDataFaceInformation {
	public:
		uint_16 vertex2; // this
		uint_16 vertex1; // is
		uint_16 flags;	 // weird
		uint_16 vertex3; // order
	} *faceInformation; // [triangleCount]

	class RwGeometryDataNonameInfo {
	public:
		float_32 boundingSphereX;
		float_32 boundingSphereY;
		float_32 boundingSphereZ;
		float_32 boundingSphereR;
		uint_32 hasPosition;
		uint_32 hasNormals;
	} nonameInfo;

	class RwGeometryDataVertexInformationChunk {
	public:
		float_32 x;
		float_32 y;
		float_32 z;
	} *vertexInformation; // [vertexCount]

	class RwGeometryDataNormalInformationChunk { // if rwOBJECT_VERTEX_NORMAL in flags
	public:
		float_32 x;
		float_32 y;
		float_32 z;
	} *normalInformation; // [vertexCount]
};

class RwMaterialData : public RwSectionHeader {
public:
	uint_32 unk1;
	uint_8 R;
	uint_8 G;
	uint_8 B;
	uint_8 A;
	uint_32 unk2;
	uint_32 textureCount;
	float_32 unkPosX;
	float_32 unkPosY;
	float_32 unkPosZ;
};

class RwTextureData : public RwSectionHeader {
public:
	uint_16 textureFilterModeFlags;
	uint_16 unk;
};

class RwString : public RwSectionHeader {
public:
	std::string text;
};

class RwTextureExtension : public RwSectionHeader {
	// May contain Sky Mipmap Val
};

class RwTexture : public RwSectionHeader {
public:
	RwTextureData	data;
	RwString		textureName;
	RwString		textureAlphaName;
	RwTextureExtension extension;
};

class RwMaterialExtension : public RwSectionHeader {
	// meant to be void.. don't ask
};

class RwMaterial : public RwSectionHeader {
public:
	RwMaterialData		data;
	RwTexture*			textures;
	RwMaterialExtension extension;
};

class RwMaterialListData : public RwSectionHeader {
public:
	uint_32 materialCount;
	uint_32 *arrayOfUnks; // Filled with '-1's, [materialCount] - it wasn't mentioned in docs.
};

class RwMaterialList : public RwSectionHeader {
public:
	RwMaterialListData	data;
	RwMaterial*			materials;
};

class RwMaterialSplit {
public:
	class Header {
	public:
		uint_32 triangleStrip;
		uint_32 splitCount;
		uint_32 faceCount;
	} header;

	class RwGeometryListInfoChunk {
	public:
		uint_32 faceIndex;
		uint_32 materialIndex;

		class RwGeometryListVertexInfoChunk {
		public:
			uint_32 vertex1;
		} *vertexInformation; // [faceIndex]
	} *splitInformation; // [splitCount]
};

class RwGeometryExtension : public RwSectionHeader {
public:
	RwMaterialSplit materialSplit;
};

class RwGeometry : public RwSectionHeader {
public:
	RwGeometryData		data;
	RwMaterialList		materialList;
	RwGeometryExtension extension;
};
// ---

// Section: Geometry List
class RwGeometryListData : public RwSectionHeader {
public:
	uint_32 geometryCount;
};

class RwGeometryList : public RwSectionHeader {
public:
	RwGeometryListData	data;
	RwGeometry			*geometries;
};
// ---

// Section: Atomic
class RwAtomicData : public RwSectionHeader {
public:
	uint_32 frameNumber;
	uint_32 geometryNumber;
	uint_32 unk1;
	uint_32 unk2;
};

class RwAtomic : public RwSectionHeader {
public:
	RwAtomicData data;
};
// ---

// Section: Clump
class RwClumpData : public RwSectionHeader {
public:
	uint_32 objectCount;
	uint_32 unk1;
	uint_32 unk2;
};

class RwClump : public RwSectionHeader {
public:
	RwClumpData		data;
	RwFrameList		frameList;
	RwGeometryList	geometryList;
	RwAtomic		atomic; //multiple?? but how many
};
// ---

#endif


text:
package ru.naumen.model.dao;

import com.google.common.collect.Iterables;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import ru.naumen.model.User;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import java.util.List;

/**
 * DAO for user entity
 * <br>
 * Used JPA specification
 * @author serce, astarovoyt
 *
 */
@Repository
@SuppressWarnings({ "unchecked", "rawtypes" })
public class UserDAO
{
    @PersistenceContext
    EntityManager entityManager;

    @Transactional
    public User getByAccessKey(String accessKey)
    {
        Query query = getEntityManager().createQuery(
                "SELECT p from " + User.class.getName() + " p where p.accessKey = :accessKey");
        query.setParameter("accessKey", accessKey);
        query.setHint("org.hibernate.cacheable", true);

        List resultList = query.getResultList();
        return (User)Iterables.get(resultList, 0, null);
    }

    @Transactional
    public User getByEmail(String email)
    {
        Query query = getEntityManager().createQuery(
                "SELECT p from " + User.class.getName() + " p where p.email = :email");
        query.setParameter("email", email);
        query.setHint("org.hibernate.cacheable", true);

        List resultList = query.getResultList();
        return (User)Iterables.get(resultList, 0, null);
    }

    @Transactional(readOnly = true)
    public List<User> loadAll()
    {
        return getEntityManager().createQuery("SELECT p from " + User.class.getName() + " p").getResultList();
    }

    @Transactional
    public User saveUser(User user)
    {
        getEntityManager().merge(user);

        return user;
    }

    public void store(User user)
    {
        getEntityManager().persist(user);
    }

    EntityManager getEntityManager()
    {
        return entityManager;
    }
}


text:
package com.github.games647.fastlogin.core.importer;

import com.github.games647.fastlogin.core.AuthStorage;
import com.github.games647.fastlogin.core.PlayerProfile;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.UUID;

import javax.sql.DataSource;

public class AutoInImporter extends Importer {

    private static final String PLUGIN_NAME = "AutoIn";

    private static final String SQLITE_FILE = "plugins/" + PLUGIN_NAME + "/AutoIn_PlayerOptions.db";

    private static final String USER_TABLE = "nicknames";
    private static final String UUID_TABLE = "uuids";
    private static final String SESSION_TABLE = "sessions";

    public static String getSQLitePath() {
        return SQLITE_FILE;
    }

    @Override
    public int importData(Connection source, DataSource target, AuthStorage storage) throws SQLException {
        Statement stmt = null;
        ResultSet resultSet = null;
        try {
            stmt = source.createStatement();
            resultSet = stmt.executeQuery("SELECT name, protection, premium, puuid FROM " + USER_TABLE
                    + " LEFT JOIN " + " ("
                    /* Prevent duplicates */
                    + "SELECT * FROM " + UUID_TABLE + " GROUP BY nickname_id"
                    + ") uuids"
                    + " ON " + USER_TABLE + ".id = uuids.nickname_id");

            int rows = 0;
            while (resultSet.next()) {
                String name = resultSet.getString(1);
                boolean protection = resultSet.getBoolean(2);
                /* Enable premium authentication only for those who want to be auto logged in,
                so they have their cracked protection disabled */
                boolean premium = !protection && resultSet.getBoolean(3);
                String puuid = resultSet.getString(4);

                /* FastLogin will also make lookups on the uuid column for name changes
                the old 1.6.2 version won't check if those user have premium enabled

                so it could happen that a premium could steal the account if we don't do this

                It seems the uuid is saved on autoin too if the player is cracked */
                PlayerProfile profile;
                if (premium) {
                    profile = new PlayerProfile(UUID.fromString(puuid), name, premium, "");
                } else {
                    profile = new PlayerProfile(null, name, premium, "");
                }

                storage.save(profile);
                rows++;
            }

            return rows;
        } finally {
            closeQuietly(stmt);
            closeQuietly(resultSet);
        }
    }
}


text:
package com.allanbank.mongodb.client.message;

import com.allanbank.mongodb.client.Message;

/**
 * CursorableMessage provides a common interface for messages that can start a
 * cursor.
 *
 * @api.no This class is <b>NOT</b> part of the drivers API. This class may be
 *         mutated in incompatible ways between any two releases of the driver.
 * @copyright 2013, Allanbank Consulting, Inc., All Rights Reserved
 */
public interface CursorableMessage
        extends Message {
    /**
     * Returns the number of documents to be returned in each batch of results.
     *
     * @return The number of documents to be returned in each batch of results.
     */
    public int getBatchSize();

    /**
     * Returns the total number of documents to be returned.
     *
     * @return The total number of documents to be returned.
     */
    public int getLimit();

}


text:
import $ from 'jquery';
import request from '../../utils/request';
import FilesField, { UriToMarkdown } from '../../forms/fields/files';
import { config, translations } from 'grav-config';
import { Instance as Editor } from '../../forms/fields/editor';

const previewTemplate = `

✔

✘

      ${translations.PLUGIN_ADMIN.DELETE}
      ${translations.PLUGIN_ADMIN.VIEW}
      ${translations.PLUGIN_ADMIN.INSERT}

`.trim();

export default class PageMedia extends FilesField {
    constructor({ container = '#grav-dropzone', options = {} } = {}) {
        options = Object.assign(options, { previewTemplate });
        super({ container, options });
        if (!this.container.length) { return; }

        this.urls = {
            fetch: `${this.container.data('media-url')}/task${config.param_sep}listmedia`,
            add: `${this.container.data('media-url')}/task${config.param_sep}addmedia`,
            delete: `${this.container.data('media-url')}/task${config.param_sep}delmedia`
        };

        this.dropzone.options.url = this.urls.add;

        if (typeof this.options.fetchMedia === 'undefined' || this.options.fetchMedia) {
            this.fetchMedia();
        }

        if (typeof this.options.attachDragDrop === 'undefined' || this.options.attachDragDrop) {
            this.attachDragDrop();
        }
    }

    fetchMedia() {
        let url = this.urls.fetch;

        request(url, { method: 'post' }, (response) => {
            let results = response.results;

            Object.keys(results).forEach((name) => {
                let data = results[name];
                let mock = { name, size: data.size, accepted: true, extras: data };

                this.dropzone.files.push(mock);
                this.dropzone.options.addedfile.call(this.dropzone, mock);

                if (name.match(/\.(jpg|jpeg|png|gif)$/i)) {
                    this.dropzone.options.thumbnail.call(this.dropzone, mock, data.url);
                }
            });

            this.container.find('.dz-preview').prop('draggable', 'true');
        });
    }

    onDropzoneSending(file, xhr, formData) {
        /*
        // Cannot call super because Safari and IE API don't implement `delete`
        super.onDropzoneSending(file, xhr, formData);
        formData.delete('task');
        */

        formData.append('name', this.options.dotNotation);
        formData.append('admin-nonce', config.admin_nonce);
    }

    onDropzoneComplete(file) {
        super.onDropzoneComplete(file);

        // accepted
        $('.dz-preview').prop('draggable', 'true');
    }

    attachDragDrop() {
        this.container.delegate('[data-dz-insert]', 'click', (e) => {
            let target = $(e.currentTarget).parent('.dz-preview').find('.dz-filename');
            let editor = Editor.editors.filter((index, editor) => $(editor).attr('name') === 'data[content]');

            if (editor.length) {
                editor = editor.data('codemirror');
                editor.focus();

                let filename = encodeURI(target.text());
                let shortcode = UriToMarkdown(filename);
                editor.doc.replaceSelection(shortcode);
            }
        });

        this.container.delegate('[data-dz-view]', 'mouseenter', (e) => {
            let target = $(e.currentTarget);
            let file = target.parent('.dz-preview').find('.dz-filename');
            let filename = encodeURI(file.text());
            let URL = target.closest('[data-media-path]').data('media-path');

            target.attr('href', `${URL}/${filename}`);
        });

        this.container.delegate('.dz-preview', 'dragstart', (e) => {
            let target = $(e.currentTarget);
            let uri = encodeURI(target.find('.dz-filename').text());
            let shortcode = UriToMarkdown(uri);
            this.dropzone.disable();
            target.addClass('hide-backface');
            e.originalEvent.dataTransfer.effectAllowed = 'copy';
            e.originalEvent.dataTransfer.setData('text', shortcode);
        });

        this.container.delegate('.dz-preview', 'dragend', (e) => {
            let target = $(e.currentTarget);
            this.dropzone.enable();
            target.removeClass('hide-backface');
        });
    }
}

export let Instance = new PageMedia();


text:
package ro.gov.ithub.infotranspub.gtfs;
import java.lang.String;

public class ShapesEntity {

	private int id = 0;

	public ShapesEntity() {
		this.id = 0;
	}

	protected void setId (int id){
		this.id = id;
	}

	public int 	getId(){ return id; }
}


text:
'use strict';

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

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _class, _class2, _temp; /**
                             * @fileOverview X Axis
                             */

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _PureRender = require('../util/PureRender');

var _PureRender2 = _interopRequireDefault(_PureRender);

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

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var XAxis = (0, _PureRender2.default)(_class = (_temp = _class2 = function (_Component) {
  _inherits(XAxis, _Component);

  function XAxis() {
    _classCallCheck(this, XAxis);

    return _possibleConstructorReturn(this, (XAxis.__proto__ || Object.getPrototypeOf(XAxis)).apply(this, arguments));
  }

  _createClass(XAxis, [{
    key: 'render',
    value: function render() {
      return null;
    }
  }]);

  return XAxis;
}(_react.Component), _class2.displayName = 'XAxis', _class2.propTypes = {
  allowDecimals: _react.PropTypes.bool,
  hide: _react.PropTypes.bool,
  // The name of data displayed in the axis
  name: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]),
  // The unit of data displayed in the axis
  unit: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]),
  // The unique id of x-axis
  xAxisId: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]),
  domain: _react.PropTypes.arrayOf(_react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number, _react.PropTypes.oneOf(['auto', 'dataMin', 'dataMax'])])),
  // The key of data displayed in the axis
  dataKey: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]),
  // The width of axis which is usually calculated internally
  width: _react.PropTypes.number,
  // The height of axis, which need to be setted by user
  height: _react.PropTypes.number,
  // The orientation of axis
  orientation: _react.PropTypes.oneOf(['top', 'bottom']),
  type: _react.PropTypes.oneOf(['number', 'category']),
  // Ticks can be any type when the axis is the type of category
  // Ticks must be numbers when the axis is the type of number
  ticks: _react.PropTypes.array,
  // The count of ticks
  tickCount: _react.PropTypes.number,
  // The formatter function of tick
  tickFormatter: _react.PropTypes.func,
  padding: _react.PropTypes.shape({
    left: _react.PropTypes.number,
    right: _react.PropTypes.number
  }),
  allowDataOverflow: _react.PropTypes.bool
}, _class2.defaultProps = {
  allowDecimals: true,
  hide: false,
  orientation: 'bottom',
  width: 0,
  height: 30,
  xAxisId: 0,
  tickCount: 5,
  type: 'category',
  domain: [0, 'auto'],
  padding: { left: 0, right: 0 },
  allowDataOverflow: false
}, _temp)) || _class;

exports.default = XAxis;


text:
describe('WalkontableWheel', function () {
  var $table
    , debug = false;

  beforeEach(function () {
    $table = $('

'); //create a table that is not attached to document
    $table.appendTo('body');
    createDataArray();
  });

  afterEach(function () {
    if (!debug) {
      $('.wtHolder').remove();
    }
  });

  it("scroll down one row", function () {
    var wt = new Walkontable({
      table: $table[0],
      data: getData,
      totalRows: getTotalRows,
      totalColumns: getTotalColumns,
      offsetRow: 0,
      offsetColumn: 0,
      height: 200,
      width: 100
    });
    wt.draw();
    expect(wt.wtTable.getCoords($table.find('tbody tr:eq(0) td:eq(0)')[0])).toEqual([0, 0]);

    $table.trigger('mousewheel', [null, null, -1]); //deltaY -1 means mouse wheel scrolled down

    waits(0); //mousewheel runs in async

    runs(function(){
      expect(wt.wtTable.getCoords($table.find('tbody tr:eq(0) td:eq(0)')[0])).toEqual([1, 0]);
    });
  });

  it("scroll down one row (wheel on parent, which sometimes is visible after scrolling to last row)", function () {
    var wt = new Walkontable({
      table: $table[0],
      data: getData,
      totalRows: getTotalRows,
      totalColumns: getTotalColumns,
      offsetRow: 0,
      offsetColumn: 0,
      height: 200,
      width: 100
    });
    wt.draw();
    expect(wt.wtTable.getCoords($table.find('tbody tr:eq(0) td:eq(0)')[0])).toEqual([0, 0]);

    $table.parent().trigger('mousewheel', [null, null, -1]); //deltaY -1 means mouse wheel scrolled down

    waits(0); //mousewheel runs in async

    runs(function(){
      expect(wt.wtTable.getCoords($table.find('tbody tr:eq(0) td:eq(0)')[0])).toEqual([1, 0]);
    });
  });
});


text:
"use strict"

const DarkQuest = require("node-quest");
const Equipment = DarkQuest.Equipment;
const Parameter = DarkQuest.Parameter;
const Weapon    = DarkQuest.Weapon;
const User      = DarkQuest.User;
const Status    = DarkQuest.Status;
const HitRate   = DarkQuest.HitRate;
const Critical  = DarkQuest.Critical;
const HitPoint  = DarkQuest.HitPoint;
const MagicPoint= DarkQuest.MagicPoint;
const Spell     = DarkQuest.Spell;
const AttackEffect = DarkQuest.Effect.AttackEffect;
const CureEffect   = DarkQuest.Effect.CureEffect;
const StatusEffect = DarkQuest.Effect.StatusEffect;
const MindAttackEffect = DarkQuest.Effect.MindAttackEffect;
const MindCureEffect = DarkQuest.Effect.MindCureEffect;
const StatusValues = DarkQuest.StatusValues;
const Feedback = require("./spell/Feedback.js");
const DrainFeedback = Feedback.DrainFeedback;
const MagicDrainFeedback = Feedback.MagicDrainFeedback;

class MonsterRepositoryOnMemory {
    constructor() {
        this.monsters = [];
    }

    get() {
        return this.monsters;
    }

    getByName(name) {
        return this.get().filter((m) => m.name === name).pop() || null;
    }

    put(monster) {
        monster.hitPoint.on("changed", (data) => {
            if (data.next.empty()) {
                this.remove(monster.name);
            }
        });
        this.monsters = this.monsters.concat([monster]);
        return this.monsters;
    }

    remove(name) {
        this.monsters = this.monsters.filter((m) => m.name !== name);
    }

}

module.exports = MonsterRepositoryOnMemory;


text:
package com.tuvistavie.xserver.backend.protocol.types

abstract class Value extends KnownSize {
  type T
  val value: T
}

trait KnownSize {
  def byteSize: Int
}

trait SingleByte extends KnownSize {
  override def byteSize = 1
}

trait DoubleByte extends KnownSize {
  override def byteSize = 2
}

trait FourBytes extends KnownSize {
  override def byteSize = 4
}


text:
<?php

namespace Tests\unit\WindowsAzure\ServiceRuntime\Internal;

use org\bovigo\vfs\vfsStream;
use org\bovigo\vfs\vfsStreamDirectory;
use org\bovigo\vfs\vfsStreamWrapper;
use WindowsAzure\ServiceRuntime\Internal\FileInputChannel;
use WindowsAzure\ServiceRuntime\Internal\RuntimeVersionProtocolClient;
use WindowsAzure\ServiceRuntime\Internal\RuntimeVersionManager;

/**
 * Unit tests for class RuntimeVersionManager.
 *
 * @category  Microsoft
 *
 * @author    Azure PHP SDK <azurephpsdk@microsoft.com>
 * @copyright 2012 Microsoft Corporation
 * @license   http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
 *
 * @version   Release: 0.4.4_2016-08
 *
 * @link      https://github.com/windowsazure/azure-sdk-for-php
 */
class RuntimeVersionManagerTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @covers WindowsAzure\ServiceRuntime\Internal\RuntimeVersionManager::__construct
     */
    public function testConstruct()
    {
        // Setup
        $runtimeVersionManager = new RuntimeVersionManager(null);

        // Test
        $this->assertInstanceOf(
            'WindowsAzure\ServiceRuntime\Internal\RuntimeVersionManager',
            $runtimeVersionManager);
    }

    /**
     * @covers WindowsAzure\ServiceRuntime\Internal\RuntimeVersionManager::getRuntimeClient
     */
    public function testGetRuntimeClientInvalid()
    {
        // Setup
        $rootDirectory = 'root';

        vfsStreamWrapper::register();
        vfsStreamWrapper::setRoot(new vfsStreamDirectory($rootDirectory));

        // Fake version will force the exception
        $fileName = 'versionendpoint';
        $fileContent = '<?xml version="1.0" encoding="utf-8"?>'.
            '<RuntimeServerDiscovery xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '.
            'xmlns:xsd="http://www.w3.org/2001/XMLSchema">'.
            '<RuntimeServerEndpoints>'.
            '<RuntimeServerEndpoint version="2099-03-08" path="myPath1" />'.
            '</RuntimeServerEndpoints>'.
            '</RuntimeServerDiscovery>';

        $file = vfsStream::newFile($fileName);
        $file->setContent($fileContent);

        vfsStreamWrapper::getRoot()->addChild($file);

        $runtimeVersionProtocolClient =
            new RuntimeVersionProtocolClient(new FileInputChannel());

        $runtimeVersionManager = new RuntimeVersionManager(
            $runtimeVersionProtocolClient
        );

        // Test
        $this->setExpectedException(get_class(new \RuntimeException()));
        $runtimeVersionManager->getRuntimeClient(
            vfsStream::url($rootDirectory.'/'.$fileName)
        );
    }

    /**
     * @covers WindowsAzure\ServiceRuntime\Internal\RuntimeVersionManager::getRuntimeClient
     */
    public function testGetRuntimeClient()
    {
        // Setup
        $rootDirectory = 'root';

        vfsStreamWrapper::register();
        vfsStreamWrapper::setRoot(new vfsStreamDirectory($rootDirectory));

        $fileName = 'versionendpoint';
        $fileContent = '<?xml version="1.0" encoding="utf-8"?>'.
            '<RuntimeServerDiscovery xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '.
            'xmlns:xsd="http://www.w3.org/2001/XMLSchema">'.
            '<RuntimeServerEndpoints>'.
            '<RuntimeServerEndpoint version="2011-03-08" path="myPath1" />'.
            '</RuntimeServerEndpoints>'.
            '</RuntimeServerDiscovery>';

        $file = vfsStream::newFile($fileName);
        $file->setContent($fileContent);

        vfsStreamWrapper::getRoot()->addChild($file);

        $runtimeVersionProtocolClient =
            new RuntimeVersionProtocolClient(new FileInputChannel());

        $runtimeVersionManager = new RuntimeVersionManager(
            $runtimeVersionProtocolClient
        );

        $runtimeClient = $runtimeVersionManager->getRuntimeClient(
            vfsStream::url($rootDirectory.'/'.$fileName)
        );

        // Test
        $this->assertNotEquals(null, $runtimeClient);
    }
}


text:
set work work
#--------------------------------------------------------------------------------
mkdir work

ncvlog -work work ../../implement/results/routed.v

echo "Compiling Test Bench Files"

ncvhdl -v93 -work work    ../bmg_tb_pkg.vhd
ncvhdl -v93 -work work    ../random.vhd
ncvhdl -v93 -work work    ../data_gen.vhd
ncvhdl -v93 -work work    ../addr_gen.vhd
ncvhdl -v93 -work work    ../checker.vhd
ncvhdl -v93 -work work    ../bmg_stim_gen.vhd
ncvhdl -v93 -work work    ../ram_16x1k_dp_synth.vhd
ncvhdl -v93 -work work    ../ram_16x1k_dp_tb.vhd

echo "Compiling SDF file"
ncsdfc ../../implement/results/routed.sdf -output ./routed.sdf.X

echo "Generating SDF command file"
echo 'COMPILED_SDF_FILE = "routed.sdf.X",' > sdf.cmd
echo 'SCOPE = :ram_16x1k_dp_synth_inst:BMG_PORT,' >> sdf.cmd
echo 'MTM_CONTROL = "MAXIMUM";' >> sdf.cmd

echo "Elaborating Design"
ncelab -access +rwc glbl -sdf_cmd_file sdf.cmd $work.ram_16x1k_dp_tb

echo "Simulating Design"
ncsim -gui -input @"simvision -input wave_ncsim.sv" $work.ram_16x1k_dp_tb


text:
package com.coreoz.plume.admin.services.scheduled.bean;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@AllArgsConstructor
public class AdminSchedulerThreadStats {
    private int activeThreads;
    private int inactiveThreads;
    private int minThreads;
    private int maxThreads;
    private int largestPoolSize;
}


text:
package org.codegist.common.log;

import java.io.Serializable;

/**
 * Apache commons logging Logger implementation
 *
 * @author Laurent Gilles (laurent.gilles@codegist.org)
 */
public class ApacheCommonsLogger extends AbstractLogger implements Serializable {

    private final transient org.apache.commons.logging.Log logger;

    public ApacheCommonsLogger(String name) {
        this.logger = org.apache.commons.logging.LogFactory.getLog(name);
    }

    @Override
    protected void logError(Object message, Throwable e) {
        logger.error(message, e);
    }

    @Override
    protected void logError(Object message) {
        logger.error(message);
    }

    @Override
    protected void logWarn(Object message, Throwable e) {
        logger.warn(message, e);
    }

    @Override
    protected void logWarn(Object message) {
        logger.warn(message);
    }

    @Override
    protected void logInfo(Object message, Throwable e) {
        logger.info(message, e);
    }

    @Override
    protected void logInfo(Object message) {
        logger.info(message);
    }

    @Override
    protected void logDebug(Object message, Throwable e) {
        logger.debug(message, e);
    }

    @Override
    protected void logDebug(Object message) {
        logger.debug(message);
    }

    @Override
    protected void logTrace(Object message, Throwable e) {
        logger.trace(message, e);
    }

    @Override
    protected void logTrace(Object message) {
        logger.trace(message);
    }

    public boolean isErrorOn() {
        return logger.isErrorEnabled();
    }

    public boolean isWarnOn() {
        return logger.isWarnEnabled();
    }

    public boolean isInfoOn() {
        return logger.isInfoEnabled();
    }

    public boolean isDebugOn() {
        return logger.isDebugEnabled();
    }

    public boolean isTraceOn() {
        return logger.isTraceEnabled();
    }
}


text:
import javax.swing.JFrame;

public class DrawingTest extends JFrame
{
    public static void main(String[] args)
    {
        DrawFrame app =new DrawFrame();

        app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        app.setSize(500,500);
        app.setVisible(true);
    }
}


text:
<?php

namespace Laminas\Validator;

use function is_string;
use function preg_match;

/**
 * Uuid validator.
 */
final class Uuid extends AbstractValidator
{
    /**
     * Matches Uuid's versions 1 to 5.
     */
    public const REGEX_UUID = '/^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/';

    public const INVALID    = 'valueNotUuid';
    public const NOT_STRING = 'valueNotString';

    /** @var array */
    protected $messageTemplates = [
        self::NOT_STRING => 'Invalid type given; string expected',
        self::INVALID    => 'Invalid UUID format',
    ];

    /**
     * Returns true if and only if $value meets the validation requirements.
     *
     * If $value fails validation, then this method returns false, and
     * getMessages() will return an array of messages that explain why the
     * validation failed.
     *
     * @param mixed $value
     * @return bool
     * @throws Exception\RuntimeException If validation of $value is impossible.
     */
    public function isValid($value)
    {
        if (! is_string($value)) {
            $this->error(self::NOT_STRING);
            return false;
        }

        $this->setValue($value);

        if (
            empty($value)
            || $value !== '00000000-0000-0000-0000-000000000000'
            && ! preg_match(self::REGEX_UUID, $value)
        ) {
            $this->error(self::INVALID);
            return false;
        }

        return true;
    }
}


text:
import { Meteor } from 'meteor/meteor';
import { Harvests } from '/imports/api/harvests/harvests.js';
import { Accounts } from 'meteor/accounts-base';
import { Roles } from 'meteor/alanning:roles';
import { Organizations } from '/imports/api/organizations/organizations.js';

function insertHarvests() {
  Harvests.insert({name: 'Example WAF',
                   url: 'http://sos.maracoos.org/maracoos-iso/',
                   organization: 'MARACOOS',
                   harvest_interval: 1,
                   harvest_type: 'WAF',
                   harvest_contact: 'test@test.com'});
}

function insertUsers() {
  Accounts.createUser({
    username: "admin",
    email: "admin@ioos.us",
    password: Meteor.settings.adminPassword || "testadmin",
    profile:{
      name: "Admin",
      email: "admin@ioos.us",
      organization: "IOOS"
    }
  });
  Roles.addUsersToRoles(Accounts.findUserByEmail('admin@ioos.us'), ['admin', 'approved']);
  Accounts.createUser({
    username: "lcampbell",
    email: "lcampbell@ioos.us",
    password: "bobpass",
    profile:{
      name: "Luke Campbell",
      email: "lcampbell@ioos.us",
      organization: "IOOS"
    }
  });
  Roles.addUsersToRoles(Accounts.findUserByEmail('lcampbell@ioos.us'), ['approved']);
  Accounts.createUser({
    username: "badams",
    email: "badams@ioos.us",
    password: "bobpass",
    profile:{
      name: "Ben Adams",
      email: "badams@ioos.us",
      organization: "IOOS"
    }
  });
  Meteor.users.update({}, {$set:{"emails.0.verified":true}}, {multi: true});
}

function insertOrganizations() {
  Organizations.insert({
    name: "IOOS",
    description: "U.S. Integrated Ocean Observing System",
    url: "http://ioos.us/",
    logo_url: "http://data.ioos.us/ioos_logo.png"
  });
  Organizations.insert({
    name: "AOOS",
    description: "Alaskan Ocean Observing System",
    url: "http://aoos.org",
    logo_url: "http://www.aoos.org/wp-content/uploads/2012/09/AOOS_logo.jpg"
  });
  Organizations.insert({
    name: "CariCOOS",
    description: "CarICOOS is the observing arm of the Caribbean Regional Association for Integrated Coastal Ocean Observing (CaRA) http://cara.uprm.edu/. This effort, funded by the NOAA IOOS office http://ioos.noaa.gov/, is one of eleven coastal observing systems and regional associations which along with federal agencies constitute the national coastal component of the US Integrated Ocean Observing System.",
    url: "http://www.caricoos.org/",
  });
  Organizations.insert({
    name: "CDIP",
    description: "The Coastal Data Information Program (CDIP) measures, analyzes, archives, and disseminates coastal environment data for use by coastal engineers, planners, and managers as well as scientists and mariners.",
    url: "https://cdip.ucsd.edu/",
    logo_url: "http://catalog.ioos.us/static/img/np/cdip.png",
  });
  Organizations.insert({
    name: "CenCOOS",
    description: "The Central and Northern California Ocean Observing System (CeNCOOS) is one of eleven regional associations within the Integrated Ocean Observing System (IOOS) around the nation dedicated to the support of science in the service of marine ecosystem health and resource sustainability.",
    url: "http://www.cencoos.org/",
    logo_url: "http://catalog.ioos.us/static/img/ra/cencoos.jpg"
  });
  Organizations.insert({
    name: "GCOOS",
    description: "The Gulf of Mexico Coastal Ocean Observing System (GCOOS) provides timely information about the environment of the United States portion of the Gulf of Mexico and its estuaries for use by decision-makers, including researchers, government managers, industry, the military, educators, emergency responders, and the general public.",
    url: "http://gcoos.org/",
    logo_url: "http://catalog.ioos.us/static/img/ra/gcoos.jpg"
  });
  Organizations.insert({
    name: "COMT",
    description: "U.S. Integrated Ocean Observing System's Coastal and Ocean Modeling Testbed",
    url: "http://testbed.sura.org/",
    logo_url: "http://data.ioos.us/ioos_logo.png"
  });
  Organizations.insert({
    name: "GLOS",
    description: "GLOS is one of 11 Regional Associations of the Integrated Ocean Observing System (IOOS), working to enhance the ability to collect, deliver, and use ocean and Great Lakes information. IOOS is a partnership among federal, regional, academic and private sector parties that works to provide new tools and forecasts to improve safety, enhance the economy, and protect our environment.",
    url: "http://glos.us/",
    logo_url: "http://data.glos.us/portal/img/gloslogo_2x.png"
  });
  Organizations.insert({
    name: "HF Radar DAC",
    description: "U.S. Integrated Ocean Observing System's HF Radar Data Assembly Center",
    logo_url: "http://data.ioos.us/ioos_logo.png"
  });
  Organizations.insert({
    name: "Glider DAC",
    description: "U.S. Integrated Ocean Observing System's National Glider Data Assembly Center",
    url: "http://gliders.ioos.us/",
    logo_url: "http://gliders.ioos.us/static/img/flying_glider.jpg"
  });
  Organizations.insert({
    name: "MARACOOS",
    description: "Mid-Atlantic Regional Association Coastal and Ocean Observing System",
    url: "http://maracoos.org/",
    logo_url: "https://pbs.twimg.com/profile_images/1384705096/MARACOOS_round_transparent.png"
  });
  Organizations.insert({
    name: "NANOOS",
    description: "The Northwest Association of Networked Ocean Observing Systems (NANOOS) is the Regional Association of the national Integrated Ocean Observing System (IOOS) in the Pacific Northwest, primarily Washington and Oregon. NANOOS has strong ties with the observing programs in Alaska and British Columbia through our common purpose and the occasional overlap of data and products.",
    url: "http://nanoos.org/",
    logo_url: "http://catalog.ioos.us/static/img/ra/nanoos.png"
  });
  Organizations.insert({
    name: "US Navy",
    description: "United States Navy partnering with NOAA and IOOS",
    url: "http://www.public.navy.mil/fltfor/cnmoc/Pages/home.aspx",
    logo_url: "http://catalog.ioos.us/static/img/np/logoNavy.jpg"
  });
  Organizations.insert({
    name: "NOAA NDBC",
    description: "NOAA National Data Buoy Center",
    url: "http://www.ndbc.noaa.gov/",
    logo_url: "http://catalog.ioos.us/static/img/np/NOAA-Transparent-Logo.png"
  });
  Organizations.insert({
    name: "NOAA NOS",
    description: "NOAA National Ocean Service",
    url: "http://oceanservice.noaa.gov/",
    logo_url: "http://catalog.ioos.us/static/img/np/NOAA-Transparent-Logo.png"
  });
  Organizations.insert({
    name: "NERACOOS",
    description: "NERACOOS, the Northeastern Regional Association of Coastal Ocean Observing Systems, is collecting and delivering quality and timely ocean and weather information to users throughout the Northeast United States and Canadian Maritimes. To achieve this, NERACOOS supports integrated coastal and ocean observing and modeling activities that feed user defined information products. NERACOOS works collaboratively with regional and local partners including the Northeast Regional Ocean Council (NROC), a state and federal partnership created by the six New England governors.",
    url: "http://neracoos.org/",
    logo_url: "http://catalog.ioos.us/static/img/ra/neracoos.png"
  });
  Organizations.insert({
    name: "SCCOOS",
    description: "SCCOOS brings together coastal observations in the Southern California Bight to provide information necessary to address issues in climate change, ecosystem preservation and management, coastal water quality, maritime operations, coastal hazards and national security. As a science-based decision support system, SCCOOS works interactively with local, state and federal agencies, resource managers, industry, policy makers, educators, scientists and the general public to provide data, models and products that advance our understanding of the current and future state of our coastal and global environment.",
    url: "http://sccoos.org/"
  });
  Organizations.insert({
    name: "PacIOOS",
    description: "PacIOOS is one of eleven regional observing programs in the U.S. that are supporting the emergence of the U.S. Integrated Ocean Observing System (IOOS) under the National Oceanographic Partnership Program (NOPP). The PacIOOS region includes the U.S. Pacific Region (Hawaii, Guam, American Samoa, Commonwealth of the Northern Mariana Islands), the Pacific nations in Free Association with the U.S. (Republic of the Marshall Islands, Federated States of Micronesia, Republic of Palau), and the U.S. Minor Outlying Islands (Howland, Baker, Johnston, Jarvis, Kingman, Palmyra, Midway, Wake).",
    url: "http://pacioos.org/",
    logo_url: "http://www.pacioos.hawaii.edu/wp-content/uploads/2016/06/PacIOOS-logo-landscape-large.jpg"
  });
  Organizations.insert({
    name: "OceanSITES",
    url: "http://www.oceansites.org/",
    logo_url: "http://catalog.ioos.us/static/img/np/oceansites.gif"
  });
  Organizations.insert({
    name: "SECOORA",
    description: "SECOORA, the Southeast Coastal Ocean Observing Regional Association, is the regional solution to integrating coastal and ocean observing data and information in the Southeast United States. SECOORA is a 501(c)(3) nonprofit incorporated in September 2007 that coordinates coastal and ocean observing activities, and facilitates continuous dialogue among stakeholders so that the benefits from the sustained operation of a coastal and ocean observing system can be realized.",
    url: "http://secoora.org/",
    logo_url: "http://catalog.ioos.us/static/img/ra/secoora.png"
  });
  Organizations.insert({
    name: "USGS",
    description: "United States Geological Survey - Science for a Changing World",
    url: "http://usgs.gov/",
    logo_url: "http://catalog.ioos.us/static/img/np/usgs-logo-color.jpg"
  });
  Organizations.insert({
    name: "Other"
  });
}

// if the database is empty on server start, create some sample data.
Meteor.startup(function() {
  if (Harvests.find().count() === 0) {
    insertHarvests();
  }

  if(Meteor.users.find().count() === 0) {
    insertUsers();
  }

  if(Organizations.find().count() === 0) {
    insertOrganizations();
  }
});

Meteor.startup(function() {
  if(Meteor.settings.email && Meteor.settings.email.mail_url) {
    process.env.MAIL_URL = process.env.MAIL_URL || Meteor.settings.email.mail_url;
  }

  Accounts.emailTemplates.siteName = "IOOS Harvest Registry";
  Accounts.emailTemplates.from = "ioos.us Administrator <admin@ioos.us>";
  Accounts.emailTemplates.verifyEmail = {
    subject() {
      let siteName = Accounts.emailTemplates.siteName;
      return `Welcome to ${siteName}`;
    },
    text(user, url) {
      let emailAddress   = user.emails[0].address,
      urlWithoutHash = url.replace( '#/verify-email', 'users/verify' ),
      supportEmail   = (Meteor.settings.email && Meteor.settings.email.support_email) || "admin@ioos.us",
      emailBody      = `To verify your email address (${emailAddress}) visit the following link:\n\n${urlWithoutHash}\n\n If you did not request this verification, please ignore this email. If you feel something is wrong, please contact our support team: ${supportEmail}.`;

    return emailBody;
    }
  };
  Accounts.emailTemplates.resetPassword = {
    subject() {
      let siteName = Accounts.emailTemplates.siteName;
      return `${siteName} Password Reset`;
    },
    text(user, url) {
      let urlWithoutHash = url.replace( '#/reset-password', 'users/reset' ),
      emailBody = `Someone has requested a password reset for this account.\n\nPlease proceed to ${urlWithoutHash} to reset your user account password.`;
      return emailBody;
    }
  };

});


text:
Run `dart example/client.dart`. The client will start up a worker process, send
a single work request, read a file written by the worker, then terminate the
worker.


text:
import CommunityApp from '../app/communityApp';
import { id, createdBy, dtChanged } from '../../core/api/entityBaseGraphQL';

import {
 GraphQLObjectType,
 GraphQLString
} from 'graphql';

import {

} from 'graphql-relay';

function CommunitySchema(db){

    var communityApp = CommunityApp(db);

    var communityType = new GraphQLObjectType({
        name: 'Community',
        fields: () => ({
            id,
            name: {type: GraphQLString},
            createdBy,
            dtChanged
        })
    });
}

export default CommunitySchema;


text:
require 'spec_helper'

describe Guard::Notifier::FileNotifier do
  let(:notifier) { described_class.new }

  describe '.available?' do
    it 'returns true if there is a file in options' do
      expect(described_class).to be_available(path: '.guard_result')
    end

    it 'returns false if there is no path in options' do
      expect(described_class).not_to be_available
    end
  end

  describe '.notify' do
    context 'with options passed at initialization' do
      let(:notifier) { described_class.new(path: 'tmp/guard_result', silent: true) }

      it 'uses these options by default' do
        expect(File).to receive(:write).with('tmp/guard_result', "success\nany title\nany message\n")

        notifier.notify('any message', title: 'any title')
      end

      it 'overwrites object options with passed options' do
        expect(File).to receive(:write).with('tmp/guard_result_final', "success\nany title\nany message\n")

        notifier.notify('any message', title: 'any title', path: 'tmp/guard_result_final')
      end
    end

    it 'writes to a file on success' do
      expect(File).to receive(:write).with('tmp/guard_result', "success\nany title\nany message\n")

      notifier.notify('any message', title: 'any title', path: 'tmp/guard_result')
    end

    it 'also writes to a file on failure' do
      expect(File).to receive(:write).with('tmp/guard_result', "failed\nany title\nany message\n")

      notifier.notify('any message', type: :failed, title: 'any title', path: 'tmp/guard_result')
    end

    # We don't have a way to return false in .available? when no path is
    # specified. So, we just don't do anything in .notify if there's no path.
    it 'does not write to a file if no path is specified' do
      expect(File).to_not receive(:write)
      expect(::Guard::UI).to receive(:error).with ":file notifier requires a :path option"

      notifier.notify('any message')
    end
  end

end


text:
ModuleDroitDetails.ModulesModule = ModuleDroitDetails.ModulesModule || (function () {
    //args:
    //  panelID
    //  vueID

    var _args = {};

    return {
        init: function (args) {
            _args = $.extend({
                tabClass: "tabs-infos"
            }, args);
        },

        start: function () {
            $("#" + _args.panelID + " ." + _args.tabClass).basicTabs();

            var jsonData = Func.getPanelJsonData(_args.panelID);

            var entityViewModel = function () {
                var self = this;
                self.vueID = _args.vueID;
                self.panelID = _args.panelID;
                self.data = ko.mapping.fromJSON(jsonData);
                self.changeTracker = new ko.ChangeTracker(self.data, self.data.DroitID() > 0);

                self.save = function () {
                    Func.post({
                        urlCode: "DROITS_SAVE_MODULES",
                        data: ko.mapping.toJSON(self.data),
                        panelID: self.panelID,
                        reloadPanel: true,
                        failCallback: function (jqXHR, textStatus, errorThrown) {
                            if (jqXHR.status === 409) {
                                Func.HandleConflict(self.panelID, ko.mapping.toJSON(self.data), Func.getUrl("DROITS_DETAILS", { id: self.data.DroitID(), vueID: self.vueID }), Resources.GroupeVue.DroitDetails);
                            }
                        }
                    });
                };

                self.cancel = function () {
                    Func.cancelPanel(self.panelID);
                };

            }

            var viewModel = function () {
                var self = this;
                self.vueID = _args.vueID;
                self.panelID = _args.panelID;
                self.entity = new entityViewModel();
                self.isModeConflict = Func.getTabType(self.panelID) === Enums.TypeTab.Conflict;

                //Abonnement aux actions générales
                Vars.PostboxSubscriptions.push(new Types.PostboxSubscription(self.panelID,
                    ko.postbox.subscribe(Enums.PostboxNotifiers.ActionGeneralExecution, function (data) {
                        if (Vars.CurrentVue.vueID == self.vueID && Vars.CurrentVue.panelID == self.panelID) {
                            switch (data.typeActionID) {
                                case (Resources.TypeAction.Save):
                                    self.entity.save();
                                    break;
                                case (Resources.TypeAction.Cancel):
                                    self.entity.cancel();
                                    break;
                                case (Resources.TypeAction.Export):
                                    self.entity.export();
                                    break;
                                default:
                                    Utils.consoleLog('ModuleDroitDetails.ModulesModule : Action "' + data.typeActionID + '" indéfinie');
                            }
                        }
                    })
                    )
               );

                self.toggleTreeViewChildren = function (data, event) {
                    $(event.target).closest('li').children('ul').toggle();
                    $(event.target).closest('li').toggleClass('closed');
                    $(event.target).closest('li').children('.' + Static.TreeViewCocherDecherToutClass).toggleClass('hidden');
                };
            }

            var vm = new viewModel();
            ko.applyBindings(vm, document.getElementById(vm.panelID));

            if (self.isModeConflict) {
                var serverJsonData = JSON.parse($("#" + vm.panelID).find("." + Static.ScriptServerDataClass).html());
                Utils.copyJsToKO(serverJsonData, vm.entity.data);
            }
        }
    };
}());


text:
/*
 * ScriptImageVerification.java
 *
 * Created on January 6, 2009, 7:26 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package scripteditor;

/**
 *
 * @author Ben
 */
public class ScriptImageVerification extends IQImageVerification {
    String mScriptName;
    String mSessionName;
    String mScriptFileName;
    boolean italic=false;
    /** Creates a new instance of ScriptImageVerification */
    public ScriptImageVerification(SessionInfo session,boolean fontItalic) {
        super(session,fontItalic);
        mScriptName = session.mScriptName;
        mSessionName = session.mSessionName;
        mScriptFileName = session.mScriptFileName;
    }

    @Override
    public void SaveResult(){
        ScriptResult rs;
        rs = new ScriptResult("Image Verification", mSessionInfo.mTaxaLevel, mSessionInfo.mTaxa, mSessionInfo.mUserName,
                    mGrade.getGradeInstance().FinalGrade(), mScriptName, mSessionName, mGrade.getGradeInstance().TotalQuestions(),
                    mSessionInfo.mImageCollection.NumberOfImages(), mScriptFileName);
        rs.writeResults();
    }
}


text:
#include <regex>
#include "util.h"

/**
 * Puts this operand's value in the given register. Only requires
 * the use of the one register.
 */
void operandValueToReg(Parser *parser,
                       const Operand& operand,
                       const std::string& reg) {
  if (OperandType::ADDRESS == operand.type()) {
    parser->writeInst("POP " + reg);
    parser->writeInst("LOAD " + reg + " " + reg);
  } else if (OperandType::REGISTER == operand.type()) {
    parser->writeInst("MOV " + reg + " " + operand.reg());
  } else if (OperandType::VALUE == operand.type()) {
    parser->writeInst("POP " + reg);
  } else if (OperandType::LITERAL == operand.type()) {
    parser->writeInst("MOVI " + reg + " " + toHexStr(operand.literal()));
  }
}

/**
 * Returns a hex string of the form "0x0000" for the
 * given value, where digits is the number of digits after
 * the "0x".
 */
std::string toHexStr(uint16_t value, int digits) {
  std::string str;
  for (int i = 0; i < digits; i++) {
    uint8_t next = value & 0xf;
    value >>= 4;
    str = (char)(next <= 9 ? '0' + next : 'a' - 10 + next) + str;
  }
  return "0x" + str;
}

/**
 * Returns the opposing paranthesis for (), [], or {} pairs.
 * Returns an empty string if the input is not one of the above.
 */
std::string otherParen(const std::string& paren) {
  if ("(" == paren) {
    return ")";
  } else if (")" == paren) {
    return "(";
  } else if ("[" == paren) {
    return "]";
  } else if ("]" == paren) {
    return "[";
  } else if ("{" == paren) {
    return "}";
  } else if ("}" == paren) {
    return "{";
  }
  return "";
}

/**
 * Returns true if the given string is a valid name for a function,
 * variable, etc. A valid name starts with an alphabetic or underscore
 * character, and is followed by zero or more alphanumeric or
 * underscore characters.
 */
bool isValidName(const std::string& name) {
  return std::regex_match(name, std::regex("^[_a-zA-Z][_a-zA-Z0-9]*$"));
}

/**
 * Returns true if the given string is a valid label declaration.
 * A label declaration starts with a valid name and is followed by
 * a colon.
 */
bool isLabelDeclaration(const std::string& label) {
  return std::regex_match(label, std::regex("^[_a-zA-Z][_a-zA-Z0-9]*:$"));
}

/**
 * Returns true if the given funcName is a builtin function.
 */
bool isBuiltin(const std::string& funcName) {
  static std::vector<std::string> builtins = { "COLOR", "PIXEL", "TIMERST",
                                               "TIME", "INPUT", "RND" };
  return std::find(builtins.begin(), builtins.end(), funcName) != builtins.end();
}

/**
 * Searches through a vector of parameters and returns the one that matches
 * the given name, or a null pointer if the name was not found.
 */
std::shared_ptr<ParamToken> getParameter(
      const std::string& name,
      const std::vector<std::shared_ptr<ParamToken>>& parameters) {
  for (auto param : parameters) {
    if (param->name() == name) {
      return param;
    }
  }
  return nullptr;
}

/**
 * Searches through a vector of local variables and returns the one that
 * matches the given name, or a null pointer if the name was not found.
 */
std::shared_ptr<LocalVarToken> getLocal(
      const std::string& name,
      const std::vector<std::shared_ptr<LocalVarToken>>& locals) {
  for (auto local : locals) {
    if (local->name() == name) {
      return local;
    }
  }
  return nullptr;
}

/**
 * Searches through a vector of functions and returns the one that matches
 * the given name, or a null pointer if the name was not found.
 */
std::shared_ptr<FunctionToken> getFunction(
      const std::string& name,
      const std::vector<std::shared_ptr<FunctionToken>>& functions) {
  for (auto func : functions) {
    if (func->name() == name) {
      return func;
    }
  }
  return nullptr;
}

/**
 * Searches through a vector of globals and returns the one that matches
 * the given name, or a null pointer if the name was not found.
 */
std::shared_ptr<GlobalVarToken> getGlobal(
     const std::string& name,
     const std::vector<std::shared_ptr<GlobalVarToken>>& globals) {
  for (auto global : globals) {
    if (global->name() == name) {
      return global;
    }
  }
  return nullptr;
}

/**
 * Searches through a vector of labels and returns the one that matches
 * the given name, or a null pointer if the name was not found.
 */
std::shared_ptr<LabelStatement> getLabel(
      const std::string& name,
      const std::vector<std::shared_ptr<LabelStatement>>& labels) {
  for (auto label : labels) {
    if (label->name() == name) {
      return label;
    }
  }
  return nullptr;
}

/**
 * Returns true if the given string names a valid type. There
 * are only a few valid types right now so this function
 * is a bit crude.
 */
bool isType(const std::string& type) {
  return "void" == type ||  "uint16" == type;
}

/**
 * Prints an error message with the given line number.
 */
void _error(const std::string& msg, int lineNum) {
  // TODO: It would be nice to have error messages that showed you
  // the source line and pointed to the token causing an error.
  std::cerr << "Error:";
  if (0 < lineNum) {
    std::cerr << lineNum << ":";
  }
  std::cerr << " " << msg << std::endl;
}

/**
 * Prints a warning message with the given line number.
 */
void _warn(const std::string& msg, int lineNum) {
  std::cerr << "Warning:";
  if (0 < lineNum) {
    std::cerr << lineNum << ":";
  }
  std::cerr << " " << msg << std::endl;
}

/**
 * Consumes the next token, and prints an error message and returns
 * false if it finds EOF or a token other than the one it was
 * expecting. Returns true if the next token was the expected token.
 */
bool _expect(Tokenizer *tokenizer, const std::string& str, bool errors) {
  AtomToken t = tokenizer->getNext();
  if (t.str().empty()) {
    if (errors) {
      _error("Unexpected EOF, expected '" + str + "'.", t.line());
    }
    return false;
  } else if (str != t.str()) {
    if (errors) {
      _error("Unexpected token '" + t.str() + "', expected '" + str + "'.",
             t.line());
    }
    return false;
  }
  return true;
}


text:
.. _twitterfeed:

The twitterfeed plugin
======================

The `twitterfeed` plugin provides two widgets to display at the web site:

  .. image:: /images/plugins/twitterfeed-user-admin.*
     :width: 732px
     :height: 310px

|

  .. image:: /images/plugins/twitterfeed-search-admin.*
     :width: 732px
     :height: 333px

The twitterfeed is fetched client-side by JavaScript, and can be styled using CSS.

Installation
------------

Install the dependencies via *pip*::

    pip install django-fluent-contents[twitterfeed]

This installs the twitter-text-py_ package.

Add the following settings to ``settings.py``:

.. code-block:: python

    INSTALLED_APPS += (
        'fluent_contents.plugins.twitterfeed',
    )

Configuration
-------------

The following settings are available:

.. code-block:: python

    FLUENT_TWITTERFEED_AVATAR_SIZE = 32
    FLUENT_TWITTERFEED_REFRESH_INTERVAL = 0
    FLUENT_TWITTERFEED_TEXT_TEMPLATE = "{avatar}{text} {time}"

FLUENT_TWITTERFEED_AVATAR_SIZE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Define the size of the user avatar to display.
Typical sizes are 16, 32 or 48 pixels.

FLUENT_TWITTERFEED_REFRESH_INTERVAL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Define after how many seconds all feeds should refresh.

FLUENT_TWITTERFEED_TEXT_TEMPLATE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Define the text layout of all twitter feeds.
Various fields of the JavaScript code are available to use. The most relevant are:

* ``{screen_name}``:  The user name.
* ``{avatar}``:  The avatar image tag.
* ``{text}``:  The text of the tweet
* ``{time}``:  the relative time
* ``{user_url}``:  The URL to the user profile
* ``{tweet_url}``:  The permalink URL of the twitter status.

.. _twitter-text-py: https://github.com/dryan/twitter-text-py


text:
using System.Collections.Generic;
using Azure.Core;

namespace Azure.ResourceManager.Workloads.Models
{
    /// <summary> Defines the request body for updating SAP Application Instance. </summary>
    public partial class SapApplicationServerInstancePatch
    {
        /// <summary> Initializes a new instance of SapApplicationServerInstancePatch. </summary>
        public SapApplicationServerInstancePatch()
        {
            Tags = new ChangeTrackingDictionary<string, string>();
        }

        /// <summary> Gets or sets the Resource tags. </summary>
        public IDictionary<string, string> Tags { get; }
    }
}


text:
<?php
namespace Ilios\CoreBundle\Tests\Service;

use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
use Ilios\CoreBundle\Service\LdapManager;

class LdapManagerTest extends TestCase
{

    public function testConstructor()
    {
        $obj = new LdapManager('url', 'user', 'password', 'searchBase', 'campusId', 'username');
        $this->assertTrue($obj instanceof LdapManager);
    }
}


text:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      tools:context="com.zargidigames.kpssgenelkultur.UnitsActivity">

</menu>


text:
using System;
using Xamarin.Forms;
using MeetupManager.Portable.Views;
using Xamarin.Forms.Platform.iOS;
using MeetupManager.iOS.PlatformSpecific;
using Xamarin.Auth;
using MeetupManager.Portable.Services;
using UIKit;

[assembly:ExportRenderer(typeof(LoginPage), typeof(LoginPageRenderer))]
namespace MeetupManager.iOS.PlatformSpecific
{
    public class LoginPageRenderer : PageRenderer
    {
        LoginPage page;
        public LoginPageRenderer()
        {
        }

        protected override void OnElementChanged (VisualElementChangedEventArgs e)
        {
            base.OnElementChanged (e);

            if (e.OldElement != null || Element == null)
                return;

            page = e.NewElement as LoginPage;

        }

        public override void ViewDidLoad ()
        {
            base.ViewDidLoad ();
            if (page == null)
                return;

            this.View.BackgroundColor = UIColor.FromRGBA (0, 0, 0, 0);
        }
        bool loginInProgress;

        public override async void ViewDidAppear (bool animated)
        {
            base.ViewDidAppear (animated);

            if (page == null || loginInProgress)
                return;

            loginInProgress = true;
            try
            {
                var auth = new OAuth2Authenticator(MeetupService.ClientId, MeetupService.ClientSecret, string.Empty, new Uri(MeetupService.AuthorizeUrl), new Uri(MeetupService.RedirectUrl), new Uri(MeetupService.AccessTokenUrl));

                auth.AllowCancel = true;
                auth.ShowUIErrors = false;
                // If authorization succeeds or is canceled, .Completed will be fired.
                auth.Completed += async (s, ee) => {
                    await DismissViewControllerAsync (true);
                    await page.Navigation.PopModalAsync ();
                    await page.ViewModel.FinishLogin(ee.IsAuthenticated, ee.Account == null ? null : ee.Account.Properties);
                    loginInProgress = false;
                };

                auth.Error += async (sender, e) =>
                    {
                        //await DismissViewControllerAsync (true);
                        //await page.Navigation.PopModalAsync ();
                        //await page.ViewModel.FinishLogin(false, null);
                        //loginInProgress = false;
                    };

                await PresentViewControllerAsync (auth.GetUI (), true);

            }
            catch(Exception ex) {
                Console.WriteLine (ex);
                await page.Navigation.PopModalAsync ();
                loginInProgress = false;
            }

        }
    }
}


text:
/*================================================================================
  code generated by: java2cpp
  author: Zoran Angelov, mailto://baldzar@gmail.com
  class: java.security.cert.X509CRLSelector
================================================================================*/

#ifndef J2CPP_INCLUDE_IMPLEMENTATION

#ifndef J2CPP_JAVA_SECURITY_CERT_X509CRLSELECTOR_HPP_DECL
#define J2CPP_JAVA_SECURITY_CERT_X509CRLSELECTOR_HPP_DECL

namespace j2cpp { namespace javax { namespace security { namespace auth { namespace x500 { class X500Principal; } } } } }
namespace j2cpp { namespace java { namespace lang { class Object; } } }
namespace j2cpp { namespace java { namespace lang { class String; } } }
namespace j2cpp { namespace java { namespace math { class BigInteger; } } }
namespace j2cpp { namespace java { namespace security { namespace cert { class CRL; } } } }
namespace j2cpp { namespace java { namespace security { namespace cert { class CRLSelector; } } } }
namespace j2cpp { namespace java { namespace security { namespace cert { class X509Certificate; } } } }
namespace j2cpp { namespace java { namespace util { class Date; } } }
namespace j2cpp { namespace java { namespace util { class Collection; } } }

#include <java/lang/Object.hpp>
#include <java/lang/String.hpp>
#include <java/math/BigInteger.hpp>
#include <java/security/cert/CRL.hpp>
#include <java/security/cert/CRLSelector.hpp>
#include <java/security/cert/X509Certificate.hpp>
#include <java/util/Collection.hpp>
#include <java/util/Date.hpp>
#include <javax/security/auth/x500/X500Principal.hpp>

namespace j2cpp {

namespace java { namespace security { namespace cert {

	class X509CRLSelector;
	class X509CRLSelector
		: public object<X509CRLSelector>
	{
	public:

		J2CPP_DECLARE_CLASS

		J2CPP_DECLARE_METHOD(0)
		J2CPP_DECLARE_METHOD(1)
		J2CPP_DECLARE_METHOD(2)
		J2CPP_DECLARE_METHOD(3)
		J2CPP_DECLARE_METHOD(4)
		J2CPP_DECLARE_METHOD(5)
		J2CPP_DECLARE_METHOD(6)
		J2CPP_DECLARE_METHOD(7)
		J2CPP_DECLARE_METHOD(8)
		J2CPP_DECLARE_METHOD(9)
		J2CPP_DECLARE_METHOD(10)
		J2CPP_DECLARE_METHOD(11)
		J2CPP_DECLARE_METHOD(12)
		J2CPP_DECLARE_METHOD(13)
		J2CPP_DECLARE_METHOD(14)
		J2CPP_DECLARE_METHOD(15)
		J2CPP_DECLARE_METHOD(16)
		J2CPP_DECLARE_METHOD(17)
		J2CPP_DECLARE_METHOD(18)

		explicit X509CRLSelector(jobject jobj)
		: object<X509CRLSelector>(jobj)
		{
		}

		operator local_ref<java::lang::Object>() const;
		operator local_ref<java::security::cert::CRLSelector>() const;

		X509CRLSelector();
		void setIssuers(local_ref< java::util::Collection >  const&);
		void setIssuerNames(local_ref< java::util::Collection >  const&);
		void addIssuer(local_ref< javax::security::auth::x500::X500Principal >  const&);
		void addIssuerName(local_ref< java::lang::String >  const&);
		void addIssuerName(local_ref< array<jbyte,1> >  const&);
		void setMinCRLNumber(local_ref< java::math::BigInteger >  const&);
		void setMaxCRLNumber(local_ref< java::math::BigInteger >  const&);
		void setDateAndTime(local_ref< java::util::Date >  const&);
		void setCertificateChecking(local_ref< java::security::cert::X509Certificate >  const&);
		local_ref< java::util::Collection > getIssuers();
		local_ref< java::util::Collection > getIssuerNames();
		local_ref< java::math::BigInteger > getMinCRL();
		local_ref< java::math::BigInteger > getMaxCRL();
		local_ref< java::util::Date > getDateAndTime();
		local_ref< java::security::cert::X509Certificate > getCertificateChecking();
		local_ref< java::lang::String > toString();
		jboolean match(local_ref< java::security::cert::CRL >  const&);
		local_ref< java::lang::Object > clone();
	}; //class X509CRLSelector

} //namespace cert
} //namespace security
} //namespace java

} //namespace j2cpp

#endif //J2CPP_JAVA_SECURITY_CERT_X509CRLSELECTOR_HPP_DECL

#else //J2CPP_INCLUDE_IMPLEMENTATION

#ifndef J2CPP_JAVA_SECURITY_CERT_X509CRLSELECTOR_HPP_IMPL
#define J2CPP_JAVA_SECURITY_CERT_X509CRLSELECTOR_HPP_IMPL

namespace j2cpp {

java::security::cert::X509CRLSelector::operator local_ref<java::lang::Object>() const
{
	return local_ref<java::lang::Object>(get_jobject());
}

java::security::cert::X509CRLSelector::operator local_ref<java::security::cert::CRLSelector>() const
{
	return local_ref<java::security::cert::CRLSelector>(get_jobject());
}

java::security::cert::X509CRLSelector::X509CRLSelector()
: object<java::security::cert::X509CRLSelector>(
	call_new_object<
		java::security::cert::X509CRLSelector::J2CPP_CLASS_NAME,
		java::security::cert::X509CRLSelector::J2CPP_METHOD_NAME(0),
		java::security::cert::X509CRLSelector::J2CPP_METHOD_SIGNATURE(0)
	>()
)
{
}

void java::security::cert::X509CRLSelector::setIssuers(local_ref< java::util::Collection > const &a0)
{
	return call_method<
		java::security::cert::X509CRLSelector::J2CPP_CLASS_NAME,
		java::security::cert::X509CRLSelector::J2CPP_METHOD_NAME(1),
		java::security::cert::X509CRLSelector::J2CPP_METHOD_SIGNATURE(1),
		void
	>(get_jobject(), a0);
}

void java::security::cert::X509CRLSelector::setIssuerNames(local_ref< java::util::Collection > const &a0)
{
	return call_method<
		java::security::cert::X509CRLSelector::J2CPP_CLASS_NAME,
		java::security::cert::X509CRLSelector::J2CPP_METHOD_NAME(2),
		java::security::cert::X509CRLSelector::J2CPP_METHOD_SIGNATURE(2),
		void
	>(get_jobject(), a0);
}

void java::security::cert::X509CRLSelector::addIssuer(local_ref< javax::security::auth::x500::X500Principal > const &a0)
{
	return call_method<
		java::security::cert::X509CRLSelector::J2CPP_CLASS_NAME,
		java::security::cert::X509CRLSelector::J2CPP_METHOD_NAME(3),
		java::security::cert::X509CRLSelector::J2CPP_METHOD_SIGNATURE(3),
		void
	>(get_jobject(), a0);
}

void java::security::cert::X509CRLSelector::addIssuerName(local_ref< java::lang::String > const &a0)
{
	return call_method<
		java::security::cert::X509CRLSelector::J2CPP_CLASS_NAME,
		java::security::cert::X509CRLSelector::J2CPP_METHOD_NAME(4),
		java::security::cert::X509CRLSelector::J2CPP_METHOD_SIGNATURE(4),
		void
	>(get_jobject(), a0);
}

void java::security::cert::X509CRLSelector::addIssuerName(local_ref< array<jbyte,1> > const &a0)
{
	return call_method<
		java::security::cert::X509CRLSelector::J2CPP_CLASS_NAME,
		java::security::cert::X509CRLSelector::J2CPP_METHOD_NAME(5),
		java::security::cert::X509CRLSelector::J2CPP_METHOD_SIGNATURE(5),
		void
	>(get_jobject(), a0);
}

void java::security::cert::X509CRLSelector::setMinCRLNumber(local_ref< java::math::BigInteger > const &a0)
{
	return call_method<
		java::security::cert::X509CRLSelector::J2CPP_CLASS_NAME,
		java::security::cert::X509CRLSelector::J2CPP_METHOD_NAME(6),
		java::security::cert::X509CRLSelector::J2CPP_METHOD_SIGNATURE(6),
		void
	>(get_jobject(), a0);
}

void java::security::cert::X509CRLSelector::setMaxCRLNumber(local_ref< java::math::BigInteger > const &a0)
{
	return call_method<
		java::security::cert::X509CRLSelector::J2CPP_CLASS_NAME,
		java::security::cert::X509CRLSelector::J2CPP_METHOD_NAME(7),
		java::security::cert::X509CRLSelector::J2CPP_METHOD_SIGNATURE(7),
		void
	>(get_jobject(), a0);
}

void java::security::cert::X509CRLSelector::setDateAndTime(local_ref< java::util::Date > const &a0)
{
	return call_method<
		java::security::cert::X509CRLSelector::J2CPP_CLASS_NAME,
		java::security::cert::X509CRLSelector::J2CPP_METHOD_NAME(8),
		java::security::cert::X509CRLSelector::J2CPP_METHOD_SIGNATURE(8),
		void
	>(get_jobject(), a0);
}

void java::security::cert::X509CRLSelector::setCertificateChecking(local_ref< java::security::cert::X509Certificate > const &a0)
{
	return call_method<
		java::security::cert::X509CRLSelector::J2CPP_CLASS_NAME,
		java::security::cert::X509CRLSelector::J2CPP_METHOD_NAME(9),
		java::security::cert::X509CRLSelector::J2CPP_METHOD_SIGNATURE(9),
		void
	>(get_jobject(), a0);
}

local_ref< java::util::Collection > java::security::cert::X509CRLSelector::getIssuers()
{
	return call_method<
		java::security::cert::X509CRLSelector::J2CPP_CLASS_NAME,
		java::security::cert::X509CRLSelector::J2CPP_METHOD_NAME(10),
		java::security::cert::X509CRLSelector::J2CPP_METHOD_SIGNATURE(10),
		local_ref< java::util::Collection >
	>(get_jobject());
}

local_ref< java::util::Collection > java::security::cert::X509CRLSelector::getIssuerNames()
{
	return call_method<
		java::security::cert::X509CRLSelector::J2CPP_CLASS_NAME,
		java::security::cert::X509CRLSelector::J2CPP_METHOD_NAME(11),
		java::security::cert::X509CRLSelector::J2CPP_METHOD_SIGNATURE(11),
		local_ref< java::util::Collection >
	>(get_jobject());
}

local_ref< java::math::BigInteger > java::security::cert::X509CRLSelector::getMinCRL()
{
	return call_method<
		java::security::cert::X509CRLSelector::J2CPP_CLASS_NAME,
		java::security::cert::X509CRLSelector::J2CPP_METHOD_NAME(12),
		java::security::cert::X509CRLSelector::J2CPP_METHOD_SIGNATURE(12),
		local_ref< java::math::BigInteger >
	>(get_jobject());
}

local_ref< java::math::BigInteger > java::security::cert::X509CRLSelector::getMaxCRL()
{
	return call_method<
		java::security::cert::X509CRLSelector::J2CPP_CLASS_NAME,
		java::security::cert::X509CRLSelector::J2CPP_METHOD_NAME(13),
		java::security::cert::X509CRLSelector::J2CPP_METHOD_SIGNATURE(13),
		local_ref< java::math::BigInteger >
	>(get_jobject());
}

local_ref< java::util::Date > java::security::cert::X509CRLSelector::getDateAndTime()
{
	return call_method<
		java::security::cert::X509CRLSelector::J2CPP_CLASS_NAME,
		java::security::cert::X509CRLSelector::J2CPP_METHOD_NAME(14),
		java::security::cert::X509CRLSelector::J2CPP_METHOD_SIGNATURE(14),
		local_ref< java::util::Date >
	>(get_jobject());
}

local_ref< java::security::cert::X509Certificate > java::security::cert::X509CRLSelector::getCertificateChecking()
{
	return call_method<
		java::security::cert::X509CRLSelector::J2CPP_CLASS_NAME,
		java::security::cert::X509CRLSelector::J2CPP_METHOD_NAME(15),
		java::security::cert::X509CRLSelector::J2CPP_METHOD_SIGNATURE(15),
		local_ref< java::security::cert::X509Certificate >
	>(get_jobject());
}

local_ref< java::lang::String > java::security::cert::X509CRLSelector::toString()
{
	return call_method<
		java::security::cert::X509CRLSelector::J2CPP_CLASS_NAME,
		java::security::cert::X509CRLSelector::J2CPP_METHOD_NAME(16),
		java::security::cert::X509CRLSelector::J2CPP_METHOD_SIGNATURE(16),
		local_ref< java::lang::String >
	>(get_jobject());
}

jboolean java::security::cert::X509CRLSelector::match(local_ref< java::security::cert::CRL > const &a0)
{
	return call_method<
		java::security::cert::X509CRLSelector::J2CPP_CLASS_NAME,
		java::security::cert::X509CRLSelector::J2CPP_METHOD_NAME(17),
		java::security::cert::X509CRLSelector::J2CPP_METHOD_SIGNATURE(17),
		jboolean
	>(get_jobject(), a0);
}

local_ref< java::lang::Object > java::security::cert::X509CRLSelector::clone()
{
	return call_method<
		java::security::cert::X509CRLSelector::J2CPP_CLASS_NAME,
		java::security::cert::X509CRLSelector::J2CPP_METHOD_NAME(18),
		java::security::cert::X509CRLSelector::J2CPP_METHOD_SIGNATURE(18),
		local_ref< java::lang::Object >
	>(get_jobject());
}

J2CPP_DEFINE_CLASS(java::security::cert::X509CRLSelector,"java/security/cert/X509CRLSelector")
J2CPP_DEFINE_METHOD(java::security::cert::X509CRLSelector,0,"<init>","()V")
J2CPP_DEFINE_METHOD(java::security::cert::X509CRLSelector,1,"setIssuers","(Ljava/util/Collection;)V")
J2CPP_DEFINE_METHOD(java::security::cert::X509CRLSelector,2,"setIssuerNames","(Ljava/util/Collection;)V")
J2CPP_DEFINE_METHOD(java::security::cert::X509CRLSelector,3,"addIssuer","(Ljavax/security/auth/x500/X500Principal;)V")
J2CPP_DEFINE_METHOD(java::security::cert::X509CRLSelector,4,"addIssuerName","(Ljava/lang/String;)V")
J2CPP_DEFINE_METHOD(java::security::cert::X509CRLSelector,5,"addIssuerName","([B)V")
J2CPP_DEFINE_METHOD(java::security::cert::X509CRLSelector,6,"setMinCRLNumber","(Ljava/math/BigInteger;)V")
J2CPP_DEFINE_METHOD(java::security::cert::X509CRLSelector,7,"setMaxCRLNumber","(Ljava/math/BigInteger;)V")
J2CPP_DEFINE_METHOD(java::security::cert::X509CRLSelector,8,"setDateAndTime","(Ljava/util/Date;)V")
J2CPP_DEFINE_METHOD(java::security::cert::X509CRLSelector,9,"setCertificateChecking","(Ljava/security/cert/X509Certificate;)V")
J2CPP_DEFINE_METHOD(java::security::cert::X509CRLSelector,10,"getIssuers","()Ljava/util/Collection;")
J2CPP_DEFINE_METHOD(java::security::cert::X509CRLSelector,11,"getIssuerNames","()Ljava/util/Collection;")
J2CPP_DEFINE_METHOD(java::security::cert::X509CRLSelector,12,"getMinCRL","()Ljava/math/BigInteger;")
J2CPP_DEFINE_METHOD(java::security::cert::X509CRLSelector,13,"getMaxCRL","()Ljava/math/BigInteger;")
J2CPP_DEFINE_METHOD(java::security::cert::X509CRLSelector,14,"getDateAndTime","()Ljava/util/Date;")
J2CPP_DEFINE_METHOD(java::security::cert::X509CRLSelector,15,"getCertificateChecking","()Ljava/security/cert/X509Certificate;")
J2CPP_DEFINE_METHOD(java::security::cert::X509CRLSelector,16,"toString","()Ljava/lang/String;")
J2CPP_DEFINE_METHOD(java::security::cert::X509CRLSelector,17,"match","(Ljava/security/cert/CRL;)Z")
J2CPP_DEFINE_METHOD(java::security::cert::X509CRLSelector,18,"clone","()Ljava/lang/Object;")

} //namespace j2cpp

#endif //J2CPP_JAVA_SECURITY_CERT_X509CRLSELECTOR_HPP_IMPL

#endif //J2CPP_INCLUDE_IMPLEMENTATION


text:
/**
 * Fill HBase as Map-Reduce Target. The TableMapper is not part of HBase client but in the main HBase (hbase-server) jar.
 * Does a word count on a HBase table as MR job.
 * @see http://bigdataprocessing.wordpress.com/2012/07/27/hadoop-hbase-mapreduce-examples/
 */
package mapred_hbase_fill_table;


text:
package org.ipregel.algorithm

import org.apache.spark.SparkContext
import org.apache.spark.graphx._
import org.apache.spark.rdd.RDD

import scala.reflect.ClassTag

object PageRank {

  def apply[VD: ClassTag, ED: ClassTag](
      sc: SparkContext, mode: String, graph: Graph[VD, ED]) {
    ////// Functions for Pagerank //////
    val resetProb = 0.15; val tol = 0.0001; val errorTol = 1.0e-5
    val vertexProgram = (id: VertexId, attr: (Double, Double), msgSum: Double) => {
      val (oldPR, lastDelta) = attr
      val newPR = oldPR + (1.0 - resetProb) * msgSum
      (newPR, newPR - oldPR)
    }
    val sendMessage = (edge: EdgeTriplet[(Double, Double), Double]) => {
      if (edge.srcAttr._2 > tol) {
        Iterator((edge.dstId, edge.srcAttr._2 * edge.attr))
      } else {
        Iterator.empty
      }
    }
    val messageCombiner = (a: Double, b: Double) => a + b
    // For updating edge attribute (number of out degrees)
    def initEdgeAttr(addEdge: RDD[Edge[Double]])(g: Graph[_, Double])
        : (Graph[_, Double], VertexRDD[Int]) = {
      val activateMsg = g.vertices.aggregateUsingIndex(
        addEdge.flatMap(x => Iterator((x.srcId, 0), (x.dstId, 0))),
        (x: Int, y: Int) => x: Int
      ).cache()

      val countOutDeg = (edge: EdgeTriplet[_, Double]) => Iterator((edge.srcId, 1))
      val mergeMsg = (x: Int, y: Int) => x + y
      val updatedOutDeg = GraphXUtils.mapReduceTriplets(
        g, countOutDeg, mergeMsg, Some(activateMsg, EdgeDirection.Either)).cache()

      val updatedGraph = g.joinTriplets[Int](
        updatedOutDeg, EdgeDirection.Either, et => 1.0 / et.srcAttr).cache()
      (updatedGraph, updatedOutDeg)
    }
    ///// End of Functions //////

    // Init graph for PageRank
    val pagerankGraph = graph//gridGraph
      .outerJoinVertices(graph.outDegrees) { (_, _, deg) => deg.getOrElse(0) }
      .mapTriplets(e => 1.0 / e.srcAttr)
      .mapVertices { (id, attr) => (0.0, 0.0) }
      .cache()
    val size = pagerankGraph.vertices.count()

    // Init additional edges
    val addEdge = sc.parallelize(
      (1 until 2).map(x => Edge(size, x, null.asInstanceOf[ED]))
      // ++ (0 until cols - 1).map(x => Edge(rows * cols + x, rows * cols + x + 1, 1.0))
    ).cache()
    addEdge.count()

    if (mode == "Full") {
      // Run full version of PageRank
      val gridGraphPlus = graph
        .partitionBy(PartitionStrategy.EdgePartition1D)
        .addEdges(addEdge, PartitionStrategy.EdgePartition1D, null.asInstanceOf[VD])
        .outerJoinVertices(graph.outDegrees) { (_, _, deg) => deg.getOrElse(0) }
        .mapTriplets(e => 1.0 / e.srcAttr)
        .mapVertices { (id, attr) => (0.0, 0.0) }
        .cache()
      gridGraphPlus.vertices.count()
      val startFull = System.currentTimeMillis()
      val pagerankFull = gridGraphPlus.pageRank(tol, resetProb).vertices.cache()
      pagerankFull.count()
      val timeFull = System.currentTimeMillis() - startFull
      println(f"$timeFull%9d" + ",,")
    }

    if (mode == "Incremental") {
      // Initial run for incremental Pregel
      val startInitRun = System.currentTimeMillis()
      val iPregelRank = IncrementalPregel(
        pagerankGraph,
        resetProb / (1.0 - resetProb),
        activeDirection = EdgeDirection.Out)(
        vertexProgram,
        sendMessage,
        messageCombiner).cache()
      iPregelRank.result.vertices.count()
      val timeInitRun = System.currentTimeMillis() - startInitRun
      // Run incremental Pregel
      val startInc = System.currentTimeMillis()
      val addEdgeDouble = addEdge.map(x => Edge(x.srcId, x.dstId, 0.0))
      val init = initEdgeAttr(addEdgeDouble)(_)
      val updated = iPregelRank.run(addEdgeDouble, (0.0, 0.0), Some(init)).cache()
      updated.result.vertices.count()
      val timeInc = System.currentTimeMillis() - startInc
      println(f"$timeInitRun%9d" + "," + f"$timeInc%9d" + ",")
    }
  } // end of apply()

} // end of object PageRank


text:
package org.pac4j.core.util;

import org.junit.Assert;
import org.pac4j.core.exception.TechnicalException;

import java.net.URL;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * This class is an helper for tests: get a basic web client, parameters from an url, a formatted date, etc.
 *
 * @author Jerome Leleu
 * @since 1.0.0
 */
public final class TestsHelper {

    public static void initShouldFail(final InitializableObject obj, final String message) {
        expectException(obj::init, TechnicalException.class, message);
    }

    public static Exception expectException(final Executable executable) {
        try {
            executable.execute();
        } catch (final Exception e) {
            return e;
        }
        return null;
    }

    public static void expectException(final Executable executable, final Class<? extends Exception> clazz, final String message) {
        final var e = expectException(executable);
        Assert.assertTrue(clazz.isAssignableFrom(e.getClass()));
        Assert.assertEquals(message, e.getMessage());
    }

    public static Map<String, String> splitQuery(URL url) {
        Map<String, String> query_pairs = new LinkedHashMap<>();
        var query = url.getQuery();
        var pairs = query.split("&", -1);
        for (var pair : pairs) {
            var idx = pair.indexOf("=");
            query_pairs.put(CommonHelper.urlEncode(pair.substring(0, idx)), CommonHelper.urlEncode(pair.substring(idx + 1)));
        }
        return query_pairs;
    }

    public static void wait(int milliseconds) {
        try {
            Thread.sleep(milliseconds);
        } catch (final InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}


text:
Jack Christensen's Formulas
===========================

    $ brew tap jackc/formulas


text:
/**
 * Remote List
 * Used for syncing remote array data with a local List
 *
 * @class		RemoteList
 * @memberof	conbo
 * @augments	conbo.List
 * @author 		Neil Rackett
 * @param 		{Object} options - Object containing initialisation options, including HttpService options
 * @fires		conbo.ConboEvent#CHANGE
 * @fires		conbo.ConboEvent#ADD
 * @fires		conbo.ConboEvent#REMOVE
 * @fires		conbo.ConboEvent#RESULT
 * @fires		conbo.ConboEvent#FAULT
 */
conbo.RemoteList = conbo.List.extend(
/** @lends conbo.RemoteList.prototype */
{
	//itemClass: conbo.RemoteHash,

	/**
	 * Constructor
	 * @param {Object}	[options] - Object containing 'source' (Array, optional), 'rootUrl', 'command' and (optionally) 'itemClass' parameters
	 */
	__construct: function(options)
	{
		options = conbo.defineDefaults(options, this.options);

		this.context = options.context;

		this._httpService = new conbo.HttpService(options);
		this._command = options.command;

		var resultHandler = function(event)
		{
			this.source = event.result;
			this.dispatchEvent(event);
		};

		this._httpService
			.addEventListener(conbo.ConboEvent.RESULT, resultHandler, {scope:this})
			.addEventListener(conbo.ConboEvent.FAULT, this.dispatchEvent, {scope:this})
			;

		__denumerate(this);

		conbo.List.prototype.__construct.apply(this, arguments);
	},

	load: function()
	{
		this._httpService.call(this._command, this.toJSON(), 'GET');
		return this;
	},

	save: function()
	{
		this._httpService.call(this._command, this.toJSON(), 'POST');
		return this;
	},

	destroy: function()
	{
		// TODO
		return this;
	},

	toString: function()
	{
		return 'conbo.RemoteList';
	}

}).implement(conbo.ISyncable, conbo.IPreinitialize);

__denumerate(conbo.HttpService.prototype);


text:
import Data.Text

jiraUrl = "https://jira.chemaxon.com/rest/api/2"
searchUrl = Data.Text.concat [jiraUrl, "/search"]

main :: IO()
main = putStrLn "Hello, world"


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="false" android:drawable="@drawable/apple"></item>
    <item android:state_pressed="true" android:drawable="@drawable/orange"></item>
</selector>


text:
<?php
namespace common\rbac;

use yii\rbac\Rule;
use \Yii;

class AuthorRule extends Rule
{
    public $name = 'isAuthor';

    /**
     * @param string|integer $user the user ID.
     * @param Item $item the role or permission that this rule is associated with
     * @param array $params parameters passed to ManagerInterface::checkAccess().
     * @return boolean a value indicating whether the rule permits the role or permission it is associated with.
     */
    public function execute($user_id, $item, $params)
    {
        return isset($params['model']) ? $params['model']->created_by == $user_id : false;
        //กำหนดให้สามารถแก้ไขข้อมูลที่ตัวเองสร้างเท่านั้น
    }
}
 ?>