text:
/**
 * @file analyze.cpp
 * @author Sean Massung
 */

#include <iostream>
#include <string>
#include <unordered_set>
#include <vector>
#include "cpptoml.h"
#include "meta/analyzers/analyzer.h"
#include "meta/analyzers/filters/all.h"
#include "meta/analyzers/ngram/ngram_word_analyzer.h"
#include "meta/analyzers/tokenizers/icu_tokenizer.h"
#include "meta/corpus/document.h"
#include "meta/io/filesystem.h"
#include "meta/parser/sr_parser.h"
#include "meta/sequence/io/ptb_parser.h"
#include "meta/sequence/perceptron.h"
#include "meta/sequence/sequence.h"
#include "meta/util/shim.h"

using namespace meta;

/**
 * Prints help for this executable.
 * @param prog The name of the current executable
 * @return the exit code for this program
 */
int print_usage(const std::string& prog) {
  std::cerr << std::endl;
  std::cerr << "Usage: " << prog << " config.toml file.txt [OPTION]"
            << std::endl;
  std::cerr << "where [OPTION] is one or more of:" << std::endl;
  std::cerr << "\t--stem\tperform stemming on each word" << std::endl;
  std::cerr << "\t--stop\tremove stopwords" << std::endl;
  std::cerr << "\t--stopstem\tremove stopwords and perform stemming"
            << std::endl;
  std::cerr << "\t--pos\tannotate words with POS tags" << std::endl;
  std::cerr << "\t--pos-replace\treplace words with their POS tags"
            << std::endl;
  std::cerr << "\t--parse\tcreate grammatical parse trees from file content"
            << std::endl;
  std::cerr << "\t--freq-unigram\tsort and count unigram words" << std::endl;
  std::cerr << "\t--freq-bigram\tsort and count bigram words" << std::endl;
  std::cerr << "\t--freq-trigram\tsort and count trigram words" << std::endl;
  std::cerr << "\t--all\trun all options" << std::endl;
  std::cerr << std::endl;
  return 1;
}

/**
 * @param file The filename to modify
 * @return the base filename without an extension
 */
std::string no_ext(const std::string& file) {
  auto idx = file.find_last_of('.');
  return file.substr(0, idx);
}

/**
 * @param stream Token stream to read from
 * @param in_name Input filename
 * @param out_name Output filename
 */
template <class Stream>
void write_file(Stream& stream, const std::string& in_name,
                const std::string& out_name) {
  std::ofstream outfile{out_name};
  stream->set_content(filesystem::file_text(in_name));
  while (*stream) {
    auto next = stream->next();
    if (next == "<s>" || next == " ")
      continue;
    else if (next == "</s>")
      outfile << std::endl;
    else
      outfile << next << " ";
  }
}

/**
 * Performs stemming on a text file.
 * @param file The input file
 * @param config Configuration settings
 */
void stem(const std::string& file, const cpptoml::table&) {
  std::cout << "Running stemming algorithm" << std::endl;

  using namespace meta::analyzers;
  std::unique_ptr<token_stream> stream =
      make_unique<tokenizers::icu_tokenizer>();
  stream = make_unique<filters::lowercase_filter>(std::move(stream));
  stream = make_unique<filters::porter2_filter>(std::move(stream));
  stream = make_unique<filters::empty_sentence_filter>(std::move(stream));

  auto out_name = no_ext(file) + ".stems.txt";
  write_file(stream, file, out_name);
  std::cout << " -> file saved as " << out_name << std::endl;
}

/**
 * Performs stopword removal on a text file.
 * @param file The input file
 * @param config Configuration settings
 */
void stop(const std::string& file, const cpptoml::table& config) {
  std::cout << "Running stopword removal" << std::endl;

  using namespace meta::analyzers;
  auto stopwords = config.get_as<std::string>("stop-words");
  std::unique_ptr<token_stream> stream =
      make_unique<tokenizers::icu_tokenizer>();
  stream = make_unique<filters::lowercase_filter>(std::move(stream));
  stream = make_unique<filters::list_filter>(std::move(stream), *stopwords);
  stream = make_unique<filters::empty_sentence_filter>(std::move(stream));

  auto out_name = no_ext(file) + ".stops.txt";
  write_file(stream, file, out_name);
  std::cout << " -> file saved as " << out_name << std::endl;
}

// You should complete the function below.
void stopstem(const std::string& file, const cpptoml::table& config) {
  std::cout << "Running stopword removal and stemming" << std::endl;

  using namespace meta::analyzers;
  auto stopwords = config.get_as<std::string>(
      "stop-words");  // Reads the stop words from file
  std::unique_ptr<token_stream> stream =
      make_unique<tokenizers::icu_tokenizer>();
  stream = make_unique<filters::lowercase_filter>(std::move(stream));
  // Insert the line required to do stopword removal here
  // Insert the line required to do stemming here (using Porter2 Stemmer)
  stream = make_unique<filters::empty_sentence_filter>(std::move(stream));

  auto out_name = no_ext(file) + ".stopstem.txt";
  write_file(stream, file, out_name);
  std::cout << " -> file saved as " << out_name << std::endl;
}

/**
 * Performs part-of-speech tagging on a text file.
 * @param file The input file
 * @param config Configuration settings
 * @param replace Whether or not to replace words with their POS tags
 */
void pos(const std::string& file, const cpptoml::table& config, bool replace) {
  std::cout << "Running POS-tagging with replace = " << std::boolalpha
            << replace << std::endl;

  auto seq_grp = config.get_table("sequence");
  if (!seq_grp) {
    std::cerr << "[sequence] group needed in config file" << std::endl;
    return;
  }

  auto prefix = seq_grp->get_as<std::string>("prefix");
  if (!prefix) {
    std::cerr << "[sequence] group needs a prefix key" << std::endl;
    return;
  }

  std::cout << "Loading tagging model" << std::endl;
  sequence::perceptron tagger{*prefix};

  // construct the token filter chain
  std::unique_ptr<analyzers::token_stream> stream =
      make_unique<analyzers::tokenizers::icu_tokenizer>();
  stream = make_unique<analyzers::filters::ptb_normalizer>(std::move(stream));

  stream->set_content(filesystem::file_text(file));

  // tag each sentence in the file
  // and write its output to the output file
  auto out_name =
      no_ext(file) + (replace ? ".pos-replace.txt" : ".pos-tagged.txt");
  std::ofstream outfile{out_name};
  sequence::sequence seq;
  while (*stream) {
    auto token = stream->next();
    if (token == "<s>") {
      seq = {};
    } else if (token == "</s>") {
      tagger.tag(seq);
      for (const auto& obs : seq) {
        if (replace)
          outfile << obs.tag() << " ";
        else
          outfile << obs.symbol() << "_" << obs.tag() << " ";
      }
      outfile << std::endl;
    } else {
      seq.add_symbol(sequence::symbol_t{token});
    }
  }

  std::cout << " -> file saved as " << out_name << std::endl;
}

/**
 * Parses all sentences in a text file.
 */
void parse(const std::string& file, const cpptoml::table& config) {
  std::cout << "Running parser" << std::endl;

  auto seq_grp = config.get_table("sequence");
  if (!seq_grp) {
    std::cerr << "[sequence] group needed in config file" << std::endl;
    return;
  }

  auto prefix = seq_grp->get_as<std::string>("prefix");
  if (!prefix) {
    std::cerr << "[sequence] group needs a prefix key" << std::endl;
    return;
  }

  auto parser_grp = config.get_table("parser");
  if (!parser_grp) {
    std::cerr << "[parser] group needed in config file" << std::endl;
    return;
  }

  auto parser_prefix = parser_grp->get_as<std::string>("prefix");
  if (!parser_prefix) {
    std::cerr << "[parser] group needs a prefix key" << std::endl;
    return;
  }

  std::cout << "Loading tagging model" << std::endl;
  // load POS-tagging model
  sequence::perceptron tagger{*prefix};

  std::cout << "Loading parser model" << std::endl;
  // load parser model
  parser::sr_parser parser{*parser_prefix};

  // construct the token filter chain
  std::unique_ptr<analyzers::token_stream> stream =
      make_unique<analyzers::tokenizers::icu_tokenizer>();
  stream = make_unique<analyzers::filters::ptb_normalizer>(std::move(stream));

  stream->set_content(filesystem::file_text(file));

  // parse each sentence in the file
  // and write its output to the output file
  auto out_name = no_ext(file) + ".parsed.txt";
  std::ofstream outfile{out_name};
  sequence::sequence seq;
  while (*stream) {
    auto token = stream->next();
    if (token == "<s>") {
      seq = {};
    } else if (token == "</s>") {
      tagger.tag(seq);
      parser.parse(seq).pretty_print(outfile);
    } else {
      seq.add_symbol(sequence::symbol_t{token});
    }
  }

  std::cout << " -> file saved as " << out_name << std::endl;
}

/**
 * Performs frequency analysis on a text file.
 * @param file The input file
 * @param config Configuration settings
 * @param n The n-gram value to use in tokenization
 */
void freq(const std::string& file, cpptoml::table& config, int64_t n) {
  std::cout << "Running frequency analysis on " << n << "-grams" << std::endl;
  using namespace meta::analyzers;

  // make sure we have the right n-gram
  auto anas = config.get_table_array("analyzers");
  auto local = *anas->begin();
  local->erase("ngram");
  local->insert("ngram", n);
  auto ana = make_analyzer<ngram_word_analyzer>(config, *local);

  corpus::document doc;
  doc.content(filesystem::file_text(file));
  auto counts = ana->analyze<uint64_t>(doc);

  using pair_t = std::pair<std::string, uint64_t>;
  std::vector<pair_t> sorted(counts.begin(), counts.end());
  std::sort(sorted.begin(), sorted.end(), [](const pair_t& a, const pair_t& b) {
    return a.second > b.second;
  });

  auto out_name = no_ext(file) + ".freq." + std::to_string(n) + ".txt";
  std::ofstream outfile{out_name};
  for (auto& token : sorted)
    outfile << token.first << " " << token.second << std::endl;

  std::cout << " -> file saved as " << out_name << std::endl;
}

int main(int argc, char* argv[]) {
  if (argc < 4) return print_usage(argv[0]);

  auto config = cpptoml::parse_file(argv[1]);
  std::string file = argv[2];
  if (!filesystem::file_exists(file)) {
    std::cerr << "File does not exist" << std::endl;
    return 1;
  }
  std::unordered_set<std::string> args{argv + 3, argv + argc};
  bool all = args.find("--all") != args.end();

  if (all || args.find("--stem") != args.end()) stem(file, *config);
  if (all || args.find("--stop") != args.end()) stop(file, *config);
  if (all || args.find("--pos") != args.end()) pos(file, *config, false);
  if (all || args.find("--pos-replace") != args.end()) pos(file, *config, true);
  if (all || args.find("--parse") != args.end()) parse(file, *config);
  if (all || args.find("--freq-unigram") != args.end()) freq(file, *config, 1);
  if (all || args.find("--freq-bigram") != args.end()) freq(file, *config, 2);
  if (all || args.find("--freq-trigram") != args.end()) freq(file, *config, 3);
  if (all || args.find("--stopstem") != args.end()) stopstem(file, *config);
}


text:
mac setup

#check ruby is installed or not
ruby -v

#install homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

brew install git

redpajama_set_name: RedPajamaGithub


text:
package com.example.tests;

public class ContactData implements Comparable<ContactData>{
	private String firstname;
	private String lastname;
	private String address;
	private String home;
	private String mobile;
	private String work;
	private String email;
	private String email2;
	private String bday;
	private String bmonth;
	private String byear;
	private String address1;
	private String address2;
	private String phone2;

	public ContactData() {
	}
	public ContactData(String firstname, String lastname, String address, String home, String mobile, String work,
			String email, String email2, String bday, String bmonth, String byear, String address1, String address2,
			String phone2) {
		this.firstname = firstname;
		this.lastname = lastname;
		this.address = address;
		this.home = home;
		this.mobile = mobile;
		this.work = work;
		this.email = email;
		this.email2 = email2;
		this.bday = bday;
		this.bmonth = bmonth;
		this.byear = byear;
		this.address1 = address1;
		this.address2 = address2;
		this.phone2 = phone2;
	}

    @Override
	public String toString() {
		return "ContactData [email=" + email + "]";
	}

	@Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof ContactData)) return false;

        ContactData that = (ContactData) o;

        if (!email.equals(that.email)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return email.hashCode();
    }
	@Override
	public int compareTo(ContactData other) {
		return this.email.toLowerCase().compareTo(other.email.toLowerCase());
	}
	public ContactData withFirstname(String firstname) {
		this.firstname = firstname;
		return this;
	}

	public ContactData withLastname(String lastname) {
		this.lastname = lastname;
		return this;
	}

	public ContactData withAddress(String address) {
		this.address = address;
		return this;
	}

	public ContactData withHome(String home) {
		this.home = home;
		return this;
	}
	public ContactData withMobile(String mobile) {
		this.mobile = mobile;
		return this;
	}

	public ContactData withWork(String work) {
		this.work = work;
		return this;
	}

	public ContactData withEmail(String email) {
		this.email = email;
		return this;
	}
	public ContactData withEmail2(String email2) {
		this.email2 = email2;
		return this;
	}
	public ContactData withBday(String bday) {
		this.bday = bday;
		return this;
	}
	public ContactData withBmonth(String bmonth) {
		this.bmonth = bmonth;
		return this;
	}
	public ContactData withByear(String byear) {
		this.byear = byear;
		return this;
	}
	public ContactData withAddress1(String address1) {
		this.address1 = address1;
		return this;
	}
	public ContactData withAddress2(String address2) {
		this.address2 = address2;
		return this;
	}
	public ContactData withPhone2(String phone2) {
		this.phone2 = phone2;
		return this;
	}
	public String getFirstname() {
		return firstname;
	}
	public String getLastname() {
		return lastname;
	}
	public String getAddress() {
		return address;
	}
	public String getHome() {
		return home;
	}
	public String getMobile() {
		return mobile;
	}
	public String getWork() {
		return work;
	}
	public String getEmail() {
		return email;
	}
	public String getEmail2() {
		return email2;
	}
	public String getBday() {
		return bday;
	}
	public String getBmonth() {
		return bmonth;
	}
	public String getByear() {
		return byear;
	}
	public String getAddress1() {
		return address1;
	}
	public String getAddress2() {
		return address2;
	}
	public String getPhone2() {
		return phone2;
	}

}


text:
echo "*** NOTE: If this script does not work, try running ./setup.sh first to get the environment ready ***"
echo "Starting Admin..."
echo "Running 'npm start' in $PWD"
npm start


text:
package com.igormaznitsa.jjjvm.model;

import java.util.Map;

public interface JJJVMClass extends JJJVMConstants {

  JJJVMProvider getProvider();

  JJJVMConstantPool getConstantPool();

  JJJVMMethod findMethod(String methodName, String methodSignature) throws Throwable;

  JJJVMField findField(String fieldName) throws Throwable;

  JJJVMMethod findDeclaredMethod(String methodName, String methodSignature);

  JJJVMField findDeclaredField(String fieldName);

  Map<String, JJJVMField> getAllDeclaredFields();

  Map<String, JJJVMMethod> getAllDeclaredMethods();

  Object resolveSuperclass() throws Throwable;

  String[] getImplementedInterfaceNames();

  int getClassFormatVersion();

  int getFlags();

  String getName();

  String getClassName();

  String getCanonicalName();

  String getSourceFileName();

  Object readStaticField(String fieldName) throws Throwable;

  void writeStaticField(String fieldName, Object value) throws Throwable;

  JJJVMObject newInstance(boolean callDefaultConstructor) throws Throwable;

  JJJVMObject newInstance(String constructorSignature, Object[] args, Object[] stack, Object[] localVariables) throws Throwable;

  JJJVMObject initInstanceFields(JJJVMObject obj) throws Throwable;

}


text:
package com.wine.config;

import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.boot.context.embedded.ErrorPage;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.repository.support.DomainClassConverter;
import org.springframework.format.support.FormattingConversionService;
import org.springframework.http.HttpStatus;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class WebConfig extends WebMvcConfigurerAdapter {

	@Bean
	public EmbeddedServletContainerCustomizer containerCustomizer() {
		return (container ->
			container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/404"),
					new ErrorPage(HttpStatus.FORBIDDEN, "/403")));
	}

	//Configuração para nao utilizar o findone e o spring ja reconhecer o objeto vinho pelo codigo
	@Bean
	public DomainClassConverter<FormattingConversionService> domainClassConverter(
			FormattingConversionService conversionService) {
		return new DomainClassConverter<FormattingConversionService>(conversionService);
	}

	// redirecionar a requisicao de "/"
	@Override
	public void addViewControllers(ViewControllerRegistry registry) {
		registry.addRedirectViewController("/", "/vinhos/novo");
	}

}


text:
<?php

namespace Symfony\Components\OutputEscaper;

/**
 * Marks a variable as being safe for output.
 *
 * @package    Symfony
 * @subpackage Components_OutputEscaper
 * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
 */
class SafeDecorator extends \ArrayIterator
{
    protected $value;

    /**
     * Constructor.
     *
     * @param mixed $value  The value to mark as safe
     */
    public function __construct($value)
    {
        $this->value = $value;

        if (is_array($value) || is_object($value)) {
            parent::__construct($value);
        }
    }

    public function __toString()
    {
        return (string) $this->value;
    }

    public function __get($key)
    {
        return $this->value->$key;
    }

    public function __set($key, $value)
    {
        $this->value->$key = $value;
    }

    public function __call($method, $arguments)
    {
        return call_user_func_array(array($this->value, $method), $arguments);
    }

    public function __isset($key)
    {
        return isset($this->value->$key);
    }

    public function __unset($key)
    {
        unset($this->value->$key);
    }

    /**
     * Returns the embedded value.
     *
     * @return mixed The embedded value
     */
    public function getValue()
    {
        return $this->value;
    }
}


text:
//
//  PaintController.m
//  feelings
//
//  Created by Androidicus Maximus on 8/2/09.
//  Copyright 2009 Stone Design Corp. All rights reserved.
//

#import "PaintController.h"
#import "PaintingView.h"
#import "AudioFX.h"

@implementation PaintController

- (id)init {
    if (self = [super initWithNibName:nil bundle:nil]) {
		self.tabBarItem = [[[UITabBarItem alloc] initWithTitle:@"New" image:[UIImage imageNamed:@"brush.png"] tag:2] autorelease];
    }
    return self;
}

#define kPaletteHeight					30
#define kPaletteSize				    5
#define kAccelerometerFrequency			25 //Hz
#define kFilteringFactor				0.1
#define kMinEraseInterval				0.5
#define kEraseAccelerationThreshold		2.0

// Padding for margins
#define kLeftMargin				10.0
#define kTopMargin				10.0
#define kRightMargin			10.0

//FUNCTIONS:
/*
 HSL2RGB Converts hue, saturation, luminance values to the equivalent red, green and blue values.
 For details on this conversion, see Fundamentals of Interactive Computer Graphics by Foley and van Dam (1982, Addison and Wesley)
 You can also find HSL to RGB conversion algorithms by searching the Internet.
 See also http://en.wikipedia.org/wiki/HSV_color_space for a theoretical explanation
 */
static void HSL2RGB(float h, float s, float l, float* outR, float* outG, float* outB)
{
	float			temp1,
	temp2;
	float			temp[3];
	int				i;

	// Check for saturation. If there isn't any just return the luminance value for each, which results in gray.
	if(s == 0.0) {
		if(outR)
			*outR = l;
		if(outG)
			*outG = l;
		if(outB)
			*outB = l;
		return;
	}

	// Test for luminance and compute temporary values based on luminance and saturation
	if(l < 0.5)
		temp2 = l * (1.0 + s);
	else
		temp2 = l + s - l * s;
	temp1 = 2.0 * l - temp2;

	// Compute intermediate values based on hue
	temp[0] = h + 1.0 / 3.0;
	temp[1] = h;
	temp[2] = h - 1.0 / 3.0;

	for(i = 0; i < 3; ++i) {

		// Adjust the range
		if(temp[i] < 0.0)
			temp[i] += 1.0;
		if(temp[i] > 1.0)
			temp[i] -= 1.0;

		if(6.0 * temp[i] < 1.0)
			temp[i] = temp1 + (temp2 - temp1) * 6.0 * temp[i];
		else {
			if(2.0 * temp[i] < 1.0)
				temp[i] = temp2;
			else {
				if(3.0 * temp[i] < 2.0)
					temp[i] = temp1 + (temp2 - temp1) * ((2.0 / 3.0) - temp[i]) * 6.0;
				else
					temp[i] = temp1;
			}
		}
	}

	// Assign temporary values to R, G, B
	if(outR)
		*outR = temp[0];
	if(outG)
		*outG = temp[1];
	if(outB)
		*outB = temp[2];
}

- (void)viewDidLoad
{
	CGRect					rect = self.view.frame;
	CGFloat					components[3];

	[self.view setBackgroundColor:[UIColor blackColor]];

	//Create the OpenGL drawing view and add it to the window
	drawingView = [[PaintingView alloc] initWithFrame:CGRectMake(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height)]; // - kPaletteHeight
	[self.view addSubview:drawingView];

	// Create a segmented control so that the user can choose the brush color.
	UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] initWithItems:
											[NSArray arrayWithObjects:
											 [UIImage imageNamed:@"Red.png"],
											 [UIImage imageNamed:@"Yellow.png"],
											 [UIImage imageNamed:@"Green.png"],
											 [UIImage imageNamed:@"Blue.png"],
											 [UIImage imageNamed:@"Purple.png"],
											 nil]];

	// Compute a rectangle that is positioned correctly for the segmented control you'll use as a brush color palette
	CGRect frame = CGRectMake(rect.origin.x + kLeftMargin, rect.size.height - kPaletteHeight - kTopMargin, rect.size.width - (kLeftMargin + kRightMargin), kPaletteHeight);
	segmentedControl.frame = frame;
	// When the user chooses a color, the method changeBrushColor: is called.
	[segmentedControl addTarget:self action:@selector(changeBrushColor:) forControlEvents:UIControlEventValueChanged];
	segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;
	// Make sure the color of the color complements the black background
	segmentedControl.tintColor = [UIColor darkGrayColor];
	// Set the third color (index values start at 0)
	segmentedControl.selectedSegmentIndex = 2;

	// Add the control to the window
	[self.view addSubview:segmentedControl];
	// Now that the control is added, you can release it
	[segmentedControl release];

    // Define a starting color
	HSL2RGB((CGFloat) 2.0 / (CGFloat)kPaletteSize, kSaturation, kLuminosity, &components[0], &components[1], &components[2]);
	// Set the color using OpenGL
	glColor4f(components[0], components[1], components[2], kBrushOpacity);

	// Look in the Info.plist file and you'll see the status bar is hidden
	// Set the style to black so it matches the background of the application
	[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:NO];
	// Now show the status bar, but animate to the style.
//	[application setStatusBarHidden:NO animated:YES];

	//Configure and enable the accelerometer
	[[UIAccelerometer sharedAccelerometer] setUpdateInterval:(1.0 / kAccelerometerFrequency)];
	[[UIAccelerometer sharedAccelerometer] setDelegate:self];
//	//Load the sounds
//	NSBundle *mainBundle = [NSBundle mainBundle];
//	erasingSound = [[SoundEffect alloc] initWithContentsOfFile:[mainBundle pathForResource:@"Erase" ofType:@"caf"]];
//	selectSound =  [[SoundEffect alloc] initWithContentsOfFile:[mainBundle pathForResource:@"Select" ofType:@"caf"]];
}

- (void)viewDidAppear:(BOOL)ani{
	[drawingView becomeFirstResponder];
}
// Release resources when they are no longer needed,
- (void) dealloc
{
//	[selectSound release];
//	[erasingSound release];
	[drawingView release];

	[super dealloc];
}

// Change the brush color
- (void)changeBrushColor:(id)sender
{
 	CGFloat					components[3];

	//Play sound
// 	[selectSound play];
	[AudioFX playAtPath:[[NSBundle mainBundle] pathForResource:@"Select" ofType:@"caf"]];
	//Set the new brush color
 	HSL2RGB((CGFloat)[sender selectedSegmentIndex] / (CGFloat)kPaletteSize, kSaturation, kLuminosity, &components[0], &components[1], &components[2]);
 	glColor4f(components[0], components[1], components[2], kBrushOpacity);
}

@end


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

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>ViennaCL - The Vienna Computing Library: viennacl/ocl/local_mem.hpp File Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

ViennaCL - The Vienna Computing Library
    1.3.1

Main Page

Namespaces

Data Structures

Files

File List

Globals

Data Structures |
Namespaces

viennacl/ocl/local_mem.hpp File Reference

A local (shared) memory object for OpenCL.
More...

Go to the source code of this file.

Data Structures

class  	local_mem

 	A class representing local (shared) OpenCL memory. Typically used as kernel argument.  More...

Namespaces

namespace  	viennacl

namespace  	viennacl::ocl

Detailed Description

A local (shared) memory object for OpenCL.

<address class="footer">
Generated on Thu Aug 9 2012 19:49:11 for ViennaCL - The Vienna Computing Library by

 1.7.6.1
</address>


text:
SetupProvider = require('../setupprovider').SetupProvider;
var setupProvider= new SetupProvider(GLOBAL.mongo_host, GLOBAL.mongo_port);

exports.resetDB = function(req, res){
    setupProvider.reset(function(error, users_counter, global_counter) {
        if(error) {
            console.log(error.toString());
            res.statusCode = 400;
            res.send(error.toString());
        } else {
            console.log("DBs were reset successfully! " + users_counter + " users songs and " + global_counter + " global songs were loaded successfully!");
            res.statusCode = 200;
            res.send("DBs were reset successfully! " + users_counter + " users songs and " + global_counter + " global songs were loaded successfully!");
        }
    });
};


text:
#ifndef HPP_PSI_MACROS
#define HPP_PSI_MACROS

#include "Compiler.hpp"
#include "Tree.hpp"
#include "Export.hpp"

namespace Psi {
  namespace Compiler {
    TreePtr<> default_macro_term(CompileContext& compile_context, const SourceLocation& location);
    TreePtr<> default_type_macro_term(CompileContext& compile_context, const SourceLocation& location);
    TreePtr<> default_macro_member(CompileContext& compile_context, const SourceLocation& location);
    TreePtr<> default_type_macro_member(CompileContext& compile_context, const SourceLocation& location);

    TreePtr<> string_macro(CompileContext& compile_context, const SourceLocation& location);
    TreePtr<> bracket_macro(CompileContext& compile_context, const SourceLocation& location);

    TreePtr<Term> lifecycle_init_macro(CompileContext& compile_context, const SourceLocation& location);
    TreePtr<Term> lifecycle_fini_macro(CompileContext& compile_context, const SourceLocation& location);
    TreePtr<Term> lifecycle_move_macro(CompileContext& compile_context, const SourceLocation& location);
    TreePtr<Term> lifecycle_copy_macro(CompileContext& compile_context, const SourceLocation& location);
    TreePtr<Term> lifecycle_no_move_macro(CompileContext& compile_context, const SourceLocation& location);
    TreePtr<Term> lifecycle_no_copy_macro(CompileContext& compile_context, const SourceLocation& location);

    TreePtr<Term> new_macro(CompileContext& compile_context, const SourceLocation& location);
    TreePtr<Term> namespace_macro(CompileContext& compile_context, const SourceLocation& location);
    TreePtr<Term> number_value_macro(CompileContext& compile_context, const SourceLocation& location);
    TreePtr<Term> pointer_macro(CompileContext& compile_context, const SourceLocation& location);
    TreePtr<Term> function_macro(CompileContext& compile_context, const SourceLocation& location);
    TreePtr<Term> struct_macro(CompileContext& compile_context, const SourceLocation& location);

    TreePtr<Term> macro_define_macro(CompileContext& compile_context, const SourceLocation& location);
    TreePtr<Term> interface_define_macro(CompileContext& compile_context, const SourceLocation& location);

    TreePtr<Term> library_macro(CompileContext& compile_context, const SourceLocation& location);

    struct ConstantMetadataSetup {
      TreePtr<MetadataType> type;
      TreePtr<> value;
      unsigned n_wildcards;
      /// Extra pattern variables
      PSI_STD::vector<TreePtr<Term> > pattern;

      template<typename V>
      static void visit(V& v) {
        v("type", &ConstantMetadataSetup::type)
        ("value", &ConstantMetadataSetup::value)
        ("n_wildcards", &ConstantMetadataSetup::n_wildcards)
        ("pattern", &ConstantMetadataSetup::pattern);
      }
    };

    TreePtr<Term> make_annotated_type(CompileContext& compile_context, const PSI_STD::vector<ConstantMetadataSetup>& metadata, const SourceLocation& location);
    TreePtr<Term> make_macro_tag_term(const TreePtr<Macro>& macro, const TreePtr<Term>& tag, const SourceLocation& location);
    TreePtr<Term> make_macro_term(const TreePtr<Macro>& macro, const SourceLocation& location);

    class MacroMemberCallback;

    /**
     * \see MacroEvaluateCallback
     */
    struct MacroMemberCallbackVtable {
      TreeVtable base;
      void (*evaluate) (TreePtr<Term>*, const MacroMemberCallback*, const TreePtr<Term>*, const PSI_STD::vector<SharedPtr<Parser::Expression> >*, const TreePtr<EvaluateContext>*, const SourceLocation*);
    };

    class MacroMemberCallback : public Tree {
    public:
      typedef MacroMemberCallbackVtable VtableType;
      static const SIVtable vtable;

      MacroMemberCallback(const MacroMemberCallbackVtable *vptr, CompileContext& compile_context, const SourceLocation& location)
      : Tree(PSI_COMPILER_VPTR_UP(Tree, vptr), compile_context, location) {
      }

      TreePtr<Term> evaluate(const TreePtr<Term>& value, const PSI_STD::vector<SharedPtr<Parser::Expression> >& parameters, const TreePtr<EvaluateContext>& evaluate_context, const SourceLocation& location) const {
        ResultStorage<TreePtr<Term> > rs;
        derived_vptr(this)->evaluate(rs.ptr(), this, &value, &parameters, &evaluate_context, &location);
        return rs.done();
      }
    };

    template<typename Derived>
    struct MacroMemberCallbackWrapper : NonConstructible {
      static void evaluate(TreePtr<Term> *out, const MacroMemberCallback *self, const TreePtr<Term> *value, const PSI_STD::vector<SharedPtr<Parser::Expression> > *parameters, const TreePtr<EvaluateContext> *evaluate_context, const SourceLocation *location) {
        new (out) TreePtr<Term> (Derived::evaluate_impl(*static_cast<const Derived*>(self), *value, *parameters, *evaluate_context, *location));
      }
    };

#define PSI_COMPILER_MACRO_MEMBER_CALLBACK(derived,name,super) { \
    PSI_COMPILER_TREE(derived,name,super), \
    &MacroMemberCallbackWrapper<derived>::evaluate \
  }

    TreePtr<Macro> make_macro(CompileContext&, const SourceLocation&, const TreePtr<MacroMemberCallback>&, const std::map<String, TreePtr<MacroMemberCallback> >&);
    TreePtr<Macro> make_macro(CompileContext&, const SourceLocation&, const TreePtr<MacroMemberCallback>&);
    TreePtr<Macro> make_macro(CompileContext&, const SourceLocation&, const std::map<String, TreePtr<MacroMemberCallback> >&);
  }
}

#endif


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

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  <title>find_file — CMake 3.7.1 Documentation</title>

    <link rel="stylesheet" href="../_static/cmake.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />

    <link rel="shortcut icon" href="../_static/cmake-favicon.ico"/>
    <link rel="top" title="CMake 3.7.1 Documentation" href="../index.html" />
    <link rel="up" title="cmake-commands(7)" href="../manual/cmake-commands.7.html" />
    <link rel="next" title="find_library" href="find_library.html" />
    <link rel="prev" title="file" href="file.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.7.1 Documentation »

cmake-commands(7) »

find_file¶

A short-hand signature is:

find_file (<VAR> name1 [path1 path2 ...])

The general signature is:

find_file (
          <VAR>
          name | NAMES name1 [name2 ...]
          [HINTS path1 [path2 ... ENV var]]
          [PATHS path1 [path2 ... ENV var]]
          [PATH_SUFFIXES suffix1 [suffix2 ...]]
          [DOC "cache documentation string"]
          [NO_DEFAULT_PATH]
          [NO_CMAKE_ENVIRONMENT_PATH]
          [NO_CMAKE_PATH]
          [NO_SYSTEM_ENVIRONMENT_PATH]
          [NO_CMAKE_SYSTEM_PATH]
          [CMAKE_FIND_ROOT_PATH_BOTH |
           ONLY_CMAKE_FIND_ROOT_PATH |
           NO_CMAKE_FIND_ROOT_PATH]
         )

This command is used to find a full path to named file.
A cache entry named by <VAR> is created to store the result
of this command.
If the full path to a file is found the result is stored in the variable
and the search will not be repeated unless the variable is cleared.
If nothing is found, the result will be
<VAR>-NOTFOUND, and the search will be attempted again the
next time find_file is invoked with the same variable.

Options include:

NAMES

Specify one or more possible names for the full path to a file.

When using this to specify names with and without a version
suffix, we recommend specifying the unversioned name first
so that locally-built packages can be found before those
provided by distributions.

HINTS, PATHS

Specify directories to search in addition to the default locations.
The ENV var sub-option reads paths from a system environment
variable.

PATH_SUFFIXES

Specify additional subdirectories to check below each directory
location otherwise considered.

DOC

Specify the documentation string for the <VAR> cache entry.

If NO_DEFAULT_PATH is specified, then no additional paths are
added to the search.
If NO_DEFAULT_PATH is not specified, the search process is as follows:

Search paths specified in cmake-specific cache variables.
These are intended to be used on the command line with a -DVAR=value.
This can be skipped if NO_CMAKE_PATH is passed.

<prefix>/include/<arch> if CMAKE_LIBRARY_ARCHITECTURE
is set, and <prefix>/include for each <prefix> in CMAKE_PREFIX_PATH

CMAKE_INCLUDE_PATH

CMAKE_FRAMEWORK_PATH

Search paths specified in cmake-specific environment variables.
These are intended to be set in the user’s shell configuration.
This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is passed.

<prefix>/include/<arch> if CMAKE_LIBRARY_ARCHITECTURE
is set, and <prefix>/include for each <prefix> in CMAKE_PREFIX_PATH

CMAKE_INCLUDE_PATH

CMAKE_FRAMEWORK_PATH

Search the paths specified by the HINTS option.
These should be paths computed by system introspection, such as a
hint provided by the location of another item already found.
Hard-coded guesses should be specified with the PATHS option.

Search the standard system environment variables.
This can be skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument.

Directories in INCLUDE.
On Windows hosts:
<prefix>/include/<arch> if CMAKE_LIBRARY_ARCHITECTURE
is set, and <prefix>/include for each <prefix>/[s]bin in PATH, and
<entry>/include for other entries in PATH, and the
directories in PATH itself.

Search cmake variables defined in the Platform files
for the current system.  This can be skipped if NO_CMAKE_SYSTEM_PATH
is passed.

<prefix>/include/<arch> if CMAKE_LIBRARY_ARCHITECTURE
is set, and <prefix>/include for each <prefix> in
CMAKE_SYSTEM_PREFIX_PATH

CMAKE_SYSTEM_INCLUDE_PATH

CMAKE_SYSTEM_FRAMEWORK_PATH

Search the paths specified by the PATHS option
or in the short-hand version of the command.
These are typically hard-coded guesses.

On OS X the CMAKE_FIND_FRAMEWORK and
CMAKE_FIND_APPBUNDLE variables determine the order of
preference between Apple-style and unix-style package components.

The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more
directories to be prepended to all other search directories.  This
effectively “re-roots” the entire search under given locations.
Paths which are descendants of the CMAKE_STAGING_PREFIX are excluded
from this re-rooting, because that variable is always a path on the host system.
By default the CMAKE_FIND_ROOT_PATH is empty.

The CMAKE_SYSROOT variable can also be used to specify exactly one
directory to use as a prefix.  Setting CMAKE_SYSROOT also has other
effects.  See the documentation for that variable for more.

These variables are especially useful when cross-compiling to
point to the root directory of the target environment and CMake will
search there too.  By default at first the directories listed in
CMAKE_FIND_ROOT_PATH are searched, then the CMAKE_SYSROOT
directory is searched, and then the non-rooted directories will be
searched.  The default behavior can be adjusted by setting
CMAKE_FIND_ROOT_PATH_MODE_INCLUDE.  This behavior can be manually
overridden on a per-call basis using options:

CMAKE_FIND_ROOT_PATH_BOTH

Search in the order described above.

NO_CMAKE_FIND_ROOT_PATH

Do not use the CMAKE_FIND_ROOT_PATH variable.

ONLY_CMAKE_FIND_ROOT_PATH

Search only the re-rooted directories and directories below
CMAKE_STAGING_PREFIX.

The default search order is designed to be most-specific to
least-specific for common use cases.
Projects may override the order by simply calling the command
multiple times and using the NO_* options:

find_file (<VAR> NAMES name PATHS paths... NO_DEFAULT_PATH)
find_file (<VAR> NAMES name)

Once one of the calls succeeds the result variable will be set
and stored in the cache so that no call will search again.

Previous topic

file

Next topic

find_library

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

    Enter search terms or a module, class or function name.

Navigation

          index

          next |

          previous |

    CMake »

    3.7.1 Documentation »

cmake-commands(7) »

        © Copyright 2000-2016 Kitware, Inc. and Contributors.
      Created using Sphinx 1.4a0+.


text:
package org.apache.batik.util.gui;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.Point;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.EventListener;
import java.util.EventObject;
import java.util.Locale;
import java.util.ResourceBundle;

import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
import javax.swing.ScrollPaneConstants;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.event.EventListenerList;
import javax.swing.plaf.basic.BasicButtonUI;

import org.apache.batik.util.resources.ResourceManager;

/**
 * The drop down menu component. Supports drop down popup menu and the main
 * button.
 *
 * @version $Id: DropDownComponent.java 985243 2010-08-13 15:30:25Z helder $
 */
public class DropDownComponent extends JPanel {

    /**
     * The main button for this component.
     */
    private JButton mainButton;

    /**
     * The drop down button. When clicked the dropdown popup menu appears.
     */
    private JButton dropDownButton;

    /**
     * The icon for enabled drop down button.
     */
    private Icon enabledDownArrow;

    /**
     * The icon for disabled drop down button.
     */
    private Icon disabledDownArrow;

    /**
     * The scrollable pop up menu.
     */
    private ScrollablePopupMenu popupMenu;

    /**
     * If drop down menu appears when clicked on dropdown button.
     */
    private boolean isDropDownEnabled;

    /**
     * Creates the dropdown menu with the given main button.
     *
     * @param mainButton
     *            the components main button
     */
    public DropDownComponent(JButton mainButton) {
        super(new BorderLayout());

        // Initializes pop up menu
        popupMenu = getPopupMenu();

        this.mainButton = mainButton;
        add(this.mainButton, BorderLayout.WEST);
        this.mainButton.setMaximumSize(new Dimension(24, 24));
        this.mainButton.setPreferredSize(new Dimension(24, 24));

        // Initializes dropdown button and icons for dropdown button
        enabledDownArrow = new SmallDownArrow();
        disabledDownArrow = new SmallDisabledDownArrow();
        dropDownButton = new JButton(disabledDownArrow);
        dropDownButton.setBorderPainted(false);
        dropDownButton.setDisabledIcon(disabledDownArrow);
        dropDownButton.addMouseListener(new DropDownListener());
        dropDownButton.setMaximumSize(new Dimension(18, 24));
        dropDownButton.setMinimumSize(new Dimension(18, 10));
        dropDownButton.setPreferredSize(new Dimension(18, 10));
        dropDownButton.setFocusPainted(false);
        add(dropDownButton, BorderLayout.EAST);

        setEnabled(false);
    }

    /**
     * Gets the dropdown popup menu.
     *
     * @return ScrollablePopupMenu
     */
    public ScrollablePopupMenu getPopupMenu() {
        if (popupMenu == null) {
            popupMenu = new ScrollablePopupMenu(this);
            popupMenu.setEnabled(false);
            // If the pop up menu gets disabled,
            // the dropdown buttons should be disabled as well
            popupMenu.addPropertyChangeListener
                ("enabled",
                 new PropertyChangeListener() {
                     public void propertyChange(PropertyChangeEvent evt) {
                         setEnabled
                            (((Boolean) evt.getNewValue()).booleanValue());
                     }
                 });

            // Listens for the changes in the scrollable pop up menu
            popupMenu.addListener
                (new ScrollablePopupMenuAdapter() {

                     public void itemsWereAdded(ScrollablePopupMenuEvent ev) {
                         updateMainButtonTooltip(ev.getDetails());
                     }

                     public void itemsWereRemoved(ScrollablePopupMenuEvent ev) {
                         updateMainButtonTooltip(ev.getDetails());
                     }
                 });
        }
        return popupMenu;
    }

    public void setEnabled(boolean enable) {
        isDropDownEnabled = enable;
        mainButton.setEnabled(enable);
        dropDownButton.setEnabled(enable);
        dropDownButton.setIcon(enable ? enabledDownArrow : disabledDownArrow);
    }

    public boolean isEnabled() {
        return isDropDownEnabled;
    }

    /**
     * Sets new tooltip text to the main button.
     *
     * @param newTooltip
     *            the new tooltip text
     */
    public void updateMainButtonTooltip(String newTooltip) {
        mainButton.setToolTipText(newTooltip);
    }

    /**
     * Shows the pop up menu when clicked.
     */
    private class DropDownListener extends MouseAdapter {
        public void mousePressed(MouseEvent e) {
            if (popupMenu.isShowing() && isDropDownEnabled) {
                popupMenu.setVisible(false);
            } else if (isDropDownEnabled) {
                popupMenu.showMenu
                    ((Component) e.getSource(), DropDownComponent.this);
            }
        }
        public void mouseEntered(MouseEvent ev) {
            dropDownButton.setBorderPainted(true);
        }
        public void mouseExited(MouseEvent ev) {
            dropDownButton.setBorderPainted(false);
        }
    }

    /**
     * A small downward-pointing arrow icon.
     */
    private static class SmallDownArrow implements Icon {

        /**
         * The arrow color.
         */
        protected Color arrowColor = Color.black;

        public void paintIcon(Component c, Graphics g, int x, int y) {
            g.setColor(arrowColor);
            g.drawLine(x, y, x + 4, y);
            g.drawLine(x + 1, y + 1, x + 3, y + 1);
            g.drawLine(x + 2, y + 2, x + 2, y + 2);
        }

        public int getIconWidth() {
            return 6;
        }

        public int getIconHeight() {
            return 4;
        }
    }

    /**
     * A disabled small downward-pointing arrow icon.
     */
    private static class SmallDisabledDownArrow extends SmallDownArrow {

        /**
         * Constructor.
         */
        public SmallDisabledDownArrow() {
            arrowColor = new Color(140, 140, 140);
        }

        public void paintIcon(Component c, Graphics g, int x, int y) {
            super.paintIcon(c, g, x, y);
            g.setColor(Color.white);
            g.drawLine(x + 3, y + 2, x + 4, y + 1);
            g.drawLine(x + 3, y + 3, x + 5, y + 1);
        }
    }

    /**
     * The scrollable pop up menu item.
     */
    public static interface ScrollablePopupMenuItem {

        /**
         * Selects and deselects the item.
         *
         * @param selected
         *            is selected
         */
        void setSelected(boolean selected);

        /**
         * Checks if the item is selected.
         *
         * @return True if selected
         */
        boolean isSelected();

        /**
         * Returns the item name.
         *
         * @return the name
         */
        String getText();

        /**
         * Sets the item name.
         *
         * @param text
         *            The new item name
         */
        void setText(String text);

        /**
         * Enables / disables the item
         *
         * @param enabled
         *            True - enables the item
         */
        void setEnabled(boolean enabled);
    }

    /**
     * Default implementation of the scrollable popup menu item.
     */
    public static class DefaultScrollablePopupMenuItem extends JButton
            implements ScrollablePopupMenuItem {

        /**
         * The selected item background color.
         */
        public static final Color MENU_HIGHLIGHT_BG_COLOR =
            UIManager.getColor("MenuItem.selectionBackground");

        /**
         * The selected item foreground color.
         */
        public static final Color MENU_HIGHLIGHT_FG_COLOR =
            UIManager.getColor("MenuItem.selectionForeground");

        /**
         * The item background color.
         */
        public static final Color MENUITEM_BG_COLOR =
            UIManager.getColor("MenuItem.background");

        /**
         * The item foreground color.
         */
        public static final Color MENUITEM_FG_COLOR =
            UIManager.getColor("MenuItem.foreground");

        /**
         * The parent scrollable popup menu.
         */
        private ScrollablePopupMenu parent;

        /**
         * Constructor.
         */
        public DefaultScrollablePopupMenuItem(ScrollablePopupMenu parent,
                                              String text) {
            super(text);
            this.parent = parent;
            init();
        }

        /**
         * Initializes this item.
         */
        private void init() {
            this.setUI(BasicButtonUI.createUI(this));
            setBorder(BorderFactory.createEmptyBorder(5, 15, 5, 20));
            setMenuItemDefaultColors();
            this.setAlignmentX(JButton.LEFT_ALIGNMENT);
            setSelected(false);

            this.addMouseListener
                (new MouseAdapter() {

                     public void mouseEntered(MouseEvent e) {
                         if (DefaultScrollablePopupMenuItem.this.isEnabled()) {
                             setSelected(true);
                             parent.selectionChanged
                                 (DefaultScrollablePopupMenuItem.this, true);
                         }
                     }

                     public void mouseExited(MouseEvent e) {
                         if (DefaultScrollablePopupMenuItem.this.isEnabled()) {
                             setSelected(false);
                             parent.selectionChanged
                                (DefaultScrollablePopupMenuItem.this, false);
                         }
                     }

                     public void mouseClicked(MouseEvent e) {
                         parent.processItemClicked();
                     }
                 });
        }

        /**
         * Sets the default item colors.
         */
        private void setMenuItemDefaultColors() {
            setBackground(MENUITEM_BG_COLOR);
            setForeground(MENUITEM_FG_COLOR);
        }

        public void setSelected(boolean selected) {
            super.setSelected(selected);
            if (selected) {
                setBackground(MENU_HIGHLIGHT_BG_COLOR);
                setForeground(MENU_HIGHLIGHT_FG_COLOR);
            } else {
                setMenuItemDefaultColors();
            }
        }

        public String getText() {
            return super.getText();
        }

        public void setText(String text) {
            super.setText(text);
        }

        public void setEnabled(boolean b) {
            super.setEnabled(b);
        }
    }

    /**
     * The scrollable popup menu model.
     */
    public static interface ScrollablePopupMenuModel {

        /**
         * Gets the footer text for the ScrollablePopupMenu's footer item.
         * @return    the footer text.
         */
        String getFooterText();

        /**
         * Processes the click on the pop up menu item.
         */
        void processItemClicked();

        /**
         * Processes the showing of the pop up menu. Invoked before showing the
         * pop up menu
         */
        void processBeforeShowed();

        /**
         * Processes the showing of the pop up menu. Invoked after showing the
         * pop up menu
         */
        void processAfterShowed();
    }

    /**
     * The Scrollable Popup Menu Component.
     */
    public static class ScrollablePopupMenu extends JPopupMenu {

        /**
         * The resource file name.
         */
        private static final String RESOURCES =
            "org.apache.batik.util.gui.resources.ScrollablePopupMenuMessages";

        /**
         * The resource bundle.
         */
        private static ResourceBundle bundle;

        /**
         * The resource manager.
         */
        private static ResourceManager resources;
        static {
            bundle = ResourceBundle.getBundle(RESOURCES, Locale.getDefault());
            resources = new ResourceManager(bundle);
        }

        /**
         * The menu panel.
         */
        private JPanel menuPanel = new JPanel();

        /**
         * The scroll pane.
         */
        private JScrollPane scrollPane;

        /**
         * Max menu height.
         */
        private int preferredHeight = resources.getInteger("PreferredHeight");

        /**
         * The model for this component.
         */
        private ScrollablePopupMenuModel model;

        /**
         * The owner component.
         */
        private JComponent ownerComponent;

        /**
         * Footer item. Should be always shown at the bottom of this pop up.
         */
        private ScrollablePopupMenuItem footer;

        /**
         * Listeners list.
         */
        private EventListenerList eventListeners = new EventListenerList();

        /**
         * Constructor.
         *
         * @param owner
         *            The owner component
         */
        public ScrollablePopupMenu(JComponent owner) {
            super();
            this.setLayout(new BorderLayout());
            menuPanel.setLayout(new GridLayout(0, 1));
            ownerComponent = owner;
            init();
        }

        /**
         * Initializes this popup menu.
         */
        private void init() {
            super.removeAll();
            scrollPane = new JScrollPane();
            scrollPane.setViewportView(menuPanel);
            scrollPane.setBorder(null);
            int minWidth = resources.getInteger("ScrollPane.minWidth");
            int minHeight = resources.getInteger("ScrollPane.minHeight");
            int maxWidth = resources.getInteger("ScrollPane.maxWidth");
            int maxHeight = resources.getInteger("ScrollPane.maxHeight");
            scrollPane.setMinimumSize(new Dimension(minWidth, minHeight));
            scrollPane.setMaximumSize(new Dimension(maxWidth, maxHeight));
            scrollPane.setHorizontalScrollBarPolicy
                (ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
            add(scrollPane, BorderLayout.CENTER);
            addFooter(new DefaultScrollablePopupMenuItem(this, ""));
        }

        /**
         * Shows this popup menu.
         *
         * @param invoker
         *            The popup menu invoker component
         * @param refComponent
         *            The dropdown component that containts this menu
         */
        public void showMenu(Component invoker, Component refComponent) {
            model.processBeforeShowed();

            Point abs = new Point(0, refComponent.getHeight());
            SwingUtilities.convertPointToScreen(abs, refComponent);
            this.setLocation(abs);
            this.setInvoker(invoker);
            this.setVisible(true);
            this.revalidate();
            this.repaint();

            model.processAfterShowed();
        }

        /**
         * Adds the item to this component at the specified location.
         *
         * @param menuItem
         *            the item to add
         */
        public void add(ScrollablePopupMenuItem menuItem, int index,
                        int oldSize, int newSize) {
            menuPanel.add((Component) menuItem, index);
            if (oldSize == 0) {
                this.setEnabled(true);
            }
        }

        /**
         * Removes the item from this component.
         *
         * @param menuItem
         *            the item to remove
         */
        public void remove(ScrollablePopupMenuItem menuItem, int oldSize,
                           int newSize) {
            menuPanel.remove((Component) menuItem);
            if (newSize == 0) {
                this.setEnabled(false);
            }
        }

        /**
         * Gets the preferred width of this pop up menu.
         *
         * @return the preferred width
         */
        private int getPreferredWidth() {
            Component[] components = menuPanel.getComponents();
            int maxWidth = 0;
            for (int i = 0; i < components.length; i++) {
                int currentWidth = components[i].getPreferredSize().width;
                if (maxWidth < currentWidth) {
                    maxWidth = currentWidth;
                }
            }
            int footerWidth = ((Component) footer).getPreferredSize().width;
            if (footerWidth > maxWidth) {
                maxWidth = footerWidth;
            }
            int widthOffset = 30;
            return maxWidth + widthOffset;
        }

        /**
         * Gets the preferred height of this component.
         *
         * @return the preferred height
         */
        private int getPreferredHeight() {
            if (scrollPane.getPreferredSize().height < preferredHeight) {
                int heightOffset = 10;
                return scrollPane.getPreferredSize().height
                        + ((Component) footer).getPreferredSize().height
                        + heightOffset;
            }
            return preferredHeight
                    + ((Component) footer).getPreferredSize().height;
        }

        public Dimension getPreferredSize() {
            return new Dimension(getPreferredWidth(), getPreferredHeight());
        }

        /**
         * Invoked when item selection changes.
         */
        public void selectionChanged(ScrollablePopupMenuItem targetItem,
                boolean wasSelected) {
            Component[] comps = menuPanel.getComponents();
            int n = comps.length;
            // Deselect all if something was selected
            if (!wasSelected) {
                for (int i = n - 1; i >= 0; i--) {
                    ScrollablePopupMenuItem item = (ScrollablePopupMenuItem) comps[i];
                    item.setSelected(wasSelected);
                }
            } else {
                for (int i = 0; i < n; i++) {
                    ScrollablePopupMenuItem item = (ScrollablePopupMenuItem) comps[i];
                    if (item == targetItem) {
                        break;
                    }
                    item.setSelected(true);
                }
            }
            footer.setText(model.getFooterText() + getSelectedItemsCount());
            repaint();
        }

        /**
         * Sets the ScrollablePopupMenuModel.
         *
         * @param model
         *            the model to set
         */
        public void setModel(ScrollablePopupMenuModel model) {
            this.model = model;
            this.footer.setText(model.getFooterText());
        }

        /**
         * Gets the ScrollablePopupMenuModel
         *
         * @return the ScrollablePopupMenuModel model
         */
        public ScrollablePopupMenuModel getModel() {
            return model;
        }

        /**
         * Gets the number of the selected items.
         *
         * @return number of selected items
         */
        public int getSelectedItemsCount() {
            int selectionCount = 0;
            Component[] components = menuPanel.getComponents();
            for (int i = 0; i < components.length; i++) {
                ScrollablePopupMenuItem item = (ScrollablePopupMenuItem) components[i];
                if (item.isSelected()) {
                    selectionCount++;
                }
            }
            return selectionCount;
        }

        /**
         * Processes click on the pop up menu item.
         */
        public void processItemClicked() {
            footer.setText(model.getFooterText() + 0);
            setVisible(false);
            model.processItemClicked();
        }

        /**
         * Gets the owner component.
         * @return    the owner component
         */
        public JComponent getOwner() {
            return ownerComponent;
        }

        /**
         * Adds the footer item to this pop up menu.
         */
        private void addFooter(ScrollablePopupMenuItem footer) {
            this.footer = footer;
            this.footer.setEnabled(false);
            add((Component)this.footer, BorderLayout.SOUTH);
        }

        /**
         * Gets the footer item.
         * @return    the footer
         */
        public ScrollablePopupMenuItem getFooter() {
            return footer;
        }

        /**
         * Adds the listener to the listener list.
         *
         * @param listener
         *            The listener to add
         */
        public void addListener(ScrollablePopupMenuListener listener) {
            eventListeners.add(ScrollablePopupMenuListener.class, listener);
        }

        /**
         * Fires the itemsWereAdded event, when the items are added to this pop
         * up menu.
         *
         * @param event
         *            The associated ScrollablePopupMenuEvent event
         */
        public void fireItemsWereAdded(ScrollablePopupMenuEvent event) {
            Object[] listeners = eventListeners.getListenerList();
            int length = listeners.length;
            for (int i = 0; i < length; i += 2) {
                if (listeners[i] == ScrollablePopupMenuListener.class) {
                    ((ScrollablePopupMenuListener) listeners[i + 1])
                            .itemsWereAdded(event);
                }
            }
        }

        /**
         * Fires the itemsWereRemove event, when the items are removed from this
         * pop up menu.
         *
         * @param event
         *            The associated ScrollablePopupMenuEvent event
         */
        public void fireItemsWereRemoved(ScrollablePopupMenuEvent event) {
            Object[] listeners = eventListeners.getListenerList();
            int length = listeners.length;
            for (int i = 0; i < length; i += 2) {
                if (listeners[i] == ScrollablePopupMenuListener.class) {
                    ((ScrollablePopupMenuListener) listeners[i + 1])
                            .itemsWereRemoved(event);
                }
            }
        }
    }

    // Custom event support for ScrollablePopupMenu

    /**
     * Event to pass to listener.
     */
    public static class ScrollablePopupMenuEvent extends EventObject {

        // The codes for the event type
        public static final int ITEMS_ADDED = 1;
        public static final int ITEMS_REMOVED = 2;

        /**
         * The event type.
         */
        private int type;

        /**
         * The number of items that were added / removed.
         */
        private int itemNumber;

        /**
         * The details about the event.
         */
        private String details;

        /**
         * Creates the ScrollablePopupMenuEvent.
         *
         * @param source
         *            The source component
         * @param type
         *            The event type
         * @param itemNumber
         *            The item number
         * @param details
         *            The event details
         */
        public ScrollablePopupMenuEvent(Object source, int type,
                                        int itemNumber, String details) {
            super(source);
            initEvent(type, itemNumber, details);
        }

        /**
         * Initializes this event.
         */
        public void initEvent(int type, int itemNumber, String details) {
            this.type = type;
            this.itemNumber = itemNumber;
            this.details = details;
        }

        /**
         * Gets the event details.
         *
         * @return the details
         */
        public String getDetails() {
            return details;
        }

        /**
         * Gets the item number.
         *
         * @return the item number
         */
        public int getItemNumber() {
            return itemNumber;
        }

        /**
         * Gets the event type.
         *
         * @return the type
         */
        public int getType() {
            return type;
        }
    }

    /**
     * The ScrollablePopupMenu listener. Handles the events that
     * ScrollablePopupMenu fires
     */
    public static interface ScrollablePopupMenuListener extends EventListener {

        /**
         * Handles the 'itemsWereAdded' event.
         *
         * @param ev
         *            The associated event
         */
        void itemsWereAdded(ScrollablePopupMenuEvent ev);

        /**
         * Handles the 'itemsWereRemoved' event.
         *
         * @param ev
         *            The associated event
         */
        void itemsWereRemoved(ScrollablePopupMenuEvent ev);
    }

    /**
     * The adapter for the ScrollablePopupMenuListener.
     */
    public static class ScrollablePopupMenuAdapter
            implements ScrollablePopupMenuListener {

        public void itemsWereAdded(ScrollablePopupMenuEvent ev) {
        }

        public void itemsWereRemoved(ScrollablePopupMenuEvent ev) {
        }
    }
}


text:
package com.sequenceiq.cloudbreak.user;

import static org.junit.Assert.assertNotNull;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import java.util.Optional;
import java.util.function.Supplier;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Spy;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.junit.MockitoJUnitRunner;
import org.mockito.stubbing.Answer;

import com.google.common.collect.Sets;
import com.sequenceiq.cloudbreak.auth.CrnUser;
import com.sequenceiq.cloudbreak.common.service.TransactionService;
import com.sequenceiq.cloudbreak.common.service.TransactionService.TransactionExecutionException;
import com.sequenceiq.cloudbreak.common.service.TransactionService.TransactionRuntimeExecutionException;
import com.sequenceiq.cloudbreak.common.user.CloudbreakUser;
import com.sequenceiq.cloudbreak.service.tenant.TenantService;
import com.sequenceiq.cloudbreak.service.user.CachedUserService;
import com.sequenceiq.cloudbreak.service.user.UserService;
import com.sequenceiq.cloudbreak.service.workspace.WorkspaceService;
import com.sequenceiq.cloudbreak.structuredevent.CloudbreakRestRequestThreadLocalService;
import com.sequenceiq.cloudbreak.workspace.model.Tenant;
import com.sequenceiq.cloudbreak.workspace.model.User;
import com.sequenceiq.cloudbreak.workspace.model.Workspace;
import com.sequenceiq.cloudbreak.workspace.repository.workspace.UserRepository;

@RunWith(MockitoJUnitRunner.class)
public class UserServiceTest {

    @Mock
    private TenantService tenantService;

    @Mock
    private WorkspaceService workspaceService;

    @Mock
    private UserRepository userRepository;

    @Spy
    private CachedUserService cachedUserService = new CachedUserService();

    @Spy
    private TransactionService transactionService = new TransactionService();

    @Mock
    private CloudbreakRestRequestThreadLocalService restRequestThreadLocalService;

    @InjectMocks
    private UserService underTest;

    @Test
    public void testCreateUser() throws TransactionExecutionException {
        doAnswer(invocation -> ((Supplier<?>) invocation.getArgument(0)).get()).when(transactionService).requiresNew(any());
        when(userRepository.findByTenantNameAndUserId(anyString(), anyString())).thenReturn(Optional.empty());
        when(tenantService.findByName(anyString())).thenReturn(Optional.empty());
        when(tenantService.save(any())).thenReturn(createTenant());
        when(workspaceService.create(any())).thenReturn(createWorkspace());
        when(userRepository.save(any())).thenReturn(createUser());

        User user = underTest.getOrCreate(createCbUser());

        assertNotNull(user);
        verify(cachedUserService, times(1)).getUser(any(), any(), any());
        verify(workspaceService, times(1)).create(any());
        verify(tenantService, times(1)).save(any());
    }

    @Test
    public void testCreateUserWithDuplicateException() throws TransactionExecutionException {
        doAnswer(invocation -> ((Supplier<?>) invocation.getArgument(0)).get()).when(transactionService).requiresNew(any());
        when(tenantService.findByName(anyString())).thenReturn(Optional.empty());
        when(tenantService.save(any())).thenReturn(createTenant());
        when(workspaceService.create(any())).thenReturn(createWorkspace());

        when(userRepository.findByTenantNameAndUserId(anyString(), anyString())).thenAnswer(new Answer() {
            private int count;

            public Object answer(InvocationOnMock invocation) {
                if (count++ == 0) {
                    return Optional.empty();
                }
                return Optional.of(createUser());
            }
        });

        when(userRepository.save(any())).thenAnswer(new Answer() {
            private int count;

            public Object answer(InvocationOnMock invocation) {
                if (count++ == 0) {
                    TransactionExecutionException exception = new TransactionExecutionException("", new RuntimeException("User already exists!"));
                    throw new TransactionRuntimeExecutionException(exception);
                }
                TransactionExecutionException exception = new TransactionExecutionException("", new RuntimeException("This is not expected to run"));
                throw new TransactionRuntimeExecutionException(exception);
            }
        });

        User user = underTest.getOrCreate(createCbUser());

        assertNotNull(user);
        verify(cachedUserService, times(1)).getUser(any(), any(), any());
        verify(workspaceService, times(1)).create(any());
        verify(tenantService, times(1)).save(any());
    }

    @Test
    public void testPersistModifiedInternalUser() throws TransactionExecutionException {
        doAnswer(invocation -> ((Supplier<?>) invocation.getArgument(0)).get()).when(transactionService).requiresNew(any());
        when(userRepository.findByTenantNameAndUserId(anyString(), anyString())).thenReturn(Optional.empty());
        when(tenantService.findByName(anyString())).thenReturn(Optional.empty());
        when(tenantService.save(any())).thenReturn(createTenant());
        when(workspaceService.create(any())).thenReturn(createWorkspace());
        when(userRepository.save(any())).thenReturn(createUser());
        doNothing().when(restRequestThreadLocalService).setCloudbreakUser(any());

        CrnUser cbUser = createCrnUser();
        underTest.persistModifiedInternalUser(cbUser);

        assertNotNull(cbUser);
        verify(cachedUserService, times(1)).getUser(any(), any(), any());
        verify(workspaceService, times(1)).create(any());
        verify(tenantService, times(1)).save(any());
        verify(restRequestThreadLocalService, times(1)).setCloudbreakUser(eq(cbUser));
    }

    private User createUser() {
        User user = new User();
        user.setTenant(createTenant());
        user.setUserId("userId");
        user.setUserName("userName");
        user.setUserCrn("crn:cdp:iam:us-west-1:tenantName:user:userName");
        return user;
    }

    private Workspace createWorkspace() {
        return new Workspace();
    }

    private Tenant createTenant() {
        Tenant tenant = new Tenant();
        tenant.setName("tenantName");
        tenant.setWorkspaces(Sets.newHashSet(createWorkspace()));
        return tenant;
    }

    private CloudbreakUser createCbUser() {
        return new CloudbreakUser("userId", "crn:cdp:iam:us-west-1:tenantName:user:userName",
                "userName", "email@email.com", "tenantName");
    }

    private CrnUser createCrnUser() {
        return new CrnUser("userId", "crn:cdp:iam:us-west-1:tenantName:user:userName",
                "userName", "email@email.com", "tenantName", "role");
    }

}


text:
[org.apache.struts.taglib.html.md](../../../../../org/apache/struts/taglib/html/package-summary.html)
|---------------------------------------------------------------------------|
| Classes
  [TestHtmlTag](TestHtmlTag.html.md "class in org.apache.struts.taglib.html")  |


text:
@interface SideChannelDataLeakageVC : UIViewController

@end


text:
(function ($, w) {
    "use strict";

    var methods = (function () {
        // private properties and methods go here
        var c = {
                bcClass: 'sf-breadcrumb',
                menuClass: 'sf-js-enabled',
                anchorClass: 'sf-with-ul',
                menuArrowClass: 'sf-arrows'
            },
            ios = (function () {
                var ios = /^(?![\w\W]*Windows Phone)[\w\W]*(iPhone|iPad|iPod)/i.test(navigator.userAgent);
                if (ios) {
                    // tap anywhere on iOS to unfocus a submenu
                    $('html').css('cursor', 'pointer').on('click', $.noop);
                }
                return ios;
            })(),
            wp7 = (function () {
                var style = document.documentElement.style;
                return ('behavior' in style && 'fill' in style && /iemobile/i.test(navigator.userAgent));
            })(),
            unprefixedPointerEvents = (function () {
                return (!!w.PointerEvent);
            })(),
            toggleMenuClasses = function ($menu, o, add) {
                var classes = c.menuClass,
                    method;
                if (o.cssArrows) {
                    classes += ' ' + c.menuArrowClass;
                }
                method = (add) ? 'addClass' : 'removeClass';
                $menu[method](classes);
            },
            setPathToCurrent = function ($menu, o) {
                return $menu.find('li.' + o.pathClass).slice(0, o.pathLevels)
                    .addClass(o.hoverClass + ' ' + c.bcClass)
                    .filter(function () {
                        return ($(this).children(o.popUpSelector).hide().show().length);
                    }).removeClass(o.pathClass);
            },
            toggleAnchorClass = function ($li, add) {
                var method = (add) ? 'addClass' : 'removeClass';
                $li.children('a')[method](c.anchorClass);
            },
            toggleTouchAction = function ($menu) {
                var msTouchAction = $menu.css('ms-touch-action');
                var touchAction = $menu.css('touch-action');
                touchAction = touchAction || msTouchAction;
                touchAction = (touchAction === 'pan-y') ? 'auto' : 'pan-y';
                $menu.css({
                    'ms-touch-action': touchAction,
                    'touch-action': touchAction
                });
            },
            getMenu = function ($el) {
                return $el.closest('.' + c.menuClass);
            },
            getOptions = function ($el) {
                return getMenu($el).data('sfOptions');
            },
            over = function () {
                var $this = $(this),
                    o = getOptions($this);
                clearTimeout(o.sfTimer);
                $this.siblings().superfish('hide').end().superfish('show');
            },
            close = function (o) {
                o.retainPath = ($.inArray(this[0], o.$path) > -1);
                this.superfish('hide');

                if (!this.parents('.' + o.hoverClass).length) {
                    o.onIdle.call(getMenu(this));
                    if (o.$path.length) {
                        $.proxy(over, o.$path)();
                    }
                }
            },
            out = function () {
                var $this = $(this),
                    o = getOptions($this);
                if (ios) {
                    $.proxy(close, $this, o)();
                }
                else {
                    clearTimeout(o.sfTimer);
                    o.sfTimer = setTimeout($.proxy(close, $this, o), o.delay);
                }
            },
            touchHandler = function (e) {
                var $this = $(this),
                    o = getOptions($this),
                    $ul = $this.siblings(e.data.popUpSelector);

                if (o.onHandleTouch.call($ul) === false) {
                    return this;
                }

                if ($ul.length > 0 && $ul.is(':hidden')) {
                    $this.one('click.superfish', false);
                    if (e.type === 'MSPointerDown' || e.type === 'pointerdown') {
                        $this.trigger('focus');
                    } else {
                        $.proxy(over, $this.parent('li'))();
                    }
                }
            },
            applyHandlers = function ($menu, o) {
                var targets = 'li:has(' + o.popUpSelector + ')';
                if ($.fn.hoverIntent && !o.disableHI) {
                    $menu.hoverIntent(over, out, targets);
                }
                else {
                    $menu
                        .on('mouseenter.superfish', targets, over)
                        .on('mouseleave.superfish', targets, out);
                }
                var touchevent = 'MSPointerDown.superfish';
                if (unprefixedPointerEvents) {
                    touchevent = 'pointerdown.superfish';
                }
                if (!ios) {
                    touchevent += ' touchend.superfish';
                }
                if (wp7) {
                    touchevent += ' mousedown.superfish';
                }
                $menu
                    .on('focusin.superfish', 'li', over)
                    .on('focusout.superfish', 'li', out)
                    .on(touchevent, 'a', o, touchHandler);
            };

        return {
            // public methods
            hide: function (instant) {
                if (this.length) {
                    var $this = this,
                        o = getOptions($this);
                    if (!o) {
                        return this;
                    }
                    var not = (o.retainPath === true) ? o.$path : '',
                        $ul = $this.find('li.' + o.hoverClass).add(this).not(not).removeClass(o.hoverClass).children(o.popUpSelector),
                        speed = o.speedOut;

                    if (instant) {
                        $ul.show();
                        speed = 0;
                    }
                    o.retainPath = false;

                    if (o.onBeforeHide.call($ul) === false) {
                        return this;
                    }

                    $ul.stop(true, true).animate(o.animationOut, speed, function () {
                        var $this = $(this);
                        o.onHide.call($this);
                    });
                }
                return this;
            },
            show: function () {
                var o = getOptions(this);
                if (!o) {
                    return this;
                }
                var $this = this.addClass(o.hoverClass),
                    $ul = $this.children(o.popUpSelector);

                if (o.onBeforeShow.call($ul) === false) {
                    return this;
                }

                $ul.stop(true, true).animate(o.animation, o.speed, function () {
                    o.onShow.call($ul);
                });
                return this;
            },
            destroy: function () {
                return this.each(function () {
                    var $this = $(this),
                        o = $this.data('sfOptions'),
                        $hasPopUp;
                    if (!o) {
                        return false;
                    }
                    $hasPopUp = $this.find(o.popUpSelector).parent('li');
                    clearTimeout(o.sfTimer);
                    toggleMenuClasses($this, o);
                    toggleAnchorClass($hasPopUp);
                    toggleTouchAction($this);
                    // remove event handlers
                    $this.off('.superfish').off('.hoverIntent');
                    // clear animation's inline display style
                    $hasPopUp.children(o.popUpSelector).attr('style', function (i, style) {
                        return style.replace(/display[^;]+;?/g, '');
                    });
                    // reset 'current' path classes
                    o.$path.removeClass(o.hoverClass + ' ' + c.bcClass).addClass(o.pathClass);
                    $this.find('.' + o.hoverClass).removeClass(o.hoverClass);
                    o.onDestroy.call($this);
                    $this.removeData('sfOptions');
                });
            },
            init: function (op) {
                return this.each(function () {
                    var $this = $(this);
                    if ($this.data('sfOptions')) {
                        return false;
                    }
                    var o = $.extend({}, $.fn.superfish.defaults, op),
                        $hasPopUp = $this.find(o.popUpSelector).parent('li');
                    o.$path = setPathToCurrent($this, o);

                    $this.data('sfOptions', o);

                    toggleMenuClasses($this, o, true);
                    toggleAnchorClass($hasPopUp, true);
                    toggleTouchAction($this);
                    applyHandlers($this, o);

                    $hasPopUp.not('.' + c.bcClass).superfish('hide', true);

                    o.onInit.call(this);
                });
            }
        };
    })();

    $.fn.superfish = function (method, args) {
        if (methods[method]) {
            return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
        }
        else if (typeof method === 'object' || ! method) {
            return methods.init.apply(this, arguments);
        }
        else {
            return $.error('Method ' +  method + ' does not exist on jQuery.fn.superfish');
        }
    };

    $.fn.superfish.defaults = {
        popUpSelector: 'ul,.sf-mega', // within menu context
        hoverClass: 'sfHover',
        pathClass: 'overrideThisToUse',
        pathLevels: 1,
        delay: 800,
        animation: {opacity: 'show'},
        animationOut: {opacity: 'hide'},
        speed: 'normal',
        speedOut: 'fast',
        cssArrows: true,
        disableHI: false,
        onInit: $.noop,
        onBeforeShow: $.noop,
        onShow: $.noop,
        onBeforeHide: $.noop,
        onHide: $.noop,
        onIdle: $.noop,
        onDestroy: $.noop,
        onHandleTouch: $.noop
    };

})(jQuery, window);


text:
.class Landroid/accessibilityservice/IEventListener$Stub$Proxy;
.super Ljava/lang/Object;
.source "IEventListener.java"

# interfaces
.implements Landroid/accessibilityservice/IEventListener;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/accessibilityservice/IEventListener$Stub;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0xa
    name = "Proxy"
.end annotation

# instance fields
.field private mRemote:Landroid/os/IBinder;

# direct methods
.method constructor <init>(Landroid/os/IBinder;)V
    .locals 0
    .parameter "remote"

    .prologue
    .line 86
    invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V

    .line 87
    iput-object p1, p0, Landroid/accessibilityservice/IEventListener$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    .line 88
    return-void
.end method

# virtual methods
.method public asBinder()Landroid/os/IBinder;
    .locals 1

    .prologue
    .line 91
    iget-object v0, p0, Landroid/accessibilityservice/IEventListener$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    return-object v0
.end method

.method public getInterfaceDescriptor()Ljava/lang/String;
    .locals 1

    .prologue
    .line 95
    const-string v0, "android.accessibilityservice.IEventListener"

    return-object v0
.end method

.method public onAccessibilityEvent(Landroid/view/accessibility/AccessibilityEvent;)V
    .locals 5
    .parameter "event"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    .line 112
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v0

    .line 114
    .local v0, _data:Landroid/os/Parcel;
    :try_start_0
    const-string v1, "android.accessibilityservice.IEventListener"

    invoke-virtual {v0, v1}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    .line 115
    if-eqz p1, :cond_0

    .line 116
    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Landroid/os/Parcel;->writeInt(I)V

    .line 117
    const/4 v1, 0x0

    invoke-virtual {p1, v0, v1}, Landroid/view/accessibility/AccessibilityEvent;->writeToParcel(Landroid/os/Parcel;I)V

    .line 122
    :goto_0
    iget-object v1, p0, Landroid/accessibilityservice/IEventListener$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    const/4 v2, 0x2

    const/4 v3, 0x0

    const/4 v4, 0x1

    invoke-interface {v1, v2, v0, v3, v4}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 125
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    .line 127
    return-void

    .line 120
    :cond_0
    const/4 v1, 0x0

    :try_start_1
    invoke-virtual {v0, v1}, Landroid/os/Parcel;->writeInt(I)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    .line 125
    :catchall_0
    move-exception v1

    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    throw v1
.end method

.method public onInterrupt()V
    .locals 5
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    .line 130
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v0

    .line 132
    .local v0, _data:Landroid/os/Parcel;
    :try_start_0
    const-string v1, "android.accessibilityservice.IEventListener"

    invoke-virtual {v0, v1}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    .line 133
    iget-object v1, p0, Landroid/accessibilityservice/IEventListener$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    const/4 v2, 0x3

    const/4 v3, 0x0

    const/4 v4, 0x1

    invoke-interface {v1, v2, v0, v3, v4}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 136
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    .line 138
    return-void

    .line 136
    :catchall_0
    move-exception v1

    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    throw v1
.end method

.method public setConnection(Landroid/accessibilityservice/IAccessibilityServiceConnection;I)V
    .locals 5
    .parameter "connection"
    .parameter "connectionId"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    const/4 v1, 0x0

    .line 99
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v0

    .line 101
    .local v0, _data:Landroid/os/Parcel;
    :try_start_0
    const-string v2, "android.accessibilityservice.IEventListener"

    invoke-virtual {v0, v2}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    .line 102
    if-eqz p1, :cond_0

    invoke-interface {p1}, Landroid/accessibilityservice/IAccessibilityServiceConnection;->asBinder()Landroid/os/IBinder;

    move-result-object v1

    :cond_0
    invoke-virtual {v0, v1}, Landroid/os/Parcel;->writeStrongBinder(Landroid/os/IBinder;)V

    .line 103
    invoke-virtual {v0, p2}, Landroid/os/Parcel;->writeInt(I)V

    .line 104
    iget-object v1, p0, Landroid/accessibilityservice/IEventListener$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    const/4 v2, 0x1

    const/4 v3, 0x0

    const/4 v4, 0x1

    invoke-interface {v1, v2, v0, v3, v4}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 107
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    .line 109
    return-void

    .line 107
    :catchall_0
    move-exception v1

    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    throw v1
.end method


text:
set -e

# Create the cluster.yml
if [ -z $TENSORFLOW_SERVING_CLUSTER_CONFIG ]; then
  echo "TENSORFLOW_SERVING_CLUSTER_CONFIG is missing"
  exit 1
fi
mkdir -p /opt
echo ${TENSORFLOW_SERVING_CLUSTER_CONFIG} > /opt/cluster.yml.base64
base64 -d /opt/cluster.yml.base64 > /opt/cluster.yml

# Start the proxy server
set -x
python -m tensorflow_serving_cluster.proxy_app /opt/cluster.yml


text:
Adds support for `routing_key` to be supplied for `ElasticSearchFramework::IndexAlias#<get|put|delete>_item` to define a custom routing key when reading or writing index documents.

Adds support for `routing_key` to be supplied for `ElasticSearchFramework::ShardedIndex#<get|put|delete>_item` to define a custom routing key when reading or writing index documents.

**IMPORTANT** Default routing behaviour remains unless both a `routing_key` is supplied in the request, and the index class inherits from `ElasticSearchFramework::ShardedIndex`. `ElasticSearchFramework::Index` subclasses will not receive this update.

See [documentation](https://www.elastic.co/blog/customizing-your-document-routing) for more information.

## v2.3.1
Adds support for `op_type` to be supplied for `ElasticSearchFramework::Index#put_item` to allow control of PUT behaviour in create scenarios.
Adds support for `op_type` to be supplied for `ElasticSearchFramework::IndexAlias#put_item` to allow control of PUT behaviour in create scenarios.
See [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-index_.html#operation-type) for more information and accepted values.

## v2.3.0
Adds support for `op_type` to be supplied for `ElasticSearchFramework::Repository#set` to allow control of PUT behaviour in create scenarios.
See [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-index_.html#operation-type) for more information and accepted values.

## v2.2.0
Adds index alias support.

## v2.1.0
Ensures that the read timeout is set to either the value of `ENV['CONNECTION_READ_TIMEOUT']` or `5` as a default.
Previously this was being set to the value of `ENV['CONNECTION_OPEN_TIMEOUT']` or `1` as a default.

## v2.0.1
The settings method when passed multiple times it was replacing the key value instead of building a hash of data within the name / type keys.

## v2.0.0
### Breaking change

The index method no longer accepts shards as a parameter.
This change follows the implementation of a new settings method allowing you to pass any number of settings objects to build out the index.

Where the index method is currently being used as follows
```
index name: 'index_name', shards: 1
```

This should now look as follows.
```
index name 'index_name'
settings name: :number_of_shards, value: 1
```

## v1.4.0
* Resolve JSON query to work with ES6 by adding the request content type.
* Make the mapping method more flexible to allow more than just type and index to be passed for the mapping parameters/options.

## v1.3.0
* 1.3.0 was pushed and yanked from gem server.
* Code did contain: Resolve JSON query to work with ES6 by adding the request content type.

## v1.2.0
* Added a json_query method to provide the ability to query ElasticSearch with a json object.

## v1.1.0

* Fix the eq and contains? queries.
The contains? method. This was doing the same thing as the eq method. Added the wildcard symbols to match the queries we were running using kibana.
The condition type. I've updated this to always do `value.to_s` as ES accepts a String value in the query for searches.

## v1.0.0

* Support Elasticsearch v6.2.x. See https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes-6.0.html for more info.

Note: Contains breaking changes to the mapping API:

```ruby
mapping name: 'default', field: :name, type: :string, analyser: :not_analyzed
```

must be changed to use the new format:

```ruby
mapping name: 'default', field: :name, type: :keyword, index: true
```

## v0.2.4

* Bugfix to catch and surpress index already exists error.


text:
#include "taiseigl.h"

#ifdef __WIN32__
// #include <GL/wgl.h>
#else
#include <GL/glx.h>
#endif

#include <string.h>
#include <stdio.h>

int tgl_ext[_TGLEXT_COUNT];

typedef void (*GLFuncPtr)(void);
GLFuncPtr get_proc_address(char *name) {
#ifdef __WIN32__
	return (GLFuncPtr)wglGetProcAddress(name);
#else
	return glXGetProcAddress((GLubyte *)name);
#endif
}

void check_gl_extensions(void) {
	int l;
	char *ext = (char*)glGetString(GL_EXTENSIONS);
	char *last, *pos;

	last = ext;
	pos = ext;
	while((pos = strchr(pos, ' '))) {
		pos++;

		l = pos - last - 1;

		if(strncmp(last, "GL_EXT_draw_instanced", l) == 0)
			tgl_ext[TGLEXT_draw_instanced] = 1;

		last = pos;
	}
}

void load_gl_functions(void) {
#ifdef __WIN32__
	glActiveTexture = (PFNGLACTIVETEXTUREPROC)get_proc_address("glActiveTexture");
	glBlendEquation = (PFNGLBLENDEQUATIONPROC)get_proc_address("glBlendEquation");
#endif

	glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)get_proc_address("glBlendFuncSeparate");
	glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)get_proc_address("glDrawArraysInstanced");

	glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)get_proc_address("glBindFramebuffer");
	glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)get_proc_address("glGenFramebuffers");
	glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)get_proc_address("glFramebufferTexture2D");
	glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)get_proc_address("glDeleteFramebuffers");

	glGenBuffers = (PFNGLGENBUFFERSPROC)get_proc_address("glGenBuffers");
	glBindBuffer = (PFNGLBINDBUFFERPROC)get_proc_address("glBindBuffer");
	glBufferData = (PFNGLBUFFERDATAPROC)get_proc_address("glBufferData");
	glBufferSubData = (PFNGLBUFFERSUBDATAPROC)get_proc_address("glBufferSubData");
	glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)get_proc_address("glDeleteBuffers");

	glCreateProgram = (PFNGLCREATEPROGRAMPROC)get_proc_address("glCreateProgram");
	glLinkProgram = (PFNGLLINKPROGRAMPROC)get_proc_address("glLinkProgram");
	glUseProgram = (PFNGLUSEPROGRAMPROC)get_proc_address("glUseProgram");
	glGetProgramiv = (PFNGLGETPROGRAMIVPROC)get_proc_address("glGetProgramiv");
	glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)get_proc_address("glGetProgramInfoLog");
	glDeleteProgram = (PFNGLDELETEPROGRAMPROC)get_proc_address("glDeleteProgram");

	glCreateShader = (PFNGLCREATESHADERPROC)get_proc_address("glCreateShader");
	glGetShaderiv = (PFNGLGETSHADERIVPROC)get_proc_address("glGetShaderiv");
	glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)get_proc_address("glGetShaderInfoLog");
	glShaderSource = (PFNGLSHADERSOURCEPROC)get_proc_address("glShaderSource");
	glCompileShader = (PFNGLCOMPILESHADERPROC)get_proc_address("glCompileShader");
	glAttachShader = (PFNGLATTACHSHADERPROC)get_proc_address("glAttachShader");
	glDeleteShader = (PFNGLDELETESHADERPROC)get_proc_address("glDeleteShader");

	glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)get_proc_address("glGetActiveUniform");
	glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)get_proc_address("glGetUniformLocation");

	glUniform1f = (PFNGLUNIFORM1FPROC)get_proc_address("glUniform1f");
	glUniform2f = (PFNGLUNIFORM2FPROC)get_proc_address("glUniform2f");
	glUniform3f = (PFNGLUNIFORM3FPROC)get_proc_address("glUniform3f");
	glUniform4f = (PFNGLUNIFORM4FPROC)get_proc_address("glUniform4f");

	glUniform1i = (PFNGLUNIFORM1IPROC)get_proc_address("glUniform1i");
	glUniform2i = (PFNGLUNIFORM2IPROC)get_proc_address("glUniform2i");
	glUniform3i = (PFNGLUNIFORM3IPROC)get_proc_address("glUniform3i");
	glUniform4i = (PFNGLUNIFORM4IPROC)get_proc_address("glUniform4i");

	glUniform2fv = (PFNGLUNIFORM2FVPROC)get_proc_address("glUniform2fv");
	glUniform3fv = (PFNGLUNIFORM3FVPROC)get_proc_address("glUniform3fv");
	glUniform4fv = (PFNGLUNIFORM4FVPROC)get_proc_address("glUniform4fv");
}


text:
<?php

namespace App\Observers;
use App\Category;
use App\Action;

class CategoryObserver extends Observer
{

    public function updated(Category $category)
    {
        Action::create([
            'desc' => '(' .$category->name. ') kategorisi güncellendi',
            'user_id' => $this->profile->id,
            'icon' => 'icon-menu'
        ]);
    }

    public function deleted(Category $category)
    {
        Action::create([
            'desc' => '(' .$category->name. ') kategorisi silindi',
            'user_id' => $this->profile->id,
            'icon' => 'icon-folder-remove'
        ]);
    }

}


text:
     business  Organization List

     keyboard_arrow_right
     keyboard_arrow_right

    {{ selectedOrg.name }}

     keyboard_arrow_right
     keyboard_arrow_right

    {{report.name}}

Report Information

        Name: {{ report.name }}

        Organization: {{ selectedOrg.name }}

        Date:  {{ report.created_at | date }}

        Datastudio Link:  {{ report.link }}

    <mat-spinner></mat-spinner>

Loading...

      <app-error-message [errorMessage]="errorMessage" (tryAgain)="reInitialize()"></app-error-message>