text:
import { Component } from '@angular/core';
import { MovieService } from '../../services/movie.service';

@Component({
  moduleId: module.id,
  selector: 'movies',
  templateUrl: 'movies.component.html',
})
export class MoviesComponent  {

  popularList:Array<Object>;
  theatersList:Array<Object>;
  searchStr:string;
  searchRes:Array<Object>;

  constructor(private _movieService:MovieService){
    this._movieService.getPopular().subscribe(res => {
      this.popularList = res.results;
    });

    this._movieService.getInTheaters().subscribe(res => {
          this.theatersList = res.results;
        });
  }

  searchMovies(){
     this._movieService.searchMovies(this.searchStr).subscribe(res =>{
      this.searchRes = res.results;
     });
  }
}

redpajama_set_name: RedPajamaGithub


text:
These scaled images should have their text scaled too.

.. image:: test_issue_244.svg
    :width: 5cm

.. image:: test_issue_244.svg
    :width: 10cm


text: Various VHDL instances


text:
package com.icesecret.web;

import com.alibaba.fastjson.JSON;
import com.icesecret.domain.Test;
import com.icesecret.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by liucl on 16/8/27.
 */
@RestController
@EnableAutoConfiguration
public class TestController {
    @Autowired
    private TestService sysConfigService;
    @RequestMapping(value="/test")
    public String test(){
        try {
            Thread.sleep(10);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        //JedisUtil.set("test","hahah");

        //System.out.println(JedisUtil.get("test"));
        return "hello world";
    }
    @GetMapping(value="/page")
    public String page(){
        return "page";
    }

    @RequestMapping(value="/dao",method = RequestMethod.GET)
    public String dao(@RequestParam("id") int id){
        Test test=sysConfigService.select(id);
        return JSON.toJSONString(test);
    }
}


text:
import sys
import unittest
import libsbml

class TestXMLError(unittest.TestCase):

  def test_XMLError_create(self):
    error = libsbml.XMLError()
    self.assert_( error != None )
    error = None
    error = libsbml.XMLError(libsbml.DuplicateXMLAttribute)
    self.assert_( error.getErrorId() == libsbml.DuplicateXMLAttribute )
    self.assert_( error.getSeverity() == libsbml.LIBSBML_SEV_ERROR )
    self.assert_( error.getSeverityAsString() ==  "Error"  )
    self.assert_( error.getCategory() == libsbml.LIBSBML_CAT_XML )
    self.assert_( error.getCategoryAsString() ==  "XML content" )
    self.assert_( error.getMessage() ==  "Duplicate XML attribute."  )
    self.assert_( error.getShortMessage() ==  "Duplicate attribute"  )
    error = None
    error = libsbml.XMLError(12345, "My message")
    self.assert_( error.getErrorId() == 12345 )
    self.assert_( error.getMessage() ==  "My message"  )
    self.assert_( error.getSeverity() == libsbml.LIBSBML_SEV_FATAL )
    self.assert_( error.getSeverityAsString() ==  "Fatal"  )
    self.assert_( error.getCategory() == libsbml.LIBSBML_CAT_INTERNAL )
    self.assert_( error.getCategoryAsString() ==  "Internal" )
    error = None
    error = libsbml.XMLError(12345, "My message",0,0,libsbml.LIBSBML_SEV_INFO,libsbml.LIBSBML_CAT_SYSTEM)
    self.assert_( error.getErrorId() == 12345 )
    self.assert_( error.getMessage() ==  "My message"  )
    self.assert_( error.getSeverity() == libsbml.LIBSBML_SEV_INFO )
    self.assert_( error.getSeverityAsString() ==  "Informational"  )
    self.assert_( error.getCategory() == libsbml.LIBSBML_CAT_SYSTEM )
    self.assert_( error.getCategoryAsString() ==  "Operating system" )
    self.assertEqual( True, error.isInfo() )
    self.assertEqual( True, error.isSystem() )
    error = None
    error = libsbml.XMLError(10000, "Another message",0,0,libsbml.LIBSBML_SEV_FATAL,libsbml.LIBSBML_CAT_XML)
    self.assert_( error.getErrorId() == 10000 )
    self.assert_( error.getMessage() ==  "Another message"  )
    self.assert_( error.getSeverity() == libsbml.LIBSBML_SEV_FATAL )
    self.assert_( error.getSeverityAsString() ==  "Fatal"  )
    self.assert_( error.getCategory() == libsbml.LIBSBML_CAT_XML )
    self.assert_( error.getCategoryAsString() ==  "XML content" )
    self.assertEqual( True, error.isFatal() )
    self.assertEqual( True, error.isXML() )
    error = None
    pass

  def test_XMLError_setters(self):
    error = libsbml.XMLError()
    self.assert_( error != None )
    i = error.setLine(23)
    self.assert_( i == libsbml.LIBSBML_OPERATION_SUCCESS )
    self.assert_( error.getLine() == 23 )
    i = error.setColumn(45)
    self.assert_( i == libsbml.LIBSBML_OPERATION_SUCCESS )
    self.assert_( error.getColumn() == 45 )
    error = None
    pass

def suite():
  suite = unittest.TestSuite()
  suite.addTest(unittest.makeSuite(TestXMLError))

  return suite

if __name__ == "__main__":
  if unittest.TextTestRunner(verbosity=1).run(suite()).wasSuccessful() :
    sys.exit(0)
  else:
    sys.exit(1)


text:
package de.lessvoid.nifty.input.keyboard;

/**
 * A Keyboard Input Event.
 * @author void
 */
public class KeyboardInputEvent {
  public static final int KEY_NONE            = 0x00;

  public static final int KEY_ESCAPE          = 0x01;
  public static final int KEY_1               = 0x02;
  public static final int KEY_2               = 0x03;
  public static final int KEY_3               = 0x04;
  public static final int KEY_4               = 0x05;
  public static final int KEY_5               = 0x06;
  public static final int KEY_6               = 0x07;
  public static final int KEY_7               = 0x08;
  public static final int KEY_8               = 0x09;
  public static final int KEY_9               = 0x0A;
  public static final int KEY_0               = 0x0B;
  public static final int KEY_MINUS           = 0x0C; /* - on main keyboard */
  public static final int KEY_EQUALS          = 0x0D;
  public static final int KEY_BACK            = 0x0E; /* backspace */
  public static final int KEY_TAB             = 0x0F;
  public static final int KEY_Q               = 0x10;
  public static final int KEY_W               = 0x11;
  public static final int KEY_E               = 0x12;
  public static final int KEY_R               = 0x13;
  public static final int KEY_T               = 0x14;
  public static final int KEY_Y               = 0x15;
  public static final int KEY_U               = 0x16;
  public static final int KEY_I               = 0x17;
  public static final int KEY_O               = 0x18;
  public static final int KEY_P               = 0x19;
  public static final int KEY_LBRACKET        = 0x1A;
  public static final int KEY_RBRACKET        = 0x1B;
  public static final int KEY_RETURN          = 0x1C; /* Enter on main keyboard */
  public static final int KEY_LCONTROL        = 0x1D;
  public static final int KEY_A               = 0x1E;
  public static final int KEY_S               = 0x1F;
  public static final int KEY_D               = 0x20;
  public static final int KEY_F               = 0x21;
  public static final int KEY_G               = 0x22;
  public static final int KEY_H               = 0x23;
  public static final int KEY_J               = 0x24;
  public static final int KEY_K               = 0x25;
  public static final int KEY_L               = 0x26;
  public static final int KEY_SEMICOLON       = 0x27;
  public static final int KEY_APOSTROPHE      = 0x28;
  public static final int KEY_GRAVE           = 0x29; /* accent grave */
  public static final int KEY_LSHIFT          = 0x2A;
  public static final int KEY_BACKSLASH       = 0x2B;
  public static final int KEY_Z               = 0x2C;
  public static final int KEY_X               = 0x2D;
  public static final int KEY_C               = 0x2E;
  public static final int KEY_V               = 0x2F;
  public static final int KEY_B               = 0x30;
  public static final int KEY_N               = 0x31;
  public static final int KEY_M               = 0x32;
  public static final int KEY_COMMA           = 0x33;
  public static final int KEY_PERIOD          = 0x34; /* . on main keyboard */
  public static final int KEY_SLASH           = 0x35; /* / on main keyboard */
  public static final int KEY_RSHIFT          = 0x36;
  public static final int KEY_MULTIPLY        = 0x37; /* * on numeric keypad */
  public static final int KEY_LMENU           = 0x38; /* left Alt */
  public static final int KEY_SPACE           = 0x39;
  public static final int KEY_CAPITAL         = 0x3A;
  public static final int KEY_F1              = 0x3B;
  public static final int KEY_F2              = 0x3C;
  public static final int KEY_F3              = 0x3D;
  public static final int KEY_F4              = 0x3E;
  public static final int KEY_F5              = 0x3F;
  public static final int KEY_F6              = 0x40;
  public static final int KEY_F7              = 0x41;
  public static final int KEY_F8              = 0x42;
  public static final int KEY_F9              = 0x43;
  public static final int KEY_F10             = 0x44;
  public static final int KEY_NUMLOCK         = 0x45;
  public static final int KEY_SCROLL          = 0x46; /* Scroll Lock */
  public static final int KEY_NUMPAD7         = 0x47;
  public static final int KEY_NUMPAD8         = 0x48;
  public static final int KEY_NUMPAD9         = 0x49;
  public static final int KEY_SUBTRACT        = 0x4A; /* - on numeric keypad */
  public static final int KEY_NUMPAD4         = 0x4B;
  public static final int KEY_NUMPAD5         = 0x4C;
  public static final int KEY_NUMPAD6         = 0x4D;
  public static final int KEY_ADD             = 0x4E; /* + on numeric keypad */
  public static final int KEY_NUMPAD1         = 0x4F;
  public static final int KEY_NUMPAD2         = 0x50;
  public static final int KEY_NUMPAD3         = 0x51;
  public static final int KEY_NUMPAD0         = 0x52;
  public static final int KEY_DECIMAL         = 0x53; /* . on numeric keypad */
  public static final int KEY_F11             = 0x57;
  public static final int KEY_F12             = 0x58;
  public static final int KEY_F13             = 0x64; /*                     (NEC PC98) */
  public static final int KEY_F14             = 0x65; /*                     (NEC PC98) */
  public static final int KEY_F15             = 0x66; /*                     (NEC PC98) */
  public static final int KEY_KANA            = 0x70; /* (Japanese keyboard)            */
  public static final int KEY_CONVERT         = 0x79; /* (Japanese keyboard)            */
  public static final int KEY_NOCONVERT       = 0x7B; /* (Japanese keyboard)            */
  public static final int KEY_YEN             = 0x7D; /* (Japanese keyboard)            */
  public static final int KEY_NUMPADEQUALS    = 0x8D; /* = on numeric keypad (NEC PC98) */
  public static final int KEY_CIRCUMFLEX      = 0x90; /* (Japanese keyboard)            */
  public static final int KEY_AT              = 0x91; /*                     (NEC PC98) */
  public static final int KEY_COLON           = 0x92; /*                     (NEC PC98) */
  public static final int KEY_UNDERLINE       = 0x93; /*                     (NEC PC98) */
  public static final int KEY_KANJI           = 0x94; /* (Japanese keyboard)            */
  public static final int KEY_STOP            = 0x95; /*                     (NEC PC98) */
  public static final int KEY_AX              = 0x96; /*                     (Japan AX) */
  public static final int KEY_UNLABELED       = 0x97; /*                        (J3100) */
  public static final int KEY_NUMPADENTER     = 0x9C; /* Enter on numeric keypad */
  public static final int KEY_RCONTROL        = 0x9D;
  public static final int KEY_NUMPADCOMMA     = 0xB3; /* , on numeric keypad (NEC PC98) */
  public static final int KEY_DIVIDE          = 0xB5; /* / on numeric keypad */
  public static final int KEY_SYSRQ           = 0xB7;
  public static final int KEY_RMENU           = 0xB8; /* right Alt */
  public static final int KEY_PAUSE           = 0xC5; /* Pause */
  public static final int KEY_HOME            = 0xC7; /* Home on arrow keypad */
  public static final int KEY_UP              = 0xC8; /* UpArrow on arrow keypad */
  public static final int KEY_PRIOR           = 0xC9; /* PgUp on arrow keypad */
  public static final int KEY_LEFT            = 0xCB; /* LeftArrow on arrow keypad */
  public static final int KEY_RIGHT           = 0xCD; /* RightArrow on arrow keypad */
  public static final int KEY_END             = 0xCF; /* End on arrow keypad */
  public static final int KEY_DOWN            = 0xD0; /* DownArrow on arrow keypad */
  public static final int KEY_NEXT            = 0xD1; /* PgDn on arrow keypad */
  public static final int KEY_INSERT          = 0xD2; /* Insert on arrow keypad */
  public static final int KEY_DELETE          = 0xD3; /* Delete on arrow keypad */
  public static final int KEY_LMETA            = 0xDB; /* Left Windows/Option key */
  /**
   * The left windows key, mapped to KEY_LMETA
   *
   * @deprecated Use KEY_LMETA instead
   */
  @Deprecated
  public static final int KEY_LWIN            = KEY_LMETA; /* Left Windows key */
  public static final int KEY_RMETA            = 0xDC; /* Right Windows/Option key */
  /**
   * The right windows key, mapped to KEY_RMETA
   *
   * @deprecated Use KEY_RMETA instead
   */
  @Deprecated
  public static final int KEY_RWIN            = KEY_RMETA; /* Right Windows key */
  public static final int KEY_APPS            = 0xDD; /* AppMenu key */
  public static final int KEY_POWER           = 0xDE;
  public static final int KEY_SLEEP           = 0xDF;

  /**
   * key.
   */
  private int key;

  /**
   * character.
   */
  private char character;

  /**
   * keyDown.
   */
  private boolean keyDown;

  /**
   * shiftDown.
   */
  private boolean shiftDown;

  /**
   * controlDown.
   */
  private boolean controlDown;

  /**
   * create the event.
   * @param newKey key
   * @param newCharacter character
   * @param newKeyDown keyDown
   * @param newShiftDown shiftDown
   * @param newControlDown controlDown
   */
  public KeyboardInputEvent(
      final int newKey,
      final char newCharacter,
      final boolean newKeyDown,
      final boolean newShiftDown,
      final boolean newControlDown) {
    this.key = newKey;
    this.character = newCharacter;
    this.keyDown = newKeyDown;
    this.shiftDown = newShiftDown;
    this.controlDown = newControlDown;
  }

  /**
   * @return the key
   */
  public int getKey() {
    return key;
  }

  /**
   * @return the character
   */
  public char getCharacter() {
    return character;
  }

  /**
   * @return the keyDown
   */
  public boolean isKeyDown() {
    return keyDown;
  }

  /**
   * @return the shiftDown
   */
  public boolean isShiftDown() {
    return shiftDown;
  }

  /**
   * @return the controlDown
   */
  public boolean isControlDown() {
    return controlDown;
  }
}


text:
@interface GIGURLTests : SenTestCase

@property (strong, nonatomic) GIGURL *testURL;

@end

@implementation GIGURLTests

- (void)setUp {
    [super setUp];

    NSDictionary *representation = @{
            @"url" : @"http://t.co/IOwBrTZR",
            @"indices" : @[@32, @52],
            @"display_url" : @"youtube.com/watch?v=oHg5SJ\u2026",
            @"expanded_url" : @"http://www.youtube.com/watch?v=oHg5SJYRHA0"
    };

    self.testURL = [MTLJSONAdapter modelOfClass:GIGURL.class fromJSONDictionary:representation error:NULL];
}

- (void)tearDown {
    self.testURL = nil;
    [super tearDown];
}

- (void)testThatURLExists {
    STAssertNotNil(self.testURL, nil);
}

- (void)testThatURLInitializes {
    STAssertEqualObjects(self.testURL.URL,[NSURL URLWithString:@"http://t.co/IOwBrTZR"], nil);
    STAssertEquals(self.testURL.range, NSMakeRange(32, 20), nil);
    STAssertEqualObjects(self.testURL.displayURL, @"youtube.com/watch?v=oHg5SJ\u2026", nil);
    STAssertEqualObjects(self.testURL.expandedURL,[NSURL URLWithString:@"http://www.youtube.com/watch?v=oHg5SJYRHA0"], nil);
}

@end


text:
require 'spec_helper'

Dir[File.expand_path('../../../features/support/factories.rb', __FILE__)].each {|f| require f}

describe PortfolioEntry do
  describe "validations" do
    it "rejects empty title" do
      PortfolioEntry.new.should_not be_valid
    end
  end

  describe "title_image association" do
    it "have a title_image attribute" do
      Factory(:portfolio_entry).should respond_to(:title_image)
    end
  end

  describe "images_portfolio_entries association" do
    it "have an images_portfolio_entries attribute" do
      Factory(:portfolio_entry).should respond_to(:images_portfolio_entries)
    end
  end

  describe "images association" do
    it "have an images attribute" do
      Factory(:portfolio_entry).should respond_to(:images)
    end
  end

  describe "default scope" do
    it "order by lft in ASC order" do
      PortfolioEntry.delete_all
      entry1 = Factory(:portfolio_entry)
      entry2 = Factory(:portfolio_entry)
      portfolio_entries = PortfolioEntry.all
      portfolio_entries.first.should == entry1
      portfolio_entries.second.should == entry2
    end
  end

  describe "alias between content and body" do
    it "aliases content method to body" do
      entry = Factory(:portfolio_entry, :content => "refinerycms")
      entry.content.should == entry.body
    end
  end
end


text:
const _ = require('underscore');
const cos = require('./uploader/cos');
const qiniu = require('./uploader/qiniu');
const s3 = require('./uploader/s3');
const AVError = require('./error');
const AVRequest = require('./request')._request;
const Promise = require('./promise');
const { tap, transformFetchOptions } = require('./utils');
const debug = require('debug')('leancloud:file');
const parseBase64 = require('./utils/parse-base64');

module.exports = function(AV) {
  const hexOctet = () =>
    Math.floor((1 + Math.random()) * 0x10000)
      .toString(16)
      .substring(1);

  // port from browserify path module
  // since react-native packager won't shim node modules.
  const extname = path => {
    if (!_.isString(path)) return '';
    return path.match(
      /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/
    )[4];
  };

  const b64Digit = number => {
    if (number < 26) {
      return String.fromCharCode(65 + number);
    }
    if (number < 52) {
      return String.fromCharCode(97 + (number - 26));
    }
    if (number < 62) {
      return String.fromCharCode(48 + (number - 52));
    }
    if (number === 62) {
      return '+';
    }
    if (number === 63) {
      return '/';
    }
    throw new Error('Tried to encode large digit ' + number + ' in base64.');
  };

  var encodeBase64 = function(array) {
    var chunks = [];
    chunks.length = Math.ceil(array.length / 3);
    _.times(chunks.length, function(i) {
      var b1 = array[i * 3];
      var b2 = array[i * 3 + 1] || 0;
      var b3 = array[i * 3 + 2] || 0;

      var has2 = i * 3 + 1 < array.length;
      var has3 = i * 3 + 2 < array.length;

      chunks[i] = [
        b64Digit((b1 >> 2) & 0x3f),
        b64Digit(((b1 << 4) & 0x30) | ((b2 >> 4) & 0x0f)),
        has2 ? b64Digit(((b2 << 2) & 0x3c) | ((b3 >> 6) & 0x03)) : '=',
        has3 ? b64Digit(b3 & 0x3f) : '=',
      ].join('');
    });
    return chunks.join('');
  };

  /**
   * An AV.File is a local representation of a file that is saved to the AV
   * cloud.
   * @param name {String} The file's name. This will change to a unique value
   *     once the file has finished saving.
   * @param data {Array} The data for the file, as either:
   *     1. an Array of byte value Numbers, or
   *     2. an Object like { base64: "..." } with a base64-encoded String.
   *     3. a Blob(File) selected with a file upload control.
   *     4. a Buffer in Node.js runtime.
   *     5. a Stream in Node.js runtime.
   *
   *        For example:

   * var fileUploadControl = $("#profilePhotoFileUpload")[0];
   * if (fileUploadControl.files.length > 0) {
   *   var file = fileUploadControl.files[0];
   *   var name = "photo.jpg";
   *   var file = new AV.File(name, file);
   *   file.save().then(function() {
   *     // The file has been saved to AV.
   *   }, function(error) {
   *     // The file either could not be read, or could not be saved to AV.
   *   });
   * }

   *
   * @class
   * @param [mimeType] {String} Content-Type header to use for the file. If
   *     this is omitted, the content type will be inferred from the name's
   *     extension.
   */
  AV.File = function(name, data, mimeType) {
    this.attributes = {
      name,
      url: '',
      metaData: {},
      // 用来存储转换后要上传的 base64 String
      base64: '',
    };

    if (_.isString(data)) {
      throw new TypeError(
        'Creating an AV.File from a String is not yet supported.'
      );
    }
    if (_.isArray(data)) {
      this.attributes.metaData.size = data.length;
      data = { base64: encodeBase64(data) };
    }

    this._extName = '';
    this._data = data;
    this._uploadHeaders = {};

    if (
      process.env.CLIENT_PLATFORM === 'ReactNative' ||
      process.env.CLIENT_PLATFORM === 'Weapp'
    ) {
      if (data && data.blob) {
        this._extName = extname(data.blob.uri);
      }
    }

    if (typeof Blob !== 'undefined' && data instanceof Blob) {
      if (data.size) {
        this.attributes.metaData.size = data.size;
      }
      if (data.name) {
        this._extName = extname(data.name);
      }
    }

    /* NODE-ONLY:start */
    if (data instanceof require('stream') && data.path) {
      this._extName = extname(data.path);
    }
    if (Buffer.isBuffer(data)) {
      this.attributes.metaData.size = data.length;
    }
    /* NODE-ONLY:end */

    let owner;
    if (data && data.owner) {
      owner = data.owner;
    } else if (!AV._config.disableCurrentUser) {
      try {
        owner = AV.User.current();
      } catch (error) {
        if ('SYNC_API_NOT_AVAILABLE' !== error.code) {
          throw error;
        }
      }
    }

    this.attributes.metaData.owner = owner ? owner.id : 'unknown';

    this.set('mime_type', mimeType);
  };

  /**
   * Creates a fresh AV.File object with exists url for saving to AVOS Cloud.
   * @param {String} name the file name
   * @param {String} url the file url.
   * @param {Object} [metaData] the file metadata object.
   * @param {String} [type] Content-Type header to use for the file. If
   *     this is omitted, the content type will be inferred from the name's
   *     extension.
   * @return {AV.File} the file object
   */
  AV.File.withURL = function(name, url, metaData, type) {
    if (!name || !url) {
      throw new Error('Please provide file name and url');
    }
    var file = new AV.File(name, null, type);
    //copy metaData properties to file.
    if (metaData) {
      for (var prop in metaData) {
        if (!file.attributes.metaData[prop])
          file.attributes.metaData[prop] = metaData[prop];
      }
    }
    file.attributes.url = url;
    //Mark the file is from external source.
    file.attributes.metaData.__source = 'external';
    return file;
  };

  /**
   * Creates a file object with exists objectId.
   * @param {String} objectId The objectId string
   * @return {AV.File} the file object
   */
  AV.File.createWithoutData = function(objectId) {
    var file = new AV.File();
    file.id = objectId;
    return file;
  };

  _.extend(
    AV.File.prototype,
    /** @lends AV.File.prototype */ {
      className: '_File',

      _toFullJSON(seenObjects, full = true) {
        var json = _.clone(this.attributes);
        AV._objectEach(json, function(val, key) {
          json[key] = AV._encode(val, seenObjects, undefined, full);
        });
        AV._objectEach(this._operations, function(val, key) {
          json[key] = val;
        });

        if (_.has(this, 'id')) {
          json.objectId = this.id;
        }
        _(['createdAt', 'updatedAt']).each(key => {
          if (_.has(this, key)) {
            const val = this[key];
            json[key] = _.isDate(val) ? val.toJSON() : val;
          }
        });
        if (full) {
          json.__type = 'File';
        }
        return json;
      },

      /**
       * Returns a JSON version of the file with meta data.
       * Inverse to {@link AV.parseJSON}
       * @since 2.0.0
       * @return {Object}
       */
      toFullJSON(seenObjects = []) {
        return this._toFullJSON(seenObjects);
      },

      /**
       * Returns a JSON version of the object.
       * @return {Object}
       */
      toJSON: function(key, holder, seenObjects = [this]) {
        return this._toFullJSON(seenObjects, false);
      },

      /**
       * Gets a Pointer referencing this file.
       * @private
       */
      _toPointer() {
        return {
          __type: 'Pointer',
          className: this.className,
          objectId: this.id,
        };
      },

      /**
       * Returns the ACL for this file.
       * @returns {AV.ACL} An instance of AV.ACL.
       */
      getACL: function() {
        return this._acl;
      },

      /**
       * Sets the ACL to be used for this file.
       * @param {AV.ACL} acl An instance of AV.ACL.
       */
      setACL: function(acl) {
        if (!(acl instanceof AV.ACL)) {
          return new AVError(AVError.OTHER_CAUSE, 'ACL must be a AV.ACL.');
        }
        this._acl = acl;
      },

      /**
       * Gets the name of the file. Before save is called, this is the filename
       * given by the user. After save is called, that name gets prefixed with a
       * unique identifier.
       */
      name: function() {
        return this.get('name');
      },

      /**
       * Gets the url of the file. It is only available after you save the file or
       * after you get the file from a AV.Object.
       * @return {String}
       */
      url: function() {
        return this.get('url');
      },

      /**
       * Gets the attributs of the file object.
       * @param {String} The attribute name which want to get.
       * @returns {Any}
       */
      get: function(attrName) {
        switch (attrName) {
          case 'objectId':
            return this.id;
          case 'url':
          case 'name':
          case 'mime_type':
          case 'metaData':
          case 'createdAt':
          case 'updatedAt':
            return this.attributes[attrName];
          default:
            return this.attributes.metaData[attrName];
        }
      },

      /**
       * Set the metaData of the file object.
       * @param {Object} Object is an key value Object for setting metaData.
       * @param {String} attr is an optional metadata key.
       * @param {Object} value is an optional metadata value.
       * @returns {String|Number|Array|Object}
       */
      set: function(...args) {
        const set = (attrName, value) => {
          switch (attrName) {
            case 'name':
            case 'url':
            case 'mime_type':
            case 'base64':
            case 'metaData':
              this.attributes[attrName] = value;
              break;
            default:
              // File 并非一个 AVObject,不能完全自定义其他属性,所以只能都放在 metaData 上面
              this.attributes.metaData[attrName] = value;
              break;
          }
        };

        switch (args.length) {
          case 1:
            // 传入一个 Object
            for (var k in args[0]) {
              set(k, args[0][k]);
            }
            break;
          case 2:
            set(args[0], args[1]);
            break;
        }
      },

      /**
       * Set a header for the upload request.
       * For more infomation, go to https://url.leanapp.cn/avfile-upload-headers
       *
       * @param {String} key header key
       * @param {String} value header value
       * @return {AV.File} this
       */
      setUploadHeader(key, value) {
        this._uploadHeaders[key] = value;
        return this;
      },

      /**
       *
Returns the file's metadata JSON object if no arguments is given.Returns the
       * metadata value if a key is given.Set metadata value if key and value are both given.

       *

       *  var metadata = file.metaData(); //Get metadata JSON object.
       *  var size = file.metaData('size');  // Get the size metadata value.
       *  file.metaData('format', 'jpeg'); //set metadata attribute and value.
       *

       * @return {Object} The file's metadata JSON object.
       * @param {String} attr an optional metadata key.
       * @param {Object} value an optional metadata value.
       **/
      metaData: function(attr, value) {
        if (attr && value) {
          this.attributes.metaData[attr] = value;
          return this;
        } else if (attr && !value) {
          return this.attributes.metaData[attr];
        } else {
          return this.attributes.metaData;
        }
      },

      /**
       * 如果文件是图片,获取图片的缩略图URL。可以传入宽度、高度、质量、格式等参数。
       * @return {String} 缩略图URL
       * @param {Number} width 宽度,单位:像素
       * @param {Number} heigth 高度,单位:像素
       * @param {Number} quality 质量,1-100的数字,默认100
       * @param {Number} scaleToFit 是否将图片自适应大小。默认为true。
       * @param {String} fmt 格式,默认为png,也可以为jpeg,gif等格式。
       */

      thumbnailURL: function(width, height, quality, scaleToFit, fmt) {
        const url = this.attributes.url;
        if (!url) {
          throw new Error('Invalid url.');
        }
        if (!width || !height || width <= 0 || height <= 0) {
          throw new Error('Invalid width or height value.');
        }
        quality = quality || 100;
        scaleToFit = !scaleToFit ? true : scaleToFit;
        if (quality <= 0 || quality > 100) {
          throw new Error('Invalid quality value.');
        }
        fmt = fmt || 'png';
        const mode = scaleToFit ? 2 : 1;
        return (
          url +
          '?imageView/' +
          mode +
          '/w/' +
          width +
          '/h/' +
          height +
          '/q/' +
          quality +
          '/format/' +
          fmt
        );
      },

      /**
       * Returns the file's size.
       * @return {Number} The file's size in bytes.
       **/
      size: function() {
        return this.metaData().size;
      },

      /**
       * Returns the file's owner.
       * @return {String} The file's owner id.
       */
      ownerId: function() {
        return this.metaData().owner;
      },

      /**
       * Destroy the file.
       * @param {AuthOptions} options
       * @return {Promise} A promise that is fulfilled when the destroy
       *     completes.
       */
      destroy: function(options) {
        if (!this.id) {
          return Promise.reject(new Error('The file id does not eixst.'));
        }
        var request = AVRequest(
          'files',
          null,
          this.id,
          'DELETE',
          null,
          options
        );
        return request;
      },

      /**
       * Request Qiniu upload token
       * @param {string} type
       * @return {Promise} Resolved with the response
       * @private
       */
      _fileToken(type, route = 'fileTokens') {
        let name = this.attributes.name;

        let extName = extname(name);
        if (!extName && this._extName) {
          name += this._extName;
          extName = this._extName;
        }
        // Create 16-bits uuid as qiniu key.
        const key =
          hexOctet() +
          hexOctet() +
          hexOctet() +
          hexOctet() +
          hexOctet() +
          extName;
        const data = {
          key,
          name,
          ACL: this._acl,
          mime_type: type,
          metaData: this.attributes.metaData,
        };
        this._qiniu_key = key;
        return AVRequest(route, null, null, 'POST', data);
      },

      /**
       * @callback UploadProgressCallback
       * @param {XMLHttpRequestProgressEvent} event - The progress event with 'loaded' and 'total' attributes
       */
      /**
       * Saves the file to the AV cloud.
       * @param {Object} [options]
       * @param {UploadProgressCallback} [options.onprogress] 文件上传进度,在 Node.js 中无效,回调参数说明详见 {@link UploadProgressCallback}。
       * @return {Promise} Promise that is resolved when the save finishes.
       */
      save(options) {
        if (this.id) {
          throw new Error(
            'File already saved. If you want to manipulate a file, use AV.Query to get it.'
          );
        }
        if (!this._previousSave) {
          if (this._data) {
            let mimeType = this.get('mime_type');
            this._previousSave = this._fileToken(mimeType).then(uploadInfo => {
              if (uploadInfo.mime_type) {
                mimeType = uploadInfo.mime_type;
                this.set('mime_type', mimeType);
              }
              this._token = uploadInfo.token;
              return Promise.resolve()
                .then(() => {
                  const data = this._data;
                  if (data && data.base64) {
                    return parseBase64(data.base64, mimeType);
                  }
                  if (data && data.blob) {
                    if (!data.blob.type && mimeType) {
                      data.blob.type = mimeType;
                    }
                    if (!data.blob.name) {
                      data.blob.name = this.get('name');
                    }
                    return data.blob;
                  }
                  if (typeof Blob !== 'undefined' && data instanceof Blob) {
                    return data;
                  }
                  /* NODE-ONLY:start */
                  if (data instanceof require('stream')) {
                    return data;
                  }
                  if (Buffer.isBuffer(data)) {
                    return data;
                  }
                  /* NODE-ONLY:end */
                  throw new TypeError('malformed file data');
                })
                .then(data => {
                  switch (uploadInfo.provider) {
                    case 's3':
                      return s3(uploadInfo, data, this, options);
                    case 'qcloud':
                      return cos(uploadInfo, data, this, options);
                    case 'qiniu':
                    default:
                      return qiniu(uploadInfo, data, this, options);
                  }
                })
                .then(tap(() => this._callback(true)), error => {
                  this._callback(false);
                  throw error;
                });
            });
          } else if (
            this.attributes.url &&
            this.attributes.metaData.__source === 'external'
          ) {
            // external link file.
            const data = {
              name: this.attributes.name,
              ACL: this._acl,
              metaData: this.attributes.metaData,
              mime_type: this.mimeType,
              url: this.attributes.url,
            };
            this._previousSave = AVRequest(
              'files',
              this.attributes.name,
              null,
              'post',
              data
            ).then(response => {
              this.attributes.name = response.name;
              this.attributes.url = response.url;
              this.id = response.objectId;
              if (response.size) {
                this.attributes.metaData.size = response.size;
              }
              return this;
            });
          }
        }
        return this._previousSave;
      },

      _callback(success) {
        AVRequest('fileCallback', null, null, 'post', {
          token: this._token,
          result: success,
        }).catch(debug);
        delete this._token;
        delete this._data;
      },

      /**
       * fetch the file from server. If the server's representation of the
       * model differs from its current attributes, they will be overriden,
       * @param {Object} fetchOptions Optional options to set 'keys',
       *      'include' and 'includeACL' option.
       * @param {AuthOptions} options
       * @return {Promise} A promise that is fulfilled when the fetch
       *     completes.
       */
      fetch: function(fetchOptions, options) {
        var request = AVRequest(
          'files',
          null,
          this.id,
          'GET',
          transformFetchOptions(fetchOptions),
          options
        );
        return request.then(this._finishFetch.bind(this));
      },
      _finishFetch: function(response) {
        var value = AV.Object.prototype.parse(response);
        value.attributes = {
          name: value.name,
          url: value.url,
          mime_type: value.mime_type,
          bucket: value.bucket,
        };
        value.attributes.metaData = value.metaData || {};
        value.id = value.objectId;
        // clean
        delete value.objectId;
        delete value.metaData;
        delete value.url;
        delete value.name;
        delete value.mime_type;
        delete value.bucket;
        _.extend(this, value);
        return this;
      },
    }
  );
};


text:
FieldVal-JS
========

The FieldVal-JS library allows you to easily validate data and provide readable and structured error reports.

[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/FieldVal/fieldval-js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Documentation and Examples
=============

Documentation and examples can be found at [http://fieldval.com](http://fieldval.com)

Development
=============

This project uses [gulp.js](http://gulpjs.com/) to build and [mocha](http://visionmedia.github.io/mocha/) to test.

```bash
npm install
gulp js
mocha test/test
```


text: Preparing vocabulary data for another problem.


text:
require 'uri'
require 'fileutils'

##
# A Source knows how to list and fetch gems from a RubyGems marshal index.
#
# There are other Source subclasses for installed gems, local gems, the
# bundler dependency API and so-forth.

class Gem::Source

  include Comparable

  FILES = { # :nodoc:
    :released   => 'specs',
    :latest     => 'latest_specs',
    :prerelease => 'prerelease_specs',
  }

  ##
  # The URI this source will fetch gems from.

  attr_reader :uri

  ##
  # Creates a new Source which will use the index located at +uri+.

  def initialize(uri)
    begin
      unless uri.kind_of? URI
        uri = URI.parse(uri.to_s)
      end
    rescue URI::InvalidURIError
      raise if Gem::Source == self.class
    end

    @uri = uri
    @api_uri = nil
  end

  ##
  # Use an SRV record on the host to look up the true endpoint for the index.

  def api_uri # :nodoc:
    require 'rubygems/remote_fetcher'
    @api_uri ||= Gem::RemoteFetcher.fetcher.api_endpoint uri
  end

  ##
  # Sources are ordered by installation preference.

  def <=>(other)
    case other
    when Gem::Source::Installed,
         Gem::Source::Local,
         Gem::Source::Lock,
         Gem::Source::SpecificFile,
         Gem::Source::Git,
         Gem::Source::Vendor then
      -1
    when Gem::Source then
      if !@uri
        return 0 unless other.uri
        return 1
      end

      return -1 if !other.uri

      @uri.to_s <=> other.uri.to_s
    else
      nil
    end
  end

  def == other # :nodoc:
    self.class === other and @uri == other.uri
  end

  alias_method :eql?, :== # :nodoc:

  ##
  # Returns a Set that can fetch specifications from this source.

  def dependency_resolver_set # :nodoc:
    return Gem::Resolver::IndexSet.new self if 'file' == api_uri.scheme

    bundler_api_uri = api_uri + './api/v1/dependencies'

    begin
      fetcher = Gem::RemoteFetcher.fetcher
      response = fetcher.fetch_path bundler_api_uri, nil, true
    rescue Gem::RemoteFetcher::FetchError
      Gem::Resolver::IndexSet.new self
    else
      if response.respond_to? :uri then
        Gem::Resolver::APISet.new response.uri
      else
        Gem::Resolver::APISet.new bundler_api_uri
      end
    end
  end

  def hash # :nodoc:
    @uri.hash
  end

  ##
  # Returns the local directory to write +uri+ to.

  def cache_dir(uri)
    # Correct for windows paths
    escaped_path = uri.path.sub(/^\/([a-z]):\//i, '/\\1-/')
    escaped_path.untaint

    File.join Gem.spec_cache_dir, "#{uri.host}%#{uri.port}", File.dirname(escaped_path)
  end

  ##
  # Returns true when it is possible and safe to update the cache directory.

  def update_cache?
    @update_cache ||=
      begin
        File.stat(Gem.user_home).uid == Process.uid
      rescue Errno::ENOENT
        false
      end
  end

  ##
  # Fetches a specification for the given +name_tuple+.

  def fetch_spec name_tuple
    fetcher = Gem::RemoteFetcher.fetcher

    spec_file_name = name_tuple.spec_name

    uri = api_uri + "#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}"

    cache_dir = cache_dir uri

    local_spec = File.join cache_dir, spec_file_name

    if File.exist? local_spec then
      spec = Gem.read_binary local_spec
      spec = Marshal.load(spec) rescue nil
      return spec if spec
    end

    uri.path << '.rz'

    spec = fetcher.fetch_path uri
    spec = Gem.inflate spec

    if update_cache? then
      FileUtils.mkdir_p cache_dir

      open local_spec, 'wb' do |io|
        io.write spec
      end
    end

    # TODO: Investigate setting Gem::Specification#loaded_from to a URI
    Marshal.load spec
  end

  ##
  # Loads +type+ kind of specs fetching from +@uri+ if the on-disk cache is
  # out of date.
  #
  # +type+ is one of the following:
  #
  # :released   => Return the list of all released specs
  # :latest     => Return the list of only the highest version of each gem
  # :prerelease => Return the list of all prerelease only specs
  #

  def load_specs(type)
    file       = FILES[type]
    fetcher    = Gem::RemoteFetcher.fetcher
    file_name  = "#{file}.#{Gem.marshal_version}"
    spec_path  = api_uri + "#{file_name}.gz"
    cache_dir  = cache_dir spec_path
    local_file = File.join(cache_dir, file_name)
    retried    = false

    FileUtils.mkdir_p cache_dir if update_cache?

    spec_dump = fetcher.cache_update_path spec_path, local_file, update_cache?

    begin
      Gem::NameTuple.from_list Marshal.load(spec_dump)
    rescue ArgumentError
      if update_cache? && !retried
        FileUtils.rm local_file
        retried = true
        retry
      else
        raise Gem::Exception.new("Invalid spec cache file in #{local_file}")
      end
    end
  end

  ##
  # Downloads +spec+ and writes it to +dir+.  See also
  # Gem::RemoteFetcher#download.

  def download(spec, dir=Dir.pwd)
    fetcher = Gem::RemoteFetcher.fetcher
    fetcher.download spec, api_uri.to_s, dir
  end

  def pretty_print q # :nodoc:
    q.group 2, '[Remote:', ']' do
      q.breakable
      q.text @uri.to_s

      if api = api_uri
        q.breakable
        q.text 'API URI: '
        q.text api.to_s
      end
    end
  end

end

require 'rubygems/source/git'
require 'rubygems/source/installed'
require 'rubygems/source/specific_file'
require 'rubygems/source/local'
require 'rubygems/source/lock'
require 'rubygems/source/vendor'


text:
package fr.pizzeria.model;

public enum TypePizza {
	VIANDE("Viande"), POISSON("Poisson"), SANS_VIANDE("Sans Viande");

	private String libelle;

	private TypePizza(String libelle) {
		this.libelle = libelle;
	}

	public String toString() {
		return libelle;
	}

	public String getLibelle() {
		return libelle;
	}

}


text:
namespace Framework.Ioc
{
    using System.ComponentModel;

    /// <summary>
    /// Binding Extensions.
    /// </summary>
    /// <author>Anwar</author>
    /// <date>11/9/2011</date>
    [EditorBrowsable(EditorBrowsableState.Never)]
    public static class BindingExtensions
    {
    }
}


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

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="Apache Forrest" name="Generator">
<meta name="Forrest-version" content="0.7">
<meta name="Forrest-skin-name" content="pelt">
<title>Hadoop credits</title>
<link type="text/css" href="skin/basic.css" rel="stylesheet">
<link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
<link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
<link type="text/css" href="skin/profile.css" rel="stylesheet">

<link rel="shortcut icon" href="images/favicon.ico">

Apache > Lucene > Hadoop

<form action="http://www.google.com/search" method="get" class="roundtopsmall">
<input value="lucene.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">
                    <input attr="value" name="Search" value="Search" type="submit">
</form>

Main

Wiki

Project

News

About

Credits

Documentation

Wiki

API Docs

Resources

Download

Mailing Lists

Issue Tracking

Version Control

Related Projects

Lucene

Nutch

        PDF

Hadoop credits

Committers

Committers

Andrzej Bialecki

Mike Cafarella

Doug Cutting

        Copyright ©
         2005 The Apache Software Foundation.


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>pymatgen.io.cssr — pymatgen 2017.11.6 documentation</title>
    <link rel="stylesheet" href="../../../_static/proBlue.css" type="text/css" />
    <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />

    <link rel="shortcut icon" href="../../../_static/favicon.ico"/>
    <link rel="index" title="Index" href="../../../genindex.html" />
    <link rel="search" title="Search" href="../../../search.html" />

Navigation

          index

          modules |

pymatgen 2017.11.6 documentation »

Module code »

pymatgen »

Source code for pymatgen.io.cssr

# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.

from __future__ import division, unicode_literals
import re

from monty.io import zopen
from pymatgen.core.lattice import Lattice
from pymatgen.core.structure import Structure

"""
This module provides input and output from the CSSR file format.
"""

__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyuep@gmail.com"
__date__ = "Jan 24, 2012"

[docs]class Cssr(object):
    """
    Basic object for working with Cssr file. Right now, only conversion from
    a Structure to a Cssr file is supported.

    Args:
        structure (Structure/IStructure): A structure to create the Cssr object.
    """

    def __init__(self, structure):
        if not structure.is_ordered:
            raise ValueError("Cssr file can only be constructed from ordered "
                             "structure")
        self.structure = structure

    def __str__(self):
        output = ["{:.4f} {:.4f} {:.4f}"
                  .format(*self.structure.lattice.abc),
                  "{:.2f} {:.2f} {:.2f} SPGR =  1 P 1    OPT = 1"
                  .format(*self.structure.lattice.angles),
                  "{} 0".format(len(self.structure)),
                  "0 {}".format(self.structure.formula)]
        for i, site in enumerate(self.structure.sites):
            output.append("{} {} {:.4f} {:.4f} {:.4f}"
                          .format(i + 1, site.specie, site.a, site.b, site.c))
        return "\n".join(output)

[docs]    def write_file(self, filename):
        """
        Write out a CSSR file.

        Args:
            filename (str): Filename to write to.
        """
        with zopen(filename, 'wt') as f:
            f.write(str(self) + "\n")

[docs]    @staticmethod
    def from_string(string):
        """
        Reads a string representation to a Cssr object.

        Args:
            string (str): A string representation of a CSSR.

        Returns:
            Cssr object.
        """
        lines = string.split("\n")
        toks = lines[0].split()
        lengths = [float(i) for i in toks]
        toks = lines[1].split()
        angles = [float(i) for i in toks[0:3]]
        latt = Lattice.from_lengths_and_angles(lengths, angles)
        sp = []
        coords = []
        for l in lines[4:]:
            m = re.match(
                r"\d+\s+(\w+)\s+([0-9\-\.]+)\s+([0-9\-\.]+)\s+([0-9\-\.]+)",
                l.strip())
            if m:
                sp.append(m.group(1))
                coords.append([float(m.group(i)) for i in range(2, 5)])
        return Cssr(Structure(latt, sp, coords))

[docs]    @staticmethod
    def from_file(filename):
        """
        Reads a CSSR file to a Cssr object.

        Args:
            filename (str): Filename to read from.

        Returns:
            Cssr object.
        """
        with zopen(filename, "rt") as f:
            return Cssr.from_string(f.read())

Quick search

    <form class="search" action="../../../search.html" method="get">

<input type="text" name="q" />

<input type="submit" value="Go" />

      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

Navigation

          index

          modules |

pymatgen 2017.11.6 documentation »

Module code »

pymatgen »

        © Copyright 2011, Pymatgen Development Team.
      Created using Sphinx 1.6.5.

This page uses
Google Analytics to collect statistics. You can disable it by blocking
the JavaScript coming from www.google-analytics.com.


text:
class Camera;
class AudioStreamPlayer3D : public Spatial {

	GDCLASS(AudioStreamPlayer3D, Spatial)
public:
	enum AttenuationModel {
		ATTENUATION_INVERSE_DISTANCE,
		ATTENUATION_INVERSE_SQUARE_DISTANCE,
		ATTENUATION_LOGARITHMIC,
	};

	enum OutOfRangeMode {
		OUT_OF_RANGE_MIX,
		OUT_OF_RANGE_PAUSE,
	};

	enum DopplerTracking {
		DOPPLER_TRACKING_DISABLED,
		DOPPLER_TRACKING_IDLE_STEP,
		DOPPLER_TRACKING_FIXED_STEP
	};

private:
	enum {
		MAX_OUTPUTS = 8,
		MAX_INTERSECT_AREAS = 32

	};

	struct Output {

		AudioFilterSW filter;
		AudioFilterSW::Processor filter_process[6];
		AudioFrame vol[4];
		float filter_gain;
		float pitch_scale;
		int bus_index;
		int reverb_bus_index;
		AudioFrame reverb_vol[4];
		Viewport *viewport; //pointer only used for reference to previous mix

		Output() {
			filter_gain = 0;
			viewport = NULL;
			reverb_bus_index = -1;
			bus_index = -1;
		}
	};

	Output outputs[MAX_OUTPUTS];
	volatile int output_count;
	volatile bool output_ready;

	//these are used by audio thread to have a reference of previous volumes (for ramping volume and avoiding clicks)
	Output prev_outputs[MAX_OUTPUTS];
	int prev_output_count;

	Ref<AudioStreamPlayback> stream_playback;
	Ref<AudioStream> stream;
	Vector<AudioFrame> mix_buffer;

	volatile float setseek;
	volatile bool active;
	volatile float setplay;

	AttenuationModel attenuation_model;
	float unit_db;
	float unit_size;
	float max_db;
	bool autoplay;
	StringName bus;

	void _mix_audio();
	static void _mix_audios(void *self) { reinterpret_cast<AudioStreamPlayer3D *>(self)->_mix_audio(); }

	void _set_playing(bool p_enable);
	bool _is_active() const;

	void _bus_layout_changed();

	uint32_t area_mask;

	bool emission_angle_enabled;
	float emission_angle;
	float emission_angle_filter_attenuation_db;
	float attenuation_filter_cutoff_hz;
	float attenuation_filter_db;

	float max_distance;

	Ref<SpatialVelocityTracker> velocity_tracker;

	DopplerTracking doppler_tracking;

	OutOfRangeMode out_of_range_mode;

	float _get_attenuation_db(float p_distance) const;

protected:
	void _validate_property(PropertyInfo &property) const;
	void _notification(int p_what);
	static void _bind_methods();

public:
	void set_stream(Ref<AudioStream> p_stream);
	Ref<AudioStream> get_stream() const;

	void set_unit_db(float p_volume);
	float get_unit_db() const;

	void set_unit_size(float p_volume);
	float get_unit_size() const;

	void set_max_db(float p_boost);
	float get_max_db() const;

	void play(float p_from_pos = 0.0);
	void seek(float p_seconds);
	void stop();
	bool is_playing() const;
	float get_playback_position();

	void set_bus(const StringName &p_bus);
	StringName get_bus() const;

	void set_autoplay(bool p_enable);
	bool is_autoplay_enabled();

	void set_max_distance(float p_metres);
	float get_max_distance() const;

	void set_area_mask(uint32_t p_mask);
	uint32_t get_area_mask() const;

	void set_emission_angle_enabled(bool p_enable);
	bool is_emission_angle_enabled() const;

	void set_emission_angle(float p_angle);
	float get_emission_angle() const;

	void set_emission_angle_filter_attenuation_db(float p_angle_attenuation_db);
	float get_emission_angle_filter_attenuation_db() const;

	void set_attenuation_filter_cutoff_hz(float p_hz);
	float get_attenuation_filter_cutoff_hz() const;

	void set_attenuation_filter_db(float p_db);
	float get_attenuation_filter_db() const;

	void set_attenuation_model(AttenuationModel p_model);
	AttenuationModel get_attenuation_model() const;

	void set_out_of_range_mode(OutOfRangeMode p_mode);
	OutOfRangeMode get_out_of_range_mode() const;

	void set_doppler_tracking(DopplerTracking p_tracking);
	DopplerTracking get_doppler_tracking() const;

	AudioStreamPlayer3D();
	~AudioStreamPlayer3D();
};

VARIANT_ENUM_CAST(AudioStreamPlayer3D::AttenuationModel)
VARIANT_ENUM_CAST(AudioStreamPlayer3D::OutOfRangeMode)
VARIANT_ENUM_CAST(AudioStreamPlayer3D::DopplerTracking)
#endif // AUDIO_STREAM_PLAYER_3D_H


text:
package com.github.aleksandermielczarek.observablecache;

import android.support.annotation.Nullable;

import java.util.HashMap;
import java.util.Map;

import rx.Observable;
import rx.Single;

/**
 * Created by Aleksander Mielczarek on 30.10.2016.
 */

public final class MapObservableCache extends ObservableCache {

    private static volatile ObservableCache defaultInstance;

    private final Map<String, Observable<?>> observables;
    private final Map<String, Single<?>> singles;

    private MapObservableCache() {
        observables = new HashMap<>();
        singles = new HashMap<>();
    }

    private MapObservableCache(int size) {
        observables = new HashMap<>(size);
        singles = new HashMap<>(size);
    }

    public static ObservableCache getDefault() {
        if (defaultInstance == null) {
            synchronized (ObservableCache.class) {
                if (defaultInstance == null) {
                    defaultInstance = newInstance();
                }
            }
        }
        return defaultInstance;
    }

    public static ObservableCache newInstance() {
        return new MapObservableCache();
    }

    public static ObservableCache newInstance(int size) {
        return new MapObservableCache(size);
    }

    @Override
    protected <T> void cache(String key, Observable<T> observable) {
        observables.put(key, observable);
    }

    @Override
    protected <T> void cache(String key, Single<T> single) {
        singles.put(key, single);
    }

    @Override
    public boolean clear() {
        boolean empty = isEmpty();
        observables.clear();
        singles.clear();
        return !empty;
    }

    @Override
    public boolean remove(String key) {
        Observable<?> removedObservable = observables.remove(key);
        Single<?> removedSingle = singles.remove(key);
        return removedObservable != null || removedSingle != null;
    }

    @Override
    public int size() {
        return observables.size() + singles.size();
    }

    @Override
    public boolean exists(String key) {
        return observables.containsKey(key) || singles.containsKey(key);
    }

    @Override
    public boolean isEmpty() {
        return observables.isEmpty() && singles.isEmpty();
    }

    @Override
    @Nullable
    @SuppressWarnings("unchecked")
    protected <T> Observable<T> getObservableFromCache(String key) {
        return (Observable<T>) observables.get(key);
    }

    @Nullable
    @Override
    @SuppressWarnings("unchecked")
    protected <T> Single<T> getSingleFromCache(String key) {
        return (Single<T>) singles.get(key);
    }
}


text:
import gameUtils from './game';

const canvasUtils = {

  isOffCanvas ( canvas, x, y, size ) {

    if ( x < -size ) {
        return true;
    }

    if ( x > canvas.width + size ) {
        return true;
    }

    if ( y < -size ) {
        return true;
    }

    if ( y > canvas.height + size ) {
        return true;
    }

    return false;
  },

  drawMovingGrid ( canvas, ctx, hero ) {
    const { x, y } = hero;
    const distance = 150;
    const offsetX = x % distance;
    const offsetY = y % distance;

    canvasUtils.drawGrid( canvas, ctx, -offsetX, -offsetY, distance, distance, 'rgba( 0, 255, 130, 0.5 )', 'rgba( 0, 255, 130, 0.5 )' );
  },

  drawGrid: ( canvas, ctx, posX = 0, posY = 0, distance = 50, highlightDistance = 100, color = '#888888', highlightColor = '#000000' ) => {
    ctx.beginPath();
    let position = posX;

    while ( position < canvas.width ) {
        ctx.strokeStyle = position % highlightDistance === 0 ? highlightColor : color;
        ctx.moveTo( position, 0 );
        ctx.lineTo( position, canvas.height );
        position += distance;
    }

    position = posY;

    while ( position < canvas.height ) {
        ctx.strokeStyle = position % highlightDistance === 0 ? highlightColor : color;
        ctx.moveTo( 0, position );
        ctx.lineTo( canvas.width, position );
        position += distance;
    }

    ctx.stroke();
    ctx.closePath();
  },

  drawMap: ( map, ctx ) => {
    const shipColor = 'rgba( 250, 100, 100, 1)';
    const friendlyColor = 'rgba( 250, 200, 100, 1)';

    canvasUtils.drawCircle( map, ctx, map.width * 0.5, map.height * 0.5, 2, '#ffffff' );

    (map.ships || []).forEach( ( ship ) => {
        const color = ship.isFriendly ? friendlyColor : shipColor;
        if ( canvasUtils.isOffCanvas( map, ship.x, ship.y, 4 ) ) { return; }
        // canvasUtils.drawCircle( canvas, ctx, ship.x, ship.y, 2, color );
        canvasUtils.drawRect( map, ctx, ship.x, ship.y, 4, color );
    });
  },

  drawTriangle: ( canvas, ctx, x, y, width, color, direction ) => {
    if ( canvasUtils.isOffCanvas( canvas, x, y, width ) ) { return; }
    ctx.fillStyle = color;
    ctx.beginPath();
    ctx.moveTo(x - width, y);
    ctx.lineTo(x, direction === 'up' ? y - width : y + width);
    ctx.lineTo(x + width, y);
    ctx.lineTo(x - width, y);
    ctx.fill();
  },

  drawShot: ( canvas, ctx, x, y, direction, size = 10, opacity = 1 ) => {
    const color = `rgba( 0, 255, 0, ${opacity}`;
    canvasUtils.drawCircle( canvas, ctx, x, y, size, 'yellow' );
  },

  drawRect: ( canvas, ctx, x, y, size, color = '#000000' ) => {
    if ( canvasUtils.isOffCanvas( canvas, x, y, size ) ) { return; }
    //draw a circle
    ctx.fillStyle = color;
    ctx.fillRect( x, y, size, size );
  },

  drawCircle: ( canvas, ctx, x, y, size, color = '#000000' ) => {
    if ( canvasUtils.isOffCanvas( canvas, x, y, size ) ) { return; }
    //draw a circle
    ctx.fillStyle = color;
    ctx.beginPath();
    ctx.arc( x, y, size, 0, Math.PI * 2, true );
    ctx.closePath();
    ctx.fill();
  },

  drawHoop: ( canvas, ctx, x, y, size, color = '#000000', strokeSize = 1 ) => {
    if ( canvasUtils.isOffCanvas( canvas, x, y, size ) ) { return; }
    //draw a circle
    ctx.strokeStyle = color;
    ctx.beginPath();
    ctx.arc( x, y, size, 0, Math.PI * 2, true );
    ctx.closePath();
    ctx.lineWidth = strokeSize;
    ctx.stroke();
  },

  drawThing: ( canvas, ctx, thing, x, y, showGuides = true ) => {
    const { image, circle, direction, targetDirection } = thing;
    if ( canvasUtils.isOffCanvas( canvas, x, y, thing.size ) ) { return; }
    if ( !image ) {
      console.warn( 'image not found', thing );
      return;
    }
    const guidesColor = 'rgba( 0, 255, 130, 0.5 )';
    const crosshairOffset = 25;
    const radians = gameUtils.degreesToRadians( direction );
    ctx.save();
    ctx.translate( x, y );
    ctx.translate( image.width * 0.5, image.height * 0.5 );
    ctx.rotate( radians );
    ctx.drawImage( image, -image.width * 0.5, -image.width * 0.5 );
    ctx.restore();

    const center = {
        x: x + thing.size * 0.5,
        y: y + thing.size * 0.5
    };

    // draw the health status
    const health255 = Math.floor(thing.health * 255);
    const greenPart = health255;
    const redPart = 255 - health255;
    let healthColor = `rgb( ${ redPart }, ${ greenPart }, 0 )`;
    if ( thing.power < 0 ) { healthColor = '#33bbdd'; }

    canvasUtils.drawHoop( canvas, ctx, center.x, center.y, circle.radius - 5, healthColor, 3);

    if ( showGuides ) {
        // todo - make the cross hairs bigger than the circle
        canvasUtils.drawHoop( canvas, ctx, center.x, center.y, circle.radius, guidesColor);
        ctx.strokeStyle = guidesColor;
        ctx.beginPath();
        ctx.moveTo( center.x, y - crosshairOffset);
        ctx.lineTo( center.x, y + thing.size + crosshairOffset);
        ctx.moveTo( x - crosshairOffset, center.y);
        ctx.lineTo( x + thing.size + crosshairOffset, center.y);
        ctx.stroke();
        ctx.closePath();

        if ( typeof targetDirection === 'number' ) {
            const xTo = gameUtils.getXPositionFromAngle( center.x, targetDirection, circle.radius + 30 );
            const yTo = gameUtils.getYPositionFromAngle( center.y, targetDirection, circle.radius + 30 );
            ctx.strokeStyle = '#ddaa00';
            ctx.beginPath();
            ctx.moveTo( center.x, center.y );
            ctx.lineTo( xTo, yTo );
            ctx.stroke();
            ctx.closePath();
        }
    }
  }

}

export default canvasUtils;


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

//-----------------------------------------------------------------------------

using System;
using System.Xml;
using System.ServiceModel;
using System.Xml.Serialization;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.ServiceModel.Description;

namespace System.ServiceModel.Dispatcher
{
    internal class XmlSerializerObjectSerializer : XmlObjectSerializer
    {
        private XmlSerializer _serializer;
        private Type _rootType;
        private string _rootName;
        private string _rootNamespace;
        private bool _isSerializerSetExplicit = false;

        internal XmlSerializerObjectSerializer(Type type)
        {
            Initialize(type, null /*rootName*/, null /*rootNamespace*/, null /*xmlSerializer*/);
        }

        internal XmlSerializerObjectSerializer(Type type, XmlQualifiedName qualifiedName, XmlSerializer xmlSerializer)
        {
            if (qualifiedName == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("qualifiedName");
            }
            Initialize(type, qualifiedName.Name, qualifiedName.Namespace, xmlSerializer);
        }

        private void Initialize(Type type, string rootName, string rootNamespace, XmlSerializer xmlSerializer)
        {
            if (type == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("type");
            }
            _rootType = type;
            _rootName = rootName;
            _rootNamespace = rootNamespace == null ? string.Empty : rootNamespace;
            _serializer = xmlSerializer;

            if (_serializer == null)
            {
                if (_rootName == null)
                    _serializer = new XmlSerializer(type);
                else
                {
                    XmlRootAttribute xmlRoot = new XmlRootAttribute();
                    xmlRoot.ElementName = _rootName;
                    xmlRoot.Namespace = _rootNamespace;
                    _serializer = new XmlSerializer(type, xmlRoot);
                }
            }
            else
                _isSerializerSetExplicit = true;

            //try to get rootName and rootNamespace from type since root name not set explicitly
            if (_rootName == null)
            {
                XmlTypeMapping mapping = new XmlReflectionImporter().ImportTypeMapping(_rootType);

                _rootName = mapping.ElementName;
                _rootNamespace = mapping.Namespace;
            }
        }

        public override void WriteObject(XmlDictionaryWriter writer, object graph)
        {
            if (_isSerializerSetExplicit)
                _serializer.Serialize(writer, new object[] { graph });
            else
                _serializer.Serialize(writer, graph);
        }

        public override void WriteStartObject(XmlDictionaryWriter writer, object graph)
        {
            throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(NotImplemented.ByDesign);
        }

        public override void WriteObjectContent(XmlDictionaryWriter writer, object graph)
        {
            throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(NotImplemented.ByDesign);
        }

        public override void WriteEndObject(XmlDictionaryWriter writer)
        {
            throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(NotImplemented.ByDesign);
        }

        public override object ReadObject(XmlDictionaryReader reader, bool verifyObjectName)
        {
            if (_isSerializerSetExplicit)
            {
                object[] deserializedObjects = (object[])_serializer.Deserialize(reader);
                if (deserializedObjects != null && deserializedObjects.Length > 0)
                    return deserializedObjects[0];
                else
                    return null;
            }
            else
                return _serializer.Deserialize(reader);
        }

        public override bool IsStartObject(XmlDictionaryReader reader)
        {
            if (reader == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("reader"));

            reader.MoveToElement();

            if (_rootName != null)
            {
                return reader.IsStartElement(_rootName, _rootNamespace);
            }
            else
            {
                return reader.IsStartElement();
            }
        }
    }
}


text: export { FlightSchedule24 as default } from "../../";


text:
/* global Feature Scenario */
Feature('themes')

// nothing

Scenario('It should display button Labels: null | null', async (I) => {
  I.amOnPage('themes.html')
  I.waitForText('Themes Test Page')
  I.waitForText('Collapse')
  I.waitForText('Edit JSON')
  I.waitForText('Object Properties')
  I.waitForText('Delete item')
  I.waitForText('Delete Last item')
  I.waitForText('Delete All')
  I.waitForText('Move down')
  I.waitForText('Move up')
})

// only themes

Scenario('It should display button Labels: barebones | null', async (I) => {
  I.amOnPage('themes.html')
  I.waitForText('Themes Test Page')
  I.waitForText('Collapse')
  I.waitForText('Edit JSON')
  I.waitForText('Object Properties')
  I.waitForText('Delete item')
  I.waitForText('Delete Last item')
  I.waitForText('Delete All')
  I.waitForText('Move down')
  I.waitForText('Move up')
})

Scenario('It should display button Labels: spectre | null', async (I) => {
  I.amOnPage('themes.html')
  I.selectOption('theme', 'Spectre')
  I.waitForText('Themes Test Page')
  I.waitForText('Collapse')
  I.waitForText('Edit JSON')
  I.waitForText('Object Properties')
  I.waitForText('Delete item')
  I.waitForText('Delete Last item')
  I.waitForText('Delete All')
  I.waitForText('Move down')
  I.waitForText('Move up')
})

/*
  Scenario('It should display button Labels: materialize | null', async (I) => {
  I.amOnPage('themes.html')
  I.selectOption('theme', 'Materialize')
  I.waitForText('Themes Test Page')
  I.waitForText('COLLAPSE')
  I.waitForText('EDIT JSON')
  I.waitForText('OBJECT PROPERTIES')
  I.waitForText('DELETE ITEM')
  I.waitForText('DELETE LAST ITEM')
  I.waitForText('DELETE ALL')
  I.waitForText('MOVE DOWN')
  I.waitForText('MOVE UP')
})
*/
/*
Scenario('It should display button Labels: jqueryui | null', async (I) => {
  I.amOnPage('themes.html')
  I.selectOption('theme', 'jQuery UI')
  I.waitForText('Themes Test Page')
  I.waitForText('Collapse')
  I.waitForText('Edit JSON')
  I.waitForText('Object Properties')
  I.waitForText('Delete item')
  I.waitForText('Delete Last item')
  I.waitForText('Delete All')
  I.waitForText('Move down')
  I.waitForText('Move up')
})
*/

/*Scenario('It should display button Labels: foundation6 | null', async (I) => {
  I.amOnPage('themes.html')
  I.selectOption('theme', 'Foundation 6')
  I.waitForText('Themes Test Page')
  I.waitForText('Collapse')
  I.waitForText('Edit JSON')
  I.waitForText('Object Properties')
  I.waitForText('Delete item')
  I.waitForText('Delete Last item')
  I.waitForText('Delete All')
  I.waitForText('Move down')
  I.waitForText('Move up')
})

Scenario('It should display button Labels: foundation5 | null', async (I) => {
  I.amOnPage('themes.html')
  I.selectOption('theme', 'Foundation 5')
  I.waitForText('Themes Test Page')
  I.waitForText('Collapse')
  I.waitForText('Edit JSON')
  I.waitForText('Object Properties')
  I.waitForText('Delete item')
  I.waitForText('Delete Last item')
  I.waitForText('Delete All')
  I.waitForText('Move down')
  I.waitForText('Move up')
})

Scenario('It should display button Labels: foundation4 | null', async (I) => {
  I.amOnPage('themes.html')
  I.selectOption('theme', 'Foundation 4')
  I.waitForText('Themes Test Page')
  I.waitForText('Collapse')
  I.waitForText('Edit JSON')
  I.waitForText('Object Properties')
  I.waitForText('Delete item')
  I.waitForText('Delete Last item')
  I.waitForText('Delete All')
  I.waitForText('Move down')
  I.waitForText('Move up')
})

Scenario('It should display button Labels: foundation3 | null', async (I) => {
  I.amOnPage('themes.html')
  I.selectOption('theme', 'Foundation 3')
  I.waitForText('Themes Test Page')
  I.waitForText('Collapse')
  I.waitForText('Edit JSON')
  I.waitForText('Object Properties')
  I.waitForText('Delete item')
  I.waitForText('Delete Last item')
  I.waitForText('Delete All')
  I.waitForText('Move down')
  I.waitForText('Move up')
})
*/

Scenario('It should display button Labels: bootstrap4 | null', async (I) => {
  I.amOnPage('themes.html')
  I.selectOption('theme', 'Bootstrap 4')
  I.waitForText('Themes Test Page')
  I.waitForText('Collapse')
  I.waitForText('Edit JSON')
  I.waitForText('Object Properties')
  I.waitForText('Delete item')
  I.waitForText('Delete Last item')
  I.waitForText('Delete All')
  I.waitForText('Move down')
  I.waitForText('Move up')
})
/*
Scenario('It should display button Labels: bootstrap3 | null', async (I) => {
  I.amOnPage('themes.html')
  I.selectOption('theme', 'Bootstrap 3')
  I.waitForText('Themes Test Page')
  I.waitForText('Collapse')
  I.waitForText('Edit JSON')
  I.waitForText('Object Properties')
  I.waitForText('Delete item')
  I.waitForText('Delete Last item')
  I.waitForText('Delete All')
  I.waitForText('Move down')
  I.waitForText('Move up')
})

Scenario('It should display button Labels: bootstrap2 | null', async (I) => {
  I.amOnPage('themes.html')
  I.selectOption('theme', 'Bootstrap 2')
  I.waitForText('Themes Test Page')
  I.waitForText('Collapse')
  I.waitForText('Edit JSON')
  I.waitForText('Object Properties')
  I.waitForText('Delete item')
  I.waitForText('Delete Last item')
  I.waitForText('Delete All')
  I.waitForText('Move down')
  I.waitForText('Move up')
})
*/
// only icons

/*
  Scenario('It should hide button Labels: null | bootstrap2', async (I) => {
  I.amOnPage('themes.html')
  I.selectOption('iconlib', 'Bootstrap 2')
  I.waitForText('Themes Test Page')
  I.dontSee('Collapse')
  I.dontSee('Edit JSON')
  I.dontSee('Object Properties')
  I.dontSee('Delete item')
  I.dontSee('Delete Last item')
  I.dontSee('Delete All')
  I.dontSee('Move down')
  I.dontSee('Move up')

  I.click('Collapse')
  I.seeElementInDOM('i.icon-chevron-down')
  I.seeElementInDOM('i.icon-chevron-up')
  I.seeElementInDOM('i.icon-trash')
  I.seeElementInDOM('i.icon-pencil')
  I.seeElementInDOM('i.icon-plus')
  I.seeElementInDOM('i.icon-minus')
  I.seeElementInDOM('i.icon-ban-circle')
  I.seeElementInDOM('i.icon-ok')
  I.seeElementInDOM('i.icon-arrow-up')
  I.seeElementInDOM('i.icon-arrow-right')
  I.seeElementInDOM('i.icon-arrow-down')
  I.seeElementInDOM('i.icon-arrow-left')
  I.seeElementInDOM('i.icon-copy')
  I.seeElementInDOM('i.icon-list')
})

Scenario('It should hide button Labels: null | bootstrap3', async (I) => {
  I.amOnPage('themes.html')
  I.selectOption('iconlib', 'Bootstrap 3')
  I.waitForText('Themes Test Page')
  I.dontSee('Collapse')
  I.dontSee('Edit JSON')
  I.dontSee('Object Properties')
  I.dontSee('Delete item')
  I.dontSee('Delete Last item')
  I.dontSee('Delete All')
  I.dontSee('Move down')
  I.dontSee('Move up')

  I.click('Collapse')
  I.seeElementInDOM('i.glyphicon.glyphicon-chevron-down')
  I.seeElementInDOM('i.glyphicon.glyphicon-chevron-right')
  I.seeElementInDOM('i.glyphicon.glyphicon-trash')
  I.seeElementInDOM('i.glyphicon.glyphicon-pencil')
  I.seeElementInDOM('i.glyphicon.glyphicon-plus')
  I.seeElementInDOM('i.glyphicon.glyphicon-minus')
  I.seeElementInDOM('i.glyphicon.glyphicon-floppy-remove')
  I.seeElementInDOM('i.glyphicon.glyphicon-floppy-saved')
  I.seeElementInDOM('i.glyphicon.glyphicon-arrow-up')
  I.seeElementInDOM('i.glyphicon.glyphicon-arrow-right')
  I.seeElementInDOM('i.glyphicon.glyphicon-arrow-down')
  I.seeElementInDOM('i.glyphicon.glyphicon-arrow-left')
  I.seeElementInDOM('i.glyphicon.glyphicon-copy')
  I.seeElementInDOM('i.glyphicon.glyphicon-list')
})

Scenario('It should hide button Labels: null | fontawesome3', async (I) => {
  I.amOnPage('themes.html')
  I.selectOption('iconlib', 'fontawesome 3')
  I.waitForText('Themes Test Page')
  I.dontSee('Collapse')
  I.dontSee('Edit JSON')
  I.dontSee('Object Properties')
  I.dontSee('Delete item')
  I.dontSee('Delete Last item')
  I.dontSee('Delete All')
  I.dontSee('Move down')
  I.dontSee('Move up')

  I.click('Collapse')
  I.seeElementInDOM('i.icon-chevron-down')
  I.seeElementInDOM('i.icon-chevron-right')
  I.seeElementInDOM('i.icon-trash')
  I.seeElementInDOM('i.icon-pencil')
  I.seeElementInDOM('i.icon-plus')
  I.seeElementInDOM('i.icon-minus')
  I.seeElementInDOM('i.icon-ban-circle')
  I.seeElementInDOM('i.icon-save')
  I.seeElementInDOM('i.icon-arrow-up')
  I.seeElementInDOM('i.icon-arrow-right')
  I.seeElementInDOM('i.icon-arrow-down')
  I.seeElementInDOM('i.icon-arrow-left')
  I.seeElementInDOM('i.icon-copy')
  I.seeElementInDOM('i.icon-list')
})

Scenario('It should hide button Labels: null | fontawesome4', async (I) => {
  I.amOnPage('themes.html')
  I.selectOption('iconlib', 'fontawesome 4')
  I.waitForText('Themes Test Page')
  I.dontSee('Collapse')
  I.dontSee('Edit JSON')
  I.dontSee('Object Properties')
  I.dontSee('Delete item')
  I.dontSee('Delete Last item')
  I.dontSee('Delete All')
  I.dontSee('Move down')
  I.dontSee('Move up')

  I.click('Collapse')
  I.seeElementInDOM('i.fa.fa-caret-square-o-down')
  I.seeElementInDOM('i.fa.fa-caret-square-o-right')
  I.seeElementInDOM('i.fa.fa-times')
  I.seeElementInDOM('i.fa.fa-pencil')
  I.seeElementInDOM('i.fa.fa-plus')
  I.seeElementInDOM('i.fa.fa-minus')
  I.seeElementInDOM('i.fa.fa-ban')
  I.seeElementInDOM('i.fa.fa-save')
  I.seeElementInDOM('i.fa.fa-arrow-up')
  I.seeElementInDOM('i.fa.fa-arrow-right')
  I.seeElementInDOM('i.fa.fa-arrow-down')
  I.seeElementInDOM('i.fa.fa-arrow-left')
  I.seeElementInDOM('i.fa.fa-files-o')
  I.seeElementInDOM('i.fa.fa-list')
})

Scenario('It should hide button Labels: null | fontawesome5', async (I) => {
  I.amOnPage('themes.html')
  I.selectOption('iconlib', 'fontawesome 5')
  I.waitForText('Themes Test Page')
  I.dontSee('Collapse')
  I.dontSee('Edit JSON')
  I.dontSee('Object Properties')
  I.dontSee('Delete item')
  I.dontSee('Delete Last item')
  I.dontSee('Delete All')
  I.dontSee('Move down')
  I.dontSee('Move up')

  I.click('Collapse')
  I.seeElementInDOM('i.fas.fa-caret-down')
  I.seeElementInDOM('i.fas.fa-caret-right')
  I.seeElementInDOM('i.fas.fa-trash')
  I.seeElementInDOM('i.fas.fa-pen')
  I.seeElementInDOM('i.fas.fa-plus')
  I.seeElementInDOM('i.fas.fa-minus')
  I.seeElementInDOM('i.fas.fa-ban')
  I.seeElementInDOM('i.fas.fa-save')
  I.seeElementInDOM('i.fas.fa-arrow-up')
  I.seeElementInDOM('i.fas.fa-arrow-right')
  I.seeElementInDOM('i.fas.fa-arrow-down')
  I.seeElementInDOM('i.fas.fa-arrow-left')
  I.seeElementInDOM('i.fas.fa-copy')
  I.seeElementInDOM('i.fas.fa-list')
})

Scenario('It should hide button Labels: null | foundation3', async (I) => {
  I.amOnPage('themes.html')
  I.selectOption('iconlib', 'Foundation 3')
  I.waitForText('Themes Test Page')
  I.dontSee('Collapse')
  I.dontSee('Edit JSON')
  I.dontSee('Object Properties')
  I.dontSee('Delete item')
  I.dontSee('Delete Last item')
  I.dontSee('Delete All')
  I.dontSee('Move down')
  I.dontSee('Move up')

  I.click('Collapse')
  I.seeElementInDOM('i.fi-minus')
  I.seeElementInDOM('i.fi-plus')
  I.seeElementInDOM('i.fi-trash')
  I.seeElementInDOM('i.fi-pencil')
  I.seeElementInDOM('i.fi-plus')
  I.seeElementInDOM('i.fi-minus')
  I.seeElementInDOM('i.fi-x-circle')
  I.seeElementInDOM('i.fi-save')
  I.seeElementInDOM('i.fi-arrow-up')
  I.seeElementInDOM('i.fi-arrow-right')
  I.seeElementInDOM('i.fi-arrow-down')
  I.seeElementInDOM('i.fi-arrow-left')
  I.seeElementInDOM('i.fi-page-copy')
  I.seeElementInDOM('i.fi-list')
})

Scenario('It should hide button Labels: null | jqueryui', async (I) => {
  I.amOnPage('themes.html')
  I.selectOption('iconlib', 'jQuery UI')
  I.waitForText('Themes Test Page')
  I.dontSee('Collapse')
  I.dontSee('Edit JSON')
  I.dontSee('Object Properties')
  I.dontSee('Delete item')
  I.dontSee('Delete Last item')
  I.dontSee('Delete All')
  I.dontSee('Move down')
  I.dontSee('Move up')

  I.click('Collapse')
  I.seeElementInDOM('i.ui-icon.ui-icon-triangle-1-s')
  I.seeElementInDOM('i.ui-icon.ui-icon-triangle-1-e')
  I.seeElementInDOM('i.ui-icon.ui-icon-trash')
  I.seeElementInDOM('i.ui-icon.ui-icon-pencil')
  I.seeElementInDOM('i.ui-icon.ui-icon-plusthick')
  I.seeElementInDOM('i.ui-icon.ui-icon-minusthick')
  I.seeElementInDOM('i.ui-icon.ui-icon-closethick')
  I.seeElementInDOM('i.ui-icon.ui-icon-disk')
  I.seeElementInDOM('i.ui-icon.ui-icon-arrowthick-1-n')
  I.seeElementInDOM('i.ui-icon.ui-icon-arrowthick-1-e')
  I.seeElementInDOM('i.ui-icon.ui-icon-arrowthick-1-s')
  I.seeElementInDOM('i.ui-icon.ui-icon-arrowthick-1-w')
  I.seeElementInDOM('i.ui-icon.ui-icon-copy')
  I.seeElementInDOM('i.ui-icon.ui-icon-note')
})

Scenario('It should hide button Labels: null | materialicons', async (I) => {
  I.amOnPage('themes.html')
  I.selectOption('iconlib', 'Material icons')
  I.waitForText('Themes Test Page')
  I.dontSee('Collapse')
  I.dontSee('Edit JSON')
  I.dontSee('Object Properties')
  I.dontSee('Delete item')
  I.dontSee('Delete Last item')
  I.dontSee('Delete All')
  I.dontSee('Move down')
  I.dontSee('Move up')

  I.waitForText('arrow_drop_up', 'i.material-icons')
  I.waitForText('delete', 'i.material-icons')
  I.waitForText('edit', 'i.material-icons')
  I.waitForText('add', 'i.material-icons')
  I.waitForText('remove', 'i.material-icons')
  I.waitForText('arrow_upward', 'i.material-icons')
  I.waitForText('arrow_downward', 'i.material-icons')
  I.waitForText('arrow_forward', 'i.material-icons')
  I.click('#root\\.arraycasetabstop\\.arraytest\\.1')
  I.waitForText('arrow_back', 'i.material-icons')
  I.waitForText('list', 'i.material-icons')
  I.click('Edit JSON')
  I.waitForText('save', 'i.material-icons')
  I.waitForText('content_copy', 'i.material-icons')
  I.waitForText('cancel', 'i.material-icons')
  I.click('Collapse')
  I.waitForText('arrow_drop_down', 'i.material-icons')
})
*/
Scenario('It should hide button Labels: null | spectre', async (I) => {
  I.amOnPage('themes.html')
  I.selectOption('iconlib', 'Spectre')
  I.waitForText('Themes Test Page')
  I.dontSee('Collapse')
  I.dontSee('Edit JSON')
  I.dontSee('Object Properties')
  I.dontSee('Delete item')
  I.dontSee('Delete Last item')
  I.dontSee('Delete All')
  I.dontSee('Move down')
  I.dontSee('Move up')

  I.click('.json-editor-btn-collapse')
  I.seeElementInDOM('i.icon.icon-arrow-down')
  I.seeElementInDOM('i.icon.icon-arrow-right')
  I.seeElementInDOM('i.icon.icon-delete')
  I.seeElementInDOM('i.icon.icon-edit')
  I.seeElementInDOM('i.icon.icon-plus')
  I.seeElementInDOM('i.icon.icon-minus')
  I.seeElementInDOM('i.icon.icon-cross')
  I.seeElementInDOM('i.icon.icon-check')
  I.seeElementInDOM('i.icon.icon-upward')
  I.seeElementInDOM('i.icon.icon-forward')
  I.seeElementInDOM('i.icon.icon-downward')
  I.seeElementInDOM('i.icon.icon-back')
  I.seeElementInDOM('i.icon.icon-copy')
  I.seeElementInDOM('i.icon.icon-menu')
})

// icons + themes

Scenario('It should hide button Labels: spectre | spectre', async (I) => {
  I.amOnPage('themes.html')
  I.selectOption('theme', 'Spectre')
  I.selectOption('iconlib', 'Spectre')
  I.waitForText('Themes Test Page')
  I.dontSee('Collapse')
  I.dontSee('Edit JSON')
  I.dontSee('Object Properties')
  I.dontSee('Delete item')
  I.dontSee('Delete Last item')
  I.dontSee('Delete All')
  I.dontSee('Move down')
  I.dontSee('Move up')

  I.click('.json-editor-btn-collapse')
  I.seeElementInDOM('i.icon.icon-arrow-down')
  I.seeElementInDOM('i.icon.icon-arrow-right')
  I.seeElementInDOM('i.icon.icon-delete')
  I.seeElementInDOM('i.icon.icon-edit')
  I.seeElementInDOM('i.icon.icon-plus')
  I.seeElementInDOM('i.icon.icon-minus')
  I.seeElementInDOM('i.icon.icon-cross')
  I.seeElementInDOM('i.icon.icon-check')
  I.seeElementInDOM('i.icon.icon-upward')
  I.seeElementInDOM('i.icon.icon-forward')
  I.seeElementInDOM('i.icon.icon-downward')
  I.seeElementInDOM('i.icon.icon-back')
  I.seeElementInDOM('i.icon.icon-copy')
  I.seeElementInDOM('i.icon.icon-menu')
})


text: module.exports = require('./zipfile');


text:
{#-
       Licensed to the Apache Software Foundation (ASF) under one
       or more contributor license agreements.  See the NOTICE file
       distributed with this work for additional information
       regarding copyright ownership.  The ASF licenses this file
       to you 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.
-#}
{% extends g.theme.master %}
{% do g.register_forge_css('css/hilite.css') %}
{% do g.register_app_css('css/tracker.css') %}

{% block title %}{{c.project.name}} / {{app.config.options.mount_label}} / Saved Searches{% endblock %}

{% block head %}
  <link rel="alternate" type="application/rss+xml" title="RSS" href="feed.rss"/>
  <link rel="alternate" type="application/atom+xml" title="Atom" href="feed.atom"/>
{% endblock %}

{% block header %}Saved Searches{% endblock %}

{% block content %}
  <form action="{{c.project.url()}}admin/{{app.config.options.mount_point}}/bins/update_bins" method="post"
        class="update_bins" id="saved-search-form">

          Name
          Terms

        {% if not bins %}

No saved searches have been created yet.

        {% endif %}
        {% for bin in bins %}

            {{bin.summary}}
            {{bin.terms}}
            <input type="text" name="bins-{{loop.index0}}.summary" value="{{bin.summary}}">

                <input class="grid-8" type="text" name="bins-{{loop.index0}}.terms" value="{{bin.terms}}">

                  {{ g.icons['help'].render(
                      show_title=True,
                      target='_blank',
                      href=tg.url(app.url + 'search_help/'),
                      extra_css='btn search_help_modal') }}
                {% if bin.error %}
{{bin.error}}{% endif %}

              {{ g.icons['delete'].render(extra_css='del_bin') }}
              {{ g.icons['edit'].render(extra_css='edit_bin') }}
              <input type="hidden" name="bins-{{loop.index0}}.id" value="{{bin._id | string}}">
              <input type="hidden" name="bins-{{loop.index0}}.delete" value="False" class="delete_flag">

        {% endfor %}
        {% set num_bins = bins.__len__() %}

            <input type="hidden" name="bins-{{num_bins}}.id">
            <input type="hidden" name="bins-{{num_bins}}.delete" value="False" class="delete_flag">
            <input type="text" name="bins-{{num_bins}}.summary" placeholder="Summary" {% if new_bin %}value="{{new_bin.summary}}"{% endif %}>

            <input class="grid-8" type="text" name="bins-{{num_bins}}.terms" placeholder="Terms" {% if new_bin %}value="{{new_bin.terms}}"{% endif %}>

              {{ g.icons['help'].render(
                  show_title=True,
                  target='_blank',
                  href=tg.url(app.url + 'search_help/'),
                  extra_css='btn search_help_modal') }}
            {% if new_bin and new_bin.error %}
{{new_bin.error}}{% endif %}

Add Search

      <input type="submit" value="Save">
      {% if errors %}
        Cancel
      {% else %}
        Cancel
      {% endif %}

    {{lib.csrf_token()}}
  </form>
{% endblock %}

{% block extra_js %}

{% endblock %}


text:
class FixUserlessArticles < ActiveRecord::Migration
  class User < ActiveRecord::Base
  end
  class Content < ActiveRecord::Base
  end
  class Article < Content
  end

  def self.up
    unless $schema_generator
      articles = Article.find(:all)
      say "Fixing articles with empty user_id"

      articles.each do |article|
        if article.user.nil?
          say "Fixing article #{article.id} having empty user", true
          article.user_id = 1
          article.save!
        end
      end
    end
  end

  def self.down

  end
end


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

  // Public scope

  function Projectile(cv, x, y, width, height, direction, speed) {
    this.cv = cv;
    this.x = x;
    this.y = y;
    this.width = width;
    this.height = height;
    this.direction = direction;
    this.speed = speed;
  }

  Projectile.prototype.draw = function() {
    this.x += this.speed;
    this.cv.fillStyle = '#000';
    this.cv.fillRect(this.x + this.width / 2,
                     this.y + this.height / 2,
                     8,
                     3);
  };

  // Public scope

  /*
   * Projectile factory
   */
  modules.Projectiles = (function() {
    return {
      projectiles: [],
      new: function(cv, x, y, width, height, direction, speed) {
        this.projectiles.push(
          new Projectile(cv, x, y, width, height, direction, speed));
      },

      getActive: function() {
        return this.projectiles.length;
      },

      draw: function() {
        for (var i = 0; i < this.projectiles.length; i++) {
          this.projectiles[i].draw();
        }
      }
    };
  })();

  window.$modules = modules;
})(window.$modules || {});


text:
<?php
/**
 * Created by PhpStorm.
 * User: hebidu
 * Date: 16/6/20
 * Time: 10:09
 */

namespace Money\Logic;

use Home\Api\DistributorCfgApi;
use Home\Api\FinAccountBalanceHisApi;
use Home\Model\FinAccountBalanceHisModel;

class DistributorMoney {

    public function withdrawMoney($uid,$money){
        $map = array(
            'uid'=>$uid,
        );

        $api = new DistributorCfgApi();
        $api->startTrans();

        $result = $api->setDec($map,"money",$money);
        if(!$result['status']){
            return $result;
        }

        $api->setInc($map,"frozen_money",$money);

        if($result['status']){
            $api->commit();
        }else{
            $api->rollback();
        }

        return $result;
    }

    /**
     * 分配给推荐人一部分佣金
     * @param $uid
     * @param $brokerage
     */
    public function  allocDistributeMoney($uid,$brokerage){

        $map = array(
            'uid'=>$uid,
        );

        $result  = apiCall(DistributorCfgApi::GET_INFO,array($map));
        $distrbutor_info = $result['info'];

        if($result['status'] && is_array($distrbutor_info)){
            //
            $rebate = floatval($distrbutor_info['rebate']);
//            $money = $distrbutor_info['money'];
//            $frozen_money = $distrbutor_info['frozen_money'];
            $addedMoney = $brokerage * $rebate;
            $this->addMoney($uid,$addedMoney,$distrbutor_info);
        }
    }

    public function addMoney($uid,$addedMoney,$distrbutor_info){
        $map = array(
            'uid'=>$uid,
        );

        $result = apiCall(DistributorCfgApi::SET_INC,array($map,"money",$addedMoney));

        if($result['status']){
            $this->log($uid,0,$addedMoney,$distrbutor_info);
        }else{
            LogRecord("返佣时发生错误addMoney,info=".$result['info'],__FILE__.__LINE__,LOG_EMERG);
        }

    }

    private function log($uid,$defray,$income,$distrbutor_info){
        $notes = "获得分成".$income."元!";

        $entity = array(
            'uid'=>$uid,
            'defray'=>$defray,
            'income'=>$income,
            'left_money'=>$distrbutor_info['money']+$defray,
            'frozen_money'=>0,
            'create_time'=>time(),
            'notes'=>$notes,
            'dtree_type'=>FinAccountBalanceHisModel::TYPE_DISTRIBUTOR_GET,
            'imgurl'=>'',
            'status'=>FinAccountBalanceHisModel::STATUS_PASSED,
            'extra'=>$distrbutor_info['uid'],

        );

        $result = apiCall(FinAccountBalanceHisApi::ADD,array($entity));

        if(!$result['status']){
            LogRecord("返佣时发生错误log,info=".$result['info'],__FILE__.__LINE__,LOG_EMERG);
        }

    }
}


text:
import React from 'react';
import { shallow } from 'enzyme';

import Footer from './Footer';

describe('Component: Footer', () => {
  it('renders without crashing', () => {
    const wrapper = shallow(<Footer />);
    expect(wrapper).toHaveLength(1);
  });
});


text:
<?php

namespace Kanboard\Auth;

use Otp\Otp;
use Otp\GoogleAuthenticator;
use Base32\Base32;
use Kanboard\Core\Base;
use Kanboard\Core\Security\PostAuthenticationProviderInterface;

/**
 * TOTP Authentication Provider
 *
 * @package  auth
 * @author   Frederic Guillot
 */
class TotpAuth extends Base implements PostAuthenticationProviderInterface
{
    /**
     * User pin code
     *
     * @access protected
     * @var string
     */
    protected $code = '';

    /**
     * Private key
     *
     * @access protected
     * @var string
     */
    protected $secret = '';

    /**
     * Get authentication provider name
     *
     * @access public
     * @return string
     */
    public function getName()
    {
        return t('Time-based One-time Password Algorithm');
    }

    /**
     * Authenticate the user
     *
     * @access public
     * @return boolean
     */
    public function authenticate()
    {
        $otp = new Otp;
        return $otp->checkTotp(Base32::decode($this->secret), $this->code);
    }

    /**
     * Called before to prompt the user
     *
     * @access public
     */
    public function beforeCode()
    {

    }

    /**
     * Set validation code
     *
     * @access public
     * @param  string $code
     */
    public function setCode($code)
    {
        $this->code = $code;
    }

    /**
     * Generate secret
     *
     * @access public
     * @return string
     */
    public function generateSecret()
    {
        $this->secret = GoogleAuthenticator::generateRandom();
        return $this->secret;
    }

    /**
     * Set secret token
     *
     * @access public
     * @param  string  $secret
     */
    public function setSecret($secret)
    {
        $this->secret = $secret;
    }

    /**
     * Get secret token
     *
     * @access public
     * @return string
     */
    public function getSecret()
    {
        return $this->secret;
    }

    /**
     * Get QR code url
     *
     * @access public
     * @param  string $label
     * @return string
     */
    public function getQrCodeUrl($label)
    {
        if (empty($this->secret)) {
            return '';
        }

        $options = array('issuer' => TOTP_ISSUER);
        return GoogleAuthenticator::getQrCodeUrl('totp', $label, $this->secret, null, $options);
    }

    /**
     * Get key url (empty if no url can be provided)
     *
     * @access public
     * @param  string $label
     * @return string
     */
    public function getKeyUrl($label)
    {
        if (empty($this->secret)) {
            return '';
        }

        $options = array('issuer' => TOTP_ISSUER);
        return GoogleAuthenticator::getKeyUri('totp', $label, $this->secret, null, $options);
    }
}


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.
 */

package org.camunda.bpm.dmn.feel.impl.juel;

import org.camunda.bpm.dmn.feel.impl.FeelException;

/**
 * Exception thrown if a method used in a FEEL expression is not available.
 */
public class FeelMissingFunctionException extends FeelException {

  protected String function;

  public FeelMissingFunctionException(String message, String function) {
    super(message);
    this.function = function;
  }

  public FeelMissingFunctionException(String message, Throwable cause, String function) {
    super(message, cause);
    this.function = function;
  }

  public String getFunction() {
    return function;
  }

}


text:
<?php

namespace StaticBundlerTest\Controller;

use StaticBundlerTest\Bootstrap;
use PHPUnit_Framework_TestCase;

class BundleControllerTest extends PHPUnit_Framework_TestCase
{
    protected $serviceManager;

    public function setUp()
    {
        parent::setUp();

        $this->serviceManager = Bootstrap::getServiceManager();
    }

    public function testTest()
    {
        //
    }
}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
Biblioth. Bot. 22(Heft 89):297(851). 1927

#### Original name
Oxleya xanthoxyla A.Cunn.

### Remarks
null


text:
namespace Google.Identity.AccessContextManager.V1.Snippets
{
    // [START accesscontextmanager_v1_generated_AccessContextManager_GetAccessPolicy_async_flattened]
    using Google.Identity.AccessContextManager.V1;
    using System.Threading.Tasks;

    public sealed partial class GeneratedAccessContextManagerClientSnippets
    {
        /// <summary>Snippet for GetAccessPolicyAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated and should be regarded as a code template only.
        /// It will require modifications to work:
        /// - It may require correct/in-range values for request initialization.
        /// - It may require specifying regional endpoints when creating the service client as shown in
        ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
        /// </remarks>
        public async Task GetAccessPolicyAsync()
        {
            // Create client
            AccessContextManagerClient accessContextManagerClient = await AccessContextManagerClient.CreateAsync();
            // Initialize request argument(s)
            string name = "accessPolicies/[ACCESS_POLICY]";
            // Make the request
            AccessPolicy response = await accessContextManagerClient.GetAccessPolicyAsync(name);
        }
    }
    // [END accesscontextmanager_v1_generated_AccessContextManager_GetAccessPolicy_async_flattened]
}