text:
// ********************************************************************************************************
// Product Name: DotSpatial.Positioning.dll
// Description:  A library for managing GPS connections.
// ********************************************************************************************************
//
// The Original Code is from http://gps3.codeplex.com/ version 3.0
//
// The Initial Developer of this original code is Jon Pearson. Submitted Oct. 21, 2010 by Ben Tombs (tidyup)
//
// Contributor(s): (Open source contributors should list themselves and their modifications here).
// -------------------------------------------------------------------------------------------------------
// |    Developer             |    Date    |                             Comments
// |--------------------------|------------|--------------------------------------------------------------
// | Tidyup  (Ben Tombs)      | 10/21/2010 | Original copy submitted from modified GPS.Net 3.0
// | Shade1974 (Ted Dunsford) | 10/22/2010 | Added file headers reviewed formatting with resharper.
// ********************************************************************************************************

using System;
using System.Globalization;
using System.Net;
using System.Net.Sockets;
#if !PocketPC

using System.ComponentModel;

#endif

namespace DotSpatial.Positioning
{
#if !PocketPC

    /// <summary>
    /// Represents a Bluetooth service on a device.
    /// </summary>
    [Description("Returns a GUID indentifying the service.")]
    [DefaultProperty("Name")]
    [TypeConverter(typeof(ExpandableObjectConverter))]
#endif
    public sealed class BluetoothEndPoint : EndPoint, IEquatable<BluetoothEndPoint>, IFormattable
    {
        /// <summary>
        ///
        /// </summary>
        private readonly SocketAddress _socketAddress;
        /// <summary>
        ///
        /// </summary>
        private BluetoothAddress _address;
        /// <summary>
        ///
        /// </summary>
        private Guid _service;
        /// <summary>
        ///
        /// </summary>
        private readonly int _port;
        /// <summary>
        ///
        /// </summary>
        private string _name;
        /// <summary>
        ///
        /// </summary>
        private int _successfulDetectionCount;
        /// <summary>
        ///
        /// </summary>
        private int _failedDetectionCount;

        /// <summary>
        ///
        /// </summary>
        private const AddressFamily BLUETOOTH_FAMILY = (AddressFamily)32;
#if !PocketPC
        /// <summary>
        ///
        /// </summary>
        private const int PACKET_SIZE = 30;
        /// <summary>
        ///
        /// </summary>
        private const int ADDRESS_OFFSET = 2;
        /// <summary>
        ///
        /// </summary>
        private const int SERVICE_GUID_OFFSET = 10;
        /// <summary>
        ///
        /// </summary>
        private const int PORT_OFFSET = 26;
        /// <summary>
        ///
        /// </summary>
        private const int DEFAULT_PORT = 1;
#else
        private const int PacketSize = 40;
        private const int AddressOffset = 8;
        private const int ServiceGuidOffset = 16;
        private const int PortOffset = 32;
        private const int DefaultPort = 0;
#endif

        #region Constructors

        /* FxCop says this is unused
         *
        //internal BluetoothEndPoint(byte[] data)
        //{
        //    /* Socket endpoints are different on the desktop vs. mobile devices.
        //     * As a result, we'll serialize the same Address/Port/Guid differently.
        //     */

        //    // Create a new Bluetooth socket address
        //    _SocketAddress = new SocketAddress(BluetoothFamily, PacketSize);

        //    // Copy all the data over
        //    for (int index = 0; index < PacketSize; index++)
        //        _SocketAddress[index] = data[index];

        //    // Deserialize the address
        //    _Address = new BluetoothAddress(BitConverter.ToInt32(data, AddressOffset));

        //    // Deserialize the service GUID
        //    byte[] serviceBytes = new byte[16];
        //    Array.Copy(data, ServiceGuidOffset, serviceBytes, 0, 16);
        //    _Service = new Guid(serviceBytes);

        //    // Deserialize the port
        //    _Port = BitConverter.ToInt32(data, PortOffset);
        //}

        /// <summary>
        /// Creates a new instance using the specified address.
        /// </summary>
        /// <param name="address">The address.</param>
        public BluetoothEndPoint(BluetoothAddress address)
            : this(address, Guid.Empty)
        { }

        /// <summary>
        /// Creates a new instance using the specified address and service GUID.
        /// </summary>
        /// <param name="address">The address.</param>
        /// <param name="service">The service.</param>
        public BluetoothEndPoint(BluetoothAddress address, Guid service)
            : this(address, service, DEFAULT_PORT)
        { }

        /// <summary>
        /// Creates a new instance using the specified address, service GUID, and remote port number.
        /// </summary>
        /// <param name="address">The address.</param>
        /// <param name="service">The service.</param>
        /// <param name="port">The port.</param>
        public BluetoothEndPoint(BluetoothAddress address, Guid service, int port)
        {
            _address = address;
            _service = service;
            _port = port;

            // Create a new Bluetooth socket address
            _socketAddress = new SocketAddress(BLUETOOTH_FAMILY, PACKET_SIZE);

            // Specify the address family (again?)
            _socketAddress[0] = 32;

            // Copy the device address in
            byte[] addressBytes = address.Address;
            for (int index = 0; index < 6; index++)
                _socketAddress[index + ADDRESS_OFFSET] = addressBytes[index];

            // Copy in the service GUID
            byte[] guidBytes = service.ToByteArray();
            for (int index = 0; index < 16; index++)
                _socketAddress[index + SERVICE_GUID_OFFSET] = guidBytes[index];

            // Copy in the port
            byte[] portBytes = BitConverter.GetBytes(port);
            for (int index = 0; index < 4; index++)
                _socketAddress[index + PORT_OFFSET] = portBytes[index];
        }

        /// <summary>
        /// Creates a new instance from the specified socket address.
        /// </summary>
        /// <param name="socketAddress">The socket address.</param>
        public BluetoothEndPoint(SocketAddress socketAddress)
        {
            _socketAddress = socketAddress;

            // Deserialize the address
            byte[] addressBytes = new byte[6];
            for (int index = 0; index < 6; index++)
                addressBytes[index] = socketAddress[index + ADDRESS_OFFSET];
            _address = new BluetoothAddress(addressBytes);

            // Deserialize the service GUID
            byte[] serviceBytes = new byte[16];
            for (int index = 0; index < 16; index++)
                serviceBytes[index] = socketAddress[index + SERVICE_GUID_OFFSET];
            _service = new Guid(serviceBytes);

            // Deserialize the port
            byte[] portBytes = new byte[4];
            for (int index = 0; index < 4; index++)
                portBytes[index] = socketAddress[index + PORT_OFFSET];
            _port = BitConverter.ToInt32(portBytes, 0);
        }

        #endregion Constructors

        #region Public Properties

#if !PocketPC

        /// <summary>
        /// Returns a GUID indentifying the service.
        /// </summary>
        [Category("Data")]
        [Description("Returns a GUID indentifying the service.")]
        [Browsable(true)]
#endif
        public Guid Service
        {
            get
            {
                return _service;
            }
        }

#if !PocketPC

        /// <summary>
        /// Returns the port used for opening connections.
        /// </summary>
        [Category("Data")]
        [Description("Returns the port used for opening connections.")]
        [Browsable(true)]
#endif
        public int Port
        {
            get
            {
                return _port;
            }
        }

#if !PocketPC

        /// <summary>
        /// Returns a friendly name for the endpoint.
        /// </summary>
        [Category("Data")]
        [Description("Returns a friendly name for the endpoint.")]
        [Browsable(true)]
        [ParenthesizePropertyName(true)]
#endif
        public string Name
        {
            get
            {
                return _name;
            }
        }

#if !PocketPC

        /// <summary>
        /// Returns the unique address of the device, used for connections.
        /// </summary>
        [Category("Data")]
        [Description("Returns the unique address of the device, used for connections.")]
        [Browsable(true)]
#endif
        public BluetoothAddress Address
        {
            get
            {
                return _address;
            }
        }

#if !PocketPC

        /// <summary>
        /// Controls the number of times this endpoint has been identified as a GPS service.
        /// </summary>
        /// <value>The successful detection count.</value>
        [Category("Data")]
        [Description("Controls the number of times this endpoint has been identified as a GPS service.")]
        [Browsable(true)]
#endif
        public int SuccessfulDetectionCount
        {
            get { return _successfulDetectionCount; }
            set { _successfulDetectionCount = value; }
        }

#if !PocketPC

        /// <summary>
        /// Controls the number of times this endpoint has failed to identify itself as a GPS service.
        /// </summary>
        /// <value>The failed detection count.</value>
        [Category("Data")]
        [Description("Controls the number of times this endpoint has failed to identify itself as a GPS service.")]
        [Browsable(true)]
#endif
        public int FailedDetectionCount
        {
            get { return _failedDetectionCount; }
            set { _failedDetectionCount = value; }
        }

        #endregion Public Properties

        #region Internal Methods

        /// <summary>
        /// Sets the name.
        /// </summary>
        /// <param name="name">The name.</param>
        internal void SetName(string name)
        {
            _name = name;
        }

        #endregion Internal Methods

        #region Overrides

        /// <summary>
        /// Returns a hash code for this instance.
        /// </summary>
        /// <returns>A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.</returns>
        public override int GetHashCode()
        {
            return _address.GetHashCode() ^ _port.GetHashCode() ^ _service.GetHashCode();
        }

        /// <summary>
        /// Determines whether the specified <see cref="System.Object"/> is equal to this instance.
        /// </summary>
        /// <param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>.</param>
        /// <returns><c>true</c> if the specified <see cref="System.Object"/> is equal to this instance; otherwise, <c>false</c>.</returns>
        public override bool Equals(object obj)
        {
            // If it's unll, return false
            if (ReferenceEquals(obj, null))
                return false;

            // Try to cast as this object type
            BluetoothEndPoint endPoint = obj as BluetoothEndPoint;
            if (endPoint != null)
                return Equals(endPoint);

            // Not our kind of object
            return base.Equals(obj);
        }

        /// <summary>
        /// Creates an <see cref="T:System.Net.EndPoint"/> instance from a <see cref="T:System.Net.SocketAddress"/> instance.
        /// </summary>
        /// <param name="socketAddress">The socket address that serves as the endpoint for a connection.</param>
        /// <returns>A new <see cref="T:System.Net.EndPoint"/> instance that is initialized from the specified <see cref="T:System.Net.SocketAddress"/> instance.</returns>
        /// <exception cref="T:System.NotImplementedException">Any attempt is made to access the method when the method is not overridden in a descendant class. </exception>
        ///
        /// <PermissionSet>
        ///   <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence"/>
        ///   </PermissionSet>
        public override EndPoint Create(SocketAddress socketAddress)
        {
            // If it's not a BT socket, skip it
            if (socketAddress.Family != BLUETOOTH_FAMILY)
                return base.Create(socketAddress);
            return new BluetoothEndPoint(socketAddress);
        }

        /// <summary>
        /// Serializes endpoint information into a <see cref="T:System.Net.SocketAddress"/> instance.
        /// </summary>
        /// <returns>A <see cref="T:System.Net.SocketAddress"/> instance that contains the endpoint information.</returns>
        /// <exception cref="T:System.NotImplementedException">Any attempt is made to access the method when the method is not overridden in a descendant class. </exception>
        ///
        /// <PermissionSet>
        ///   <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence"/>
        ///   </PermissionSet>
        public override SocketAddress Serialize()
        {
            return _socketAddress;
        }

        /// <summary>
        /// Returns a <see cref="System.String"/> that represents this instance.
        /// </summary>
        /// <returns>A <see cref="System.String"/> that represents this instance.</returns>
        public override string ToString()
        {
            return ToString("G", CultureInfo.CurrentUICulture);
        }

        /// <summary>
        /// Gets the address family to which the endpoint belongs.
        /// </summary>
        /// <returns>One of the <see cref="T:System.Net.Sockets.AddressFamily"/> values.</returns>
        ///
        /// <exception cref="T:System.NotImplementedException">Any attempt is made to get or set the property when the property is not overridden in a descendant class. </exception>
        ///
        /// <PermissionSet>
        ///   <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence"/>
        ///   </PermissionSet>
        public override AddressFamily AddressFamily
        {
            get
            {
                return BLUETOOTH_FAMILY;
            }
        }

        #endregion Overrides

        #region IEquatable<BluetoothEndPoint> Members

        /// <summary>
        /// Indicates whether the current object is equal to another object of the same type.
        /// </summary>
        /// <param name="other">An object to compare with this object.</param>
        /// <returns>true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.</returns>
        public bool Equals(BluetoothEndPoint other)
        {
            return _address.Equals(other.Address)
                && _port.Equals(other.Port)
                && _service.Equals(other.Service);
        }

        #endregion IEquatable<BluetoothEndPoint> Members

        #region IFormattable Members

        /// <summary>
        /// Returns a <see cref="System.String"/> that represents this instance.
        /// </summary>
        /// <param name="format">The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the <see cref="T:System.IFormattable"/> implementation.</param>
        /// <param name="formatProvider">The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.</param>
        /// <returns>A <see cref="System.String"/> that represents this instance.</returns>
        public string ToString(string format, IFormatProvider formatProvider)
        {
            if (String.IsNullOrEmpty(_name))
            {
                CultureInfo culture = (CultureInfo)formatProvider ?? CultureInfo.CurrentCulture;

                if (string.IsNullOrEmpty(format))
                    format = "G";

                // Start with the address
                string result = _address.ToString(format, formatProvider);

                // Append the port if it's non-zero
                if (_port != 0)
                    result += culture.TextInfo.ListSeparator + " Port " + _port.ToString(format, formatProvider);

                // Append the GUID if it's not empty
                if (!_service.Equals(Guid.Empty))
                {
                    // Guid objects have very limited formats, the default "D" format is used.
                    result += culture.TextInfo.ListSeparator + " Service " + _service.ToString("D", formatProvider);
                }

                return result;
            }
            return _name;
        }

        #endregion IFormattable Members
    }
}


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

<title>Uses of Class org.codehaus.jackson.map.module.SimpleSerializers (Jackson JSON Processor)</title>
<meta name="date" content="2013-07-14">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
org.codehaus.jackson.map.module.SimpleSerializers

Packages that use SimpleSerializers

Package
Description

org.codehaus.jackson.map.module

Package that contains classes and interfaces to help implement
 custom extension Modules
 (which are registered using
 ObjectMapper.registerModule(org.codehaus.jackson.map.Module).

Uses of SimpleSerializers in org.codehaus.jackson.map.module

Fields in org.codehaus.jackson.map.module declared as SimpleSerializers

Modifier and Type
Field and Description

protected SimpleSerializers
SimpleModule._keySerializers

protected SimpleSerializers
SimpleModule._serializers

Methods in org.codehaus.jackson.map.module with parameters of type SimpleSerializers

Modifier and Type
Method and Description

void
SimpleModule.setKeySerializers(SimpleSerializers ks)

Resets all currently configured key serializers.

void
SimpleModule.setSerializers(SimpleSerializers s)

Resets all currently configured serializers.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

redpajama_set_name: RedPajamaGithub


text:
#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICROFRONTEND_AUDIO_MICROFRONTEND_H_
#define TENSORFLOW_LITE_EXPERIMENTAL_MICROFRONTEND_AUDIO_MICROFRONTEND_H_

#include "tensorflow/lite/context.h"

namespace tflite {
namespace ops {
namespace custom {
TfLiteRegistration* Register_AUDIO_MICROFRONTEND();
}  // namespace custom
}  // namespace ops
}  // namespace tflite

#endif  // TENSORFLOW_LITE_EXPERIMENTAL_MICROFRONTEND_AUDIO_MICROFRONTEND_H_


text:
lxc-ls |tr -s " " "\n" > container_names
if [[ -f container_names ]]
    then
        while read container_name
        do
	    echo $container_name
            output=$(lxc-attach --name $container_name $1)
	    echo $output
        done < container_names
fi


text:
Dialogs are floating windows that can be dragged around or closed.

Technically the behave like a ```LiteGUI.Panel``` but with a frame that makes it a floating window.

Here is an example of how to create a Dialog:

```js
  //create the dialog
	var dialog = new LiteGUI.Dialog({title:"Editor", close: true, width: 300, height: 120, scroll: false, draggable: true});

  //add some widgets
	var widgets = new LiteGUI.Inspector();
	dialog.add(widgets);

  //fill the widgets
	widgets.addButton("My button","Click", function(){ console.log("clicked"); });

  //show and ensure the content fits
	dialog.show();
	dialog.adjustSize();
```


text:
class DadosBiopsia < ActiveRecord::Base
  belongs_to :laudo

  validates :celulas_inflamatorias,         :presence => true
  validates :vasculite,                     :presence => true
  validates :fibrose,                       :presence => true
  validates :bacilos,                       :presence => true
  validates :perda_fibras,                  :presence => true
  validates :degeneracao_axonal,            :presence => true
  validates :regeneracao_axonal,            :presence => true
  validates :desmielinizacao_ativa,         :presence => true

end


text:
package co.inventorsoft.oop.basic.overloading;

class BoxingVsWideningVararg {
    static void vararg(long... x) {
        System.out.println("long...");
    }

    static void vararg(Integer... x) {
        System.out.println("Integer...");
    }

    public static void main(String[] args) {
        int i = 5;
        //vararg(i, i);     // needs to box and use var-args
    }
}


text:
package org.projectfloodlight.openflow.protocol;

import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import java.util.List;
import org.jboss.netty.buffer.ChannelBuffer;

public interface OFBsnGetInterfacesReply extends OFObject, OFBsnHeader {
    OFVersion getVersion();
    OFType getType();
    long getXid();
    long getExperimenter();
    long getSubtype();
    List<OFBsnInterface> getInterfaces();

    void writeTo(ChannelBuffer channelBuffer);

    Builder createBuilder();
    public interface Builder extends OFBsnHeader.Builder {
        OFBsnGetInterfacesReply build();
        OFVersion getVersion();
        OFType getType();
        long getXid();
        Builder setXid(long xid);
        long getExperimenter();
        long getSubtype();
        List<OFBsnInterface> getInterfaces();
        Builder setInterfaces(List<OFBsnInterface> interfaces);
    }
}


text:
Just clone and run the script!

```bash
git clone https://github.com/weihanglo/dotfiles.git ~/.dotfiles
bash ~/.dotfiles/bootstrap.bash
```

## Tools We Love

- [**Alacritty**]: Maybe the fastest terminal emulator ever.
- [**bat**]: A cat(1) clone with wings.
- [**delta**]: Enjoyable diff viewer.
- [**exa**]: Modern `ls` with sane defaults and `tree`'s functionalities.
- [**fish**]: Kitty needs fish.
- [**fnm**]: Ease the pain of sourcing nvm.
- [**FZF**]: Fuzzy finder goes rock.
- [**GitUI**]: One of the best TUI Git client on Earth.
- [**JetBrains Mono**]: Probably the best monospace font for coder.
- [**kitty**]: Another GPU-based terminal emulator that just works.
- [**Neovim**]: Next-generation Vim. Required.
- [**pyenv**]: Simple Python version management.
- [**ripgrep**]: Better, stronger `grep` written in Rust.
- [**Starship**]: Cross-shell prompt with sane defaults.
- [**tmux**]: Awesome tool that defeats all terminal window managers.
- [**zoxide**] A smarter cd(1) command. Built in Rust.

Want to share your config file?
Feel free to create an issue or pull request!

## License

[The MIT License (MIT)](LICENSE)

Copyright © 2015 - 2021 Weihang Lo

[**Alacritty**]: https://github.com/jwilm/alacritty
[**bat**]: https://github.com/sharkdp/bat
[**delta**]: https://github.com/dandavison/delta
[**exa**]: https://the.exa.website/
[**fish**]: https://fishshell.com/
[**fnm**]: https://github.com/Schniz/fnm
[**FZF**]: https://github.com/junegunn/fzf
[**GitUI**]: https://github.com/extrawurst/gitui
[**JetBrains Mono**]: https://www.jetbrains.com/lp/mono/
[**kitty**]: https://sw.kovidgoyal.net/kitty/
[**Neovim**]: https://neovim.io
[**pyenv**]: https://github.com/pyenv/pyenv
[**ripgrep**]: https://github.com/burntsushi/ripgrep
[**Starship**]: https://starship.rs
[**tmux**]: https://tmux.github.io
[**zoxide**]: https://github.com/ajeetdsouza/zoxide


text:
var React = require('react')
Object.assign = require('object-assign')

//Reducer imports
import AuthReducer from '../../../src/reducers/auth';

//Testing imports
import expect from 'expect'

//Constants
import CONSTANTS from '../../../src/constants/index';
const {LOGIN_USER_REQUEST, LOGIN_USER_FAILURE, LOGIN_USER_SUCCESS, LOGOUT_USER} = CONSTANTS

describe('reducers', () => {

    describe('AuthReducer', () => {

        const initialState = {
            token: null,
            userDetails: {},
            isAuthenticated: false,
            isAuthenticating: false,
            statusText: null
        };

        it('should return the initial state', () => {
            expect(
                AuthReducer(initialState, {})
            ).toEqual(
                {
                    token: null,
                    userDetails: {},
                    isAuthenticated: false,
                    isAuthenticating: false,
                    statusText: null
                }
            )

        })

        it('should handle LOGIN_USER_REQUEST', () => {
            expect(
                AuthReducer(initialState, {
                    type: LOGIN_USER_REQUEST
                })
            ).toEqual(

                Object.assign({},initialState,{'isAuthenticating': true,'statusText': null})

            )
        })
        it('should handle LOGIN_USER_FAILURE', () => {
            expect(
                AuthReducer(initialState, {
                    type: LOGIN_USER_FAILURE,
                    payload: {
                        status: 401,
                        statusText: "Login Unauthorized"
                    }
                })
            ).toEqual(
                Object.assign({},initialState,{
                    'isAuthenticated': false,
                    'isAuthenticating': false,
                    'token': null,
                    'userDetails': null,
                    'statusText': `Authentication Error: 401 Login Unauthorized`})

            )
        })
        it('should handle LOGIN_USER_SUCCESS', () => {
            expect(
                AuthReducer(initialState, {
                    type: LOGIN_USER_SUCCESS,
                    payload : {
                        token : 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyTmFtZSI6InRkc0B0ZHMuY29tIiwiaWF0IjoxNDU0MDY0MTQ2fQ.ArQkqa8Wgp9MTO7dPQ4aMIyfHS6eQxTBAUk4tyWOoMY',
                        user_details : {
                            name : 'bob',
                            id: '123456',
                            email : 'veebuv@gmail.com'
                        }
                    }
                })
            ).toEqual(
                Object.assign({},initialState,{
                    'isAuthenticating': false,
                    'isAuthenticated': true,
                    'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyTmFtZSI6InRkc0B0ZHMuY29tIiwiaWF0IjoxNDU0MDY0MTQ2fQ.ArQkqa8Wgp9MTO7dPQ4aMIyfHS6eQxTBAUk4tyWOoMY',
                     userDetails : {
                        name : 'bob',
                        id: '123456',
                        email : 'veebuv@gmail.com'
                     },
                    'statusText': 'You have been successfully logged in.'
                })
            )
        })
        it('should handle LOGOUT_USER', () => {
            expect(
                AuthReducer(initialState, {
                    type: LOGOUT_USER
                })
            ).toEqual(
               Object.assign({},initialState,{
                    'isAuthenticated': false,
                    'token': null,
                    'userDetails': null,
                    'statusText': 'You have been successfully logged out.'
                })
            )
        })

    })
})


text:
import Jasmine from 'jasmine'
import { runTestInFiberContext, executeHooksWithArgs } from '@wdio/config'
import logger from '@wdio/logger'

import JasmineReporter from './reporter'

const INTERFACES = {
    bdd: ['beforeAll', 'beforeEach', 'it', 'xit', 'fit', 'afterEach', 'afterAll']
}
const NOOP = function noop () {}
const DEFAULT_TIMEOUT_INTERVAL = 60000

const log = logger('wdio-jasmine-framework')

/**
 * Jasmine 2.x runner
 */
class JasmineAdapter {
    constructor (cid, config, specs, capabilities, reporter) {
        this.cid = cid
        this.config = config
        this.capabilities = capabilities
        this.specs = specs
        this.jrunner = {}

        this.jasmineNodeOpts = Object.assign({
            cleanStack: true
        }, config.jasmineNodeOpts)

        this.reporter = new JasmineReporter(reporter, {
            cid: this.cid,
            capabilities: this.capabilities,
            specs: this.specs,
            cleanStack: this.jasmineNodeOpts.cleanStack
        })
    }

    async run () {
        const self = this

        this.jrunner = new Jasmine()
        const { jasmine } = this.jrunner
        const jasmineEnv = jasmine.getEnv()

        this.jrunner.projectBaseDir = ''
        this.jrunner.specDir = ''
        this.jrunner.addSpecFiles(this.specs)

        jasmine.DEFAULT_TIMEOUT_INTERVAL = this.jasmineNodeOpts.defaultTimeoutInterval || DEFAULT_TIMEOUT_INTERVAL
        jasmineEnv.addReporter(this.reporter)

        /**
         * Set whether to stop suite execution when a spec fails
         */
        const stopOnSpecFailure = !!this.jasmineNodeOpts.stopOnSpecFailure

        /**
         * Filter specs to run based on jasmineNodeOpts.grep and jasmineNodeOpts.invert
         */
        jasmineEnv.configure({
            specFilter: ::this.customSpecFilter,
            stopOnSpecFailure: stopOnSpecFailure,
            random: Boolean(this.jasmineNodeOpts.random),
            failFast: this.jasmineNodeOpts.failFast
        })

        /**
         * enable expectHandler
         */
        jasmine.Spec.prototype.addExpectationResult = this.getExpectationResultHandler(jasmine)

        /**
         * wrap commands with wdio-sync
         */
        INTERFACES['bdd'].forEach((fnName) => runTestInFiberContext(
            ['it', 'fit'],
            this.config.beforeHook,
            this.config.afterHook,
            fnName
        ))

        /**
         * for a clean stdout we need to avoid that Jasmine initialises the
         * default reporter
         */
        Jasmine.prototype.configureDefaultReporter = NOOP

        /**
         * wrap Suite and Spec prototypes to get access to their data
         */
        let beforeAllMock = jasmine.Suite.prototype.beforeAll
        jasmine.Suite.prototype.beforeAll = function (...args) {
            self.lastSpec = this.result
            beforeAllMock.apply(this, args)
        }
        let executeMock = jasmine.Spec.prototype.execute
        jasmine.Spec.prototype.execute = function (...args) {
            self.lastTest = this.result
            self.lastTest.start = new Date().getTime()
            executeMock.apply(this, args)
        }

        await executeHooksWithArgs(this.config.before, [this.capabilities, this.specs])
        let result = await new Promise((resolve) => {
            this.jrunner.env.beforeAll(this.wrapHook('beforeSuite'))
            this.jrunner.env.beforeEach(this.wrapHook('beforeTest'))
            this.jrunner.env.afterEach(this.wrapHook('afterTest'))
            this.jrunner.env.afterAll(this.wrapHook('afterSuite'))

            this.jrunner.onComplete(() => resolve(this.reporter.getFailedCount()))
            this.jrunner.execute()
        })
        await executeHooksWithArgs(this.config.after, [result, this.capabilities, this.specs])
        return result
    }

    customSpecFilter (spec) {
        const { grep, invertGrep } = this.jasmineNodeOpts
        const grepMatch = !grep || spec.getFullName().match(new RegExp(grep)) !== null
        if (grepMatch === Boolean(invertGrep)) {
            spec.pend()
        }
        return true
    }

    /**
     * Hooks which are added as true Mocha hooks need to call done() to notify async
     */
    wrapHook (hookName) {
        return (done) => executeHooksWithArgs(
            this.config[hookName],
            this.prepareMessage(hookName)
        ).then(() => done(), (e) => {
            log.info(`Error in ${hookName} hook: ${e.stack.slice(7)}`)
            done()
        })
    }

    prepareMessage (hookName) {
        const params = { type: hookName }

        switch (hookName) {
        case 'beforeSuite':
        case 'afterSuite':
            params.payload = Object.assign({
                file: this.jrunner.specFiles[0]
            }, this.lastSpec)
            break
        case 'beforeTest':
        case 'afterTest':
            params.payload = Object.assign({
                file: this.jrunner.specFiles[0]
            }, this.lastTest)
            break
        }

        return this.formatMessage(params)
    }

    formatMessage (params) {
        let message = {
            type: params.type
        }

        if (params.payload) {
            message.title = params.payload.description
            message.fullName = params.payload.fullName || null
            message.file = params.payload.file

            if (params.payload.failedExpectations && params.payload.failedExpectations.length) {
                message.failedExpectations = params.payload.failedExpectations
                message.error = params.payload.failedExpectations[0]
            }

            if (params.payload.id && params.payload.id.startsWith('spec')) {
                message.parent = this.lastSpec.description
                message.passed = params.payload.failedExpectations.length === 0
            }

            if (params.type === 'afterTest') {
                message.duration = new Date().getTime() - params.payload.start
            }

            if (typeof params.payload.duration === 'number') {
                message.duration = params.payload.duration
            }
        }

        return message
    }

    getExpectationResultHandler (jasmine) {
        let { expectationResultHandler } = this.jasmineNodeOpts
        const origHandler = jasmine.Spec.prototype.addExpectationResult

        if (typeof expectationResultHandler !== 'function') {
            return origHandler
        }

        return this.expectationResultHandler(origHandler)
    }

    expectationResultHandler (origHandler) {
        const { expectationResultHandler } = this.jasmineNodeOpts
        return function (passed, data) {
            try {
                expectationResultHandler.call(this, passed, data)
            } catch (e) {
                /**
                 * propagate expectationResultHandler error if actual assertion passed
                 * but the custom handler decides to throw
                 */
                if (passed) {
                    passed = false
                    data = {
                        passed: false,
                        message: 'expectationResultHandlerError: ' + e.message,
                        error: e
                    }
                }
            }

            return origHandler.call(this, passed, data)
        }
    }
}

const adapterFactory = {}
adapterFactory.run = async function (...args) {
    const adapter = new JasmineAdapter(...args)
    const result = await adapter.run()
    return result
}

export default adapterFactory
export { JasmineAdapter, adapterFactory }


text:
package com.pgmacdesign.pgmactips.utilities;

import androidx.annotation.NonNull;

import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.pgmacdesign.pgmactips.misc.CustomAnnotationsBase;

import java.lang.reflect.Type;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/**
 * Created by pmacdowell on 8/18/2016.
 */
@CustomAnnotationsBase.RequiresDependency(requiresDependency = CustomAnnotationsBase.Dependencies.GSON)
public class GsonUtilities {

    private static Gson gson;

    static {
        if(gson == null){
            gson = new Gson();
        }
    }

    /**
     * Convert an object to a json string using the {@link Class}
     * @param object
     * @param objectSourceClass
     * @return
     */
    @CustomAnnotationsBase.RequiresDependency(requiresDependency = CustomAnnotationsBase.Dependencies.GSON)
    public static String convertObjectToJson(Object object, Class objectSourceClass){
        String str = null;
        try {
            str = gson.toJson(object, objectSourceClass);
        } catch (IllegalArgumentException ile){
            //Triggers if you declare 2 fields with the same @Serialized string name
            ile.printStackTrace();
        } catch (Exception e){}
        return(str);
    }

    /**
     * Convert an object to a json string using the {@link Type}
     * @param object
     * @param objectSourceClass
     * @return
     */
    @CustomAnnotationsBase.RequiresDependency(requiresDependency = CustomAnnotationsBase.Dependencies.GSON)
    public static String convertObjectToJson(Object object, Type objectSourceClass){
        String str = null;
        try {
            str = gson.toJson(object, objectSourceClass);
        } catch (IllegalArgumentException ile){
            //Triggers if you declare 2 fields with the same @Serialized string name
            ile.printStackTrace();
        } catch (Exception e){}
        return(str);
    }

    /**
     * Convert a json string to an object using the {@link Class}
     * @param jsonString
     * @param objectSourceClass
     * @return
     */
    @CustomAnnotationsBase.RequiresDependency(requiresDependency = CustomAnnotationsBase.Dependencies.GSON)
    public static Object convertJsonToObject(String jsonString, Class objectSourceClass){
        try {
            Object obj = gson.fromJson(jsonString, objectSourceClass);
            return obj;
        } catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }

    /**
     * Convert a json string to an object using the {@link Type}
     * @param jsonString
     * @param objectSourceClass
     * @return
     */
    @CustomAnnotationsBase.RequiresDependency(requiresDependency = CustomAnnotationsBase.Dependencies.GSON)
    public static Object convertJsonToObject(String jsonString, Type objectSourceClass){
        try {
            Object obj = gson.fromJson(jsonString, objectSourceClass);
            return obj;
        } catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }

    /**
     * Convert an object to a JSON Element {@link JsonElement} If cannot convert, will return null
     * @param o Object to be converted
     * @return JsonElement to be returned
     */
    @CustomAnnotationsBase.RequiresDependency(requiresDependency = CustomAnnotationsBase.Dependencies.GSON)
    public static JsonElement convertToJsonElement(Object o){
        JsonElement jsonElement = null;
        try {
            jsonElement = gson.toJsonTree(o);
        } catch (Exception e){
            e.printStackTrace();
        }
        return jsonElement;
    }

    /**
     * Convert an object to a String (using gson)
     * @param o
     * @param type {@link Type}. To see type examples, look at sample:
     * {@link com.pgmacdesign.pgmactips.networkclasses.retrofitutilities.CustomConverterFactory#TYPE_TESTINGPOJO}
     * @return
     */
    @CustomAnnotationsBase.RequiresDependency(requiresDependency = CustomAnnotationsBase.Dependencies.GSON)
    @Deprecated
    public static String convertObjectToString(@NonNull final Object o, @NonNull final Type type){
//        JsonElement jsonElement = new Gson().toJsonTree(o);
        JsonElement jsonElement = new Gson().toJsonTree(o, type);
        if(jsonElement == null){
            return null;
        }
        StringBuilder sb = new StringBuilder();
        if(jsonElement.isJsonArray()){
            JsonArray jsonArray = jsonElement.getAsJsonArray();
            Iterator<JsonElement> j = jsonArray.iterator();
            while (j.hasNext()){
                JsonElement element = j.next();
                String s = convertJsonElementToString(element);
                if(!StringUtilities.isNullOrEmpty(s)){
                    sb.append(s + "\n");
                }
            }
        } else if (jsonElement.isJsonObject()){
            JsonObject jsonObject = jsonElement.getAsJsonObject();
            sb.append(convertJsonObjectToString(jsonObject));
        } else if (jsonElement.isJsonNull()){
            return null;
        } else if (jsonElement.isJsonPrimitive()){
            sb.append("JsonPrimitive: " + jsonElement.getAsJsonPrimitive().toString());
        }
        return sb.toString();
    }

    /**
     * Convert a {@link JsonElement} to a String using gson
     * @param jsonElement
     * @return
     */
    @CustomAnnotationsBase.RequiresDependency(requiresDependency = CustomAnnotationsBase.Dependencies.GSON)
    public static String convertJsonElementToString(JsonElement jsonElement){
        if(jsonElement == null){
            return null;
        }
        return jsonElement.getAsString();
    }

    /**
     * Convert a {@link JsonObject} to a String using gson
     * @param jsonObject
     * @return
     */
    @CustomAnnotationsBase.RequiresDependency(requiresDependency = CustomAnnotationsBase.Dependencies.GSON)
    @Deprecated
    public static String convertJsonObjectToString(JsonObject jsonObject){
        if(jsonObject == null){
            return null;
        }
        Set<Map.Entry<String, JsonElement>> entries = jsonObject.entrySet();
        StringBuilder sb = new StringBuilder();
        for(Map.Entry<String, JsonElement> map : entries){
            if(map == null){
                continue;
            }
            String key = map.getKey();
            JsonElement value = map.getValue();
            if(!StringUtilities.isNullOrEmpty(key) && value != null){
                try {
                	/*
                	todo fix issue below:
                	Bug is happening here:
W: java.lang.IllegalStateException
W:     at com.google.gson.JsonArray.getAsString(JsonArray.java:226)
W:     at com.pgmacdesign.pgmactips.utilities.GsonUtilities.convertJsonObjectToString(GsonUtilities.java:185)
W:     at com.pgmacdesign.pgmactips.utilities.GsonUtilities.convertObjectToString(GsonUtilities.java:143)
W:     at my.app.networking.APICalls$3.onResponse(APICalls.java:231)
W:     at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:70)
W:     at android.os.Handler.handleCallback(Handler.java:873)
W:     at android.os.Handler.dispatchMessage(Handler.java:99)
W:     at android.os.Looper.loop(Looper.java:193)
W:     at android.app.ActivityThread.main(ActivityThread.java:6718)
W:     at java.lang.reflect.Method.invoke(Native Method)
W:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
W:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
                	 */
                    sb.append(key + " : " + value.getAsString() + "\n");
                } catch (UnsupportedOperationException o){
                    sb.append(key + " : " + value.toString() + "\n");
                }
            }
        }
        return sb.toString();
    }

    /**
     * Makes a deep copy of an object. From:
     * https://stackoverflow.com/questions/64036/how-do-you-make-a-deep-copy-of-an-object-in-java
     * @param objectToCopy Object to copy
     * @param typeOfObject Type of the object
     * @return Will returned copied object or null if it did not process correctly
     */
    public static Object copyObject(Object objectToCopy, Type typeOfObject){
        try {
            String json = gson.toJson(objectToCopy, typeOfObject);
            return gson.fromJson(json, typeOfObject);
        } catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }

    /**
     * Makes a deep copy of an object. From:
     * https://stackoverflow.com/questions/64036/how-do-you-make-a-deep-copy-of-an-object-in-java
     * @param objectToCopy Object to copy
     * @param typeOfObject Class of the object
     * @return Will returned copied object or null if it did not process correctly
     */
    public static Object copyObject(Object objectToCopy, Class typeOfObject){
        try {
            String json = gson.toJson(objectToCopy, typeOfObject);
            return gson.fromJson(json, typeOfObject);
        } catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }
}


text:
require_relative '../../puppet_x/puppetlabs/netdev_stdlib/check'
if PuppetX::NetdevStdlib::Check.use_old_netdev_type
  Puppet::Type.newtype(:radius_server) do
    @doc = 'Configure a RADIUS server'

    apply_to_all
    ensurable

    newparam(:name, namevar: true) do
      desc 'The name of the RADIUS server'

      validate do |value|
        if value.is_a? String then super(value)
        else raise "value #{value.inspect} is invalid, must be a String."
        end
      end
    end

    newproperty(:hostname) do
      desc 'The hostname or address of the RADIUS server'

      validate do |value|
        if value.is_a? String then super(value)
        else raise "value #{value.inspect} is invalid, must be a String."
        end
      end
    end

    newproperty(:auth_port) do
      desc 'Port number to use for authentication'
      munge { |v| Integer(v) }
    end

    newproperty(:acct_port) do
      desc 'Port number to use for accounting'
      munge { |v| Integer(v) }
    end

    newproperty(:key) do
      desc 'Encryption key (plaintext or in hash form depending on key_format)'

      validate do |value|
        if value.is_a? String then super(value)
        else raise "value #{value.inspect} is invalid, must be a String."
        end
      end
    end

    newproperty(:key_format) do
      desc 'Encryption key format [0-7]'
      munge { |v| Integer(v) }
    end

    newproperty(:group) do
      desc 'Server group associated with this server'

      validate do |value|
        if value.is_a? String then super(value)
        else raise "value #{value.inspect} is invalid, must be a String."
        end
      end
    end

    newproperty(:deadtime) do
      desc 'Number of minutes to ignore an unresponsive server'
      munge { |v| Integer(v) }
    end

    newproperty(:timeout) do
      desc 'Number of seconds before the timeout period ends'
      munge { |v| Integer(v) }
    end

    newproperty(:vrf) do
      desc 'VRF to send syslog data from, e.g. "management"'

      validate do |value|
        if value.is_a? String then super(value)
        else raise "value #{value.inspect} is invalid, must be a String."
        end
      end
    end

    newproperty(:source_interface) do
      desc 'Source interface to send syslog data from, e.g. "ethernet 2/1"'

      validate do |value|
        if value.is_a? String then super(value)
        else raise "value #{value.inspect} is invalid, must be a String."
        end
      end
    end

    newproperty(:retransmit_count) do
      desc 'How many times to retransmit'
      munge { |v| Integer(v) }
    end

    newproperty(:accounting_only) do
      desc 'Enable this server for accounting only'
      newvalues(:true, :false)
    end

    newproperty(:authentication_only) do
      desc 'Enable this server for authentication only'
      newvalues(:true, :false)
    end
  end
else
  require 'puppet/resource_api'

  Puppet::ResourceApi.register_type(
    name: 'radius_server',
    docs: 'Configure a RADIUS server',
    features: ['canonicalize','simple_get_filter'] + ( Puppet::Util::NetworkDevice.current.nil? ? [] : ['remote_resource'] ),
    attributes: {
      ensure: {
        type:    'Enum[present, absent]',
        desc:    'Ensure the radius_server exists.',
        default: 'present'
      },
      name: {
        type:       'String',
        desc:       'The name of the RADIUS server',
        behaviour:  :namevar
      },
      hostname: {
        type:      'Optional[String]',
        desc:      'The hostname or address of the RADIUS server'
      },
      auth_port: {
        type:      'Optional[Integer[1, 65535]]',
        desc:      'Port number to use for authentication'
      },
      acct_port: {
        type:      'Optional[Integer[1, 65535]]',
        desc:      'Port number to use for accounting'
      },
      key: {
        type:      'Optional[String]',
        desc:      'Encryption key (plaintext or in hash form depending on key_format)'
      },
      key_format: {
        type:      'Optional[Variant[Integer, Enum["unset"]]]',
        desc:      'Encryption key format [0-7]'
      },
      group: {
        type:      'Optional[String]',
        desc:      'Server group associated with this server'
      },
      deadtime: {
        type:      'Optional[Integer]',
        desc:      'Number of minutes to ignore an unresponsive server'
      },
      timeout: {
        type:      'Optional[Variant[Integer, Enum["unset"]]]',
        desc:      'Number of seconds before the timeout period ends'
      },
      vrf: {
        type:      'Optional[String]',
        desc:      'VRF to send syslog data from, e.g. "management"'
      },
      source_interface: {
        type:      'Optional[String]',
        desc:      'Source interface to send syslog data from, e.g. "ethernet 2/1"'
      },
      retransmit_count: {
        type:      'Optional[Variant[Integer, Enum["unset"]]]',
        desc:      'How many times to retransmit'
      },
      accounting_only: {
        type:      'Optional[Boolean]',
        desc:      'Enable this server for accounting only'
      },
      authentication_only: {
        type:      'Optional[Boolean]',
        desc:      'Enable this server for authentication only'
      }
    }
  )
end


text:
 #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif

#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
 #import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
#else
 #import "GPBProtocolBuffers_RuntimeSupport.h"
#endif

 #import "POGOProtos/Networking/Responses/DownloadItemTemplatesResponse.pbobjc.h"
 #import "POGOProtos/Settings/Master/ItemSettings.pbobjc.h"
 #import "POGOProtos/Settings/Master/MoveSettings.pbobjc.h"
 #import "POGOProtos/Settings/Master/BadgeSettings.pbobjc.h"
 #import "POGOProtos/Settings/Master/PokemonSettings.pbobjc.h"
 #import "POGOProtos/Settings/Master/MoveSequenceSettings.pbobjc.h"
 #import "POGOProtos/Settings/Master/TypeEffectiveSettings.pbobjc.h"
 #import "POGOProtos/Settings/Master/CameraSettings.pbobjc.h"
 #import "POGOProtos/Settings/Master/PlayerLevelSettings.pbobjc.h"
 #import "POGOProtos/Settings/Master/GymLevelSettings.pbobjc.h"
 #import "POGOProtos/Settings/Master/GymBattleSettings.pbobjc.h"
 #import "POGOProtos/Settings/Master/EncounterSettings.pbobjc.h"
 #import "POGOProtos/Settings/Master/IapItemDisplay.pbobjc.h"
 #import "POGOProtos/Settings/Master/IapSettings.pbobjc.h"
 #import "POGOProtos/Settings/Master/PokemonUpgradeSettings.pbobjc.h"
 #import "POGOProtos/Settings/Master/EquippedBadgeSettings.pbobjc.h"
// @@protoc_insertion_point(imports)

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"

#pragma mark - DownloadItemTemplatesResponseRoot

@implementation DownloadItemTemplatesResponseRoot

+ (GPBExtensionRegistry*)extensionRegistry {
  // This is called by +initialize so there is no need to worry
  // about thread safety and initialization of registry.
  static GPBExtensionRegistry* registry = nil;
  if (!registry) {
    GPBDebugCheckRuntimeVersion();
    registry = [[GPBExtensionRegistry alloc] init];
    [registry addExtensions:[ItemSettingsRoot extensionRegistry]];
    [registry addExtensions:[MoveSettingsRoot extensionRegistry]];
    [registry addExtensions:[BadgeSettingsRoot extensionRegistry]];
    [registry addExtensions:[PokemonSettingsRoot extensionRegistry]];
    [registry addExtensions:[MoveSequenceSettingsRoot extensionRegistry]];
    [registry addExtensions:[TypeEffectiveSettingsRoot extensionRegistry]];
    [registry addExtensions:[CameraSettingsRoot extensionRegistry]];
    [registry addExtensions:[PlayerLevelSettingsRoot extensionRegistry]];
    [registry addExtensions:[GymLevelSettingsRoot extensionRegistry]];
    [registry addExtensions:[GymBattleSettingsRoot extensionRegistry]];
    [registry addExtensions:[EncounterSettingsRoot extensionRegistry]];
    [registry addExtensions:[IapItemDisplayRoot extensionRegistry]];
    [registry addExtensions:[IapSettingsRoot extensionRegistry]];
    [registry addExtensions:[PokemonUpgradeSettingsRoot extensionRegistry]];
    [registry addExtensions:[EquippedBadgeSettingsRoot extensionRegistry]];
  }
  return registry;
}

@end

#pragma mark - DownloadItemTemplatesResponseRoot_FileDescriptor

static GPBFileDescriptor *DownloadItemTemplatesResponseRoot_FileDescriptor(void) {
  // This is called by +initialize so there is no need to worry
  // about thread safety of the singleton.
  static GPBFileDescriptor *descriptor = NULL;
  if (!descriptor) {
    GPBDebugCheckRuntimeVersion();
    descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"POGOProtos.Networking.Responses"
                                                     syntax:GPBFileSyntaxProto3];
  }
  return descriptor;
}

#pragma mark - DownloadItemTemplatesResponse

@implementation DownloadItemTemplatesResponse

@dynamic success;
@dynamic itemTemplatesArray, itemTemplatesArray_Count;
@dynamic timestampMs;

typedef struct DownloadItemTemplatesResponse__storage_ {
  uint32_t _has_storage_[1];
  NSMutableArray *itemTemplatesArray;
  uint64_t timestampMs;
} DownloadItemTemplatesResponse__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    static GPBMessageFieldDescription fields[] = {
      {
        .name = "success",
        .dataTypeSpecific.className = NULL,
        .number = DownloadItemTemplatesResponse_FieldNumber_Success,
        .hasIndex = 0,
        .offset = 1,  // Stored in _has_storage_ to save space.
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeBool,
      },
      {
        .name = "itemTemplatesArray",
        .dataTypeSpecific.className = GPBStringifySymbol(DownloadItemTemplatesResponse_ItemTemplate),
        .number = DownloadItemTemplatesResponse_FieldNumber_ItemTemplatesArray,
        .hasIndex = GPBNoHasBit,
        .offset = (uint32_t)offsetof(DownloadItemTemplatesResponse__storage_, itemTemplatesArray),
        .flags = GPBFieldRepeated,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "timestampMs",
        .dataTypeSpecific.className = NULL,
        .number = DownloadItemTemplatesResponse_FieldNumber_TimestampMs,
        .hasIndex = 2,
        .offset = (uint32_t)offsetof(DownloadItemTemplatesResponse__storage_, timestampMs),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeUInt64,
      },
    };
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:[DownloadItemTemplatesResponse class]
                                     rootClass:[DownloadItemTemplatesResponseRoot class]
                                          file:DownloadItemTemplatesResponseRoot_FileDescriptor()
                                        fields:fields
                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
                                   storageSize:sizeof(DownloadItemTemplatesResponse__storage_)
                                         flags:0];
    NSAssert(descriptor == nil, @"Startup recursed!");
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

#pragma mark - DownloadItemTemplatesResponse_ItemTemplate

@implementation DownloadItemTemplatesResponse_ItemTemplate

@dynamic templateId;
@dynamic hasPokemonSettings, pokemonSettings;
@dynamic hasItemSettings, itemSettings;
@dynamic hasMoveSettings, moveSettings;
@dynamic hasMoveSequenceSettings, moveSequenceSettings;
@dynamic hasTypeEffective, typeEffective;
@dynamic hasBadgeSettings, badgeSettings;
@dynamic hasCamera, camera;
@dynamic hasPlayerLevel, playerLevel;
@dynamic hasGymLevel, gymLevel;
@dynamic hasBattleSettings, battleSettings;
@dynamic hasEncounterSettings, encounterSettings;
@dynamic hasIapItemDisplay, iapItemDisplay;
@dynamic hasIapSettings, iapSettings;
@dynamic hasPokemonUpgrades, pokemonUpgrades;
@dynamic hasEquippedBadges, equippedBadges;

typedef struct DownloadItemTemplatesResponse_ItemTemplate__storage_ {
  uint32_t _has_storage_[1];
  NSString *templateId;
  PokemonSettings *pokemonSettings;
  ItemSettings *itemSettings;
  MoveSettings *moveSettings;
  MoveSequenceSettings *moveSequenceSettings;
  TypeEffectiveSettings *typeEffective;
  BadgeSettings *badgeSettings;
  CameraSettings *camera;
  PlayerLevelSettings *playerLevel;
  GymLevelSettings *gymLevel;
  GymBattleSettings *battleSettings;
  EncounterSettings *encounterSettings;
  IapItemDisplay *iapItemDisplay;
  IapSettings *iapSettings;
  PokemonUpgradeSettings *pokemonUpgrades;
  EquippedBadgeSettings *equippedBadges;
} DownloadItemTemplatesResponse_ItemTemplate__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    static GPBMessageFieldDescription fields[] = {
      {
        .name = "templateId",
        .dataTypeSpecific.className = NULL,
        .number = DownloadItemTemplatesResponse_ItemTemplate_FieldNumber_TemplateId,
        .hasIndex = 0,
        .offset = (uint32_t)offsetof(DownloadItemTemplatesResponse_ItemTemplate__storage_, templateId),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeString,
      },
      {
        .name = "pokemonSettings",
        .dataTypeSpecific.className = GPBStringifySymbol(PokemonSettings),
        .number = DownloadItemTemplatesResponse_ItemTemplate_FieldNumber_PokemonSettings,
        .hasIndex = 1,
        .offset = (uint32_t)offsetof(DownloadItemTemplatesResponse_ItemTemplate__storage_, pokemonSettings),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "itemSettings",
        .dataTypeSpecific.className = GPBStringifySymbol(ItemSettings),
        .number = DownloadItemTemplatesResponse_ItemTemplate_FieldNumber_ItemSettings,
        .hasIndex = 2,
        .offset = (uint32_t)offsetof(DownloadItemTemplatesResponse_ItemTemplate__storage_, itemSettings),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "moveSettings",
        .dataTypeSpecific.className = GPBStringifySymbol(MoveSettings),
        .number = DownloadItemTemplatesResponse_ItemTemplate_FieldNumber_MoveSettings,
        .hasIndex = 3,
        .offset = (uint32_t)offsetof(DownloadItemTemplatesResponse_ItemTemplate__storage_, moveSettings),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "moveSequenceSettings",
        .dataTypeSpecific.className = GPBStringifySymbol(MoveSequenceSettings),
        .number = DownloadItemTemplatesResponse_ItemTemplate_FieldNumber_MoveSequenceSettings,
        .hasIndex = 4,
        .offset = (uint32_t)offsetof(DownloadItemTemplatesResponse_ItemTemplate__storage_, moveSequenceSettings),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "typeEffective",
        .dataTypeSpecific.className = GPBStringifySymbol(TypeEffectiveSettings),
        .number = DownloadItemTemplatesResponse_ItemTemplate_FieldNumber_TypeEffective,
        .hasIndex = 5,
        .offset = (uint32_t)offsetof(DownloadItemTemplatesResponse_ItemTemplate__storage_, typeEffective),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "badgeSettings",
        .dataTypeSpecific.className = GPBStringifySymbol(BadgeSettings),
        .number = DownloadItemTemplatesResponse_ItemTemplate_FieldNumber_BadgeSettings,
        .hasIndex = 6,
        .offset = (uint32_t)offsetof(DownloadItemTemplatesResponse_ItemTemplate__storage_, badgeSettings),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "camera",
        .dataTypeSpecific.className = GPBStringifySymbol(CameraSettings),
        .number = DownloadItemTemplatesResponse_ItemTemplate_FieldNumber_Camera,
        .hasIndex = 7,
        .offset = (uint32_t)offsetof(DownloadItemTemplatesResponse_ItemTemplate__storage_, camera),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "playerLevel",
        .dataTypeSpecific.className = GPBStringifySymbol(PlayerLevelSettings),
        .number = DownloadItemTemplatesResponse_ItemTemplate_FieldNumber_PlayerLevel,
        .hasIndex = 8,
        .offset = (uint32_t)offsetof(DownloadItemTemplatesResponse_ItemTemplate__storage_, playerLevel),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "gymLevel",
        .dataTypeSpecific.className = GPBStringifySymbol(GymLevelSettings),
        .number = DownloadItemTemplatesResponse_ItemTemplate_FieldNumber_GymLevel,
        .hasIndex = 9,
        .offset = (uint32_t)offsetof(DownloadItemTemplatesResponse_ItemTemplate__storage_, gymLevel),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "battleSettings",
        .dataTypeSpecific.className = GPBStringifySymbol(GymBattleSettings),
        .number = DownloadItemTemplatesResponse_ItemTemplate_FieldNumber_BattleSettings,
        .hasIndex = 10,
        .offset = (uint32_t)offsetof(DownloadItemTemplatesResponse_ItemTemplate__storage_, battleSettings),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "encounterSettings",
        .dataTypeSpecific.className = GPBStringifySymbol(EncounterSettings),
        .number = DownloadItemTemplatesResponse_ItemTemplate_FieldNumber_EncounterSettings,
        .hasIndex = 11,
        .offset = (uint32_t)offsetof(DownloadItemTemplatesResponse_ItemTemplate__storage_, encounterSettings),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "iapItemDisplay",
        .dataTypeSpecific.className = GPBStringifySymbol(IapItemDisplay),
        .number = DownloadItemTemplatesResponse_ItemTemplate_FieldNumber_IapItemDisplay,
        .hasIndex = 12,
        .offset = (uint32_t)offsetof(DownloadItemTemplatesResponse_ItemTemplate__storage_, iapItemDisplay),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "iapSettings",
        .dataTypeSpecific.className = GPBStringifySymbol(IapSettings),
        .number = DownloadItemTemplatesResponse_ItemTemplate_FieldNumber_IapSettings,
        .hasIndex = 13,
        .offset = (uint32_t)offsetof(DownloadItemTemplatesResponse_ItemTemplate__storage_, iapSettings),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "pokemonUpgrades",
        .dataTypeSpecific.className = GPBStringifySymbol(PokemonUpgradeSettings),
        .number = DownloadItemTemplatesResponse_ItemTemplate_FieldNumber_PokemonUpgrades,
        .hasIndex = 14,
        .offset = (uint32_t)offsetof(DownloadItemTemplatesResponse_ItemTemplate__storage_, pokemonUpgrades),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
      {
        .name = "equippedBadges",
        .dataTypeSpecific.className = GPBStringifySymbol(EquippedBadgeSettings),
        .number = DownloadItemTemplatesResponse_ItemTemplate_FieldNumber_EquippedBadges,
        .hasIndex = 15,
        .offset = (uint32_t)offsetof(DownloadItemTemplatesResponse_ItemTemplate__storage_, equippedBadges),
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeMessage,
      },
    };
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:[DownloadItemTemplatesResponse_ItemTemplate class]
                                     rootClass:[DownloadItemTemplatesResponseRoot class]
                                          file:DownloadItemTemplatesResponseRoot_FileDescriptor()
                                        fields:fields
                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
                                   storageSize:sizeof(DownloadItemTemplatesResponse_ItemTemplate__storage_)
                                         flags:0];
    NSAssert(descriptor == nil, @"Startup recursed!");
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end

#pragma clang diagnostic pop

// @@protoc_insertion_point(global_scope)


text:
/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
/**
 * Copyright (c) 2004-2005, Regents of the University of California
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 *
 * 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.
 *
 * Neither the name of the University of California, Los Angeles nor the
 * names of its contributors may be used to endorse or promote products
 * derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "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 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS 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.
 */

package avrora.syntax.atmel;

import avrora.syntax.AbstractToken;

/**
 * Describes the input token stream.
 */

public class Token extends AbstractToken {

    /**
     * An integer that describes the kind of this token.  This numbering system is determined by JavaCCParser,
     * and a table of these numbers is stored in the file ...Constants.java.
     */
    public int kind;

    /**
     * This field is used to access special tokens that occur prior to this token, but after the immediately
     * preceding regular (non-special) token. If there are no such special tokens, this field is set to null.
     * When there are more than one such special token, this field refers to the last of these special tokens,
     * which in turn refers to the next previous special token through its specialToken field, and so on until
     * the first special token (whose specialToken field is null). The next fields of special tokens refer to
     * other special tokens that immediately follow it (without an intervening regular token).  If there is no
     * such token, this field is null.
     */
    public Token specialToken;

    /**
     * A reference to the next regular (non-special) token from the input stream.  If this is the last token
     * from the input stream, or if the token manager has not read tokens beyond this one, this field is set
     * to null.  This is true only if this token is also a regular token.  Otherwise, see below for a
     * description of the contents of this field.
     */
    public Token next;

    /**
     * Returns a new Token object, by default. However, if you want, you can create and return subclass
     * objects based on the value of ofKind. Simply add the cases to the switch for all those special cases.
     * For example, if you have a subclass of Token called IDToken that you want to create if ofKind is ID,
     * simlpy add something like :
     *

     * case MyParserConstants.ID : return new IDToken();
     *

     * to the following switch statement. Then you can cast matchedToken variable to the appropriate type and
     * use it in your lexical actions.
     */
    public static final Token newToken(int ofKind) {
        switch (ofKind) {
            default :
                return new Token();
        }
    }

    public AbstractToken getNextToken() {
        return next;
    }

}


text:
In this demo scenario, we perform a series of procedures which is typical in machine learning.

- Split dataset (we use [svmguide3](http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary/svmguide3) ) into 10 pieces
- With varying training methods and cost functions which differ in regularization,
    - execute one versus rest for each part of dataset with LIBLINEAR
    - calculate average accuracy of 10-fold cross validation
    - plot accuracy with respect to cost function

## Run Demo

To run demo, execute these commands:

```
$ cd $DEMO_ROOT
$ ./waf configure
$ ./waf build # or simply ./waf
```

To clear generated files do `./waf distclean`


text:
<?php

namespace Icans\Platforms\CafManBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use JMS\SecurityExtraBundle\Annotation\Secure;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;

/**
 * Implements a controller containing admin functionality, i.e. reset the application
 */
class AdminController extends Controller
{
    /**
     * Display form to reset the application to factory defaults
     *
     * @Route("/admin/reset", name="cafman_admin_reset")
     * @Secure(roles="ROLE_SUPER_ADMIN")
     *
     * @Template()
     */
    public function resetAction(Request $request)
    {
        return array();
    }

    /**
     * Reset the application to factory defaults
     *
     * @Route("/admin/reset/execute", name="cafman_admin_reset_execute")
     * @Secure(roles="ROLE_SUPER_ADMIN")
     *
     * @Template()
     */
    public function resetExecuteAction()
    {
        // Reset the application
        /* @var $kernel KernelInterface */
        $kernel = $this->get('kernel');
        $application = new Application($kernel);
        $application->setAutoExit(false);

        // Drop dbs
        $options = array('command' => 'doctrine:mongodb:schema:drop');
        $application->run(new ArrayInput($options));
        $options = array('command' => 'doctrine:mongodb:schema:create');
        $application->run(new ArrayInput($options));

        // Create admin user
        $options = array('command' => 'fos:user:create', 'username' => 'admin', 'email' => 'organizers@plat-forms.org', 'password' => 'admin');
        $application->run(new ArrayInput($options));
        $options = array('command' => 'fos:user:promote', 'username' => 'admin', '--super' => true);
        $application->run(new ArrayInput($options));

        return new RedirectResponse($this->generateUrl('fos_user_security_logout'));
    }
}


text:
This utilities file contain helpers method to help you. Please contribute to add more helper !

# Helper list

- Set Color with Hex Code
- Customize Label
- Image to circle
- Simply add Text View Properties
- Border Properties to View
- String CGRect with Max Width and Max Height
- Atributed String Creator
- Get String Rect frame
- Get number of line from Text View
- Alpha Numeric String Validation
- Set Button Title WIth Image
- Atributed Underline String
- Attributed arrow
- Set Image with Color
- Check connection status

# How to use

(will update soon)


text:
cask "mate-translate" do
  version "8.1.8,3055"
  sha256 :no_check

  url "https://gikken.co/mate/MateTranslate.dmg",
      verified: "gikken.co/mate/"
  name "Mate Translate"
  desc "Select text in any app and translate it"
  homepage "https://twopeoplesoftware.com/mate"

  livecheck do
    url "https://gikken.co/mate/appcast.xml"
    strategy :sparkle
  end

  depends_on macos: ">= :high_sierra"

  app "Mate Translate.app"

  zap trash: [
    "~/Library/Application Scripts/com.twopeoplesoftware.InstantTranslate-nomas.Mate-Translate-Safari",
    "~/Library/Containers/com.twopeoplesoftware.InstantTranslate-nomas.Mate-Translate-Safari",
  ]
end


text:
function tweak_smallbird(inst)
    -- smallbirds avoid traps
    inst:AddTag("notraptrigger")

    local OldSpawnTeen = inst.userfunctions.SpawnTeen
    function inst.userfunctions.SpawnTeen(inst)
        OldSpawnTeen(inst)
        if inst.components.follower and inst.components.follower.leader then
            local leader = inst.components.follower.leader
            if leader.components.leader then
                leader.components.leader:RemoveFollower(inst)
            end
        end
    end
end

return tweak_smallbird


text:
/*
1- Union Type.

A union type describes a value that can be one of several types. We use the
vertical bar (|) to separate each type, so number | string | boolean is the type
of a value that can be a number, a string, or a boolean.
*/
function padLeft(value: string, padding: string | number) {
    // ...
}
let indentedString = padLeft("Hello world", true); // Errors during compilation

// If we have a value that has a union type, we can only access members that are
// common to all types in the union.
interface Bird {
    fly();
    layEggs();
}

interface Fish {
    swim();
    layEggs();
}

function getSmallPet(): Fish | Bird {
    // ...
}

let pet = getSmallPet();
pet.layEggs(); // okay
pet.swim();    // errors

/*
2- Type Guard.

A type guard is some expression that performs a runtime check that guarantees
the type in some scope. To define a type guard, we simply need to define a
function whose return type is a type predicate.
*/
function isFish(pet: Fish | Bird): pet is Fish {
    return (<Fish>pet).swim !== undefined;
}

/*
3- Intersection Types.

Intersection types are closely related to union types, but they are used very
differently. An object of this type will have all members of all three types. In
practice you will mostly see intersection types used for mixins
*/
function extend<T, U>(first: T, second: U): T & U {
    let result = <T & U>{};
    for (let id in first) {
        (<any>result)[id] = (<any>first)[id];
    }
    for (let id in second) {
        if (!result.hasOwnProperty(id)) {
            (<any>result)[id] = (<any>second)[id];
        }
    }
    return result;
}

class PersonIntersection {
    constructor(public name: string) { }
}
interface Loggable {
    log(): void;
}
class ConsoleLogger implements Loggable {
    log() {
        // ...
    }
}
var jim = extend(new PersonIntersection("Jim"), new ConsoleLogger());
var n = jim.name;
jim.log();

/*
Polymorphic 'this' types.

A polymorphic this type represents a type that is the subtype of the containing
class or interface. This is called F-bounded polymorphism. This makes hierarchical
fluent interfaces much easier to expres.
*/
class BasicCalculator {
    public constructor(protected value: number = 0) { }
    public currentValue(): number {
        return this.value;
    }
    public add(operand: number): this {
        this.value += operand;
        return this;
    }
    public multiply(operand: number): this {
        this.value *= operand;
        return this;
    }
    // ... other operations go here ...
}

let basicCalc = new BasicCalculator(2)
    .multiply(5)
    .add(1)
    .currentValue();

class ScientificCalculator extends BasicCalculator {
    public constructor(value = 0) {
        super(value);
    }
    public sin() {
        this.value = Math.sin(this.value);
        return this;
    }
    // ... other operations go here ...
}

let scientisCalc = new ScientificCalculator(2)
    .multiply(5)
    .sin()
    .add(1)
    .currentValue();


text:
type: doc
layout: reference
category: "Syntax"
title: "Ranges"
---

# Ranges

Range expressions are formed with `rangeTo` functions that have the operator form `..` which is complemented by *in*{: .keyword } and *!in*{: .keyword }.
Range is defined for any comparable type, but for integral primitive types it has an optimized implementation. Here are some examples of using ranges:

``` kotlin
if (i in 1..10) { // equivalent of 1 <= i && i <= 10
    println(i)
}
```

Integral type ranges (`IntRange`, `LongRange`, `CharRange`) have an extra feature: they can be iterated over.
The compiler takes care of converting this analogously to Java's indexed *for*{: .keyword }-loop, without extra overhead:

``` kotlin
for (i in 1..4) print(i) // prints "1234"

for (i in 4..1) print(i) // prints nothing
```

What if you want to iterate over numbers in reverse order? It's simple. You can use the `downTo()` function defined in the standard library:

``` kotlin
for (i in 4 downTo 1) print(i) // prints "4321"
```

Is it possible to iterate over numbers with arbitrary step, not equal to 1? Sure, the `step()` function will help you:

``` kotlin
for (i in 1..4 step 2) print(i) // prints "13"

for (i in 4 downTo 1 step 2) print(i) // prints "42"
```

To create a range which does not include its end element, you can use the `until` function:

``` kotlin
for (i in 1 until 10) { // i in [1, 10), 10 is excluded
     println(i)
}
```

## How it works

Ranges implement a common interface in the library: `ClosedRange<T>`.

`ClosedRange<T>` denotes a closed interval in the mathematical sense, defined for comparable types.
It has two endpoints: `start` and `endInclusive`, which are included in the range.
The main operation is `contains`, usually used in the form of *in*{: .keyword }/*!in*{: .keyword } operators.

Integral type progressions (`IntProgression`, `LongProgression`, `CharProgression`) denote an arithmetic progression.
Progressions are defined by the `first` element, the `last` element and a non-zero `step`.
The first element is `first`, subsequent elements are the previous element plus `step`. The `last` element is always hit by iteration unless the progression is empty.

A progression is a subtype of `Iterable<N>`, where `N` is `Int`, `Long` or `Char` respectively, so it can be used in *for*{: .keyword }-loops and functions like `map`, `filter`, etc.
Iteration over `Progression` is equivalent to an indexed *for*{: .keyword }-loop in Java/JavaScript:

``` java
for (int i = first; i != last; i += step) {
  // ...
}
```

For integral types, the `..` operator creates an object which implements both `ClosedRange<T>` and `*Progression`.
For example, `IntRange` implements `ClosedRange<Int>` and extends `IntProgression`, thus all operations defined for `IntProgression` are available for `IntRange` as well.
The result of the `downTo()` and `step()` functions is always a `*Progression`.

Progressions are constructed with the `fromClosedRange` function defined in their companion objects:

``` kotlin
IntProgression.fromClosedRange(start, end, step)
```

The `last` element of the progression is calculated to find maximum value not greater than the `end` value for positive `step` or minimum value not less than the `end` value for negative `step` such that `(last - first) % step == 0`.

## Utility functions

### `rangeTo()`

The `rangeTo()` operators on integral types simply call the constructors of `*Range` classes, e.g.:

``` kotlin
class Int {
    //...
    operator fun rangeTo(other: Long): LongRange = LongRange(this, other)
    //...
    operator fun rangeTo(other: Int): IntRange = IntRange(this, other)
    //...
}
```

Floating point numbers (`Double`, `Float`) do not define their `rangeTo` operator, and the one provided by the standard library for generic `Comparable` types is used instead:

``` kotlin
    public operator fun <T: Comparable<T>> T.rangeTo(that: T): ClosedRange<T>
```

The range returned by this function cannot be used for iteration.

### `downTo()`

The `downTo()` extension function is defined for any pair of integral types, here are two examples:

``` kotlin
fun Long.downTo(other: Int): LongProgression {
    return LongProgression.fromClosedRange(this, other.toLong(), -1L)
}

fun Byte.downTo(other: Int): IntProgression {
    return IntProgression.fromClosedRange(this.toInt(), other, -1)
}
```

### `reversed()`

The `reversed()` extension functions are defined for each `*Progression` classes, and all of them return reversed progressions:

``` kotlin
fun IntProgression.reversed(): IntProgression {
    return IntProgression.fromClosedRange(last, first, -step)
}
```

### `step()`

`step()` extension functions are defined for `*Progression` classes,
all of them return progressions with modified `step` values (function parameter).
The step value is required to be always positive, therefore this function never changes the direction of iteration:

``` kotlin
fun IntProgression.step(step: Int): IntProgression {
    if (step <= 0) throw IllegalArgumentException("Step must be positive, was: $step")
    return IntProgression.fromClosedRange(first, last, if (this.step > 0) step else -step)
}

fun CharProgression.step(step: Int): CharProgression {
    if (step <= 0) throw IllegalArgumentException("Step must be positive, was: $step")
    return CharProgression.fromClosedRange(first, last, if (this.step > 0) step else -step)
}
```

Note that the `last` value of the returned progression may become different from the `last` value of the original progression in order to preserve the invariant `(last - first) % step == 0`. Here is an example:

``` kotlin
(1..12 step 2).last == 11  // progression with values [1, 3, 5, 7, 9, 11]
(1..12 step 3).last == 10  // progression with values [1, 4, 7, 10]
(1..12 step 4).last == 9   // progression with values [1, 5, 9]
```


text:
![5 stars](../../images/ic_star_black_18dp_1x.png)![5 stars](../../images/ic_star_black_18dp_1x.png)![5 stars](../../images/ic_star_black_18dp_1x.png)![5 stars](../../images/ic_star_black_18dp_1x.png)![5 stars](../../images/ic_star_black_18dp_1x.png) 1

To use the OxWOD skill, try saying...

* *Alexa, ask Ox WOD give me the wod*

* *Alexa, ask Ox WOD what is the wod*

* *Alexa, ask Ox WOD what wod should I expect*

OxWod reads out the WOD on the OxBox (Seattle, WA) website. You can also go to OxBox website to see the WOD!

Note: OxWod is not sponsored or endorsed or affiliated with OxBox Gym.

***

### Skill Details

* **Invocation Name:** ox wod
* **Category:** null
* **ID:** amzn1.ask.skill.ffee5d8e-c7df-47df-adca-ca8ea19cc1a5
* **ASIN:** B01N9FCHU4
* **Author:** Panda Bears
* **Release Date:** December 13, 2016 @ 02:19:41
* **In-App Purchasing:** No


text:
This is a basic program to capture data from Masimo Brand Pulse Oximeter and store the data in a mysql data base. This should allow us to plot information at a later point..

#Packages needed for Debian on Raspberry PI or BeagleBone Black:
sudo apt-get install python-serial python-mysqldb python-pip
sudo pip install config elasticsearch


text:
from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:9568")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60)


text:
<?php

namespace PagueVeloz\Api\v2\Dto;

class ContaBancariaDTO extends \PagueVeloz\AbstractDTO
{
    protected $CodigoBanco;
    protected $CodigoAgencia;
    protected $NumeroConta;
    protected $Descricao;
    protected $Excluida;
    protected $Id;

    /**
     * Gets the value of CodigoBanco.
     *
     * @return mixed
     */
    public function getCodigoBanco()
    {
        return $this->CodigoBanco;
    }

    /**
     * Sets the value of CodigoBanco.
     *
     * @param mixed $CodigoBanco the codigo banco
     *
     * @return self
     */
    public function setCodigoBanco($CodigoBanco)
    {
        $this->CodigoBanco = $CodigoBanco;

        return $this;
    }

    /**
     * Gets the value of CodigoAgencia.
     *
     * @return mixed
     */
    public function getCodigoAgencia()
    {
        return $this->CodigoAgencia;
    }

    /**
     * Sets the value of CodigoAgencia.
     *
     * @param mixed $CodigoAgencia the codigo agencia
     *
     * @return self
     */
    public function setCodigoAgencia($CodigoAgencia)
    {
        $this->CodigoAgencia = $CodigoAgencia;

        return $this;
    }

    /**
     * Gets the value of NumeroConta.
     *
     * @return mixed
     */
    public function getNumeroConta()
    {
        return $this->NumeroConta;
    }

    /**
     * Sets the value of NumeroConta.
     *
     * @param mixed $NumeroConta the numero conta
     *
     * @return self
     */
    public function setNumeroConta($NumeroConta)
    {
        $this->NumeroConta = $NumeroConta;

        return $this;
    }

    /**
     * Gets the value of Descricao.
     *
     * @return mixed
     */
    public function getDescricao()
    {
        return $this->Descricao;
    }

    /**
     * Sets the value of Descricao.
     *
     * @param mixed $Descricao the descricao
     *
     * @return self
     */
    public function setDescricao($Descricao)
    {
        $this->Descricao = $Descricao;

        return $this;
    }

    /**
     * Gets the value of Excluida.
     *
     * @return mixed
     */
    public function getExcluida()
    {
        return $this->Excluida;
    }

    /**
     * Sets the value of Excluida.
     *
     * @param mixed $Excluida the excluida
     *
     * @return self
     */
    public function setExcluida($Excluida)
    {
        $this->Excluida = $Excluida;

        return $this;
    }

    /**
     * Gets the value of Id.
     *
     * @return mixed
     */
    public function getId()
    {
        return $this->Id;
    }

    /**
     * Sets the value of Id.
     *
     * @param mixed $Id the id
     *
     * @return self
     */
    public function setId($Id)
    {
        $this->Id = $Id;

        return $this;
    }
}