text:
cask "pycharm" do
  arch arm: "-aarch64"

  version "2022.2.3,222.4345.23"
  sha256 arm:   "59d9553ab01de9460984f082c12fb0586aeb84eb00a4501bab358e516f1f6847",
         intel: "920326a35589fee80e70b84d23184daf1d3efc8ecf4ec8c273c2bf2ec764a5b7"

  url "https://download.jetbrains.com/python/pycharm-professional-#{version.csv.first}#{arch}.dmg"
  name "PyCharm"
  name "PyCharm Professional"
  desc "IDE for professional Python development"
  homepage "https://www.jetbrains.com/pycharm/"

  livecheck do
    url "https://data.services.jetbrains.com/products/releases?code=PCP&latest=true&type=release"
    strategy :page_match do |page|
      JSON.parse(page)["PCP"].map do |release|
        "#{release["version"]},#{release["build"]}"
      end
    end
  end

  auto_updates true
  depends_on macos: ">= :high_sierra"

  app "PyCharm.app"

  uninstall_postflight do
    ENV["PATH"].split(File::PATH_SEPARATOR).map { |path| File.join(path, "charm") }.each do |path|
      if File.readable?(path) &&
         File.readlines(path).grep(/# see com.intellij.idea.SocketLock for the server side of this interface/).any?
        File.delete(path)
      end
    end
  end

  zap trash: [
    "~/Library/Application Support/JetBrains/PyCharm#{version.major_minor}",
    "~/Library/Application Support/PyCharm#{version.major_minor}",
    "~/Library/Caches/JetBrains/PyCharm#{version.major_minor}",
    "~/Library/Logs/JetBrains/PyCharm#{version.major_minor}",
    "~/Library/Preferences/com.jetbrains.pycharm.plist",
    "~/Library/Preferences/jetbrains.pycharm.*.plist",
    "~/Library/Preferences/PyCharm#{version.major_minor}",
    "~/Library/Saved Application State/com.jetbrains.pycharm.savedState",
  ]
end


text:
'''
Created on May 7, 2014

@author: eran
'''
import unittest
from adiencealign.landmarks_detection.landmarks_detector import detect_landmarks
import os
from adiencealign.common.landmarks import read_fidu
from adience.common.utils.fidu import draw_fidu
import cv2

class Test(unittest.TestCase):

    def testDetectLandmarks(self):
        input_file = os.path.abspath('./resources/landmarks/Fayssal_Mekdad_0002.jpg')
        fidu_file = input_file.replace('.jpg','.cfidu')
        if os.path.exists(fidu_file):
            os.remove(fidu_file)

        detect_landmarks(fname = input_file)
        fidu_score, yaw_angle, fidu_points = read_fidu(fidu_file)

        self.assertEqual(fidu_score, 252)
        self.assertEqual(yaw_angle, 0)

        img = cv2.imread(input_file)
        draw_fidu(img, fidu_points)
        cv2.imshow('landmarks',img)
        cv2.waitKey()

        if os.path.exists(fidu_file):
            os.remove(fidu_file)

        detect_landmarks(fname = input_file, max_size = 160*160)
        fidu_score, yaw_angle, fidu_points = read_fidu(fidu_file)

        print "new fidu score is", fidu_score
        self.assertGreater(fidu_score, 200)
        self.assertEqual(yaw_angle, 0)

        img = cv2.imread(input_file)
        draw_fidu(img, fidu_points)
        cv2.imshow('landmarks, detected on reduced image',img)
        cv2.waitKey()

if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testName']
    unittest.main()

redpajama_set_name: RedPajamaGithub


text:
<?php

use yii\db\Migration;

/**
 * Handles the creation for table `tb_bn_equipos`.
 */
class m161016_202008_create_TB_BN_EQUIPOS_table extends Migration
{
    /**
     * @inheritdoc
     */
    public function safeUp()
    {
        $this->createTable('tb_bn_equipos', [
            'CodigoEquipo' => $this->primaryKey(),
            'Fecha' => $this->dateTime(),
            'NumeroInventario' => $this->string(255),
            'CodigoCategoria' => $this->integer()->notNull(),
            'DescripcionEquipo' => $this->string(255),
            'Marca' => $this->string(50),
            'SerieEquipo' => $this->string(100),
            'Color' => $this->string(50),
            'CodigoDepartamento' => $this->integer()->notNull(),
            'Telefono' => $this->string(15),
            'Piso' => $this->string(50),
            'CodigoEdificio' => $this->integer()->notNull(),
            'CodigoTipoDoc' => $this->integer()->notNull(),
            'NumeroDocumento' => $this->string(50),
            'FechaDocumento' => $this->dateTime(),
            'CostoUnitario' => $this->double(18,2),
            'id' => $this->integer()->notNull(),
            'CodigoEstadoEquipo' => $this->integer()->notNull(),
            'Observaciones' => $this->string(255),
            'SistemaFecha' => $this->dateTime(),
            'SistemaUsuario' => $this->string(100),
            'CodigoEstadoAsignacion' => $this->integer()->notNull(),
        ]);
        $this->addForeignKey('fk_EQUIPOS_CATEGORIA','tb_bn_equipos','CodigoCategoria','tb_bn_categorias_bienes','CodigoCategoria');
        $this->addForeignKey('fk_EQUIPOS_EDIFICIOS','tb_bn_equipos','CodigoEdificio','tb_bn_edificios','CodigoEdificio');
        $this->addForeignKey('fk_EQUIPOS_TIPO_DOC','tb_bn_equipos','CodigoTipoDoc','tb_bn_tipos_documentos','CodigoTipoDoc');
        $this->addForeignKey('fk_EQUIPOS_EMPLEADO','tb_bn_equipos','id','user','id');
        $this->addForeignKey('fk_EQUIPOS_ESTADO_EQUIPO','tb_bn_equipos','CodigoEstadoEquipo','tb_bn_estado_equipo','CodigoEstadoEquipo');
        $this->addForeignKey('fk_EQUIPOS_ESTADO_ASIGNACION','tb_bn_equipos','CodigoEstadoAsignacion','tb_bn_estadoasignacion','CodigoEstadoAsignacion');
    }

    /**
     * @inheritdoc
     */
    public function down()
    {
        $this->dropTable('tb_bn_equipos');
    }
}


text:
// Package wcmatch implements wildcard matching files using .gitignore syntax.
package wcmatch

import (
	"fmt"
	"strings"
	"unicode"

	"github.com/pkg/errors"
)

// WildcardMatcher represents a wildcard-pattern (in .gitignore syntax) and options used to match against file paths.
type WildcardMatcher struct {
	pattern string
	tokens  []token
	dirOnly bool
	negated bool
	options Options
}

// Options defines flags that controls a WildcardMatcher.
type Options struct {
	IgnoreCase bool
	BaseDir    string
}

// Option supports the functional option pattern for NewWildcardMatcher.
type Option func(*Options)

// IgnoreCase is used to enable/disable case-insensitive operation when creating a WildcardMatcher.
func IgnoreCase(enabled bool) Option {
	return func(args *Options) {
		args.IgnoreCase = enabled
	}
}

// BaseDir is used to set the base directory to use when creating a WildcardMatcher.
// Providing a base dir here means the matcher will not match anything outside of that
// directory.
//
// Examples:
// The pattern 'a.txt' with the base dir '/my/base' is equivalent to
// the pattern '/my/base/**/a.txt' without a base dir.
//
// The pattern '/a.txt' with the base dir '/my/base/ is equivalent to
// the pattern '/my/base/a.txt' without a base dir.
func BaseDir(dir string) Option {
	return func(args *Options) {
		args.BaseDir = dir
	}
}

// Pattern returns the original pattern from which this matcher was created.
func (matcher *WildcardMatcher) Pattern() string {
	return matcher.pattern
}

// Negated inidicates whether the pattern used by this matcher is a negated pattern, i.e. starts with a '!'.
func (matcher *WildcardMatcher) Negated() bool {
	return matcher.negated
}

// Options gets the options used when constructing the WildcardMatcher.
func (matcher *WildcardMatcher) Options() Options {
	return matcher.options
}

// NewWildcardMatcher creates a new WildcardMatcher with the specified pattern and options.
// The default option is for the matcher to be case-sensitive without a base dir.
//
//nolint:funlen,gocognit,gocyclo,cyclop,maintidx
func NewWildcardMatcher(pattern string, options ...Option) (matcher *WildcardMatcher, err error) {
	var result []token

	if len(pattern) > 2 && pattern[len(pattern)-2] != '\\' {
		pattern = strings.TrimSpace(pattern)
	}

	args := &Options{
		IgnoreCase: false,
		BaseDir:    "",
	}

	for _, option := range options {
		option(args)
	}

	// Ensure that BaseDir does not have a trailing directory separator if it is non-empty.
	if len(args.BaseDir) > 1 && strings.HasSuffix(args.BaseDir, "/") {
		args.BaseDir = args.BaseDir[:len(args.BaseDir)-1]
	}

	p := newRuneScanner(pattern, args.IgnoreCase)

	// Skip leading whitespace
	for unicode.IsSpace(p.peek(0)) {
		p.read()
	}

	negated := false
	if p.peek(0) == '!' {
		negated = true

		p.read()
	}

	isPatternRooted := p.peek(0) == '/'

	// Prepend the base directory to the pattern if we have one.
	if args.BaseDir != "" && pattern != "" {
		for _, ch := range args.BaseDir {
			if ch == '/' {
				result = append(result, tokenDirSep{})
			} else {
				result = append(result, tokenRune{ch})
			}
		}

		if !isPatternRooted {
			result = append(result, tokenDirSep{})
		}
	}

	// If the pattern isn't rooted, i.e. doesn't start with a '/', nor contain a '/' in the middle somewhere, then we want it to match
	// anywhere, so we add an implicit '**/' to the start of the pattern.
	firstSlashIndex := p.indexOf('/')
	if !isPatternRooted && pattern != "**" && pattern != "" {
		if firstSlashIndex == -1 || firstSlashIndex == len(p.text)-1-p.pos {
			result = append(result, tokenStar{true}, tokenDirSep{})
		} else if args.BaseDir == "" {
			// An unrooted pattern that contains a slash in the middle should be considered rooted, so
			// prepend the pattern with a '/', unless we have a baseDir, in which case we already have rooted
			// the pattern above.
			result = append(result, tokenDirSep{})
		}
	}

	dirOnly := false
	if len(p.text) > 0 && p.text[len(p.text)-1] == '/' {
		dirOnly = true
		p.text = p.text[:len(p.text)-1]
	}

	for ch := p.read(); ch != 0; ch = p.read() {
		switch ch {
		case '\\':
			if p.eos() {
				return nil, errors.Errorf("invalid pattern \"%v\": end of line found after '\\' character. Use '\\\\' to indicate a literal backslash in a pattern", pattern)
			}

			ch = p.read()
			result = append(result, tokenRune{ch})

		case '?':
			result = append(result, tokenAnyChar{})

		case '/':
			result = append(result, tokenDirSep{})

		case '*':
			if p.peek(0) == '*' {
				// We have a double star
				prevCh := p.peek(-2)

				for p.peek(0) == '*' {
					// Just consume contiguous stars
					p.read()
				}

				if prevCh == 0 || prevCh == '/' && (p.peek(0) == '/' || p.eos()) {
					result = append(result, tokenStar{doubleStar: true})
					continue
				}
			}

			result = append(result, tokenStar{doubleStar: false})

		case '[':
			ch = p.read()
			negatedSeq := ch == '!'

			if negatedSeq {
				ch = p.read()
			}

			var seq []seqToken

			for ; ch != ']' && ch != 0; ch = p.read() {
				if ch == 0 {
					return nil, errors.Errorf("invalid pattern \"%v\": end of line found, expected ']'", pattern)
				}

				if ch == '\\' {
					ch = p.read()
					if ch == 0 {
						return nil, errors.Errorf("invalid pattern \"%v\": end of line found after '\\' character. Use '\\\\' to indicate a literal backslash in a pattern", pattern)
					}
				}

				switch {
				case p.peek(0) == '-' && p.peek(1) != ']' && p.peek(1) != 0:
					// we have a range
					p.read() // consume the '-'
					endCh := p.read()

					if endCh == '\\' {
						endCh = p.read()
						if endCh == 0 {
							return nil, errors.Errorf("invalid pattern \"%v\": end of line found after '\\' character. Use '\\\\' to indicate a literal backslash in a pattern", pattern)
						}
					}

					seq = append(seq, seqTokenRuneRange{ch, endCh, negatedSeq})

				case ch == '[' && p.peek(0) == ':':
					closingBracketIndex := p.indexOf(']')
					if closingBracketIndex == -1 {
						return nil, errors.Errorf("invalid pattern \"%v\": unterminated sequence, expected ']'", pattern)
					}

					if closingBracketIndex-1 <= p.pos || p.peek(closingBracketIndex-1) != ':' {
						// treat as normal
						seq = append(seq, seqTokenRune{ch})
						continue
					}

					class := strings.ToLower(string(p.text[p.pos+1 : closingBracketIndex+p.pos-1]))
					p.pos += closingBracketIndex + 1

					var m func(ch rune) bool

					switch class {
					case "alnum":
						m = func(ch rune) bool {
							return unicode.IsLetter(ch) || unicode.IsDigit(ch)
						}
					case "alpha":
						m = unicode.IsLetter

					case "ascii":
						m = func(ch rune) bool {
							return ch >= 0 && ch <= 127
						}
					case "blank":
						m = func(ch rune) bool {
							return unicode.Is(unicode.Zs, ch) || ch == '\t'
						}
					case "cntrl":
						m = unicode.IsControl

					case "digit":
						m = unicode.IsDigit

					case "graph":
						m = unicode.IsGraphic

					case "lower":
						m = unicode.IsLower

					case "print":
						m = unicode.IsPrint

					case "punct":
						m = func(ch rune) bool {
							return unicode.IsPunct(ch) || unicode.IsSymbol(ch)
						}
					case "space":
						m = unicode.IsSpace

					case "upper":
						if args.IgnoreCase {
							m = func(ch rune) bool {
								return unicode.IsUpper(ch) || unicode.IsLower(ch)
							}
						} else {
							m = unicode.IsUpper
						}
					case "xdigit":
						m = func(ch rune) bool {
							return ch >= 'A' && ch <= 'F' ||
								ch >= 'a' && ch <= 'f' ||
								unicode.IsDigit(ch)
						}

					default:
						return nil, errors.Errorf("invalid pattern %#v: unrecognized character class [:%v:]", pattern, class)
					}

					seq = append(seq, seqTokenClass{class, m})
				default:
					seq = append(seq, seqTokenRune{ch})
				}
			}

			if ch != ']' {
				return nil, errors.Errorf("invalid pattern %#v: unterminated sequence, expected ']'", pattern)
			}

			result = append(result, tokenSeq{seq, negatedSeq})

		default:
			result = append(result, tokenRune{ch})
		}
	}

	return &WildcardMatcher{
		pattern: pattern,
		tokens:  result,
		options: *args,
		dirOnly: dirOnly,
		negated: negated,
	}, nil
}

type matchResult int

const (
	wcMatch matchResult = iota
	wcNoMatch
	wcAbortAll
	wcAbortToDoubleStar
)

// Match matches the specified text against the pattern of this WildcardMatcher. Returns true if it is a match,
// and false if it is not.  isDir should be set to true to indicate that the specified text is a directory, and
// false if it is a file.
func (matcher *WildcardMatcher) Match(text string, isDir bool) bool {
	if matcher.dirOnly && !isDir {
		return matcher.negated
	}

	return (doMatch(matcher.tokens, []rune(text), matcher.options.IgnoreCase) == wcMatch) != matcher.negated
}

//nolint:gocognit,gocyclo,cyclop
func doMatch(tokens []token, text []rune, ignoreCase bool) matchResult {
	t := runeScanner{0, text, ignoreCase}

	var tch rune
	for pi := 0; pi < len(tokens); pi, _ = pi+1, t.read() {
		tch = t.peek(0)

		if t.eos() && !isStar(tokens[pi]) {
			// We have reached the end of the text but with pattern still remaining without an '*'. This is not a match.
			return wcAbortAll
		}

		switch token := tokens[pi].(type) {
		case tokenRune:
			if tch != token.Ch {
				return wcNoMatch
			}

		case tokenDirSep:
			if tch != '/' {
				return wcNoMatch
			}
		case tokenAnyChar:
			if tch == '/' {
				return wcNoMatch
			}

			continue

		case tokenStar:
			if pi == len(tokens)-1 {
				// Trailing ** matches everything. Trailing '*' matches only if there are no more directory separators.
				if !token.doubleStar && indexOf(text[t.pos:], '/') != -1 {
					return wcNoMatch
				}

				return wcMatch
			}

			if token.doubleStar && pi+2 < len(tokens) && isDirSep(tokens[pi+1]) && doMatch(tokens[pi+2:], text[t.pos:], ignoreCase) == wcMatch {
				return wcMatch
			}

			if !token.doubleStar && isDirSep(tokens[pi+1]) {
				// One asterisk followed by a slash
				slashIndex := indexOf(text[t.pos:], '/')
				if slashIndex == -1 {
					return wcNoMatch
				}

				// Skip all characters up to the upcoming directory sep.
				t.pos += slashIndex - 1

				break
			}

			for {
				if t.eos() {
					break
				}

				matchResult := doMatch(tokens[pi+1:], text[t.pos:], ignoreCase)
				if matchResult != wcNoMatch {
					if !token.doubleStar || matchResult != wcAbortToDoubleStar {
						return matchResult
					}
				} else if !token.doubleStar && tch == '/' {
					// We are working on a single asterisk matching and encountered a '/', so return AbortToStarStar, meaning any
					// recursive calls will abort until we reach a '**' matching loop where we will then continue.
					return wcAbortToDoubleStar
				}

				tch = t.read()
			}

			return wcAbortAll

		case tokenSeq:
			match := false

			for _, r := range token.items {
				if r.match(tch) {
					match = true
					break
				}
			}

			if match == token.negated {
				return wcNoMatch
			}

		default:
			panic(fmt.Sprintf("internal error, unsupported token %T", token))
		}
	}

	if t.eos() {
		return wcMatch
	}

	return wcNoMatch
}

func indexOf(slice []rune, ch rune) int {
	for i, n := range slice {
		if n == ch {
			return i
		}
	}

	return -1
}


text:
from setuptools import setup
import twitch

setup(name='twitch.py',
	  description='Twitch API for Python',
	  author='Zakru',
	  authir_email='sakari.leukkunen@gmail.com',
	  url='https://github.com/Zakru/twitch.py',
	  version=twitch.__version__,
	  packages=['twitch'],
	  license='MIT')


text:
package com.ggt.slidescast.slideshare.model;

import java.io.Serializable;

public class SlideShareServiceError extends SlideShareObject implements Serializable {

	private static final long serialVersionUID = -696563550019943702L;

	private Message Message;

	public Message getMessage() {
		return Message;
	}

	public void setMessage(Message message) {
		Message = message;
	}

}


text:
using ECQRS.Commons.Events;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UserManager.Core.Organizations.Events
{
    public class OrganizationModified : Event
    {
        public Guid OrganizationId { get; set; }
        public string Name { get; set; }
    }

}


text:
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace BaseIMEUI
{
    public partial class BIStatusBarForm
    {
        /// <summary>
        /// Ask the status bar to reload all settings and reset the user
 		/// interface.
        /// </summary>
        public void Reload()
        {
			this.u_smartPhoneticToolStripMenuItem.Checked = false;
            this.u_terminateServerToolStripMenuItem.Checked = false;
            this.u_cangjieToolStripMenuItem.Checked = false;
            this.u_simplexToolStripMenuItem.Checked = false;

            this.u_toolStrip.Items.Clear();
            this.u_toolStrip.Items.AddRange(this.m_defaultToolStripItems);
            this.SetMiniModeByConfig();
            this.SetMiniModeTypeByConfig();
            this.InitUI();
        }

        #region Initialize User Interface
        /// <summary>
        /// Initialize User Interface
        /// </summary>
        private void InitUI()
        {
            BIServerConnector callback = BIServerConnector.SharedInstance;
            Dictionary<string, string> extraInputMethods = new Dictionary<string, string>();
            Dictionary<string, string> outputFilters = new Dictionary<string, string>();
            Dictionary<string, string> aroundFilters = new Dictionary<string, string>();
            List<string> modulesSuppressedFromUI = new List<string>();

            string currentInputMethod = "";
            bool useFullWidth = true;
            bool useSimplifiedChinese = false;
            bool useEnglishKeyboard = false;

            if (callback != null)
            {
                currentInputMethod = callback.stringValueForLoaderConfigKey("PrimaryInputMethod");
                if (currentInputMethod.Length == 0)
                    currentInputMethod = callback.primaryInputMethod();

                useSimplifiedChinese = callback.isOutputFilterEnabled("ChineseCharacterConvertor-TC2SC");
                useFullWidth = callback.isFullWidthCharacterMode();
                extraInputMethods = callback.allInputMethodIdentifiersAndNames();
                outputFilters = callback.allOutputFilterIdentifiersAndNames();
                aroundFilters = callback.allAroundFilterIdentifiersAndNames();
                modulesSuppressedFromUI = callback.arrayValueForLoaderConfigKey("ModulesSuppressedFromUI");

                if (callback.isLoaderConfigKeyTrue("EnablesCapsLockAsAlphanumericModeToggle"))
                    this.u_toolStrip.Items.Remove(u_toggleAlphanumericMode);
            }

			// Load extra Input Method modules.

			this.u_toggleInputMethodDropDownMenu.Items.Clear();
            this.u_toggleInputMethodDropDownMenu.Items.AddRange(this.m_defualtInputMethodMenuItems);

            if (modulesSuppressedFromUI.Contains("SmartMandarin"))
                this.u_toggleInputMethodDropDownMenu.Items.Remove(this.u_smartPhoneticToolStripMenuItem);
            if (modulesSuppressedFromUI.Contains("TraditionalMandarins"))
                this.u_toggleInputMethodDropDownMenu.Items.Remove(this.u_traditionalPhoneticToolStripMenuItem);
            if (modulesSuppressedFromUI.Contains("Generic-cj-cin"))
                this.u_toggleInputMethodDropDownMenu.Items.Remove(this.u_cangjieToolStripMenuItem);
            if (modulesSuppressedFromUI.Contains("Generic-simplex-cin"))
                this.u_toggleInputMethodDropDownMenu.Items.Remove(this.u_simplexToolStripMenuItem);

            if (extraInputMethods.Count > 0)
            {
                ToolStrip tempStrip = new ToolStrip();
                ToolStripItem[] tempItems = new ToolStripItem[] { };
                ToolStripItemCollection genericInputMethodMenuItems = new ToolStripItemCollection(tempStrip, tempItems);

                foreach (KeyValuePair<string, string> genericInputMethod in extraInputMethods)
                {
                    string moduleID = genericInputMethod.Key;
                    string moduleName = genericInputMethod.Value;

					if (modulesSuppressedFromUI.Contains(moduleID))
					    continue;

                    System.Windows.Forms.ToolStripMenuItem newItem = new System.Windows.Forms.ToolStripMenuItem();

                    if (moduleID.Equals(currentInputMethod))
                        newItem.CheckState = CheckState.Checked;

                    newItem.AutoSize = true;
                    newItem.Image = global::BaseIMEUI.Properties.Resources.generic;
                    newItem.Name = moduleID;
                    newItem.Text = moduleName;
                    newItem.ToolTipText = moduleName;
                    newItem.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
                    newItem.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
                    newItem.Click += new System.EventHandler(this.SelectInputMethod);
					genericInputMethodMenuItems.Add(newItem);
                }

                if (u_toggleInputMethodDropDownMenu.Items.Count > 0 && genericInputMethodMenuItems.Count > 0)
                    this.u_toggleInputMethodDropDownMenu.Items.Add(new ToolStripSeparator());
				if (genericInputMethodMenuItems.Count > 0)
                   this.u_toggleInputMethodDropDownMenu.Items.AddRange(genericInputMethodMenuItems);
                tempStrip.Dispose();
            }

			// Avoids that there is no input method in the menu.
			if (this.u_toggleInputMethodDropDownMenu.Items.Count == 0)
				this.u_toggleInputMethodDropDownMenu.Items.Add(this.u_smartPhoneticToolStripMenuItem);

            this.u_configsDropDownMenu.Items.Clear();

			// Loads Around Filters.
            if (aroundFilters.Count > 0)
            {
                foreach (KeyValuePair<string, string> aroundFilter in aroundFilters)
                {
                    string moduleID = aroundFilter.Key;
                    string moduleName = aroundFilter.Value;

					// Makes the search and evanuator module always enabled.
                    if (moduleID.Equals("OneKey") || moduleID.Equals("Evaluator"))
                    {
                        if (callback != null && !callback.isAroundFilterEnabled(moduleID))
                            callback.toggleAroundFilter(moduleID);
                        continue;
                    }
					// Leaves the ReverseLookup Modules hidden.
                    if (moduleID.StartsWith("ReverseLookup"))
                    {
                        continue;
                    }

                    System.Windows.Forms.ToolStripMenuItem newItem = new System.Windows.Forms.ToolStripMenuItem();
                    newItem.AutoSize = true;
                    if (callback != null && callback.isAroundFilterEnabled(moduleID) == true)
                    {
                        newItem.Image = global::BaseIMEUI.Properties.Resources.menuCheck;
                        newItem.Checked = true;
                    }
                    else
                    {
                        newItem.Image = global::BaseIMEUI.Properties.Resources.menuUncheck;
                        newItem.Checked = false;
                    }
                    newItem.Name = moduleID;
                    newItem.Text = moduleName;
                    newItem.ToolTipText = moduleName;
                    newItem.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
                    newItem.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
                    newItem.Click += new System.EventHandler(this.aroundFilterToolStripMenuItem_Click);
                    this.u_configsDropDownMenu.Items.Add(newItem);
                }
                this.u_configsDropDownMenu.Items.Add(new ToolStripSeparator());
            }

			// Load Output Filters.

            if (outputFilters.Count > 0)
            {
                foreach (KeyValuePair<string, string> outputFilter in outputFilters)
                {
                    string ID = outputFilter.Key;
                    string Name = outputFilter.Value;

                    System.Windows.Forms.ToolStripMenuItem newItem = new System.Windows.Forms.ToolStripMenuItem();
                    newItem.AutoSize = true;
                    if (callback != null && callback.isOutputFilterEnabled(ID) == true)
                    {
                        newItem.Image = global::BaseIMEUI.Properties.Resources.menuCheck;
                        newItem.Checked = true;
                    }
                    else
                    {
                        newItem.Image = global::BaseIMEUI.Properties.Resources.menuUncheck;
                        newItem.Checked = false;
                    }
                    newItem.Name = ID;
                    newItem.Text = Name;
                    newItem.ToolTipText = Name;
                    newItem.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
                    newItem.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
                    newItem.Click += new System.EventHandler(this.outputFilterToolStripMenuItem_Click);
                    u_configsDropDownMenu.Items.Add(newItem);
                }
                this.u_configsDropDownMenu.Items.Add(new ToolStripSeparator());
            }

            this.u_configsDropDownMenu.Items.AddRange(this.m_defualtConfigItems);

            #region Init the default input method

            ToolStripMenuItem targetItem = null;
			bool found = false;
            foreach (object item in this.u_toggleInputMethodDropDownMenu.Items)
			{
                if (item is ToolStripMenuItem)
				{
                    ToolStripMenuItem currentItem = (ToolStripMenuItem)item;
                    if (currentItem.Name.Equals(currentInputMethod))
					{
						found = true;
                        targetItem = currentItem;
						break;
					}
				}
			}

			if (!found)
	            targetItem = (ToolStripMenuItem)this.u_toggleInputMethodDropDownMenu.Items[0];

			if (targetItem != null)
			{
				this.u_toggleInputMethod.Image = targetItem.Image;
	            this.u_toggleInputMethod.Text = targetItem.Text;
                if (callback != null)
	                callback.setPrimaryInputMethod(targetItem.Name, false);
	            targetItem.CheckState = CheckState.Checked;
			}

            #endregion

            if (useEnglishKeyboard == true)
                this.u_toggleAlphanumericMode.Image = global::BaseIMEUI.Properties.Resources.english;
            else
                this.u_toggleAlphanumericMode.Image = global::BaseIMEUI.Properties.Resources.chinese;

            if (useFullWidth == true)
                this.u_toggleFullWidthCharacterMode.Image = global::BaseIMEUI.Properties.Resources.fullwidth;
            else
                this.u_toggleFullWidthCharacterMode.Image = global::BaseIMEUI.Properties.Resources.halfwidth;

            if (useSimplifiedChinese == true)
                this.u_toggleChineseCharacterConverter.Image = global::BaseIMEUI.Properties.Resources.zh_CN;
            else
                this.u_toggleChineseCharacterConverter.Image = global::BaseIMEUI.Properties.Resources.zh_TW;
        }
        #endregion
    }
}


text:
/* =================================================================================================

(c - MIT) T.W.J. de Geus (Tom) | tom@geus.me | www.geus.me | github.com/tdegeus/cppmat

================================================================================================= */

#ifndef CPPMAT_FIX_CARTESIAN_TENSOR2S_H
#define CPPMAT_FIX_CARTESIAN_TENSOR2S_H

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

#include "cppmat.h"

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

namespace cppmat {
namespace tiny {
namespace cartesian {

// =================================================================================================
// cppmat::tiny::cartesian::tensor2s
// =================================================================================================

template<typename X, size_t ND>
class tensor2s : public cppmat::tiny::symmetric::matrix<X,ND,ND>
{
  static_assert( ND > 0, "Number of dimensions must positive" );

public:

  // constructor: allocate, don't initialize
  tensor2s();

  // constructor: copy from parent (with different type)
  template<typename U, typename=typename std::enable_if<std::is_convertible<U,X>::value>::type>
  tensor2s(const cppmat::tiny::symmetric::matrix<U,ND> &A);

  // constructor: copy from other classes
  tensor2s(const cppmat::tiny::diagonal::matrix<X,ND> &A);

  // constructor: copy from dynamic size
  tensor2s(const cppmat::cartesian::tensor2s<X> &A);

  // constructor: copy from view
  tensor2s(const cppmat::view::cartesian::tensor2s<X,ND> &A);

  // named constructor: initialize
  static tensor2s<X,ND> I();

  // get dimensions
  size_t ndim() const;

  // initialize
  void setI();

  // tensor products / operations
  tensor2 <X,ND> dot   (const tensor2 <X,ND> &B) const; // single contract.: C_ik   = A_ij * B_jk
  tensor2 <X,ND> dot   (const tensor2s<X,ND> &B) const; // single contract.: C_ik   = A_ij * B_jk
  tensor2 <X,ND> dot   (const tensor2d<X,ND> &B) const; // single contract.: C_ik   = A_ij * B_jk
  vector  <X,ND> dot   (const vector  <X,ND> &B) const; // single contract.: C_i    = A_ij * B_j
  tensor2 <X,ND> ddot  (const tensor4 <X,ND> &B) const; // double contract.: C_kl   = A_ij * B_jikl
  X              ddot  (const tensor2 <X,ND> &B) const; // double contract.: C      = A_ij * B_ji
  X              ddot  (const tensor2s<X,ND> &B) const; // double contract.: C      = A_ij * B_ji
  X              ddot  (const tensor2d<X,ND> &B) const; // double contract.: C      = A_ij * B_ji
  tensor4 <X,ND> dyadic(const tensor2 <X,ND> &B) const; // dyadic product  : C_ijkl = A_ij * B_kl
  tensor4 <X,ND> dyadic(const tensor2s<X,ND> &B) const; // dyadic product  : C_ijkl = A_ij * B_kl
  tensor4 <X,ND> dyadic(const tensor2d<X,ND> &B) const; // dyadic product  : C_ijkl = A_ij * B_kl
  tensor2s<X,ND> T     ()                        const; // transpose       : C_ij   = A_ji
  X              trace ()                        const; // trace           : A_ii
  X              det   ()                        const; // determinant (only in 2D/3D)
  tensor2s<X,ND> inv   ()                        const; // inverse     (only in 2D/3D)

};

// =================================================================================================

}}} // namespace ...

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

#endif


text:
class ServiceType < ActiveRecord::Base
  belongs_to :trusted_app

  has_many :permissions
  has_many :permits

  # Convenience Associations
  has_many :companies, through: :permits, source: :permitable, source_type: "Company"
  has_many :people, through: :permits, source: :permitable, source_type: "Person"
  has_many :vehicles, through: :permits, source: :permitable, source_type: "Vehicle"
  has_many :services, through: :permits

  validates :name, uniqueness: true
  validates :trusted_app, presence: true
end


text:
package com.deadswine.brickator.sample;

import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.SystemClock;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import android.support.test.uiautomator.UiObject;
import android.support.test.uiautomator.UiObjectNotFoundException;
import android.support.v4.content.ContextCompat;

import com.deadswine.brickator.library.Brickator;
import com.deadswine.brickator.sample.resolvers.Resolver;
import com.deadswine.brickator.sample.states.BackgroundState;
import com.deadswine.brickator.sample.states.GalleryState;
import com.deadswine.brickator.sample.states.MainMenuState;
import com.deadswine.brickator.sample.states.MainState;
import com.deadswine.brickator.sample.states.PermissionState;
import com.deadswine.brickator.sample.states.UninstalledState;

import org.junit.After;
import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestRule;
import org.junit.rules.TestWatcher;
import org.junit.runner.Description;
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;

import static java.lang.System.out;
import static org.junit.Assert.assertEquals;

@RunWith(AndroidJUnit4.class)
public class ExampleBrickatorTestBasic {
    private final String TAG = this.getClass().getSimpleName();

    @Rule
    public TestRule watcher = new TestWatcher() {
        protected void starting(Description description) {
            Brickator.print("Starting test: " + description.getMethodName() + " for class: " + TAG);
            Brickator.getInstance().setCurrentTestName(TAG, description.getMethodName());
        }
    };

    @Before
    public void beforeTest() {
        // initialize automator here
        // #1 initialize
        Brickator.print("STAGE 1111111111");
        Brickator.getInstance().initialize("com.deadswine.brickator.sample", new Resolver());

        // #2 register states clasess
        Brickator.print("STAGE 2222222222");
        Brickator.getInstance().registerState(UninstalledState.class);
        Brickator.getInstance().registerState(BackgroundState.class);
        Brickator.getInstance().registerState(PermissionState.class);
        Brickator.getInstance().registerState(MainState.class);
        Brickator.getInstance().registerState(MainMenuState.class);
        Brickator.getInstance().registerState(GalleryState.class);

        SystemClock.sleep(500);
        Brickator.print("STAGE 3333333333");

        // #3 grant permission for screenshots
        PermissionState.checkScreenShotsPermission();

        Brickator.getInstance().takeScreenShot("BeforeTest");
    }

    @Test
    public void useAppContext() throws Exception {
        // Context of the app under test.

        Brickator.print("TEST useAppContext()");

        Context appContext = InstrumentationRegistry.getTargetContext();

        assertEquals("com.deadswine.brickator.sample", appContext.getPackageName());

        out.println("hello world");

    }

    @Test
    public void goToStatesWithoutPathTracingExample() throws Exception {
        // this test assumes you are already in background state // remember that test execution order is random, so if one state depends on another one test will fail.
        checkMainState();
        checkMainMenuState();
        checkGalleryState();
    }

    public void checkMainState() throws Exception {
        Brickator.print("TEST checkMainState()");

        Brickator.getInstance().goToStateSimple(MainState.class);

        Brickator.getInstance().takeScreenShot("checkMainState");

        assertEquals(MainState.class.getName(), Brickator.getInstance().resolveCurrentState().getName());

    }

    public void checkMainMenuState() throws Exception {
        Brickator.print("TEST checkMainMenuState()");

        Brickator.getInstance().goToStateSimple(MainMenuState.class);

        Brickator.getInstance().takeScreenShot("checkMainMenuState");

        assertEquals(MainMenuState.class.getName(), Brickator.getInstance().resolveCurrentState().getName());

    }

    public void checkGalleryState() throws Exception {
        Brickator.print("TEST checkGalleryState()");

        Brickator.getInstance().goToStateSimple(GalleryState.class);

        Brickator.getInstance().takeScreenShot("checkGalleryState");

        assertEquals(GalleryState.class.getName(), Brickator.getInstance().resolveCurrentState().getName());

    }

    @After
    public void afterTest() {
        Brickator.getInstance().takeScreenShot("AfterTest");
    }
}


text:
package org.apache.dubbo.config.spring.util;

import org.apache.dubbo.config.annotation.Reference;
import org.apache.dubbo.config.annotation.Service;

import org.springframework.core.env.Environment;
import org.springframework.core.env.PropertyResolver;
import org.springframework.util.StringUtils;

import java.lang.annotation.Annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Method;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;

import static java.lang.String.valueOf;
import static org.springframework.core.annotation.AnnotationUtils.findAnnotation;
import static org.springframework.core.annotation.AnnotationUtils.getAnnotationAttributes;
import static org.springframework.core.annotation.AnnotationUtils.getDefaultValue;
import static org.springframework.util.CollectionUtils.arrayToList;
import static org.springframework.util.ObjectUtils.nullSafeEquals;
import static org.springframework.util.StringUtils.trimWhitespace;

/**
 * Annotation Utilities Class
 *
 * @see org.springframework.core.annotation.AnnotationUtils
 * @since 2.5.11
 */
public class AnnotationUtils {

    public static String resolveInterfaceName(Service service, Class<?> defaultInterfaceClass)
            throws IllegalStateException {

        String interfaceName;
        if (StringUtils.hasText(service.interfaceName())) {
            interfaceName = service.interfaceName();
        } else if (!void.class.equals(service.interfaceClass())) {
            interfaceName = service.interfaceClass().getName();
        } else if (defaultInterfaceClass.isInterface()) {
            interfaceName = defaultInterfaceClass.getName();
        } else {
            throw new IllegalStateException(
                    "The @Service undefined interfaceClass or interfaceName, and the type "
                            + defaultInterfaceClass.getName() + " is not a interface.");
        }

        return interfaceName;

    }

    public static String resolveInterfaceName(Reference reference, Class<?> defaultInterfaceClass)
            throws IllegalStateException {

        String interfaceName;
        if (!"".equals(reference.interfaceName())) {
            interfaceName = reference.interfaceName();
        } else if (!void.class.equals(reference.interfaceClass())) {
            interfaceName = reference.interfaceClass().getName();
        } else if (defaultInterfaceClass.isInterface()) {
            interfaceName = defaultInterfaceClass.getName();
        } else {
            throw new IllegalStateException(
                    "The @Reference undefined interfaceClass or interfaceName, and the type "
                            + defaultInterfaceClass.getName() + " is not a interface.");
        }

        return interfaceName;

    }

    // Cloned from https://github.com/alibaba/spring-context-support/blob/1.0.2/src/main/java/com/alibaba/spring/util/AnnotationUtils.java

    /**
     * Is specified {@link Annotation} present on {@link Method}'s declaring class or parameters or itself.
     *
     * @param method          {@link Method}
     * @param annotationClass {@link Annotation} type
     * @param              {@link Annotation} type
     * @return If present , return true , or false
     * @since 2.6.6
     */
    public static  boolean isPresent(Method method, Class annotationClass) {

        Map<ElementType, List> annotationsMap = findAnnotations(method, annotationClass);

        return !annotationsMap.isEmpty();

    }

    /**
     * Find specified {@link Annotation} type maps from {@link Method}
     *
     * @param method          {@link Method}
     * @param annotationClass {@link Annotation} type
     * @param              {@link Annotation} type
     * @return {@link Annotation} type maps , the {@link ElementType} as key ,
     * the list of {@link Annotation} as value.
     * If {@link Annotation} was annotated on {@link Method}'s parameters{@link ElementType#PARAMETER} ,
     * the associated {@link Annotation} list may contain multiple elements.
     * @since 2.6.6
     */
    public static  Map<ElementType, List> findAnnotations(Method method,
                                                                                Class annotationClass) {

        Retention retention = annotationClass.getAnnotation(Retention.class);

        RetentionPolicy retentionPolicy = retention.value();

        if (!RetentionPolicy.RUNTIME.equals(retentionPolicy)) {
            return Collections.emptyMap();
        }

        Map<ElementType, List> annotationsMap = new LinkedHashMap<ElementType, List>();

        Target target = annotationClass.getAnnotation(Target.class);

        ElementType[] elementTypes = target.value();

        for (ElementType elementType : elementTypes) {

            List annotationsList = new LinkedList();

            switch (elementType) {

                case PARAMETER:

                    Annotation[][] parameterAnnotations = method.getParameterAnnotations();

                    for (Annotation[] annotations : parameterAnnotations) {

                        for (Annotation annotation : annotations) {

                            if (annotationClass.equals(annotation.annotationType())) {

                                annotationsList.add((A) annotation);

                            }

                        }

                    }

                    break;

                case METHOD:

                    A annotation = findAnnotation(method, annotationClass);

                    if (annotation != null) {

                        annotationsList.add(annotation);

                    }

                    break;

                case TYPE:

                    Class<?> beanType = method.getDeclaringClass();

                    A annotation2 = findAnnotation(beanType, annotationClass);

                    if (annotation2 != null) {

                        annotationsList.add(annotation2);

                    }

                    break;

            }

            if (!annotationsList.isEmpty()) {

                annotationsMap.put(elementType, annotationsList);

            }

        }

        return Collections.unmodifiableMap(annotationsMap);

    }

    /**
     * Get the {@link Annotation} attributes
     *
     * @param annotation           specified {@link Annotation}
     * @param ignoreDefaultValue   whether ignore default value or not
     * @param ignoreAttributeNames the attribute names of annotation should be ignored
     * @return non-null
     * @since 2.6.6
     */
    public static Map<String, Object> getAttributes(Annotation annotation, boolean ignoreDefaultValue,
                                                    String... ignoreAttributeNames) {
        return getAttributes(annotation, null, ignoreDefaultValue, ignoreAttributeNames);
    }

    /**
     * Get the {@link Annotation} attributes
     *
     * @param annotation           specified {@link Annotation}
     * @param propertyResolver     {@link PropertyResolver} instance, e.g {@link Environment}
     * @param ignoreDefaultValue   whether ignore default value or not
     * @param ignoreAttributeNames the attribute names of annotation should be ignored
     * @return non-null
     * @since 2.6.6
     */
    public static Map<String, Object> getAttributes(Annotation annotation, PropertyResolver propertyResolver,
                                                    boolean ignoreDefaultValue, String... ignoreAttributeNames) {

        Set<String> ignoreAttributeNamesSet = new HashSet<String>(arrayToList(ignoreAttributeNames));

        Map<String, Object> attributes = getAnnotationAttributes(annotation);

        Map<String, Object> actualAttributes = new LinkedHashMap<String, Object>();

        for (Map.Entry<String, Object> entry : attributes.entrySet()) {

            String attributeName = entry.getKey();
            Object attributeValue = entry.getValue();

            // ignore default attribute value
            if (ignoreDefaultValue && nullSafeEquals(attributeValue, getDefaultValue(annotation, attributeName))) {
                continue;
            }

            // ignore attribute name
            if (ignoreAttributeNamesSet.contains(attributeName)) {
                continue;
            }

            /**
             * @since 2.7.1
             * ignore annotation member
             */
            if (attributeValue.getClass().isAnnotation()){
                continue;
            }
            if (attributeValue.getClass().isArray() && attributeValue.getClass().getComponentType().isAnnotation()){
                continue;
            }

            if (attributeValue instanceof String) {
                attributeValue = resolvePlaceholders(valueOf(attributeValue), propertyResolver);
            } else if (attributeValue instanceof String[]) {
                String[] values = (String[]) attributeValue;
                for (int i = 0; i < values.length; i++) {
                    values[i] = resolvePlaceholders(values[i], propertyResolver);
                }
                attributeValue = values;
            }
            actualAttributes.put(attributeName, attributeValue);
        }
        return actualAttributes;
    }

    private static String resolvePlaceholders(String attributeValue, PropertyResolver propertyResolver) {
        String resolvedValue = attributeValue;
        if (propertyResolver != null) {
            resolvedValue = propertyResolver.resolvePlaceholders(resolvedValue);
            resolvedValue = trimWhitespace(resolvedValue);
        }
        return resolvedValue;
    }

}


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

<TITLE>
Uses of Class soot.tagkit.AbstractHost (Soot API)
</TITLE>

<META NAME="date" CONTENT="2012-01-22">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
soot.tagkit.AbstractHost

Packages that use AbstractHost

soot
Base Soot classes, shared by different intermediate representations.

soot.baf
Public classes for the Baf intermediate representation.

soot.baf.internal
Internal, messy, implementation-specific classes for the Baf intermediate representation.

soot.dava

soot.dava.internal.AST

soot.dava.internal.javaRep

soot.grimp
Public classes for the Grimp intermediate representation.

soot.grimp.internal
Internal, messy, implementation-specific classes for the Grimp intermediate representation.

soot.jimple
Public classes for the Jimple intermediate representation.

soot.jimple.internal
Internal, messy, implementation-specific classes for the Jimple intermediate representation.

soot.jimple.toolkits.thread.mhp.stmt

soot.shimple
Public classes for the SSA Shimple intermediate representation.

soot.shimple.internal
Shimple internal messy stuff.

soot.toolkits.scalar
A number of scalar optimizations, and the flow analysis framework.

Uses of AbstractHost in soot

Subclasses of AbstractHost in soot

 class
AbstractUnit

          Provides default implementations for the methods in Unit.

 class
AbstractValueBox

          Reference implementation for ValueBox; just
 add a canContainValue method.

 class
Body

          Abstract base class that models the body (code attribute) of a Java method.

 class
SootClass

          Soot representation of a Java class.

 class
SootField

          Soot representation of a Java field.

 class
SootMethod

          Soot representation of a Java method.

Uses of AbstractHost in soot.baf

Subclasses of AbstractHost in soot.baf

 class
BafBody

 class
PlaceholderInst

Uses of AbstractHost in soot.baf.internal

Subclasses of AbstractHost in soot.baf.internal

 class
AbstractBranchInst

 class
AbstractInst

 class
AbstractOpTypeBranchInst

 class
AbstractOpTypeInst

 class
AbstractRefTypeInst

 class
BAddInst

 class
BafLocalBox

 class
BAndInst

 class
BArrayLengthInst

 class
BArrayReadInst

 class
BArrayWriteInst

 class
BCmpgInst

 class
BCmpInst

 class
BCmplInst

 class
BDivInst

 class
BDup1_x1Inst

 class
BDup1_x2Inst

 class
BDup1Inst

 class
BDup2_x1Inst

 class
BDup2_x2Inst

 class
BDup2Inst

 class
BDupInst

 class
BDynamicInvokeInst

 class
BEnterMonitorInst

 class
BExitMonitorInst

 class
BFieldGetInst

 class
BFieldPutInst

 class
BGotoInst

 class
BIdentityInst

 class
BIfCmpEqInst

 class
BIfCmpGeInst

 class
BIfCmpGtInst

 class
BIfCmpLeInst

 class
BIfCmpLtInst

 class
BIfCmpNeInst

 class
BIfEqInst

 class
BIfGeInst

 class
BIfGtInst

 class
BIfLeInst

 class
BIfLtInst

 class
BIfNeInst

 class
BIfNonNullInst

 class
BIfNullInst

 class
BIncInst

 class
BInstanceCastInst

 class
BInstanceOfInst

 class
BInterfaceInvokeInst

 class
BJSRInst

 class
BLoadInst

 class
BLookupSwitchInst

 class
BMulInst

 class
BNegInst

 class
BNewArrayInst

 class
BNewInst

 class
BNewMultiArrayInst

 class
BNopInst

 class
BOrInst

 class
BPopInst

 class
BPrimitiveCastInst

 class
BPushInst

 class
BRemInst

 class
BReturnInst

 class
BReturnVoidInst

 class
BShlInst

 class
BShrInst

 class
BSpecialInvokeInst

 class
BStaticGetInst

 class
BStaticInvokeInst

 class
BStaticPutInst

 class
BStoreInst

 class
BSubInst

 class
BSwapInst

 class
BTableSwitchInst

 class
BThrowInst

 class
BUshrInst

 class
BVirtualInvokeInst

 class
BXorInst

Uses of AbstractHost in soot.dava

Subclasses of AbstractHost in soot.dava

 class
DavaBody

Uses of AbstractHost in soot.dava.internal.AST

Subclasses of AbstractHost in soot.dava.internal.AST

 class
ASTControlFlowNode

 class
ASTDoWhileNode

 class
ASTForLoopNode

 class
ASTIfElseNode

 class
ASTIfNode

 class
ASTLabeledBlockNode

 class
ASTLabeledNode

 class
ASTMethodNode

 class
ASTNode

 class
ASTStatementSequenceNode

 class
ASTSwitchNode

 class
ASTSynchronizedBlockNode

 class
ASTTryNode

 class
ASTUnconditionalLoopNode

 class
ASTWhileNode

Uses of AbstractHost in soot.dava.internal.javaRep

Subclasses of AbstractHost in soot.dava.internal.javaRep

 class
DAbruptStmt

 class
DArrayInitValueBox

 class
DAssignStmt

 class
DDecrementStmt

 class
DIdentityStmt

 class
DIncrementStmt

 class
DShortcutAssignStmt

 class
DVariableDeclarationStmt

Uses of AbstractHost in soot.grimp

Subclasses of AbstractHost in soot.grimp

 class
GrimpBody

          Implementation of the Body class for the Grimp IR.

Uses of AbstractHost in soot.grimp.internal

Subclasses of AbstractHost in soot.grimp.internal

 class
ExprBox

 class
GAssignStmt

 class
GEnterMonitorStmt

 class
GExitMonitorStmt

 class
GIdentityStmt

 class
GIfStmt

 class
GInvokeStmt

 class
GLookupSwitchStmt

 class
GReturnStmt

 class
GRValueBox

 class
GTableSwitchStmt

 class
GThrowStmt

 class
ObjExprBox

Uses of AbstractHost in soot.jimple

Subclasses of AbstractHost in soot.jimple

 class
JimpleBody

          Implementation of the Body class for the Jimple IR.

 class
PlaceholderStmt

 class
StmtBody

          Abstract base class for Body's on Stmts (Jimple and Grimp).

Uses of AbstractHost in soot.jimple.internal

Subclasses of AbstractHost in soot.jimple.internal

 class
AbstractDefinitionStmt

 class
AbstractStmt

 class
ConditionExprBox

 class
IdentityRefBox

 class
ImmediateBox

 class
InvokeExprBox

 class
JAssignStmt

 class
JBreakpointStmt

 class
JEnterMonitorStmt

 class
JExitMonitorStmt

 class
JGotoStmt

 class
JIdentityStmt

 class
JIfStmt

 class
JimpleLocalBox

 class
JInvokeStmt

 class
JLookupSwitchStmt

 class
JNopStmt

 class
JRetStmt

 class
JReturnStmt

 class
JReturnVoidStmt

 class
JTableSwitchStmt

 class
JThrowStmt

 class
RValueBox

 class
VariableBox

Uses of AbstractHost in soot.jimple.toolkits.thread.mhp.stmt

Subclasses of AbstractHost in soot.jimple.toolkits.thread.mhp.stmt

 class
BeginStmt

 class
JoinStmt

 class
JPegStmt

 class
MonitorEntryStmt

 class
MonitorExitStmt

 class
NotifiedEntryStmt

 class
NotifyAllStmt

 class
NotifyStmt

 class
OtherStmt

 class
StartStmt

 class
WaitingStmt

 class
WaitStmt

Uses of AbstractHost in soot.shimple

Subclasses of AbstractHost in soot.shimple

 class
ShimpleBody

          Implementation of the Body class for the SSA Shimple IR.

Uses of AbstractHost in soot.shimple.internal

Subclasses of AbstractHost in soot.shimple.internal

 class
SValueUnitPair

          Extension of ValueUnitPair that implements SUnitBox.

Uses of AbstractHost in soot.toolkits.scalar

Subclasses of AbstractHost in soot.toolkits.scalar

 class
ValueUnitPair

          Utility class used to package a Value and a Unit together.

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes


text:
package it.michelelacorte.exampleswipeablecard;

import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.NavigationView;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.CardView;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.text.method.LinkMovementMethod;
import android.view.MenuItem;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.RadioButton;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.gms.maps.model.LatLng;

import java.util.ArrayList;
import java.util.List;

import it.michelelacorte.swipeablecard.CustomCardAnimation;
import it.michelelacorte.swipeablecard.OptionView;
import it.michelelacorte.swipeablecard.OptionViewAdditional;
import it.michelelacorte.swipeablecard.SwipeableCard;
import it.michelelacorte.swipeablecard.SwipeableCardAdapter;

public class MainActivity extends AppCompatActivity {
    private SwipeableCard swipeableCard;
    private RecyclerView rv;
    private ActionBarDrawerToggle mDrawerToggle;
    private DrawerLayout drawerLayout;
    private CardView cardOther;
    private RadioButton singleMarker;
    private RadioButton multipleMarker;
    private RadioButton settedCard;
    private RadioButton creationCard;
    private RelativeLayout radioGroup;
    private RelativeLayout radioGroupCreditCard;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        /**
         * Example of single Swipeable Card.
         */

        final Toolbar.OnMenuItemClickListener toolbarListener = new Toolbar.OnMenuItemClickListener() {
            @Override
            public boolean onMenuItemClick(MenuItem item) {
                int id = item.getItemId();
                if (id == R.id.action_settings) {
                    Toast.makeText(getApplicationContext(), "Settings Menu!", Toast.LENGTH_LONG).show();
                    return true;
                }

                return false;
            }
        };

        View.OnClickListener clickTextButton = new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(getApplicationContext(), "Text Button!", Toast.LENGTH_LONG).show();
            }
        };

        View.OnClickListener clickIconButton1 = new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(getApplicationContext(), "Icon Button 1!", Toast.LENGTH_LONG).show();
            }
        };

        View.OnClickListener clickIconButton2 = new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(getApplicationContext(), "Icon Button 2!", Toast.LENGTH_LONG).show();
            }
        };

        final View.OnClickListener clickFab = new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(getApplicationContext(), "Fab Button!", Toast.LENGTH_LONG).show();
            }
        };

        final OptionView singleSwipe = new OptionView.Builder()
                .normalCard()
                .text("Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text," +
                        " a lot of Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text")
                .title("Single Card")
                .menuItem(R.menu.menu_main)
                .toolbarListener(toolbarListener)
                .setAdditionalItem(new OptionViewAdditional.Builder()
                        .setFabIcon(android.R.drawable.ic_dialog_info)
                        .setFabColor(R.color.colorPrimary)
                        .setOnClickListenerFab(clickFab)
                        .build())
                .build();

        final OptionView singleSwipeNotAutoAnimation = new OptionView.Builder()
                .normalCard()
                .setAutoAnimation(false)
                .text("Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text," +
                        " a lot of Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text")
                .title("Single Card")
                .menuItem(R.menu.menu_main)
                .toolbarListener(toolbarListener)
                .setAdditionalItem(new OptionViewAdditional.Builder()
                        .setFabIcon(android.R.drawable.ic_dialog_info)
                        .setFabColor(R.color.colorPrimary)
                        .setOnClickListenerFab(clickFab)
                        .build())
                .build();

        final OptionView creditCardSetted = new OptionView.Builder()
                .creditCard()
                .setCVV("233")
                .setCardHolderName("Lacorte Michele")
                .setCardNumber("5566784298446522")
                .setCardExpiry("01/20")
                .title("Credit Card")
                .menuItem(R.menu.menu_main)
                .toolbarListener(toolbarListener)
                .build();

        final OptionView creditCardCreation = new OptionView.Builder()
                .creditCard()
                .setCardCreation(MainActivity.this)
                .title("Credit Card")
                .menuItem(R.menu.menu_main)
                .toolbarListener(toolbarListener)
                .build();

        final OptionView customSwipe = new OptionView.Builder()
                .normalCard()
                .image(R.drawable.image)
                .title("Custom Card")
                .menuItem(R.menu.menu_main)
                .toolbarListener(toolbarListener)
                .setAdditionalItem(new OptionViewAdditional.Builder()
                        .iconButton(android.R.drawable.ic_menu_camera,
                                android.R.drawable.ic_menu_call)
                        .textButton("SHARE")
                        .textColorButton(R.color.colorPrimary)
                        .textSize(15f)
                        .setOnClickListenerTextButton(clickTextButton)
                        .setOnClickListenerIconButton(clickIconButton1, clickIconButton2)
                        .build())
                .build();

        final OptionView dismissableSwipe = new OptionView.Builder()
                .normalCard()
                .image(R.drawable.image)
                .title("Dismissable Card")
                .menuItem(R.menu.menu_main)
                .setSwipeToDismiss(true)
                .toolbarListener(toolbarListener)
                .setAdditionalItem(new OptionViewAdditional.Builder()
                        .textButton("SHARE", "LEARN MORE")
                        .textColorButton(R.color.colorPrimary)
                        .textSize(15f)
                        .setOnClickListenerTextButton(clickTextButton, clickTextButton)
                        .build())
                .build();

        final OptionView mapSwipeSingleMarker = new OptionView.Builder().mapsCard()
                .title("Maps Card")
                .setLocation(44.4937615, 11.3430542, "MyMarker")
                .setZoom(10f)
                .withStreetName(true)
                .menuItem(R.menu.menu_main)
                .toolbarListener(toolbarListener)
                .build();

        final OptionView mapSwipeMultipleMarker = new OptionView.Builder().mapsCard()
                .title("Maps Card")
                .setLocation(new LatLng(44.48, 11.33), new LatLng(43.45, 11.32), new LatLng(45.70, 10.11))
                .menuItem(R.menu.menu_main)
                .toolbarListener(toolbarListener)
                .build();

        setContentView(R.layout.activity_main);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        cardOther = (CardView) findViewById(R.id.cardOther);
        swipeableCard = (SwipeableCard) findViewById(R.id.swipeCard);
        rv = (RecyclerView) findViewById(R.id.rv);
        singleMarker = (RadioButton) findViewById(R.id.singleMarker);
        multipleMarker = (RadioButton) findViewById(R.id.multipleMarker);
        settedCard = (RadioButton) findViewById(R.id.settedCard);
        creationCard = (RadioButton) findViewById(R.id.creationCard);
        radioGroup = (RelativeLayout) findViewById(R.id.radioGroup);
        radioGroupCreditCard = (RelativeLayout) findViewById(R.id.radioGroupCreditCard);

        NavigationView navigationView = (NavigationView) findViewById(R.id.navigation_view);
        navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
            @Override
            public boolean onNavigationItemSelected(MenuItem menuItem) {
                switch (menuItem.getItemId()) {
                    case R.id.SingleSwipe:
                        /**
                         * Example of Single Swipeable Card.
                         */
                        radioGroupCreditCard.setVisibility(View.GONE);
                        radioGroup.setVisibility(View.GONE);
                        rv.setVisibility(View.GONE);
                        cardOther.setVisibility(View.GONE);
                        swipeableCard.init(getApplicationContext(), singleSwipe);
                        swipeableCard.setVisibility(View.VISIBLE);
                        drawerLayout.closeDrawers();
                        break;
                    case R.id.CreditCard:
                        radioGroup.setVisibility(View.GONE);
                        radioGroupCreditCard.setVisibility(View.VISIBLE);
                        rv.setVisibility(View.GONE);
                        cardOther.setVisibility(View.GONE);
                        creationCard.setChecked(false);
                        settedCard.setChecked(true);
                        swipeableCard.init(getApplicationContext(), creditCardSetted);
                        swipeableCard.setVisibility(View.VISIBLE);
                        settedCard.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                            @Override
                            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                                swipeableCard.setVisibility(View.GONE);
                                if (settedCard.isChecked()) {
                                    creationCard.setChecked(false);
                                    swipeableCard.init(getApplicationContext(), creditCardSetted);
                                    swipeableCard.setVisibility(View.VISIBLE);
                                }
                            }
                        });
                        creationCard.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                            @Override
                            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                                swipeableCard.setVisibility(View.GONE);
                                if (creationCard.isChecked()) {
                                    settedCard.setChecked(false);
                                    swipeableCard.init(getApplicationContext(), creditCardCreation);
                                    swipeableCard.setVisibility(View.VISIBLE);
                                }
                            }
                        });
                        drawerLayout.closeDrawers();
                        break;
                    case R.id.SingleSwipeNotAutoAnimation:
                        /**
                         * Example of Single Swipeable Card with Swipe Gesture.
                         */
                        radioGroupCreditCard.setVisibility(View.GONE);
                        radioGroup.setVisibility(View.GONE);
                        rv.setVisibility(View.GONE);
                        cardOther.setVisibility(View.GONE);
                        swipeableCard.init(getApplicationContext(), singleSwipeNotAutoAnimation);
                        swipeableCard.setVisibility(View.VISIBLE);
                        drawerLayout.closeDrawers();
                        break;
                    case R.id.OtherSwipe:
                        /**
                         * Example of Other Card Layout.
                         */
                        radioGroupCreditCard.setVisibility(View.GONE);
                        radioGroup.setVisibility(View.GONE);
                        rv.setVisibility(View.GONE);
                        swipeableCard.setVisibility(View.GONE);
                        cardOther.setVisibility(View.VISIBLE);
                        final CustomCardAnimation cardAnim = new CustomCardAnimation(getApplicationContext(), cardOther, 200);
                        cardOther.setOnClickListener(new View.OnClickListener() {
                            boolean swipeUp = false;
                            @Override
                            public void onClick(View v) {
                                if (!swipeUp) {
                                    cardAnim.animationCustomCardUp();
                                    swipeUp = true;
                                } else {
                                    cardAnim.animationCustomCardDown();
                                    swipeUp = false;
                                }
                            }
                        });
                        drawerLayout.closeDrawers();
                        break;
                    case R.id.CustomSwipe:
                        /**
                         * Custom Card View Example
                         */
                        radioGroupCreditCard.setVisibility(View.GONE);
                        radioGroup.setVisibility(View.GONE);
                        cardOther.setVisibility(View.GONE);
                        rv.setVisibility(View.GONE);
                        swipeableCard.init(getApplicationContext(), customSwipe);
                        swipeableCard.setVisibility(View.VISIBLE);
                        drawerLayout.closeDrawers();
                        break;
                    case R.id.MapSwipe:
                        radioGroupCreditCard.setVisibility(View.GONE);
                        radioGroup.setVisibility(View.VISIBLE);
                        cardOther.setVisibility(View.GONE);
                        rv.setVisibility(View.GONE);
                        multipleMarker.setChecked(false);
                        swipeableCard.init(getApplicationContext(), mapSwipeSingleMarker);
                        swipeableCard.setVisibility(View.VISIBLE);
                        singleMarker.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                            @Override
                            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                                swipeableCard.setVisibility(View.GONE);
                                if (singleMarker.isChecked()) {
                                    multipleMarker.setChecked(false);
                                    swipeableCard.init(getApplicationContext(), mapSwipeSingleMarker);
                                    swipeableCard.setVisibility(View.VISIBLE);
                                }
                            }
                        });
                        multipleMarker.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                            @Override
                            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                                swipeableCard.setVisibility(View.GONE);
                                if(multipleMarker.isChecked()) {
                                    singleMarker.setChecked(false);
                                    swipeableCard.init(getApplicationContext(), mapSwipeMultipleMarker);
                                    swipeableCard.setVisibility(View.VISIBLE);
                                }
                            }
                        });
                        drawerLayout.closeDrawers();
                        break;

                    case R.id.DismissSwipe:
                        /**
                         * Example of Dismissable Swipeable Card.
                         */
                        radioGroupCreditCard.setVisibility(View.GONE);
                        radioGroup.setVisibility(View.GONE);
                        cardOther.setVisibility(View.GONE);
                        rv.setVisibility(View.GONE);
                        swipeableCard.init(getApplicationContext(), dismissableSwipe);
                        swipeableCard.setVisibility(View.VISIBLE);
                        drawerLayout.closeDrawers();
                        break;
                    case R.id.RecyclerSwipe:
                        /**
                         * Example of Recycler View Swipeable Card.
                         */
                        //Set layout HORIZONTAL
                        radioGroupCreditCard.setVisibility(View.GONE);
                        radioGroup.setVisibility(View.GONE);
                        LinearLayoutManager llm = new LinearLayoutManager(getApplicationContext(), LinearLayoutManager.HORIZONTAL, false);
                        rv.setLayoutManager(llm);

                        List<OptionView> optionViews = new ArrayList<>();
                        Toolbar.OnMenuItemClickListener toolbarListener = new Toolbar.OnMenuItemClickListener() {
                            @Override
                            public boolean onMenuItemClick(MenuItem item) {
                                int id = item.getItemId();
                                if (id == R.id.action_settings) {
                                    Toast.makeText(getApplicationContext(), "Settings Menu!", Toast.LENGTH_LONG).show();
                                    return true;
                                }

                                return false;
                            }
                        };
                        optionViews.add(new OptionView.Builder()
                                .normalCard()
                                .image(R.drawable.image)
                                .title("TITLE")
                                .colorTitle(R.color.colorPrimary)
                                .menuItem(R.menu.menu_main)
                                .toolbarListener(toolbarListener)
                                .setAdditionalItem(new OptionViewAdditional.Builder()
                                        .iconButton(android.R.drawable.ic_menu_camera,
                                                android.R.drawable.ic_menu_call)
                                        .textButton("SHARE")
                                        .textColorButton(R.color.colorPrimary)
                                        .textSize(15f)
                                        .build())
                                .build());
                        optionViews.add(new OptionView.Builder()
                                .normalCard()
                                .text("Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text," +
                                        " a lot of Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text, a lot of Text")
                                .title("TITLE")
                                .colorTitle(R.color.colorPrimary)
                                .menuItem(R.menu.menu_main)
                                .toolbarListener(toolbarListener)
                                .setCardRadius(40) //Optional, default 4
                                .build());
                        optionViews.add(new OptionView.Builder()
                                .normalCard()
                                .subTitle("Sub Title!!!")
                                .image(R.drawable.image)
                                .title("TITLE")
                                .colorTitle(R.color.colorPrimary)
                                .menuItem(R.menu.menu_main)
                                .toolbarListener(toolbarListener)
                                .setAdditionalItem(new OptionViewAdditional.Builder()
                                        .iconButton(android.R.drawable.ic_menu_camera,
                                                android.R.drawable.ic_menu_call,
                                                android.R.drawable.ic_menu_delete)
                                        .build())
                                .build());

                        optionViews.add(new OptionView.Builder()
                                .creditCard()
                                .title("Credit Card")
                                .setCardCreation(MainActivity.this)
                                .colorTitle(R.color.colorPrimary)
                                .menuItem(R.menu.menu_main)
                                .toolbarListener(toolbarListener)
                                .build());

                        optionViews.add(new OptionView.Builder()
                                .creditCard()
                                .setCVV("233")
                                .setCardHolderName("Lacorte Michele")
                                .setCardNumber("5566784298446522")
                                .setCardExpiry("01/20")
                                .title("Credit Card")
                                .menuItem(R.menu.menu_main)
                                .toolbarListener(toolbarListener)
                                .build());

                        optionViews.add(new OptionView.Builder().mapsCard()
                                .title("Maps Card")
                                .setLocation(44.4937615, 11.3430542, "MyMarker")
                                .setZoom(10f)
                                .withStreetName(true)
                                .menuItem(R.menu.menu_main)
                                .toolbarListener(toolbarListener)
                                .build());

                        optionViews.add(new OptionView.Builder().mapsCard()
                                .title("Maps Card")
                                .setLocation(new LatLng(44.48, 11.33), new LatLng(43.45, 11.32), new LatLng(45.70, 10.11))
                                .menuItem(R.menu.menu_main)
                                .toolbarListener(toolbarListener)
                                .build());

                        //Set custom adapter.
                        SwipeableCardAdapter adapter = new SwipeableCardAdapter(optionViews, getApplicationContext());
                        rv.setAdapter(adapter);
                        swipeableCard.setVisibility(View.GONE);
                        cardOther.setVisibility(View.GONE);
                        rv.setVisibility(View.VISIBLE);
                        drawerLayout.closeDrawers();
                        break;
                    case R.id.About:
                        AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this, R.style.AlertDialogCustom);
                        builder.setTitle("Swipeable Card Library")
                                .setMessage(R.string.dialog_message)
                                .setCancelable(false)
                                .setNegativeButton("OK", new DialogInterface.OnClickListener() {
                                    public void onClick(DialogInterface dialog, int id) {
                                        dialog.dismiss();
                                    }
                                });

                        AlertDialog about = builder.create();
                        about.show();
                        ((TextView) about.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance());
                        break;
                    case R.id.Donate:
                        AlertDialog.Builder donate = new AlertDialog.Builder(MainActivity.this, R.style.AlertDialogCustom);
                        donate.setTitle("Donate")
                                .setMessage(R.string.donate_message)
                                .setCancelable(false)
                                .setNegativeButton("OK", new DialogInterface.OnClickListener() {
                                    public void onClick(DialogInterface dialog, int id) {
                                        dialog.dismiss();
                                    }
                                });

                        AlertDialog donation = donate.create();
                        donation.show();
                        ((TextView) donation.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance());
                        break;
                    case R.id.Share:
                        Intent share = new Intent(Intent.ACTION_SEND);
                        share.setType("text/plain");
                        share.putExtra(Intent.EXTRA_TEXT, "Hello!\nSee SwipeableCardLibrary at https://github.com/michelelacorte/SwipeableCard");
                        startActivity(Intent.createChooser(share, "Swipeable Card Library"));
                        break;
                    default:
                        break;
                }
                return false;
            }
        });

        drawerLayout = (DrawerLayout) findViewById(R.id.DrawerLayout);
        mDrawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.drawer_open, R.string.drawer_close) {
            @Override
            public void onDrawerClosed(View drawerView) {
                super.onDrawerClosed(drawerView);
            }

            @Override
            public void onDrawerOpened(View drawerView) {
                super.onDrawerOpened(drawerView);
            }
        };
        drawerLayout.post(new Runnable() {
            @Override
            public void run() {
                mDrawerToggle.syncState();
            }
        });
        drawerLayout.setDrawerListener(mDrawerToggle);
        mDrawerToggle.syncState();
    }
}


text:
package stormpot;

import java.util.concurrent.TimeUnit;

/**
 * A Timeout represents the maximum amount of time a caller is willing to wait
 * for a blocking operation to complete.
 *
 * Timeouts are independent of their units, so two timeouts of equivalent
 * duration but constructed in different units, will be equal to each other and
 * work exactly the same.
 *
 * Timeouts are also independent of "calendar time" in the sense that they
 * represent and work as a duration of absolute time. In other words, timeouts
 * do not grow or shrink with passing leap seconds or daylight savings time
 * adjustments.
 *
 * @author Chris Vest <mr.chrisvest@gmail.com>
 */
// TODO 3.0 make class final
public class Timeout {
  private final long timeout;
  private final TimeUnit unit;
  private final long timeoutBase;

  /**
   * Construct a new timeout with the given value and unit. The unit cannot be
   * `null`, but the timeout value is unrestricted. The meaning of a
   * negative timeout value is specific to the implementation of the use site,
   * but typically means that no amount of blocking or waiting is tolerated.
   * @param timeout A numerical value for the timeout. Can be zero or negative,
   * though the meaning is implementation specific.
   * @param unit The unit of the timeout value. Never `null`.
   */
  public Timeout(long timeout, TimeUnit unit) {
    if (unit == null) {
      throw new IllegalArgumentException("The TimeUnit cannot be null");
    }
    this.timeout = timeout;
    this.unit = unit;
    this.timeoutBase = getBaseUnit().convert(timeout, unit);
  }

  /**
   * Get the timeout value in terms of the {@link #getUnit() unit}.
   * @return A numerical value of the timeout. Possibly zero or negative.
   */
  public long getTimeout() {
    return timeout;
  }

  /**
   * Get the unit for the {@link #getTimeout() timeout value}.
   * @return The {@link TimeUnit} of the timeout value. Never `null`.
   */
  public TimeUnit getUnit() {
    return unit;
  }

  /**
   * Calculate a deadline, as an instant in the future, in terms of the
   * {@link #getBaseUnit() base unit}. Once you have a deadline, you can ask
   * how much time is left until it transpires, with the
   * {@link #getTimeLeft(long)} method, giving the deadline as an argument.
   *
   * If the {@link #getTimeout() timeout value} is really small, zero or
   * negative, then the deadline might be an instant in the past.
   * @return A numerical value that represents the deadline from "now" until
   * this timeout has passed.
   */
  public long getDeadline() {
    return now() + timeoutBase;
  }

  /**
   * Get the timeout value in terms of the {@link #getBaseUnit() base unit}.
   * @return A numerical value of the timeout. Possibly zero or negative.
   */
  public long getTimeoutInBaseUnit() {
    return timeoutBase;
  }

  /**
   * Calculate the amount of time that is left until the deadline, in terms
   * of the {@link #getBaseUnit() base unit}. The argument is a deadline value
   * that has been calculated with the {@link #getDeadline()} method.
   * @param deadline The reference deadline from {@link #getDeadline()}.
   * @return The amount of time, in terms of the
   * {@link #getBaseUnit() base unit}, that is left until the deadline. If
   * this value is negative, then the deadline has transpired.
   */
  public long getTimeLeft(long deadline) {
    return deadline - now();
  }

  /**
   * Get the unit of precision for the underlying clock, that is used by
   * {@link #getDeadline()} and {@link #getTimeLeft(long)}.
   * @return TimeUnit The unit of precision used by the clock in this Timeout.
   */
  public TimeUnit getBaseUnit() {
    return TimeUnit.NANOSECONDS;
  }

  private long now() {
    return System.nanoTime();
  }

  @Override
  public int hashCode() {
    return 31 * (1 + (int) (timeoutBase ^ (timeoutBase >>> 32)));
  }

  /**
   * Timeouts of equivalent duration are equal, even if they were constructed
   * with different units.
   * @return `true` if this Timeout value is equal to the given
   * Timeout value, `false` otherwise.
   */
  @Override
  public boolean equals(Object obj) {
    if (!(obj instanceof Timeout)) {
      return false;
    }
    Timeout that = (Timeout) obj;
    return this.timeoutBase == that.timeoutBase;
  }
}


text:
/**
 * angular2-cookie - Implementation of Angular 1.x $cookies service to Angular 2
 * @version v1.2.6
 * @link https://github.com/salemdar/angular2-cookie#readme
 * @license MIT
 */
export { BaseCookieOptions, CookieOptions } from './services/base-cookie-options';
export { CookieOptionsArgs } from './services/cookie-options-args.model';
export { CookieService } from './services/cookies.service';


text:
'use strict';

/**
 * Module dependencies.
 */
var debug = require('debug')('swara:server-controller:server'),
  fs = require('fs'),
  es = require('event-stream'),
  async = require('async'),
  Convert = require('ansi-to-html'),
  config = require('../../config/config'),
  convert = new Convert({fg : '#333', bg : 'transparent'});

var MAX_LOG_SIZE = 10000;

var readAsync = function (file, callback) {
  fs.readFile(file, 'utf8', callback);
};

var colorize = function (line) {
  return convert.toHtml(line);
};

var setupLibraryLogTail = function (socketio, logFilePath, logFileName, availableLines) {
  debug('Inside server.server-controller.setupLibraryLogTail:' + logFileName);

  var lineCounter = 0;
  // TODO: createReadStream suddenly stops at the end of scanning for some reason
  var logStream = fs.createReadStream(logFilePath)
    .pipe(es.split())
    .pipe(es.map(function (line) {
      lineCounter++;

      // pause the readstream
      logStream.pause();

      (function () {
        // process line here and call logStream.resume() when rdy
        if (lineCounter > availableLines && line) {
          socketio.sockets.emit(logFileName + '.tail.line', colorize(line));
        }
        // resume the readstream
        logStream.resume();
      })();
    })
      .on('error', function (error) {
        console.log('Error while reading file.');
        socketio.sockets.emit(logFileName + '.tail.error', error);
      })
      .on('end', function () {
        console.log('Read entire file.');
        socketio.sockets.emit(logFileName + '.tail.ended', {});
      })
  );
};

var limitToMaximumSize = function (logLines) {
  var size = logLines.length;

  // trim the empty line at the end
  if (logLines[logLines.length - 1].length === 0) {
    logLines.splice(-1, 1);
    size--;
  }

  // limit to maximum size
  if (size > MAX_LOG_SIZE) {
    logLines.splice(0, size - MAX_LOG_SIZE);
  }

  return {size : size, lines : logLines};
};

/**
 * Show the server information
 */
exports.view = function (req, res) {
  debug('Inside server.server-controller.view ');
  var app = req.app;
  debug('App Log File: %s', app.locals.appLogFile);
  debug('Library Log File: %s', app.locals.libraryLogFile);
  var server = {
    title      : app.locals.title,
    env        : app.get('env'),
    port       : config.port,
    pid        : process.pid,
    db         : config.db,
    maxLogSize : MAX_LOG_SIZE
  };
  async.map([
    app.locals.appLogFile,
    app.locals.libraryLogFile
  ], readAsync, function (err, results) {
    debug('Read both log files asynchronously');
    if (err) {
      return res.status(400).send(err);
    } else {

      var appLogFile = limitToMaximumSize(results[0].split('\n').map(colorize));
      server.appLogFileLength = appLogFile.size;
      server.appLogFile = appLogFile.lines;

      var libraryLogFile = limitToMaximumSize(results[1].split('\n').map(colorize));
      server.libraryLogFileLength = libraryLogFile.size;
      server.libraryLogFile = libraryLogFile.lines;

      res.json(server);
    }
  });
};

exports.logs = function (req, res) {
  var availableLines = req.body;
  var app = req.app;
  var socketio = req.app.get('socketio');

  setupLibraryLogTail(socketio, app.locals.appLogFile, 'appLogFile', availableLines.appLogFile);
  setupLibraryLogTail(socketio, app.locals.libraryLogFile, 'libraryLogFile', availableLines.libraryLogFile);

  res.send('WebSockets set up successfully');
};


text:
package org.pentaho.profiling.services;

import org.pentaho.profiling.api.AggregateProfile;
import org.pentaho.profiling.api.AggregateProfileService;
import org.pentaho.profiling.api.Profile;
import org.pentaho.profiling.api.ProfilingService;
import org.pentaho.osgi.notification.api.DelegatingNotifierImpl;
import org.pentaho.osgi.notification.api.NotificationListener;
import org.pentaho.osgi.notification.api.NotificationObject;
import org.pentaho.osgi.notification.api.NotifierWithHistory;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.atomic.AtomicLong;

/**
 * Created by bryan on 5/12/15.
 */
public class ProfileTreeNotifier implements NotifierWithHistory, NotificationListener {
  public static final String PROFILING_SERVICE_CANONICAL_NAME = ProfilingService.class.getCanonicalName();
  public static final String AGGREGATE_PROFILE_SERVICE_CANONICAL_NAME =
    AggregateProfileService.class.getCanonicalName();
  public static final String CANONICAL_NAME = ProfileTreeNotifier.class.getCanonicalName();
  public static final String PROFILE_TREE = "profileTree";
  private final DelegatingNotifierImpl delegatingNotifier =
    new DelegatingNotifierImpl(
      new HashSet<String>( Arrays.asList( ProfileTreeNotifier.class.getCanonicalName() ) ),
      this );
  private final AtomicLong seqence = new AtomicLong( 1L );
  private volatile NotificationObject previousNotificationObject;
  private volatile List<AggregateProfile> aggregateProfiles = new ArrayList<AggregateProfile>();
  private volatile List<Profile> allProfiles = new ArrayList<Profile>();

  @Override public List<NotificationObject> getPreviousNotificationObjects() {
    NotificationObject previousNotificationObject = this.previousNotificationObject;
    if ( previousNotificationObject == null ) {
      return new ArrayList<NotificationObject>();
    }
    return new ArrayList<NotificationObject>( Arrays.asList( previousNotificationObject ) );
  }

  public void addNotifier( NotifierWithHistory notifierWithHistory ) {
    if ( notifierWithHistory == null ) {
      return;
    }
    Set<String> emittedTypes = notifierWithHistory.getEmittedTypes();
    if ( emittedTypes.contains( PROFILING_SERVICE_CANONICAL_NAME ) || emittedTypes.contains(
      AGGREGATE_PROFILE_SERVICE_CANONICAL_NAME ) ) {
      notifierWithHistory.register( this );
    }
  }

  @Override public void notify( NotificationObject notificationObject ) {
    if ( PROFILING_SERVICE_CANONICAL_NAME.equals( notificationObject.getType() ) && ProfilingService.PROFILES
      .equals( notificationObject.getId() ) ) {
      allProfiles = (List<Profile>) notificationObject.getObject();
    } else if ( AGGREGATE_PROFILE_SERVICE_CANONICAL_NAME.equals( notificationObject.getType() )
      && AggregateProfileService.AGGREGATE_PROFILES.equals( notificationObject.getId() ) ) {
      aggregateProfiles = (List<AggregateProfile>) notificationObject.getObject();
    } else {
      return;
    }
    List<AggregateProfileDTO> aggregateProfileDTOs = AggregateProfileDTO.forProfiles( aggregateProfiles );
    Set<String> representedIds = new HashSet<String>();
    buildRepresentedIds( representedIds, aggregateProfileDTOs );
    for ( Profile profile : allProfiles ) {
      if ( !representedIds.contains( profile.getId() ) ) {
        aggregateProfileDTOs.add( new AggregateProfileDTO( profile ) );
      }
    }
    Collections.sort( aggregateProfileDTOs, new Comparator<AggregateProfileDTO>() {
      @Override public int compare( AggregateProfileDTO o1, AggregateProfileDTO o2 ) {
        if ( o1.getName() == null ) {
          if ( o2.getName() == null ) {
            return o1.getId().compareTo( o2.getId() );
          } else {
            return 1;
          }
        } else if ( o2.getName() == null ) {
          return -1;
        }
        return o1.getName().compareTo( o2.getName() );
      }
    } );
    previousNotificationObject =
      new NotificationObject( CANONICAL_NAME, PROFILE_TREE, seqence.getAndIncrement(), aggregateProfileDTOs );
    delegatingNotifier.notify( previousNotificationObject );
  }

  private void buildRepresentedIds( Set<String> representedIds, List<AggregateProfileDTO> aggregateProfileDTOs ) {
    for ( AggregateProfileDTO aggregateProfileDTO : aggregateProfileDTOs ) {
      buildRepresentedIds( representedIds, aggregateProfileDTO );
    }
  }

  private void buildRepresentedIds( Set<String> representedIds, AggregateProfileDTO aggregateProfileDTO ) {
    representedIds.add( aggregateProfileDTO.getId() );
    List<AggregateProfileDTO> childProfiles = aggregateProfileDTO.getChildProfiles();
    if ( childProfiles != null ) {
      buildRepresentedIds( representedIds, childProfiles );
    }
  }

  @Override public Set<String> getEmittedTypes() {
    return delegatingNotifier.getEmittedTypes();
  }

  @Override public void register( NotificationListener notificationListener ) {
    delegatingNotifier.register( notificationListener );
  }

  @Override public void unregister( NotificationListener notificationListener ) {
    delegatingNotifier.unregister( notificationListener );
  }
}


text:
```dart
import 'package:keyclic_sdk_api/api.dart';
```

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**contactPoint** | [**MemberPatchContactPoint**](MemberPatchContactPoint.md) |  | [optional] [default to null]
**roles** | **List<String>** |  | [optional] [default to []]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


text:
(function() {

var checkVersion = Dagaz.Model.checkVersion;

Dagaz.Model.checkVersion = function(design, name, value) {
  if (name != "8x3-solitaire-extension") {
     checkVersion(design, name, value);
  }
}

var checkGoals = Dagaz.Model.checkGoals;

Dagaz.Model.checkGoals = function(design, board, player) {
  var cnt = 0;
  var f = false;
  _.each(design.allPositions(), function(pos) {
      var piece = board.getPiece(pos);
      if (piece !== null) {
         if (piece.type == 1) {
             cnt++;
         } else {
             f = true;
         }
      }
  });
  if (!f) return -1;
  if (cnt == 0) return 1;
  return checkGoals(design, board, player);
}

})();


text:
{
  return new Promise((resolve, reject) => {
    const updatedLabels = pr.__originalIssue.labels
      .filter(label => label.name !== DOCS_LABEL)
      .map(label => label.name);

    app.ghissues.editIssue(
      pr.number,
      {
        labels: updatedLabels
      },
      (err, body) => {
        if (err) {
          reject(err);
        } else {
          resolve(pr);
        }
      }
    );
  });
}