text:
<?php
namespace Fulfil;

class Context
{
    use Spec;

    private $path = [];
    private $name = [];
    private $node = null;
    private $root = null;

    // node objects are only created when a reason or message is added.
    // holds properties required to create a node here until needed.
    private $nodeTemp = null;

    protected $allowIncomplete = false;

    public static function spec()
    {
        return [
            'allowIncomplete'=>['kind'=>'bool', 'default'=>false],
        ];
    }

    public function __construct(array $config=[])
    {
        $this->node = $this->root = new Node;
        $this->populate($config, []);
    }

    function ensureValid(\Fulfil\MessageSet $messageSet=null)
    {
        if (!$messageSet) {
            $messageSet = new \Fulfil\MessageSet\Developer;
        }

        $flat = $this->flatten();
        if (!$flat->valid) {
            $msg = implode("\n - ", $messageSet->formatAll($flat->messages))."\n";
            throw new \Fulfil\ValidationException("Failed validation:\n - ".$msg);
        }
    }

    function push($key, $name=null)
    {
        $this->path[] = $key;
        $this->name[] = $name ?: $key;
        $node = $this->getNode();
        if (isset($node->children[$key])) {
            $this->node = $node->children[$key];
        } else {
            $this->nodeTemp = [$key, $name];
        }
    }

    function pop($key)
    {
        if ($this->nodeTemp) {
            list ($curKey, ) = $this->nodeTemp;
            $this->nodeTemp = null;
        }
        else {
            if ($this->node == $this->root) {
                throw new \LogicException("Tried to pop the root");
            }
            $curKey = $this->node->key;
            $this->node = $this->node->parent;
        }
        if ($curKey != $key) {
            throw new \UnexpectedValueException("Expected to pop $key, tried to pop $curKey");
        }

        array_pop($this->path);
        array_pop($this->name);
    }

    function getNode($path=null)
    {
        if ($this->nodeTemp) {
            list ($key, $name) = $this->nodeTemp;
            $node = new Node;
            $node->name = $name;
            $node->key = $key;
            $node->parent = $this->node;
            $this->node->children[$key] = $node;
            $this->node = $node;
            $this->nodeTemp = null;
        }
        $cur = $this->node;
        if ($path) {
            $cur = $cur->child($path);
        }
        return $cur;
    }

    function root()           { return $this->root; }
    function getPath()        { return $this->path; }

    function setIncomplete($source)
    {
        if ($this->allowIncomplete) {
            $this->getNode()->complete = false;
        }
        else {
            // FIXME
            if ($source instanceof \Fulfil\Incomplete) {
                $summary = $source->incompleteExportKey().", ".$source->incompleteType();
            } else {
                $summary = get_class($source);
            }
            throw new \RuntimeException( "Incomplete validation disallowed by context: ".$summary);
        }
    }

    function setChange($change)
    {
        $node = $this->getNode();
        $node->change = Change::max($change, $node->change);
    }

    function getChange()
    {
        // don't call getNode - if we haven't created the current node yet (see nodeTemp)
        // then it hasn't been changed.
        if (!$this->node) {
            return Change::None;
        }
        return $this->node->treeChange();
    }

    function flatten()
    {
        if ($this->getNode() != $this->root) {
            throw new \LogicException("You have unpopped nodes");
        }
        return $this->root->flatten();
    }

    function nodeValid()
    {
        if (!$this->node) {
            return true;
        } else {
            return $this->getNode()->treeValid();
        }
    }

    function nodeComplete()
    {
        if (!$this->node) {
            return true;
        } else {
            return $this->getNode()->complete;
        }
    }

    function allValid()
    {
        if ($this->getNode() != $this->root) {
            throw new \LogicException("You have unpopped nodes");
        }
        return $this->root->treeValid();
    }

    function addReason($messenger, $reason)
    {
        $node = $this->getNode();
        $node->valid = false;

        $reason = Message::ensure($reason);
        $reason->path = $this->path;
        $reason->source = get_class($messenger);
        $reason->name = $this->name;
        $node->messages[] = $reason;

        if ($messenger instanceof Messenger && $message = $messenger->message()) {
            $message = Message::ensure($message);
            $message->kind = 'message';
            $message->path = $this->path;
            $message->source = get_class($messenger);
            $message->name = $this->name;
            $node->message = $message;
        }
    }

    function pathsValid(array $paths)
    {
        foreach ($paths as $path) {
            if (!$this->pathValid($path)) {
                return false;
            }
        }
        return true;
    }

    function pathValid($path)
    {
        if (!$this->node) {
            return true;
        }

        $path = (array) $path;
        $cur = $this->getNode();
        foreach ($path as $p) {
            if (!isset($cur->children[$p])) {
                return true;
            }
            $cur = $cur->children[$p];
        }
        return $cur->treeValid();
    }
}


text:
//Write a program that reads a list of words, separated by spaces and prints the list in an alphabetical order

namespace OrderWords
{
    using System;
    using System.Linq;
    class OrderWords
    {
        static void Main(string[] args)
        {
            //Nulla vel magna sit amet dui lobortis commodo vitae nulla amet ante hendrerit tempus Cras molestie risus a enim convallis vitae luctus libero lacinia Suspendisse potenti Donec et nisi dictum felis sollicitudin congue Duis sagittis est amet gravida
            Console.Write("Enter some words, separated by a space: ");
            var words = Console.ReadLine()
                .ToUpperInvariant()
                .Split(new char[] { ',', ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries)
                .ToList();

            words = words
                .Distinct()
                .ToList();

            words = words.OrderBy(x => x).ToList();

            foreach (var word in words)
            {
                Console.WriteLine(word);
            }
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Linq;
using System.Web.Mvc;
using Adxstudio.Xrm.Cms;
using Adxstudio.Xrm.Core.Flighting;
using Adxstudio.Xrm.Data;
using Adxstudio.Xrm.Issues;
using Adxstudio.Xrm.Resources;
using Adxstudio.Xrm.Web.Mvc;
using Microsoft.Xrm.Client;
using Microsoft.Xrm.Client.Security;
using Microsoft.Xrm.Portal.Configuration;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Client;
using Site.Areas.Issues.ViewModels;
using OrganizationServiceContextExtensions = Adxstudio.Xrm.Cms.OrganizationServiceContextExtensions;

namespace Site.Areas.Issues.Controllers
{
	[PortalView, PortalSecurity]
	public class IssuesController : Controller
	{
		private const string PageNotFoundSiteMarker = "Page Not Found";

		// GET: /issues/{issueForumPartialUrl}/{issuePartialUrl}
		[HttpGet]
		public ActionResult Issues(string issueForumPartialUrl, string issuePartialUrl, int? page)
		{
			var context = PortalCrmConfigurationManager.CreateServiceContext();

			if (string.IsNullOrWhiteSpace(issueForumPartialUrl))
			{
				return GetIssuesViewOrRedirectToOnlyIssueForum();
			}

			var issueForum = GetIssueForum(issueForumPartialUrl, context);

			if (issueForum == null || !Authorized(context, issueForum))
			{
				return RedirectToPageNotFound();
			}

			if (string.IsNullOrWhiteSpace(issuePartialUrl))
			{
				return GetIssueForumView(issueForum, page);
			}

			var issue = GetIssue(issuePartialUrl, issueForum, context);

			if (issue == null)
			{
				return RedirectToPageNotFound();
			}

			return GetIssueView(issueForum, issue, page);
		}

		// GET: /issues/{issueForumPartialUrl}/filter/{filter}/{status}/{priority}
		[HttpGet]
		public ActionResult Filter(string issueForumPartialUrl, string filter, string status, string priority, int? page)
		{
			var context = PortalCrmConfigurationManager.CreateServiceContext();

			if (string.IsNullOrWhiteSpace(issueForumPartialUrl))
			{
				return RedirectToAction("Issues");
			}

			var issueForum = GetIssueForum(issueForumPartialUrl, context);

			if (issueForum == null || !Authorized(context, issueForum))
			{
				return RedirectToAction("Issues");
			}

			return GetIssueForumView(issueForum, page, filter, status, priority);
		}

		private static bool Authorized(OrganizationServiceContext context, Entity entity)
		{
			var securityProvider = PortalCrmConfigurationManager.CreateCrmEntitySecurityProvider();

			return securityProvider.TryAssert(context, entity, CrmEntityRight.Read);
		}

		private static Entity GetIssue(string issuePartialUrl, Entity issueForum, OrganizationServiceContext context)
		{
			var issue = context.CreateQuery("adx_issue")
				.FirstOrDefault(adxIssue => adxIssue.GetAttributeValue<EntityReference>("adx_issueforumid") == issueForum.ToEntityReference()
					&& adxIssue.GetAttributeValue<string>("adx_partialurl") == issuePartialUrl
					&& adxIssue.GetAttributeValue<bool?>("adx_approved").GetValueOrDefault(false)
					&& adxIssue.GetAttributeValue<OptionSetValue>("statecode") != null && adxIssue.GetAttributeValue<OptionSetValue>("statecode").Value == 0);

			return issue;
		}

		private static Entity GetIssueForum(string issueForumPartialUrl, OrganizationServiceContext context)
		{
			var website = PortalCrmConfigurationManager.CreatePortalContext().Website;

			var issueForum = context.CreateQuery("adx_issueforum")
				.FirstOrDefault(forum => forum.GetAttributeValue<EntityReference>("adx_websiteid") == website.ToEntityReference()
					&& forum.GetAttributeValue<string>("adx_partialurl") == issueForumPartialUrl
					&& forum.GetAttributeValue<OptionSetValue>("statecode") != null && forum.GetAttributeValue<OptionSetValue>("statecode").Value == 0);

			return issueForum;
		}

		private ActionResult GetIssueForumView(Entity issueForum, int? page, string filter = "open", string status = "all", string priority = null)
		{
			IssuePriority issuePriority;

			var issueForumDataAdapter = new IssueForumDataAdapter(issueForum);

			if (status == "all" && string.Equals(filter, "open", StringComparison.InvariantCultureIgnoreCase))
			{
				issueForumDataAdapter.Status = new []
				{
					(int)IssueStatus.NewOrUnconfirmed,
					(int)IssueStatus.Confirmed,
					(int)IssueStatus.WorkaroundAvailable,
				};
			}
			else if (status == "all" && string.Equals(filter, "closed", StringComparison.InvariantCultureIgnoreCase))
			{
				issueForumDataAdapter.Status = new []
				{
					(int)IssueStatus.Resolved,
					(int)IssueStatus.WillNotFix,
					(int)IssueStatus.ByDesign,
					(int)IssueStatus.UnableToReproduce,
				};
			}
			else
			{
				var statusWithoutHyphens = status.Replace("-", string.Empty);

				IssueStatus issueStatus;

				if (Enum.TryParse(statusWithoutHyphens, true, out issueStatus))
				{
					issueForumDataAdapter.Status = new[] { (int)issueStatus };
				}
			}

			issueForumDataAdapter.Priority = Enum.TryParse(priority, true, out issuePriority) ? (int)issuePriority : (int?)null;

			var issueForumViewModel = new IssueForumViewModel
			{
				IssueForum = issueForumDataAdapter.Select(),
				Issues = new PaginatedList<IIssue>(page, issueForumDataAdapter.SelectIssueCount(), issueForumDataAdapter.SelectIssues)
			};

			return View("IssueForum", issueForumViewModel);
		}

		private ActionResult GetIssuesViewOrRedirectToOnlyIssueForum()
		{
			var websiteDataAdapter = new WebsiteDataAdapter();

			var issueForums = websiteDataAdapter.SelectIssueForums().ToArray();

			var issueForumCount = websiteDataAdapter.SelectIssueForumCount();

			if (issueForums.Count() == 1)
			{
				return RedirectToAction("Issues", new { issueForumPartialUrl = issueForums.First().PartialUrl });
			}

			var issuesViewModel = new IssuesViewModel
			{
				IssueForums = issueForums,
				IssueForumCount = issueForumCount
			};

			return View("Issues", issuesViewModel);
		}

		private ActionResult GetIssueView(Entity adxIssueForum, Entity adxIssue, int? page)
		{
			var issueDataAdapter = new IssueDataAdapter(adxIssue) { ChronologicalComments = true };

			var issue = issueDataAdapter.Select();

			var comments = FeatureCheckHelper.IsFeatureEnabled(FeatureNames.Feedback)
				? new PaginatedList<IComment>(page, issueDataAdapter.SelectCommentCount(), issueDataAdapter.SelectComments)
				: null;

			var issueViewModel = new IssueViewModel
			{
				IssueForum = new IssueForumDataAdapter(adxIssueForum).Select(),
				Issue = issue,
				Comments = new IssueCommentsViewModel { Comments = comments, Issue = issue },
				CurrentUserHasAlert = issueDataAdapter.HasAlert()
			};

			return View("Issue", issueViewModel);
		}

		private ActionResult RedirectToPageNotFound()
		{
			var context = PortalCrmConfigurationManager.CreatePortalContext();

			var page = context.ServiceContext.GetPageBySiteMarkerName(context.Website, PageNotFoundSiteMarker);

			if (page == null)
			{
				throw new Exception("Please contact your system administrator. The required site marker {0} is missing.".FormatWith(PageNotFoundSiteMarker));
			}

			var path = OrganizationServiceContextExtensions.GetUrl(context.ServiceContext, page);

			if (path == null)
			{
				throw new Exception("Please contact your System Administrator. Unable to build URL for Site Marker {0}.".FormatWith(PageNotFoundSiteMarker));
			}

			return Redirect(path);
		}
	}
}


text:
Ext.define('MCLM.store.TrabalhoTree', {
    extend: 'Ext.data.TreeStore',
    storeId:'store.trabalhoTree',
    autoLoad : false,

    requires: [
       'MCLM.model.TrabalhoTreeModel',
    ],

	model:  'MCLM.model.TrabalhoTreeModel',

	proxy: {
        type: 'ajax',
        reader: {
            type: 'json'
        },
		extraParams: {
			cenario: MCLM.Globals.currentScenery
		},
        api: {
            read: 'getCenarioTreeNode',
            create: 'createCenarioTreeNode',
            update: 'updateCenarioTreeNode',
            destroy: 'deleteCenarioTreeNode'
        },

        writer: {
            type:'json',
            encode:true,
            rootProperty:'data',
            writeAllFields: true
        }
    },

    plugins: [{  ptype: 'treefilter', allowParentFolders: true }],

    root: {
        text: 'Cenário',
        id: 0,
        index:0,
        description : 'Raiz'
    },

	listeners: {
		beforeload : function( store, operation, options ) {
			store.proxy.extraParams.cenario = MCLM.Globals.currentScenery;
			return true;
		},
        load: function(store, records){
        	//
        	return true;
    	},
    	beforesync: function( operations ) {
    		return true;
    	}
	}
});


text:
@interface JXTabBarController : UITabBarController

@end


text:
import {ContainersAPI} from './api'
import {CommonsAPI} from '../commons/api'
import {AbstractCollection} from '../commons/AbstractCollection'
import {HeapIterator} from './HeapIterator'

import Queue = ContainersAPI.Queue
import Comparator = CommonsAPI.Comparator
import Ordering = CommonsAPI.Ordering
import CollectionIterator = CommonsAPI.CollectionIterator

/**
 * This implementation uses a binary heap. The <tt>enqueue</tt> and <tt>dequeue</tt> operations take logarithmic
 * amortized time. The <tt>peek</tt>, <tt>size</tt>, and <tt>is-empty</tt> operations take constant time. Construction
 * takes time proportional to the specified capacity or the number of items used to initialize the data structure.
 * <tt>iterator</tt> operation takes time proportional to the current size or the queue.
 *

 * For additional documentation, see Section 2.4 of
 * Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.
 * @param <E> the generic type of key on this priority queue
 */
export class PriorityQueue<E> extends AbstractCollection<E> implements Queue<E> {
    private pq: E[] = [undefined as any] // store items at indices 1 to n
    private n = 0                   // number of items on priority queue
    private inOrder: (i: number, j: number) => boolean

    /**
     * Construct priority queue.
     * @param {CommonsAPI.Comparator<E>} comparator comparator for the queue elements.
     * @param {boolean} maxPQ <tt>true</tt> if this queue should be MaxPriorityQueue, and <tt>false</tt> if this queue
     * should be MinPriorityQueue. Default value is <tt>true</tt>.
     * @param {E[]} keys elements to put in this queue. Default value is empty array.
     */
    constructor(private comparator: Comparator<E>, private maxPQ: boolean = true, keys: E[] = []) {
        super()
        this.inOrder = maxPQ ? this.lessInOrder : this.greaterInOrder
        this.n = keys.length
        keys.forEach(v => this.pq.push(v))
        for (let k = Math.floor(this.n / 2); k >= 1; k--) {
            this.sink(k)
        }
    }

    private lessInOrder: (i: number, j: number) => boolean = (i, j) => {
        return this.comparator(this.pq[i], this.pq[j]) === Ordering.LT
    }

    private greaterInOrder: (i: number, j: number) => boolean = (i, j) => {
        return this.comparator(this.pq[i], this.pq[j]) === Ordering.GT
    }

    isEmpty(): boolean {
        return this.n == 0
    }

    size(): number {
        return this.n
    }

    peek(): E {
        if (this.isEmpty()) {
            throw new Error('Queue underflow')
        }
        return this.pq[1]
    }

    enqueue(e: E): ContainersAPI.Queue<E> {
        // add x, and percolate it up to maintain heap invariant
        this.pq[++this.n] = e
        this.swim(this.n)
        return this
    }

    dequeue(): E {
        if (this.isEmpty()) {
            throw new Error('Queue underflow')
        }
        const max = this.pq[1]
        this.exch(1, this.n--)
        this.sink(1)
        this.pq.pop()     // to avoid loiterig and help with garbage collection
        return max
    }

    asCollection(): CommonsAPI.Collection<E> {
        return this
    }

    private swim(k: number): void {
        while (k > 1 && this.inOrder(Math.floor(k / 2), k)) {
            this.exch(k, Math.floor(k / 2))
            k = Math.floor(k / 2)
        }
    }

    private sink(k: number): void {
        while (2 * k <= this.n) {
            let j = 2 * k
            if (j < this.n && this.inOrder(j, j+1)) {
                j++
            }
            if (!this.inOrder(k, j)) {
                break
            }
            this.exch(k, j)
            k = j
        }
    }

    private exch(i: number, j: number): void {
        const swap = this.pq[i]
        this.pq[i] = this.pq[j]
        this.pq[j] = swap
    }

    toString(): string {
        return this.reduce((acc, e) => acc === '' ? String(e) : acc + ' ' + e, '')
    }

    iterator(): CollectionIterator<E> {
        return new HeapIterator(this.pq, this.n, new PriorityQueue(this.comparator, this.maxPQ))
    }
}


text:
package pl.jft.addressbook.model;

import com.google.gson.annotations.Expose;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamOmitField;
import org.hibernate.annotations.Type;

import javax.persistence.*;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;

@XStreamAlias("contacts")
@Entity
@Table(name = "addressbook")
public class ContactData {

  @XStreamOmitField
  @Id
  @Column(name = "id")
  private int id = Integer.MAX_VALUE;

  @Expose
  @Column(name = "firstname")
  private String firstName = "";

  @Expose
  @Column(name = "lastname")
  private String lastName = "";

  @Expose
  @Column(name = "company")
  private String company = "";

  @Expose
  @Column(name = "address")
  @Type( type = "text")
  private String address = "";

  @Expose
  @Column(name = "home")
  @Type( type = "text")
  private String homePhone = "";

  @Expose
  @Column(name = "mobile")
  @Type( type = "text")
  private String mobilePhone = "";

  @Expose
  @Column(name = "work")
  @Type( type = "text")
  private String workPhone = "";

  @Expose
  @Transient
  private String allPhones;

  @Expose
  @ManyToMany(fetch = FetchType.EAGER)
  @JoinTable(name = "address_in_groups",
          joinColumns = @JoinColumn(name = "id"), inverseJoinColumns = @JoinColumn(name = "group_id"))
  private Set<GroupData> groups = new HashSet<GroupData>();

  @Expose
  @Column(name = "email")
  @Type( type = "text")
  private String email = "";

  @Expose
  @Column(name = "email2")
  @Type( type = "text")
  private String email2 = "";

  @Expose
  @Column(name = "email3")
  @Type( type = "text")
  private String email3 = "";

  @Transient
  private String allEmails;

  @Transient
  private String contactDetails;

  @Expose
  @Column(name = "photo")
  @Type( type = "text")
  private String pathToPhoto = "";

  public int getId() {
    return id;
  }

  public String getFirstName() {
    return firstName;
  }

  public String getLastName() {
    return lastName;
  }

  public String getCompany() {
    return company;
  }

  public String getAddress() {
    return address;
  }

  public String getHomePhone() {
    return homePhone;
  }

  public String getMobilePhone() {
    return mobilePhone;
  }

  public String getWorkPhone() {
    return workPhone;
  }

  public String getAllPhones() {
    return allPhones;
  }

  public Groups getGroups() {
    return new Groups(groups);
  }

  public String getEmail() {
    return email;
  }

  public String getEmail2() {
    return email2;
  }

  public String getEmail3() {
    return email3;
  }

  public String getAllEmails() {
    return allEmails;
  }

  public String getContactDetails() {
    return contactDetails;
  }

  public String getPathToPhoto() {
    return pathToPhoto;
  }

  public ContactData withId(int id) {
    this.id = id;
    return this;
  }

  public ContactData withFirstName(String firstName) {
    this.firstName = firstName;
    return this;
  }

  public ContactData withLastName(String lastName) {
    this.lastName = lastName;
    return this;
  }

  public ContactData withCompany(String company) {
    this.company = company;
    return this;
  }

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

  public ContactData withHomePhone(String homePhone) {
    this.homePhone = homePhone;
    return this;
  }

  public ContactData withMobilePhone(String mobilePhone) {
    this.mobilePhone = mobilePhone;
    return this;
  }

  public ContactData withWorkPhone(String workPhone) {
    this.workPhone = workPhone;
    return this;
  }

  public ContactData withAllPhones(String phones) {
    this.allPhones = phones;
    return this;
  }

  public ContactData withEmail(String email) {
    this.email = email;
    return this;
  }

  public ContactData withEmail2(String email2) {
    this.email2 = email2;
    return this;
  }

  public ContactData withEmail3(String email3) {
    this.email3 = email3;
    return this;
  }

  public ContactData withAllEmails(String emails) {
    this.allEmails = emails;
    return this;
  }

  public ContactData withContactDetails(String details) {
    this.contactDetails = details;
    return this;
  }

  public ContactData withPathToPhoto(String path) {
    this.pathToPhoto = path;
    return this;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    ContactData that = (ContactData) o;
    return id == that.id &&
            Objects.equals( firstName, that.firstName ) &&
            Objects.equals( lastName, that.lastName ) &&
            Objects.equals( company, that.company ) &&
            Objects.equals( address, that.address ) &&
            Objects.equals( homePhone, that.homePhone ) &&
            Objects.equals( mobilePhone, that.mobilePhone ) &&
            Objects.equals( workPhone, that.workPhone ) &&
            Objects.equals( email, that.email ) &&
            Objects.equals( email2, that.email2 ) &&
            Objects.equals( email3, that.email3 );
  }

  @Override
  public int hashCode() {
    return Objects.hash( id, firstName, lastName, company, address, homePhone, mobilePhone, workPhone, email, email2, email3 );
  }

  @Override
  public String toString() {
    return "ContactData{" +
            "id=" + id +
            ", firstName='" + firstName + '\'' +
            ", lastName='" + lastName + '\'' +
            '}';
  }

  public ContactData inGroup(GroupData group) {
    groups.add(group);
    return this;
  }
}


text:
package org.conqat.engine.scripting;

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

import org.conqat.engine.commons.ConQATParamDoc;
import org.conqat.engine.commons.node.IConQATNode;
import org.conqat.engine.commons.node.NodeUtils;
import org.conqat.engine.commons.traversal.ETargetNodes;
import org.conqat.engine.commons.traversal.INodeVisitor;
import org.conqat.engine.commons.traversal.TraversalUtils;
import org.conqat.engine.core.core.AConQATAttribute;
import org.conqat.engine.core.core.AConQATParameter;
import org.conqat.engine.core.core.AConQATProcessor;
import org.conqat.engine.core.core.APipelineSource;
import org.conqat.engine.core.core.ConQATException;
import org.conqat.lib.commons.error.NeverThrownRuntimeException;

/**
 * A processor performing arbitrary calculations on the values stored on the
 * nodes. The error behaviour is to not create any output (i.e. write into the
 * key).
 *
 * @author Benjamin Hummel
 * @author $Author: steidl $
 * @version $Rev: 43637 $
 * @ConQAT.Rating GREEN Hash: 9D96FDC15483D9A08FAB8867B5BBEB05
 */
@AConQATProcessor(description = "This processor calculates a function on "
		+ "every node in the provided input based on a mathematical expression. "
		+ "The expression can reference the results from other processors "
		+ "using const-variables and also the value stored in the node using "
		+ "key-variables. The result of the calculation is stored in the "
		+ "provided key at each node."
		+ "If any kind of error occurs (key not found, value not numeric, "
		+ "division by zero, etc.) no value is written. "
		+ CalculatorBase.PROCESSOR_DOC)
public class NodeValueCalculator extends CalculatorBase implements
		INodeVisitor<IConQATNode, NeverThrownRuntimeException> {

	/** The node to work on. */
	private IConQATNode input;

	/** The key to store the result into. */
	private String outputKey;

	/** Key variables are a mapping from variable names to (node) keys. */
	private final Map<String, String> keyVariables = new HashMap<String, String>();

	/** The keys to be removed from the display list. */
	private final Set<String> removeKeys = new HashSet<String>();

	/** Constant variables are introduced externally. */
	private final Map<String, Double> constVariables = new HashMap<String, Double>();

	/** The nodes to work on. */
	private ETargetNodes targets = ETargetNodes.ALL;

	/** Set the input. */
	@AConQATParameter(name = ConQATParamDoc.INPUT_NAME, minOccurrences = 1, maxOccurrences = 1, description = ConQATParamDoc.INPUT_DESC)
	public void setInput(
			@APipelineSource @AConQATAttribute(name = ConQATParamDoc.INPUT_REF_NAME, description = ConQATParamDoc.INPUT_REF_DESC) IConQATNode input) {
		this.input = input;
	}

	/** Set the key used for writing. */
	@AConQATParameter(name = ConQATParamDoc.WRITEKEY_NAME, minOccurrences = 1, maxOccurrences = 1, description = ""
			+ "The key used to store the calculated result into.")
	public void setOutputKey(
			@AConQATAttribute(name = ConQATParamDoc.WRITEKEY_KEY_NAME, description = ConQATParamDoc.WRITEKEY_KEY_DESC) String key) {
		outputKey = key;
	}

	/** Set a variable that is read from a key. */
	@AConQATParameter(name = "key-variable", description = "Declare a variable "
			+ "whose value depends on the value of a key in the current node.")
	public void addKeyVariable(
			@AConQATAttribute(name = "name", description = "the name of the variable") String varName,
			@AConQATAttribute(name = "key", description = "the key used to look up the variable's value") String readKey,
			@AConQATAttribute(name = "remove", defaultValue = "true", description = ""
					+ "whether to remove this key from the display list") boolean remove) {

		keyVariables.put(varName, readKey);
		if (remove) {
			removeKeys.add(readKey);
		}
	}

	/** Set a variable to a constant value. */
	@AConQATParameter(name = "const-variable", description = "Declare a variable"
			+ "whose value is given in advance.")
	public void addConstVariable(
			@AConQATAttribute(name = "name", description = "the name of the variable") String varName,
			@AConQATAttribute(name = "value", description = "the value used for the variable") double value) {

		constVariables.put(varName, value);
	}

	/** Set the targets to use. */
	@AConQATParameter(name = "target", minOccurrences = 0, maxOccurrences = 1, description = ""
			+ "The target nodes of this processor. Default is ALL.")
	public void setTargets(
			@AConQATAttribute(name = "nodes", description = "the nodes this operation targets") ETargetNodes targets) {
		this.targets = targets;
	}

	/** {@inheritDoc} */
	@Override
	public IConQATNode process() {

		for (String name : constVariables.keySet()) {
			addBshVariable(name, constVariables.get(name));
		}

		for (String name : keyVariables.keySet()) {
			addBshVariable(name, 0);
		}

		TraversalUtils.visitDepthFirst(this, input, targets);
		updateDisplayList(input);
		return input;
	}

	/** Update the display list of the provided root node. */
	private void updateDisplayList(IConQATNode root) {
		NodeUtils.getDisplayList(root).removeKeys(removeKeys);
		NodeUtils.addToDisplayList(root, outputKey);
	}

	/** {@inheritDoc} */
	@Override
	public void visit(IConQATNode node) {

		for (String varName : keyVariables.keySet()) {
			Object o = node.getValue(keyVariables.get(varName));
			if (!(o instanceof Number)) {
				return; // ignore
			}
			addBshVariable(varName, ((Number) o).doubleValue());
		}

		try {
			node.setValue(outputKey, evaluateExpression());
		} catch (ConQATException e) {
			getLogger().warn("Had evaluation error: " + e);
		}
	}
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Ann. Rep. N. Y. St. Mus. nat. Hist. 29: 43 (1878)

#### Original name
Hygrophorus speciosus Peck

### Remarks
null


text:
package com.googlecode.jeneratedata.numbers;

import java.math.BigInteger;

import com.googlecode.jeneratedata.core.Generator;
import com.googlecode.jeneratedata.core.RandomBasedGeneratorBase;

/**
 * Generates {@link BigInteger} data items uniformly distributed over the range
 * 0 to (2^numBits - 1), inclusive using {@link BigInteger#BigInteger(int, java.util.Random)}.
 *
 * @author Agustin Barto <abarto@gmail.com>
 *
 * @see BigInteger
 */
public class BigIntegerGenerator extends RandomBasedGeneratorBase implements Generator<BigInteger> {
	/**
	 * Number of bits to be supplied to the {@link BigInteger} constructor.
	 */
	private int numBits;

	/**
	 * Constructor.
	 *
	 * @param numBits Number of bits to be supplied to the {@link BigInteger} constructor.
	 * @see BigInteger#BigInteger(int, java.util.Random)
	 */
	public BigIntegerGenerator(int numBits) {
		this.numBits = numBits;
	}

	/* (non-Javadoc)
	 * @see com.googlecode.jeneratedata.core.Generator#generate()
	 */
	@Override
	public BigInteger generate() {
		return new BigInteger(numBits, random);
	}
}


text:
<?php

namespace Mail\Message;

use Mailgun\Messages\MessageBuilder as BaseMessageBuilder;
use Zend\I18n\Translator\TranslatorInterface;
use Zend\View\Model\ViewModel;
use Zend\View\Renderer\RendererInterface;

class MessageBuilder extends BaseMessageBuilder
{
    /**
     * @var TranslatorInterface
     */
    protected $translator;
    /**
     * @var RendererInterface
     */
    protected $viewRenderer;

    public function __construct(TranslatorInterface $translator, RendererInterface $viewRenderer)
    {
        $this->translator = $translator;
        $this->viewRenderer = $viewRenderer;
    }

    public function setRenderHtmlBody(string $template, array $variables): string
    {
        $viewModel = new ViewModel($variables);
        $viewModel->setTemplate($template);
        return parent::setHtmlBody($this->viewRenderer->render($viewModel));
    }

    public function setTranslateSubject(string $message, string $domain): string
    {
        return parent::setSubject($this->translator->translate($message, $domain));
    }
}


text:
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
using System.Collections.Generic;

namespace Leap.Unity.Attributes {

  public class MinValue : CombinablePropertyAttribute, IPropertyConstrainer {
    public float minValue;

    public MinValue(float minValue) {
      this.minValue = minValue;
    }

#if UNITY_EDITOR
    public void ConstrainValue(SerializedProperty property) {
      if (property.propertyType == SerializedPropertyType.Float) {
        property.floatValue = Mathf.Max(minValue, property.floatValue);
      } else if (property.propertyType == SerializedPropertyType.Integer) {
        property.intValue = Mathf.Max((int)minValue, property.intValue);
      }
    }

    public override IEnumerable<SerializedPropertyType> SupportedTypes {
      get {
        yield return SerializedPropertyType.Integer;
        yield return SerializedPropertyType.Float;
      }
    }
#endif
  }
}


text:
<!doctype html>
<html>

<head>
  <title>MQTTLens</title>
  <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
  <script src="bower_components/webcomponentsjs/webcomponents.js"></script>
  <link rel="icon" href="icon_16.png" type="image/png" />

  <link rel="import" href="bower_components/core-icons/core-icons.html">
  <link rel="import" href="bower_components/core-icon/core-icon.html"/>
  <link rel="import" href="bower_components/mqtt-lens/mqtt-lens.html"/>

  <!--<link rel="stylesheet" href="styles/style.css"/>-->
</head>

<body unresolved>
<mqtt-lens></mqtt-lens>
</body>

</html>


text:
<?xml version="1.0" encoding="UTF-8"?>
<out> near-north near-south-west</out>


text:
MKIMAGE         := $(srctree)/scripts/mkuboot.sh

ifneq ($(MACHINE),)
include $(srctree)/$(MACHINE)/Makefile.boot
endif

# Note: the following conditions must always be true:
#   ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET)
#   PARAMS_PHYS must be within 4MB of ZRELADDR
#   INITRD_PHYS must be in RAM
ZRELADDR    := $(zreladdr-y)
PARAMS_PHYS := $(params_phys-y)
INITRD_PHYS := $(initrd_phys-y)

export ZRELADDR INITRD_PHYS PARAMS_PHYS

targets := Image zImage xipImage bootpImage uImage

ifeq ($(CONFIG_XIP_KERNEL),y)

$(obj)/xipImage: vmlinux FORCE
	$(call if_changed,objcopy)
	@echo '  Kernel: $@ is ready (physical address: $(CONFIG_XIP_PHYS_ADDR))'

$(obj)/Image $(obj)/zImage: FORCE
	@echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)'
	@echo 'Only the xipImage target is available in this case'
	@false

else

$(obj)/xipImage: FORCE
	@echo 'Kernel not configured for XIP (CONFIG_XIP_KERNEL!=y)'
	@false

$(obj)/Image: vmlinux FORCE
	$(call if_changed,objcopy)
	@echo '  Kernel: $@ is ready'

$(obj)/compressed/vmlinux: $(obj)/Image FORCE
	$(Q)$(MAKE) $(build)=$(obj)/compressed $@

$(obj)/zImage:	$(obj)/compressed/vmlinux FORCE
	$(call if_changed,objcopy)
	@echo '  Kernel: $@ is ready'

endif

# Rule to build device tree blobs
$(obj)/%.dtb: $(src)/dts/%.dts
	$(call cmd,dtc)

$(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y))

clean-files := *.dtb

quiet_cmd_uimage = UIMAGE  $@
      cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \
		   -C none -a $(LOADADDR) -e $(STARTADDR) \
		   -n 'Linux-$(KERNELRELEASE)' -d $< $@

ifeq ($(CONFIG_ZBOOT_ROM),y)
$(obj)/uImage: LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
else
$(obj)/uImage: LOADADDR=$(ZRELADDR)
endif

$(obj)/uImage: STARTADDR=$(LOADADDR)

check_for_multiple_loadaddr = \
if [ $(words $(LOADADDR)) -gt 1 ]; then \
	echo 'multiple load addresses: $(LOADADDR)'; \
	echo 'This is incompatible with uImages'; \
	echo 'Specify LOADADDR on the commandline to build an uImage'; \
	false; \
fi

$(obj)/uImage:	$(obj)/zImage FORCE
	@$(check_for_multiple_loadaddr)
	$(call if_changed,uimage)
	@echo '  Image $@ is ready'

$(obj)/bootp/bootp: $(obj)/zImage initrd FORCE
	$(Q)$(MAKE) $(build)=$(obj)/bootp $@
	@:

$(obj)/bootpImage: $(obj)/bootp/bootp FORCE
	$(call if_changed,objcopy)
	@echo '  Kernel: $@ is ready'

PHONY += initrd FORCE
initrd:
	@test "$(INITRD_PHYS)" != "" || \
	(echo This machine does not support INITRD; exit -1)
	@test "$(INITRD)" != "" || \
	(echo You must specify INITRD; exit -1)

install: $(obj)/Image
	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
	$(obj)/Image System.map "$(INSTALL_PATH)"

zinstall: $(obj)/zImage
	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
	$(obj)/zImage System.map "$(INSTALL_PATH)"

uinstall: $(obj)/uImage
	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
	$(obj)/uImage System.map "$(INSTALL_PATH)"

zi:
	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
	$(obj)/zImage System.map "$(INSTALL_PATH)"

i:
	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
	$(obj)/Image System.map "$(INSTALL_PATH)"

subdir-	    := bootp compressed


text:
package ru.doxhost.newhost.server;

import io.vertx.core.http.HttpServerResponse;
import io.vertx.ext.web.RoutingContext;

import static ru.doxhost.newhost.server.Nh2ServerUpload.allowedSizeToUpload;

/**
 * Handler if server sent error code
 * @author Eugene Kirin
 */
public class Nh2RouteFailureHandler {

    public static final int CODE_ENTITY_TOO_LARGE = 413;

    public static final int CODE_NOT_FOUND = 404;

    public static final int CODE_SERVER_ERROR = 500;

    public static final int CODE_FORBIDDEN = 403;

    private final RoutingContext routingContext;

    public Nh2RouteFailureHandler(RoutingContext routingContext) {
        this.routingContext = routingContext;
    }

    /**
     * Send error response
     */
    public void failed() {
        int statusCode = routingContext.statusCode();

        if (statusCode == CODE_ENTITY_TOO_LARGE) { //  Request Entity Too Large
            HttpServerResponse response = routingContext.response();
            response.setStatusCode(statusCode).end(
                    "You trying to send a very big file. Allow size " + allowedSizeToUpload() + ".");

            return;

        } else if (statusCode != CODE_NOT_FOUND) {
            routingContext.failure().printStackTrace();
        }

        // Status code will be 500 for the RuntimeException or 403 for the other failure
        HttpServerResponse response = routingContext.response();
        response.setStatusCode(statusCode == -1 ? CODE_SERVER_ERROR : statusCode).end("Sorry! Not today");
    }
}


text:
<?php

namespace VladimirYuldashev\LaravelQueueRabbitMQ\Console;

use Exception;
use Illuminate\Console\Command;
use Illuminate\Console\ConfirmableTrait;
use VladimirYuldashev\LaravelQueueRabbitMQ\Queue\Connectors\RabbitMQConnector;

class QueuePurgeCommand extends Command
{
    use ConfirmableTrait;

    protected $signature = 'rabbitmq:queue-purge
                           {queue}
                           {connection=rabbitmq : The name of the queue connection to use}
                           {--force : Force the operation to run when in production}';

    protected $description = 'Purge all messages in queue';

    /**
     * @param  RabbitMQConnector  $connector
     *
     * @throws Exception
     */
    public function handle(RabbitMQConnector $connector): void
    {
        if (! $this->confirmToProceed()) {
            return;
        }

        $config = $this->laravel['config']->get('queue.connections.'.$this->argument('connection'));

        $queue = $connector->connect($config);

        $queue->purge($this->argument('queue'));

        $this->info('Queue purged successfully.');
    }
}


text:
/**
 * Matter component, creates the bodies in the Matter world and links the to its entities.
 */
Crafty.c( 'Matter', ( function() {

	var _newBody = function _newBody( attr ) {

        var coords = {
            x: attr.x || 0,
            y: attr.y || 0,
            w: attr.w || 0,
            h: attr.h || 0
        };

		this.origin( ( coords.w / 2 ), ( coords.h / 2 ) );

		entities.push( this );

		var options = {};
		if ( !!attr.matter ) {
			options = attr.matter;
		}

		Common.extend(options, this._matter, true);

		if ( !!options.shape && options.shape === 'circle' ) {
			var radius = coords.w / 2;

			if ( !!attr.matter.radius ) {
				radius = attr.matter.radius;
			}

			this._body = Bodies.circle( coords.x + ( coords.w / 2 ), coords.y + ( coords.h / 2 ), radius, options );

		} else {

			this._body = Bodies.rectangle( coords.x + ( coords.w / 2 ), coords.y + ( coords.h / 2 ), coords.w, coords.h,
				options );
		}

		this._body.entity = this;

		this.matterMoved = false;

		this._debugBody = debug.generateDebugBody( this._body );

		if ( !!attr.rotation ) {
			Body.setAngle( this._body, Crafty.math.degToRad( attr.rotation ) );
		}

		World.addBody( engine.world, this._body );
	};

    return {

		init: function() {
			this._matter = {};

			this.requires( '2D' );

			this.bind( 'Change', function( attr ) {
				if ( !attr ) {
					return;
				}
				if ( attr.hasOwnProperty( 'x' ) && attr.hasOwnProperty( 'y' ) ) {
					return _newBody.call( this, attr );
				}
			}.bind( this ) );

			this.bind( 'Move', function( ) {

				if ( !this.matterMoved && typeof this._body !== 'undefined' ) {
					Body.setPosition ( this._body, {
						x: this._x + this._w / 2,
						y: this._y + this._h / 2
					} );

				} else {
					this.matterMoved = false;
				}

			}.bind( this ) );

			this.bind( 'Rotate', function( ) {

				if ( !this.matterMoved ) {

					Body.setAngle ( this._body, Crafty.math.degToRad( this.rotation ) );

				} else {
					this.matterMoved = false;
				}
			}.bind( this ) );
		},

		remove: function( ) {
	        World.remove( engine.world, this._body, true );

			if ( typeof this._debugBody !== 'undefined' ) {
				this._debugBody.destroy();
			}
	    },

    	matter: function (options) {
    		Common.extend(this._matter, options, true);

    		return this;
    	}
	};

} ) () );


text:
id: 263
title: Richard Avedon
date: 2009-01-11T19:51:53+00:00
author: A. Murat Eren
layout: post
guid: http://www.meren.org/blog/?p=263
permalink: /blog/2009/01/richard-avedon/
pvc_views:
  - "16142"
categories:
  - blogpost
  - Ben Bugün Bunu Çektim
  - Büyük Fotoğrafçılar
  - Düşünce / Yorum
  - Leziz Bağlantı İçerebilir
---
Richard Avedon 60 yıllık fotoğraf kariyerini hayatının son günlerine kadar sürdürmüş, fotoğraf dünyasının tanıdığı belki de en önemli portre fotoğrafçılarından birisi. Andy Warhol'dan Salvador Dali'ye, Marilyn Monroe'dan Dr. Robert Oppenheimer'a kadar modern çağa damgasını vurmuş simaların unutulmaz portrelerini çekmiş olan ve insanların isimleri yüzlerle ilişkilendirmesine vasıta olmuş dehşet bir insan kendisi. Dönüp dönüp fotoğraflarına bakmak büyük bir keyif.

En meşhur fotoğrafı hangisi karar vermek zor. Fakat üzerinde en çok tartışılmış fotoğraflarından birisi olan "_Dovima with Elephants_" belki de en etkileyici fotoğraflarından birisi. Dovima denen ablamız zamanının en meşhur modellerinden birisi imiş bu arada. Avedon fotoğrafını çekerken ne kadar meşhurdu bilmiyorum ama herhalde şöyle bir portre fotoğrafının ardından meşhur olmamak gibi bir alternatifi kalmamıştır (bu fotoğrafın 1955 yılında çekildiğini de hatırlatmak isterim):

 Dovima with Elephants© Richard Avedon

Gidip [web sayfası](http://www.richardavedon.com/)ndan fotoğrafladığı müzisyenlere, aktörlere, politik figürlere bir bakmanızı rica ediyorum. Dehasını ortaya koymak için beyaz bir fondan fazlasına ihtiyacı olmayan bu adamın eserlerini izlememiş olmak bence bir kayıp olurdu. Gitmişken kalp yetmezliğinden ölmezden önce üzerinde çalıştığı “_Democracy_” isimli seçkisine de göz atmak isteyebilirsiniz (adam 2004’te Obama’nın fotoğrafını çekmiş yahu). Avedon’un fotoğraflarındaki minimalizm ile ilgili kendi düşüncelerini alıntılamak istiyorum (alıntı Tutunamayanlar.net sitesinde rastladığım, Avedon ile ilgili [bir yazı](http://www.tutunamayanlar.net/detail.php?id=117)dan):

> Avedon'un hem moda hem de portre fotoğrafçısı olaral içeriksel ve biçimsel yaklaşımları önceki dönem moda-portre fotoğrafçılarından ve çağdaşlarından ayrılır. Avedon genellikle portrelerini stüdyoda beyaz fon önünde üretmektedir. Avedon bu tercihini şöyle açıklar: “Benim fotoğraf tercihim bir dizi “Hayır”a dayalıdır. Kusursuz bir ışığa hayır, kolay anlaşılan kompozisyonlara hayır, poza ya da hikayeye hayır. Bütün bu hayırlar beni evete yönlendiriyor. Beyaz bir fona sahibim. İnsana sahibim ve aramızda olan şeyle ilgileniyorum.” Avedon beyaz fon kullanarak, kendine göre kişileri mekanın karmaşıklığından soyutlayarak, sadece kendi görüntüleri, giyimleri (bazen çıplaklıklarıyla), takıları ile görüntülüyor.

Bu arada kendisinin şöyle bir sözü vardır ki, portre fotoğrafçılığı konusunda usta bir icracı olmakla kalmayıp büyük bir düşünür de olduğu konusunda ipucu verir:

> Bir portre fotoğrafçısı, çalışmasını ortaya koymak için bir başka kişiye bağımlıdır. Hayal edilmiş konu, bir anlamda “fotoğrafçının kendisi”, hakkında bir fikir sahibi olması imkansız olan bir kurgunun içerisinde yer almaya gönüllü olmuş birisinin içerisinde keşfedilmelidir.

Bendeniz için ise Richard Avedon’un en kıymetli eserleri “_In the American West_” ve “_Jacob İsrael Avedon_” isimli seçkileri içerisinde.

“[In the American West](http://www.richardavedon.com/#s=0&a=0&mi=2&pt=1&pi=10000&p=7&at=0)“, içerisinde Amerikalıların portrelerinin yer aldığı bir çalışma. Her bir portre o kadar güçlü ki hayatınız boyunca karşılaşmayacağınız insanları ebediyen hafızanıza kazıyor neredeyse. Mesela, benim menkıbem de aynını Anadolu için yapmak olsa, bitirdiğimde bu ömrü boşa geçmiş saymam.

 © Richard Avedon

“[Jacob İsrael Avedon](http://richardavedon.com/#s=0&a=0&mi=2&pt=1&pi=10000&p=8&at=0)” isimli çalışması da babasının son 7 yılında çektiği fotoğraflardan bir derleme. Hastası, hastası, hastası olmak durumu. Babayı fotoğraflamak, hem de bu kadar derinden, ne müthiş bir şeydir. [Nuri Bilge Ceylan](http://www.meren.org/blog/2008/05/nuri-bilge-ceylan-sinematografi-fotograf/)‘ın da [babasına dair bir seçki](http://www.nuribilgeceylan.com/photography/formyfather1.php?sid=1)si var, belki biliyorsunuz (muhtemelen bilmediğiniz ise Ceylan’ın fotoğrafçılıkla ilgilenen ablasının da [benzer bir çalışma](http://www.emineceylan.com/default.asp?node=Node_Images&mnu_id=2&frm_CatId=57)sı olduğu :)). Bununla beraber Avedon, bambaşka.

 © Richard Avedon

Aile fertlerinin fotoğraflanması, bunun özellikle anı fotoğrafçılığı ile ilgisi olmayan ciddi fotoğrafçılar tarafından yapılması, sonuçları çok etkileyici çalışmalar çıkartıyor bence ortaya. Karışık mevzular, ama anladınız muhtemelen. Madem mevzu buraya kadar geldi ben de kapanışı -burasının benim çöplüğüm olduğu gerçeğinden güç bularak- yukarıdaki isimlerle aynı sayfada kendi çalışmama yer verme yüzsüzlüğü yaparak gerçekleştireyim.


text:
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.components.browser_ui.site_settings;

import org.chromium.base.Callback;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.NativeMethods;
import org.chromium.components.content_settings.ContentSettingValues;
import org.chromium.components.content_settings.ContentSettingsType;
import org.chromium.components.location.LocationUtils;
import org.chromium.content_public.browser.BrowserContextHandle;
import org.chromium.url.GURL;

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

/**
 * Utility class that interacts with native to retrieve and set website settings.
 */
public class WebsitePreferenceBridge {
    public static final String SITE_WILDCARD = "*";

    /**
     * Interface for an object that listens to storage info is cleared callback.
     */
    public interface StorageInfoClearedCallback {
        @CalledByNative("StorageInfoClearedCallback")
        public void onStorageInfoCleared();
    }

    /**
     * @return the list of all origins that have permissions in non-incognito mode.
     */
    @SuppressWarnings("unchecked")
    public List<PermissionInfo> getPermissionInfo(
            BrowserContextHandle browserContextHandle, @ContentSettingsType int type) {
        ArrayList<PermissionInfo> list = new ArrayList<>();
        boolean managedOnly = false;
        // Camera, Location & Microphone can be managed by the custodian
        // of a supervised account or by enterprise policy.
        switch (type) {
            case ContentSettingsType.GEOLOCATION:
            case ContentSettingsType.MEDIASTREAM_CAMERA:
            case ContentSettingsType.MEDIASTREAM_MIC:
                managedOnly = !isContentSettingUserModifiable(browserContextHandle, type);
        }
        WebsitePreferenceBridgeJni.get().getOriginsForPermission(
                browserContextHandle, type, list, managedOnly);
        return list;
    }

    @CalledByNative
    private static void insertPermissionInfoIntoList(@ContentSettingsType int type,
            ArrayList<PermissionInfo> list, String origin, String embedder, boolean isEmbargoed) {
        if (type == ContentSettingsType.MEDIASTREAM_CAMERA
                || type == ContentSettingsType.MEDIASTREAM_MIC) {
            for (PermissionInfo info : list) {
                if (info.getOrigin().equals(origin) && info.getEmbedder().equals(embedder)) {
                    return;
                }
            }
        }
        list.add(new PermissionInfo(type, origin, embedder, isEmbargoed));
    }

    @CalledByNative
    private static void insertStorageInfoIntoList(
            ArrayList<StorageInfo> list, String host, int type, long size) {
        list.add(new StorageInfo(host, type, size));
    }

    @CalledByNative
    private static Object createStorageInfoList() {
        return new ArrayList<StorageInfo>();
    }

    @CalledByNative
    private static Object createLocalStorageInfoMap() {
        return new HashMap<String, LocalStorageInfo>();
    }

    @SuppressWarnings("unchecked")
    @CalledByNative
    private static void insertLocalStorageInfoIntoMap(
            HashMap map, String origin, long size, boolean important) {
        ((HashMap<String, LocalStorageInfo>) map)
                .put(origin, new LocalStorageInfo(origin, size, important));
    }

    public List<ContentSettingException> getContentSettingsExceptions(
            BrowserContextHandle browserContextHandle,
            @ContentSettingsType int contentSettingsType) {
        List<ContentSettingException> exceptions = new ArrayList<>();
        WebsitePreferenceBridgeJni.get().getContentSettingsExceptions(
                browserContextHandle, contentSettingsType, exceptions);
        if (!isContentSettingManaged(browserContextHandle, contentSettingsType)) {
            return exceptions;
        }

        List<ContentSettingException> managedExceptions = new ArrayList<ContentSettingException>();
        for (ContentSettingException exception : exceptions) {
            if (exception.getSource().equals("policy")) {
                managedExceptions.add(exception);
            }
        }
        return managedExceptions;
    }

    public void fetchLocalStorageInfo(BrowserContextHandle browserContextHandle,
            Callback<HashMap> callback, boolean fetchImportant) {
        WebsitePreferenceBridgeJni.get().fetchLocalStorageInfo(
                browserContextHandle, callback, fetchImportant);
    }

    public void fetchStorageInfo(
            BrowserContextHandle browserContextHandle, Callback<ArrayList> callback) {
        WebsitePreferenceBridgeJni.get().fetchStorageInfo(browserContextHandle, callback);
    }

    /**
     * Returns the list of all chosen object permissions for the given ContentSettingsType.
     *
     * There will be one ChosenObjectInfo instance for each granted permission. That means that if
     * two origin/embedder pairs have permission for the same object there will be two
     * ChosenObjectInfo instances.
     */
    public List<ChosenObjectInfo> getChosenObjectInfo(BrowserContextHandle browserContextHandle,
            @ContentSettingsType int contentSettingsType) {
        ArrayList<ChosenObjectInfo> list = new ArrayList<ChosenObjectInfo>();
        WebsitePreferenceBridgeJni.get().getChosenObjects(
                browserContextHandle, contentSettingsType, list);
        return list;
    }

    /**
     * Inserts a ChosenObjectInfo into a list.
     */
    @CalledByNative
    private static void insertChosenObjectInfoIntoList(ArrayList<ChosenObjectInfo> list,
            @ContentSettingsType int contentSettingsType, String origin, String name, String object,
            boolean isManaged) {
        list.add(new ChosenObjectInfo(contentSettingsType, origin, name, object, isManaged));
    }

    /**
     * Returns whether the DSE (Default Search Engine) origin matches the given origin.
     */
    public static boolean isDSEOrigin(BrowserContextHandle browserContextHandle, String origin) {
        return WebsitePreferenceBridgeJni.get().isDSEOrigin(browserContextHandle, origin);
    }

    /**
     * Returns whether this origin is activated for ad blocking, and will have resources blocked
     * unless they are explicitly allowed via a permission.
     */
    public static boolean getAdBlockingActivated(
            BrowserContextHandle browserContextHandle, String origin) {
        return WebsitePreferenceBridgeJni.get().getAdBlockingActivated(
                browserContextHandle, origin);
    }

    @CalledByNative
    private static void addContentSettingExceptionToList(ArrayList<ContentSettingException> list,
            @ContentSettingsType int contentSettingsType, String primaryPattern,
            String secondaryPattern, int contentSetting, String source) {
        ContentSettingException exception = new ContentSettingException(
                contentSettingsType, primaryPattern, secondaryPattern, contentSetting, source);
        list.add(exception);
    }

    /**
     * Returns whether a particular content setting type is enabled.
     * @param contentSettingsType The content setting type to check.
     */
    public static boolean isContentSettingEnabled(BrowserContextHandle browserContextHandle,
            @ContentSettingsType int contentSettingsType) {
        return WebsitePreferenceBridgeJni.get().isContentSettingEnabled(
                browserContextHandle, contentSettingsType);
    }

    /**
     * @return Whether a particular content setting type is managed by policy.
     * @param contentSettingsType The content setting type to check.
     */
    public static boolean isContentSettingManaged(BrowserContextHandle browserContextHandle,
            @ContentSettingsType int contentSettingsType) {
        return WebsitePreferenceBridgeJni.get().isContentSettingManaged(
                browserContextHandle, contentSettingsType);
    }

    /**
     * @return Whether a particular content setting type is managed by custodian.
     * @param contentSettingsType The content setting type to check.
     */
    public static boolean isContentSettingManagedByCustodian(
            BrowserContextHandle browserContextHandle,
            @ContentSettingsType int contentSettingsType) {
        return WebsitePreferenceBridgeJni.get().isContentSettingManagedByCustodian(
                browserContextHandle, contentSettingsType);
    }

    /**
     * Sets a default value for content setting type.
     * @param contentSettingsType The content setting type to check.
     * @param enabled Whether the default value should be disabled or enabled.
     */
    public static void setContentSettingEnabled(BrowserContextHandle browserContextHandle,
            @ContentSettingsType int contentSettingsType, boolean enabled) {
        WebsitePreferenceBridgeJni.get().setContentSettingEnabled(
                browserContextHandle, contentSettingsType, enabled);
    }

    /**
     * Whether the setting type requires tri-state (Allowed/Ask/Blocked) setting.
     */
    public static boolean requiresTriStateContentSetting(
            @ContentSettingsType int contentSettingsType) {
        switch (contentSettingsType) {
            case ContentSettingsType.PROTECTED_MEDIA_IDENTIFIER:
                return true;
            default:
                return false;
        }
    }

    /**
     * Whether the setting type requires four-state
     * (Allow/BlockThirdPartyIncognito/BlockThirdParty/Block) setting.
     */
    public static boolean requiresFourStateContentSetting(
            @ContentSettingsType int contentSettingsType) {
        return contentSettingsType == ContentSettingsType.COOKIES;
    }

    /**
     * Sets the preferences on whether to enable/disable given setting.
     */
    public static void setCategoryEnabled(BrowserContextHandle browserContextHandle,
            @ContentSettingsType int contentSettingsType, boolean allow) {
        assert !requiresTriStateContentSetting(contentSettingsType);
        setContentSettingEnabled(browserContextHandle, contentSettingsType, allow);
    }

    public static boolean isCategoryEnabled(BrowserContextHandle browserContextHandle,
            @ContentSettingsType int contentSettingsType) {
        assert !requiresTriStateContentSetting(contentSettingsType);
        return isContentSettingEnabled(browserContextHandle, contentSettingsType);
    }

    /**
     * Gets the default ContentSetting for a settings type. Should only be used for more
     * complex settings where a binary on/off value is not sufficient.
     * Otherwise, use isCategoryEnabled() above.
     * @param contentSettingsType The settings type to get setting for.
     * @return The ContentSetting for |contentSettingsType|.
     */
    public static int getDefaultContentSetting(BrowserContextHandle browserContextHandle,
            @ContentSettingsType int contentSettingsType) {
        return WebsitePreferenceBridgeJni.get().getDefaultContentSetting(
                browserContextHandle, contentSettingsType);
    }

    /**
     * @param setting New default ContentSetting to set for |contentSettingsType|.
     */
    public static void setDefaultContentSetting(BrowserContextHandle browserContextHandle,
            @ContentSettingsType int contentSettingsType, int setting) {
        WebsitePreferenceBridgeJni.get().setDefaultContentSetting(
                browserContextHandle, contentSettingsType, setting);
    }

    /**
     * Some Google-affiliated domains are not allowed to delete cookies for supervised accounts.
     *
     * @return Whether deleting cookies is disabled for |origin|.
     */
    public static boolean isCookieDeletionDisabled(
            BrowserContextHandle browserContextHandle, String origin) {
        return WebsitePreferenceBridgeJni.get().isCookieDeletionDisabled(
                browserContextHandle, origin);
    }

    /**
     * @return Whether geolocation information access is set to be shared with all sites, by policy.
     */
    public static boolean isLocationAllowedByPolicy(BrowserContextHandle browserContextHandle) {
        return WebsitePreferenceBridgeJni.get().getLocationAllowedByPolicy(browserContextHandle);
    }

    /**
     * @return Whether location is enabled system-wide and the Chrome location setting is enabled.
     */
    public static boolean areAllLocationSettingsEnabled(BrowserContextHandle browserContextHandle) {
        return isContentSettingEnabled(browserContextHandle, ContentSettingsType.GEOLOCATION)
                && LocationUtils.getInstance().isSystemLocationSettingEnabled();
    }

    /**
     * @return Whether the camera permission is editable by the user.
     */
    public static boolean isContentSettingUserModifiable(BrowserContextHandle browserContextHandle,
            @ContentSettingsType int contentSettingsType) {
        return WebsitePreferenceBridgeJni.get().isContentSettingUserModifiable(
                browserContextHandle, contentSettingsType);
    }

    /**
     * Returns the ContentSetting for a specific site.
     * See HostContentSettingsMap::GetContentSetting() for more details.
     */
    public static @ContentSettingValues int getContentSetting(
            BrowserContextHandle browserContextHandle, @ContentSettingsType int contentSettingType,
            GURL primaryUrl, GURL secondaryUrl) {
        return WebsitePreferenceBridgeJni.get().getContentSetting(
                browserContextHandle, contentSettingType, primaryUrl, secondaryUrl);
    }

    /**
     * Sets the content setting for the default scope of the url that is appropriate for the
     * given contentSettingType.
     * See HostContentSettingsMap::SetContentSettingDefaultScope() for more details.
     */
    public static void setContentSettingDefaultScope(BrowserContextHandle browserContextHandle,
            @ContentSettingsType int contentSettingType, GURL primaryUrl, GURL secondaryUrl,
            @ContentSettingValues int setting) {
        WebsitePreferenceBridgeJni.get().setContentSettingDefaultScope(
                browserContextHandle, contentSettingType, primaryUrl, secondaryUrl, setting);
    }
    /**
     * Sets the ContentSetting for a specific pattern combination.Unless adding a custom-scoped
     * setting, most developers will want to use setContentSettingDefaultScope()
     * instead.
     * See HostContentSettingsMap::SetContentSettingCustomScope() for more details.
     */
    public static void setContentSettingCustomScope(BrowserContextHandle browserContextHandle,
            @ContentSettingsType int contentSettingType, String primaryPattern,
            String secondaryPattern, @ContentSettingValues int setting) {
        // Currently only Cookie Settings support a non-empty, non-wildcard secondaryPattern.
        // In addition, if a Cookie Setting uses secondaryPattern, the primaryPattern must be
        // the wildcard.
        if (contentSettingType != ContentSettingsType.COOKIES) {
            assert secondaryPattern.equals(SITE_WILDCARD) || secondaryPattern.isEmpty();
        } else if (!secondaryPattern.equals(SITE_WILDCARD) && !secondaryPattern.isEmpty()) {
            assert primaryPattern.equals(SITE_WILDCARD);
        }

        WebsitePreferenceBridgeJni.get().setContentSettingCustomScope(browserContextHandle,
                contentSettingType, primaryPattern, secondaryPattern, setting);
    }

    @NativeMethods
    public interface Natives {
        boolean isNotificationEmbargoedForOrigin(
                BrowserContextHandle browserContextHandle, String origin);
        void reportNotificationRevokedForOrigin(
                BrowserContextHandle browserContextHandle, String origin, int newSettingValue);
        void clearBannerData(BrowserContextHandle browserContextHandle, String origin);
        void clearMediaLicenses(BrowserContextHandle browserContextHandle, String origin);
        void clearCookieData(BrowserContextHandle browserContextHandle, String path);
        void clearLocalStorageData(
                BrowserContextHandle browserContextHandle, String path, Object callback);
        void clearStorageData(BrowserContextHandle browserContextHandle, String origin, int type,
                Object callback);
        void getChosenObjects(BrowserContextHandle browserContextHandle,
                @ContentSettingsType int type, Object list);
        void resetNotificationsSettingsForTest(BrowserContextHandle browserContextHandle);
        void revokeObjectPermission(BrowserContextHandle browserContextHandle,
                @ContentSettingsType int type, String origin, String object);
        boolean isContentSettingsPatternValid(String pattern);
        boolean urlMatchesContentSettingsPattern(String url, String pattern);
        void fetchStorageInfo(BrowserContextHandle browserContextHandle, Object callback);
        void fetchLocalStorageInfo(BrowserContextHandle browserContextHandle, Object callback,
                boolean includeImportant);
        void getOriginsForPermission(BrowserContextHandle browserContextHandle,
                @ContentSettingsType int contentSettingsType, Object list, boolean managedOnly);
        @ContentSettingValues
        int getPermissionSettingForOrigin(BrowserContextHandle browserContextHandle,
                @ContentSettingsType int contentSettingsType, String origin, String embedder);
        void setPermissionSettingForOrigin(BrowserContextHandle browserContextHandle,
                @ContentSettingsType int contentSettingsType, String origin, String embedder,
                @ContentSettingValues int value);
        boolean isDSEOrigin(BrowserContextHandle browserContextHandle, String origin);
        boolean getAdBlockingActivated(BrowserContextHandle browserContextHandle, String origin);
        boolean isContentSettingEnabled(
                BrowserContextHandle browserContextHandle, int contentSettingType);
        boolean isContentSettingManaged(
                BrowserContextHandle browserContextHandle, int contentSettingType);
        boolean isCookieDeletionDisabled(BrowserContextHandle browserContextHandle, String origin);
        void setContentSettingEnabled(
                BrowserContextHandle browserContextHandle, int contentSettingType, boolean allow);
        void getContentSettingsExceptions(BrowserContextHandle browserContextHandle,
                @ContentSettingsType int contentSettingsType, List<ContentSettingException> list);
        @ContentSettingValues
        int getContentSetting(BrowserContextHandle browserContextHandle,
                @ContentSettingsType int contentSettingType, GURL primaryUrl, GURL secondaryUrl);
        void setContentSettingDefaultScope(BrowserContextHandle browserContextHandle,
                @ContentSettingsType int contentSettingType, GURL primaryUrl, GURL secondaryUrl,
                @ContentSettingValues int setting);
        void setContentSettingCustomScope(BrowserContextHandle browserContextHandle,
                @ContentSettingsType int contentSettingType, String primaryPattern,
                String secondaryPattern, @ContentSettingValues int setting);
        @ContentSettingValues
        int getDefaultContentSetting(BrowserContextHandle browserContextHandle,
                @ContentSettingsType int contentSettingType);
        void setDefaultContentSetting(BrowserContextHandle browserContextHandle,
                @ContentSettingsType int contentSettingType, @ContentSettingValues int setting);
        boolean isContentSettingUserModifiable(
                BrowserContextHandle browserContextHandle, int contentSettingType);
        boolean isContentSettingManagedByCustodian(
                BrowserContextHandle browserContextHandle, int contentSettingType);
        boolean getLocationAllowedByPolicy(BrowserContextHandle browserContextHandle);
    }
}


text:
set -ex

source_dir=${1}/go

testargs="-race"
case "$(uname)" in
    MINGW*)
        # -race doesn't work on windows currently
        testargs=""
        ;;
esac

if [[ "$(go env GOHOSTARCH)" = "s390x" ]]; then
    testargs="" # -race not supported on s390x
fi

# Go static check (skipped in MinGW)
if [[ -z "${MINGW_LINT}" ]]; then
    pushd ${source_dir}
    "$(go env GOPATH)"/bin/staticcheck ./...
    popd
fi

pushd ${source_dir}/arrow

TAGS="assert,test"
if [[ -n "${ARROW_GO_TESTCGO}" ]]; then
    if [[ "${MSYSTEM}" = "MINGW64" ]]; then
        export PATH=${MINGW_PREFIX}/bin:$PATH
    fi
    TAGS="${TAGS},ccalloc"
fi

# the cgo implementation of the c data interface requires the "test"
# tag in order to run its tests so that the testing functions implemented
# in .c files don't get included in non-test builds.

for d in $(go list ./... | grep -v vendor); do
    go test $testargs -tags $TAGS $d
done

popd

export PARQUET_TEST_DATA=${1}/cpp/submodules/parquet-testing/data

pushd ${source_dir}/parquet

for d in $(go list ./... | grep -v vendor); do
    go test $testargs -tags assert $d
done

popd


text:
using System;
using System.Runtime.InteropServices;

namespace SharpVk.Interop
{
    /// <summary>
    ///
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    public unsafe partial struct BufferDeviceAddressInfo
    {
        /// <summary>
        /// The type of this structure.
        /// </summary>
        public SharpVk.StructureType SType;

        /// <summary>
        /// Null or an extension-specific structure.
        /// </summary>
        public void* Next;

        /// <summary>
        /// The buffer whose address is being queried.
        /// </summary>
        public SharpVk.Interop.Buffer Buffer;
    }
}


text:
Haiku+ is full featured sample application for the Google+ Platform.

Please see https://developers.google.com/+/haikuplus/php for more information.


text:
#ifndef ZYCORE_SIGNAL_HPP
#define ZYCORE_SIGNAL_HPP

#include "zycore/Utils.hpp"

#include <map>
#include <thread>
#include <mutex>

namespace zycore
{

class SignalObject;

using SlotHandle = size_t;

// ============================================================================================== //
// Internal base classes                                                                          //
// ============================================================================================== //

namespace internal
{
    class SignalBase
    {
        friend SignalObject;
        virtual void onSlotsObjectDestroyed(SlotHandle handle) = 0;
    public:
        virtual ~SignalBase() = default;
    };

    struct SignalObjectBase
    {
        template<typename Object, typename... ArgsT>
        friend class ClassFuncConnection;

        virtual ~SignalObjectBase() = default;
        virtual void onSignalConnected(SignalBase *signal, SlotHandle handle) = 0;
        virtual void onSignalDisconnected(SignalBase *signal, SlotHandle handle) = 0;
    };
} // namespace internal

// ============================================================================================== //
// [ConnectionBase]                                                                               //
// ============================================================================================== //

/**
 * @brief   Abstract base class for connections between signals and slots.
 * @tparam  ArgsT The slot's argument types.
 */
template<typename... ArgsT>
struct ConnectionBase
{
    template<typename...>
    friend class Signal;
public: // Public interface.
    /**
     * @brief   Default constructor.
     */
    ConnectionBase() = default;

    /**
     * @brief   Destructor.
     */
    virtual ~ConnectionBase() = default;

    /**
     * @brief   Calls the connected slot.
     * @param   args The arguments.
     */
    virtual void call(ArgsT... args) const = 0;
private: // Private interface.
    /**
     * @brief   Called when connection is destroyed.
     * @param   handle  The slot handle.
     */
    virtual void onDestroy(SlotHandle handle) = 0;
};

// ============================================================================================== //
// [FuncConnection]                                                                               //
// ============================================================================================== //

/**
 * @brief   Connection between static slot and signal.
 * @tparam  ArgsT The slot's argument types.
 */
template<typename... ArgsT>
class FuncConnection
    : public ConnectionBase<ArgsT...>
{
public:
    using Function = std::function<void(ArgsT... args)>;
    /**
     * @brief   Constructor.
     * @param   func The slot to be connected.
     */
    explicit FuncConnection(Function func);
public: // Implementation of public, virtual member-functions.
    /**
     * @brief   Calls the slot.
     * @param   args  Arguments.
     */
    virtual void call(ArgsT... args) const override;
private:
    Function m_func;
private: // Implementation of private interface.
    virtual void onDestroy(SlotHandle /*handle*/) override {}
};

// ============================================================================================== //
// [LifetimedConnection]                                                                          //
// ============================================================================================== //

/**
 * @brief   Connection automatically loosened when either the signal or the lifetime-giving objects
 *          is destoyed.
 * @tparam  ArgsT   The slot's member function argument types.
 */
template<typename... ArgsT>
class LifetimedConnection
    : public ConnectionBase<ArgsT...>
    , public NonCopyable
{
public:
    using Function = std::function<void(ArgsT...)>;
private:
    Function m_func;
    internal::SignalBase* m_signal;
    internal::SignalObjectBase* m_lifetimeObject;
public: // Constructor
    /**
     * @brief   Constructor.
     * @param   obj     The object whose lifetime to bind to.
     * @param   func    The callback function.
     * @param   sig     The signal to connect to.
     * @param   handle  The slot handle.
     */
    LifetimedConnection(internal::SignalObjectBase *obj, Function func,
        internal::SignalBase* sig, SlotHandle handle);
public: // Implementation of public interface.
    void call(ArgsT... args) const override;
private: // Implementation of private interface.
    void onDestroy(SlotHandle handle) override;
};

// ============================================================================================== //
// [internal::MemberFuncBinding]                                                                  //
// ============================================================================================== //

namespace internal
{

/**
 * @brief   Binds @c this to a member-function without the need of placeholders.
 */
template<typename ObjectT, typename... ArgsT>
class MemberFuncBinding
{
    using Member = void (ObjectT::*)(ArgsT...);
    ObjectT* m_obj;
    Member m_member;
public:
    MemberFuncBinding(ObjectT* obj, Member memberFunc);
    void operator() (ArgsT... args);
};

} // namespace internal

// ============================================================================================== //
// [Signal]                                                                                //
// ============================================================================================== //

/**
 * @brief   Type and thread safe signal implementation.
 * @tparam  ArgsT The slot's argument types.
 *
 * For more information, see Signals & Slots at wikipedia:
 * http://en.wikipedia.org/wiki/Signals_and_slots
 */
template<typename... ArgsT>
class Signal
    : public internal::SignalBase
    , public NonCopyable
{
    // Typedefs and private member-variables
    using ConnectionBase = ConnectionBase<ArgsT...>;
    std::map<SlotHandle, ConnectionBase*> m_slots;
    SlotHandle m_IdCtr;
    mutable std::recursive_mutex m_mutex;
public: // Con- & Destructor.
    /**
     * @brief   Default constructor.
     */
    Signal();

    /**
     * @brief   Destructor.
     */
    virtual ~Signal();
public: // Public interface.
    /**
     * @brief   Adds a given connection to the internal list.
     * @param   connection The connection to be added. The pointer will be
     *                     stolen.
     */
    SlotHandle connect(FuncConnection<ArgsT...>* connection);

    /**
     * @brief   Connects a static slot to the signal.
     * @param   func The function/lambda to connect.
     */
    SlotHandle connect(typename FuncConnection<ArgsT...>::Function func);

    /**
     * @brief   Disconnects an existing connetion by it's handle
     * @param   handle  The connection handle.
     * @return  `true` on success, `false` if the connection didn't exist.
     */
    bool disconnect(SlotHandle handle);

    /**
     * @brief   Emits the signal and calls all connected slots.
     * @param   args  Arguments to be passed to the slots.
     */
    void emit(ArgsT... args) const;

    /**
     * @brief   Shorthand for @c emit.
     */
    void operator () (ArgsT... args) const;

    /**
     * @brief   Shorthand for @c connect.
     * @param   func  The function (slot) to connect with the signal.
     * @return  This instance.
     */
    Signal& operator += (typename FuncConnection<ArgsT...>::Function func);

    /**
     * @brief   Adds a given connection to the internal list.
     * @param   connection The connection to be added. Ownership is transfered.
     */
    template<typename Object>
    SlotHandle connect(LifetimedConnection<Object, ArgsT...>* connection)
    {
        std::lock_guard<std::recursive_mutex> lock(m_mutex);
        m_slots.emplace(m_IdCtr, connection);
        return m_IdCtr++;
    }

    /**
     * @brief   Connects a function to the signal binding the connection lifetime to a
     *          signal object.
     * @param   object The object to be connected.
     * @param	member The member function.
     *
     * The connection is automatically released as soon as either the signal or the
     * lifetime-giver is destroyed.
     */
    SlotHandle connect(SignalObject* lifetimeGiver, std::function<void(ArgsT...)> func)
    {
        std::lock_guard<std::recursive_mutex> lock(m_mutex);
        SlotHandle handle = m_IdCtr++;
        m_slots.emplace(handle, new LifetimedConnection<ArgsT...>(
            lifetimeGiver, func, this, handle));
        return handle;
    }

    /**
     * @brief   Connects a member-function slot to the signal.
     * @param   object The object to be connected.
     * @param	member The member function.
     *
     * The connection is automatically released as soon as either the signal or the object
     * with the slot is destroyed.
     */
    template<typename ObjectT>
    SlotHandle connect(ObjectT* object, void(ObjectT::*member)(ArgsT...))
    {
        static_assert(std::is_base_of<SignalObject, ObjectT>::value,
            "type has to be derived from SignalObject");
        return connect(object, internal::MemberFuncBinding<ObjectT, ArgsT...>(object, member));
    }
private: // Interface for SignalObject.
    /**
     * @brief   Callback used by slots when they are destroyed.
     */
    void onSlotsObjectDestroyed(SlotHandle handle) override;
};

// ============================================================================================== //
// Implementation of inline methods [FuncConnection]                                              //
// ============================================================================================== //

template<typename... ArgsT>
inline FuncConnection<ArgsT...>::FuncConnection(Function func)
    : m_func(func)
{}

template<typename... ArgsT>
inline void FuncConnection<ArgsT...>::call(ArgsT... args) const
{
    m_func(args...);
}

// ============================================================================================== //
// Implementation of inline methods [LifetimedConnection]                                         //
// ============================================================================================== //

template<typename... ArgsT>
inline LifetimedConnection<ArgsT...>::LifetimedConnection(internal::SignalObjectBase *lifetimeObj,
        Function func, internal::SignalBase* sig, SlotHandle handle)
    : m_func(func)
    , m_signal(sig)
    , m_lifetimeObject(lifetimeObj)
{
    lifetimeObj->onSignalConnected(sig, handle);
}

template<typename... ArgsT>
inline void LifetimedConnection<ArgsT...>::call(ArgsT... args) const
{
    m_func(args...);
}

template<typename... ArgsT>
inline void LifetimedConnection<ArgsT...>::onDestroy(SlotHandle handle)
{
    m_lifetimeObject->onSignalDisconnected(m_signal, handle);
}

// ============================================================================================== //
// Implementation of inline functions [internal::MemberFuncBinding]                               //
// ============================================================================================== //

namespace internal
{

template<typename ObjectT, typename... ArgsT>
inline MemberFuncBinding<ObjectT, ArgsT...>::MemberFuncBinding(ObjectT* obj, Member memberFunc)
    : m_obj(obj)
    , m_member(memberFunc)
{}

template<typename ObjectT, typename... ArgsT>
inline void MemberFuncBinding<ObjectT, ArgsT...>::operator() (ArgsT... args)
{
    (m_obj->*m_member)(args...);
}

} // namespace internal

// ============================================================================================== //
// Implementation of inline functions [Signal]                                                    //
// ============================================================================================== //

template<typename... ArgsT>
inline Signal<ArgsT...>::Signal()
    : m_IdCtr(1)
{}

template<typename... ArgsT>
inline Signal<ArgsT...>::~Signal()
{
    std::lock_guard<std::recursive_mutex> lock(m_mutex);
    for (auto i = m_slots.begin(); i != m_slots.end(); ++i)
    {
        i->second->onDestroy(i->first);
        delete i->second;
    }
}

template<typename... ArgsT>
inline SlotHandle Signal<ArgsT...>::connect(FuncConnection<ArgsT...>* connection)
{
    std::lock_guard<std::recursive_mutex> lock(m_mutex);
    m_slots.emplace(m_IdCtr, connection);
    return m_IdCtr++;
}

template<typename... ArgsT>
inline bool Signal<ArgsT...>::disconnect(SlotHandle handle)
{
    std::lock_guard<std::recursive_mutex> lock(m_mutex);
    auto it = m_slots.find(handle);
    if (it == m_slots.end()) return false;
    it->second->onDestroy(it->first);
    delete it->second;
    m_slots.erase(it);
    return true;
}

template<typename... ArgsT>
inline SlotHandle Signal<ArgsT...>::connect(typename FuncConnection<ArgsT...>::Function func)
{
    std::lock_guard<std::recursive_mutex> lock(m_mutex);
    auto connection = new FuncConnection<ArgsT...>(func);
    m_slots.emplace(m_IdCtr, connection);
    return m_IdCtr++;
}

template<typename... ArgsT>
inline void Signal<ArgsT...>::emit(ArgsT... args) const
{
    std::lock_guard<std::recursive_mutex> lock(m_mutex);
    for (const auto &cur : m_slots)
    {
        cur.second->call(args...);
    }
}

template<typename... ArgsT>
inline void Signal<ArgsT...>::operator()(ArgsT... args) const
{
    emit(args...);
}

template<typename... ArgsT>
inline Signal<ArgsT...>& Signal<ArgsT...>::operator += (
    typename FuncConnection<ArgsT...>::Function func)
{
    connect(func);
    return *this;
}

template<typename... ArgsT>
inline void Signal<ArgsT...>::onSlotsObjectDestroyed(SlotHandle handle)
{
    std::lock_guard<std::recursive_mutex> lock(m_mutex);
    for (auto i = m_slots.begin(); i != m_slots.end();)
    {
        if (i->first == handle)
        {
            delete i->second;
            i = m_slots.erase(i);
        }
        else
        {
            ++i;
        }
    }
}

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

} // namespace zycore

#endif // ZYCORE_SIGNAL_HPP


text:
<?php

// Uncomment this line if you must temporarily take down your site for maintenance.
// require __DIR__ . '/.maintenance.php';

$container = require __DIR__ . '/../private/app/bootstrap.php';

$container->getService('application')->run();


text:
 - Keep footprint small, essentially shebang and one line that points to the `bin/handler` that does the rest.
 - When hook script exists, amend it with the one line instead of ignoring the setup at all.
 - Add setup health check at start up.

### Check ideas:

See https://git-scm.com/docs/githooks for details.

 - Prevent rebasing (via `pre-rebase`)
 - No push to master branch (via `pre-push`)
 - Branch name pattern (via `pre-commit` and parsing git refs)
 - Limit number of files changed (via `pre-commit`)
 - Limit number of lines changed (via `pre-commit`)
 - External cmd (or script from package.json)


text:
/*
 * sequence_alignment_test.h
 *
 *  Created on: Feb 15, 2016
 *      Author: isovic
 */

#ifndef CODEBASE_SEQLIB_SRC_SEQUENCES_SEQUENCE_TEST_H_
#define CODEBASE_SEQLIB_SRC_SEQUENCES_SEQUENCE_TEST_H_

void TEST_CLASS_SEQUENCE_ALIGNMENT();

#endif /* CODEBASE_SEQLIB_SRC_SEQUENCES_SEQUENCE_TEST_H_ */


text:
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.chrome.browser.suggestions.tile;

import android.app.Activity;
import android.content.res.Configuration;
import android.view.ViewGroup;

import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher;
import org.chromium.chrome.browser.lifecycle.ConfigurationChangedObserver;
import org.chromium.chrome.browser.native_page.ContextMenuManager;
import org.chromium.chrome.browser.offlinepages.OfflinePageBridge;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.suggestions.SuggestionsConfig;
import org.chromium.chrome.browser.suggestions.SuggestionsDependencyFactory;
import org.chromium.chrome.browser.suggestions.SuggestionsUiDelegate;
import org.chromium.chrome.browser.tasks.ReturnToChromeExperimentsUtil;
import org.chromium.chrome.browser.tasks.tab_management.TabUiFeatureUtilities;
import org.chromium.chrome.browser.ui.native_page.TouchEnabledDelegate;
import org.chromium.components.browser_ui.widget.displaystyle.UiConfig;
import org.chromium.ui.base.DeviceFormFactor;
import org.chromium.ui.base.WindowAndroid;
import org.chromium.ui.modelutil.PropertyModel;
import org.chromium.ui.modelutil.PropertyModelChangeProcessor;

/**
 * Coordinator for displaying a list of {@link SuggestionsTileView} in a {@link ViewGroup}.
 */
public class MostVisitedListCoordinator implements ConfigurationChangedObserver {
    private static final int TITLE_LINES = 1;
    public static final String CONTEXT_MENU_USER_ACTION_PREFIX = "Suggestions";

    private final Activity mActivity;
    private final ActivityLifecycleDispatcher mActivityLifecycleDispatcher;
    private final MostVisitedListMediator mMediator;
    private final WindowAndroid mWindowAndroid;
    private final MvTilesLayout mMvTilesLayout;
    private final UiConfig mUiConfig;
    private final PropertyModelChangeProcessor mModelChangeProcessor;
    private TileRenderer mRenderer;
    private ContextMenuManager mContextMenuManager;
    private OfflinePageBridge mOfflinePageBridge;

    /**
     * @param activity The app activity.
     * @param activityLifecycleDispatcher Dispatcher for activity lifecycle events,
     *                                    e.g.configuration changes. We need this to adjust the
     *                                    paddings and margins of the tile views.
     * @param mvTilesLayout The view of most visisted tiles layout.
     * @param windowAndroid The current {@link WindowAndroid}
     * @param parentViewLeftAndRightPaddings The margins of the parent view. We need this to adjust
     *                                       the paddings and margins of the tile views.
     */
    public MostVisitedListCoordinator(Activity activity,
            ActivityLifecycleDispatcher activityLifecycleDispatcher, MvTilesLayout mvTilesLayout,
            WindowAndroid windowAndroid, int parentViewLeftAndRightPaddings) {
        mActivity = activity;
        mActivityLifecycleDispatcher = activityLifecycleDispatcher;
        mWindowAndroid = windowAndroid;
        mMvTilesLayout = mvTilesLayout;
        mUiConfig = new UiConfig(mMvTilesLayout);

        PropertyModel propertyModel = new PropertyModel(MostVisitedListProperties.ALL_KEYS);
        mModelChangeProcessor = PropertyModelChangeProcessor.create(
                propertyModel, mMvTilesLayout, MostVisitedListViewBinder::bind);

        mRenderer =
                new TileRenderer(mActivity, SuggestionsConfig.TileStyle.MODERN, TITLE_LINES, null);

        boolean shouldShowPlaceholderPreNative =
                ReturnToChromeExperimentsUtil.isStartSurfaceEnabled(mActivity)
                && TabUiFeatureUtilities.supportInstantStart(
                        DeviceFormFactor.isNonMultiDisplayContextOnTablet(mActivity), mActivity);
        boolean isTablet = DeviceFormFactor.isNonMultiDisplayContextOnTablet(mActivity);
        ;
        mMediator = new MostVisitedListMediator(activity.getResources(), mvTilesLayout, mRenderer,
                propertyModel, shouldShowPlaceholderPreNative, parentViewLeftAndRightPaddings,
                isTablet);
    }

    /**
     * Called before the TasksSurface is showing to initialize MV tiles.
     * {@link MostVisitedListCoordinator#destroyMVTiles()} is called after the TasksSurface hides.
     *
     * @param suggestionsUiDelegate The UI delegate of suggestion surface.
     * @param tileGroupDelegate The delegate of tile group.
     * @param touchEnabledDelegate The {@link TouchEnabledDelegate} for handling whether touch
     *                             events are allowed.
     */
    public void initWithNative(SuggestionsUiDelegate suggestionsUiDelegate,
            TileGroup.Delegate tileGroupDelegate, TouchEnabledDelegate touchEnabledDelegate) {
        mActivityLifecycleDispatcher.register(this);
        Profile profile = Profile.getLastUsedRegularProfile();
        if (mRenderer == null) {
            mRenderer = new TileRenderer(mActivity, SuggestionsConfig.getTileStyle(mUiConfig),
                    TITLE_LINES, suggestionsUiDelegate.getImageFetcher());
        } else {
            mRenderer.setImageFetcher(suggestionsUiDelegate.getImageFetcher());
        }

        mContextMenuManager = new ContextMenuManager(suggestionsUiDelegate.getNavigationDelegate(),
                touchEnabledDelegate, mActivity::closeContextMenu, CONTEXT_MENU_USER_ACTION_PREFIX);
        mWindowAndroid.addContextMenuCloseListener(mContextMenuManager);
        mOfflinePageBridge =
                SuggestionsDependencyFactory.getInstance().getOfflinePageBridge(profile);
        mMediator.initWithNative(suggestionsUiDelegate, mContextMenuManager, tileGroupDelegate,
                mOfflinePageBridge, mRenderer);
    }

    /** Called when the TasksSurface is hidden or NewTabPageLayout is destroyed. */
    public void destroyMVTiles() {
        if (mMvTilesLayout != null) mMvTilesLayout.destroy();
        mActivityLifecycleDispatcher.unregister(this);

        if (mOfflinePageBridge != null) mOfflinePageBridge = null;
        if (mRenderer != null) mRenderer = null;

        if (mWindowAndroid != null) {
            mWindowAndroid.removeContextMenuCloseListener(mContextMenuManager);
            mContextMenuManager = null;
        }

        if (mMediator != null) mMediator.destroy();
    }

    public boolean isMVTilesCleanedUp() {
        return mMediator.isMVTilesCleanedUp();
    }

    public void onSwitchToForeground() {
        assert !isMVTilesCleanedUp();
        mMediator.onSwitchToForeground();
    }

    /* ConfigurationChangedObserver implementation. */
    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        mMediator.onConfigurationChanged();
        mUiConfig.updateDisplayStyle();
    }
}


text:
var gulp = require('gulp'),
    sass = require('gulp-ruby-sass'),
    autoprefixer = require('gulp-autoprefixer'),
    gulpFilter = require('gulp-filter'),
    inject = require('gulp-inject'),
    runSequence = require('run-sequence');

gulp.task('express', function() {
    var express = require('express');
    var app = express();
    app.use(require('connect-livereload')({port: 35729}));
    app.use(express.static(__dirname));
    app.listen(4000, '0.0.0.0');
});

var tinylr;
gulp.task('livereload', function() {
    tinylr = require('tiny-lr')();
    tinylr.listen(35729);
});

function notifyLiveReload(event) {
    var fileName = require('path').relative(__dirname, event.path);
    tinylr.changed({
        body: {
            files: [fileName]
        }
    });
}

gulp.task('styles', function() {
    return sass('sass/*.scss', { style: 'expanded' })
        .pipe(gulp.dest('css'));
});

gulp.task('watch', function() {
    gulp.watch('sass/*.scss', ['styles']);
    gulp.watch('*.html', notifyLiveReload);
    gulp.watch('js/*.js', notifyLiveReload);
    gulp.watch('css/*.css', notifyLiveReload);
});

gulp.task('wiredep', function () {
    var wiredep = require('wiredep').stream;
    gulp.src('index.html')
        .pipe(wiredep())
        .pipe(gulp.dest(''));
});

gulp.task('inject', function() {
    var target = gulp.src('index.html');
    // It's not necessary to read the files (will speed up things), we're only after their paths:
    var sources = gulp.src(['css/*.css', 'js/*.js'], {read: false});

    return target.pipe(inject(sources))
        .pipe(gulp.dest(''));

});

gulp.task('default', function(callback) {
    runSequence('inject','wiredep', 'styles',
              ['express', 'livereload', 'watch'],
              callback);

});


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

    <item name="blue" type="color">#0000FF</item>
    <item name="purple" type="color">#800080</item>
    <item name="green" type="color">#008000</item>
    <item name="orange" type="color">#FFA500</item>
    <item name="red" type="color">#FF0000</item>
    <item name="yellow" type="color">#FFFF00</item>
    <item name="indigo" type="color">#4B0082</item>

    <integer-array name="androidcolors">
        <item>@color/blue</item>
        <item>@color/purple</item>
        <item>@color/green</item>
        <item>@color/orange</item>
        <item>@color/red</item>
        <item>@color/yellow</item>
        <item>@color/indigo</item>
    </integer-array>

</resources>


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Manajemen_user extends CI_Controller {

	public function __construct()
	{
		parent::__construct();
		$this->load->model(array(
						'model_user' => 'user',
						'model_departement'	=> 'departement'
		));

		if ($this->session->userdata('level') != 1)
		{
			redirect('auth/users');
		}
	}

	public function index()
	{
		$data['user'] = $this->user->get_all()->result();
		$this->template->admin('manajemen_user/manajemen_user','script_admin', $data);
	}

	public function add()
	{
		$this->load->helper('security');

		$this->form_validation->set_rules('name','Nama','required'); // trigger bootstrap form validation
		if($this->form_validation->run() == FALSE)
		{
			$data['departement'] = $this->departement->get_all()->result();
			$this->template->admin('manajemen_user/add_user','script_admin', $data);
		}
		else
		{
			$data = array(
				'id_departement'	=> $this->input->post('id_departement'),
				'nik'				=> $this->input->post('nik'),
				'name'				=> $this->input->post('name'),
				'username'			=> $this->input->post('username'),
				'password'			=> do_hash($this->input->post('password')),
				'level'				=> $this->input->post('level'),
				'status'			=> $this->input->post('status')
				);
			$this->user->add($data);
			$this->session->set_flashdata('add', 'User berhasil ditambah');
			redirect('admin/manajemen_user');
		}
	}

	public function update($id_user)
	{
		$this->load->helper('security');

		$this->form_validation->set_rules('name','Nama','required'); // trigger bootstrap form validation
		if($this->form_validation->run() == FALSE)
		{
			$data['departement'] = $this->departement->get_all()->result();
			$data['user'] = $this->user->get_by_id($id_user)->row();
			$this->template->admin('manajemen_user/update_user','script_admin', $data);
		}
		else
		{
			$data = array(
				'id_departement'	=> $this->input->post('id_departement'),
				'nik'				=> $this->input->post('nik'),
				'name'				=> $this->input->post('name'),
				'username'			=> $this->input->post('username'),
				'password'			=> do_hash($this->input->post('password')),
				'level'				=> $this->input->post('level'),
				'status'			=> $this->input->post('status')
				);
			$this->user->update($id_user, $data);
			$this->session->set_flashdata('update', 'User berhasil diperbaharui');
			redirect('admin/manajemen_user');
		}
	}

	public function delete($id_user)
	{
		$this->user->delete($id_user);
		$this->session->set_flashdata('delete', 'User berhasil dihapus');
		redirect('admin/manajemen_user');
	}

}

/* End of file Manajemen_user.php */
/* Location: ./application/modules/admin/controllers/Manajemen_user.php */


text:
package com.wxs.redis.services;

import com.wxs.redis.domain.User;

import java.util.List;

/**
 * @Description:
 * @Author:Wuxisnhui
 * @Date:2017/6/12 16:58
 */
public interface UserService {
	List<User> selectAll();

	User save(User user);

	List<User> selectByUsernameAndPassword(User user);

	User selectByPrimaryKey(int id);
}


text:
using PInvoke;

using SharpDX;

using System.Windows;
using System.Windows.Interop;

using D2D = SharpDX.Direct2D1;
using DXGI = SharpDX.DXGI;

namespace LifafaheqearNearkairliraywal;

public class Program
{
    [STAThread]
    public static void Main(string[] args)
    {
        Application application = new Application();
        application.Startup += (s, e) =>
        {
            application.MainWindow.Show();
        };

        Window window = new Window();
        D2DRender render = new D2DRender();
        window.Loaded += (s, e) =>
        {
            render.Init(window);
        };
        application.MainWindow=window;
        application.Run();
    }
}

class D2DRender
{
    public void Init(Window window)
    {
        var factory = new D2D.Factory();

        var pixelFormat = new D2D.PixelFormat(DXGI.Format.B8G8R8A8_UNorm, D2D.AlphaMode.Ignore);

        var renderTargetProperties = new D2D.RenderTargetProperties
        (
              // 默认的行为就是尝试使用硬件优先,否则再使用软件
              D2D.RenderTargetType.Default,
              // 像素格式,对于当前大多数显卡来说,选择 B8G8R8A8 是完全能支持的
              // 而且也方便和其他框架,如 WPF 交互
              pixelFormat,
              dpiX: 96,
              dpiY: 96,
              D2D.RenderTargetUsage.None,
              D2D.FeatureLevel.Level_DEFAULT
        );
        var hwndRenderTargetProperties = new D2D.HwndRenderTargetProperties();
        hwndRenderTargetProperties.Hwnd = new WindowInteropHelper(window).Handle;
        hwndRenderTargetProperties.PixelSize = new Size2((int) window.ActualWidth, (int) window.ActualHeight);

        var renderTarget = new D2D.WindowRenderTarget(factory, renderTargetProperties, hwndRenderTargetProperties);
    }
}