text:
#pragma once
#include <aws/email/SES_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Xml
{
  class XmlNode;
} // namespace Xml
} // namespace Utils
namespace SES
{
namespace Model
{

  /**
   *
Indicates that the provided AWS Lambda function is invalid, or that Amazon
   * SES could not execute the provided function, possibly due to permissions issues.
   * For information about giving permissions, see the Amazon
   * SES Developer Guide.

See Also:
   AWS
   * API Reference

   */
  class AWS_SES_API InvalidLambdaFunctionException
  {
  public:
    InvalidLambdaFunctionException();
    InvalidLambdaFunctionException(const Aws::Utils::Xml::XmlNode& xmlNode);
    InvalidLambdaFunctionException& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);

    void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
    void OutputToStream(Aws::OStream& oStream, const char* location) const;

    /**
     *
Indicates that the ARN of the function was not found.

     */
    inline const Aws::String& GetFunctionArn() const{ return m_functionArn; }

    /**
     *
Indicates that the ARN of the function was not found.

     */
    inline bool FunctionArnHasBeenSet() const { return m_functionArnHasBeenSet; }

    /**
     *
Indicates that the ARN of the function was not found.

     */
    inline void SetFunctionArn(const Aws::String& value) { m_functionArnHasBeenSet = true; m_functionArn = value; }

    /**
     *
Indicates that the ARN of the function was not found.

     */
    inline void SetFunctionArn(Aws::String&& value) { m_functionArnHasBeenSet = true; m_functionArn = std::move(value); }

    /**
     *
Indicates that the ARN of the function was not found.

     */
    inline void SetFunctionArn(const char* value) { m_functionArnHasBeenSet = true; m_functionArn.assign(value); }

    /**
     *
Indicates that the ARN of the function was not found.

     */
    inline InvalidLambdaFunctionException& WithFunctionArn(const Aws::String& value) { SetFunctionArn(value); return *this;}

    /**
     *
Indicates that the ARN of the function was not found.

     */
    inline InvalidLambdaFunctionException& WithFunctionArn(Aws::String&& value) { SetFunctionArn(std::move(value)); return *this;}

    /**
     *
Indicates that the ARN of the function was not found.

     */
    inline InvalidLambdaFunctionException& WithFunctionArn(const char* value) { SetFunctionArn(value); return *this;}

  private:

    Aws::String m_functionArn;
    bool m_functionArnHasBeenSet;
  };

} // namespace Model
} // namespace SES
} // namespace Aws


text:
@interface RLMMigration ()

@property (nonatomic, strong) RLMRealm *oldRealm;
@property (nonatomic, strong) RLMRealm *realm;

+ (instancetype)migrationAtPath:(NSString *)path error:(NSError **)error;

- (void)migrateWithBlock:(RLMMigrationBlock)block;

@end

redpajama_set_name: RedPajamaGithub


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.frc1675.commands;

/**
 *
 * @author Tony Stano
 */
public class CompressorWork extends CommandBase {

    public CompressorWork() {
        requires(compressor);

    }

    // Called just before this Command runs the first time
    protected void initialize() {
        compressor.init();

    }

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
        compressor.work();
    }

    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
        return false;
    }

    // Called once after isFinished returns true
    protected void end() {
        compressor.stop();
    }

    // Called when another command which requires one or more of the same
    // subsystems is scheduled to run
    protected void interrupted() {
        compressor.stop();
    }
}


text:
package org.jetbrains.plugins.scala
package lang
package psi
package api
package base
package patterns

import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import org.jetbrains.plugins.scala.lang.psi.api.base.types.ScSequenceArg
import org.jetbrains.plugins.scala.lang.psi.api.statements.params._

/**
* @author Alexander Podkhalyuzin
* Date: 28.02.2008
*/

trait ScPatternArgumentList extends ScArguments {

  def patterns: Seq[ScPattern]

  def missedLastExpr: Boolean = {
    var child = getLastChild
    while (child != null && child.getNode.getElementType != ScalaTokenTypes.tCOMMA) {
      if (child.isInstanceOf[ScPattern] || child.isInstanceOf[ScSequenceArg]) return false
      child = child.getPrevSibling
    }
    return child != null && child.getNode.getElementType == ScalaTokenTypes.tCOMMA
  }

  override def getArgsCount: Int = patterns.length
}


text:
package com.usearch.factorys;

import com.usearch.interfaces.ResponseCallBack;

import org.json.JSONObject;

public class ProductFactory {

    public static void create(JSONObject jsonObject, ResponseCallBack callback){

    }

}


text:
import { TestBed } from '@angular/core/testing';
import { testUtils } from 'src/utils/test';
import { AudioService } from './audio-service';
import { AudioSource, AUDIO_SOURCE_PROVIDER } from './audio-source';
import { PlayerActions } from './player-actions';

describe('player', () => {
  describe('AudioService', () => {
    let actions: PlayerActions;
    let audio: AudioSource;
    let audioService: AudioService;

    beforeEach(() => {
      let injector = TestBed.configureTestingModule({
        providers: [
          AUDIO_SOURCE_PROVIDER,
          PlayerActions,
          {
            provide: AudioService,
            deps: [PlayerActions, AudioSource],
            useFactory: (actions: PlayerActions, audio: AudioSource) => {
              return new AudioService(actions, audio);
            }
          }
        ]
      });

      actions = injector.get(PlayerActions);
      audio = injector.get(AudioSource);
      audioService = injector.get(AudioService);
    });

    describe('audio events', () => {
      it('`ended` event should dispatch AUDIO_ENDED action', () => {
        audioService.events$.subscribe(action => {
          expect(action).toEqual(actions.audioEnded());
        });

        audio.dispatchEvent(new Event('ended'));
      });

      it('`pause` event should dispatch AUDIO_PAUSED action', () => {
        audioService.events$.subscribe(action => {
          expect(action).toEqual(actions.audioPaused());
        });

        audio.dispatchEvent(new Event('pause'));
      });

      it('`playing` event should dispatch AUDIO_PLAYING action', () => {
        audioService.events$.subscribe(action => {
          expect(action).toEqual(actions.audioPlaying());
        });

        audio.dispatchEvent(new Event('playing'));
      });

      it('`timeupdate` event should dispatch AUDIO_TIME_UPDATED action', () => {
        let times = {
          bufferedTime: 0,
          currentTime: 0,
          duration: NaN,
          percentBuffered: '0%',
          percentCompleted: '0%'
        };

        audioService.events$.subscribe(action => {
          expect(action).toEqual(actions.audioTimeUpdated(times));
        });

        audio.dispatchEvent(new Event('timeupdate'));
      });

      it('`volumechange` event should dispatch AUDIO_VOLUME_CHANGED action', () => {
        audioService.events$.subscribe(action => {
          expect(action).toEqual(actions.audioVolumeChanged(50));
        });

        audio.volume = 0.5;
        audio.dispatchEvent(new Event('volumechange'));
      });
    });

    describe('decreaseVolume()', () => {
      it('should decrement volume by PLAYER_VOLUME_INCREMENT', () => {
        let volumes = testUtils.getVolumes();
        volumes.reverse().shift();

        audio.volume = 1;

        volumes.forEach(volume => {
          audioService.decreaseVolume();
          expect(audio.volume).toBe(volume.actual);
        });
      });

      it('should NOT decrement volume below zero', () => {
        audio.volume = 0;
        expect(() => audioService.decreaseVolume()).not.toThrow();
      });
    });

    describe('increaseVolume()', () => {
      it('should increment volume by PLAYER_VOLUME_INCREMENT', () => {
        let volumes = testUtils.getVolumes();
        volumes.shift();

        audio.volume = 0;

        volumes.forEach(volume => {
          audioService.increaseVolume();
          expect(audio.volume).toBe(volume.actual);
        });
      });

      it('should NOT increment volume beyond 1', () => {
        audio.volume = 1;
        expect(() => audioService.increaseVolume()).not.toThrow();
      });
    });

    describe('pause()', () => {
      it('should call audio.pause()', () => {
        spyOn(audio, 'pause');
        audioService.pause();
        expect(audio.pause).toHaveBeenCalledTimes(1);
      });
    });

    describe('play()', () => {
      it('should call audio.play()', () => {
        spyOn(audio, 'play');
        audioService.play();
        expect(audio.play).toHaveBeenCalledTimes(1);
      });

      it('should set audio.src if url param is provided', () => {
        let streamUrl = 'https://stream/';
        audioService.play(streamUrl);
        expect(audio.src).toBe(streamUrl);
      });
    });

    describe('seek()', () => {
      it('should set audio.currentTime', () => {
        audioService.seek(100);
        expect(audio.currentTime).toBe(100);
      });
    });
  });
});


text:
package smoketest.layout;

import java.io.File;

import org.springframework.boot.loader.tools.Layout;
import org.springframework.boot.loader.tools.LayoutFactory;

public class SampleLayoutFactory implements LayoutFactory {

	private String name = "sample";

	public SampleLayoutFactory() {
	}

	public SampleLayoutFactory(String name) {
		this.name = name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return this.name;
	}

	@Override
	public Layout getLayout(File source) {
		return new SampleLayout(this.name);
	}

}


text:
/* @flow */
import React from 'react';
import { StyleSheet, View, ScrollView, TextInput } from 'react-native';

import { Auth, Narrow, User } from '../types';
import { Input } from '../common';
import { isStreamNarrow, isTopicNarrow, isPrivateOrGroupNarrow } from '../utils/narrow';
import { registerUserInputActivity } from '../utils/activity';
import sendMessage from '../api/sendMessage';
import SendButton from './SendButton';
import getComposeInputPlaceholder from './getComposeInputPlaceholder';

const MIN_HEIGHT = 38;
const MAX_HEIGHT = 200;

const componentStyles = StyleSheet.create({
  wrapper: {
    flexDirection: 'row',
    alignItems: 'flex-end'
  },
  messageBox: {
    flex: 1,
  },
});

type Props = {
  auth: Auth,
  narrow: Narrow,
  operator: string,
  users: User[],
  text: string,
  handleChangeText: (input: string) => void,
};

export default class ComposeText extends React.Component {

  static contextTypes = {
    styles: () => null,
  };

  props: Props;
  textInput: TextInput;

  state: {
    editing: boolean,
    autocomplete: boolean,
    contentHeight: number,
  }

  state = {
    editing: false,
    autocomplete: false,
    contentHeight: MIN_HEIGHT,
  };

  handleSend = () => {
    const { auth, narrow, operator, text } = this.props;

    if (isPrivateOrGroupNarrow(narrow)) {
      sendMessage(auth, 'private', narrow[0].operand, '', text);
    } else if (isTopicNarrow(narrow) || isStreamNarrow(narrow)) {
      if (operator !== null) {
        sendMessage(auth, 'stream', narrow[0].operand,
        (operator === '') ? '(no topic)' : operator, text);
      } else if (isTopicNarrow(narrow)) {
        sendMessage(auth, 'stream', narrow[0].operand, narrow[1].operand, text);
      } else if (isStreamNarrow(narrow)) {
        sendMessage(auth, 'stream', narrow[0].operand, '(no topic)', text);
      }
    }

    this.clearInput();
  }

  clearInput = () => {
    this.textInput.clear();
    this.setState({
      contentHeight: MIN_HEIGHT,
    });
    this.props.handleChangeText('');
  }

  handleOnChange = (event: Object) =>
    this.setState({ contentHeight: event.nativeEvent.contentSize.height });

  handleChangeText = (text: string) => {
    const { auth, handleChangeText } = this.props;
    registerUserInputActivity(auth);
    handleChangeText(text);
  }

  render() {
    const { narrow, auth, users, text } = this.props;
    const { contentHeight } = this.state;
    const height = Math.min(Math.max(MIN_HEIGHT, contentHeight), MAX_HEIGHT);

    return (
      <View style={componentStyles.wrapper}>
        <ScrollView style={{ height }} contentContainerStyle={componentStyles.messageBox}>
          <Input
            value={text}
            style={this.context.styles.composeText}
            textInputRef={component => { this.textInput = component; }}
            multiline
            underlineColorAndroid="transparent"
            height={contentHeight}
            onChange={this.handleOnChange}
            onChangeText={this.handleChangeText}
            placeholder={getComposeInputPlaceholder(narrow, auth.email, users)}
          />
        </ScrollView>
        <SendButton
          disabled={text.length === 0}
          onPress={this.handleSend}
        />
      </View>
    );
  }
}


text:
Ce tutoriel non-officiel sur la **liblapin** est en cours d'écriture.
Toute collaboration est la bienvenue - voir la page [Améliorer](extend.html).

Le manuel « officiel » de la liblapin est [disponible ici][manuel].
Il est également possible de [le consulter en plein écran][manuel plein ecran].

## Exemples ##

Les exemples de ce tutoriel sont regroupés dans
[le dossier `examples`][examples] du dépot sur GitHub.

Vous pouvez cloner tout le dépot et compiler les exemples à l'aide des
commandes suivantes :

```sh
$ git clone https://github.com/motet-a/liblapin-tutorial.git
$ cd liblapin-tutorial
$ make examples
```

Vous trouverez les fichiers exécutables des exemples dans les sous-dossiers
du dossier `examples/`.

[manuel]: https://intra.epitech.eu/e-learning/#!/semester-1/B1-Infographie/cours-LibLapin-&-Documentation/Manuel
[manuel plein ecran]: https://cdn.local.epitech.eu/elearning/B-MUL-051/doc_lapin.htm
[examples]: https://github.com/motet-a/liblapin-tutorial/tree/master/examples


text:
// Copyright 2014 The Oppia Authors. All Rights Reserved.
//
// 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.

/**
 * @fileoverview Unit tests for the services and controllers of the
 *   editor page.
 */

describe('Context service', function() {
  beforeEach(module('oppia'));

  describe('behavior in the exploration learner view', function() {
    var ecs = null;

    beforeEach(function() {
      module(function($provide) {
        $provide.value('UrlService', {
          getPathname: function() {
            return '/explore/123';
          }
        });
      });
    });

    beforeEach(module('oppia', GLOBALS.TRANSLATOR_PROVIDER_FOR_TESTS));

    beforeEach(inject(function($injector) {
      ecs = $injector.get('ContextService');
    }));

    it('should correctly set editor context to exploration editor', function() {
      ecs.init('exploration_editor');
      expect(ecs.getEditorContext()).toBe('exploration_editor');
    });

    it('should correctly retrieve the exploration id', function() {
      expect(ecs.getExplorationId()).toBe('123');
    });

    it('should correctly retrieve the page context', function() {
      expect(ecs.getPageContext()).toBe('learner');
    });
  });

  describe('behavior in the exploration editor view', function() {
    var ecs = null;

    beforeEach(function() {
      module(function($provide) {
        $provide.value('UrlService', {
          getPathname: function() {
            return '/create/123';
          },
          getHash: function() {
            return '#/gui';
          }
        });
      });
    });

    beforeEach(inject(function($injector) {
      ecs = $injector.get('ContextService');
    }));

    it('should correctly retrieve the exploration id', function() {
      expect(ecs.getExplorationId()).toBe('123');
    });

    it('should correctly retrieve the page context', function() {
      expect(ecs.getPageContext()).toBe('editor');
    });

    it('should correctly retrieve exploration editor mode', function() {
      expect(ecs.isInExplorationEditorMode()).toBe(true);
    });
  });

  describe('behavior in the question editor view', function() {
    var ecs = null;

    beforeEach(function() {
      module(function($provide) {
        $provide.value('UrlService', {
          getPathname: function() {
            return '/question_editor/123';
          }
        });
      });
    });

    beforeEach(inject(function($injector) {
      ecs = $injector.get('ContextService');
    }));

    it('should correctly set editor context to question editor', function() {
      ecs.init('question_editor');
      expect(ecs.getEditorContext()).toBe('question_editor');
    });

    it('should correctly retrieve the question id', function() {
      expect(ecs.getQuestionId()).toBe('123');
    });

    it('should correctly retrieve the page context', function() {
      expect(ecs.getPageContext()).toBe('question_editor');
    });

    it('should correctly tell the question editor context', function() {
      expect(ecs.isInQuestionContext()).toBe(true);
    });
  });

  describe('behavior in other pages', function() {
    var ecs = null;

    beforeEach(function() {
      module(function($provide) {
        $provide.value('UrlService', {
          getPathname: function() {
            return '/about';
          }
        });
      });
    });

    beforeEach(inject(function($injector) {
      ecs = $injector.get('ContextService');
    }));

    it('should throw an error when trying to retrieve the exploration id',
      function() {
        expect(ecs.getExplorationId).toThrow();
      }
    );

    it('should throw an error when trying to retrieve the question id',
      function() {
        expect(ecs.getQuestionId).toThrow();
      }
    );

    it('should retrieve other as page context',
      function() {
        expect(ecs.getPageContext()).toBe('other');
      }
    );
  });
});


text:
package secrets

import (
	"sync"

	"github.com/docker/swarmkit/agent/exec"
	"github.com/docker/swarmkit/api"
)

// secrets is a map that keeps all the currently available secrets to the agent
// mapped by secret ID.
type secrets struct {
	mu sync.RWMutex
	m  map[string]*api.Secret
}

// NewManager returns a place to store secrets.
func NewManager() exec.SecretsManager {
	return &secrets{
		m: make(map[string]*api.Secret),
	}
}

// Get returns a secret by ID.  If the secret doesn't exist, returns nil.
func (s *secrets) Get(secretID string) *api.Secret {
	s.mu.RLock()
	defer s.mu.RUnlock()
	if s, ok := s.m[secretID]; ok {
		return s
	}
	return nil
}

// Add adds one or more secrets to the secret map.
func (s *secrets) Add(secrets ...api.Secret) {
	s.mu.Lock()
	defer s.mu.Unlock()
	for _, secret := range secrets {
		s.m[secret.ID] = secret.Copy()
	}
}

// Remove removes one or more secrets by ID from the secret map.  Succeeds
// whether or not the given IDs are in the map.
func (s *secrets) Remove(secrets []string) {
	s.mu.Lock()
	defer s.mu.Unlock()
	for _, secret := range secrets {
		delete(s.m, secret)
	}
}

// Reset removes all the secrets.
func (s *secrets) Reset() {
	s.mu.Lock()
	defer s.mu.Unlock()
	s.m = make(map[string]*api.Secret)
}

// taskRestrictedSecretsProvider restricts the ids to the task.
type taskRestrictedSecretsProvider struct {
	secrets   exec.SecretGetter
	secretIDs map[string]struct{} // allow list of secret ids
}

func (sp *taskRestrictedSecretsProvider) Get(secretID string) *api.Secret {
	if _, ok := sp.secretIDs[secretID]; !ok {
		return nil
	}

	return sp.secrets.Get(secretID)
}

// Restrict provides a getter that only allows access to the secrets
// referenced by the task.
func Restrict(secrets exec.SecretGetter, t *api.Task) exec.SecretGetter {
	sids := map[string]struct{}{}

	container := t.Spec.GetContainer()
	if container != nil {
		for _, ref := range container.Secrets {
			sids[ref.SecretID] = struct{}{}
		}
	}

	return &taskRestrictedSecretsProvider{secrets: secrets, secretIDs: sids}
}


text:
module Clockwork
  class Manager
    class NoHandlerDefined < RuntimeError; end

    attr_reader :config

    def initialize
      @events = []
      @callbacks = {}
      @config = default_configuration
      @handler = nil
    end

    def thread_available?
      Thread.list.select { |t| t['creator'] == self }.count < config[:max_threads]
    end

    def configure
      yield(config)
      if config[:sleep_timeout] < 1
        config[:logger].warn 'sleep_timeout must be >= 1 second'
      end
    end

    def default_configuration
      { :sleep_timeout => 1, :logger => Logger.new(STDOUT), :thread => false, :max_threads => 10 }
    end

    def handler(&block)
      @handler = block if block_given?
      raise NoHandlerDefined unless @handler
      @handler
    end

    def error_handler(&block)
      @error_handler = block if block_given?
      @error_handler
    end

    def on(event, options={}, &block)
      raise "Unsupported callback #{event}" unless [:before_tick, :after_tick, :before_run, :after_run].include?(event.to_sym)
      (@callbacks[event.to_sym]||=[]) << block
    end

    def every(period, job='unnamed', options={}, &block)
      if job.is_a?(Hash) and options.empty?
        options = job
        job = "unnamed"
      end
      if options[:at].respond_to?(:each)
        every_with_multiple_times(period, job, options, &block)
      else
        register(period, job, block, options)
      end
    end

    def fire_callbacks(event, *args)
      @callbacks[event].nil? || @callbacks[event].all? { |h| h.call(*args) }
    end

    def run
      log "Starting clock for #{@events.size} events: [ #{@events.map(&:to_s).join(' ')} ]"
      loop do
        tick
        interval = config[:sleep_timeout] - Time.now.subsec + 0.001
        sleep(interval) if interval > 0
      end
    end

    def tick(t=Time.now)
      if (fire_callbacks(:before_tick))
        events = events_to_run(t)
        events.each do |event|
          if (fire_callbacks(:before_run, event, t))
            event.run(t)
            fire_callbacks(:after_run, event, t)
          end
        end
      end
      fire_callbacks(:after_tick)
      events
    end

    def log_error(e)
      config[:logger].error(e)
    end

    def handle_error(e)
      error_handler.call(e) if error_handler
    end

    def log(msg)
      config[:logger].info(msg)
    end

    private
    def events_to_run(t)
      @events.select{ |event| event.run_now?(t) }
    end

    def register(period, job, block, options)
      event = Event.new(self, period, job, block || handler, options)
      @events << event
      event
    end

    def every_with_multiple_times(period, job, options={}, &block)
      each_options = options.clone
      options[:at].each do |at|
        each_options[:at] = at
        register(period, job, block, each_options)
      end
    end
  end
end


text:
MIT License (see LICENSE.md), (c) 2017 Markku Alho & Anton Saressalo

If you happen meet the authors of the Teesiverkko project some day, feel free to buy us some sparkling wine, if you think this stuff is worth it.

--------------

Verkkopohjaista visualisointia opinnäytteistä - Graph-based visualization of dissertations and Master's theses

--------------

There are two main components here:
1) The python harvester & data miner for HELDA OAI database, used to extract metadata and mine entire theses, where available.

Requires additional sickle package https://pypi.python.org/pypi/Sickle
as well as the pdfminer script in the same folder https://pypi.python.org/pypi/pdfminer/

Functions in file functions.py.
The main program in file graduminer.py.

Run with command:
python graduminer.py

2) Mathematica notebook for the remainder of text processing and graph creation, instructions included. Handles both plain metadata and mined thesis data from the python miner.

The notebook exports graphs to .graphml and additional data to TSV (Mathematica compresses large .graphml fields) to be used in dedicated graph software. We used Gephi and gexfjs for the final touches, including deployment to the Internet.


text:
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;

namespace Amazon.RDS.Model
{
    /// <summary>
    /// <para>This data type is used as a response element to DownloadDBLogFilePortion.</para>
    /// </summary>
    public class DownloadDBLogFilePortionResult
    {

        private string logFileData;
        private string marker;
        private bool? additionalDataPending;

        /// <summary>
        /// Entries from the specified log file.
        ///
        /// </summary>
        public string LogFileData
        {
            get { return this.logFileData; }
            set { this.logFileData = value; }
        }

        /// <summary>
        /// Sets the LogFileData property
        /// </summary>
        /// <param name="logFileData">The value to set for the LogFileData property </param>
        /// <returns>this instance</returns>
        [Obsolete("The With methods are obsolete and will be removed in version 2 of the AWS SDK for .NET. See http://aws.amazon.com/sdkfornet/#version2 for more information.")]
        public DownloadDBLogFilePortionResult WithLogFileData(string logFileData)
        {
            this.logFileData = logFileData;
            return this;
        }

        // Check to see if LogFileData property is set
        internal bool IsSetLogFileData()
        {
            return this.logFileData != null;
        }

        /// <summary>
        /// An optional pagination token provided by a previous DownloadDBLogFilePortion request.
        ///
        /// </summary>
        public string Marker
        {
            get { return this.marker; }
            set { this.marker = value; }
        }

        /// <summary>
        /// Sets the Marker property
        /// </summary>
        /// <param name="marker">The value to set for the Marker property </param>
        /// <returns>this instance</returns>
        [Obsolete("The With methods are obsolete and will be removed in version 2 of the AWS SDK for .NET. See http://aws.amazon.com/sdkfornet/#version2 for more information.")]
        public DownloadDBLogFilePortionResult WithMarker(string marker)
        {
            this.marker = marker;
            return this;
        }

        // Check to see if Marker property is set
        internal bool IsSetMarker()
        {
            return this.marker != null;
        }

        /// <summary>
        /// Boolean value that if true, indicates there is more data to be downloaded.
        ///
        /// </summary>
        public bool AdditionalDataPending
        {
            get { return this.additionalDataPending ?? default(bool); }
            set { this.additionalDataPending = value; }
        }

        /// <summary>
        /// Sets the AdditionalDataPending property
        /// </summary>
        /// <param name="additionalDataPending">The value to set for the AdditionalDataPending property </param>
        /// <returns>this instance</returns>
        [Obsolete("The With methods are obsolete and will be removed in version 2 of the AWS SDK for .NET. See http://aws.amazon.com/sdkfornet/#version2 for more information.")]
        public DownloadDBLogFilePortionResult WithAdditionalDataPending(bool additionalDataPending)
        {
            this.additionalDataPending = additionalDataPending;
            return this;
        }

        // Check to see if AdditionalDataPending property is set
        internal bool IsSetAdditionalDataPending()
        {
            return this.additionalDataPending.HasValue;
        }
    }
}


text:
// Copyright 2017 The Bazel Authors. All rights reserved.
//
// 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 com.google.devtools.build.lib.skylarkbuildapi.android;

import com.google.devtools.build.lib.skylarkbuildapi.FileApi;
import com.google.devtools.build.lib.skylarkbuildapi.core.ProviderApi;
import com.google.devtools.build.lib.skylarkbuildapi.core.StructApi;
import com.google.devtools.build.lib.skylarkinterface.Param;
import com.google.devtools.build.lib.skylarkinterface.SkylarkCallable;
import com.google.devtools.build.lib.skylarkinterface.SkylarkConstructor;
import com.google.devtools.build.lib.skylarkinterface.SkylarkModule;
import com.google.devtools.build.lib.skylarkinterface.SkylarkModuleCategory;
import com.google.devtools.build.lib.syntax.Depset;
import com.google.devtools.build.lib.syntax.EvalException;

/**
 * Configured targets implementing this provider can contribute Android IDL information to the
 * compilation.
 */
@SkylarkModule(
    name = "AndroidIdlInfo",
    doc =
        "Do not use this module. It is intended for migration purposes only. If you depend on it, "
            + "you will be broken when it is removed."
            + "Information about Android IDLs",
    documented = false,
    category = SkylarkModuleCategory.PROVIDER)
public interface AndroidIdlProviderApi<FileT extends FileApi> extends StructApi {

  /** Name of this info object. */
  String NAME = "AndroidIdlInfo";

  /** The set of IDL import roots need for compiling the IDL sources in the transitive closure. */
  @SkylarkCallable(
      name = "transitive_idl_import_roots",
      structField = true,
      doc = "Returns a depset of strings of all the idl import roots.",
      documented = false)
  Depset /*<String>*/ getTransitiveIdlImportRootsForStarlark();

  /** The IDL files in the transitive closure. */
  @SkylarkCallable(
      name = "transitive_idl_imports",
      structField = true,
      doc = "Returns a depset of artifacts of all the idl imports.",
      documented = false)
  Depset /*<FileT>*/ getTransitiveIdlImportsForStarlark();

  /** The IDL jars in the transitive closure, both class and source jars. */
  @SkylarkCallable(
      name = "transitive_idl_jars",
      structField = true,
      doc = "Returns a depset of artifacts of all the idl class and source jars.",
      documented = false)
  Depset /*<FileT>*/ getTransitiveIdlJarsForStarlark();

  /** The preprocessed IDL files in the transitive closure. */
  @SkylarkCallable(
      name = "transitive_idl_preprocessed",
      structField = true,
      doc = "Returns a depset of artifacts of all the idl preprocessed files.",
      documented = false)
  Depset /*<FileT>*/ getTransitiveIdlPreprocessedForStarlark();

  /** The provider implementing this can construct the AndroidIdlInfo provider. */
  @SkylarkModule(
      name = "Provider",
      doc =
          "Do not use this module. It is intended for migration purposes only. If you depend on "
              + "it, you will be broken when it is removed.",
      documented = false)
  interface Provider<FileT extends FileApi> extends ProviderApi {

    @SkylarkCallable(
        name = NAME,
        doc = "The AndroidIdlInfo constructor.",
        documented = false,
        parameters = {
          @Param(
              name = "transitive_idl_import_roots",
              doc = "A depset of strings of all the idl import roots in the transitive closure.",
              positional = true,
              named = false,
              type = Depset.class,
              generic1 = String.class),
          @Param(
              name = "transitive_idl_imports",
              doc = "A depset of artifacts of all the idl imports in the transitive closure.",
              positional = true,
              named = false,
              type = Depset.class,
              generic1 = FileApi.class),
          @Param(
              name = "transitive_idl_jars",
              doc =
                  "A depset of artifacts of all the idl class and source jars in the "
                      + "transitive closure.",
              positional = true,
              named = false,
              type = Depset.class,
              generic1 = FileApi.class),
          @Param(
              name = "transitive_idl_preprocessed",
              doc =
                  "A depset of artifacts of all the idl preprocessed files in the transitive "
                      + "closure.",
              positional = true,
              named = false,
              type = Depset.class,
              generic1 = FileApi.class),
        },
        selfCall = true)
    @SkylarkConstructor(objectType = AndroidIdlProviderApi.class, receiverNameForDoc = NAME)
    AndroidIdlProviderApi<FileT> createInfo(
        Depset transitiveIdlImportRoots,
        Depset transitiveIdlImports,
        Depset transitiveIdlJars,
        Depset transitiveIdlPreprocessed)
        throws EvalException;
  }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <!-- Dialog Animations -->
    <style name="DA_Fade">
        <item name="android:windowEnterAnimation">@android:anim/fade_in</item>
        <item name="android:windowExitAnimation">@android:anim/fade_out</item>
    </style>

    <style name="DA_SlideInFromTopWithBounce">
        <item name="android:windowEnterAnimation">@anim/slide_in_from_top_bounce</item>
        <item name="android:windowExitAnimation">@anim/slide_out_to_top_bounce</item>
    </style>
    <style name="DA_SlideInFromTop">
        <item name="android:windowEnterAnimation">@anim/slide_in_from_top</item>
        <item name="android:windowExitAnimation">@anim/slide_out_to_top</item>
    </style>
    <style name="DA_SlideInFromLeftOutRight">
        <item name="android:windowEnterAnimation">@android:anim/slide_in_left</item>
        <item name="android:windowExitAnimation">@android:anim/slide_out_right</item>
    </style>

</resources>


text:
const request = require('request');
const Command = require('../lib/Command');

const foodCommand = new Command({
  name: 'Foodporn Images',
  triggers: ['foodporn', 'food', '🥩'],
  description: 'Get some good looking food images provided by Reddit',
  async process(client, msg, args) {
    request('https://www.reddit.com/r/FoodPorn/top/.json?sort=top&t=day&limit=75', (req, res, body) => {
      const redditEntries = JSON.parse(body).data.children;
      const randomPost = redditEntries[Math.floor(76 * Math.random())].data
      msg.channel.send({
        embed: {
          color: 0xe0e0e0,
          author: {
            name: 'Foodporn',
            url: `https://www.reddit.com/${randomPost.permalink}`,
            icon_url: 'https://icon-icons.com/icons2/836/PNG/512/Reddit_icon-icons.com_66786.png'
          },
          title: `**${randomPost.title}**`,
          image: { url: randomPost.url },
        }
      })
    });

  }
});

module.exports = foodCommand;


text: import another_module


text:
from pprint import pprint
from collections import OrderedDict
import socket, re
from datetime import datetime, timedelta
import xmltodict
import requests
from exceptions import *

class ListrakClient():
    debug = False

    def __init__(self, username, password):
        self.soap_header = """<?xml version="1.0" encoding="utf-8"?>
            <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
              <soap:Header>
                <WSUser xmlns="http://webservices.listrak.com/v31/">
                  <UserName>%s</UserName>
                  <Password>%s</Password>
                </WSUser>
              </soap:Header>
              <soap:Body>
                [BODY]
              </soap:Body>
            </soap:Envelope>""" % (username, password)

    def do_action(self, action, params=None):
        url = 'https://webservices.listrak.com/v31/IntegrationService.asmx'

        headers = {
            'SOAPAction': 'http://webservices.listrak.com/v31/%s' % action,
            'Content-Type': 'text/xml; charset=utf-8'
        }

        data = self.soap_header
        if params:
            body = '<%s xmlns="http://webservices.listrak.com/v31/">' % action
            for k,v in params.items():
                if type(v) == list:
                    for i in v:
                        body += "<%s>%s</%s>" % (k, i, k)
                else:
                    body += "<%s>%s</%s>" % (k, v, k)
            body += '</%s>' % action
            data = data.replace('[BODY]', body)
        else:
            data = data.replace('[BODY]', '<%s xmlns="http://webservices.listrak.com/v31/" />' % action)

        if self.debug:
            print data
            #return data

        response = requests.post(url, data=data, headers=headers)
        print response.text.replace(">", ">\n")
        if "[InvalidLogonAttempt]" in response.text:
            raise InvalidLogonAttempt("Invalid user name or password")
        if "[LoginAttemptsExceeded]" in response.text:
            raise InvalidLogonAttempt("Login attempts exceeded")
        if "[ProhibitedIPAddress]" in response.text:
            raise InvalidLogonAttempt(
                "IP address not allowed.  You need to add %s to your approved list." % socket.gethostbyaddr("traklis.com")[2][0])
        # Handle nil response with empty list
        #if '<WSException xsi:nil="true" />' in response.text: return [];

        results = xmltodict.parse(response.text)
        try:
            ret = results['soap:Envelope']['soap:Body']['%sResponse'%action]['%sResult'%action].items()[0][1]
        except AttributeError:
            # Single value response, no need to build a response list
            return results['soap:Envelope']['soap:Body']['%sResponse'%action]['%sResult'%action]
        except KeyError:
            return []
        # If single record returned, make it a list of 1 dict
        if type(ret) == OrderedDict:
            ret = [ret]
        for i in ret:
            for k,v in i.items():
                #if type(v) != "<type 'unicode'>":
                #    i.pop(k, None)
                if "Date" in k:
                    #print v
                    i[k] = datetime.strptime(re.sub('\.\d{1,3}','',v), "%Y-%m-%dT%H:%M:%S")
        return ret

    def get_contact(self, list_id, email):
        result = self.do_action('GetContact', {'ListID': list_id, 'ContactEmailAddress': email})
        return result

    def get_lists(self):
        lists = []
        results = self.do_action('GetContactListCollection')
        # Assign list size values
        for list in results:
            list = dict(list)
            size = self.do_action('GetFilteredListCount', {'ListID': list['ListID']})
            list['ListSize'] = size
            lists.append(list)
        return lists

    def get_list_attributes(self, list_id):
        attrs = {}
        r = self.do_action('GetProfileHeaderCollection', {'ListID': list_id})
        for attr_set in r[1:]:
            if 'Signup' in attr_set:
                print attr_set
                break
            for rr in attr_set['WSProfileAttributes']:
                try:
                    d = dict(rr)
                    attrs[d['Name']] = d
                except ValueError:
                    continue
        return attrs

    def get_saved_messages(self, list_id):
        r = self.do_action('GetSavedMessageCollection', {'ListID': list_id})
        return r

    def get_message_activity(self, list_id, days=30):
        start = (datetime.today() - timedelta(days=days)).strftime("%Y-%m-%d")
        end = (datetime.today() + timedelta(days=1)).strftime("%Y-%m-%d")

        data = {'ListID': list_id, 'StartDate':start, 'EndDate':end}
        r = self.do_action('ReportListMessageActivity', data)
        return r

    def get_list_activity(self, list_id):
        data = {'ListID': list_id, 'IncludeTerminated': '1'}
        ret = self.do_action('ReportListConversationActivity', data)
        return ret

    def get_conversations(self, list_id):
        data = {'listID': list_id}
        return self.do_action('ConductorGetConversations', data)

    def get_conversation_activity(self, list_id, convo_id, page=1, days=90):
        start = (datetime.today() - timedelta(days=days)).strftime("%Y-%m-%d")
        end = (datetime.today() + timedelta(days=1)).strftime("%Y-%m-%d")
        data = {'ConversationID': convo_id, 'Page': page, 'StartDate': start, 'EndDate': end}
        return self.do_action('ReportConversationContactDelivery', data)

    def get_contact_activity(self, list_id, email, page=1):
        data = {'ListID': list_id, 'EmailAddress': email, 'Page': page}
        ret = self.do_action('ReportContactMessageActivity', data)
        return ret

    def get_msg_contact_activity(self, msg_id, page=1):
        data = {'MsgID': msg_id, 'Page': page}
        try:
            ret = self.do_action('ReportMessageContactActivity', data)
        except AttributeError:
            ret = []
        return ret

    def get_msg_opens(self, msg_id, page=1):
        data = {'MsgID': msg_id, 'Page': page}
        ret = self.do_action('ReportMessageContactOpen', data)
        return ret

    def get_msg_clicks(self, msg_id, page=1, days=30):
        start = (datetime.today() - timedelta(days=days)).strftime("%Y-%m-%d")
        end = (datetime.today() + timedelta(days=1)).strftime("%Y-%m-%d")

        data = {'MsgID': msg_id, 'Page': page, 'StartDate':start, 'EndDate':end}
        ret = self.do_action('ReportRangeMessageContactClick', data)
        return ret

    def get_msg_unsubs(self, msg_id, page=1):
        data = {'MsgID': msg_id, 'Page': page}
        ret = self.do_action('ReportMessageContactRemoval', data)
        return ret

    def get_contacts_for_list(self, list_id, page=1):
        data = {'ListID': list_id, 'Page': page}
        ret = self.do_action('ReportSubscribedContacts', data)
        return ret

    def subscribe_contact(self, list_id, email, override_unsub=False):
        data = {'ListID': list_id, 'ContactEmailAddress': email, 'OverrideUnsubscribe': int(override_unsub)}
        ret = self.do_action('SubscribeContact', data)
        return ret

    def update_contact(self, list_id, email, attributes, events=''):
        xml = '<EmailAddress>%s</EmailAddress><ListID>%s</ListID>' % (email, list_id)
        data = {}
        for k, v in attributes.items():
            xml += '<ContactProfileAttribute><AttributeID>%s</AttributeID>' % k
            xml += '<Value>%s</Value></ContactProfileAttribute>' % v
        data['WSContact'] = xml
        data['ProfileUpdateType'] = 'Update'
        data['ExternalEventIDs'] = events
        data['OverrideUnsubscribe'] = 0
        ret = self.do_action('SetContact', data)
        return ret

    def upload_contacts(self):
        #TODO
        pass

    def validate(self):
        try:
            self.get_lists()
            return True
        except Exception, e:
            return e


text:
import { Pipe, PipeTransform } from '@angular/core';
import { parseFactory } from '@qgrid/core';

@Pipe({
  name: 'qGridConvert',
})
export class ConvertPipe implements PipeTransform {
  constructor() { }

  transform(value: any, type: string) {
    const parse = parseFactory(type);
    const result = parse(value);
    return result === null ? value : result;
  }
}


text:
class User < ActiveRecord::Base
  after_save :welcome_notification

  # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable

  private

  def welcome_notification
    UserMailer.welcome(self).deliver
  end

end


text:
/**
 * Tests sit right alongside the file they are testing, which is more intuitive
 * and portable than separating `src` and `test` directories. Additionally, the
 * build process will exclude all `.spec.js` files from the build
 * automatically.
 */
describe( 'user_create section', function() {
  beforeEach( module( 'bigboldwords.user_create' ) );

  it( 'should have a dummy test', inject( function() {
    expect( true ).toBeTruthy();
  }));
});


text:
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Security;
using System.Text;

using Khronos;

// ReSharper disable CheckNamespace
// ReSharper disable InconsistentNaming
// ReSharper disable JoinDeclarationAndInitializer

namespace OpenGL
{
	public partial class Gl
	{
		/// <summary>
		/// [GL] glDrawVkImageNV: Binding for glDrawVkImageNV.
		/// </summary>
		/// <param name="vkImage">
		/// A <see cref="T:ulong"/>.
		/// </param>
		/// <param name="sampler">
		/// A <see cref="T:uint"/>.
		/// </param>
		/// <param name="x0">
		/// A <see cref="T:float"/>.
		/// </param>
		/// <param name="y0">
		/// A <see cref="T:float"/>.
		/// </param>
		/// <param name="x1">
		/// A <see cref="T:float"/>.
		/// </param>
		/// <param name="y1">
		/// A <see cref="T:float"/>.
		/// </param>
		/// <param name="z">
		/// A <see cref="T:float"/>.
		/// </param>
		/// <param name="s0">
		/// A <see cref="T:float"/>.
		/// </param>
		/// <param name="t0">
		/// A <see cref="T:float"/>.
		/// </param>
		/// <param name="s1">
		/// A <see cref="T:float"/>.
		/// </param>
		/// <param name="t1">
		/// A <see cref="T:float"/>.
		/// </param>
		[RequiredByFeature("GL_NV_draw_vulkan_image", Api = "gl|glcore|gles2")]
		public static void DrawVkImageNV(ulong vkImage, uint sampler, float x0, float y0, float x1, float y1, float z, float s0, float t0, float s1, float t1)
		{
			Debug.Assert(Delegates.pglDrawVkImageNV != null, "pglDrawVkImageNV not implemented");
			Delegates.pglDrawVkImageNV(vkImage, sampler, x0, y0, x1, y1, z, s0, t0, s1, t1);
			LogCommand("glDrawVkImageNV", null, vkImage, sampler, x0, y0, x1, y1, z, s0, t0, s1, t1			);
			DebugCheckErrors(null);
		}

		/// <summary>
		/// [GL] glGetVkProcAddrNV: Binding for glGetVkProcAddrNV.
		/// </summary>
		/// <param name="name">
		/// A <see cref="T:string"/>.
		/// </param>
		[RequiredByFeature("GL_NV_draw_vulkan_image", Api = "gl|glcore|gles2")]
		public static VulkanProc GetVkProcAddrNV(string name)
		{
			VulkanProc retValue;

			Debug.Assert(Delegates.pglGetVkProcAddrNV != null, "pglGetVkProcAddrNV not implemented");
			retValue = Delegates.pglGetVkProcAddrNV(name);
			LogCommand("glGetVkProcAddrNV", retValue, name			);
			DebugCheckErrors(retValue);

			return (retValue);
		}

		/// <summary>
		/// [GL] glWaitVkSemaphoreNV: Binding for glWaitVkSemaphoreNV.
		/// </summary>
		/// <param name="vkSemaphore">
		/// A <see cref="T:ulong"/>.
		/// </param>
		[RequiredByFeature("GL_NV_draw_vulkan_image", Api = "gl|glcore|gles2")]
		public static void WaitVkSemaphoreNV(ulong vkSemaphore)
		{
			Debug.Assert(Delegates.pglWaitVkSemaphoreNV != null, "pglWaitVkSemaphoreNV not implemented");
			Delegates.pglWaitVkSemaphoreNV(vkSemaphore);
			LogCommand("glWaitVkSemaphoreNV", null, vkSemaphore			);
			DebugCheckErrors(null);
		}

		/// <summary>
		/// [GL] glSignalVkSemaphoreNV: Binding for glSignalVkSemaphoreNV.
		/// </summary>
		/// <param name="vkSemaphore">
		/// A <see cref="T:ulong"/>.
		/// </param>
		[RequiredByFeature("GL_NV_draw_vulkan_image", Api = "gl|glcore|gles2")]
		public static void SignalVkSemaphoreNV(ulong vkSemaphore)
		{
			Debug.Assert(Delegates.pglSignalVkSemaphoreNV != null, "pglSignalVkSemaphoreNV not implemented");
			Delegates.pglSignalVkSemaphoreNV(vkSemaphore);
			LogCommand("glSignalVkSemaphoreNV", null, vkSemaphore			);
			DebugCheckErrors(null);
		}

		/// <summary>
		/// [GL] glSignalVkFenceNV: Binding for glSignalVkFenceNV.
		/// </summary>
		/// <param name="vkFence">
		/// A <see cref="T:ulong"/>.
		/// </param>
		[RequiredByFeature("GL_NV_draw_vulkan_image", Api = "gl|glcore|gles2")]
		public static void SignalVkFenceNV(ulong vkFence)
		{
			Debug.Assert(Delegates.pglSignalVkFenceNV != null, "pglSignalVkFenceNV not implemented");
			Delegates.pglSignalVkFenceNV(vkFence);
			LogCommand("glSignalVkFenceNV", null, vkFence			);
			DebugCheckErrors(null);
		}

		internal static unsafe partial class Delegates
		{
			[RequiredByFeature("GL_NV_draw_vulkan_image", Api = "gl|glcore|gles2")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate void glDrawVkImageNV(ulong vkImage, uint sampler, float x0, float y0, float x1, float y1, float z, float s0, float t0, float s1, float t1);

			[RequiredByFeature("GL_NV_draw_vulkan_image", Api = "gl|glcore|gles2")]
			[ThreadStatic]
			internal static glDrawVkImageNV pglDrawVkImageNV;

			[RequiredByFeature("GL_NV_draw_vulkan_image", Api = "gl|glcore|gles2")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate VulkanProc glGetVkProcAddrNV(string name);

			[RequiredByFeature("GL_NV_draw_vulkan_image", Api = "gl|glcore|gles2")]
			[ThreadStatic]
			internal static glGetVkProcAddrNV pglGetVkProcAddrNV;

			[RequiredByFeature("GL_NV_draw_vulkan_image", Api = "gl|glcore|gles2")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate void glWaitVkSemaphoreNV(ulong vkSemaphore);

			[RequiredByFeature("GL_NV_draw_vulkan_image", Api = "gl|glcore|gles2")]
			[ThreadStatic]
			internal static glWaitVkSemaphoreNV pglWaitVkSemaphoreNV;

			[RequiredByFeature("GL_NV_draw_vulkan_image", Api = "gl|glcore|gles2")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate void glSignalVkSemaphoreNV(ulong vkSemaphore);

			[RequiredByFeature("GL_NV_draw_vulkan_image", Api = "gl|glcore|gles2")]
			[ThreadStatic]
			internal static glSignalVkSemaphoreNV pglSignalVkSemaphoreNV;

			[RequiredByFeature("GL_NV_draw_vulkan_image", Api = "gl|glcore|gles2")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate void glSignalVkFenceNV(ulong vkFence);

			[RequiredByFeature("GL_NV_draw_vulkan_image", Api = "gl|glcore|gles2")]
			[ThreadStatic]
			internal static glSignalVkFenceNV pglSignalVkFenceNV;

		}
	}

}


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">
<title>org.apache.giraph.utils (Apache Giraph Core 1.0.0 API)</title>
<meta name="date" content="2014-01-02">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

您的浏览器已禁用 JavaScript。

概览

程序包

类

使用

树

已过时

索引

帮助

上一个程序包

下一个程序包

框架

无框架

所有类

程序包 org.apache.giraph.utils

Package of all generic utility classes.

请参阅: 说明

接口概要

接口
说明

CallableFactory<R>

Factory for creating Callables

ExtendedDataInput

Add some functionality to data input

ExtendedDataOutput

Add a few features to data output

类概要

类
说明

AnnotationUtils

Helper class to deal with annotations in runtime.

ArrayListWritable<M extends org.apache.hadoop.io.Writable>

A Writable for ListArray containing instances of a class.

ByteArrayIterable<T extends org.apache.hadoop.io.Writable>

This iterable is designed to deserialize a byte array on the fly to
 provide new copies of writable objects when desired.

ByteArrayIterator<T extends org.apache.hadoop.io.Writable>

This iterator is designed to deserialize a byte array on the fly to
 provide new copies of writable objects when desired.

ByteArrayVertexIdData<I extends org.apache.hadoop.io.WritableComparable,T>

Stores pairs of vertex id and generic data in a single byte array

ByteArrayVertexIdEdges<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>

Stores vertex id and edge pairs in a single byte array.

ByteArrayVertexIdMessages<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable>

Stores vertex id and message pairs in a single byte array.

CollectionUtils

Helper methods for Collections

ConfigurationUtils

Translate command line args into Configuration Key-Value pairs.

DynamicChannelBufferInputStream

Special input that reads from a DynamicChannelBuffer.

DynamicChannelBufferOutputStream

Special output stream that can grow as needed and dumps to a
 DynamicChannelBuffer.

EdgeComparator<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.WritableComparable>

Comparator for edges.

EdgeIterables

Utility methods for iterables of edges.

EmptyIterable<T>

Singleton class for empty iterables.

ExtendedByteArrayDataInput

Provides access to a internals of ByteArrayInputStream

ExtendedByteArrayDataOutput

Adds some functionality to ByteArrayOutputStream,
 such as an option to write int value over previously written data
 and directly get the byte array.

FileUtils

Helper class for filesystem operations during testing

IncreasingBitSet

Bit set optimized for increasing longs to save storage space.

InMemoryVertexInputFormat<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>

An input format that reads the input graph in memory.

InternalVertexRunner

A base class for running internal tests on a vertex

 Extending classes only have to invoke the run() method to test their vertex.

IntPair

A pair of integers.

JMap

Helper to run jmap and print the output

JMapHistoDumper

An observer for both worker and master that periodically dumps the memory
 usage using jmap tool.

LoggerUtils

Logger utils for log4j

LogStacktraceCallable<V>

A wrapper to improve debugging.

MasterLoggingAggregator

Helper class for using aggregator which gathers log messages from workers
 and prints them on master.

MathUtils

A helper class for math related operations with writables

MemoryUtils

Helper static methods for tracking memory usage.

PairList<U,V>

Collection to keep pairs in, without creating a wrapper object around
 each pair of objects.

ProgressableUtils

Functions for waiting on some events to happen while reporting progress

ReflectionUtils

Helper methods to get type arguments to generic classes.

RepresentativeByteArrayIterable<T extends org.apache.hadoop.io.Writable>

The objects provided by the iterators generated from this object have
 lifetimes only until next() is called.

RepresentativeByteArrayIterator<T extends org.apache.hadoop.io.Writable>

The objects provided by this iterator have lifetimes only until next() is
 called.

TaskIdsPermitsBarrier

This barrier is used when we don't know how many events are we waiting on
 from the start.

TestGraph<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>

TestGraph class for in-memory testing.

TimedLogger

Print log messages only if the time is met.

UnsafeByteArrayInputStream

Byte array output stream that uses Unsafe methods to serialize/deserialize
 much faster

UnsafeByteArrayOutputStream

Byte array output stream that uses Unsafe methods to serialize/deserialize
 much faster

VertexIdIterator<I extends org.apache.hadoop.io.WritableComparable>

Common implementation for VertexIdEdgeIterator, VertexIdMessageIterator
 and VertexIdMessageBytesIterator.

WritableUtils

Helper static methods for working with Writable objects.

程序包org.apache.giraph.utils的说明

Package of all generic utility classes.

概览

程序包

类

使用

树

已过时

索引

帮助

上一个程序包

下一个程序包

框架

无框架

所有类

Copyright © 2011-2014 The Apache Software Foundation. All Rights Reserved.


text:
package io.fsq.spindle.runtime.test

import io.fsq.spindle.common.thrift.json.TReadableJSONProtocol
import io.fsq.spindle.runtime.{KnownTProtocolNames, MetaRecord, TProtocolInfo}
import io.fsq.spindle.runtime.common.gen.{
  TestStruct,
  TestStructCollections,
  TestStructNestedCollections,
  TestStructNoBinary,
  TestStructNoBool,
  TestStructNoByte,
  TestStructNoDouble,
  TestStructNoI16,
  TestStructNoI32,
  TestStructNoI64,
  TestStructNoList,
  TestStructNoMap,
  TestStructNoMyBinary,
  TestStructNoSet,
  TestStructNoString,
  TestStructNoStruct
}
import io.fsq.spindle.runtime.enums.gen.{NewTestEnum, StructWithNewEnumField, StructWithOldEnumField}
import io.fsq.spindle.runtime.structs.gen.{InnerStruct, InnerStructNoUnknownFieldsTracking, StructWithNoFields}
import io.fsq.spindle.runtime.test.gen.{
  TestStructInnerStructNoI32,
  TestStructInnerStructNoI32RetiredFields,
  TestStructInnerStructNoString,
  TestStructInnerStructNoStringNoUnknownFieldsTracking,
  TestStructInnerStructNoUnknownFieldsTracking,
  TestStructNoBoolNoUnknownFieldsTracking,
  TestStructNoBoolRetiredFields,
  TestStructNoBoolRetiredFieldsNoUnknownFieldsTracking,
  TestStructNoUnknownFieldsTracking,
  TestStructNoUnknownFieldsTrackingExceptInnerStruct,
  TestStructNoUnknownFieldsTrackingInnerStructNoString,
  TestStructNoUnknownFieldsTrackingInnerStructNoStringNoUnknownFieldsTracking
}
import java.nio.ByteBuffer
import net.liftweb.json.{Diff, JsonAST, JsonParser}
import org.apache.thrift.{TBase, TDeserializer, TFieldIdEnum}
import org.apache.thrift.protocol.TType
import org.apache.thrift.transport.{AutoExpandingBufferReadTransport, TMemoryBuffer}
import org.junit.{Assert, Ignore, Test}

class WireCompatibilityTest {

  val protocols = Set(
    KnownTProtocolNames.TBinaryProtocol,
    KnownTProtocolNames.TCompactProtocol,
    KnownTProtocolNames.TJSONProtocol,
    KnownTProtocolNames.TBSONBinaryProtocol,
    KnownTProtocolNames.TBSONProtocol,
    KnownTProtocolNames.TReadableJSONProtocol,
    KnownTProtocolNames.TReadableJSONProtocolLegacy,
    KnownTProtocolNames.TBSONProtocolLegacy
  )

  @Ignore("This test fails in CI regularly, even though it was forced to run in serial.")
  @Test
  def testBSON2CompactCrossCompatibility() {
    // This is the most important case for us: It simulates the realistic scenario where we read records
    // from mongodb, convert them to a the compact binary protocol and put them in a serving system.
    // This verifies that unknown fields will survive that trip, so we single it out here for emphasis and
    // ease of debugging, even though this combo is also tested in testAllCompatibilityCombos().
    doTestUnknownFieldCompatibility(KnownTProtocolNames.TBSONProtocol, KnownTProtocolNames.TCompactProtocol)
    doTestUnknownFieldCompatibility(KnownTProtocolNames.TBSONBinaryProtocol, KnownTProtocolNames.TCompactProtocol)
  }

  @Test
  def testUnkownFieldsProtocol() {
    // Ensure that unknown fields is not mangling data whether through using the wrong protocol or something else.
    type TType = TBase[_ <: TBase[_ <: AnyRef, _ <: TFieldIdEnum], _ <: TFieldIdEnum]

    def parse[T <: TType](rawResponse: String, responseObj: T): Unit = {
      val deserializer =
        new TDeserializer(new TReadableJSONProtocol.Factory())
      deserializer.deserialize(responseObj, rawResponse.getBytes)
    }

    def toJson[T <: TType](thrift: T): JsonAST.JObject = {
      val trans = new TMemoryBuffer(1024)
      val oprot = (new TReadableJSONProtocol.Factory).getProtocol(trans)
      thrift.write(oprot)
      JsonParser.parse(trans.toString("UTF-8")).asInstanceOf[JsonAST.JObject]
    }

    val jsonString = """{"user": { "id": "12", "firstName": "Tester", "gender": "female"}}"""
    val jsonObj = JsonParser.parse(jsonString).asInstanceOf[JsonAST.JObject]
    val thriftResponse = StructWithNoFields.createRecord

    parse(jsonString, thriftResponse)
    val backToJson = toJson(thriftResponse)
    val diff = Diff.diff(jsonObj, backToJson)

    for (x <- diff.added
         if x != JsonAST.JNothing) {
      throw new RuntimeException(
        "Thrift object %s contains different fields than original json. Diff: %s. Original json: %s"
          .format(thriftResponse, diff, jsonString)
      )
    }
    Assert.assertEquals(JsonAST.compactRender(jsonObj), JsonAST.compactRender(backToJson))
  }

  @Test
  def testReusableStructWithClear() {
    val srcProtocol = KnownTProtocolNames.TBSONProtocol

    val newObj = testStruct()
    val oldObj = TestStructNoBool.createRawRecord.asInstanceOf[TBase[_, _]]

    // Write the object out.
    val newBuf1 = doWrite(srcProtocol, newObj)
    val newBuf2 = doWrite(srcProtocol, newObj)

    // Read the new object into an older version of the same struct and write it out.
    doRead(srcProtocol, newBuf1, oldObj)
    val oldStr1 = oldObj.toString

    // Reuse oldObj to read it in again.
    oldObj.clear()
    doRead(srcProtocol, newBuf2, oldObj)
    val oldStr2 = oldObj.toString

    Assert.assertEquals(oldStr1, oldStr2)
  }

  @Ignore("This test fails in CI regularly, even though it was forced to run in serial.")
  @Test
  def testAllCompatibilityCombos() {
    for {
      src <- protocols
      dst <- protocols
    } {
      println("Testing unknown field compatibility between: %s -> %s".format(src, dst))
      doTestUnknownFieldCompatibility(src, dst)
    }
  }

  private def doTestUnknownFieldCompatibility(srcProtocol: String, dstProtocol: String) {
    val s = testStruct()
    val sNoBool = s.toBuilder.aBool(None).result()
    val sNoUnknownFields = testStructNoUnknownFieldsTracking()
    val sNoUnknownFieldsExceptInner = testStructNoUnknownFieldsTrackingExceptInner()
    val sInnerStructNoUnknownFields = testStructInnerStructNoUnknownFieldsTracking()
    val sInnerStructNoStringNoUnknownFields = testStructInnerStructNoStringNoUnknownFieldsTracking()
    val sNoUnknownFieldsExceptInnerNoString = testStructNoUnknownFieldsTrackingExceptInnerStructNoString()
    val sNoUnknownFieldsNoBool = sNoUnknownFields.toBuilder.aBool(None).result()
    val sInnerStructNoString = testStructInnerStructNoString()
    val sInnerStructNoI32 = testStructInnerStructNoI32()
    val sNoUnknownFieldsInnerStructNoString = testStructNoUnknownFieldsTrackingInnerStructNoString()
    val sCollections = testStructCollections()
    val sNestedCollections = testStructNestedCollections()

    def getProtocolName(protocolName: String) = {
      protocolName.split("\\.").last
    }

    def areSameProtocol(firstProtocol: String, secondProtocol: String) = {
      // Compare protocols based on the protocol name instead of including the package name in the comparison.
      // This assumes that there aren't two different versions of the same protocol available in different packages.
      getProtocolName(firstProtocol) == getProtocolName(secondProtocol)
    }

    // Test reading via versions of the struct missing one field.
    val structsMissingOneField: List[MetaRecord[_, _]] = List(
      TestStructNoBool,
      TestStructNoByte,
      TestStructNoI16,
      TestStructNoI32,
      TestStructNoI64,
      TestStructNoDouble,
      TestStructNoString,
      TestStructNoBinary,
      TestStructNoStruct,
      TestStructNoSet,
      TestStructNoList,
      TestStructNoMap,
      TestStructNoMyBinary,
      TestStructInnerStructNoString,
      TestStructInnerStructNoI32
    )

    for (oldMeta <- structsMissingOneField) {
      testReadingUnknownField(oldMeta, TestStruct, s)
    }

    // Test reading various structs via a struct with no fields at all, so all fields are unknown.
    testReadingUnknownField(StructWithNoFields, TestStruct, s)
    testReadingUnknownField(StructWithNoFields, TestStructCollections, sCollections)
    testReadingUnknownField(StructWithNoFields, TestStructNestedCollections, sNestedCollections)

    // Test using versions of the struct with and without unknown fields tracking enabled.
    testReadingUnknownField(TestStructNoUnknownFieldsTracking, TestStruct, s)
    testReadingUnknownField(TestStruct, TestStructNoUnknownFieldsTracking, sNoUnknownFields)
    testReadingUnknownField(TestStructNoBoolNoUnknownFieldsTracking, TestStruct, s, Some(sNoBool), Some(sNoBool))
    testReadingUnknownField(
      TestStructNoBool,
      TestStructNoUnknownFieldsTracking,
      sNoUnknownFields,
      Some(sNoUnknownFieldsNoBool),
      Some(sNoUnknownFields)
    )
    testReadingUnknownField(
      TestStructNoBoolNoUnknownFieldsTracking,
      TestStructNoUnknownFieldsTracking,
      sNoUnknownFields,
      Some(sNoUnknownFieldsNoBool),
      Some(sNoUnknownFieldsNoBool)
    )

    // Test using versions of the struct with retired fields, with and without unknown fields tracking enabled.
    testReadingUnknownField(TestStructNoBoolRetiredFields, TestStruct, s, Some(sNoBool), Some(sNoBool))
    testReadingUnknownField(
      TestStructNoBoolRetiredFieldsNoUnknownFieldsTracking,
      TestStruct,
      s,
      Some(sNoBool),
      Some(sNoBool)
    )
    testReadingUnknownField(
      TestStructNoBoolRetiredFields,
      TestStructNoUnknownFieldsTracking,
      sNoUnknownFields,
      Some(sNoUnknownFieldsNoBool),
      Some(sNoUnknownFieldsNoBool)
    )
    testReadingUnknownField(
      TestStructNoBoolRetiredFieldsNoUnknownFieldsTracking,
      TestStructNoUnknownFieldsTracking,
      sNoUnknownFields,
      Some(sNoUnknownFieldsNoBool),
      Some(sNoUnknownFieldsNoBool)
    )
    testReadingUnknownField(
      TestStructInnerStructNoI32RetiredFields,
      TestStruct,
      s,
      Some(sInnerStructNoI32),
      Some(sInnerStructNoI32)
    )

    // Test using versions of the struct with and without unknown fields enabled on embedded structs.
    // 16 cases here. There are 4 independent places to enable or disable unknown fields tracking:
    //   - new version of the struct
    //   - inner struct of the new version of the struct
    //   - old version of the struct
    //   - inner struct of the old version of the struct
    testReadingUnknownField(TestStructInnerStructNoString, TestStruct, s)
    testReadingUnknownField(TestStructNoUnknownFieldsTrackingInnerStructNoString, TestStruct, s)
    testReadingUnknownField(
      TestStructInnerStructNoStringNoUnknownFieldsTracking,
      TestStruct,
      s,
      Some(sInnerStructNoString),
      Some(sInnerStructNoString)
    )
    testReadingUnknownField(
      TestStructNoUnknownFieldsTrackingInnerStructNoStringNoUnknownFieldsTracking,
      TestStruct,
      s,
      Some(sInnerStructNoString),
      Some(sInnerStructNoString)
    )

    testReadingUnknownField(
      TestStructInnerStructNoString,
      TestStructNoUnknownFieldsTrackingExceptInnerStruct,
      sNoUnknownFieldsExceptInner
    )
    testReadingUnknownField(
      TestStructNoUnknownFieldsTrackingInnerStructNoString,
      TestStructNoUnknownFieldsTrackingExceptInnerStruct,
      sNoUnknownFieldsExceptInner
    )
    testReadingUnknownField(
      TestStructInnerStructNoStringNoUnknownFieldsTracking,
      TestStructNoUnknownFieldsTrackingExceptInnerStruct,
      sNoUnknownFieldsExceptInner,
      Some(sNoUnknownFieldsExceptInnerNoString),
      Some(sNoUnknownFieldsExceptInnerNoString)
    )
    testReadingUnknownField(
      TestStructNoUnknownFieldsTrackingInnerStructNoStringNoUnknownFieldsTracking,
      TestStructNoUnknownFieldsTrackingExceptInnerStruct,
      sNoUnknownFieldsExceptInner,
      Some(sNoUnknownFieldsExceptInnerNoString),
      Some(sNoUnknownFieldsExceptInnerNoString)
    )

    testReadingUnknownField(
      TestStructInnerStructNoString,
      TestStructInnerStructNoUnknownFieldsTracking,
      sInnerStructNoUnknownFields,
      Some(sInnerStructNoStringNoUnknownFields),
      Some(sInnerStructNoUnknownFields)
    )
    testReadingUnknownField(
      TestStructNoUnknownFieldsTrackingInnerStructNoString,
      TestStructInnerStructNoUnknownFieldsTracking,
      sInnerStructNoUnknownFields,
      Some(sInnerStructNoStringNoUnknownFields),
      Some(sInnerStructNoUnknownFields)
    )
    testReadingUnknownField(
      TestStructInnerStructNoStringNoUnknownFieldsTracking,
      TestStructInnerStructNoUnknownFieldsTracking,
      sInnerStructNoUnknownFields,
      Some(sInnerStructNoStringNoUnknownFields),
      Some(sInnerStructNoStringNoUnknownFields)
    )
    testReadingUnknownField(
      TestStructNoUnknownFieldsTrackingInnerStructNoStringNoUnknownFieldsTracking,
      TestStructInnerStructNoUnknownFieldsTracking,
      sInnerStructNoUnknownFields,
      Some(sInnerStructNoStringNoUnknownFields),
      Some(sInnerStructNoStringNoUnknownFields)
    )

    testReadingUnknownField(
      TestStructInnerStructNoString,
      TestStructNoUnknownFieldsTracking,
      sNoUnknownFields,
      Some(sNoUnknownFieldsInnerStructNoString),
      Some(sNoUnknownFields)
    )
    testReadingUnknownField(
      TestStructNoUnknownFieldsTrackingInnerStructNoString,
      TestStructNoUnknownFieldsTracking,
      sNoUnknownFields,
      Some(sNoUnknownFieldsInnerStructNoString),
      Some(sNoUnknownFields)
    )
    testReadingUnknownField(
      TestStructInnerStructNoStringNoUnknownFieldsTracking,
      TestStructNoUnknownFieldsTracking,
      sNoUnknownFields,
      Some(sNoUnknownFieldsInnerStructNoString),
      Some(sNoUnknownFieldsInnerStructNoString)
    )
    testReadingUnknownField(
      TestStructNoUnknownFieldsTrackingInnerStructNoStringNoUnknownFieldsTracking,
      TestStructNoUnknownFieldsTracking,
      sNoUnknownFields,
      Some(sNoUnknownFieldsInnerStructNoString),
      Some(sNoUnknownFieldsInnerStructNoString)
    )

    // Test that unknown values in known enum fields are preserved.
    testReadingUnknownField(StructWithOldEnumField, StructWithNewEnumField, testEnumStruct())

    // "new" vs. "old" here mean "struct with all fields" vs. "struct without some fields".
    def testReadingUnknownField(
      oldMeta: MetaRecord[_, _],
      newMeta: MetaRecord[_, _],
      newObj: TBase[_, _],
      expectedRoundTrippedObj: Option[TBase[_, _]] = None,
      expectedRoundTrippedObjSameProto: Option[TBase[_, _]] = None
    ) {
      // Write the object out.
      val newBuf = doWrite(srcProtocol, newObj)

      // Read the new object into an older version of the same struct.
      val oldObj = oldMeta.createRawRecord.asInstanceOf[TBase[_, _]]
      doRead(srcProtocol, newBuf, oldObj)

      // Write the old object back out.
      val oldBuf1 = doWrite(dstProtocol, oldObj)

      // Read it back into a fresh instance of the old version of the struct.
      val roundtrippedOldObj = oldMeta.createRawRecord.asInstanceOf[TBase[_, _]]
      doRead(dstProtocol, oldBuf1, roundtrippedOldObj)

      // Check that we got what we expect.
      Assert.assertEquals(oldObj, roundtrippedOldObj)

      // Write the old object back out.
      val oldBuf2 = doWrite(dstProtocol, oldObj)

      // Read it back into a fresh instance of the new version of the struct.
      val roundtrippedNewObj = newMeta.createRawRecord.asInstanceOf[TBase[_, _]]
      doRead(dstProtocol, oldBuf2, roundtrippedNewObj)

      // Check that we got what we expect.
      val expected = {
        if ((
              areSameProtocol(srcProtocol, dstProtocol) &&
              srcProtocol != KnownTProtocolNames.TBSONBinaryProtocol
            ) ||
            // TBSONBinaryProtocol uses the same writer as TBSONProtocol
            (srcProtocol == KnownTProtocolNames.TBSONProtocol && dstProtocol == KnownTProtocolNames.TBSONBinaryProtocol) ||
            (srcProtocol == KnownTProtocolNames.TBSONProtocolLegacy && dstProtocol == KnownTProtocolNames.TBSONBinaryProtocol) ||
            (TProtocolInfo.isRobust(srcProtocol) && TProtocolInfo.isRobust(dstProtocol))) {
          expectedRoundTrippedObjSameProto.getOrElse(newObj)
        } else {
          expectedRoundTrippedObj.getOrElse(newObj)
        }
      }
      Assert.assertEquals(
        s"Unexpected value for $oldMeta -> $newMeta, $srcProtocol -> $dstProtocol",
        expected,
        roundtrippedNewObj
      )
    }
  }

  @Test
  def testPatternMatchforIsTextBased() {
    for (protocol <- protocols) {
      // Just checking to ensure that this function call does not end in an exception.
      TProtocolInfo.isTextBased(protocol)
    }
  }

  @Test
  def testPatternMatchforIsRobust() {
    for (protocol <- protocols) {
      // Just checking to ensure that this function call does not end in an exception.
      TProtocolInfo.isRobust(protocol)
    }
  }

  @Test
  def testIsRobustUnknownProtocol() {
    val unknownProtocol = "com.notfoursquare.unknown.UnknownProtocol"
    Assert.assertEquals(TProtocolInfo.isRobust(unknownProtocol), false)
  }

  @Test
  def testIsTextBasedUnknownProtocol() {
    val unknownProtocol = "com.notfoursquare.unknown.UnknownProtocol"
    Assert.assertEquals(TProtocolInfo.isTextBased(unknownProtocol), false)
  }

  private def doWrite(protocolName: String, thriftObj: TBase[_, _]): TMemoryBuffer = {
    val protocolFactory = TProtocolInfo.getWriterFactory(protocolName)
    val trans = new TMemoryBuffer(1024)
    val oprot = protocolFactory.getProtocol(trans)
    thriftObj.write(oprot)
    trans
  }

  private def doRead(protocolName: String, buf: TMemoryBuffer, thriftObj: TBase[_, _]) {
    val protocolFactory = TProtocolInfo.getReaderFactory(protocolName)
    // Unlike TMemoryBuffer, AutoExpandingBufferReadTransport exposes its underlying buffer, and
    // protocols such as TBinaryProtocol take advantage of this, e.g., to return binary values
    // as ByteBuffer wrappers around a segment of that underlying buffer instead of creating a copy.
    // We wrap our data in AutoExpandingBufferReadTransport here to test that things work in such cases.
    val trans = new AutoExpandingBufferReadTransport(1024, 2)
    trans.fill(buf, buf.length)
    val iprot = protocolFactory.getProtocol(trans)
    thriftObj.read(iprot)
  }

  private def testStruct() = TestStruct.newBuilder
    .aBool(true)
    .aByte(120.toByte)
    .anI16(30000.toShort)
    .anI32(7654321)
    .anI64(987654321L)
    .aDouble(0.57)
    .aString("hello, world")
    .aBinary(ByteBuffer.wrap(Array[Byte](1, 2, 3, 4, 5)))
    .aStruct(InnerStruct("hi!", 5))
    .aSet(Set("foo", "bar", "baz"))
    .aList(List(4, 8, 15, 16, 23, 42))
    .aMap(Map("uno" -> InnerStruct("one", 1), "dos" -> InnerStruct("two", 2)))
    .aMyBinary(ByteBuffer.wrap(Array[Byte](1, 2, 3, 4, 5, 6)))
    .aStructList(Seq(InnerStruct("hello", 4), InnerStruct("world", 2)))
    .result()

  private def testStructNoUnknownFieldsTracking() = TestStructNoUnknownFieldsTracking.newBuilder
    .aBool(true)
    .aByte(120.toByte)
    .anI16(30000.toShort)
    .anI32(7654321)
    .anI64(987654321L)
    .aDouble(0.57)
    .aString("hello, world")
    .aBinary(ByteBuffer.wrap(Array[Byte](1, 2, 3, 4, 5)))
    .aStruct(InnerStructNoUnknownFieldsTracking("hi!", 5))
    .aSet(Set("foo", "bar", "baz"))
    .aList(List(4, 8, 15, 16, 23, 42))
    .aMap(
      Map("uno" -> InnerStructNoUnknownFieldsTracking("one", 1), "dos" -> InnerStructNoUnknownFieldsTracking("two", 2))
    )
    .aMyBinary(ByteBuffer.wrap(Array[Byte](1, 2, 3, 4, 5, 6)))
    .aStructList(Seq(InnerStructNoUnknownFieldsTracking("hello", 4), InnerStructNoUnknownFieldsTracking("world", 2)))
    .result()

  private def testStructNoUnknownFieldsTrackingExceptInner() =
    TestStructNoUnknownFieldsTrackingExceptInnerStruct.newBuilder
      .aBool(true)
      .aByte(120.toByte)
      .anI16(30000.toShort)
      .anI32(7654321)
      .anI64(987654321L)
      .aDouble(0.57)
      .aString("hello, world")
      .aBinary(ByteBuffer.wrap(Array[Byte](1, 2, 3, 4, 5)))
      .aStruct(InnerStruct("hi!", 5))
      .aSet(Set("foo", "bar", "baz"))
      .aList(List(4, 8, 15, 16, 23, 42))
      .aMap(Map("uno" -> InnerStruct("one", 1), "dos" -> InnerStruct("two", 2)))
      .aMyBinary(ByteBuffer.wrap(Array[Byte](1, 2, 3, 4, 5, 6)))
      .aStructList(Seq(InnerStruct("hello", 4), InnerStruct("world", 2)))
      .result()

  private def testStructInnerStructNoUnknownFieldsTracking() = TestStructInnerStructNoUnknownFieldsTracking.newBuilder
    .aBool(true)
    .aByte(120.toByte)
    .anI16(30000.toShort)
    .anI32(7654321)
    .anI64(987654321L)
    .aDouble(0.57)
    .aString("hello, world")
    .aBinary(ByteBuffer.wrap(Array[Byte](1, 2, 3, 4, 5)))
    .aStruct(InnerStructNoUnknownFieldsTracking("hi!", 5))
    .aSet(Set("foo", "bar", "baz"))
    .aList(List(4, 8, 15, 16, 23, 42))
    .aMap(
      Map("uno" -> InnerStructNoUnknownFieldsTracking("one", 1), "dos" -> InnerStructNoUnknownFieldsTracking("two", 2))
    )
    .aMyBinary(ByteBuffer.wrap(Array[Byte](1, 2, 3, 4, 5, 6)))
    .aStructList(Seq(InnerStructNoUnknownFieldsTracking("hello", 4), InnerStructNoUnknownFieldsTracking("world", 2)))
    .result()

  private def testStructInnerStructNoString() = TestStruct.newBuilder
    .aBool(true)
    .aByte(120.toByte)
    .anI16(30000.toShort)
    .anI32(7654321)
    .anI64(987654321L)
    .aDouble(0.57)
    .aString("hello, world")
    .aBinary(ByteBuffer.wrap(Array[Byte](1, 2, 3, 4, 5)))
    .aStruct(InnerStruct.newBuilder.anInt(5).result())
    .aSet(Set("foo", "bar", "baz"))
    .aList(List(4, 8, 15, 16, 23, 42))
    .aMap(Map("uno" -> InnerStruct.newBuilder.anInt(1).result(), "dos" -> InnerStruct.newBuilder.anInt(2).result()))
    .aMyBinary(ByteBuffer.wrap(Array[Byte](1, 2, 3, 4, 5, 6)))
    .aStructList(Seq(InnerStruct.newBuilder.anInt(4).result(), InnerStruct.newBuilder.anInt(2).result()))
    .result()

  private def testStructNoUnknownFieldsTrackingInnerStructNoString() = TestStructNoUnknownFieldsTracking.newBuilder
    .aBool(true)
    .aByte(120.toByte)
    .anI16(30000.toShort)
    .anI32(7654321)
    .anI64(987654321L)
    .aDouble(0.57)
    .aString("hello, world")
    .aBinary(ByteBuffer.wrap(Array[Byte](1, 2, 3, 4, 5)))
    .aStruct(InnerStructNoUnknownFieldsTracking.newBuilder.anInt(5).result())
    .aSet(Set("foo", "bar", "baz"))
    .aList(List(4, 8, 15, 16, 23, 42))
    .aMap(
      Map(
        "uno" -> InnerStructNoUnknownFieldsTracking.newBuilder.anInt(1).result(),
        "dos" -> InnerStructNoUnknownFieldsTracking.newBuilder.anInt(2).result()
      )
    )
    .aMyBinary(ByteBuffer.wrap(Array[Byte](1, 2, 3, 4, 5, 6)))
    .aStructList(
      Seq(
        InnerStructNoUnknownFieldsTracking.newBuilder.anInt(4).result(),
        InnerStructNoUnknownFieldsTracking.newBuilder.anInt(2).result()
      )
    )
    .result()

  private def testStructInnerStructNoStringNoUnknownFieldsTracking() =
    TestStructInnerStructNoUnknownFieldsTracking.newBuilder
      .aBool(true)
      .aByte(120.toByte)
      .anI16(30000.toShort)
      .anI32(7654321)
      .anI64(987654321L)
      .aDouble(0.57)
      .aString("hello, world")
      .aBinary(ByteBuffer.wrap(Array[Byte](1, 2, 3, 4, 5)))
      .aStruct(InnerStructNoUnknownFieldsTracking.newBuilder.anInt(5).result())
      .aSet(Set("foo", "bar", "baz"))
      .aList(List(4, 8, 15, 16, 23, 42))
      .aMap(
        Map(
          "uno" -> InnerStructNoUnknownFieldsTracking.newBuilder.anInt(1).result(),
          "dos" -> InnerStructNoUnknownFieldsTracking.newBuilder.anInt(2).result()
        )
      )
      .aMyBinary(ByteBuffer.wrap(Array[Byte](1, 2, 3, 4, 5, 6)))
      .aStructList(
        Seq(
          InnerStructNoUnknownFieldsTracking.newBuilder.anInt(4).result(),
          InnerStructNoUnknownFieldsTracking.newBuilder.anInt(2).result()
        )
      )
      .result()

  private def testStructNoUnknownFieldsTrackingExceptInnerStructNoString() =
    TestStructNoUnknownFieldsTrackingExceptInnerStruct.newBuilder
      .aBool(true)
      .aByte(120.toByte)
      .anI16(30000.toShort)
      .anI32(7654321)
      .anI64(987654321L)
      .aDouble(0.57)
      .aString("hello, world")
      .aBinary(ByteBuffer.wrap(Array[Byte](1, 2, 3, 4, 5)))
      .aStruct(InnerStruct.newBuilder.anInt(5).result())
      .aSet(Set("foo", "bar", "baz"))
      .aList(List(4, 8, 15, 16, 23, 42))
      .aMap(Map("uno" -> InnerStruct.newBuilder.anInt(1).result(), "dos" -> InnerStruct.newBuilder.anInt(2).result()))
      .aMyBinary(ByteBuffer.wrap(Array[Byte](1, 2, 3, 4, 5, 6)))
      .aStructList(Seq(InnerStruct.newBuilder.anInt(4).result(), InnerStruct.newBuilder.anInt(2).result()))
      .result()

  private def testStructInnerStructNoI32() = TestStruct.newBuilder
    .aBool(true)
    .aByte(120.toByte)
    .anI16(30000.toShort)
    .anI32(7654321)
    .anI64(987654321L)
    .aDouble(0.57)
    .aString("hello, world")
    .aBinary(ByteBuffer.wrap(Array[Byte](1, 2, 3, 4, 5)))
    .aStruct(InnerStruct.newBuilder.aString("hi!").result())
    .aSet(Set("foo", "bar", "baz"))
    .aList(List(4, 8, 15, 16, 23, 42))
    .aMap(
      Map(
        "uno" -> InnerStruct.newBuilder.aString("one").result(),
        "dos" -> InnerStruct.newBuilder.aString("two").result()
      )
    )
    .aMyBinary(ByteBuffer.wrap(Array[Byte](1, 2, 3, 4, 5, 6)))
    .aStructList(
      Seq(InnerStruct.newBuilder.aString("hello").result(), InnerStruct.newBuilder.aString("world").result())
    )
    .result()

  private def testStructCollections() = TestStructCollections.newBuilder
    .listBool(List[Boolean](true, false, true))
    .listByte(List[Byte](0, 1, -1, 42, -9, Byte.MinValue, Byte.MaxValue))
    .listI16(List[Short](0, 1, -1, 42, -9, Short.MinValue, Short.MaxValue))
    .listI32(List[Int](0, 1, -1, 42, -9, Int.MinValue, Int.MaxValue))
    .listI64(List[Long](0, 1, -1, 42, -9, Long.MinValue, Long.MaxValue))
    .listDouble(List[Double](0f, 1f, -1f, -32.7, Double.MinValue, Double.MaxValue, Double.MinPositiveValue))
    .listString(List[String]("hello", "world"))
    .listBinary(List[ByteBuffer](ByteBuffer.wrap(Array[Byte](1, 2, 3)), ByteBuffer.wrap(Array[Byte](65, 12))))
    .listStruct(List[InnerStruct](InnerStruct("hi", 5), InnerStruct("bye", 6)))
    .setBool(Set[Boolean](true, false, true))
    .setByte(Set[Byte](0, 1, -1, 42, -9, Byte.MinValue, Byte.MaxValue))
    .setI16(Set[Short](0, 1, -1, 42, -9, Short.MinValue, Short.MaxValue))
    .setI32(Set[Int](0, 1, -1, 42, -9, Int.MinValue, Int.MaxValue))
    .setI64(Set[Long](0, 1, -1, 42, -9, Long.MinValue, Long.MaxValue))
    .setDouble(Set[Double](0f, 1f, -1f, -32.7, Double.MinValue, Double.MaxValue, Double.MinPositiveValue))
    .setString(Set[String]("hello", "world"))
    .setBinary(Set[ByteBuffer](ByteBuffer.wrap(Array[Byte](1, 2, 3)), ByteBuffer.wrap(Array[Byte](65, 12))))
    .setStruct(Set[InnerStruct](InnerStruct("hi", 5), InnerStruct("bye", 6)))
    .mapBool(Map[String, Boolean]("a" -> true, "b" -> false, "c" -> true))
    .mapByte(
      Map[String, Byte]("a" -> 0, "b" -> 1, "c" -> -1, "d" -> 42, "e" -> -9, "f" -> Byte.MinValue, "g" -> Byte.MaxValue)
    )
    .mapI16(
      Map[String, Short](
        "a" -> 0,
        "b" -> 1,
        "c" -> -1,
        "d" -> 42,
        "e" -> -9,
        "f" -> Short.MinValue,
        "g" -> Short.MaxValue
      )
    )
    .mapI32(
      Map[String, Int]("a" -> 0, "b" -> 1, "c" -> -1, "d" -> 42, "e" -> -9, "f" -> Int.MinValue, "g" -> Int.MaxValue)
    )
    .mapI64(
      Map[String, Long]("a" -> 0, "b" -> 1, "c" -> -1, "d" -> 42, "e" -> -9, "f" -> Long.MinValue, "g" -> Long.MaxValue)
    )
    .mapDouble(
      Map[String, Double](
        "a" -> 0f,
        "b" -> 1f,
        "c" -> -1f,
        "d" -> -32.7,
        "e" -> Double.MinValue,
        "f" -> Double.MaxValue,
        "g" -> Double.MinPositiveValue
      )
    )
    .mapString(Map[String, String]("a" -> "hello", "b" -> "world"))
    .mapBinary(
      Map[String, ByteBuffer]("a" -> ByteBuffer.wrap(Array[Byte](1, 2, 3)), "b" -> ByteBuffer.wrap(Array[Byte](65, 12)))
    )
    .mapStruct(Map[String, InnerStruct]("a" -> InnerStruct("hi", 5), "b" -> InnerStruct("bye", 6)))
    .result()

  private def testStructNestedCollections() = TestStructNestedCollections.newBuilder
    .listBool(List[List[Boolean]](List[Boolean](true, false), List[Boolean](true)))
    .listByte(List[List[Byte]](List[Byte](0, 1, -1, 42), List[Byte](-9, Byte.MinValue, Byte.MaxValue)))
    .listI16(List[List[Short]](List[Short](), List[Short](0, 1, -1, 42, -9, Short.MinValue, Short.MaxValue)))
    .listI32(List[List[Int]](List[Int](0, 1, -1, 42, -9, Int.MinValue, Int.MaxValue), List[Int]()))
    .listI64(List[List[Long]](List[Long](0), List[Long](1, -1, 42, -9, Long.MinValue, Long.MaxValue)))
    .listDouble(
      List[List[Double]](
        List[Double](0f, 1f, -1f, -32.7, Double.MinValue),
        List[Double](Double.MaxValue, Double.MinPositiveValue)
      )
    )
    .listString(List[List[String]](List[String]("hello", "world")))
    .listBinary(
      List[List[ByteBuffer]](
        List[ByteBuffer](ByteBuffer.wrap(Array[Byte](1, 2, 3))),
        List[ByteBuffer](ByteBuffer.wrap(Array[Byte](65, 12)))
      )
    )
    .listStruct(
      List[List[InnerStruct]](List[InnerStruct](), List[InnerStruct](InnerStruct("hi", 5), InnerStruct("bye", 6)))
    )
    .setBool(Set[Set[Boolean]](Set[Boolean](true, false), Set[Boolean](true)))
    .setByte(Set[Set[Byte]](Set[Byte](0, 1, -1, 42), Set[Byte](-9, Byte.MinValue, Byte.MaxValue)))
    .setI16(Set[Set[Short]](Set[Short](), Set[Short](0, 1, -1, 42, -9, Short.MinValue, Short.MaxValue)))
    .setI32(Set[Set[Int]](Set[Int](0, 1, -1, 42, -9, Int.MinValue, Int.MaxValue), Set[Int]()))
    .setI64(Set[Set[Long]](Set[Long](0), Set[Long](1, -1, 42, -9, Long.MinValue, Long.MaxValue)))
    .setDouble(
      Set[Set[Double]](
        Set[Double](0f, 1f, -1f, -32.7, Double.MinValue),
        Set[Double](Double.MaxValue, Double.MinPositiveValue)
      )
    )
    .setString(Set[Set[String]](Set[String]("hello", "world")))
    .setBinary(
      Set[Set[ByteBuffer]](
        Set[ByteBuffer](ByteBuffer.wrap(Array[Byte](1, 2, 3))),
        Set[ByteBuffer](ByteBuffer.wrap(Array[Byte](65, 12)))
      )
    )
    .setStruct(Set[Set[InnerStruct]](Set[InnerStruct](), Set[InnerStruct](InnerStruct("hi", 5), InnerStruct("bye", 6))))
    .mapBool(
      Map[String, Map[String, Boolean]](
        "foo" -> Map[String, Boolean]("a" -> true, "b" -> false),
        "bar" -> Map[String, Boolean]("c" -> true)
      )
    )
    .mapByte(
      Map[String, Map[String, Byte]](
        "foo" -> Map[String, Byte]("a" -> 0, "b" -> 1, "c" -> -1, "d" -> 42),
        "bar" -> Map[String, Byte]("e" -> -9, "f" -> Byte.MinValue, "g" -> Byte.MaxValue)
      )
    )
    .mapI16(
      Map[String, Map[String, Short]](
        "foo" -> Map[String, Short](),
        "bar" -> Map[String, Short](
          "a" -> 0,
          "b" -> 1,
          "c" -> -1,
          "d" -> 42,
          "e" -> -9,
          "f" -> Short.MinValue,
          "g" -> Short.MaxValue
        )
      )
    )
    .mapI32(
      Map[String, Map[String, Int]](
        "foo" -> Map[String, Int](
          "a" -> 0,
          "b" -> 1,
          "c" -> -1,
          "d" -> 42,
          "e" -> -9,
          "f" -> Int.MinValue,
          "g" -> Int.MaxValue
        ),
        "bar" -> Map[String, Int]()
      )
    )
    .mapI64(
      Map[String, Map[String, Long]](
        "foo" -> Map[String, Long]("a" -> 0),
        "bar" -> Map[String, Long](
          "b" -> 1,
          "c" -> -1,
          "d" -> 42,
          "e" -> -9,
          "f" -> Long.MinValue,
          "g" -> Long.MaxValue
        )
      )
    )
    .mapDouble(
      Map[String, Map[String, Double]](
        "foo" -> Map[String, Double]("a" -> 0f, "b" -> 1f, "c" -> -1f, "d" -> -32.7, "e" -> Double.MinValue),
        "bar" -> Map[String, Double]("f" -> Double.MaxValue, "g" -> Double.MinPositiveValue)
      )
    )
    .mapString(Map[String, Map[String, String]]("foo" -> Map[String, String]("a" -> "hello", "b" -> "world")))
    .mapBinary(
      Map[String, Map[String, ByteBuffer]](
        "foo" -> Map[String, ByteBuffer]("a" -> ByteBuffer.wrap(Array[Byte](1, 2, 3))),
        "bar" -> Map[String, ByteBuffer]("b" -> ByteBuffer.wrap(Array[Byte](65, 12)))
      )
    )
    .mapStruct(
      Map[String, Map[String, InnerStruct]](
        "foo" -> Map[String, InnerStruct](),
        "bar" -> Map[String, InnerStruct]("a" -> InnerStruct("hi", 5), "b" -> InnerStruct("bye", 6))
      )
    )
    .result()

  private def testEnumStruct() = StructWithNewEnumField.newBuilder
    .anEnum(NewTestEnum.Two)
    .anEnumList(NewTestEnum.Zero :: NewTestEnum.Two :: NewTestEnum.One :: Nil)
    .result()
}


text:
<template name="createBundleAction">

      {{#if orders}}

{{ i18n 'exportPaidInvoices.title' orders amount }}

        <button class="btn btn-primary create-payments-bundle-button">{{ i18n 'exportPaidInvoices.buttons.save' }} </button>
      {{else}}

{{ i18n 'exportPaidInvoices.noPaidOrders' }}

      {{/if}}

</template>


text:
import {provide, DynamicComponentLoader, ApplicationRef, APP_INITIALIZER} from 'angular2/core';
import {noop} from './util';
import {loadComponent} from './loader';

export const loadComponentProvider = provide(APP_INITIALIZER, {
  multi: true,
  deps: [ DynamicComponentLoader, ApplicationRef ],
  useFactory: function(loader, app) {
    ['loadAsRoot', 'loadNextToLocation', 'loadIntoLocation'].forEach(function(methodName) {
      let originalMethod = loader[methodName];

      loader[methodName] = function(path, ...rest) {
        if (typeof path !== 'string') {
          return originalMethod.apply(this, arguments);
        }

        let componentIndex = app.componentTypes.length - 1;

        return loadComponent(path).then(type => {
          rest.unshift(type);

          if (methodName === 'loadAsRoot') {
            app.componentTypes[componentIndex] = type;
          }

          return originalMethod.apply(this, rest);
        });
      };
    });

    return noop;
  }
})


text:
namespace gep
{
    //the result type
    enum Result
    {
        FAILURE = 0,
        SUCCESS = 1
    };

    //don't initialize type
    enum DoNotInitialize
    {
      DO_NOT_INITIALIZE
    };

    enum class TakeOwnership
    {
        no,
        yes
    };

    // integer types
    typedef unsigned char uint8;
    typedef char int8;
    typedef unsigned short uint16;
    typedef short int16;
    typedef unsigned int uint32;
    typedef int int32;
    typedef unsigned long long uint64;
    typedef long long int64;

    //test integer types
    static_assert(sizeof(uint8) == 1, "uint8 is not 8 bit wide");
    static_assert(sizeof(int8) == 1, "int8 is not 8 bit wide");
    static_assert(sizeof(uint16) == 2, "uint16 is not 16 bit wide");
    static_assert(sizeof(int16) == 2, "int16 is not 16 bit wide");
    static_assert(sizeof(int32) == 4, "int32 is not 32 bit wide");
    static_assert(sizeof(uint32) == 4, "uint32 is not 32 bit wide");
    static_assert(sizeof(int64) == 8, "int64 is not 64 bit wide");
    static_assert(sizeof(uint64) == 8, "uint64 is not 64 bit wide");
};


text:
class HomeModel {
    constructor() {
        this.title = 'Home';
    }
}

export default HomeModel;


text:
/**
 *
 */
package com.ycsoft.business.dto.core.acct;

import java.io.Serializable;

import com.ycsoft.commons.constants.DictKey;
import com.ycsoft.commons.store.MemoryDict;

/**
 * @author YC-SOFT
 *
 */
public class PayDto implements Serializable{
	/**
	 */
	private static final long serialVersionUID = 1L;
	private String acct_id ;
	private String acctitem_id ;
	private String cust_id;
	private String user_id;
	private String prod_sn;
	private String tariff_id;
	private String fee_date;
	private String begin_date;
	private String invalid_date;
	private String disct_id;
	private Integer fee;
	private Integer present_fee;
	private String card_id;
	private String next_invalid_date;

	private String cust_no;
	private String cust_name;
	private String cust_addr;
	private String user_type;
	private String prod_name;
	private String invoice_id;
	private String invoice_code;
	private String invoice_book_id;
	private String invoice_mode;
	private Integer done_code;
	private String create_time;
	private String user_type_text;

	/**
	 * @return the cust_id
	 */
	public String getCust_id() {
		return cust_id;
	}
	/**
	 * @param cust_id the cust_id to set
	 */
	public void setCust_id(String cust_id) {
		this.cust_id = cust_id;
	}
	public String getAcct_id() {
		return acct_id;
	}
	public void setAcct_id(String acct_id) {
		this.acct_id = acct_id;
	}
	public String getAcctitem_id() {
		return acctitem_id;
	}
	public void setAcctitem_id(String acctitem_id) {
		this.acctitem_id = acctitem_id;
	}
	public String getUser_id() {
		return user_id;
	}
	public void setUser_id(String user_id) {
		this.user_id = user_id;
	}
	public String getTariff_id() {
		return tariff_id;
	}
	public void setTariff_id(String tariff_id) {
		this.tariff_id = tariff_id;
	}
	public String getProd_sn() {
		return prod_sn;
	}
	public void setProd_sn(String prod_sn) {
		this.prod_sn = prod_sn;
	}
	public String getFee_date() {
		return fee_date;
	}
	public void setFee_date(String fee_date) {
		this.fee_date = fee_date;
	}
	public String getInvalid_date() {
		return invalid_date;
	}
	public void setInvalid_date(String invalid_date) {
		this.invalid_date = invalid_date;
	}
	public String getDisct_id() {
		return disct_id;
	}
	public void setDisct_id(String disct_id) {
		this.disct_id = disct_id;
	}
	public Integer getFee() {
		return fee;
	}
	public void setFee(Integer fee) {
		this.fee = fee;
	}
	public String getBegin_date() {
		return begin_date;
	}
	public void setBegin_date(String begin_date) {
		this.begin_date = begin_date;
	}
	public Integer getPresent_fee() {
		return present_fee==null?0:present_fee;
	}
	public void setPresent_fee(Integer present_fee) {
		this.present_fee = present_fee;
	}
	public String getCard_id() {
		return card_id;
	}
	public void setCard_id(String card_id) {
		this.card_id = card_id;
	}
	public String getCust_no() {
		return cust_no;
	}
	public void setCust_no(String cust_no) {
		this.cust_no = cust_no;
	}
	public String getCust_name() {
		return cust_name;
	}
	public void setCust_name(String cust_name) {
		this.cust_name = cust_name;
	}
	public String getCust_addr() {
		return cust_addr;
	}
	public void setCust_addr(String cust_addr) {
		this.cust_addr = cust_addr;
	}
	public String getUser_type() {
		return user_type;
	}
	public void setUser_type(String user_type) {
		this.user_type = user_type;
		this.user_type_text = MemoryDict.getDictName(DictKey.USER_TYPE, user_type);
	}
	public String getProd_name() {
		return prod_name;
	}
	public void setProd_name(String prod_name) {
		this.prod_name = prod_name;
	}
	public String getInvoice_id() {
		return invoice_id;
	}
	public void setInvoice_id(String invoice_id) {
		this.invoice_id = invoice_id;
	}
	public String getInvoice_book_id() {
		return invoice_book_id;
	}
	public void setInvoice_book_id(String invoice_book_id) {
		this.invoice_book_id = invoice_book_id;
	}
	public String getInvoice_mode() {
		return invoice_mode;
	}
	public void setInvoice_mode(String invoice_mode) {
		this.invoice_mode = invoice_mode;
	}
	public Integer getDone_code() {
		return done_code;
	}
	public void setDone_code(Integer doneCode) {
		done_code = doneCode;
	}
	public String getInvoice_code() {
		return invoice_code;
	}
	public void setInvoice_code(String invoice_code) {
		this.invoice_code = invoice_code;
	}
	public String getNext_invalid_date() {
		return next_invalid_date;
	}
	public void setNext_invalid_date(String next_invalid_date) {
		this.next_invalid_date = next_invalid_date;
	}
	public String getCreate_time() {
		return create_time;
	}
	public void setCreate_time(String createTime) {
		create_time = createTime;
	}
	public String getUser_type_text() {
		return user_type_text;
	}
}