text:
class Bairro < ActiveRecord::Base
  belongs_to :cidade
  has_many :locais
  #set_default_order "name ASC"

  #============================================================#
  #                        VALIDATIONS                         #
  #============================================================#
  validates_presence_of :nome, :cidade_id

  #============================================================#
  #                         NAMED Scopes                       #
  #============================================================#
  named_scope :da_cidade, lambda { |cidade_id|
    if cidade_id.blank?
      { }
    else
      { :conditions => [ "bairros.cidade_id = ?", cidade_id ],
        :order => "bairros.nome ASC" }
    end
  }
  named_scope :com_nome, lambda { |nome|
    if nome.blank?
      {}
    else
      {
        :conditions => [ "bairros.nome LIKE ?", '%' + nome + '%' ]
      }
    end
  }
  named_scope :com_topicos_do_contexto, lambda { |options|
    condicoes = []
    condicoes << "1=1"
    condicoes << "taggings.tag_id = #{options[:tag].id}" if options[:tag]
    condicoes << "topicos.created_at >= '#{options[:ultimos_dias].to_i.days.ago.to_s(:db)}'" if options[:ultimos_dias]
    condicoes << "topicos.type = '#{options[:topico_type].singularize.camelize}'" if options[:topico_type] and (options[:topico_type]!="topicos")
    condicoes << "users.type = '#{options[:user_type].singularize.camelize}'" if options[:user_type] and (options[:user_type]!="usuarios")

    sql_string = <<MYSTRING.gsub(/\s+|\t+/, " ").strip
    SELECT a.bairro_id, count(*) as total
    FROM (
      SELECT DISTINCT topicos.id, locais.bairro_id
      FROM locais JOIN topicos JOIN users JOIN taggings
      ON (locais.responsavel_type = 'Topico') AND
         (locais.responsavel_id = topicos.id) AND
         (taggings.taggable_type = 'Topico') AND
         (taggings.taggable_id = topicos.id) AND
         (topicos.user_id = users.id)
      WHERE #{condicoes.join(' AND ')}
    ) a GROUP BY a.bairro_id
MYSTRING
    {
      :joins => "JOIN (#{sql_string}) z ON (bairros.id = z.bairro_id)",
      :select => "bairros.*, z.total",
      :conditions => "z.total > 0"
    }
  }

  named_scope :com_usuarios_do_contexto, lambda { |options|
    condicoes = []
    condicoes << "1=1"
    condicoes << "users.type = '#{options[:user_type].singularize.camelize}'" if options[:user_type] and (options[:user_type]!="usuarios")

    sql_string = <<MYSTRING.gsub(/\s+|\t+/, " ").strip
    SELECT a.bairro_id, count(*) as total
    FROM (
      SELECT DISTINCT users.id, locais.bairro_id
      FROM locais JOIN users
      ON (locais.responsavel_id = users.id) AND
         (locais.responsavel_type = 'User')
      WHERE #{condicoes.join(' AND ')}
    ) a GROUP BY a.bairro_id
MYSTRING
    {
      :joins => "JOIN (#{sql_string}) z ON (bairros.id = z.bairro_id)",
      :select => "bairros.*, z.total",
      :conditions => "z.total > 0"
    }
  }

  #============================================================#
  #                          CLASS Methods                     #
  #============================================================#

  # Faz a busca pelos bairros mais "ativos"
  def self.mais_ativos(options={})
    options = {
      :limit => 50,
      :order => "total DESC",
      :cidade => nil # Caso venha uma cidade, usá-la na query
    }.merge!(options)

    if options[:cidade]
      join_str  = "JOIN locais ON (locais.bairro_id = bairros.id) AND " +
                  "               (locais.responsavel_type = 'Topico') AND " +
                  "               (locais.cidade_id = #{options[:cidade].id}) " +
                  "JOIN topicos ON (locais.responsavel_id = topicos.id) "
    else
      join_str =  "JOIN locais ON (locais.bairro_id = bairros.id) AND " +
                  "               (locais.responsavel_type = 'Topico') " +
                  "JOIN topicos ON (locais.responsavel_id = topicos.id) "
    end

    find(:all,
         :select => " bairros.*, COUNT(*) AS total",
         :conditions => [],
         :joins => join_str,
         :group => "bairros.id",
         :limit => options[:limit],
         :order => options[:order])
  end

  # Lista de bairros (de uma dada cidade),
  # com counts( = total!) de problemas/propostas
  def self.de_topicos(cidade_id, options = {})
    # Strings a parte...
    sql_string_topico_type = options[:topico_type].nil? ? "" : " AND topicos.type = '#{options[:topico_type].to_s.singularize.camelize}' "
    sql_string_user_type = options[:user_type].nil? ? "" : " AND users.type = '#{options[:user_type].to_s.singularize.camelize}' "
    sql_string_date = options[:ultimos_dias].nil? ? "" : " AND topicos.created_at >= '#{options[:ultimos_dias].to_i.days.ago.to_s(:db)}' "

    sql_string = <<MYSTRING.gsub(/\s+/, " ").strip
    SELECT b.id, b.nome, a.total FROM bairros b INNER JOIN (
      SELECT l.bairro_id, count(*) AS total FROM locais l
        WHERE l.cidade_id = #{cidade_id}
        AND l.responsavel_type = 'Topico'
        AND l.responsavel_id IN (
          SELECT topicos.id
          FROM topicos JOIN users
          ON (topicos.user_id = users.id)
          WHERE topicos.id > 0
          #{sql_string_topico_type}
          #{sql_string_user_type}
          #{sql_string_date}
        )
        GROUP BY l.bairro_id
    ) a ON (b.id = a.bairro_id)
MYSTRING
    return Bairro.find_by_sql(sql_string)
  end

  # Lista de bairros (de uma dada cidade)
  # cujos tópicos possuem a tag (ID!) forncecida,
  # com counts( = total!) de problemas/propostas
  def self.de_topicos_com_tag(tag, cidade_id, options = {})
    # Strings a parte...
    sql_string_topico_type = options[:topico_type].nil? ? "" : " AND topicos.type = '#{options[:topico_type].to_s.singularize.camelize}' "
    sql_string_user_type = options[:user_type].nil? ? "" : " AND users.type = '#{options[:user_type].to_s.singularize.camelize}' "
    sql_string_date = options[:ultimos_dias].nil? ? "" : " AND topicos.created_at >= '#{options[:ultimos_dias].to_i.days.ago.to_s(:db)}' "

    # String para consulta
    sql_string = <<MYSTRING.gsub(/\s+/, " ").strip
    SELECT b.id, b.nome, a.total
    FROM bairros b INNER JOIN (
      SELECT l.bairro_id, count(*) AS total
      FROM locais l
      WHERE l.cidade_id = #{cidade_id}
        AND l.responsavel_type = 'Topico'
        AND l.responsavel_id IN (
          SELECT topicos.id
          FROM topicos JOIN users JOIN taggings topicos_taggings
                     ON (topicos.user_id = users.id)
                        AND (topicos_taggings.taggable_id = topicos.id)
                        AND (topicos_taggings.taggable_type = 'Topico')
                     JOIN tags topicos_tags
                     ON (topicos_tags.id = topicos_taggings.tag_id)
        WHERE context = 'tags'
          AND topicos_tags.id LIKE '#{tag}'
          #{sql_string_topico_type}
          #{sql_string_user_type}
          #{sql_string_date}
      )
      GROUP BY l.bairro_id
    ) a ON (b.id = a.bairro_id)
    ORDER BY a.total DESC
MYSTRING
    return Bairro.find_by_sql(sql_string)
  end

  #============================================================#
  #                       OBJECT Methods                       #
  #============================================================#

  # Atualizacoes dos contadores
  def atualiza_contadores
    topicos_count = 0
    topicos_count = Topico.do_bairro(self).count(:all)

    topicos_relevancias_sum = 0
    Topico.do_bairro(self).find(:all).each { |t| topicos_relevancias_sum += t.relevancia }

    users_count = 0
    users_count = User.do_bairro(self).count(:all)

    users_relevancias_sum = 0
    User.do_bairro(self).find(:all).each { |u| users_relevancias_sum += u.relevancia }

    self.relevancia = (eval(Settings.localizacao_formula_relevancia)).to_i
    self.save(false)
  end

end


text:
package me.zsj.interessant.rx;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import java.util.List;

import io.reactivex.ObservableTransformer;

/**
 * @author zsj
 */

public class RxScroller {

    private RxScroller() {
        throw new AssertionError("No instances.");
    }

    public static <T> ObservableTransformer<Integer, Integer> scrollTransformer(
            final LinearLayoutManager layoutManager, final RecyclerView.Adapter adapter,
            final List<T> data) {
        return integerObservable -> integerObservable
                .filter(integer -> layoutManager.findFirstCompletelyVisibleItemPosition() >=
                            adapter.getItemCount() - 4)
                .filter(integer -> data.size() != 0)
                .filter(integer -> layoutManager.findFirstVisibleItemPosition() != 0);
    }

}

redpajama_set_name: RedPajamaGithub


text:
/*
	This file is part of cpp-ethereum.

	cpp-ethereum is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	cpp-ethereum is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with cpp-ethereum.  If not, see <http://www.gnu.org/licenses/>.
*/
/** @file Network.cpp
 * @author Alex Leverington <nessence@gmail.com>
 * @author Gav Wood <i@gavwood.com>
 * @author Eric Lombrozo <elombrozo@gmail.com> (Windows version of getInterfaceAddresses())
 * @date 2014
 */

#include <sys/types.h>
#ifndef _WIN32
#include <ifaddrs.h>
#endif

#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/split.hpp>

#include <libdevcore/Common.h>
#include <libdevcore/Assertions.h>
#include <libdevcore/CommonIO.h>
#include <libethcore/Exceptions.h>
#include "Common.h"
#include "UPnP.h"
#include "Network.h"

using namespace std;
using namespace dev;
using namespace dev::p2p;

std::set<bi::address> Network::getInterfaceAddresses()
{
	std::set<bi::address> addresses;

#ifdef _WIN32
	WSAData wsaData;
	if (WSAStartup(MAKEWORD(1, 1), &wsaData) != 0)
		BOOST_THROW_EXCEPTION(NoNetworking());

	char ac[80];
	if (gethostname(ac, sizeof(ac)) == SOCKET_ERROR)
	{
		clog(NetWarn) << "Error " << WSAGetLastError() << " when getting local host name.";
		WSACleanup();
		BOOST_THROW_EXCEPTION(NoNetworking());
	}

	struct hostent* phe = gethostbyname(ac);
	if (phe == 0)
	{
		clog(NetWarn) << "Bad host lookup.";
		WSACleanup();
		BOOST_THROW_EXCEPTION(NoNetworking());
	}

	for (int i = 0; phe->h_addr_list[i] != 0; ++i)
	{
		struct in_addr addr;
		memcpy(&addr, phe->h_addr_list[i], sizeof(struct in_addr));
		char *addrStr = inet_ntoa(addr);
		bi::address address(bi::address::from_string(addrStr));
		if (!isLocalHostAddress(address))
			addresses.insert(address.to_v4());
	}

	WSACleanup();
#else
	ifaddrs* ifaddr;
	if (getifaddrs(&ifaddr) == -1)
		BOOST_THROW_EXCEPTION(NoNetworking());

	for (auto ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next)
	{
		if (!ifa->ifa_addr || string(ifa->ifa_name) == "lo0" || !(ifa->ifa_flags & IFF_UP))
			continue;

		if (ifa->ifa_addr->sa_family == AF_INET)
		{
			in_addr addr = ((struct sockaddr_in *)ifa->ifa_addr)->sin_addr;
			boost::asio::ip::address_v4 address(boost::asio::detail::socket_ops::network_to_host_long(addr.s_addr));
			if (!isLocalHostAddress(address))
				addresses.insert(address);
		}
		else if (ifa->ifa_addr->sa_family == AF_INET6)
		{
			sockaddr_in6* sockaddr = ((struct sockaddr_in6 *)ifa->ifa_addr);
			in6_addr addr = sockaddr->sin6_addr;
			boost::asio::ip::address_v6::bytes_type bytes;
			memcpy(&bytes[0], addr.s6_addr, 16);
			boost::asio::ip::address_v6 address(bytes, sockaddr->sin6_scope_id);
			if (!isLocalHostAddress(address))
				addresses.insert(address);
		}
	}

	if (ifaddr!=NULL)
		freeifaddrs(ifaddr);

#endif

	return addresses;
}

int Network::tcp4Listen(bi::tcp::acceptor& _acceptor, NetworkPreferences const& _netPrefs)
{
	int retport = -1;
	if (_netPrefs.listenIPAddress.empty())
		for (unsigned i = 0; i < 2; ++i)
		{
			// try to connect w/listenPort, else attempt net-allocated port
			bi::tcp::endpoint endpoint(bi::tcp::v4(), i ? 0 : _netPrefs.listenPort);
			try
			{
				_acceptor.open(endpoint.protocol());
				_acceptor.set_option(ba::socket_base::reuse_address(true));
				_acceptor.bind(endpoint);
				_acceptor.listen();
				retport = _acceptor.local_endpoint().port();
				break;
			}
			catch (...)
			{
				if (i)
				{
					// both attempts failed
					cwarn << "Couldn't start accepting connections on host. Something very wrong with network?\n" << boost::current_exception_diagnostic_information();
				}

				// first attempt failed
				_acceptor.close();
				continue;
			}
		}
	else
	{
		bi::tcp::endpoint endpoint(bi::address::from_string(_netPrefs.listenIPAddress), _netPrefs.listenPort);
		try
		{
			_acceptor.open(endpoint.protocol());
			_acceptor.set_option(ba::socket_base::reuse_address(true));
			_acceptor.bind(endpoint);
			_acceptor.listen();
			retport = _acceptor.local_endpoint().port();
			assert(retport == _netPrefs.listenPort);
		}
		catch (...)
		{
			clog(NetWarn) << "Couldn't start accepting connections on host. Failed to accept socket.\n" << boost::current_exception_diagnostic_information();
		}
		return retport;
	}
	return retport;
}

bi::tcp::endpoint Network::traverseNAT(std::set<bi::address> const& _ifAddresses, unsigned short _listenPort, bi::address& o_upnpInterfaceAddr)
{
	asserts(_listenPort != 0);

	unique_ptr<UPnP> upnp;
	try
	{
		upnp.reset(new UPnP);
	}
	// let m_upnp continue as null - we handle it properly.
	catch (...) {}

	bi::tcp::endpoint upnpEP;
	if (upnp && upnp->isValid())
	{
		bi::address pAddr;
		int extPort = 0;
		for (auto const& addr: _ifAddresses)
			if (addr.is_v4() && isPrivateAddress(addr) && (extPort = upnp->addRedirect(addr.to_string().c_str(), _listenPort)))
			{
				pAddr = addr;
				break;
			}

		auto eIP = upnp->externalIP();
		bi::address eIPAddr(bi::address::from_string(eIP));
		if (extPort && eIP != string("0.0.0.0") && !isPrivateAddress(eIPAddr))
		{
			clog(NetNote) << "Punched through NAT and mapped local port" << _listenPort << "onto external port" << extPort << ".";
			clog(NetNote) << "External addr:" << eIP;
			o_upnpInterfaceAddr = pAddr;
			upnpEP = bi::tcp::endpoint(eIPAddr, (unsigned short)extPort);
		}
		else
			clog(NetWarn) << "Couldn't punch through NAT (or no NAT in place).";
	}

	return upnpEP;
}

bi::tcp::endpoint Network::resolveHost(string const& _addr)
{
	static boost::asio::io_service s_resolverIoService;

	vector<string> split;
	boost::split(split, _addr, boost::is_any_of(":"));
	unsigned port = dev::p2p::c_defaultIPPort;

	try
	{
		if (split.size() > 1)
			port = static_cast<unsigned>(stoi(split.at(1)));
	}
	catch(...) {}

	boost::system::error_code ec;
	bi::address address = bi::address::from_string(split[0], ec);
	bi::tcp::endpoint ep(bi::address(), port);
	if (!ec)
		ep.address(address);
	else
	{
		boost::system::error_code ec;
		// resolve returns an iterator (host can resolve to multiple addresses)
		bi::tcp::resolver r(s_resolverIoService);
		auto it = r.resolve({bi::tcp::v4(), split[0], toString(port)}, ec);
		if (ec)
		{
			clog(NetWarn) << "Error resolving host address..." << LogTag::Url << _addr << ":" << LogTag::Error << ec.message();
			return bi::tcp::endpoint();
		}
		else
			ep = *it;
	}
	return ep;
}


text:
Sky Walking | [English](README.md)
==========

**SkyWalking 3**: 针对分布式系统的APM系统,也被称为分布式追踪系统

[![Build Status](https://travis-ci.org/OpenSkywalking/skywalking.svg?branch=master)](https://travis-ci.org/OpenSkywalking/skywalking)
[![Coverage Status](https://coveralls.io/repos/github/OpenSkywalking/skywalking/badge.svg?branch=master&forceUpdate=3)](https://coveralls.io/github/OpenSkywalking/skywalking?branch=master)
[![Join the chat at https://gitter.im/openskywalking/Lobby](https://badges.gitter.im/openskywalking/Lobby.svg)](https://gitter.im/openskywalking/Lobby)
[![OpenTracing-1.x Badge](https://img.shields.io/badge/OpenTracing--1.x-enabled-blue.svg)](http://opentracing.io)

* Java自动探针,**不需要修改应用程序源代码**
  * 高性能探针,针对单实例5000tps的应用,在**全量采集的情况下**,只增加**10%**的CPU开销。
  * [中间件,框架与类库支持列表](docs/Supported-list.md).
* 手动探针
  * [使用OpenTracing手动探针API](http://opentracing.io/documentation/pages/supported-tracers)
  * 使用 [**@Trace**](docs/cn/Application-toolkit-trace-CN.md) 标注追踪业务方法
  * 将 traceId 集成到 log4j, log4j2 或 logback这些日志组件中
* 纯Java后端Collector实现,提供RESTful和gRPC接口。兼容接受其他语言探针发送数据
  * [如何将探针的Metric和Trace数据上传到Collector?](/docs/cn/How-to-communicate-with-the-collector-CN.md)
* UI工程请查看 [skywalking-ui](https://github.com/OpenSkywalking/skywalking-ui)
* 中文QQ群:392443393

# Architecture
* 3.2.5+版本架构图

# Document
[![EN doc](https://img.shields.io/badge/document-English-blue.svg)](docs/README.md) [![cn doc](https://img.shields.io/badge/document-中文-blue.svg)](docs/README_ZH.md)

This project adheres to the Contributor Covenant [code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to wu.sheng@foxmail.com.

# Screenshots
- 分布式系统拓扑图自动发现

- 调用链查询

- Span信息查询

- 实例全局视图

- JVM明细信息

- 服务依赖树.

# Test reports
- 自动化集成测试报告
  - [Java探针测试报告](https://github.com/SkywalkingTest/agent-integration-test-report)
- 性能测试报告
  - [Java探针测试报告](https://skywalkingtest.github.io/Agent-Benchmarks/)

# Contact Us
* 直接提交Issue
* [Gitter](https://gitter.im/openskywalking/Lobby)
* [Google Mailing List](https://groups.google.com/forum/#!forum/skywalking-distributed-tracing-and-apm)
* QQ群: 392443393

# Open Skywalking Organization
[Open Skywalking Organization Teams and Contributors](https://github.com/OpenSkywalking/Organization/blob/master/README.md)

# Partners

# License
[Apache 2.0 License.](/LICENSE)


text:
require File.expand_path('../test_helper', __FILE__)

class GlobalizeTest < Test::Unit::TestCase
  test "a translated record has many translations" do
    assert_has_many(Post, :translations)
  end

  test "translations are empty for a new record" do
    assert_equal [], Post.new.translations
  end
end


text:
package net.onedaybeard.ecs.model.scan;

import static net.onedaybeard.ecs.model.scan.TypeConfiguration.type;

import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;

public class ParentChainFinder extends ClassVisitor {

	private Map<Type,Set<Type>> parentChildrenMap;

	public ParentChainFinder(Map<Type,Set<Type>> parentChildrenMap) {
		super(Opcodes.ASM4);
		this.parentChildrenMap = parentChildrenMap;
	}

	@Override
	public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
		if (superName != null) {
			Type visited = type(name);
			if (!"java/lang/Object".equals(superName))
				addToMap(type(superName), visited);

			for (String iface : interfaces) {
				addToMap(type(iface), visited);
			}
		}

		super.visit(version, access, name, signature, superName, interfaces);
	}

	private void addToMap(Type parent, Type child) {
		if (!parentChildrenMap.containsKey(parent))
			parentChildrenMap.put(parent, new HashSet<Type>());

		parentChildrenMap.get(parent).add(child);
	}

}


text:
package org.apache.spark.examples.mllib;

// $example on$
import java.util.Arrays;
// $example off$

import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaSparkContext;
// $example on$
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.mllib.feature.ElementwiseProduct;
import org.apache.spark.mllib.linalg.Vector;
import org.apache.spark.mllib.linalg.Vectors;
// $example off$

public class JavaElementwiseProductExample {
  public static void main(String[] args) {

    SparkConf conf = new SparkConf().setAppName("JavaElementwiseProductExample");
    JavaSparkContext jsc = new JavaSparkContext(conf);

    // $example on$
    // Create some vector data; also works for sparse vectors
    JavaRDD<Vector> data = jsc.parallelize(Arrays.asList(
      Vectors.dense(1.0, 2.0, 3.0), Vectors.dense(4.0, 5.0, 6.0)));
    Vector transformingVector = Vectors.dense(0.0, 1.0, 2.0);
    ElementwiseProduct transformer = new ElementwiseProduct(transformingVector);

    // Batch transform and per-row transform give the same results:
    JavaRDD<Vector> transformedData = transformer.transform(data);
    JavaRDD<Vector> transformedData2 = data.map(transformer::transform);
    // $example off$

    System.out.println("transformedData: ");
    transformedData.foreach(System.out::println);

    System.out.println("transformedData2: ");
    transformedData2.foreach(System.out::println);

    jsc.stop();
  }
}


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Management.Automation.Language;
using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic;
using System.ComponentModel.Composition;
using System.Globalization;
using System.IO;

namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules
{
    /// <summary>
    /// AvoidUsingInternalURLs: Check if a URL is potentially an internal URL,
    /// eg://msw, //scratch2/scratch
    /// </summary>
    [Export(typeof (IScriptRule))]
    public class AvoidUsingInternalURLs : IScriptRule
    {
        /// <summary>
        /// AnalyzeScript: Analyzes the ast to check if any internal URL is used.
        /// </summary>
        /// <param name="ast">The script's ast</param>
        /// <param name="fileName">The script's file name</param>
        /// <returns>A List of diagnostic results of this rule</returns>
        public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
        {
            if (ast == null) throw new ArgumentNullException(Strings.NullAstErrorMessage);

            IEnumerable<Ast> expressionAsts = ast.FindAll(testAst => testAst is StringConstantExpressionAst, true);

            if (expressionAsts != null)
            {
                foreach (StringConstantExpressionAst expressionAst in expressionAsts)
                {

                    Ast parentAst = expressionAst.Parent;
                    //Check if -replace is used, if it is string replace, we don't throw warnings.
                    Ast grandParentAst = parentAst.Parent;
                    if (grandParentAst is BinaryExpressionAst)
                    {
                        if ((grandParentAst as BinaryExpressionAst).Operator.Equals(TokenKind.Ireplace))
                        {
                            continue;
                        }
                    }

                    //Check if XPath is used. If XPath is used, then we don't throw warnings.
                    if (parentAst is InvokeMemberExpressionAst)
                    {
                        InvokeMemberExpressionAst invocation = parentAst as InvokeMemberExpressionAst;
                        if (invocation != null)
                        {
                            if (String.Equals(invocation.Member.ToString(), "SelectSingleNode",StringComparison.OrdinalIgnoreCase) ||
                                String.Equals(invocation.Member.ToString(), "SelectNodes",StringComparison.OrdinalIgnoreCase) ||
                                String.Equals(invocation.Member.ToString(), "Select", StringComparison.OrdinalIgnoreCase) ||
                                String.Equals(invocation.Member.ToString(), "Evaluate",StringComparison.OrdinalIgnoreCase) ||
                                String.Equals(invocation.Member.ToString(), "Matches",StringComparison.OrdinalIgnoreCase) ||
                                String.Equals(invocation.Expression.ToString(), "[System.String]",StringComparison.OrdinalIgnoreCase) ||
                                String.Equals(invocation.Expression.ToString(), "[String]", StringComparison.OrdinalIgnoreCase))
                            {
                                continue;
                            }

                        }
                    }

                    bool isPathValid = false;
                    bool isInternalURL = false;
                    //make sure there is no path
                    char[] invalidPathChars = Path.GetInvalidPathChars();
                    if (expressionAst.Value.IndexOfAny(invalidPathChars) < 0)
                    {
                        isPathValid = true;
                    }

                    //Check if path is UNC or begins with "http:" or "www"
                    if (isPathValid && ((!String.IsNullOrWhiteSpace(expressionAst.Value))) &&
                        (Path.IsPathRooted(expressionAst.Value) ||
                         expressionAst.Value.StartsWith("http:", StringComparison.CurrentCultureIgnoreCase)) ||
                        (expressionAst.Value.StartsWith("www", StringComparison.CurrentCultureIgnoreCase)))
                    {
                        //Exclude the case where there are only slashes in the expressions
                        char[] varToTrim = {'/','\\'};
                        string noSlash = expressionAst.Value.Trim(varToTrim);
                        if (!String.IsNullOrEmpty(noSlash) && noSlash.Trim().Length > 1)
                        {
                            //Check if the string contains two back or forward slashes, such as: \\scratch2\scratch or http:\\www.google.com
                            bool backSlash = expressionAst.Value.Contains(@"\\");
                            bool forwardSlash = expressionAst.Value.Contains(@"//");
                            string firstPartURL = "";
                            if (backSlash)
                            {
                                //Get the first part of the URL before the first back slash, eg: \\scratch2\scratch we check only scratch2 as the first part
                                string trimmedAddress =
                                    expressionAst.Value.Substring(expressionAst.Value.IndexOf(@"\\") + 2);
                                if (trimmedAddress.Contains(@"\"))
                                {
                                    firstPartURL = trimmedAddress.Substring(0, trimmedAddress.IndexOf(@"\"));
                                }
                                else
                                {
                                    firstPartURL = trimmedAddress;
                                }
                            }
                            else if (forwardSlash)
                            {
                                //Get the first part of the URL before the first forward slash
                                string trimmedAddress =
                                    expressionAst.Value.Substring(expressionAst.Value.IndexOf(@"//") + 2);
                                if (trimmedAddress.Contains(@"/"))
                                {
                                    firstPartURL = trimmedAddress.Substring(0, trimmedAddress.IndexOf(@"/"));
                                }
                                else
                                {
                                    firstPartURL = trimmedAddress;
                                }
                            }
                            else
                            {
                                if (expressionAst.Value.Contains(@"\"))
                                {
                                    firstPartURL = expressionAst.Value.Substring(0, expressionAst.Value.IndexOf(@"\"));
                                }
                                else if (expressionAst.Value.Contains(@"/"))
                                {
                                    firstPartURL = expressionAst.Value.Substring(0, expressionAst.Value.IndexOf(@"/"));
                                }
                                else
                                {
                                    firstPartURL = expressionAst.Value;
                                }
                            }
                            if (!firstPartURL.Contains("."))
                            {
                                isInternalURL = true;
                                //Add a check to exclude potential SDDL format. Check if a string have four components separated by ":"
                                var count = firstPartURL.Count(x => x == ':');
                                if (count == 3 || count == 4 )
                                {
                                    isInternalURL = false;
                                }
                            }
                        }
                        if (isInternalURL)
                        {
                            yield return
                                new DiagnosticRecord(
                                    String.Format(CultureInfo.CurrentCulture, Strings.AvoidUsingInternalURLsError,
                                        expressionAst.Value), expressionAst.Extent,
                                    GetName(), DiagnosticSeverity.Information, fileName);

                        }
                    }
                }
            }
        }

        /// <summary>
        /// GetName: Retrieves the name of this rule.
        /// </summary>
        /// <returns>The name of this rule</returns>
        public string GetName()
        {
            return string.Format(CultureInfo.CurrentCulture, Strings.NameSpaceFormat, GetSourceName(), Strings.AvoidUsingInternalURLsName);
        }

        /// <summary>
        /// GetCommonName: Retrieves the common name of this rule.
        /// </summary>
        /// <returns>The common name of this rule</returns>
        public string GetCommonName()
        {
            return String.Format(CultureInfo.CurrentCulture, Strings.AvoidUsingInternalURLsCommonName);
        }

        /// <summary>
        /// GetDescription: Retrieves the description of this rule.
        /// </summary>
        /// <returns>The description of this rule</returns>
        public string GetDescription()
        {
            return string.Format(CultureInfo.CurrentCulture, Strings.AvoidUsingInternalURLsDescription);
        }

        /// <summary>
        /// Method: Retrieves the type of the rule: builtin, managed or module.
        /// </summary>
        public SourceType GetSourceType()
        {
            return SourceType.Builtin;
        }

        /// <summary>
        /// GetSeverity: Retrieves the severity of the rule: error, warning of information.
        /// </summary>
        /// <returns></returns>
        public RuleSeverity GetSeverity()
        {
            return RuleSeverity.Information;
        }

        /// <summary>
        /// Method: Retrieves the module/assembly name the rule is from.
        /// </summary>
        public string GetSourceName()
        {
            return string.Format(CultureInfo.CurrentCulture, Strings.SourceName);
        }
    }
}


text:
#ifndef __FBOBJ_H__
#define __FBOBJ_H__

#include "BasicIncludes.h"
#include "Texture.h"
#include "Texture2D.h"

class Camera;

class FBObj {
public:
	enum FBOAttachments {
        NoAttachment = 0x00000000, DepthAttachment = 0x00000001, StencilAttachment = 0x00000010,
        DepthTextureAttachment = 0x00000020
    };

	FBObj(int width, int height, Texture::TextureFilterType filter, int attachments);
	~FBObj();

	inline const Texture2D* GetFBOTexture() const {
		return this->fboTex;
	}
    inline const Texture2D* GetRenderToDepthTexture() const {
        return this->depthTex;
    }
	inline void BindFBObj() const {
		glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, this->fboID);
	}
	static void UnbindFBObj() {
		glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
	}

	inline void BindDepthRenderBuffer() {
		glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, this->depthBuffID);
		glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,  GL_RENDERBUFFER_EXT, this->depthBuffID);
	}
    inline void BindDepthRenderTexture() {
        glFramebufferTextureEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, this->depthTex->GetTextureID(), 0);
    }

private:
	GLuint fboID;                       // OGL Framebuffer object ID
	GLuint depthBuffID;                 // OGL depth renderbuffer object ID
	GLuint stencilBuffID;               // OGL stencil renderbuffer object ID
	GLuint packedStencilDepthBuffID;	// OGL packed depth-stencil renderbuffer object ID

	Texture2D* fboTex;
    Texture2D* depthTex;

	static bool CheckFBOStatus();

    DISALLOW_COPY_AND_ASSIGN(FBObj);
};
#endif


text:
@interface PodsDummy_Pods_ExpandFoundation : NSObject
@end
@implementation PodsDummy_Pods_ExpandFoundation
@end


text:
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs.Extensions.Files;
using Microsoft.Azure.WebJobs.Extensions.Files.Listener;
using Microsoft.Azure.WebJobs.Extensions.Tests.Common;
using Microsoft.Azure.WebJobs.Host.Executors;
using Moq;
using Newtonsoft.Json;
using Xunit;

namespace Microsoft.Azure.WebJobs.Extensions.Tests.Files.Listener
{
    public class FileProcessorTests
    {
        private const string InstanceId = "3b151065ae0740f5c4c278989981d9090cd27d8440cdd27ee155a9f0d0ef6bb9";
        private const string AttributeSubPath = @"webjobs_extensionstests\fileprocessor_import";

        private readonly string combinedTestFilePath;
        private readonly string rootPath;

        private FileProcessor processor;
        private FilesOptions options;
        private Mock<ITriggeredFunctionExecutor> mockExecutor;
        private JsonSerializer _serializer;

        public FileProcessorTests()
        {
            rootPath = Path.GetTempPath();
            combinedTestFilePath = Path.Combine(rootPath, AttributeSubPath);
            Directory.CreateDirectory(combinedTestFilePath);
            DeleteTestFiles(combinedTestFilePath);

            options = new FilesOptions()
            {
                RootPath = rootPath
            };

            FileTriggerAttribute attribute = new FileTriggerAttribute(AttributeSubPath, "*.dat");
            processor = CreateTestProcessor(attribute);

            JsonSerializerSettings settings = new JsonSerializerSettings
            {
                DateFormatHandling = DateFormatHandling.IsoDateFormat,
            };
            _serializer = JsonSerializer.Create(settings);

            Environment.SetEnvironmentVariable("WEBSITE_INSTANCE_ID", InstanceId);
        }

        [Fact]
        public async Task ProcessFileAsync_AlreadyProcessing_ReturnsWithoutProcessing()
        {
            string testFile = WriteTestFile("dat");

            // first take a lock on the status file
            StatusFileEntry status = null;
            using (StreamWriter statusFile = processor.AcquireStatusFileLock(testFile, WatcherChangeTypes.Created, out status))
            {
                // now attempt to process the file
                FileSystemEventArgs eventArgs = new FileSystemEventArgs(WatcherChangeTypes.Created, Path.GetDirectoryName(testFile), Path.GetFileName(testFile));

                bool fileProcessedSuccessfully = await processor.ProcessFileAsync(eventArgs, CancellationToken.None);

                Assert.False(fileProcessedSuccessfully);
                mockExecutor.Verify(p => p.TryExecuteAsync(It.IsAny<TriggeredFunctionData>(), It.IsAny<CancellationToken>()), Times.Never);
            }

            string statusFilePath = processor.GetStatusFile(testFile);
            File.Delete(statusFilePath);
        }

        [Fact]
        public async Task ProcessFileAsync_Failure_RetriesAndLeavesFailureStatusFile()
        {
            string testFile = WriteTestFile("dat");

            FunctionResult result = new FunctionResult(false);
            mockExecutor.Setup(p => p.TryExecuteAsync(It.IsAny<TriggeredFunctionData>(), It.IsAny<CancellationToken>())).ReturnsAsync(result);

            FileSystemEventArgs eventArgs = new FileSystemEventArgs(WatcherChangeTypes.Created, Path.GetDirectoryName(testFile), Path.GetFileName(testFile));
            bool fileProcessedSuccessfully = await processor.ProcessFileAsync(eventArgs, CancellationToken.None);

            Assert.False(fileProcessedSuccessfully);
            Assert.True(File.Exists(testFile));
            string statusFilePath = processor.GetStatusFile(testFile);

            StatusFileEntry[] entries = File.ReadAllLines(statusFilePath).Select(p => JsonConvert.DeserializeObject<StatusFileEntry>(p)).ToArray();

            Assert.Equal(6, entries.Length);

            // verify each of the retries
            for (int i = 0; i < processor.MaxProcessCount; i++)
            {
                // verify the processing entry
                Assert.Equal(ProcessingState.Processing, entries[i * 2].State);
                Assert.Equal(i + 1, entries[i * 2].ProcessCount);

                // verify the failure entry
                Assert.Equal(ProcessingState.Failed, entries[(i * 2) + 1].State);
                Assert.Equal(i + 1, entries[(i * 2) + 1].ProcessCount);
            }
        }

        [Fact]
        public async Task ProcessFileAsync_ChangeTypeCreate_Success()
        {
            FileTriggerAttribute attribute = new FileTriggerAttribute(AttributeSubPath, "*.dat");
            processor = CreateTestProcessor(attribute);

            string testFile = WriteTestFile("dat");

            FunctionResult result = new FunctionResult(true);
            mockExecutor.Setup(p => p.TryExecuteAsync(It.IsAny<TriggeredFunctionData>(), It.IsAny<CancellationToken>())).ReturnsAsync(result);

            string testFilePath = Path.GetDirectoryName(testFile);
            string testFileName = Path.GetFileName(testFile);
            FileSystemEventArgs eventArgs = new FileSystemEventArgs(WatcherChangeTypes.Created, testFilePath, testFileName);
            bool fileProcessedSuccessfully = await processor.ProcessFileAsync(eventArgs, CancellationToken.None);

            Assert.True(fileProcessedSuccessfully);
            string expectedStatusFile = processor.GetStatusFile(testFile);
            Assert.True(File.Exists(testFile));
            Assert.True(File.Exists(expectedStatusFile));
            string[] lines = File.ReadAllLines(expectedStatusFile);
            Assert.Equal(2, lines.Length);

            StatusFileEntry entry = (StatusFileEntry)_serializer.Deserialize(new StringReader(lines[0]), typeof(StatusFileEntry));
            Assert.Equal(ProcessingState.Processing, entry.State);
            Assert.Equal(WatcherChangeTypes.Created, entry.ChangeType);
            Assert.Equal(InstanceId.Substring(0, 20), entry.InstanceId);

            entry = (StatusFileEntry)_serializer.Deserialize(new StringReader(lines[1]), typeof(StatusFileEntry));
            Assert.Equal(ProcessingState.Processed, entry.State);
            Assert.Equal(WatcherChangeTypes.Created, entry.ChangeType);
            Assert.Equal(InstanceId.Substring(0, 20), entry.InstanceId);
        }

        [Fact]
        public async Task ProcessFileAsync_ChangeTypeChange_Success()
        {
            FileTriggerAttribute attribute = new FileTriggerAttribute(AttributeSubPath, "*.dat");
            processor = CreateTestProcessor(attribute);

            string testFile = WriteTestFile("dat");

            FunctionResult result = new FunctionResult(true);
            mockExecutor.Setup(p => p.TryExecuteAsync(It.IsAny<TriggeredFunctionData>(), It.IsAny<CancellationToken>())).ReturnsAsync(result);

            // first process a Create event
            string testFilePath = Path.GetDirectoryName(testFile);
            string testFileName = Path.GetFileName(testFile);
            FileSystemEventArgs eventArgs = new FileSystemEventArgs(WatcherChangeTypes.Created, testFilePath, testFileName);
            bool fileProcessedSuccessfully = await processor.ProcessFileAsync(eventArgs, CancellationToken.None);
            Assert.True(fileProcessedSuccessfully);

            // Wait briefly so the changed time is slightly different than the created time
            await Task.Delay(10);

            // now process a Change event
            File.WriteAllText(testFile, "update");
            eventArgs = new FileSystemEventArgs(WatcherChangeTypes.Changed, testFilePath, testFileName);
            fileProcessedSuccessfully = await processor.ProcessFileAsync(eventArgs, CancellationToken.None);
            Assert.True(fileProcessedSuccessfully);

            string expectedStatusFile = processor.GetStatusFile(testFile);
            Assert.True(File.Exists(testFile));
            Assert.True(File.Exists(expectedStatusFile));
            string[] lines = File.ReadAllLines(expectedStatusFile);
            Assert.Equal(4, lines.Length);

            StatusFileEntry entry = (StatusFileEntry)_serializer.Deserialize(new StringReader(lines[0]), typeof(StatusFileEntry));
            Assert.Equal(ProcessingState.Processing, entry.State);
            Assert.Equal(WatcherChangeTypes.Created, entry.ChangeType);
            Assert.Equal(InstanceId.Substring(0, 20), entry.InstanceId);

            entry = (StatusFileEntry)_serializer.Deserialize(new StringReader(lines[1]), typeof(StatusFileEntry));
            Assert.Equal(ProcessingState.Processed, entry.State);
            Assert.Equal(WatcherChangeTypes.Created, entry.ChangeType);
            Assert.Equal(InstanceId.Substring(0, 20), entry.InstanceId);

            entry = (StatusFileEntry)_serializer.Deserialize(new StringReader(lines[2]), typeof(StatusFileEntry));
            Assert.Equal(ProcessingState.Processing, entry.State);
            Assert.Equal(WatcherChangeTypes.Changed, entry.ChangeType);
            Assert.Equal(InstanceId.Substring(0, 20), entry.InstanceId);

            entry = (StatusFileEntry)_serializer.Deserialize(new StringReader(lines[3]), typeof(StatusFileEntry));
            Assert.Equal(ProcessingState.Processed, entry.State);
            Assert.Equal(WatcherChangeTypes.Changed, entry.ChangeType);
            Assert.Equal(InstanceId.Substring(0, 20), entry.InstanceId);
        }

        [Fact]
        public async Task ProcessFileAsync_JobFunctionSucceeds()
        {
            string testFile = WriteTestFile("dat");

            FunctionResult result = new FunctionResult(true);
            mockExecutor.Setup(p => p.TryExecuteAsync(It.IsAny<TriggeredFunctionData>(), It.IsAny<CancellationToken>())).ReturnsAsync(result);

            FileSystemEventArgs eventArgs = new FileSystemEventArgs(WatcherChangeTypes.Created, combinedTestFilePath, Path.GetFileName(testFile));
            await processor.ProcessFileAsync(eventArgs, CancellationToken.None);

            Assert.Equal(2, Directory.GetFiles(combinedTestFilePath).Length);
            string expectedStatusFile = processor.GetStatusFile(testFile);
            Assert.True(File.Exists(testFile));
            Assert.True(File.Exists(expectedStatusFile));

            string[] statusLines = File.ReadAllLines(expectedStatusFile);
            Assert.Equal(2, statusLines.Length);
            StatusFileEntry entry = (StatusFileEntry)_serializer.Deserialize(new StringReader(statusLines[0]), typeof(StatusFileEntry));
            Assert.Equal(ProcessingState.Processing, entry.State);
            Assert.Equal(WatcherChangeTypes.Created, entry.ChangeType);
            Assert.Equal(processor.InstanceId, entry.InstanceId);
            entry = (StatusFileEntry)_serializer.Deserialize(new StringReader(statusLines[1]), typeof(StatusFileEntry));
            Assert.Equal(ProcessingState.Processed, entry.State);
            Assert.Equal(WatcherChangeTypes.Created, entry.ChangeType);
            Assert.Equal(processor.InstanceId, entry.InstanceId);
        }

        [Fact]
        public void Cleanup_AutoDeleteOn_DeletesCompletedFiles()
        {
            FileTriggerAttribute attribute = new FileTriggerAttribute(AttributeSubPath, "*.dat", autoDelete: true);
            FileProcessor localProcessor = CreateTestProcessor(attribute);

            // create a completed file set
            string completedFile = WriteTestFile("dat");
            string completedStatusFile = localProcessor.GetStatusFile(completedFile);
            StatusFileEntry status = new StatusFileEntry
            {
                State = ProcessingState.Processing,
                Timestamp = DateTime.Now,
                ChangeType = WatcherChangeTypes.Created,
                InstanceId = "1"
            };
            StringWriter sw = new StringWriter();
            _serializer.Serialize(sw, status);
            sw.WriteLine();
            status.State = ProcessingState.Processed;
            status.Timestamp = status.Timestamp + TimeSpan.FromSeconds(15);
            _serializer.Serialize(sw, status);
            sw.WriteLine();
            sw.Flush();
            File.WriteAllText(completedStatusFile, sw.ToString());

            // include an additional companion metadata file
            string completedAdditionalFile = completedFile + ".metadata";
            File.WriteAllText(completedAdditionalFile, "Data");

            // write a file that SHOULDN'T be deleted
            string dontDeleteFile = Path.ChangeExtension(completedFile, "json");
            File.WriteAllText(dontDeleteFile, "Data");

            // create an incomplete file set
            string incompleteFile = WriteTestFile("dat");
            string incompleteStatusFile = localProcessor.GetStatusFile(incompleteFile);
            status = new StatusFileEntry
            {
                State = ProcessingState.Processing,
                Timestamp = DateTime.Now,
                ChangeType = WatcherChangeTypes.Created,
                InstanceId = "1"
            };
            sw = new StringWriter();
            _serializer.Serialize(sw, status);
            sw.WriteLine();
            File.WriteAllText(incompleteStatusFile, sw.ToString());

            localProcessor.Cleanup();

            // expect the completed set to be deleted
            Assert.False(File.Exists(completedFile));
            Assert.False(File.Exists(completedAdditionalFile));
            Assert.False(File.Exists(completedStatusFile));
            Assert.True(File.Exists(dontDeleteFile));

            // expect the incomplete set to remain
            Assert.False(File.Exists(completedFile));
            Assert.False(File.Exists(completedStatusFile));
        }

        [Theory]
        [InlineData("input.status", true)]
        [InlineData("input.status.status", true)]
        [InlineData("input.txt", false)]
        [InlineData("input", false)]
        [InlineData("", false)]
        public void IsStatusFile_ReturnsExpectedResult(string file, bool expected)
        {
            Assert.Equal(expected, processor.IsStatusFile(file));
        }

        private string WriteTestFile(string extension = "dat", string fileContents = "TestData")
        {
            string testFileName = string.Format("{0}.{1}", Guid.NewGuid(), extension);
            string testFilePath = Path.Combine(combinedTestFilePath, testFileName);
            File.WriteAllText(testFilePath, fileContents);
            Assert.True(File.Exists(testFilePath));

            return testFilePath;
        }

        private void DeleteTestFiles(string path)
        {
            foreach (string file in Directory.GetFiles(path))
            {
                File.Delete(file);
            }
        }

        private FileProcessor CreateTestProcessor(FileTriggerAttribute attribute)
        {
            mockExecutor = new Mock<ITriggeredFunctionExecutor>(MockBehavior.Strict);
            FileProcessorFactoryContext context = new FileProcessorFactoryContext(options, attribute, mockExecutor.Object, new TestLogger("Test"));

            return new FileProcessor(context);
        }
    }
}


text:
package com.poolik.classfinder;

public class ClassFinderException extends RuntimeException {

  public ClassFinderException(String message) {
    super(message);
  }

  public ClassFinderException(String message, Throwable exception) {
    super(message, exception);
  }
}


text:
struct UnityDisplaySurfaceBase;	// Unity/UnityRendering.h
struct RenderingSurfaceParams;	// Unity/DisplayManager.h

// due to delicate nature of render loop we have just one delegate in app
// if you need to use several rendering delegates you need to do one of:
// 1. create custom delegate that will have code to combine effects by itself
// 2. use helper that simply holds array of delegates (which will work only in easiest cases)
@protocol RenderPluginDelegate<LifeCycleListener, NSObject>

@required
// this will be called right after gles intialization.
// surface pointer will never be changed, so you should keep it.
// the only valid fields in there as of now are layer and context
- (void)mainDisplayInited:(struct UnityDisplaySurfaceBase*)surface;

@optional

// this will be called before recreating main display surface (from [UnityView recreateGLESSurface])
// you can tweak params here.
// use it for enabling CVTextureCache support and the likes
- (void)onBeforeMainDisplaySurfaceRecreate:(struct RenderingSurfaceParams*)params;

// this will be called right after recreating main display surface (from [UnityView recreateGLESSurface])
// as [UnityView recreateGLESSurface] is the only place where unity itself will trigger surface recreate
// you can use this method to update your rendering depending on changes
- (void)onAfterMainDisplaySurfaceRecreate;

// this will be called after frame render and msaa resolve but before blitting to system FB
// you can expect that frame contents are ready (though still in target resolution)
// use it for anylizing/postprocessing rendered frame, taking screenshot and the like
// you should use targetFB if it is not 0
// otherwise use systemFB (covers case of intermediate fb not needed: no msaa, native res, no CVTextureCache involved)
- (void)onFrameResolved;
@end

// simple helper for common plugin stuff
// you can implement protocol directly, but subclassing this will provide some common implementation
@interface RenderPluginDelegate : NSObject<RenderPluginDelegate>
{
	struct UnityDisplaySurfaceBase* mainDisplaySurface;
}
- (void)mainDisplayInited:(struct UnityDisplaySurfaceBase*)surface;
@end

// simple helper to have an array of render delegates.
// be warned that it works in simplest cases only, when there is no interop between delegates
@interface RenderPluginArrayDelegate : RenderPluginDelegate
{
	NSArray* delegateArray;
}
@property(nonatomic, retain) NSArray* delegateArray;
- (void)mainDisplayInited:(struct UnityDisplaySurfaceBase*)surface;
- (void)onBeforeMainDisplaySurfaceRecreate:(struct RenderingSurfaceParams*)params;
- (void)onAfterMainDisplaySurfaceRecreate;
- (void)onFrameResolved;

- (void)didBecomeActive:(NSNotification*)notification;
- (void)willResignActive:(NSNotification*)notification;
- (void)didEnterBackground:(NSNotification*)notification;
- (void)willEnterForeground:(NSNotification*)notification;
- (void)willTerminate:(NSNotification*)notification;
@end


text:
(function() {
    'use strict'
    angular.module('application').controller('NgMapController', ['NgMapServices', '$scope', 'NgMap', NgMapController]);

    function NgMapController(NgMapServices, $scope, NgMap) {
        // Controller Variables
        var self = this;
        self.loading = false;
        self.properties = {};

        NgMapServices.getProperties().then(function(result) {
            self.properties = result.listing;
        });

        NgMap.getMap().then(function(map) {
         console.log(map.getCenter());
         console.log('markers', map.markers);
         console.log('shapes', map.shapes);
        });

    };

})();


text:
title: Queues
description: Procrastinate on slow processes. It'll get done later, promise.
date: 2016-06-09
collection: guide
collectionSort: 1
layout: guide.hbs
pendingTask: https://github.com/ubiquits/ubiquits/issues/76
---


text:
Legal stuff and credits

Created and maintained by Piotr and Oskar.

It wouldn't exist without MooTools community.

License

All code belongs to the poster and no license is enforced.

We are not responsible or liable for any loss or damage of any kind during the usage of provided code.


text:
	<title></title>

	 This is not a bold variant
	<button id="button" >Convert</button>


text:
import {assert} from "chai";
import {ParentMessageV3} from "../generated/examplecom/parent_message_v3_pb";
import {ExternalChildMessage} from "../generated/othercom/external_child_message_pb";
import InternalChildMessage = ParentMessageV3.InternalChildMessage;

describe("proto3 - internal nested messages", () => {
  it("should allow getting internal message fields on an empty message", () => {
    const parentMsg = new ParentMessageV3();
    assert.strictEqual(parentMsg.getInternalChildMessage() as undefined, undefined);
    assert.deepEqual(parentMsg.getInternalChildrenList() as Array<InternalChildMessage>, []);
  });

  it("should allow setting and getting internal message fields", () => {
    const parentMsg = new ParentMessageV3();
    assert.strictEqual(parentMsg.hasInternalChildMessage(), false);
    const childMsg = new InternalChildMessage();
    childMsg.setMyString("hello world");
    parentMsg.setInternalChildMessage(childMsg);
    assert.strictEqual(parentMsg.getInternalChildMessage()!.getMyString() as string, "hello world");
    assert.strictEqual(parentMsg.hasInternalChildMessage(), true);
    parentMsg.setInternalChildMessage(undefined);
    assert.strictEqual(parentMsg.getInternalChildMessage() as undefined, undefined);
    assert.strictEqual(parentMsg.hasInternalChildMessage(), false);

    parentMsg.setInternalChildMessage(childMsg);
    assert.strictEqual(parentMsg.hasInternalChildMessage(), true);
    parentMsg.clearInternalChildMessage();
    assert.strictEqual(parentMsg.hasInternalChildMessage(), false);
  });

  it("should allow setting and getting repeated internal message fields", () => {
    const parentMsg = new ParentMessageV3();
    const childMsgOne = new InternalChildMessage();
    childMsgOne.setMyString("one");

    const childMsgTwo = new InternalChildMessage();
    childMsgTwo.setMyString("two");

    parentMsg.setInternalChildrenList([childMsgOne, childMsgTwo]);

    assert.deepEqual(parentMsg.getInternalChildrenList() as Array<InternalChildMessage>, [childMsgOne, childMsgTwo]);
  });

  it("should allow adding and getting repeated internal message fields", () => {
    const parentMsg = new ParentMessageV3();
    const childMsgOne = new InternalChildMessage();
    childMsgOne.setMyString("one");

    const childMsgTwo = new InternalChildMessage();
    childMsgTwo.setMyString("two");

    const addedOne = parentMsg.addInternalChildren(childMsgOne);
    assert.strictEqual(childMsgOne, addedOne);
    const addedTwo = parentMsg.addInternalChildren(childMsgTwo);
    assert.strictEqual(childMsgTwo, addedTwo);

    assert.deepEqual(parentMsg.getInternalChildrenList() as Array<InternalChildMessage>, [childMsgOne, childMsgTwo]);
  });
});

describe("proto3 - external nested messages", () => {
  it("should allow getting external message fields on an empty message", () => {
    const parentMsg = new ParentMessageV3();
    assert.strictEqual(parentMsg.getExternalChildMessage() as undefined, undefined);
    assert.deepEqual(parentMsg.getExternalChildrenList() as Array<ExternalChildMessage>, []);
  });

  it("should allow setting and getting external message fields", () => {
    const parentMsg = new ParentMessageV3();
    const childMsg = new ExternalChildMessage();
    childMsg.setMyString("hello world");
    parentMsg.setExternalChildMessage(childMsg);
    assert.strictEqual(parentMsg.getExternalChildMessage()!.getMyString() as string, "hello world");
    parentMsg.setExternalChildMessage(undefined);
    assert.strictEqual(parentMsg.getExternalChildMessage() as undefined, undefined);
  });

  it("should allow setting and getting repeated external message fields", () => {
    const parentMsg = new ParentMessageV3();
    const childMsgOne = new ExternalChildMessage();
    childMsgOne.setMyString("one");

    const childMsgTwo = new ExternalChildMessage();
    childMsgTwo.setMyString("two");

    parentMsg.setExternalChildrenList([childMsgOne, childMsgTwo]);

    assert.deepEqual(parentMsg.getExternalChildrenList() as Array<ExternalChildMessage>, [childMsgOne, childMsgTwo]);
  });

  it("should allow adding and getting repeated external message fields", () => {
    const parentMsg = new ParentMessageV3();
    const childMsgOne = new ExternalChildMessage();
    childMsgOne.setMyString("one");

    const childMsgTwo = new ExternalChildMessage();
    childMsgTwo.setMyString("two");

    const addedOne = parentMsg.addExternalChildren(childMsgOne);
    assert.strictEqual(childMsgOne, addedOne);
    const addedTwo = parentMsg.addExternalChildren(childMsgTwo);
    assert.strictEqual(childMsgTwo, addedTwo);

    assert.deepEqual(parentMsg.getExternalChildrenList() as Array<ExternalChildMessage>, [childMsgOne, childMsgTwo]);
  });
});

describe("proto3 - toObject", () => {
  it("should indicate potentially undefined message fields", () => {
    const parentMsg = new ParentMessageV3();
    const asObjectUnset = parentMsg.toObject();
    assert.strictEqual(asObjectUnset.internalChildMessage as undefined, undefined);
    const childMsg = new InternalChildMessage();
    childMsg.setMyString("hello world");
    parentMsg.setInternalChildMessage(childMsg);
    const asObjectSet = parentMsg.toObject();
    assert.strictEqual(asObjectSet.internalChildMessage!.myString as string, "hello world");
  });
  it("should indicate potentially undefined primitive fields", () => {
    const msg = new InternalChildMessage();
    const asObjectUnset = msg.toObject();
    assert.strictEqual(asObjectUnset.myString as string, "");
    msg.setMyString("hello world");
    const asObjectSet = msg.toObject();
    assert.strictEqual(asObjectSet.myString! as string, "hello world");
  });
});


text:
@import 'theme-gray-all_1.css';
@import 'theme-gray-all_2.css';


text:
package org.optaplanner.core.impl.heuristic.selector.value.decorator;

import java.util.Iterator;
import java.util.Spliterators;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;

import org.optaplanner.core.impl.domain.variable.descriptor.GenuineVariableDescriptor;
import org.optaplanner.core.impl.domain.variable.descriptor.ListVariableDescriptor;
import org.optaplanner.core.impl.domain.variable.inverserelation.SingletonInverseVariableSupply;
import org.optaplanner.core.impl.domain.variable.inverserelation.SingletonListInverseVariableDemand;
import org.optaplanner.core.impl.heuristic.selector.value.AbstractValueSelector;
import org.optaplanner.core.impl.heuristic.selector.value.EntityIndependentValueSelector;
import org.optaplanner.core.impl.phase.scope.AbstractPhaseScope;

/**
 * Discards planning values that are already assigned to a list variable.
 *

 * Only returns values from the child value selector that are unassigned.
 * This prevents reassigning of values that are already assigned to a list variable during Construction Heuristics.
 *

 * Does implement {@link EntityIndependentValueSelector} because the question whether a value is assigned or not does not depend
 * on a specific entity.
 */
public class UnassignedValueSelector<Solution_> extends AbstractValueSelector<Solution_>
        implements EntityIndependentValueSelector<Solution_> {

    protected final EntityIndependentValueSelector<Solution_> childValueSelector;

    protected SingletonInverseVariableSupply inverseVariableSupply;

    public UnassignedValueSelector(EntityIndependentValueSelector<Solution_> childValueSelector) {
        if (childValueSelector.isNeverEnding()) {
            throw new IllegalArgumentException("The selector (" + this
                    + ") has a childValueSelector (" + childValueSelector
                    + ") with neverEnding (" + childValueSelector.isNeverEnding() + ").\n"
                    + "This is not allowed because " + UnassignedValueSelector.class.getSimpleName()
                    + " cannot decorate a never-ending child value selector.\n"
                    + "This could be a result of using random selection order (which is often the default).");
        }
        this.childValueSelector = childValueSelector;
        phaseLifecycleSupport.addEventListener(childValueSelector);
    }

    // ************************************************************************
    // Worker methods
    // ************************************************************************

    @Override
    public void phaseStarted(AbstractPhaseScope<Solution_> phaseScope) {
        super.phaseStarted(phaseScope);
        ListVariableDescriptor<Solution_> variableDescriptor =
                (ListVariableDescriptor<Solution_>) childValueSelector.getVariableDescriptor();
        inverseVariableSupply = phaseScope.getScoreDirector().getSupplyManager()
                .demand(new SingletonListInverseVariableDemand<>(variableDescriptor));
    }

    @Override
    public void phaseEnded(AbstractPhaseScope<Solution_> phaseScope) {
        super.phaseEnded(phaseScope);
        inverseVariableSupply = null;
    }

    @Override
    public GenuineVariableDescriptor<Solution_> getVariableDescriptor() {
        return childValueSelector.getVariableDescriptor();
    }

    @Override
    public boolean isCountable() {
        // Because !neverEnding => countable.
        return true;
    }

    @Override
    public boolean isNeverEnding() {
        // Because the childValueSelector is not never-ending.
        return false;
    }

    @Override
    public long getSize(Object entity) {
        return getSize();
    }

    @Override
    public long getSize() {
        return streamUnassignedValues().count();
    }

    @Override
    public Iterator<Object> iterator(Object entity) {
        return iterator();
    }

    @Override
    public Iterator<Object> iterator() {
        return streamUnassignedValues().iterator();
    }

    @Override
    public Iterator<Object> endingIterator(Object entity) {
        return iterator();
    }

    private Stream<Object> streamUnassignedValues() {
        return StreamSupport
                .stream(Spliterators.spliterator(childValueSelector.iterator(), childValueSelector.getSize(), 0), false)
                // Skip assigned values.
                .filter(value -> inverseVariableSupply.getInverseSingleton(value) == null);
    }

    @Override
    public String toString() {
        return "Unassigned(" + childValueSelector + ")";
    }
}


text:
ChromeOSLoginMediaAccessHandler::ChromeOSLoginMediaAccessHandler() {}

ChromeOSLoginMediaAccessHandler::~ChromeOSLoginMediaAccessHandler() {}

bool ChromeOSLoginMediaAccessHandler::SupportsStreamType(
    content::WebContents* web_contents,
    const blink::mojom::MediaStreamType type,
    const extensions::Extension* extension) {
  if (!web_contents)
    return false;
  auto* host = ash::LoginDisplayHost::default_host();
  return host && web_contents == host->GetOobeWebContents();
}

bool ChromeOSLoginMediaAccessHandler::CheckMediaAccessPermission(
    content::RenderFrameHost* render_frame_host,
    const GURL& security_origin,
    blink::mojom::MediaStreamType type,
    const extensions::Extension* extension) {
  if (type != blink::mojom::MediaStreamType::DEVICE_VIDEO_CAPTURE)
    return false;

  // When creating new user (including supervised user), we must be able to use
  // the camera to capture a user image.
  if (security_origin.spec() == chrome::kChromeUIOobeURL)
    return true;

  const ash::CrosSettings* const settings = ash::CrosSettings::Get();
  if (!settings)
    return false;

  // The following checks are for SAML logins.
  const base::Value* const list_value =
      settings->GetPref(ash::kLoginVideoCaptureAllowedUrls);
  if (!list_value)
    return false;

  DCHECK(list_value->is_list());
  for (const auto& base_value : list_value->GetList()) {
    const std::string* value = base_value.GetIfString();
    if (value) {
      const ContentSettingsPattern pattern =
          ContentSettingsPattern::FromString(*value);
      // Force administrators to specify more-specific patterns by ignoring the
      // global wildcard pattern.
      if (pattern == ContentSettingsPattern::Wildcard()) {
        VLOG(1) << "Ignoring wildcard URL pattern: " << *value;
        continue;
      }
      if (pattern.IsValid() && pattern.Matches(security_origin))
        return true;
    }
  }
  return false;
}

void ChromeOSLoginMediaAccessHandler::HandleRequest(
    content::WebContents* web_contents,
    const content::MediaStreamRequest& request,
    content::MediaResponseCallback callback,
    const extensions::Extension* extension) {
  bool audio_allowed = false;
  bool video_allowed =
      request.video_type ==
          blink::mojom::MediaStreamType::DEVICE_VIDEO_CAPTURE &&
      CheckMediaAccessPermission(
          content::RenderFrameHost::FromID(request.render_process_id,
                                           request.render_frame_id),
          request.security_origin,
          blink::mojom::MediaStreamType::DEVICE_VIDEO_CAPTURE, extension);

  CheckDevicesAndRunCallback(web_contents, request, std::move(callback),
                             audio_allowed, video_allowed);
}


text:
Android and Web Developer Club

https://abraincode.github.io/

# Tentang abraincode

Satu paragraf  proyek dideskripsikan di sini

## Memulai

instruksi ini akan membuat Anda menyalinin proyek dan berjalan di komputer atau laptop(lokal) Anda untuk tujuan development dan pengujian. Lihat penerapan untuk catatan tentang cara menggunakan proyek pada sistem langsung.

## Ringkasan

Di bagian atas file harus ada perkenalan singkat dan / atau ikhtisar yang menjelaskan ** apa ** proyek itu. Deskripsi ini harus cocok dengan deskripsi yang ditambahkan untuk manajer paket (Gemspec, package.json, dll.)

## Motivasi

Penjelasan singkat tentang motivasi di balik penciptaan dan pemeliharaan proyek. Ini harus menjelaskan ** mengapa ** proyek itu ada.

### Prasyarat

Hal apa yang Anda perlukan untuk menginstal perangkat lunak dan cara menginstalnya
```

Berikan contoh
```

### Installasi

Serangkaian contoh langkah demi langkah yang memberi tahu Anda harus menjalankan pengembangan env

Katakan Langkah apa yang ingin dilakukan

```
Berikan Contoh
```

dan ulangi

```
sampai selesai
```

Akhiri dengan contoh untuk mengeluarkan data dari sistem atau menggunakannya untuk demo kecil

## Menjalankan tes

Jelaskan cara menjalankan tes otomatis untuk sistem ini

### Rinci tes ujung ke ujung

Jelaskan apa tes tes ini dan mengapa

```
Berikan Contoh
```

### Dan tes gaya pengkodean

Jelaskan apa tes tes ini dan mengapa

```
Berikan Contoh
```

## Pengembangan

Tambahkan catatan tambahan tentang cara menggunakan ini pada sistem live

## Dibuat dengan

* [Dropwizard](http://www.dropwizard.io/1.0.2/docs/) - Web Framework yang digunakan
* [Maven](https://maven.apache.org/) - Manajemen Ketergantungan
* [ROME](https://rometools.github.io/rome/) - Menggunakan generate RSS Feeds

## API Referensi

Bergantung pada ukuran proyek, jika kecil dan cukup sederhana, dokumen referensi dapat ditambahkan ke README. Untuk proyek berukuran sedang hingga besar, penting untuk setidaknya menyediakan tautan ke tempat dokumen rujukan API.

## Tests

jelaskan dan tunjukkan bagaimana cara menjalankan test dengan contoh kode.

## Kontribusi

Biarkan orang tahu bagaimana mereka bisa terjun ke dalam proyek, sertakan tautan penting ke hal-hal seperti pelacak masalah, irc, akun twitter jika berlaku.

## Berkontribusi

Silahkan baca [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) untuk detail tentang kode etik kami, dan proses untuk mengirimkan pull request kepada kami.

## Versi

Kami Menggunakan [SemVer](http://semver.org/) untuk versiVersi. Untuk versi yang tersedia, lihat[tags on this repository](https://github.com/your/project/tags).

## Authors

* **Billie Thompson** - *Initial work* - [PurpleBooth](https://github.com/PurpleBooth)

Lihat juga daftar [contributors](https://github.com/your/project/contributors)yang berpartisipasi dalam proyek ini.

## Lisensi

Proyek ini dilisensikan di bawah Lisensi MIT - lihat file [LICENSE.md] (LICENSE.md) untuk detailnya

## Ucapan Terima Kasih

* Kiat tip kepada siapa pun yang menggunakan kode
* Inspirasi
* dan lain lain