text:
use std::collections::{
    BTreeMap,
    BTreeSet,
    HashMap,
    HashSet,
    btree_map,
    btree_set,
    hash_map,
    hash_set,
};
use std::hash::Hash;
use std::error;
use std::fmt;
use std::vec;
use std::marker::PhantomData;

use de;
use bytes;

///////////////////////////////////////////////////////////////////////////////

/// This represents all the possible errors that can occur using the `ValueDeserializer`.
#[derive(Clone, Debug, PartialEq)]
pub enum Error {
    /// The value had some syntatic error.
    Syntax(String),

    /// The value had an incorrect type.
    Type(de::Type),

    /// The value had an invalid length.
    Length(usize),

    /// EOF while deserializing a value.
    EndOfStream,

    /// Unknown field in struct.
    UnknownField(String),

    /// Struct is missing a field.
    MissingField(&'static str),
}

impl de::Error for Error {
    fn syntax(msg: &str) -> Self { Error::Syntax(String::from(msg)) }
    fn type_mismatch(type_: de::Type) -> Self { Error::Type(type_) }
    fn length_mismatch(len: usize) -> Self { Error::Length(len) }
    fn end_of_stream() -> Self { Error::EndOfStream }
    fn unknown_field(field: &str) -> Self { Error::UnknownField(String::from(field)) }
    fn missing_field(field: &'static str) -> Self { Error::MissingField(field) }
}

impl fmt::Display for Error {
    fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> {
        match *self {
            Error::Syntax(ref s) => write!(formatter, "Syntax error: {}", s),
            Error::Type(ty) => write!(formatter, "Invalid type: {:?}", ty),
            Error::Length(len) => write!(formatter, "Invalid length: {}", len),
            Error::EndOfStream => formatter.write_str("EndOfStreamError"),
            Error::UnknownField(ref field) => write!(formatter, "Unknown field: {}", field),
            Error::MissingField(ref field) => write!(formatter, "Missing field: {}", field),
        }
    }
}

impl error::Error for Error {
    fn description(&self) -> &str {
        "Serde Deserialization Error"
    }

    fn cause(&self) -> Option<&error::Error> {
        None
    }
}

///////////////////////////////////////////////////////////////////////////////

/// This trait converts primitive types into a deserializer.
pub trait ValueDeserializer<E: de::Error = Error> {
    /// The actual deserializer type.
    type Deserializer: de::Deserializer<Error=E>;

    /// Convert this value into a deserializer.
    fn into_deserializer(self) -> Self::Deserializer;
}

///////////////////////////////////////////////////////////////////////////////

impl<E> ValueDeserializer<E> for ()
    where E: de::Error,
{
    type Deserializer = UnitDeserializer<E>;

    fn into_deserializer(self) -> UnitDeserializer<E> {
        UnitDeserializer(PhantomData)
    }
}

/// A helper deserializer that deserializes a `()`.
pub struct UnitDeserializer<E>(PhantomData<E>);

impl<E> de::Deserializer for UnitDeserializer<E>
    where E: de::Error
{
    type Error = E;

    fn deserialize<V>(&mut self, mut visitor: V) -> Result<V::Value, Self::Error>
        where V: de::Visitor,
    {
        visitor.visit_unit()
    }

    fn deserialize_option<V>(&mut self, mut visitor: V) -> Result<V::Value, Self::Error>
        where V: de::Visitor,
    {
        visitor.visit_none()
    }
}

///////////////////////////////////////////////////////////////////////////////

macro_rules! primitive_deserializer {
    ($ty:ty, $name:ident, $method:ident) => {
        /// A helper deserializer that deserializes a number.
        pub struct $name<E>(Option<$ty>, PhantomData<E>);

        impl<E> ValueDeserializer<E> for $ty
            where E: de::Error,
        {
            type Deserializer = $name<E>;

            fn into_deserializer(self) -> $name<E> {
                $name(Some(self), PhantomData)
            }
        }

        impl<E> de::Deserializer for $name<E>
            where E: de::Error,
        {
            type Error = E;

            fn deserialize<V>(&mut self, mut visitor: V) -> Result<V::Value, Self::Error>
                where V: de::Visitor,
            {
                match self.0.take() {
                    Some(v) => visitor.$method(v),
                    None => Err(de::Error::end_of_stream()),
                }
            }
        }
    }
}

primitive_deserializer!(bool, BoolDeserializer, visit_bool);
primitive_deserializer!(i8, I8Deserializer, visit_i8);
primitive_deserializer!(i16, I16Deserializer, visit_i16);
primitive_deserializer!(i32, I32Deserializer, visit_i32);
primitive_deserializer!(i64, I64Deserializer, visit_i64);
primitive_deserializer!(isize, IsizeDeserializer, visit_isize);
primitive_deserializer!(u8, U8Deserializer, visit_u8);
primitive_deserializer!(u16, U16Deserializer, visit_u16);
primitive_deserializer!(u32, U32Deserializer, visit_u32);
primitive_deserializer!(u64, U64Deserializer, visit_u64);
primitive_deserializer!(usize, UsizeDeserializer, visit_usize);
primitive_deserializer!(f32, F32Deserializer, visit_f32);
primitive_deserializer!(f64, F64Deserializer, visit_f64);
primitive_deserializer!(char, CharDeserializer, visit_char);

///////////////////////////////////////////////////////////////////////////////

/// A helper deserializer that deserializes a `&str`.
pub struct StrDeserializer<'a, E>(Option<&'a str>, PhantomData<E>);

impl<'a, E> ValueDeserializer<E> for &'a str
    where E: de::Error,
{
    type Deserializer = StrDeserializer<'a, E>;

    fn into_deserializer(self) -> StrDeserializer<'a, E> {
        StrDeserializer(Some(self), PhantomData)
    }
}

impl<'a, E> de::Deserializer for StrDeserializer<'a, E>
    where E: de::Error,
{
    type Error = E;

    fn deserialize<V>(&mut self, mut visitor: V) -> Result<V::Value, Self::Error>
        where V: de::Visitor,
    {
        match self.0.take() {
            Some(v) => visitor.visit_str(v),
            None => Err(de::Error::end_of_stream()),
        }
    }

    fn deserialize_enum<V>(&mut self,
                     _name: &str,
                     _variants: &'static [&'static str],
                     mut visitor: V) -> Result<V::Value, Self::Error>
        where V: de::EnumVisitor,
    {
        visitor.visit(self)
    }
}

impl<'a, E> de::VariantVisitor for StrDeserializer<'a, E>
    where E: de::Error,
{
    type Error = E;

    fn visit_variant<T>(&mut self) -> Result<T, Self::Error>
        where T: de::Deserialize,
    {
        de::Deserialize::deserialize(self)
    }

    fn visit_unit(&mut self) -> Result<(), Self::Error> {
        Ok(())
    }
}

///////////////////////////////////////////////////////////////////////////////

/// A helper deserializer that deserializes a `String`.
pub struct StringDeserializer<E>(Option<String>, PhantomData<E>);

impl<E> ValueDeserializer<E> for String
    where E: de::Error,
{
    type Deserializer = StringDeserializer<E>;

    fn into_deserializer(self) -> StringDeserializer<E> {
        StringDeserializer(Some(self), PhantomData)
    }
}

impl<E> de::Deserializer for StringDeserializer<E>
    where E: de::Error,
{
    type Error = E;

    fn deserialize<V>(&mut self, mut visitor: V) -> Result<V::Value, Self::Error>
        where V: de::Visitor,
    {
        match self.0.take() {
            Some(string) => visitor.visit_string(string),
            None => Err(de::Error::end_of_stream()),
        }
    }

    fn deserialize_enum<V>(&mut self,
                     _name: &str,
                     _variants: &'static [&'static str],
                     mut visitor: V) -> Result<V::Value, Self::Error>
        where V: de::EnumVisitor,
    {
        visitor.visit(self)
    }
}

impl<'a, E> de::VariantVisitor for StringDeserializer<E>
    where E: de::Error,
{
    type Error = E;

    fn visit_variant<T>(&mut self) -> Result<T, Self::Error>
        where T: de::Deserialize,
    {
        de::Deserialize::deserialize(self)
    }

    fn visit_unit(&mut self) -> Result<(), Self::Error> {
        Ok(())
    }
}

///////////////////////////////////////////////////////////////////////////////

/// A helper deserializer that deserializes a sequence.
pub struct SeqDeserializer<I, E> {
    iter: I,
    len: usize,
    marker: PhantomData<E>,
}

impl<I, E> SeqDeserializer<I, E>
    where E: de::Error,
{
    /// Construct a new `SeqDeserializer<I>`.
    pub fn new(iter: I, len: usize) -> Self {
        SeqDeserializer {
            iter: iter,
            len: len,
            marker: PhantomData,
        }
    }
}

impl<I, T, E> de::Deserializer for SeqDeserializer<I, E>
    where I: Iterator<Item=T>,
          T: ValueDeserializer<E>,
          E: de::Error,
{
    type Error = E;

    fn deserialize<V>(&mut self, mut visitor: V) -> Result<V::Value, Self::Error>
        where V: de::Visitor,
    {
        visitor.visit_seq(self)
    }
}

impl<I, T, E> de::SeqVisitor for SeqDeserializer<I, E>
    where I: Iterator<Item=T>,
          T: ValueDeserializer<E>,
          E: de::Error,
{
    type Error = E;

    fn visit<V>(&mut self) -> Result<Option<V>, Self::Error>
        where V: de::Deserialize
    {
        match self.iter.next() {
            Some(value) => {
                self.len -= 1;
                let mut de = value.into_deserializer();
                Ok(Some(try!(de::Deserialize::deserialize(&mut de))))
            }
            None => Ok(None),
        }
    }

    fn end(&mut self) -> Result<(), Self::Error> {
        if self.len == 0 {
            Ok(())
        } else {
            Err(de::Error::length_mismatch(self.len))
        }
    }

    fn size_hint(&self) -> (usize, Option<usize>) {
        (self.len, Some(self.len))
    }
}

///////////////////////////////////////////////////////////////////////////////

impl<T, E> ValueDeserializer<E> for Vec<T>
    where T: ValueDeserializer<E>,
          E: de::Error,
{
    type Deserializer = SeqDeserializer<vec::IntoIter<T>, E>;

    fn into_deserializer(self) -> Self::Deserializer {
        let len = self.len();
        SeqDeserializer::new(self.into_iter(), len)
    }
}

impl<T, E> ValueDeserializer<E> for BTreeSet<T>
    where T: ValueDeserializer<E> + Eq + Ord,
          E: de::Error,
{
    type Deserializer = SeqDeserializer<btree_set::IntoIter<T>, E>;

    fn into_deserializer(self) -> Self::Deserializer {
        let len = self.len();
        SeqDeserializer::new(self.into_iter(), len)
    }
}

impl<T, E> ValueDeserializer<E> for HashSet<T>
    where T: ValueDeserializer<E> + Eq + Hash,
          E: de::Error,
{
    type Deserializer = SeqDeserializer<hash_set::IntoIter<T>, E>;

    fn into_deserializer(self) -> Self::Deserializer {
        let len = self.len();
        SeqDeserializer::new(self.into_iter(), len)
    }
}

///////////////////////////////////////////////////////////////////////////////

/// A helper deserializer that deserializes a sequence using a `SeqVisitor`.
pub struct SeqVisitorDeserializer<V_, E> {
    visitor: V_,
    marker: PhantomData<E>,
}

impl<V_, E> SeqVisitorDeserializer<V_, E>
    where V_: de::SeqVisitor<Error = E>,
          E: de::Error,
{
    /// Construct a new `SeqVisitorDeserializer<V_, E>`.
    pub fn new(visitor: V_) -> Self {
        SeqVisitorDeserializer{
            visitor: visitor,
            marker: PhantomData
        }
    }
}

impl<V_, E> de::Deserializer for SeqVisitorDeserializer<V_, E>
    where V_: de::SeqVisitor<Error = E>,
          E: de::Error,
{
    type Error = E;

    fn deserialize<V: de::Visitor>(&mut self, mut visitor: V) -> Result<V::Value, Self::Error> {
        visitor.visit_seq(&mut self.visitor)
    }
}

///////////////////////////////////////////////////////////////////////////////

/// A helper deserializer that deserializes a map.
pub struct MapDeserializer<I, K, V, E>
    where I: Iterator<Item=(K, V)>,
          K: ValueDeserializer<E>,
          V: ValueDeserializer<E>,
          E: de::Error,
{
    iter: I,
    value: Option<V>,
    len: usize,
    marker: PhantomData<E>,
}

impl<I, K, V, E> MapDeserializer<I, K, V, E>
    where I: Iterator<Item=(K, V)>,
          K: ValueDeserializer<E>,
          V: ValueDeserializer<E>,
          E: de::Error,
{
    /// Construct a new `MapDeserializer<I, K, V>`.
    pub fn new(iter: I, len: usize) -> Self {
        MapDeserializer {
            iter: iter,
            value: None,
            len: len,
            marker: PhantomData,
        }
    }
}

impl<I, K, V, E> de::Deserializer for MapDeserializer<I, K, V, E>
    where I: Iterator<Item=(K, V)>,
          K: ValueDeserializer<E>,
          V: ValueDeserializer<E>,
          E: de::Error,
{
    type Error = E;

    fn deserialize<V_>(&mut self, mut visitor: V_) -> Result<V_::Value, Self::Error>
        where V_: de::Visitor,
    {
        visitor.visit_map(self)
    }
}

impl<I, K, V, E> de::MapVisitor for MapDeserializer<I, K, V, E>
    where I: Iterator<Item=(K, V)>,
          K: ValueDeserializer<E>,
          V: ValueDeserializer<E>,
          E: de::Error,
{
    type Error = E;

    fn visit_key<T>(&mut self) -> Result<Option<T>, Self::Error>
        where T: de::Deserialize,
    {
        match self.iter.next() {
            Some((key, value)) => {
                self.len -= 1;
                self.value = Some(value);
                let mut de = key.into_deserializer();
                Ok(Some(try!(de::Deserialize::deserialize(&mut de))))
            }
            None => Ok(None),
        }
    }

    fn visit_value<T>(&mut self) -> Result<T, Self::Error>
        where T: de::Deserialize,
    {
        match self.value.take() {
            Some(value) => {
                let mut de = value.into_deserializer();
                de::Deserialize::deserialize(&mut de)
            }
            None => Err(de::Error::syntax("expected a map value"))
        }
    }

    fn end(&mut self) -> Result<(), Self::Error> {
        if self.len == 0 {
            Ok(())
        } else {
            Err(de::Error::length_mismatch(self.len))
        }
    }

    fn size_hint(&self) -> (usize, Option<usize>) {
        (self.len, Some(self.len))
    }
}

///////////////////////////////////////////////////////////////////////////////

impl<K, V, E> ValueDeserializer<E> for BTreeMap<K, V>
    where K: ValueDeserializer<E> + Eq + Ord,
          V: ValueDeserializer<E>,
          E: de::Error,
{
    type Deserializer = MapDeserializer<btree_map::IntoIter<K, V>, K, V, E>;

    fn into_deserializer(self) -> Self::Deserializer {
        let len = self.len();
        MapDeserializer::new(self.into_iter(), len)
    }
}

impl<K, V, E> ValueDeserializer<E> for HashMap<K, V>
    where K: ValueDeserializer<E> + Eq + Hash,
          V: ValueDeserializer<E>,
          E: de::Error,
{
    type Deserializer = MapDeserializer<hash_map::IntoIter<K, V>, K, V, E>;

    fn into_deserializer(self) -> Self::Deserializer {
        let len = self.len();
        MapDeserializer::new(self.into_iter(), len)
    }
}

///////////////////////////////////////////////////////////////////////////////

/// A helper deserializer that deserializes a map using a `MapVisitor`.
pub struct MapVisitorDeserializer<V_, E> {
    visitor: V_,
    marker: PhantomData<E>,
}

impl<V_, E> MapVisitorDeserializer<V_, E>
    where V_: de::MapVisitor<Error = E>,
          E: de::Error,
{
    /// Construct a new `MapVisitorDeserializer<V_, E>`.
    pub fn new(visitor: V_) -> Self {
        MapVisitorDeserializer{
            visitor: visitor,
            marker: PhantomData
        }
    }
}

impl<V_, E> de::Deserializer for MapVisitorDeserializer<V_, E>
    where V_: de::MapVisitor<Error = E>,
          E: de::Error,
{
    type Error = E;

    fn deserialize<V: de::Visitor>(&mut self, mut visitor: V) -> Result<V::Value, Self::Error> {
        visitor.visit_map(&mut self.visitor)
    }
}

///////////////////////////////////////////////////////////////////////////////

impl<'a, E> ValueDeserializer<E> for bytes::Bytes<'a>
    where E: de::Error,
{
    type Deserializer = BytesDeserializer<'a, E>;

    fn into_deserializer(self) -> BytesDeserializer<'a, E> {
        BytesDeserializer(Some(self.into()), PhantomData)
    }
}

/// A helper deserializer that deserializes a `&[u8]`.
pub struct BytesDeserializer<'a, E> (Option<&'a [u8]>, PhantomData<E>);

impl<'a, E> de::Deserializer for BytesDeserializer<'a, E>
    where E: de::Error
{
    type Error = E;

    fn deserialize<V>(&mut self, mut visitor: V) -> Result<V::Value, Self::Error>
        where V: de::Visitor,
    {
        match self.0.take() {
            Some(bytes) => visitor.visit_bytes(bytes),
            None => Err(de::Error::end_of_stream()),
        }
    }
}

///////////////////////////////////////////////////////////////////////////////

impl<E> ValueDeserializer<E> for bytes::ByteBuf
    where E: de::Error,
{
    type Deserializer = ByteBufDeserializer<E>;

    fn into_deserializer(self) -> Self::Deserializer {
        ByteBufDeserializer(Some(self.into()), PhantomData)
    }
}

/// A helper deserializer that deserializes a `Vec<u8>`.
pub struct ByteBufDeserializer<E>(Option<Vec<u8>>, PhantomData<E>);

impl<E> de::Deserializer for ByteBufDeserializer<E>
    where E: de::Error,
{
    type Error = E;

    fn deserialize<V>(&mut self, mut visitor: V) -> Result<V::Value, Self::Error>
        where V: de::Visitor,
    {
        match self.0.take() {
            Some(bytes) => visitor.visit_byte_buf(bytes),
            None => Err(de::Error::end_of_stream()),
        }
    }
}


text:
module.exports = {
  includes: [
    'node_modules/**/aws-sdk/apis/*.json',
    'node_modules/**/mime/types/*.types',
    'node_modules/**/negotiator/**/*.js',
    'node_modules/**/socket.io-client/socket.io.js',
    'node_modules/**/socket.io-client/dist/socket.io.min.js',
    'node_modules/**/socket.io-client/dist/socket.io.js',
  ],

  ignores: [
    'node_modules/**/tessel/**/*',
  ],

  // These are used to override all other rules.
  //
  // A concrete example of why this is necessary:
  //
  //    Sometimes `ignores` might conflict with includes,
  //    such as the case with "tessel" and "mime". Since
  //    `includes` always trump `ignores`, 'mime/types/*.types'
  //    gets removed from the `ignores` list and results in
  //    `./node_modules/tessel/node_modules/mime/types/*.*`
  //    being included in the bundle. Since we ABSOLUTELY
  //    know that we do not want users trying to send the
  //    `tessel` module that would exist as a result of
  //    `npm install tessel`, we _must_ have a backup
  //    strategy. In this particular case, it means
  //    `rm -rf` anything in this list.
  //
  //    This could also be caused by `.tesselinclude`
  //    rules, so those must be overridden as well.
  //
  blacklist: [
    'node_modules/tessel',
  ],

  binaryPathTranslations: {
    '*': [{
      find: `${process.platform}-${process.arch}`,
      replace: 'linux-mipsel'
    }],
    /*
      Other module-specific translations could be added in the future.
     */
  },
  compressionOptions: {
    // "extend" is the name of the module
    extend: {
      compress: {
        keep_fnames: true
      },
      mangle: {}
    },
  },
  compressionBlacklist: {
    // Placeholder
  },

  compressionVersion: {
    // Values are either 'es' or 'js' and map
    // to a version of uglify
    bindings: 'js',
    'component-inherit': 'js',
    express: 'js',
    glob: 'js',
    'supports-color': 'js',
  },
};

redpajama_set_name: RedPajamaGithub


text:
package org.apache.commons.vfs2;

/**
 * Represents a file name.  File names are immutable, and work correctly as
 * keys in hash tables.
 *
 * @see FileObject
 */
public interface FileName extends Comparable<FileName>
{
    /**
     * The separator character used in file paths.
     */
    char SEPARATOR_CHAR = '/';

    /**
     * The separator used in file paths.
     */
    String SEPARATOR = "/";

    /**
     * The absolute path of the root of a file system.
     */
    String ROOT_PATH = "/";

    /**
     * Returns the base name of this file.  The base name is the last element
     * of the file name.  For example the base name of
     * {@code /somefolder/somefile} is {@code somefile}.
     *

     * The root file of a file system has an empty base name.
     *

     *
     * @return The base name.  Never returns null.
     */
    String getBaseName();

    /**
     * Returns the absolute path of this file, within its file system.  This
     * path is normalized, so that {@code .} and {@code ..} elements
     * have been removed.  Also, the path only contains {@code /} as its
     * separator character.  The path always starts with {@code /}
     *

     * The root of a file system has {@code /} as its absolute path.
     *

     *
     * @return The path.  Never returns null.
     */
    String getPath();

    /**
     * Returns the absolute path of this file, within its file system.  This
     * path is normalized, so that {@code .} and {@code ..} elements
     * have been removed.  Also, the path only contains {@code /} as its
     * separator character.  The path always starts with {@code /}
     *

     * The root of a file system has {@code /} as its absolute path.
     *

     *

     * In contrast to {@link #getPath()} the path is decoded i.e. all %nn stuff
     * replaced by its character.
     *

     *
     * @return The path.  Never returns null.
     * @throws FileSystemException if the path is not correctly encoded
     */
    String getPathDecoded() throws FileSystemException;

    /**
     * Returns the extension of this file name.
     *
     * @return The extension.  Returns an empty string if the name has no
     *         extension.
     */
    String getExtension();

    /**
     * Returns the depth of this file name, within its file system.  The depth
     * of the root of a file system is 0.  The depth of any other file is
     * 1 + the depth of its parent.
     *
     * @return The depth of this file name.
     */
    int getDepth();

    /**
     * Returns the URI scheme of this file.
     *
     * @return The URI scheme of this file.
     */
    String getScheme();

    /**
     * Returns the absolute URI of this file.
     *
     * @return the absolute URI of this file.
     */
    String getURI();

    /**
     * Returns the root URI of the file system this file belongs to.
     *
     * @return the root URI.
     */
    String getRootURI();

    /**
     * Finds the root of the file system.
     *
     * @return the file system root.
     */
    FileName getRoot();

    /**
     * Returns the file name of the parent of this file.  The root of a
     * file system has no parent.
     *
     * @return A {@link FileName} object representing the parent name.  Returns
     *         null for the root of a file system.
     */
    FileName getParent();

    /**
     * Resolves a name, relative to this file name.  Equivalent to calling
     * {@code resolveName( path, NameScope.FILE_SYSTEM )}.
     *
     * @param name The name to resolve.
     * @return A {@link FileName} object representing the resolved file name.
     * @throws FileSystemException If the name is invalid.
     */
    // FileName resolveName(String name) throws FileSystemException;

    /**
     * Resolves a name, relative to this file name.  Refer to {@link NameScope}
     * for a description of how names are resolved.
     *
     * @param name  The name to resolve.
     * @param scope The scope to use when resolving the name.
     * @return A {@link FileName} object representing the resolved file name.
     * @throws FileSystemException If the name is invalid.
     */
    // FileName resolveName(String name, NameScope scope)
    //     throws FileSystemException;

    /**
     * Converts a file name to a relative name, relative to this file name.
     *
     * @param name The name to convert to a relative path.
     * @return The relative name.
     * @throws FileSystemException On error.
     */
    String getRelativeName(FileName name) throws FileSystemException;

    /**
     * Determines if another file name is an ancestor of this file name.
     *
     * @param ancestor The FileName to check.
     * @return true if another file name is an ancestor of this file name.
     */
    boolean isAncestor(FileName ancestor);

    /**
     * Determines if another file name is a descendent of this file name.
     *
     * @param descendent the FileName to check.
     * @return true if the other FileName is a descendent of this file name.
     */
    boolean isDescendent(FileName descendent);

    /**
     * Determines if another file name is a descendent of this file name.
     *
     * @param descendent the FileName to check.
     * @param nameScope the NameScope of the FileName.
     * @return true if the other FileName is a descendent of this file name.
     */
    boolean isDescendent(FileName descendent, NameScope nameScope);

    /**
     * Checks if this file name is a name for a regular file.
     *
     * @return true if this file name is a name for a regular file.
     * @throws FileSystemException if an error occurs.
     * @see #getType()
     * @see FileType#FILE
     * @since 2.1
     */
    boolean isFile() throws FileSystemException;

    /**
     * Returns the requested or current type of this name.
     *

     * The "requested" type is the one determined during resolving the name.
     * In this case the name is a {@link FileType#FOLDER} if it ends with an "/" else
     * it will be a {@link FileType#FILE}.
     *

     * Once attached it will be changed to reflect the real type of this resource.
     *
     * @return {@link FileType#FOLDER} or {@link FileType#FILE}
     */
    FileType getType();

    /**
     * Returns a "friendly path", this is a path without a password.
     *

     * This path can not be used to resolve the path again.
     *
     * @return the friendly URI as a String.
     */
    String getFriendlyURI();
}


text:
<resources>
	<string name="app_name">ProgressView</string>
</resources>


text:
Get Started.

Read how to Get Started or check out the Style Guide.


text:
package com.kb.mylibs.FrameHandle;

import com.kb.mylibs.DelayHandle.IDelayHandleItem;
import com.kb.mylibs.EventHandle.IDispatchObject;

/**
 * @brief 定时器,这个是不断增长的
 */
public class TimerItemBase implements IDelayHandleItem, IDispatchObject
{
    public float mInternal;        // 定时器间隔
    public float mTotalTime;       // 总共定时器时间
    public float mCurRunTime;      // 当前定时器运行的时间
    public float mCurCallTime;     // 当前定时器已经调用的时间
    public boolean mIsInfineLoop;      // 是否是无限循环
    public float mIntervalLeftTime;     // 定时器调用间隔剩余时间
    public TimerFunctionObject mTimerDisp;       // 定时器分发
    public boolean mDisposed;             // 是否已经被释放
    public boolean mIsContinuous;          // 是否是连续的定时器

    public TimerItemBase()
    {
        this.mInternal = 1;
        this.mTotalTime = 1;
        this.mCurRunTime = 0;
        this.mCurCallTime = 0;
        this.mIsInfineLoop = false;
        this.mIntervalLeftTime = 0;
        this.mTimerDisp = new TimerFunctionObject();
        this.mDisposed = false;
        this.mIsContinuous = false;
    }

    public void setFuncObject(ICalleeObjectTimer eventHandle)
    {
        this.mTimerDisp.setFuncObject(eventHandle);
    }

    public void setTotalTime(float value)
    {
        this.mTotalTime = value;
    }

    public float getRunTime()
    {
        return this.mCurRunTime;
    }

    public float getCallTime()
    {
        return this.mCurCallTime;
    }

    public float getLeftRunTime()
    {
        return this.mTotalTime - this.mCurRunTime;
    }

    public float getLeftCallTime()
    {
        return this.mTotalTime - this.mCurCallTime;
    }

    // 在调用回调函数之前处理
    protected void onPreCallBack()
    {

    }

    public void OnTimer(float delta)
    {
        if (this.mDisposed)
        {
            return;
        }

        this.mCurRunTime += delta;
        if (this.mCurRunTime > this.mTotalTime)
        {
            this.mCurRunTime = this.mTotalTime;
        }
        this.mIntervalLeftTime += delta;

        if (this.mIsInfineLoop)
        {
            checkAndDisp();
        }
        else
        {
            if (this.mCurRunTime >= this.mTotalTime)
            {
                disposeAndDisp();
            }
            else
            {
                checkAndDisp();
            }
        }
    }

    public void disposeAndDisp()
    {
        if (this.mIsContinuous)
        {
            this.continueDisposeAndDisp();
        }
        else
        {
            this.discontinueDisposeAndDisp();
        }
    }

    protected void continueDisposeAndDisp()
    {
        this.mDisposed = true;

        while (this.mIntervalLeftTime >= this.mInternal && this.mCurCallTime < this.mTotalTime)
        {
            this.mCurCallTime = this.mCurCallTime + this.mInternal;
            this.mIntervalLeftTime = this.mIntervalLeftTime - this.mInternal;
            this.onPreCallBack();

            if (this.mTimerDisp.isValid())
            {
                this.mTimerDisp.call(this);
            }
        }
    }

    protected void discontinueDisposeAndDisp()
    {
        this.mDisposed = true;
        this.mCurCallTime = this.mTotalTime;
        this.onPreCallBack();

        if (this.mTimerDisp.isValid())
        {
            this.mTimerDisp.call(this);
        }
    }

    public void checkAndDisp()
    {
        if(this.mIsContinuous)
        {
            continueCheckAndDisp();
        }
        else
        {
            discontinueCheckAndDisp();
        }
    }

    // 连续的定时器
    protected void continueCheckAndDisp()
    {
        while (this.mIntervalLeftTime >= this.mInternal)
        {
            // 这个地方 m_curCallTime 肯定会小于 m_totalTime,因为在调用这个函数的外部已经进行了判断
            this.mCurCallTime = this.mCurCallTime + this.mInternal;
            this.mIntervalLeftTime = this.mIntervalLeftTime - this.mInternal;
            this.onPreCallBack();

            if (this.mTimerDisp.isValid())
            {
                this.mTimerDisp.call(this);
            }
        }
    }

    // 不连续的定时器
    protected void discontinueCheckAndDisp()
    {
        if (this.mIntervalLeftTime >= this.mInternal)
        {
            // 这个地方 m_curCallTime 肯定会小于 m_totalTime,因为在调用这个函数的外部已经进行了判断
            this.mCurCallTime = this.mCurCallTime + (((int)(this.mIntervalLeftTime / this.mInternal)) * this.mInternal);
            this.mIntervalLeftTime = this.mIntervalLeftTime % this.mInternal;   // 只保留余数
            this.onPreCallBack();

            if (this.mTimerDisp.isValid())
            {
                this.mTimerDisp.call(this);
            }
        }
    }

    public void reset()
    {
        this.mCurRunTime = 0;
        this.mCurCallTime = 0;
        this.mIntervalLeftTime = 0;
        this.mDisposed = false;
    }

    public void setClientDispose(boolean isDispose)
    {

    }

    public boolean isClientDispose()
    {
        return false;
    }

    public void startTimer()
    {
        //Ctx.msIns.mTimerMgr.addTimer(this);
    }

    public void stopTimer()
    {
        //Ctx.msIns.mTimerMgr.removeTimer(this);
    }
}


text:
<?php
declare(strict_types = 1);

namespace Tests\Innmind\TimeContinuum\Earth\Timezone\America;

use Innmind\TimeContinuum\{
    Earth\Timezone\America\Asuncion,
    Timezone,
};
use PHPUnit\Framework\TestCase;

class AsuncionTest extends TestCase
{
    public function testInterface()
    {
        $zone = new Asuncion;

        $this->assertInstanceOf(Timezone::class, $zone);
    }
}


text:
import "babel/polyfill"

// phantomjs
import "./Function.prototype.bind"

// some not so recent browsers
import "./String.prototype.repeat"


text:
void fill_segment_ssse3(const argon2_instance_t *instance,
                        argon2_position_t position);

int check_ssse3(void);

#endif // ARGON2_SSSE3_H


text:
<?php
namespace NaturalWeb\FileStorage\Storage;

use FilesystemIterator;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;

class FileSystemStorage implements StorageInterface
{
    protected $host;

    protected $pathRoot;

    /**
     * Construct
     *
     * @param string $pathRoot
     * @param string $host
     */
    public function __construct($pathRoot, $host = '')
    {
        $this->pathRoot = rtrim($pathRoot, '/') . "/";
        $this->host = rtrim($host, '/') . "/";
    }

    /**
     * Get Path Root
     *
     * @return string
     */
    public function getPathRoot()
    {
        return $this->pathRoot;
    }

    /**
     * Save file for storage
     *
     * @param string $source   Source File
     * @param string $path     Remote path
     * @param bool   $override Override
     *
     * @return bool
     * @throws
     */
    public function upload($source, $path, $override = false)
    {
        $path = ltrim($path, "/");
        return copy($source, $this->pathRoot.$path);
    }

    /**
     * Delete remote file
     *
     * @param string $path Remote Path
     *
     * @return bool
     * @throws
     */
    public function delete($path)
    {
        $path = trim($path, "/");
        return unlink($this->pathRoot.$path);
    }

    /**
     * Create Folder
     *
     * @param string $path Path folder
     *
     * @return bool
     * @throws
     */
    public function createFolder($path)
    {
        $mode = 0777;
        $recursive = true;
        $path = ltrim($path, "/");
        return mkdir($this->pathRoot.$path, $mode, $recursive);
    }

    /**
     * Delete Folder
     *
     * @param string $path Path folder
     *
     * @return bool
     * @throws
     */
    public function deleteFolder($path)
    {
        $path = ltrim($path, "/");

        if ( ! $this->isDir($path)) {
            throw new ExceptionStorage("Directory {$path} Not found or Not Is Diretory", 1);
        }

        $items = new FilesystemIterator($this->pathRoot.$path);

        foreach ($items as $item)
        {
            // If the item is a directory, we can just recurse into the function and
            // delete that sub-director, otherwise we'll just delete the file and
            // keep iterating through each file until the directory is cleaned.
            if ($item->isDir())
            {
                $pathname = str_replace($this->pathRoot, "", $item->getPathname());
                $this->deleteFolder($pathname);
            }

            // If the item is just a file, we can go ahead and delete it since we're
            // just looping through and waxing all of the files in this directory
            // and calling directories recursively, so we delete the real path.
            else
            {
                $pathname = str_replace($this->pathRoot, "", $item->getPathname());
                $this->delete($pathname);
            }
        }

        return rmdir($this->pathRoot.$path);
    }

    /**
     * Get remote url, return false in case of error
     *
     * @param string $path Remote Path with folder
     *
     * @return string | false
     */
    public function getUrl($path)
    {
        $path = ltrim($path, "/");
        $url = '';
        if ($this->isFile($path)) $url = $this->host.$path;

        return $url;
    }

    /**
     * If path exists
     *
     * @param string $path Remote Path
     *
     * @return bool
     */
    public function exists($path)
    {
        $path = ltrim($path, "/");
        return file_exists($this->pathRoot.$path);
    }

    /**
     * If path is file
     *
     * @param string $path Remote Path
     *
     * @return bool
     */
    public function isFile($path)
    {
        $path = trim($path, "/");
        return is_file($this->pathRoot.$path);
    }

    /**
     * If path is diretory
     *
     * @param string $path Remote Path
     *
     * @return bool
     */
    public function isDir($path)
    {
        $path = ltrim($path, "/");
        return is_dir($this->pathRoot.$path);
    }

    /**
     * Get an array of files in a directory.
     *
     * @param string $directory Directory
     *
     * @return array
     */
    public function items($directory)
    {
        $directory = ltrim($directory, "/");

        $iterator = new FilesystemIterator($this->pathRoot.$directory);

        $files = array();

        foreach ($iterator as $file) {
            $files[] = strval($file);
        }

        return $files;
    }

    /**
     * Get an array of all files in a directory.
     *
     * @param string $directory Directory
     *
     * @return array
     */
    public function files($directory)
    {
        $directory = ltrim($directory, "/");
        $files = array();

        $dirIterator = new RecursiveDirectoryIterator($this->pathRoot.$directory);
        $iterator = new RecursiveIteratorIterator($dirIterator, RecursiveIteratorIterator::CHILD_FIRST);

        foreach ($iterator as $file) {
            if (filetype($file) == 'file') {
                $files[] = strval($file);
            }
        }

        return $files;
    }

    /**
     * Rename Object
     *
     * @param string $oldname Path From
     * @param string $newname Path To
     *
     * @return bool
     */
    public function rename($oldname, $newname)
    {
        $oldname = $this->pathRoot.ltrim($oldname, "/");
        $newname = $this->pathRoot.ltrim($newname, "/");
        return rename($oldname, $newname);
    }

    /**
     * Copy Object
     *
     * @param string $from Path From
     * @param string $to   Path To
     *
     * @return bool
     */
    public function copy($from, $to)
    {
        $pathFrom = $this->pathRoot.ltrim($from, "/");
        $pathTo   = $this->pathRoot.ltrim($to, "/");

        if (is_dir($pathFrom)) {
            return $this->copyDir($pathFrom, $pathTo);
        } else {
            return $this->copyFile($pathFrom, $pathTo);
        }
    }

    /**
     * Copy File
     *
     * @param string $from Path From
     * @param string $to   Path To
     *
     * @return bool
     * @access private
     */
    private function copyFile($from, $to)
    {
        return copy($from, $to);
    }

    /**
     * Copy Directory Recursive
     *
     * @param string $from Path From
     * @param string $to   Path To
     *
     * @return bool
     * @access private
     */
    private function copyDir($from, $to)
    {
        mkdir($to, 0777, true);

        $items = new FilesystemIterator($from);

        foreach ($items as $item)
        {
            $pattern = preg_quote($from, "/");
            $Key = preg_replace("/^{$pattern}/", "", $item);

            $subFrom = strval($item);
            $subTo   = $to.$Key;

            if (filetype($item) == 'dir')
            {
                $this->copyDir($subFrom, $subTo);
            } else {
                $this->copyFile($subFrom, $subTo);
            }
        }

        return true;
    }
}


text:
var bcrypt = require("bcrypt-nodejs");
// Dependencies
// =============================================================

// Sequelize (capital) references the standard library
var Sequelize = require("sequelize");
// sequelize (lowercase) references my connection to the DB.
var sequelize = require("../config/connection.js");

// Creates a "Event" model that matches up with DB

//Wes Update

    var EventModel = sequelize.define("eventmodel", {
      name: {
        type: Sequelize.STRING,
        allowNull: false,
        validate: {
          len: [1]
        }
      },
      description: {
        type: Sequelize.STRING,
        allowNull: false,
        validate: {
          len: [1]
        }
      },
      address: {
        type: Sequelize.STRING,
        allowNull: true,
        len: [1]
      },
      lat: {
        type: Sequelize.STRING,
        allowNull: true,
        len: [1]
      },
      lon: {
        type: Sequelize.STRING,
        allowNull: true,
        len: [1]
      },
      date: {
        type: Sequelize.STRING,
        allowNull: false,
        len: [1]
      },
      image: {
        type: Sequelize.STRING,
        allowNull: false,
        len: [1]
      },
      category: {
        type: Sequelize.STRING,
        defaultValue: "General Assistance"
      }
    });

//Differnt color ??
  // Syncs with DB
EventModel.sync();

// Makes the EventModel Model available for other files (will also create a table)
module.exports = EventModel;


text:
require 'json'

module ZdSearch
  class JSONSearchStore
    def initialize(dir)
      @search_index = SearchIndex.new
      load_files(dir)
    end

    def size
      @search_index.size
    end

    def search(options = {})
      @search_index.search(options)
    end

    private

    def load_files(dir)
      path = File.join(dir, '*.json')
      Dir[path].each do |file|
        if File.file?(file) && File.extname(file) == '.json'
          load_file file
        end
      end
      warn "no json files found in #{dir}" if size == 0
    end

    def load_file(file)
      type = File.basename file, '.json'
      File.open(file) do |f|
        JSON.load(f).each do |doc|
          @search_index << Document.new(type, doc)
        end
      end
    rescue JSON::ParserError
      warn "#{file} is not a JSON file, skipping it"
    end
  end
end


text:
Simple Python script that downloads and saves all the images from a web page to a local folder.

### !!! WARNING: This script will not work currently. Please fork and make a pull request for any better suggestions. Thanks!


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <dimen name="background_text_size">18.0sp</dimen>
</resources>


text:
public class KeyBinding {

}


text:
[![Build Status](https://travis-ci.org/yinguanhao/pipes-cereal.svg?branch=master)](https://travis-ci.org/yinguanhao/pipes-cereal)

Provides functions to decode `pipes` byte streams with `cereal` parsers.


text: Ein Wordpress Plugin zur Verwaltung der Clankasse.


text:
import angular from 'angular';
import Home from './home';
import Login from './login';
import Admin from './admin';
import Empleado from './empleado';
import User from './user';
import DatosForm from './admin/datosForm';
import Cliente from './cliente';
import Clientes from './clientes';
import Cuentas from './cuentas';
import Firmas from './firmas';
import Documentos from './documentos';
import DocumentosList from './documentos-list';
import EstadoCuenta from './estado-cuenta';

let componentModule = angular.module('app.components', [
    Login,
    Admin,
    Cliente,
    Clientes,
    Cuentas,
    Empleado,
    User,
    Documentos,
    EstadoCuenta,
    Firmas,
    DocumentosList,
    DatosForm
])
    .name;

export default componentModule;


text:
package org.apache.http.impl.cookie;

import org.apache.http.annotation.ThreadSafe;
import org.apache.http.client.utils.DateUtils;
import org.apache.http.cookie.CommonCookieAttributeHandler;

/**
 * Standard {@link org.apache.http.cookie.CookieSpec} implementation that enforces syntax
 * and semantics of the well-behaved profile of the HTTP state management specification
 * (RFC 6265, section 4).
 *
 * @since 4.4
 */
@ThreadSafe
public class RFC6265StrictSpec extends RFC6265CookieSpecBase {

    final static String[] DATE_PATTERNS = {
        DateUtils.PATTERN_RFC1123,
        DateUtils.PATTERN_RFC1036,
        DateUtils.PATTERN_ASCTIME
    };

    public RFC6265StrictSpec() {
        super(new BasicPathHandler(),
                new BasicDomainHandler(),
                new BasicMaxAgeHandler(),
                new BasicSecureHandler(),
                new BasicExpiresHandler(DATE_PATTERNS));
    }

    RFC6265StrictSpec(final CommonCookieAttributeHandler... handlers) {
        super(handlers);
    }

    @Override
    public String toString() {
        return "rfc6265-strict";
    }

}


text:
<!DOCTYPE html>

        <title th:text="#{email.reset.title}">JHipster password reset</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link rel="shortcut icon" th:href="@{|${baseUrl}/favicon.ico|}" />

            Dear

            For your Sopnopriyo account a password reset was requested, please click on the URL below to reset it:

            Login link

            Regards,

            Shahin.


text:
title: What Is IOTA?
description: What Is IOTA?
name: IOTA
author: WeUseCoins
authorurl: /
published: true
permalink: /what-is-iota/
toc:
  what: What Is IOTA?
  getting: Getting Started With IOTA
  howto: How To Get An IOTA Wallet?
  resources: IOTA Resources
  buy: How To Buy IOTA?
  earn: How To Earn IOTA?
  spend: Where To Spend IOTA?
  mining: What Is IOTA Mining?
  latest: Latest IOTA News
img: iota.png
category: appcoin
summary: IOTA is the next generation and revolutionary new public distributed ledger that utilizes a novel invention, called "Tangle", at its core. The Tangle is a new data structure based on a Directed Acyclic Graph.
---

What Is IOTA?

IOTA is the next generation and revolutionary new public distributed ledger that utilizes a novel invention, called "Tangle", at its core. The Tangle is a new data structure based on a Directed Acyclic Graph.

As such it has no Blocks, no Chain and also no Miners. Because of this radical new architecture, things in IOTA work quite differently compared to other Blockchains.

The major difference that is worth mentioning (apart from the DAG vs. Blockchain) is how IOTA achieves consensus and how transactions are made. As mentioned previously, there are no miners. What this means is that each participant in the network that wants to make a transaction has to actively participate in the consensus of the network by approving 2 past transactions.

{% include page-toc.html %}

This attestation on the validity of two past transactions ensures that the whole network achieves consensus on the current state of approved transactions, and it enables variety of unique features that are only seen in IOTA.

IOTA is the missing puzzle piece for the Machine Economy to fully emerge and reach its desired potential. We envision IOTA to be the public, permissionless backbone for the Internet of Things that enables true interoperability between all devices.

IOTA has a range of features that are uniquely enabled due to its architecture:

Scalability: IOTA can achieve high transaction throughput thanks to parallelized validation of transactions with no limit as to the number of transactions that can be confirmed in a certain interval

No Transaction Fees: IOTA has no transaction fees.

Decentralization: IOTA has no miners. Every participant in the network that is making a transaction, actively participates in the consensus. As such, IOTA is more decentralized than any Blockchain.

Quantum-immunity: IOTA utilized a newly designed trinary hash function called Curl, which is quantum immune (Winternitz signatures)

Getting Started With IOTA

IOTA is a cryptocurrency designed for the Internet of Things. But before we get into why the Internet of Things needs IOTA, lets look at what IOTA can offer to the existing cryptocurrency scene. (Don't worry, we will return to the internet of things later). IOTA has 4 HUGE advantages over Blockchain cryptocurrencies in that it is:

Scalable

Decenteralized

Modular

Fee Less

How is this achieved?

The technological breakthrough that makes this possible is The Tangle (which looks something like this).

Unlike Bitcoin which uses a blockchain architecture for maintaining it's ledger, IOTA uses the 'Tangle' which is a Directed Acyclic Graph, known as a DAG. In summary the Tangle solves both the scalability and transaction fee issues faced by Bitcoin (And most cryptocurrencies) by requiring the Sender in a transaction to perform a kind of proof of work which approves two transactions.

Thus, the act of making a transaction and validating transactions are coupled. This removes dedicated miners and makes the system fully decenteralised – those making transactions (the systems 'users') are the only actors who can affect the system (whereas in bitcoin miners are not 'using' the system, rather they are simply enabling it to operate).

The remarkable result is that in IOTA, the network transaction speed INCREASES as the number of users increases (as opposed to blockchain cryptocurrencies which get slower with increased numbers of users).  It also eliminates the need for users to pay 'miners' for doing the proof of work (because they do it themselves). Thus there is no Fee to make a transaction!

So far, so good. IOTA looks to be Fee less and scalable. This alone makes IOTA incredibly promising as a technology for a huge number of applications.

But it doesn't stop there. IOTA has been under development since 2015 (Announcement Thread) and in that time industrial partnerships have been forged which will ensure that IOTA has practical, real world use.

How To Get A IOTA Wallet?

Different Node/Wallet types in IOTA

In the guide below you will learn which type of IOTA node or wallet is right for you.

You can then use our knowledge base at the bottom of the page to access tutorials for each option.

If you don't understand any IOTA related terms, check out our Glossary!

When getting started with IOTA it can be very hard to understand the difference between a light and a full node and which wallet types there are. IOTA Support has tutorials for all options but it is important to understand the differences first!

Full Node (GUI): This is an IRI (IOTA Reference Implementation) running and being accessed locally via a GUI. Any full node needs to be connected to neighbours via a static IP in order to function. Learn how you can run a full node and how they help the IOTA ecosystem in our GUI tutorials!

Headless Node: A full node running in your local console. You can access it via a simple UI called Nostalgia in your browser. It has the same requirements as a GUI full node, but has the advantage that you can open multiple Seeds (Accounts) at the same time.

{% include page-toc.html %}

Light Wallet (GUI): A local interface that accesses a full node (IOTA Node) in a different environment (e.g a node on a server; Please note: Your Seed NEVER leaves your computer). Learn how to run a light node in our Lightwallet tutorials!

IOTA App Wallet

Download NodeJS

Install Electron:

npm install -g electron

Install Bower:

npm install -g bower

Windows Users Only

Run the following command as Administrator:

npm install -g --production windows-build-tools

Compiling

If you wish to compile the app, install the following also:

Install Electron Builder

Electron Builder is used behind the scenes. Read their instructions on how to set up your system.

Install Docker

Instructions

Clone this repository:

git clone https://github.com/iotaledger/wallet

Go to the wallet directory:

cd wallet

Clone iri:

git clone https://github.com/iotaledger/iri

Note: make sure compiled iri.jar is in the iri folder.

Install components

npm install

Run the app:

npm start

If you wish to compile the app:

npm run compile

If you'd like to create a package only for a specific OS, you can do so like this:

npm run compile:win

npm run compile:mac

npm run compile:lin

Compiled binaries are found in the out directory.

Testnet

To build testnet binaries, rename package.testnet.json to package.json and follow instructions as above. Make sure the jar is named iri-testnet.jar.

GUI (full node) Knowledge Base

Headless node (full node)

If you don't understand IOTA related terms, check out our Glossary!

The requirements for a headless node are a static IP, IP adresses of your future neighbours and a computer that's running near 24/7 (in order to stay synchronized with the network)!

Furthermore you will need to download Nostalgia, a simple UI for your browser (running only locally), with which you can access your node.

Light Wallet Knowledge Base

A Light Wallet is the easiest way to send and receive IOTA. You have two options to run one!

IOTA Resources

IOTA Official Website

IOTA Twitter

IOTA Reddit

IOTA Github

IOTA Facebook

How To Buy IOTA?

IOTA on Bitfinex

Step 1: Create an account using an account name, your e-mail and a secure password

Step 2: Insert this referral code for reduced trading fees: ********

Step 3: Create account and verify your e-mail

Step 4: Once logged in, select 'Bitcoin' under balances and then 'Deposit'

Step 5:	Send your Bitcoin to the address provided and wait for it to confirm and be shown in your balance

Step 6: Once confirmed, use the order form to place a bid for IOTA

It is important to note that IOTA is listed on Bitfinex in Miota units (1 Miota = 1,000,000 iota)

How To Earn IOTA?

Step 1: Join the Slack-Channel slack.iotatoken.com

The IOTA Slack channel is essential. It provides you with information on updates, bugs and you can buy IOTA there (more explained in detail in the following steps). Make sure to join the sub-channels trading, botbox, and releases.

{% include page-toc.html %}

Step 2: Download the IOTA wallet

You can find the latest version of IOTA, which is currently 1.0.3, at GitHub. To easily find it use either the link in the releases-channel of Slack (in which all future updates of the wallet will be announced) or you simply klick on this one: https://github.com/iotaledger/wallet/releases

You can get help installing it for your system here: https://iota.readme.io/docs/general

Step 3: Start your IOTA wallet

After installing and starting it, this screen should pop up:

Now, in order to create an account you need to generate a Seed (Password). The Seed is ONLY consisting of capital Latin letters and the number 9. The maximum length of the Seed is 81 characters and it is recommended you make a Seed with the maximum length.

You can either think of a new one from scratch or click on Tools-->Generate Seed. Then enter your Seed and press the "Login" Button. You are now in your new account. Make sure to unhide the Status Bar by clicking View-->Show Status Bar. This is essential for the next step.

Step 4: Synchronizing with the Network

After having you account you are NOT ready to use you wallet. First, it needs to synchronize. This is done by simply letting you wallet open and running in the background. To check if your wallet is ready to go, you need to compare the numbers showed in the Status Bar with the latest numbers posted by the so called "Coordinator" in the botbox on Slack.

The Status Bar in the wallet shows the following: XX(X)/YYYYYY (ZZZZ). The YYYYYY are the transactions while the (ZZZZ) are the milestones. Make sure that the transactions and the milestones show coincidence with the latest numbers posted by the Coordinator bot before making any transactions. If the numbers match, you are set up and can use your wallet!

Important note on receiving IOTA:

Before you use your address to receive IOTA, make sure to press "ATTACH TO TANGLE". It will take a while for your address to be attached to your tangle (while showing the words "GETTING TIPS"), but after that you are ready to receive IOTA on this address.

Author's note on synchronizing:

I personally had the problem that at first the transactions were accelerating fast towards the numbers the Coordinator posted, but the closer I got, the longer it took. I ended up having the correct amount of milestones, while I was still behind on transactions.

I asked about this in the forum and was told that the milestones are the important thing and I should try the wallet. It worked! So if you have the same problem just ask someone to send you a small amount of IOTA and see if it works.

Step 5: Buy IOTA

If you want to buy IOTA, visit the trading channel on Slack. In this channel there is an trading bot operating. See the available commands by typing "OTC" (capital letters are necessary). Then simply create an ASK position or message people selling IOTA.

Where To Spend IOTA?

This correlates well with the information presented on IOTA's website. If these claims are proven to be true, IOTA would perhaps be the most interesting innovation to ever emerge from this space.

This post will not go in to extreme detail about how IOTA works or what a DAG is, since there are plenty of other resources online (website, whitepaper, github). Instead, here's an extremely short and simplified version:

The IOTA ledger is constructed as a tree, where the root node ("node" here simply refers to a position in the tree — has nothing to do will network nodes) is the equivalent to the "genesis block", and every subsequent transaction creates a new node in the tree.

From the genesis node, all iotas that will ever be created were distributed to a group of addresses participating in the original ICO in 2015. For a person to extend this tree, his transaction must point to two randomly chosen previous transactions in the tree, and include a tiny Proof-of-Work hash. This creates an ever-growing tree representing the ledger.

When he has selected the two previous transactions, he also verifies them by making sure they also include the required Proof-of-Work and that they neither directly nor indirectly extend what would constitute a double-spending transaction in the tree.

To choose which branch of the tree to extend upon, he follows a specific MCMC-based algorithm, and as long as the majority of the other users follows the same algorithm, the tree will diverge into the same direction as a result.

{% include page-toc.html %}

This direction is then secured over time through the extension of more tiny Proofs-of-Works added by each new transaction. Further, the system only provides any security guarantees in the case that an attacker does not amass more than 33% of the hashpower of the network.

This means that IOTA in its current form does not provide any censorship resistance, since the path of the tree is centrally directed through a Coordinator node run by the IOTA Foundation. As such, IOTA is no more decentralized than an Apache Kafka cluster, or Ripple and their Unique Node List.

This also opens up IOTA to double-spend attacks from the Coordinator itself, which I submitted an issue about. The issue was closed with no response. 3 months later, I got the explanation from IOTA co-founder that such an attack would be "not rational", albeit indeed possible.

What Is IOTA Mining?

You can't mine IOTA for the time being, the only way to acquire them is to buy or purchase them through exchanges which has been discuss above. In the future it could be possible and will be updated right away on this article.

Latest IOTA News

The IOTA Foundation will be established. Now some might ask the eligible question: What is the foundation, what do they do, and why are these news so great? Behind the IOTA Foundation are the developers of IOTA (David Sønstebø, Dominik Schiener, Serguei Popov, Sergey Ivancheglo and probably three more; see 3rd link below), who will push the project further, introduce IOTA to the public and do development.

The reason behind the news of the establishment being awesome is easily explained: The requirement for the establishment of the foundation was that a minimum of 5% of all IOTA tokens would be donated to it in a certain period of time (being in the foundation is a half/fulltime-job and people don't work for free).

{% include page-toc.html %}

This minimum amount has now finally been reached (after the time period for donations was expanded). The foundation will do the following (quoting David Sønstebø, see link #3 below):

"A complete IOTA Foundation roadmap and website with more detailed information will be published later in the week, but here is a brief summary:

1. Initiate C and RUST core client development.

2. Attend Internet-of-Things and Blockchain/Distributed ledger conferences and hackathons in the coming months in active role ( E.G. presentations about IOTA ).

3. In collaboration with some big holders give out development-bounties.

4. Be able to strengthen the brand and raise awareness of IOTA in all capacities.

5. Bring on companies and organizations, especially those focused on Internet-of-Things and blockchain.

6. Essentially realize the vision which started the R&D of IOTA

7. Be the de facto public organization behind IOTA"


text:
<ion-view title="Organisation Create">
    <ion-content overflow-scroll="true" padding="true" scroll="false" class="has-header has-footer">
        <form class="list">
            <ion-list>

                    Name
                    <input type="text" placeholder="">

                    Contact
                    <input type="tel" placeholder="Telephone or Cell">

                    Email
                    <input type="email" placeholder="Email address">

            </ion-list>
            <button class="button button-dark button-block  ion-checkmark button-full"> Save</button>
        </form>
    </ion-content>
</ion-view>


text:
"""
ViewSet decorator to impose conditions enforced by
the ViewRules
"""
from functools import wraps

def require(ViewRule, **params):
    """
    Decorator function checks if all conditions are met.
    If no errors are found, it will return the ViewSet

    :param ViewRule: ViewRule template containing an enforce method
    :type ViewRule: Class inheriting from ViewRule
    """
    def wrapper(viewset):
        @wraps(viewset)
        def require(*request_args, **request_kwargs):
            view_rule = ViewRule(request_args, request_kwargs)
            failed = view_rule.errors_found(params)
            if failed[0]:
                return failed[1]
            return viewset(*request_args, **request_kwargs)
        return require
    return wrapper


text:
/**
* Header file containing function declarations.
*/
#ifndef STDLIB_BLAS_EXT_BASE_DNANNSUMKBN2_H
#define STDLIB_BLAS_EXT_BASE_DNANNSUMKBN2_H

#include <stdint.h>

/*
* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler.
*/
#ifdef __cplusplus
extern "C" {
#endif

/**
* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan–Babuška algorithm.
*/
double stdlib_strided_dnannsumkbn2( const int64_t N, const double *X, const int64_t stride, int64_t *n );

#ifdef __cplusplus
}
#endif

#endif // !STDLIB_BLAS_EXT_BASE_DNANNSUMKBN2_H


text:
package com.company.issuetracker.core.domain;

import java.io.Serializable;

public class IssueTypePK implements Serializable{

	private static final long serialVersionUID = 1L;

	protected String issueTypeId;

	public IssueTypePK(){
	}

	public String getIssueTypeId() {
		return issueTypeId;
	}

	public void setIssueTypeId(String issueTypeId) {
		this.issueTypeId = issueTypeId;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((issueTypeId == null) ? 0 : issueTypeId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (!(obj instanceof IssueTypePK)) {
			return false;
		}
		IssueTypePK other = (IssueTypePK) obj;
		if (issueTypeId == null) {
			if (other.issueTypeId != null) {
				return false;
			}
		} else if (!issueTypeId.equals(other.issueTypeId)) {
			return false;
		}
		return true;
	}
}


text:
package org.siphon.visualbasic.runtime.statements;

import java.util.AbstractList;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.Map;

import org.apache.commons.collections.iterators.ArrayIterator;
import org.apache.commons.collections.iterators.EnumerationIterator;
import org.apache.commons.lang3.ArrayUtils;
import org.siphon.visualbasic.ArgumentException;
import org.siphon.visualbasic.ClassModuleDecl;
import org.siphon.visualbasic.ClassTypeDecl;
import org.siphon.visualbasic.Interpreter;
import org.siphon.visualbasic.MethodDecl;
import org.siphon.visualbasic.ModuleMemberDecl;
import org.siphon.visualbasic.PropertyDecl;
import org.siphon.visualbasic.SourceLocation;
import org.siphon.visualbasic.VarDecl;
import org.siphon.visualbasic.compile.ValueStatementDesc;
import org.siphon.visualbasic.runtime.CallFrame;
import org.siphon.visualbasic.runtime.JavaModuleInstance;
import org.siphon.visualbasic.runtime.ModuleInstance;
import org.siphon.visualbasic.runtime.Statement;
import org.siphon.visualbasic.runtime.VbArray;
import org.siphon.visualbasic.runtime.VbRuntimeException;
import org.siphon.visualbasic.runtime.VbValue;
import org.siphon.visualbasic.runtime.VbVarType;
import org.siphon.visualbasic.runtime.VbVariable;
import org.siphon.visualbasic.runtime.interaction.JavaArrayIterator;
import org.siphon.visualbasic.runtime.interaction.VbValueIterator;

public class ForEachStatement extends Statement {

	private VarDecl varDecl;
	private Statement collection;
	protected Iterator<VbValue> iterator;

	public ForEachStatement(SourceLocation sourceLocation, VarDecl var, Statement collection) {
		super(sourceLocation);
		this.varDecl = var;
		this.collection = collection;
	}

	@Override
	public VbValue eval(Interpreter interpreter, CallFrame frame) throws VbRuntimeException {
		return null;
	}

	public Statement initStatement(SourceLocation sourceLocation) {
		return new Statement(sourceLocation) {

			@Override
			public VbValue eval(Interpreter interpreter, CallFrame frame) throws VbRuntimeException {
				VbValue col = collection.eval(interpreter, frame);
				if (col.varType.vbType == VbVarType.vbVariant) {
					col = (VbValue) col.value;
				}
				if (col.varType.vbType == VbVarType.vbArray) {
					VbArray arr = (VbArray) col;
					iterator = arr.iterator();
				} else if (col.varType.isJavaObject()) {
					if (col.value.getClass().isArray()) {
						iterator = new JavaArrayIterator(col.value);
					} else if (col.value instanceof Iterable) {
						iterator = new VbValueIterator(((Iterable) col.value).iterator());
					} else if (col.value instanceof Enumeration) {
						iterator = new VbValueIterator(new EnumerationIterator((Enumeration) col.value));
					} else if (col.value instanceof Map) {
						Map map = (Map) col.value;
						iterator = new VbValueIterator(map.values().iterator());
					}
				}
				if (iterator == null && col.isObject()) {
					ClassModuleDecl c = col.varType.getClassModuleDecl();
					ModuleMemberDecl it = (c != null ? c.getIteratorMember() : null);
					if (it == null) {
						throw new VbRuntimeException(VbRuntimeException.类型不匹配, sourceLocation);
					}
					MethodDecl itMethod = null;
					if (it instanceof PropertyDecl) {
						PropertyDecl p = (PropertyDecl) it;
						if (p.get == null || p.get.arguments.size() > 0) {
							throw new VbRuntimeException(VbRuntimeException.无效的过程调用, sourceLocation);
						}
						itMethod = p.get;
					} else if (it instanceof MethodDecl) {
						itMethod = (MethodDecl) it;
						if (itMethod.arguments.size() > 0) {
							throw new VbRuntimeException(VbRuntimeException.无效的过程调用, sourceLocation);
						}
					}

					try {
						VbValue itr = interpreter.callMethod((ModuleInstance) col.value, itMethod);
						if (itr != null) {
							if (itr.value instanceof JavaModuleInstance) {
								JavaModuleInstance inst = (JavaModuleInstance) itr.value;
								Object obj = inst.getInstance();
								if (obj instanceof Iterator) {
									iterator = (Iterator) obj;
								}
							} else if (itr.value instanceof Iterator) {
								iterator = (Iterator<VbValue>) itr.value;
							}
						}
						if (iterator == null) {
							throw new VbRuntimeException(VbRuntimeException.类型不匹配, sourceLocation);
						}
					} catch (ArgumentException e) {
						// no arguments
					}
				}
				return null;
			}

			@Override
			public String toString() {
				return "For Each Iterator At " + varDecl;
			}
		};
	}

	public Statement advanceNext(SourceLocation sourceLocation) {
		return new Statement(sourceLocation) {

			@Override
			public VbValue eval(Interpreter interpreter, CallFrame frame) throws VbRuntimeException {
				VbVariable variable = frame.locateVbVariable(varDecl);
				variable.assign(iterator.next(), interpreter, frame, sourceLocation);
				return null;
			}

			@Override
			public String toString() {
				return "ForEach.Next";
			}
		};
	}

	public Statement hasNext(SourceLocation sourceLocation) {
		return new Statement(sourceLocation) {

			@Override
			public VbValue eval(Interpreter interpreter, CallFrame frame) throws VbRuntimeException {
				return VbValue.fromJava(iterator.hasNext());
			}

			@Override
			public String toString() {
				return "ForEach.hasNext";
			}
		};
	}

}


text:
<!DOCTYPE html>

  <title>Backgrid.js</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="X-UA-Compatible" content="chrome=1">
  <meta name="fragment" content="!">

  <link rel="shortcut icon" type="image/ico" href="favicon.ico" />
  <link rel="stylesheet" href="resources/css/app-0b2d94a756da271cc9ed4a65f4837560.css" type="text/css" />

Backgrid.js

Backgrid.js

Backgrid.js Core

Cells

Backgrid.Cell

Backgrid.DatetimeCell

Backgrid.DateCell

Backgrid.TimeCell

Backgrid.NumberCell

Backgrid.IntegerCell

Backgrid.PercentCell

Backgrid.StringCell

Backgrid.UriCell

Backgrid.EmailCell

Backgrid.BooleanCell

Backgrid.SelectCell

CellEditors

Backgrid.CellEditor

Backgrid.InputCellEditor

Backgrid.BooleanCellEditor

Backgrid.SelectCellEditor

Formatters

Backgrid.CellFormatter

Backgrid.StringFormatter

Backgrid.EmailFormatter

Backgrid.NumberFormatter

Backgrid.PercentFormatter

Backgrid.DatetimeFormatter

Backgrid.SelectFormatter

Columns

Backgrid.Column

Backgrid.Columns

Headers

Backgrid.HeaderCell

Backgrid.HeaderRow

Backgrid.Header

Others

Backgrid.Command

Backgrid.Grid

Backgrid.Body

Backgrid.Row

Backgrid.EmptyRow

Backgrid.Footer

Generated on Mon 27 Feb 2017 16:47:17 by JSDuck 4.10.4.


text:
<?php

include_once('BCGBarcode1D.php');

class BCGupca extends BCGBarcode1D {
	protected $codeParity = array();

	/**
	 * Constructor
	 */
	public function __construct() {
		parent::__construct();

		$this->keys = array('0','1','2','3','4','5','6','7','8','9');
		// Left-Hand Odd Parity starting with a space
		// Left-Hand Even Parity is the inverse (0=0012) starting with a space
		// Right-Hand is the same of Left-Hand starting with a bar
		$this->code = array(
			'2100',	/* 0 */
			'1110',	/* 1 */
			'1011',	/* 2 */
			'0300',	/* 3 */
			'0021',	/* 4 */
			'0120',	/* 5 */
			'0003',	/* 6 */
			'0201',	/* 7 */
			'0102',	/* 8 */
			'2001'	/* 9 */
		);
		// Parity, 0=Odd, 1=Even for manufacturer code. Depending on 1st System Digit
		$this->codeParity = array(
			array(0,0,0,0,0),	/* 0 */
			array(0,1,0,1,1),	/* 1 */
			array(0,1,1,0,1),	/* 2 */
			array(0,1,1,1,0),	/* 3 */
			array(1,0,0,1,1),	/* 4 */
			array(1,1,0,0,1),	/* 5 */
			array(1,1,1,0,0),	/* 6 */
			array(1,0,1,0,1),	/* 7 */
			array(1,0,1,1,0),	/* 8 */
			array(1,1,0,1,0)	/* 9 */
		);
	}

	public function parse($text) {
		parent::parse($text);

		$this->setLabelOffset();
	}

	public function setFont($font) {
		parent::setFont($font);

		$this->setLabelOffset();
	}

	public function setLabel($label) {
		parent::setLabel($label);

		$this->setLabelOffset();
	}

	public function setOffsetX($offsetX) {
		parent::setOffsetX($offsetX);

		$this->setLabelOffset();
	}

	public function setScale($scale) {
		parent::setScale($scale);

		$this->setLabelOffset();
	}

	/**
	 * Draws the barcode
	 *
	 * @param resource $im
	 */
	public function draw(&$im) {
		$error_stop = false;

		// Checking if all chars are allowed
		$c = strlen($this->text);
		for($i = 0; $i < $c; $i++) {
			if(array_search($this->text[$i], $this->keys) === false) {
				$this->drawError($im, 'Char \'' . $this->text[$i] . '\' not allowed.');
				$error_stop = true;
			}
		}
		if($error_stop === false) {
			// Must contain 11 chars
			if($c !== 11) {
				$this->drawError($im, 'Must contain 11 chars, the 12th digit is automatically added.');
				$error_stop = true;
			}
			if($error_stop === false) {
				// The following code is exactly the same as EAN13. We just add a 0 in front of the code !
				$this->text = '0'.$this->text; // We will remove it at the end... don't worry
				// Checksum
				$this->calculateChecksum();
				$temp_text = $this->text . $this->keys[$this->checksumValue];
				// Starting Code
				$this->drawChar($im, '000', true);
				// Draw Second Code
				$this->drawChar($im, $this->findCode($temp_text[1]), false);
				// Draw Manufacturer Code
				for($i = 0; $i < 5; $i++) {
					$this->drawChar($im, self::inverse($this->findCode($temp_text[$i + 2]), $this->codeParity[$temp_text[0]][$i]), false);
				}
				// Draw Center Guard Bar
				$this->drawChar($im, '00000', false);
				// Draw Product Code
				for($i = 7; $i < 13; $i++) {
					$this->drawChar($im, $this->findCode($temp_text[$i]), true);
				}
				// Draw Right Guard Bar
				$this->drawChar($im, '000', true);
				$this->drawText($im);
				// We remove the 0 in front, as we said :)
				$this->text = substr($this->text, 1);
			}
		}
	}

	/**
	 * Returns the maximal size of a barcode
	 *
	 * @return int[]
	 */
	public function getMaxSize() {
		$p = parent::getMaxSize();

		$startlength = 3 * $this->scale;
		$centerlength = 5 * $this->scale;
		$textlength = 12 * 7 * $this->scale;
		$endlength = 3 * $this->scale;
		$lastcharlength = $this->getEndPosition() + 2;

		return array($p[0] + $startlength + $centerlength + $textlength + $endlength + $lastcharlength, $p[1]);
	}

	/**
	 * Overloaded method to calculate checksum
	 */
	protected function calculateChecksum() {
		// Calculating Checksum
		// Consider the right-most digit of the message to be in an "odd" position,
		// and assign odd/even to each character moving from right to left
		// Odd Position = 3, Even Position = 1
		// Multiply it by the number
		// Add all of that and do 10-(?mod10)
		$odd = true;
		$this->checksumValue = 0;
		$c = strlen($this->text);
		for($i = $c; $i > 0; $i--) {
			if($odd === true) {
				$multiplier = 3;
				$odd = false;
			} else {
				$multiplier = 1;
				$odd = true;
			}
			if(!isset($this->keys[$this->text[$i - 1]])) {
				return;
			}
			$this->checksumValue += $this->keys[$this->text[$i - 1]] * $multiplier;
		}
		$this->checksumValue = (10 - $this->checksumValue % 10) % 10;
	}

	/**
	 * Overloaded method to display the checksum
	 */
	protected function processChecksum() {
		if($this->checksumValue === false) { // Calculate the checksum only once
			$this->calculateChecksum();
		}
		if($this->checksumValue !== false) {
			return $this->keys[$this->checksumValue];
		}
		return false;
	}

	/**
	 * Overloaded method for drawing special label
	 *
	 * @param resource $im
	 */
	protected function drawText($im) {
		if($this->label !== BCGBarcode1D::AUTO_LABEL) {
			parent::drawText($im);
		} elseif($this->label !== '') {
			$temp_text = $this->text . $this->keys[$this->checksumValue];
			if($this->textfont instanceof BCGFont) {
				$code1 = 0;
				$code2 = 0;

				$this->textfont->setText($temp_text);
				$this->drawExtendedBars($im, $this->textfont->getHeight(), $code1, $code2);

				// We need to separate the text, one on the left and one on the right, one starting and one ending
				$text0 = substr($temp_text, 1, 1);
				$text1 = substr($temp_text, 2, 5);
				$text2 = substr($temp_text, 7, 5);
				$text3 = substr($temp_text, 12, 1);
				$font0 = clone $this->textfont;
				$font1 = clone $this->textfont;
				$font2 = clone $this->textfont;
				$font3 = clone $this->textfont;
				$font0->setText($text0);
				$font1->setText($text1);
				$font2->setText($text2);
				$font3->setText($text3);

				$xPosition0 = $this->offsetX * $this->scale - $font0->getWidth() - 4; // -4 is just for beauty;
				$xPosition3 = $this->offsetX * $this->scale + $this->positionX * $this->scale + 2;
				$yPosition0 = $this->thickness * $this->scale + $font0->getHeight() / 2 + $this->offsetY * $this->scale;

				$xPosition1 = ($this->scale * 36 - $font1->getWidth()) / 2 + $code1 * $this->scale + $this->offsetX * $this->scale;
				$xPosition2 = ($this->scale * 37 - $font2->getWidth()) / 2 + $code2 * $this->scale + $this->offsetX * $this->scale;
				$yPosition = $this->thickness * $this->scale + $this->textfont->getHeight() + BCGBarcode1D::SIZE_SPACING_FONT + $this->offsetY * $this->scale;

				$text_color = $this->colorFg->allocate($im);
				$font0->draw($im, $text_color, $xPosition0, $yPosition0);
				$font1->draw($im, $text_color, $xPosition1, $yPosition);
				$font2->draw($im, $text_color, $xPosition2, $yPosition);
				$font3->draw($im, $text_color, $xPosition3, $yPosition0);
			} elseif($this->textfont !== 0) {
				$code1 = 0;
				$code2 = 0;

				$this->drawExtendedBars($im, 9, $code1, $code2);

				$xPosition0 = $this->offsetX * $this->scale - imagefontwidth($this->textfont);
				$xPosition3 = $this->offsetX * $this->scale + $this->positionX * $this->scale + 2;
				$yPosition0 = $this->thickness * $this->scale - imagefontheight($this->textfont) / 2 + $this->offsetY * $this->scale;

				$xPosition1 = ($this->scale * 36 - imagefontwidth($this->textfont) * 5) / 2 + $code1 * $this->scale + $this->offsetX * $this->scale;
				$xPosition2 = ($this->scale * 37 - imagefontwidth($this->textfont) * 5) / 2 + $code2 * $this->scale + $this->offsetX * $this->scale;
				$yPosition = $this->thickness * $this->scale + $this->offsetY * $this->scale;

				$text_color = $this->colorFg->allocate($im);
				imagechar($im, $this->textfont, $xPosition0, $yPosition0, $temp_text[1], $text_color);
				imagestring($im, $this->textfont, $xPosition1, $yPosition, substr($temp_text, 2, 5), $text_color);
				imagestring($im, $this->textfont, $xPosition2, $yPosition, substr($temp_text, 7, 5), $text_color);
				imagechar($im, $this->textfont, $xPosition3, $yPosition0, $temp_text[12], $text_color);
			}
		}
	}

	private function setLabelOffset() {
		$label = $this->getLabel();
		if(!empty($label)) {
			if($this->textfont instanceof BCGFont) {
				$f = clone $this->textfont;
				$f->setText(substr($label, 0, 1));
				$val = ($f->getWidth() + 5) / $this->scale;
				if($val > $this->offsetX) {
					$this->offsetX = $val;
				}
			} elseif($this->textfont !== 0) {
				$val = (imagefontwidth($this->textfont) + 2) / $this->scale;
				if($val > $this->offsetX) {
					$this->offsetX = $val;
				}
			}
		}
	}

	private function drawExtendedBars(&$im, $plus, &$code1, &$code2) {
		$temp_text = $this->text . $this->keys[$this->checksumValue];
		$rememberX = $this->positionX;
		$rememberH = $this->thickness;
		// We increase the bars

		// First 2 Bars
		$this->thickness = $this->thickness + ceil($plus / $this->scale);
		$this->positionX = 0;
		$this->drawSingleBar($im, BCGBarcode::COLOR_FG);
		$this->positionX += 2;
		$this->drawSingleBar($im, BCGBarcode::COLOR_FG);

		// Attemping to increase the 2 following bars
		$this->positionX += 1;
		$code1 = $this->positionX;
		$temp_value = $this->findCode($temp_text[1]);
		$this->drawChar($im, $temp_value, false);
		$code1 = $this->positionX;

		// Center Guard Bar
		$this->positionX += 36;
		$this->drawSingleBar($im, BCGBarcode::COLOR_FG);
		$this->positionX += 2;
		$this->drawSingleBar($im, BCGBarcode::COLOR_FG);
		$code2 = $this->positionX;

		// Attemping to increase the 2 last bars
		$this->positionX += 37;
		$temp_value = $this->findCode($temp_text[12]);
		$this->drawChar($im, $temp_value, true);

		// Completly last bars
		$this->drawSingleBar($im, BCGBarcode::COLOR_FG);
		$this->positionX += 2;
		$this->drawSingleBar($im, BCGBarcode::COLOR_FG);

		$this->positionX = $rememberX;
		$this->thickness = $rememberH;
	}

	private function getEndPosition() {
		if($this->label === BCGBarcode1D::AUTO_LABEL) {
			$this->calculateChecksum();
			if($this->textfont instanceof BCGFont) {
				$f = clone $this->textfont;
				$f->setText($this->checksumValue);
				return $f->getWidth();
			} elseif($this->textfont !== 0) {
				return imagefontwidth($this->textfont);
			}
		}
		return 0;
	}

	private static function inverse($text, $inverse = 1) {
		if($inverse === 1) {
			$text = strrev($text);
		}
		return $text;
	}
};
?>


text:
package org.mockito;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * This annotation is not supposed to be used by Mockito end-users. Instead, we
 * use it to annotate methods for Static Analysis tools, including FindBugs and ErrorProne.
 * These tools can check whether the return value of our Mockito methods are actually
 * used. As such, Mockito State Validation can be performed at compile-time rather than run-time.
 * This annotation is public, because we have to use it in multiple packages.
 *
 * @see Findbugs source code
 * @see ErrorProne check
 * @since 2.11.4
 */
@Target({
    ElementType.CONSTRUCTOR,
    ElementType.METHOD,
    ElementType.PACKAGE,
    ElementType.TYPE
})
@Retention(RetentionPolicy.CLASS)
public @interface CheckReturnValue {
}


text:
package net.ljcomputing.ecsr.service.contact.impl;

import net.ljcomputing.ecsr.domain.contact.AbstractContactInformation;
import net.ljcomputing.ecsr.repository.contact.ContactInformationRepository;
import net.ljcomputing.ecsr.service.contact.ContactInformationService;
import net.ljcomputing.ecsr.service.impl.AbstractDomainServiceImpl;

/**
 * Abstract implementation of the contact information service.
 *
 * @author James G. Willmore
 *
 */
public abstract class AbstractContactInformationServiceImpl
    <T extends AbstractContactInformation, R extends ContactInformationRepository<T>>
    extends AbstractDomainServiceImpl<T, R>
    implements ContactInformationService<T, R> {

  /**
   * Instantiates a new abstract contact information service impl.
   */
  protected AbstractContactInformationServiceImpl() {
    super();
  }
}


text:
/* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */

/*! \page License
 * Copyright (C) 2009, H&D Wireless AB All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 *
 * 3. The name of H&D Wireless AB may not be used to endorse or promote products derived
 * from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY H&D WIRELESS AB ``AS IS'' AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND
 * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
#ifndef WL_CM_H
#define WL_CM_H

#include <stdint.h>
#include <stdlib.h>
#include <wl_api.h>

typedef void (cm_scan_cb_t)(void* ctx);
typedef void (cm_conn_cb_t)(struct wl_network_t *net, void* ctx);
typedef void (cm_disconn_cb_t)(void* ctx);

wl_err_t wl_cm_set_network(struct wl_ssid_t *ssid, struct wl_mac_addr_t *bssid);

wl_err_t wl_cm_init(cm_scan_cb_t scan_cb,
                    cm_conn_cb_t conn_cb,
                    cm_disconn_cb_t disconn_cb,
                    void* ctx);

wl_err_t wl_cm_start(void);
wl_err_t wl_cm_stop(void);

#endif


text:
	<?
	if(isset($_GET['returnTo']))
		$url = array($_GET['returnTo']);
	if(!isset($url))
		$url = array('profilecomment/admin');
echo CHtml::Button(Yii::t('app', 'Cancel'), array('submit' => $url)); ?>
<?php echo CHtml::submitButton(Yii::t('app', 'Create')); ?>


text:
!function(NAME){
  // 19.2.4.2 name
  NAME in FunctionProto || defineProperty(FunctionProto, NAME, {
    configurable: true,
    get: function(){
      var match = String(this).match(/^\s*function ([^ (]*)/)
        , name  = match ? match[1] : '';
      has(this, NAME) || defineProperty(this, NAME, descriptor(5, name));
      return name;
    },
    set: function(value){
      has(this, NAME) || defineProperty(this, NAME, descriptor(0, value));
    }
  });
}('name');


text:
package org.apache.hedwig.server.stats;

import java.util.concurrent.ConcurrentMap;

import org.apache.bookkeeper.stats.StatsLogger;
import org.apache.hedwig.protocol.PubSubProtocol;

import com.google.protobuf.ByteString;

/**
 * Any backend that logs hedwig stats should implement this interface.
 * The Getter and Logger interfaces are different because some backends might export
 * stats internally and the getters would have to be no-ops.
 */
public interface HedwigServerStatsLogger extends StatsLogger {

    /**
     * An enum representing the simple stats logged by this logger
     */
    public static enum HedwigServerSimpleStatType {
        TOTAL_REQUESTS_RECEIVED, TOTAL_REQUESTS_REDIRECT, TOTAL_MESSAGES_DELIVERED,
        NUM_TOPICS, PERSIST_QUEUE, NUM_SUBSCRIPTIONS, NUM_REMOTE_SUBSCRIPTIONS,
        NUM_CACHED_ENTRIES, NUM_CACHE_STUBS, NUM_CACHE_HITS, NUM_CACHE_MISS,
        CACHE_ENTRY_SIZE
    }

    /**
     * An enum representing operations logged by this logger
     */
    public static enum HedwigServerInternalOpStatType {
        PERSISTENCE_MANAGER_ACQUIRE, PERSISTENCE_MANAGER_RELEASE, PERSISTENCE_MANAGER_UPDATE_LEDGERRANGES,
        PERSISTENCE_MANAGER_CHANGE_LEDGER, SUBSCRIPTION_MANAGER_ACQUIRE, SUBSCRIPTION_MANAGER_RELEASE
    }

    public static enum PerTopicStatType {
        CROSS_REGION, LOCAL_PENDING
    }

    /**
     * Set the value in the per topic map for operation type. We use this to set the locally pending messages.
     * @param type The type of operation whose map we update.
     * @param topic
     * @param value The sequence id to be set
     * @param create True if we should put a value in the map if one doesn't exist.
     * @return
     */
    public void setPerTopicSeqId(PerTopicStatType type, ByteString topic, long seqId, boolean create);

    /**
     * Set the value in the per topic map for operation type. We use this to set cross region delivered sequence ids.
     * @param type
     * @param topic
     * @param message
     * @param create
     */
    public void setPerTopicLastSeenMessage(PerTopicStatType type, ByteString topic, PubSubProtocol.Message message, boolean create);

    /**
     * Get the logger map for this type. Each entry in the returned map is of the form <topic, PerTopicStat>
     * @param type
     */
    public ConcurrentMap<ByteString, PerTopicStat> getPerTopicLogger(PerTopicStatType type);

    /**
     * Remove the logger from the maps for this topic.
     * @param type
     * @param topic
     */
    public void removePerTopicLogger(PerTopicStatType type, ByteString topic);
}


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

<title>The GNU Fortran Compiler: MASKL</title>

<meta name="description" content="The GNU Fortran Compiler: MASKL">
<meta name="keywords" content="The GNU Fortran Compiler: MASKL">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Intrinsic-Procedures.html#Intrinsic-Procedures" rel="up" title="Intrinsic Procedures">
<link href="MASKR.html#MASKR" rel="next" title="MASKR">
<link href="MALLOC.html#MALLOC" rel="prev" title="MALLOC">

Next: MASKR, Previous: MALLOC, Up: Intrinsic Procedures   [Contents][Index]

8.162 MASKL — Left justified mask

Description:

MASKL(I[, KIND]) has its leftmost <var>I</var> bits set to 1, and the
remaining bits set to 0.

Standard:

Fortran 2008 and later

Class:

Elemental function

Syntax:

RESULT = MASKL(I[, KIND])

Arguments:

<var>I</var>	Shall be of type INTEGER.

<var>KIND</var>	Shall be a scalar constant expression of type
INTEGER.

Return value:

The return value is of type INTEGER. If <var>KIND</var> is present, it
specifies the kind value of the return type; otherwise, it is of the
default integer kind.

See also:

MASKR


text:
import subprocess
import os
import os.path
from glob import glob
import unittest
import logging
from mock import patch

import luigi
from luigi.contrib.sge import SGEJobTask, _parse_qstat_state

from nose.plugins.attrib import attr

DEFAULT_HOME = '/home'

logger = logging.getLogger('luigi-interface')

QSTAT_OUTPUT = """job-ID  prior   name       user         state submit/start at     queue                          slots ja-task-ID
-----------------------------------------------------------------------------------------------------------------
     1 0.55500 job1 root         r     07/09/2015 16:56:45 all.q@node001                      1
     2 0.55500 job2 root         qw    07/09/2015 16:56:42                                    1
     3 0.00000 job3 root         t    07/09/2015 16:56:45                                    1
"""

def on_sge_master():
    try:
        subprocess.check_output('qstat', shell=True)
        return True
    except subprocess.CalledProcessError:
        return False

@attr('contrib')
class TestSGEWrappers(unittest.TestCase):

    def test_track_job(self):
        """`track_job` returns the state using qstat"""
        self.assertEqual(_parse_qstat_state(QSTAT_OUTPUT, 1), 'r')
        self.assertEqual(_parse_qstat_state(QSTAT_OUTPUT, 2), 'qw')
        self.assertEqual(_parse_qstat_state(QSTAT_OUTPUT, 3), 't')
        self.assertEqual(_parse_qstat_state('', 1), 'u')
        self.assertEqual(_parse_qstat_state('', 4), 'u')

class TestJobTask(SGEJobTask):

    """Simple SGE job: write a test file to NSF shared drive and waits a minute"""

    i = luigi.Parameter()

    def work(self):
        logger.info('Running test job...')
        with open(self.output().path, 'w') as f:
            f.write('this is a test\n')

    def output(self):
        return luigi.LocalTarget(os.path.join(DEFAULT_HOME, 'testfile_' + str(self.i)))

@attr('contrib')
class TestSGEJob(unittest.TestCase):

    """Test from SGE master node"""

    def test_run_job(self):
        if on_sge_master():
            outfile = os.path.join(DEFAULT_HOME, 'testfile_1')
            tasks = [TestJobTask(i=str(i), n_cpu=1) for i in range(3)]
            luigi.build(tasks, local_scheduler=True, workers=3)
            self.assertTrue(os.path.exists(outfile))

    @patch('subprocess.check_output')
    def test_run_job_with_dump(self, mock_check_output):
        mock_check_output.side_effect = [
            'Your job 12345 ("test_job") has been submitted',
            ''
        ]
        task = TestJobTask(i="1", n_cpu=1, shared_tmp_dir='/tmp')
        luigi.build([task], local_scheduler=True)
        self.assertEqual(mock_check_output.call_count, 2)

    def tearDown(self):
        for fpath in glob(os.path.join(DEFAULT_HOME, 'test_file_*')):
            try:
                os.remove(fpath)
            except OSError:
                pass


text:
(function () {
	'use strict';

		var express = require('express');
		var controller = require('./jelp.controller');
		var router = express.Router();

	// --------------------------------------------------------------------------------
	// Routes
	// --------------------------------------------------------------------------------

		router.get('/', controller.all);
		router.get('/:id', controller.one);
		router.post('/', controller.create);
		router.put('/', controller.update);
		router.delete('/:id', controller.delete);

	// --------------------------------------------------------------------------------
	// Exports
	// --------------------------------------------------------------------------------

		module.exports = router;

}());


text:
module Gathering
  class PersonRepository
    include Lotus::Repository

  end
end