text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.doubleclickbidmanager.model;

/**
 * Request to upload line items.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the DoubleClick Bid Manager API. For a detailed
 * explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class UploadLineItemsRequest extends com.google.api.client.json.GenericJson {

  /**
   * Set to true to get upload status without actually persisting the line items.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean dryRun;

  /**
   * Format the line items are in. Default to CSV.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String format;

  /**
   * Line items in CSV to upload. Refer to Entity Write File Format for more information on file
   * format.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String lineItems;

  /**
   * Set to true to get upload status without actually persisting the line items.
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getDryRun() {
    return dryRun;
  }

  /**
   * Set to true to get upload status without actually persisting the line items.
   * @param dryRun dryRun or {@code null} for none
   */
  public UploadLineItemsRequest setDryRun(java.lang.Boolean dryRun) {
    this.dryRun = dryRun;
    return this;
  }

  /**
   * Format the line items are in. Default to CSV.
   * @return value or {@code null} for none
   */
  public java.lang.String getFormat() {
    return format;
  }

  /**
   * Format the line items are in. Default to CSV.
   * @param format format or {@code null} for none
   */
  public UploadLineItemsRequest setFormat(java.lang.String format) {
    this.format = format;
    return this;
  }

  /**
   * Line items in CSV to upload. Refer to Entity Write File Format for more information on file
   * format.
   * @return value or {@code null} for none
   */
  public java.lang.String getLineItems() {
    return lineItems;
  }

  /**
   * Line items in CSV to upload. Refer to Entity Write File Format for more information on file
   * format.
   * @param lineItems lineItems or {@code null} for none
   */
  public UploadLineItemsRequest setLineItems(java.lang.String lineItems) {
    this.lineItems = lineItems;
    return this;
  }

  @Override
  public UploadLineItemsRequest set(String fieldName, Object value) {
    return (UploadLineItemsRequest) super.set(fieldName, value);
  }

  @Override
  public UploadLineItemsRequest clone() {
    return (UploadLineItemsRequest) super.clone();
  }

}


text:
/**
 * @author itollu
 * @since 10.06.15
 */
describe("Active-item handles mouse events", function() {

    beforeEach(function () {
        angular.mock.module("activeList");
    });

    var $compile;
    var $rootScope;
    var markup = "" +
        "<active-list>" +
        "<active-item>item</active-item>" +
        "</active-list>";
    var activeListJq;
    var activeList;

    beforeEach(inject(function (_$compile_, _$rootScope_) {
        $compile = _$compile_;
        $rootScope = _$rootScope_;
        activeListJq = $compile(markup)($rootScope);
        activeList = activeListJq[0];
    }));

    it("Should delegate to activeUnit on mouseover and mouseleave", function() {
        var activeItem = activeList.querySelector("li[active-unit]");
        var activeItemJq = angular.element(activeItem);

        var activeUnitCtrl = activeItemJq.controller("activeUnit");
        expect(activeUnitCtrl).toBeDefined();

        var unitState = activeUnitCtrl.state;

        expect(unitState().length).toBe(1);
        expect(unitState()).toContain("idle");

        activeItemJq.triggerHandler("mouseover");
        expect(unitState().length).toBe(1);
        expect(unitState()).toContain("highlighted");

        activeItemJq.triggerHandler("mouseleave");
        expect(unitState().length).toBe(1);
        expect(unitState()).toContain("idle");
    });

    /*it("Should have stateClass() class", function () {
        var activeItem = document.getElementsByTagName("li")[0];
        var jqActiveItem = angular.element(activeItem);
        var stateClass = jqActiveItem.isolateScope().stateClass;

        expect(jqActiveItem.hasClass(stateClass())).toBe(true);
        jqActiveItem.triggerHandler("mouseover");
        expect(jqActiveItem.hasClass(stateClass())).toBe(true);
        jqActiveItem.triggerHandler("mouseleave");
        expect(jqActiveItem.hasClass(stateClass())).toBe(true);
    });

    it("stateClass() should be \"bg-info\" on mouseover", function () {
        var activeItem = document.getElementsByTagName("li")[0];
        var jqActiveItem = angular.element(activeItem);
        var stateClass = jqActiveItem.isolateScope().stateClass;

        expect(stateClass()).not.toBe("bg-info");
        jqActiveItem.triggerHandler("mouseover");
        expect(stateClass()).toBe("bg-info");
        jqActiveItem.triggerHandler("mouseleave");
        expect(stateClass()).not.toBe("bg-info");
    });

    it("stateClass() should be \"default\" when not mouseover", function () {
        var activeItem = document.getElementsByTagName("li")[0];
        var jqActiveItem = angular.element(activeItem);
        var stateClass = jqActiveItem.isolateScope().stateClass;

        expect(stateClass()).toBe("default");
        jqActiveItem.triggerHandler("mouseover");
        expect(stateClass()).not.toBe("default");
        jqActiveItem.triggerHandler("mouseleave");
        expect(stateClass()).toBe("default");
    });*/
});

redpajama_set_name: RedPajamaGithub


text:
var Class = require('../shared/lib/Class').Class,
    BaseEntityManager = require('../shared/EntityManager').EntityManager,
    Network = require('./Network').Network;

"use strict";

// Server Side Entity State Manager -------------------------------------------
var EntityManager = Class(function(parent) {
    BaseEntityManager(this, parent);

}, BaseEntityManager, {

    addEntity: function(entity) {

        if (this.entities.add(entity)) {

            entity.parent = this;

            this.messages.push([
                Network.Entity.Add,
                entity.getState(true, Network.State.Add)
            ]);

            this.log('Entity added', entity);
            return entity;

        }

    },

    setEntityOwner: function(entity, owner) {

        if (owner) {
            this.messages.push([Network.Entity.Owner, [entity.id, owner.id]]);
        }

        this.log('Set entity Owner', entity, owner);

    },

    updateEntity: function(owner, state) {

        var entity = this.entities.get(state[0]);
        if (entity && entity.getOwner() === owner) {
            entity.updateState(state);
        }

    },

    removeEntity: function(entity) {

        if (this.entities.remove(entity)) {

            this.messages.push([
                Network.Entity.Remove,
                entity.getState(true, Network.State.Remove)
            ]);

            console.log(this.messages);

            this.log('Entity removed', entity);
            entity.destroy();
            return entity;

        }

    },

    send: function() {

        this.entities.each(function(entity) {

            // Send the delayed state and buffer the current state
            this.messages.push([
                Network.Entity.Update,
                entity.getState(true, Network.State.Update)
            ]);

            // Note: It is important to do it this way around so that we actually
            // send the currentState - DelayCount BEFORE pushing a new value
            // to the buffer
            entity.bufferState();

        }, this);

        for(var i = 0, l = this.messages.length; i < l; i++) {
            this.parent.send.apply(this.parent, this.messages[i]);
        }

        this.messages.length = 0;

    }

});

// Exports --------------------------------------------------------------------
exports.EntityManager = EntityManager;


text:
require_relative "../lib/day3"

puts Day3.new.read_valid_triangles_by_row(File.join("data", "day3.txt")).length
puts Day3.new.read_valid_triangles_by_col(File.join("data", "day3.txt")).length


text:
package org.jclouds.docker.options;

import org.jclouds.http.options.BaseHttpRequestOptions;

public class RemoveContainerOptions extends BaseHttpRequestOptions {

   public RemoveContainerOptions verbose(Boolean verbose) {
      this.queryParameters.put("verbose", verbose.toString());
      return this;
   }

   public RemoveContainerOptions force(Boolean force) {
      this.queryParameters.put("force", force.toString());
      return this;
   }

   public static class Builder {
      /**
       * @see RemoveContainerOptions#verbose
       */
      public static RemoveContainerOptions verbose(Boolean verbose) {
         RemoveContainerOptions options = new RemoveContainerOptions();
         return options.verbose(verbose);
      }

      /**
       * @see RemoveContainerOptions#force
       */
      public static RemoveContainerOptions force(Boolean force) {
         RemoveContainerOptions options = new RemoveContainerOptions();
         return options.force(force);
      }
   }
}


text:
#ifndef __DC_Renderer_UIKitOpenGLView_H__
#define __DC_Renderer_UIKitOpenGLView_H__

#include <UIKit/UIKit.h>
#include "../OpenGL2.h"

DC_BEGIN_DREEMCHEST
namespace Renderer
{
    class iOSOpenGLView;
}
DC_END_DREEMCHEST

DC_USE_DREEMCHEST

// ** UIKitOpenGLView
@interface UIKitOpenGLView : UIView
{
    @private
        EAGLContext*                _context;
        CAEAGLLayer*                _layer;
        id                          _displayLink;
        GLuint                      _defaultFramebuffer, _colorRenderBuffer, _depthRenderBuffer;
        Renderer::iOSOpenGLView*    _view;
        int                         _width;
        int                         _height;
    }

    - ( id )    initWithView: ( Renderer::iOSOpenGLView* )view bounds:( CGRect )bounds options:( unsigned int )options scaleFactor:(float)scaleFactor;
    - ( void )  beginFrame;
    - ( void )  endFrame: (BOOL) wait;
    - ( BOOL )  makeCurrent;
    @property (readonly) int width;
    @property (readonly) int height;
@end

#endif /*   !defined( __DC_Renderer_UIKitOpenGLView_H__ ) */


text:
from setuptools import setup

setup(name='rampage',
      version='0.1.2',
      description='An arbitrary waveform builder and a control system for ultra-cold atom and ion trap experiments',
      classifiers=['Development Status :: 3 - Alpha',
                   'Environment :: X11 Applications :: Qt',
                   'Intended Audience :: Science/Research',
                   'License :: OSI Approved :: MIT License',
                   'Operating System :: OS Independent',
                   'Programming Language :: Python :: 2.7',
                   'Topic :: Multimedia :: Graphics :: Viewers',
                   'Topic :: Scientific/Engineering :: Physics',
                   'Topic :: Scientific/Engineering :: Visualization'],
      url='http://github.com/shreyaspotnis/rampage',
      author='Shreyas Potnis',
      author_email='shreyaspotnis@gmail.com',
      license='MIT',
      packages=['rampage'],
      install_requires=['pyqtgraph', 'numpy', 'pyzmq'],
      include_package_data=True,
      zip_safe=False)


text:
use std::default::Default;
use std::fmt;
use std::io::{Cursor, ErrorKind, Read, Write};

use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use rand;

use protocol::{CloseCode, OpCode};
use result::{Error, Kind, Result};
use stream::TryReadBuf;

fn apply_mask(buf: &mut [u8], mask: &[u8; 4]) {
    let iter = buf.iter_mut().zip(mask.iter().cycle());
    for (byte, &key) in iter {
        *byte ^= key
    }
}

/// A struct representing a WebSocket frame.
#[derive(Debug, Clone)]
pub struct Frame {
    finished: bool,
    rsv1: bool,
    rsv2: bool,
    rsv3: bool,
    opcode: OpCode,

    mask: Option<[u8; 4]>,

    payload: Vec<u8>,
}

impl Frame {
    /// Get the length of the frame.
    /// This is the length of the header + the length of the payload.
    #[inline]
    pub fn len(&self) -> usize {
        let mut header_length = 2;
        let payload_len = self.payload().len();
        if payload_len > 125 {
            if payload_len <= u16::max_value() as usize {
                header_length += 2;
            } else {
                header_length += 8;
            }
        }

        if self.is_masked() {
            header_length += 4;
        }

        header_length + payload_len
    }

    /// Return `false`: a frame is never empty since it has a header.
    #[inline]
    pub fn is_empty(&self) -> bool {
        false
    }

    /// Test whether the frame is a final frame.
    #[inline]
    pub fn is_final(&self) -> bool {
        self.finished
    }

    /// Test whether the first reserved bit is set.
    #[inline]
    pub fn has_rsv1(&self) -> bool {
        self.rsv1
    }

    /// Test whether the second reserved bit is set.
    #[inline]
    pub fn has_rsv2(&self) -> bool {
        self.rsv2
    }

    /// Test whether the third reserved bit is set.
    #[inline]
    pub fn has_rsv3(&self) -> bool {
        self.rsv3
    }

    /// Get the OpCode of the frame.
    #[inline]
    pub fn opcode(&self) -> OpCode {
        self.opcode
    }

    /// Test whether this is a control frame.
    #[inline]
    pub fn is_control(&self) -> bool {
        self.opcode.is_control()
    }

    /// Get a reference to the frame's payload.
    #[inline]
    pub fn payload(&self) -> &Vec<u8> {
        &self.payload
    }

    // Test whether the frame is masked.
    #[doc(hidden)]
    #[inline]
    pub fn is_masked(&self) -> bool {
        self.mask.is_some()
    }

    // Get an optional reference to the frame's mask.
    #[doc(hidden)]
    #[allow(dead_code)]
    #[inline]
    pub fn mask(&self) -> Option<&[u8; 4]> {
        self.mask.as_ref()
    }

    /// Make this frame a final frame.
    #[allow(dead_code)]
    #[inline]
    pub fn set_final(&mut self, is_final: bool) -> &mut Frame {
        self.finished = is_final;
        self
    }

    /// Set the first reserved bit.
    #[inline]
    pub fn set_rsv1(&mut self, has_rsv1: bool) -> &mut Frame {
        self.rsv1 = has_rsv1;
        self
    }

    /// Set the second reserved bit.
    #[inline]
    pub fn set_rsv2(&mut self, has_rsv2: bool) -> &mut Frame {
        self.rsv2 = has_rsv2;
        self
    }

    /// Set the third reserved bit.
    #[inline]
    pub fn set_rsv3(&mut self, has_rsv3: bool) -> &mut Frame {
        self.rsv3 = has_rsv3;
        self
    }

    /// Set the OpCode.
    #[allow(dead_code)]
    #[inline]
    pub fn set_opcode(&mut self, opcode: OpCode) -> &mut Frame {
        self.opcode = opcode;
        self
    }

    /// Edit the frame's payload.
    #[allow(dead_code)]
    #[inline]
    pub fn payload_mut(&mut self) -> &mut Vec<u8> {
        &mut self.payload
    }

    // Generate a new mask for this frame.
    //
    // This method simply generates and stores the mask. It does not change the payload data.
    // Instead, the payload data will be masked with the generated mask when the frame is sent
    // to the other endpoint.
    #[doc(hidden)]
    #[inline]
    pub fn set_mask(&mut self) -> &mut Frame {
        self.mask = Some(rand::random());
        self
    }

    // This method unmasks the payload and should only be called on frames that are actually
    // masked. In other words, those frames that have just been received from a client endpoint.
    #[doc(hidden)]
    #[inline]
    pub fn remove_mask(&mut self) -> &mut Frame {
        self.mask
            .take()
            .map(|mask| apply_mask(&mut self.payload, &mask));
        self
    }

    /// Consume the frame into its payload.
    pub fn into_data(self) -> Vec<u8> {
        self.payload
    }

    /// Create a new data frame.
    #[inline]
    pub fn message(data: Vec<u8>, code: OpCode, finished: bool) -> Frame {
        debug_assert!(
            match code {
                OpCode::Text | OpCode::Binary | OpCode::Continue => true,
                _ => false,
            },
            "Invalid opcode for data frame."
        );

        Frame {
            finished,
            opcode: code,
            payload: data,
            ..Frame::default()
        }
    }

    /// Create a new Pong control frame.
    #[inline]
    pub fn pong(data: Vec<u8>) -> Frame {
        Frame {
            opcode: OpCode::Pong,
            payload: data,
            ..Frame::default()
        }
    }

    /// Create a new Ping control frame.
    #[inline]
    pub fn ping(data: Vec<u8>) -> Frame {
        Frame {
            opcode: OpCode::Ping,
            payload: data,
            ..Frame::default()
        }
    }

    /// Create a new Close control frame.
    #[inline]
    pub fn close(code: CloseCode, reason: &str) -> Frame {
        let payload = if let CloseCode::Empty = code {
            Vec::new()
        } else {
            let u: u16 = code.into();
            let raw = [(u >> 8) as u8, u as u8];
            [&raw, reason.as_bytes()].concat()
        };

        Frame {
            payload,
            ..Frame::default()
        }
    }

    /// Parse the input stream into a frame.
    pub fn parse(cursor: &mut Cursor<Vec<u8>>, max_payload_length: u64) -> Result<Option<Frame>> {
        let size = cursor.get_ref().len() as u64 - cursor.position();
        let initial = cursor.position();
        trace!("Position in buffer {}", initial);

        let mut head = [0u8; 2];
        if cursor.read(&mut head)? != 2 {
            cursor.set_position(initial);
            return Ok(None);
        }

        trace!("Parsed headers {:?}", head);

        let first = head[0];
        let second = head[1];
        trace!("First: {:b}", first);
        trace!("Second: {:b}", second);

        let finished = first & 0x80 != 0;

        let rsv1 = first & 0x40 != 0;
        let rsv2 = first & 0x20 != 0;
        let rsv3 = first & 0x10 != 0;

        let opcode = OpCode::from(first & 0x0F);
        trace!("Opcode: {:?}", opcode);

        let masked = second & 0x80 != 0;
        trace!("Masked: {:?}", masked);

        let mut header_length = 2;

        let mut length = u64::from(second & 0x7F);

        if let Some(length_nbytes) = match length {
            126 => Some(2),
            127 => Some(8),
            _ => None,
        } {
            match cursor.read_uint::<BigEndian>(length_nbytes) {
                Err(ref err) if err.kind() == ErrorKind::UnexpectedEof => {
                    cursor.set_position(initial);
                    return Ok(None);
                }
                Err(err) => {
                    return Err(Error::from(err));
                }
                Ok(read) => {
                    length = read;
                }
            };
            header_length += length_nbytes as u64;
        }
        trace!("Payload length: {}", length);

        if length > max_payload_length {
            return Err(Error::new(
                Kind::Protocol,
                format!(
                    "Rejected frame with payload length exceeding defined max: {}.",
                    max_payload_length
                ),
            ));
        }

        let mask = if masked {
            let mut mask_bytes = [0u8; 4];
            if cursor.read(&mut mask_bytes)? != 4 {
                cursor.set_position(initial);
                return Ok(None);
            } else {
                header_length += 4;
                Some(mask_bytes)
            }
        } else {
            None
        };

        match length.checked_add(header_length) {
            Some(l) if size < l => {
                cursor.set_position(initial);
                return Ok(None);
            }
            Some(_) => (),
            None => return Ok(None),
        };

        let mut data = Vec::with_capacity(length as usize);
        if length > 0 {
            if let Some(read) = cursor.try_read_buf(&mut data)? {
                debug_assert!(read == length as usize, "Read incorrect payload length!");
            }
        }

        // Disallow bad opcode
        if let OpCode::Bad = opcode {
            return Err(Error::new(
                Kind::Protocol,
                format!("Encountered invalid opcode: {}", first & 0x0F),
            ));
        }

        // control frames must have length <= 125
        match opcode {
            OpCode::Ping | OpCode::Pong if length > 125 => {
                return Err(Error::new(
                    Kind::Protocol,
                    format!(
                        "Rejected WebSocket handshake.Received control frame with length: {}.",
                        length
                    ),
                ))
            }
            OpCode::Close if length > 125 => {
                debug!("Received close frame with payload length exceeding 125. Morphing to protocol close frame.");
                return Ok(Some(Frame::close(
                    CloseCode::Protocol,
                    "Received close frame with payload length exceeding 125.",
                )));
            }
            _ => (),
        }

        let frame = Frame {
            finished,
            rsv1,
            rsv2,
            rsv3,
            opcode,
            mask,
            payload: data,
        };

        Ok(Some(frame))
    }

    /// Write a frame out to a buffer
    pub fn format<W>(&mut self, w: &mut W) -> Result<()>
    where
        W: Write,
    {
        let mut one = 0u8;
        let code: u8 = self.opcode.into();
        if self.is_final() {
            one |= 0x80;
        }
        if self.has_rsv1() {
            one |= 0x40;
        }
        if self.has_rsv2() {
            one |= 0x20;
        }
        if self.has_rsv3() {
            one |= 0x10;
        }
        one |= code;

        let mut two = 0u8;
        if self.is_masked() {
            two |= 0x80;
        }

        match self.payload.len() {
            len if len < 126 => {
                two |= len as u8;
            }
            len if len <= 65535 => {
                two |= 126;
            }
            _ => {
                two |= 127;
            }
        }
        w.write_all(&[one, two])?;

        if let Some(length_bytes) = match self.payload.len() {
            len if len < 126 => None,
            len if len <= 65535 => Some(2),
            _ => Some(8),
        } {
            w.write_uint::<BigEndian>(self.payload.len() as u64, length_bytes)?;
        }

        if self.is_masked() {
            let mask = self.mask.take().unwrap();
            apply_mask(&mut self.payload, &mask);
            w.write_all(&mask)?;
        }

        w.write_all(&self.payload)?;
        Ok(())
    }
}

impl Default for Frame {
    fn default() -> Frame {
        Frame {
            finished: true,
            rsv1: false,
            rsv2: false,
            rsv3: false,
            opcode: OpCode::Close,
            mask: None,
            payload: Vec::new(),
        }
    }
}

impl fmt::Display for Frame {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "
<FRAME>
final: {}
reserved: {} {} {}
opcode: {}
length: {}
payload length: {}
payload: 0x{}
            ",
            self.finished,
            self.rsv1,
            self.rsv2,
            self.rsv3,
            self.opcode,
            // self.mask.map(|mask| format!("{:?}", mask)).unwrap_or("NONE".into()),
            self.len(),
            self.payload.len(),
            self.payload
                .iter()
                .map(|byte| format!("{:x}", byte))
                .collect::<String>()
        )
    }
}

mod test {
    #![allow(unused_imports, unused_variables, dead_code)]
    use super::*;
    use protocol::OpCode;

    #[test]
    fn display_frame() {
        let f = Frame::message("hi there".into(), OpCode::Text, true);
        let view = format!("{}", f);
        view.contains("payload:");
    }
}


text:
import React, { Component, PropTypes } from 'react'

import {
  View,
  Text,
  StyleSheet,
  Image
} from 'react-native'

export default class extends Component {
  static propTypes = {
    topic: PropTypes.object,
    style: View.propTypes.style,
    isSubscribed: PropTypes.bool
  };

  static defaultProps = {
    isSubscribed: false
  }

  render () {
    const {topic, style, isSubscribed} = this.props
    return (
      <View style={[{padding: 14}, style]}>
        <Text numberOfLines={1} style={{fontSize: 16, color: '#6199b1'}}>{topic.title}</Text>
        {
          topic.author &&
          <View style={{flexDirection: 'row', paddingLeft: 5, marginTop: 15}}>
            {
              topic.author_avatars.length > 0
              ? topic.author_avatars.map((uri, index) =>
                <Image key={index} style={{height: 35, width: 35, borderRadius: 17.5, marginLeft: -5}} source={{uri}}/>
                )
              : <Image style={{height: 35, width: 35, borderRadius: 17.5, marginLeft: -5}} source={require('../assets/default_avatar.png')}/>
            }
            <View style={{marginLeft: 10, justifyContent: 'center', flex: 1}}>
              <Text numberOfLines={1} style={styles.font}>{topic.author}</Text>
              <Text numberOfLines={1} style={{marginTop: 5, color: '#777777', fontSize: 11}}>{topic.author_info}</Text>
            </View>
          </View>
        }
        {isSubscribed &&
          <Image style={styles.subscribedLabel} source={require('../assets/added-cell.png')} />
        }
      </View>
    )
  }
}

const styles = StyleSheet.create({
  font: {
    fontSize: 12.5,
    color: '#555555'
  },
  subscribedLabel: {
    height: 30,
    width: 30,
    position: 'absolute',
    top: 0,
    right: 0
  }
})


text:
package org.jiemamy.utils.functor.core;

import org.jiemamy.utils.functor.Editor;
import org.jiemamy.utils.functor.Functor;
import org.jiemamy.utils.functor.Generator;

/**
 * 標準的な関数群。
 *
 * @version $Date$
 * @author Suguru ARAKAWA
 */
public final class Functors {

	/**
	 * 指定の値を常に返す、{@link Functor}のインスタンスを返す。
	 *
	 *
引数に{@code null}を指定した場合、メソッドの型推論が無効化される場合がある。
	 * そのような場合、
	 * {@code always((String) null)}のように型を明示的に指定してやるとよい。

	 *
	 * @param <T> 生成する定数の型
	 * @param value 生成する定数
	 * @return 生成したインスタンス
	 */
	public static <T>Functor<T, Object> always(final T value) {
		return new AbstractFunctor<T, Object>() {

			public T apply(Object argument) {
				return value;
			}
		};
	}

	/**
	 * 2つの{@link Functor}を合成した関数を生成して返す。
	 *
	 *
合成した関数{@code composite}は、{@link Functor#apply(Object)}が実行された際に
	 * まず{@code f.apply()}を実行し、その結果にさらに{@code g.apply()}を
	 * 適用した結果を返す。
	 * つまり、
	 * {@code composite.apply(x) == g.apply(f.apply(x))}
	 * となる。

	 *
	 * @param <D> 最終的な変換後の値の型
	 * @param  最初の変換後の値の型
	 * @param <S> 変換前の値の型
	 * @param g {@code f}の結果をさらに変換する関数
	 * @param f 最初に変換を行う関数
	 * @return 合成した関数
	 * @throws IllegalArgumentException 引数に{@code null}が含まれる場合
	 */
	public static <D, I, S>Functor<D, S> compose(Functor<? extends D, ? super I> g, Functor<? extends I, ? super S> f) {
		if (f == null) {
			throw new IllegalArgumentException("f is null"); //$NON-NLS-1$
		}
		if (g == null) {
			throw new IllegalArgumentException("g is null"); //$NON-NLS-1$
		}
		return new Composite<D, I, S>(f, g);
	}

	/**
	 * {@link Generator}と{@link Editor}を組み合わせて
	 * {@link Functor}のように振舞うインスタンスを生成する。
	 *
	 * @param <D> 変換後の値({@code Editor}の操作対象)の型
	 * @param <S> 変換前の値({@code Editor}の操作引数)の型
	 * @param generator 結果となる値を生成する生成器
	 * @param editor {@code generator}によって生成された値を操作する操作器
	 * @return 生成した変換器
	 * @throws IllegalArgumentException 引数に{@code null}が含まれる場合
	 */
	public static <D, S>Functor<D, S> from(Editor<? super D, ? super S> editor, Generator<? extends D> generator) {
		if (editor == null) {
			throw new IllegalArgumentException("editor is null"); //$NON-NLS-1$
		}
		if (generator == null) {
			throw new IllegalArgumentException("generator is null"); //$NON-NLS-1$
		}
		return new FromEditor<D, S>(editor, generator);
	}

	/**
	 * 指定の {@link Generator}を元に {@link Functor}を構築して返す。
	 *

	 * 返される関数の{@link Functor#apply(Object)}の引数は無視され、ラップする{@link Generator}が生成する値を返す。
	 *

	 * @param <T> 生成される値の型
	 * @param generator 元となる生成器
	 * @return 生成したインスタンス
	 * @throws IllegalArgumentException 引数に{@code null}が含まれる場合
	 */
	public static <T>Functor<T, Object> from(Generator<? extends T> generator) {
		if (generator == null) {
			throw new IllegalArgumentException("generator is null"); //$NON-NLS-1$
		}
		return new FromGenerator<T>(generator);
	}

	/**
	 * 引数をそのまま返すような、恒等関数を返す。
	 *
	 *
恒等関数の型を指定する場合、{@code Functors.<String>id()}のように記述する。

	 *
	 * @param <T> 恒等関数が取り扱う値の型
	 * @return 恒等関数
	 */
	public static <T>Functor<T, T> id() {
		return new AbstractFunctor<T, T>() {

			public T apply(T argument) {
				return argument;
			}
		};
	}

	/**
	 * 高階化された関数の、第1引数と第2引数の順序を入れ替えた関数を返す。
	 *
	 *
引数に渡された関数が{@code f.apply(x).apply(y)}のように適用される場合、
	 * {@code t(f).apply(y).apply(x)}のように利用できることになる。

	 *
	 * @param <D> 高階化された関数の、最終的な結果の型
	 * @param  高階化された関数の、本来の第2引数の型
	 * @param <S> 高階化された関数の、本来の第1引数の型
	 * @param functor 対象の高階化された関数
	 * @return 対象の引数の順序を入れ替えた関数
	 * @throws IllegalArgumentException 引数に{@code null}が含まれる場合
	 */
	@SuppressWarnings("unchecked")
	// 現行のコンパイラだと正しく解釈しない
	public static <D, I, S>Functor<Functor<D, S>, I> transpose(Functor<? extends Functor<D, I>, S> functor) {
		if (functor == null) {
			throw new IllegalArgumentException("functor is null"); //$NON-NLS-1$
		}
		if (functor instanceof Transpose) {
			@SuppressWarnings("rawtypes")
			Transpose transposed = (Transpose) functor;
			return transposed.original;
		}
		return new Transpose<D, I, S>(functor);
	}

	private Functors() {
	}

	private static class Composite<D, I, S> extends AbstractFunctor<D, S> {

		private Functor<? extends I, ? super S> former;

		private Functor<? extends D, ? super I> latter;

		Composite(Functor<? extends I, ? super S> former, Functor<? extends D, ? super I> latter) {
			assert former != null;
			assert latter != null;
			this.former = former;
			this.latter = latter;
		}

		public D apply(S argument) {
			I intermediate = former.apply(argument);
			D result = latter.apply(intermediate);
			return result;
		}
	}

	private static class FromEditor<D, S> extends AbstractFunctor<D, S> {

		private Generator<? extends D> generator;

		private Editor<? super D, ? super S> editor;

		FromEditor(Editor<? super D, ? super S> editor, Generator<? extends D> generator) {
			assert generator != null;
			assert editor != null;
			this.editor = editor;
			this.generator = generator;
		}

		public D apply(S argument) {
			D object = generator.generate();
			editor.edit(object, argument);
			return object;
		}
	}

	private static class FromGenerator<T> extends AbstractFunctor<T, Object> {

		private Generator<? extends T> generator;

		FromGenerator(Generator<? extends T> generator) {
			assert generator != null;
			this.generator = generator;
		}

		public T apply(Object argument) {
			return generator.generate();
		}
	}

	private static class Transpose<D, A, B> extends AbstractFunctor<Functor<D, B>, A> {

		final Functor<? extends Functor<D, A>, B> original;

		Transpose(Functor<? extends Functor<D, A>, B> original) {
			assert original != null;
			this.original = original;
		}

		public Functor<D, B> apply(final A a) {
			final Functor<? extends Functor<D, A>, B> f = original;
			return new AbstractFunctor<D, B>() {

				public D apply(final B b) {
					return f.apply(b).apply(a);
				}
			};
		}
	}
}


text:
{%each args as cbFunction %}
  {%if cbFunction.isCallbackFunction %}

{{ cbFunction.return.type }} {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_cppCallback (
  {% each cbFunction.args|argsInfo as arg %}
    {{ arg.cType }} {{ arg.name}}{% if not arg.lastArg %},{% endif %}
  {% endeach %}
) {
  {{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton* baton = new {{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton();

  {% each cbFunction.args|argsInfo as arg %}
    baton->{{ arg.name }} = {{ arg.name }};
  {% endeach %}

  baton->result = 0;
  baton->req.data = baton;
  baton->done = false;

  uv_async_init(uv_default_loop(), &baton->req, (uv_async_cb) {{ cppFunctionName }}_{{ cbFunction.name }}_async);
  uv_async_send(&baton->req);

  while(!baton->done) {
    this_thread::sleep_for(chrono::milliseconds(1));
  }

  {% each cbFunction|returnsInfo false true as _return %}
    {% if _return.isOutParam %}
    *{{ _return.name }} = *baton->{{ _return.name }};
    {% endif %}
  {% endeach %}

  return baton->result;
}

void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_async(uv_async_t* req, int status) {
  NanScope();

  {{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton* baton = static_cast<{{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton*>(req->data);

  {% each cbFunction.args|argsInfo as arg %}
    {% if arg | isPayload %}
      {% if cbFunction.payload.globalPayload %}
  NanCallback* callback = (({{ cppFunctionName }}_globalPayload*)baton->{{ arg.name }})->{{ cbFunction.name }};
      {% else %}
  NanCallback* callback = (NanCallback *)baton->{{ arg.name }};
      {% endif %}
    {% endif %}
  {% endeach %}

  Local<Value> argv[{{ cbFunction.args|jsArgsCount }}] = {
    {% each cbFunction.args|argsInfo as arg %}
      {% if arg | isPayload %}
        {%-- payload is always the last arg --%}
        // payload is null because we can use closure scope in javascript
        NanUndefined()
      {% elsif arg.isJsArg %}
        {% if arg.isEnum %}
          NanNew((int)baton->{{ arg.name }}),
        {% elsif arg.isLibgitType %}
          NanNew({{ arg.cppClassName }}::New((void *)baton->{{ arg.name }}, false)),
        {% elsif arg.cType == "size_t" %}
          // HACK: NAN should really have an overload for NanNew to support size_t
          NanNew((unsigned int)baton->{{ arg.name }}),
        {% else %}
          NanNew(baton->{{ arg.name }}),
        {% endif %}
      {% endif %}
    {% endeach %}
  };

  TryCatch tryCatch;
  Handle<v8::Value> result = callback->Call({{ cbFunction.args|jsArgsCount }}, argv);

  if (result->IsObject() && result->ToObject()->Has(NanNew("then"))) {
    Handle<v8::Value> thenProp = result->ToObject()->Get(NanNew("then"));

    if (thenProp->IsFunction()) {
      // we can be reasonbly certain that the result is a promise
      Local<Object> promise = result->ToObject();

      NanAssignPersistent(baton->promise, promise);

      uv_close((uv_handle_t*) &baton->req, NULL);
      uv_async_init(uv_default_loop(), &baton->req, (uv_async_cb) {{ cppFunctionName }}_{{ cbFunction.name }}_asyncPromisePolling);
      uv_async_send(&baton->req);
      return;
    }
  }

  {% each cbFunction|returnsInfo false true as _return %}
    if (result.IsEmpty() || result->IsNativeError()) {
      baton->result = {{ cbFunction.return.error }};
    }
    else if (!result->IsNull() && !result->IsUndefined()) {
      {% if _return.isOutParam %}
      {{ _return.cppClassName }}* wrapper = ObjectWrap::Unwrap<{{ _return.cppClassName }}>(result->ToObject());
      wrapper->selfFreeing = false;

      baton->{{ _return.name }} = wrapper->GetRefValue();
      baton->result = {{ cbFunction.return.success }};
      {% else %}
      if (result->IsNumber()) {
        baton->result = (int)result->ToNumber()->Value();
      }
      else {
        baton->result = {{ cbFunction.return.noResults }};
      }
      {% endif %}
    }
    else {
      baton->result = {{ cbFunction.return.noResults }};
    }
  {% endeach %}

  baton->done = true;
  uv_close((uv_handle_t*) &baton->req, NULL);
}

void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_asyncPromisePolling(uv_async_t* req, int status) {
  NanScope();

  {{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton* baton = static_cast<{{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton*>(req->data);
  Local<Object> promise = NanNew<Object>(baton->promise);
  NanCallback* isPendingFn = new NanCallback(promise->Get(NanNew("isPending")).As<Function>());
  Local<Value> argv[1]; // MSBUILD won't assign an array of length 0
  Local<Boolean> isPending = isPendingFn->Call(promise, 0, argv)->ToBoolean();

  if (isPending->Value()) {
    uv_async_send(&baton->req);
    return;
  }

  NanCallback* isFulfilledFn = new NanCallback(promise->Get(NanNew("isFulfilled")).As<Function>());
  Local<Boolean> isFulfilled = isFulfilledFn->Call(promise, 0, argv)->ToBoolean();

  if (isFulfilled->Value()) {
    NanCallback* resultFn = new NanCallback(promise->Get(NanNew("value")).As<Function>());
    Handle<v8::Value> result = resultFn->Call(promise, 0, argv);

    {% each cbFunction|returnsInfo false true as _return %}
      if (result.IsEmpty() || result->IsNativeError()) {
        baton->result = {{ cbFunction.return.error }};
      }
      else if (!result->IsNull() && !result->IsUndefined()) {
        {% if _return.isOutParam %}
        {{ _return.cppClassName }}* wrapper = ObjectWrap::Unwrap<{{ _return.cppClassName }}>(result->ToObject());
        wrapper->selfFreeing = false;

        baton->{{ _return.name }} = wrapper->GetRefValue();
        baton->result = {{ cbFunction.return.success }};
        {% else %}
        if (result->IsNumber()) {
          baton->result = (int)result->ToNumber()->Value();
        }
        else {
          baton->result = {{ cbFunction.return.noResults }};
        }
        {% endif %}
      }
      else {
        baton->result = {{ cbFunction.return.noResults }};
      }
    {% endeach %}
    baton->done = true;
  }
  else {
    // promise was rejected
    baton->result = {{ cbFunction.return.error }};
    baton->done = false;
  }

  uv_close((uv_handle_t*) &baton->req, NULL);
}
  {%endif%}
{%endeach%}


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


text:
@interface LecturesModel : NSObject
@property(nonatomic,copy)NSString * title;
@property(nonatomic,copy)NSString * time;
@property(nonatomic,copy)NSString * jiangZuoID;
@property(nonatomic,copy)NSString * imageurl;
-(id)initWithJiangZuoDic:(NSDictionary*)dic;
@end


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.fithjoyapp.googlefittest" >

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

        <meta-data android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <activity
            android:name="com.zmarkan.fitexperiment.FitActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>


text:
require "active_model/type/helpers"
require "active_model/type/value"

require "active_model/type/big_integer"
require "active_model/type/binary"
require "active_model/type/boolean"
require "active_model/type/date"
require "active_model/type/date_time"
require "active_model/type/decimal"
require "active_model/type/float"
require "active_model/type/immutable_string"
require "active_model/type/integer"
require "active_model/type/string"
require "active_model/type/time"

require "active_model/type/registry"

module ActiveModel
  module Type
    @registry = Registry.new

    class << self
      attr_accessor :registry # :nodoc:

      # Add a new type to the registry, allowing it to be gotten through ActiveModel::Type#lookup
      def register(type_name, klass = nil, **options, &block)
        registry.register(type_name, klass, **options, &block)
      end

      def lookup(*args, **kwargs) # :nodoc:
        registry.lookup(*args, **kwargs)
      end

      def default_value # :nodoc:
        @default_value ||= Value.new
      end
    end

    register(:big_integer, Type::BigInteger)
    register(:binary, Type::Binary)
    register(:boolean, Type::Boolean)
    register(:date, Type::Date)
    register(:datetime, Type::DateTime)
    register(:decimal, Type::Decimal)
    register(:float, Type::Float)
    register(:immutable_string, Type::ImmutableString)
    register(:integer, Type::Integer)
    register(:string, Type::String)
    register(:time, Type::Time)
  end
end


text:
import { Component, OnInit } from '@angular/core';
import {Router} from '@angular/router';
import {AuthenticationService} from '../services/authentication.service';

@Component({
  selector: 'app-login',
  templateUrl: './login.component.html',
  styleUrls: ['./login.component.css']
})
export class LoginComponent implements OnInit {
  username: string;
  password: string;
  errorMessage: string;

  constructor(
    private authenticationService: AuthenticationService,
    private router: Router
  ) { }

  ngOnInit() {
  }

  onLoginClick() {
    this.errorMessage = '';
    this.authenticationService.login(this.username, this.password)
      .then(() => this.router.navigate(['/']),
        error => this.errorMessage = error);
  }
}


text:
package org.onlab.junit;

import org.junit.Test;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.is;
import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable;

/**
 * Set of unit tests to check the implementation of the immutable class
 * checker.
 */
public class ImmutableClassCheckerTest {
    /**
     * Test class for non final class check.
     */
    // CHECKSTYLE IGNORE FinalClass FOR NEXT 1 LINES
    static class NonFinal {
        private NonFinal() { }
    }

    /**
     * Check that a non final class correctly produces an error.
     * @throws Exception if any of the reflection lookups fail.
     */
    @Test
    public void testNonFinalClass() throws Exception {
        boolean gotException = false;
        try {
            assertThatClassIsImmutable(NonFinal.class);
        } catch (AssertionError assertion) {
            assertThat(assertion.getMessage(),
                    containsString("is not final"));
            gotException = true;
        }
        assertThat(gotException, is(true));
    }

    /**
     * Test class for non private member class check.
     */
    static final class FinalProtectedMember {
        protected final int x = 0;
    }

    /**
     * Check that a final class with a non-private member is properly detected.
     *
     * @throws Exception if any of the reflection lookups fail.
     */
    @Test
    public void testFinalProtectedMember() throws Exception {
        boolean gotException = false;
        try {
            assertThatClassIsImmutable(FinalProtectedMember.class);
        } catch (AssertionError assertion) {
            assertThat(assertion.getMessage(),
                       containsString("a field named 'x' that is not private"));
            gotException = true;
        }
        assertThat(gotException, is(true));
    }

    /**
     * Test class for non private member class check.
     */
    static final class NotFinalPrivateMember {
        private int x = 0;
    }

    /**
     * Check that a final class with a non-final private
     * member is properly detected.
     *
     * @throws Exception if any of the reflection lookups fail.
     */
    @Test
    public void testNotFinalPrivateMember() throws Exception {
        boolean gotException = false;
        try {
            assertThatClassIsImmutable(NotFinalPrivateMember.class);
        } catch (AssertionError assertion) {
            assertThat(assertion.getMessage(),
                    containsString("a field named 'x' that is not final"));
            gotException = true;
        }
        assertThat(gotException, is(true));
    }

    /**
     * Test class for non private member class check.
     */
    static final class ClassWithSetter {
        private final int x = 0;
        public void setX(int newX) {
        }
    }

    /**
     * Check that a final class with a final private
     * member that is modifyable by a setter is properly detected.
     *
     * @throws Exception if any of the reflection lookups fail.
     */
    @Test
    public void testClassWithSetter() throws Exception {
        boolean gotException = false;
        try {
            assertThatClassIsImmutable(ClassWithSetter.class);
        } catch (AssertionError assertion) {
            assertThat(assertion.getMessage(),
                    containsString("a class with a setter named 'setX'"));
            gotException = true;
        }
        assertThat(gotException, is(true));
    }

}


text:
#ifndef USB_KEYBOARD_SERVICE_H_
#define USB_KEYBOARD_SERVICE_H_

errval_t usb_keyboard_service_init(void);
void key_event(uint8_t scancode, bool extended);

#endif /* USB_KEYBOARD_SERVICE_H_ */


text:
using JetBrains.ReSharper.FeaturesTestFramework.Intentions;
using JetBrains.ReSharper.TestFramework;
using NUnit.Framework;
using ReCommendedExtension.ContextActions.CodeContracts;

namespace ReCommendedExtension.Tests.ContextActions.CodeContracts.Types
{
    [TestNetFramework4]
    [TestFixture]
    public sealed class TimeSpanZeroOrNegativeAvailabilityTests : CSharpContextActionAvailabilityTestBase<TimeSpanZeroOrNegative>
    {
        protected override string ExtraPath => "";

        protected override string RelativeTestDataPath => @"ContextActions\CodeContracts\Types\TimeSpanZeroOrNegative";

        [Test]
        public void TestAvailability() => DoNamedTest2();
    }
}


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

<TITLE>
UpdateView
</TITLE>

<META NAME="date" CONTENT="2013-06-28">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../doclava-developer-docs.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

net.hockeyapp.android.views

Class UpdateView

java.lang.Object
  RelativeLayout
      net.hockeyapp.android.views.UpdateView

public class UpdateView
extends RelativeLayout

Description

 Internal helper class to draw the content view of UpdateActivity
 and UpdateFragement.

License

 Copyright (c) 2011-2013 Bit Stadium GmbH

 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
 conditions:

 The above copyright notice and this permission notice shall be
 included in all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.

Author:

Thomas Dohmke

Field Summary

static int
HEADER_VIEW_ID

protected  RelativeLayout
headerView

protected  boolean
layoutHorizontally

protected  boolean
limitHeight

static int
NAME_LABEL_ID

static int
UPDATE_BUTTON_ID

static int
VERSION_LABEL_ID

static int
WEB_VIEW_ID

Constructor Summary

UpdateView(Context context)

UpdateView(Context context,
           AttributeSet attrs)

UpdateView(Context context,
           boolean allowHorizontalLayout)

UpdateView(Context context,
           boolean allowHorizontalLayout,
           boolean limitHeight)

Method Summary

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

HEADER_VIEW_ID

public static final int HEADER_VIEW_ID

See Also:
Constant Field Values

NAME_LABEL_ID

public static final int NAME_LABEL_ID

See Also:
Constant Field Values

VERSION_LABEL_ID

public static final int VERSION_LABEL_ID

See Also:
Constant Field Values

UPDATE_BUTTON_ID

public static final int UPDATE_BUTTON_ID

See Also:
Constant Field Values

WEB_VIEW_ID

public static final int WEB_VIEW_ID

See Also:
Constant Field Values

headerView

protected RelativeLayout headerView

layoutHorizontally

protected boolean layoutHorizontally

limitHeight

protected boolean limitHeight

Constructor Detail

UpdateView

public UpdateView(Context context)

UpdateView

public UpdateView(Context context,
                  AttributeSet attrs)

UpdateView

public UpdateView(Context context,
                  boolean allowHorizontalLayout)

UpdateView

public UpdateView(Context context,
                  boolean allowHorizontalLayout,
                  boolean limitHeight)

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
from wagtail.wagtailcore.models import Page

class HomePage(Page):
    pass


text:
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVectorClamp" inherits="VisualShaderNode" version="4.0">
	<brief_description>
		Clamps a vector value within the visual shader graph.
	</brief_description>
	<description>
		Constrains a value to lie between [code]min[/code] and [code]max[/code] values. The operation is performed on each component of the vector individually.
	</description>
	<tutorials>
	</tutorials>
	<methods>
	</methods>
	<constants>
	</constants>
</class>


text:
package com.github.okhttprequestbodylengthbug;

import android.support.annotation.NonNull;

import com.squareup.okhttp.RequestBody;

import retrofit.Call;
import retrofit.GsonConverterFactory;
import retrofit.Retrofit;
import retrofit.http.Body;
import retrofit.http.POST;

public class DummyClient {

    public static Retrofit getRetrofit() {
        return new Retrofit.Builder()
                .baseUrl("http://www.google.com")
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }

    public interface IDummyService {

        @POST("/dummy/path")
        Call<Void> dummyRequest(@NonNull @Body RequestBody body);
    }
}


text:
@implementation SCBadgeView

- (instancetype)initWithFrame:(CGRect)frame {

    self = [super initWithFrame:frame];

    if (self) {
        // 不允许点击
        self.userInteractionEnabled = NO;

        // 设置字体
        self.titleLabel.font = SCBadgeNumberFontSize;

        // 设置居右
        self.titleLabel.textAlignment = NSTextAlignmentRight;

        // 字体颜色
        [self setTitleColor:[UIColor redColor] forState:UIControlStateNormal];

    }

    return self;
}

- (void)setBadgeValue:(NSString *)badgeValue
{
    // 设置属性
    _badgeValue = badgeValue;

    // 设置badgeView内容
    [self setBadgeViewWithbadgeValue:badgeValue];
}

- (void)setBadgeViewWithbadgeValue:(NSString *)badgeValue {
    // 设置文字内容
    [self setTitle:badgeValue forState:UIControlStateNormal];

    // 判断是否有内容,设置隐藏属性
    if (badgeValue.length == 0 ||
        [badgeValue isEqualToString:@"0"]) {

        // 数值内容为空或数值为0,则隐藏
        self.hidden = YES;
    }
    else {
        self.hidden = NO;
    }

    long badgeNumber = [badgeValue longLongValue];
    // 如果文字尺寸大于控件宽度
    if (badgeNumber > 9 && badgeNumber < 100) {
        // 显示中等大小图片
        [self setBackgroundImage:[UIImage imageNamed:@"badge_cart_icon2"]
                        forState:UIControlStateNormal];
    }
    else if (badgeNumber > 99) {
        // 设置文字内容
        [self setTitle:@"99+" forState:UIControlStateNormal];
        // 显示内容和大红点背景
        [self setBackgroundImage:[UIImage imageNamed:@"badge_cart_icon1"]
                        forState:UIControlStateNormal];

    } else {
        // 设置图片
        [self setBackgroundImage:[UIImage imageNamed:@"badge_cart_icon3"]
                        forState:UIControlStateNormal];

    }

    // 尺寸自适应
    [self sizeToFit];
}

@end


text:
using System;

namespace Sparrow.Reactive.Linq
{
    public class MinMessenger<T> : Messenger<T, T> where T : IComparable<T>
    {
        public MinMessenger(ISender<T> sender) : base(null)
        {
            sender.Attach(this);
        }

        public override void Receive(T value)
        {
            if (Value != null && Value.CompareTo(value) <= 0) return;
            Send(value);
        }
    }
}


text:
//
//  CYCreatorModel.h
//  CYInkeLive
//
//  Created by Cyrill on 2017/4/11.
//  Copyright © 2017年 Cyrill. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface CYCreatorModel : NSObject

/** 主播名 */
@property (nonatomic, strong) NSString *nick;
/** 主播头像 */
@property (nonatomic, strong) NSString *portrait;

@property (nonatomic, copy) NSString *third_platform;

@property (nonatomic, assign) NSInteger rank_veri;

@property (nonatomic, assign) NSInteger sex;

@property (nonatomic, assign) NSInteger gmutex;

@property (nonatomic, assign) NSInteger verified;

@property (nonatomic, copy) NSString *emotion;

@property (nonatomic, assign) NSInteger inke_verify;

@property (nonatomic, copy) NSString *verified_reason;

@property (nonatomic, copy) NSString *birth;

@property (nonatomic, copy) NSString *location;

@property (nonatomic, copy) NSString *hometown;

@property (nonatomic, assign) NSInteger level;

@property (nonatomic, copy) NSString *veri_info;

@property (nonatomic, assign) NSInteger gender;

@property (nonatomic, copy) NSString *profession;

@end


text:
require 'araignee/ai/core/fabricators/ai_starter_fabricator'

RSpec.describe 'AI StarterFabricator' do
  let(:starter) { Fabricate(:ai_starter) }

  subject { starter }

  describe '#initialize' do
    it 'should have no child' do
      expect(subject.child).to eq(nil)
    end
  end
end


text:
FROM node:10

ENV NPM_CONFIG_PREFIX=/home/node/.npm-global

WORKDIR /home/node

COPY package.json ./
COPY examples/ ./examples
COPY src/ ./src
COPY conf/ ./conf

RUN chown -R node:node package.json examples src conf
USER node

RUN npm install babel-cli webpack \
 && npm install


text:
<?xml version="1.0" encoding="utf-8"?>
<config>
    <routing-instance name='default-domain:default-project:ip-fabric:__default__'>
        <bgp-router name='local'>
            <address>127.0.0.1</address>
            <autonomous-system>1</autonomous-system>
            <address-families>
                <family>inet-vpn</family>
            </address-families>
            <session to='remote:1001'>
                <address-families>
                    <family>inet-vpn</family>
                </address-families>
            </session>
            <session to='remote:1004'>
                <address-families>
                    <family>inet-vpn</family>
                </address-families>
            </session>
        </bgp-router>
        <bgp-router name='remote'>
            <address>127.0.0.2</address>
            <autonomous-system>1</autonomous-system>
            <address-families>
                <family>inet-vpn</family>
            </address-families>
            <session to='local:1001'>
                <address-families>
                    <family>inet-vpn</family>
                </address-families>
            </session>
            <session to='local:1004'>
                <address-families>
                    <family>inet-vpn</family>
                </address-families>
            </session>
        </bgp-router>
    </routing-instance>
</config>


text:
require 'timeout'

module FileMover

  module Timeout
    def self.included base
      base.send :attribute, :timeout
    end

    def with_timeout what = self
      logger.debug{"entering with_timeout #{what}. timeout=#{timeout}"}
      ::Timeout.timeout(timeout){yield}
    rescue ::Timeout::Error
      raise ::Timeout::Error, "expired: #{what}"
    end
  end

end


text:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "dmadrv.h"
#include "em_chip.h"
#include "em_cmu.h"
#include "em_core.h"
#include "em_device.h"
#include "em_gpio.h"
#include "em_ldma.h"
#include "em_usart.h"
#include "gpiointerrupt.h"
#include "sl_device_init_clocks.h"
#include "sl_status.h"

#include "FreeRTOS.h"
#include "event_groups.h"
#include "task.h"

#include "wfx_host_events.h"
#include "wfx_rsi.h"

#include "rsi_board_configuration.h"
#include "rsi_driver.h"

typedef void (*UserIntCallBack_t)(void);
UserIntCallBack_t call_back, gpio_callback;
#ifdef LOGGING_STATS
uint8_t current_pin_set, prev_pin_set;
#endif /* LOGGING_STATS */

/* ARGSUSED */
void rsi_gpio_irq_cb(uint8_t irqnum)
{

    // WFX_RSI_LOG ("RSI: Got Int=%d", irqnum)
    if (irqnum != SL_WFX_HOST_PINOUT_SPI_IRQ)
        return;
    GPIO_IntClear(1 << SL_WFX_HOST_PINOUT_SPI_IRQ);

    // WFX_RSI_LOG ("Got SPI intr, cb=%x", (uint32_t)call_back);
    if (call_back != NULL)
        (*call_back)();
}

/*===================================================*/
/**
 * @fn           void rsi_hal_intr_config(void (* rsi_interrupt_handler)())
 * @brief        Starts and enables the SPI interrupt
 * @param[in]    rsi_interrupt_handler() ,call back function to handle interrupt
 * @param[out]   none
 * @return       none
 * @description  This HAL API should contain the code to initialize the register/pins
 *               related to interrupts and enable the interrupts.
 */
void rsi_hal_intr_config(void (*rsi_interrupt_handler)(void))
{
    call_back = rsi_interrupt_handler;
    WFX_RSI_LOG("RSI:Set SPI intr CB to=%x", (uint32_t) call_back);
}

/*===================================================*/
/**
 * @fn           void rsi_hal_log_stats_intr_config(void (* rsi_give_wakeup_indication)())
 * @brief        Checks the interrupt and map/set gpio callback function
 * @param[in]    rsi_give_wakeup_indication() ,gpio call back function to handle interrupt
 * @param[out]   none
 * @return       none
 * @description  This HAL API should contain the code
 *               related to mapping of gpio callback function.
 */
#ifdef LOGGING_STATS
void rsi_hal_log_stats_intr_config(void (*rsi_give_wakeup_indication)())
{
    gpio_callback = rsi_give_wakeup_indication;
}
#endif

/*===================================================*/
/**
 * @fn           void rsi_hal_intr_mask(void)
 * @brief        Disables the SPI Interrupt
 * @param[in]    none
 * @param[out]   none
 * @return       none
 * @description  This HAL API should contain the code to mask/disable interrupts.
 */
void rsi_hal_intr_mask(void)
{
    // WFX_RSI_LOG ("RSI:Disable IRQ");
    // NVIC_DisableIRQ(GPIO_ODD_IRQn);
    GPIO_IntDisable(1 << SL_WFX_HOST_PINOUT_SPI_IRQ);
}

/*===================================================*/
/**
 * @fn           void rsi_hal_intr_unmask(void)
 * @brief        Enables the SPI interrupt
 * @param[in]    none
 * @param[out]   none
 * @return       none
 * @description  This HAL API should contain the code to enable interrupts.
 */
void rsi_hal_intr_unmask(void)
{
    // Unmask/Enable the interrupt
    NVIC_EnableIRQ(GPIO_ODD_IRQn);
    NVIC_EnableIRQ(GPIO_EVEN_IRQn);
    GPIO_IntEnable(1 << SL_WFX_HOST_PINOUT_SPI_IRQ);
    // WFX_RSI_LOG ("RSI:Enable IRQ (mask=%x)", GPIO_IntGetEnabled ());
}

/*===================================================*/
/**
 * @fn           void rsi_hal_intr_clear(void)
 * @brief        Clears the pending interrupt
 * @param[in]    none
 * @param[out]   none
 * @return       none
 * @description  This HAL API should contain the code to clear the handled interrupts.
 */
void rsi_hal_intr_clear(void)
{
    GPIO_IntClear(1 << SL_WFX_HOST_PINOUT_SPI_IRQ);
}

/*===================================================*/
/**
 * @fn          void rsi_hal_intr_pin_status(void)
 * @brief       Checks the SPI interrupt at pin level
 * @param[in]   none
 * @param[out]  uint8_t, interrupt status
 * @return      none
 * @description This API is used to check interrupt pin status(pin level whether it is high/low).
 */
uint8_t rsi_hal_intr_pin_status(void)
{
    uint32_t mask;
    // Return interrupt pin  status(high(1) /low (0))
    mask = GPIO_PinInGet(WFX_INTERRUPT_PIN.port, WFX_INTERRUPT_PIN.pin);

    return !!mask;
}


text:
var express = require('express');
var app = express();
var request = require('request');
var bodyParser = require('body-parser');
var pg = require('pg');

var token = "EAAINjmZBbO3IBAPETswkn6IN47EMXRZBJWaLti70FuHLqyCma7edPhBYh8j7UekZC95fgNDtaTzehKUjZCZCZBkwMfYSWfFfL3wgjM5H9majnuZBuSjUbUx2Avf84fTHMcZA79mohADc5PZAK78Vh08QrBZANuvXCY6v4X0Ps2aZBZBAUgZDZD";
var uses = 0;

//connect to Database
pg.defaults.ssl = true;
pg.connect(process.env.DATABASE_URL, function(err, client) {
  if (err) throw err;
  console.log('Connected to postgres! Getting schemas...');

  client
    .query('SELECT table_schema,table_name FROM information_schema.tables;')
    .on('row', function(row) {
      console.log(JSON.stringify(row));
    });
});

//change to RB Tree */
var users = [];

app.use(bodyParser.json());

app.set('port', (process.env.PORT || 5000));

app.get('/', function (req, res) {
  res.send('Hello World!');
});

function sendTextMessage(sender, text) {
  uses++;

  messageData = {
    text:text
  }
  request({
    url: 'https://graph.facebook.com/v2.6/me/messages',
    qs: {access_token:token},
    method: 'POST',
    json: {
      recipient: {id:sender},
      message: messageData,
    }
  }, function(error, response, body) {
    if (error) {
      console.log('Error sending message: ', error);
    } else if (response.body.error) {
      console.log('Error: ', response.body.error);
    }
  });
}

function topStoryList() {

}
app.get('/webhook', function (req, res) {
  if (req.query['hub.verify_token'] === 'yolo__123__justin') {
    res.send(req.query['hub.challenge']);
  } else {
    res.send('Error, wrong validation token')
  }
});

app.post('/webhook/', function (req, res) {
  messaging_events = req.body.entry[0].messaging;
  for (i = 0; i < messaging_events.length; i++) {
    event = req.body.entry[0].messaging[i];
    sender = event.sender.id;
    if (event.message && event.message.text) {
      text = event.message.text;
      sendTextMessage(sender,text.substring(0, 200));
    }
  }
  res.sendStatus(200);
});

app.listen(app.get('port'), function() {
  console.log('Node app is running on port', app.get('port'));
});

process.on('uncaughtException', function (err) {
  console.log(err);
})


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using WebServiceStudio;
using WebServiceTestStudio.Model;
using WebServiceTestStudio.UserInterface;

namespace WebServiceTestStudio
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            WSSWebRequestCreate.RegisterPrefixes();
            TypeDescriptorModifier.modifyType(typeof(System.Dynamic.ExpandoObject));

            TestStudioFormBuilder formBuilder = TestStudioFormBuilder.Instance;
            TestStudioFormDesigner formDesigner = new TestStudioFormDesigner(formBuilder, true);
            var form = formBuilder.GetForm();

            Application.Run(form);

            GC.Collect();
            GC.WaitForPendingFinalizers();
            DeleteTempFiles();
        }

        static void DeleteTempFiles()
        {
            foreach (var file in Wsdl.tempfiles)
            {
                // Delete a file by using File class static method...
                if (System.IO.File.Exists(file))
                {
                    // Use a try block to catch IOExceptions, to
                    // handle the case of the file already being
                    // opened by another process.
                    try
                    {
                        System.IO.File.Delete(file);
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine(e.Message);
                    }
                }
            }
        }

    }
}


text:
A simple window based Blackjack game built in Visual Studio, using C#.

This program demonstrates reactive forms, MVC architecture, and an underlying library of objects representing the game components.

Rules:
The player competes against a computerized "House" player in a game of tradtional Blackjack. The program emulates a 52 card deck, with random shuffling occuring after the entire deck has been played. As is the case with most casino house players, the computer will stop asking for hitting after attaining a score of 17 or more.

The standard rules for Blackjack can be found [here](https://en.wikipedia.org/wiki/Blackjack).

![Game Screenshot](http://i.imgur.com/ubfA5XR.png "Game Screenshot")


text:
'use strict';

require('configureForRelayOSS');

const Relay = require('Relay');
const RelayConnectionInterface = require('RelayConnectionInterface');
const RelayQuery = require('RelayQuery');
const RelayTestUtils = require('RelayTestUtils');

const generateRQLFieldAlias = require('generateRQLFieldAlias');

describe('RelayQueryField', () => {
  var {getNode} = RelayTestUtils;

  let aliasedIdField;
  let cursorField;
  let edgesField;
  let friendsScalarField;
  let friendsConnectionField;
  let friendsVariableField;
  let generatedIdField;
  let generatedIdFieldRQL;
  let nodeField;
  let nodeIdField;
  let pageInfoField;
  let userAddressField;

  beforeEach(() => {
    jest.resetModuleRegistry();

    jasmine.addMatchers(RelayTestUtils.matchers);

    var scalarRQL = Relay.QL`
      fragment on Node {
        id
      }
    `;
    nodeIdField = getNode(scalarRQL).getChildren()[0];
    expect(nodeIdField.getSchemaName()).toBe('id');

    var query = getNode(Relay.QL`
      query {
        node(id:"4") {
          friends(first:"1") {
            edges {
              node {
                special_id: id,
              },
            },
          },
        }
      }
    `);
    friendsConnectionField = query.getChildren()[0];
    edgesField = friendsConnectionField.getChildren()[0];
    nodeField = edgesField.getChildren()[0];
    aliasedIdField =  nodeField.getChildren()[0];
    expect(aliasedIdField.getSchemaName()).toBe('id');

    var groupRQL = Relay.QL`
      fragment on User {
        address {
          city
        }
      }
    `;
    userAddressField = getNode(groupRQL).getChildren()[0];
    expect(userAddressField.getSchemaName()).toBe('address');

    var friendsScalarFieldRQL = Relay.QL`
      fragment on User {
        friend_scalar: friends
          (first:"10",after:"offset",orderby:"name") {
          edges {
            node {
              id
            }
          }
        }
      }
    `;
    friendsScalarField = getNode(friendsScalarFieldRQL).getChildren()[0];
    expect(friendsScalarField.getSchemaName()).toBe('friends');
    pageInfoField = getNode(friendsScalarFieldRQL)
      .getChildren()[0]
      .getChildren()[1];
    expect(pageInfoField.getSchemaName())
      .toBe(RelayConnectionInterface.PAGE_INFO);
    // feed.edges.cursor
    cursorField = getNode(friendsScalarFieldRQL)
      .getChildren()[0].getChildren()[0].getChildren()[1];
    expect(cursorField.getSchemaName()).toBe('cursor');

    var friendsVariableFieldRQL = Relay.QL`
      fragment on User {
        friends_variable: friends(first:$first,after:$after) {
          edges {
            node {
              id
            }
          }
        }
      }
    `;
    var variables = {
      after: 'offset',
      first: 10,
    };
    friendsVariableField =
      getNode(friendsVariableFieldRQL, variables).getChildren()[0];
    expect(friendsVariableField.getSchemaName()).toBe('friends');

    generatedIdFieldRQL = Relay.QL`
      fragment on User {
        name
      }
    `;
    generatedIdField = getNode(generatedIdFieldRQL).getChildren()[1];
    expect(generatedIdField.getSchemaName()).toBe('id');
  });

  it('returns the type', () => {
    var actor = getNode(Relay.QL`
      fragment on Viewer {
        actor {
          name
        }
      }
    `).getChildren()[0];
    expect(actor.getType()).toBe('Actor');
  });

  it('gets children by storage key', () => {
    var edges = friendsScalarField.getFieldByStorageKey('edges');
    expect(edges).toBe(friendsScalarField.getChildren()[0]);
  });

  it('gets children by field', () => {
    var edges = friendsScalarField.getFieldByStorageKey('edges');
    expect(edges).toBe(friendsScalarField.getChildren()[0]);
    var varFeedEdges = friendsVariableField.getField(edges);
    expect(varFeedEdges).toBe(friendsVariableField.getChildren()[0]);
  });

  it('equals the same fields', () => {
    expect(nodeIdField.equals(nodeIdField)).toBe(true);
    expect(userAddressField.equals(userAddressField)).toBe(true);
    expect(friendsScalarField.equals(friendsScalarField)).toBe(true);
    expect(friendsVariableField.equals(friendsVariableField)).toBe(true);
    expect(generatedIdField.equals(generatedIdField)).toBe(true);
    expect(pageInfoField.equals(pageInfoField)).toBe(true);
    expect(cursorField.equals(cursorField)).toBe(true);
  });

  it('equals equivalent fields', () => {
    var pictureScalarRQL = Relay.QL`
      fragment on User {
        profilePicture(size:"32")
      }
    `;
    var pictureScalar = getNode(pictureScalarRQL).getChildren()[0];
    var pictureVariableRQL = Relay.QL`
      fragment on User {
        profilePicture(size:$size)
      }
    `;
    var variables = {size: '32'};
    var pictureVariable =
      getNode(pictureVariableRQL,  variables).getChildren()[0];
    expect(pictureScalar.equals(pictureVariable)).toBe(true);

    var diffId = getNode(generatedIdFieldRQL).getChildren()[1];
    expect(generatedIdField.equals(diffId)).toBe(true);
  });

  it('does not equal fields with different values', () => {
    var pictureScalarRQL = Relay.QL`
      fragment on User {
        profilePicture(size:"32")
      }
    `;
    var pictureScalar = getNode(pictureScalarRQL).getChildren()[0];
    var pictureVariableRQL = Relay.QL`
      fragment on User {
        profilePicture(size:$size)
      }
    `;
    var pictureVariable =
      getNode(pictureVariableRQL, {size: '33'}).getChildren()[0];
    expect(pictureScalar.equals(pictureVariable)).toBe(false);
  });

  it('scalar fields have no children', () => {
    expect(nodeIdField.canHaveSubselections()).toBe(false);
    expect(nodeIdField.getChildren().length).toBe(0);
  });

  it('returns the same object when cloning a scalar field', () => {
    expect(nodeIdField.clone([])).toBe(nodeIdField);
  });

  it('clones with updated children', () => {
    var query = getNode(Relay.QL`
      fragment on Story {
        feedback {
          id,
          canViewerComment,
        }
      }
    `).getChildren()[0];
    var clone = query.clone([query.getChildren()[0]]);
    expect(clone.getChildren().length).toBe(1);
    expect(clone.getChildren()[0].getSchemaName()).toBe('id');
    expect(clone.getFieldByStorageKey('canViewerComment')).toBe(undefined);
  });

  it('throws if cloning a subselection-ineligible field with children', () => {
    const expectedError = (
      'RelayQueryNode: Cannot add children to field `id` because it does not ' +
      'support sub-selections (sub-fields).'
    );
    expect(() => {
      nodeIdField.clone([null]);
    }).toFailInvariant(expectedError);
    expect(() => {
      nodeIdField.cloneFieldWithCalls([null], []);
    }).toFailInvariant(expectedError);
  });

  it('returns children', () => {
    var children = userAddressField.getChildren();
    expect(children.length).toBe(1);
    expect(children[0].getSchemaName()).toBe('city');
  });

  it('return the same object when cloning with the same children', () => {
    var children = userAddressField.getChildren();
    var child = children[0];
    expect(userAddressField.clone(children)).toBe(userAddressField);
    expect(userAddressField.clone([child])).toBe(userAddressField);
    expect(userAddressField.clone([child, null])).toBe(userAddressField);
    expect(userAddressField.clone([null, child, null])).toBe(userAddressField);
  });

  it('returns a new object when cloning with different children', () => {
    expect(userAddressField.clone([nodeIdField])).not.toBe(userAddressField);
  });

  it('returns null when cloning without children', () => {
    expect(userAddressField.clone([])).toBe(null);
    expect(userAddressField.clone([null])).toBe(null);
    expect(userAddressField.cloneFieldWithCalls([], [])).toBe(null);
    expect(userAddressField.cloneFieldWithCalls([null], [])).toBe(null);
  });

  it('returns the schema/application names', () => {
    expect(friendsScalarField.getSchemaName()).toBe('friends');
    expect(friendsScalarField.getApplicationName()).toBe('friend_scalar');

    expect(friendsVariableField.getSchemaName()).toBe('friends');
    expect(friendsVariableField.getApplicationName()).toBe('friends_variable');
  });

  it('returns call types', () => {
    var field = getNode(
      Relay.QL`fragment on User{profilePicture(size:"32")}`
    ).getChildren()[0];
    field.getConcreteQueryNode().calls[0].metadata = {type: 'scalar'};

    expect(field.getCallType('size')).toBe('scalar');
    expect(field.getCallType('nonExistentCall')).toBe(undefined);
  });

  it('throws if a variable is missing', () => {
    var pictureFragment = Relay.QL`
      fragment on User {
        profilePicture(size:[$width,$height])
      }
    `;
    var variables = {};
    var pictureField = getNode(pictureFragment, variables).getChildren()[0];
    expect(() => pictureField.getCallsWithValues()).toFailInvariant(
      'callsFromGraphQL(): Expected a declared value for variable, `$width`.'
    );
  });

  it('permits null or undefined variable values', () => {
    var pictureFragment = Relay.QL`
      fragment on User {
        profilePicture(size:[$width,$height])
      }
    `;
    var variables = {
      width: null,
      height: undefined,
    };
    var pictureField = getNode(pictureFragment, variables).getChildren()[0];
    expect(pictureField.getCallsWithValues()).toEqual([
      {
        name: 'size',
        value: [
          null,
          undefined,
        ],
      },
    ]);
  });

  describe('canHaveSubselections()', () => {
    it('returns true for fields that support sub-selections', () => {
      expect(edgesField.canHaveSubselections()).toBe(true);
      expect(friendsConnectionField.canHaveSubselections()).toBe(true);
      expect(friendsScalarField.canHaveSubselections()).toBe(true);
      expect(friendsVariableField.canHaveSubselections()).toBe(true);
      expect(nodeField.canHaveSubselections()).toBe(true);
      expect(pageInfoField.canHaveSubselections()).toBe(true);
      expect(userAddressField.canHaveSubselections()).toBe(true);
    });

    it('returns false for fields that do not support sub-selections', () => {
      expect(aliasedIdField.canHaveSubselections()).toBe(false);
      expect(cursorField.canHaveSubselections()).toBe(false);
      expect(generatedIdField.canHaveSubselections()).toBe(false);
      expect(nodeIdField.canHaveSubselections()).toBe(false);
    });
  });

  describe('getRangeBehaviorKey()', () => {
    it('strips range calls on connections', () => {
      var connectionField = getNode(
        Relay.QL`fragment on User { friends(first:"10",isViewerFriend:true) }`
      ).getChildren()[0];
      expect(connectionField.getRangeBehaviorKey())
        .toBe('isViewerFriend(true)');
    });

    it('throws for non-connection fields', () => {
      var nonConnectionField = getNode(
        Relay.QL`query { node(id:"4") }`
      ).getChildren()[0];
      expect(nonConnectionField.getRangeBehaviorKey).toThrow();
    });

    it('strips passing `if` calls', () => {
      var ifTrue = getNode(
        Relay.QL`fragment on User { friends(if:true) }`
      ).getChildren()[0];
      expect(ifTrue.getRangeBehaviorKey()).toBe('');

      var ifFalse = getNode(
        Relay.QL`fragment on User { friends(if:false) }`
      ).getChildren()[0];
      expect(ifFalse.getRangeBehaviorKey()).toBe('if(false)');
    });

    it('strips failing `unless` calls', () => {
      var unlessTrue = getNode(
        Relay.QL`fragment on User { friends(unless:true) }`
      ).getChildren()[0];
      expect(unlessTrue.getRangeBehaviorKey()).toBe('unless(true)');

      var unlessFalse = getNode(Relay.QL`
        fragment on User {
          friends(unless:false)
        }
      `).getChildren()[0];
      expect(unlessFalse.getRangeBehaviorKey()).toBe('');
    });

    it('substitutes variable values', () => {
      var key = 'isViewerFriend(false)';
      var friendsScalarRQL = Relay.QL`
        fragment on User { friends(isViewerFriend:false) }
      `;
      var friendsScalar = getNode(friendsScalarRQL).getChildren()[0];
      expect(friendsScalar.getRangeBehaviorKey()).toBe(key);

      var friendsVariableRQL = Relay.QL`
        fragment on User { friends(isViewerFriend:$isViewerFriend) }
      `;
      var variables = {isViewerFriend: false};
      var friendsVariable =
        getNode(friendsVariableRQL, variables).getChildren()[0];
      expect(friendsVariable.getRangeBehaviorKey()).toBe(key);
    });

    it('produces stable keys regardless of argument order', () => {
      var friendFieldA = getNode(Relay.QL`fragment on User {
        friends(orderby: "name", isViewerFriend: true)
      }`).getChildren()[0];
      var friendFieldB = getNode(Relay.QL`fragment on User {
        friends(isViewerFriend: true, orderby: "name")
      }`).getChildren()[0];
      const expectedKey = 'isViewerFriend(true).orderby(name)';
      expect(friendFieldA.getRangeBehaviorKey()).toBe(expectedKey);
      expect(friendFieldB.getRangeBehaviorKey()).toBe(expectedKey);
    });
  });

  describe('getSerializationKey()', () => {
    it('serializes all calls', () => {
      expect(friendsScalarField.getSerializationKey()).toBe(
        generateRQLFieldAlias('friends.after(offset).first(10).orderby(name)')
      );
    });

    it('substitutes variable values', () => {
      var key = generateRQLFieldAlias('profilePicture.size(32,64)');
      var pictureScalarRQL = Relay.QL`
        fragment on User {
          profilePicture(size:["32","64"])
        }
      `;
      var pictureScalar = getNode(pictureScalarRQL).getChildren()[0];
      expect(pictureScalar.getSerializationKey()).toBe(key);

      var pictureVariableRQL = Relay.QL`
        fragment on User {
          profilePicture(size:[$width,$height])
        }
      `;
      var variables = {
        height: 64,
        width: 32,
      };
      var pictureVariable =
        getNode(pictureVariableRQL, variables).getChildren()[0];
      expect(pictureVariable.getSerializationKey()).toBe(key);
    });
  });

  describe('getShallowHash()', () => {
    it('serializes all calls', () => {
      expect(friendsScalarField.getShallowHash()).toBe(
        'friends{after:"offset",first:"10",orderby:"name"}'
      );
    });

    it('serializes argument literal values', () => {
      var node = getNode(Relay.QL`
        fragment on User {
          profilePicture(size: ["32", "64"])
        }
      `);
      expect(node.getChildren()[0].getShallowHash()).toBe(
        'profilePicture{size:[0:"32",1:"64"]}'
      );
    });

    it('serializes argument variable values', () => {
      var node = getNode(Relay.QL`
        fragment on User {
          profilePicture(size: [$width, $height])
        }
      `, {
        width: 32,
        height: 64,
      });
      expect(node.getChildren()[0].getShallowHash()).toBe(
        'profilePicture{size:[0:32,1:64]}'
      );
    });
  });

  describe('getStorageKey()', () => {
    it('strips range calls on connections', () => {
      var connectionField = getNode(Relay.QL`
        fragment on User {
          friends(first:"10",isViewerFriend:true) {
            edges { node { id } }
          }
        }
      `).getChildren()[0];
      expect(connectionField.getStorageKey())
        .toBe('friends{isViewerFriend:true}');
    });

    it('preserves range-like calls on non-connections', () => {
      // NOTE: `segments.edges.node` is scalar.
      var nonConnectionField = getNode(Relay.QL`
        fragment on Node {
          segments(first:"3") {
            edges { node }
          }
        }
      `).getChildren()[0];
      expect(nonConnectionField.getStorageKey()).toBe('segments{first:"3"}');
    });

    it('strips passing `if` calls', () => {
      var ifTrue = getNode(Relay.QL`
        fragment on Node {
          firstName(if:true)
        }
      `).getChildren()[0];
      expect(ifTrue.getStorageKey()).toBe('firstName');

      var ifFalse = getNode(Relay.QL`
        fragment on Node {
          firstName(if:false)
        }
      `).getChildren()[0];
      expect(ifFalse.getStorageKey()).toBe('firstName{if:false}');
    });

    it('strips failing `unless` calls', () => {
      var unlessTrue = getNode(Relay.QL`
        fragment on Node{
          firstName(unless:true)
        }
      `).getChildren()[0];
      expect(unlessTrue.getStorageKey()).toBe('firstName{unless:true}');

      var unlessFalse = getNode(Relay.QL`
        fragment on Node{
          firstName(unless:false)
        }
      `).getChildren()[0];
      expect(unlessFalse.getStorageKey()).toBe('firstName');
    });

    it('substitutes variable values', () => {
      var key = 'profilePicture{size:[0:"32",1:"64"]}';
      var pictureScalarRQL = Relay.QL`
        fragment on User {
          profilePicture(size:["32","64"])
        }
      `;
      var pictureScalar = getNode(pictureScalarRQL).getChildren()[0];
      expect(pictureScalar.getStorageKey()).toBe(key);

      var pictureVariableRQL = Relay.QL`
        fragment on User {
          profilePicture(size:[$width,$height])
        }
      `;
      var variables = {
        height: '64',
        width: '32',
      };
      var pictureVariable =
        getNode(pictureVariableRQL, variables).getChildren()[0];
      expect(pictureVariable.getStorageKey()).toBe(key);
    });

    it('produces stable keys regardless of argument order', () => {
      var pictureFieldA = getNode(Relay.QL`fragment on User {
        profilePicture(size: "32", preset: SMALL)
      }`).getChildren()[0];
      var pictureFieldB = getNode(Relay.QL`fragment on User {
        profilePicture(preset: SMALL, size: "32")
      }`).getChildren()[0];
      const expectedKey = 'profilePicture{preset:"SMALL",size:"32"}';
      expect(pictureFieldA.getStorageKey()).toBe(expectedKey);
      expect(pictureFieldB.getStorageKey()).toBe(expectedKey);
    });
  });

  it('returns arguments with values', () => {
    // scalar values are converted to strings
    expect(friendsScalarField.getCallsWithValues()).toEqual([
      {name: 'first', value: '10'},
      {name: 'after', value: 'offset'},
      {name: 'orderby', value: 'name'},
    ]);
    // variables return their values
    expect(friendsVariableField.getCallsWithValues()).toEqual([
      {name: 'first', value: 10},
      {name: 'after', value: 'offset'},
    ]);

    var pictureScalarRQL = Relay.QL`
      fragment on User {
        profilePicture(size:["32","64"])
      }
    `;
    var pictureScalar = getNode(pictureScalarRQL).getChildren()[0];
    expect(pictureScalar.getCallsWithValues()).toEqual([
      {name: 'size', value: ['32', '64']},
    ]);

    var pictureVariableRQL = Relay.QL`
      fragment on User {
        profilePicture(size:[$width,$height])
      }
    `;
    var variables = {
      height: '64',
      width: 32,
    };
    var pictureVariable =
      getNode(pictureVariableRQL, variables).getChildren()[0];
    expect(pictureVariable.getCallsWithValues()).toEqual([
      {name: 'size', value: [32, '64']},
    ]);
  });

  it('returns arguments with array values', () => {
    var variables = {vanities: ['a', 'b', 'c']};
    var usernamesQuery = getNode(Relay.QL`
      query {
        usernames(names:$vanities) {
          id
        }
      }
    `, variables);
    expect(usernamesQuery.getIdentifyingArg()).toEqual(
      {name: 'names', value: ['a', 'b', 'c']}
    );
  });

  it('clones with different call values', () => {
    var clonedFeed = friendsVariableField.cloneFieldWithCalls(
      friendsVariableField.getChildren(),
      [{name: 'first', value: 25}]
    );
    expect(clonedFeed.getSchemaName()).toBe('friends');
    expect(clonedFeed.getCallsWithValues()).toEqual([
      {name: 'first', value: 25},
    ]);
    expect(clonedFeed.getSerializationKey()).toEqual(
      generateRQLFieldAlias('friends.first(25)')
    );
    expect(clonedFeed.getStorageKey()).toEqual('friends');

    clonedFeed = friendsVariableField.cloneFieldWithCalls(
      friendsVariableField.getChildren(),
      [
        {name: 'first', value: 10},
        {name: 'after', value: 'offset'},
      ]
    );
    expect(clonedFeed).toBe(friendsVariableField);
  });

  it('returns isAbstract', () => {
    expect(getNode(Relay.QL`
      fragment on Viewer {
        actor {
          name
        }
      }
    `).getFieldByStorageKey('actor').isAbstract()).toBe(true);
    expect(getNode(Relay.QL`
      fragment on User {
        address {
          city
        }
      }
    `).getFieldByStorageKey('address').isAbstract()).toBe(false);
  });

  it('returns isGenerated', () => {
    expect(aliasedIdField.isGenerated()).toBe(false);
    expect(cursorField.isGenerated()).toBe(true);
    expect(userAddressField.isGenerated()).toBe(false);
    expect(generatedIdField.isGenerated()).toBe(true);
    expect(nodeIdField.isGenerated()).toBe(false);
    expect(pageInfoField.isGenerated()).toBe(true);
  });

  it('returns isRefQueryDependency', () => {
    // Not ref query dependencies:
    expect(aliasedIdField.isRefQueryDependency()).toBe(false);
    expect(cursorField.isRefQueryDependency()).toBe(false);
    expect(userAddressField.isRefQueryDependency()).toBe(false);
    expect(generatedIdField.isRefQueryDependency()).toBe(false);
    expect(nodeIdField.isRefQueryDependency()).toBe(false);
    expect(pageInfoField.isRefQueryDependency()).toBe(false);

    // Pretend some of them are ref query dependencies:
    expect(aliasedIdField.cloneAsRefQueryDependency().isRefQueryDependency())
      .toBe(true);
    expect(cursorField.cloneAsRefQueryDependency().isRefQueryDependency())
      .toBe(true);
    expect(generatedIdField.cloneAsRefQueryDependency().isRefQueryDependency())
      .toBe(true);
    expect(nodeIdField.cloneAsRefQueryDependency().isRefQueryDependency())
      .toBe(true);
    expect(pageInfoField.cloneAsRefQueryDependency().isRefQueryDependency())
      .toBe(true);
  });

  it('returns isRequisite', () => {
    expect(aliasedIdField.isRequisite()).toBe(true);
    expect(cursorField.isRequisite()).toBe(true);
    expect(userAddressField.isRequisite()).toBe(false);
    expect(generatedIdField.isRequisite()).toBe(true);
    expect(nodeIdField.isRequisite()).toBe(true);
    expect(pageInfoField.isRequisite()).toBe(true);
  });

  it('returns isFindable', () => {
    expect(nodeIdField.isFindable()).toBe(false);
    expect(friendsScalarField.isFindable()).toBe(true);
    expect(userAddressField.isFindable()).toBe(false);
  });

  it('returns the inferred primary key', () => {
    var field = getNode(Relay.QL`fragment on Story{feedback}`).getChildren()[0];
    expect(field.getInferredPrimaryKey()).toBe('id');

    expect(friendsScalarField.getInferredPrimaryKey()).toBe(undefined);
  });

  it('returns the inferred root call name', () => {
    var field = getNode(Relay.QL`fragment on Story{feedback}`).getChildren()[0];
    expect(field.getInferredRootCallName()).toBe('node');

    expect(friendsScalarField.getInferredRootCallName()).toBe(undefined);
  });

  it('creates nodes', () => {
    var fragmentRQL = Relay.QL`
      fragment on FeedUnit {
        actorCount
      }
    `;
    var node = nodeIdField.createNode(fragmentRQL);
    expect(node instanceof RelayQuery.Fragment).toBe(true);
    expect(node.getType()).toBe('FeedUnit');
    expect(node.getRoute()).toBe(nodeIdField.getRoute());
    expect(node.getVariables()).toBe(nodeIdField.getVariables());
    expect(node.getFieldByStorageKey('actorCount').getType()).toBe('Int');
  });

  it('returns directives', () => {
    var field = getNode(Relay.QL`
      fragment on Story {
        feedback @include(if: $cond)
      }
    `, {cond: true}).getChildren()[0];
    expect(field.getDirectives()).toEqual([
      {
        args: [
          {name: 'if', value: true},
        ],
        name: 'include',
      },
    ]);
  });
});


text:
'use strict';

var React = require('react-native');
var {
  AppRegistry,
  BackAndroid,
  Navigator,
  ToolbarAndroid,
  Image,
  ListView,
  StyleSheet,
  Text,
  View,
  PixelRatio,
  TouchableHighlight,
  ProgressBarAndroid,
  Alert,
  PullToRefreshViewAndroid
} = React;

var REQUEST_URL = 'http://busintime.id:6001/';
var dismissKeyboard = require('dismissKeyboard');

var ArticleListScreen = React.createClass({
  getInitialState: function() {
    return {
      dataSource: new ListView.DataSource({
        rowHasChanged: (row1, row2) => row1 !== row2,
      }),
      data: [],
      loaded: false,
      isLoadingTail: false,
      isRefreshing: false,
      page: 1,
    };
  },
  getDefaultProps: function() {
    return {
      category: 'featured'
    };
  },
  fetchData: function(page) {
    var url = REQUEST_URL + this.props.category;
    if (page)
      url += '?page=' + page;
    return fetch(url);
  },
  selectArticle: function(slug, title) {
    dismissKeyboard();
    this.props.navigator.push({
      title: title,
      slug: slug,
      name: 'article',
    });
  },
  onRefresh: function() {
    this.setState({isRefreshing: true});
    this.fetchData()
      .then((response) => response.json())
      .then((responseData) => {
        this.setState({
          dataSource: this.state.dataSource.cloneWithRows(responseData),
          loaded: true,
          data: responseData,
          page: this.state.page+1,
          isRefreshing: false,
        });
      })
      .catch(function(ex) {
        Alert.alert('Ziliun', 'Failed to load article');
      })
      .done();
  },
  componentDidMount: function() {
    this.onRefresh();
  },
  renderArticle: function(article) {
    return (
      <TouchableHighlight
          underlayColor="#dddddd"
          onPress={() => this.selectArticle(article.slug, article.title)}>
          <View style={styles.container}>
            <Image
              source={{uri: article.image}}
              style={styles.thumbnail}
            />
            <View style={styles.rightContainer}>
              <Text style={styles.title}>{article.title}</Text>
            </View>
          </View>
      </TouchableHighlight>
    );
  },
  renderLoadingView: function() {
    return (
      <View style={{flex: 1, flexDirection: 'column', alignItems: 'center', justifyContent: 'center'}}>
        <ProgressBarAndroid styleAttr="Small"/>
        <Text style={{textAlign: 'center'}}>
          Loading articles...
        </Text>
      </View>
    )
  },
  renderFooter: function() {
    return (
      <View  style={{alignItems: 'center', padding: 10}}>
        <ProgressBarAndroid styleAttr="Small"/>
      </View>
    );
  },
  onEndReached: function() {
    // if (!this.hasMore() || this.state.isLoadingTail) {
    //   // We're already fetching or have all the elements so noop
    //   return;
    // }

    this.setState({
      isLoadingTail: true,
    });

    this.fetchData(this.state.page)
      .then((response) => response.json())
      .then((responseData) => {
        var data = this.state.data.concat(responseData);
        this.setState({
          dataSource: this.state.dataSource.cloneWithRows(data),
          data: data,
          isLoadingTail: false,
          page: this.state.page+1,
        });
      })
      .catch(function(ex) {
        Alert.alert('Ziliun', 'Failed to load article');
      })
      .done();
  },
  render: function() {
    if (!this.state.loaded) {
      return this.renderLoadingView();
    }

    return (
      <PullToRefreshViewAndroid
        style={{flex: 1}}
        refreshing={this.state.isRefreshing}
        onRefresh={this.onRefresh}
        colors={['#f7913d', '#f7913d', '#f7913d']}
        progressBackgroundColor={'#fff'}
        >
        <ListView
          dataSource={this.state.dataSource}
          renderRow={this.renderArticle}
          style={styles.listView}
          renderFooter={this.renderFooter}
          onEndReached={this.onEndReached}
        />
      </PullToRefreshViewAndroid>
    );

  }
});

var styles = StyleSheet.create({
  container: {
    flex: 1,
    flexDirection: 'column',
    justifyContent: 'center',
    alignItems: 'stretch',
    backgroundColor: '#F5FCFF',
  },
  rightContainer: {
    position: 'absolute',
    padding: 20,
    paddingTop: 10,
    paddingBottom: 10,
    bottom: 0,
    left: 0,
    flex: 1,
    backgroundColor: 'rgba(0,0,0,0.5)',
  },
  title: {
    fontSize: 12,
    marginBottom: 8,
    textAlign: 'left',
    color: 'white'
  },
  description: {
    fontSize: 9,
    textAlign: 'left',
  },
  thumbnail: {
    flex: 1,
    height: 140,
  },
  listView: {
    backgroundColor: '#F5FCFF',
  },
});

module.exports = ArticleListScreen;


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>hazelcast</groupId>
    <artifactId>hazelcast-consul</artifactId>
    <version>0.0.1</version>
    <packaging>jar</packaging>

    <parent>
        <groupId>com.hazelcast</groupId>
        <artifactId>hazelcast-root</artifactId>
        <version>3.5-SNAPSHOT</version>
    </parent>

    <name>hazelcast-consul</name>
    <url>https://github.com/decooman/hazelcast-consul</url>

    <developers>
        <developer>
            <name>Jan De Cooman</name>
            <email>jan_decooman@yahoo.com</email>
        </developer>
        <developer>
            <name>Guiquan Weng</name>
            <email>weng.guiquan@gmail.com</email>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
        <encoding>UTF-8</encoding>
    </properties>

    <repositories>
        <repository>
            <id>sonatype-nexus-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/releases</url>
        </repository>
        <repository>
            <id>bintray</id>
            <url>http://jcenter.bintray.com/</url>
        </repository>
        <repository>
            <id>mvnrepository</id>
            <url>http://repo1.maven.org/maven2</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>com.hazelcast</groupId>
            <artifactId>hazelcast</artifactId>
            <version>${project.parent.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.hazelcast</groupId>
            <artifactId>hazelcast</artifactId>
            <scope>test</scope>
            <version>${project.parent.version}</version>
            <classifier>tests</classifier>
        </dependency>
        <dependency>
            <groupId>com.orbitz.consul</groupId>
            <artifactId>consul-client</artifactId>
            <version>0.8</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>


text:
package pl.warsjawa.loan;

public final class UiApi {
    public static final String API_URL = "/api" ;
    public static final String APPLICATION = "application";
    public static final String UI_NAME = "vnd.pl.warsjawa.ui";
    public static final String JSON_V1 = ".v1+json";
    public static final String UI_JSON_V1 = UI_NAME + JSON_V1;

    public static final String UI_API_VERSION_1 = APPLICATION + "/" + UI_JSON_V1;
    public static final String LOAN_APPLICATION_ROOT_URL = "loanApplication";

    public static final String FRAUD_NAME = "vnd.pl.warsjawa.fraud-detection-service";
    public static final String FRAUD_JSON_V1 = FRAUD_NAME + JSON_V1;
    public static final String FRAUD_API_VERSION_1 = APPLICATION + "/" + FRAUD_JSON_V1;
    public static final String FRAUD_LOAN_APPLICATION_URL = API_URL + "/" + LOAN_APPLICATION_ROOT_URL + "/{loanApplicationId}";

    public static final String CLIENTS_JSON = "application/json";
    public static final String CLIENTS_SERVICE_URL = "/clients";
}